[7838] More fixes in pet's levelup spells.

* Fixed not updating levelup spells at warlock pet summon firsy time (overwriting by default original ranks in fact)
* Correctly upgrade/doungrade spell ranks in action bar.
* Fixed spell learning spam at warlock pet re-summon in some cases.

TODO: currently (before this commit and in it) PetSpellInitialize() called too oftern. Maybe possible cache update flag and do it one time somewhere in Pet::Update....
This commit is contained in:
VladimirMangos 2009-05-16 17:01:03 +04:00
parent 8cf9dc035b
commit 122c9c5785
6 changed files with 97 additions and 48 deletions

View file

@ -3259,6 +3259,7 @@ void Spell::EffectSummon(uint32 i)
spawnCreature->AIM_Initialize();
spawnCreature->InitPetCreateSpells();
spawnCreature->InitLevelupSpellsForLevel();
spawnCreature->SetHealth(spawnCreature->GetMaxHealth());
spawnCreature->SetPower(POWER_MANA, spawnCreature->GetMaxPower(POWER_MANA));
@ -4171,6 +4172,7 @@ void Spell::EffectSummonPet(uint32 i)
NewSummon->InitStatsForLevel(petlevel);
NewSummon->InitPetCreateSpells();
NewSummon->InitLevelupSpellsForLevel();
NewSummon->InitTalentForLevel();
if(NewSummon->getPetType()==SUMMON_PET)
@ -5967,6 +5969,7 @@ void Spell::EffectSummonCritter(uint32 i)
critter->AIM_Initialize();
critter->InitPetCreateSpells(); // e.g. disgusting oozeling has a create spell as critter...
//critter->InitLevelupSpellsForLevel(); // none?
critter->SelectLevel(critter->GetCreatureInfo()); // some summoned creaters have different from 1 DB data for level/hp
critter->SetUInt32Value(UNIT_NPC_FLAGS, critter->GetCreatureInfo()->npcflag);
// some mini-pets have quests