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,124 +1,126 @@
using System;
using Server.Engines.ConPVP;
using Server.Targeting;
namespace Server.Spells.Chivalry
{
public class CleanseByFireSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Cleanse By Fire", "Expor Flamus",
-1,
9002
);
public class CleanseByFireSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Cleanse By Fire", "Expor Flamus",
-1,
9002
);
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 1.0 );
public CleanseByFireSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{
}
public override double RequiredSkill => 5.0;
public override int RequiredMana => 10;
public override int RequiredTithing => 10;
public override int MantraNumber => 1060718; // Expor Flamus
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds(1.0);
public CleanseByFireSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override double RequiredSkill => 5.0;
public override int RequiredMana => 10;
public override int RequiredTithing => 10;
public override int MantraNumber => 1060718; // Expor Flamus
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 ( !m.Poisoned )
{
Caster.SendLocalizedMessage( 1060176 ); // That creature is not poisoned!
}
else if ( CheckBSequence( m ) )
{
SpellHelper.Turn( Caster, m );
public void Target(Mobile m)
{
if (!m.Poisoned)
{
Caster.SendLocalizedMessage(1060176); // That creature is not poisoned!
}
else if (CheckBSequence(m))
{
SpellHelper.Turn(Caster, m);
/* Cures the target of poisons, but causes the caster to be burned by fire damage for 13-55 hit points.
* The amount of fire damage is lessened if the caster has high Karma.
*/
/* Cures the target of poisons, but causes the caster to be burned by fire damage for 13-55 hit points.
* The amount of fire damage is lessened if the caster has high Karma.
*/
Poison p = m.Poison;
Poison p = m.Poison;
if ( p != null )
{
// Cleanse by fire is now difficulty based
int chanceToCure = 10000 + (int)(Caster.Skills[SkillName.Chivalry].Value * 75) - ((p.Level + 1) * 2000);
chanceToCure /= 100;
if (p != null)
{
// Cleanse by fire is now difficulty based
int chanceToCure = 10000 + (int)(Caster.Skills[SkillName.Chivalry].Value * 75) - (p.Level + 1) * 2000;
chanceToCure /= 100;
if ( chanceToCure > Utility.Random( 100 ) )
{
if ( m.CurePoison( Caster ) )
{
if ( Caster != m )
Caster.SendLocalizedMessage( 1010058 ); // You have cured the target of all poisons!
if (chanceToCure > Utility.Random(100))
{
if (m.CurePoison(Caster))
{
if (Caster != m)
Caster.SendLocalizedMessage(1010058); // You have cured the target of all poisons!
m.SendLocalizedMessage( 1010059 ); // You have been cured of all poisons.
}
}
else
{
m.SendLocalizedMessage( 1010060 ); // You have failed to cure your target!
}
}
m.SendLocalizedMessage(1010059); // You have been cured of all poisons.
}
}
else
{
m.SendLocalizedMessage(1010060); // You have failed to cure your target!
}
}
m.PlaySound( 0x1E0 );
m.FixedParticles( 0x373A, 1, 15, 5012, 3, 2, EffectLayer.Waist );
m.PlaySound(0x1E0);
m.FixedParticles(0x373A, 1, 15, 5012, 3, 2, EffectLayer.Waist);
IEntity from = new Entity( Serial.Zero, new Point3D( m.X, m.Y, m.Z - 5 ), m.Map );
IEntity to = new Entity( Serial.Zero, new Point3D( m.X, m.Y, m.Z + 45 ), m.Map );
Effects.SendMovingParticles( from, to, 0x374B, 1, 0, false, false, 63, 2, 9501, 1, 0, EffectLayer.Head, 0x100 );
IEntity from = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z - 5), m.Map);
IEntity to = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 45), m.Map);
Effects.SendMovingParticles(from, to, 0x374B, 1, 0, false, false, 63, 2, 9501, 1, 0, EffectLayer.Head,
0x100);
Caster.PlaySound( 0x208 );
Caster.FixedParticles( 0x3709, 1, 30, 9934, 0, 7, EffectLayer.Waist );
Caster.PlaySound(0x208);
Caster.FixedParticles(0x3709, 1, 30, 9934, 0, 7, EffectLayer.Waist);
int damage = 50 - ComputePowerValue( 4 );
int damage = 50 - ComputePowerValue(4);
// TODO: Should caps be applied?
if ( damage < 13 )
damage = 13;
else if ( damage > 55 )
damage = 55;
// TODO: Should caps be applied?
if (damage < 13)
damage = 13;
else if (damage > 55)
damage = 55;
AOS.Damage( Caster, Caster, damage, 0, 100, 0, 0, 0, true );
}
AOS.Damage(Caster, Caster, damage, 0, 100, 0, 0, 0, true);
}
FinishSequence();
}
FinishSequence();
}
private class InternalTarget : Target
{
private CleanseByFireSpell m_Owner;
private class InternalTarget : Target
{
private CleanseByFireSpell m_Owner;
public InternalTarget( CleanseByFireSpell owner ) : base( Core.ML ? 10 : 12, false, TargetFlags.Beneficial )
{
m_Owner = owner;
}
public InternalTarget(CleanseByFireSpell owner) : base(Core.ML ? 10 : 12, 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();
}
}
}
}

View file

@ -1,119 +1,122 @@
using System;
using Server.Network;
using Server.Engines.ConPVP;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using Server.Targeting;
namespace Server.Spells.Chivalry
{
public class CloseWoundsSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Close Wounds", "Obsu Vulni",
-1,
9002
);
public class CloseWoundsSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Close Wounds", "Obsu Vulni",
-1,
9002
);
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 1.5 );
public CloseWoundsSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{
}
public override double RequiredSkill => 0.0;
public override int RequiredMana => 10;
public override int RequiredTithing => 10;
public override int MantraNumber => 1060719; // Obsu Vulni
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds(1.5);
public CloseWoundsSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override double RequiredSkill => 0.0;
public override int RequiredMana => 10;
public override int RequiredTithing => 10;
public override int MantraNumber => 1060719; // Obsu Vulni
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.InRange( m, 2 ) )
{
Caster.SendLocalizedMessage( 1060178 ); // You are too far away to perform that action!
}
else if ( m is BaseCreature && ((BaseCreature)m).IsAnimatedDead )
{
Caster.SendLocalizedMessage( 1061654 ); // You cannot heal that which is not alive.
}
else if ( m.IsDeadBondedPet )
{
Caster.SendLocalizedMessage( 1060177 ); // You cannot heal a creature that is already dead!
}
else if ( m.Hits >= m.HitsMax )
{
Caster.SendLocalizedMessage( 500955 ); // That being is not damaged!
}
else if ( m.Poisoned || Items.MortalStrike.IsWounded( m ) )
{
Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, (Caster == m) ? 1005000 : 1010398 );
}
else if ( CheckBSequence( m ) )
{
SpellHelper.Turn( Caster, m );
public void Target(Mobile m)
{
if (!Caster.InRange(m, 2))
{
Caster.SendLocalizedMessage(1060178); // You are too far away to perform that action!
}
else if (m is BaseCreature && ((BaseCreature)m).IsAnimatedDead)
{
Caster.SendLocalizedMessage(1061654); // You cannot heal that which is not alive.
}
else if (m.IsDeadBondedPet)
{
Caster.SendLocalizedMessage(1060177); // You cannot heal a creature that is already dead!
}
else if (m.Hits >= m.HitsMax)
{
Caster.SendLocalizedMessage(500955); // That being is not damaged!
}
else if (m.Poisoned || MortalStrike.IsWounded(m))
{
Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, Caster == m ? 1005000 : 1010398);
}
else if (CheckBSequence(m))
{
SpellHelper.Turn(Caster, m);
/* Heals the target for 7 to 39 points of damage.
* The caster's Karma affects the amount of damage healed.
*/
/* Heals the target for 7 to 39 points of damage.
* The caster's Karma affects the amount of damage healed.
*/
int toHeal = ComputePowerValue( 6 ) + Utility.RandomMinMax( 0, 2 );
int toHeal = ComputePowerValue(6) + Utility.RandomMinMax(0, 2);
// TODO: Should caps be applied?
if ( toHeal < 7 )
toHeal = 7;
else if ( toHeal > 39 )
toHeal = 39;
// TODO: Should caps be applied?
if (toHeal < 7)
toHeal = 7;
else if (toHeal > 39)
toHeal = 39;
if ( (m.Hits + toHeal) > m.HitsMax )
toHeal = m.HitsMax - m.Hits;
if (m.Hits + toHeal > m.HitsMax)
toHeal = m.HitsMax - m.Hits;
//m.Hits += toHeal; //Was previously due to the message
//m.Heal( toHeal, Caster, false );
SpellHelper.Heal( toHeal, m, Caster, false );
//m.Hits += toHeal; //Was previously due to the message
//m.Heal( toHeal, Caster, false );
SpellHelper.Heal(toHeal, m, Caster, false);
m.SendLocalizedMessage( 1060203, toHeal.ToString() ); // You have had ~1_HEALED_AMOUNT~ hit points of damage healed.
m.SendLocalizedMessage(1060203,
toHeal.ToString()); // You have had ~1_HEALED_AMOUNT~ hit points of damage healed.
m.PlaySound( 0x202 );
m.FixedParticles( 0x376A, 1, 62, 9923, 3, 3, EffectLayer.Waist );
m.FixedParticles( 0x3779, 1, 46, 9502, 5, 3, EffectLayer.Waist );
}
m.PlaySound(0x202);
m.FixedParticles(0x376A, 1, 62, 9923, 3, 3, EffectLayer.Waist);
m.FixedParticles(0x3779, 1, 46, 9502, 5, 3, EffectLayer.Waist);
}
FinishSequence();
}
FinishSequence();
}
private class InternalTarget : Target
{
private CloseWoundsSpell m_Owner;
private class InternalTarget : Target
{
private CloseWoundsSpell m_Owner;
public InternalTarget( CloseWoundsSpell owner ) : base( 12, false, TargetFlags.Beneficial )
{
m_Owner = owner;
}
public InternalTarget(CloseWoundsSpell owner) : base(12, 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();
}
}
}
}

