mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
Packet fixes, pet spells
This commit is contained in:
parent
e5a597ea9f
commit
b2d24ba0f7
18 changed files with 262 additions and 30 deletions
|
|
@ -904,7 +904,7 @@ bool Pet::InitStatsForLevel(uint32 petlevel)
|
|||
case HUNTER_PET:
|
||||
{
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32((MaNGOS::XP::xp_to_level(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)) );
|
||||
|
|
@ -1331,6 +1331,21 @@ bool Pet::learnSpell(uint16 spell_id)
|
|||
return true;
|
||||
}
|
||||
|
||||
void Pet::learnLevelupSpells()
|
||||
{
|
||||
PetLevelupSpellList const *levelupSpells = spellmgr.GetPetLevelupSpellList(GetCreatureInfo()->family);
|
||||
if(!levelupSpells)
|
||||
return;
|
||||
|
||||
for(PetLevelupSpellList::const_iterator itr = levelupSpells->begin(); itr != levelupSpells->end(); ++itr)
|
||||
{
|
||||
if(itr->ReqLevel <= getLevel())
|
||||
learnSpell(itr->SpellId);
|
||||
else
|
||||
removeSpell(itr->SpellId);
|
||||
}
|
||||
}
|
||||
|
||||
void Pet::removeSpell(uint16 spell_id)
|
||||
{
|
||||
PetSpellMap::iterator itr = m_spells.find(spell_id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue