Fixes code according to modern code style. Fixes a few expression bugs.
This commit is contained in:
parent
89eea25e5f
commit
970fd563b2
3324 changed files with 441118 additions and 433755 deletions
|
|
@ -2,118 +2,115 @@ using Server.Targeting;
|
|||
|
||||
namespace Server.Spells.Seventh
|
||||
{
|
||||
public class ManaVampireSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Mana Vampire", "Ort Sanct",
|
||||
221,
|
||||
9032,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.SpidersSilk
|
||||
);
|
||||
public class ManaVampireSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Mana Vampire", "Ort Sanct",
|
||||
221,
|
||||
9032,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.SpidersSilk
|
||||
);
|
||||
|
||||
public override SpellCircle Circle => SpellCircle.Seventh;
|
||||
public ManaVampireSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public ManaVampireSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
public override SpellCircle Circle => SpellCircle.Seventh;
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public void Target( Mobile m )
|
||||
{
|
||||
if ( !Caster.CanSee( m ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
|
||||
}
|
||||
else if ( CheckHSequence( m ) )
|
||||
{
|
||||
SpellHelper.Turn( Caster, m );
|
||||
public void Target(Mobile m)
|
||||
{
|
||||
if (!Caster.CanSee(m))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (CheckHSequence(m))
|
||||
{
|
||||
SpellHelper.Turn(Caster, m);
|
||||
|
||||
SpellHelper.CheckReflect( (int)Circle, Caster, ref m );
|
||||
SpellHelper.CheckReflect((int)Circle, Caster, ref m);
|
||||
|
||||
m.Spell?.OnCasterHurt();
|
||||
m.Spell?.OnCasterHurt();
|
||||
|
||||
m.Paralyzed = false;
|
||||
m.Paralyzed = false;
|
||||
|
||||
int toDrain = 0;
|
||||
int toDrain = 0;
|
||||
|
||||
if ( Core.AOS )
|
||||
{
|
||||
toDrain = (int)(GetDamageSkill( Caster ) - GetResistSkill( m ));
|
||||
if (Core.AOS)
|
||||
{
|
||||
toDrain = (int)(GetDamageSkill(Caster) - GetResistSkill(m));
|
||||
|
||||
if ( !m.Player )
|
||||
toDrain /= 2;
|
||||
if (!m.Player)
|
||||
toDrain /= 2;
|
||||
|
||||
if ( toDrain < 0 )
|
||||
toDrain = 0;
|
||||
else if ( toDrain > m.Mana )
|
||||
toDrain = m.Mana;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( CheckResisted( m ) )
|
||||
m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
|
||||
else
|
||||
toDrain = m.Mana;
|
||||
}
|
||||
if (toDrain < 0)
|
||||
toDrain = 0;
|
||||
else if (toDrain > m.Mana)
|
||||
toDrain = m.Mana;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CheckResisted(m))
|
||||
m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
|
||||
else
|
||||
toDrain = m.Mana;
|
||||
}
|
||||
|
||||
if ( toDrain > (Caster.ManaMax - Caster.Mana) )
|
||||
toDrain = Caster.ManaMax - Caster.Mana;
|
||||
if (toDrain > Caster.ManaMax - Caster.Mana)
|
||||
toDrain = Caster.ManaMax - Caster.Mana;
|
||||
|
||||
m.Mana -= toDrain;
|
||||
Caster.Mana += toDrain;
|
||||
m.Mana -= toDrain;
|
||||
Caster.Mana += toDrain;
|
||||
|
||||
if ( Core.AOS )
|
||||
{
|
||||
m.FixedParticles( 0x374A, 1, 15, 5054, 23, 7, EffectLayer.Head );
|
||||
m.PlaySound( 0x1F9 );
|
||||
if (Core.AOS)
|
||||
{
|
||||
m.FixedParticles(0x374A, 1, 15, 5054, 23, 7, EffectLayer.Head);
|
||||
m.PlaySound(0x1F9);
|
||||
|
||||
Caster.FixedParticles( 0x0000, 10, 5, 2054, EffectLayer.Head );
|
||||
}
|
||||
else
|
||||
{
|
||||
m.FixedParticles( 0x374A, 10, 15, 5054, EffectLayer.Head );
|
||||
m.PlaySound( 0x1F9 );
|
||||
}
|
||||
Caster.FixedParticles(0x0000, 10, 5, 2054, EffectLayer.Head);
|
||||
}
|
||||
else
|
||||
{
|
||||
m.FixedParticles(0x374A, 10, 15, 5054, EffectLayer.Head);
|
||||
m.PlaySound(0x1F9);
|
||||
}
|
||||
|
||||
HarmfulSpell( m );
|
||||
}
|
||||
HarmfulSpell(m);
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
public override double GetResistPercent( Mobile target )
|
||||
{
|
||||
return 98.0;
|
||||
}
|
||||
public override double GetResistPercent(Mobile target)
|
||||
{
|
||||
return 98.0;
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private ManaVampireSpell m_Owner;
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private ManaVampireSpell m_Owner;
|
||||
|
||||
public InternalTarget( ManaVampireSpell owner ) : base( Core.ML ? 10 : 12, false, TargetFlags.Harmful )
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
public InternalTarget(ManaVampireSpell owner) : base(Core.ML ? 10 : 12, false, TargetFlags.Harmful)
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
if ( o is Mobile )
|
||||
{
|
||||
m_Owner.Target( (Mobile)o );
|
||||
}
|
||||
}
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (o is Mobile) m_Owner.Target((Mobile)o);
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue