diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp | 249 |
1 files changed, 248 insertions, 1 deletions
diff --git a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp index ee95d5066f3..be29cf79f0e 100644 --- a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp +++ b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp @@ -17,7 +17,7 @@ /* ScriptData SDName: Shadowmoon_Valley SD%Complete: 100 -SDComment: Quest support: 10519, 10583, 10601, 10814, 10804, 10854, 11082. Vendor Drake Dealer Hurlunk. +SDComment: Quest support: 10519, 10583, 10601, 10814, 10804, 10854, 11082, 10451. Vendor Drake Dealer Hurlunk. SDCategory: Shadowmoon Valley EndScriptData */ @@ -30,9 +30,11 @@ npc_murkblood_overseer npc_neltharaku npc_karynaku npc_oronok_tornheart +npc_earthmender_wilda EndContentData */ #include "precompiled.h" +#include "../../npc/npc_escortAI.h" /*##### # mob_mature_netherwing_drake @@ -1036,6 +1038,245 @@ bool QuestAccept_Overlord_Morghor(Player *player, Creature *_Creature, const Que return false; } +/*#### +# npc_earthmender_wilda +####*/ + +#define SAY_START "I sense the tortured spirits, $N. They are this way, come quickly!" +#define SAY_AGGRO1 "Watch out!" +#define SAY_AGGRO2 "Naga attackers! Defend yourself!" +#define ASSASSIN_SAY_AGGRO1 "Kill them all!" +#define ASSASSIN_SAY_AGGRO2 "You will never essscape Coilssskarrr..." +#define SAY_PROGRESS1 "Grant me protection $N, i must break trough their foul magic!" +#define SAY_PROGRESS2 "The naga of Coilskar are exceptionally cruel to their prisoners. It is a miracle that I survived inside that watery prison for as long as I did. Earthmother be praised." +#define SAY_PROGRESS3 "Now we must find the exit." +#define SAY_PROGRESS4 "Lady Vashj must answer for these atrocities. She must be brought to justice!" +#define SAY_PROGRESS5 "The tumultuous nature of the great waterways of Azeroth and Draenor are a direct result of tormented water spirits." +#define SAY_PROGRESS6 "It shouldn't be much further, $N. The exit is just up ahead." +#define SAY_END "Thank you, $N. Please return to my brethren at the Altar of Damnation, near the Hand of Gul'dan, and tell them that Wilda is safe. May the Earthmother watch over you..." + + +#define QUEST_ESCAPE_FROM_COILSKAR_CISTERN 10451 +#define NPC_COILSKAR_ASSASSIN 21044 + +struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI +{ + npc_earthmender_wildaAI(Creature *c) : npc_escortAI(c) {Reset();} + + void Aggro(Unit *who) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + if(who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_COILSKAR_ASSASSIN) + DoSay(SAY_AGGRO2, LANG_UNIVERSAL, player); + else DoSay(SAY_AGGRO1, LANG_UNIVERSAL, player); + } + + void Reset() + { + m_creature->setFaction(1726); + } + + void WaypointReached(uint32 i) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + if (!player) + return; + + switch(i) + { + case 0: + DoSay(SAY_START, LANG_UNIVERSAL, player); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK); + break; + case 13: + DoSay(SAY_PROGRESS1, LANG_UNIVERSAL, player); + SummonAssassin(); + break; + case 14: + SummonAssassin(); break; + case 15: + DoSay(SAY_PROGRESS3, LANG_UNIVERSAL, player); break; + case 19: + switch(rand()%3) + { + case 0: + DoSay(SAY_PROGRESS2, LANG_UNIVERSAL, player); break; + case 1: + DoSay(SAY_PROGRESS4, LANG_UNIVERSAL, player); break; + case 2: + DoSay(SAY_PROGRESS5, LANG_UNIVERSAL, player); break; + } + break; + case 20: + SummonAssassin(); break; + case 26: + switch(rand()%3) + { + case 0: + DoSay(SAY_PROGRESS2, LANG_UNIVERSAL, player); break; + case 1: + DoSay(SAY_PROGRESS4, LANG_UNIVERSAL, player); break; + case 2: + DoSay(SAY_PROGRESS5, LANG_UNIVERSAL, player); break; + } + break; + case 27: + SummonAssassin(); break; + case 33: + switch(rand()%3) + { + case 0: + DoSay(SAY_PROGRESS2, LANG_UNIVERSAL, player); break; + case 1: + DoSay(SAY_PROGRESS4, LANG_UNIVERSAL, player); break; + case 2: + DoSay(SAY_PROGRESS5, LANG_UNIVERSAL, player); break; + } + break; + case 34: + SummonAssassin(); break; + case 37: + switch(rand()%3) + { + case 0: + DoSay(SAY_PROGRESS2, LANG_UNIVERSAL, player); break; + case 1: + DoSay(SAY_PROGRESS4, LANG_UNIVERSAL, player); break; + case 2: + DoSay(SAY_PROGRESS5, LANG_UNIVERSAL, player); break; + } + break; + case 38: + SummonAssassin(); break; + case 39: + DoSay(SAY_PROGRESS6, LANG_UNIVERSAL, player); break; + case 43: + switch(rand()%3) + { + case 0: + DoSay(SAY_PROGRESS2, LANG_UNIVERSAL, player); break; + case 1: + DoSay(SAY_PROGRESS4, LANG_UNIVERSAL, player); break; + case 2: + DoSay(SAY_PROGRESS5, LANG_UNIVERSAL, player); break; + } + break; + case 44: + SummonAssassin(); break; + case 50: + DoSay(SAY_END, LANG_UNIVERSAL, player); + ((Player*)player)->GroupEventHappens(QUEST_ESCAPE_FROM_COILSKAR_CISTERN, m_creature); + break; + } + } + + void SummonAssassin() + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + Creature* CoilskarAssassin = m_creature->SummonCreature(NPC_COILSKAR_ASSASSIN, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_DEAD_DESPAWN, 0); + if( CoilskarAssassin ) + { + switch(rand()%2) + { + case 0: + CoilskarAssassin->Say(ASSASSIN_SAY_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break; + case 1: + CoilskarAssassin->Say(ASSASSIN_SAY_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break; + } + CoilskarAssassin->AI()->AttackStart(m_creature); + } + else error_log("SD2 ERROR: Coilskar Assassin couldn't be summmoned"); + } + + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + if (player) + ((Player*)player)->FailQuest(QUEST_ESCAPE_FROM_COILSKAR_CISTERN); + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; + +CreatureAI* GetAI_npc_earthmender_wildaAI(Creature *_Creature) +{ + npc_earthmender_wildaAI* earthmender_wildaAI = new npc_earthmender_wildaAI(_Creature); + + earthmender_wildaAI->AddWaypoint(0, -2637.466064, 1359.977905, 35.889114, 2000); // SAY_START + earthmender_wildaAI->AddWaypoint(1, -2666.364990, 1348.222656, 34.445557); + earthmender_wildaAI->AddWaypoint(2, -2693.789307, 1336.964966, 34.445557); + earthmender_wildaAI->AddWaypoint(3, -2715.495361, 1328.054443, 34.106014); + earthmender_wildaAI->AddWaypoint(4, -2742.530762, 1314.138550, 33.606144); + earthmender_wildaAI->AddWaypoint(5, -2745.077148, 1311.108765, 33.630898); + earthmender_wildaAI->AddWaypoint(6, -2749.855225, 1302.737915, 33.475632); + earthmender_wildaAI->AddWaypoint(7, -2753.639648, 1294.059448, 33.314930); + earthmender_wildaAI->AddWaypoint(8, -2756.796387, 1285.122192, 33.391262); + earthmender_wildaAI->AddWaypoint(9, -2750.042969, 1273.661987, 33.188259); + earthmender_wildaAI->AddWaypoint(10, -2740.378418, 1258.846680, 33.212521); + earthmender_wildaAI->AddWaypoint(11, -2733.629395, 1248.259766, 33.640598); + earthmender_wildaAI->AddWaypoint(12, -2727.212646, 1238.606445, 33.520847); + earthmender_wildaAI->AddWaypoint(13, -2726.377197, 1237.264526, 33.461823, 4000); // SAY_PROGRESS1 + earthmender_wildaAI->AddWaypoint(14, -2746.383301, 1266.390625, 33.191952, 2000); + earthmender_wildaAI->AddWaypoint(15, -2746.383301, 1266.390625, 33.191952, 4000); // SAY_PROGRESS3 + earthmender_wildaAI->AddWaypoint(16, -2758.927734, 1285.134155, 33.341728); + earthmender_wildaAI->AddWaypoint(17, -2761.845703, 1292.313599, 33.209042); + earthmender_wildaAI->AddWaypoint(18, -2758.871826, 1300.677612, 33.285332); + earthmender_wildaAI->AddWaypoint(19, -2758.871826, 1300.677612, 33.285332); + earthmender_wildaAI->AddWaypoint(20, -2753.928955, 1307.755859, 33.452457); + earthmender_wildaAI->AddWaypoint(20, -2738.612061, 1316.191284, 33.482975); + earthmender_wildaAI->AddWaypoint(21, -2727.897461, 1320.013916, 33.381111); + earthmender_wildaAI->AddWaypoint(22, -2709.458740, 1315.739990, 33.301838); + earthmender_wildaAI->AddWaypoint(23, -2704.658936, 1301.620361, 32.463303); + earthmender_wildaAI->AddWaypoint(24, -2704.120117, 1298.922607, 32.768162); + earthmender_wildaAI->AddWaypoint(25, -2691.798340, 1292.846436, 33.852642); + earthmender_wildaAI->AddWaypoint(26, -2682.879639, 1288.853882, 32.995399); + earthmender_wildaAI->AddWaypoint(27, -2661.869141, 1279.682495, 26.686783); + earthmender_wildaAI->AddWaypoint(28, -2648.943604, 1270.272827, 24.147522); + earthmender_wildaAI->AddWaypoint(29, -2642.506836, 1262.938721, 23.512444); + earthmender_wildaAI->AddWaypoint(20, -2636.984863, 1252.429077, 20.418257); + earthmender_wildaAI->AddWaypoint(31, -2648.113037, 1224.984863, 8.691818); + earthmender_wildaAI->AddWaypoint(32, -2658.393311, 1200.136719, 5.492243); + earthmender_wildaAI->AddWaypoint(33, -2668.504395, 1190.450562, 3.127407); + earthmender_wildaAI->AddWaypoint(34, -2685.930420, 1174.360840, 5.163924); + earthmender_wildaAI->AddWaypoint(35, -2701.613770, 1160.026367, 5.611311); + earthmender_wildaAI->AddWaypoint(36, -2714.659668, 1149.980347, 4.342373); + earthmender_wildaAI->AddWaypoint(37, -2721.443359, 1145.002808, 1.913474); + earthmender_wildaAI->AddWaypoint(38, -2733.962158, 1143.436279, 2.620415); + earthmender_wildaAI->AddWaypoint(39, -2757.876709, 1146.937500, 6.184002, 2000); // SAY_PROGRESS6 + earthmender_wildaAI->AddWaypoint(40, -2772.300537, 1166.052734, 6.331811); + earthmender_wildaAI->AddWaypoint(41, -2790.265381, 1189.941650, 5.207958); + earthmender_wildaAI->AddWaypoint(42, -2805.448975, 1208.663940, 5.557623); + earthmender_wildaAI->AddWaypoint(43, -2820.617676, 1225.870239, 6.266103); + earthmender_wildaAI->AddWaypoint(44, -2831.926758, 1237.725830, 5.808506); + earthmender_wildaAI->AddWaypoint(45, -2842.578369, 1252.869629, 6.807481); + earthmender_wildaAI->AddWaypoint(46, -2846.344971, 1258.727295, 7.386168); + earthmender_wildaAI->AddWaypoint(47, -2847.556396, 1266.771729, 8.208790); + earthmender_wildaAI->AddWaypoint(48, -2841.654541, 1285.809204, 7.933223); + earthmender_wildaAI->AddWaypoint(49, -2841.754883, 1289.832520, 6.990304); + earthmender_wildaAI->AddWaypoint(50, -2871.398438, 1302.348145, 6.807335, 8000); // SAY_END + + return (CreatureAI*)earthmender_wildaAI; +} + +bool QuestAccept_npc_earthmender_wilda(Player* player, Creature* creature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_ESCAPE_FROM_COILSKAR_CISTERN) + { + creature->setFaction(1725); + ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + } + return true; +} + void AddSC_shadowmoon_valley() { Script *newscript; @@ -1107,4 +1348,10 @@ void AddSC_shadowmoon_valley() newscript->pGossipHello = &GossipHello_npc_yarzill_fly; newscript->pGossipSelect = &GossipSelect_npc_yarzill_fly; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_earthmender_wilda"; + newscript->GetAI = &GetAI_npc_earthmender_wildaAI; + newscript->pQuestAccept = &QuestAccept_npc_earthmender_wilda; + newscript->RegisterSelf(); } |