Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
140
Scripts/Spells/First/Clumsy.cs
Normal file
140
Scripts/Spells/First/Clumsy.cs
Normal file
@@ -0,0 +1,140 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Spells.First
|
||||
{
|
||||
public class ClumsySpell : MagerySpell
|
||||
{
|
||||
private static readonly SpellInfo m_Info = new SpellInfo(
|
||||
"Clumsy", "Uus Jux",
|
||||
212,
|
||||
9031,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.Nightshade);
|
||||
public ClumsySpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
|
||||
|
||||
public static bool IsUnderEffects(Mobile m)
|
||||
{
|
||||
return m_Table.ContainsKey(m);
|
||||
}
|
||||
|
||||
public static void RemoveEffects(Mobile m, bool removeMod = true)
|
||||
{
|
||||
if (m_Table.ContainsKey(m))
|
||||
{
|
||||
Timer t = m_Table[m];
|
||||
|
||||
if (t != null && t.Running)
|
||||
{
|
||||
t.Stop();
|
||||
}
|
||||
|
||||
BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
|
||||
|
||||
if (removeMod)
|
||||
m.RemoveStatMod("[Magic] Dex Curse");
|
||||
|
||||
m_Table.Remove(m);
|
||||
}
|
||||
}
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get
|
||||
{
|
||||
return SpellCircle.First;
|
||||
}
|
||||
}
|
||||
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 (this.CheckHSequence(m))
|
||||
{
|
||||
SpellHelper.Turn(this.Caster, m);
|
||||
SpellHelper.CheckReflect((int)this.Circle, this.Caster, ref m);
|
||||
|
||||
if (Mysticism.StoneFormSpell.CheckImmunity(m))
|
||||
{
|
||||
Caster.SendLocalizedMessage(1080192); // Your target resists your ability reduction magic.
|
||||
return;
|
||||
}
|
||||
|
||||
int oldOffset = SpellHelper.GetCurseOffset(m, StatType.Dex);
|
||||
int newOffset = SpellHelper.GetOffset(Caster, m, StatType.Dex, true, false);
|
||||
|
||||
if (-newOffset > oldOffset || newOffset == 0)
|
||||
{
|
||||
DoHurtFizzle();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m.Spell != null)
|
||||
m.Spell.OnCasterHurt();
|
||||
|
||||
m.Paralyzed = false;
|
||||
|
||||
m.FixedParticles(0x3779, 10, 15, 5002, EffectLayer.Head);
|
||||
m.PlaySound(0x1DF);
|
||||
|
||||
HarmfulSpell(m);
|
||||
|
||||
if (-newOffset < oldOffset)
|
||||
{
|
||||
SpellHelper.AddStatCurse(this.Caster, m, StatType.Dex, false, newOffset);
|
||||
|
||||
int percentage = (int)(SpellHelper.GetOffsetScalar(this.Caster, m, true) * 100);
|
||||
TimeSpan length = SpellHelper.GetDuration(this.Caster, m);
|
||||
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Clumsy, 1075831, length, m, percentage.ToString()));
|
||||
|
||||
if (m_Table.ContainsKey(m))
|
||||
m_Table[m].Stop();
|
||||
|
||||
m_Table[m] = Timer.DelayCall(length, () =>
|
||||
{
|
||||
RemoveEffects(m);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly ClumsySpell m_Owner;
|
||||
public InternalTarget(ClumsySpell 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)
|
||||
{
|
||||
this.m_Owner.Target((Mobile)o);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
this.m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
111
Scripts/Spells/First/CreateFood.cs
Normal file
111
Scripts/Spells/First/CreateFood.cs
Normal file
@@ -0,0 +1,111 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Spells.First
|
||||
{
|
||||
public class CreateFoodSpell : MagerySpell
|
||||
{
|
||||
private static readonly SpellInfo m_Info = new SpellInfo(
|
||||
"Create Food", "In Mani Ylem",
|
||||
224,
|
||||
9011,
|
||||
Reagent.Garlic,
|
||||
Reagent.Ginseng,
|
||||
Reagent.MandrakeRoot);
|
||||
private static readonly FoodInfo[] m_Food = new FoodInfo[]
|
||||
{
|
||||
new FoodInfo(typeof(Grapes), "a grape bunch"),
|
||||
new FoodInfo(typeof(Ham), "a ham"),
|
||||
new FoodInfo(typeof(CheeseWedge), "a wedge of cheese"),
|
||||
new FoodInfo(typeof(Muffins), "muffins"),
|
||||
new FoodInfo(typeof(FishSteak), "a fish steak"),
|
||||
new FoodInfo(typeof(Ribs), "cut of ribs"),
|
||||
new FoodInfo(typeof(CookedBird), "a cooked bird"),
|
||||
new FoodInfo(typeof(Sausage), "sausage"),
|
||||
new FoodInfo(typeof(Apple), "an apple"),
|
||||
new FoodInfo(typeof(Peach), "a peach")
|
||||
};
|
||||
public CreateFoodSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get
|
||||
{
|
||||
return SpellCircle.First;
|
||||
}
|
||||
}
|
||||
public override void OnCast()
|
||||
{
|
||||
if (this.CheckSequence())
|
||||
{
|
||||
FoodInfo foodInfo = m_Food[Utility.Random(m_Food.Length)];
|
||||
Item food = foodInfo.Create();
|
||||
|
||||
if (food != null)
|
||||
{
|
||||
this.Caster.AddToBackpack(food);
|
||||
|
||||
// You magically create food in your backpack:
|
||||
this.Caster.SendLocalizedMessage(1042695, true, " " + foodInfo.Name);
|
||||
|
||||
this.Caster.FixedParticles(0, 10, 5, 2003, EffectLayer.RightHand);
|
||||
this.Caster.PlaySound(0x1E2);
|
||||
}
|
||||
}
|
||||
|
||||
this.FinishSequence();
|
||||
}
|
||||
}
|
||||
|
||||
public class FoodInfo
|
||||
{
|
||||
private Type m_Type;
|
||||
private string m_Name;
|
||||
public FoodInfo(Type type, string name)
|
||||
{
|
||||
this.m_Type = type;
|
||||
this.m_Name = name;
|
||||
}
|
||||
|
||||
public Type Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Type;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Type = value;
|
||||
}
|
||||
}
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Name;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Name = value;
|
||||
}
|
||||
}
|
||||
public Item Create()
|
||||
{
|
||||
Item item;
|
||||
|
||||
try
|
||||
{
|
||||
item = (Item)Activator.CreateInstance(this.m_Type);
|
||||
}
|
||||
catch
|
||||
{
|
||||
item = null;
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
140
Scripts/Spells/First/Feeblemind.cs
Normal file
140
Scripts/Spells/First/Feeblemind.cs
Normal file
@@ -0,0 +1,140 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Spells.First
|
||||
{
|
||||
public class FeeblemindSpell : MagerySpell
|
||||
{
|
||||
private static readonly SpellInfo m_Info = new SpellInfo(
|
||||
"Feeblemind", "Rel Wis",
|
||||
212,
|
||||
9031,
|
||||
Reagent.Ginseng,
|
||||
Reagent.Nightshade);
|
||||
public FeeblemindSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
|
||||
|
||||
public static bool IsUnderEffects(Mobile m)
|
||||
{
|
||||
return m_Table.ContainsKey(m);
|
||||
}
|
||||
|
||||
public static void RemoveEffects(Mobile m, bool removeMod = true)
|
||||
{
|
||||
if (m_Table.ContainsKey(m))
|
||||
{
|
||||
Timer t = m_Table[m];
|
||||
|
||||
if (t != null && t.Running)
|
||||
{
|
||||
t.Stop();
|
||||
}
|
||||
|
||||
BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
|
||||
|
||||
if (removeMod)
|
||||
m.RemoveStatMod("[Magic] Int Curse");
|
||||
|
||||
m_Table.Remove(m);
|
||||
}
|
||||
}
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get
|
||||
{
|
||||
return SpellCircle.First;
|
||||
}
|
||||
}
|
||||
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);
|
||||
SpellHelper.CheckReflect((int)Circle, Caster, ref m);
|
||||
|
||||
if (Mysticism.StoneFormSpell.CheckImmunity(m))
|
||||
{
|
||||
Caster.SendLocalizedMessage(1080192); // Your target resists your ability reduction magic.
|
||||
return;
|
||||
}
|
||||
|
||||
int oldOffset = SpellHelper.GetCurseOffset(m, StatType.Int);
|
||||
int newOffset = SpellHelper.GetOffset(Caster, m, StatType.Int, true, false);
|
||||
|
||||
if (-newOffset > oldOffset || newOffset == 0)
|
||||
{
|
||||
DoHurtFizzle();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m.Spell != null)
|
||||
m.Spell.OnCasterHurt();
|
||||
|
||||
m.Paralyzed = false;
|
||||
|
||||
m.FixedParticles(0x3779, 10, 15, 5002, EffectLayer.Head);
|
||||
m.PlaySound(0x1DF);
|
||||
|
||||
HarmfulSpell(m);
|
||||
|
||||
if (-newOffset < oldOffset)
|
||||
{
|
||||
SpellHelper.AddStatCurse(this.Caster, m, StatType.Int, false, newOffset);
|
||||
|
||||
int percentage = (int)(SpellHelper.GetOffsetScalar(this.Caster, m, true) * 100);
|
||||
TimeSpan length = SpellHelper.GetDuration(this.Caster, m);
|
||||
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.FeebleMind, 1075833, length, m, percentage.ToString()));
|
||||
|
||||
if (m_Table.ContainsKey(m))
|
||||
m_Table[m].Stop();
|
||||
|
||||
m_Table[m] = Timer.DelayCall(length, () =>
|
||||
{
|
||||
RemoveEffects(m);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly FeeblemindSpell m_Owner;
|
||||
public InternalTarget(FeeblemindSpell 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
110
Scripts/Spells/First/Heal.cs
Normal file
110
Scripts/Spells/First/Heal.cs
Normal file
@@ -0,0 +1,110 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Spells.First
|
||||
{
|
||||
public class HealSpell : MagerySpell
|
||||
{
|
||||
private static readonly SpellInfo m_Info = new SpellInfo(
|
||||
"Heal", "In Mani",
|
||||
224,
|
||||
9061,
|
||||
Reagent.Garlic,
|
||||
Reagent.Ginseng,
|
||||
Reagent.SpidersSilk);
|
||||
public HealSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get
|
||||
{
|
||||
return SpellCircle.First;
|
||||
}
|
||||
}
|
||||
|
||||
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.IsDeadBondedPet)
|
||||
{
|
||||
this.Caster.SendLocalizedMessage(1060177); // You cannot heal a creature that is already dead!
|
||||
}
|
||||
else if (m is BaseCreature && ((BaseCreature)m).IsAnimatedDead)
|
||||
{
|
||||
this.Caster.SendLocalizedMessage(1061654); // You cannot heal that which is not alive.
|
||||
}
|
||||
else if (m is IRepairableMobile)
|
||||
{
|
||||
this.Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500951); // You cannot heal that.
|
||||
}
|
||||
else if (m.Poisoned || Server.Items.MortalStrike.IsWounded(m))
|
||||
{
|
||||
this.Caster.LocalOverheadMessage(MessageType.Regular, 0x22, (this.Caster == m) ? 1005000 : 1010398);
|
||||
}
|
||||
else if (this.CheckBSequence(m))
|
||||
{
|
||||
SpellHelper.Turn(this.Caster, m);
|
||||
|
||||
int toHeal;
|
||||
|
||||
if (Core.AOS)
|
||||
{
|
||||
toHeal = this.Caster.Skills.Magery.Fixed / 120;
|
||||
toHeal += Utility.RandomMinMax(1, 4);
|
||||
|
||||
if (Core.SE && this.Caster != m)
|
||||
toHeal = (int)(toHeal * 1.5);
|
||||
}
|
||||
else
|
||||
{
|
||||
toHeal = (int)(this.Caster.Skills[SkillName.Magery].Value * 0.1);
|
||||
toHeal += Utility.Random(1, 5);
|
||||
}
|
||||
|
||||
//m.Heal( toHeal, Caster );
|
||||
SpellHelper.Heal(toHeal, m, this.Caster);
|
||||
|
||||
m.FixedParticles(0x376A, 9, 32, 5005, EffectLayer.Waist);
|
||||
m.PlaySound(0x1F2);
|
||||
}
|
||||
|
||||
this.FinishSequence();
|
||||
}
|
||||
|
||||
public class InternalTarget : Target
|
||||
{
|
||||
private readonly HealSpell m_Owner;
|
||||
public InternalTarget(HealSpell 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
128
Scripts/Spells/First/MagicArrow.cs
Normal file
128
Scripts/Spells/First/MagicArrow.cs
Normal file
@@ -0,0 +1,128 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Spells.First
|
||||
{
|
||||
public class MagicArrowSpell : MagerySpell
|
||||
{
|
||||
private static readonly SpellInfo m_Info = new SpellInfo(
|
||||
"Magic Arrow", "In Por Ylem",
|
||||
212,
|
||||
9041,
|
||||
Reagent.SulfurousAsh);
|
||||
public MagicArrowSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get
|
||||
{
|
||||
return SpellCircle.First;
|
||||
}
|
||||
}
|
||||
public override bool DelayedDamageStacking
|
||||
{
|
||||
get
|
||||
{
|
||||
return !Core.AOS;
|
||||
}
|
||||
}
|
||||
public override bool DelayedDamage
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public override Type[] DelayDamageFamily { get { return new Type[] { typeof(Server.Spells.Mysticism.NetherBoltSpell) }; } }
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public void Target(IDamageable d)
|
||||
{
|
||||
if (!Caster.CanSee(d))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (CheckHSequence(d))
|
||||
{
|
||||
IDamageable source = Caster;
|
||||
IDamageable target = d;
|
||||
|
||||
SpellHelper.Turn(Caster, d);
|
||||
|
||||
if (Core.SA && HasDelayContext(d))
|
||||
{
|
||||
DoHurtFizzle();
|
||||
return;
|
||||
}
|
||||
|
||||
if (SpellHelper.CheckReflect((int)Circle, ref source, ref target))
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(.5), () =>
|
||||
{
|
||||
source.MovingParticles(target, 0x36E4, 5, 0, false, true, 3043, 4043, 0x211);
|
||||
source.PlaySound(0x1E5);
|
||||
});
|
||||
}
|
||||
|
||||
double damage = 0;
|
||||
|
||||
if (Core.AOS)
|
||||
{
|
||||
damage = GetNewAosDamage(10, 1, 4, d);
|
||||
}
|
||||
else if (target is Mobile)
|
||||
{
|
||||
damage = Utility.Random(4, 4);
|
||||
|
||||
if (CheckResisted((Mobile)target))
|
||||
{
|
||||
damage *= 0.75;
|
||||
|
||||
((Mobile)target).SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
|
||||
}
|
||||
|
||||
damage *= GetDamageScalar((Mobile)target);
|
||||
}
|
||||
|
||||
if (damage > 0)
|
||||
{
|
||||
Caster.MovingParticles(d, 0x36E4, 5, 0, false, false, 3006, 0, 0);
|
||||
Caster.PlaySound(0x1E5);
|
||||
|
||||
SpellHelper.Damage(this, target, damage, 0, 100, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly MagicArrowSpell m_Owner;
|
||||
public InternalTarget(MagicArrowSpell 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
83
Scripts/Spells/First/NightSight.cs
Normal file
83
Scripts/Spells/First/NightSight.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Spells.First
|
||||
{
|
||||
public class NightSightSpell : MagerySpell
|
||||
{
|
||||
private static readonly SpellInfo m_Info = new SpellInfo(
|
||||
"Night Sight", "In Lor",
|
||||
236,
|
||||
9031,
|
||||
Reagent.SulfurousAsh,
|
||||
Reagent.SpidersSilk);
|
||||
public NightSightSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get
|
||||
{
|
||||
return SpellCircle.First;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new NightSightTarget(this);
|
||||
}
|
||||
|
||||
public void Target(Mobile targ)
|
||||
{
|
||||
SpellHelper.Turn(Caster, targ);
|
||||
|
||||
if (targ.BeginAction(typeof(LightCycle)))
|
||||
{
|
||||
new LightCycle.NightSightTimer(targ).Start();
|
||||
int level = (int)(LightCycle.DungeonLevel * ((Core.AOS ? targ.Skills[SkillName.Magery].Value : Caster.Skills[SkillName.Magery].Value) / 100));
|
||||
|
||||
if (level < 0)
|
||||
level = 0;
|
||||
|
||||
targ.LightLevel = level;
|
||||
|
||||
targ.FixedParticles(0x376A, 9, 32, 5007, EffectLayer.Waist);
|
||||
targ.PlaySound(0x1E3);
|
||||
|
||||
BuffInfo.AddBuff(targ, new BuffInfo(BuffIcon.NightSight, 1075643)); //Night Sight/You ignore lighting effects
|
||||
}
|
||||
else
|
||||
{
|
||||
Caster.SendMessage("{0} already have nightsight.", Caster == targ ? "You" : "They");
|
||||
}
|
||||
}
|
||||
|
||||
private class NightSightTarget : Target
|
||||
{
|
||||
private readonly NightSightSpell m_Spell;
|
||||
|
||||
public NightSightTarget(NightSightSpell spell)
|
||||
: base(12, false, TargetFlags.Beneficial)
|
||||
{
|
||||
m_Spell = spell;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is Mobile && m_Spell.CheckBSequence((Mobile)targeted))
|
||||
{
|
||||
m_Spell.Target((Mobile)targeted);
|
||||
}
|
||||
|
||||
m_Spell.FinishSequence();
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Spell.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
165
Scripts/Spells/First/ReactiveArmor.cs
Normal file
165
Scripts/Spells/First/ReactiveArmor.cs
Normal file
@@ -0,0 +1,165 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace Server.Spells.First
|
||||
{
|
||||
public class ReactiveArmorSpell : MagerySpell
|
||||
{
|
||||
private static readonly SpellInfo m_Info = new SpellInfo(
|
||||
"Reactive Armor", "Flam Sanct",
|
||||
236,
|
||||
9011,
|
||||
Reagent.Garlic,
|
||||
Reagent.SpidersSilk,
|
||||
Reagent.SulfurousAsh);
|
||||
private static readonly Hashtable m_Table = new Hashtable();
|
||||
public ReactiveArmorSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get
|
||||
{
|
||||
return SpellCircle.First;
|
||||
}
|
||||
}
|
||||
public static void EndArmor(Mobile m)
|
||||
{
|
||||
if (m_Table.Contains(m))
|
||||
{
|
||||
ResistanceMod[] mods = (ResistanceMod[])m_Table[m];
|
||||
|
||||
if (mods != null)
|
||||
{
|
||||
for (int i = 0; i < mods.Length; ++i)
|
||||
m.RemoveResistanceMod(mods[i]);
|
||||
}
|
||||
|
||||
m_Table.Remove(m);
|
||||
BuffInfo.RemoveBuff(m, BuffIcon.ReactiveArmor);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
if (Core.AOS)
|
||||
return true;
|
||||
|
||||
if (this.Caster.MeleeDamageAbsorb > 0)
|
||||
{
|
||||
this.Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
|
||||
return false;
|
||||
}
|
||||
else if (!this.Caster.CanBeginAction(typeof(DefensiveSpell)))
|
||||
{
|
||||
this.Caster.SendLocalizedMessage(1005385); // The spell will not adhere to you at this time.
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (Core.AOS)
|
||||
{
|
||||
/* The reactive armor spell increases the caster's physical resistance, while lowering the caster's elemental resistances.
|
||||
* 15 + (Inscription/20) Physcial bonus
|
||||
* -5 Elemental
|
||||
* The reactive armor spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
|
||||
* Reactive Armor, Protection, and Magic Reflection will stay on<6F>even after logging out, even after dying<6E>until you <20>turn them off<66> by casting them again.
|
||||
* (+20 physical -5 elemental at 100 Inscription)
|
||||
*/
|
||||
if (this.CheckSequence())
|
||||
{
|
||||
Mobile targ = this.Caster;
|
||||
|
||||
ResistanceMod[] mods = (ResistanceMod[])m_Table[targ];
|
||||
|
||||
if (mods == null)
|
||||
{
|
||||
targ.PlaySound(0x1E9);
|
||||
targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);
|
||||
|
||||
mods = new ResistanceMod[5]
|
||||
{
|
||||
new ResistanceMod(ResistanceType.Physical, 15 + (int)(targ.Skills[SkillName.Inscribe].Value / 20)),
|
||||
new ResistanceMod(ResistanceType.Fire, -5),
|
||||
new ResistanceMod(ResistanceType.Cold, -5),
|
||||
new ResistanceMod(ResistanceType.Poison, -5),
|
||||
new ResistanceMod(ResistanceType.Energy, -5)
|
||||
};
|
||||
|
||||
m_Table[targ] = mods;
|
||||
|
||||
for (int i = 0; i < mods.Length; ++i)
|
||||
targ.AddResistanceMod(mods[i]);
|
||||
|
||||
int physresist = 15 + (int)(targ.Skills[SkillName.Inscribe].Value / 20);
|
||||
string args = String.Format("{0}\t{1}\t{2}\t{3}\t{4}", physresist, 5, 5, 5, 5);
|
||||
|
||||
BuffInfo.AddBuff(this.Caster, new BuffInfo(BuffIcon.ReactiveArmor, 1075812, 1075813, args.ToString()));
|
||||
}
|
||||
else
|
||||
{
|
||||
targ.PlaySound(0x1ED);
|
||||
targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);
|
||||
|
||||
m_Table.Remove(targ);
|
||||
|
||||
for (int i = 0; i < mods.Length; ++i)
|
||||
targ.RemoveResistanceMod(mods[i]);
|
||||
|
||||
BuffInfo.RemoveBuff(this.Caster, BuffIcon.ReactiveArmor);
|
||||
}
|
||||
}
|
||||
|
||||
this.FinishSequence();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.Caster.MeleeDamageAbsorb > 0)
|
||||
{
|
||||
this.Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
|
||||
}
|
||||
else if (!this.Caster.CanBeginAction(typeof(DefensiveSpell)))
|
||||
{
|
||||
this.Caster.SendLocalizedMessage(1005385); // The spell will not adhere to you at this time.
|
||||
}
|
||||
else if (this.CheckSequence())
|
||||
{
|
||||
if (this.Caster.BeginAction(typeof(DefensiveSpell)))
|
||||
{
|
||||
int value = (int)(this.Caster.Skills[SkillName.Magery].Value + this.Caster.Skills[SkillName.Meditation].Value + this.Caster.Skills[SkillName.Inscribe].Value);
|
||||
value /= 3;
|
||||
|
||||
if (value < 0)
|
||||
value = 1;
|
||||
else if (value > 75)
|
||||
value = 75;
|
||||
|
||||
this.Caster.MeleeDamageAbsorb = value;
|
||||
|
||||
this.Caster.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);
|
||||
this.Caster.PlaySound(0x1F2);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Caster.SendLocalizedMessage(1005385); // The spell will not adhere to you at this time.
|
||||
}
|
||||
}
|
||||
|
||||
this.FinishSequence();
|
||||
}
|
||||
}
|
||||
|
||||
#region SA
|
||||
public static bool HasArmor(Mobile m)
|
||||
{
|
||||
return m_Table.ContainsKey(m);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
141
Scripts/Spells/First/Weaken.cs
Normal file
141
Scripts/Spells/First/Weaken.cs
Normal file
@@ -0,0 +1,141 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Spells.First
|
||||
{
|
||||
public class WeakenSpell : MagerySpell
|
||||
{
|
||||
private static readonly SpellInfo m_Info = new SpellInfo(
|
||||
"Weaken", "Des Mani",
|
||||
212,
|
||||
9031,
|
||||
Reagent.Garlic,
|
||||
Reagent.Nightshade);
|
||||
|
||||
public static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
|
||||
|
||||
public static bool IsUnderEffects(Mobile m)
|
||||
{
|
||||
return m_Table.ContainsKey(m);
|
||||
}
|
||||
|
||||
public static void RemoveEffects(Mobile m, bool removeMod = true)
|
||||
{
|
||||
if (m_Table.ContainsKey(m))
|
||||
{
|
||||
Timer t = m_Table[m];
|
||||
|
||||
if (t != null && t.Running)
|
||||
{
|
||||
t.Stop();
|
||||
}
|
||||
|
||||
BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
|
||||
|
||||
if(removeMod)
|
||||
m.RemoveStatMod("[Magic] Str Curse");
|
||||
|
||||
m_Table.Remove(m);
|
||||
}
|
||||
}
|
||||
|
||||
public WeakenSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get
|
||||
{
|
||||
return SpellCircle.First;
|
||||
}
|
||||
}
|
||||
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);
|
||||
SpellHelper.CheckReflect((int)Circle, Caster, ref m);
|
||||
|
||||
if (Mysticism.StoneFormSpell.CheckImmunity(m))
|
||||
{
|
||||
Caster.SendLocalizedMessage(1080192); // Your target resists your ability reduction magic.
|
||||
return;
|
||||
}
|
||||
|
||||
int oldOffset = SpellHelper.GetCurseOffset(m, StatType.Str);
|
||||
int newOffset = SpellHelper.GetOffset(Caster, m, StatType.Str, true, false);
|
||||
|
||||
if (-newOffset > oldOffset || newOffset == 0)
|
||||
{
|
||||
DoHurtFizzle();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m.Spell != null)
|
||||
m.Spell.OnCasterHurt();
|
||||
|
||||
m.Paralyzed = false;
|
||||
|
||||
m.FixedParticles(0x3779, 10, 15, 5002, EffectLayer.Head);
|
||||
m.PlaySound(0x1DF);
|
||||
|
||||
HarmfulSpell(m);
|
||||
|
||||
if (-newOffset < oldOffset)
|
||||
{
|
||||
SpellHelper.AddStatCurse(this.Caster, m, StatType.Str, false, newOffset);
|
||||
|
||||
int percentage = (int)(SpellHelper.GetOffsetScalar(this.Caster, m, true) * 100);
|
||||
TimeSpan length = SpellHelper.GetDuration(this.Caster, m);
|
||||
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Weaken, 1075837, length, m, percentage.ToString()));
|
||||
|
||||
if (m_Table.ContainsKey(m))
|
||||
m_Table[m].Stop();
|
||||
|
||||
m_Table[m] = Timer.DelayCall(length, () =>
|
||||
{
|
||||
RemoveEffects(m);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
public class InternalTarget : Target
|
||||
{
|
||||
private readonly WeakenSpell m_Owner;
|
||||
public InternalTarget(WeakenSpell 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user