View file

@ -4,101 +4,111 @@ using Server.Items;
namespace Server.Spells.Chivalry
{
public class ConsecrateWeaponSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Consecrate Weapon", "Consecrus Arma",
-1,
9002
);
public class ConsecrateWeaponSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Consecrate Weapon", "Consecrus Arma",
-1,
9002
);
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 0.5 );
private static Hashtable m_Table = new Hashtable();
public override double RequiredSkill => 15.0;
public override int RequiredMana => 10;
public override int RequiredTithing => 10;
public override int MantraNumber => 1060720; // Consecrus Arma
public override bool BlocksMovement => false;
public ConsecrateWeaponSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{
}
public ConsecrateWeaponSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds(0.5);
public override void OnCast()
{
BaseWeapon weapon = Caster.Weapon as BaseWeapon;
public override double RequiredSkill => 15.0;
public override int RequiredMana => 10;
public override int RequiredTithing => 10;
public override int MantraNumber => 1060720; // Consecrus Arma
public override bool BlocksMovement => false;
if ( weapon == null || weapon is Fists )
{
Caster.SendLocalizedMessage( 501078 ); // You must be holding a weapon.
}
else if ( CheckSequence() )
{
/* Temporarily enchants the weapon the caster is currently wielding.
* The type of damage the weapon inflicts when hitting a target will
* be converted to the target's worst Resistance type.
* Duration of the effect is affected by the caster's Karma and lasts for 3 to 11 seconds.
*/
public override void OnCast()
{
BaseWeapon weapon = Caster.Weapon as BaseWeapon;
int itemID, soundID;
if (weapon == null || weapon is Fists)
{
Caster.SendLocalizedMessage(501078); // You must be holding a weapon.
}
else if (CheckSequence())
{
/* Temporarily enchants the weapon the caster is currently wielding.
* The type of damage the weapon inflicts when hitting a target will
* be converted to the target's worst Resistance type.
* Duration of the effect is affected by the caster's Karma and lasts for 3 to 11 seconds.
*/
switch ( weapon.Skill )
{
case SkillName.Macing: itemID = 0xFB4; soundID = 0x232; break;
case SkillName.Archery: itemID = 0x13B1; soundID = 0x145; break;
default: itemID = 0xF5F; soundID = 0x56; break;
}
int itemID, soundID;
Caster.PlaySound( 0x20C );
Caster.PlaySound( soundID );
Caster.FixedParticles( 0x3779, 1, 30, 9964, 3, 3, EffectLayer.Waist );
switch (weapon.Skill)
{
case SkillName.Macing:
itemID = 0xFB4;
soundID = 0x232;
break;
case SkillName.Archery:
itemID = 0x13B1;
soundID = 0x145;
break;
default:
itemID = 0xF5F;
soundID = 0x56;
break;
}
IEntity from = new Entity( Serial.Zero, new Point3D( Caster.X, Caster.Y, Caster.Z ), Caster.Map );
IEntity to = new Entity( Serial.Zero, new Point3D( Caster.X, Caster.Y, Caster.Z + 50 ), Caster.Map );
Effects.SendMovingParticles( from, to, itemID, 1, 0, false, false, 33, 3, 9501, 1, 0, EffectLayer.Head, 0x100 );
Caster.PlaySound(0x20C);
Caster.PlaySound(soundID);
Caster.FixedParticles(0x3779, 1, 30, 9964, 3, 3, EffectLayer.Waist);
double seconds = ComputePowerValue( 20 );
IEntity from = new Entity(Serial.Zero, new Point3D(Caster.X, Caster.Y, Caster.Z), Caster.Map);
IEntity to = new Entity(Serial.Zero, new Point3D(Caster.X, Caster.Y, Caster.Z + 50), Caster.Map);
Effects.SendMovingParticles(from, to, itemID, 1, 0, false, false, 33, 3, 9501, 1, 0, EffectLayer.Head,
0x100);
// TODO: Should caps be applied?
if ( seconds < 3.0 )
seconds = 3.0;
else if ( seconds > 11.0 )
seconds = 11.0;
double seconds = ComputePowerValue(20);
TimeSpan duration = TimeSpan.FromSeconds( seconds );
// TODO: Should caps be applied?
if (seconds < 3.0)
seconds = 3.0;
else if (seconds > 11.0)
seconds = 11.0;
Timer t = (Timer)m_Table[weapon];
TimeSpan duration = TimeSpan.FromSeconds(seconds);
t?.Stop();
Timer t = (Timer)m_Table[weapon];
weapon.Consecrated = true;
t?.Stop();
m_Table[weapon] = t = new ExpireTimer( weapon, duration );
weapon.Consecrated = true;
t.Start();
}
m_Table[weapon] = t = new ExpireTimer(weapon, duration);
FinishSequence();
}
t.Start();
}
private static Hashtable m_Table = new Hashtable();
FinishSequence();
}
private class ExpireTimer : Timer
{
private BaseWeapon m_Weapon;
private class ExpireTimer : Timer
{
private BaseWeapon m_Weapon;
public ExpireTimer( BaseWeapon weapon, TimeSpan delay ) : base( delay )
{
m_Weapon = weapon;
Priority = TimerPriority.FiftyMS;
}
public ExpireTimer(BaseWeapon weapon, TimeSpan delay) : base(delay)
{
m_Weapon = weapon;
Priority = TimerPriority.FiftyMS;
}
protected override void OnTick()
{
m_Weapon.Consecrated = false;
Effects.PlaySound( m_Weapon.GetWorldLocation(), m_Weapon.Map, 0x1F8 );
m_Table.Remove( this );
}
}
}
}
protected override void OnTick()
{
m_Weapon.Consecrated = false;
Effects.PlaySound(m_Weapon.GetWorldLocation(), m_Weapon.Map, 0x1F8);
m_Table.Remove(this);
}
}
}
}

View file

