From 5a59f99851fda11035ce6afd82a41c1c13f15e4d Mon Sep 17 00:00:00 2001 From: hondacrx Date: Fri, 16 Apr 2021 15:02:56 -0400 Subject: [PATCH] Core/Spells: fix some DB errors Port From (https://github.com/TrinityCore/TrinityCore/commit/16ec008290861573fac7137af054be6d9642712f) --- Source/Game/Spells/SpellManager.cs | 8 ++++ Source/Scripts/Spells/Generic.cs | 37 +++++++++++++++++++ ...021_03_17_00_world_2017_12_20_00_world.sql | 13 +++++++ 3 files changed, 58 insertions(+) create mode 100644 sql/updates/world/master/2021_03_17_00_world_2017_12_20_00_world.sql diff --git a/Source/Game/Spells/SpellManager.cs b/Source/Game/Spells/SpellManager.cs index 6958b4476..87294d92e 100644 --- a/Source/Game/Spells/SpellManager.cs +++ b/Source/Game/Spells/SpellManager.cs @@ -3510,6 +3510,14 @@ namespace Game.Entities break; // ENDOF ISLE OF CONQUEST SPELLS // + // Aura of Fear + case 40453: + // Bad DBC data? Copying 25820 here due to spell description + // either is a periodic with chance on tick, or a proc + spellInfo.GetEffect(0).ApplyAuraName = AuraType.ProcTriggerSpell; + spellInfo.GetEffect(0).ApplyAuraPeriod = 0; + spellInfo.ProcChance = 10; + break; // FIRELANDS SPELLS // Torment Searcher case 99253: diff --git a/Source/Scripts/Spells/Generic.cs b/Source/Scripts/Spells/Generic.cs index 22e2b272d..cb0bed859 100644 --- a/Source/Scripts/Spells/Generic.cs +++ b/Source/Scripts/Spells/Generic.cs @@ -614,6 +614,29 @@ namespace Scripts.Spells.Generic } } + [Script] // 28313 - Aura of Fear + class spell_gen_aura_of_fear : AuraScript + { + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(spellInfo.GetEffect(0).TriggerSpell); + } + + void PeriodicTick(AuraEffect aurEff) + { + PreventDefaultAction(); + if (!RandomHelper.randChance(GetSpellInfo().ProcChance)) + return; + + GetTarget().CastSpell((Unit)null, GetSpellInfo().GetEffect(aurEff.GetEffIndex()).TriggerSpell, true); + } + + public override void Register() + { + OnEffectPeriodic.Add(new EffectPeriodicHandler(PeriodicTick, 0, AuraType.PeriodicTriggerSpell)); + } + } + [Script] class spell_gen_aura_service_uniform : AuraScript { @@ -1961,6 +1984,20 @@ namespace Scripts.Spells.Generic } } + [Script] + class spell_gen_proc_charge_drop_only : AuraScript + { + void HandleChargeDrop(ProcEventInfo eventInfo) + { + PreventDefaultAction(); + } + + public override void Register() + { + OnProc.Add(new AuraProcHandler(HandleChargeDrop)); + } + } + [Script] // 45472 Parachute class spell_gen_parachute : AuraScript { diff --git a/sql/updates/world/master/2021_03_17_00_world_2017_12_20_00_world.sql b/sql/updates/world/master/2021_03_17_00_world_2017_12_20_00_world.sql new file mode 100644 index 000000000..b12e6abd9 --- /dev/null +++ b/sql/updates/world/master/2021_03_17_00_world_2017_12_20_00_world.sql @@ -0,0 +1,13 @@ +DELETE FROM `spell_proc` WHERE `SpellId` IN (45092/*, 50871*/); +INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES +(45092, 0x0, 0, 0x00000000, 0x00000000, 0x00000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0); -- Faction, Spar Buddy (SERVERSIDE) - needed to drop charge +-- (50871, 0x0, 9, 0x00000000, 0x40000000, 0x00000000, 0x0, 0x1, 0x2, 0x2, 0x0, 0, 0, 0, 0); -- Savage Rend + +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_gen_aura_of_fear'/*,'spell_gen_choking_vines'*/); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(28313, 'spell_gen_aura_of_fear'); +-- (35244, 'spell_gen_choking_vines'); + +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gen_proc_charge_drop_only' AND `spell_id`=45092; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(45092, 'spell_gen_proc_charge_drop_only');