Scripts/Quest: Update few quests (#28108)

(cherry picked from commit 1c96eebcc1)
This commit is contained in:
offl
2022-07-12 00:31:59 +03:00
committed by Shauren
parent 731177fa9b
commit d02989e9e6
4 changed files with 153 additions and 45 deletions

View File

@@ -0,0 +1,54 @@
--
DELETE FROM `smart_scripts` WHERE `entryorguid` = 5108 AND `source_type` = 2;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(5108,2,0,1,46,0,100,0,5108,0,0,0,0,64,1,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Areatrigger (The Stormwright's Shelf) - On Trigger - Store Targetlist"),
(5108,2,1,2,61,0,100,0,0,0,0,0,0,100,1,0,0,0,0,0,19,29079,0,0,0,0,0,0,0,"Areatrigger (The Stormwright's Shelf) - On Link - Send Target 1 (Shrine of the Tempest)"),
(5108,2,2,0,61,0,100,0,0,0,0,0,0,45,0,1,0,0,0,0,19,29079,0,0,0,0,0,0,0,"Areatrigger (The Stormwright's Shelf) - On Link - Set Data 0 1 (Shrine of the Tempest)");
DELETE FROM `areatrigger_scripts` WHERE `entry` = 5108;
INSERT INTO `areatrigger_scripts` (`entry`,`ScriptName`) VALUES
(5108,"SmartTrigger");
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = 5108 AND `SourceId` = 2;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(22,1,5108,2,0,9,0,12741,0,0,0,0,0,"","Group 0: Execute SAI (Action 0) if player has taken quest 'Strength of the Tempest'");
DELETE FROM `smart_scripts` WHERE `entryorguid` = 29079 AND `source_type` = 0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(29079,0,0,0,38,0,100,0,0,1,0,0,0,11,53062,0,0,0,0,0,12,1,0,0,0,0,0,0,0,"Shrine of the Tempest - On Data Set 0 1 - Cast 'Lightning Strike'");
DELETE FROM `spell_scripts` WHERE `id` = 53062;
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_sholazar_lightning_strike';
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(53062,'spell_sholazar_lightning_strike');
--
DELETE FROM `spell_scripts` WHERE `id` = 51071;
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_sholazar_flight_to_sholazar';
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(51071,'spell_sholazar_flight_to_sholazar');
DELETE FROM `creature_text` WHERE `CreatureID` = 28192;
-- Yes, it is unrealistic that other 8 will be used
DELETE FROM `spell_scripts` WHERE `id` IN (53341,53343);
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_chapter1_runeforging_credit';
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
-- (53323,'spell_chapter1_runeforging_credit'),
-- (53331,'spell_chapter1_runeforging_credit'),
-- (53341,'spell_chapter1_runeforging_credit'),
-- (53342,'spell_chapter1_runeforging_credit'),
(53343,'spell_chapter1_runeforging_credit'),
(53344,'spell_chapter1_runeforging_credit'),
-- (54446,'spell_chapter1_runeforging_credit'),
-- (54447,'spell_chapter1_runeforging_credit'),
(62158,'spell_chapter1_runeforging_credit'),
-- (70164,'spell_chapter1_runeforging_credit');
(326805,'spell_chapter1_runeforging_credit'),
(326855,'spell_chapter1_runeforging_credit'),
(326911,'spell_chapter1_runeforging_credit'),
(326977,'spell_chapter1_runeforging_credit'),
(327082,'spell_chapter1_runeforging_credit');
-- Already scripted.
DELETE FROM `spell_scripts` WHERE `id` IN (40904,44997);

View File

@@ -1102,6 +1102,43 @@ class spell_gift_of_the_harvester : public SpellScript
}
};
/*######
## Quest 12842: Runeforging: Preparation For Battle
######*/
enum Runeforging
{
SPELL_RUNEFORGING_CREDIT = 54586
};
/* 53343 - Rune of Razorice
53344 - Rune of the Fallen Crusader
62158 - Rune of the Stoneskin Gargoyle
326805 - Rune of Sanguination
326855 - Rune of Spellwarding
326911 - Rune of Hysteria
326977 - Rune of Unending Thirst
327082 - Rune of the Apocalypse */
class spell_chapter1_runeforging_credit : public SpellScript
{
PrepareSpellScript(spell_chapter1_runeforging_credit);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_RUNEFORGING_CREDIT });
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
GetCaster()->CastSpell(GetCaster(), SPELL_RUNEFORGING_CREDIT);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_chapter1_runeforging_credit::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};
void AddSC_the_scarlet_enclave_c1()
{
new npc_unworthy_initiate();
@@ -1118,4 +1155,5 @@ void AddSC_the_scarlet_enclave_c1()
new npc_dkc1_gothik();
RegisterCreatureAI(npc_scarlet_ghoul);
RegisterSpellScript(spell_gift_of_the_harvester);
RegisterSpellScript(spell_chapter1_runeforging_credit);
}

