Scripts/Quest: Migrate few quest spell scripts to zone files (#28015)

This commit is contained in:
offl
2022-06-10 00:15:20 +03:00
committed by GitHub
parent ee9e4ac33e
commit b52e0ccbad
8 changed files with 193 additions and 166 deletions

View File

@@ -0,0 +1,6 @@
--
UPDATE `spell_script_names` SET `ScriptName` = 'spell_undercity_bending_shinbone' WHERE `ScriptName` = 'spell_q1846_bending_shinbone';
UPDATE `spell_script_names` SET `ScriptName` = 'spell_eastern_plaguelands_test_fetid_skull' WHERE `ScriptName` = 'spell_q5206_test_fetid_skull';
UPDATE `spell_script_names` SET `ScriptName` = 'spell_azuremyst_isle_cast_fishing_net' WHERE `ScriptName` = 'spell_q9452_cast_net';
UPDATE `spell_script_names` SET `ScriptName` = 'spell_dustwallow_marsh_salvage_wreckage' WHERE `ScriptName` = 'spell_q11140salvage_wreckage';
UPDATE `spell_script_names` SET `ScriptName` = 'spell_borean_tundra_arcane_prisoner_rescue' WHERE `ScriptName` = 'spell_q11587_arcane_prisoner_rescue';

View File

@@ -177,7 +177,7 @@ void AddSC_instance_zulgurub();
//void AddSC_arathi_highlands();
void AddSC_blasted_lands();
void AddSC_duskwood();
//void AddSC_eastern_plaguelands();
void AddSC_eastern_plaguelands();
void AddSC_elwynn_forest();
//void AddSC_ghostlands();
void AddSC_hinterlands();
@@ -355,7 +355,7 @@ void AddEasternKingdomsScripts()
//AddSC_arathi_highlands();
AddSC_blasted_lands();
AddSC_duskwood();
//AddSC_eastern_plaguelands();
AddSC_eastern_plaguelands();
AddSC_elwynn_forest();
//AddSC_ghostlands();
AddSC_hinterlands();

View File

@@ -0,0 +1,56 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "SpellScript.h"
#include "Unit.h"
/*######
## Quest 5206: Marauders of Darrowshire
######*/
enum MaraudersOfDarrowshire
{
SPELL_CREATE_RESONATING_SKULL = 17269,
SPELL_CREATE_BONE_DUST = 17270
};
// 17271 - Test Fetid Skull
class spell_eastern_plaguelands_test_fetid_skull : public SpellScript
{
PrepareSpellScript(spell_eastern_plaguelands_test_fetid_skull);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_CREATE_RESONATING_SKULL, SPELL_CREATE_BONE_DUST });
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
GetCaster()->CastSpell(GetCaster(), roll_chance_i(50) ? SPELL_CREATE_RESONATING_SKULL : SPELL_CREATE_BONE_DUST, TRIGGERED_IGNORE_POWER_AND_REAGENT_COST);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_eastern_plaguelands_test_fetid_skull::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
void AddSC_eastern_plaguelands()
{
RegisterSpellScript(spell_eastern_plaguelands_test_fetid_skull);
}

View File

@@ -34,6 +34,7 @@ EndContentData */
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SpellScript.h"
/*######
## npc_lady_sylvanas_windrunner
@@ -321,6 +322,37 @@ public:
};
};
/*######
## Quest 1846: Dragonmaw Shinbones
######*/
enum DragonmawShinbones
{
SPELL_BENDING_SHINBONE1 = 8854,
SPELL_BENDING_SHINBONE2 = 8855
};
// 8856 - Bending Shinbone
class spell_undercity_bending_shinbone : public SpellScript
{
PrepareSpellScript(spell_undercity_bending_shinbone);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_BENDING_SHINBONE1, SPELL_BENDING_SHINBONE2 });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
GetCaster()->CastSpell(GetCaster(), roll_chance_i(20) ? SPELL_BENDING_SHINBONE1 : SPELL_BENDING_SHINBONE2);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_undercity_bending_shinbone::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
/*######
## AddSC
######*/
@@ -329,4 +361,5 @@ void AddSC_undercity()
{
new npc_lady_sylvanas_windrunner();
new npc_highborne_lamenter();
RegisterSpellScript(spell_undercity_bending_shinbone);
}

