예제 #1
0
        [PacketHandler(RealmServerOpCode.BreakPetLvlLimit)]//6148
        public static void BreakPetLvlLimitRequest(IRealmClient client, RealmPacketIn packet)
        {
            var petGuid             = packet.ReadInt32(); //default : 68412Len : 4
            var itemId              = packet.ReadInt32(); //default : 37813Len : 4
            var inv2                = packet.ReadByte();  //default : 2Len : 1
            var lvlBreakItemSlot    = packet.ReadInt16(); //default : 3Len : 2
            var petLevelBreakAmount = packet.ReadInt32(); //default : -1Len : 4
            var inv20               = packet.ReadByte();  //default : 0Len : 1
            var lsuplItemSlot       = packet.ReadInt16(); //default : -1Len : 2

            if (!client.ActiveCharacter.OwnedPets.ContainsKey(petGuid))
            {
                client.ActiveCharacter.YouAreFuckingCheater("Trying to break pet lvl limit not existing pet.", 20);
                SendPetLevelLimitBreakedResponse(client, PetLimitBreakStatus.AbnormalPetInfo);
                return;
            }
            var item = client.ActiveCharacter.Asda2Inventory.GetRegularItem(lvlBreakItemSlot);

            if (item == null)
            {
                client.ActiveCharacter.YouAreFuckingCheater("Trying to break pet lvl limit with not existint break lvl item.", 10);
                SendPetLevelLimitBreakedResponse(client, PetLimitBreakStatus.PetLimitPotionInfoAbnormal);
                return;
            }
            if (item.Category != Asda2ItemCategory.PetLevelBreakPotion)
            {
                client.ActiveCharacter.YouAreFuckingCheater("Trying to resurect pet with not a resurect item.", 50);
                SendPetLevelLimitBreakedResponse(client, PetLimitBreakStatus.PetLimitPotionInfoAbnormal);
                return;
            }
            var pet = client.ActiveCharacter.OwnedPets[petGuid];

            if (item.Template.ValueOnUse != pet.Level)
            {
                client.ActiveCharacter.YouAreFuckingCheater("Trying to break pet level limit wrong level item.", 50);
                SendPetLevelLimitBreakedResponse(client, PetLimitBreakStatus.TheLevelOfLimitBreakItemIsTooLow);
                return;
            }
            if (!pet.IsMaxExpirience)
            {
                client.ActiveCharacter.YouAreFuckingCheater("Trying to break pet level limit with not 100prc exp.", 50);
                SendPetLevelLimitBreakedResponse(client, PetLimitBreakStatus.Not100PrcExp);
                return;
            }
            if (pet.Level != pet.MaxLevel)
            {
                client.ActiveCharacter.YouAreFuckingCheater("Trying to break pet level limit with not maxed level.", 50);
                SendPetLevelLimitBreakedResponse(client, PetLimitBreakStatus.TheLevelOfLimitBreakItemIsTooLow);
                return;
            }
            if (pet.Level >= 10)
            {
                client.ActiveCharacter.YouAreFuckingCheater("Trying to break pet level limit more than 10 lvl.", 50);
                SendPetLevelLimitBreakedResponse(client, PetLimitBreakStatus.MaximumBreakLvlLimitReached);
                return;
            }
            var success  = CharacterFormulas.CalcPetLevelBreakSuccess();
            var suplItem = client.ActiveCharacter.Asda2Inventory.GetShopShopItem(lsuplItemSlot);

            if (suplItem != null && suplItem.Category != Asda2ItemCategory.PetLevelProtection)
            {
                client.ActiveCharacter.YouAreFuckingCheater("Trying to break pet level limit with incorect category supl.", 50);
                SendPetLevelLimitBreakedResponse(client, PetLimitBreakStatus.MaximumBreakLvlLimitReached);
                return;
            }
            if (success)
            {
                pet.MaxLevel++;
                pet.Level++;
            }
            else
            {
                pet.RemovePrcExp(suplItem == null ? 50 : 10);
            }
            if (suplItem != null)
            {
                suplItem.ModAmount(-1);
            }
            item.ModAmount(-1);
            SendPetLevelLimitBreakedResponse(client,
                                             success ? PetLimitBreakStatus.Ok : PetLimitBreakStatus.FailedRedusedBy50,
                                             pet, item, suplItem);
        }
