diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp | 130 |
1 files changed, 129 insertions, 1 deletions
diff --git a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp b/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp index fdce0029e9d..6f3ca0149bb 100644 --- a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp +++ b/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp @@ -17,7 +17,7 @@ /* ScriptData SDName: Zangarmarsh SD%Complete: 100 -SDComment: Quest support: 9785, 9803, 10009. Mark Of ... buffs. +SDComment: Quest support: 9785, 9803, 10009, 9752. Mark Of ... buffs. SDCategory: Zangarmarsh EndScriptData */ @@ -26,9 +26,11 @@ npcs_ashyen_and_keleth npc_cooshcoosh npc_elder_kuruti npc_mortog_steamhead +npc_kayra_longmane EndContentData */ #include "precompiled.h" +#include "../../npc/npc_escortAI.h" /*###### ## npcs_ashyen_and_keleth @@ -250,6 +252,126 @@ bool GossipSelect_npc_mortog_steamhead(Player *player, Creature *_Creature, uint } /*###### +## npc_kayra_longmane +######*/ + +#define SAY_PROGRESS_1 "Is the way clear? Let's get out while we can, $N." +#define SAY_PROGRESS_2 "Looks like we won't get away so easy. Get ready!" +#define SAY_PROGRESS_3 "Let's keep moving. We're not safe here!" +#define SAY_PROGRESS_4 "Look out, $N! Enemies ahead!" +#define SAY_PROGRESS_5 "We're almost to the refuge! Let's go." +#define SAY_PROGRESS_6 "I can see my fellow druids from here. Thank you, $N. I'm sure Ysiel will reward you for your actions!" + +#define QUEST_EFU 9752 +#define MOB_AMBUSH 18042 + +struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI +{ + npc_kayra_longmaneAI(Creature* c) : npc_escortAI(c) {Reset();} + + bool Completed; + + void Reset() + { + Completed = false; + } + + void Aggro(Unit* who){} + + void JustSummoned(Creature *summoned) + { + summoned->AI()->AttackStart(m_creature); + summoned->setFaction(14); + } + + void WaypointReached(uint32 i) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + switch(i) + { + case 0: DoSay(SAY_PROGRESS_1, LANG_UNIVERSAL, player); break; + case 5: DoSay(SAY_PROGRESS_2, LANG_UNIVERSAL, player); + m_creature->SummonCreature(MOB_AMBUSH, -922.24, 5357.98, 17.93, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + m_creature->SummonCreature(MOB_AMBUSH, -922.24, 5357.98, 17.93, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + break; + case 6: DoSay(SAY_PROGRESS_3, LANG_UNIVERSAL, player); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + break; + case 18: DoSay(SAY_PROGRESS_4, LANG_UNIVERSAL, player); + m_creature->SummonCreature(MOB_AMBUSH, -671.86, 5379.81, 22.12, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + m_creature->SummonCreature(MOB_AMBUSH, -671.86, 5379.81, 22.12, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + break; + case 19: m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + DoSay(SAY_PROGRESS_5, LANG_UNIVERSAL, player); break; + case 26: DoSay(SAY_PROGRESS_6, LANG_UNIVERSAL, player); + if(player) + ((Player*)player)->GroupEventHappens(QUEST_EFU, m_creature); + break; + } + } + + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + if (player && !Completed) + ((Player*)player)->FailQuest(QUEST_EFU); + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; + +bool QuestAccept_npc_kayra_longmane(Player* player, Creature* creature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_EFU) + { + ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + creature->setFaction(775); + } + return true; +} + +CreatureAI* GetAI_npc_kayra_longmaneAI(Creature* _Creature) +{ + npc_kayra_longmaneAI* thisAI = new npc_kayra_longmaneAI(_Creature); + + thisAI->AddWaypoint(0, -931.88, 5283.56, 23.98);//SAY_PROGRESS_1 + thisAI->AddWaypoint(1, -930.52, 5287.57, 23.82); + thisAI->AddWaypoint(2, -924.98, 5297.94, 17.78); + thisAI->AddWaypoint(3, -928.83, 5316.07, 18.18); + thisAI->AddWaypoint(4, -930.07, 5323.10, 18.63); + thisAI->AddWaypoint(5, -926.58, 5331.24, 18.74, 6000);//SAY_PROGRESS_2 + thisAI->AddWaypoint(6, -926.58, 5331.24, 18.74, 3000);//SAY_PROGRESS_3 Run to the hills! + thisAI->AddWaypoint(7, -931.24, 5358.89, 18.14); + thisAI->AddWaypoint(8, -934.43, 5370.20, 22.41); + thisAI->AddWaypoint(9, -943.01, 5400.55, 22.74); + thisAI->AddWaypoint(10, -929.62, 5417.98, 23.07); + thisAI->AddWaypoint(11, -901.92, 5420.38, 24.19); + thisAI->AddWaypoint(12, -859.03, 5415.36, 23.64); + thisAI->AddWaypoint(13, -808.94, 5401.93, 23.11); + thisAI->AddWaypoint(14, -772.74, 5390.53, 22.97); + thisAI->AddWaypoint(15, -749.71, 5385.39, 22.75); + thisAI->AddWaypoint(16, -721.23, 5380.38, 22.47); + thisAI->AddWaypoint(17, -687.96, 5379.08, 22.16); + thisAI->AddWaypoint(18, -680.87, 5378.95, 21.99, 6000);//SAY_PROGRESS_4 Summon Ambush + thisAI->AddWaypoint(19, -680.87, 5378.95, 21.99, 6000);//SAY_PROGRESS_5 + thisAI->AddWaypoint(20, -636.14, 5385.25, 22.20); + thisAI->AddWaypoint(21, -602.94, 5411.36, 21.48); + thisAI->AddWaypoint(22, -566.86, 5421.87, 21.25); + thisAI->AddWaypoint(23, -547.27, 5427.87, 21.10); + thisAI->AddWaypoint(24, -520.59, 5444.83, 21.15); + thisAI->AddWaypoint(25, -488.45, 5447.83, 22.38); + thisAI->AddWaypoint(26, -449.65, 5463.78, 21.77, 11000);//SAY_PROGRESS_6 + + return (CreatureAI*)thisAI; +} +/*###### ## AddSC ######*/ @@ -280,4 +402,10 @@ void AddSC_zangarmarsh() newscript->pGossipHello = &GossipHello_npc_mortog_steamhead; newscript->pGossipSelect = &GossipSelect_npc_mortog_steamhead; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_kayra_longmane"; + newscript->GetAI = &GetAI_npc_kayra_longmaneAI; + newscript->pQuestAccept = &QuestAccept_npc_kayra_longmane; + newscript->RegisterSelf(); } |