diff options
| author | click <none@none> | 2010-05-04 08:30:11 +0200 |
|---|---|---|
| committer | click <none@none> | 2010-05-04 08:30:11 +0200 |
| commit | 0fd39511acda67f3f61a5a84ab3c34dd91855baa (patch) | |
| tree | 7b7c48dd600bafe617fc4ee8b8f755fe7f951c87 | |
| parent | 5b88cd584aaaa7d7c71c2776652f02e55d449d0b (diff) | |
Add support for quest 6641 (Vorsha The Lasher)
--HG--
branch : trunk
| -rw-r--r-- | sql/updates/8089_world_creature_template.sql | 1 | ||||
| -rw-r--r-- | sql/updates/8089_world_gameobject.sql | 1 | ||||
| -rw-r--r-- | sql/updates/8089_world_gameobject_template.sql | 1 | ||||
| -rw-r--r-- | sql/updates/8089_world_script_texts.sql | 12 | ||||
| -rw-r--r-- | sql/updates/8089_world_script_waypoint.sql | 32 | ||||
| -rw-r--r-- | src/scripts/kalimdor/ashenvale.cpp | 220 |
6 files changed, 267 insertions, 0 deletions
diff --git a/sql/updates/8089_world_creature_template.sql b/sql/updates/8089_world_creature_template.sql new file mode 100644 index 00000000000..6706e069cce --- /dev/null +++ b/sql/updates/8089_world_creature_template.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_muglash' WHERE `creature_template`.`entry` = 12717; diff --git a/sql/updates/8089_world_gameobject.sql b/sql/updates/8089_world_gameobject.sql new file mode 100644 index 00000000000..cc75a18a489 --- /dev/null +++ b/sql/updates/8089_world_gameobject.sql @@ -0,0 +1 @@ +UPDATE `gameobject` SET `state` = 1 WHERE `guid` =47873; diff --git a/sql/updates/8089_world_gameobject_template.sql b/sql/updates/8089_world_gameobject_template.sql new file mode 100644 index 00000000000..add13e988f6 --- /dev/null +++ b/sql/updates/8089_world_gameobject_template.sql @@ -0,0 +1 @@ +UPDATE `gameobject_template` SET `ScriptName` = 'go_naga_brazier' WHERE `gameobject_template`.`entry` = 178247; diff --git a/sql/updates/8089_world_script_texts.sql b/sql/updates/8089_world_script_texts.sql new file mode 100644 index 00000000000..2c0c35c2592 --- /dev/null +++ b/sql/updates/8089_world_script_texts.sql @@ -0,0 +1,12 @@ +DELETE FROM `script_texts` WHERE `npc_entry`=12717; +INSERT INTO `script_texts` (`npc_entry`, `entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`, `sound`, `type`, `language`, `emote`, `comment`) VALUES +(12717, -1800054, 'Are you sure that you are ready? If we do not have a group of your allies to aid us, we will surely fail.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 1, 0, 'muglash SAY_MUG_START1'); +(12717, -1800055, 'This will be a though fight, $N. Follow me closely.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 1, 0, 'muglash SAY_MUG_START2'), +(12717, -1800056, 'This is the brazier, $N. Put it out. Vorsha is a beast, worthy of praise from no one!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 1, 0, 'muglash SAY_MUG_BRAZIER'), +(12717, -1800057, 'Now we must wait. It won''t be long before the naga realize what we have done.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 1, 0, 'muglash SAY_MUG_BRAZIER_WAIT'), +(12717, -1800058, 'Be on your guard, $N!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 1, 0, 'muglash SAY_MUG_ON_GUARD'), +(12717, -1800059, 'Perhaps we will get a moment to rest. But I will not give up until we have faced off against Vorsha!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 1, 0, 'muglash SAY_MUG_REST'), +(12717, -1800060, 'We have done it!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 1, 0, 'muglash SAY_MUG_DONE'), +(12717, -1800061, 'You have my deepest gratitude. I thank you.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 1, 0, 'muglash SAY_MUG_GRATITUDE'), +(12717, -1800062, 'I am going to patrol the area for a while longer and ensure that things are truly safe.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 1, 0, 'muglash SAY_MUG_PATROL'), +(12717, -1800063, 'Please return to Zoram''gar and report our success to the Warsong runner.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 1, 0, 'muglash SAY_MUG_RETURN'), diff --git a/sql/updates/8089_world_script_waypoint.sql b/sql/updates/8089_world_script_waypoint.sql new file mode 100644 index 00000000000..7cd2f1a13c2 --- /dev/null +++ b/sql/updates/8089_world_script_waypoint.sql @@ -0,0 +1,32 @@ +DELETE FROM `script_waypoint` WHERE `entry`=12717; +INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`,`location_y`, `location_z`, `waittime`, `point_comment`) VALUES +(12717, 0, 3346.25, 1007.88, 3.59, 0, 'SAY_MUG_START2'), +(12717, 1, 3367.39, 1011.51, 3.72, 0, ''), +(12717, 2, 3418.64, 1013.96, 2.905, 0, ''), +(12717, 3, 3426.84, 1015.1, 3.449, 0, ''), +(12717, 4, 3437.03, 1020.79, 2.742, 0, ''), +(12717, 5, 3460.56, 1024.26, 1.353, 0, ''), +(12717, 6, 3479.87, 1037.96, 1.023, 0, ''), +(12717, 7, 3490.53, 1043.35, 3.338, 0, ''), +(12717, 8, 3504.28, 1047.77, 8.205, 0, ''), +(12717, 9, 3510.73, 1049.79, 12.143, 0, ''), +(12717, 10, 3514.41, 1051.17, 13.235, 0, ''), +(12717, 11, 3516.94, 1052.91, 12.918, 0, ''), +(12717, 12, 3523.64, 1056.3, 7.563, 0, ''), +(12717, 13, 3531.94, 1059.86, 6.175, 0, ''), +(12717, 14, 3535.48, 1069.96, 1.697, 0, ''), +(12717, 15, 3546.98, 1093.49, 0.68, 0, ''), +(12717, 16, 3549.73, 1101.88, -1.123, 0, ''), +(12717, 17, 3555.14, 1116.99, -4.326, 0, ''), +(12717, 18, 3571.94, 1132.18, -0.634, 0, ''), +(12717, 19, 3574.28, 1137.58, 3.684, 0, ''), +(12717, 20, 3579.31, 1137.25, 8.205, 0, ''), +(12717, 21, 3590.22, 1143.65, 8.291, 0, ''), +(12717, 22, 3595.97, 1145.83, 6.773, 0, ''), +(12717, 23, 3603.65, 1146.92, 9.763, 0, ''), +(12717, 24, 3607.08, 1146.01, 10.692, 5000, 'SAY_MUG_BRAZIER'), +(12717, 25, 3614.52, 1142.63, 10.248, 0, ''), +(12717, 26, 3616.66, 1140.84, 10.682, 3000, 'SAY_MUG_PATROL'), +(12717, 27, 3621.08, 1138.11, 10.369, 0, 'SAY_MUG_RETURN'), +(12717, 28, 3615.48, 1145.53, 9.614, 0, ''), +(12717, 29, 3607.19, 1152.72, 8.871, 0, ''); diff --git a/src/scripts/kalimdor/ashenvale.cpp b/src/scripts/kalimdor/ashenvale.cpp index 94da61bbbbf..46f97fd4954 100644 --- a/src/scripts/kalimdor/ashenvale.cpp +++ b/src/scripts/kalimdor/ashenvale.cpp @@ -229,6 +229,215 @@ CreatureAI* GetAI_npc_ruul_snowhoofAI(Creature* pCreature) return new npc_ruul_snowhoofAI(pCreature); } +#include "ScriptedPch.h" +#include "ScriptedEscortAI.h" + +enum eEnums +{ + SAY_MUG_START1 = -1800054, + SAY_MUG_START2 = -1800055, + SAY_MUG_BRAZIER = -1800056, + SAY_MUG_BRAZIER_WAIT = -1800057, + SAY_MUG_ON_GUARD = -1800058, + SAY_MUG_REST = -1800059, + SAY_MUG_DONE = -1800060, + SAY_MUG_GRATITUDE = -1800061, + SAY_MUG_PATROL = -1800062, + SAY_MUG_RETURN = -1800063, + + QUEST_VORSHA = 6641, + + GO_NAGA_BRAZIER = 178247, + + NPC_WRATH_RIDER = 3713, + NPC_WRATH_SORCERESS = 3717, + NPC_WRATH_RAZORTAIL = 3712, + + NPC_WRATH_PRIESTESS = 3944, + NPC_WRATH_MYRMIDON = 3711, + NPC_WRATH_SEAWITCH = 3715, + + NPC_VORSHA = 12940, + NPC_MUGLASH = 12717 +}; + +static float m_afFirstNagaCoord[3][3]= +{ + {3603.504150, 1122.631104, 1.635}, // rider + {3589.293945, 1148.664063, 5.565}, // sorceress + {3609.925537, 1168.759521, -1.168} // razortail +}; + +static float m_afSecondNagaCoord[3][3]= +{ + {3609.925537, 1168.759521, -1.168}, // witch + {3645.652100, 1139.425415, 1.322}, // priest + {3583.602051, 1128.405762, 2.347} // myrmidon +}; + +static float m_fVorshaCoord[]={3633.056885, 1172.924072, -5.388}; + + +struct npc_muglashAI : public npc_escortAI +{ + npc_muglashAI(Creature* pCreature) : npc_escortAI(pCreature) { } + + uint32 m_uiWaveId; + uint32 m_uiEventTimer; + bool m_bIsBrazierExtinguished; + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AI()->AttackStart(me); + } + + void WaypointReached(uint32 i) + { + Player* pPlayer = GetPlayerForEscort(); + + switch(i) + { + case 0: + if (pPlayer) + DoScriptText(SAY_MUG_START2, me, pPlayer); + break; + case 24: + if (pPlayer) + DoScriptText(SAY_MUG_BRAZIER, me, pPlayer); + + if (GameObject* pGo = GetClosestGameObjectWithEntry(me, GO_NAGA_BRAZIER, INTERACTION_DISTANCE*2)) + { + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + SetEscortPaused(true); + } + break; + case 25: + DoScriptText(SAY_MUG_GRATITUDE, me); + + if (pPlayer) + pPlayer->GroupEventHappens(QUEST_VORSHA, me); + break; + case 26: + DoScriptText(SAY_MUG_PATROL, me); + break; + case 27: + DoScriptText(SAY_MUG_RETURN, me); + break; + } + } + + void Aggro(Unit* pWho) + { + if (HasEscortState(STATE_ESCORT_PAUSED)) + { + if (urand(0, 1)) + DoScriptText(SAY_MUG_ON_GUARD, me); + return; + } + } + + void Reset() + { + m_uiEventTimer = 10000; + m_uiWaveId = 0; + m_bIsBrazierExtinguished = false; + } + + void JustDied(Unit* pKiller) + { + Player* pPlayer = GetPlayerForEscort(); + if (HasEscortState(STATE_ESCORT_ESCORTING)) + { + if (pPlayer) + { + pPlayer->FailQuest(QUEST_VORSHA); + } + } + } + + void DoWaveSummon() + { + switch(m_uiWaveId) + { + case 1: + me->SummonCreature(NPC_WRATH_RIDER, m_afFirstNagaCoord[0][0], m_afFirstNagaCoord[0][1], m_afFirstNagaCoord[0][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_SORCERESS, m_afFirstNagaCoord[1][0], m_afFirstNagaCoord[1][1], m_afFirstNagaCoord[1][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_RAZORTAIL, m_afFirstNagaCoord[2][0], m_afFirstNagaCoord[2][1], m_afFirstNagaCoord[2][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + break; + case 2: + me->SummonCreature(NPC_WRATH_PRIESTESS, m_afSecondNagaCoord[0][0], m_afSecondNagaCoord[0][1], m_afSecondNagaCoord[0][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_MYRMIDON, m_afSecondNagaCoord[1][0], m_afSecondNagaCoord[1][1], m_afSecondNagaCoord[1][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_SEAWITCH, m_afSecondNagaCoord[2][0], m_afSecondNagaCoord[2][1], m_afSecondNagaCoord[2][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + break; + case 3: + me->SummonCreature(NPC_VORSHA, m_fVorshaCoord[0], m_fVorshaCoord[1], m_fVorshaCoord[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + break; + case 4: + SetEscortPaused(false); + DoScriptText(SAY_MUG_DONE, me); + break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + npc_escortAI::UpdateAI(uiDiff); + + if (!me->getVictim()) + { + if (HasEscortState(STATE_ESCORT_PAUSED) && m_bIsBrazierExtinguished) + { + if (m_uiEventTimer < uiDiff) + { + ++m_uiWaveId; + DoWaveSummon(); + m_uiEventTimer = 10000; + } + else + m_uiEventTimer -= uiDiff; + } + return; + } + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_muglash(Creature* pCreature) +{ + return new npc_muglashAI(pCreature); +} + +bool QuestAccept_npc_muglash(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_VORSHA) + { + if (npc_muglashAI* pEscortAI = CAST_AI(npc_muglashAI, pCreature->AI())) + { + DoScriptText(SAY_MUG_START1, pCreature); + pCreature->setFaction(113); + + pEscortAI->Start(true, true, pPlayer->GetGUID()); + } + } + return true; +} + + +bool GOHello_go_naga_brazier(Player* pPlayer, GameObject* pGo) +{ + if (Creature* pCreature = GetClosestCreatureWithEntry(pGo, NPC_MUGLASH, INTERACTION_DISTANCE*2)) + { + if (npc_muglashAI* pEscortAI = CAST_AI(npc_muglashAI, pCreature->AI())) + { + DoScriptText(SAY_MUG_BRAZIER_WAIT, pCreature); + + pEscortAI->m_bIsBrazierExtinguished = true; + return false; + } + } + return true; +} + void AddSC_ashenvale() { Script *newscript; @@ -244,5 +453,16 @@ void AddSC_ashenvale() newscript->GetAI = &GetAI_npc_ruul_snowhoofAI; newscript->pQuestAccept = &QuestAccept_npc_ruul_snowhoof; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_muglash"; + newscript->GetAI = &GetAI_npc_muglash; + newscript->pQuestAccept = &QuestAccept_npc_muglash; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_naga_brazier"; + newscript->pGOHello = &GOHello_go_naga_brazier; + newscript->RegisterSelf(); } |
