mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Scripts/Spells: Removed unneccessary hacks - reagent consumption by triggered spells fixed in 54a83b4b68
This commit is contained in:
1
sql/updates/world/master/2025_01_01_01_world.sql
Normal file
1
sql/updates/world/master/2025_01_01_01_world.sql
Normal file
@@ -0,0 +1 @@
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_brewfest_relay_race_intro_force_player_to_throw','spell_silithus_summon_cultist_periodic','spell_hor_quel_delars_will','spell_kaelthas_remove_weapons');
|
||||
@@ -205,23 +205,6 @@ class spell_brewfest_exhausted_ram : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
// 43714 - Brewfest - Relay Race - Intro - Force - Player to throw- DND
|
||||
class spell_brewfest_relay_race_intro_force_player_to_throw : public SpellScript
|
||||
{
|
||||
void HandleForceCast(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
// All this spells trigger a spell that requires reagents; if the
|
||||
// triggered spell is cast as "triggered", reagents are not consumed
|
||||
GetHitUnit()->CastSpell(nullptr, GetEffectInfo().TriggerSpell, TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_REAGENT_COST);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_brewfest_relay_race_intro_force_player_to_throw::HandleForceCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST);
|
||||
}
|
||||
};
|
||||
|
||||
// 43755 - Brewfest - Daily - Relay Race - Player - Increase Mount Duration - DND
|
||||
class spell_brewfest_relay_race_turn_in : public SpellScript
|
||||
{
|
||||
@@ -634,7 +617,6 @@ void AddSC_event_brewfest()
|
||||
RegisterSpellScript(spell_brewfest_ram_fatigue);
|
||||
RegisterSpellScript(spell_brewfest_apple_trap);
|
||||
RegisterSpellScript(spell_brewfest_exhausted_ram);
|
||||
RegisterSpellScript(spell_brewfest_relay_race_intro_force_player_to_throw);
|
||||
RegisterSpellScript(spell_brewfest_relay_race_turn_in);
|
||||
RegisterSpellScript(spell_brewfest_dismount_ram);
|
||||
RegisterSpellScript(spell_brewfest_barker_bunny);
|
||||
|
||||
@@ -44,8 +44,6 @@ EndContentData */
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
/*#####
|
||||
@@ -1430,44 +1428,6 @@ class go_wind_stone : public GameObjectScript
|
||||
}
|
||||
};
|
||||
|
||||
// 24745 - Summon Templar, Trigger
|
||||
// 24747 - Summon Templar Fire, Trigger
|
||||
// 24757 - Summon Templar Air, Trigger
|
||||
// 24759 - Summon Templar Earth, Trigger
|
||||
// 24761 - Summon Templar Water, Trigger
|
||||
// 24762 - Summon Duke, Trigger
|
||||
// 24766 - Summon Duke Fire, Trigger
|
||||
// 24769 - Summon Duke Air, Trigger
|
||||
// 24771 - Summon Duke Earth, Trigger
|
||||
// 24773 - Summon Duke Water, Trigger
|
||||
// 24785 - Summon Royal, Trigger
|
||||
// 24787 - Summon Royal Fire, Trigger
|
||||
// 24791 - Summon Royal Air, Trigger
|
||||
// 24792 - Summon Royal Earth, Trigger
|
||||
// 24793 - Summon Royal Water, Trigger
|
||||
// 46595 - Summon Ice Stone Lieutenant, Trigger
|
||||
class spell_silithus_summon_cultist_periodic : public AuraScript
|
||||
{
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
return ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } }) && ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
|
||||
}
|
||||
|
||||
void PeriodicTick(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
// All these spells trigger a spell that requires reagents; if the
|
||||
// triggered spell is cast as "triggered", reagents are not consumed
|
||||
GetTarget()->CastSpell(nullptr, aurEff->GetSpellEffectInfo().TriggerSpell, CastSpellExtraArgs(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_REAGENT_COST).SetTriggeringAura(aurEff));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_silithus_summon_cultist_periodic::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_silithus()
|
||||
{
|
||||
new go_crystalline_tear();
|
||||
@@ -1475,5 +1435,4 @@ void AddSC_silithus()
|
||||
new npc_anachronos_the_ancient();
|
||||
new npc_qiraj_war_spawn();
|
||||
new go_wind_stone();
|
||||
RegisterSpellScript(spell_silithus_summon_cultist_periodic);
|
||||
}
|
||||
|
||||
@@ -2829,28 +2829,6 @@ class spell_hor_gunship_cannon_fire : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 70698 - Quel'Delar's Will
|
||||
class spell_hor_quel_delars_will : public SpellScript
|
||||
{
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
return ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } }) && ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
|
||||
}
|
||||
|
||||
void HandleReagent(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
|
||||
// dummy spell consumes reagent, don't ignore it
|
||||
GetHitUnit()->CastSpell(GetCaster(), GetEffectInfo().TriggerSpell, TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_REAGENT_COST);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_hor_quel_delars_will::HandleReagent, EFFECT_0, SPELL_EFFECT_FORCE_CAST);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_halls_of_reflection()
|
||||
{
|
||||
new at_hor_intro_start();
|
||||
@@ -2877,5 +2855,4 @@ void AddSC_halls_of_reflection()
|
||||
new spell_hor_start_halls_of_reflection_quest_ae();
|
||||
new spell_hor_evasion();
|
||||
new spell_hor_gunship_cannon_fire();
|
||||
RegisterSpellScript(spell_hor_quel_delars_will);
|
||||
}
|
||||
|
||||
@@ -280,12 +280,6 @@ constexpr uint32 SummonWeaponsSpells[] =
|
||||
SPELL_SUMMON_WEAPONE, SPELL_SUMMON_WEAPONF, SPELL_SUMMON_WEAPONG
|
||||
};
|
||||
|
||||
constexpr uint32 RemoveWeaponsSpells[] =
|
||||
{
|
||||
SPELL_REMOVE_WEAPONA, SPELL_REMOVE_WEAPONB, SPELL_REMOVE_WEAPONC, SPELL_REMOVE_WEAPOND,
|
||||
SPELL_REMOVE_WEAPONE, SPELL_REMOVE_WEAPONF, SPELL_REMOVE_WEAPONG
|
||||
};
|
||||
|
||||
constexpr uint32 GravityLapseSpells[] =
|
||||
{
|
||||
SPELL_GRAVITY_LAPSE_TELE_FRONT,
|
||||
@@ -1383,27 +1377,6 @@ class spell_kaelthas_summon_weapons : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
// 39497 - Remove Enchanted Weapons
|
||||
class spell_kaelthas_remove_weapons : public SpellScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo(RemoveWeaponsSpells);
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Player* player = GetHitPlayer())
|
||||
for (uint32 spells : RemoveWeaponsSpells)
|
||||
player->CastSpell(player, spells, TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_REAGENT_COST);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_kaelthas_remove_weapons::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_kaelthas()
|
||||
{
|
||||
RegisterTheEyeCreatureAI(boss_kaelthas);
|
||||
@@ -1417,5 +1390,4 @@ void AddSC_boss_kaelthas()
|
||||
RegisterSpellScript(spell_kael_gravity_lapse);
|
||||
RegisterSpellScript(spell_kaelthas_flame_strike);
|
||||
RegisterSpellScript(spell_kaelthas_summon_weapons);
|
||||
RegisterSpellScript(spell_kaelthas_remove_weapons);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user