[7877] Correctly set totem PvP state at loading and owner PvP state change, including GM totem case.

* Also set PvP state in proper way at pet loading if owner in PvP state.
This commit is contained in:
VladimirMangos 2009-05-23 00:30:18 +04:00
parent e0e5ed7bd8
commit bc4611e8c0
6 changed files with 42 additions and 20 deletions

View file

@ -4181,6 +4181,9 @@ void Spell::EffectSummonPet(uint32 i)
if(m_caster->GetTypeId() == TYPEID_PLAYER)
NewSummon->SetUInt32Value(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE);
if(m_caster->IsPvP())
NewSummon->SetPvP(true);
NewSummon->InitStatsForLevel(petlevel);
NewSummon->InitPetCreateSpells();
NewSummon->InitLevelupSpellsForLevel();
@ -5515,6 +5518,9 @@ void Spell::EffectSummonTotem(uint32 i)
if(m_caster->GetTypeId() == TYPEID_PLAYER)
pTotem->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE);
if(m_caster->IsPvP())
pTotem->SetPvP(true);
pTotem->Summon(m_caster);
if(slot < MAX_TOTEM && m_caster->GetTypeId() == TYPEID_PLAYER)