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
|
|
@ -1,144 +1,145 @@
|
|||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Spells.Third
|
||||
{
|
||||
public class PoisonSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Poison", "In Nox",
|
||||
203,
|
||||
9051,
|
||||
Reagent.Nightshade
|
||||
);
|
||||
public class PoisonSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Poison", "In Nox",
|
||||
203,
|
||||
9051,
|
||||
Reagent.Nightshade
|
||||
);
|
||||
|
||||
public override SpellCircle Circle => SpellCircle.Third;
|
||||
public PoisonSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public PoisonSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
public override SpellCircle Circle => SpellCircle.Third;
|
||||
|
||||
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;
|
||||
|
||||
if ( CheckResisted( m ) )
|
||||
{
|
||||
m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
|
||||
}
|
||||
else
|
||||
{
|
||||
int level;
|
||||
if (CheckResisted(m))
|
||||
{
|
||||
m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
|
||||
}
|
||||
else
|
||||
{
|
||||
int level;
|
||||
|
||||
if ( Core.AOS )
|
||||
{
|
||||
if ( Caster.InRange( m, 2 ) )
|
||||
{
|
||||
int total = (Caster.Skills.Magery.Fixed + Caster.Skills.Poisoning.Fixed) / 2;
|
||||
if (Core.AOS)
|
||||
{
|
||||
if (Caster.InRange(m, 2))
|
||||
{
|
||||
int total = (Caster.Skills.Magery.Fixed + Caster.Skills.Poisoning.Fixed) / 2;
|
||||
|
||||
if ( total >= 1000 )
|
||||
level = 3;
|
||||
else if ( total > 850 )
|
||||
level = 2;
|
||||
else if ( total > 650 )
|
||||
level = 1;
|
||||
else
|
||||
level = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
level = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//double total = Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Poisoning].Value;
|
||||
if (total >= 1000)
|
||||
level = 3;
|
||||
else if (total > 850)
|
||||
level = 2;
|
||||
else if (total > 650)
|
||||
level = 1;
|
||||
else
|
||||
level = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
level = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//double total = Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Poisoning].Value;
|
||||
|
||||
#region Dueling
|
||||
double total = Caster.Skills[SkillName.Magery].Value;
|
||||
#region Dueling
|
||||
|
||||
if ( Caster is Mobiles.PlayerMobile )
|
||||
{
|
||||
Mobiles.PlayerMobile pm = (Mobiles.PlayerMobile)Caster;
|
||||
double total = Caster.Skills[SkillName.Magery].Value;
|
||||
|
||||
if ( pm.DuelContext != null && pm.DuelContext.Started && !pm.DuelContext.Finished && !pm.DuelContext.Ruleset.GetOption( "Skills", "Poisoning" ) )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
total += Caster.Skills[SkillName.Poisoning].Value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
total += Caster.Skills[SkillName.Poisoning].Value;
|
||||
}
|
||||
#endregion
|
||||
if (Caster is PlayerMobile)
|
||||
{
|
||||
PlayerMobile pm = (PlayerMobile)Caster;
|
||||
|
||||
double dist = Caster.GetDistanceToSqrt( m );
|
||||
if (pm.DuelContext != null && pm.DuelContext.Started && !pm.DuelContext.Finished &&
|
||||
!pm.DuelContext.Ruleset.GetOption("Skills", "Poisoning"))
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
total += Caster.Skills[SkillName.Poisoning].Value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
total += Caster.Skills[SkillName.Poisoning].Value;
|
||||
}
|
||||
|
||||
if ( dist >= 3.0 )
|
||||
total -= (dist - 3.0) * 10.0;
|
||||
#endregion
|
||||
|
||||
if ( total >= 200.0 && 1 > Utility.Random( 10 ) )
|
||||
level = 3;
|
||||
else if ( total > (Core.AOS ? 170.1 : 170.0) )
|
||||
level = 2;
|
||||
else if ( total > (Core.AOS ? 130.1 : 130.0) )
|
||||
level = 1;
|
||||
else
|
||||
level = 0;
|
||||
}
|
||||
double dist = Caster.GetDistanceToSqrt(m);
|
||||
|
||||
m.ApplyPoison( Caster, Poison.GetPoison( level ) );
|
||||
}
|
||||
if (dist >= 3.0)
|
||||
total -= (dist - 3.0) * 10.0;
|
||||
|
||||
m.FixedParticles( 0x374A, 10, 15, 5021, EffectLayer.Waist );
|
||||
m.PlaySound( 0x205 );
|
||||
if (total >= 200.0 && 1 > Utility.Random(10))
|
||||
level = 3;
|
||||
else if (total > (Core.AOS ? 170.1 : 170.0))
|
||||
level = 2;
|
||||
else if (total > (Core.AOS ? 130.1 : 130.0))
|
||||
level = 1;
|
||||
else
|
||||
level = 0;
|
||||
}
|
||||
|
||||
HarmfulSpell( m );
|
||||
}
|
||||
m.ApplyPoison(Caster, Poison.GetPoison(level));
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
m.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
|
||||
m.PlaySound(0x205);
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private PoisonSpell m_Owner;
|
||||
HarmfulSpell(m);
|
||||
}
|
||||
|
||||
public InternalTarget( PoisonSpell owner ) : base( Core.ML ? 10 : 12, false, TargetFlags.Harmful )
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
if ( o is Mobile )
|
||||
{
|
||||
m_Owner.Target( (Mobile)o );
|
||||
}
|
||||
}
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private PoisonSpell m_Owner;
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public InternalTarget(PoisonSpell 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 OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue