mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 00:18:43 +01:00
Improve scripts for quests Breakfast Of Champions and A Bear of an Appetite (#17780)
Properly despawn the related GameObjects after use of the quest item, avoiding multiple use and summon
This commit is contained in:
5
sql/updates/world/3.3.5/2016_99_99_99_world.sql
Normal file
5
sql/updates/world/3.3.5/2016_99_99_99_world.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=66512;
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` IN('spell_q14076_14092_pound_drum','spell_q12279_cast_net');
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||
(66512,'spell_q14076_14092_pound_drum'),
|
||||
(48794,'spell_q12279_cast_net');
|
||||
@@ -1127,6 +1127,75 @@ class spell_q9452_cast_net: public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
enum PoundDrumSpells
|
||||
{
|
||||
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(80))
|
||||
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
|
||||
{
|
||||
public:
|
||||
spell_q12279_cast_net() : SpellScriptLoader("spell_q12279_cast_net") { }
|
||||
|
||||
class spell_q12279_cast_net_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q12279_cast_net_SpellScript);
|
||||
|
||||
void HandleActiveObject(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
GetHitGObj()->SetLootState(GO_JUST_DEACTIVATED);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q12279_cast_net_SpellScript::HandleActiveObject, EFFECT_1, SPELL_EFFECT_ACTIVATE_OBJECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_q12279_cast_net_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum HodirsHelm
|
||||
{
|
||||
SAY_1 = 1,
|
||||
@@ -2569,6 +2638,8 @@ void AddSC_quest_spell_scripts()
|
||||
new spell_q13280_13283_plant_battle_standard();
|
||||
new spell_q14112_14145_chum_the_water();
|
||||
new spell_q9452_cast_net();
|
||||
new spell_q12279_cast_net();
|
||||
new spell_q14076_14092_pound_drum();
|
||||
new spell_q12987_read_pronouncement();
|
||||
new spell_q12277_wintergarde_mine_explosion();
|
||||
new spell_q12066_bunny_kill_credit();
|
||||
|
||||
Reference in New Issue
Block a user