Modify pet leveling-logic slightly, making sure it'll pass up 5 FULL levels when tamed/unstabled

+ set XP to 0 if dropped DOWN to playerlevel (antihack with no excess XP allowed, thank you!)
Disclaimer: No pets were harmed (much) during these changes - no need to call PETA!

--HG--
branch : trunk
This commit is contained in:
click
2010-07-21 17:24:51 +02:00
parent 88ab38e9c8
commit 4d09046d54

View File

@@ -2000,13 +2000,13 @@ void Pet::SynchronizeLevelWithOwner()
{
GivePetLevel(owner->getLevel());
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(owner->getLevel())/5);
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, GetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP)-1);
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
}
if (getLevel() < owner->getLevel()-5)
{
GivePetLevel(owner->getLevel()-5);
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(owner->getLevel()-5)/5);
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, GetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP)-1);
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
}
break;
default: