diff options
author | Kudlaty <none@none> | 2009-11-02 07:37:13 +0100 |
---|---|---|
committer | Kudlaty <none@none> | 2009-11-02 07:37:13 +0100 |
commit | d8ed6a294bf2da119e3aeca3bf3f8a977e4d5097 (patch) | |
tree | 0013cab13e1ac571a29913c3fa7bdab97252584b /src | |
parent | e2c39374dd22d4d90b3b32095756f84f187e0f98 (diff) |
Target dummies from engi, shuld not runnig with players and fighting with mobs like pets. Also they shuld despawn after 15 sec.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/scripts/world/npcs_special.cpp | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/src/bindings/scripts/scripts/world/npcs_special.cpp b/src/bindings/scripts/scripts/world/npcs_special.cpp index e93a788c9d4..96d0bce3400 100644 --- a/src/bindings/scripts/scripts/world/npcs_special.cpp +++ b/src/bindings/scripts/scripts/world/npcs_special.cpp @@ -1835,15 +1835,21 @@ CreatureAI* GetAI_npc_lightwellAI(Creature* pCreature) struct TRINITY_DLL_DECL npc_training_dummy : Scripted_NoMovementAI { - npc_training_dummy(Creature *c) : Scripted_NoMovementAI(c) {} + npc_training_dummy(Creature *c) : Scripted_NoMovementAI(c) + { + m_Entry = c->GetEntry(); + } + uint64 m_Entry; uint32 ResetTimer; + uint32 DespawnTimer; void Reset() { m_creature->SetControlled(true,UNIT_STAT_STUNNED);//disable rotate m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);//imune to knock aways like blast wave m_creature->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_STUN, true); ResetTimer = 10000; + DespawnTimer = 15000; } void DamageTaken(Unit *done_by, uint32 &damage) @@ -1852,7 +1858,11 @@ struct TRINITY_DLL_DECL npc_training_dummy : Scripted_NoMovementAI damage = 0; } - void EnterCombat(Unit *who){return;} + void EnterCombat(Unit *who) + { + if (m_Entry != 2674 && m_Entry != 2673) + return; + } void UpdateAI(const uint32 diff) { @@ -1860,12 +1870,25 @@ struct TRINITY_DLL_DECL npc_training_dummy : Scripted_NoMovementAI return; if (!m_creature->hasUnitState(UNIT_STAT_STUNNED)) m_creature->SetControlled(true,UNIT_STAT_STUNNED);//disable rotate - if (ResetTimer <= diff) + + if (m_Entry != 2674 && m_Entry != 2673) { - EnterEvadeMode(); - ResetTimer = 10000; - } else ResetTimer -= diff; - return; + if (ResetTimer <= diff) + { + EnterEvadeMode(); + ResetTimer = 10000; + } + else + ResetTimer -= diff; + return; + } + else + { + if (DespawnTimer <= diff) + m_creature->ForcedDespawn(); + else + DespawnTimer -= diff; + } } void MoveInLineOfSight(Unit *who){return;} }; |