Core/Scripts: implemented Fungal Decay & Tail Sting

Port From (https://github.com/TrinityCore/TrinityCore/commit/d36f8bb7547c5ebef067f834c79754c57ff66a34)
This commit is contained in:
hondacrx
2021-06-24 00:03:16 -04:00
parent 1d9e839bc9
commit 3265d6ea17
3 changed files with 111 additions and 12 deletions
+1 -1
View File
@@ -1465,7 +1465,7 @@ namespace Game.Scripting
void RefreshDuration() { m_aura.RefreshDuration(); }
long GetApplyTime() { return m_aura.GetApplyTime(); }
public int GetMaxDuration() { return m_aura.GetMaxDuration(); }
void SetMaxDuration(int duration) { m_aura.SetMaxDuration(duration); }
public void SetMaxDuration(int duration) { m_aura.SetMaxDuration(duration); }
int CalcMaxDuration() { return m_aura.CalcMaxDuration(); }
// expired - duration just went to 0
public bool IsExpired() { return m_aura.IsExpired(); }
+102 -11
View File
@@ -364,6 +364,12 @@ namespace Scripts.Spells.Generic
public const uint A_ValiantOfSilvermoon = 13696;
}
struct Misc
{
//FungalDecay
public const int AuraDuration = 12600; // found in sniffs, there is no duration entry we can possibly use
}
[Script]
class spell_gen_absorb0_hitlimit1 : AuraScript
{
@@ -596,7 +602,7 @@ namespace Scripts.Spells.Generic
OnEffectUpdatePeriodic.Add(new EffectUpdatePeriodicHandler(UpdatePeriodic, 1, AuraType.PeriodicDummy));
}
}
[Script] // 41337 Aura of Anger
class spell_gen_aura_of_anger : AuraScript
{
@@ -636,7 +642,7 @@ namespace Scripts.Spells.Generic
OnEffectPeriodic.Add(new EffectPeriodicHandler(PeriodicTick, 0, AuraType.PeriodicTriggerSpell));
}
}
[Script]
class spell_gen_aura_service_uniform : AuraScript
{
@@ -966,7 +972,7 @@ namespace Scripts.Spells.Generic
OnEffectUpdatePeriodic.Add(new EffectUpdatePeriodicHandler(UpdatePeriodic, 1, AuraType.PeriodicDummy));
}
}
[Script]
class spell_gen_chaos_blast : SpellScript
{
@@ -1270,6 +1276,91 @@ namespace Scripts.Spells.Generic
}
}
[Script] // 32065 - Fungal Decay
class spell_gen_decay_over_time_fungal_decay_SpellScript : SpellScript
{
void ModAuraStack()
{
Aura aur = GetHitAura();
if (aur != null)
aur.SetStackAmount((byte)GetSpellInfo().StackAmount);
}
public override void Register()
{
AfterHit.Add(new HitHandler(ModAuraStack));
}
}
[Script] // 32065 - Fungal Decay
class spell_gen_decay_over_time_fungal_decay_AuraScript : AuraScript
{
void ModDuration(AuraEffect aurEff, AuraEffectHandleModes mode)
{
// only on actual reapply, not on stack decay
if (GetDuration() == GetMaxDuration())
{
SetMaxDuration(Misc.AuraDuration);
SetDuration(Misc.AuraDuration);
}
}
bool CheckProc(ProcEventInfo eventInfo)
{
return eventInfo.GetSpellInfo() == GetSpellInfo();
}
void Decay(ProcEventInfo eventInfo)
{
PreventDefaultAction();
ModStackAmount(-1);
}
public override void Register()
{
DoCheckProc.Add(new CheckProcHandler(CheckProc));
OnProc.Add(new AuraProcHandler(Decay));
OnEffectApply.Add(new EffectApplyHandler(ModDuration, 0, AuraType.ModDecreaseSpeed, AuraEffectHandleModes.RealOrReapplyMask));
}
}
[Script] // 36659 - Tail Sting
class spell_gen_decay_over_time_tail_sting_SpellScript : SpellScript
{
void ModAuraStack()
{
Aura aur = GetHitAura();
if (aur != null)
aur.SetStackAmount((byte)GetSpellInfo().StackAmount);
}
public override void Register()
{
AfterHit.Add(new HitHandler(ModAuraStack));
}
}
[Script] // 36659 - Tail Sting
class spell_gen_decay_over_time_tail_sting_AuraScript : AuraScript
{
bool CheckProc(ProcEventInfo eventInfo)
{
return eventInfo.GetSpellInfo() == GetSpellInfo();
}
void Decay(ProcEventInfo eventInfo)
{
PreventDefaultAction();
ModStackAmount(-1);
}
public override void Register()
{
DoCheckProc.Add(new CheckProcHandler(CheckProc));
OnProc.Add(new AuraProcHandler(Decay));
}
}
[Script]
class spell_gen_despawn_self : SpellScript
{
@@ -1742,7 +1833,7 @@ namespace Scripts.Spells.Generic
OnEffectPeriodic.Add(new EffectPeriodicHandler(PeriodicTick, 0, AuraType.PeriodicTriggerSpell));
}
}
[Script] // 28702 - Netherbloom
class spell_gen_netherbloom : SpellScript
{
@@ -1825,10 +1916,10 @@ namespace Scripts.Spells.Generic
public override void Register()
{
OnEffectPeriodic .Add(new EffectPeriodicHandler(PeriodicTick, 1, AuraType.PeriodicTriggerSpell));
OnEffectPeriodic.Add(new EffectPeriodicHandler(PeriodicTick, 1, AuraType.PeriodicTriggerSpell));
}
}
[Script] // 27539 - Obsidian Armor
class spell_gen_obsidian_armor : AuraScript
{
@@ -2010,7 +2101,7 @@ namespace Scripts.Spells.Generic
OnProc.Add(new AuraProcHandler(HandleChargeDrop));
}
}
[Script] // 45472 Parachute
class spell_gen_parachute : AuraScript
{
@@ -2240,7 +2331,7 @@ namespace Scripts.Spells.Generic
public override void Register()
{
OnEffectPeriodic .Add(new EffectPeriodicHandler(PeriodicTick, 0, AuraType.PeriodicDamage));
OnEffectPeriodic.Add(new EffectPeriodicHandler(PeriodicTick, 0, AuraType.PeriodicDamage));
}
}
@@ -2261,10 +2352,10 @@ namespace Scripts.Spells.Generic
public override void Register()
{
OnEffectPeriodic .Add(new EffectPeriodicHandler(PeriodicTick, 2, AuraType.PeriodicDamagePercent));
OnEffectPeriodic.Add(new EffectPeriodicHandler(PeriodicTick, 2, AuraType.PeriodicDamagePercent));
}
}
[Script]
class spell_gen_replenishment : SpellScript
{
@@ -2472,7 +2563,7 @@ namespace Scripts.Spells.Generic
[Script]
class spell_gen_spectator_cheer_trigger : SpellScript
{
{
readonly static Emote[] EmoteArray = { Emote.OneshotCheer, Emote.OneshotExclamation, Emote.OneshotApplaud };
void HandleDummy(uint effIndex)
@@ -0,0 +1,8 @@
DELETE FROM `spell_proc` WHERE `SpellId` IN (32065, 36659);
INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES
(32065, 0x0, 0, 0x00000000, 0x00000000, 0x00000000, 0x80000, 0x1, 0x0, 0x0, 0x0, 0, 0, 0, 0),
(36659, 0x0, 0, 0x00000000, 0x00000000, 0x00000000, 0x80000, 0x1, 0x0, 0x0, 0x0, 0, 0, 0, 0);
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_gen_decay_over_time_fungal_decay','spell_gen_decay_over_time_tail_sting');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(32065, 'spell_gen_decay_over_time_fungal_decay'),
(36659, 'spell_gen_decay_over_time_tail_sting');