diff options
author | Carbenium <carbenium@outlook.com> | 2020-07-27 23:05:41 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-03-11 12:54:22 +0100 |
commit | 169c6a522bda5870581472c219999677261f0c45 (patch) | |
tree | 11c752e57bc0d1870746ff4522d2ce5316fd6e2c | |
parent | 3623e1c7f2dec17810c32250899b900928ae480f (diff) |
Scripts/SholazarBasin: Make quest "Engineering a Disaster" more retail-like
* Use correct spells and add the appropriate spell scripts
* Use correct flame GOs
* Fix emotes of the escortee
(cherry picked from commit c08f086a02729f3b7e4c99f4741063e45301ebf8)
-rw-r--r-- | sql/updates/world/master/2022_03_11_13_world_2021_06_24_05_world.sql | 41 | ||||
-rw-r--r-- | src/server/scripts/Northrend/zone_sholazar_basin.cpp | 188 |
2 files changed, 147 insertions, 82 deletions
diff --git a/sql/updates/world/master/2022_03_11_13_world_2021_06_24_05_world.sql b/sql/updates/world/master/2022_03_11_13_world_2021_06_24_05_world.sql new file mode 100644 index 00000000000..f5306c37625 --- /dev/null +++ b/sql/updates/world/master/2022_03_11_13_world_2021_06_24_05_world.sql @@ -0,0 +1,41 @@ +-- NPC Engineer Helice +UPDATE creature_text SET emote = 5 WHERE CreatureID = 28787 AND GroupID = 0; +UPDATE creature_text SET emote = 25 WHERE CreatureID = 28787 AND GroupID = 1; +UPDATE creature_text SET emote = 11 WHERE CreatureID = 28787 AND GroupID = 3; +UPDATE creature_text SET emote = 25 WHERE CreatureID = 28787 AND GroupID = 4; +UPDATE creature_text SET emote = 5 WHERE CreatureID = 28787 AND GroupID = 5; +UPDATE creature_text SET emote = 4 WHERE CreatureID = 28787 AND GroupID = 6; + +DELETE FROM conditions WHERE SourceTypeOrReferenceId = 13 AND SourceEntry IN (52369, 52371); +INSERT INTO conditions (SourceTypeOrReferenceId, SourceGroup, SourceEntry, SourceId, ElseGroup, ConditionTypeOrReference, ConditionTarget, ConditionValue1, ConditionValue2, ConditionValue3, NegativeCondition, ErrorType, ErrorTextId, ScriptName, Comment) VALUES +(13, 1, 52369, 0, 0, 31, 0, 3, 28789, 0, 0, 0, 0, '', 'Spell ''Detonate Explosives'' targets trigger'), +(13, 1, 52371, 0, 0, 31, 0, 3, 28789, 0, 0, 0, 0, '', 'Spell ''Detonate Explosives'' targets trigger'); + +DELETE FROM spell_script_names WHERE spell_id IN (52369, 52371); +INSERT INTO spell_script_names (spell_id, ScriptName) VALUES +(52369, 'spell_q12688_detonate_1'), +(52371, 'spell_q12688_detonate_2'); + +-- Flames +DELETE FROM gameobject WHERE guid IN (9577, 9578, 9579, 9598, 9599, 9600); +INSERT INTO gameobject (guid, id, map, zoneId, areaId, spawnDifficulties, phaseId, position_x, position_y, position_z, orientation, rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state, ScriptName, VerifiedBuild) VALUES +(9577, 182071, 571, 0, 0, '0', 0, 5921.53, 5371.77, -96.3387, 0, 0, 0, 0.688354, 0.725374, 0, 0, 1, '', 0), +(9578, 182071, 571, 0, 0, '0', 0, 5919.42, 5366.92, -96.0911, 0, 0, 0, 0.608761, 0.793354, 0, 0, 1, '', 0), +(9579, 182071, 571, 0, 0, '0', 0, 5920.25, 5372.41, -98.8582, 0, 0, 0, -0.325567, 0.945519, 0, 0, 1, '', 0), +(9598, 182071, 571, 0, 0, '0', 0, 5888.68, 5377.42, -92.6171, 0, 0, 0, 0.9612608, 0.2756405, 0, 0, 1, '', 0), +(9599, 182071, 571, 0, 0, '0', 0, 5886.48, 5379.05, -92.9799, 0, 0, 0, 0.41469288, 0.90996146, 0, 0, 1, '', 0), +(9600, 182071, 571, 0, 0, '0', 0, 5887.20, 5381.18, -93.5000, 0, 0, 0, 0.061048508, 0.9981348, 0, 0, 1, '', 0); + +DELETE FROM spawn_group_template WHERE groupId IN (67, 68); +INSERT INTO spawn_group_template (groupId, groupName, groupFlags) VALUES +(67, 'Quest "Engineering a Disaster" (12688) - Spell Detonate (52369)', 4), +(68, 'Quest "Engineering a Disaster" (12688) - Spell Detonate (52371)', 4); + +DELETE FROM spawn_group WHERE groupId IN (67, 68); +INSERT INTO spawn_group (groupId, spawnType, spawnId) VALUES +(67, 1, 9577), +(67, 1, 9578), +(67, 1, 9579), +(68, 1, 9598), +(68, 1, 9599), +(68, 1, 9600); diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index 44cb45e0b4c..70c5d0ec729 100644 --- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -26,6 +26,7 @@ #include "SpellAuras.h" #include "SpellScript.h" #include "Vehicle.h" +#include "GameObject.h" /*###### ## npc_engineer_helice @@ -34,8 +35,9 @@ enum EngineerHelice { // Spells - SPELL_EXPLODE_CRYSTAL = 62487, - SPELL_FLAMES = 64561, + SPELL_DETONATE_1 = 52369, + SPELL_DETONATE_2 = 52371, + SPELL_EXPLOSION = 46419, // Yells SAY_WP_1 = 0, @@ -50,109 +52,129 @@ enum EngineerHelice QUEST_DISASTER = 12688 }; -class npc_engineer_helice : public CreatureScript +struct npc_engineer_helice : public EscortAI { -public: - npc_engineer_helice() : CreatureScript("npc_engineer_helice") { } + npc_engineer_helice(Creature* creature) : EscortAI(creature) { } - struct npc_engineer_heliceAI : public EscortAI + void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override { - npc_engineer_heliceAI(Creature* creature) : EscortAI(creature) + switch (waypointId) { - Initialize(); + case 0: + Talk(SAY_WP_2); + break; + case 1: + Talk(SAY_WP_3); + DoCast(SPELL_DETONATE_1); + break; + case 7: + Talk(SAY_WP_5); + break; + case 8: + DoCast(SPELL_DETONATE_2); + break; + case 9: + Talk(SAY_WP_6); + break; + case 13: + if (Player* player = GetPlayerForEscort()) + { + player->GroupEventHappens(QUEST_DISASTER, me); + Talk(SAY_WP_7); + } + break; + default: + break; } + } - void Initialize() + void JustDied(Unit* /*killer*/) override + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) { - m_uiChatTimer = 4000; + if (Player* player = GetPlayerForEscort()) + player->FailQuest(QUEST_DISASTER); } + } - uint32 m_uiChatTimer; - - void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override + void OnQuestAccept(Player* player, Quest const* quest) override + { + if (quest->GetQuestId() == QUEST_DISASTER) { - Player* player = GetPlayerForEscort(); + me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); - switch (waypointId) - { - case 0: - Talk(SAY_WP_2); - break; - case 1: - Talk(SAY_WP_3); - me->CastSpell(Position{ 5918.33f, 5372.91f, -98.770f }, SPELL_EXPLODE_CRYSTAL, true); - me->SummonGameObject(184743, 5918.33f, 5372.91f, -98.770f, 0, QuaternionData(), 3s, GO_SUMMON_TIMED_DESPAWN); - me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); - break; - case 2: - Talk(SAY_WP_4); - break; - case 7: - Talk(SAY_WP_5); - break; - case 8: - me->CastSpell(Position{ 5887.37f, 5379.39f, -91.289f }, SPELL_EXPLODE_CRYSTAL, true); - me->SummonGameObject(184743, 5887.37f, 5379.39f, -91.289f, 0, QuaternionData(), 3s, GO_SUMMON_TIMED_DESPAWN); - me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); - break; - case 9: - Talk(SAY_WP_6); - break; - case 13: - if (player) - { - player->GroupEventHappens(QUEST_DISASTER, me); - Talk(SAY_WP_7); - } - break; - } + Start(false, false, player->GetGUID()); + Talk(SAY_WP_1); } + } +}; - void Reset() override - { - Initialize(); - } +class spell_q12688_detonate_1 : public SpellScript +{ + PrepareSpellScript(spell_q12688_detonate_1); - void JustDied(Unit* /*killer*/) override - { - if (HasEscortState(STATE_ESCORT_ESCORTING)) - { - if (Player* player = GetPlayerForEscort()) - player->FailQuest(QUEST_DISASTER); - } - } + static constexpr uint32 SPAWN_GROUP_FLAMES = 67; - void UpdateAI(uint32 uiDiff) override + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_EXPLOSION }); + } + + void HandleDummyEffect(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) { - EscortAI::UpdateAI(uiDiff); + target->CastSpell(target, SPELL_EXPLOSION); - if (HasEscortState(STATE_ESCORT_ESCORTING)) - { - if (m_uiChatTimer <= uiDiff) - { - m_uiChatTimer = 12000; - } - else - m_uiChatTimer -= uiDiff; - } + std::vector<WorldObject*> flames; + target->GetMap()->SpawnGroupSpawn(SPAWN_GROUP_FLAMES, false, false, &flames); + target->GetMap()->SetSpawnGroupInactive(SPAWN_GROUP_FLAMES); + for (WorldObject* flame : flames) + dynamic_cast<GameObject*>(flame)->DespawnOrUnsummon(20s); } + } + + void HandleAfterHit() + { + if (Creature* caster = GetCaster()->ToCreature()) + caster->AI()->Talk(EngineerHelice::SAY_WP_4); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12688_detonate_1::HandleDummyEffect, EFFECT_0, SPELL_EFFECT_DUMMY); + AfterHit += SpellHitFn(spell_q12688_detonate_1::HandleAfterHit); + } +}; + +class spell_q12688_detonate_2 : public SpellScript +{ + PrepareSpellScript(spell_q12688_detonate_2); + + static constexpr uint32 SPAWN_GROUP_FLAMES = 68; + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_EXPLOSION }); + } - void OnQuestAccept(Player* player, Quest const* quest) override + void HandleDummyEffect(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) { - if (quest->GetQuestId() == QUEST_DISASTER) - { - me->GetMotionMaster()->MoveJumpTo(0, 0.4f, 0.4f); - me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); + target->CastSpell(target, SPELL_EXPLOSION); - Start(false, false, player->GetGUID()); - Talk(SAY_WP_1); - } + std::vector<WorldObject*> flames; + target->GetMap()->SpawnGroupSpawn(SPAWN_GROUP_FLAMES, false, false, &flames); + target->GetMap()->SetSpawnGroupInactive(SPAWN_GROUP_FLAMES); + for (WorldObject* flame : flames) + dynamic_cast<GameObject*>(flame)->DespawnOrUnsummon(20s); } - }; + } - CreatureAI* GetAI(Creature* creature) const override + void Register() override { - return new npc_engineer_heliceAI(creature); + OnEffectHitTarget += SpellEffectFn(spell_q12688_detonate_2::HandleDummyEffect, EFFECT_0, SPELL_EFFECT_DUMMY); } }; @@ -692,7 +714,9 @@ class spell_q12611_deathbolt : public SpellScript void AddSC_sholazar_basin() { - new npc_engineer_helice(); + RegisterCreatureAI(npc_engineer_helice); + RegisterSpellScript(spell_q12688_detonate_1); + RegisterSpellScript(spell_q12688_detonate_2); new npc_jungle_punch_target(); new spell_q12620_the_lifewarden_wrath(); new spell_q12589_shoot_rjr(); |