Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
89
Scripts/Spells/Sixth/Dispel.cs
Normal file
89
Scripts/Spells/Sixth/Dispel.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Spells.Sixth
|
||||
{
|
||||
public class DispelSpell : MagerySpell
|
||||
{
|
||||
private static readonly SpellInfo m_Info = new SpellInfo(
|
||||
"Dispel", "An Ort",
|
||||
218,
|
||||
9002,
|
||||
Reagent.Garlic,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.SulfurousAsh);
|
||||
public DispelSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get
|
||||
{
|
||||
return SpellCircle.Sixth;
|
||||
}
|
||||
}
|
||||
public override void OnCast()
|
||||
{
|
||||
this.Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public class InternalTarget : Target
|
||||
{
|
||||
private readonly DispelSpell m_Owner;
|
||||
public InternalTarget(DispelSpell owner)
|
||||
: base(Core.ML ? 10 : 12, false, TargetFlags.Harmful)
|
||||
{
|
||||
this.m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (o is Mobile)
|
||||
{
|
||||
Mobile m = (Mobile)o;
|
||||
BaseCreature bc = m as BaseCreature;
|
||||
|
||||
if (!from.CanSee(m))
|
||||
{
|
||||
from.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (bc == null || !bc.IsDispellable)
|
||||
{
|
||||
from.SendLocalizedMessage(1005049); // That cannot be dispelled.
|
||||
}
|
||||
else if (bc.SummonMaster == from || m_Owner.CheckHSequence(m))
|
||||
{
|
||||
SpellHelper.Turn(from, m);
|
||||
|
||||
double dispelChance = (50.0 + ((100 * (from.Skills.Magery.Value - bc.GetDispelDifficulty())) / (bc.DispelFocus * 2))) / 100;
|
||||
|
||||
//Skill Masteries
|
||||
dispelChance -= ((double)SkillMasteries.MasteryInfo.EnchantedSummoningBonus(bc) / 100);
|
||||
|
||||
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();
|
||||
}
|
||||
else
|
||||
{
|
||||
m.FixedEffect(0x3779, 10, 20);
|
||||
from.SendLocalizedMessage(1010084); // The creature resisted the attempt to dispel it!
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
this.m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
117
Scripts/Spells/Sixth/EnergyBolt.cs
Normal file
117
Scripts/Spells/Sixth/EnergyBolt.cs
Normal file
@@ -0,0 +1,117 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Spells.Sixth
|
||||
{
|
||||
public class EnergyBoltSpell : MagerySpell
|
||||
{
|
||||
private static readonly SpellInfo m_Info = new SpellInfo(
|
||||
"Energy Bolt", "Corp Por",
|
||||
230,
|
||||
9022,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.Nightshade);
|
||||
public EnergyBoltSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get
|
||||
{
|
||||
return SpellCircle.Sixth;
|
||||
}
|
||||
}
|
||||
public override bool DelayedDamage
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public void Target(IDamageable m)
|
||||
{
|
||||
if (!Caster.CanSee(m))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (CheckHSequence(m))
|
||||
{
|
||||
IDamageable source = Caster;
|
||||
IDamageable target = m;
|
||||
|
||||
SpellHelper.Turn(Caster, m);
|
||||
|
||||
if (SpellHelper.CheckReflect((int)Circle, ref source, ref target))
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(.5), () =>
|
||||
{
|
||||
source.MovingParticles(target, 0x379F, 7, 0, false, true, 3043, 4043, 0x211);
|
||||
source.PlaySound(0x20A);
|
||||
});
|
||||
}
|
||||
|
||||
double damage = 0;
|
||||
|
||||
if (Core.AOS)
|
||||
{
|
||||
damage = GetNewAosDamage(40, 1, 5, m);
|
||||
}
|
||||
else if (m is Mobile)
|
||||
{
|
||||
Mobile mob = m as Mobile;
|
||||
damage = Utility.Random(24, 18);
|
||||
|
||||
if (CheckResisted(mob))
|
||||
{
|
||||
damage *= 0.75;
|
||||
|
||||
mob.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
|
||||
}
|
||||
|
||||
// Scale damage based on evalint and resist
|
||||
damage *= GetDamageScalar(mob);
|
||||
}
|
||||
|
||||
// Do the effects
|
||||
Caster.MovingParticles(m, 0x379F, 7, 0, false, true, 3043, 4043, 0x211);
|
||||
Caster.PlaySound(0x20A);
|
||||
|
||||
if (damage > 0)
|
||||
{
|
||||
// Deal the damage
|
||||
SpellHelper.Damage(this, target, damage, 0, 0, 0, 0, 100);
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly EnergyBoltSpell m_Owner;
|
||||
public InternalTarget(EnergyBoltSpell owner)
|
||||
: base(Core.ML ? 10 : 12, false, TargetFlags.Harmful)
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (o is IDamageable)
|
||||
m_Owner.Target((IDamageable)o);
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
160
Scripts/Spells/Sixth/Explosion.cs
Normal file
160
Scripts/Spells/Sixth/Explosion.cs
Normal file
@@ -0,0 +1,160 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Spells.Sixth
|
||||
{
|
||||
public class ExplosionSpell : MagerySpell
|
||||
{
|
||||
private static readonly SpellInfo m_Info = new SpellInfo(
|
||||
"Explosion", "Vas Ort Flam",
|
||||
230,
|
||||
9041,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.MandrakeRoot);
|
||||
public ExplosionSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get
|
||||
{
|
||||
return SpellCircle.Sixth;
|
||||
}
|
||||
}
|
||||
public override bool DelayedDamageStacking
|
||||
{
|
||||
get
|
||||
{
|
||||
return !Core.AOS;
|
||||
}
|
||||
}
|
||||
public override bool DelayedDamage
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public void Target(IDamageable m)
|
||||
{
|
||||
if (Core.SA && HasDelayContext(m))
|
||||
{
|
||||
DoHurtFizzle();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Caster.CanSee(m))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (Caster.CanBeHarmful(m) && CheckSequence())
|
||||
{
|
||||
Mobile attacker = Caster;
|
||||
|
||||
SpellHelper.Turn(Caster, m);
|
||||
|
||||
SpellHelper.CheckReflect((int)Circle, Caster, ref m);
|
||||
|
||||
InternalTimer t = new InternalTimer(this, attacker, m);
|
||||
t.Start();
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private readonly MagerySpell m_Spell;
|
||||
private readonly IDamageable m_Target;
|
||||
private readonly Mobile m_Attacker;
|
||||
|
||||
public InternalTimer(MagerySpell spell, Mobile attacker, IDamageable target)
|
||||
: base(TimeSpan.FromSeconds(Core.AOS ? 3.0 : 2.5))
|
||||
{
|
||||
m_Spell = spell;
|
||||
m_Attacker = attacker;
|
||||
m_Target = target;
|
||||
|
||||
if (m_Spell != null)
|
||||
m_Spell.StartDelayedDamageContext(attacker, this);
|
||||
|
||||
Priority = TimerPriority.FiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
Mobile defender = m_Target as Mobile;
|
||||
|
||||
if (m_Attacker.HarmfulCheck(m_Target))
|
||||
{
|
||||
double damage = 0;
|
||||
|
||||
if (Core.AOS)
|
||||
{
|
||||
damage = m_Spell.GetNewAosDamage(40, 1, 5, m_Target);
|
||||
}
|
||||
else if (defender != null)
|
||||
{
|
||||
damage = Utility.Random(23, 22);
|
||||
|
||||
if (m_Spell.CheckResisted(defender))
|
||||
{
|
||||
damage *= 0.75;
|
||||
|
||||
defender.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
|
||||
}
|
||||
|
||||
damage *= m_Spell.GetDamageScalar(defender);
|
||||
}
|
||||
|
||||
if (defender != null)
|
||||
{
|
||||
defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
|
||||
defender.PlaySound(0x307);
|
||||
}
|
||||
else
|
||||
{
|
||||
Effects.SendLocationParticles(m_Target, 0x36BD, 20, 10, 5044);
|
||||
Effects.PlaySound(m_Target.Location, m_Target.Map, 0x307);
|
||||
}
|
||||
|
||||
if (damage > 0)
|
||||
{
|
||||
SpellHelper.Damage(m_Spell, m_Target, damage, 0, 100, 0, 0, 0);
|
||||
}
|
||||
|
||||
if (m_Spell != null)
|
||||
m_Spell.RemoveDelayedDamageContext(m_Attacker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly ExplosionSpell m_Owner;
|
||||
public InternalTarget(ExplosionSpell owner)
|
||||
: base(Core.ML ? 10 : 12, false, TargetFlags.Harmful)
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (o is IDamageable)
|
||||
m_Owner.Target((IDamageable)o);
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
128
Scripts/Spells/Sixth/Invisibility.cs
Normal file
128
Scripts/Spells/Sixth/Invisibility.cs
Normal file
@@ -0,0 +1,128 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Spells.Sixth
|
||||
{
|
||||
public class InvisibilitySpell : MagerySpell
|
||||
{
|
||||
private static readonly SpellInfo m_Info = new SpellInfo(
|
||||
"Invisibility", "An Lor Xen",
|
||||
206,
|
||||
9002,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.Nightshade);
|
||||
private static readonly Hashtable m_Table = new Hashtable();
|
||||
public InvisibilitySpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get
|
||||
{
|
||||
return SpellCircle.Sixth;
|
||||
}
|
||||
}
|
||||
public static bool HasTimer(Mobile m)
|
||||
{
|
||||
return m_Table[m] != null;
|
||||
}
|
||||
|
||||
public static void RemoveTimer(Mobile m)
|
||||
{
|
||||
Timer t = (Timer)m_Table[m];
|
||||
|
||||
if (t != null)
|
||||
{
|
||||
t.Stop();
|
||||
m_Table.Remove(m);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
this.Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public void Target(Mobile m)
|
||||
{
|
||||
if (!this.Caster.CanSee(m))
|
||||
{
|
||||
this.Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (m is Mobiles.BaseVendor || m is Mobiles.PlayerVendor || m is Mobiles.PlayerBarkeeper || m.AccessLevel > this.Caster.AccessLevel)
|
||||
{
|
||||
this.Caster.SendLocalizedMessage(501857); // This spell won't work on that!
|
||||
}
|
||||
else if (this.CheckBSequence(m))
|
||||
{
|
||||
SpellHelper.Turn(this.Caster, m);
|
||||
|
||||
Effects.SendLocationParticles(EffectItem.Create(new Point3D(m.X, m.Y, m.Z + 16), this.Caster.Map, EffectItem.DefaultDuration), 0x376A, 10, 15, 5045);
|
||||
m.PlaySound(0x3C4);
|
||||
|
||||
m.Hidden = true;
|
||||
m.Combatant = null;
|
||||
m.Warmode = false;
|
||||
|
||||
RemoveTimer(m);
|
||||
|
||||
TimeSpan duration = TimeSpan.FromSeconds(((1.2 * this.Caster.Skills.Magery.Fixed) / 10));
|
||||
|
||||
Timer t = new InternalTimer(m, duration);
|
||||
|
||||
BuffInfo.RemoveBuff(m, BuffIcon.HidingAndOrStealth);
|
||||
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Invisibility, 1075825, duration, m)); //Invisibility/Invisible
|
||||
|
||||
m_Table[m] = t;
|
||||
|
||||
t.Start();
|
||||
}
|
||||
|
||||
this.FinishSequence();
|
||||
}
|
||||
|
||||
public class InternalTarget : Target
|
||||
{
|
||||
private readonly InvisibilitySpell m_Owner;
|
||||
public InternalTarget(InvisibilitySpell owner)
|
||||
: base(Core.ML ? 10 : 12, false, TargetFlags.Beneficial)
|
||||
{
|
||||
this.m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (o is Mobile)
|
||||
{
|
||||
this.m_Owner.Target((Mobile)o);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
this.m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private readonly Mobile m_Mobile;
|
||||
public InternalTimer(Mobile m, TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
this.Priority = TimerPriority.OneSecond;
|
||||
this.m_Mobile = m;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
this.m_Mobile.RevealingAction();
|
||||
RemoveTimer(this.m_Mobile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
104
Scripts/Spells/Sixth/Mark.cs
Normal file
104
Scripts/Spells/Sixth/Mark.cs
Normal file
@@ -0,0 +1,104 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Spells.Sixth
|
||||
{
|
||||
public class MarkSpell : MagerySpell
|
||||
{
|
||||
private static readonly SpellInfo m_Info = new SpellInfo(
|
||||
"Mark", "Kal Por Ylem",
|
||||
218,
|
||||
9002,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.MandrakeRoot);
|
||||
public MarkSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get
|
||||
{
|
||||
return SpellCircle.Sixth;
|
||||
}
|
||||
}
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
if (!base.CheckCast())
|
||||
return false;
|
||||
|
||||
return SpellHelper.CheckTravel(Caster, TravelCheckType.Mark);
|
||||
}
|
||||
|
||||
public void Target(RecallRune rune)
|
||||
{
|
||||
BaseBoat boat = BaseBoat.FindBoatAt(Caster.Location, Caster.Map);
|
||||
|
||||
if (!Caster.CanSee(rune))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.Mark))
|
||||
{
|
||||
}
|
||||
else if (boat == null && SpellHelper.CheckMulti(Caster.Location, Caster.Map, !Core.AOS))
|
||||
{
|
||||
Caster.SendLocalizedMessage(501942); // That location is blocked.
|
||||
}
|
||||
else if (boat != null && !(boat is BaseGalleon))
|
||||
{
|
||||
Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501800); // You cannot mark an object at that location.
|
||||
}
|
||||
else if (!rune.IsChildOf(Caster.Backpack))
|
||||
{
|
||||
Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1062422); // You must have this rune in your backpack in order to mark it.
|
||||
}
|
||||
else if (CheckSequence())
|
||||
{
|
||||
rune.Mark(Caster);
|
||||
|
||||
Caster.PlaySound(0x1FA);
|
||||
Effects.SendLocationEffect(Caster, Caster.Map, 14201, 16);
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly MarkSpell m_Owner;
|
||||
public InternalTarget(MarkSpell owner)
|
||||
: base(Core.ML ? 10 : 12, false, TargetFlags.None)
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (o is RecallRune)
|
||||
{
|
||||
m_Owner.Target((RecallRune)o);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.Send(new MessageLocalized(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 501797, from.Name, "")); // I cannot mark that object.
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
81
Scripts/Spells/Sixth/MassCurse.cs
Normal file
81
Scripts/Spells/Sixth/MassCurse.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Server.Targeting;
|
||||
using Server.Spells.Fourth;
|
||||
|
||||
namespace Server.Spells.Sixth
|
||||
{
|
||||
public class MassCurseSpell : MagerySpell
|
||||
{
|
||||
private static readonly SpellInfo m_Info = new SpellInfo(
|
||||
"Mass Curse", "Vas Des Sanct",
|
||||
218,
|
||||
9031,
|
||||
false,
|
||||
Reagent.Garlic,
|
||||
Reagent.Nightshade,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.SulfurousAsh);
|
||||
public MassCurseSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get
|
||||
{
|
||||
return SpellCircle.Sixth;
|
||||
}
|
||||
}
|
||||
public override void OnCast()
|
||||
{
|
||||
this.Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public void Target(IPoint3D p)
|
||||
{
|
||||
if (!this.Caster.CanSee(p))
|
||||
{
|
||||
this.Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (SpellHelper.CheckTown(p, this.Caster) && this.CheckSequence())
|
||||
{
|
||||
SpellHelper.Turn(this.Caster, p);
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
foreach (var m in AcquireIndirectTargets(p, 2).OfType<Mobile>())
|
||||
{
|
||||
CurseSpell.DoCurse(this.Caster, m, true);
|
||||
}
|
||||
}
|
||||
|
||||
this.FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly MassCurseSpell m_Owner;
|
||||
public InternalTarget(MassCurseSpell owner)
|
||||
: base(Core.ML ? 10 : 12, true, TargetFlags.None)
|
||||
{
|
||||
this.m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
IPoint3D p = o as IPoint3D;
|
||||
|
||||
if (p != null)
|
||||
this.m_Owner.Target(p);
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
this.m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
251
Scripts/Spells/Sixth/ParalyzeField.cs
Normal file
251
Scripts/Spells/Sixth/ParalyzeField.cs
Normal file
@@ -0,0 +1,251 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Misc;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Spells.Sixth
|
||||
{
|
||||
public class ParalyzeFieldSpell : MagerySpell
|
||||
{
|
||||
private static readonly SpellInfo m_Info = new SpellInfo(
|
||||
"Paralyze Field", "In Ex Grav",
|
||||
230,
|
||||
9012,
|
||||
false,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.Ginseng,
|
||||
Reagent.SpidersSilk);
|
||||
public ParalyzeFieldSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get
|
||||
{
|
||||
return SpellCircle.Sixth;
|
||||
}
|
||||
}
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public void Target(IPoint3D p)
|
||||
{
|
||||
if (!Caster.CanSee(p))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (SpellHelper.CheckTown(p, Caster) && SpellHelper.CheckWater(new Point3D(p), Caster.Map) && CheckSequence())
|
||||
{
|
||||
SpellHelper.Turn(Caster, p);
|
||||
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
int dx = Caster.Location.X - p.X;
|
||||
int dy = Caster.Location.Y - p.Y;
|
||||
int rx = (dx - dy) * 44;
|
||||
int ry = (dx + dy) * 44;
|
||||
|
||||
bool eastToWest;
|
||||
|
||||
if (rx >= 0 && ry >= 0)
|
||||
eastToWest = false;
|
||||
else if (rx >= 0)
|
||||
eastToWest = true;
|
||||
else if (ry >= 0)
|
||||
eastToWest = true;
|
||||
else
|
||||
eastToWest = false;
|
||||
|
||||
Effects.PlaySound(p, Caster.Map, 0x20B);
|
||||
int itemID = eastToWest ? 0x3967 : 0x3979;
|
||||
|
||||
Point3D pnt = new Point3D(p);
|
||||
TimeSpan duration = TimeSpan.FromSeconds(3.0 + (Caster.Skills[SkillName.Magery].Value / 3.0));
|
||||
|
||||
if (SpellHelper.CheckField(pnt, Caster.Map))
|
||||
new InternalItem(itemID, pnt, Caster, Caster.Map, duration);
|
||||
|
||||
for (int i = 1; i <= 2; ++i)
|
||||
{
|
||||
Timer.DelayCall<int>(TimeSpan.FromMilliseconds(i * 300), index =>
|
||||
{
|
||||
Point3D point = new Point3D(eastToWest ? pnt.X + index : pnt.X, eastToWest ? pnt.Y : pnt.Y + index, pnt.Z);
|
||||
SpellHelper.AdjustField(ref point, Caster.Map, 16, false);
|
||||
|
||||
if (SpellHelper.CheckField(point, Caster.Map))
|
||||
new InternalItem(itemID, point, Caster, Caster.Map, duration);
|
||||
|
||||
point = new Point3D(eastToWest ? pnt.X + -index : pnt.X, eastToWest ? pnt.Y : pnt.Y + -index, pnt.Z);
|
||||
SpellHelper.AdjustField(ref point, Caster.Map, 16, false);
|
||||
|
||||
if (SpellHelper.CheckField(point, Caster.Map))
|
||||
new InternalItem(itemID, point, Caster, Caster.Map, duration);
|
||||
}, i);
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
[DispellableField]
|
||||
public class InternalItem : Item
|
||||
{
|
||||
private Timer m_Timer;
|
||||
private Mobile m_Caster;
|
||||
private DateTime m_End;
|
||||
|
||||
public Mobile Caster { get { return m_Caster; } }
|
||||
|
||||
public InternalItem(int itemID, Point3D loc, Mobile caster, Map map, TimeSpan duration)
|
||||
: base(itemID)
|
||||
{
|
||||
Movable = false;
|
||||
Light = LightType.Circle300;
|
||||
|
||||
MoveToWorld(loc, map);
|
||||
Effects.SendLocationParticles(EffectItem.Create(loc, map, EffectItem.DefaultDuration), 0x376A, 9, 10, 5048);
|
||||
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
m_Caster = caster;
|
||||
|
||||
m_Timer = new InternalTimer(this, duration);
|
||||
m_Timer.Start();
|
||||
|
||||
m_End = DateTime.UtcNow + duration;
|
||||
}
|
||||
|
||||
public InternalItem(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool BlocksFit
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if (m_Timer != null)
|
||||
m_Timer.Stop();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
|
||||
writer.Write(m_Caster);
|
||||
writer.WriteDeltaTime(m_End);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Caster = reader.ReadMobile();
|
||||
m_End = reader.ReadDeltaTime();
|
||||
|
||||
m_Timer = new InternalTimer(this, m_End - DateTime.UtcNow);
|
||||
m_Timer.Start();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
if (Visible && m_Caster != null && (!Core.AOS || m != m_Caster) && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false))
|
||||
{
|
||||
if (SpellHelper.CanRevealCaster(m))
|
||||
m_Caster.RevealingAction();
|
||||
|
||||
m_Caster.DoHarmful(m);
|
||||
|
||||
double duration;
|
||||
|
||||
if (Core.AOS)
|
||||
{
|
||||
duration = 2.0 + ((int)(m_Caster.Skills[SkillName.EvalInt].Value / 10) - (int)(m.Skills[SkillName.MagicResist].Value / 10));
|
||||
|
||||
if (!m.Player)
|
||||
duration *= 3.0;
|
||||
|
||||
if (duration < 0.0)
|
||||
duration = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
duration = 7.0 + (m_Caster.Skills[SkillName.Magery].Value * 0.2);
|
||||
}
|
||||
|
||||
m.Paralyze(TimeSpan.FromSeconds(duration));
|
||||
|
||||
m.PlaySound(0x204);
|
||||
m.FixedEffect(0x376A, 10, 16);
|
||||
|
||||
if (m is BaseCreature)
|
||||
((BaseCreature)m).OnHarmfulSpell(m_Caster);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private readonly Item m_Item;
|
||||
public InternalTimer(Item item, TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
Priority = TimerPriority.OneSecond;
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Item.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class InternalTarget : Target
|
||||
{
|
||||
private readonly ParalyzeFieldSpell m_Owner;
|
||||
public InternalTarget(ParalyzeFieldSpell owner)
|
||||
: base(Core.TOL ? 15 : Core.ML ? 10 : 12, true, TargetFlags.None)
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (o is IPoint3D)
|
||||
m_Owner.Target((IPoint3D)o);
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
126
Scripts/Spells/Sixth/Reveal.cs
Normal file
126
Scripts/Spells/Sixth/Reveal.cs
Normal file
@@ -0,0 +1,126 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Spells.Sixth
|
||||
{
|
||||
public class RevealSpell : MagerySpell
|
||||
{
|
||||
private static readonly SpellInfo m_Info = new SpellInfo(
|
||||
"Reveal", "Wis Quas",
|
||||
206,
|
||||
9002,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.SulfurousAsh);
|
||||
public RevealSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get
|
||||
{
|
||||
return SpellCircle.Sixth;
|
||||
}
|
||||
}
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public void Target(IPoint3D p)
|
||||
{
|
||||
if (!Caster.CanSee(p))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (CheckSequence())
|
||||
{
|
||||
SpellHelper.Turn(Caster, p);
|
||||
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
List<Mobile> targets = new List<Mobile>();
|
||||
|
||||
Map map = Caster.Map;
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 1 + (int)(Caster.Skills[SkillName.Magery].Value / 20.0));
|
||||
|
||||
foreach (Mobile m in eable)
|
||||
{
|
||||
if ((m is Mobiles.ShadowKnight && (m.X != p.X || m.Y != p.Y)) || !SkillHandlers.DetectHidden.CanDetect(Caster, m))
|
||||
continue;
|
||||
|
||||
if (m.Hidden && (m.IsPlayer() || Caster.AccessLevel > m.AccessLevel) && CheckDifficulty(Caster, m))
|
||||
targets.Add(m);
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
for (int i = 0; i < targets.Count; ++i)
|
||||
{
|
||||
Mobile m = targets[i];
|
||||
|
||||
m.RevealingAction();
|
||||
|
||||
m.FixedParticles(0x375A, 9, 20, 5049, EffectLayer.Head);
|
||||
m.PlaySound(0x1FD);
|
||||
}
|
||||
|
||||
ColUtility.Free(targets);
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
// Reveal uses magery and detect hidden vs. hide and stealth
|
||||
private static bool CheckDifficulty(Mobile from, Mobile m)
|
||||
{
|
||||
// Reveal always reveals vs. invisibility spell
|
||||
if (!Core.AOS || InvisibilitySpell.HasTimer(m))
|
||||
return true;
|
||||
|
||||
int magery = from.Skills[SkillName.Magery].Fixed;
|
||||
int detectHidden = from.Skills[SkillName.DetectHidden].Fixed;
|
||||
|
||||
int hiding = m.Skills[SkillName.Hiding].Fixed;
|
||||
int stealth = m.Skills[SkillName.Stealth].Fixed;
|
||||
int divisor = hiding + stealth;
|
||||
|
||||
int chance;
|
||||
if (divisor > 0)
|
||||
chance = 50 * (magery + detectHidden) / divisor;
|
||||
else
|
||||
chance = 100;
|
||||
|
||||
return chance > Utility.Random(100);
|
||||
}
|
||||
|
||||
public class InternalTarget : Target
|
||||
{
|
||||
private readonly RevealSpell m_Owner;
|
||||
public InternalTarget(RevealSpell owner)
|
||||
: base(Core.ML ? 10 : 12, true, TargetFlags.None)
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
IPoint3D p = o as IPoint3D;
|
||||
|
||||
if (p != null)
|
||||
m_Owner.Target(p);
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user