Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions sql/updates/world/3.3.5/2021_04_13_01_world.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-- 11140
DELETE FROM `spell_script_names` WHERE `spell_id` = 42287 AND `ScriptName` = "spell_q11140salvage_wreckage";
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(42287,"spell_q11140salvage_wreckage");

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 13 AND `SourceEntry` = 42287;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,1,42287,0,0,31,0,5,186283,0,0,0,0,"","Group 0: Spell 'Salvage Wreckage' (Effect 0) targets object 'Shipwreck Debris'"),
(13,2,42287,0,1,31,0,5,186283,0,0,0,0,"","Group 1: Spell 'Salvage Wreckage' (Effect 1) targets object 'Shipwreck Debris'"),
(13,4,42287,0,2,31,0,5,186278,0,0,0,0,"","Group 2: Spell 'Salvage Wreckage' (Effect 2) targets object 'Burning Wreckage'");

DELETE FROM `smart_scripts` WHERE `entryorguid` = 186283 AND `source_type` = 1;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (18628300,18628301) AND `source_type` = 9;
UPDATE `gameobject_template` SET `AIName` = "" WHERE `entry` = 186283;
UPDATE `gameobject` SET `spawntimesecs` = 180 WHERE `id` IN (186283,186278);

-- 12279
DELETE FROM `spell_script_names` WHERE `spell_id` = 48794 AND `ScriptName` = "spell_q12279_cast_net";

-- 9452
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 13 AND `SourceEntry` IN (29866,29869);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,1,29866,0,0,31,0,5,181616,0,0,0,0,"","Group 0: Spell 'Cast Fishing Net' (Effect 0) targets object 'School of Red Snapper'"),
(13,2,29866,0,1,31,0,5,181616,0,0,0,0,"","Group 1: Spell 'Cast Fishing Net' (Effect 1) targets object 'School of Red Snapper'"),
(13,1,29869,0,0,31,0,5,181616,0,0,0,0,"","Group 0: Spell 'Fished Up Murloc' (Effect 0) targets object 'School of Red Snapper'");
175 changes: 75 additions & 100 deletions src/server/scripts/Spells/spell_quest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1112,125 +1112,68 @@ class spell_q14112_14145_chum_the_water: public SpellScriptLoader
}
};

// http://old01.wowhead.com/quest=9452 - Red Snapper - Very Tasty!
enum RedSnapperVeryTasty
{
ITEM_RED_SNAPPER = 23614,
SPELL_CAST_NET = 29866,
SPELL_FISHED_UP_RED_SNAPPER = 29867,
SPELL_FISHED_UP_MURLOC = 29869
};

