From 4ada3fccdfc4d154efa74c0e4e94819bc95fc218 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Wed, 14 Jul 2021 18:43:01 -0400 Subject: [PATCH] Implemented Implemented SE_Fearstun 502 Stun with a max level limit. Normal stun restrictions don't apply. Base1 duration, base2 PC duration, max is level limit SE_TwinCastBlocker 39 Previously unused spell effect that is now used on live. Simply, if this effect is present in a spell then the spell can not be twin cast. --- common/spdat.h | 4 ++-- zone/mob.cpp | 3 +++ zone/spell_effects.cpp | 27 +++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/common/spdat.h b/common/spdat.h index ec4dca3fa..fa2bdd369 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -381,7 +381,7 @@ typedef enum { #define SE_PoisonCounter 36 // implemented //#define SE_DetectHostile 37 // not used //#define SE_DetectMagic 38 // not used -//#define SE_DetectPoison 39 // not used TODO: NEW EFFECT Stacking:: Twincast Blocker +#define SE_TwinCastBlocker 39 // implemented - If present in spell, then the spell can not be twincast. #define SE_DivineAura 40 // implemented #define SE_Destroy 41 // implemented - Disintegrate, Banishment of Shadows #define SE_ShadowStep 42 // implemented @@ -844,7 +844,7 @@ typedef enum { //#define SE_AddExtraAttackPct_1h_Secondary 499 // //#define SE_Fc_CastTimeMod2 500 // //#define SE_Fc_CastTimeAmt 501 // -//#define SE_Fearstun 502 // +#define SE_Fearstun 502 // implemented - Stun with a max level limit. Normal stun restrictions don't apply. #define SE_Melee_Damage_Position_Mod 503 // implemented - modify melee damage by pct if done from Front or Behind //#define SE_Melee_Damage_Position_Amt 504 // #define SE_Damage_Taken_Position_Mod 505 // implemented - mitigate melee damage by pct if dmg taken from Front or Behind diff --git a/zone/mob.cpp b/zone/mob.cpp index 80c1ccfcd..60037057a 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -3701,6 +3701,9 @@ void Mob::TryTwincast(Mob *caster, Mob *target, uint32 spell_id) if(!IsValidSpell(spell_id)) return; + if (IsEffectInSpell(spell_id, SE_TwinCastBlocker)) + return; + if(IsClient()) { int32 focus = CastToClient()->GetFocusEffect(focusTwincast, spell_id); diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 59682fc52..08f912189 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -2918,6 +2918,32 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove caster->SetTopRampageList(); break; } + + case SE_Fearstun: { + //Normal 'stun' restrictions do not apply. base1=duration, base2=PC duration, max =lv restrict + if (!caster) + break; + + if (IsNPC() && GetSpecialAbility(UNSTUNABLE)) { + caster->MessageString(Chat::SpellFailure, IMMUNE_STUN); + break; + } + + if (IsNPC() && GetSpecialAbility(UNFEARABLE)) { + caster->MessageString(Chat::SpellFailure, IMMUNE_FEAR); + break; + } + + if (GetLevel() <= spells[spell_id].max[i]) { + if (IsClient()) + Stun(spells[spell_id].base2[i]); + else + Stun(effect_value); + } + else + caster->MessageString(Chat::SpellFailure, FEAR_TOO_HIGH); + break; + } case SE_PersistentEffect: MakeAura(spell_id); @@ -3177,6 +3203,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_Double_Backstab_Front: case SE_Pet_Crit_Melee_Damage_Pct_Owner: case SE_Pet_Add_Atk: + case SE_TwinCastBlocker: { break; }