*Allow totems to cast spell2 from DB instantnly when put down

--HG--
branch : trunk
This commit is contained in:
thenecromancer
2009-07-05 17:29:28 +02:00
parent 67f8ec608c
commit ea7ac26e72
3 changed files with 5 additions and 2 deletions

View File

@@ -91,6 +91,9 @@ void Totem::InitSummon()
if(m_type == TOTEM_PASSIVE)
CastSpell(this, GetSpell(), true);
// Some totems can have both instant effect and passive spell
if (GetSpell(1))
CastSpell(this, GetSpell(1), true);
}
void Totem::UnSummon()

View File

@@ -40,7 +40,7 @@ class Totem : public Minion
void InitStats(uint32 duration);
void InitSummon();
void UnSummon();
uint32 GetSpell() const { return m_spells[0]; }
uint32 GetSpell(uint8 slot=0) const { return m_spells[slot]; }
uint32 GetTotemDuration() const { return m_duration; }
TotemType GetTotemType() const { return m_type; }

View File

@@ -4213,7 +4213,7 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
Aur->_RemoveAura();
// Remove totem at next update if totem looses its aura
if (GetTypeId()==TYPEID_UNIT && ((Creature*)this)->isTotem()&& ((TempSummon*)this)->GetSummonerGUID()==Aur->GetCasterGUID())
if (Aur->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE && GetTypeId()==TYPEID_UNIT && ((Creature*)this)->isTotem()&& ((TempSummon*)this)->GetSummonerGUID()==Aur->GetCasterGUID())
{
if (((Totem*)this)->GetSpell()==Aur->GetId() && ((Totem*)this)->GetTotemType()==TOTEM_PASSIVE)
((Totem*)this)->setDeathState(JUST_DIED);