예제 #2
0
        public static void BreakPetLvlLimitRequest(IRealmClient client, RealmPacketIn packet)
        {
            int key = packet.ReadInt32();

            packet.ReadInt32();
            int   num1     = (int)packet.ReadByte();
            short slotInq1 = packet.ReadInt16();

            packet.ReadInt32();
            int   num2     = (int)packet.ReadByte();
            short slotInq2 = packet.ReadInt16();

            if (!client.ActiveCharacter.OwnedPets.ContainsKey(key))
            {
                client.ActiveCharacter.YouAreFuckingCheater("Trying to break pet lvl limit not existing pet.", 20);
                Asda2PetHandler.SendPetLevelLimitBreakedResponse(client, PetLimitBreakStatus.AbnormalPetInfo,
                                                                 (Asda2PetRecord)null, (Asda2Item)null, (Asda2Item)null);
            }
            else
            {
                Asda2Item regularItem = client.ActiveCharacter.Asda2Inventory.GetRegularItem(slotInq1);
                if (regularItem == null)
                {
                    client.ActiveCharacter.YouAreFuckingCheater(
                        "Trying to break pet lvl limit with not existint break lvl item.", 10);
                    Asda2PetHandler.SendPetLevelLimitBreakedResponse(client,
                                                                     PetLimitBreakStatus.PetLimitPotionInfoAbnormal, (Asda2PetRecord)null, (Asda2Item)null,
                                                                     (Asda2Item)null);
                }
                else if (regularItem.Category != Asda2ItemCategory.PetLevelBreakPotion)
                {
                    client.ActiveCharacter.YouAreFuckingCheater("Trying to resurect pet with not a resurect item.", 50);
                    Asda2PetHandler.SendPetLevelLimitBreakedResponse(client,
                                                                     PetLimitBreakStatus.PetLimitPotionInfoAbnormal, (Asda2PetRecord)null, (Asda2Item)null,
                                                                     (Asda2Item)null);
                }
                else
                {
                    Asda2PetRecord ownedPet = client.ActiveCharacter.OwnedPets[key];
                    if (regularItem.Template.ValueOnUse != (int)ownedPet.Level)
                    {
                        client.ActiveCharacter.YouAreFuckingCheater("Trying to break pet level limit wrong level item.",
                                                                    50);
                        Asda2PetHandler.SendPetLevelLimitBreakedResponse(client,
                                                                         PetLimitBreakStatus.TheLevelOfLimitBreakItemIsTooLow, (Asda2PetRecord)null,
                                                                         (Asda2Item)null, (Asda2Item)null);
                    }
                    else if (!ownedPet.IsMaxExpirience)
                    {
                        client.ActiveCharacter.YouAreFuckingCheater(
                            "Trying to break pet level limit with not 100prc exp.", 50);
                        Asda2PetHandler.SendPetLevelLimitBreakedResponse(client, PetLimitBreakStatus.Not100PrcExp,
                                                                         (Asda2PetRecord)null, (Asda2Item)null, (Asda2Item)null);
                    }
                    else if ((int)ownedPet.Level != (int)ownedPet.MaxLevel)
                    {
                        client.ActiveCharacter.YouAreFuckingCheater(
                            "Trying to break pet level limit with not maxed level.", 50);
                        Asda2PetHandler.SendPetLevelLimitBreakedResponse(client,
                                                                         PetLimitBreakStatus.TheLevelOfLimitBreakItemIsTooLow, (Asda2PetRecord)null,
                                                                         (Asda2Item)null, (Asda2Item)null);
                    }
                    else if (ownedPet.Level >= (byte)10)
                    {
                        client.ActiveCharacter.YouAreFuckingCheater("Trying to break pet level limit more than 10 lvl.",
                                                                    50);
                        Asda2PetHandler.SendPetLevelLimitBreakedResponse(client,
                                                                         PetLimitBreakStatus.MaximumBreakLvlLimitReached, (Asda2PetRecord)null, (Asda2Item)null,
                                                                         (Asda2Item)null);
                    }
                    else
                    {
                        bool      flag         = CharacterFormulas.CalcPetLevelBreakSuccess();
                        Asda2Item shopShopItem = client.ActiveCharacter.Asda2Inventory.GetShopShopItem(slotInq2);
                        if (shopShopItem != null && shopShopItem.Category != Asda2ItemCategory.PetLevelProtection)
                        {
                            client.ActiveCharacter.YouAreFuckingCheater(
                                "Trying to break pet level limit with incorect category supl.", 50);
                            Asda2PetHandler.SendPetLevelLimitBreakedResponse(client,
                                                                             PetLimitBreakStatus.MaximumBreakLvlLimitReached, (Asda2PetRecord)null,
                                                                             (Asda2Item)null, (Asda2Item)null);
                        }
                        else
                        {
                            if (flag)
                            {
                                ++ownedPet.MaxLevel;
                                ++ownedPet.Level;
                            }
                            else
                            {
                                ownedPet.RemovePrcExp(shopShopItem == null ? 50 : 10);
                            }

                            if (shopShopItem != null)
                            {
                                shopShopItem.ModAmount(-1);
                            }
                            regularItem.ModAmount(-1);
                            Asda2PetHandler.SendPetLevelLimitBreakedResponse(client,
                                                                             flag ? PetLimitBreakStatus.Ok : PetLimitBreakStatus.FailedRedusedBy50, ownedPet,
                                                                             regularItem, shopShopItem);
                        }
                    }
                }
            }
        }