mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
[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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user