View File

@@ -634,6 +634,37 @@ class spell_inoculate_nestlewood : public AuraScript
}
};
/*######
## Quest 9452: Red Snapper - Very Tasty!
######*/
enum RedSnapperVeryTasty
{
SPELL_FISHED_UP_RED_SNAPPER = 29867,
SPELL_FISHED_UP_MURLOC = 29869
};
// 29866 - Cast Fishing Net
class spell_azuremyst_isle_cast_fishing_net : public SpellScript
{
PrepareSpellScript(spell_azuremyst_isle_cast_fishing_net);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_FISHED_UP_RED_SNAPPER, SPELL_FISHED_UP_MURLOC });
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
GetCaster()->CastSpell(GetCaster(), roll_chance_i(66) ? SPELL_FISHED_UP_RED_SNAPPER : SPELL_FISHED_UP_MURLOC);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_azuremyst_isle_cast_fishing_net::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
void AddSC_azuremyst_isle()
{
new npc_draenei_survivor();
@@ -642,4 +673,5 @@ void AddSC_azuremyst_isle()
new npc_magwin();
new npc_geezle();
RegisterSpellScript(spell_inoculate_nestlewood);
RegisterSpellScript(spell_azuremyst_isle_cast_fishing_net);
}

View File

@@ -110,9 +110,41 @@ class spell_energize_aoe : public SpellScript
}
};
/*######
## Quest 11140: Recover the Cargo!
######*/
enum RecoverTheCargo
{
SPELL_SUMMON_LOCKBOX = 42288,
SPELL_SUMMON_BURROWER = 42289
};
// 42287 - Salvage Wreckage
class spell_dustwallow_marsh_salvage_wreckage : public SpellScript
{
PrepareSpellScript(spell_dustwallow_marsh_salvage_wreckage);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_SUMMON_LOCKBOX, SPELL_SUMMON_BURROWER });
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
GetCaster()->CastSpell(GetCaster(), roll_chance_i(50) ? SPELL_SUMMON_LOCKBOX : SPELL_SUMMON_BURROWER);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_dustwallow_marsh_salvage_wreckage::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
void AddSC_dustwallow_marsh()
{
RegisterSpellScript(spell_ooze_zap);
RegisterSpellScript(spell_ooze_zap_channel_end);
RegisterSpellScript(spell_energize_aoe);
RegisterSpellScript(spell_dustwallow_marsh_salvage_wreckage);
}

View File

@@ -1883,6 +1883,37 @@ class spell_borean_tundra_prototype_neural_needle : public SpellScript
}
};
/*######
## Quest 11587: Prison Break
######*/
enum PrisonBreak
{
SPELL_SUMMON_ARCANE_PRISONER_1 = 45446,
SPELL_SUMMON_ARCANE_PRISONER_2 = 45448
};
// 45449 - Arcane Prisoner Rescue
class spell_borean_tundra_arcane_prisoner_rescue : public SpellScript
{
PrepareSpellScript(spell_borean_tundra_arcane_prisoner_rescue);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_SUMMON_ARCANE_PRISONER_1, SPELL_SUMMON_ARCANE_PRISONER_2 });
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
GetCaster()->CastSpell(GetCaster(), RAND(SPELL_SUMMON_ARCANE_PRISONER_1, SPELL_SUMMON_ARCANE_PRISONER_2));
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_borean_tundra_arcane_prisoner_rescue::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
void AddSC_borean_tundra()
{
RegisterCreatureAI(npc_corastrasza);
@@ -1910,4 +1941,5 @@ void AddSC_borean_tundra()
RegisterSpellScript(spell_borean_tundra_kodo_delivered);
RegisterSpellScript(spell_borean_tundra_neural_needle);
RegisterSpellScript(spell_borean_tundra_prototype_neural_needle);
RegisterSpellScript(spell_borean_tundra_arcane_prisoner_rescue);
}

