aboutsummaryrefslogtreecommitdiff
path: root/src/game/Creature.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-10 20:25:47 -0600
committermegamage <none@none>2008-12-10 20:25:47 -0600
commit39083f4ff837d23cc886338fc9bc74df90fe9613 (patch)
tree5c2e0860894a6ac435f6035b9fab166a35c3d278 /src/game/Creature.cpp
parent0029017e17b9a2fded77e1680cef9dbc3aebacff (diff)
*Add function SummonTrigger and allow to override its AI.
*Remove some trigger scripts. Use default trigger AI and db data instead. *Small fix on eagle boss' electrical storm. --HG-- branch : trunk
Diffstat (limited to 'src/game/Creature.cpp')
-rw-r--r--src/game/Creature.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index 3e2a6e72dfd..3afc23c3ba4 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -347,10 +347,10 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data )
m_spells[3] = GetCreatureInfo()->spell4;
// HACK: trigger creature is always not selectable
- if(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER)
+ if(isTrigger())
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- if(isTotem() || GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER
+ if(isTotem() || isTrigger()
|| GetCreatureType() == CREATURE_TYPE_CRITTER)
SetReactState(REACT_PASSIVE);
else if(isCivilian())
@@ -563,7 +563,7 @@ void Creature::RegenerateHealth()
ModifyHealth(addvalue);
}
-bool Creature::AIM_Initialize()
+bool Creature::AIM_Initialize(CreatureAI* ai)
{
// make sure nothing can change the AI during AI update
if(m_AI_locked)
@@ -578,7 +578,7 @@ bool Creature::AIM_Initialize()
CreatureAI * oldAI = i_AI;
i_motionMaster.Initialize();
- i_AI = FactorySelector::selectAI(this);
+ i_AI = ai ? ai : FactorySelector::selectAI(this);
if (oldAI)
delete oldAI;
return true;