Пример #1
0
 public static void ListStabledPets(Character chr, NPC stableMaster)
 {
     if (!PetMgr.CheckForStableMasterCheats(chr, stableMaster))
     {
         return;
     }
     PetHandler.SendStabledPetsList((IPacketReceiver)chr, (Unit)stableMaster, (byte)chr.StableSlotCount,
                                    chr.StabledPetRecords);
 }
Пример #2
0
        public static void DeStablePet(Character chr, NPC stableMaster, uint petNumber)
        {
            if (!PetMgr.CheckForStableMasterCheats(chr, stableMaster))
            {
                return;
            }
            PermanentPetRecord stabledPet = chr.GetStabledPet(petNumber);

            chr.DeStablePet(stabledPet);
            PetHandler.SendStableResult((IPacketReceiver)chr, StableResult.DeStableSuccess);
        }
Пример #3
0
 public static void BuyStableSlot(Character chr, NPC stableMaster)
 {
     if (!PetMgr.CheckForStableMasterCheats(chr, stableMaster))
     {
         return;
     }
     if (!chr.TryBuyStableSlot())
     {
         PetHandler.SendStableResult((IPacketReceiver)chr.Client, StableResult.NotEnoughMoney);
     }
     else
     {
         PetHandler.SendStableResult((IPacketReceiver)chr.Client, StableResult.BuySlotSuccess);
     }
 }
Пример #4
0
        public static void SwapStabledPet(Character chr, NPC stableMaster, uint petNumber)
        {
            if (!PetMgr.CheckForStableMasterCheats(chr, stableMaster))
            {
                return;
            }
            NPC activePet = chr.ActivePet;
            PermanentPetRecord stabledPet = chr.GetStabledPet(petNumber);

            if (activePet.Health == 0)
            {
                PetHandler.SendStableResult((IPacketReceiver)chr, StableResult.Fail);
            }
            else if (!chr.TrySwapStabledPet(stabledPet))
            {
                PetHandler.SendStableResult((IPacketReceiver)chr, StableResult.Fail);
            }
            else
            {
                PetHandler.SendStableResult((IPacketReceiver)chr, StableResult.DeStableSuccess);
            }
        }
Пример #5
0
        public static void StablePet(Character chr, NPC stableMaster)
        {
            if (!PetMgr.CheckForStableMasterCheats(chr, stableMaster))
            {
                return;
            }
            NPC activePet = chr.ActivePet;

            if (!chr.GodMode && activePet.Health == 0)
            {
                PetHandler.SendStableResult((IPacketReceiver)chr, StableResult.Fail);
            }
            if (chr.StabledPetRecords.Count < chr.StableSlotCount)
            {
                chr.StablePet();
                PetHandler.SendStableResult((IPacketReceiver)chr, StableResult.StableSuccess);
            }
            else
            {
                PetHandler.SendStableResult((IPacketReceiver)chr, StableResult.Fail);
            }
        }