Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class BagOfAncientScrolls : ScrollBag
|
||||
{
|
||||
[Constructable]
|
||||
public BagOfAncientScrolls()
|
||||
{
|
||||
Hue = 1355;
|
||||
PlaceItemIn(30, 35, new AncientFireworksScroll());
|
||||
PlaceItemIn(50, 35, new AncientGlimmerScroll());
|
||||
PlaceItemIn(70, 35, new AncientAwakenScroll());
|
||||
PlaceItemIn(90, 35, new AncientThunderScroll());
|
||||
PlaceItemIn(30, 55, new AncientWeatherScroll());
|
||||
PlaceItemIn(50, 55, new AncientIgniteScroll());
|
||||
PlaceItemIn(70, 55, new AncientDouseScroll());
|
||||
PlaceItemIn(90, 55, new AncientLocateScroll());
|
||||
PlaceItemIn(30, 75, new AncientAwakenAllScroll());
|
||||
PlaceItemIn(50, 75, new AncientDetectTrapScroll());
|
||||
PlaceItemIn(70, 75, new AncientGreatDouseScroll());
|
||||
PlaceItemIn(90, 75, new AncientGreatIgniteScroll());
|
||||
PlaceItemIn(30, 90, new AncientEnchantScroll());
|
||||
PlaceItemIn(50, 90, new AncientFalseCoinScroll());
|
||||
PlaceItemIn(70, 90, new AncientGreatLightScroll());
|
||||
PlaceItemIn(90, 90, new AncientDestroyTrapScroll());
|
||||
PlaceItemIn(30, 45, new AncientSleepScroll());
|
||||
PlaceItemIn(50, 45, new AncientSwarmScroll());
|
||||
PlaceItemIn(70, 45, new AncientPeerScroll());
|
||||
PlaceItemIn(90, 45, new AncientSeanceScroll());
|
||||
PlaceItemIn(30, 65, new AncientCharmScroll());
|
||||
PlaceItemIn(50, 65, new AncientDanceScroll());
|
||||
PlaceItemIn(70, 65, new AncientMassSleepScroll());
|
||||
PlaceItemIn(90, 65, new AncientCloneScroll());
|
||||
PlaceItemIn(30, 85, new AncientCauseFearScroll());
|
||||
PlaceItemIn(50, 85, new AncientFireRingScroll());
|
||||
PlaceItemIn(70, 85, new AncientTremorScroll());
|
||||
PlaceItemIn(90, 85, new AncientSleepFieldScroll());
|
||||
PlaceItemIn(40, 35, new AncientMassMightScroll());
|
||||
PlaceItemIn(60, 35, new AncientMassCharmScroll());
|
||||
PlaceItemIn(80, 35, new AncientInvisibilityAllScroll());
|
||||
PlaceItemIn(40, 55, new AncientDeathVortexScroll());
|
||||
PlaceItemIn(60, 55, new AncientMassDeathScroll());
|
||||
|
||||
}
|
||||
|
||||
public BagOfAncientScrolls(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientInitializer : BaseInitializer
|
||||
{
|
||||
public static void Configure()
|
||||
{
|
||||
Register(typeof(AncientFireworksSpell), "Fireworks", "Creates an impressive display of multi-colored moving lights.", "Sulfurous Ash", null, 2282, 9270, School.Ancient);
|
||||
Register(typeof(AncientGlimmerSpell), "Glimmer", "Creates a small light source that lasts for a short period of time.", "Bloodmoss", null, 21280, 9270, School.Ancient);
|
||||
Register(typeof(AncientAwakenSpell), "Awaken", "Awakens one sleeping or unconscious creature.", "Sulfurous Ash", null, 2242, 9270, School.Ancient);
|
||||
Register(typeof(AncientThunderSpell), "Thunder", "Causes a single thunderclap to be heard, as if a terrible storm is imminent.", "Sulfurous Ash", null, 21540, 9270, School.Ancient);
|
||||
Register(typeof(AncientWeatherSpell), "Weather", "Can create a storm or cause an existing storm to stop.", "Sulfurous Ash", null, 23004, 9270, School.Ancient);
|
||||
Register(typeof(AncientIgniteSpell), "Ignite", "Generates a tiny missile of sparks that can ignite flammable material.", "Black Pearl", null, 2257, 9270, School.Ancient);
|
||||
Register(typeof(AncientDouseSpell), "Douse", "Extinguishes any small, non-magical fire.", "Bloodmoss", null, 2256, 9270, School.Ancient);
|
||||
Register(typeof(AncientLocateSpell), "Locate", "Reveals the position of the mage, even when underground.", "Nightshade", null, 2260, 9270, School.Ancient);
|
||||
Register(typeof(AncientAwakenAllSpell), "Awaken All", "Awakens all unconscious members of the mage's party.", "Garlic, Ginseng", null, 2292, 9270, School.Ancient);
|
||||
Register(typeof(AncientDetectTrapSpell), "Detect Trap", "Allows the mage to see any nearby traps.", "Bloodmoss, Sulfurous Ash", null, 20496, 9270, School.Ancient);
|
||||
Register(typeof(AncientGreatDouseSpell), "Great Douse", "A more potent version of the spell Douse.", "Garlic, Spider's Silk", null, 20999, 9270, School.Ancient);
|
||||
Register(typeof(AncientGreatIgniteSpell), "Great Ignite", "A more potent version of the spell Ignite.", "Sulfurous Ash, Spider's Silk", null, 21256, 9270, School.Ancient);
|
||||
Register(typeof(AncientEnchantSpell), "Enchant", "Causes a ranged weapon to become enchanted and glow blue. Enchanted weapons will always hit their target.", "Black Pearl, Mandrake Root", null, 23003, 9270, School.Ancient);
|
||||
Register(typeof(AncientFalseCoinSpell), "False Coin", "When cast upon any coin, this spell creates five duplicate coins.", "Nightshade, Sulfurous Ash", null, 20481, 9270, School.Ancient);
|
||||
Register(typeof(AncientGreatLightSpell), "Great Light", "A more potent version of Nightsight, and has a substantially longer duration.", "Sulfurous Ash, Mandrake Root", null, 2245, 9270, School.Ancient);
|
||||
Register(typeof(AncientDestroyTrapSpell), "Destroy Trap", "Destroys any one specific trap upon which it is cast.", "Bloodmoss, Sulfurous Ash", null, 20994, 9270, School.Ancient);
|
||||
Register(typeof(AncientSleepSpell), "Sleep", "Causes the enchanted person to fall asleep.", "Spider's Silk, Nightshade, Black Pearl", null, 2277, 9270, School.Ancient);
|
||||
Register(typeof(AncientSwarmSpell), "Swarm", "Summons swarms of insects to attack the enemies of the mage from all directions.", "Nightshade, Mandrake Root, Bloodmoss", null, 20740, 9270, School.Ancient);
|
||||
Register(typeof(AncientPeerSpell), "Peer", "Enables the mage's vision to leave his body and scout the area.", "Mandrake Root, Nightshade", null, 2270, 9270, School.Ancient);
|
||||
Register(typeof(AncientSeanceSpell), "Seance", "Enables the mage to move as a ghost.", "Bloodmoss, Spider's Silk, Mandrake Root, Nightshade, Sulfurous Ash", null, 23014, 9270, School.Ancient);
|
||||
Register(typeof(AncientCharmSpell), "Charm", "Can be used either to control an enemy or creature, or to free a charmed one.", "Black Pearl, Nightshade, Spider's Silk", null, 23015, 9270, School.Ancient);
|
||||
Register(typeof(AncientDanceSpell), "Dance", "Makes everyone in sight (except the mage and his party) start to dance.", "Garlic, Bloodmoss, Mandrake Root", null, 23005, 9270, School.Ancient);
|
||||
Register(typeof(AncientMassSleepSpell), "Mass Sleep", "Puts to sleep a group of targets.", "Nightshade, Ginseng, Spider's Silk", null, 2276, 9270, School.Ancient);
|
||||
Register(typeof(AncientCloneSpell), "Clone", "Creates an exact duplicate of any mortal creature, who will then fight for the mage.", "Sulfurous Ash, Spider's Silk, Bloodmoss, Ginseng, Nightshade,Mandrake Rook", null, 2261, 9270, School.Ancient);
|
||||
Register(typeof(AncientCauseFearSpell), "Cause Fear", "Nothing is known about this spell.", "Garlic, Nightshade, Mandrake Root", null, 2286, 9270, School.Ancient);
|
||||
Register(typeof(AncientFireRingSpell), "Fire Ring", "Creates a ring of fire that will encircle the mage's target.", "Black Pearl, Spider's Silk, Sulfurous Ash, Mandrake Root", null, 2302, 9270, School.Ancient);
|
||||
Register(typeof(AncientTremorSpell), "Tremor", "Creates violent tremors in the earth that will cause the mage's enemies to tremble frantically.", "Bloodmoss, Mandrake Root, Sulfurous Ash", null, 2296, 9270, School.Ancient);
|
||||
Register(typeof(AncientSleepFieldSpell), "Sleep Field", "Creates a thick wall of energy field where the mage desires. All who enter this energy field will fall asleep.", "Black Pearl, Ginseng, Spider's Silk", null, 2283, 9270, School.Ancient);
|
||||
Register(typeof(AncientMassMightSpell), "Mass Might", "Casts Bless on everyone in the mage's party.", "Black Pearl, Mandrake Root, Ginseng", null, 23001, 9270, School.Ancient);
|
||||
Register(typeof(AncientMassCharmSpell), "Mass Charm", "Similar to Charm, but it affects more powerful monsters, based on the mage's intellect.", "Black Pearl, Nightshade, Spider's Silk, Mandrake Root", null, 21000, 9270, School.Ancient);
|
||||
Register(typeof(AncientInvisibilityAllSpell), "Invisibility All", "Casts Invisibility upon the mage and everyone in his party.", "Nightshade, Bloodmoss, Black Pearl, Mandrake Root", null, 23012, 9270, School.Ancient);
|
||||
Register(typeof(AncientDeathVortexSpell), "Death Vortex", "Creates a swirling black vortex at the point the mage designates, which will thereafter move at random.", "Bloodmoss, Sulfurous Ash, Mandrake Root, Nightshade", null, 21541, 9270, School.Ancient);
|
||||
Register(typeof(AncientMassDeathSpell), "Mass Death", "Kills everything within the mage's sight", "Bloodmoss, Ginseng, Garlic, Mandrake Root, Nightshade", null, 2285, 9270, School.Ancient);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public abstract class AncientSpell : CSpell
|
||||
{
|
||||
public AncientSpell( Mobile caster, Item scroll, SpellInfo info ) : base( caster, scroll, info )
|
||||
{
|
||||
}
|
||||
|
||||
public abstract SpellCircle Circle { get; }
|
||||
|
||||
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds(3 * CastDelaySecondsPerTick); } }
|
||||
public override SkillName CastSkill { get { return SkillName.Magery; } }
|
||||
public override SkillName DamageSkill { get { return SkillName.EvalInt; } }
|
||||
|
||||
public override bool ClearHandsOnCast { get { return true; } }
|
||||
|
||||
public override void GetCastSkills( out double min, out double max )
|
||||
{
|
||||
min = RequiredSkill;
|
||||
max = RequiredSkill;
|
||||
}
|
||||
|
||||
public override int GetMana()
|
||||
{
|
||||
return RequiredMana;
|
||||
}
|
||||
|
||||
public override TimeSpan GetCastDelay()
|
||||
{
|
||||
return TimeSpan.FromSeconds( CastDelay );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientSpellbook : CSpellbook
|
||||
{
|
||||
public override School School { get { return School.Ancient; } }
|
||||
|
||||
[Constructable]
|
||||
public AncientSpellbook()
|
||||
: this((ulong)0, CSSettings.FullSpellbooks)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientSpellbook(bool full)
|
||||
: this((ulong)0, full)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientSpellbook(ulong content, bool full)
|
||||
: base(content, 0xEFA, full)
|
||||
{
|
||||
Hue = 1355;
|
||||
Name = "Ancient Spellbook";
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.AccessLevel == AccessLevel.Player)
|
||||
{
|
||||
Container pack = from.Backpack;
|
||||
if (!(Parent == from || (pack != null && Parent == pack)))
|
||||
{
|
||||
from.SendMessage("The spellbook must be in your backpack [and not in a container within] to open.");
|
||||
return;
|
||||
}
|
||||
else if (SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions(from, this.School))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
from.CloseGump(typeof(AncientSpellbookGump));
|
||||
from.SendGump(new AncientSpellbookGump(this));
|
||||
}
|
||||
|
||||
public AncientSpellbook(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
using Server.Prompts;
|
||||
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientSpellbookGump : CSpellbookGump
|
||||
{
|
||||
public override string TextHue { get { return "660066"; } }
|
||||
public override int BGImage { get { return 2203; } }
|
||||
public override int SpellBtn { get { return 2362; } }
|
||||
public override int SpellBtnP { get { return 2361; } }
|
||||
public override string Label1 { get { return "Ancient"; } }
|
||||
public override string Label2 { get { return "Spells"; } }
|
||||
public override Type GumpType { get { return typeof(AncientSpellbookGump); } }
|
||||
|
||||
public AncientSpellbookGump(CSpellbook book)
|
||||
: base(book)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class FakeGold : Item
|
||||
{
|
||||
public int m_Amount;
|
||||
|
||||
[Constructable]
|
||||
public FakeGold()
|
||||
: base(0xEEF)
|
||||
{
|
||||
Weight = 0.0;
|
||||
Name = "" + m_Amount + " Gold Coins";
|
||||
|
||||
}
|
||||
|
||||
public FakeGold(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int GetDropSound()
|
||||
{
|
||||
if (m_Amount <= 1)
|
||||
return 0x2E4;
|
||||
else if (m_Amount <= 5)
|
||||
return 0x2E5;
|
||||
else
|
||||
return 0x2E6;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
writer.Write(m_Amount);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
m_Amount = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Misc;
|
||||
using Server.Items;
|
||||
using System.Collections;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class GreaterNaturalFire : Item
|
||||
{
|
||||
private Timer m_Timer;
|
||||
private Timer m_Burn;
|
||||
private DateTime m_End;
|
||||
private Mobile m_Caster;
|
||||
|
||||
public override bool BlocksFit { get { return true; } }
|
||||
|
||||
public GreaterNaturalFire(Point3D loc, Map map, Mobile caster)
|
||||
: base(0x19AB)
|
||||
{
|
||||
Visible = false;
|
||||
Movable = false;
|
||||
Light = LightType.Circle150;
|
||||
MoveToWorld(loc, map);
|
||||
m_Caster = caster;
|
||||
|
||||
if (caster.InLOS(this))
|
||||
Visible = true;
|
||||
else
|
||||
Delete();
|
||||
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
m_Timer = new InternalTimer(this, TimeSpan.FromMinutes(5.0));
|
||||
m_Timer.Start();
|
||||
m_Burn = new BurnTimer(this, m_Caster);
|
||||
m_Burn.Start();
|
||||
|
||||
m_End = DateTime.Now + TimeSpan.FromMinutes(5.0);
|
||||
}
|
||||
|
||||
public GreaterNaturalFire(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
if (Visible && m_Caster != null && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false))
|
||||
{
|
||||
m_Caster.DoHarmful(m);
|
||||
|
||||
int damage = Utility.Random(5, 10);
|
||||
|
||||
if (!Core.AOS && m.CheckSkill(SkillName.MagicResist, 0.0, 30.0))
|
||||
{
|
||||
damage = Utility.Random(2, 5);
|
||||
|
||||
m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
|
||||
}
|
||||
|
||||
AOS.Damage(m, m_Caster, damage, 0, 100, 0, 0, 0);
|
||||
m.PlaySound(0x1DD);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write(m_End - DateTime.Now);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
TimeSpan duration = reader.ReadTimeSpan();
|
||||
|
||||
m_Timer = new InternalTimer(this, duration);
|
||||
m_Timer.Start();
|
||||
|
||||
m_End = DateTime.Now + duration;
|
||||
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
TimeSpan duration = TimeSpan.FromSeconds(10.0);
|
||||
|
||||
m_Timer = new InternalTimer(this, duration);
|
||||
m_Timer.Start();
|
||||
|
||||
m_End = DateTime.Now + duration;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if (m_Timer != null)
|
||||
m_Timer.Stop();
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private GreaterNaturalFire m_Item;
|
||||
|
||||
public InternalTimer(GreaterNaturalFire item, TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Item.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
private class BurnTimer : Timer
|
||||
{
|
||||
private Item m_FireRing;
|
||||
private Mobile m_Caster;
|
||||
private DateTime m_Duration;
|
||||
|
||||
private static Queue m_Queue = new Queue();
|
||||
|
||||
public BurnTimer(Item ap, Mobile ca)
|
||||
: base(TimeSpan.FromSeconds(0.25), TimeSpan.FromSeconds(0.5))
|
||||
{
|
||||
Priority = TimerPriority.FiftyMS;
|
||||
|
||||
m_FireRing = ap;
|
||||
m_Caster = ca;
|
||||
m_Duration = DateTime.Now + TimeSpan.FromSeconds(15.0 + (Utility.RandomDouble() * 15.0));
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (m_FireRing.Deleted)
|
||||
return;
|
||||
|
||||
if (DateTime.Now > m_Duration)
|
||||
{
|
||||
|
||||
Stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
Map map = m_FireRing.Map;
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
foreach (Mobile m in m_FireRing.GetMobilesInRange(1))
|
||||
{
|
||||
if ((m.Z + 16) > m_FireRing.Z && (m_FireRing.Z + 12) > m.Z)
|
||||
m_Queue.Enqueue(m);
|
||||
}
|
||||
|
||||
while (m_Queue.Count > 0)
|
||||
{
|
||||
Mobile m = (Mobile)m_Queue.Dequeue();
|
||||
|
||||
if (m_FireRing.Visible && m_Caster != null && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false))
|
||||
{
|
||||
m_Caster.DoHarmful(m);
|
||||
|
||||
int damage = Utility.Random(5, 10);
|
||||
|
||||
if (!Core.AOS && m.CheckSkill(SkillName.MagicResist, 0.0, 30.0))
|
||||
{
|
||||
damage = Utility.Random(2, 5);
|
||||
|
||||
m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
|
||||
}
|
||||
|
||||
AOS.Damage(m, m_Caster, damage, 0, 100, 0, 0, 0);
|
||||
m.PlaySound(0x1DD);
|
||||
m.SendLocalizedMessage(503000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,421 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class LesserBladeTrapDeed : HouseTrapDeed
|
||||
{
|
||||
[Constructable]
|
||||
public LesserBladeTrapDeed() : base( HouseTrapStrength.Lesser, HouseTrapType.Blades )
|
||||
{
|
||||
}
|
||||
|
||||
public LesserBladeTrapDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class RegularBladeTrapDeed : HouseTrapDeed
|
||||
{
|
||||
[Constructable]
|
||||
public RegularBladeTrapDeed() : base( HouseTrapStrength.Regular, HouseTrapType.Blades )
|
||||
{
|
||||
}
|
||||
|
||||
public RegularBladeTrapDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class GreaterBladeTrapDeed : HouseTrapDeed
|
||||
{
|
||||
[Constructable]
|
||||
public GreaterBladeTrapDeed() : base( HouseTrapStrength.Greater, HouseTrapType.Blades )
|
||||
{
|
||||
}
|
||||
|
||||
public GreaterBladeTrapDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class DeadlyBladeTrapDeed : HouseTrapDeed
|
||||
{
|
||||
[Constructable]
|
||||
public DeadlyBladeTrapDeed() : base( HouseTrapStrength.Deadly, HouseTrapType.Blades )
|
||||
{
|
||||
}
|
||||
|
||||
public DeadlyBladeTrapDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LesserExplosionTrapDeed : HouseTrapDeed
|
||||
{
|
||||
[Constructable]
|
||||
public LesserExplosionTrapDeed() : base( HouseTrapStrength.Lesser, HouseTrapType.Explosion )
|
||||
{
|
||||
}
|
||||
|
||||
public LesserExplosionTrapDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class RegularExplosionTrapDeed : HouseTrapDeed
|
||||
{
|
||||
[Constructable]
|
||||
public RegularExplosionTrapDeed() : base( HouseTrapStrength.Regular, HouseTrapType.Explosion )
|
||||
{
|
||||
}
|
||||
|
||||
public RegularExplosionTrapDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class GreaterExplosionTrapDeed : HouseTrapDeed
|
||||
{
|
||||
[Constructable]
|
||||
public GreaterExplosionTrapDeed() : base( HouseTrapStrength.Greater, HouseTrapType.Explosion )
|
||||
{
|
||||
}
|
||||
|
||||
public GreaterExplosionTrapDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class DeadlyExplosionTrapDeed : HouseTrapDeed
|
||||
{
|
||||
[Constructable]
|
||||
public DeadlyExplosionTrapDeed() : base( HouseTrapStrength.Deadly, HouseTrapType.Explosion )
|
||||
{
|
||||
}
|
||||
|
||||
public DeadlyExplosionTrapDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LesserFireColumnTrapDeed : HouseTrapDeed
|
||||
{
|
||||
[Constructable]
|
||||
public LesserFireColumnTrapDeed() : base( HouseTrapStrength.Lesser, HouseTrapType.FireColumn )
|
||||
{
|
||||
}
|
||||
|
||||
public LesserFireColumnTrapDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class RegularFireColumnTrapDeed : HouseTrapDeed
|
||||
{
|
||||
[Constructable]
|
||||
public RegularFireColumnTrapDeed() : base( HouseTrapStrength.Regular, HouseTrapType.FireColumn )
|
||||
{
|
||||
}
|
||||
|
||||
public RegularFireColumnTrapDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class GreaterFireColumnTrapDeed : HouseTrapDeed
|
||||
{
|
||||
[Constructable]
|
||||
public GreaterFireColumnTrapDeed() : base( HouseTrapStrength.Greater, HouseTrapType.FireColumn )
|
||||
{
|
||||
}
|
||||
|
||||
public GreaterFireColumnTrapDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class DeadlyFireColumnTrapDeed : HouseTrapDeed
|
||||
{
|
||||
[Constructable]
|
||||
public DeadlyFireColumnTrapDeed() : base( HouseTrapStrength.Deadly, HouseTrapType.FireColumn )
|
||||
{
|
||||
}
|
||||
|
||||
public DeadlyFireColumnTrapDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LesserPoisonTrapDeed : HouseTrapDeed
|
||||
{
|
||||
[Constructable]
|
||||
public LesserPoisonTrapDeed() : base( HouseTrapStrength.Lesser, HouseTrapType.Poison )
|
||||
{
|
||||
}
|
||||
|
||||
public LesserPoisonTrapDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class RegularPoisonTrapDeed : HouseTrapDeed
|
||||
{
|
||||
[Constructable]
|
||||
public RegularPoisonTrapDeed() : base( HouseTrapStrength.Regular, HouseTrapType.Poison )
|
||||
{
|
||||
}
|
||||
|
||||
public RegularPoisonTrapDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class GreaterPoisonTrapDeed : HouseTrapDeed
|
||||
{
|
||||
[Constructable]
|
||||
public GreaterPoisonTrapDeed() : base( HouseTrapStrength.Greater, HouseTrapType.Poison )
|
||||
{
|
||||
}
|
||||
|
||||
public GreaterPoisonTrapDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class DeadlyPoisonTrapDeed : HouseTrapDeed
|
||||
{
|
||||
[Constructable]
|
||||
public DeadlyPoisonTrapDeed() : base( HouseTrapStrength.Deadly, HouseTrapType.Poison )
|
||||
{
|
||||
}
|
||||
|
||||
public DeadlyPoisonTrapDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,469 @@
|
||||
using System;
|
||||
using Server.Multis;
|
||||
using Server.Regions;
|
||||
using Server.Spells;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public enum HouseTrapStrength
|
||||
{
|
||||
Lesser = 1,
|
||||
Regular = 2,
|
||||
Greater = 3,
|
||||
Deadly = 4,
|
||||
None = 0
|
||||
}
|
||||
|
||||
public enum HouseTrapType
|
||||
{
|
||||
Blades = 1,
|
||||
FireColumn = 2,
|
||||
Explosion = 3,
|
||||
Poison = 4
|
||||
}
|
||||
|
||||
public class BaseHouseTrap : BaseTrap
|
||||
{
|
||||
public BaseHouseTrap(HouseTrapStrength p_Strength, HouseTrapType p_Type)
|
||||
: base(0x3133)
|
||||
{
|
||||
TrapType = p_Type;
|
||||
TrapStrength = p_Strength;
|
||||
}
|
||||
|
||||
public BaseHouseTrap(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
private Mobile m_Placer;
|
||||
private bool m_Detected;
|
||||
private HouseTrapType m_TrapType;
|
||||
private HouseTrapStrength m_TrapStrength;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Placer
|
||||
{
|
||||
get { return m_Placer; }
|
||||
set { m_Placer = value; }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool Detected
|
||||
{
|
||||
get { return m_Detected; }
|
||||
set { m_Detected = value; }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public HouseTrapType TrapType
|
||||
{
|
||||
get { return m_TrapType; }
|
||||
set { m_TrapType = value; }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public HouseTrapStrength TrapStrength
|
||||
{
|
||||
get { return m_TrapStrength; }
|
||||
set { m_TrapStrength = value; }
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((Mobile)m_Placer);
|
||||
writer.Write((int)TrapType);
|
||||
writer.Write((int)TrapStrength);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_Placer = reader.ReadMobile();
|
||||
TrapType = (HouseTrapType)reader.ReadInt();
|
||||
TrapStrength = (HouseTrapStrength)reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ItemID = 12595;
|
||||
}
|
||||
|
||||
public override bool PassivelyTriggered { get { return true; } }
|
||||
public override TimeSpan PassiveTriggerDelay { get { return TimeSpan.FromSeconds(2.0); } } // Two seconds to get the f**k off the trap
|
||||
public override int PassiveTriggerRange { get { return 0; } } // Have to be ON TOP of the trap to activate it..
|
||||
public override TimeSpan ResetDelay { get { return TimeSpan.FromSeconds(0.5); } } // Resets after half a second
|
||||
|
||||
public override void OnTrigger(Mobile from) // Add Types of Trap Poison, Blade, Explosion etc...
|
||||
{
|
||||
if (from != null && m_Placer != null)
|
||||
{
|
||||
if (from != m_Placer && from.Z == this.Z && from.Alive && from.AccessLevel == AccessLevel.Player) // Must not be the placer, must be alive, and standing on the trap for it to work.
|
||||
{
|
||||
if (m_Placer.GuildFealty != from.GuildFealty)
|
||||
{
|
||||
switch (TrapType)
|
||||
{
|
||||
case HouseTrapType.FireColumn:
|
||||
Effects.SendLocationParticles(EffectItem.Create(Location, Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);
|
||||
Effects.PlaySound(Location, Map, 0x225);
|
||||
break;
|
||||
case HouseTrapType.Blades:
|
||||
Effects.SendLocationParticles(EffectItem.Create(Location, Map, EffectItem.DefaultDuration), 0x37A0, 10, 30, 5052);
|
||||
Effects.PlaySound(Location, Map, 0x23A);
|
||||
break;
|
||||
case HouseTrapType.Poison:
|
||||
Effects.SendLocationParticles(EffectItem.Create(Location, Map, EffectItem.DefaultDuration), 0x11A6, 10, 30, 5052);
|
||||
Effects.PlaySound(Location, Map, 0x1DE);
|
||||
break;
|
||||
case HouseTrapType.Explosion:
|
||||
Effects.SendLocationParticles(EffectItem.Create(Location, Map, EffectItem.DefaultDuration), 0x36BD, 10, 30, 5052);
|
||||
Effects.PlaySound(Location, Map, 0x234);
|
||||
break;
|
||||
}
|
||||
|
||||
if (TrapType == HouseTrapType.Poison)
|
||||
switch (TrapStrength)
|
||||
{
|
||||
case HouseTrapStrength.Lesser:
|
||||
m_Placer.DoHarmful(from);
|
||||
from.ApplyPoison(m_Placer, Poison.Lesser);
|
||||
break;
|
||||
case HouseTrapStrength.Regular:
|
||||
m_Placer.DoHarmful(from);
|
||||
from.ApplyPoison(m_Placer, Poison.Regular);
|
||||
break;
|
||||
case HouseTrapStrength.Greater:
|
||||
m_Placer.DoHarmful(from);
|
||||
from.ApplyPoison(m_Placer, Poison.Greater);
|
||||
break;
|
||||
case HouseTrapStrength.Deadly:
|
||||
m_Placer.DoHarmful(from);
|
||||
from.ApplyPoison(m_Placer, Poison.Deadly);
|
||||
break;
|
||||
case HouseTrapStrength.None:
|
||||
break;
|
||||
}
|
||||
else if (TrapType == HouseTrapType.Blades)
|
||||
switch (TrapStrength)
|
||||
{
|
||||
case HouseTrapStrength.Lesser:
|
||||
m_Placer.DoHarmful(from);
|
||||
AOS.Damage(from, m_Placer, Utility.RandomMinMax(5, 20), 0, 100, 0, 0, 0);
|
||||
break;
|
||||
case HouseTrapStrength.Regular:
|
||||
m_Placer.DoHarmful(from);
|
||||
AOS.Damage(from, m_Placer, Utility.RandomMinMax(10, 40), 0, 100, 0, 0, 0); break;
|
||||
case HouseTrapStrength.Greater:
|
||||
m_Placer.DoHarmful(from);
|
||||
AOS.Damage(from, m_Placer, Utility.RandomMinMax(50, 100), 0, 100, 0, 0, 0); break;
|
||||
case HouseTrapStrength.Deadly:
|
||||
m_Placer.DoHarmful(from);
|
||||
AOS.Damage(from, m_Placer, Utility.RandomMinMax(80, 120), 0, 100, 0, 0, 0); break;
|
||||
case HouseTrapStrength.None:
|
||||
break;
|
||||
}
|
||||
else
|
||||
switch (TrapStrength)
|
||||
{
|
||||
case HouseTrapStrength.Lesser:
|
||||
m_Placer.DoHarmful(from);
|
||||
AOS.Damage(m_Placer, from, Utility.RandomMinMax(5, 20), 100, 0, 0, 0, 0);
|
||||
break;
|
||||
case HouseTrapStrength.Regular:
|
||||
m_Placer.DoHarmful(from);
|
||||
AOS.Damage(from, m_Placer, Utility.RandomMinMax(10, 40), 100, 0, 0, 0, 0); break;
|
||||
case HouseTrapStrength.Greater:
|
||||
m_Placer.DoHarmful(from);
|
||||
AOS.Damage(from, m_Placer, Utility.RandomMinMax(50, 100), 100, 0, 0, 0, 0); break;
|
||||
case HouseTrapStrength.Deadly:
|
||||
m_Placer.DoHarmful(from);
|
||||
AOS.Damage(from, m_Placer, Utility.RandomMinMax(80, 120), 100, 0, 0, 0, 0); break;
|
||||
case HouseTrapStrength.None:
|
||||
break;
|
||||
}
|
||||
|
||||
if (0.3 > Utility.RandomDouble())
|
||||
{
|
||||
m_Placer.SendMessage("A trap you placed has broken!");
|
||||
Blood shards = new Blood();
|
||||
shards.ItemID = 0xC2D;
|
||||
shards.Map = this.Map;
|
||||
shards.Location = this.Location;
|
||||
Effects.PlaySound(this.Location, this.Map, 0x305);
|
||||
this.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.InRange(this.GetWorldLocation(), 1))
|
||||
{
|
||||
if (m_Placer == null || from == m_Placer)
|
||||
{
|
||||
from.AddToBackpack(new HouseTrapDeed(TrapStrength, TrapType));
|
||||
|
||||
this.Delete();
|
||||
|
||||
from.SendMessage("You disassemble the trap.");
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("You can not disassemble that trap.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class HouseTrap : BaseHouseTrap
|
||||
{
|
||||
[Constructable]
|
||||
public HouseTrap(Mobile from, HouseTrapStrength p_Strength, HouseTrapType p_Type)
|
||||
: base(p_Strength, p_Type)
|
||||
{
|
||||
Name = "";
|
||||
Visible = false;
|
||||
|
||||
switch (p_Strength)
|
||||
{
|
||||
case HouseTrapStrength.Lesser:
|
||||
Name = Name + "Lesser";
|
||||
break;
|
||||
case HouseTrapStrength.Regular:
|
||||
Name = Name + "Regular";
|
||||
break;
|
||||
case HouseTrapStrength.Greater:
|
||||
Name = Name + "Greater";
|
||||
break;
|
||||
case HouseTrapStrength.Deadly:
|
||||
Name = Name + "Deadly";
|
||||
break;
|
||||
case HouseTrapStrength.None:
|
||||
Name = Name + "None";
|
||||
break;
|
||||
}
|
||||
|
||||
Name = Name + " ";
|
||||
|
||||
switch (p_Type)
|
||||
{
|
||||
case HouseTrapType.Blades:
|
||||
Name = Name + "Blade";
|
||||
break;
|
||||
case HouseTrapType.FireColumn:
|
||||
Name = Name + "Fire Column";
|
||||
break;
|
||||
case HouseTrapType.Explosion:
|
||||
Name = Name + "Explosion";
|
||||
break;
|
||||
case HouseTrapType.Poison:
|
||||
Name = Name + "Poison";
|
||||
break;
|
||||
}
|
||||
|
||||
Name = Name + " Trap";
|
||||
|
||||
Placer = from;
|
||||
Movable = false;
|
||||
MoveToWorld(from.Location, from.Map);
|
||||
}
|
||||
|
||||
public HouseTrap(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class HouseTrapDeed : Item
|
||||
{
|
||||
private HouseTrapType m_TrapType;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public HouseTrapType TrapType
|
||||
{
|
||||
get { return m_TrapType; }
|
||||
set { m_TrapType = value; }
|
||||
}
|
||||
|
||||
private HouseTrapStrength m_TrapStrength;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public HouseTrapStrength TrapStrength
|
||||
{
|
||||
get { return m_TrapStrength; }
|
||||
set { m_TrapStrength = value; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HouseTrapDeed(HouseTrapStrength p_Strength, HouseTrapType p_Type)
|
||||
: base(0x14F0)
|
||||
{
|
||||
Name = "a ";
|
||||
|
||||
switch (p_Strength)
|
||||
{
|
||||
case HouseTrapStrength.Lesser:
|
||||
Name = Name + "Lesser";
|
||||
break;
|
||||
case HouseTrapStrength.Regular:
|
||||
Name = Name + "Regular";
|
||||
break;
|
||||
case HouseTrapStrength.Greater:
|
||||
Name = Name + "Greater";
|
||||
break;
|
||||
case HouseTrapStrength.Deadly:
|
||||
Name = Name + "Deadly";
|
||||
break;
|
||||
case HouseTrapStrength.None:
|
||||
Name = Name + "None";
|
||||
break;
|
||||
}
|
||||
|
||||
Name = Name + " ";
|
||||
|
||||
switch (p_Type)
|
||||
{
|
||||
case HouseTrapType.Blades:
|
||||
Name = Name + "Blade";
|
||||
break;
|
||||
case HouseTrapType.FireColumn:
|
||||
Name = Name + "Fire Column";
|
||||
break;
|
||||
case HouseTrapType.Explosion:
|
||||
Name = Name + "Explosion";
|
||||
break;
|
||||
case HouseTrapType.Poison:
|
||||
Name = Name + "Poison";
|
||||
break;
|
||||
}
|
||||
|
||||
Name = Name + " Trap Deed";
|
||||
|
||||
m_TrapType = p_Type;
|
||||
m_TrapStrength = p_Strength;
|
||||
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public HouseTrapDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
writer.Write((int)TrapType);
|
||||
writer.Write((int)TrapStrength);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
m_TrapType = (HouseTrapType)reader.ReadInt();
|
||||
m_TrapStrength = (HouseTrapStrength)reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
Container pack = from.Backpack;
|
||||
|
||||
if (from.InRange(this.GetWorldLocation(), 1))
|
||||
{
|
||||
if (pack != null && IsChildOf(pack))
|
||||
{
|
||||
if (!SpellHelper.IsTown(from.Location, from))
|
||||
{
|
||||
if (!NonTrapLocations(from))
|
||||
{
|
||||
this.Delete();
|
||||
new HouseTrap(from, TrapStrength, TrapType);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("You cannot place that there.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("! , .");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1060640); // Must be in backpack...
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
}
|
||||
|
||||
public bool NonTrapLocations(Mobile from)
|
||||
{
|
||||
Map map = from.Map;
|
||||
|
||||
if (map == null)
|
||||
return false;
|
||||
|
||||
IPooledEnumerable eable = map.GetItemsInRange(from.Location, 0);
|
||||
|
||||
foreach (Item item in eable)
|
||||
{
|
||||
if ((item.Z + 16) > from.Z && (from.Z + 16) > item.Z && item.ItemID == 0x1BBF)
|
||||
{
|
||||
eable.Free();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Misc;
|
||||
using Server.Items;
|
||||
using System.Collections;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class NaturalFire : Item
|
||||
{
|
||||
private Timer m_Timer;
|
||||
private Timer m_Burn;
|
||||
private DateTime m_End;
|
||||
private Mobile m_Caster;
|
||||
|
||||
public override bool BlocksFit { get { return true; } }
|
||||
|
||||
public NaturalFire(Point3D loc, Map map, Mobile caster)
|
||||
: base(0xF53)
|
||||
{
|
||||
Visible = false;
|
||||
Movable = false;
|
||||
Light = LightType.Circle150;
|
||||
MoveToWorld(loc, map);
|
||||
m_Caster = caster;
|
||||
|
||||
if (caster.InLOS(this))
|
||||
Visible = true;
|
||||
else
|
||||
Delete();
|
||||
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
m_Timer = new InternalTimer(this, TimeSpan.FromMinutes(5.0));
|
||||
m_Timer.Start();
|
||||
m_Burn = new BurnTimer(this, m_Caster);
|
||||
m_Burn.Start();
|
||||
|
||||
m_End = DateTime.Now + TimeSpan.FromMinutes(5.0);
|
||||
}
|
||||
|
||||
public NaturalFire(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
if (Visible && m_Caster != null && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false))
|
||||
{
|
||||
m_Caster.DoHarmful(m);
|
||||
|
||||
int damage = Utility.Random(1, 2);
|
||||
|
||||
if (!Core.AOS && m.CheckSkill(SkillName.MagicResist, 0.0, 30.0))
|
||||
{
|
||||
damage = Utility.Random(1);
|
||||
|
||||
m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
|
||||
}
|
||||
|
||||
AOS.Damage(m, m_Caster, damage, 0, 100, 0, 0, 0);
|
||||
m.PlaySound(0x1DD);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write(m_End - DateTime.Now);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
TimeSpan duration = reader.ReadTimeSpan();
|
||||
|
||||
m_Timer = new InternalTimer(this, duration);
|
||||
m_Timer.Start();
|
||||
|
||||
m_End = DateTime.Now + duration;
|
||||
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
TimeSpan duration = TimeSpan.FromSeconds(10.0);
|
||||
|
||||
m_Timer = new InternalTimer(this, duration);
|
||||
m_Timer.Start();
|
||||
|
||||
m_End = DateTime.Now + duration;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if (m_Timer != null)
|
||||
m_Timer.Stop();
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private NaturalFire m_Item;
|
||||
|
||||
public InternalTimer(NaturalFire item, TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Item.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
private class BurnTimer : Timer
|
||||
{
|
||||
private Item m_FireRing;
|
||||
private Mobile m_Caster;
|
||||
private DateTime m_Duration;
|
||||
|
||||
private static Queue m_Queue = new Queue();
|
||||
|
||||
public BurnTimer(Item ap, Mobile ca)
|
||||
: base(TimeSpan.FromSeconds(0.25), TimeSpan.FromSeconds(0.5))
|
||||
{
|
||||
Priority = TimerPriority.FiftyMS;
|
||||
|
||||
m_FireRing = ap;
|
||||
m_Caster = ca;
|
||||
m_Duration = DateTime.Now + TimeSpan.FromSeconds(15.0 + (Utility.RandomDouble() * 15.0));
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (m_FireRing.Deleted)
|
||||
return;
|
||||
|
||||
if (DateTime.Now > m_Duration)
|
||||
{
|
||||
|
||||
Stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
Map map = m_FireRing.Map;
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
foreach (Mobile m in m_FireRing.GetMobilesInRange(1))
|
||||
{
|
||||
if ((m.Z + 16) > m_FireRing.Z && (m_FireRing.Z + 12) > m.Z)
|
||||
m_Queue.Enqueue(m);
|
||||
}
|
||||
|
||||
while (m_Queue.Count > 0)
|
||||
{
|
||||
Mobile m = (Mobile)m_Queue.Dequeue();
|
||||
|
||||
if (m_FireRing.Visible && m_Caster != null && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false))
|
||||
{
|
||||
m_Caster.DoHarmful(m);
|
||||
|
||||
int damage = Utility.Random(1, 2);
|
||||
|
||||
if (!Core.AOS && m.CheckSkill(SkillName.MagicResist, 0.0, 30.0))
|
||||
{
|
||||
damage = Utility.Random(1);
|
||||
|
||||
m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
|
||||
}
|
||||
|
||||
AOS.Damage(m, m_Caster, damage, 0, 100, 0, 0, 0);
|
||||
m.PlaySound(0x1DD);
|
||||
m.SendLocalizedMessage(503000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,357 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using Server;
|
||||
using Server.Engines.PartySystem;
|
||||
using Server.Misc;
|
||||
using Server.Guilds;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.ContextMenus;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class SleepingBody : Container
|
||||
{
|
||||
private Mobile m_Owner;
|
||||
private string m_SleepingBodyName; // Value of the SleepingNameAttribute attached to the owner when he died -or- null if the owner had no SleepingBodyNameAttribute; use "the remains of ~name~"
|
||||
private bool m_Blessed;
|
||||
|
||||
private ArrayList m_EquipItems; // List of items equiped when the owner died. Ingame, these items display /on/ the SleepingBody, not just inside
|
||||
private bool m_spell;
|
||||
private DateTime m_NextSnoreTrigger;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Owner
|
||||
{
|
||||
get { return m_Owner; }
|
||||
}
|
||||
|
||||
public ArrayList EquipItems
|
||||
{
|
||||
get { return m_EquipItems; }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool Invuln
|
||||
{
|
||||
get { return m_Blessed; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SleepingBody(Mobile owner, bool blessed)
|
||||
: this(owner, blessed, true)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SleepingBody(Mobile owner, bool blessed, bool isSpell)
|
||||
: base(0x2006)
|
||||
{
|
||||
Stackable = true; // To supress console warnings, stackable must be true
|
||||
Amount = owner.Body; // protocol defines that for itemid 0x2006, amount=body
|
||||
Stackable = false;
|
||||
m_Blessed = blessed;
|
||||
Movable = false;
|
||||
|
||||
m_Owner = owner;
|
||||
Name = m_Owner.Name;
|
||||
m_SleepingBodyName = GetBodyName(owner);
|
||||
Hue = m_Owner.Hue;
|
||||
Direction = m_Owner.Direction;
|
||||
m_spell = isSpell;
|
||||
|
||||
m_EquipItems = new ArrayList();
|
||||
AddFromLayer(m_Owner, Layer.FirstValid, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.TwoHanded, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.Shoes, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.Pants, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.Shirt, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.Helm, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.Gloves, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.Ring, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.Neck, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.Hair, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.Waist, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.InnerTorso, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.Bracelet, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.FacialHair, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.MiddleTorso, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.Earrings, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.Arms, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.Cloak, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.OuterTorso, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.OuterLegs, ref m_EquipItems);
|
||||
AddFromLayer(m_Owner, Layer.LastUserValid, ref m_EquipItems);
|
||||
}
|
||||
|
||||
private void AddFromLayer(Mobile from, Layer layer, ref ArrayList list)
|
||||
{
|
||||
if (list == null)
|
||||
list = new ArrayList();
|
||||
|
||||
Item worn = from.FindItemOnLayer(layer);
|
||||
if (worn != null)
|
||||
{
|
||||
Item item = new Item();
|
||||
item.ItemID = worn.ItemID;
|
||||
item.Hue = worn.Hue;
|
||||
item.Layer = layer;
|
||||
DropItem(item);
|
||||
list.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
from.SendLocalizedMessage(1001018); // You cannot perform negative acts on your target.
|
||||
}
|
||||
|
||||
public override bool HandlesOnMovement { get { return true; } } // Tell the core that we implement OnMovement
|
||||
|
||||
public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
|
||||
{
|
||||
from.SendLocalizedMessage(1005468, "", 0x8A5); // Me Sleepy.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
from.SendLocalizedMessage(1005468, "", 0x8A5); // Me Sleepy.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckContentDisplay(Mobile from)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool DisplaysContent { get { return false; } }
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if (m_Owner != null)
|
||||
{
|
||||
m_Owner.Z = this.Z;
|
||||
m_Owner.Blessed = this.m_Blessed;
|
||||
}
|
||||
|
||||
for (int i = 0; i < m_EquipItems.Count; i++)
|
||||
{
|
||||
object o = m_EquipItems[i];
|
||||
if (o != null && o is Item)
|
||||
{
|
||||
Item item = (Item)o;
|
||||
item.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
base.OnAfterDelete();
|
||||
}
|
||||
|
||||
public SleepingBody(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void SendInfoTo(NetState state, bool sendOplPacket)
|
||||
{
|
||||
base.SendInfoTo(state, ObjectPropertyList.Enabled);
|
||||
|
||||
if (ItemID == 0x2006)
|
||||
{
|
||||
state.Send(new SleepingBodyContent(state.Mobile, this));
|
||||
state.Send(new SleepingBodyEquip(state.Mobile, this));
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
if (m_SleepingBodyName != null)
|
||||
list.Add(m_SleepingBodyName);
|
||||
else
|
||||
list.Add(1049644, String.Format("Sleeping {0}", Name));
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
LabelTo(from, m_SleepingBodyName == null ? String.Format("Sleeping {0}", Name) : m_SleepingBodyName);
|
||||
}
|
||||
|
||||
public static string GetBodyName(Mobile m)
|
||||
{
|
||||
Type t = m.GetType();
|
||||
|
||||
object[] attrs = t.GetCustomAttributes(typeof(SleepingNameAttribute), true);
|
||||
|
||||
if (attrs != null && attrs.Length > 0)
|
||||
{
|
||||
SleepingNameAttribute attr = attrs[0] as SleepingNameAttribute;
|
||||
|
||||
if (attr != null)
|
||||
return attr.Name;
|
||||
}
|
||||
|
||||
return m.Name;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1);
|
||||
|
||||
writer.Write(m_spell); // version 1
|
||||
|
||||
writer.Write(m_Owner); // version 0
|
||||
writer.Write(m_SleepingBodyName);
|
||||
writer.Write(m_Blessed);
|
||||
|
||||
writer.WriteItemList(m_EquipItems, true);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
m_spell = true;
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_spell = reader.ReadBool();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_Owner = reader.ReadMobile();
|
||||
m_SleepingBodyName = reader.ReadString();
|
||||
m_Blessed = reader.ReadBool();
|
||||
|
||||
m_EquipItems = reader.ReadItemList();
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_NextSnoreTrigger = DateTime.Now;
|
||||
|
||||
// Delete on Server restart if spell action
|
||||
if (m_spell)
|
||||
this.Delete();
|
||||
}
|
||||
public bool CheckRange(Point3D loc, Point3D oldLoc, int range)
|
||||
{
|
||||
return CheckRange(loc, range) && !CheckRange(oldLoc, range);
|
||||
}
|
||||
|
||||
public bool CheckRange(Point3D loc, int range)
|
||||
{
|
||||
return ((this.Z + 8) >= loc.Z && (loc.Z + 16) > this.Z)
|
||||
&& Utility.InRange(GetWorldLocation(), loc, range);
|
||||
}
|
||||
|
||||
public override void OnMovement(Mobile m, Point3D oldLocation)
|
||||
{
|
||||
base.OnMovement(m, oldLocation);
|
||||
|
||||
if (m.Location == oldLocation)
|
||||
return;
|
||||
|
||||
if (CheckRange(m.Location, oldLocation, 5) && DateTime.Now >= m_NextSnoreTrigger)
|
||||
{
|
||||
m_NextSnoreTrigger = DateTime.Now + TimeSpan.FromSeconds(Utility.Random(5, 10));
|
||||
|
||||
if (this != null && this.Owner != null)
|
||||
{
|
||||
this.PublicOverheadMessage(0, Owner.SpeechHue, false, "zZz");
|
||||
Owner.PlaySound(Owner.Female ? 819 : 1093);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class SleepingBodyEquip : Packet
|
||||
{
|
||||
public SleepingBodyEquip(Mobile beholder, SleepingBody beheld)
|
||||
: base(0x89)
|
||||
{
|
||||
ArrayList list = beheld.EquipItems;
|
||||
|
||||
EnsureCapacity(8 + (list.Count * 5));
|
||||
|
||||
m_Stream.Write((int)beheld.Serial);
|
||||
|
||||
for (int i = 0; i < list.Count; ++i)
|
||||
{
|
||||
Item item = (Item)list[i];
|
||||
|
||||
if (!item.Deleted && beholder.CanSee(item) && item.Parent == beheld)
|
||||
{
|
||||
m_Stream.Write((byte)(item.Layer + 1));
|
||||
m_Stream.Write((int)item.Serial);
|
||||
}
|
||||
}
|
||||
|
||||
m_Stream.Write((byte)Layer.Invalid);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class SleepingBodyContent : Packet
|
||||
{
|
||||
public SleepingBodyContent(Mobile beholder, SleepingBody beheld)
|
||||
: base(0x3C)
|
||||
{
|
||||
ArrayList items = beheld.EquipItems;
|
||||
int count = items.Count;
|
||||
|
||||
EnsureCapacity(5 + (count * 19));
|
||||
|
||||
long pos = m_Stream.Position;
|
||||
|
||||
int written = 0;
|
||||
|
||||
m_Stream.Write((ushort)0);
|
||||
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
Item child = (Item)items[i];
|
||||
|
||||
if (!child.Deleted && child.Parent == beheld && beholder.CanSee(child))
|
||||
{
|
||||
m_Stream.Write((int)child.Serial);
|
||||
m_Stream.Write((ushort)child.ItemID);
|
||||
m_Stream.Write((byte)0); // signed, itemID offset
|
||||
m_Stream.Write((ushort)child.Amount);
|
||||
m_Stream.Write((short)child.X);
|
||||
m_Stream.Write((short)child.Y);
|
||||
m_Stream.Write((int)beheld.Serial);
|
||||
m_Stream.Write((ushort)child.Hue);
|
||||
|
||||
++written;
|
||||
}
|
||||
}
|
||||
|
||||
m_Stream.Seek(pos, SeekOrigin.Begin);
|
||||
m_Stream.Write((ushort)written);
|
||||
}
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class SleepingNameAttribute : Attribute
|
||||
{
|
||||
private string m_Name;
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return m_Name; }
|
||||
}
|
||||
|
||||
public SleepingNameAttribute(string name)
|
||||
{
|
||||
m_Name = name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.Misc;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
[CorpseName("a corpse")]
|
||||
public class CharmedMobile : BaseCreature
|
||||
{
|
||||
private BaseCreature m_Owner;
|
||||
|
||||
[Constructable]
|
||||
public CharmedMobile(BaseCreature owner)
|
||||
: base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
owner = m_Owner;
|
||||
Body = 777;
|
||||
Title = " The Mystic Lama Herder";
|
||||
}
|
||||
|
||||
public CharmedMobile(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseCreature Owner
|
||||
{
|
||||
get { return m_Owner; }
|
||||
set { m_Owner = value; }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public override bool ClickTitle { get { return false; } }
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
list.Add(1042971, this.Name);
|
||||
|
||||
list.Add(1049644, "charmed");
|
||||
|
||||
}
|
||||
|
||||
public override bool OnBeforeDeath()
|
||||
{
|
||||
BaseCreature m_Own = this.m_Owner;
|
||||
|
||||
if (m_Own != null)
|
||||
{
|
||||
m_Own.Location = this.Location;
|
||||
m_Own.Blessed = false;
|
||||
m_Own.RevealingAction();
|
||||
}
|
||||
Delete();
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
BaseCreature m_Own = this.m_Owner;
|
||||
|
||||
if (m_Own != null)
|
||||
{
|
||||
m_Own.Location = this.Location;
|
||||
m_Own.Blessed = false;
|
||||
m_Own.RevealingAction();
|
||||
}
|
||||
|
||||
base.OnAfterDelete();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
writer.Write(m_Owner);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
m_Owner = reader.ReadMobile() as BaseCreature;
|
||||
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.Spells;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class DeathVortex : BaseCreature
|
||||
{
|
||||
private Timer m_Timer;
|
||||
|
||||
[Constructable]
|
||||
public DeathVortex()
|
||||
: base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
Name = "Death Vortex";
|
||||
Body = 573;
|
||||
|
||||
m_Timer = new InternalTimer(this);
|
||||
m_Timer.Start();
|
||||
AddItem(new LightSource());
|
||||
|
||||
SetStr(50);
|
||||
SetDex(200);
|
||||
SetInt(100);
|
||||
|
||||
SetHits(70);
|
||||
SetStam(250);
|
||||
SetMana(0);
|
||||
|
||||
SetDamage(14, 17);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 0);
|
||||
SetDamageType(ResistanceType.Energy, 100);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 60, 70);
|
||||
SetResistance(ResistanceType.Fire, 40, 50);
|
||||
SetResistance(ResistanceType.Cold, 40, 50);
|
||||
SetResistance(ResistanceType.Poison, 40, 50);
|
||||
SetResistance(ResistanceType.Energy, 90, 100);
|
||||
|
||||
SetSkill(SkillName.MagicResist, 99.9);
|
||||
SetSkill(SkillName.Tactics, 90.0);
|
||||
SetSkill(SkillName.Wrestling, 100.0);
|
||||
|
||||
Fame = 0;
|
||||
Karma = 0;
|
||||
|
||||
VirtualArmor = 40;
|
||||
ControlSlots = 1;
|
||||
}
|
||||
|
||||
public override Poison PoisonImmune { get { return Poison.Lethal; } }
|
||||
|
||||
public override int GetAngerSound()
|
||||
{
|
||||
return 0x15;
|
||||
}
|
||||
|
||||
public override int GetAttackSound()
|
||||
{
|
||||
return 0x28;
|
||||
}
|
||||
public override void OnGotMeleeAttack(Mobile attacker)
|
||||
{
|
||||
base.OnGotMeleeAttack(attacker);
|
||||
|
||||
attacker.BoltEffect(0);
|
||||
AOS.Damage(this, attacker, 20, 0, 0, 0, 0, 100);
|
||||
}
|
||||
public override void OnGaveMeleeAttack(Mobile attacker)
|
||||
{
|
||||
base.OnGaveMeleeAttack(attacker);
|
||||
|
||||
attacker.BoltEffect(0);
|
||||
AOS.Damage(this, attacker, 20, 0, 0, 0, 0, 100);
|
||||
}
|
||||
|
||||
public override void AlterDamageScalarFrom(Mobile caster, ref double scalar)
|
||||
{
|
||||
base.AlterDamageScalarFrom(caster, ref scalar);
|
||||
caster.BoltEffect(0);
|
||||
AOS.Damage(this, caster, 20, 0, 0, 0, 0, 100);
|
||||
|
||||
}
|
||||
public DeathVortex(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
m_Timer = new InternalTimer(this);
|
||||
m_Timer.Start();
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
m_Timer.Stop();
|
||||
|
||||
base.OnDelete();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private DeathVortex m_Owner;
|
||||
private int m_Count = 0;
|
||||
|
||||
public InternalTimer(DeathVortex owner)
|
||||
: base(TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(0.1))
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if ((m_Count++ & 0x3) == 0)
|
||||
{
|
||||
m_Owner.Direction = (Direction)(Utility.Random(8) | 0x80);
|
||||
}
|
||||
|
||||
m_Owner.Move(m_Owner.Direction);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.Misc;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
[CorpseName("a corpse")]
|
||||
public class Souless : BaseCreature
|
||||
{
|
||||
private Mobile m_Owner;
|
||||
private int m_OldBody;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Owner
|
||||
{
|
||||
get { return m_Owner; }
|
||||
set { m_Owner = value; }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int OldBody
|
||||
{
|
||||
get { return m_OldBody; }
|
||||
set { m_OldBody = value; }
|
||||
}
|
||||
|
||||
private AncientPeerSpell spell;
|
||||
|
||||
[Constructable]
|
||||
public Souless(AncientPeerSpell m_spell)
|
||||
: base(AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
Body = 777;
|
||||
Title = " The Mystic Lama Herder";
|
||||
CantWalk = true;
|
||||
spell = m_spell;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (m_Owner != null && m_Owner == from)
|
||||
{
|
||||
m_Owner.Map = this.Map;
|
||||
m_Owner.Location = this.Location;
|
||||
m_Owner.BodyValue = m_OldBody;
|
||||
m_Owner.Blessed = this.Blessed;
|
||||
m_Owner.Direction = this.Direction;
|
||||
this.Delete();
|
||||
m_Owner.SendMessage("You return to your body");
|
||||
if (spell != null)
|
||||
{
|
||||
spell.RemovePeerMod();
|
||||
}
|
||||
if (!m_Owner.CanBeginAction(typeof(AncientPeerSpell)))
|
||||
m_Owner.EndAction(typeof(AncientPeerSpell));
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnBeforeDeath()
|
||||
{
|
||||
if (m_Owner != null)
|
||||
m_Owner.Map = this.Map;
|
||||
m_Owner.Location = this.Location;
|
||||
m_Owner.Blessed = this.Blessed;
|
||||
m_Owner.Direction = this.Direction;
|
||||
AFKKiller();
|
||||
m_Owner.Kill();
|
||||
m_Owner.BodyValue = 402;
|
||||
Delete();
|
||||
return false;
|
||||
}
|
||||
|
||||
public void AFKKiller()
|
||||
{
|
||||
List<Mobile> toGive = new List<Mobile>();
|
||||
|
||||
List<AggressorInfo> list = Aggressors;
|
||||
|
||||
for (int i = 0; i < list.Count; ++i)
|
||||
{
|
||||
AggressorInfo info = (AggressorInfo)list[i];
|
||||
|
||||
if (info.Attacker.Player && (DateTime.Now - info.LastCombatTime) < TimeSpan.FromSeconds(30.0) && !toGive.Contains(info.Attacker))
|
||||
toGive.Add(info.Attacker);
|
||||
}
|
||||
|
||||
list = Aggressed;
|
||||
for (int i = 0; i < list.Count; ++i)
|
||||
{
|
||||
AggressorInfo info = (AggressorInfo)list[i];
|
||||
|
||||
if (info.Defender.Player && (DateTime.Now - info.LastCombatTime) < TimeSpan.FromSeconds(30.0) && !toGive.Contains(info.Defender))
|
||||
toGive.Add(info.Defender);
|
||||
}
|
||||
|
||||
if (toGive.Count == 0)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < toGive.Count; ++i)
|
||||
{
|
||||
Mobile m = (Mobile)toGive[i % toGive.Count];
|
||||
|
||||
if (m != null)
|
||||
{
|
||||
m.DoHarmful(m_Owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public override bool ClickTitle { get { return false; } }
|
||||
public Souless(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
writer.Write(m_Owner);
|
||||
writer.Write(m_OldBody);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
m_Owner = reader.ReadMobile();
|
||||
m_OldBody = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientAwakenAllScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientAwakenAllScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientAwakenAllScroll(int amount)
|
||||
: base(typeof(AncientAwakenAllSpell), 0x1F2E, amount)
|
||||
{
|
||||
Name = "Awaken All Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientAwakenAllScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientAwakenScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientAwakenScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientAwakenScroll(int amount)
|
||||
: base(typeof(AncientAwakenSpell), 0x1F32, amount)
|
||||
{
|
||||
Name = "Awaken Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientAwakenScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientCauseFearScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientCauseFearScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientCauseFearScroll(int amount)
|
||||
: base(typeof(AncientCauseFearSpell), 0x1F56, amount)
|
||||
{
|
||||
Name = "Cause Fear Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientCauseFearScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientCharmScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientCharmScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientCharmScroll(int amount)
|
||||
: base(typeof(AncientCharmSpell), 0x1F51, amount)
|
||||
{
|
||||
Name = "Charm Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientCharmScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientCloneScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientCloneScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientCloneScroll(int amount)
|
||||
: base(typeof(AncientCloneSpell), 0x1F56, amount)
|
||||
{
|
||||
Name = "Clone Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientCloneScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientDanceScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientDanceScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientDanceScroll(int amount)
|
||||
: base(typeof(AncientDanceSpell), 0x1F51, amount)
|
||||
{
|
||||
Name = "Dance Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientDanceScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientDeathVortexScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientDeathVortexScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientDeathVortexScroll(int amount)
|
||||
: base(typeof(AncientDeathVortexSpell), 0x1F66, amount)
|
||||
{
|
||||
Name = "Death Vortex Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientDeathVortexScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientDestroyTrapScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientDestroyTrapScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientDestroyTrapScroll(int amount)
|
||||
: base(typeof(AncientDestroyTrapSpell), 0x1F35, amount)
|
||||
{
|
||||
Name = "Destroy Trap Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientDestroyTrapScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientDetectTrapScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientDetectTrapScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientDetectTrapScroll(int amount)
|
||||
: base(typeof(AncientDetectTrapSpell), 0x1F2E, amount)
|
||||
{
|
||||
Name = "Detect Trap Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientDetectTrapScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientDouseScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientDouseScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientDouseScroll(int amount)
|
||||
: base(typeof(AncientDouseSpell), 0x1F32, amount)
|
||||
{
|
||||
Name = "Douse Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientDouseScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientEnchantScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientEnchantScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientEnchantScroll(int amount)
|
||||
: base(typeof(AncientEnchantSpell), 0x1F35, amount)
|
||||
{
|
||||
Name = "Enchant Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientEnchantScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientFalseCoinScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientFalseCoinScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientFalseCoinScroll(int amount)
|
||||
: base(typeof(AncientFalseCoinSpell), 0x1F35, amount)
|
||||
{
|
||||
Name = "False Coin Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientFalseCoinScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientFireRingScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientFireRingScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientFireRingScroll(int amount)
|
||||
: base(typeof(AncientFireRingSpell), 0x1F56, amount)
|
||||
{
|
||||
Name = "Fire Ring Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientFireRingScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientFireworksScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientFireworksScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientFireworksScroll(int amount)
|
||||
: base(typeof(AncientFireworksSpell), 0x1F32, amount)
|
||||
{
|
||||
Name = "Fireworks Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientFireworksScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientGlimmerScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientGlimmerScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientGlimmerScroll(int amount)
|
||||
: base(typeof(AncientGlimmerSpell), 0x1F32, amount)
|
||||
{
|
||||
Name = "Glimmer Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientGlimmerScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientGreatDouseScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientGreatDouseScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientGreatDouseScroll(int amount)
|
||||
: base(typeof(AncientGreatDouseSpell), 0x1F43, amount)
|
||||
{
|
||||
Name = "Great Douse Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientGreatDouseScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientGreatIgniteScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientGreatIgniteScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientGreatIgniteScroll(int amount)
|
||||
: base(typeof(AncientGreatIgniteSpell), 0x1F43, amount)
|
||||
{
|
||||
Name = "Great Ignite Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientGreatIgniteScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientGreatLightScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientGreatLightScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientGreatLightScroll(int amount)
|
||||
: base(typeof(AncientGreatLightSpell), 0x1F35, amount)
|
||||
{
|
||||
Name = "Great Light Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientGreatLightScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientIgniteScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientIgniteScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientIgniteScroll(int amount)
|
||||
: base(typeof(AncientIgniteSpell), 0x1F32, amount)
|
||||
{
|
||||
Name = "Ignite Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientIgniteScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientInvisibilityAllScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientInvisibilityAllScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientInvisibilityAllScroll(int amount)
|
||||
: base(typeof(AncientInvisibilityAllSpell), 0x1F65, amount)
|
||||
{
|
||||
Name = "Invisibility All Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientInvisibilityAllScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientLocateScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientLocateScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientLocateScroll(int amount)
|
||||
: base(typeof(AncientLocateSpell), 0x1F31, amount)
|
||||
{
|
||||
Name = "Locate Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientLocateScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientMassCharmScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientMassCharmScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientMassCharmScroll(int amount)
|
||||
: base(typeof(AncientMassCharmSpell), 0x1F56, amount)
|
||||
{
|
||||
Name = "Mass Charm Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientMassCharmScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientMassDeathScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientMassDeathScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientMassDeathScroll(int amount)
|
||||
: base(typeof(AncientMassDeathSpell), 0x1F51, amount)
|
||||
{
|
||||
Name = "Mass Death Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientMassDeathScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientMassMightScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientMassMightScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientMassMightScroll(int amount)
|
||||
: base(typeof(AncientMassMightSpell), 0x1F62, amount)
|
||||
{
|
||||
Name = "Mass Might Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientMassMightScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientMassSleepScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientMassSleepScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientMassSleepScroll(int amount)
|
||||
: base(typeof(AncientMassSleepSpell), 0x1F51, amount)
|
||||
{
|
||||
Name = "Mass Sleep Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientMassSleepScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientPeerScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientPeerScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientPeerScroll(int amount)
|
||||
: base(typeof(AncientPeerSpell), 0x1F43, amount)
|
||||
{
|
||||
Name = "Peer Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientPeerScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientSeanceScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientSeanceScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientSeanceScroll(int amount)
|
||||
: base(typeof(AncientSeanceSpell), 0x1F47, amount)
|
||||
{
|
||||
Name = "Seance Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientSeanceScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientSleepFieldScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientSleepFieldScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientSleepFieldScroll(int amount)
|
||||
: base(typeof(AncientSleepFieldSpell), 0x1F56, amount)
|
||||
{
|
||||
Name = "Sleep Field Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientSleepFieldScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientSleepScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientSleepScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientSleepScroll(int amount)
|
||||
: base(typeof(AncientSleepSpell), 0x1F43, amount)
|
||||
{
|
||||
Name = "Sleep Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientSleepScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientSwarmScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientSwarmScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientSwarmScroll(int amount)
|
||||
: base(typeof(AncientSwarmSpell), 0x1F43, amount)
|
||||
{
|
||||
Name = "Swarm Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientSwarmScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientThunderScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientThunderScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientThunderScroll(int amount)
|
||||
: base(typeof(AncientThunderSpell), 0x1F32, amount)
|
||||
{
|
||||
Name = "Thunder Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientThunderScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientTremorScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientTremorScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientTremorScroll(int amount)
|
||||
: base(typeof(AncientTremorSpell), 0x1F56, amount)
|
||||
{
|
||||
Name = "Tremor Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientTremorScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientWeatherScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AncientWeatherScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientWeatherScroll(int amount)
|
||||
: base(typeof(AncientWeatherSpell), 0x1F2E, amount)
|
||||
{
|
||||
Name = "Weather Scroll";
|
||||
Hue = 1355;
|
||||
}
|
||||
|
||||
public AncientWeatherScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Items;
|
||||
using Server.Misc;
|
||||
using Server.Network;
|
||||
using Server.Spells;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientAwakenAllSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Awaken All", "Vas An Zu",
|
||||
218,
|
||||
9031,
|
||||
Reagent.Garlic,
|
||||
Reagent.Ginseng
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.First; }
|
||||
}
|
||||
|
||||
public AncientAwakenAllSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if(CheckSequence())
|
||||
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);
|
||||
|
||||
|
||||
ArrayList targets = new ArrayList();
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
Map map = Caster.Map;
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
|
||||
IPooledEnumerable eable = map.GetItemsInRange(new Point3D(p), 3);
|
||||
|
||||
foreach (Item m in eable)
|
||||
{
|
||||
|
||||
|
||||
if (Caster.CanSee(m) && m is SleepingBody)
|
||||
targets.Add(m);
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
for (int i = 0; i < targets.Count; ++i)
|
||||
{
|
||||
|
||||
SleepingBody m = (SleepingBody)targets[i];
|
||||
|
||||
|
||||
if (m != null)
|
||||
{
|
||||
m.Owner.RevealingAction();
|
||||
m.Owner.Frozen = false;
|
||||
m.Owner.Squelched = false;
|
||||
m.Owner.Map = m.Map;
|
||||
m.Owner.Location = m.Location;
|
||||
m.Owner.Animate(21, 6, 1, false, false, 0);
|
||||
|
||||
m.Owner.SendMessage("You wake up!");
|
||||
|
||||
m.Delete();
|
||||
}
|
||||
Caster.SendMessage("You awaken them!");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientAwakenAllSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientAwakenAllSpell owner)
|
||||
: base(12, true, TargetFlags.None)
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (o is SleepingBody)
|
||||
{
|
||||
IPoint3D p = o as IPoint3D;
|
||||
|
||||
if (p != null)
|
||||
m_Owner.Target(p);
|
||||
}
|
||||
else
|
||||
from.SendMessage("That is not a slumbering being");
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
using Server.Spells;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Regions;
|
||||
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientAwakenSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Awaken", "An Zu",
|
||||
218,
|
||||
9002,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.First; }
|
||||
}
|
||||
|
||||
public override double CastDelay { get { return 1.0; } }
|
||||
public override double RequiredSkill { get { return 0.0; } }
|
||||
public override int RequiredMana { get { return 5; } }
|
||||
|
||||
public AncientAwakenSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if(CheckSequence())
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public void Target(SleepingBody slumber)
|
||||
{
|
||||
if (!Caster.CanSee(slumber))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
|
||||
else if (CheckSequence())
|
||||
{
|
||||
|
||||
if (slumber != null)
|
||||
{
|
||||
if (slumber.Owner != null)
|
||||
{
|
||||
slumber.Owner.RevealingAction();
|
||||
slumber.Owner.Frozen = false;
|
||||
slumber.Owner.Squelched = false;
|
||||
slumber.Owner.Map = slumber.Map;
|
||||
slumber.Owner.Location = slumber.Location;
|
||||
slumber.Owner.Animate(21, 6, 1, false, false, 0); ;
|
||||
|
||||
|
||||
slumber.Delete();
|
||||
slumber.Owner.SendMessage("You wake up!");
|
||||
Caster.SendMessage("You awaken them!");
|
||||
}
|
||||
else
|
||||
Caster.SendMessage("They are beyond your power to awaken...");
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientAwakenSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientAwakenSpell owner)
|
||||
: base(12, false, TargetFlags.None)
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (o is SleepingBody)
|
||||
{
|
||||
m_Owner.Target((SleepingBody)o);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("That cannot be awoken."); // I cannot mark that object.
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientCauseFearSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Cause Fear", "Quas Wis",
|
||||
230,
|
||||
9022,
|
||||
Reagent.Garlic,
|
||||
Reagent.Nightshade,
|
||||
Reagent.MandrakeRoot
|
||||
);
|
||||
|
||||
public override Server.Spells.SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Sixth; }
|
||||
}
|
||||
|
||||
public AncientCauseFearSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
Caster.PlaySound(0x245);
|
||||
Caster.PlaySound(0x3EA);
|
||||
Caster.FixedParticles(0x2109, 1, 25, 9922, 14, 3, EffectLayer.Head);
|
||||
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 + 32), Caster.Map);
|
||||
Effects.SendMovingParticles(from, to, 0x3192, 1, 0, false, false, 33, 3, 9501, 1, 0, EffectLayer.Head, 0x100);
|
||||
|
||||
|
||||
int dispelSkill = Caster.Int;
|
||||
|
||||
double mag = Caster.Skills.Magery.Value;
|
||||
|
||||
for (int i = 0; i < targets.Count; ++i)
|
||||
{
|
||||
if (targets[i] is BaseCreature)
|
||||
{
|
||||
BaseCreature m = targets[i] as BaseCreature;
|
||||
|
||||
if (m != null)
|
||||
{
|
||||
bool dispellable = m.Summoned && !m.IsAnimatedDead;
|
||||
|
||||
if (dispellable)
|
||||
{
|
||||
double dispelChance = (50.0 + ((100 * (mag - m.DispelDifficulty)) / (m.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);
|
||||
|
||||
m.Delete();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
bool evil = !m.Controlled && !m.Blessed;
|
||||
|
||||
if (evil)
|
||||
{
|
||||
|
||||
double fleeChance = (100 - Math.Sqrt(m.Fame / 2)) * mag * dispelSkill;
|
||||
fleeChance /= 1000000;
|
||||
|
||||
if (fleeChance > Utility.RandomDouble())
|
||||
{
|
||||
m.PlaySound(m.Female ? 814 : 1088);
|
||||
m.BeginFlee(TimeSpan.FromSeconds(15.0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,369 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientCharmSpell : AncientSpell
|
||||
{
|
||||
private Timer m_Timer;
|
||||
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Charm", "An Xen Ex",
|
||||
218,
|
||||
9012,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.Nightshade,
|
||||
Reagent.SpidersSilk
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Fifth; }
|
||||
}
|
||||
|
||||
public AncientCharmSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public void Target(Mobile ma)
|
||||
{
|
||||
BaseCreature m = ma as BaseCreature;
|
||||
if (ma is CharmedMobile)
|
||||
{
|
||||
ma.Kill();
|
||||
Caster.SendMessage("You free them from their charm!");
|
||||
}
|
||||
else if (m != null)
|
||||
{
|
||||
if (!Caster.CanSee(m))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (m.Controlled || m.Summoned)
|
||||
{
|
||||
Caster.SendMessage("That target is already under somone's control!");
|
||||
}
|
||||
else if (!m.Alive)
|
||||
{
|
||||
Caster.SendMessage("The dead are beyond your charms.");
|
||||
}
|
||||
else if (!m.Tamable || m.Blessed)
|
||||
{
|
||||
|
||||
Caster.SendMessage("You have no chance of charming that!");
|
||||
|
||||
}
|
||||
else if (Caster.Followers >= 1)
|
||||
{
|
||||
Caster.SendMessage("You couldn't control that if you did charm it!");
|
||||
}
|
||||
else if (CheckHSequence(m))
|
||||
{
|
||||
SpellHelper.Turn(Caster, m);
|
||||
|
||||
|
||||
if (!m.Controlled && m != null && !m.Deleted)
|
||||
{
|
||||
double taming;
|
||||
if (m.MinTameSkill <= 1.0)
|
||||
taming = 1.0;
|
||||
else
|
||||
taming = m.MinTameSkill;
|
||||
|
||||
double charmchance = (Caster.Skills[SkillName.Magery].Value / taming);
|
||||
if (charmchance <= 0.5)
|
||||
{
|
||||
Caster.SendMessage("You have no chance of charming them.");
|
||||
}
|
||||
else if (charmchance >= 0.9)
|
||||
{
|
||||
Caster.SendMessage("You charm them!");
|
||||
Point3D mloc = new Point3D(m.X, m.Y, m.Z);
|
||||
CharmedMobile dg = new CharmedMobile(m);
|
||||
dg.Owner = m;
|
||||
|
||||
dg.Body = m.Body;
|
||||
dg.AI = m.AI;
|
||||
dg.Hue = m.Hue;
|
||||
dg.Name = m.Name;
|
||||
dg.SpeechHue = m.SpeechHue;
|
||||
dg.Fame = m.Fame;
|
||||
dg.Karma = m.Karma;
|
||||
dg.EmoteHue = m.EmoteHue;
|
||||
dg.Title = m.Title;
|
||||
dg.Criminal = (m.Criminal);
|
||||
dg.Str = m.Str;
|
||||
dg.Int = m.Int;
|
||||
dg.Hits = m.Hits;
|
||||
dg.Dex = m.Dex;
|
||||
dg.Mana = m.Mana;
|
||||
dg.Stam = m.Stam;
|
||||
|
||||
dg.VirtualArmor = (m.VirtualArmor);
|
||||
dg.SetSkill(SkillName.Wrestling, m.Skills[SkillName.Wrestling].Value);
|
||||
dg.SetSkill(SkillName.Tactics, m.Skills[SkillName.Tactics].Value);
|
||||
dg.SetSkill(SkillName.Anatomy, m.Skills[SkillName.Anatomy].Value);
|
||||
|
||||
dg.SetSkill(SkillName.Magery, m.Skills[SkillName.Magery].Value);
|
||||
dg.SetSkill(SkillName.MagicResist, m.Skills[SkillName.MagicResist].Value);
|
||||
dg.SetSkill(SkillName.Meditation, m.Skills[SkillName.Meditation].Value);
|
||||
dg.SetSkill(SkillName.EvalInt, m.Skills[SkillName.EvalInt].Value);
|
||||
|
||||
dg.SetSkill(SkillName.Archery, m.Skills[SkillName.Archery].Value);
|
||||
dg.SetSkill(SkillName.Macing, m.Skills[SkillName.Macing].Value);
|
||||
dg.SetSkill(SkillName.Swords, m.Skills[SkillName.Swords].Value);
|
||||
dg.SetSkill(SkillName.Fencing, m.Skills[SkillName.Fencing].Value);
|
||||
dg.SetSkill(SkillName.Lumberjacking, m.Skills[SkillName.Lumberjacking].Value);
|
||||
dg.SetSkill(SkillName.Alchemy, m.Skills[SkillName.Alchemy].Value);
|
||||
dg.SetSkill(SkillName.Parry, m.Skills[SkillName.Parry].Value);
|
||||
dg.SetSkill(SkillName.Focus, m.Skills[SkillName.Focus].Value);
|
||||
dg.SetSkill(SkillName.Necromancy, m.Skills[SkillName.Necromancy].Value);
|
||||
dg.SetSkill(SkillName.Chivalry, m.Skills[SkillName.Chivalry].Value);
|
||||
dg.SetSkill(SkillName.ArmsLore, m.Skills[SkillName.ArmsLore].Value);
|
||||
dg.SetSkill(SkillName.Poisoning, m.Skills[SkillName.Poisoning].Value);
|
||||
dg.SetSkill(SkillName.SpiritSpeak, m.Skills[SkillName.SpiritSpeak].Value);
|
||||
dg.SetSkill(SkillName.Stealing, m.Skills[SkillName.Stealing].Value);
|
||||
dg.SetSkill(SkillName.Inscribe, m.Skills[SkillName.Inscribe].Value);
|
||||
dg.Kills = (m.Kills);
|
||||
|
||||
|
||||
// Clear Items
|
||||
RemoveFromAllLayers(dg);
|
||||
|
||||
// Then copy
|
||||
CopyFromLayer(m, dg, Layer.FirstValid);
|
||||
CopyFromLayer(m, dg, Layer.TwoHanded);
|
||||
CopyFromLayer(m, dg, Layer.Shoes);
|
||||
CopyFromLayer(m, dg, Layer.Pants);
|
||||
CopyFromLayer(m, dg, Layer.Shirt);
|
||||
CopyFromLayer(m, dg, Layer.Helm);
|
||||
CopyFromLayer(m, dg, Layer.Gloves);
|
||||
CopyFromLayer(m, dg, Layer.Ring);
|
||||
CopyFromLayer(m, dg, Layer.Talisman);
|
||||
CopyFromLayer(m, dg, Layer.Neck);
|
||||
CopyFromLayer(m, dg, Layer.Hair);
|
||||
CopyFromLayer(m, dg, Layer.Waist);
|
||||
CopyFromLayer(m, dg, Layer.InnerTorso);
|
||||
CopyFromLayer(m, dg, Layer.Bracelet);
|
||||
// CopyFromLayer(m, dg, Layer.Unused_xF);
|
||||
CopyFromLayer(m, dg, Layer.FacialHair);
|
||||
CopyFromLayer(m, dg, Layer.MiddleTorso);
|
||||
CopyFromLayer(m, dg, Layer.Earrings);
|
||||
CopyFromLayer(m, dg, Layer.Arms);
|
||||
CopyFromLayer(m, dg, Layer.Cloak);
|
||||
CopyFromLayer(m, dg, Layer.OuterTorso);
|
||||
CopyFromLayer(m, dg, Layer.OuterLegs);
|
||||
CopyFromLayer(m, dg, Layer.LastUserValid);
|
||||
CopyFromLayer(m, dg, Layer.Mount);
|
||||
dg.ControlSlots = 5;
|
||||
dg.Controlled = true;
|
||||
dg.ControlMaster = Caster;
|
||||
TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Magery].Value * 1.2); // 120% of magery
|
||||
m_Timer = new InternalTimer(dg, duration);
|
||||
m_Timer.Start();
|
||||
dg.Map = m.Map;
|
||||
dg.Location = m.Location;
|
||||
m.Blessed = true;
|
||||
m.Hidden = true;
|
||||
|
||||
m.Location = new Point3D(m.X, m.Y, m.Z - 95);
|
||||
}
|
||||
else if (charmchance >= Utility.RandomDouble())
|
||||
{
|
||||
Caster.SendMessage("You charm them!");
|
||||
CharmedMobile dg = new CharmedMobile(m);
|
||||
dg.Owner = m;
|
||||
|
||||
dg.Body = m.Body;
|
||||
|
||||
dg.Hue = m.Hue;
|
||||
dg.Name = m.Name;
|
||||
dg.SpeechHue = m.SpeechHue;
|
||||
dg.Fame = m.Fame;
|
||||
dg.Karma = m.Karma;
|
||||
dg.EmoteHue = m.EmoteHue;
|
||||
dg.Title = m.Title;
|
||||
dg.Criminal = (m.Criminal);
|
||||
dg.Str = m.Str;
|
||||
dg.Int = m.Int;
|
||||
dg.Hits = m.Hits;
|
||||
dg.Dex = m.Dex;
|
||||
dg.Mana = m.Mana;
|
||||
dg.Stam = m.Stam;
|
||||
dg.AI = m.AI;
|
||||
|
||||
dg.VirtualArmor = (m.VirtualArmor);
|
||||
dg.SetSkill(SkillName.Wrestling, m.Skills[SkillName.Wrestling].Value);
|
||||
dg.SetSkill(SkillName.Tactics, m.Skills[SkillName.Tactics].Value);
|
||||
dg.SetSkill(SkillName.Anatomy, m.Skills[SkillName.Anatomy].Value);
|
||||
|
||||
dg.SetSkill(SkillName.Magery, m.Skills[SkillName.Magery].Value);
|
||||
dg.SetSkill(SkillName.MagicResist, m.Skills[SkillName.MagicResist].Value);
|
||||
dg.SetSkill(SkillName.Meditation, m.Skills[SkillName.Meditation].Value);
|
||||
dg.SetSkill(SkillName.EvalInt, m.Skills[SkillName.EvalInt].Value);
|
||||
|
||||
dg.SetSkill(SkillName.Archery, m.Skills[SkillName.Archery].Value);
|
||||
dg.SetSkill(SkillName.Macing, m.Skills[SkillName.Macing].Value);
|
||||
dg.SetSkill(SkillName.Swords, m.Skills[SkillName.Swords].Value);
|
||||
dg.SetSkill(SkillName.Fencing, m.Skills[SkillName.Fencing].Value);
|
||||
dg.SetSkill(SkillName.Lumberjacking, m.Skills[SkillName.Lumberjacking].Value);
|
||||
dg.SetSkill(SkillName.Alchemy, m.Skills[SkillName.Alchemy].Value);
|
||||
dg.SetSkill(SkillName.Parry, m.Skills[SkillName.Parry].Value);
|
||||
dg.SetSkill(SkillName.Focus, m.Skills[SkillName.Focus].Value);
|
||||
dg.SetSkill(SkillName.Necromancy, m.Skills[SkillName.Necromancy].Value);
|
||||
dg.SetSkill(SkillName.Chivalry, m.Skills[SkillName.Chivalry].Value);
|
||||
dg.SetSkill(SkillName.ArmsLore, m.Skills[SkillName.ArmsLore].Value);
|
||||
dg.SetSkill(SkillName.Poisoning, m.Skills[SkillName.Poisoning].Value);
|
||||
dg.SetSkill(SkillName.SpiritSpeak, m.Skills[SkillName.SpiritSpeak].Value);
|
||||
dg.SetSkill(SkillName.Stealing, m.Skills[SkillName.Stealing].Value);
|
||||
dg.SetSkill(SkillName.Inscribe, m.Skills[SkillName.Inscribe].Value);
|
||||
dg.Kills = (m.Kills);
|
||||
|
||||
|
||||
// Clear Items
|
||||
RemoveFromAllLayers(dg);
|
||||
|
||||
// Then copy
|
||||
CopyFromLayer(m, dg, Layer.FirstValid);
|
||||
CopyFromLayer(m, dg, Layer.TwoHanded);
|
||||
CopyFromLayer(m, dg, Layer.Shoes);
|
||||
CopyFromLayer(m, dg, Layer.Pants);
|
||||
CopyFromLayer(m, dg, Layer.Shirt);
|
||||
CopyFromLayer(m, dg, Layer.Helm);
|
||||
CopyFromLayer(m, dg, Layer.Gloves);
|
||||
CopyFromLayer(m, dg, Layer.Ring);
|
||||
CopyFromLayer(m, dg, Layer.Talisman);
|
||||
CopyFromLayer(m, dg, Layer.Neck);
|
||||
CopyFromLayer(m, dg, Layer.Hair);
|
||||
CopyFromLayer(m, dg, Layer.Waist);
|
||||
CopyFromLayer(m, dg, Layer.InnerTorso);
|
||||
CopyFromLayer(m, dg, Layer.Bracelet);
|
||||
// CopyFromLayer(m, dg, Layer.Unused_xF);
|
||||
CopyFromLayer(m, dg, Layer.FacialHair);
|
||||
CopyFromLayer(m, dg, Layer.MiddleTorso);
|
||||
CopyFromLayer(m, dg, Layer.Earrings);
|
||||
CopyFromLayer(m, dg, Layer.Arms);
|
||||
CopyFromLayer(m, dg, Layer.Cloak);
|
||||
CopyFromLayer(m, dg, Layer.OuterTorso);
|
||||
CopyFromLayer(m, dg, Layer.OuterLegs);
|
||||
CopyFromLayer(m, dg, Layer.LastUserValid);
|
||||
CopyFromLayer(m, dg, Layer.Mount);
|
||||
dg.ControlSlots = 5;
|
||||
dg.Controlled = true;
|
||||
dg.ControlMaster = Caster;
|
||||
TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Magery].Value * 1.2); // 120% of magery
|
||||
m_Timer = new InternalTimer(dg, duration);
|
||||
dg.Map = m.Map;
|
||||
dg.Location = m.Location;
|
||||
m.Blessed = true;
|
||||
m.Hidden = true;
|
||||
m.Location = new Point3D(m.X, m.Y, m.Z - 95);
|
||||
}
|
||||
else
|
||||
{
|
||||
Caster.SendMessage("You fail to charm them.");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Caster.SendMessage("You have no chance of charming them.");
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private void CopyFromLayer(Mobile from, Mobile mimic, Layer layer)
|
||||
{
|
||||
if (mimic.FindItemOnLayer(layer) != null && mimic.FindItemOnLayer(layer).LootType != LootType.Blessed)
|
||||
mimic.FindItemOnLayer(layer).LootType = LootType.Newbied;
|
||||
}
|
||||
|
||||
private void DeleteFromLayer(Mobile from, Layer layer)
|
||||
{
|
||||
if (from.FindItemOnLayer(layer) != null)
|
||||
from.RemoveItem(from.FindItemOnLayer(layer));
|
||||
}
|
||||
private void RemoveFromAllLayers(Mobile from)
|
||||
{
|
||||
DeleteFromLayer(from, Layer.FirstValid);
|
||||
DeleteFromLayer(from, Layer.TwoHanded);
|
||||
DeleteFromLayer(from, Layer.Shoes);
|
||||
DeleteFromLayer(from, Layer.Pants);
|
||||
DeleteFromLayer(from, Layer.Shirt);
|
||||
DeleteFromLayer(from, Layer.Helm);
|
||||
DeleteFromLayer(from, Layer.Gloves);
|
||||
DeleteFromLayer(from, Layer.Ring);
|
||||
DeleteFromLayer(from, Layer.Talisman);
|
||||
DeleteFromLayer(from, Layer.Neck);
|
||||
DeleteFromLayer(from, Layer.Hair);
|
||||
DeleteFromLayer(from, Layer.Waist);
|
||||
DeleteFromLayer(from, Layer.InnerTorso);
|
||||
DeleteFromLayer(from, Layer.Bracelet);
|
||||
//DeleteFromLayer(from, Layer.Unused_xF);
|
||||
DeleteFromLayer(from, Layer.FacialHair);
|
||||
DeleteFromLayer(from, Layer.MiddleTorso);
|
||||
DeleteFromLayer(from, Layer.Earrings);
|
||||
DeleteFromLayer(from, Layer.Arms);
|
||||
DeleteFromLayer(from, Layer.Cloak);
|
||||
DeleteFromLayer(from, Layer.OuterTorso);
|
||||
DeleteFromLayer(from, Layer.OuterLegs);
|
||||
DeleteFromLayer(from, Layer.LastUserValid);
|
||||
DeleteFromLayer(from, Layer.Mount);
|
||||
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private CharmedMobile m_Item;
|
||||
|
||||
public InternalTimer(CharmedMobile item, TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (m_Item != null)
|
||||
m_Item.Delete();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientCharmSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientCharmSpell owner)
|
||||
: base(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,312 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientCloneSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Clone", "In Quas Xen",
|
||||
//SpellCircle.Sixth,
|
||||
230,
|
||||
9022,
|
||||
Reagent.SulfurousAsh,
|
||||
Reagent.SpidersSilk,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.Ginseng,
|
||||
Reagent.Nightshade,
|
||||
Reagent.MandrakeRoot
|
||||
);
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Sixth; }
|
||||
}
|
||||
|
||||
public AncientCloneSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if(CheckSequence())
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public override TimeSpan CastDelayBase
|
||||
{
|
||||
get { return base.CastDelayBase.Add(TimeSpan.FromSeconds(28)); }
|
||||
}
|
||||
|
||||
public override double CastDelayFastScalar
|
||||
{
|
||||
get { return 5.0; }
|
||||
}
|
||||
|
||||
public override TimeSpan GetCastDelay()
|
||||
{
|
||||
if (Core.AOS)
|
||||
return base.GetCastDelay();
|
||||
|
||||
return base.GetCastDelay() + TimeSpan.FromSeconds(6.0);
|
||||
}
|
||||
|
||||
public void Target(Mobile m)
|
||||
{
|
||||
if (!Caster.CanSee(m))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (CheckHSequence(m))
|
||||
{
|
||||
Mobile source = Caster;
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
SpellHelper.Turn(Caster, m);
|
||||
|
||||
Clone dg = new Clone(m);
|
||||
|
||||
dg.Body = m.Body;
|
||||
|
||||
dg.Hue = m.Hue;
|
||||
dg.Name = m.Name;
|
||||
dg.SpeechHue = m.SpeechHue;
|
||||
dg.Fame = m.Fame;
|
||||
dg.Karma = (0 - m.Karma);
|
||||
dg.EmoteHue = m.EmoteHue;
|
||||
dg.Title = m.Title;
|
||||
dg.Criminal = (m.Criminal);
|
||||
dg.Str = m.Str;
|
||||
dg.Int = m.Int;
|
||||
dg.Hits = m.Hits;
|
||||
dg.Dex = m.Dex;
|
||||
dg.Mana = m.Mana;
|
||||
dg.Stam = m.Stam;
|
||||
dg.Female = m.Female;
|
||||
dg.AccessLevel = m.AccessLevel;
|
||||
|
||||
dg.VirtualArmor = (m.VirtualArmor);
|
||||
dg.SetSkill(SkillName.Wrestling, m.Skills[SkillName.Wrestling].Value);
|
||||
dg.SetSkill(SkillName.Tactics, m.Skills[SkillName.Tactics].Value);
|
||||
dg.SetSkill(SkillName.Anatomy, m.Skills[SkillName.Anatomy].Value);
|
||||
|
||||
dg.SetSkill(SkillName.Magery, m.Skills[SkillName.Magery].Value);
|
||||
dg.SetSkill(SkillName.MagicResist, m.Skills[SkillName.MagicResist].Value);
|
||||
dg.SetSkill(SkillName.Meditation, m.Skills[SkillName.Meditation].Value);
|
||||
dg.SetSkill(SkillName.EvalInt, m.Skills[SkillName.EvalInt].Value);
|
||||
|
||||
dg.SetSkill(SkillName.Archery, m.Skills[SkillName.Archery].Value);
|
||||
dg.SetSkill(SkillName.Macing, m.Skills[SkillName.Macing].Value);
|
||||
dg.SetSkill(SkillName.Swords, m.Skills[SkillName.Swords].Value);
|
||||
dg.SetSkill(SkillName.Fencing, m.Skills[SkillName.Fencing].Value);
|
||||
dg.SetSkill(SkillName.Lumberjacking, m.Skills[SkillName.Lumberjacking].Value);
|
||||
dg.SetSkill(SkillName.Alchemy, m.Skills[SkillName.Alchemy].Value);
|
||||
dg.SetSkill(SkillName.Parry, m.Skills[SkillName.Parry].Value);
|
||||
dg.SetSkill(SkillName.Focus, m.Skills[SkillName.Focus].Value);
|
||||
dg.SetSkill(SkillName.Necromancy, m.Skills[SkillName.Necromancy].Value);
|
||||
dg.SetSkill(SkillName.Chivalry, m.Skills[SkillName.Chivalry].Value);
|
||||
dg.SetSkill(SkillName.ArmsLore, m.Skills[SkillName.ArmsLore].Value);
|
||||
dg.SetSkill(SkillName.Poisoning, m.Skills[SkillName.Poisoning].Value);
|
||||
dg.SetSkill(SkillName.SpiritSpeak, m.Skills[SkillName.SpiritSpeak].Value);
|
||||
dg.SetSkill(SkillName.Stealing, m.Skills[SkillName.Stealing].Value);
|
||||
dg.SetSkill(SkillName.Inscribe, m.Skills[SkillName.Inscribe].Value);
|
||||
dg.Kills = (m.Kills);
|
||||
|
||||
|
||||
// Clear Items
|
||||
RemoveFromAllLayers(dg);
|
||||
|
||||
// Then copy
|
||||
CopyFromLayer(m, dg, Layer.FirstValid);
|
||||
CopyFromLayer(m, dg, Layer.TwoHanded);
|
||||
CopyFromLayer(m, dg, Layer.Shoes);
|
||||
CopyFromLayer(m, dg, Layer.Pants);
|
||||
CopyFromLayer(m, dg, Layer.Shirt);
|
||||
CopyFromLayer(m, dg, Layer.Helm);
|
||||
CopyFromLayer(m, dg, Layer.Gloves);
|
||||
CopyFromLayer(m, dg, Layer.Ring);
|
||||
CopyFromLayer(m, dg, Layer.Talisman);
|
||||
CopyFromLayer(m, dg, Layer.Neck);
|
||||
CopyFromLayer(m, dg, Layer.Hair);
|
||||
CopyFromLayer(m, dg, Layer.Waist);
|
||||
CopyFromLayer(m, dg, Layer.InnerTorso);
|
||||
CopyFromLayer(m, dg, Layer.Bracelet);
|
||||
//CopyFromLayer(m, dg, Layer.Unused_xF);
|
||||
CopyFromLayer(m, dg, Layer.FacialHair);
|
||||
CopyFromLayer(m, dg, Layer.MiddleTorso);
|
||||
CopyFromLayer(m, dg, Layer.Earrings);
|
||||
CopyFromLayer(m, dg, Layer.Arms);
|
||||
CopyFromLayer(m, dg, Layer.Cloak);
|
||||
CopyFromLayer(m, dg, Layer.OuterTorso);
|
||||
CopyFromLayer(m, dg, Layer.OuterLegs);
|
||||
CopyFromLayer(m, dg, Layer.LastUserValid);
|
||||
DupeFromLayer(m, dg, Layer.Mount);
|
||||
dg.ControlSlots = 5;
|
||||
SpellHelper.Summon(dg, Caster, 0x215, TimeSpan.FromSeconds(4.0 * Caster.Skills[SkillName.Magery].Value), false, false);
|
||||
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private void CopyFromLayer(Mobile from, Mobile mimic, Layer layer)
|
||||
{
|
||||
if (from.FindItemOnLayer(layer) != null)
|
||||
{
|
||||
Item copy = (Item)from.FindItemOnLayer(layer);
|
||||
Type t = copy.GetType();
|
||||
|
||||
ConstructorInfo[] info = t.GetConstructors();
|
||||
|
||||
foreach (ConstructorInfo c in info)
|
||||
{
|
||||
//if ( !c.IsDefined( typeof( ConstructableAttribute ), false ) ) continue;
|
||||
|
||||
ParameterInfo[] paramInfo = c.GetParameters();
|
||||
|
||||
if (paramInfo.Length == 0)
|
||||
{
|
||||
object[] objParams = new object[0];
|
||||
|
||||
try
|
||||
{
|
||||
Item newItem = null;
|
||||
object o = c.Invoke(objParams);
|
||||
|
||||
if (o != null && o is Item)
|
||||
{
|
||||
newItem = (Item)o;
|
||||
CopyProperties(newItem, copy);//copy.Dupe( item, copy.Amount );
|
||||
newItem.Parent = null;
|
||||
|
||||
mimic.EquipItem(newItem);
|
||||
}
|
||||
|
||||
if (newItem != null)
|
||||
{
|
||||
if (newItem is BaseWeapon && o is BaseWeapon)
|
||||
{
|
||||
BaseWeapon weapon = newItem as BaseWeapon;
|
||||
BaseWeapon oweapon = o as BaseWeapon;
|
||||
weapon.Attributes = oweapon.Attributes;
|
||||
weapon.WeaponAttributes = oweapon.WeaponAttributes;
|
||||
|
||||
}
|
||||
if (newItem is BaseArmor && o is BaseArmor)
|
||||
{
|
||||
BaseArmor armor = newItem as BaseArmor;
|
||||
BaseArmor oarmor = o as BaseArmor;
|
||||
armor.Attributes = oarmor.Attributes;
|
||||
armor.ArmorAttributes = oarmor.ArmorAttributes;
|
||||
armor.SkillBonuses = oarmor.SkillBonuses;
|
||||
|
||||
}
|
||||
|
||||
mimic.EquipItem(newItem);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
from.Say("Error!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mimic.FindItemOnLayer(layer) != null && mimic.FindItemOnLayer(layer).LootType != LootType.Blessed)
|
||||
mimic.FindItemOnLayer(layer).LootType = LootType.Newbied;
|
||||
}
|
||||
|
||||
private void DupeFromLayer(Mobile from, Mobile mimic, Layer layer)
|
||||
{
|
||||
//if (from.FindItemOnLayer(layer) != null)
|
||||
// mimic.AddItem(from.FindItemOnLayer(layer).Dupe(1));
|
||||
|
||||
if (mimic.FindItemOnLayer(layer) != null && mimic.FindItemOnLayer(layer).LootType != LootType.Blessed)
|
||||
mimic.FindItemOnLayer(layer).LootType = LootType.Newbied;
|
||||
}
|
||||
|
||||
private static void CopyProperties(Item dest, Item src)
|
||||
{
|
||||
PropertyInfo[] props = src.GetType().GetProperties();
|
||||
|
||||
for (int i = 0; i < props.Length; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (props[i].CanRead && props[i].CanWrite)
|
||||
{
|
||||
//Console.WriteLine( "Setting {0} = {1}", props[i].Name, props[i].GetValue( src, null ) );
|
||||
props[i].SetValue(dest, props[i].GetValue(src, null), null);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
//Console.WriteLine( "Denied" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DeleteFromLayer(Mobile from, Layer layer)
|
||||
{
|
||||
if (from.FindItemOnLayer(layer) != null)
|
||||
from.RemoveItem(from.FindItemOnLayer(layer));
|
||||
}
|
||||
|
||||
private void RemoveFromAllLayers(Mobile from)
|
||||
{
|
||||
DeleteFromLayer(from, Layer.FirstValid);
|
||||
DeleteFromLayer(from, Layer.TwoHanded);
|
||||
DeleteFromLayer(from, Layer.Shoes);
|
||||
DeleteFromLayer(from, Layer.Pants);
|
||||
DeleteFromLayer(from, Layer.Shirt);
|
||||
DeleteFromLayer(from, Layer.Helm);
|
||||
DeleteFromLayer(from, Layer.Gloves);
|
||||
DeleteFromLayer(from, Layer.Ring);
|
||||
DeleteFromLayer(from, Layer.Talisman);
|
||||
DeleteFromLayer(from, Layer.Neck);
|
||||
DeleteFromLayer(from, Layer.Hair);
|
||||
DeleteFromLayer(from, Layer.Waist);
|
||||
DeleteFromLayer(from, Layer.InnerTorso);
|
||||
DeleteFromLayer(from, Layer.Bracelet);
|
||||
// DeleteFromLayer(from, Layer.Unused_xF);
|
||||
DeleteFromLayer(from, Layer.FacialHair);
|
||||
DeleteFromLayer(from, Layer.MiddleTorso);
|
||||
DeleteFromLayer(from, Layer.Earrings);
|
||||
DeleteFromLayer(from, Layer.Arms);
|
||||
DeleteFromLayer(from, Layer.Cloak);
|
||||
DeleteFromLayer(from, Layer.OuterTorso);
|
||||
DeleteFromLayer(from, Layer.OuterLegs);
|
||||
DeleteFromLayer(from, Layer.LastUserValid);
|
||||
DeleteFromLayer(from, Layer.Mount);
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientCloneSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientCloneSpell owner)
|
||||
: base(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Misc;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientDanceSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Dance", "Por Xen",
|
||||
218,
|
||||
9031,
|
||||
Reagent.Garlic,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.MandrakeRoot
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Fifth; }
|
||||
}
|
||||
|
||||
public AncientDanceSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public void Target(IPoint3D p)
|
||||
{
|
||||
if (!Caster.CanSee(p))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
SpellHelper.Turn(Caster, p);
|
||||
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
ArrayList targets = new ArrayList();
|
||||
|
||||
Map map = Caster.Map;
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 3);
|
||||
|
||||
foreach (Mobile m in eable)
|
||||
{
|
||||
if (Core.AOS && m == Caster)
|
||||
continue;
|
||||
|
||||
if (SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanSee(m))
|
||||
targets.Add(m);
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
for (int i = 0; i < targets.Count; ++i)
|
||||
{
|
||||
Mobile m = (Mobile)targets[i];
|
||||
if (Caster.CanBeHarmful(m, false))
|
||||
{
|
||||
Caster.DoHarmful(m);
|
||||
m.Stam = 0;
|
||||
}
|
||||
m.Freeze(TimeSpan.FromSeconds(4)); //freeze for animation
|
||||
|
||||
m.Animate(111, 5, 1, true, false, 0); // Do a little dance...
|
||||
|
||||
|
||||
m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.CenterFeet);
|
||||
m.PlaySound(0x1FB);
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientDanceSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientDanceSpell owner)
|
||||
: base(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientDeathVortexSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Death Vortex", "Vas Corp Hur",
|
||||
260,
|
||||
9032,
|
||||
false,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.SulfurousAsh,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.Nightshade
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Eighth; }
|
||||
}
|
||||
|
||||
public AncientDeathVortexSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
if (!base.CheckCast())
|
||||
return false;
|
||||
|
||||
if ((Caster.Followers + 1) > Caster.FollowersMax)
|
||||
{
|
||||
Caster.SendLocalizedMessage(1049645); // You have too many followers to summon that creature.
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public void Target(IPoint3D p)
|
||||
{
|
||||
Map map = Caster.Map;
|
||||
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z))
|
||||
{
|
||||
Caster.SendLocalizedMessage(501942); // That location is blocked.
|
||||
}
|
||||
else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
|
||||
{
|
||||
BaseCreature.Summon(new DeathVortex(), false, Caster, new Point3D(p), 0x212, TimeSpan.FromSeconds(Utility.Random(80, 40)));
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientDeathVortexSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientDeathVortexSpell owner)
|
||||
: base(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 OnTargetOutOfLOS(Mobile from, object o)
|
||||
{
|
||||
from.SendLocalizedMessage(501943); // Target cannot be seen. Try again.
|
||||
from.Target = new InternalTarget(m_Owner);
|
||||
from.Target.BeginTimeout(from, TimeoutTime - DateTime.Now);
|
||||
m_Owner = null;
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
if (m_Owner != null)
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientDestroyTrapSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Destroy Trap", "An Jux",
|
||||
212,
|
||||
9001,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Second; }
|
||||
}
|
||||
|
||||
public AncientDestroyTrapSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
{
|
||||
Caster.Target = new InternalTarget(this);
|
||||
Caster.SendMessage("Which trap do you wish to destroy?");
|
||||
}
|
||||
}
|
||||
|
||||
public void Target(HouseTrap item)
|
||||
{
|
||||
if (!Caster.CanSee(item))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (CheckSequence())
|
||||
{
|
||||
SpellHelper.Turn(Caster, item);
|
||||
|
||||
Point3D loc = item.GetWorldLocation();
|
||||
|
||||
Blood shards = new Blood();
|
||||
shards.ItemID = 0xC2D;
|
||||
shards.Map = item.Map;
|
||||
shards.Location = loc;
|
||||
Effects.PlaySound(loc, item.Map, 0x305);
|
||||
if (item.Placer != null)
|
||||
item.Placer.SendMessage("A trap you placed has been destroyed!");
|
||||
|
||||
|
||||
item.Delete();
|
||||
Caster.SendMessage("You destroy the trap!");
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientDestroyTrapSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientDestroyTrapSpell owner)
|
||||
: base(12, false, TargetFlags.None)
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (o is HouseTrap)
|
||||
{
|
||||
m_Owner.Target((HouseTrap)o);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("You can't destroy that");
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Misc;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientDetectTrapSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Detect Trap", "Wis Jux",
|
||||
206,
|
||||
9002,
|
||||
Reagent.SpidersSilk,
|
||||
Reagent.Nightshade
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.First; }
|
||||
}
|
||||
|
||||
public AncientDetectTrapSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
private static Hashtable m_UnderEffect = new Hashtable();
|
||||
|
||||
private static void RemoveEffect(object state)
|
||||
{
|
||||
Mobile m = (Mobile)state;
|
||||
|
||||
m_UnderEffect.Remove(m);
|
||||
|
||||
m.SendMessage("You can no longer see hidden traps");
|
||||
}
|
||||
|
||||
public static bool UnderEffect(Mobile m)
|
||||
{
|
||||
return m_UnderEffect.Contains(m);
|
||||
}
|
||||
|
||||
public void Target(Mobile m)
|
||||
{
|
||||
if (!Caster.CanSee(m))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (CheckSequence())
|
||||
{
|
||||
SpellHelper.Turn(Caster, m);
|
||||
|
||||
Timer t = (Timer)m_UnderEffect[m];
|
||||
|
||||
if (Caster.Player && m.Player && t == null)
|
||||
{
|
||||
TimeSpan duration = SpellHelper.GetDuration(Caster, m);
|
||||
m_UnderEffect[m] = t = Timer.DelayCall(duration, new TimerStateCallback(RemoveEffect), m);
|
||||
m.SendMessage("You can now see hidden traps!");
|
||||
Map duck = m.Map;
|
||||
if (duck == Map.Felucca)
|
||||
m.Map = Map.Malas;
|
||||
else
|
||||
m.Map = Map.Felucca;
|
||||
m.Map = duck;
|
||||
m.FixedParticles(0x3818, 10, 15, 5028, EffectLayer.Head);
|
||||
m.PlaySound(0x104);
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientDetectTrapSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientDetectTrapSpell 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 OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientDouseSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Douse", "An Flam",
|
||||
212,
|
||||
9001,
|
||||
Reagent.Bloodmoss
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.First; }
|
||||
}
|
||||
|
||||
public override double CastDelay { get { return 1.0; } }
|
||||
public override double RequiredSkill { get { return 0.0; } }
|
||||
public override int RequiredMana { get { return 5; } }
|
||||
|
||||
public AncientDouseSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
{
|
||||
Caster.Target = new InternalTarget(this);
|
||||
Caster.SendMessage("What do you wish to douse?");
|
||||
}
|
||||
}
|
||||
|
||||
public void Target(NaturalFire item)
|
||||
{
|
||||
if (!Caster.CanSee(item))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
|
||||
else if (CheckSequence())
|
||||
{
|
||||
SpellHelper.Turn(Caster, item);
|
||||
|
||||
Point3D loc = item.GetWorldLocation();
|
||||
|
||||
|
||||
Effects.PlaySound(loc, item.Map, 0x11);
|
||||
IEntity to = new Entity(Serial.Zero, new Point3D(Caster.X, Caster.Y, Caster.Z), Caster.Map);
|
||||
IEntity from = new Entity(Serial.Zero, new Point3D(Caster.X, Caster.Y, Caster.Z + 50), Caster.Map);
|
||||
Effects.SendMovingParticles(from, to, 0x376A, 1, 0, false, false, 33, 3, 1263, 1, 0, EffectLayer.Head, 0x100);
|
||||
|
||||
|
||||
item.Delete();
|
||||
Caster.SendMessage("You douse the flames!");
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientDouseSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientDouseSpell owner)
|
||||
: base(12, false, TargetFlags.None)
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (o is NaturalFire)
|
||||
{
|
||||
m_Owner.Target((NaturalFire)o);
|
||||
}
|
||||
else if (o is GreaterNaturalFire)
|
||||
{
|
||||
from.SendMessage("Your spell is not powerful enough to douse that!");
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("You can't douse that!");
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
using Server.Spells;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Regions;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientEnchantSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Enchant", "Ort Ylem",
|
||||
218,
|
||||
9002,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.MandrakeRoot
|
||||
);
|
||||
|
||||
private int m_Hue;
|
||||
private string m_Name;
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Second; }
|
||||
}
|
||||
|
||||
public AncientEnchantSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
{
|
||||
m_Name = null;
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
if (!base.CheckCast())
|
||||
return false;
|
||||
|
||||
return SpellHelper.CheckTravel(Caster, TravelCheckType.Mark);
|
||||
}
|
||||
|
||||
public void Target(BaseRanged weapon)
|
||||
{
|
||||
if (!Caster.CanSee(weapon))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (!Caster.CanBeginAction(typeof(AncientEnchantSpell)))
|
||||
{
|
||||
Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
|
||||
|
||||
}
|
||||
else if (CheckSequence())
|
||||
{
|
||||
if (Caster.BeginAction(typeof(AncientEnchantSpell)))
|
||||
{
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
m_Hue = weapon.Hue;
|
||||
m_Name = weapon.Name;
|
||||
weapon.Name = "" + m_Name + " [enchanted]";
|
||||
weapon.Hue = 1366;
|
||||
weapon.Attributes.WeaponDamage += 10;
|
||||
weapon.Attributes.AttackChance += 1000;
|
||||
|
||||
Caster.PlaySound(0x20C);
|
||||
Caster.PlaySound(0x145);
|
||||
Caster.FixedParticles(0x3779, 1, 30, 9964, 3, 3, EffectLayer.Waist);
|
||||
|
||||
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, 0x13B1, 1, 0, false, false, 33, 3, 9501, 1, 0, EffectLayer.Head, 0x100);
|
||||
StopTimer(Caster);
|
||||
|
||||
Timer t = new InternalTimer(Caster, weapon, m_Hue, m_Name);
|
||||
|
||||
m_Timers[Caster] = t;
|
||||
|
||||
t.Start();
|
||||
}
|
||||
else if (!Caster.CanBeginAction(typeof(AncientEnchantSpell)))
|
||||
{
|
||||
DoFizzle();
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientEnchantSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientEnchantSpell owner)
|
||||
: base(12, false, TargetFlags.None)
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (o is BaseRanged)
|
||||
{
|
||||
m_Owner.Target((BaseRanged)o);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("That cannot be enchanted."); // I cannot mark that object.
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
private static Hashtable m_Timers = new Hashtable();
|
||||
|
||||
public static bool StopTimer(Mobile m)
|
||||
{
|
||||
Timer t = (Timer)m_Timers[m];
|
||||
|
||||
if (t != null)
|
||||
{
|
||||
t.Stop();
|
||||
m_Timers.Remove(m);
|
||||
}
|
||||
|
||||
return (t != null);
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_Owner;
|
||||
private BaseRanged m_Weapon;
|
||||
private int m_weaponhue;
|
||||
private string m_Name;
|
||||
|
||||
public InternalTimer(Mobile owner, BaseRanged weapon, int m_Hue, string m_WeaponName)
|
||||
: base(TimeSpan.FromSeconds(0))
|
||||
{
|
||||
m_Owner = owner;
|
||||
m_Weapon = weapon;
|
||||
m_weaponhue = m_Hue;
|
||||
m_Name = m_WeaponName;
|
||||
|
||||
int val = (int)owner.Skills[SkillName.Magery].Value;
|
||||
|
||||
if (val > 100)
|
||||
val = 100;
|
||||
|
||||
Delay = TimeSpan.FromSeconds(val);
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (!m_Owner.CanBeginAction(typeof(AncientEnchantSpell)))
|
||||
{
|
||||
m_Weapon.Hue = m_weaponhue;
|
||||
m_Weapon.Name = m_Name;
|
||||
m_Weapon.Attributes.WeaponDamage -= 10;
|
||||
m_Weapon.Attributes.AttackChance -= 1000;
|
||||
m_Owner.EndAction(typeof(AncientEnchantSpell));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
using Server.Spells;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Regions;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientFalseCoinSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"False Coin", "Rel Ylem",
|
||||
218,
|
||||
9002,
|
||||
Reagent.Nightshade,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Second; }
|
||||
}
|
||||
|
||||
private FakeGold m_Fake;
|
||||
|
||||
public AncientFalseCoinSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
if (!base.CheckCast())
|
||||
return false;
|
||||
|
||||
return SpellHelper.CheckTravel(Caster, TravelCheckType.Mark);
|
||||
}
|
||||
|
||||
public void Target(Gold weapon)
|
||||
{
|
||||
if (!Caster.CanSee(weapon))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
|
||||
else if (CheckSequence())
|
||||
{
|
||||
if (Caster.BeginAction(typeof(AncientFalseCoinSpell)))
|
||||
{
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
FakeGold fake = new FakeGold();
|
||||
fake.m_Amount = weapon.Amount * 5;
|
||||
fake.Name = "" + (weapon.Amount * 5) + " Gold Coins";
|
||||
m_Fake = fake;
|
||||
Caster.AddToBackpack(fake);
|
||||
Caster.PlaySound(0x2E6);
|
||||
|
||||
IEntity from = new Entity(Serial.Zero, new Point3D(Caster.X, Caster.Y, Caster.Z + 50), Caster.Map);
|
||||
IEntity to = new Entity(Serial.Zero, new Point3D(Caster.X, Caster.Y, Caster.Z), Caster.Map);
|
||||
Effects.SendMovingParticles(from, to, 0x1EC6, 1, 0, false, false, 33, 3, 9501, 1, 0, EffectLayer.Head, 0x100);
|
||||
StopTimer(Caster);
|
||||
|
||||
|
||||
Timer t = new InternalTimer(Caster, m_Fake);
|
||||
|
||||
m_Timers[Caster] = t;
|
||||
|
||||
t.Start();
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientFalseCoinSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientFalseCoinSpell owner)
|
||||
: base(12, false, TargetFlags.None)
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (o is Gold)
|
||||
{
|
||||
m_Owner.Target((Gold)o);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("That cannot be copied."); // I cannot mark that object.
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
private static Hashtable m_Timers = new Hashtable();
|
||||
|
||||
public static bool StopTimer(Mobile m)
|
||||
{
|
||||
Timer t = (Timer)m_Timers[m];
|
||||
|
||||
if (t != null)
|
||||
{
|
||||
t.Stop();
|
||||
m_Timers.Remove(m);
|
||||
}
|
||||
|
||||
return (t != null);
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_Owner;
|
||||
private FakeGold m_Weapon;
|
||||
|
||||
|
||||
public InternalTimer(Mobile owner, FakeGold weapon)
|
||||
: base(TimeSpan.FromSeconds(0))
|
||||
{
|
||||
m_Owner = owner;
|
||||
m_Weapon = weapon;
|
||||
|
||||
int val = (int)owner.Skills[SkillName.Magery].Value;
|
||||
|
||||
if (val > 100)
|
||||
val = 100;
|
||||
|
||||
Delay = TimeSpan.FromSeconds(val);
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (!m_Owner.CanBeginAction(typeof(AncientFalseCoinSpell)))
|
||||
{
|
||||
if (m_Weapon != null)
|
||||
{
|
||||
m_Weapon.Delete();
|
||||
m_Owner.SendMessage("The forged coins fade away!");
|
||||
}
|
||||
|
||||
m_Owner.EndAction(typeof(AncientFalseCoinSpell));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,339 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Misc;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientFireRingSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Fire Ring", "Kal Flam Grav",
|
||||
233,
|
||||
9012,
|
||||
false,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.SpidersSilk,
|
||||
Reagent.SulfurousAsh,
|
||||
Reagent.MandrakeRoot
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Sixth; }
|
||||
}
|
||||
|
||||
public AncientFireRingSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
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) && CheckSequence())
|
||||
{
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
SpellHelper.Turn(Caster, p);
|
||||
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
Effects.PlaySound(p, Caster.Map, 0x1DD);
|
||||
|
||||
Point3D loc = new Point3D(p.X, p.Y, p.Z);
|
||||
int mushx;
|
||||
int mushy;
|
||||
int mushz;
|
||||
|
||||
InternalItem firstFlamea = new InternalItem(Caster.Location, Caster.Map, Caster);
|
||||
mushx = loc.X - 2;
|
||||
mushy = loc.Y - 2;
|
||||
mushz = loc.Z;
|
||||
Point3D mushxyz = new Point3D(mushx, mushy, mushz);
|
||||
firstFlamea.MoveToWorld(mushxyz, Caster.Map);
|
||||
|
||||
InternalItem firstFlamec = new InternalItem(Caster.Location, Caster.Map, Caster);
|
||||
mushx = loc.X;
|
||||
mushy = loc.Y - 3;
|
||||
mushz = loc.Z;
|
||||
Point3D mushxyzb = new Point3D(mushx, mushy, mushz);
|
||||
firstFlamec.MoveToWorld(mushxyzb, Caster.Map);
|
||||
|
||||
InternalItem firstFlamed = new InternalItem(Caster.Location, Caster.Map, Caster);
|
||||
firstFlamed.ItemID = 0x3709;
|
||||
mushx = loc.X + 2;
|
||||
mushy = loc.Y - 2;
|
||||
mushz = loc.Z;
|
||||
Point3D mushxyzc = new Point3D(mushx, mushy, mushz);
|
||||
firstFlamed.MoveToWorld(mushxyzc, Caster.Map);
|
||||
InternalItem firstFlamee = new InternalItem(Caster.Location, Caster.Map, Caster);
|
||||
mushx = loc.X + 3;
|
||||
firstFlamee.ItemID = 0x3709;
|
||||
mushy = loc.Y;
|
||||
mushz = loc.Z;
|
||||
Point3D mushxyzd = new Point3D(mushx, mushy, mushz);
|
||||
firstFlamee.MoveToWorld(mushxyzd, Caster.Map);
|
||||
InternalItem firstFlamef = new InternalItem(Caster.Location, Caster.Map, Caster);
|
||||
firstFlamef.ItemID = 0x3709;
|
||||
mushx = loc.X + 2;
|
||||
mushy = loc.Y + 2;
|
||||
mushz = loc.Z;
|
||||
Point3D mushxyze = new Point3D(mushx, mushy, mushz);
|
||||
firstFlamef.MoveToWorld(mushxyze, Caster.Map);
|
||||
InternalItem firstFlameg = new InternalItem(Caster.Location, Caster.Map, Caster);
|
||||
mushx = loc.X;
|
||||
firstFlameg.ItemID = 0x3709;
|
||||
mushy = loc.Y + 3;
|
||||
mushz = loc.Z;
|
||||
Point3D mushxyzf = new Point3D(mushx, mushy, mushz);
|
||||
firstFlameg.MoveToWorld(mushxyzf, Caster.Map);
|
||||
InternalItem firstFlameh = new InternalItem(Caster.Location, Caster.Map, Caster);
|
||||
mushx = loc.X - 2;
|
||||
firstFlameh.ItemID = 0x3709;
|
||||
mushy = loc.Y + 2;
|
||||
mushz = loc.Z;
|
||||
Point3D mushxyzg = new Point3D(mushx, mushy, mushz);
|
||||
firstFlameh.MoveToWorld(mushxyzg, Caster.Map);
|
||||
InternalItem firstFlamei = new InternalItem(Caster.Location, Caster.Map, Caster);
|
||||
mushx = loc.X - 3;
|
||||
firstFlamei.ItemID = 0x3709;
|
||||
mushy = loc.Y;
|
||||
mushz = loc.Z;
|
||||
Point3D mushxyzh = new Point3D(mushx, mushy, mushz);
|
||||
firstFlamei.MoveToWorld(mushxyzh, Caster.Map);
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
[DispellableField]
|
||||
private class InternalItem : Item
|
||||
{
|
||||
private Timer m_Timer;
|
||||
private Timer m_Burn;
|
||||
private DateTime m_End;
|
||||
private Mobile m_Caster;
|
||||
|
||||
public override bool BlocksFit { get { return true; } }
|
||||
|
||||
public InternalItem(Point3D loc, Map map, Mobile caster)
|
||||
: base(0x3709)
|
||||
{
|
||||
Visible = false;
|
||||
Movable = false;
|
||||
Light = LightType.Circle150;
|
||||
MoveToWorld(loc, map);
|
||||
m_Caster = caster;
|
||||
|
||||
if (caster.InLOS(this))
|
||||
Visible = true;
|
||||
else
|
||||
Delete();
|
||||
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
m_Timer = new InternalTimer(this, TimeSpan.FromSeconds(30.0));
|
||||
m_Timer.Start();
|
||||
m_Burn = new BurnTimer(this, m_Caster);
|
||||
m_Burn.Start();
|
||||
|
||||
m_End = DateTime.Now + TimeSpan.FromSeconds(30.0);
|
||||
}
|
||||
|
||||
public InternalItem(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
if (Visible && m_Caster != null && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false))
|
||||
{
|
||||
m_Caster.DoHarmful(m);
|
||||
|
||||
int damage = Utility.Random(18, 24);
|
||||
|
||||
if (!Core.AOS && m.CheckSkill(SkillName.MagicResist, 0.0, 30.0))
|
||||
{
|
||||
damage = Utility.Random(9, 12);
|
||||
|
||||
m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
|
||||
}
|
||||
|
||||
AOS.Damage(m, m_Caster, damage, 0, 100, 0, 0, 0);
|
||||
m.PlaySound(0x1DD);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write(m_End - DateTime.Now);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
TimeSpan duration = reader.ReadTimeSpan();
|
||||
|
||||
m_Timer = new InternalTimer(this, duration);
|
||||
m_Timer.Start();
|
||||
|
||||
m_End = DateTime.Now + duration;
|
||||
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
TimeSpan duration = TimeSpan.FromSeconds(10.0);
|
||||
|
||||
m_Timer = new InternalTimer(this, duration);
|
||||
m_Timer.Start();
|
||||
|
||||
m_End = DateTime.Now + duration;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if (m_Timer != null)
|
||||
m_Timer.Stop();
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private InternalItem m_Item;
|
||||
|
||||
public InternalTimer(InternalItem item, TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Item.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientFireRingSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientFireRingSpell owner)
|
||||
: base(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();
|
||||
}
|
||||
}
|
||||
|
||||
private class BurnTimer : Timer
|
||||
{
|
||||
private Item m_FireRing;
|
||||
private Mobile m_Caster;
|
||||
private DateTime m_Duration;
|
||||
|
||||
private static Queue m_Queue = new Queue();
|
||||
|
||||
public BurnTimer(Item ap, Mobile ca)
|
||||
: base(TimeSpan.FromSeconds(0.25), TimeSpan.FromSeconds(0.5))
|
||||
{
|
||||
Priority = TimerPriority.FiftyMS;
|
||||
|
||||
m_FireRing = ap;
|
||||
m_Caster = ca;
|
||||
m_Duration = DateTime.Now + TimeSpan.FromSeconds(15.0 + (Utility.RandomDouble() * 15.0));
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (m_FireRing.Deleted)
|
||||
return;
|
||||
|
||||
if (DateTime.Now > m_Duration)
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
Map map = m_FireRing.Map;
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
foreach (Mobile m in m_FireRing.GetMobilesInRange(1))
|
||||
{
|
||||
if ((m.Z + 16) > m_FireRing.Z && (m_FireRing.Z + 12) > m.Z)
|
||||
m_Queue.Enqueue(m);
|
||||
}
|
||||
|
||||
while (m_Queue.Count > 0)
|
||||
{
|
||||
Mobile m = (Mobile)m_Queue.Dequeue();
|
||||
|
||||
if (m_FireRing.Visible && m_Caster != null && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false))
|
||||
{
|
||||
m_Caster.DoHarmful(m);
|
||||
|
||||
int damage = Utility.Random(5, 8);
|
||||
|
||||
if (!Core.AOS && m.CheckSkill(SkillName.MagicResist, 0.0, 30.0))
|
||||
{
|
||||
damage = Utility.Random(1, 3);
|
||||
m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
|
||||
}
|
||||
|
||||
AOS.Damage(m, m_Caster, damage, 0, 100, 0, 0, 0);
|
||||
m.PlaySound(0x1DD);
|
||||
m.SendLocalizedMessage(503000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientFireworksSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Fireworks", "Bet Ort",
|
||||
236,
|
||||
9011,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.First; }
|
||||
}
|
||||
|
||||
public override double CastDelay { get { return 0.5; } }
|
||||
public override double RequiredSkill { get { return 0.0; } }
|
||||
public override int RequiredMana { get { return 1; } }
|
||||
|
||||
public AncientFireworksSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private static Hashtable m_Table = new Hashtable();
|
||||
|
||||
public static void DrawFirework(Mobile from)
|
||||
{
|
||||
int[] intEffectID = { 14138, 14154, 14201 };
|
||||
|
||||
Point3D EffectLocation = new Point3D((from.X + Utility.Random(-4, 8)), (from.Y + Utility.Random(-4, 8)), from.Z + 20);
|
||||
// Effects.SendMovingParticles( from, EffectLocation, 0x36E4, 5, 0, false, false, 3006, 4006, 9501, 1, 0, EffectLayer.RightHand, 0x100 );
|
||||
IEntity to = new Entity(Serial.Zero, EffectLocation, from.Map);
|
||||
from.MovingParticles(to, 0x36E4, 5, 0, false, false, 3006, 4006, 0);
|
||||
Timer t = new InternalTimer(from, EffectLocation, intEffectID);
|
||||
|
||||
m_Table[from] = t;
|
||||
|
||||
t.Start();
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
private Point3D EffectLocation;
|
||||
private int[] intEffectID;
|
||||
|
||||
public InternalTimer(Mobile m, Point3D local, int[] fwoosh)
|
||||
: base(TimeSpan.FromSeconds(0.3))
|
||||
{
|
||||
m_Mobile = m;
|
||||
EffectLocation = local;
|
||||
intEffectID = fwoosh;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
Effects.SendLocationEffect(EffectLocation, m_Mobile.Map, intEffectID[Utility.Random(0, 3)], 70, (int)(5 * Utility.Random(0, 20)) + 3, 2);
|
||||
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 0: m_Mobile.PlaySound(0x11C); break;
|
||||
case 1: m_Mobile.PlaySound(0x11E); break;
|
||||
case 2: m_Mobile.PlaySound(0x11D); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
{
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
DrawFirework(Caster);
|
||||
if (Caster.Skills[SkillName.Magery].Base >= 110)
|
||||
DrawFirework(Caster);
|
||||
if (Caster.Skills[SkillName.Magery].Base >= 100)
|
||||
DrawFirework(Caster);
|
||||
if (Caster.Skills[SkillName.Magery].Base >= 75)
|
||||
DrawFirework(Caster);
|
||||
if (Caster.Skills[SkillName.Magery].Base >= 50)
|
||||
DrawFirework(Caster);
|
||||
if (Caster.Skills[SkillName.Magery].Base >= 25)
|
||||
DrawFirework(Caster);
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Misc;
|
||||
using Server.Items;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientGlimmerSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Glimmer", "Bet Lor",
|
||||
227,
|
||||
9011,
|
||||
Reagent.Bloodmoss
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Second; }
|
||||
}
|
||||
|
||||
public override double CastDelay { get { return 1.5; } }
|
||||
public override double RequiredSkill { get { return 0.0; } }
|
||||
public override int RequiredMana { get { return 3; } }
|
||||
|
||||
public AncientGlimmerSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public void Target(IPoint3D p)
|
||||
{
|
||||
if (!Caster.CanSee(p))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else
|
||||
{
|
||||
SpellHelper.Turn(Caster, 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, 0x1EE);
|
||||
|
||||
for (int i = -1; i <= 1; ++i)
|
||||
{
|
||||
Point3D loc = new Point3D(eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z);
|
||||
bool canFit = SpellHelper.AdjustField(ref loc, Caster.Map, 22, true);
|
||||
|
||||
//Effects.SendLocationParticles( EffectItem.Create( loc, Caster.Map, EffectItem.DefaultDuration ), 0x376A, 9, 10, 5025 );
|
||||
|
||||
if (!canFit)
|
||||
continue;
|
||||
|
||||
Item item = new InternalItem(loc, Caster.Map, Caster);
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
Effects.SendLocationParticles(item, 0x376A, 9, 10, 5025);
|
||||
|
||||
//new InternalItem( loc, Caster.Map, Caster );
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
[DispellableField]
|
||||
private class InternalItem : Item
|
||||
{
|
||||
private Timer m_Timer;
|
||||
private DateTime m_End;
|
||||
|
||||
public override bool BlocksFit { get { return true; } }
|
||||
|
||||
public InternalItem(Point3D loc, Map map, Mobile caster)
|
||||
: base(0x1647)
|
||||
{
|
||||
Visible = false;
|
||||
Movable = false;
|
||||
|
||||
MoveToWorld(loc, map);
|
||||
|
||||
if (caster.InLOS(this))
|
||||
{
|
||||
Visible = true;
|
||||
Light = LightType.Circle150;
|
||||
}
|
||||
else
|
||||
Delete();
|
||||
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
m_Timer = new InternalTimer(this, TimeSpan.FromSeconds(3.0));
|
||||
m_Timer.Start();
|
||||
|
||||
m_End = DateTime.Now + TimeSpan.FromSeconds(3.0);
|
||||
}
|
||||
|
||||
public InternalItem(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.WriteDeltaTime(m_End);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_End = reader.ReadDeltaTime();
|
||||
|
||||
m_Timer = new InternalTimer(this, m_End - DateTime.Now);
|
||||
m_Timer.Start();
|
||||
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
TimeSpan duration = TimeSpan.FromSeconds(3.0);
|
||||
|
||||
m_Timer = new InternalTimer(this, duration);
|
||||
m_Timer.Start();
|
||||
|
||||
m_End = DateTime.Now + duration;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if (m_Timer != null)
|
||||
m_Timer.Stop();
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private InternalItem m_Item;
|
||||
|
||||
public InternalTimer(InternalItem item, TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Item.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientGlimmerSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientGlimmerSpell owner)
|
||||
: base(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Misc;
|
||||
using Server.Items;
|
||||
using System.Collections;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientGreatIgniteSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Great Ignite", "Vas In Flam",
|
||||
233,
|
||||
9012,
|
||||
false,
|
||||
Reagent.SulfurousAsh,
|
||||
Reagent.SpidersSilk
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.First; }
|
||||
}
|
||||
|
||||
public AncientGreatIgniteSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientGreatIgniteSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientGreatIgniteSpell owner)
|
||||
: base(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();
|
||||
}
|
||||
}
|
||||
|
||||
public void Target(IPoint3D p)
|
||||
{
|
||||
if (!Caster.CanSee(p))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
|
||||
{
|
||||
|
||||
SpellHelper.Turn(Caster, p);
|
||||
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
Effects.PlaySound(p, Caster.Map, 0x1DD);
|
||||
|
||||
Point3D loc = new Point3D(p.X, p.Y, p.Z);
|
||||
|
||||
IEntity to = new Entity(Serial.Zero, new Point3D(p), Caster.Map);
|
||||
Effects.SendMovingParticles(Caster, to, 0xf53, 1, 0, false, false, 33, 3, 1260, 1, 0, EffectLayer.Head, 0x100);
|
||||
|
||||
GreaterNaturalFire fire = new GreaterNaturalFire(Caster.Location, Caster.Map, Caster);
|
||||
fire.MoveToWorld(loc, Caster.Map);
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientGreatLightSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Great Light", "Vas Lor",
|
||||
215,
|
||||
9061,
|
||||
Reagent.SulfurousAsh,
|
||||
Reagent.MandrakeRoot
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Second; }
|
||||
}
|
||||
|
||||
public AncientGreatLightSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
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);
|
||||
|
||||
ArrayList targets = new ArrayList();
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
Map map = Caster.Map;
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 3);
|
||||
|
||||
foreach (Mobile m in eable)
|
||||
{
|
||||
if (Caster.CanBeBeneficial(m, false))
|
||||
targets.Add(m);
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
Effects.PlaySound(p, Caster.Map, 0x299);
|
||||
|
||||
if (targets.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < targets.Count; ++i)
|
||||
{
|
||||
Mobile targ = (Mobile)targets[i];
|
||||
|
||||
if (targ.BeginAction(typeof(LightCycle)))
|
||||
{
|
||||
new LightCycle.NightSightTimer(targ).Start();
|
||||
int level = (int)Math.Abs(LightCycle.DungeonLevel * (Caster.Skills[SkillName.Magery].Base / 100));
|
||||
|
||||
if (level > 25 || level < 0)
|
||||
level = 25;
|
||||
|
||||
targ.LightLevel = level;
|
||||
|
||||
targ.FixedParticles(0x376A, 9, 32, 5007, EffectLayer.Waist);
|
||||
targ.PlaySound(0x1E3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientGreatLightSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientGreatLightSpell owner)
|
||||
: base(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientGreatDouseSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Great Douse", "Vas An Flam",
|
||||
212,
|
||||
9001,
|
||||
Reagent.Garlic,
|
||||
Reagent.SpidersSilk
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.First; }
|
||||
}
|
||||
|
||||
public AncientGreatDouseSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
{
|
||||
Caster.Target = new InternalTarget(this);
|
||||
Caster.SendMessage("What do you wish to douse?");
|
||||
}
|
||||
}
|
||||
|
||||
public void Target(Item item)
|
||||
{
|
||||
if (!Caster.CanSee(item))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (CheckSequence())
|
||||
{
|
||||
SpellHelper.Turn(Caster, item);
|
||||
|
||||
Point3D loc = item.GetWorldLocation();
|
||||
|
||||
Effects.PlaySound(loc, item.Map, 0x10);
|
||||
IEntity to = new Entity(Serial.Zero, loc, Caster.Map);
|
||||
IEntity from = new Entity(Serial.Zero, new Point3D(loc.X, loc.Y, loc.Z + 50), Caster.Map);
|
||||
Effects.SendMovingParticles(from, to, 0x376A, 1, 0, false, false, 33, 3, 1263, 1, 0, EffectLayer.Head, 1263);
|
||||
|
||||
item.Delete();
|
||||
Caster.SendMessage("You douse the flames!");
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientGreatDouseSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientGreatDouseSpell owner)
|
||||
: base(12, false, TargetFlags.None)
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (o is NaturalFire)
|
||||
{
|
||||
m_Owner.Target((NaturalFire)o);
|
||||
}
|
||||
else if (o is GreaterNaturalFire)
|
||||
{
|
||||
m_Owner.Target((GreaterNaturalFire)o);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("You can't douse that!");
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Misc;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientIgniteSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Ignite", "In Flam",
|
||||
233,
|
||||
9012,
|
||||
false,
|
||||
Reagent.BlackPearl
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.First; }
|
||||
}
|
||||
|
||||
public override double CastDelay { get { return 3.0; } }
|
||||
public override double RequiredSkill { get { return 0.0; } }
|
||||
public override int RequiredMana { get { return 10; } }
|
||||
|
||||
public AncientIgniteSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientIgniteSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientIgniteSpell owner)
|
||||
: base(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();
|
||||
}
|
||||
}
|
||||
|
||||
public void Target(IPoint3D p)
|
||||
{
|
||||
if (!Caster.CanSee(p))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
|
||||
{
|
||||
|
||||
SpellHelper.Turn(Caster, p);
|
||||
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
Effects.PlaySound(p, Caster.Map, 0x1DD);
|
||||
|
||||
IEntity to = new Entity(Serial.Zero, new Point3D(p), Caster.Map);
|
||||
Effects.SendMovingParticles(Caster, to, 0xf53, 1, 0, false, false, 33, 3, 1260, 1, 0, EffectLayer.Head, 0x100);
|
||||
|
||||
Point3D loc = new Point3D(p.X, p.Y, p.Z);
|
||||
|
||||
NaturalFire fire = new NaturalFire(Caster.Location, Caster.Map, Caster);
|
||||
fire.MoveToWorld(loc, Caster.Map);
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientInvisibilityAllSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Invisibility All", "Vas Sanct Lor",
|
||||
215,
|
||||
9061,
|
||||
Reagent.Nightshade,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.MandrakeRoot
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Eighth; }
|
||||
}
|
||||
|
||||
public AncientInvisibilityAllSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
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())
|
||||
{
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
SpellHelper.Turn(Caster, p);
|
||||
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
ArrayList targets = new ArrayList();
|
||||
|
||||
Map map = Caster.Map;
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 3);
|
||||
|
||||
foreach (Mobile m in eable)
|
||||
{
|
||||
if (Caster.CanBeBeneficial(m, false))
|
||||
targets.Add(m);
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
if (targets.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < targets.Count; ++i)
|
||||
{
|
||||
Mobile m = (Mobile)targets[i];
|
||||
|
||||
Caster.DoBeneficial(m);
|
||||
|
||||
Effects.SendLocationParticles(EffectItem.Create(new Point3D(m.X, m.Y, m.Z + 16), Caster.Map, EffectItem.DefaultDuration), 0x376A, 10, 15, 5045);
|
||||
m.PlaySound(0x3C4);
|
||||
|
||||
m.Hidden = true;
|
||||
|
||||
RemoveTimer(m);
|
||||
|
||||
TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Magery].Value * 1.2); // 120% of magery
|
||||
|
||||
Timer t = new InternalTimer(m, duration);
|
||||
|
||||
m_Table[m] = t;
|
||||
|
||||
t.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private static Hashtable m_Table = new Hashtable();
|
||||
|
||||
public static void RemoveTimer(Mobile m)
|
||||
{
|
||||
Timer t = (Timer)m_Table[m];
|
||||
|
||||
if (t != null)
|
||||
{
|
||||
t.Stop();
|
||||
m_Table.Remove(m);
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
|
||||
public InternalTimer(Mobile m, TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
m_Mobile = m;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Mobile.RevealingAction();
|
||||
RemoveTimer(m_Mobile);
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientInvisibilityAllSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientInvisibilityAllSpell owner)
|
||||
: base(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientLocateSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Locate", "In Wis",
|
||||
224,
|
||||
9061,
|
||||
Reagent.Nightshade
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.First; }
|
||||
}
|
||||
|
||||
public AncientLocateSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
{
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
int xLong = 0, yLat = 0;
|
||||
int xMins = 0, yMins = 0;
|
||||
bool xEast = false, ySouth = false;
|
||||
|
||||
if (AncientLocateSpell.Format(Caster.Location, Caster.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth))
|
||||
{
|
||||
string location = String.Format("Your current location is: {0} {1}'{2}, {3} {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W");
|
||||
Caster.LocalOverheadMessage(MessageType.Regular, Caster.SpeechHue, false, location);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Format(Point3D p, Map map, ref int xLong, ref int yLat, ref int xMins, ref int yMins, ref bool xEast, ref bool ySouth)
|
||||
{
|
||||
if (map == null || map == Map.Internal)
|
||||
return false;
|
||||
|
||||
int x = p.X, y = p.Y;
|
||||
int xCenter, yCenter;
|
||||
int xWidth, yHeight;
|
||||
|
||||
xWidth = 5120; yHeight = 4096;
|
||||
|
||||
if (map == Map.Trammel || map == Map.Felucca)
|
||||
{
|
||||
if (x >= 0 && y >= 0 && x < 5120 && y < 4096)
|
||||
{
|
||||
xCenter = 1323; yCenter = 1624;
|
||||
}
|
||||
else if (x >= 0 && y >= 0 && x < map.Width && y < map.Height)
|
||||
{
|
||||
xCenter = 1323; yCenter = 1624;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (x >= 0 && y >= 0 && x < map.Width && y < map.Height)
|
||||
{
|
||||
xCenter = 5936; yCenter = 3112;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
double absLong = (double)((x - xCenter) * 360) / xWidth;
|
||||
double absLat = (double)((y - yCenter) * 360) / yHeight;
|
||||
|
||||
if (absLong > 180.0)
|
||||
absLong = -180.0 + (absLong % 180.0);
|
||||
|
||||
if (absLat > 180.0)
|
||||
absLat = -180.0 + (absLat % 180.0);
|
||||
|
||||
bool east = (absLong >= 0), south = (absLat >= 0);
|
||||
|
||||
if (absLong < 0.0)
|
||||
absLong = -absLong;
|
||||
|
||||
if (absLat < 0.0)
|
||||
absLat = -absLat;
|
||||
|
||||
xLong = (int)absLong;
|
||||
yLat = (int)absLat;
|
||||
|
||||
xMins = (int)((absLong % 1.0) * 60);
|
||||
yMins = (int)((absLat % 1.0) * 60);
|
||||
|
||||
xEast = east;
|
||||
ySouth = south;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientMassCharmSpell : AncientSpell
|
||||
{
|
||||
private Timer m_Timer;
|
||||
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Mass Charm", "Vas An Xen Ex",
|
||||
218,
|
||||
9012,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.Nightshade,
|
||||
Reagent.SpidersSilk,
|
||||
Reagent.MandrakeRoot
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Seventh; }
|
||||
}
|
||||
|
||||
public AncientMassCharmSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public void Target(Mobile ma)
|
||||
{
|
||||
BaseCreature m = ma as BaseCreature;
|
||||
|
||||
if (ma is CharmedMobile)
|
||||
{
|
||||
ma.Kill();
|
||||
Caster.SendMessage("You free them from their charm!");
|
||||
}
|
||||
else if (m != null)
|
||||
{
|
||||
if (!Caster.CanSee(m))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (m.Controlled || m.Summoned)
|
||||
{
|
||||
Caster.SendMessage("That target is already under somone's control!");
|
||||
}
|
||||
else if (!m.Alive)
|
||||
{
|
||||
Caster.SendMessage("The dead are beyond your charms.");
|
||||
}
|
||||
else if (m.Blessed)
|
||||
{
|
||||
Caster.SendMessage("You have no chance of charming that!");
|
||||
}
|
||||
else if (Caster.Followers >= 2)
|
||||
{
|
||||
Caster.SendMessage("You couldn't control that if you did charm it!");
|
||||
}
|
||||
else if (CheckHSequence(m))
|
||||
{
|
||||
SpellHelper.Turn(Caster, m);
|
||||
|
||||
if (!m.Controlled && m != null && !m.Deleted)
|
||||
{
|
||||
int charmchance = Caster.Int + Utility.Random(1, 6);
|
||||
if (charmchance <= m.Int + Utility.Random(1, 6))
|
||||
{
|
||||
Caster.SendMessage("You have no chance of charming them.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Caster.SendMessage("You charm them!");
|
||||
Point3D mloc = new Point3D(m.X, m.Y, m.Z);
|
||||
CharmedMobile dg = new CharmedMobile(m);
|
||||
dg.Owner = m;
|
||||
|
||||
dg.Body = m.Body;
|
||||
dg.AI = m.AI;
|
||||
dg.Hue = m.Hue;
|
||||
dg.Name = m.Name;
|
||||
dg.SpeechHue = m.SpeechHue;
|
||||
dg.Fame = m.Fame;
|
||||
dg.Karma = m.Karma;
|
||||
dg.EmoteHue = m.EmoteHue;
|
||||
dg.Title = m.Title;
|
||||
dg.Criminal = (m.Criminal);
|
||||
dg.Str = m.Str;
|
||||
dg.Int = m.Int;
|
||||
dg.Hits = m.Hits;
|
||||
dg.Dex = m.Dex;
|
||||
dg.Mana = m.Mana;
|
||||
dg.Stam = m.Stam;
|
||||
|
||||
dg.VirtualArmor = (m.VirtualArmor);
|
||||
dg.SetSkill(SkillName.Wrestling, m.Skills[SkillName.Wrestling].Value);
|
||||
dg.SetSkill(SkillName.Tactics, m.Skills[SkillName.Tactics].Value);
|
||||
dg.SetSkill(SkillName.Anatomy, m.Skills[SkillName.Anatomy].Value);
|
||||
|
||||
dg.SetSkill(SkillName.Magery, m.Skills[SkillName.Magery].Value);
|
||||
dg.SetSkill(SkillName.MagicResist, m.Skills[SkillName.MagicResist].Value);
|
||||
dg.SetSkill(SkillName.Meditation, m.Skills[SkillName.Meditation].Value);
|
||||
dg.SetSkill(SkillName.EvalInt, m.Skills[SkillName.EvalInt].Value);
|
||||
|
||||
dg.SetSkill(SkillName.Archery, m.Skills[SkillName.Archery].Value);
|
||||
dg.SetSkill(SkillName.Macing, m.Skills[SkillName.Macing].Value);
|
||||
dg.SetSkill(SkillName.Swords, m.Skills[SkillName.Swords].Value);
|
||||
dg.SetSkill(SkillName.Fencing, m.Skills[SkillName.Fencing].Value);
|
||||
dg.SetSkill(SkillName.Lumberjacking, m.Skills[SkillName.Lumberjacking].Value);
|
||||
dg.SetSkill(SkillName.Alchemy, m.Skills[SkillName.Alchemy].Value);
|
||||
dg.SetSkill(SkillName.Parry, m.Skills[SkillName.Parry].Value);
|
||||
dg.SetSkill(SkillName.Focus, m.Skills[SkillName.Focus].Value);
|
||||
dg.SetSkill(SkillName.Necromancy, m.Skills[SkillName.Necromancy].Value);
|
||||
dg.SetSkill(SkillName.Chivalry, m.Skills[SkillName.Chivalry].Value);
|
||||
dg.SetSkill(SkillName.ArmsLore, m.Skills[SkillName.ArmsLore].Value);
|
||||
dg.SetSkill(SkillName.Poisoning, m.Skills[SkillName.Poisoning].Value);
|
||||
dg.SetSkill(SkillName.SpiritSpeak, m.Skills[SkillName.SpiritSpeak].Value);
|
||||
dg.SetSkill(SkillName.Stealing, m.Skills[SkillName.Stealing].Value);
|
||||
dg.SetSkill(SkillName.Inscribe, m.Skills[SkillName.Inscribe].Value);
|
||||
dg.Kills = (m.Kills);
|
||||
|
||||
// Clear Items
|
||||
RemoveFromAllLayers(dg);
|
||||
|
||||
// Then copy
|
||||
CopyFromLayer(m, dg, Layer.FirstValid);
|
||||
CopyFromLayer(m, dg, Layer.TwoHanded);
|
||||
CopyFromLayer(m, dg, Layer.Shoes);
|
||||
CopyFromLayer(m, dg, Layer.Pants);
|
||||
CopyFromLayer(m, dg, Layer.Shirt);
|
||||
CopyFromLayer(m, dg, Layer.Helm);
|
||||
CopyFromLayer(m, dg, Layer.Gloves);
|
||||
CopyFromLayer(m, dg, Layer.Ring);
|
||||
CopyFromLayer(m, dg, Layer.Talisman);
|
||||
CopyFromLayer(m, dg, Layer.Neck);
|
||||
CopyFromLayer(m, dg, Layer.Hair);
|
||||
CopyFromLayer(m, dg, Layer.Waist);
|
||||
CopyFromLayer(m, dg, Layer.InnerTorso);
|
||||
CopyFromLayer(m, dg, Layer.Bracelet);
|
||||
// CopyFromLayer(m, dg, Layer.Unused_xF);
|
||||
CopyFromLayer(m, dg, Layer.FacialHair);
|
||||
CopyFromLayer(m, dg, Layer.MiddleTorso);
|
||||
CopyFromLayer(m, dg, Layer.Earrings);
|
||||
CopyFromLayer(m, dg, Layer.Arms);
|
||||
CopyFromLayer(m, dg, Layer.Cloak);
|
||||
CopyFromLayer(m, dg, Layer.OuterTorso);
|
||||
CopyFromLayer(m, dg, Layer.OuterLegs);
|
||||
CopyFromLayer(m, dg, Layer.LastUserValid);
|
||||
CopyFromLayer(m, dg, Layer.Mount);
|
||||
dg.ControlSlots = 5;
|
||||
dg.Controlled = true;
|
||||
dg.ControlMaster = Caster;
|
||||
TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Magery].Value * 1.2); // 120% of magery
|
||||
m_Timer = new InternalTimer(dg, duration);
|
||||
m_Timer.Start();
|
||||
dg.Map = m.Map;
|
||||
dg.Location = m.Location;
|
||||
m.Blessed = true;
|
||||
m.Hidden = true;
|
||||
|
||||
m.Location = new Point3D(m.X, m.Y, m.Z - 95);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
Caster.SendMessage("You have no chance of charming them.");
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private void CopyFromLayer(Mobile from, Mobile mimic, Layer layer)
|
||||
{
|
||||
if (mimic.FindItemOnLayer(layer) != null && mimic.FindItemOnLayer(layer).LootType != LootType.Blessed)
|
||||
mimic.FindItemOnLayer(layer).LootType = LootType.Newbied;
|
||||
}
|
||||
|
||||
private void DeleteFromLayer(Mobile from, Layer layer)
|
||||
{
|
||||
if (from.FindItemOnLayer(layer) != null)
|
||||
from.RemoveItem(from.FindItemOnLayer(layer));
|
||||
}
|
||||
|
||||
private void RemoveFromAllLayers(Mobile from)
|
||||
{
|
||||
DeleteFromLayer(from, Layer.FirstValid);
|
||||
DeleteFromLayer(from, Layer.TwoHanded);
|
||||
DeleteFromLayer(from, Layer.Shoes);
|
||||
DeleteFromLayer(from, Layer.Pants);
|
||||
DeleteFromLayer(from, Layer.Shirt);
|
||||
DeleteFromLayer(from, Layer.Helm);
|
||||
DeleteFromLayer(from, Layer.Gloves);
|
||||
DeleteFromLayer(from, Layer.Ring);
|
||||
DeleteFromLayer(from, Layer.Talisman);
|
||||
DeleteFromLayer(from, Layer.Neck);
|
||||
DeleteFromLayer(from, Layer.Hair);
|
||||
DeleteFromLayer(from, Layer.Waist);
|
||||
DeleteFromLayer(from, Layer.InnerTorso);
|
||||
DeleteFromLayer(from, Layer.Bracelet);
|
||||
// DeleteFromLayer(from, Layer.Unused_xF);
|
||||
DeleteFromLayer(from, Layer.FacialHair);
|
||||
DeleteFromLayer(from, Layer.MiddleTorso);
|
||||
DeleteFromLayer(from, Layer.Earrings);
|
||||
DeleteFromLayer(from, Layer.Arms);
|
||||
DeleteFromLayer(from, Layer.Cloak);
|
||||
DeleteFromLayer(from, Layer.OuterTorso);
|
||||
DeleteFromLayer(from, Layer.OuterLegs);
|
||||
DeleteFromLayer(from, Layer.LastUserValid);
|
||||
DeleteFromLayer(from, Layer.Mount);
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private CharmedMobile m_Item;
|
||||
|
||||
public InternalTimer(CharmedMobile item, TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (m_Item != null)
|
||||
m_Item.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public class InternalTarget : Target
|
||||
{
|
||||
private AncientMassCharmSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientMassCharmSpell owner)
|
||||
: base(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientMassDeathSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Mass Death", "Vas Corp",
|
||||
233,
|
||||
9012,
|
||||
false,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.Ginseng,
|
||||
Reagent.Garlic,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.Nightshade
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Eighth; }
|
||||
}
|
||||
|
||||
public AncientMassDeathSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool DelayedDamage { get { return !Core.AOS; } }
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (SpellHelper.CheckTown(Caster, Caster) && CheckSequence())
|
||||
{
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
ArrayList targets = new ArrayList();
|
||||
|
||||
Map map = Caster.Map;
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
foreach (Mobile m in Caster.GetMobilesInRange(1 + (int)(Caster.Skills[SkillName.Magery].Value / 15.0)))
|
||||
{
|
||||
if (Caster != m && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false) && (!Core.AOS || Caster.InLOS(m)))
|
||||
targets.Add(m);
|
||||
}
|
||||
}
|
||||
|
||||
Caster.PlaySound(0x309);
|
||||
|
||||
for (int i = 0; i < targets.Count; ++i)
|
||||
{
|
||||
Mobile m = (Mobile)targets[i];
|
||||
|
||||
double damage = Core.AOS ? m.Hits - (m.Hits / 3.0) : m.Hits * 0.6;
|
||||
|
||||
if (!m.Player && damage < 10.0)
|
||||
damage = 10.0;
|
||||
else if (damage > (Core.AOS ? 100.0 : 75.0))
|
||||
damage = Core.AOS ? 100.0 : 75.0;
|
||||
|
||||
Caster.DoHarmful(m);
|
||||
SpellHelper.Damage(TimeSpan.Zero, m, Caster, damage, 100, 0, 0, 0, 0);
|
||||
m.Kill();
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientMassMightSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Mass Might", "In Vas Por",
|
||||
215,
|
||||
9061,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.Ginseng
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Seventh; }
|
||||
}
|
||||
|
||||
public AncientMassMightSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
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())
|
||||
{
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
SpellHelper.Turn(Caster, p);
|
||||
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
ArrayList targets = new ArrayList();
|
||||
|
||||
Map map = Caster.Map;
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 3);
|
||||
|
||||
foreach (Mobile m in eable)
|
||||
{
|
||||
if (Caster.CanBeBeneficial(m, false))
|
||||
targets.Add(m);
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
Effects.PlaySound(p, Caster.Map, 0x299);
|
||||
|
||||
if (targets.Count > 0)
|
||||
{
|
||||
|
||||
for (int i = 0; i < targets.Count; ++i)
|
||||
{
|
||||
Mobile targ = (Mobile)targets[i];
|
||||
|
||||
SpellHelper.AddStatBonus(Caster, targ, true,StatType.Str); //SpellHelper.DisableSkillCheck = true;
|
||||
SpellHelper.AddStatBonus(Caster, targ, true,StatType.Dex);
|
||||
SpellHelper.AddStatBonus(Caster, targ, true,StatType.Int); //SpellHelper.DisableSkillCheck = false;
|
||||
|
||||
targ.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist);
|
||||
targ.PlaySound(0x1EA);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientMassMightSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientMassMightSpell owner)
|
||||
: base(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientMassSleepSpell : AncientSpell
|
||||
{
|
||||
private SleepingBody m_Body;
|
||||
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Mass Sleep", "Vas Zu",
|
||||
215,
|
||||
9061,
|
||||
Reagent.Nightshade,
|
||||
Reagent.Ginseng,
|
||||
Reagent.SpidersSilk
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Fifth; }
|
||||
}
|
||||
|
||||
public AncientMassSleepSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
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())
|
||||
{
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
SpellHelper.Turn(Caster, p);
|
||||
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
ArrayList targets = new ArrayList();
|
||||
|
||||
Map map = Caster.Map;
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 3);
|
||||
|
||||
foreach (Mobile m in eable)
|
||||
{
|
||||
if (m != Caster && m.AccessLevel <= Caster.AccessLevel)
|
||||
targets.Add(m);
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
if (targets.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < targets.Count; ++i)
|
||||
{
|
||||
Mobile m = (Mobile)targets[i];
|
||||
|
||||
Effects.SendLocationParticles(EffectItem.Create(new Point3D(m.X, m.Y, m.Z + 16), Caster.Map, EffectItem.DefaultDuration), 0x376A, 10, 15, 5045);
|
||||
m.PlaySound(0x3C4);
|
||||
|
||||
m.Hidden = true;
|
||||
m.Frozen = true;
|
||||
m.Squelched = true;
|
||||
|
||||
SleepingBody body = new SleepingBody(m, m.Blessed);
|
||||
body.Map = m.Map;
|
||||
body.Location = m.Location;
|
||||
m_Body = body;
|
||||
m.Z -= 100;
|
||||
|
||||
m.SendMessage("You fall asleep");
|
||||
|
||||
RemoveTimer(m);
|
||||
|
||||
TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Magery].Value * 1.2); // 120% of magery
|
||||
|
||||
Timer t = new InternalTimer(m, duration, m_Body);
|
||||
|
||||
m_Table[m] = t;
|
||||
|
||||
t.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private static Hashtable m_Table = new Hashtable();
|
||||
|
||||
public static void RemoveTimer(Mobile m)
|
||||
{
|
||||
Timer t = (Timer)m_Table[m];
|
||||
|
||||
if (t != null)
|
||||
{
|
||||
t.Stop();
|
||||
m_Table.Remove(m);
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
private SleepingBody m_Body;
|
||||
|
||||
public InternalTimer(Mobile m, TimeSpan duration, SleepingBody body)
|
||||
: base(duration)
|
||||
{
|
||||
m_Mobile = m;
|
||||
m_Body = body;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Mobile.RevealingAction();
|
||||
m_Mobile.Frozen = false;
|
||||
m_Mobile.Squelched = false;
|
||||
m_Mobile.Z = m_Body.Z;
|
||||
m_Mobile.Map = m_Body.Map;
|
||||
if (m_Body != null)
|
||||
{
|
||||
m_Body.Delete();
|
||||
m_Mobile.SendMessage("You wake up!");
|
||||
}
|
||||
RemoveTimer(m_Mobile);
|
||||
}
|
||||
}
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientMassSleepSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientMassSleepSpell owner)
|
||||
: base(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,310 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
using Server.Spells.Fifth;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientPeerSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Peer", "Vas Wis",
|
||||
221,
|
||||
9002,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.Nightshade
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Third; }
|
||||
}
|
||||
|
||||
private int m_OldBody;
|
||||
private Souless m_Fake;
|
||||
public ArrayList m_PeerMod;
|
||||
|
||||
public AncientPeerSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (!CheckSequence())
|
||||
return;
|
||||
else if (Caster.Mounted)
|
||||
{
|
||||
Caster.SendLocalizedMessage(1042561); //Please dismount first.
|
||||
}
|
||||
else if (!Caster.CanBeginAction(typeof(AncientPeerSpell)))
|
||||
{
|
||||
Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
|
||||
}
|
||||
else if (Server.Spells.TransformationSpellHelper.UnderTransformation(Caster))
|
||||
{
|
||||
Caster.SendMessage("Your eyes stay firmly inside your body.");
|
||||
}
|
||||
else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
|
||||
{
|
||||
Caster.SendMessage("Your eyes stay firmly inside your body.");
|
||||
}
|
||||
else if (!Caster.CanBeginAction(typeof(IncognitoSpell)) || Caster.IsBodyMod)
|
||||
{
|
||||
DoFizzle();
|
||||
}
|
||||
else if (CheckSequence())
|
||||
{
|
||||
if (Caster.BeginAction(typeof(AncientPeerSpell)))
|
||||
{
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
Caster.PlaySound(0x2DF);
|
||||
|
||||
Caster.SendMessage("Your sight leaves your body.");
|
||||
|
||||
Souless dg = new Souless(this);
|
||||
|
||||
dg.Body = Caster.Body;
|
||||
|
||||
dg.Hue = Caster.Hue;
|
||||
dg.Name = Caster.Name;
|
||||
dg.SpeechHue = Caster.SpeechHue;
|
||||
dg.Fame = Caster.Fame;
|
||||
dg.Karma = Caster.Karma;
|
||||
dg.EmoteHue = Caster.EmoteHue;
|
||||
dg.Title = Caster.Title;
|
||||
dg.Criminal = (Caster.Criminal);
|
||||
dg.AccessLevel = Caster.AccessLevel;
|
||||
dg.Str = Caster.Str;
|
||||
dg.Int = Caster.Int;
|
||||
dg.Hits = Caster.Hits;
|
||||
dg.Dex = Caster.Dex;
|
||||
dg.Mana = Caster.Mana;
|
||||
dg.Stam = Caster.Stam;
|
||||
|
||||
dg.VirtualArmor = (Caster.VirtualArmor);
|
||||
dg.SetSkill(SkillName.Wrestling, Caster.Skills[SkillName.Wrestling].Value);
|
||||
dg.SetSkill(SkillName.Tactics, Caster.Skills[SkillName.Tactics].Value);
|
||||
dg.SetSkill(SkillName.Anatomy, Caster.Skills[SkillName.Anatomy].Value);
|
||||
|
||||
dg.SetSkill(SkillName.Magery, Caster.Skills[SkillName.Magery].Value);
|
||||
dg.SetSkill(SkillName.MagicResist, Caster.Skills[SkillName.MagicResist].Value);
|
||||
dg.SetSkill(SkillName.Meditation, Caster.Skills[SkillName.Meditation].Value);
|
||||
dg.SetSkill(SkillName.EvalInt, Caster.Skills[SkillName.EvalInt].Value);
|
||||
|
||||
dg.SetSkill(SkillName.Archery, Caster.Skills[SkillName.Archery].Value);
|
||||
dg.SetSkill(SkillName.Macing, Caster.Skills[SkillName.Macing].Value);
|
||||
dg.SetSkill(SkillName.Swords, Caster.Skills[SkillName.Swords].Value);
|
||||
dg.SetSkill(SkillName.Fencing, Caster.Skills[SkillName.Fencing].Value);
|
||||
dg.SetSkill(SkillName.Lumberjacking, Caster.Skills[SkillName.Lumberjacking].Value);
|
||||
dg.SetSkill(SkillName.Alchemy, Caster.Skills[SkillName.Alchemy].Value);
|
||||
dg.SetSkill(SkillName.Parry, Caster.Skills[SkillName.Parry].Value);
|
||||
dg.SetSkill(SkillName.Focus, Caster.Skills[SkillName.Focus].Value);
|
||||
dg.SetSkill(SkillName.Necromancy, Caster.Skills[SkillName.Necromancy].Value);
|
||||
dg.SetSkill(SkillName.Chivalry, Caster.Skills[SkillName.Chivalry].Value);
|
||||
dg.SetSkill(SkillName.ArmsLore, Caster.Skills[SkillName.ArmsLore].Value);
|
||||
dg.SetSkill(SkillName.Poisoning, Caster.Skills[SkillName.Poisoning].Value);
|
||||
dg.SetSkill(SkillName.SpiritSpeak, Caster.Skills[SkillName.SpiritSpeak].Value);
|
||||
dg.SetSkill(SkillName.Stealing, Caster.Skills[SkillName.Stealing].Value);
|
||||
dg.SetSkill(SkillName.Inscribe, Caster.Skills[SkillName.Inscribe].Value);
|
||||
dg.Kills = (Caster.Kills);
|
||||
|
||||
m_PeerMod = new ArrayList();
|
||||
double loss = (0 - Caster.Skills[SkillName.AnimalTaming].Base);
|
||||
SkillMod sk = new DefaultSkillMod(SkillName.AnimalTaming, true, loss);
|
||||
Caster.AddSkillMod(sk);
|
||||
m_PeerMod.Add(sk);
|
||||
double loss1 = (0 - Caster.Skills[SkillName.AnimalLore].Base);
|
||||
SkillMod sk1 = new DefaultSkillMod(SkillName.AnimalLore, true, loss1);// Druidry
|
||||
Caster.AddSkillMod(sk1);
|
||||
m_PeerMod.Add(sk1);
|
||||
|
||||
double loss3 = (0 - Caster.Skills[SkillName.Necromancy].Base);
|
||||
SkillMod sk3 = new DefaultSkillMod(SkillName.Necromancy, true, loss3);
|
||||
Caster.AddSkillMod(sk3);
|
||||
m_PeerMod.Add(sk3);
|
||||
double loss4 = (0 - Caster.Skills[SkillName.TasteID].Base);
|
||||
SkillMod sk4 = new DefaultSkillMod(SkillName.TasteID, true, loss4);
|
||||
Caster.AddSkillMod(sk4);
|
||||
m_PeerMod.Add(sk4);
|
||||
// Clear Items
|
||||
RemoveFromAllLayers(dg);
|
||||
|
||||
// Then copy
|
||||
CopyFromLayer(Caster, dg, Layer.FirstValid);
|
||||
CopyFromLayer(Caster, dg, Layer.OneHanded);
|
||||
CopyFromLayer(Caster, dg, Layer.TwoHanded);
|
||||
CopyFromLayer(Caster, dg, Layer.Shoes);
|
||||
CopyFromLayer(Caster, dg, Layer.Pants);
|
||||
CopyFromLayer(Caster, dg, Layer.Shirt);
|
||||
CopyFromLayer(Caster, dg, Layer.Helm);
|
||||
CopyFromLayer(Caster, dg, Layer.Gloves);
|
||||
CopyFromLayer(Caster, dg, Layer.Ring);
|
||||
CopyFromLayer(Caster, dg, Layer.Talisman);
|
||||
CopyFromLayer(Caster, dg, Layer.Neck);
|
||||
CopyFromLayer(Caster, dg, Layer.Hair);
|
||||
CopyFromLayer(Caster, dg, Layer.Waist);
|
||||
CopyFromLayer(Caster, dg, Layer.InnerTorso);
|
||||
CopyFromLayer(Caster, dg, Layer.Bracelet);
|
||||
//CopyFromLayer(Caster, dg, Layer.Unused_xF);
|
||||
CopyFromLayer(Caster, dg, Layer.FacialHair);
|
||||
CopyFromLayer(Caster, dg, Layer.MiddleTorso);
|
||||
CopyFromLayer(Caster, dg, Layer.Earrings);
|
||||
CopyFromLayer(Caster, dg, Layer.Arms);
|
||||
CopyFromLayer(Caster, dg, Layer.Cloak);
|
||||
CopyFromLayer(Caster, dg, Layer.Backpack);
|
||||
CopyFromLayer(Caster, dg, Layer.OuterTorso);
|
||||
CopyFromLayer(Caster, dg, Layer.OuterLegs);
|
||||
CopyFromLayer(Caster, dg, Layer.InnerLegs);
|
||||
CopyFromLayer(Caster, dg, Layer.LastUserValid);
|
||||
CopyFromLayer(Caster, dg, Layer.Mount);
|
||||
|
||||
dg.Owner = Caster;
|
||||
dg.OldBody = m_OldBody;
|
||||
m_Fake = dg;
|
||||
dg.Map = Caster.Map;
|
||||
dg.Location = Caster.Location;
|
||||
BaseArmor.ValidateMobile(Caster);
|
||||
m_OldBody = Caster.Body;
|
||||
Caster.BodyValue = 903;
|
||||
Caster.Blessed = true;
|
||||
StopTimer(Caster);
|
||||
|
||||
Timer t = new InternalTimer(Caster, m_OldBody, m_Fake, this);
|
||||
|
||||
m_Timers[Caster] = t;
|
||||
|
||||
t.Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private void CopyFromLayer(Mobile from, Mobile mimic, Layer layer)
|
||||
{
|
||||
if (mimic.FindItemOnLayer(layer) != null && mimic.FindItemOnLayer(layer).LootType != LootType.Blessed)
|
||||
mimic.FindItemOnLayer(layer).LootType = LootType.Newbied;
|
||||
}
|
||||
|
||||
private void DeleteFromLayer(Mobile from, Layer layer)
|
||||
{
|
||||
if (from.FindItemOnLayer(layer) != null)
|
||||
from.RemoveItem(from.FindItemOnLayer(layer));
|
||||
}
|
||||
|
||||
private void RemoveFromAllLayers(Mobile from)
|
||||
{
|
||||
DeleteFromLayer(from, Layer.FirstValid);
|
||||
DeleteFromLayer(from, Layer.OneHanded);
|
||||
DeleteFromLayer(from, Layer.TwoHanded);
|
||||
DeleteFromLayer(from, Layer.Shoes);
|
||||
DeleteFromLayer(from, Layer.Pants);
|
||||
DeleteFromLayer(from, Layer.Shirt);
|
||||
DeleteFromLayer(from, Layer.Helm);
|
||||
DeleteFromLayer(from, Layer.Gloves);
|
||||
DeleteFromLayer(from, Layer.Ring);
|
||||
DeleteFromLayer(from, Layer.Talisman);
|
||||
DeleteFromLayer(from, Layer.Neck);
|
||||
DeleteFromLayer(from, Layer.Hair);
|
||||
DeleteFromLayer(from, Layer.Waist);
|
||||
DeleteFromLayer(from, Layer.InnerTorso);
|
||||
DeleteFromLayer(from, Layer.Bracelet);
|
||||
//DeleteFromLayer(from, Layer.Unused_xF);
|
||||
DeleteFromLayer(from, Layer.FacialHair);
|
||||
DeleteFromLayer(from, Layer.MiddleTorso);
|
||||
DeleteFromLayer(from, Layer.Earrings);
|
||||
DeleteFromLayer(from, Layer.Arms);
|
||||
DeleteFromLayer(from, Layer.Cloak);
|
||||
DeleteFromLayer(from, Layer.Backpack);
|
||||
DeleteFromLayer(from, Layer.OuterTorso);
|
||||
DeleteFromLayer(from, Layer.OuterLegs);
|
||||
DeleteFromLayer(from, Layer.InnerLegs);
|
||||
DeleteFromLayer(from, Layer.LastUserValid);
|
||||
DeleteFromLayer(from, Layer.Mount);
|
||||
}
|
||||
|
||||
public void RemovePeerMod()
|
||||
{
|
||||
if (m_PeerMod == null)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < m_PeerMod.Count; ++i)
|
||||
((SkillMod)m_PeerMod[i]).Remove();
|
||||
m_PeerMod = null;
|
||||
}
|
||||
private static Hashtable m_Timers = new Hashtable();
|
||||
|
||||
public static bool StopTimer(Mobile m)
|
||||
{
|
||||
Timer t = (Timer)m_Timers[m];
|
||||
|
||||
if (t != null)
|
||||
{
|
||||
t.Stop();
|
||||
m_Timers.Remove(m);
|
||||
}
|
||||
|
||||
return (t != null);
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_Owner;
|
||||
private int m_OldBody;
|
||||
private Souless fake;
|
||||
private Point3D loc;
|
||||
private AncientPeerSpell m_spell;
|
||||
public InternalTimer(Mobile owner, int body, Souless m_Fake, AncientPeerSpell spell)
|
||||
: base(TimeSpan.FromSeconds(0))
|
||||
{
|
||||
m_Owner = owner;
|
||||
m_OldBody = body;
|
||||
fake = m_Fake;
|
||||
m_spell = spell;
|
||||
|
||||
int val = (int)owner.Skills[SkillName.Magery].Value;
|
||||
|
||||
if (val > 100)
|
||||
val = 100;
|
||||
double loss2 = (0 - m_Owner.Skills[SkillName.Magery].Base);
|
||||
SkillMod sk2 = new DefaultSkillMod(SkillName.Magery, true, loss2);
|
||||
m_Owner.AddSkillMod(sk2);
|
||||
m_spell.m_PeerMod.Add(sk2);
|
||||
|
||||
Delay = TimeSpan.FromSeconds(val);
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (!m_Owner.CanBeginAction(typeof(AncientPeerSpell)))
|
||||
{
|
||||
if (fake != null && !fake.Deleted)
|
||||
{
|
||||
loc = new Point3D(fake.X, fake.Y, fake.Z);
|
||||
m_Owner.Location = loc;
|
||||
m_Owner.Blessed = fake.Blessed;
|
||||
fake.Delete();
|
||||
|
||||
}
|
||||
m_Owner.BodyValue = m_OldBody;
|
||||
m_spell.RemovePeerMod();
|
||||
m_Owner.EndAction(typeof(AncientPeerSpell));
|
||||
|
||||
BaseArmor.ValidateMobile(m_Owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientSeanceSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Seance", "Kal Wis Corp",
|
||||
221,
|
||||
9002,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.SpidersSilk,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.Nightshade,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Fourth; }
|
||||
}
|
||||
|
||||
private int m_NewBody;
|
||||
private int m_OldBody;
|
||||
|
||||
public AncientSeanceSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
if (Caster.Mounted)
|
||||
{
|
||||
Caster.SendLocalizedMessage(1042561); //Please dismount first.
|
||||
return false;
|
||||
}
|
||||
else if (TransformationSpellHelper.UnderTransformation(Caster))
|
||||
{
|
||||
Caster.SendMessage("You cannot enter the realm of the dead while in that form.");
|
||||
return false;
|
||||
}
|
||||
else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
|
||||
{
|
||||
Caster.SendMessage("You cannot enter the realm of the dead without removing your paint.");
|
||||
return false;
|
||||
}
|
||||
else if (!Caster.CanBeginAction(typeof(AncientSeanceSpell)))
|
||||
{
|
||||
Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
|
||||
return false;
|
||||
}
|
||||
else if (Caster.Female)
|
||||
{
|
||||
m_NewBody = 403;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
m_NewBody = 402;
|
||||
|
||||
|
||||
}
|
||||
m_OldBody = Caster.Body;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (!CheckSequence())
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (!Caster.CanBeginAction(typeof(AncientSeanceSpell)))
|
||||
{
|
||||
Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
|
||||
}
|
||||
else if (TransformationSpellHelper.UnderTransformation(Caster))
|
||||
{
|
||||
Caster.SendMessage("You cannot enter the realm of the dead while in that form.");
|
||||
}
|
||||
else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
|
||||
{
|
||||
Caster.SendMessage("You cannot enter the realm of the dead without removing your paint.");
|
||||
}
|
||||
else if (!Caster.CanBeginAction(typeof(Server.Spells.Fifth.IncognitoSpell)) || Caster.IsBodyMod)
|
||||
{
|
||||
DoFizzle();
|
||||
}
|
||||
else if (CheckSequence())
|
||||
{
|
||||
|
||||
if (Caster.BeginAction(typeof(AncientSeanceSpell)))
|
||||
{
|
||||
if (m_NewBody != 0)
|
||||
{
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
Caster.PlaySound(0x379);
|
||||
|
||||
Caster.BodyValue = m_NewBody;
|
||||
|
||||
Caster.SendMessage("You enter the realm of the dead.");
|
||||
BaseArmor.ValidateMobile(Caster);
|
||||
|
||||
StopTimer(Caster);
|
||||
|
||||
Timer t = new InternalTimer(Caster, m_OldBody);
|
||||
|
||||
m_Timers[Caster] = t;
|
||||
|
||||
t.Start();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private static Hashtable m_Timers = new Hashtable();
|
||||
|
||||
public static bool StopTimer(Mobile m)
|
||||
{
|
||||
Timer t = (Timer)m_Timers[m];
|
||||
|
||||
if (t != null)
|
||||
{
|
||||
t.Stop();
|
||||
m_Timers.Remove(m);
|
||||
}
|
||||
|
||||
return (t != null);
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_Owner;
|
||||
private int m_OldBody;
|
||||
|
||||
public InternalTimer(Mobile owner, int body)
|
||||
: base(TimeSpan.FromSeconds(0))
|
||||
{
|
||||
m_Owner = owner;
|
||||
m_OldBody = body;
|
||||
|
||||
int val = (int)owner.Skills[SkillName.Magery].Value;
|
||||
|
||||
if (val > 100)
|
||||
val = 100;
|
||||
|
||||
Delay = TimeSpan.FromSeconds(val);
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (!m_Owner.CanBeginAction(typeof(AncientSeanceSpell)))
|
||||
{
|
||||
m_Owner.BodyValue = m_OldBody;
|
||||
m_Owner.EndAction(typeof(AncientSeanceSpell));
|
||||
|
||||
BaseArmor.ValidateMobile(m_Owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,349 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Misc;
|
||||
using Server.Items;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientSleepFieldSpell : AncientSpell
|
||||
{
|
||||
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Sleep Field", "In Zu Grav",
|
||||
230,
|
||||
9052,
|
||||
false,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.Ginseng,
|
||||
Reagent.SpidersSilk
|
||||
);
|
||||
|
||||
public override Server.Spells.SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Sixth; ; }
|
||||
}
|
||||
|
||||
public AncientSleepFieldSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
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) && CheckSequence())
|
||||
{
|
||||
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
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 ? 0x3915 : 0x3922;
|
||||
|
||||
TimeSpan duration = TimeSpan.FromSeconds(3.0 + (Caster.Skills[SkillName.Magery].Value * 0.4));
|
||||
|
||||
for (int i = -2; i <= 2; ++i)
|
||||
{
|
||||
Point3D loc = new Point3D(eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z);
|
||||
|
||||
new InternalItem(itemID, loc, Caster, Caster.Map, duration, i);
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
[DispellableField]
|
||||
private class InternalItem : Item
|
||||
{
|
||||
private Timer m_Timer;
|
||||
private DateTime m_End;
|
||||
private Mobile m_Caster;
|
||||
private SleepingBody m_Body;
|
||||
|
||||
public override bool BlocksFit { get { return true; } }
|
||||
|
||||
public InternalItem(int itemID, Point3D loc, Mobile caster, Map map, TimeSpan duration, int val)
|
||||
: base(itemID)
|
||||
{
|
||||
bool canFit = SpellHelper.AdjustField(ref loc, map, 12, false);
|
||||
|
||||
Visible = false;
|
||||
Movable = false;
|
||||
Light = LightType.Circle300;
|
||||
Hue = 1169;
|
||||
Name = "sleep field";
|
||||
|
||||
MoveToWorld(loc, map);
|
||||
|
||||
m_Caster = caster;
|
||||
|
||||
m_End = DateTime.Now + duration;
|
||||
|
||||
m_Timer = new InternalTimer(this, TimeSpan.FromSeconds(Math.Abs(val) * 0.2), caster.InLOS(this), canFit);
|
||||
m_Timer.Start();
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if (m_Timer != null)
|
||||
m_Timer.Stop();
|
||||
}
|
||||
|
||||
public InternalItem(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // 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 1:
|
||||
{
|
||||
m_Caster = reader.ReadMobile();
|
||||
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_End = reader.ReadDeltaTime();
|
||||
|
||||
m_Timer = new InternalTimer(this, TimeSpan.Zero, true, true);
|
||||
m_Timer.Start();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ApplySleepTo(Mobile m)
|
||||
{
|
||||
m.Hidden = true;
|
||||
m.Frozen = true;
|
||||
m.Squelched = true;
|
||||
|
||||
SleepingBody body = new SleepingBody(m, m.Blessed);
|
||||
|
||||
body.Map = m.Map;
|
||||
body.Location = m.Location;
|
||||
m_Body = body;
|
||||
m.Z -= 100;
|
||||
|
||||
|
||||
m.SendMessage("You fall asleep");
|
||||
|
||||
RemoveTimer(m);
|
||||
|
||||
TimeSpan duration = TimeSpan.FromSeconds(m_Caster.Skills[SkillName.Magery].Value * 1.2); // 120% of magery
|
||||
|
||||
Timer t = new BodyTimer(m, duration, m_Body);
|
||||
|
||||
m_Table[m] = t;
|
||||
|
||||
t.Start();
|
||||
}
|
||||
private static Hashtable m_Table = new Hashtable();
|
||||
|
||||
public static void RemoveTimer(Mobile m)
|
||||
{
|
||||
Timer t = (Timer)m_Table[m];
|
||||
|
||||
if (t != null)
|
||||
{
|
||||
t.Stop();
|
||||
m_Table.Remove(m);
|
||||
}
|
||||
}
|
||||
|
||||
private class BodyTimer : Timer
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
private SleepingBody m_Body;
|
||||
|
||||
public BodyTimer(Mobile m, TimeSpan duration, SleepingBody body)
|
||||
: base(duration)
|
||||
{
|
||||
m_Mobile = m;
|
||||
m_Body = body;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Mobile.RevealingAction();
|
||||
m_Mobile.Frozen = false;
|
||||
m_Mobile.Squelched = false;
|
||||
m_Mobile.Z = m_Body.Z;
|
||||
|
||||
if (m_Body != null)
|
||||
{
|
||||
m_Body.Delete();
|
||||
m_Mobile.SendMessage("You wake up!");
|
||||
}
|
||||
RemoveTimer(m_Mobile);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
if (Visible && m_Caster != null && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false))
|
||||
{
|
||||
|
||||
ApplySleepTo(m);
|
||||
m.PlaySound(0x474);
|
||||
}
|
||||
m.Hidden = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private InternalItem m_Item;
|
||||
private bool m_InLOS, m_CanFit;
|
||||
|
||||
private static Queue m_Queue = new Queue();
|
||||
|
||||
public InternalTimer(InternalItem item, TimeSpan delay, bool inLOS, bool canFit)
|
||||
: base(delay, TimeSpan.FromSeconds(1.5))
|
||||
{
|
||||
m_Item = item;
|
||||
m_InLOS = inLOS;
|
||||
m_CanFit = canFit;
|
||||
|
||||
Priority = TimerPriority.FiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (m_Item.Deleted)
|
||||
return;
|
||||
|
||||
if (!m_Item.Visible)
|
||||
{
|
||||
if (m_InLOS && m_CanFit)
|
||||
m_Item.Visible = true;
|
||||
else
|
||||
m_Item.Delete();
|
||||
|
||||
if (!m_Item.Deleted)
|
||||
{
|
||||
m_Item.ProcessDelta();
|
||||
Effects.SendLocationParticles(EffectItem.Create(m_Item.Location, m_Item.Map, EffectItem.DefaultDuration), 0x376A, 9, 10, 5040);
|
||||
}
|
||||
}
|
||||
else if (DateTime.Now > m_Item.m_End)
|
||||
{
|
||||
m_Item.Delete();
|
||||
Stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
Map map = m_Item.Map;
|
||||
Mobile caster = m_Item.m_Caster;
|
||||
|
||||
if (map != null && caster != null)
|
||||
{
|
||||
bool eastToWest = (m_Item.ItemID == 0x3915);
|
||||
IPooledEnumerable eable = map.GetMobilesInBounds(new Rectangle2D(m_Item.X - (eastToWest ? 0 : 1), m_Item.Y - (eastToWest ? 1 : 0), (eastToWest ? 1 : 2), (eastToWest ? 2 : 1))); ;
|
||||
|
||||
foreach (Mobile m in eable)
|
||||
{
|
||||
if ((m.Z + 16) > m_Item.Z && (m_Item.Z + 12) > m.Z && SpellHelper.ValidIndirectTarget(caster, m) && caster.CanBeHarmful(m, false))
|
||||
m_Queue.Enqueue(m);
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
|
||||
while (m_Queue.Count > 0)
|
||||
{
|
||||
Mobile m = (Mobile)m_Queue.Dequeue();
|
||||
|
||||
m.PlaySound(0x3C4);
|
||||
m_Item.ApplySleepTo(m);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientSleepFieldSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientSleepFieldSpell owner)
|
||||
: base(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientSleepSpell : AncientSpell
|
||||
{
|
||||
private SleepingBody m_Body;
|
||||
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Sleep", "In Zu",
|
||||
206,
|
||||
9002,
|
||||
Reagent.SpidersSilk,
|
||||
Reagent.BlackPearl,
|
||||
Reagent.Nightshade
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Third; }
|
||||
}
|
||||
|
||||
public AncientSleepSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public void Target(Mobile m)
|
||||
{
|
||||
if (!Caster.CanSee(m))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else
|
||||
{
|
||||
SpellHelper.Turn(Caster, m);
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
Effects.SendLocationParticles(EffectItem.Create(new Point3D(m.X, m.Y, m.Z + 16), Caster.Map, EffectItem.DefaultDuration), 0x376A, 10, 15, 5045);
|
||||
m.PlaySound(0x3C4);
|
||||
|
||||
m.Hidden = true;
|
||||
m.Frozen = true;
|
||||
m.Squelched = true;
|
||||
|
||||
ArrayList sleepequip = new ArrayList();
|
||||
|
||||
Item hat = m.FindItemOnLayer(Layer.Helm);
|
||||
if (hat != null)
|
||||
{
|
||||
sleepequip.Add(hat);
|
||||
}
|
||||
SleepingBody body = new SleepingBody(m, false);
|
||||
body.Map = m.Map;
|
||||
body.Location = m.Location;
|
||||
m_Body = body;
|
||||
m.Z -= 100;
|
||||
|
||||
m.SendMessage("You fall asleep");
|
||||
|
||||
RemoveTimer(m);
|
||||
|
||||
TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Magery].Value * 1.2); // 120% of magery
|
||||
|
||||
Timer t = new InternalTimer(m, duration, m_Body);
|
||||
|
||||
m_Table[m] = t;
|
||||
|
||||
t.Start();
|
||||
}
|
||||
}
|
||||
|
||||
private static Hashtable m_Table = new Hashtable();
|
||||
|
||||
public static void RemoveTimer(Mobile m)
|
||||
{
|
||||
Timer t = (Timer)m_Table[m];
|
||||
|
||||
if (t != null)
|
||||
{
|
||||
t.Stop();
|
||||
m_Table.Remove(m);
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
private Item m_Body;
|
||||
|
||||
public InternalTimer(Mobile m, TimeSpan duration, Item body)
|
||||
: base(duration)
|
||||
{
|
||||
m_Mobile = m;
|
||||
m_Body = body;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Mobile.RevealingAction();
|
||||
m_Mobile.Frozen = false;
|
||||
m_Mobile.Squelched = false;
|
||||
|
||||
if (m_Body != null)
|
||||
{
|
||||
m_Body.Delete();
|
||||
m_Mobile.SendMessage("You wake up!");
|
||||
m_Mobile.Z = m_Body.Z;
|
||||
m_Mobile.Animate(21, 6, 1, false, false, 0);
|
||||
}
|
||||
RemoveTimer(m_Mobile);
|
||||
}
|
||||
}
|
||||
|
||||
public class InternalTarget : Target
|
||||
{
|
||||
private AncientSleepSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientSleepSpell 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 OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientSwarmSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Swarm", "Kal Bet Xen",
|
||||
203,
|
||||
9051,
|
||||
Reagent.Nightshade,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.Bloodmoss
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Third; }
|
||||
}
|
||||
|
||||
public AncientSwarmSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
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))
|
||||
{
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
SpellHelper.Turn(Caster, m);
|
||||
|
||||
SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);
|
||||
|
||||
if (m.Spell != null)
|
||||
m.Spell.OnCasterHurt();
|
||||
|
||||
m.Paralyzed = false;
|
||||
|
||||
if (CheckResisted(m))
|
||||
{
|
||||
m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!m_Table.Contains(m))
|
||||
{
|
||||
Timer t = new InternalTimer(m, Caster);
|
||||
t.Start();
|
||||
|
||||
m_Table[m] = t;
|
||||
}
|
||||
|
||||
m.SendMessage("A swarm of insects surrounds you, and starts to sting you!");
|
||||
m.FixedParticles(0x91B, 1, 240, 9916, 1159, 3, EffectLayer.Head);
|
||||
m.PlaySound(0x230);
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
public virtual bool CheckResisted(Mobile target)
|
||||
{
|
||||
double n = GetResistPercent(target, Circle);
|
||||
|
||||
n /= 100.0;
|
||||
|
||||
if (n <= 0.0)
|
||||
return false;
|
||||
|
||||
if (n >= 1.0)
|
||||
return true;
|
||||
|
||||
int maxSkill = (1 + (int)Circle) * 10;
|
||||
maxSkill += (1 + ((int)Circle / 6)) * 25;
|
||||
|
||||
if (target.Skills[SkillName.MagicResist].Value < maxSkill)
|
||||
target.CheckSkill(SkillName.MagicResist, 0.0, 120.0);
|
||||
|
||||
return (n >= Utility.RandomDouble());
|
||||
}
|
||||
|
||||
public virtual double GetResistPercent(Mobile target, SpellCircle circle)
|
||||
{
|
||||
double firstPercent = target.Skills[SkillName.MagicResist].Value / 5.0;
|
||||
double secondPercent = target.Skills[SkillName.MagicResist].Value - (((Caster.Skills[CastSkill].Value - 20.0) / 5.0) + (1 + (int)circle) * 5.0);
|
||||
|
||||
return (firstPercent > secondPercent ? firstPercent : secondPercent) / 2.0; // Seems should be about half of what stratics says.
|
||||
}
|
||||
|
||||
private static Hashtable m_Table = new Hashtable();
|
||||
|
||||
public static void RemoveCurse(Mobile m)
|
||||
{
|
||||
Timer t = (Timer)m_Table[m];
|
||||
|
||||
if (t == null)
|
||||
return;
|
||||
|
||||
t.Stop();
|
||||
m.SendMessage("The swarm stop stinging.");
|
||||
|
||||
m_Table.Remove(m);
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_Target, m_From;
|
||||
private double m_MinBaseDamage, m_MaxBaseDamage;
|
||||
|
||||
private DateTime m_NextHit;
|
||||
private int m_HitDelay;
|
||||
|
||||
private int m_Count, m_MaxCount;
|
||||
|
||||
public InternalTimer(Mobile target, Mobile from)
|
||||
: base(TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(0.1))
|
||||
{
|
||||
Priority = TimerPriority.FiftyMS;
|
||||
|
||||
m_Target = target;
|
||||
m_From = from;
|
||||
|
||||
double timeLevel = from.Skills[SkillName.EvalInt].Value / 10;
|
||||
|
||||
m_MinBaseDamage = timeLevel - 2;
|
||||
m_MaxBaseDamage = timeLevel + 1;
|
||||
|
||||
m_HitDelay = 5;
|
||||
m_NextHit = DateTime.Now + TimeSpan.FromSeconds(m_HitDelay);
|
||||
|
||||
m_Count = (int)timeLevel;
|
||||
|
||||
if (m_Count < 4)
|
||||
m_Count = 4;
|
||||
|
||||
m_MaxCount = m_Count;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (!m_Target.Alive)
|
||||
{
|
||||
m_Table.Remove(m_Target);
|
||||
Stop();
|
||||
}
|
||||
|
||||
if (!m_Target.Alive || DateTime.Now < m_NextHit)
|
||||
return;
|
||||
|
||||
--m_Count;
|
||||
|
||||
if (m_HitDelay > 1)
|
||||
{
|
||||
m_Target.FixedParticles(0x91B, 1, 240, 9916, 1159, 3, EffectLayer.Head);
|
||||
m_Target.PlaySound(0x230);
|
||||
if (m_MaxCount < 5)
|
||||
{
|
||||
--m_HitDelay;
|
||||
}
|
||||
else
|
||||
{
|
||||
int delay = (int)(Math.Ceiling((1.0 + (5 * m_Count)) / m_MaxCount));
|
||||
|
||||
if (delay <= 5)
|
||||
m_HitDelay = delay;
|
||||
else
|
||||
m_HitDelay = 5;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_Count == 0)
|
||||
{
|
||||
m_Target.SendMessage("The swarm stop stinging.");
|
||||
m_Table.Remove(m_Target);
|
||||
Stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_NextHit = DateTime.Now + TimeSpan.FromSeconds(m_HitDelay);
|
||||
|
||||
double damage = m_MinBaseDamage + (Utility.RandomDouble() * (m_MaxBaseDamage - m_MinBaseDamage));
|
||||
|
||||
damage *= (3 - (((double)m_Target.Stam / m_Target.StamMax) * 2));
|
||||
|
||||
if (damage < 1)
|
||||
damage = 1;
|
||||
|
||||
if (!m_Target.Player)
|
||||
damage *= 1.75;
|
||||
|
||||
AOS.Damage(m_Target, m_From, (int)damage, 0, 0, 0, 100, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AncientSwarmSpell m_Owner;
|
||||
|
||||
public InternalTarget(AncientSwarmSpell owner)
|
||||
: base(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientThunderSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Thunder", "Vas Kal",
|
||||
236,
|
||||
9011,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.First; }
|
||||
}
|
||||
|
||||
public override double CastDelay { get { return 0.5; } }
|
||||
public override double RequiredSkill { get { return 0.0; } }
|
||||
public override int RequiredMana { get { return 2; } }
|
||||
|
||||
public AncientThunderSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
{
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 0: Caster.PlaySound(0x28); break;
|
||||
case 1: Caster.PlaySound(0x29); break;
|
||||
case 2: Caster.PlaySound(0x206); break;
|
||||
}
|
||||
|
||||
if (Caster.Skills[SkillName.Magery].Base >= 50)
|
||||
{
|
||||
foreach (Mobile ma in Caster.GetMobilesInRange(5))
|
||||
{
|
||||
BaseCreature m = ma as BaseCreature;
|
||||
if (m != null)
|
||||
{
|
||||
if (!m.Blessed && !m.Controlled && !m.Summoned && m.Alive && m.Int <= (Caster.Int + Caster.Str))
|
||||
{
|
||||
m.FocusMob = Caster;
|
||||
m.AIObject.DoActionFlee();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientTremorSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Tremor", "Vas Por Ylem",
|
||||
233,
|
||||
9012,
|
||||
false,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.MandrakeRoot,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Sixth; }
|
||||
}
|
||||
|
||||
public AncientTremorSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool DelayedDamage { get { return !Core.AOS; } }
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (SpellHelper.CheckTown(Caster, Caster) && CheckSequence())
|
||||
{
|
||||
ArrayList targets = new ArrayList();
|
||||
|
||||
Map map = Caster.Map;
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
foreach (Mobile m in Caster.GetMobilesInRange(1 + (int)(Caster.Skills[SkillName.Magery].Value / 15.0)))
|
||||
{
|
||||
if (Caster != m && m.AccessLevel == AccessLevel.Player && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false) && (!Core.AOS || Caster.InLOS(m)))
|
||||
targets.Add(m);
|
||||
}
|
||||
}
|
||||
|
||||
Caster.PlaySound(0x2F3);
|
||||
|
||||
for (int i = 0; i < targets.Count; ++i)
|
||||
{
|
||||
Mobile m = (Mobile)targets[i];
|
||||
|
||||
m.Stam = 0;
|
||||
m.Mana = 0;
|
||||
m.SendMessage("A powerful tremor in the ground makes you stumble and tremble!");
|
||||
int damage = (Utility.Random(10, 15));
|
||||
Caster.DoHarmful(m);
|
||||
SpellHelper.Damage(TimeSpan.Zero, m, Caster, damage, 100, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Ancient
|
||||
{
|
||||
public class AncientWeatherSpell : AncientSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Weather", "Rel Hur",
|
||||
236,
|
||||
9011,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.First; }
|
||||
}
|
||||
|
||||
public override double CastDelay { get { return 0.5; } }
|
||||
public override double RequiredSkill { get { return 0.0; } }
|
||||
public override int RequiredMana { get { return 7; } }
|
||||
|
||||
public AncientWeatherSpell(Mobile caster, Item scroll)
|
||||
: base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (CheckSequence())
|
||||
{
|
||||
if (this.Scroll != null)
|
||||
Scroll.Consume();
|
||||
|
||||
Timer t = (Timer)m_UnderEffect[Caster];
|
||||
|
||||
if (Caster != null && t == null)
|
||||
{
|
||||
TimeSpan duration = SpellHelper.GetDuration(Caster, Caster);
|
||||
m_UnderEffect[Caster] = t = Timer.DelayCall(duration, new TimerStateCallback(RemoveEffect), Caster);
|
||||
Caster.SendMessage("Clouds swirl and boil above your head!");
|
||||
Caster.FixedParticles(0xC4A, 10, 15, 5028, EffectLayer.Head);
|
||||
Caster.PlaySound(0x16);
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private static Hashtable m_UnderEffect = new Hashtable();
|
||||
|
||||
private static void RemoveEffect(object state)
|
||||
{
|
||||
Mobile m = (Mobile)state;
|
||||
|
||||
m_UnderEffect.Remove(m);
|
||||
|
||||
m.SendMessage("The magical weather fades away.");
|
||||
}
|
||||
|
||||
public static bool UnderEffect(Mobile m)
|
||||
{
|
||||
return m_UnderEffect.Contains(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Avatar
|
||||
{
|
||||
public class AvatarBag : ScrollBag
|
||||
{
|
||||
[Constructable]
|
||||
public AvatarBag()
|
||||
{
|
||||
Hue = 1174;
|
||||
PlaceItemIn( 30, 35, new AvatarHeavenlyLightScroll() );
|
||||
PlaceItemIn( 50, 35, new AvatarHeavensGateScroll() );
|
||||
PlaceItemIn( 70, 35, new AvatarMarkOfGodsScroll() );
|
||||
}
|
||||
|
||||
public AvatarBag( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Avatar
|
||||
{
|
||||
public class AvatarInitializer : BaseInitializer
|
||||
{
|
||||
public static void Configure()
|
||||
{
|
||||
Register( typeof( AvatarHeavensGateSpell ), "Heaven's Gate", "Allows the Paladin to open a heavenly portal to another location.", null, "Tithe: 30; Skill: 80; Mana: 40", 2258, 9300, School.Avatar );
|
||||
Register( typeof( AvatarMarkOfGodsSpell ), "Mark Of Gods", "Casts down a powerful bolt of lightning to mark a rune for the Palaidn", null, "Tithe: 10; Skill: 20; Mana: 10", 2269, 9300, School.Avatar );
|
||||
Register( typeof( AvatarHeavenlyLightSpell ), "Heavenly Light", "Heaven lights the Paladin's way.", null, "Tithe: 10; Skill: 20; Mana: 10", 2245, 9300, School.Avatar );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Spells;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Avatar
|
||||
{
|
||||
public abstract class AvatarSpell : CSpell
|
||||
{
|
||||
public override SkillName CastSkill { get { return SkillName.Chivalry; } }
|
||||
public override SkillName DamageSkill { get { return SkillName.Focus; } }
|
||||
|
||||
public abstract SpellCircle Circle { get; }
|
||||
|
||||
public override bool ClearHandsOnCast { get { return false; } }
|
||||
|
||||
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds(3 * CastDelaySecondsPerTick); } }
|
||||
|
||||
public override int CastRecoveryBase { get { return 7; } }
|
||||
public override int CastRecoveryFastScalar { get { return 1; } }
|
||||
public override int CastRecoveryPerSecond { get { return 4; } }
|
||||
public override int CastRecoveryMinimum { get { return 0; } }
|
||||
|
||||
public AvatarSpell(Mobile caster, Item scroll, SpellInfo info)
|
||||
: base(caster, scroll, info)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
if (!base.CheckCast())
|
||||
return false;
|
||||
|
||||
if (Caster.Skills[SkillName.Chivalry].Value < RequiredSkill)
|
||||
{
|
||||
Caster.SendLocalizedMessage(1060172, RequiredSkill.ToString("F1")); // You must have at least ~1_SKILL_REQUIREMENT~ Chivalry to use this ability,
|
||||
return false;
|
||||
}
|
||||
else 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;
|
||||
}
|
||||
else if (Caster.Mana < ScaleMana(RequiredMana))
|
||||
{
|
||||
Caster.SendLocalizedMessage(1060174, RequiredMana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckFizzle()
|
||||
{
|
||||
int requiredTithing = this.RequiredTithing;
|
||||
|
||||
if (AosAttributes.GetValue(Caster, AosAttribute.LowerRegCost) > Utility.Random(100))
|
||||
requiredTithing = 0;
|
||||
|
||||
int mana = ScaleMana(RequiredMana);
|
||||
|
||||
if (Caster.Skills[SkillName.Chivalry].Value < RequiredSkill)
|
||||
{
|
||||
Caster.SendLocalizedMessage(1060172, RequiredSkill.ToString("F1")); // You must have at least ~1_SKILL_REQUIREMENT~ Chivalry to use this ability,
|
||||
return false;
|
||||
}
|
||||
else 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;
|
||||
}
|
||||
else if (Caster.Mana < mana)
|
||||
{
|
||||
Caster.SendLocalizedMessage(1060174, RequiredMana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
|
||||
return false;
|
||||
}
|
||||
|
||||
Caster.TithingPoints -= requiredTithing;
|
||||
|
||||
if (!base.CheckFizzle())
|
||||
return false;
|
||||
|
||||
Caster.Mana -= mana;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void DoFizzle()
|
||||
{
|
||||
Caster.PlaySound(0x1D6);
|
||||
Caster.NextSpellTime = Core.TickCount;
|
||||
}
|
||||
|
||||
public override void DoHurtFizzle()
|
||||
{
|
||||
Caster.PlaySound(0x1D6);
|
||||
}
|
||||
|
||||
public override void OnDisturb(DisturbType type, bool message)
|
||||
{
|
||||
base.OnDisturb(type, message);
|
||||
|
||||
if (message)
|
||||
Caster.PlaySound(0x1D6);
|
||||
}
|
||||
|
||||
public override void OnBeginCast()
|
||||
{
|
||||
base.OnBeginCast();
|
||||
|
||||
SendCastEffect();
|
||||
}
|
||||
|
||||
public virtual void SendCastEffect()
|
||||
{
|
||||
Caster.FixedEffect(0x37C4, 10, 42, 4, 3);
|
||||
}
|
||||
|
||||
public override void GetCastSkills(out double min, out double max)
|
||||
{
|
||||
min = RequiredSkill;
|
||||
max = RequiredSkill + 50.0;
|
||||
}
|
||||
|
||||
public override int GetMana()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int ComputePowerValue(int div)
|
||||
{
|
||||
return ComputePowerValue(Caster, div);
|
||||
}
|
||||
|
||||
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));
|
||||
|
||||
return v / div;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Avatar
|
||||
{
|
||||
public class AvatarSpellbook : CSpellbook
|
||||
{
|
||||
public override School School{ get{ return School.Avatar; } }
|
||||
|
||||
[Constructable]
|
||||
public AvatarSpellbook() : this( (ulong)0, CSSettings.FullSpellbooks )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AvatarSpellbook( bool full ) : this( (ulong)0, full )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AvatarSpellbook( ulong content, bool full ) : base( content, 0xEFA, full )
|
||||
{
|
||||
Hue = 1174;
|
||||
Name = "Avatar Spell Book";
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( from.AccessLevel == AccessLevel.Player )
|
||||
{
|
||||
Container pack = from.Backpack;
|
||||
if( !(Parent == from || (pack != null && Parent == pack)) )
|
||||
{
|
||||
from.SendMessage( "The spellbook must be in your backpack [and not in a container within] to open." );
|
||||
return;
|
||||
}
|
||||
else if( SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions( from, this.School ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
from.CloseGump( typeof( AvatarSpellbookGump ) );
|
||||
from.SendGump( new AvatarSpellbookGump( this ) );
|
||||
}
|
||||
|
||||
public AvatarSpellbook( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Avatar
|
||||
{
|
||||
public class AvatarSpellbookGump : CSpellbookGump
|
||||
{
|
||||
public override string TextHue { get{ return "CC3333"; } }
|
||||
public override int BGImage { get{ return 2203; } }
|
||||
public override int SpellBtn { get{ return 2362; } }
|
||||
public override int SpellBtnP{ get{ return 2361; } }
|
||||
public override string Label1 { get{ return "Avatar"; } }
|
||||
public override string Label2 { get{ return "Spells"; } }
|
||||
public override Type GumpType { get{ return typeof( AvatarSpellbookGump ); } }
|
||||
|
||||
public AvatarSpellbookGump( CSpellbook book ) : base( book )
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Avatar
|
||||
{
|
||||
public class AvatarHeavenlyLightScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AvatarHeavenlyLightScroll() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AvatarHeavenlyLightScroll( int amount ) : base( typeof( AvatarHeavenlyLightSpell ), 0xE39, amount )
|
||||
{
|
||||
Name = "Heavenly Light";
|
||||
Hue = 1174;
|
||||
}
|
||||
|
||||
public AvatarHeavenlyLightScroll( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Avatar
|
||||
{
|
||||
public class AvatarHeavensGateScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AvatarHeavensGateScroll() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AvatarHeavensGateScroll( int amount ) : base( typeof( AvatarHeavensGateSpell ), 0xE39, amount )
|
||||
{
|
||||
Name = "Heaven's Gate";
|
||||
Hue = 1174;
|
||||
}
|
||||
|
||||
public AvatarHeavensGateScroll( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Avatar
|
||||
{
|
||||
public class AvatarMarkOfGodsScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AvatarMarkOfGodsScroll() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AvatarMarkOfGodsScroll( int amount ) : base( typeof( AvatarMarkOfGodsSpell ), 0xE39, amount )
|
||||
{
|
||||
Name = "Mark of Gods";
|
||||
Hue = 1174;
|
||||
}
|
||||
|
||||
public AvatarMarkOfGodsScroll( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Avatar
|
||||
{
|
||||
public class AvatarHeavenlyLightSpell : AvatarSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Heavenly Light", "He Ven In Lor",
|
||||
// SpellCircle.First,
|
||||
236,
|
||||
9031,
|
||||
Reagent.BatWing,
|
||||
Reagent.NoxCrystal
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.First; }
|
||||
}
|
||||
|
||||
public override double RequiredSkill{ get{ return 20; } }
|
||||
public override int RequiredMana{ get{ return 10; } }
|
||||
public override int RequiredTithing{ get{ return 10; } }
|
||||
|
||||
public AvatarHeavenlyLightSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new AvatarHeavenlyLightSpellTarget( this );
|
||||
}
|
||||
|
||||
private class AvatarHeavenlyLightSpellTarget : Target
|
||||
{
|
||||
private Spell m_Spell;
|
||||
|
||||
public AvatarHeavenlyLightSpellTarget( Spell spell ) : base( 10, false, TargetFlags.None )
|
||||
{
|
||||
m_Spell = spell;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( targeted is Mobile && m_Spell.CheckSequence() )
|
||||
{
|
||||
Mobile targ = (Mobile)targeted;
|
||||
|
||||
SpellHelper.Turn( m_Spell.Caster, targ );
|
||||
|
||||
if ( targ.BeginAction( typeof( LightCycle ) ) )
|
||||
{
|
||||
new LightCycle.NightSightTimer( targ ).Start();
|
||||
int level = (int)Math.Abs( LightCycle.DungeonLevel * ( m_Spell.Caster.Skills[SkillName.Necromancy].Base / 100 ) );
|
||||
|
||||
if ( level > 25 || level < 0 )
|
||||
level = 25;
|
||||
|
||||
targ.LightLevel = level;
|
||||
|
||||
targ.FixedParticles( 0x376A, 9, 32, 5007, EffectLayer.Waist );
|
||||
targ.PlaySound( 0x1E3 );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "{0} already have heavenly light.", from == targ ? "You" : "They" );
|
||||
}
|
||||
}
|
||||
|
||||
m_Spell.FinishSequence();
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
m_Spell.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
using System;
|
||||
using Server.Network;
|
||||
using Server.Multis;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.Misc;
|
||||
using Server.Regions;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Avatar
|
||||
{
|
||||
public class AvatarHeavensGateSpell : AvatarSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Heaven's Gate", "Hevs Grav Ohm Sepa",
|
||||
//SpellCircle.Fifth,
|
||||
-1,
|
||||
9002
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Fifth; }
|
||||
}
|
||||
|
||||
|
||||
public override double RequiredSkill{ get{ return 80.0; } }
|
||||
public override int RequiredMana{ get{ return 40; } }
|
||||
public override int RequiredTithing{ get{ return 30; } }
|
||||
|
||||
private RunebookEntry m_Entry;
|
||||
|
||||
public AvatarHeavensGateSpell( Mobile caster, Item scroll ) : this( caster, scroll, null )
|
||||
{
|
||||
}
|
||||
|
||||
public AvatarHeavensGateSpell( Mobile caster, Item scroll, RunebookEntry entry ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
m_Entry = entry;
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
if ( m_Entry == null )
|
||||
Caster.Target = new InternalTarget( this );
|
||||
else
|
||||
Effect( m_Entry.Location, m_Entry.Map, true );
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
if ( Caster.Criminal )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
|
||||
return false;
|
||||
}
|
||||
else if ( SpellHelper.CheckCombat( Caster ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
|
||||
return false;
|
||||
}
|
||||
|
||||
return SpellHelper.CheckTravel( Caster, TravelCheckType.GateFrom );
|
||||
}
|
||||
|
||||
public void Effect( Point3D loc, Map map, bool checkMulti )
|
||||
{
|
||||
if ( map == null || (!Core.AOS && Caster.Map != map) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1005570 ); // You can not gate to another facet.
|
||||
}
|
||||
else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.GateFrom ) )
|
||||
{
|
||||
}
|
||||
else if ( !SpellHelper.CheckTravel( Caster, map, loc, TravelCheckType.GateTo ) )
|
||||
{
|
||||
}
|
||||
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( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
|
||||
}
|
||||
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 ( CheckSequence() )
|
||||
{
|
||||
Caster.SendMessage( "The clouds open a magical gate to another place" ); // You open a magical gate to another location
|
||||
|
||||
Effects.PlaySound( Caster.Location, Caster.Map, 0x482 );
|
||||
int gravx;
|
||||
int gravy;
|
||||
int gravz;
|
||||
|
||||
|
||||
InternalItem firstGatea = new InternalItem( loc, map ); //Top Middle item
|
||||
gravx=Caster.X-1;
|
||||
gravy=Caster.Y-1;
|
||||
gravz=Caster.Z;
|
||||
firstGatea.ItemID=14138;
|
||||
firstGatea.Hue = 1174;
|
||||
Point3D gravxyz = new Point3D(gravx,gravy,gravz);
|
||||
firstGatea.MoveToWorld( gravxyz, Caster.Map );
|
||||
InternalItem firstGateb = new InternalItem( loc, map );
|
||||
gravx=Caster.X;
|
||||
gravy=Caster.Y;
|
||||
firstGateb.ItemID=6899; //Moongate
|
||||
firstGateb.Hue=1153;
|
||||
gravz=Caster.Z;
|
||||
Point3D gravxyza = new Point3D(gravx,gravy,gravz);
|
||||
firstGateb.MoveToWorld( gravxyza, Caster.Map );
|
||||
InternalItem firstGatec = new InternalItem( loc, map );
|
||||
gravx=Caster.X-1;
|
||||
firstGatec.ItemID=14138;
|
||||
firstGatec.Hue = 1174;
|
||||
gravy=Caster.Y+1;
|
||||
gravz=Caster.Z;
|
||||
Point3D gravxyzb = new Point3D(gravx,gravy,gravz);
|
||||
firstGatec.MoveToWorld( gravxyzb, Caster.Map );
|
||||
InternalItem firstGateg = new InternalItem( loc, map );
|
||||
gravx=Caster.X+1;
|
||||
firstGateg.ItemID=14138;
|
||||
firstGateg.Hue = 1174;
|
||||
gravy=Caster.Y-1;
|
||||
gravz=Caster.Z;
|
||||
Point3D gravxyzf = new Point3D(gravx,gravy,gravz);
|
||||
firstGateg.MoveToWorld( gravxyzf, Caster.Map );
|
||||
InternalItem firstGatee = new InternalItem( loc, map );
|
||||
gravx=Caster.X+1;
|
||||
firstGatee.ItemID=14170;
|
||||
firstGatee.Hue = 1174;
|
||||
gravy=Caster.Y+1;
|
||||
gravz=Caster.Z;
|
||||
Point3D gravxyzd = new Point3D(gravx,gravy,gravz);
|
||||
firstGatee.MoveToWorld( gravxyzd, Caster.Map );
|
||||
|
||||
//Effects.PlaySound( loc, map, 0x482 );
|
||||
Caster.PlaySound( 0x212 );
|
||||
Caster.PlaySound( 0x206 );
|
||||
|
||||
InternalItem secondGatea = new InternalItem( Caster.Location, Caster.Map );
|
||||
gravx=loc.X-1;
|
||||
gravy=loc.Y-1;
|
||||
gravz=loc.Z;
|
||||
secondGatea.ItemID=14138;
|
||||
secondGatea.Hue = 1151;
|
||||
Point3D gravaxyz = new Point3D(gravx,gravy,gravz);
|
||||
secondGatea.MoveToWorld( gravaxyz, map);
|
||||
InternalItem secondGateb = new InternalItem( Caster.Location, Caster.Map );
|
||||
gravx=loc.X;
|
||||
gravy=loc.Y;
|
||||
secondGateb.ItemID=6899; //Moongate
|
||||
secondGateb.Hue = 1153;
|
||||
gravz=loc.Z;
|
||||
Point3D gravaxyza = new Point3D(gravx,gravy,gravz);
|
||||
secondGateb.MoveToWorld( gravaxyza, map);
|
||||
InternalItem secondGatec = new InternalItem( Caster.Location, Caster.Map );
|
||||
gravx=loc.X-1;
|
||||
secondGatec.ItemID=14138;
|
||||
secondGatec.Hue = 1151;
|
||||
gravy=loc.Y+1;
|
||||
gravz=loc.Z;
|
||||
Point3D gravaxyzb = new Point3D(gravx,gravy,gravz);
|
||||
secondGatec.MoveToWorld( gravaxyzb, map);
|
||||
InternalItem secondGatee = new InternalItem( Caster.Location, Caster.Map );
|
||||
gravx=loc.X+1;
|
||||
gravy=loc.Y+1;
|
||||
gravz=loc.Z;
|
||||
secondGatee.ItemID=14138;
|
||||
secondGatee.Hue = 1151;
|
||||
Point3D gravaxyzd = new Point3D(gravx,gravy,gravz);
|
||||
secondGatee.MoveToWorld( gravaxyzd, map);
|
||||
InternalItem secondGateg = new InternalItem( Caster.Location, Caster.Map );
|
||||
gravx=loc.X+1;
|
||||
secondGateg.ItemID=14138;
|
||||
secondGateg.Hue = 1151;
|
||||
gravy=loc.Y-1;
|
||||
gravz=loc.Z;
|
||||
Point3D gravaxyzf = new Point3D(gravx,gravy,gravz);
|
||||
secondGateg.MoveToWorld( gravaxyzf, map);
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
[DispellableField]
|
||||
private class InternalItem : Moongate
|
||||
{
|
||||
public override bool ShowFeluccaWarning{ get{ return Core.AOS; } }
|
||||
|
||||
public InternalItem( Point3D target, Map map ) : base( target, map )
|
||||
{
|
||||
Map = map;
|
||||
|
||||
if ( ShowFeluccaWarning && map == Map.Felucca )
|
||||
ItemID = 0xDDA;
|
||||
|
||||
Dispellable = true;
|
||||
|
||||
InternalTimer t = new InternalTimer( this );
|
||||
t.Start();
|
||||
}
|
||||
|
||||
public InternalItem( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
Delete();
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Item m_Item;
|
||||
|
||||
public InternalTimer( Item item ) : base( TimeSpan.FromSeconds( 30.0 ) )
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Item.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AvatarHeavensGateSpell m_Owner;
|
||||
|
||||
public InternalTarget( AvatarHeavensGateSpell owner ) : base( 12, false, TargetFlags.None )
|
||||
{
|
||||
m_Owner = owner;
|
||||
|
||||
owner.Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501029 ); // Select Marked item.
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
if ( o is RecallRune )
|
||||
{
|
||||
RecallRune rune = (RecallRune)o;
|
||||
|
||||
if ( rune.Marked )
|
||||
m_Owner.Effect( rune.Target, rune.TargetMap, true );
|
||||
else
|
||||
from.SendLocalizedMessage( 501803 ); // That rune is not yet marked.
|
||||
}
|
||||
else if ( o is Runebook )
|
||||
{
|
||||
RunebookEntry e = ((Runebook)o).Default;
|
||||
|
||||
if ( e != null )
|
||||
m_Owner.Effect( e.Location, e.Map, true );
|
||||
else
|
||||
from.SendLocalizedMessage( 502354 ); // Target is not marked.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.Send( new MessageLocalized( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 501030, from.Name, "" ) ); // I can not gate travel from that object.
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Regions;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Avatar
|
||||
{
|
||||
public class AvatarMarkOfGodsSpell : AvatarSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Mark Of Gods", "Britemus Por Ylemis",
|
||||
//SpellCircle.Fifth,
|
||||
-1,
|
||||
9002
|
||||
);
|
||||
|
||||
public override SpellCircle Circle
|
||||
{
|
||||
get { return SpellCircle.Fifth; }
|
||||
}
|
||||
|
||||
public override double RequiredSkill{ get{ return 20; } }
|
||||
public override int RequiredMana{ get{ return 10; } }
|
||||
public override int RequiredTithing{ get{ return 10; } }
|
||||
|
||||
public AvatarMarkOfGodsSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
|
||||
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 )
|
||||
{
|
||||
if ( !Caster.CanSee( rune ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
|
||||
}
|
||||
else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.Mark ) )
|
||||
{
|
||||
}
|
||||
else if ( SpellHelper.CheckMulti( Caster.Location, Caster.Map, !Core.AOS ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
|
||||
}
|
||||
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.FixedParticles( 0x376A, 9, 32, 0x13AF, EffectLayer.Waist );
|
||||
Caster.PlaySound( 0x1FA );
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private AvatarMarkOfGodsSpell m_Owner;
|
||||
|
||||
public InternalTarget( AvatarMarkOfGodsSpell owner ) : base( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Bard
|
||||
{
|
||||
public class BardBag : ScrollBag
|
||||
{
|
||||
[Constructable]
|
||||
public BardBag()
|
||||
{
|
||||
Hue = 0x96;
|
||||
PlaceItemIn( 30, 35, new BardArmysPaeonScroll() );
|
||||
PlaceItemIn( 50, 35, new BardEnchantingEtudeScroll() );
|
||||
PlaceItemIn( 70, 35, new BardEnergyCarolScroll() );
|
||||
PlaceItemIn( 90, 35, new BardEnergyThrenodyScroll() );
|
||||
PlaceItemIn( 30, 55, new BardFireCarolScroll() );
|
||||
PlaceItemIn( 50, 55, new BardFireThrenodyScroll() );
|
||||
PlaceItemIn( 70, 55, new BardFoeRequiemScroll() );
|
||||
PlaceItemIn( 90, 55, new BardIceCarolScroll() );
|
||||
PlaceItemIn( 30, 75, new BardIceThrenodyScroll() );
|
||||
PlaceItemIn( 50, 75, new BardKnightsMinneScroll() );
|
||||
PlaceItemIn( 70, 75, new BardMagesBalladScroll() );
|
||||
PlaceItemIn( 90, 75, new BardMagicFinaleScroll() );
|
||||
PlaceItemIn( 30, 95, new BardPoisonCarolScroll() );
|
||||
PlaceItemIn( 50, 95, new BardPoisonThrenodyScroll() );
|
||||
PlaceItemIn( 70, 95, new BardSheepfoeMamboScroll() );
|
||||
PlaceItemIn( 90, 95, new BardSinewyEtudeScroll() );
|
||||
}
|
||||
|
||||
public BardBag( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Bard
|
||||
{
|
||||
public class BardInitializer : BaseInitializer
|
||||
{
|
||||
public static void Configure()
|
||||
{
|
||||
Register( typeof( BardArmysPaeonSpell ), "Army's Paeon", "Regenerates your partys health slowly. [Area Effect]", null, "Mana: 15; Skill: 60", 2243, 3000, School.Bard );
|
||||
Register( typeof( BardEnchantingEtudeSpell ), "Enchanting Etude", "Raises the intelligence of your party. [Area Effect]", null, "Mana: 12; Skill: 70", 2242, 3000, School.Bard );
|
||||
Register( typeof( BardEnergyCarolSpell ), "Energy Carol", "Raises the energy resistance of your party. [Area Effect]", null, "Mana: 12; Skill: 30", 2289, 3000, School.Bard );
|
||||
Register( typeof( BardEnergyThrenodySpell ), "Energy Threnody", "Lowers the energy resistance of your target.", null, "Mana: 7; Skill: 35", 2281, 3000, School.Bard );
|
||||
Register( typeof( BardFireCarolSpell ), "Fire Carol", "Raises the fire resistance of your party. [Area Effect]", null, "Mana: 12; Skill: 30", 2267, 3000, School.Bard );
|
||||
Register( typeof( BardFireThrenodySpell ), "Fire Threnody", "Lowers the fire resistance of your target.", null, "Mana: 7; Skill: 35", 2257, 3000, School.Bard );
|
||||
Register( typeof( BardFoeRequiemSpell ), "Foe Requiem", "Damages your target with a burst of sonic energy.", null, "Mana: 18; Skill: 55", 2270, 3000, School.Bard );
|
||||
Register( typeof( BardIceCarolSpell ), "Ice Carol", "Raises the cold resistance of your party. [Area Effect]", null, "Mana: 12; Skill: 30", 2286, 3000, School.Bard );
|
||||
Register( typeof( BardIceThrenodySpell ), "Ice Threnody", "Lowers the ice resistance of your target.", null, "Mana: 7; Skill: 35", 2269, 3000, School.Bard );
|
||||
Register( typeof( BardKnightsMinneSpell ), "Knight's Minne", "Raises the physical resist of your party. [Area Effect]", null, "Mana: 12; Skill: 45", 2273, 3000, School.Bard );
|
||||
Register( typeof( BardMagesBalladSpell ), "Mage's Ballad", "Regenerates your party's mana slowly. [Area Effect]", null, "Mana: 15; Skill: 65", 2292, 3000, School.Bard );
|
||||
Register( typeof( BardMagicFinaleSpell ), "Magic Finale", "Dispels all summoned creatures around you. [Area Effect]", null, "Mana: 15; Skill: 80", 2280, 3000, School.Bard );
|
||||
Register( typeof( BardPoisonCarolSpell ), "Poison Carol", "Raises the poison resistance of your party. [Area Effect]", null, "Mana: 12; Skill: 30", 2285, 3000, School.Bard );
|
||||
Register( typeof( BardPoisonThrenodySpell ), "Poison Threnody", "Lowers the poison resistance of your target.", null, "Mana: 7; Skill: 35", 20488, 3000, School.Bard );
|
||||
Register( typeof( BardSheepfoeMamboSpell ), "Sheepfoe Mambo", "Raises the dexterity of your party. [Area Effect]", null, "Mana: 12; Skill: 70", 2248, 3000, School.Bard );
|
||||
Register( typeof( BardSinewyEtudeSpell ), "Sinewy Etude", "Raises the strength of your party. [Area Effect]", null, "Mana: 12; Skill: 70", 20741, 3000, School.Bard );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Bard
|
||||
{
|
||||
public abstract class BardSpell : CSpell
|
||||
{
|
||||
public abstract SpellCircle Circle { get; }
|
||||
|
||||
public BardSpell(Mobile caster, Item scroll, SpellInfo info)
|
||||
: base(caster, scroll, info)
|
||||
{
|
||||
}
|
||||
|
||||
public override SkillName CastSkill { get { return SkillName.Musicianship; } }
|
||||
public override SkillName DamageSkill { get { return SkillName.Musicianship; } }
|
||||
public override bool ClearHandsOnCast { get { return false; } }
|
||||
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds(3 * CastDelaySecondsPerTick); } }
|
||||
public override void GetCastSkills(out double min, out double max)
|
||||
{
|
||||
min = RequiredSkill;
|
||||
max = RequiredSkill + 30.0;
|
||||
}
|
||||
|
||||
public override int GetMana()
|
||||
{
|
||||
return RequiredMana;
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
Container pack = Caster.Backpack;
|
||||
|
||||
BaseInstrument ints = (BaseInstrument)pack.FindItemByType(typeof(BaseInstrument));
|
||||
|
||||
if (ints == null)
|
||||
{
|
||||
Caster.SendMessage("Need instrument in pack to play this.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ints.UsesRemaining >= 2)
|
||||
ints.UsesRemaining -= 1;
|
||||
|
||||
if (ints.UsesRemaining == 1)
|
||||
ints.Delete();
|
||||
|
||||
Caster.PlaySound(ints.SuccessSound);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override TimeSpan GetCastDelay()
|
||||
{
|
||||
return TimeSpan.FromSeconds(CastDelay);
|
||||
}
|
||||
|
||||
public virtual bool CheckResisted(Mobile target)
|
||||
{
|
||||
double n = GetResistPercent(target);
|
||||
|
||||
n /= 100.0;
|
||||
|
||||
if (n <= 0.0)
|
||||
return false;
|
||||
|
||||
if (n >= 1.0)
|
||||
return true;
|
||||
|
||||
int maxSkill = (1 + (int)Circle) * 10;
|
||||
//int maxSkill = 40;
|
||||
maxSkill += (1 + ((int)Circle / 6)) * 25;
|
||||
//maxSkill += (1 + (4 / 6)) * 25;
|
||||
|
||||
if (target.Skills[SkillName.MagicResist].Value < maxSkill)
|
||||
target.CheckSkill(SkillName.MagicResist, 0.0, 120.0);
|
||||
|
||||
return (n >= Utility.RandomDouble());
|
||||
}
|
||||
|
||||
public virtual double GetResistPercent(Mobile target)
|
||||
{
|
||||
return GetResistPercentForCircle(target, Circle);
|
||||
//return GetResistPercentForCircle(target, SpellCircle.Fourth);
|
||||
}
|
||||
|
||||
public virtual double GetResistPercentForCircle(Mobile target, SpellCircle circle)
|
||||
{
|
||||
double firstPercent = target.Skills[SkillName.MagicResist].Value / 5.0;
|
||||
double secondPercent = target.Skills[SkillName.MagicResist].Value - (((Caster.Skills[CastSkill].Value - 20.0) / 5.0) + (1 + (int)circle) * 5.0);
|
||||
|
||||
return (firstPercent > secondPercent ? firstPercent : secondPercent) / 2.0; // Seems should be about half of what stratics says.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Bard
|
||||
{
|
||||
public class BardSpellbook : CSpellbook
|
||||
{
|
||||
public override School School{ get{ return School.Bard; } }
|
||||
|
||||
[Constructable]
|
||||
public BardSpellbook() : this( (ulong)0, CSSettings.FullSpellbooks )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BardSpellbook( bool full ) : this( (ulong)0, full )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BardSpellbook( ulong content, bool full ) : base( content, 0xEFA, full )
|
||||
{
|
||||
Name = "Song Book";
|
||||
Hue = 0x96;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( from.AccessLevel == AccessLevel.Player )
|
||||
{
|
||||
Container pack = from.Backpack;
|
||||
if( !(Parent == from || (pack != null && Parent == pack)) )
|
||||
{
|
||||
from.SendMessage( "The spellbook must be in your backpack [and not in a container within] to open." );
|
||||
return;
|
||||
}
|
||||
else if( SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions( from, this.School ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
from.CloseGump( typeof( BardSpellbookGump ) );
|
||||
from.SendGump( new BardSpellbookGump( this ) );
|
||||
}
|
||||
|
||||
public BardSpellbook( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Bard
|
||||
{
|
||||
public class BardSpellbookGump : CSpellbookGump
|
||||
{
|
||||
public override string TextHue { get{ return "CC3333"; } }
|
||||
public override int BGImage { get{ return 2203; } }
|
||||
public override int SpellBtn { get{ return 2362; } }
|
||||
public override int SpellBtnP{ get{ return 2361; } }
|
||||
public override string Label1 { get{ return "Bard"; } }
|
||||
public override string Label2 { get{ return "Songs"; } }
|
||||
public override Type GumpType { get{ return typeof( BardSpellbookGump ); } }
|
||||
|
||||
public BardSpellbookGump( CSpellbook book ) : base( book )
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Bard
|
||||
{
|
||||
public class BardArmysPaeonScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public BardArmysPaeonScroll() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BardArmysPaeonScroll( int amount ) : base( typeof( BardArmysPaeonSpell ), 0x14ED, amount )
|
||||
{
|
||||
Name = "Armys Paeon Sheet Music";
|
||||
Hue = 0x96;
|
||||
}
|
||||
|
||||
public BardArmysPaeonScroll( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Bard
|
||||
{
|
||||
public class BardEnchantingEtudeScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public BardEnchantingEtudeScroll() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BardEnchantingEtudeScroll( int amount ) : base( typeof( BardEnchantingEtudeSpell ), 0x14ED, amount )
|
||||
{
|
||||
Name = "Enchanting Etude Sheet Music";
|
||||
Hue = 0x96;
|
||||
}
|
||||
|
||||
public BardEnchantingEtudeScroll( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Bard
|
||||
{
|
||||
public class BardEnergyCarolScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public BardEnergyCarolScroll() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BardEnergyCarolScroll( int amount ) : base( typeof( BardEnergyCarolSpell ), 0x14ED, amount )
|
||||
{
|
||||
Name = "Energy Carol Sheet Music";
|
||||
Hue = 0x96;
|
||||
}
|
||||
|
||||
public BardEnergyCarolScroll( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS.Systems.Bard
|
||||
{
|
||||
public class BardEnergyThrenodyScroll : CSpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public BardEnergyThrenodyScroll() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BardEnergyThrenodyScroll( int amount ) : base( typeof( BardEnergyThrenodySpell ), 0x14ED, amount )
|
||||
{
|
||||
Name = "Energy Threnody Sheet Music";
|
||||
Hue = 0x96;
|
||||
}
|
||||
|
||||
public BardEnergyThrenodyScroll( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user