Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.ACC.CSS
|
||||
{
|
||||
public abstract class BaseInitializer
|
||||
{
|
||||
public static void Register( Type type, string name, string desc, string regs, string info, int icon, int back, School flag )
|
||||
{
|
||||
SpellInfoRegistry.Register( type, name, desc, regs, info, icon, back, flag );
|
||||
}
|
||||
}
|
||||
}
|
||||
277
Scripts/SubSystem/ACC/Complete Spell System/-=+ 01 Core/CSS.cs
Normal file
277
Scripts/SubSystem/ACC/Complete Spell System/-=+ 01 Core/CSS.cs
Normal file
@@ -0,0 +1,277 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using Server.Commands;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Spells;
|
||||
using Server.ACC.CSS.Modules;
|
||||
using Server.ACC.CM;
|
||||
|
||||
namespace Server.ACC.CSS
|
||||
{
|
||||
public class CSS : ACCSystem
|
||||
{
|
||||
private static int Version = 100;
|
||||
private static int PrevVersion;
|
||||
|
||||
public override string Name() { return "Complete Spell System"; }
|
||||
|
||||
private static Hashtable m_Loaded = new Hashtable();
|
||||
|
||||
public static void Configure()
|
||||
{
|
||||
ACC.RegisterSystem("Server.ACC.CSS.CSS");
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("cast", AccessLevel.Player, new CommandEventHandler(CSSCast_OnCommand));
|
||||
}
|
||||
|
||||
[Usage("Cast <text>")]
|
||||
[Description("Casts the spell assigned to the given text. Great for macros or easyuo scripts.")]
|
||||
private static void CSSCast_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
if (e.Length == 1)
|
||||
{
|
||||
if (!CentralMemory.Running || !CSS.Running)
|
||||
{
|
||||
e.Mobile.SendMessage("The Central Memory is not running. This command is disabled.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Multis.DesignContext.Check(e.Mobile))
|
||||
{
|
||||
e.Mobile.SendMessage("You cannot cast while customizing!");
|
||||
return;
|
||||
}
|
||||
|
||||
CastCommandsModule module = (CastCommandsModule)CentralMemory.GetModule(e.Mobile.Serial, typeof(CastCommandsModule));
|
||||
if (module == null)
|
||||
{
|
||||
e.Mobile.SendMessage("You do not have any commands to cast stored.");
|
||||
return;
|
||||
}
|
||||
|
||||
CastInfo info = module.Get(e.GetString(0));
|
||||
if (info == null)
|
||||
{
|
||||
e.Mobile.SendMessage("You have not assigned that command to any spells.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions(e.Mobile, info.SpellType))
|
||||
{
|
||||
e.Mobile.SendMessage("You are not allowed to cast this spell.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CSpellbook.MobileHasSpell(e.Mobile, info.School, info.SpellType))
|
||||
{
|
||||
e.Mobile.SendMessage("You do not have this spell.");
|
||||
return;
|
||||
}
|
||||
|
||||
Spell spell = SpellInfoRegistry.NewSpell(info.SpellType, info.School, e.Mobile, null);
|
||||
if (spell != null)
|
||||
spell.Cast();
|
||||
else
|
||||
e.Mobile.SendMessage("This spell has been disabled.");
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SendMessage("Format: Cast <text>");
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Running
|
||||
{
|
||||
get { return ACC.SysEnabled("Server.ACC.CSS.CSS"); }
|
||||
}
|
||||
|
||||
public override void Enable()
|
||||
{
|
||||
Console.WriteLine("{0} has just been enabled!", Name());
|
||||
}
|
||||
|
||||
public override void Disable()
|
||||
{
|
||||
Console.WriteLine("{0} has just been disabled!", Name());
|
||||
}
|
||||
|
||||
public override void Gump(Mobile from, Gump gump, ACCGumpParams subParams)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Help(Mobile from, Gump gump)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info, ACCGumpParams subParams)
|
||||
{
|
||||
}
|
||||
|
||||
private static void Refresh()
|
||||
{
|
||||
if (m_Loaded == null || m_Loaded.Count == 0)
|
||||
return;
|
||||
|
||||
Console.WriteLine("\n - Checking Spell Registry:");
|
||||
|
||||
ArrayList books;
|
||||
ArrayList oldsr;
|
||||
ArrayList newsr;
|
||||
bool changed;
|
||||
|
||||
foreach (DictionaryEntry de in m_Loaded)
|
||||
{
|
||||
changed = false;
|
||||
|
||||
oldsr = (ArrayList)de.Value;
|
||||
|
||||
newsr = SpellInfoRegistry.GetSpellsForSchool((School)de.Key);
|
||||
if (newsr == null)
|
||||
continue;
|
||||
|
||||
if (oldsr.Count != newsr.Count)
|
||||
changed = true;
|
||||
|
||||
for (int i = 0; i < oldsr.Count && !changed; i++)
|
||||
{
|
||||
if (((CSpellInfo)oldsr[i]).Type != (Type)newsr[i])
|
||||
changed = true;
|
||||
}
|
||||
|
||||
for (int i = 0; i < oldsr.Count; i++)
|
||||
{
|
||||
if (!((CSpellInfo)oldsr[i]).Enabled)
|
||||
SpellInfoRegistry.DisEnable((School)de.Key, ((CSpellInfo)oldsr[i]).Type, false);
|
||||
}
|
||||
|
||||
if (!changed)
|
||||
continue;
|
||||
|
||||
Console.WriteLine(" - Changes in {0} detected - refreshing all books.", (School)de.Key);
|
||||
|
||||
books = new ArrayList();
|
||||
foreach (Item i in World.Items.Values)
|
||||
{
|
||||
if ((i is CSpellbook))
|
||||
{
|
||||
CSpellbook book = i as CSpellbook;
|
||||
if (book == null || book.Deleted || book.School != (School)de.Key)
|
||||
continue;
|
||||
books.Add(book);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < books.Count; i++)
|
||||
{
|
||||
if (((CSpellbook)books[i]).Full)
|
||||
{
|
||||
((CSpellbook)books[i]).Fill();
|
||||
continue;
|
||||
}
|
||||
|
||||
ulong oldcontent = ((CSpellbook)books[i]).Content;
|
||||
((CSpellbook)books[i]).Content = (ulong)0;
|
||||
|
||||
for (int j = 0; j < oldsr.Count; j++)
|
||||
{
|
||||
if ((oldcontent & ((ulong)1 << j)) != 0)
|
||||
((CSpellbook)books[i]).AddSpell(((CSpellInfo)oldsr[j]).Type);
|
||||
}
|
||||
|
||||
((CSpellbook)books[i]).InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Update()
|
||||
{
|
||||
if (Version == 100)
|
||||
Console.WriteLine(" - Base Install");
|
||||
|
||||
else if (PrevVersion < Version)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public override void Save(GenericWriter idx, GenericWriter tdb, GenericWriter writer)
|
||||
{
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write(SpellInfoRegistry.Registry.Count);
|
||||
foreach (DictionaryEntry de in SpellInfoRegistry.Registry)
|
||||
{
|
||||
writer.Write((int)de.Key);
|
||||
writer.Write((int)((ArrayList)de.Value).Count);
|
||||
foreach (CSpellInfo info in (ArrayList)de.Value)
|
||||
{
|
||||
info.Serialize(writer);
|
||||
}
|
||||
}
|
||||
|
||||
writer.Write((int)Version);
|
||||
}
|
||||
|
||||
public override void Load(BinaryReader idx, BinaryReader tdb, BinaryFileReader reader)
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Loaded = new Hashtable();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
int keys = reader.ReadInt();
|
||||
for (int i = 0; i < keys; i++)
|
||||
{
|
||||
School school = (School)reader.ReadInt();
|
||||
ArrayList valuelist = new ArrayList();
|
||||
|
||||
int values = reader.ReadInt();
|
||||
for (int j = 0; j < values; j++)
|
||||
{
|
||||
valuelist.Add(new CSpellInfo(reader));
|
||||
}
|
||||
|
||||
m_Loaded.Add(school, valuelist);
|
||||
}
|
||||
|
||||
PrevVersion = reader.ReadInt();
|
||||
|
||||
Refresh();
|
||||
Update();
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
int keys = reader.ReadInt();
|
||||
for (int i = 0; i < keys; i++)
|
||||
{
|
||||
School school = (School)reader.ReadInt();
|
||||
ArrayList valuelist = new ArrayList();
|
||||
|
||||
int values = reader.ReadInt();
|
||||
for (int j = 0; j < values; j++)
|
||||
{
|
||||
valuelist.Add(new CSpellInfo(reader));
|
||||
}
|
||||
|
||||
m_Loaded.Add(school, valuelist);
|
||||
}
|
||||
|
||||
reader.ReadBool();
|
||||
PrevVersion = reader.ReadInt();
|
||||
|
||||
Refresh();
|
||||
Update();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Misc;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS
|
||||
{
|
||||
public abstract class CSpell : Spell
|
||||
{
|
||||
public virtual double RequiredSkill { get{ return 0.0; } }
|
||||
public virtual int RequiredMana { get{ return 0; } }
|
||||
public virtual int RequiredHealth { get{ return 0; } }
|
||||
public virtual int RequiredTithing{ get{ return 0; } }
|
||||
public virtual double CastDelay { get{ return -1.0; } }
|
||||
|
||||
public CSpell( Mobile caster, Item scroll, SpellInfo info ) : base( caster, scroll, info )
|
||||
{
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
if( SpellRestrictions.UseRestrictions )
|
||||
return SpellRestrictions.CheckRestrictions( Caster, this.GetType() );
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckFizzle()
|
||||
{
|
||||
if( CSkillCheck.UseDefaultSkills )
|
||||
return CSkillCheck.CheckSkill( Caster, this.GetType() ) ? base.CheckFizzle() : false;
|
||||
else
|
||||
return CSkillCheck.CheckSkill( Caster, this.GetType() );
|
||||
}
|
||||
|
||||
public override TimeSpan GetCastDelay()
|
||||
{
|
||||
return CastDelay == -1 ? base.GetCastDelay() : TimeSpan.FromSeconds( CastDelay );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
using Server.Items;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS
|
||||
{
|
||||
public class CSpellScroll : Item
|
||||
{
|
||||
private Type m_SpellType;
|
||||
|
||||
public Type SpellType
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_SpellType;
|
||||
}
|
||||
}
|
||||
|
||||
public CSpellScroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CSpellScroll(Type spellType, int itemID)
|
||||
: this(spellType, itemID, 1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CSpellScroll(Type spellType, int itemID, int amount)
|
||||
: base(itemID)
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 1.0;
|
||||
Amount = amount;
|
||||
|
||||
m_SpellType = spellType;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((string)m_SpellType.Name);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_SpellType = ScriptCompiler.FindTypeByName(reader.ReadString());
|
||||
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_SpellType = null;
|
||||
int bad = reader.ReadInt();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!Multis.DesignContext.Check(from))
|
||||
return; // They are customizing
|
||||
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
return;
|
||||
}
|
||||
|
||||
Spell spell = SpellInfoRegistry.NewSpell(m_SpellType, School.Invalid, from, this);
|
||||
|
||||
if (spell != null)
|
||||
spell.Cast();
|
||||
else
|
||||
from.SendLocalizedMessage(502345); // This spell has been temporarily disabled.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Commands;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
using Server.Spells;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.ACC.CSS
|
||||
{
|
||||
public class CSpellbook : Item
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("FillBook", ACC.GlobalMinimumAccessLevel, new CommandEventHandler(FillBook_OnCommand));
|
||||
}
|
||||
|
||||
[Usage("FillBook")]
|
||||
[Description("Completely fills a targeted spellbook with scrolls.")]
|
||||
private static void FillBook_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
e.Mobile.BeginTarget(-1, false, TargetFlags.None, new TargetCallback(FillBook_OnTarget));
|
||||
e.Mobile.SendMessage("Target the spellbook to fill.");
|
||||
}
|
||||
|
||||
private static void FillBook_OnTarget(Mobile from, object obj)
|
||||
{
|
||||
if (obj is CSpellbook)
|
||||
{
|
||||
CSpellbook book = (CSpellbook)obj;
|
||||
|
||||
if (book == null || book.Deleted)
|
||||
return;
|
||||
|
||||
book.Fill();
|
||||
book.Full = true;
|
||||
|
||||
from.SendMessage("The spellbook has been filled.");
|
||||
|
||||
CommandLogging.WriteLine(from, "{0} {1} filling spellbook {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(book));
|
||||
}
|
||||
else
|
||||
{
|
||||
from.BeginTarget(-1, false, TargetFlags.None, new TargetCallback(FillBook_OnTarget));
|
||||
from.SendMessage("That is not a spellbook. Try again.");
|
||||
}
|
||||
}
|
||||
|
||||
public override bool AllowEquipedCast(Mobile from) { return true; }
|
||||
public override bool DisplayLootType { get { return false; } }
|
||||
|
||||
public virtual School School { get { return School.Invalid; } }
|
||||
public virtual ArrayList SchoolSpells { get { return SpellInfoRegistry.GetSpellsForSchool(this.School); } }
|
||||
public virtual int BookCount { get { return SchoolSpells.Count; } }
|
||||
|
||||
private ulong m_Content;
|
||||
private int m_Count;
|
||||
private bool m_Full;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int SpellCount { get { return m_Count; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ulong Content
|
||||
{
|
||||
get { return m_Content; }
|
||||
set
|
||||
{
|
||||
if (m_Content != value)
|
||||
{
|
||||
m_Content = value;
|
||||
|
||||
m_Count = 0;
|
||||
|
||||
while (value > 0)
|
||||
{
|
||||
m_Count += (int)(value & 0x1);
|
||||
value >>= 1;
|
||||
}
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//public int Mark{ get{ return m_Mark; } set{ m_Mark = value; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool Full { get { return m_Full; } set { m_Full = value; } }
|
||||
|
||||
public CSpellbook()
|
||||
: this((ulong)0, CSSettings.FullSpellbooks)
|
||||
{
|
||||
}
|
||||
|
||||
public CSpellbook(bool full)
|
||||
: this((ulong)0, full)
|
||||
{
|
||||
}
|
||||
|
||||
public CSpellbook(ulong content, bool full)
|
||||
: this(content, 0xEFA, full)
|
||||
{
|
||||
}
|
||||
|
||||
public CSpellbook(ulong content, int itemID, bool full)
|
||||
: base(itemID)
|
||||
{
|
||||
Name = "Arcane Tome";
|
||||
|
||||
Weight = 3.0;
|
||||
Layer = Layer.OneHanded;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
Content = content;
|
||||
|
||||
if (full)
|
||||
Fill();
|
||||
}
|
||||
|
||||
public CSpellbook(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public void Fill()
|
||||
{
|
||||
m_Full = true;
|
||||
|
||||
if (this.BookCount == 64)
|
||||
this.Content = ulong.MaxValue;
|
||||
else
|
||||
this.Content = (1ul << this.BookCount) - 1;
|
||||
}
|
||||
|
||||
public bool AddSpell(Type type)
|
||||
{
|
||||
if (!SchoolSpells.Contains(type))
|
||||
return false;
|
||||
|
||||
m_Content |= (ulong)1 << SchoolSpells.IndexOf(type);
|
||||
++m_Count;
|
||||
|
||||
InvalidateProperties();
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool HasSpell(Type type)
|
||||
{
|
||||
if (SchoolSpells.Contains(type) && SpellInfoRegistry.CheckRegistry(this.School, type))
|
||||
return ((m_Content & ((ulong)1 << SchoolSpells.IndexOf(type))) != 0);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool MobileHasSpell(Mobile m, School school, Type type)
|
||||
{
|
||||
if (m == null || m.Deleted || m.Backpack == null || school == School.Invalid || type == null)
|
||||
return false;
|
||||
|
||||
foreach (Item i in m.Backpack.Items)
|
||||
{
|
||||
if (i is CSpellbook)
|
||||
{
|
||||
CSpellbook book = (CSpellbook)i;
|
||||
if (book.School == school && book.HasSpell(type))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Item layer = m.FindItemOnLayer(Layer.OneHanded);
|
||||
if (layer is CSpellbook)
|
||||
{
|
||||
CSpellbook book = (CSpellbook)layer;
|
||||
if (book.School == school && book.HasSpell(type))
|
||||
return true;
|
||||
}
|
||||
|
||||
layer = m.FindItemOnLayer(Layer.FirstValid);
|
||||
if (layer is CSpellbook)
|
||||
{
|
||||
CSpellbook book = (CSpellbook)layer;
|
||||
if (book.School == school && book.HasSpell(type))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1042886, m_Count.ToString()); // ~1_NUMBERS_OF_SPELLS~ Spells
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
this.LabelTo(from, 1042886, m_Count.ToString());
|
||||
}
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
if (dropped is CSpellScroll && dropped.Amount == 1)
|
||||
{
|
||||
CSpellScroll scroll = (CSpellScroll)dropped;
|
||||
|
||||
if (!SchoolSpells.Contains(scroll.SpellType))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (HasSpell(scroll.SpellType))
|
||||
{
|
||||
from.SendLocalizedMessage(500179); // That spell is already present in that spellbook.
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
AddSpell(scroll.SpellType);
|
||||
scroll.Delete();
|
||||
|
||||
from.Send(new PlaySound(0x249, GetWorldLocation()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (dropped is SpellScroll && dropped.Amount == 1)
|
||||
{
|
||||
SpellScroll scroll = (SpellScroll)dropped;
|
||||
|
||||
Type type = SpellRegistry.Types[scroll.SpellID];
|
||||
|
||||
if (!SchoolSpells.Contains(type))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (HasSpell(type))
|
||||
{
|
||||
from.SendLocalizedMessage(500179); // That spell is already present in that spellbook.
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
AddSpell(type);
|
||||
scroll.Delete();
|
||||
|
||||
from.Send(new PlaySound(0x249, GetWorldLocation()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
|
||||
writer.Write(m_Full);
|
||||
writer.Write(m_Content);
|
||||
writer.Write(m_Count);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Full = reader.ReadBool();
|
||||
m_Content = reader.ReadULong();
|
||||
m_Count = reader.ReadInt();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
using Server.Spells;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.ACC.CSS
|
||||
{
|
||||
public abstract class CSpellbookGump : Gump
|
||||
{
|
||||
private CSpellbook m_Book;
|
||||
private ArrayList m_Spells;
|
||||
|
||||
private int Pages;
|
||||
private int CurrentPage;
|
||||
|
||||
public abstract string TextHue { get; }
|
||||
public abstract int BGImage { get; }
|
||||
public abstract int SpellBtn { get; }
|
||||
public abstract int SpellBtnP { get; }
|
||||
public abstract string Label1 { get; }
|
||||
public abstract string Label2 { get; }
|
||||
public abstract Type GumpType { get; }
|
||||
|
||||
public CSpellbookGump(CSpellbook book)
|
||||
: base(50, 100)
|
||||
{
|
||||
if (!CSS.Running)
|
||||
return;
|
||||
|
||||
m_Book = book;
|
||||
m_Spells = book.SchoolSpells;
|
||||
|
||||
Pages = (int)Math.Ceiling((book.SpellCount / 16.0));
|
||||
|
||||
/* if( Pages > 1 && book.Mark > 0 )
|
||||
{
|
||||
ArrayList temp = new ArrayList();
|
||||
for( int i = 0; i < book.Mark*16 && i < m_Spells.Count; i++ )
|
||||
temp.Add( m_Spells[i] );
|
||||
m_Spells.RemoveRange( 0, (book.Mark*16)-1 );
|
||||
m_Spells.AddRange( temp );
|
||||
}
|
||||
*/
|
||||
Closable = false;
|
||||
Dragable = true;
|
||||
|
||||
AddPage(0);
|
||||
AddImage(100, 100, BGImage);
|
||||
|
||||
CurrentPage = 1;
|
||||
|
||||
for (int i = 0; i < Pages; i++, CurrentPage++)
|
||||
{
|
||||
AddPage(CurrentPage);
|
||||
|
||||
//Hidden Buttons
|
||||
for (int j = (CurrentPage - 1) * 16, C = 0; j < CurrentPage * 16 && j < m_Spells.Count; j++, C++)
|
||||
{
|
||||
if (HasSpell((Type)m_Spells[j]))
|
||||
{
|
||||
AddButton((C > 7 ? 305 : 145), 142 + (C > 7 ? (C - 8) * 20 : C * 20), 2482, 2482, j + 1000, GumpButtonType.Reply, 0);
|
||||
}
|
||||
}
|
||||
AddImage(100, 100, BGImage);
|
||||
AddHtml(165, 107, 100, 20, String.Format("<basefont color=#{0}><Center>{1}</Center>", TextHue, Label1), false, false);
|
||||
AddHtml(285, 107, 100, 20, String.Format("<basefont color=#{0}><Center>{1}</Center>", TextHue, Label2), false, false);
|
||||
AddButton(404, 314, 4017, 4019, 0, GumpButtonType.Reply, 0);
|
||||
//End Hidden Buttons
|
||||
|
||||
//Prev/Next Buttons
|
||||
if (Pages > 1)
|
||||
{
|
||||
if (CurrentPage > 1)
|
||||
AddButton(122, 109, 2205, 2205, 0, GumpButtonType.Page, Pages - CurrentPage - 1);
|
||||
if (CurrentPage < Pages)
|
||||
AddButton(394, 104, 2206, 2206, 0, GumpButtonType.Page, CurrentPage + 1);
|
||||
}
|
||||
//End Prev/Next Buttons
|
||||
|
||||
//Spell Buttons/Labels
|
||||
for (int j = (CurrentPage - 1) * 16, C = 0; j < CurrentPage * 16 && j < m_Spells.Count; j++, C++)
|
||||
{
|
||||
if (HasSpell((Type)m_Spells[j]))
|
||||
{
|
||||
CSpellInfo info = SpellInfoRegistry.GetInfo(m_Book.School, (Type)m_Spells[j]);
|
||||
if (info == null)
|
||||
continue;
|
||||
|
||||
AddHtml((C > 7 ? 305 : 145), 140 + (C > 7 ? (C - 8) * 20 : C * 20), 120, 20, String.Format("<basefont color=#{0}>{1}</basefont>", TextHue, info.Name), false, false);
|
||||
AddButton((C > 7 ? 285 : 125), 143 + (C > 7 ? (C - 8) * 20 : C * 20), SpellBtn, SpellBtnP, j + 2000, GumpButtonType.Reply, 0);
|
||||
AddButton((C > 7 ? 410 : 250), 142 + (C > 7 ? (C - 8) * 20 : C * 20), 5411, 5411, j + 1000, GumpButtonType.Reply, 0);
|
||||
}
|
||||
}
|
||||
//End Spell Buttons/Labels
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasSpell(Type type)
|
||||
{
|
||||
return (m_Book != null && m_Book.HasSpell(type));
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID == 0 || !CSS.Running)
|
||||
return;
|
||||
|
||||
else if (info.ButtonID >= 1000 && info.ButtonID < (1000 + m_Spells.Count))
|
||||
{
|
||||
if (SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions(state.Mobile, m_Book.School))
|
||||
{
|
||||
state.Mobile.SendMessage("You are not allowed to cast this spell.");
|
||||
return;
|
||||
}
|
||||
|
||||
CSpellInfo si = SpellInfoRegistry.GetInfo(m_Book.School, (Type)m_Spells[info.ButtonID - 1000]);
|
||||
if (si == null)
|
||||
{
|
||||
state.Mobile.SendMessage("That spell is disabled.");
|
||||
return;
|
||||
}
|
||||
state.Mobile.CloseGump(typeof(ScrollGump));
|
||||
state.Mobile.SendGump(new ScrollGump(m_Book, si, TextHue, state.Mobile));
|
||||
// m_Book.Mark = (info.ButtonID-1000)/16;
|
||||
// state.Mobile.SendMessage( "{0}", m_Book.Mark );
|
||||
}
|
||||
|
||||
else if (info.ButtonID >= 2000 && info.ButtonID < (2000 + m_Spells.Count))
|
||||
{
|
||||
if (SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions(state.Mobile, m_Book.School))
|
||||
{
|
||||
state.Mobile.SendMessage("You are not allowed to cast this spell.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CSpellbook.MobileHasSpell(state.Mobile, m_Book.School, (Type)m_Spells[info.ButtonID - 2000]))
|
||||
{
|
||||
state.Mobile.SendMessage("You do not have this spell.");
|
||||
return;
|
||||
}
|
||||
|
||||
Spell spell = SpellInfoRegistry.NewSpell((Type)m_Spells[info.ButtonID - 2000], m_Book.School, state.Mobile, null);
|
||||
if (spell == null)
|
||||
state.Mobile.SendMessage("That spell is disabled.");
|
||||
else
|
||||
spell.Cast();
|
||||
// m_Book.Mark = (info.ButtonID-2000)/16;
|
||||
// state.Mobile.SendMessage( "{0}", m_Book.Mark );
|
||||
}
|
||||
|
||||
object[] Params = new object[1] { m_Book };
|
||||
CSpellbookGump gump = Activator.CreateInstance(GumpType, Params) as CSpellbookGump;
|
||||
if (gump != null)
|
||||
state.Mobile.SendGump(gump);
|
||||
|
||||
//GumpUpTimer
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.ACC.CM;
|
||||
|
||||
namespace Server.ACC.CSS.Modules
|
||||
{
|
||||
public class CastCommandsModule : Module
|
||||
{
|
||||
private Dictionary<string, CastInfo> m_CastCommands;
|
||||
public Dictionary<string, CastInfo> CastCommands { get { return m_CastCommands; } }
|
||||
|
||||
public override string Name() { return "Cast Commands"; }
|
||||
|
||||
public CastCommandsModule(Serial serial)
|
||||
: this(serial, null, null)
|
||||
{
|
||||
}
|
||||
|
||||
public CastCommandsModule(Serial serial, string castCommand, CastInfo info)
|
||||
: base(serial)
|
||||
{
|
||||
m_CastCommands = new Dictionary<string, CastInfo>();
|
||||
|
||||
Add(castCommand, info);
|
||||
}
|
||||
|
||||
public void Add(string castCommand, CastInfo info)
|
||||
{
|
||||
if (castCommand == null || castCommand.Length == 0 || info == null)
|
||||
return;
|
||||
|
||||
if (m_CastCommands.ContainsKey(castCommand.ToLower()))
|
||||
m_CastCommands[castCommand.ToLower()] = info;
|
||||
else
|
||||
m_CastCommands.Add(castCommand.ToLower(), info);
|
||||
}
|
||||
|
||||
public CastInfo Get(string castCommand)
|
||||
{
|
||||
|
||||
return Contains(castCommand) ? m_CastCommands[castCommand.ToLower()] : null;
|
||||
}
|
||||
|
||||
public string GetCommandForInfo(CastInfo castInfo)
|
||||
{
|
||||
foreach (KeyValuePair<string, CastInfo> kvp in m_CastCommands)
|
||||
{
|
||||
if (kvp.Value.SpellType == castInfo.SpellType)
|
||||
{
|
||||
return kvp.Key.ToLower();
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public bool Contains(string castCommand)
|
||||
{
|
||||
return m_CastCommands.ContainsKey(castCommand.ToLower());
|
||||
}
|
||||
|
||||
public void Remove(string castCommand)
|
||||
{
|
||||
m_CastCommands.Remove(castCommand.ToLower());
|
||||
|
||||
if (m_CastCommands.Count == 0)
|
||||
CentralMemory.RemoveModule(this.Owner, (Module)this);
|
||||
}
|
||||
|
||||
public void RemoveCommandByInfo(CastInfo castInfo)
|
||||
{
|
||||
string command = "";
|
||||
foreach (KeyValuePair<string, CastInfo> kvp in m_CastCommands)
|
||||
{
|
||||
if (kvp.Value.SpellType == castInfo.SpellType)
|
||||
{
|
||||
command = kvp.Key.ToLower();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (command.Length > 0)
|
||||
Remove(command);
|
||||
}
|
||||
|
||||
public override void Append(Module mod, bool negatively)
|
||||
{
|
||||
CastCommandsModule m = mod as CastCommandsModule;
|
||||
List<string> removeList = new List<string>();
|
||||
|
||||
foreach (KeyValuePair<string, CastInfo> kvp in m.CastCommands)
|
||||
{
|
||||
if (negatively)
|
||||
removeList.Add(kvp.Key);
|
||||
else
|
||||
Add(kvp.Key, kvp.Value);
|
||||
}
|
||||
|
||||
foreach (string s in removeList)
|
||||
{
|
||||
Remove(s);
|
||||
}
|
||||
removeList.Clear();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write(m_CastCommands.Count);
|
||||
foreach (KeyValuePair<string, CastInfo> kvp in m_CastCommands)
|
||||
{
|
||||
writer.Write(kvp.Key);
|
||||
kvp.Value.Serialize(writer);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_CastCommands = new Dictionary<string, CastInfo>();
|
||||
|
||||
int count = reader.ReadInt();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
string s = reader.ReadString();
|
||||
CastInfo ii = new CastInfo(reader);
|
||||
if (ii.SpellType != null)
|
||||
m_CastCommands.Add(s, ii);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Spells;
|
||||
using Server.ACC.CM;
|
||||
|
||||
namespace Server.ACC.CSS.Modules
|
||||
{
|
||||
public class CastInfo
|
||||
{
|
||||
private Type m_SpellType;
|
||||
public Type SpellType { get { return m_SpellType; } set { m_SpellType = value; } }
|
||||
|
||||
private School m_School;
|
||||
public School School { get { return m_School; } set { m_School = value; } }
|
||||
|
||||
public CastInfo(Type type, School school)
|
||||
{
|
||||
m_SpellType = type;
|
||||
m_School = school;
|
||||
}
|
||||
|
||||
public CastInfo(GenericReader reader)
|
||||
{
|
||||
Deserialize(reader);
|
||||
}
|
||||
|
||||
public void Serialize(GenericWriter writer)
|
||||
{
|
||||
writer.Write((int)0); //version
|
||||
|
||||
writer.Write((string)m_SpellType.Name);
|
||||
writer.Write((int)m_School);
|
||||
}
|
||||
|
||||
public void Deserialize(GenericReader reader)
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_SpellType = ScriptCompiler.FindTypeByName(reader.ReadString());
|
||||
m_School = (School)reader.ReadInt();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
using Server.Spells;
|
||||
using Server.ACC.CM;
|
||||
using Server.ACC.CSS.Modules;
|
||||
|
||||
namespace Server.ACC.CSS
|
||||
{
|
||||
public class IconPlacementGump : Gump
|
||||
{
|
||||
public CSpellbook m_Book;
|
||||
public Mobile m_From;
|
||||
|
||||
public int m_X;
|
||||
public int m_Y;
|
||||
public int m_I;
|
||||
public int m_Icon;
|
||||
public Type m_Spell;
|
||||
public int m_Background;
|
||||
public School m_School;
|
||||
|
||||
public IconPlacementGump( CSpellbook book, Mobile from, int x, int y, int i, int icon, Type spellType, int background, School school ) : base( 0, 0 )
|
||||
{
|
||||
m_Book = book;
|
||||
m_From = from;
|
||||
|
||||
m_X = x;
|
||||
m_Y = y;
|
||||
m_I = i;
|
||||
m_Icon = icon;
|
||||
m_Spell = spellType;
|
||||
m_Background = background;
|
||||
m_School = school;
|
||||
|
||||
string xtext = m_X.ToString();
|
||||
string ytext = m_Y.ToString();
|
||||
string itext = m_I.ToString();
|
||||
|
||||
Closable=true;
|
||||
Disposable=true;
|
||||
Dragable=false;
|
||||
Resizable=false;
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddImage( 260, 160, 5011 );
|
||||
AddLabel( 353, 230, 1153, "Icon Placement" );
|
||||
|
||||
CSpellInfo si = SpellInfoRegistry.GetInfo( m_School, m_Spell );
|
||||
if( si == null )
|
||||
return;
|
||||
|
||||
AddLabel( 338, 350, 1153, si.Name );
|
||||
|
||||
AddButton( 412, 288, 2444, 2443, 1, GumpButtonType.Reply, 0 );
|
||||
AddButton( 325, 288, 2444, 2443, 2, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 425, 290, 1153, "Apply" );
|
||||
AddLabel( 339, 290, 1153, "Move" );
|
||||
|
||||
AddButton( 377, 178, 4500, 4500, 3, GumpButtonType.Reply, 0 ); //Up
|
||||
AddButton( 474, 276, 4502, 4502, 4, GumpButtonType.Reply, 0 ); //Right
|
||||
AddButton( 377, 375, 4504, 4504, 5, GumpButtonType.Reply, 0 ); //Down
|
||||
AddButton( 278, 276, 4506, 4506, 6, GumpButtonType.Reply, 0 ); //Left
|
||||
|
||||
AddBackground( 348, 260, 105, 20, 9300 );
|
||||
AddBackground( 348, 318, 105, 20, 9300 );
|
||||
AddBackground( 388, 290, 25, 20, 9300 );
|
||||
|
||||
AddTextEntry( 348, 260, 105, 20, 1153, 7, "" + xtext );
|
||||
AddTextEntry( 348, 318, 105, 20, 1153, 8, "" + ytext );
|
||||
AddTextEntry( 388, 290, 25, 20, 1153, 9, "" + itext );
|
||||
|
||||
AddBackground( x, y, 54, 56, background );
|
||||
AddImage( x+45, y, 9008 );
|
||||
AddImage( x+5, y+5, icon );
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState state, RelayInfo info )
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
switch( info.ButtonID )
|
||||
{
|
||||
//Apply
|
||||
case 1:
|
||||
{
|
||||
if( !CentralMemory.Running )
|
||||
{
|
||||
from.SendMessage( "There is no Central Memory! Please page an Admin to assist." );
|
||||
return;
|
||||
}
|
||||
|
||||
IconInfo ii = new IconInfo( m_Spell, m_Icon, m_X, m_Y, m_Background, m_School );
|
||||
|
||||
if( !CentralMemory.ContainsModule( from.Serial, typeof( IconsModule ) ) )
|
||||
CentralMemory.AddModule( from.Serial, typeof( IconsModule ) );
|
||||
|
||||
IconsModule im = new IconsModule( from.Serial );
|
||||
im.Add( ii );
|
||||
|
||||
CentralMemory.AppendModule( from.Serial, (Module)im, false );
|
||||
|
||||
from.SendGump( new SpellIconGump( ii ) );
|
||||
break;
|
||||
}
|
||||
|
||||
//Move
|
||||
case 2:
|
||||
{
|
||||
TextRelay xrelay = info.GetTextEntry( 7 );
|
||||
TextRelay yrelay = info.GetTextEntry( 8 );
|
||||
string xstring = ( xrelay == null ? null : xrelay.Text.Trim() );
|
||||
string ystring = ( yrelay == null ? null : yrelay.Text.Trim() );
|
||||
if( xstring == null || xstring.Length == 0 || ystring == null || ystring.Length == 0 )
|
||||
{
|
||||
from.SendMessage( "Please enter a X coordinate in the top box and a Y coordinate in the bottom box" );
|
||||
}
|
||||
else
|
||||
{
|
||||
int x = m_X;
|
||||
int y = m_Y;
|
||||
try
|
||||
{
|
||||
x = Int32.Parse(xstring);
|
||||
y = Int32.Parse(ystring);
|
||||
m_X = x;
|
||||
m_Y = y;
|
||||
}
|
||||
catch
|
||||
{
|
||||
from.SendMessage( "Please enter a X coordinate in the top box and a Y coordinate in the bottom box" );
|
||||
}
|
||||
}
|
||||
if( m_X < 0 )
|
||||
{
|
||||
m_X = 0;
|
||||
from.SendMessage( "You cannot go any farther left" );
|
||||
}
|
||||
if( m_Y < 0 )
|
||||
{
|
||||
m_Y = 0;
|
||||
from.SendMessage( "You cannot go any farther up" );
|
||||
}
|
||||
|
||||
from.CloseGump( typeof( IconPlacementGump ) );
|
||||
from.SendGump(new IconPlacementGump( m_Book, from, m_X, m_Y, m_I, m_Icon, m_Spell, m_Background, m_School ) );
|
||||
break;
|
||||
}
|
||||
|
||||
//Up
|
||||
case 3:
|
||||
{
|
||||
MakeI(info);
|
||||
from.CloseGump( typeof( IconPlacementGump ) );
|
||||
if( (m_Y-m_I) < 0 )
|
||||
{
|
||||
m_Y = 0;
|
||||
from.SendMessage( "You cannot go any farther up" );
|
||||
from.SendGump( new IconPlacementGump( m_Book, from, m_X, m_Y, m_I, m_Icon, m_Spell, m_Background, m_School ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendGump( new IconPlacementGump( m_Book, from, m_X, (m_Y-m_I), m_I, m_Icon, m_Spell, m_Background, m_School ) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
//Right
|
||||
case 4:
|
||||
{
|
||||
MakeI(info);
|
||||
from.CloseGump( typeof( IconPlacementGump ) );
|
||||
from.SendGump( new IconPlacementGump( m_Book, from, (m_X+m_I), m_Y, m_I, m_Icon, m_Spell, m_Background, m_School ) );
|
||||
break;
|
||||
}
|
||||
|
||||
//Down
|
||||
case 5:
|
||||
{
|
||||
MakeI(info);
|
||||
from.CloseGump( typeof( IconPlacementGump ) );
|
||||
from.SendGump( new IconPlacementGump( m_Book, from, m_X, (m_Y+m_I), m_I, m_Icon, m_Spell, m_Background, m_School ) );
|
||||
break;
|
||||
}
|
||||
|
||||
//Left
|
||||
case 6:
|
||||
{
|
||||
MakeI(info);
|
||||
from.CloseGump( typeof( IconPlacementGump ) );
|
||||
if( (m_X-m_I) < 0 )
|
||||
{
|
||||
m_X = 0;
|
||||
from.SendMessage( "You cannot go any farther left" );
|
||||
from.SendGump( new IconPlacementGump( m_Book, from, m_X, m_Y, m_I, m_Icon, m_Spell, m_Background, m_School ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendGump( new IconPlacementGump( m_Book, from, (m_X-m_I), m_Y, m_I, m_Icon, m_Spell, m_Background, m_School ) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
private void MakeI(RelayInfo info)
|
||||
{
|
||||
TextRelay irelay = info.GetTextEntry( 9 );
|
||||
string istring = ( irelay == null ? null : irelay.Text.Trim() );
|
||||
if( istring == null || istring.Length == 0 )
|
||||
{
|
||||
m_From.SendMessage( "Please enter an integer in the middle text field." );
|
||||
}
|
||||
else
|
||||
{
|
||||
int i = m_I;
|
||||
try
|
||||
{
|
||||
i = Int32.Parse(istring);
|
||||
m_I = i;
|
||||
}
|
||||
catch
|
||||
{
|
||||
m_From.SendMessage( "Please enter an integer in the middle text field." );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Spells;
|
||||
using Server.ACC.CM;
|
||||
|
||||
namespace Server.ACC.CSS.Modules
|
||||
{
|
||||
public class ApplyIcons
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.Login += new LoginEventHandler(EventSink_Login);
|
||||
}
|
||||
|
||||
private static void EventSink_Login(LoginEventArgs args)
|
||||
{
|
||||
if (!CentralMemory.Running || !CSS.Running)
|
||||
return;
|
||||
|
||||
Mobile m = args.Mobile;
|
||||
|
||||
IconsModule im = (IconsModule)CentralMemory.GetModule(m.Serial, typeof(IconsModule));
|
||||
if (im == null)
|
||||
return;
|
||||
|
||||
IconsModule imRemove = new IconsModule(m.Serial);
|
||||
|
||||
foreach (KeyValuePair<Type, IconInfo> kvp in im.Icons)
|
||||
{
|
||||
IconInfo ii = kvp.Value;
|
||||
if (ii == null)
|
||||
{
|
||||
imRemove.Add(ii);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ii.SpellType == null || ii.School == School.Invalid)
|
||||
{
|
||||
imRemove.Add(ii);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions(m, ii.School))
|
||||
{
|
||||
imRemove.Add(ii);
|
||||
continue;
|
||||
}
|
||||
|
||||
m.SendGump(new SpellIconGump(ii));
|
||||
}
|
||||
|
||||
if (im.Icons.Count > 0)
|
||||
CentralMemory.AppendModule(m.Serial, (Module)imRemove, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Spells;
|
||||
using Server.ACC.CM;
|
||||
|
||||
namespace Server.ACC.CSS.Modules
|
||||
{
|
||||
public class IconInfo
|
||||
{
|
||||
private Type m_SpellType;
|
||||
public Type SpellType{ get{ return m_SpellType; } set{ m_SpellType = value; } }
|
||||
|
||||
private int m_Icon;
|
||||
public int Icon{ get{ return m_Icon; } set{ m_Icon = value; } }
|
||||
|
||||
private Point3D m_Location;
|
||||
public Point3D Location{ get{ return m_Location; } set{ m_Location = value; } }
|
||||
|
||||
private School m_School;
|
||||
public School School{ get{ return m_School; } set{ m_School = value; } }
|
||||
|
||||
public IconInfo( Type type, int icon, int x, int y, int back, School school )
|
||||
{
|
||||
m_SpellType = type;
|
||||
m_Icon = icon;
|
||||
m_Location = new Point3D( x, y, back );
|
||||
m_School = school;
|
||||
}
|
||||
|
||||
public IconInfo( GenericReader reader )
|
||||
{
|
||||
Deserialize( reader );
|
||||
}
|
||||
|
||||
public void Serialize( GenericWriter writer )
|
||||
{
|
||||
writer.Write( (int)1 ); //version
|
||||
|
||||
writer.Write( (string)m_SpellType.Name );
|
||||
writer.Write( (int)m_Icon );
|
||||
writer.Write( (Point3D)m_Location );
|
||||
writer.Write( (int)m_School );
|
||||
}
|
||||
|
||||
public void Deserialize( GenericReader reader )
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
switch( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_SpellType = ScriptCompiler.FindTypeByName(reader.ReadString());
|
||||
m_Icon = reader.ReadInt();
|
||||
m_Location = reader.ReadPoint3D();
|
||||
m_School = (School)reader.ReadInt();
|
||||
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
int bad = reader.ReadInt();
|
||||
m_Icon = reader.ReadInt();
|
||||
m_Location = reader.ReadPoint3D();
|
||||
|
||||
m_SpellType = null;
|
||||
m_School = School.Invalid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.ACC.CM;
|
||||
|
||||
namespace Server.ACC.CSS.Modules
|
||||
{
|
||||
public class IconsModule : Module
|
||||
{
|
||||
private Dictionary<Type, IconInfo> m_Icons;
|
||||
public Dictionary<Type, IconInfo> Icons { get { return m_Icons; } }
|
||||
//private Hashtable m_Icons;
|
||||
//public Hashtable Icons{ get{ return m_Icons; } }
|
||||
|
||||
public override string Name() { return "Spell Icons"; }
|
||||
|
||||
public IconsModule(Serial serial)
|
||||
: this(serial, null)
|
||||
{
|
||||
}
|
||||
|
||||
public IconsModule(Serial serial, IconInfo info)
|
||||
: base(serial)
|
||||
{
|
||||
//m_Icons = new Hashtable();
|
||||
m_Icons = new Dictionary<Type, IconInfo>();
|
||||
|
||||
Add(info);
|
||||
}
|
||||
|
||||
public void Add(IconInfo info)
|
||||
{
|
||||
if (info == null)
|
||||
return;
|
||||
|
||||
if (m_Icons.ContainsKey(info.SpellType))
|
||||
m_Icons[info.SpellType] = info;
|
||||
|
||||
else
|
||||
m_Icons.Add(info.SpellType, info);
|
||||
}
|
||||
|
||||
public IconInfo Get(Type type)
|
||||
{
|
||||
return m_Icons[type];
|
||||
}
|
||||
|
||||
public bool Contains(Type type)
|
||||
{
|
||||
return m_Icons.ContainsKey(type);
|
||||
}
|
||||
|
||||
public void Remove(Type type)
|
||||
{
|
||||
m_Icons.Remove(type);
|
||||
|
||||
if (m_Icons.Count == 0)
|
||||
CentralMemory.RemoveModule(this.Owner, (Module)this);
|
||||
}
|
||||
|
||||
public override void Append(Module mod, bool negatively)
|
||||
{
|
||||
IconsModule im = mod as IconsModule;
|
||||
List<Type> removeList = new List<Type>();
|
||||
|
||||
foreach (KeyValuePair<Type,IconInfo> kvp in im.Icons)
|
||||
{
|
||||
if (negatively)
|
||||
removeList.Add(kvp.Value.SpellType);
|
||||
else
|
||||
Add(kvp.Value);
|
||||
}
|
||||
|
||||
foreach (Type t in removeList)
|
||||
{
|
||||
Remove(t);
|
||||
}
|
||||
removeList.Clear();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write(m_Icons.Count);
|
||||
foreach (KeyValuePair<Type,IconInfo> kvp in m_Icons)
|
||||
{
|
||||
kvp.Value.Serialize(writer);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Icons = new Dictionary<Type, IconInfo>();
|
||||
|
||||
int count = reader.ReadInt();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
IconInfo ii = new IconInfo(reader);
|
||||
if (ii.SpellType != null)
|
||||
m_Icons.Add(ii.SpellType, ii);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS
|
||||
{
|
||||
public class ScrollBag : Bag
|
||||
{
|
||||
public ScrollBag()
|
||||
{
|
||||
}
|
||||
|
||||
public void PlaceItemIn( int x, int y, Item item )
|
||||
{
|
||||
AddItem( item );
|
||||
item.Location = new Point3D( x, y, 0 );
|
||||
}
|
||||
|
||||
public ScrollBag( 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,164 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Spells;
|
||||
using Server.ACC.CM;
|
||||
using Server.ACC.CSS.Modules;
|
||||
|
||||
namespace Server.ACC.CSS
|
||||
{
|
||||
public class ScrollGump : Gump
|
||||
{
|
||||
private CSpellInfo m_Info;
|
||||
private string m_TextHue;
|
||||
private CSpellbook m_Book;
|
||||
private CastInfo m_CastInfo;
|
||||
private CastCommandsModule m_CastCommandModule;
|
||||
|
||||
public ScrollGump(CSpellbook book, CSpellInfo info, string textHue, Mobile sender)
|
||||
: base(485, 175)
|
||||
{
|
||||
if (info == null || book == null || !CSS.Running)
|
||||
return;
|
||||
|
||||
m_Info = info;
|
||||
m_Book = book;
|
||||
m_TextHue = textHue;
|
||||
m_CastInfo = new CastInfo(info.Type, info.School);
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
AddPage(0);
|
||||
AddBackground(0, 0, 200, 265, 9380);
|
||||
|
||||
if (info.Name != null)
|
||||
AddHtml(30, 3, 140, 20, String.Format("<basefont color=#{0}><center>{1}</center></font>", textHue, info.Name), false, false);
|
||||
|
||||
AddButton(30, 40, info.Icon, info.Icon, 3, GumpButtonType.Reply, 0);
|
||||
|
||||
AddButton(90, 40, 2331, 2338, 1, GumpButtonType.Reply, 0); //Cast
|
||||
AddLabel(120, 38, 0, "Cast");
|
||||
|
||||
//AddButton( 90, 65, 2338, 2331, 2, GumpButtonType.Reply, 0 ); //Scribe
|
||||
//AddLabel( 120, 63, 0, "Scribe" );
|
||||
|
||||
//Info
|
||||
string InfoString = "";
|
||||
if (info.Desc != null)
|
||||
InfoString += String.Format("<basefont color=black>{0}</font><br><br>", info.Desc);
|
||||
|
||||
if (info.Regs != null)
|
||||
{
|
||||
string[] Regs = info.Regs.Split(';');
|
||||
InfoString += String.Format("<basefont color=black>Reagents :</font><br><basefont color=#{0}>", textHue);
|
||||
foreach (string r in Regs)
|
||||
InfoString += String.Format("-{0}<br>", r.TrimStart());
|
||||
InfoString += "</font><br>";
|
||||
}
|
||||
|
||||
if (info.Info != null)
|
||||
{
|
||||
string[] Info = info.Info.Split(';');
|
||||
InfoString += String.Format("<basefont color=#{0}>", textHue);
|
||||
foreach (string s in Info)
|
||||
InfoString += String.Format("{0}<br>", s.TrimStart());
|
||||
InfoString += "</font><br>";
|
||||
}
|
||||
AddHtml(30, 95, 140, 130, InfoString, false, true);
|
||||
//End Info
|
||||
|
||||
#region CastInfo
|
||||
if (CentralMemory.Running)
|
||||
{
|
||||
m_CastCommandModule = (CastCommandsModule)CentralMemory.GetModule(sender.Serial, typeof(CastCommandsModule));
|
||||
|
||||
AddLabel(25, 242, 0, "Key :");
|
||||
if (m_CastCommandModule == null)
|
||||
AddTextEntry(70, 242, 100, 20, 0, 5, ""); //Key
|
||||
else
|
||||
AddTextEntry(70, 242, 100, 20, 0, 5, m_CastCommandModule.GetCommandForInfo(m_CastInfo)); //Key
|
||||
AddButton(175, 247, 2103, 2104, 4, GumpButtonType.Reply, 0); //KeyButton
|
||||
}
|
||||
#endregion //CastInfo
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID == 0 || !CSS.Running)
|
||||
return;
|
||||
|
||||
else if (info.ButtonID == 1)
|
||||
{
|
||||
if (SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions(state.Mobile, m_Info.School))
|
||||
{
|
||||
state.Mobile.SendMessage("You are not allowed to cast this spell.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CSpellbook.MobileHasSpell(state.Mobile, m_Info.School, m_Info.Type))
|
||||
{
|
||||
state.Mobile.SendMessage("You do not have this spell.");
|
||||
return;
|
||||
}
|
||||
|
||||
Spell spell = SpellInfoRegistry.NewSpell(m_Info.Type, m_Info.School, state.Mobile, null);
|
||||
if (spell == null)
|
||||
state.Mobile.SendMessage("That spell is disabled.");
|
||||
else
|
||||
spell.Cast();
|
||||
}
|
||||
|
||||
else if (info.ButtonID == 2)
|
||||
{
|
||||
//Scribe
|
||||
}
|
||||
|
||||
else if (info.ButtonID == 3)
|
||||
{
|
||||
if (!CentralMemory.Running)
|
||||
return;
|
||||
|
||||
if (SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions(state.Mobile, m_Info.School))
|
||||
return;
|
||||
|
||||
state.Mobile.SendGump(new IconPlacementGump(m_Book, state.Mobile, 100, 100, 10, m_Info.Icon, m_Info.Type, m_Info.Back, m_Book.School));
|
||||
}
|
||||
|
||||
else if (info.ButtonID == 4)
|
||||
{
|
||||
if (!CentralMemory.Running)
|
||||
return;
|
||||
|
||||
string command = info.GetTextEntry(5).Text;
|
||||
|
||||
if (command == null || command.Length == 0)
|
||||
{
|
||||
if (m_CastCommandModule == null)
|
||||
{
|
||||
state.Mobile.SendGump(new ScrollGump(m_Book, m_Info, m_TextHue, state.Mobile));
|
||||
return;
|
||||
}
|
||||
|
||||
m_CastCommandModule.RemoveCommandByInfo(m_CastInfo);
|
||||
state.Mobile.SendGump(new ScrollGump(m_Book, m_Info, m_TextHue, state.Mobile));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_CastCommandModule == null)
|
||||
{
|
||||
CentralMemory.AddModule(new CastCommandsModule(state.Mobile.Serial, command, m_CastInfo));
|
||||
state.Mobile.SendGump(new ScrollGump(m_Book, m_Info, m_TextHue, state.Mobile));
|
||||
return;
|
||||
}
|
||||
|
||||
m_CastCommandModule.Add(command, m_CastInfo);
|
||||
state.Mobile.SendGump(new ScrollGump(m_Book, m_Info, m_TextHue, state.Mobile));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
using Server.ACC.CM;
|
||||
using Server.ACC.CSS.Modules;
|
||||
|
||||
namespace Server.ACC.CSS
|
||||
{
|
||||
public class SpellIconGump : Gump
|
||||
{
|
||||
private IconInfo m_Info;
|
||||
|
||||
public SpellIconGump(IconInfo info)
|
||||
: base(((Point3D)info.Location).X, ((Point3D)info.Location).Y)
|
||||
{
|
||||
m_Info = info;
|
||||
|
||||
Closable = false;
|
||||
Disposable = false;
|
||||
Dragable = false;
|
||||
Resizable = false;
|
||||
|
||||
AddPage(0);
|
||||
AddBackground(0, 0, 54, 54, ((Point3D)info.Location).Z);
|
||||
AddButton(45, 0, 9008, 9010, 1, GumpButtonType.Reply, 0);
|
||||
AddButton(5, 5, m_Info.Icon, m_Info.Icon, 2, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
if (!CSS.Running || !CentralMemory.Running)
|
||||
return;
|
||||
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
IconsModule mod = new IconsModule(state.Mobile.Serial, m_Info);
|
||||
CentralMemory.AppendModule(state.Mobile.Serial, (Module)mod, true);
|
||||
state.Mobile.SendMessage("That icon has been removed and will not open again.");
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
{
|
||||
if (!Multis.DesignContext.Check(state.Mobile))
|
||||
{
|
||||
state.Mobile.SendMessage("You cannot cast while customizing!");
|
||||
state.Mobile.SendGump(new SpellIconGump(m_Info));
|
||||
return;
|
||||
}
|
||||
if (SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions(state.Mobile, m_Info.SpellType))
|
||||
{
|
||||
state.Mobile.SendMessage("You are not allowed to cast this spell.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CSpellbook.MobileHasSpell(state.Mobile, m_Info.School, m_Info.SpellType))
|
||||
{
|
||||
state.Mobile.SendMessage("You do not have this spell.");
|
||||
goto case 1;
|
||||
}
|
||||
|
||||
Spell spell = SpellInfoRegistry.NewSpell(m_Info.SpellType, m_Info.School, state.Mobile, null);
|
||||
if (spell != null)
|
||||
spell.Cast();
|
||||
else
|
||||
{
|
||||
state.Mobile.SendMessage("This spell has been disabled.");
|
||||
goto case 1;
|
||||
}
|
||||
|
||||
state.Mobile.SendGump(new SpellIconGump(m_Info));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Items;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.ACC.CSS
|
||||
{
|
||||
public class SpellInfoRegistry
|
||||
{
|
||||
private static Hashtable m_Registry = new Hashtable();
|
||||
public static Hashtable Registry{ get{ return m_Registry; } set{ m_Registry = value; } }
|
||||
|
||||
public static void Register( Type type, string name, string desc, string regs, string info, int icon, int back, School school )
|
||||
{
|
||||
if( !m_Registry.ContainsKey( school ) )
|
||||
m_Registry.Add( school, new ArrayList() );
|
||||
|
||||
if( ((ArrayList)m_Registry[school]).Count < 64 )
|
||||
{
|
||||
CSpellInfo inf = new CSpellInfo( type, name, desc, regs, info, icon, back, school, true );
|
||||
|
||||
((ArrayList)m_Registry[school]).Add( inf );
|
||||
}
|
||||
else
|
||||
Console.WriteLine( "You cannot register more than 64 spells to the {0} school.", school );
|
||||
}
|
||||
|
||||
public static void DisEnable( School school, Type type, bool enabled )
|
||||
{
|
||||
foreach( CSpellInfo info in (ArrayList)m_Registry[school] )
|
||||
{
|
||||
if( info.Type == type )
|
||||
info.Enabled = enabled;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool CheckRegistry( School school, Type type )
|
||||
{
|
||||
if( !CSS.Running )
|
||||
return false;
|
||||
|
||||
if( school == School.Invalid )
|
||||
return true;
|
||||
|
||||
if( m_Registry.ContainsKey( school ) )
|
||||
{
|
||||
foreach( CSpellInfo info in (ArrayList)m_Registry[school] )
|
||||
{
|
||||
if( info.Type == type && info.Enabled )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool CheckBooksForSchool( Mobile mobile, Type type )
|
||||
{
|
||||
Item item = mobile.FindItemOnLayer( Layer.OneHanded );
|
||||
if( item is CSpellbook && CheckRegistry( ((CSpellbook)item).School, type ) )
|
||||
return true;
|
||||
|
||||
Container pack = mobile.Backpack;
|
||||
if( pack == null )
|
||||
return false;
|
||||
|
||||
for( int i = 0; i < pack.Items.Count; i++ )
|
||||
{
|
||||
item = (Item)pack.Items[i];
|
||||
if( item is CSpellbook && CheckRegistry( ((CSpellbook)item).School, type ) )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static CSpellInfo GetInfo( School school, Type type )
|
||||
{
|
||||
if( m_Registry.ContainsKey( school ) )
|
||||
{
|
||||
foreach( CSpellInfo info in (ArrayList)m_Registry[school] )
|
||||
{
|
||||
if( info.Type == type && info.Enabled )
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ArrayList GetSpellsForSchool( School school )
|
||||
{
|
||||
ArrayList ret = new ArrayList();
|
||||
if( m_Registry.ContainsKey( school ) )
|
||||
{
|
||||
foreach( CSpellInfo info in (ArrayList)m_Registry[school] )
|
||||
{
|
||||
ret.Add( info.Type );
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
private static object[] m_Params = new object[2];
|
||||
|
||||
public static Spell NewSpell( Type type, School school, Mobile caster, Item scroll )
|
||||
{
|
||||
if( !CSS.Running )
|
||||
return null;
|
||||
else if( school == School.Invalid && scroll == null && !CheckBooksForSchool( caster, type ) )
|
||||
return null;
|
||||
else if( !CheckRegistry( school, type ) )
|
||||
return null;
|
||||
else if( !SpellRestrictions.UseRestrictions && SpellRestrictions.CheckRestrictions( caster, type ) )
|
||||
return null;
|
||||
|
||||
m_Params[0] = caster;
|
||||
m_Params[1] = scroll;
|
||||
|
||||
return (Spell)Activator.CreateInstance( type, m_Params );;
|
||||
}
|
||||
}
|
||||
|
||||
public class CSpellInfo
|
||||
{
|
||||
private Type m_Type;
|
||||
private string m_Name;
|
||||
private string m_Desc;
|
||||
private string m_Regs;
|
||||
private string m_Info;
|
||||
private int m_Icon;
|
||||
private int m_Back;
|
||||
private School m_School;
|
||||
private bool m_Enabled;
|
||||
|
||||
public Type Type { get{ return m_Type; } }
|
||||
public string Name { get{ return m_Name; } }
|
||||
public string Desc { get{ return m_Desc; } }
|
||||
public string Regs { get{ return m_Regs; } }
|
||||
public string Info { get{ return m_Info; } }
|
||||
public int Icon { get{ return m_Icon; } }
|
||||
public int Back { get{ return m_Back; } }
|
||||
public School School { get{ return m_School; } }
|
||||
public bool Enabled{ get{ return m_Enabled; } set{ m_Enabled = value; } }
|
||||
|
||||
public CSpellInfo( Type type, string name, string desc, string regs, string info, int icon, int back, School school, bool enabled )
|
||||
{
|
||||
m_Type = type;
|
||||
m_Name = name;
|
||||
m_Desc = desc;
|
||||
m_Regs = regs;
|
||||
m_Info = info;
|
||||
m_Icon = icon;
|
||||
m_Back = back;
|
||||
m_School = school;
|
||||
m_Enabled = enabled;
|
||||
}
|
||||
|
||||
public CSpellInfo( GenericReader reader )
|
||||
{
|
||||
Deserialize( reader );
|
||||
}
|
||||
|
||||
public void Serialize( GenericWriter writer )
|
||||
{
|
||||
writer.Write( (int)0 ); //version
|
||||
|
||||
writer.Write( (string)m_Type.Name );
|
||||
writer.Write( (int)m_School );
|
||||
writer.Write( (bool)m_Enabled );
|
||||
}
|
||||
|
||||
public void Deserialize( GenericReader reader )
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Type = ScriptCompiler.FindTypeByName(reader.ReadString());
|
||||
m_School = (School)reader.ReadInt();
|
||||
m_Enabled = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS
|
||||
{
|
||||
public class CReagent
|
||||
{
|
||||
private static Type[] m_Types = new Type[4]
|
||||
{
|
||||
typeof( SpringWater ),
|
||||
typeof( DestroyingAngel ),
|
||||
typeof( PetrafiedWood ),
|
||||
typeof( Kindling )
|
||||
};
|
||||
|
||||
public static Type SpringWater
|
||||
{
|
||||
get{ return m_Types[0]; }
|
||||
set{ m_Types[0] = value; }
|
||||
}
|
||||
public static Type DestroyingAngel
|
||||
{
|
||||
get{ return m_Types[1]; }
|
||||
set{ m_Types[1] = value; }
|
||||
}
|
||||
public static Type PetrafiedWood
|
||||
{
|
||||
get{ return m_Types[2]; }
|
||||
set{ m_Types[2] = value; }
|
||||
}
|
||||
public static Type Kindling
|
||||
{
|
||||
get{ return m_Types[3]; }
|
||||
set{ m_Types[3] = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.ACC.CSS
|
||||
{
|
||||
public static class CSSettings
|
||||
{
|
||||
/*
|
||||
* Initial setting. Will read from saves after first save.
|
||||
* Set to true if you want custom Spellbooks to be created full, unless you specify in the creation.
|
||||
*/
|
||||
public static bool FullSpellbooks { get { return false; } }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.ACC.CSS
|
||||
{
|
||||
public class CSkillCheck
|
||||
{
|
||||
//Set this to false if you only want to use custom skills.
|
||||
public static bool UseDefaultSkills = true;
|
||||
|
||||
//Return true if they cast.
|
||||
public static bool CheckSkill( Mobile from, Type type )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DestroyingAngel : BaseReagent//, ICommodity
|
||||
{
|
||||
// int ICommodity.DescriptionNumber { get { return LabelNumber; } }
|
||||
// bool ICommodity.IsDeedable { get { return (Core.ML); } }
|
||||
|
||||
[Constructable]
|
||||
public DestroyingAngel() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DestroyingAngel( int amount ) : base( 0xE1F, amount )
|
||||
{
|
||||
Hue = 0x290;
|
||||
Name = "destroying angel";
|
||||
}
|
||||
|
||||
public DestroyingAngel( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 1 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PetrafiedWood : BaseReagent//, ICommodity
|
||||
{
|
||||
///int ICommodity.DescriptionNumber { get { return LabelNumber; } }
|
||||
//bool ICommodity.IsDeedable { get { return (Core.ML); } }
|
||||
|
||||
[Constructable]
|
||||
public PetrafiedWood() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public PetrafiedWood( int amount ) : base( 0x97A, amount )
|
||||
{
|
||||
Hue = 0x46C;
|
||||
Name = "petrified wood";
|
||||
}
|
||||
|
||||
public PetrafiedWood( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 1 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SpringWater : BaseReagent//, ICommodity
|
||||
{
|
||||
|
||||
//int ICommodity.DescriptionNumber { get { return LabelNumber; } }
|
||||
//bool ICommodity.IsDeedable { get { return (Core.ML); } }
|
||||
|
||||
[Constructable]
|
||||
public SpringWater() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SpringWater( int amount ) : base( 0xE24, amount )
|
||||
{
|
||||
Hue = 0x47F;
|
||||
Name = "spring water";
|
||||
}
|
||||
|
||||
public SpringWater( 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,24 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace Server.ACC.CSS
|
||||
{
|
||||
[Flags]
|
||||
public enum School
|
||||
{
|
||||
Invalid = 0x00000000,
|
||||
Magery = 0x00000001,
|
||||
Necro = 0x00000002,
|
||||
Chivalry = 0x00000004,
|
||||
Ninja = 0x00000008,
|
||||
Samurai = 0x00000010,
|
||||
Druid = 0x00000020,
|
||||
Avatar = 0x00000040,
|
||||
Bard = 0x00000080,
|
||||
Cleric = 0x00000100,
|
||||
Ranger = 0x00000200,
|
||||
Rogue = 0x00000400,
|
||||
Undead = 0x00000800,
|
||||
Ancient = 0x00001000,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.CSS
|
||||
{
|
||||
public class SpellRestrictions
|
||||
{
|
||||
//Set Restricted to true if you want to check restrictions.
|
||||
public static bool UseRestrictions = true;
|
||||
|
||||
/* All checks should be written in this method. Return true if they can cast. */
|
||||
public static bool CheckRestrictions( Mobile caster, School school )
|
||||
{
|
||||
if( caster.AccessLevel >= AccessLevel.GameMaster )
|
||||
return true;
|
||||
|
||||
return !(school == School.Invalid);
|
||||
}
|
||||
|
||||
/* This method should be left alone */
|
||||
public static bool CheckRestrictions( Mobile caster, Type type )
|
||||
{
|
||||
Item item = caster.FindItemOnLayer( Layer.OneHanded );
|
||||
if( item is CSpellbook && CheckRestrictions( caster, ((CSpellbook)item).School ) )
|
||||
return true;
|
||||
|
||||
Container pack = caster.Backpack;
|
||||
if( pack == null )
|
||||
return false;
|
||||
|
||||
for( int i = 0; i < pack.Items.Count; i++ )
|
||||
{
|
||||
item = (Item)pack.Items[i];
|
||||
if( item is CSpellbook && CheckRestrictions( caster, ((CSpellbook)item).School ) )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user