@ -6,112 +6,107 @@ using Server.Spells.Necromancy;
namespace Server.Spells.Chivalry
{
public class DispelEvilSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Dispel Evil", "Dispiro Malas",
-1,
9002
);
public class DispelEvilSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Dispel Evil", "Dispiro Malas",
-1,
9002
);
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 0.25 );
public DispelEvilSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{
}
public override double RequiredSkill => 35.0;
public override int RequiredMana => 10;
public override int RequiredTithing => 10;
public override int MantraNumber => 1060721; // Dispiro Malas
public override bool BlocksMovement => false;
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds(0.25);
public DispelEvilSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override double RequiredSkill => 35.0;
public override int RequiredMana => 10;
public override int RequiredTithing => 10;
public override int MantraNumber => 1060721; // Dispiro Malas
public override bool BlocksMovement => false;
public override bool DelayedDamage => false;
public override bool DelayedDamage => false;
public override void SendCastEffect()
{
Caster.FixedEffect( 0x37C4, 10, 7, 4, 3 ); // At player
}
public override void SendCastEffect()
{
Caster.FixedEffect(0x37C4, 10, 7, 4, 3); // At player
}
public override void OnCast()
{
if ( CheckSequence() )
{
List<Mobile> targets = new List<Mobile>();
public override void OnCast()
{
if (CheckSequence())
{
List<Mobile> targets = new List<Mobile>();
foreach ( Mobile m in Caster.GetMobilesInRange( 8 ) )
{
if ( Caster != m && SpellHelper.ValidIndirectTarget( Caster, m ) && Caster.CanBeHarmful( m, false ) )
targets.Add( m );
}
foreach (Mobile m in Caster.GetMobilesInRange(8))
if (Caster != m && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false))
targets.Add(m);
Caster.PlaySound( 0xF5 );
Caster.PlaySound( 0x299 );
Caster.FixedParticles( 0x37C4, 1, 25, 9922, 14, 3, EffectLayer.Head );
Caster.PlaySound(0xF5);
Caster.PlaySound(0x299);
Caster.FixedParticles(0x37C4, 1, 25, 9922, 14, 3, EffectLayer.Head);
int dispelSkill = ComputePowerValue( 2 );
int dispelSkill = ComputePowerValue(2);
double chiv = Caster.Skills.Chivalry.Value;
double chiv = Caster.Skills.Chivalry.Value;
for ( int i = 0; i < targets.Count; ++i )
{
Mobile m = targets[i];
BaseCreature bc = m as BaseCreature;
for (int i = 0; i < targets.Count; ++i)
{
Mobile m = targets[i];
BaseCreature bc = m as BaseCreature;
if ( bc != null )
{
bool dispellable = bc.Summoned && !bc.IsAnimatedDead;
if (bc != null)
{
bool dispellable = bc.Summoned && !bc.IsAnimatedDead;
if ( dispellable )
{
double dispelChance = (50.0 + ((100 * (chiv - bc.DispelDifficulty)) / (bc.DispelFocus*2))) / 100;
dispelChance *= dispelSkill / 100.0;
if (dispellable)
{
double dispelChance = (50.0 + 100 * (chiv - bc.DispelDifficulty) / (bc.DispelFocus * 2)) / 100;
dispelChance *= dispelSkill / 100.0;
if ( dispelChance > Utility.RandomDouble() )
{
Effects.SendLocationParticles( EffectItem.Create( m.Location, m.Map, EffectItem.DefaultDuration ), 0x3728, 8, 20, 5042 );
Effects.PlaySound( m, m.Map, 0x201 );
if (dispelChance > Utility.RandomDouble())
{
Effects.SendLocationParticles(
EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042);
Effects.PlaySound(m, m.Map, 0x201);
m.Delete();
continue;
}
}
m.Delete();
continue;
}
}
bool evil = !bc.Controlled && bc.Karma < 0;
bool evil = !bc.Controlled && bc.Karma < 0;
if ( evil )
{
// TODO: Is this right?
double fleeChance = (100 - Math.Sqrt( m.Fame / 2 )) * chiv * dispelSkill;
fleeChance /= 1000000;
if (evil)
{
// TODO: Is this right?
double fleeChance = (100 - Math.Sqrt(m.Fame / 2)) * chiv * dispelSkill;
fleeChance /= 1000000;
if ( fleeChance > Utility.RandomDouble() )
{
// guide says 2 seconds, it's longer
bc.BeginFlee( TimeSpan.FromSeconds( 30.0 ) );
}
}
}
if (fleeChance > Utility.RandomDouble()) bc.BeginFlee(TimeSpan.FromSeconds(30.0));
}
}
TransformContext context = TransformationSpellHelper.GetContext( m );
if ( context?.Spell is NecromancerSpell ) //Trees are not evil! TODO: OSI confirm?
{
// transformed ..
TransformContext context = TransformationSpellHelper.GetContext(m);
if (context?.Spell is NecromancerSpell) //Trees are not evil! TODO: OSI confirm?
{
// transformed ..
double drainChance = 0.5 * (Caster.Skills.Chivalry.Value / Math.Max( m.Skills.Necromancy.Value, 1 ));
double drainChance = 0.5 * (Caster.Skills.Chivalry.Value / Math.Max(m.Skills.Necromancy.Value, 1));
if ( drainChance > Utility.RandomDouble() )
{
int drain = (5 * dispelSkill) / 100;
if (drainChance > Utility.RandomDouble())
{
int drain = 5 * dispelSkill / 100;
m.Stam -= drain;
m.Mana -= drain;
}
}
}
}
m.Stam -= drain;
m.Mana -= drain;
}
}
}
}
FinishSequence();
}
}
}
FinishSequence();
}
}
}

View file

@ -3,73 +3,75 @@ using System.Collections;
namespace Server.Spells.Chivalry
{
public class DivineFurySpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Divine Fury", "Divinum Furis",
-1,
9002
);
public class DivineFurySpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Divine Fury", "Divinum Furis",
-1,
9002
);
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 1.0 );
private static Hashtable m_Table = new Hashtable();
public override double RequiredSkill => 25.0;
public override int RequiredMana => 15;
public override int RequiredTithing => 10;
public override int MantraNumber => 1060722; // Divinum Furis
public override bool BlocksMovement => false;
public DivineFurySpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{
}
public DivineFurySpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds(1.0);
public override void OnCast()
{
if ( CheckSequence() )
{
Caster.PlaySound( 0x20F );
Caster.PlaySound( Caster.Female ? 0x338 : 0x44A );
Caster.FixedParticles( 0x376A, 1, 31, 9961, 1160, 0, EffectLayer.Waist );
Caster.FixedParticles( 0x37C4, 1, 31, 9502, 43, 2, EffectLayer.Waist );
public override double RequiredSkill => 25.0;
public override int RequiredMana => 15;
public override int RequiredTithing => 10;
public override int MantraNumber => 1060722; // Divinum Furis
public override bool BlocksMovement => false;
Caster.Stam = Caster.StamMax;
public override void OnCast()
{
if (CheckSequence())
{
Caster.PlaySound(0x20F);
Caster.PlaySound(Caster.Female ? 0x338 : 0x44A);
Caster.FixedParticles(0x376A, 1, 31, 9961, 1160, 0, EffectLayer.Waist);
Caster.FixedParticles(0x37C4, 1, 31, 9502, 43, 2, EffectLayer.Waist);
Timer t = (Timer)m_Table[Caster];
Caster.Stam = Caster.StamMax;
t?.Stop();
Timer t = (Timer)m_Table[Caster];
int delay = ComputePowerValue( 10 );
t?.Stop();
// TODO: Should caps be applied?
if ( delay < 7 )
delay = 7;
else if ( delay > 24 )
delay = 24;
int delay = ComputePowerValue(10);
m_Table[Caster] = t = Timer.DelayCall( TimeSpan.FromSeconds( delay ), new TimerStateCallback( Expire_Callback ), Caster );
Caster.Delta( MobileDelta.WeaponDamage );
// TODO: Should caps be applied?
if (delay < 7)
delay = 7;
else if (delay > 24)
delay = 24;
BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.DivineFury, 1060589, 1075634, TimeSpan.FromSeconds(delay), Caster));
}
m_Table[Caster] = t = Timer.DelayCall(TimeSpan.FromSeconds(delay), new TimerStateCallback(Expire_Callback),
Caster);
Caster.Delta(MobileDelta.WeaponDamage);
FinishSequence();
}
BuffInfo.AddBuff(Caster,
new BuffInfo(BuffIcon.DivineFury, 1060589, 1075634, TimeSpan.FromSeconds(delay), Caster));
}
private static Hashtable m_Table = new Hashtable();
FinishSequence();
}
public static bool UnderEffect( Mobile m )
{
return m_Table.Contains( m );
}
public static bool UnderEffect(Mobile m)
{
return m_Table.Contains(m);
}
private static void Expire_Callback( object state )
{
Mobile m = (Mobile)state;
private static void Expire_Callback(object state)
{
Mobile m = (Mobile)state;
m_Table.Remove( m );
m_Table.Remove(m);
m.Delta( MobileDelta.WeaponDamage );
m.PlaySound( 0xF8 );
}
}
}
m.Delta(MobileDelta.WeaponDamage);
m.PlaySound(0xF8);
}
}
}

