Fix: Make stabled pets follow official regulations for levelling when taken out of stabled mode:
If the pet is more than five levels below the hunter, then as soon as it's removed from the stable it will level up to be exactly five levels below the hunter. --HG-- branch : trunk
This commit is contained in:
@@ -2002,6 +2002,12 @@ void Pet::SynchronizeLevelWithOwner()
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(owner->getLevel())/5);
|
||||
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, GetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP)-1);
|
||||
}
|
||||
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);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user