aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author_manuel_ <none@none>2010-01-16 02:40:18 -0300
committer_manuel_ <none@none>2010-01-16 02:40:18 -0300
commitd728effd10be2998aa0ca0353c1f54f6833d6d8b (patch)
tree6a723b74bb9541f69fa1575e128a1dde51613d26 /src
parent4a1276e3d398b32f5c3bb04c2e64eb3acf3639ac (diff)
Dustwallow Marsh: Implemented basic support for quest "Cleansing Witch Hill" (11183).
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/kalimdor/dustwallow_marsh.cpp73
1 files changed, 72 insertions, 1 deletions
diff --git a/src/bindings/scripts/scripts/kalimdor/dustwallow_marsh.cpp b/src/bindings/scripts/scripts/kalimdor/dustwallow_marsh.cpp
index f2c17d464eb..7b0bd8f13d0 100644
--- a/src/bindings/scripts/scripts/kalimdor/dustwallow_marsh.cpp
+++ b/src/bindings/scripts/scripts/kalimdor/dustwallow_marsh.cpp
@@ -310,9 +310,75 @@ CreatureAI* GetAI_npc_private_hendel(Creature* pCreature)
}
/*######
-##
+## npc_zelfrax
######*/
+const Position MovePosition = {-2967.030,-3872.1799,35.620};
+
+enum eZelfrax
+{
+ SAY_ZELFRAX = -1000472,
+ SAY_ZELFRAX_2 = -1000473
+};
+
+struct TRINITY_DLL_DECL npc_zelfraxAI : public ScriptedAI
+{
+ npc_zelfraxAI(Creature* pCreature) : ScriptedAI(pCreature)
+ {
+ MoveToDock();
+ }
+
+ void AttackStart(Unit* pWho)
+ {
+ if (!pWho)
+ return;
+
+ if (m_creature->Attack(pWho, true))
+ {
+ m_creature->SetInCombatWith(pWho);
+ pWho->SetInCombatWith(m_creature);
+
+ if (IsCombatMovement())
+ m_creature->GetMotionMaster()->MoveChase(pWho);
+ }
+ }
+
+ void MovementInform(uint32 uiType, uint32 uiId)
+ {
+ if (uiType != POINT_MOTION_TYPE)
+ return;
+
+ m_creature->SetHomePosition(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation());
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ SetCombatMovement(true);
+
+ if (m_creature->isInCombat())
+ if (Unit* pUnit = m_creature->getVictim())
+ m_creature->GetMotionMaster()->MoveChase(pUnit);
+ }
+
+ void MoveToDock()
+ {
+ SetCombatMovement(false);
+ m_creature->GetMotionMaster()->MovePoint(0,MovePosition);
+ DoScriptText(SAY_ZELFRAX,m_creature);
+ DoScriptText(SAY_ZELFRAX_2,m_creature);
+ }
+
+ void UpdateAI(uint32 const uiDiff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_npc_zelfrax(Creature* pCreature)
+{
+ return new npc_zelfraxAI(pCreature);
+}
+
void AddSC_dustwallow_marsh()
{
Script *newscript;
@@ -350,5 +416,10 @@ void AddSC_dustwallow_marsh()
newscript->GetAI = &GetAI_npc_private_hendel;
newscript->pQuestAccept = &QuestAccept_npc_private_hendel;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "npc_zelfrax";
+ newscript->GetAI = &GetAI_npc_zelfrax;
+ newscript->RegisterSelf();
}