View File

@@ -88,34 +88,6 @@ class spell_q55_sacred_cleansing : public SpellScriptLoader
}
};
enum BendingShinbone
{
SPELL_BENDING_SHINBONE1 = 8854,
SPELL_BENDING_SHINBONE2 = 8855
};
// 8856 - Bending Shinbone
class spell_q1846_bending_shinbone : public SpellScript
{
PrepareSpellScript(spell_q1846_bending_shinbone);
void HandleScriptEffect(SpellEffIndex /* effIndex */)
{
Item* target = GetHitItem();
Unit* caster = GetCaster();
if (!target && caster->GetTypeId() != TYPEID_PLAYER)
return;
uint32 const spellId = roll_chance_i(20) ? SPELL_BENDING_SHINBONE1 : SPELL_BENDING_SHINBONE2;
caster->CastSpell(caster, spellId, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_q1846_bending_shinbone::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
enum ThaumaturgyChannel
{
SPELL_THAUMATURGY_CHANNEL = 21029
@@ -144,41 +116,6 @@ class spell_q2203_thaumaturgy_channel : public AuraScript
}
};
// http://www.wowhead.com/quest=5206 Marauders of Darrowshire
enum Quest5206Data
{
SPELL_CREATE_RESONATING_SKULL = 17269,
SPELL_CREATE_BONE_DUST = 17270
};
// 17271 - Test Fetid Skull
class spell_q5206_test_fetid_skull : public SpellScript
{
PrepareSpellScript(spell_q5206_test_fetid_skull);
bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
bool Validate(SpellInfo const* /*spellEntry*/) override
{
return ValidateSpellInfo({ SPELL_CREATE_RESONATING_SKULL, SPELL_CREATE_BONE_DUST });
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
uint32 spellId = roll_chance_i(50) ? SPELL_CREATE_RESONATING_SKULL : SPELL_CREATE_BONE_DUST;
caster->CastSpell(caster, spellId, true);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_q5206_test_fetid_skull::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
// http://www.wowhead.com/quest=6124 Curing the Sick (A)
// http://www.wowhead.com/quest=6129 Curing the Sick (H)
enum Quests6124_6129Data
@@ -352,38 +289,6 @@ class spell_q11515_fel_siphon_dummy : public SpellScriptLoader
}
};
// http://www.wowhead.com/quest=11587 Prison Break
enum Quest11587Data
{
SPELL_SUMMON_ARCANE_PRISONER_MALE = 45446, // Summon Arcane Prisoner - Male
SPELL_SUMMON_ARCANE_PRISONER_FEMALE = 45448 // Summon Arcane Prisoner - Female
};
// 45449 - Arcane Prisoner Rescue
class spell_q11587_arcane_prisoner_rescue : public SpellScript
{
PrepareSpellScript(spell_q11587_arcane_prisoner_rescue);
bool Validate(SpellInfo const* /*spellEntry*/) override
{
return ValidateSpellInfo({ SPELL_SUMMON_ARCANE_PRISONER_MALE, SPELL_SUMMON_ARCANE_PRISONER_FEMALE });
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
uint32 spellId = SPELL_SUMMON_ARCANE_PRISONER_MALE;
if (rand32() % 2)
spellId = SPELL_SUMMON_ARCANE_PRISONER_FEMALE;
caster->CastSpell(caster, spellId, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_q11587_arcane_prisoner_rescue::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
// http://www.wowhead.com/quest=11730 Master and Servant
enum Quest11730Data
{
@@ -713,38 +618,6 @@ class spell_q13280_13283_jump_jets : public SpellScript
}
};
enum RedSnapperVeryTasty
{
SPELL_FISHED_UP_RED_SNAPPER = 29867,
SPELL_FISHED_UP_MURLOC = 29869
};
// 29866 - Cast Fishing Net
class spell_q9452_cast_net : public SpellScript
{
PrepareSpellScript(spell_q9452_cast_net);
bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo({ SPELL_FISHED_UP_RED_SNAPPER, SPELL_FISHED_UP_MURLOC });
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (roll_chance_i(66))
caster->CastSpell(caster, SPELL_FISHED_UP_RED_SNAPPER, true);
else
caster->CastSpell(nullptr, SPELL_FISHED_UP_MURLOC, true);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_q9452_cast_net::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
enum FocusOnTheBeach
{
SPELL_BUNNY_CREDIT_BEAM = 47390,
@@ -929,38 +802,6 @@ class spell_q11010_q11102_q11023_q11008_check_fly_mount : public SpellScript
}
};
enum RecoverTheCargo
{
SPELL_SUMMON_LOCKBOX = 42288,
SPELL_SUMMON_BURROWER = 42289
};
// 42287 - Salvage Wreckage
class spell_q11140salvage_wreckage : public SpellScript
{
PrepareSpellScript(spell_q11140salvage_wreckage);
bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo({ SPELL_SUMMON_LOCKBOX, SPELL_SUMMON_BURROWER });
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (roll_chance_i(50))
caster->CastSpell(caster, SPELL_SUMMON_LOCKBOX, true);
else
caster->CastSpell(nullptr, SPELL_SUMMON_BURROWER, true);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_q11140salvage_wreckage::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
enum SpellZuldrakRat
{
SPELL_SUMMON_GORGED_LURKING_BASILISK = 50928
@@ -2000,16 +1841,13 @@ class spell_quest_portal_with_condition : public SpellScript
void AddSC_quest_spell_scripts()
{
new spell_q55_sacred_cleansing();
RegisterSpellScript(spell_q1846_bending_shinbone);
RegisterSpellScript(spell_q2203_thaumaturgy_channel);
RegisterSpellScript(spell_q5206_test_fetid_skull);
RegisterSpellScript(spell_q6124_6129_apply_salve);
new spell_q10255_administer_antidote();
RegisterSpellScript(spell_q11396_11399_force_shield_arcane_purple_x3);
RegisterSpellScript(spell_q11396_11399_scourging_crystal_controller);
RegisterSpellScript(spell_q11396_11399_scourging_crystal_controller_dummy);
new spell_q11515_fel_siphon_dummy();
RegisterSpellScript(spell_q11587_arcane_prisoner_rescue);
RegisterSpellScript(spell_q11730_ultrasonic_screwdriver);
RegisterSpellScript(spell_q12459_seeds_of_natures_wrath);
RegisterSpellScript(spell_q12634_despawn_fruit_tosser);
@@ -2018,7 +1856,6 @@ void AddSC_quest_spell_scripts()
RegisterSpellScript(spell_q12805_lifeblood_dummy);
RegisterSpellScript(spell_q13280_13283_plant_battle_standard);
RegisterSpellScript(spell_q13280_13283_jump_jets);
RegisterSpellScript(spell_q9452_cast_net);
RegisterSpellScript(spell_q12066_bunny_kill_credit);
RegisterSpellScript(spell_q12372_cast_from_gossip_trigger);
RegisterSpellScript(spell_q12372_destabilize_azure_dragonshrine_dummy);
@@ -2027,7 +1864,6 @@ void AddSC_quest_spell_scripts()
RegisterSpellScript(spell_q11010_q11102_q11023_aggro_burst);
RegisterSpellScript(spell_q11010_q11102_q11023_choose_loc);
RegisterSpellScript(spell_q11010_q11102_q11023_q11008_check_fly_mount);
RegisterSpellScript(spell_q11140salvage_wreckage);
RegisterSpellScript(spell_q12527_zuldrak_rat);
RegisterSpellScript(spell_q12661_q12669_q12676_q12677_q12713_summon_stefan);
RegisterSpellScript(spell_q12730_quenching_mist);