diff options
author | megamage <none@none> | 2008-11-02 00:59:44 -0500 |
---|---|---|
committer | megamage <none@none> | 2008-11-02 00:59:44 -0500 |
commit | 972e2d56e2c9139340f7f2bda31ded5e1696c70d (patch) | |
tree | 0353988b5c6b630308bf46d4835ae5390eb284bf /src/game/Object.cpp | |
parent | 1dad2c855c24591d38f78d4585c71cd5c9fc3cb3 (diff) |
[svn] Add function GameObject::CastSpell. Used for hunter's trap and so.
Use original caster instead caster to check spell hit result.
Let spell triggers have the same faction as the summoner.
Fix the bug that trigger creatures attack enemy. (no need use civilian extra flag in the future, 128 is enough)
Fix shadow step.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Object.cpp')
-rw-r--r-- | src/game/Object.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/game/Object.cpp b/src/game/Object.cpp index d7ec1c110cc..506acb6b7d8 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1483,7 +1483,11 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa ((Creature*)this)->AI()->JustSummoned(pCreature); if(pCreature->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER && pCreature->m_spells[0]) + { + if(GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) + pCreature->setFaction(((Unit*)this)->getFaction()); pCreature->CastSpell(pCreature, pCreature->m_spells[0], true, 0, 0, GetGUID()); + } //return the creature therewith the summoner has access to it return pCreature; |