Reorganizes Project (#41)
This commit is contained in:
parent
08bf44af9a
commit
3614a66aee
3499 changed files with 79 additions and 55 deletions
92
Projects/Scripts/Spells/Fifth/Paralyze.cs
Normal file
92
Projects/Scripts/Spells/Fifth/Paralyze.cs
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells.Chivalry;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Spells.Fifth
|
||||
{
|
||||
public class ParalyzeSpell : MagerySpell, ISpellTargetingMobile
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Paralyze", "An Ex Por",
|
||||
218,
|
||||
9012,
|
||||
Reagent.Garlic,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.SpidersSilk
|
||||
);
|
||||
|
||||
public ParalyzeSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override SpellCircle Circle => SpellCircle.Fifth;
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new SpellTargetMobile(this, TargetFlags.Harmful, Core.ML ? 10 : 12);
|
||||
}
|
||||
|
||||
public void Target(Mobile m)
|
||||
{
|
||||
if (m == null)
|
||||
return;
|
||||
|
||||
if (!Caster.CanSee(m))
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
else if (Core.AOS && (m.Frozen || m.Paralyzed ||
|
||||
m.Spell != null && m.Spell.IsCasting && !(m.Spell is PaladinSpell)))
|
||||
{
|
||||
Caster.SendLocalizedMessage(1061923); // The target is already frozen.
|
||||
}
|
||||
else if (CheckHSequence(m))
|
||||
{
|
||||
SpellHelper.Turn(Caster, m);
|
||||
|
||||
SpellHelper.CheckReflect((int)Circle, Caster, ref m);
|
||||
|
||||
double duration;
|
||||
|
||||
if (Core.AOS)
|
||||
{
|
||||
int secs = (int)(GetDamageSkill(Caster) / 10 - GetResistSkill(m) / 10);
|
||||
|
||||
if (!Core.SE)
|
||||
secs += 2;
|
||||
|
||||
if (!m.Player)
|
||||
secs *= 3;
|
||||
|
||||
if (secs < 0)
|
||||
secs = 0;
|
||||
|
||||
duration = secs;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Algorithm: ((20% of magery) + 7) seconds [- 50% if resisted]
|
||||
|
||||
duration = 7.0 + Caster.Skills.Magery.Value * 0.2;
|
||||
|
||||
if (CheckResisted(m))
|
||||
duration *= 0.75;
|
||||
}
|
||||
|
||||
if (m is PlagueBeastLord lord)
|
||||
{
|
||||
lord.OnParalyzed(Caster);
|
||||
duration = 120;
|
||||
}
|
||||
|
||||
m.Paralyze(TimeSpan.FromSeconds(duration));
|
||||
|
||||
m.PlaySound(0x204);
|
||||
m.FixedEffect(0x376A, 6, 1);
|
||||
|
||||
HarmfulSpell(m);
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue