[7831] Prevent have hunter pet with level greater player levels at level changes. Propertly set hunter pet xp values at level update.

This commit is contained in:
VladimirMangos 2009-05-15 04:56:56 +04:00
parent ac67ac8c28
commit e134b5383b
6 changed files with 44 additions and 8 deletions

View file

@ -1283,6 +1283,11 @@ bool ChatHandler::HandleNpcChangeLevelCommand(const char* args)
if(pCreature->isPet())
{
if(((Pet*)pCreature)->getPetType()==HUNTER_PET)
{
pCreature->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(lvl)/4);
pCreature->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
}
((Pet*)pCreature)->GivePetLevel(lvl);
}
else