diff options
| author | megamage <none@none> | 2008-12-28 10:52:24 -0600 |
|---|---|---|
| committer | megamage <none@none> | 2008-12-28 10:52:24 -0600 |
| commit | 3bbf8d6be8cd67d99fc8c1df3a971fe4e7e680ef (patch) | |
| tree | 0264a08b586df36f290a6b1b6a839dcf9b829c75 /src/bindings/scripts | |
| parent | ac9cced914fb4c9db0b2b64f7fd9f9ab8c7802ee (diff) | |
| parent | 9fa37dc69344a28a585bc2dee6713d7ebaa03d28 (diff) | |
HG 698.
--HG--
branch : trunk
Diffstat (limited to 'src/bindings/scripts')
11 files changed, 649 insertions, 5 deletions
diff --git a/src/bindings/scripts/Makefile.am b/src/bindings/scripts/Makefile.am index 2789b2a51b7..94a01ac23af 100644 --- a/src/bindings/scripts/Makefile.am +++ b/src/bindings/scripts/Makefile.am @@ -69,6 +69,7 @@ scripts/npc/npc_innkeeper.cpp \ scripts/npc/npc_professions.cpp \ scripts/npc/npcs_special.cpp \ scripts/zone/alterac_mountains/alterac_mountains.cpp \ +scripts/zone/arathi_highlands/arathi_highlands.cpp \ scripts/zone/ashenvale_forest/ashenvale.cpp\ scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp \ scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp \ @@ -274,6 +275,7 @@ scripts/zone/netherstorm/netherstorm.cpp \ scripts/zone/onyxias_lair/boss_onyxia.cpp \ scripts/zone/orgrimmar/orgrimmar.cpp \ scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp \ +scripts/zone/razorfen_kraul/razorfen_kraul.cpp \ scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp \ scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp \ scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp \ diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index 76ad10fe6b3..49a1dc79cc8 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -108,6 +108,8 @@ extern void AddSC_npcs_special(); extern void AddSC_alterac_mountains(); //Arathi Highlands +extern void AddSC_arathi_highlands(); + //Ashenvale Forest extern void AddSC_ashenvale(); @@ -408,6 +410,9 @@ extern void AddSC_orgrimmar(); //Razorfen Downs extern void AddSC_boss_amnennar_the_coldbringer(); +//Razorfen Kraul +extern void AddSC_razorfen_kraul(); + //Redridge Mountains //Ruins of Ahn'Qiraj //Scarlet Monastery @@ -1304,6 +1309,8 @@ void ScriptsInit() AddSC_alterac_mountains(); //Arathi Highlands + AddSC_arathi_highlands(); + //Ashenvale Forest AddSC_ashenvale(); @@ -1604,6 +1611,9 @@ void ScriptsInit() //Razorfen Downs AddSC_boss_amnennar_the_coldbringer(); + //Razorfen Kraul + AddSC_razorfen_kraul(); + //Redridge Mountains //Ruins of Ahn'Qiraj //Scarlet Monastery diff --git a/src/bindings/scripts/VC71/71ScriptDev2.vcproj b/src/bindings/scripts/VC71/71ScriptDev2.vcproj index 8eb464b81c8..5d8da080d66 100644 --- a/src/bindings/scripts/VC71/71ScriptDev2.vcproj +++ b/src/bindings/scripts/VC71/71ScriptDev2.vcproj @@ -372,6 +372,10 @@ <Filter Name="Arathi Highlands" > + <File + RelativePath="..\scripts\zone\arathi_highlands\arathi_highlands.cpp" + > + </File> </Filter> <Filter Name="Deadmines" @@ -528,6 +532,10 @@ <Filter Name="Razorfen Kraul" > + <File + RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp" + > + </File> </Filter> <Filter Name="Redridge Mountains" diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index f07fc80900e..60b74c03320 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -549,6 +549,10 @@ <Filter Name="Arathi Highlands" > + <File + RelativePath="..\scripts\zone\arathi_highlands\arathi_highlands.cpp" + > + </File> </Filter> <Filter Name="Deadmines" @@ -705,6 +709,10 @@ <Filter Name="Razorfen Kraul" > + <File + RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp" + > + </File> </Filter> <Filter Name="Redridge Mountains" diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj index 613ba6fa3c8..9c8c7da5a93 100644 --- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj +++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj @@ -542,6 +542,10 @@ <Filter Name="Arathi Highlands" > + <File + RelativePath="..\scripts\zone\arathi_highlands\arathi_highlands.cpp" + > + </File> </Filter> <Filter Name="Deadmines" @@ -698,6 +702,10 @@ <Filter Name="Razorfen Kraul" > + <File + RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp" + > + </File> </Filter> <Filter Name="Redridge Mountains" diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index cd1e5788ebd..590118e7a8c 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -236,9 +236,14 @@ void ScriptedAI::DoCastSpell(Unit* who,SpellEntry const *spellInfo, bool trigger m_creature->CastSpell(who, spellInfo, triggered); } -void ScriptedAI::DoSay(const char* text, uint32 language, Unit* target) -{ - if (target) m_creature->Say(text, language, target->GetGUID()); +void ScriptedAI::DoSay(const char* text, uint32 language, Unit* target, bool SayEmote) +{ + if (target) + { + m_creature->Say(text, language, target->GetGUID()); + if(SayEmote) + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK); + } else m_creature->Say(text, language, 0); } diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h index 90a66911ac7..1878e6e11dc 100644 --- a/src/bindings/scripts/include/sc_creature.h +++ b/src/bindings/scripts/include/sc_creature.h @@ -124,7 +124,7 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI void DoCastSpell(Unit* who,SpellEntry const *spellInfo, bool triggered = false); //Creature say - void DoSay(const char* text, uint32 language, Unit* target); + void DoSay(const char* text, uint32 language, Unit* target, bool SayEmote = false); //Creature Yell void DoYell(const char* text, uint32 language, Unit* target); diff --git a/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp b/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp new file mode 100644 index 00000000000..92dcb34a433 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp @@ -0,0 +1,152 @@ +/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Arathi Highlands +SD%Complete: 100 +SDComment: Quest support: 665 +SDCategory: Arathi Highlands +EndScriptData */ + +/* ContentData +npc_professor_phizzlethorpe +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*###### +## npc_professor_phizzlethorpe +######*/ + +#define SAY_PROGRESS_1 "Ok, $N. Follow me to the cave where I'll attempt to harness the power of the rune stone into these goggles." +#define SAY_PROGRESS_2 "I discovered this cave on our first day here. I believe the energy in the stone can be used to our advantage." +#define SAY_PROGRESS_3 "I'll begin drawing energy from the stone. Your job, $N, i to defend me. This place is cursed... trust me." +#define EMOTE_PROGRESS_4 "begins tinkering with the goggles before the stone." +#define SAY_AGGRO "Help!!! Get these things off me so I can get my work done!" +#define SAY_PROGRESS_5 "Almost done! Just a little longer!" +#define SAY_PROGRESS_6 "I've done it! I have harnessed the power of the stone into the goggles! Let's get out of here!" +#define SAY_PROGRESS_7 "Phew! Glad to be back from that creepy cave." +#define EMOTE_PROGRESS_8 "hands one glowing goggles over to Doctor Draxlegauge." +#define SAY_PROGRESS_9 "Doctor Draxlegauge will give you further instructions, $N. Many thanks for your help!" + +#define QUEST_SUNKEN_TREASURE 665 +#define MOB_VENGEFUL_SURGE 2776 + +struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI +{ + npc_professor_phizzlethorpeAI(Creature *c) : npc_escortAI(c) {Reset();} + + void WaypointReached(uint32 i) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + switch(i) + { + case 4:DoSay(SAY_PROGRESS_2, LANG_UNIVERSAL, player, true);break; + case 5:DoSay(SAY_PROGRESS_3, LANG_UNIVERSAL, player, true);break; + case 8:DoTextEmote(EMOTE_PROGRESS_4, NULL);break; + case 9: + { + Creature* sum1 = m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_DEAD_DESPAWN, 0); + Creature* sum2 = m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_DEAD_DESPAWN, 0); + sum1->Attack(m_creature, true); + sum2->Attack(m_creature, true); + break; + } + case 10:DoSay(SAY_PROGRESS_5, LANG_UNIVERSAL, player, true);break; + case 11:DoSay(SAY_PROGRESS_6, LANG_UNIVERSAL, player, true);break; + case 19:DoSay(SAY_PROGRESS_7, LANG_UNIVERSAL, player, true); break; + case 20: + DoTextEmote(EMOTE_PROGRESS_8, NULL); + DoSay(SAY_PROGRESS_9, LANG_UNIVERSAL, player, true); + ((Player*)player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, m_creature); + break; + } + } + + void Reset(){} + + void Aggro(Unit* who) + { + DoSay(SAY_AGGRO, LANG_UNIVERSAL, NULL); + } + + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + if (player) + ((Player*)player)->FailQuest(QUEST_SUNKEN_TREASURE); + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; + +bool QuestAccept_npc_professor_phizzlethorpe(Player* player, Creature* creature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE) + { + creature->Say(SAY_PROGRESS_1, LANG_UNIVERSAL, player->GetGUID()); + ((npc_escortAI*)(creature->AI()))->Start(false, false, false, player->GetGUID()); + } + return true; +} + +CreatureAI* GetAI_npc_professor_phizzlethorpeAI(Creature *_Creature) +{ + npc_professor_phizzlethorpeAI* professor_phizzlethorpeAI = new npc_professor_phizzlethorpeAI(_Creature); + + professor_phizzlethorpeAI->AddWaypoint(0, -2066.45, -2085.96, 9.08); + professor_phizzlethorpeAI->AddWaypoint(1, -2077.99, -2105.33, 13.24); + professor_phizzlethorpeAI->AddWaypoint(2, -2074.60, -2109.67, 14.24); + professor_phizzlethorpeAI->AddWaypoint(3, -2076.60, -2117.46, 16.67); + professor_phizzlethorpeAI->AddWaypoint(4, -2073.51, -2123.46, 18.42, 2000); + professor_phizzlethorpeAI->AddWaypoint(5, -2073.51, -2123.46, 18.42, 4000); + professor_phizzlethorpeAI->AddWaypoint(6, -2066.60, -2131.85, 21.56); + professor_phizzlethorpeAI->AddWaypoint(7, -2053.85, -2143.19, 20.31); + professor_phizzlethorpeAI->AddWaypoint(8, -2043.49, -2153.73, 20.20, 12000); + professor_phizzlethorpeAI->AddWaypoint(9, -2043.49, -2153.73, 20.20, 14000); + professor_phizzlethorpeAI->AddWaypoint(10, -2043.49, -2153.73, 20.20, 10000); + professor_phizzlethorpeAI->AddWaypoint(11, -2043.49, -2153.73, 20.20, 2000); + professor_phizzlethorpeAI->AddWaypoint(12, -2053.85, -2143.19, 20.31); + professor_phizzlethorpeAI->AddWaypoint(13, -2066.60, -2131.85, 21.56); + professor_phizzlethorpeAI->AddWaypoint(14, -2073.51, -2123.46, 18.42); + professor_phizzlethorpeAI->AddWaypoint(15, -2076.60, -2117.46, 16.67); + professor_phizzlethorpeAI->AddWaypoint(16, -2074.60, -2109.67, 14.24); + professor_phizzlethorpeAI->AddWaypoint(17, -2077.99, -2105.33, 13.24); + professor_phizzlethorpeAI->AddWaypoint(18, -2066.45, -2085.96, 9.08); + professor_phizzlethorpeAI->AddWaypoint(19, -2066.41, -2086.21, 8.97, 6000); + professor_phizzlethorpeAI->AddWaypoint(20, -2066.41, -2086.21, 8.97, 2000); + + return (CreatureAI*)professor_phizzlethorpeAI; +} + +void AddSC_arathi_highlands() +{ + Script * newscript; + + newscript = new Script; + newscript->Name = "npc_professor_phizzlethorpe"; + newscript->GetAI = &GetAI_npc_professor_phizzlethorpeAI; + newscript->pQuestAccept = &QuestAccept_npc_professor_phizzlethorpe; + newscript->RegisterSelf(); +}
\ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp index 9e390e6bb21..30e8a49b84a 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp @@ -58,6 +58,7 @@ struct TRINITY_DLL_DECL boss_midnightAI : public ScriptedAI Attumen = 0; Mount_Timer = 0; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->SetVisibility(VISIBILITY_ON); } diff --git a/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp b/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp new file mode 100644 index 00000000000..2d70b503a77 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp @@ -0,0 +1,203 @@ +/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Razorfen Kraul +SD%Complete: 100 +SDComment: Quest support: 1144 +SDCategory: Razorfen Kraul +EndScriptData */ + +/* ContentData +npc_willix +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +#define SAY_READY -1047000 +#define SAY_POINT -10470001 +#define SAY_AGGRO1 -1047002 +#define SAY_BLUELEAF -1047003 +#define SAY_DANGER -1047004 +#define SAY_BAD -1047005 +#define SAY_THINK -1047006 +#define SAY_SOON -1047007 +#define SAY_FINALY -1047008 +#define SAY_WIN -1047009 +#define SAY_END -1047010 + +#define QUEST_WILLIX_THE_IMPORTER 1144 +#define ENTRY_BOAR 4514 + +struct TRINITY_DLL_DECL npc_willixAI : public npc_escortAI +{ +npc_willixAI(Creature *c) : npc_escortAI(c) {Reset();} + + void WaypointReached(uint32 i) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + if (!player) + return; + + switch (i) + { + case 3: + m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); + DoScriptText(SAY_POINT, m_creature, player); + break; + case 4: + m_creature->SummonCreature(ENTRY_BOAR, 2137.66, 1843.98, 48.08, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 8: + DoScriptText(SAY_BLUELEAF, m_creature, player); + break; + case 9: + DoScriptText(SAY_DANGER, m_creature, player); + break; + case 13: + DoScriptText(SAY_BAD, m_creature, player); + break; + case 14: + m_creature->SummonCreature(ENTRY_BOAR, 2078.91, 1704.54, 56.77, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 25: + DoScriptText(SAY_THINK, m_creature, player); + break; + case 31: + DoScriptText(SAY_SOON, m_creature, player); + break; + case 42: + DoScriptText(SAY_FINALY, m_creature, player); + break; + case 43: + m_creature->SummonCreature(ENTRY_BOAR, 1956.43, 1596.97, 81.75, 1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 45: + DoScriptText(SAY_WIN, m_creature, player); + if (player && player->GetTypeId() == TYPEID_PLAYER) + ((Player*)player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,m_creature); + break; + case 46: + DoScriptText(SAY_END, m_creature, player); + break; + } + } + + void Reset() {} + + void Aggro(Unit* who) + { + DoScriptText(SAY_AGGRO1, m_creature, NULL); + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } + + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + if (Unit* player = Unit::GetUnit((*m_creature), PlayerGUID)) + ((Player*)player)->FailQuest(QUEST_WILLIX_THE_IMPORTER); + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; + +bool QuestAccept_npc_willix(Player* player, Creature* creature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_WILLIX_THE_IMPORTER) + { + ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + DoScriptText(SAY_READY, creature, player); + } + + return true; +} + +CreatureAI* GetAI_npc_willix(Creature *_Creature) +{ + npc_willixAI* thisAI = new npc_willixAI(_Creature); + + thisAI->AddWaypoint(0, 2194.38, 1791.65, 65.48, 5000); + thisAI->AddWaypoint(1, 2188.56, 1805.87, 64.45); + thisAI->AddWaypoint(2, 2187, 1843.49, 59.33); + thisAI->AddWaypoint(3, 2163.27, 1851.67, 56.73, 5000); + thisAI->AddWaypoint(4, 2137.66, 1843.98, 48.08, 5000); + thisAI->AddWaypoint(5, 2140.22, 1845.02, 48.32); + thisAI->AddWaypoint(6, 2131.5, 1804.29, 46.85); + thisAI->AddWaypoint(7, 2096.18, 1789.03, 51.13); + thisAI->AddWaypoint(8, 2074.46, 1780.09, 55.64, 3000); + thisAI->AddWaypoint(9, 2055.12, 1768.67, 58.46, 5000); + thisAI->AddWaypoint(10, 2037.83, 1748.62, 60.27); + thisAI->AddWaypoint(11, 2037.51, 1728.94, 60.85); + thisAI->AddWaypoint(12, 2044.7, 1711.71, 59.71); + thisAI->AddWaypoint(13, 2067.66, 1701.84, 57.77, 3000); + thisAI->AddWaypoint(14, 2078.91, 1704.54, 56.77, 3000); + thisAI->AddWaypoint(15, 2097.65, 1715.24, 54.74); + thisAI->AddWaypoint(16, 2106.44, 1720.98, 54.41); + thisAI->AddWaypoint(17, 2123.96, 1732.56, 52.27); + thisAI->AddWaypoint(18, 2153.82, 1728.73, 51.92); + thisAI->AddWaypoint(19, 2163.49, 1706.33, 54.42); + thisAI->AddWaypoint(20, 2158.75, 1695.98, 55.70); + thisAI->AddWaypoint(21, 2142.6, 1680.72, 58.24); + thisAI->AddWaypoint(22, 2118.31, 1671.54, 59.21); + thisAI->AddWaypoint(23, 2086.02, 1672.04, 61.24); + thisAI->AddWaypoint(24, 2068.81, 1658.93, 61.24); + thisAI->AddWaypoint(25, 2062.82, 1633.31, 64.35, 3000); + thisAI->AddWaypoint(26, 2063.05, 1589.16, 63.26); + thisAI->AddWaypoint(27, 2063.67, 1577.22, 65.89); + thisAI->AddWaypoint(28, 2057.94, 1560.68, 68.40); + thisAI->AddWaypoint(29, 2052.56, 1548.05, 73.35); + thisAI->AddWaypoint(30, 2045.22, 1543.4, 76.65); + thisAI->AddWaypoint(31, 2034.35, 1543.01, 79.70); + thisAI->AddWaypoint(32, 2029.95, 1542.94, 80.79); + thisAI->AddWaypoint(33, 2021.34, 1538.67, 80.8); + thisAI->AddWaypoint(34, 2012.45, 1549.48, 79.93); + thisAI->AddWaypoint(35, 2008.05, 1554.92, 80.44); + thisAI->AddWaypoint(36, 2006.54, 1562.72, 81.11); + thisAI->AddWaypoint(37, 2003.8, 1576.43, 81.57); + thisAI->AddWaypoint(38, 2000.57, 1590.06, 80.62); + thisAI->AddWaypoint(39, 1998.96, 1596.87, 80.22); + thisAI->AddWaypoint(40, 1991.19, 1600.82, 79.39); + thisAI->AddWaypoint(41, 1980.71, 1601.44, 79.77, 3000); + thisAI->AddWaypoint(42, 1967.22, 1600.18, 80.62, 3000); + thisAI->AddWaypoint(43, 1956.43, 1596.97, 81.75, 3000); + thisAI->AddWaypoint(44, 1954.87, 1592.02, 82.18); + thisAI->AddWaypoint(45, 1948.35, 1571.35, 80.96, 30000); + thisAI->AddWaypoint(46, 1947.02, 1566.42, 81.80, 30000); + + return (CreatureAI*)thisAI; +} + +void AddSC_razorfen_kraul() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_willix"; + newscript->GetAI = &GetAI_npc_willix; + newscript->pQuestAccept = &QuestAccept_npc_willix; + newscript->RegisterSelf(); +}
\ No newline at end of file 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(); } |