View file

@ -4,76 +4,78 @@ using Server.Mobiles;
namespace Server.Spells.Chivalry
{
public class EnemyOfOneSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Enemy of One", "Forul Solum",
-1,
9002
);
public class EnemyOfOneSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Enemy of One", "Forul Solum",
-1,
9002
);
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 0.5 );
private static Hashtable m_Table = new Hashtable();
public override double RequiredSkill => 45.0;
public override int RequiredMana => 20;
public override int RequiredTithing => 10;
public override int MantraNumber => 1060723; // Forul Solum
public override bool BlocksMovement => false;
public EnemyOfOneSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{
}
public EnemyOfOneSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds(0.5);
public override void OnCast()
{
if ( CheckSequence() )
{
Caster.PlaySound( 0x0F5 );
Caster.PlaySound( 0x1ED );
Caster.FixedParticles( 0x375A, 1, 30, 9966, 33, 2, EffectLayer.Head );
Caster.FixedParticles( 0x37B9, 1, 30, 9502, 43, 3, EffectLayer.Head );
public override double RequiredSkill => 45.0;
public override int RequiredMana => 20;
public override int RequiredTithing => 10;
public override int MantraNumber => 1060723; // Forul Solum
public override bool BlocksMovement => false;
Timer t = (Timer)m_Table[Caster];
public override void OnCast()
{
if (CheckSequence())
{
Caster.PlaySound(0x0F5);
Caster.PlaySound(0x1ED);
Caster.FixedParticles(0x375A, 1, 30, 9966, 33, 2, EffectLayer.Head);
Caster.FixedParticles(0x37B9, 1, 30, 9502, 43, 3, EffectLayer.Head);
t?.Stop();
Timer t = (Timer)m_Table[Caster];
double delay = (double)ComputePowerValue( 1 ) / 60;
t?.Stop();
// TODO: Should caps be applied?
if ( delay < 1.5 )
delay = 1.5;
else if ( delay > 3.5 )
delay = 3.5;
double delay = (double)ComputePowerValue(1) / 60;
m_Table[Caster] = Timer.DelayCall( TimeSpan.FromMinutes( delay ), new TimerStateCallback( Expire_Callback ), Caster );
// TODO: Should caps be applied?
if (delay < 1.5)
delay = 1.5;
else if (delay > 3.5)
delay = 3.5;
if ( Caster is PlayerMobile )
{
((PlayerMobile)Caster).EnemyOfOneType = null;
((PlayerMobile)Caster).WaitingForEnemy = true;
m_Table[Caster] = Timer.DelayCall(TimeSpan.FromMinutes(delay), new TimerStateCallback(Expire_Callback),
Caster);
BuffInfo.AddBuff ( Caster, new BuffInfo ( BuffIcon.EnemyOfOne, 1075653, 1044111, TimeSpan.FromMinutes ( delay ), Caster ) );
}
}
if (Caster is PlayerMobile)
{
((PlayerMobile)Caster).EnemyOfOneType = null;
((PlayerMobile)Caster).WaitingForEnemy = true;
FinishSequence();
}
BuffInfo.AddBuff(Caster,
new BuffInfo(BuffIcon.EnemyOfOne, 1075653, 1044111, TimeSpan.FromMinutes(delay), Caster));
}
}
private static Hashtable m_Table = new Hashtable();
FinishSequence();
}
private static void Expire_Callback( object state )
{
Mobile m = (Mobile)state;
private static void Expire_Callback(object state)
{
Mobile m = (Mobile)state;
m_Table.Remove( m );
m_Table.Remove(m);
m.PlaySound( 0x1F8 );
m.PlaySound(0x1F8);
if ( m is PlayerMobile )
{
((PlayerMobile)m).EnemyOfOneType = null;
((PlayerMobile)m).WaitingForEnemy = false;
}
}
}
}
if (m is PlayerMobile)
{
((PlayerMobile)m).EnemyOfOneType = null;
((PlayerMobile)m).WaitingForEnemy = false;
}
}
}
}

View file

@ -4,62 +4,66 @@ using Server.Items;
namespace Server.Spells.Chivalry
{
public class HolyLightSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Holy Light", "Augus Luminos",
-1,
9002
);
public class HolyLightSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Holy Light", "Augus Luminos",
-1,
9002
);
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 1.75 );
public HolyLightSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{
}
public override double RequiredSkill => 55.0;
public override int RequiredMana => 10;
public override int RequiredTithing => 10;
public override int MantraNumber => 1060724; // Augus Luminos
public override bool BlocksMovement => false;
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds(1.75);
public HolyLightSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override double RequiredSkill => 55.0;
public override int RequiredMana => 10;
public override int RequiredTithing => 10;
public override int MantraNumber => 1060724; // Augus Luminos
public override bool BlocksMovement => false;
public override bool DelayedDamage => false;
public override bool DelayedDamage => false;
public override void OnCast()
{
if ( CheckSequence() )
{
List<Mobile> targets = new List<Mobile>();
public override void OnCast()
{
if (CheckSequence())
{
List<Mobile> targets = new List<Mobile>();
foreach ( Mobile m in Caster.GetMobilesInRange( 3 ) )
if ( Caster != m && SpellHelper.ValidIndirectTarget( Caster, m ) && Caster.CanBeHarmful( m, false ) && ( !Core.AOS || Caster.InLOS( m ) ) )
targets.Add( m );
foreach (Mobile m in Caster.GetMobilesInRange(3))
if (Caster != m && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false) &&
(!Core.AOS || Caster.InLOS(m)))
targets.Add(m);
Caster.PlaySound( 0x212 );
Caster.PlaySound( 0x206 );
Caster.PlaySound(0x212);
Caster.PlaySound(0x206);
Effects.SendLocationParticles( EffectItem.Create( Caster.Location, Caster.Map, EffectItem.DefaultDuration ), 0x376A, 1, 29, 0x47D, 2, 9962, 0 );
Effects.SendLocationParticles( EffectItem.Create( new Point3D( Caster.X, Caster.Y, Caster.Z - 7 ), Caster.Map, EffectItem.DefaultDuration ), 0x37C4, 1, 29, 0x47D, 2, 9502, 0 );
Effects.SendLocationParticles(EffectItem.Create(Caster.Location, Caster.Map, EffectItem.DefaultDuration),
0x376A, 1, 29, 0x47D, 2, 9962, 0);
Effects.SendLocationParticles(
EffectItem.Create(new Point3D(Caster.X, Caster.Y, Caster.Z - 7), Caster.Map, EffectItem.DefaultDuration),
0x37C4, 1, 29, 0x47D, 2, 9502, 0);
for ( int i = 0; i < targets.Count; ++i )
{
Mobile m = targets[i];
for (int i = 0; i < targets.Count; ++i)
{
Mobile m = targets[i];
int damage = ComputePowerValue( 10 ) + Utility.RandomMinMax( 0, 2 );
int damage = ComputePowerValue(10) + Utility.RandomMinMax(0, 2);
// TODO: Should caps be applied?
if ( damage < 8 )
damage = 8;
else if ( damage > 24 )
damage = 24;
// TODO: Should caps be applied?
if (damage < 8)
damage = 8;
else if (damage > 24)
damage = 24;
Caster.DoHarmful( m );
SpellHelper.Damage( this, m, damage, 0, 0, 0, 0, 100 );
}
}
Caster.DoHarmful(m);
SpellHelper.Damage(this, m, damage, 0, 0, 0, 0, 100);
}
}
FinishSequence();
}
}
}
FinishSequence();
}
}
}

