public static bool CheckReflectDamage(Mobile m, Spell spell) { var context = GetContext(m); if (context != null) { var reduce = 0; if (spell is MagerySpell magerySpell) { reduce = (int)(magerySpell.Circle + 1) * 10; } else if (spell is MysticSpell mysticSpell) { reduce = (int)(mysticSpell.Circle + 1) * 10; } else if (spell is NecromancerSpell necroSpell) { reduce = (int)necroSpell.RequiredSkill; } else if (spell is ArcanistSpell arcanistSpell) { reduce = (int)arcanistSpell.RequiredSkill; } else if (spell is SkillMasterySpell masterySpell) { reduce = (int)masterySpell.RequiredSkill; } if (reduce > context.ReflectPool) { m.SendLocalizedMessage(1149981); // Your magic is not great enough to reflect the incoming spell. context.ReflectPool = 0; CooldownTimer.AddTimer(m); } else { m.SendLocalizedMessage(1149980); // You reflect the incoming spell. context.ReflectPool -= reduce; if (context.ReflectPool == 0) { m.SendLocalizedMessage(1150066); // Your magic reflection pool has been depleted. CooldownTimer.AddTimer(m); } string buffFormat = string.Format("{0}\t+{1}\t+{1}\t+{1}\t+{1}\t{2}\t{3}", context.Mods[0].Offset, context.Mods[1].Offset, "-5", context.ReflectPool); BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.MagicReflection, 1015197, 1149979, buffFormat, true)); return(true); } } return(false); }
public static void Expire(MagicReflectContext context) { var caster = context.Caster; caster.PlaySound(0x1ED); caster.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist); if (context.NextReplenish > DateTime.UtcNow) { CooldownTimer.AddTimer(context.Caster, context.NextReplenish - DateTime.UtcNow); } EndReflect(context); }
public override void InitTimers() { CooldownTimer.AddTimer(tileTimer); }
public override void InitTimers() { CooldownTimer.AddTimer(cooldown); }
public override void InitTimers() { CooldownTimer.AddTimer(trackTimer); CooldownTimer.AddTimer(dmgTimer); }