[7833] Implement levelup spells for non-hunter pets.

* Use less hacky way to prepare data in SpellMgr::LoadPetLevelupSpellMap.
* Fill data for all pet families including not hunter pets.
* Fixed bug with lost/unexpected learned spells for some hunter pet families.

Use less hackky way for
This commit is contained in:
VladimirMangos 2009-05-15 06:22:24 +04:00
parent b722e75d90
commit a1f4549862
5 changed files with 78 additions and 157 deletions

View file

@ -941,7 +941,6 @@ bool Pet::InitStatsForLevel(uint32 petlevel)
case HUNTER_PET:
{
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(petlevel)/4);
learnLevelupSpells();
//these formula may not be correct; however, it is designed to be close to what it should be
//this makes dps 0.5 of pets level
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)) );
@ -999,6 +998,9 @@ bool Pet::InitStatsForLevel(uint32 petlevel)
for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
SetModifierValue(UnitMods(UNIT_MOD_RESISTANCE_START + i), BASE_VALUE, float(createResistance[i]));
if(cinfo->family)
learnLevelupSpells();
UpdateAllStats();
SetHealth(GetMaxHealth());