*Update summon system.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-06 13:34:11 -05:00
parent 5d3a64517e
commit fa1dcd16cf
9 changed files with 109 additions and 85 deletions

View File

@@ -52,9 +52,9 @@ void Totem::Update( uint32 time )
Creature::Update( time );
}
void Totem::InitSummon(uint32 duration)
void Totem::InitStats(uint32 duration)
{
Minion::InitSummon(duration);
Minion::InitStats(duration);
CreatureInfo const *cinfo = GetCreatureInfo();
if (m_owner->GetTypeId()==TYPEID_PLAYER && cinfo)
@@ -80,10 +80,6 @@ void Totem::InitSummon(uint32 duration)
sLog.outErrorDb("Totem::Summon: Missing modelid information for entry %u, team %u, totem will use default values.",GetEntry(),((Player*)m_owner)->GetTeam());
}
WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
data << GetGUID();
SendMessageToSet(&data,true);
// Get spell casted by totem
SpellEntry const * totemSpell = sSpellStore.LookupEntry(GetSpell());
if (totemSpell)
@@ -93,9 +89,6 @@ void Totem::InitSummon(uint32 duration)
m_type = TOTEM_ACTIVE;
}
if(m_type == TOTEM_PASSIVE)
CastSpell(this, GetSpell(), true);
if(GetEntry() == SENTRY_TOTEM_ENTRY)
SetReactState(REACT_AGGRESSIVE);
@@ -104,6 +97,16 @@ void Totem::InitSummon(uint32 duration)
SetLevel(m_owner->getLevel());
}
void Totem::InitSummon()
{
WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
data << GetGUID();
SendMessageToSet(&data, true);
if(m_type == TOTEM_PASSIVE)
CastSpell(this, GetSpell(), true);
}
void Totem::UnSummon()
{
SendObjectDeSpawnAnim(GetGUID());