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(); } void RefreshDuration() { m_aura.RefreshDuration(); }
long GetApplyTime() { return m_aura.GetApplyTime(); } long GetApplyTime() { return m_aura.GetApplyTime(); }
public int GetMaxDuration() { return m_aura.GetMaxDuration(); } 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(); } int CalcMaxDuration() { return m_aura.CalcMaxDuration(); }
// expired - duration just went to 0 // expired - duration just went to 0
public bool IsExpired() { return m_aura.IsExpired(); } public bool IsExpired() { return m_aura.IsExpired(); }
+91
View File
@@ -364,6 +364,12 @@ namespace Scripts.Spells.Generic
public const uint A_ValiantOfSilvermoon = 13696; 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] [Script]
class spell_gen_absorb0_hitlimit1 : AuraScript class spell_gen_absorb0_hitlimit1 : AuraScript
{ {
@@ -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] [Script]
class spell_gen_despawn_self : SpellScript class spell_gen_despawn_self : SpellScript
{ {
@@ -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');