class spell_q9452_cast_net: public SpellScriptLoader
// 29866 - Cast Fishing Net
class spell_q9452_cast_net : public SpellScript
{
public:
spell_q9452_cast_net() : SpellScriptLoader("spell_q9452_cast_net") { }

class spell_q9452_cast_net_SpellScript : public SpellScript
{
PrepareSpellScript(spell_q9452_cast_net_SpellScript);

bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
PrepareSpellScript(spell_q9452_cast_net);

void HandleDummy(SpellEffIndex /*effIndex*/)
{
Player* caster = GetCaster()->ToPlayer();
if (roll_chance_i(66))
caster->AddItem(ITEM_RED_SNAPPER, 1);
else
caster->CastSpell(caster, SPELL_FISHED_UP_MURLOC, true);
}
bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo({ SPELL_FISHED_UP_RED_SNAPPER, SPELL_FISHED_UP_MURLOC });
}

void HandleActiveObject(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
GetHitGObj()->SetRespawnTime(roll_chance_i(50) ? 2 * MINUTE : 3 * MINUTE);
GetHitGObj()->Use(GetCaster());
GetHitGObj()->SetLootState(GO_JUST_DEACTIVATED);
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();

void Register() override
{
OnEffectHit += SpellEffectFn(spell_q9452_cast_net_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnEffectHitTarget += SpellEffectFn(spell_q9452_cast_net_SpellScript::HandleActiveObject, EFFECT_1, SPELL_EFFECT_ACTIVATE_OBJECT);
}
};
if (roll_chance_i(66))
caster->CastSpell(caster, SPELL_FISHED_UP_RED_SNAPPER, true);
else
caster->CastSpell(nullptr, SPELL_FISHED_UP_MURLOC, true);
}

SpellScript* GetSpellScript() const override
{
return new spell_q9452_cast_net_SpellScript();
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_q9452_cast_net::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};

enum PoundDrumSpells
enum BreakfastOfChampions
{
SPELL_SUMMON_DEEP_JORMUNGAR = 66510,
SPELL_STORMFORGED_MOLE_MACHINE = 66492
};

class spell_q14076_14092_pound_drum : public SpellScriptLoader
{
public:
spell_q14076_14092_pound_drum() : SpellScriptLoader("spell_q14076_14092_pound_drum") { }

class spell_q14076_14092_pound_drum_SpellScript : public SpellScript
{
PrepareSpellScript(spell_q14076_14092_pound_drum_SpellScript);

void HandleSummon()
{
Unit* caster = GetCaster();

if (roll_chance_i(50))
caster->CastSpell(caster, SPELL_SUMMON_DEEP_JORMUNGAR, true);
else
caster->CastSpell(caster, SPELL_STORMFORGED_MOLE_MACHINE, true);
}

void HandleActiveObject(SpellEffIndex /*effIndex*/)
{
GetHitGObj()->SetLootState(GO_JUST_DEACTIVATED);
}

void Register() override
{
OnCast += SpellCastFn(spell_q14076_14092_pound_drum_SpellScript::HandleSummon);
OnEffectHitTarget += SpellEffectFn(spell_q14076_14092_pound_drum_SpellScript::HandleActiveObject, EFFECT_0, SPELL_EFFECT_ACTIVATE_OBJECT);
}
};

SpellScript* GetSpellScript() const override
{
return new spell_q14076_14092_pound_drum_SpellScript();
}
};

class spell_q12279_cast_net : public SpellScriptLoader
// 66512 - Pound Drum
class spell_q14076_14092_pound_drum : public SpellScript
{
public:
spell_q12279_cast_net() : SpellScriptLoader("spell_q12279_cast_net") { }
PrepareSpellScript(spell_q14076_14092_pound_drum);

class spell_q12279_cast_net_SpellScript : public SpellScript
{
PrepareSpellScript(spell_q12279_cast_net_SpellScript);
bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo({ SPELL_SUMMON_DEEP_JORMUNGAR, SPELL_STORMFORGED_MOLE_MACHINE });
}

void HandleActiveObject(SpellEffIndex /*effIndex*/)
{
GetHitGObj()->SetLootState(GO_JUST_DEACTIVATED);
}
void HandleSummon()
{
Unit* caster = GetCaster();

void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_q12279_cast_net_SpellScript::HandleActiveObject, EFFECT_1, SPELL_EFFECT_ACTIVATE_OBJECT);
}
};
if (roll_chance_i(50))
caster->CastSpell(caster, SPELL_SUMMON_DEEP_JORMUNGAR, true);
else
caster->CastSpell(caster, SPELL_STORMFORGED_MOLE_MACHINE, true);
}

SpellScript* GetSpellScript() const override
{
return new spell_q12279_cast_net_SpellScript();
}
void Register() override
{
OnCast += SpellCastFn(spell_q14076_14092_pound_drum::HandleSummon);
}
};

enum HodirsHelm
Expand Down Expand Up @@ -1689,6 +1632,38 @@ class spell_q11010_q11102_q11023_q11008_check_fly_mount : public SpellScriptLoad
}
};

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
Expand Down Expand Up @@ -2982,9 +2957,8 @@ void AddSC_quest_spell_scripts()
RegisterSpellScript(spell_q13280_13283_plant_battle_standard);
RegisterSpellScript(spell_q13280_13283_jump_jets);
new spell_q14112_14145_chum_the_water();
new spell_q9452_cast_net();
new spell_q12279_cast_net();
new spell_q14076_14092_pound_drum();
RegisterSpellScript(spell_q9452_cast_net);
RegisterSpellScript(spell_q14076_14092_pound_drum);
new spell_q12987_read_pronouncement();
new spell_q12277_wintergarde_mine_explosion();
new spell_q12066_bunny_kill_credit();
Expand All @@ -2996,6 +2970,7 @@ void AddSC_quest_spell_scripts()
new spell_q11010_q11102_q11023_aggro_burst();
new spell_q11010_q11102_q11023_choose_loc();
new spell_q11010_q11102_q11023_q11008_check_fly_mount();
RegisterSpellScript(spell_q11140salvage_wreckage);
new spell_q12372_azure_on_death_force_whisper();
new spell_q12527_zuldrak_rat();
new spell_q12661_q12669_q12676_q12677_q12713_summon_stefan();
Expand Down