View File

@@ -17,6 +17,7 @@
#include "ScriptMgr.h"
#include "CombatAI.h"
#include "DB2Stores.h"
#include "Map.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
@@ -737,6 +738,64 @@ class spell_sholazar_song_of_cleansing : public SpellScript
}
};
/*######
## Quest 12741: Strength of the Tempest
######*/
enum StrengthOfTheTempest
{
SPELL_CREATE_POWER_OF_THE_TEMPEST = 53067
};
// 53062 - Lightning Strike
class spell_sholazar_lightning_strike : public SpellScript
{
PrepareSpellScript(spell_sholazar_lightning_strike);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_CREATE_POWER_OF_THE_TEMPEST });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
GetHitUnit()->CastSpell(GetHitUnit(), SPELL_CREATE_POWER_OF_THE_TEMPEST);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_sholazar_lightning_strike::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
/*######
## Quest 12521: Where in the World is Hemet Nesingwary?
######*/
// 51071 - Flight to Sholazar (Missile Warning)
class spell_sholazar_flight_to_sholazar : public SpellScript
{
PrepareSpellScript(spell_sholazar_flight_to_sholazar);
bool Validate(SpellInfo const* spellInfo) override
{
return sBroadcastTextStore.LookupEntry(uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()));
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
// 51076 (triggers 51071) is Area Aura - Party and applies on player too (no aura in sniffs on player)
// That makes both player and creature say
if (Creature* caster = GetCaster()->ToCreature())
caster->Unit::Say(uint32(GetEffectValue()), caster);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_sholazar_flight_to_sholazar::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
void AddSC_sholazar_basin()
{
RegisterCreatureAI(npc_engineer_helice);
@@ -750,4 +809,6 @@ void AddSC_sholazar_basin()
RegisterSpellScript(spell_sholazar_take_sputum_sample);
RegisterSpellScript(spell_sholazar_sputum_collected);
RegisterSpellScript(spell_sholazar_song_of_cleansing);
RegisterSpellScript(spell_sholazar_lightning_strike);
RegisterSpellScript(spell_sholazar_flight_to_sholazar);
}

View File

@@ -15,25 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Areatrigger_Scripts
SD%Complete: 100
SDComment: Scripts for areatriggers
SDCategory: Areatrigger
EndScriptData */
/* ContentData
at_coilfang_waterfall 4591
at_legion_teleporter 4560 Teleporter TO Invasion Point: Cataclysm
at_stormwright_shelf q12741
at_last_rites q12019
at_sholazar_waygate q12548
at_nats_landing q11209
at_bring_your_orphan_to q910 q910 q1800 q1479 q1687 q1558 q10951 q10952
at_brewfest
at_area_52_entrance
EndContentData */
#include "ScriptMgr.h"
#include "AreaTriggerAI.h"
#include "DB2Structure.h"
@@ -110,31 +91,6 @@ class AreaTrigger_at_legion_teleporter : public AreaTriggerScript
}
};
/*######
## at_stormwright_shelf
######*/
enum StormwrightShelf
{
QUEST_STRENGTH_OF_THE_TEMPEST = 12741,
SPELL_CREATE_TRUE_POWER_OF_THE_TEMPEST = 53067
};
class AreaTrigger_at_stormwright_shelf : public AreaTriggerScript
{
public:
AreaTrigger_at_stormwright_shelf() : AreaTriggerScript("at_stormwright_shelf") { }
bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) override
{
if (!player->isDead() && player->GetQuestStatus(QUEST_STRENGTH_OF_THE_TEMPEST) == QUEST_STATUS_INCOMPLETE)
player->CastSpell(player, SPELL_CREATE_TRUE_POWER_OF_THE_TEMPEST, false);
return true;
}
};
/*######
## at_scent_larkorwi
######*/
@@ -455,7 +411,6 @@ void AddSC_areatrigger_scripts()
{
new AreaTrigger_at_coilfang_waterfall();
new AreaTrigger_at_legion_teleporter();
new AreaTrigger_at_stormwright_shelf();
new AreaTrigger_at_scent_larkorwi();
new AreaTrigger_at_sholazar_waygate();
new AreaTrigger_at_nats_landing();