diff options
| author | malcromdev@gmail.com> <none@none> | 2010-04-05 11:34:30 -0230 |
|---|---|---|
| committer | malcromdev@gmail.com> <none@none> | 2010-04-05 11:34:30 -0230 |
| commit | 9629a340c6f8af87d2673ecab6c05d319aac26a5 (patch) | |
| tree | fe7767cd1b308b15550d344e36196da2beea7901 /src | |
| parent | d3e30bab724de6880d7df84b741908ae311e0631 (diff) | |
Fix script to have less calls
--HG--
branch : trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/scripts/northrend/grizzly_hills.cpp | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/scripts/northrend/grizzly_hills.cpp b/src/scripts/northrend/grizzly_hills.cpp index 0ace860bb49..438e5091d6d 100644 --- a/src/scripts/northrend/grizzly_hills.cpp +++ b/src/scripts/northrend/grizzly_hills.cpp @@ -372,7 +372,10 @@ enum eOuthouseBunny }; enum eSounds -{
SOUND_FEMALE = 12671,
SOUND_MALE = 12670
}; +{ + SOUND_FEMALE = 12671, + SOUND_MALE = 12670 +}; struct npc_outhouse_bunnyAI : public ScriptedAI { npc_outhouse_bunnyAI(Creature* pCreature) : ScriptedAI(pCreature) {} @@ -427,15 +430,25 @@ struct npc_tallhorn_stagAI : public ScriptedAI { npc_tallhorn_stagAI(Creature* pCreature) : ScriptedAI(pCreature) {} + uint8 m_uiPhase; + + void Reset() + { + m_uiPhase = 1; + } + void UpdateAI(const uint32 uiDiff) { - // call this each update tick? - if (GameObject* haunch = me->FindNearestGameObject(OBJECT_HAUNCH, 2.0f)) - { - me->SetStandState(UNIT_STAND_STATE_DEAD); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); - } + if (m_uiPhase = 1) + { + if (GameObject* haunch = me->FindNearestGameObject(OBJECT_HAUNCH, 2.0f)) + { + me->SetStandState(UNIT_STAND_STATE_DEAD); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); + } + m_uiPhase = 0; + } } }; |
