[10884] Pet with same level as owner must have xp = 0

Thanks to Click for original patch and problem description.
This commit is contained in:
VladimirMangos 2010-12-17 18:47:41 +03:00
parent 07172bc5ae
commit 8d7cc36098
3 changed files with 16 additions and 27 deletions

View file

@ -1736,14 +1736,7 @@ bool ChatHandler::HandleNpcChangeLevelCommand(char* args)
}
if (pCreature->IsPet())
{
if (((Pet*)pCreature)->getPetType()==HUNTER_PET)
{
pCreature->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForPetLevel(lvl));
pCreature->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
}
((Pet*)pCreature)->GivePetLevel(lvl);
}
else
{
pCreature->SetMaxHealth(100 + 30*lvl);