From a7832a632b79965bfa0e18686dd03ce8201c9a85 Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Thu, 23 Jul 2009 20:04:58 +0200 Subject: Script for quest 11878. Author: Drethek Missing update of *full.sql --HG-- branch : trunk --- .../scripts/zone/borean_tundra/borean_tundra.cpp | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'src') diff --git a/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp b/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp index c45ef53a81a..7a8a2de4a39 100644 --- a/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp +++ b/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp @@ -197,6 +197,40 @@ CreatureAI* GetAI_npc_sinkhole_kill_credit(Creature* pCreature) return new npc_sinkhole_kill_creditAI(pCreature); } +/*###### +## npc_khunok_the_behemoth +######*/ + +struct TRINITY_DLL_DECL npc_khunok_the_behemothAI : public ScriptedAI +{ + npc_khunok_the_behemothAI(Creature *c) : ScriptedAI(c) {} + + void MoveInLineOfSight(Unit *who) + { + ScriptedAI::MoveInLineOfSight(who); + + if(who->GetTypeId() != TYPEID_UNIT) + return; + + if(who->GetEntry() == 25861 && me->IsWithinDistInMap(who, 10.0f)) + { + if(Unit *owner = who->GetOwner()) + { + if(owner->GetTypeId() == TYPEID_PLAYER) + { + DoCast(owner, 46231, true); + ((Creature*)who)->ForcedDespawn(); + } + } + } + } +}; + +CreatureAI* GetAI_npc_khunok_the_behemoth(Creature *_Creature) +{ + return new npc_khunok_the_behemothAI(_Creature); +} + void AddSC_borean_tundra() { Script *newscript; @@ -217,4 +251,9 @@ void AddSC_borean_tundra() newscript->Name="npc_sinkhole_kill_credit"; newscript->GetAI = &GetAI_npc_sinkhole_kill_credit; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_khunok_the_behemoth"; + newscript->GetAI = &GetAI_npc_khunok_the_behemoth; + newscript->RegisterSelf(); } -- cgit v1.2.3