Fixes code according to modern code style. Fixes a few expression bugs.

This commit is contained in:
Kamron Batman 2018-09-15 09:58:51 -07:00
parent 89eea25e5f
commit 970fd563b2
3324 changed files with 441118 additions and 433755 deletions

View file

@ -1,111 +1,110 @@
using Server.Targeting;
using Server.Engines.ConPVP;
using Server.Gumps;
using Server.Targeting;
namespace Server.Spells.Eighth
{
public class ResurrectionSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
"Resurrection", "An Corp",
245,
9062,
Reagent.Bloodmoss,
Reagent.Garlic,
Reagent.Ginseng
);
public class ResurrectionSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
"Resurrection", "An Corp",
245,
9062,
Reagent.Bloodmoss,
Reagent.Garlic,
Reagent.Ginseng
);
public override SpellCircle Circle => SpellCircle.Eighth;
public ResurrectionSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{
}
public ResurrectionSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override SpellCircle Circle => SpellCircle.Eighth;
public override bool CheckCast()
{
if ( Engines.ConPVP.DuelContext.CheckSuddenDeath( Caster ) )
{
Caster.SendMessage( 0x22, "You cannot cast this spell when in sudden death." );
return false;
}
public override bool CheckCast()
{
if (DuelContext.CheckSuddenDeath(Caster))
{
Caster.SendMessage(0x22, "You cannot cast this spell when in sudden death.");
return false;
}
return base.CheckCast();
}
return base.CheckCast();
}
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 ( m == Caster )
{
Caster.SendLocalizedMessage( 501039 ); // Thou can not resurrect thyself.
}
else if ( !Caster.Alive )
{
Caster.SendLocalizedMessage( 501040 ); // The resurrecter must be alive.
}
else if ( m.Alive )
{
Caster.SendLocalizedMessage( 501041 ); // Target is not dead.
}
else if ( !Caster.InRange( m, 1 ) )
{
Caster.SendLocalizedMessage( 501042 ); // Target is not close enough.
}
else if ( !m.Player )
{
Caster.SendLocalizedMessage( 501043 ); // Target is not a being.
}
else if ( m.Map == null || !m.Map.CanFit( m.Location, 16, false, false ) )
{
Caster.SendLocalizedMessage( 501042 ); // Target can not be resurrected at that location.
m.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
}
else if ( m.Region != null && m.Region.IsPartOf( "Khaldun" ) )
{
Caster.SendLocalizedMessage( 1010395 ); // The veil of death in this area is too strong and resists thy efforts to restore life.
}
else if ( CheckBSequence( m, true ) )
{
SpellHelper.Turn( Caster, m );
public void Target(Mobile m)
{
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (m == Caster)
{
Caster.SendLocalizedMessage(501039); // Thou can not resurrect thyself.
}
else if (!Caster.Alive)
{
Caster.SendLocalizedMessage(501040); // The resurrecter must be alive.
}
else if (m.Alive)
{
Caster.SendLocalizedMessage(501041); // Target is not dead.
}
else if (!Caster.InRange(m, 1))
{
Caster.SendLocalizedMessage(501042); // Target is not close enough.
}
else if (!m.Player)
{
Caster.SendLocalizedMessage(501043); // Target is not a being.
}
else if (m.Map == null || !m.Map.CanFit(m.Location, 16, false, false))
{
Caster.SendLocalizedMessage(501042); // Target can not be resurrected at that location.
m.SendLocalizedMessage(502391); // Thou can not be resurrected there!
}
else if (m.Region != null && m.Region.IsPartOf("Khaldun"))
{
Caster.SendLocalizedMessage(
1010395); // The veil of death in this area is too strong and resists thy efforts to restore life.
}
else if (CheckBSequence(m, true))
{
SpellHelper.Turn(Caster, m);
m.PlaySound( 0x214 );
m.FixedEffect( 0x376A, 10, 16 );
m.PlaySound(0x214);
m.FixedEffect(0x376A, 10, 16);
m.CloseGump( typeof( ResurrectGump ) );
m.SendGump( new ResurrectGump( m, Caster ) );
}
m.CloseGump(typeof(ResurrectGump));
m.SendGump(new ResurrectGump(m, Caster));
}
FinishSequence();
}
FinishSequence();
}
private class InternalTarget : Target
{
private ResurrectionSpell m_Owner;
private class InternalTarget : Target
{
private ResurrectionSpell m_Owner;
public InternalTarget( ResurrectionSpell owner ) : base( 1, false, TargetFlags.Beneficial )
{
m_Owner = owner;
}
public InternalTarget(ResurrectionSpell owner) : base(1, false, TargetFlags.Beneficial)
{
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();
}
}
}
}