Totem* casts.
--HG-- branch : trunk
This commit is contained in:
@@ -6966,7 +6966,7 @@ void Spell::EffectDestroyAllTotems(uint32 /*i*/)
|
||||
mana += spellInfo->manaCost;
|
||||
mana += spellInfo->ManaCostPercentage * m_caster->GetCreateMana() / 100;
|
||||
}
|
||||
((Totem*)totem)->UnSummon();
|
||||
totem->ToTotem()->UnSummon();
|
||||
}
|
||||
}
|
||||
mana = mana * damage / 100;
|
||||
@@ -7430,7 +7430,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const *
|
||||
return;
|
||||
|
||||
if (caster->isTotem())
|
||||
caster = ((Totem*)caster)->GetOwner();
|
||||
caster = caster->ToTotem()->GetOwner();
|
||||
|
||||
// in another case summon new
|
||||
uint8 level = caster->getLevel();
|
||||
|
||||
@@ -506,7 +506,7 @@ void WorldSession::HandleTotemDestroyed( WorldPacket& recvPacket)
|
||||
Creature* totem = GetPlayer()->GetMap()->GetCreature(_player->m_SummonSlot[slotId]);
|
||||
// Don't unsummon sentry totem
|
||||
if(totem && totem->isTotem() && totem->GetEntry() != SENTRY_TOTEM_ENTRY)
|
||||
((Totem*)totem)->UnSummon();
|
||||
totem->ToTotem()->UnSummon();
|
||||
}
|
||||
|
||||
void WorldSession::HandleSelfResOpcode( WorldPacket & /*recv_data*/ )
|
||||
|
||||
@@ -56,14 +56,14 @@ void TotemAI::EnterEvadeMode()
|
||||
void
|
||||
TotemAI::UpdateAI(const uint32 /*diff*/)
|
||||
{
|
||||
if (((Totem*)m_creature)->GetTotemType() != TOTEM_ACTIVE)
|
||||
if ( m_creature->ToTotem()->GetTotemType() != TOTEM_ACTIVE)
|
||||
return;
|
||||
|
||||
if (!m_creature->isAlive() || m_creature->IsNonMeleeSpellCasted(false))
|
||||
return;
|
||||
|
||||
// Search spell
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(((Totem*)m_creature)->GetSpell());
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(m_creature->ToTotem()->GetSpell());
|
||||
if (!spellInfo)
|
||||
return;
|
||||
|
||||
@@ -95,7 +95,7 @@ TotemAI::UpdateAI(const uint32 /*diff*/)
|
||||
|
||||
// attack
|
||||
m_creature->SetInFront(victim); // client change orientation by self
|
||||
m_creature->CastSpell(victim, ((Totem*)m_creature)->GetSpell(), false);
|
||||
m_creature->CastSpell(victim, m_creature->ToTotem()->GetSpell(), false);
|
||||
}
|
||||
else
|
||||
i_victimGuid = 0;
|
||||
|
||||
+3
-3
@@ -3736,8 +3736,8 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo
|
||||
// Remove totem at next update if totem looses its aura
|
||||
if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE && GetTypeId() == TYPEID_UNIT && this->ToCreature()->isTotem()&& ((TempSummon*)this)->GetSummonerGUID() == aura->GetCasterGUID())
|
||||
{
|
||||
if (((Totem*)this)->GetSpell() == aura->GetId() && ((Totem*)this)->GetTotemType() == TOTEM_PASSIVE)
|
||||
((Totem*)this)->setDeathState(JUST_DIED);
|
||||
if (this->ToTotem()->GetSpell() == aura->GetId() && this->ToTotem()->GetTotemType() == TOTEM_PASSIVE)
|
||||
this->ToTotem()->setDeathState(JUST_DIED);
|
||||
}
|
||||
|
||||
// Remove aurastates only if were not found
|
||||
@@ -9341,7 +9341,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
|
||||
else if (minion->isTotem())
|
||||
{
|
||||
// All summoned by totem minions must disappear when it is removed.
|
||||
if (const SpellEntry* spInfo = sSpellStore.LookupEntry(((Totem*)minion)->GetSpell()))
|
||||
if (const SpellEntry* spInfo = sSpellStore.LookupEntry(minion->ToTotem()->GetSpell()))
|
||||
for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (spInfo->Effect[i] != SPELL_EFFECT_SUMMON)
|
||||
|
||||
Reference in New Issue
Block a user