Exemple #1
0
        public void RemovePartnerBuffs(ClientSession session, MateType mateType)
        {
            if (session == null || mateType == MateType.Pet)
            {
                return;
            }

            foreach (var val in PartnerSpBuffs)
            {
                session.Character.RemoveBuff(val, true);
            }
        }
Exemple #2
0
        public void RemovePetBuffs(ClientSession session, MateType mateType)
        {
            if (session == null || mateType == MateType.Partner)
            {
                return;
            }

            foreach (Buff mateBuff in session.Character.Buff.Where(b =>
                                                                   MateBuffs.Values.Any(v => v == b.Card.CardId)))
            {
                session.Character.RemoveBuff(mateBuff.Card.CardId, true);
            }

            session.SendPacket(session.Character.GeneratePetSkill());
        }
        private void AddMate(ClientSession session, short vnum, byte level, MateType mateType)
        {
            NpcMonster mateNpc = ServerManager.GetNpcMonster(vnum);

            if (session.CurrentMapInstance == session.Character.Miniland && mateNpc != null)
            {
                level = level == 0 ? (byte)1 : level;
                Mate mate = new Mate(session.Character, mateNpc, level, mateType);
                session.Character.AddPet(mate);
            }
            else
            {
                session.SendPacket(
                    UserInterfaceHelper.GenerateMsg(Language.Instance.GetMessageFromKey("NOT_IN_MINILAND"), 0));
            }
        }
Exemple #4
0
 public Mate(Character owner, NpcMonster npcMonster, byte level, MateType mateType) : this()
 {
     NpcMonsterVNum = npcMonster.NpcMonsterVNum;
     Monster        = npcMonster;
     Level          = level;
     Hp             = MaxHp;
     Mp             = MaxMp;
     Name           = npcMonster.Name;
     MateType       = mateType;
     Loyalty        = 1000;
     PositionY      = MapX = (short)(owner.PositionY + 1);
     PositionX      = MapY = (short)(owner.PositionX + 1);
     Direction      = 2;
     CharacterId    = owner.CharacterId;
     Owner          = owner;
 }
Exemple #5
0
 public Mate(Character owner, short VNum, byte level, MateType matetype)
 {
     NpcMonsterVNum = VNum;
     Monster        = ServerManager.Instance.GetNpc(VNum);
     Hp             = Monster.MaxHP;
     Mp             = Monster.MaxMP;
     Name           = Monster.Name;
     MateType       = matetype;
     Level          = level;
     Loyalty        = 1000;
     PositionY      = (short)(owner.PositionY + 1);
     PositionX      = (short)(owner.PositionX + 1);
     MapX           = (short)(owner.PositionX + 1);
     MapY           = (short)(owner.PositionY + 1);
     Direction      = 2;
     CharacterId    = owner.CharacterId;
     Owner          = owner;
     GeneateMateTransportId();
 }
Exemple #6
0
 public Mate(Character owner, NpcMonster npcMonster, byte level, MateType matetype)
 {
     NpcMonsterVNum = npcMonster.NpcMonsterVNum;
     Monster        = npcMonster;
     Hp             = npcMonster.MaxHP;
     Mp             = npcMonster.MaxMP;
     Name           = npcMonster.Name;
     MateType       = matetype;
     Level          = level;
     Loyalty        = 1000;
     PositionY      = (short)(owner.PositionY + 1);
     PositionX      = (short)(owner.PositionX + 1);
     MapX           = (short)(owner.PositionX + 1);
     MapY           = (short)(owner.PositionY + 1);
     Direction      = 2;
     CharacterId    = owner.CharacterId;
     Owner          = owner;
     GeneateMateTransportId();
 }
Exemple #7
0
 public Mate(Character owner, NpcMonster npcMonster, byte level, MateType matetype)
 {
     Owner          = owner;
     NpcMonsterVNum = npcMonster.NpcMonsterVNum;
     Monster        = npcMonster;
     Level          = level;
     BattleEntity   = new BattleEntity(this);
     Name           = npcMonster.Name;
     MateType       = matetype;
     Loyalty        = 1000;
     PositionY      = (short)(owner.PositionY + 1);
     PositionX      = (short)(owner.PositionX + 1);
     MapX           = (short)(owner.PositionX + 1);
     MapY           = (short)(owner.PositionY + 1);
     Direction      = 2;
     CharacterId    = owner.CharacterId;
     AddTeamMember();
     GenerateMateTransportId();
     StartLife();
 }
Exemple #8
0
 public Mate(Character owner, NpcMonster npcMonster, byte level, MateType matetype)
 {
     PveLockObject  = new object();
     Buff           = new ThreadSafeSortedList <short, Buff>();
     NpcMonsterVNum = npcMonster.NpcMonsterVNum;
     Monster        = npcMonster;
     Level          = level;
     Hp             = MaxHp;
     Mp             = MaxMp;
     Name           = npcMonster.Name;
     MateType       = matetype;
     Loyalty        = 1000;
     PositionY      = (short)(owner.PositionY + 1);
     PositionX      = (short)(owner.PositionX + 1);
     MapX           = (short)(owner.PositionX + 1);
     MapY           = (short)(owner.PositionY + 1);
     Direction      = 2;
     CharacterId    = owner.CharacterId;
     Owner          = owner;
     GenerateMateTransportId();
 }
        public void AddPetToTeam(ClientSession session, short vnum, byte level, MateType type)
        {
            Mate equipedMate = session.Character.Mates?.SingleOrDefault(s => s.IsTeamMember && s.MateType == type);

            if (equipedMate != null)
            {
                equipedMate.RemoveTeamMember();
                session.Character.MapInstance?.Broadcast(equipedMate.GenerateOut());
            }

            Mate mate = new Mate(session.Character, ServerManager.Instance.GetNpc(vnum), level, type);

            session.Character.Mates?.Add(mate);
            mate.RefreshStats();
            session.SendPacket($"ctl 2 {mate.PetId} 3");
            session.Character.MapInstance?.Broadcast(mate.GenerateIn());
            session.SendPacket(UserInterfaceHelper.Instance.GeneratePClear());
            session.SendPackets(session.Character.GenerateScN());
            session.SendPackets(session.Character.GenerateScP());
            session.SendPacket(session.Character.GeneratePinit());
            session.SendPackets(session.Character.Mates.Where(s => s.IsTeamMember).OrderBy(s => s.MateType).Select(s => s.GeneratePst()));
        }
 public static IEnumerable <IMateEntity> GetMateByPage(this IPlayerEntity player, MateType type, byte page) => player.Mates.Where(s => s.Mate.MateType == type).Skip(page * 10).Take(10);
 public static IEnumerable <IMateEntity> GetMateByMateType(this IPlayerEntity player, MateType type) => player.Mates.Where(s => s.Mate.MateType == type);