Instructions Jenkins Doxygen

[Fixed] pet level checks when trading and calling now correctly use the 48/1748/1
authorIvojedi <ivojedi@swgemu.com>
Fri, 6 Jun 2014 16:22:58 +0000 (09:22 -0700)
committerIvojedi <ivojedi@swgemu.com>
Fri, 6 Jun 2014 16:22:58 +0000 (09:22 -0700)
pet's adult level rather than it's current level

Change-Id: Ia0354b7077e69d1ec895248e0897a48dd89c98ae

MMOCoreORB/src/server/zone/objects/creature/Creature.idl
MMOCoreORB/src/server/zone/objects/intangible/PetControlDeviceImplementation.cpp

index b93bcb5..9d15202 100644 (file)
@@ -254,5 +254,9 @@ class Creature extends AiAgent {
 
        @dirty
        public native void sendMessage(BasePacket msg);
+
+       public int getAdultLevel() {
+               return super.npcTemplate.getLevel();
+       }
 }
 
index 0f2ba8d..936b70c 100644 (file)
@@ -106,6 +106,10 @@ void PetControlDeviceImplementation::callObject(CreatureObject* player) {
        int level = pet->getLevel();
 
        if (petType == PetManager::CREATUREPET) {
+               ManagedReference<Creature*> creaturePet = cast<Creature*>(pet.get());
+               if (creaturePet == NULL)
+                       return;
+
                bool ch = player->hasSkill("outdoors_creaturehandler_novice");
 
                if (ch) {
@@ -113,13 +117,12 @@ void PetControlDeviceImplementation::callObject(CreatureObject* player) {
                        maxLevelofPets = player->getSkillMod("tame_level");
                }
 
-               if (level > maxLevelofPets) {
+               if (creaturePet->getAdultLevel() > maxLevelofPets) {
                        player->sendSystemMessage("@pet/pet_menu:control_exceeded"); // Calling this pet would exceed your Control Level ability.
                        return;
                }
 
-               ManagedReference<Creature*> creaturePet = cast<Creature*>(pet.get());
-               if (creaturePet != NULL && creaturePet->isVicious() && (player->getSkillMod("tame_aggro") <= 0 || !ch)) {
+               if (creaturePet->isVicious() && (player->getSkillMod("tame_aggro") <= 0 || !ch)) {
                        player->sendSystemMessage("@pet/pet_menu:lack_skill"); // You lack the skill to call a pet of this type.
                        return;
                }
@@ -564,7 +567,7 @@ bool PetControlDeviceImplementation::canBeTradedTo(CreatureObject* player, Creat
                int numberStored = numberInTrade;
                int maxStoredPets = playerManager->getBaseStoredCreaturePets();
                int maxLevelofPets = 10;
-               int level = pet->getLevel();
+               int level = pet->getAdultLevel();
                bool ch = receiver->hasSkill("outdoors_creaturehandler_novice");
 
                if (ch) {