diff --git a/GameServer/styles/StyleProcessor.cs b/GameServer/styles/StyleProcessor.cs index d2c9c42b77..336f62fa77 100644 --- a/GameServer/styles/StyleProcessor.cs +++ b/GameServer/styles/StyleProcessor.cs @@ -590,43 +590,26 @@ protected static bool CheckWeaponType(Style style, GameLiving living, DbInventor /// The spellid of the magical effect protected static ISpellHandler CreateMagicEffect(GameLiving caster, GameLiving target, int spellID) { - SpellLine styleLine = SkillBase.GetSpellLine(GlobalSpellsLines.Combat_Styles_Effect); - if (styleLine == null || target == null) return null; + Spell spell = SkillBase.GetSpellByID(spellID); - List spells = SkillBase.GetSpellList(styleLine.KeyName); + if (spell == null) + return null; - Spell styleSpell = null; - foreach (Spell spell in spells) - { - if (spell.ID == spellID) - { - // We have to scale style procs when cast - if (caster is GameSummonedPet pet) - pet.ScalePetSpell(spell); + // We have to scale style procs when cast. + if (caster is GameSummonedPet pet) + pet.ScalePetSpell(spell); - styleSpell = spell; - break; - } - } + ISpellHandler spellHandler = ScriptMgr.CreateSpellHandler(caster, spell, SkillBase.GetSpellLine(GlobalSpellsLines.Combat_Styles_Effect)); - ISpellHandler spellHandler = ScriptMgr.CreateSpellHandler(caster, styleSpell, styleLine); - if (spellHandler == null && styleSpell != null && caster is GamePlayer) - { - ((GamePlayer)caster).Out.SendMessage(styleSpell.Name + " not implemented yet (" + styleSpell.SpellType + ")", eChatType.CT_System, eChatLoc.CL_SystemWindow); + if (spellHandler == null) return null; - } - // No negative effects can be applied on a keep door or via attacking a keep door - if ((target is GameKeepComponent || target is GameKeepDoor) && spellHandler?.HasPositiveEffect == false) - { + if ((target is GameKeepComponent || target is GameDoorBase) && !spellHandler.HasPositiveEffect) return null; - } - return spellHandler; } - /// /// Delve a Style handled by this processor ///