diff options
-rw-r--r-- | sql/updates/8060_world_creature_template.sql | 1 | ||||
-rw-r--r-- | sql/updates/8060_world_script_waypoint.sql | 18 | ||||
-rw-r--r-- | src/scripts/kalimdor/desolace.cpp | 72 |
3 files changed, 91 insertions, 0 deletions
diff --git a/sql/updates/8060_world_creature_template.sql b/sql/updates/8060_world_creature_template.sql new file mode 100644 index 00000000000..20775da22fb --- /dev/null +++ b/sql/updates/8060_world_creature_template.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_dalinda', `flags_extra`='2', `faction_A`=35, `faction_H`=14 WHERE `creature_template`.`entry`=5644;
\ No newline at end of file diff --git a/sql/updates/8060_world_script_waypoint.sql b/sql/updates/8060_world_script_waypoint.sql new file mode 100644 index 00000000000..dad4de36058 --- /dev/null +++ b/sql/updates/8060_world_script_waypoint.sql @@ -0,0 +1,18 @@ +DELETE FROM `script_waypoint` WHERE `entry`=5644;
+INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) VALUES
+(5644, 1, -339.679, 1752.04, 139.482, 0, '0'),
+(5644, 2, -328.957, 1734.95, 139.327, 0, '0'),
+(5644, 3, -350.747, 1731.12, 139.338, 0, '0'),
+(5644, 4, -365.064, 1739.04, 139.376, 0, '0'),
+(5644, 5, -371.105, 1746.03, 139.374, 0, '0'),
+(5644, 6, -383.141, 1738.62, 138.93, 0, '0'),
+(5644, 7, -390.445, 1733.98, 136.353, 0, '0'),
+(5644, 8, -401.368, 1726.77, 131.071, 0, '0'),
+(5644, 9, -416.016, 1721.19, 129.807, 0, '0'),
+(5644, 10, -437.139, 1709.82, 126.342, 0, '0'),
+(5644, 11, -459.862, 1687.92, 116.059, 0, '0'),
+(5644, 12, -460.686, 1679.55, 111.976, 0, '0'),
+(5644, 13, -461.485, 1670.94, 109.033, 0, '0'),
+(5644, 14, -468.53, 1645.51, 102.811, 0, '0'),
+(5644, 15, -474.529, 1615.97, 97.228, 0, '0'),
+(5644, 16, -474.329, 1590.01, 94.4982, 0, '0');
\ No newline at end of file diff --git a/src/scripts/kalimdor/desolace.cpp b/src/scripts/kalimdor/desolace.cpp index dd0d1ed3240..2e1d951c3fe 100644 --- a/src/scripts/kalimdor/desolace.cpp +++ b/src/scripts/kalimdor/desolace.cpp @@ -26,6 +26,7 @@ npc_aged_dying_ancient_kodo EndContentData */ #include "ScriptedPch.h" +#include "ScriptedEscortAI.h" enum eDyingKodo { @@ -169,6 +170,70 @@ bool GOHello_go_iruxos(Player *pPlayer, GameObject* /*pGO*/) return true; } +/*###### +## npc_dalinda_malem. Quest 1440 +######*/ + +#define QUEST_RETURN_TO_VAHLARRIEL 1440 + +struct npc_dalindaAI : public npc_escortAI +{ + npc_dalindaAI(Creature* pCreature) : npc_escortAI(pCreature) { } + + void WaypointReached(uint32 i) + { + Player* pPlayer = GetPlayerForEscort(); + switch (i) + { + case 1: + me->IsStandState(); + break; + case 15: + if (pPlayer) + pPlayer->GroupEventHappens(QUEST_RETURN_TO_VAHLARRIEL, me); + break; + } + } + + void EnterCombat(Unit* pWho) { } + + void Reset() {} + + void JustDied(Unit* pKiller) + { + Player* pPlayer = GetPlayerForEscort(); + if (pPlayer) + pPlayer->FailQuest(QUEST_RETURN_TO_VAHLARRIEL); + return; + } + + void UpdateAI(const uint32 uiDiff) + { + npc_escortAI::UpdateAI(uiDiff); + if (!UpdateVictim()) + return; + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_dalinda(Creature* pCreature) +{ + return new npc_dalindaAI(pCreature); +} + +bool QuestAccept_npc_dalinda(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_RETURN_TO_VAHLARRIEL) + { + if (npc_escortAI* pEscortAI = CAST_AI(npc_dalindaAI, pCreature->AI())) + { + pEscortAI->Start(true, false, pPlayer->GetGUID()); + pCreature->setFaction(113); + } + } + return true; +} + void AddSC_desolace() { Script *newscript; @@ -184,4 +249,11 @@ void AddSC_desolace() newscript->Name = "go_iruxos"; newscript->pGOHello = &GOHello_go_iruxos; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_dalinda"; + newscript->GetAI = &GetAI_npc_dalinda; + newscript->pQuestAccept = &QuestAccept_npc_dalinda; + newscript->RegisterSelf(); + } |