View file

@ -1,168 +1,169 @@
using System;
using System.Collections.Generic;
using Server.Mobiles;
using Server.Gumps;
using Server.Mobiles;
using Server.Spells.Necromancy;
namespace Server.Spells.Chivalry
{
public class NobleSacrificeSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Noble Sacrifice", "Dium Prostra",
-1,
9002
);
public class NobleSacrificeSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Noble Sacrifice", "Dium Prostra",
-1,
9002
);
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 1.5 );
public NobleSacrificeSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{
}
public override double RequiredSkill => 65.0;
public override int RequiredMana => 20;
public override int RequiredTithing => 30;
public override int MantraNumber => 1060725; // Dium Prostra
public override bool BlocksMovement => false;
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds(1.5);
public NobleSacrificeSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override double RequiredSkill => 65.0;
public override int RequiredMana => 20;
public override int RequiredTithing => 30;
public override int MantraNumber => 1060725; // Dium Prostra
public override bool BlocksMovement => false;
public override void OnCast()
{
if ( CheckSequence() )
{
List<Mobile> targets = new List<Mobile>();
public override void OnCast()
{
if (CheckSequence())
{
List<Mobile> targets = new List<Mobile>();
foreach ( Mobile m in Caster.GetMobilesInRange( 3 ) ) // TODO: Validate range
{
if ( m is BaseCreature && ((BaseCreature)m).IsAnimatedDead )
continue;
foreach (Mobile m in Caster.GetMobilesInRange(3)) // TODO: Validate range
{
if (m is BaseCreature && ((BaseCreature)m).IsAnimatedDead)
continue;
if ( Caster != m && m.InLOS( Caster ) && Caster.CanBeBeneficial( m, false, true ) && !(m is Golem) )
targets.Add( m );
}
if (Caster != m && m.InLOS(Caster) && Caster.CanBeBeneficial(m, false, true) && !(m is Golem))
targets.Add(m);
}
Caster.PlaySound( 0x244 );
Caster.FixedParticles( 0x3709, 1, 30, 9965, 5, 7, EffectLayer.Waist );
Caster.FixedParticles( 0x376A, 1, 30, 9502, 5, 3, EffectLayer.Waist );
Caster.PlaySound(0x244);
Caster.FixedParticles(0x3709, 1, 30, 9965, 5, 7, EffectLayer.Waist);
Caster.FixedParticles(0x376A, 1, 30, 9502, 5, 3, EffectLayer.Waist);
/* Attempts to Resurrect, Cure and Heal all targets in a radius around the caster.
* If any target is successfully assisted, the Paladin's current
* Hit Points, Mana and Stamina are set to 1.
* Amount of damage healed is affected by the Caster's Karma, from 8 to 24 hit points.
*/
/* Attempts to Resurrect, Cure and Heal all targets in a radius around the caster.
* If any target is successfully assisted, the Paladin's current
* Hit Points, Mana and Stamina are set to 1.
* Amount of damage healed is affected by the Caster's Karma, from 8 to 24 hit points.
*/
bool sacrifice = false;
bool sacrifice = false;
// TODO: Is there really a resurrection chance?
double resChance = 0.1 + (0.9 * ((double)Caster.Karma / 10000));
// TODO: Is there really a resurrection chance?
double resChance = 0.1 + 0.9 * ((double)Caster.Karma / 10000);
for ( int i = 0; i < targets.Count; ++i )
{
Mobile m = targets[i];
for (int i = 0; i < targets.Count; ++i)
{
Mobile m = targets[i];
if ( !m.Alive )
{
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 ( resChance > Utility.RandomDouble() )
{
m.FixedParticles( 0x375A, 1, 15, 5005, 5, 3, EffectLayer.Head );
m.CloseGump( typeof( ResurrectGump ) );
m.SendGump( new ResurrectGump( m, Caster ) );
sacrifice = true;
}
}
else
{
bool sendEffect = false;
if (!m.Alive)
{
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 (resChance > Utility.RandomDouble())
{
m.FixedParticles(0x375A, 1, 15, 5005, 5, 3, EffectLayer.Head);
m.CloseGump(typeof(ResurrectGump));
m.SendGump(new ResurrectGump(m, Caster));
sacrifice = true;
}
}
else
{
bool sendEffect = false;
if ( m.Poisoned && m.CurePoison( Caster ) )
{
Caster.DoBeneficial( m );
if (m.Poisoned && m.CurePoison(Caster))
{
Caster.DoBeneficial(m);
if ( Caster != m )
Caster.SendLocalizedMessage( 1010058 ); // You have cured the target of all poisons!
if (Caster != m)
Caster.SendLocalizedMessage(1010058); // You have cured the target of all poisons!
m.SendLocalizedMessage( 1010059 ); // You have been cured of all poisons.
sendEffect = true;
sacrifice = true;
}
m.SendLocalizedMessage(1010059); // You have been cured of all poisons.
sendEffect = true;
sacrifice = true;
}
if ( m.Hits < m.HitsMax )
{
int toHeal = ComputePowerValue( 10 ) + Utility.RandomMinMax( 0, 2 );
if (m.Hits < m.HitsMax)
{
int toHeal = ComputePowerValue(10) + Utility.RandomMinMax(0, 2);
// TODO: Should caps be applied?
if ( toHeal < 8 )
toHeal = 8;
else if ( toHeal > 24 )
toHeal = 24;
// TODO: Should caps be applied?
if (toHeal < 8)
toHeal = 8;
else if (toHeal > 24)
toHeal = 24;
Caster.DoBeneficial( m );
m.Heal( toHeal, Caster );
sendEffect = true;
}
Caster.DoBeneficial(m);
m.Heal(toHeal, Caster);
sendEffect = true;
}
StatMod mod;
StatMod mod;
mod = m.GetStatMod( "[Magic] Str Offset" );
if ( mod != null && mod.Offset < 0 )
{
m.RemoveStatMod( "[Magic] Str Offset" );
sendEffect = true;
}
mod = m.GetStatMod("[Magic] Str Offset");
if (mod != null && mod.Offset < 0)
{
m.RemoveStatMod("[Magic] Str Offset");
sendEffect = true;
}
mod = m.GetStatMod( "[Magic] Dex Offset" );
if ( mod != null && mod.Offset < 0 )
{
m.RemoveStatMod( "[Magic] Dex Offset" );
sendEffect = true;
}
mod = m.GetStatMod("[Magic] Dex Offset");
if (mod != null && mod.Offset < 0)
{
m.RemoveStatMod("[Magic] Dex Offset");
sendEffect = true;
}
mod = m.GetStatMod( "[Magic] Int Offset" );
if ( mod != null && mod.Offset < 0 )
{
m.RemoveStatMod( "[Magic] Int Offset" );
sendEffect = true;
}
mod = m.GetStatMod("[Magic] Int Offset");
if (mod != null && mod.Offset < 0)
{
m.RemoveStatMod("[Magic] Int Offset");
sendEffect = true;
}
if ( m.Paralyzed )
{
m.Paralyzed = false;
sendEffect = true;
}
if (m.Paralyzed)
{
m.Paralyzed = false;
sendEffect = true;
}
if ( EvilOmenSpell.TryEndEffect( m ) )
sendEffect = true;
if (EvilOmenSpell.TryEndEffect(m))
sendEffect = true;
if ( StrangleSpell.RemoveCurse( m ) )
sendEffect = true;
if (StrangleSpell.RemoveCurse(m))
sendEffect = true;
if ( CorpseSkinSpell.RemoveCurse( m ) )
sendEffect = true;
if (CorpseSkinSpell.RemoveCurse(m))
sendEffect = true;
// TODO: Should this remove blood oath? Pain spike?
// TODO: Should this remove blood oath? Pain spike?
if ( sendEffect )
{
m.FixedParticles( 0x375A, 1, 15, 5005, 5, 3, EffectLayer.Head );
sacrifice = true;
}
}
}
if (sendEffect)
{
m.FixedParticles(0x375A, 1, 15, 5005, 5, 3, EffectLayer.Head);
sacrifice = true;
}
}
}
if ( sacrifice )
{
Caster.PlaySound( Caster.Body.IsFemale ? 0x150 : 0x423 );
Caster.Hits = 1;
Caster.Stam = 1;
Caster.Mana = 1;
}
}
if (sacrifice)
{
Caster.PlaySound(Caster.Body.IsFemale ? 0x150 : 0x423);
Caster.Hits = 1;
Caster.Stam = 1;
Caster.Mana = 1;
}
}
FinishSequence();
}
}
}
FinishSequence();
}
}
}

