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:
click
2010-07-21 15:49:47 +02:00
parent 04fd9ac4ce
commit 66adaf5825
+6
View File
@@ -2002,6 +2002,12 @@ void Pet::SynchronizeLevelWithOwner()
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(owner->getLevel())/5); SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(owner->getLevel())/5);
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, GetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP)-1); 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; break;
default: default:
break; break;