View file

@ -3,139 +3,145 @@ using Server.Network;
namespace Server.Spells.Chivalry
{
public abstract class PaladinSpell : Spell
{
public abstract double RequiredSkill{ get; }
public abstract int RequiredMana{ get; }
public abstract int RequiredTithing{ get; }
public abstract int MantraNumber{ get; }
public abstract class PaladinSpell : Spell
{
public PaladinSpell(Mobile caster, Item scroll, SpellInfo info) : base(caster, scroll, info)
{
}
public override SkillName CastSkill => SkillName.Chivalry;
public override SkillName DamageSkill => SkillName.Chivalry;
public abstract double RequiredSkill{ get; }
public abstract int RequiredMana{ get; }
public abstract int RequiredTithing{ get; }
public abstract int MantraNumber{ get; }
public override bool ClearHandsOnCast => false;
public override SkillName CastSkill => SkillName.Chivalry;
public override SkillName DamageSkill => SkillName.Chivalry;
//public override int CastDelayBase => 1;
public override bool ClearHandsOnCast => false;
public override int CastRecoveryBase => 7;
//public override int CastDelayBase => 1;
public PaladinSpell( Mobile caster, Item scroll, SpellInfo info ) : base( caster, scroll, info )
{
}
public override int CastRecoveryBase => 7;
public override bool CheckCast()
{
int mana = ScaleMana( RequiredMana );
public override bool CheckCast()
{
int mana = ScaleMana(RequiredMana);
if ( !base.CheckCast() )
return false;
if (!base.CheckCast())
return false;
if ( Caster.TithingPoints < RequiredTithing )
{
Caster.SendLocalizedMessage( 1060173, RequiredTithing.ToString() ); // You must have at least ~1_TITHE_REQUIREMENT~ Tithing Points to use this ability,
return false;
}
if (Caster.TithingPoints < RequiredTithing)
{
Caster.SendLocalizedMessage(1060173,
RequiredTithing
.ToString()); // You must have at least ~1_TITHE_REQUIREMENT~ Tithing Points to use this ability,
return false;
}
if ( Caster.Mana < mana )
{
Caster.SendLocalizedMessage( 1060174, mana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
return false;
}
if (Caster.Mana < mana)
{
Caster.SendLocalizedMessage(1060174,
mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
return false;
}
return true;
}
return true;
}
public override bool CheckFizzle()
{
int requiredTithing = RequiredTithing;
public override bool CheckFizzle()
{
int requiredTithing = RequiredTithing;
if ( AosAttributes.GetValue( Caster, AosAttribute.LowerRegCost ) > Utility.Random( 100 ) )
requiredTithing = 0;
if (AosAttributes.GetValue(Caster, AosAttribute.LowerRegCost) > Utility.Random(100))
requiredTithing = 0;
int mana = ScaleMana( RequiredMana );
int mana = ScaleMana(RequiredMana);
if ( Caster.TithingPoints < requiredTithing )
{
Caster.SendLocalizedMessage( 1060173, RequiredTithing.ToString() ); // You must have at least ~1_TITHE_REQUIREMENT~ Tithing Points to use this ability,
return false;
}
if (Caster.TithingPoints < requiredTithing)
{
Caster.SendLocalizedMessage(1060173,
RequiredTithing
.ToString()); // You must have at least ~1_TITHE_REQUIREMENT~ Tithing Points to use this ability,
return false;
}
if ( Caster.Mana < mana )
{
Caster.SendLocalizedMessage( 1060174, mana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
return false;
}
if (Caster.Mana < mana)
{
Caster.SendLocalizedMessage(1060174,
mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
return false;
}
Caster.TithingPoints -= requiredTithing;
Caster.TithingPoints -= requiredTithing;
if ( !base.CheckFizzle() )
return false;
if (!base.CheckFizzle())
return false;
Caster.Mana -= mana;
Caster.Mana -= mana;
return true;
}
return true;
}
public override void SayMantra()
{
Caster.PublicOverheadMessage( MessageType.Regular, 0x3B2, MantraNumber, "", false );
}
public override void SayMantra()
{
Caster.PublicOverheadMessage(MessageType.Regular, 0x3B2, MantraNumber, "", false);
}
public override void DoFizzle()
{
Caster.PlaySound( 0x1D6 );
Caster.NextSpellTime = Core.TickCount;
}
public override void DoFizzle()
{
Caster.PlaySound(0x1D6);
Caster.NextSpellTime = Core.TickCount;
}
public override void DoHurtFizzle()
{
Caster.PlaySound( 0x1D6 );
}
public override void DoHurtFizzle()
{
Caster.PlaySound(0x1D6);
}
public override void OnDisturb( DisturbType type, bool message )
{
base.OnDisturb( type, message );
public override void OnDisturb(DisturbType type, bool message)
{
base.OnDisturb(type, message);
if ( message )
Caster.PlaySound( 0x1D6 );
}
if (message)
Caster.PlaySound(0x1D6);
}
public override void OnBeginCast()
{
base.OnBeginCast();
public override void OnBeginCast()
{
base.OnBeginCast();
SendCastEffect();
}
SendCastEffect();
}
public virtual void SendCastEffect()
{
Caster.FixedEffect( 0x37C4, 10, (int)( GetCastDelay().TotalSeconds * 28 ), 4, 3 );
}
public virtual void SendCastEffect()
{
Caster.FixedEffect(0x37C4, 10, (int)(GetCastDelay().TotalSeconds * 28), 4, 3);
}
public override void GetCastSkills( out double min, out double max )
{
min = RequiredSkill;
max = RequiredSkill + 50.0;
}
public override void GetCastSkills(out double min, out double max)
{
min = RequiredSkill;
max = RequiredSkill + 50.0;
}
public override int GetMana()
{
return 0;
}
public override int GetMana()
{
return 0;
}
public int ComputePowerValue( int div )
{
return ComputePowerValue( Caster, div );
}
public int ComputePowerValue(int div)
{
return ComputePowerValue(Caster, div);
}
public static int ComputePowerValue( Mobile from, int div )
{
if ( from == null )
return 0;
public static int ComputePowerValue(Mobile from, int div)
{
if (from == null)
return 0;
int v = (int) Math.Sqrt( from.Karma + 20000 + (from.Skills.Chivalry.Fixed * 10) );
int v = (int)Math.Sqrt(from.Karma + 20000 + from.Skills.Chivalry.Fixed * 10);
return v / div;
}
}
}
return v / div;
}
}
}

View file

@ -1,141 +1,143 @@
using System;
using Server.Engines.ConPVP;
using Server.Items;
using Server.Targeting;
using Server.Spells.Necromancy;
using Server.Spells.Fourth;
using Server.Spells.Necromancy;
using Server.Targeting;
namespace Server.Spells.Chivalry
{
public class RemoveCurseSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Remove Curse", "Extermo Vomica",
-1,
9002
);
public class RemoveCurseSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Remove Curse", "Extermo Vomica",
-1,
9002
);
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 1.5 );
public RemoveCurseSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{
}
public override double RequiredSkill => 5.0;
public override int RequiredMana => 20;
public override int RequiredTithing => 10;
public override int MantraNumber => 1060726; // Extermo Vomica
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds(1.5);
public RemoveCurseSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override double RequiredSkill => 5.0;
public override int RequiredMana => 20;
public override int RequiredTithing => 10;
public override int MantraNumber => 1060726; // Extermo Vomica
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 ( CheckBSequence( m ) )
{
SpellHelper.Turn( Caster, m );
public void Target(Mobile m)
{
if (CheckBSequence(m))
{
SpellHelper.Turn(Caster, m);
/* Attempts to remove all Curse effects from Target.
* Curses include Mage spells such as Clumsy, Weaken, Feeblemind and Paralyze
* as well as all Necromancer curses.
* Chance of removing curse is affected by Caster's Karma.
*/
/* Attempts to remove all Curse effects from Target.
* Curses include Mage spells such as Clumsy, Weaken, Feeblemind and Paralyze
* as well as all Necromancer curses.
* Chance of removing curse is affected by Caster's Karma.
*/
int chance = 0;
int chance = 0;
if ( Caster.Karma < -5000 )
chance = 0;
else if ( Caster.Karma < 0 )
chance = (int) Math.Sqrt( 20000 + Caster.Karma ) - 122;
else if ( Caster.Karma < 5625 )
chance = (int) Math.Sqrt( Caster.Karma ) + 25;
else
chance = 100;
if (Caster.Karma < -5000)
chance = 0;
else if (Caster.Karma < 0)
chance = (int)Math.Sqrt(20000 + Caster.Karma) - 122;
else if (Caster.Karma < 5625)
chance = (int)Math.Sqrt(Caster.Karma) + 25;
else
chance = 100;
if ( chance > Utility.Random( 100 ) )
{
m.PlaySound( 0xF6 );
m.PlaySound( 0x1F7 );
m.FixedParticles( 0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head );
if (chance > Utility.Random(100))
{
m.PlaySound(0xF6);
m.PlaySound(0x1F7);
m.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);
IEntity from = new Entity( Serial.Zero, new Point3D( m.X, m.Y, m.Z - 10 ), Caster.Map );
IEntity to = new Entity( Serial.Zero, new Point3D( m.X, m.Y, m.Z + 50 ), Caster.Map );
Effects.SendMovingParticles( from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100 );
IEntity from = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z - 10), Caster.Map);
IEntity to = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 50), Caster.Map);
Effects.SendMovingParticles(from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head,
0x100);
StatMod mod;
StatMod mod;
mod = m.GetStatMod( "[Magic] Str Offset" );
if ( mod != null && mod.Offset < 0 )
m.RemoveStatMod( "[Magic] Str Offset" );
mod = m.GetStatMod("[Magic] Str Offset");
if (mod != null && mod.Offset < 0)
m.RemoveStatMod("[Magic] Str Offset");
mod = m.GetStatMod( "[Magic] Dex Offset" );
if ( mod != null && mod.Offset < 0 )
m.RemoveStatMod( "[Magic] Dex Offset" );
mod = m.GetStatMod("[Magic] Dex Offset");
if (mod != null && mod.Offset < 0)
m.RemoveStatMod("[Magic] Dex Offset");
mod = m.GetStatMod( "[Magic] Int Offset" );
if ( mod != null && mod.Offset < 0 )
m.RemoveStatMod( "[Magic] Int Offset" );
mod = m.GetStatMod("[Magic] Int Offset");
if (mod != null && mod.Offset < 0)
m.RemoveStatMod("[Magic] Int Offset");
m.Paralyzed = false;
m.Paralyzed = false;
EvilOmenSpell.TryEndEffect( m );
StrangleSpell.RemoveCurse( m );
CorpseSkinSpell.RemoveCurse( m );
CurseSpell.RemoveEffect( m );
MortalStrike.EndWound( m );
if (Core.ML) { BloodOathSpell.RemoveCurse ( m ); }
MindRotSpell.ClearMindRotScalar ( m );
EvilOmenSpell.TryEndEffect(m);
StrangleSpell.RemoveCurse(m);
CorpseSkinSpell.RemoveCurse(m);
CurseSpell.RemoveEffect(m);
MortalStrike.EndWound(m);
if (Core.ML) BloodOathSpell.RemoveCurse(m);
MindRotSpell.ClearMindRotScalar(m);
BuffInfo.RemoveBuff( m, BuffIcon.Clumsy );
BuffInfo.RemoveBuff( m, BuffIcon.FeebleMind );
BuffInfo.RemoveBuff( m, BuffIcon.Weaken );
BuffInfo.RemoveBuff ( m, BuffIcon.Curse );
BuffInfo.RemoveBuff( m, BuffIcon.MassCurse );
BuffInfo.RemoveBuff( m, BuffIcon.MortalStrike );
BuffInfo.RemoveBuff ( m, BuffIcon.Mindrot );
BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
BuffInfo.RemoveBuff(m, BuffIcon.Curse);
BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);
// TODO: Should this remove blood oath? Pain spike?
}
else
{
m.PlaySound( 0x1DF );
}
}
// TODO: Should this remove blood oath? Pain spike?
}
else
{
m.PlaySound(0x1DF);
}
}
FinishSequence();
}
FinishSequence();
}
private class InternalTarget : Target
{
private RemoveCurseSpell m_Owner;
private class InternalTarget : Target
{
private RemoveCurseSpell m_Owner;
public InternalTarget( RemoveCurseSpell owner ) : base( Core.ML ? 10 : 12, false, TargetFlags.Beneficial )
{
m_Owner = owner;
}
public InternalTarget(RemoveCurseSpell owner) : base(Core.ML ? 10 : 12, 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();
}
}
}
}

View file

@ -1,202 +1,211 @@
using System;
using Server.Factions;
using Server.Items;
using Server.Multis;
using Server.Misc;
using Server.Mobiles;
using Server.Multis;
using Server.Network;
using Server.Targeting;
namespace Server.Spells.Chivalry
{
public class SacredJourneySpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Sacred Journey", "Sanctum Viatas",
-1,
9002
);
public class SacredJourneySpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Sacred Journey", "Sanctum Viatas",
-1,
9002
);
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 1.5 );
private Runebook m_Book;
public override double RequiredSkill => 15.0;
public override int RequiredMana => 10;
public override int RequiredTithing => 15;
public override int MantraNumber => 1060727; // Sanctum Viatas
public override bool BlocksMovement => false;
private RunebookEntry m_Entry;
private RunebookEntry m_Entry;
private Runebook m_Book;
public SacredJourneySpell(Mobile caster, Item scroll) : this(caster, scroll, null, null)
{
}
public SacredJourneySpell( Mobile caster, Item scroll ) : this( caster, scroll, null, null )
{
}
public SacredJourneySpell(Mobile caster, Item scroll, RunebookEntry entry, Runebook book) : base(caster, scroll,
m_Info)
{
m_Entry = entry;
m_Book = book;
}
public SacredJourneySpell( Mobile caster, Item scroll, RunebookEntry entry, Runebook book ) : base( caster, scroll, m_Info )
{
m_Entry = entry;
m_Book = book;
}
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds(1.5);
public override void OnCast()
{
if ( m_Entry == null )
Caster.Target = new InternalTarget( this );
else
Effect( m_Entry.Location, m_Entry.Map, true );
}
public override double RequiredSkill => 15.0;
public override int RequiredMana => 10;
public override int RequiredTithing => 15;
public override int MantraNumber => 1060727; // Sanctum Viatas
public override bool BlocksMovement => false;
public override bool CheckCast()
{
if ( !base.CheckCast() )
return false;
public override void OnCast()
{
if (m_Entry == null)
Caster.Target = new InternalTarget(this);
else
Effect(m_Entry.Location, m_Entry.Map, true);
}
if ( Factions.Sigil.ExistsOn( Caster ) )
{
Caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
return false;
}
public override bool CheckCast()
{
if (!base.CheckCast())
return false;
if ( Caster.Criminal )
{
Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
return false;
}
if ( SpellHelper.CheckCombat( Caster ) )
{
Caster.SendLocalizedMessage( 1061282 ); // You cannot use the Sacred Journey ability to flee from combat.
return false;
}
if ( Misc.WeightOverloading.IsOverloaded( Caster ) )
{
Caster.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
return false;
}
if (Sigil.ExistsOn(Caster))
{
Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
return false;
}
return SpellHelper.CheckTravel( Caster, TravelCheckType.RecallFrom );
}
if (Caster.Criminal)
{
Caster.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
return false;
}
public void Effect( Point3D loc, Map map, bool checkMulti )
{
if ( Factions.Sigil.ExistsOn( Caster ) )
{
Caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
}
else if ( map == null || (!Core.AOS && Caster.Map != map) )
{
Caster.SendLocalizedMessage( 1005569 ); // You can not recall to another facet.
}
else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.RecallFrom ) )
{
}
else if ( !SpellHelper.CheckTravel( Caster, map, loc, TravelCheckType.RecallTo ) )
{
}
else if ( map == Map.Felucca && Caster is PlayerMobile && ((PlayerMobile)Caster).Young )
{
Caster.SendLocalizedMessage( 1049543 ); // You decide against traveling to Felucca while you are still young.
}
else if ( Caster.Kills >= 5 && map != Map.Felucca )
{
Caster.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
}
else if ( Caster.Criminal )
{
Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
}
else if ( SpellHelper.CheckCombat( Caster ) )
{
Caster.SendLocalizedMessage( 1061282 ); // You cannot use the Sacred Journey ability to flee from combat.
}
else if ( Misc.WeightOverloading.IsOverloaded( Caster ) )
{
Caster.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
}
else if ( !map.CanSpawnMobile( loc.X, loc.Y, loc.Z ) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( (checkMulti && SpellHelper.CheckMulti( loc, map )) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( m_Book != null && m_Book.CurCharges <= 0 )
{
Caster.SendLocalizedMessage( 502412 ); // There are no charges left on that item.
}
else if ( CheckSequence() )
{
BaseCreature.TeleportPets( Caster, loc, map, true );
if (SpellHelper.CheckCombat(Caster))
{
Caster.SendLocalizedMessage(1061282); // You cannot use the Sacred Journey ability to flee from combat.
return false;
}
if ( m_Book != null )
--m_Book.CurCharges;
if (WeightOverloading.IsOverloaded(Caster))
{
Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
return false;
}
Effects.SendLocationParticles( EffectItem.Create( Caster.Location, Caster.Map, EffectItem.DefaultDuration ), 0, 0, 0, 5033 );
return SpellHelper.CheckTravel(Caster, TravelCheckType.RecallFrom);
}
Caster.PlaySound( 0x1FC );
Caster.MoveToWorld( loc, map );
Caster.PlaySound( 0x1FC );
}
public void Effect(Point3D loc, Map map, bool checkMulti)
{
if (Sigil.ExistsOn(Caster))
{
Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
}
else if (map == null || !Core.AOS && Caster.Map != map)
{
Caster.SendLocalizedMessage(1005569); // You can not recall to another facet.
}
else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.RecallFrom))
{
}
else if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.RecallTo))
{
}
else if (map == Map.Felucca && Caster is PlayerMobile && ((PlayerMobile)Caster).Young)
{
Caster.SendLocalizedMessage(1049543); // You decide against traveling to Felucca while you are still young.
}
else if (Caster.Kills >= 5 && map != Map.Felucca)
{
Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there.
}
else if (Caster.Criminal)
{
Caster.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
}
else if (SpellHelper.CheckCombat(Caster))
{
Caster.SendLocalizedMessage(1061282); // You cannot use the Sacred Journey ability to flee from combat.
}
else if (WeightOverloading.IsOverloaded(Caster))
{
Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
}
else if (!map.CanSpawnMobile(loc.X, loc.Y, loc.Z))
{
Caster.SendLocalizedMessage(501942); // That location is blocked.
}
else if (checkMulti && SpellHelper.CheckMulti(loc, map))
{
Caster.SendLocalizedMessage(501942); // That location is blocked.
}
else if (m_Book != null && m_Book.CurCharges <= 0)
{
Caster.SendLocalizedMessage(502412); // There are no charges left on that item.
}
else if (CheckSequence())
{
BaseCreature.TeleportPets(Caster, loc, map, true);
FinishSequence();
}
if (m_Book != null)
--m_Book.CurCharges;
private class InternalTarget : Target
{
private SacredJourneySpell m_Owner;
Effects.SendLocationParticles(EffectItem.Create(Caster.Location, Caster.Map, EffectItem.DefaultDuration), 0,
0, 0, 5033);
public InternalTarget( SacredJourneySpell owner ) : base( Core.ML ? 10 : 12, false, TargetFlags.None )
{
m_Owner = owner;
}
Caster.PlaySound(0x1FC);
Caster.MoveToWorld(loc, map);
Caster.PlaySound(0x1FC);
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is RecallRune )
{
RecallRune rune = (RecallRune)o;
FinishSequence();
}
if ( rune.Marked )
m_Owner.Effect( rune.Target, rune.TargetMap, true );
else
from.SendLocalizedMessage( 501805 ); // That rune is not yet marked.
}
else if ( o is Runebook )
{
RunebookEntry e = ((Runebook)o).Default;
private class InternalTarget : Target
{
private SacredJourneySpell m_Owner;
if ( e != null )
m_Owner.Effect( e.Location, e.Map, true );
else
from.SendLocalizedMessage( 502354 ); // Target is not marked.
}
else if ( o is Key && ((Key)o).KeyValue != 0 && ((Key)o).Link is BaseBoat )
{
BaseBoat boat = ((Key)o).Link as BaseBoat;
public InternalTarget(SacredJourneySpell owner) : base(Core.ML ? 10 : 12, false, TargetFlags.None)
{
m_Owner = owner;
}
if ( !boat.Deleted && boat.CheckKey( ((Key)o).KeyValue ) )
m_Owner.Effect( boat.GetMarkedLocation(), boat.Map, false );
else
from.Send( new MessageLocalized( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 502357, from.Name, "" ) ); // I can not recall from that object.
}
else if ( o is HouseRaffleDeed && ((HouseRaffleDeed)o).ValidLocation() )
{
HouseRaffleDeed deed = (HouseRaffleDeed)o;
protected override void OnTarget(Mobile from, object o)
{
if (o is RecallRune)
{
RecallRune rune = (RecallRune)o;
m_Owner.Effect( deed.PlotLocation, deed.PlotFacet, true );
}
else
{
from.Send( new MessageLocalized( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 502357, from.Name, "" ) ); // I can not recall from that object.
}
}
if (rune.Marked)
m_Owner.Effect(rune.Target, rune.TargetMap, true);
else
from.SendLocalizedMessage(501805); // That rune is not yet marked.
}
else if (o is Runebook)
{
RunebookEntry e = ((Runebook)o).Default;
protected override void OnNonlocalTarget( Mobile from, object o )
{
}
if (e != null)
m_Owner.Effect(e.Location, e.Map, true);
else
from.SendLocalizedMessage(502354); // Target is not marked.
}
else if (o is Key && ((Key)o).KeyValue != 0 && ((Key)o).Link is BaseBoat)
{
BaseBoat boat = ((Key)o).Link as BaseBoat;
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
}
}
if (!boat.Deleted && boat.CheckKey(((Key)o).KeyValue))
m_Owner.Effect(boat.GetMarkedLocation(), boat.Map, false);
else
from.Send(new MessageLocalized(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 502357,
from.Name, "")); // I can not recall from that object.
}
else if (o is HouseRaffleDeed && ((HouseRaffleDeed)o).ValidLocation())
{
HouseRaffleDeed deed = (HouseRaffleDeed)o;
m_Owner.Effect(deed.PlotLocation, deed.PlotFacet, true);
}
else
{
from.Send(new MessageLocalized(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 502357, from.Name,
"")); // I can not recall from that object.
}
}
protected override void OnNonlocalTarget(Mobile from, object o)
{
}
protected override void OnTargetFinish(Mobile from)
{
m_Owner.FinishSequence();
}
}
}
}