Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Server.ContextMenus;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.YS
|
||||
{
|
||||
public class StairRefundEntry : ContextMenuEntry
|
||||
{
|
||||
private Mobile m_From;
|
||||
private YardStair m_Stair;
|
||||
private int value = 0;
|
||||
|
||||
public StairRefundEntry(Mobile from, YardStair stair, int price)
|
||||
: base(6104, 9)
|
||||
{
|
||||
m_From = from;
|
||||
m_Stair = stair;
|
||||
value = price;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
m_Stair.Refund();
|
||||
}
|
||||
}
|
||||
|
||||
public class YardSecurityEntry : ContextMenuEntry
|
||||
{
|
||||
private Mobile m_From;
|
||||
private BaseDoor m_Gate;
|
||||
|
||||
public YardSecurityEntry(Mobile from, YardGate gate)
|
||||
: base(6203, 9)
|
||||
{
|
||||
m_From = from;
|
||||
m_Gate = gate;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
m_From.SendGump(new YardSecurityGump(m_From, m_Gate));
|
||||
}
|
||||
}
|
||||
|
||||
public class RefundEntry : ContextMenuEntry
|
||||
{
|
||||
private Mobile m_From;
|
||||
private YardGate m_Gate;
|
||||
private int value = 0;
|
||||
|
||||
public RefundEntry(Mobile from, YardGate gate, int price)
|
||||
: base(6104, 9)
|
||||
{
|
||||
m_From = from;
|
||||
m_Gate = gate;
|
||||
value = price;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
m_Gate.Refund();
|
||||
}
|
||||
}
|
||||
}
|
||||
84
Scripts/SubSystem/ACC/ACC Yard System/Core/YGSettingsGump.cs
Normal file
84
Scripts/SubSystem/ACC/ACC Yard System/Core/YGSettingsGump.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.ACC.YS
|
||||
{
|
||||
public class YGSettingsGump : Gump
|
||||
{
|
||||
public YardShovel m_Shovel;
|
||||
public YGSettingsGump(YardShovel shovel, Mobile from)
|
||||
: base(0, 0)
|
||||
{
|
||||
m_Shovel = shovel;
|
||||
string xstart = m_Shovel.XStart.ToString();
|
||||
string ystart = m_Shovel.YStart.ToString();
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
AddPage(0);
|
||||
AddBackground(0, 0, 200, 200, 9200);
|
||||
AddAlphaRegion(10, 9, 180, 180);
|
||||
AddLabel(71, 16, 0, @"Settings");
|
||||
AddBackground(46, 51, 108, 28, 0x2486);
|
||||
AddBackground(46, 91, 108, 28, 0x2486);
|
||||
AddLabel(15, 55, 0, "X - ");
|
||||
AddTextEntry(50, 55, 100, 20, 0, (int)Buttons.XCoordTextBox, xstart.ToString());
|
||||
AddLabel(15, 95, 0, "Y - ");
|
||||
AddTextEntry(50, 95, 100, 20, 0, (int)Buttons.YCoordTextBox, ystart.ToString());
|
||||
AddButton(68, 145, 238, 239, (int)Buttons.OK, GumpButtonType.Reply, 0);
|
||||
|
||||
}
|
||||
|
||||
public enum Buttons
|
||||
{
|
||||
Exit,
|
||||
XCoordTextBox,
|
||||
YCoordTextBox,
|
||||
OK,
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case (int)Buttons.OK:
|
||||
{
|
||||
TextRelay xrelay = info.GetTextEntry((int)Buttons.XCoordTextBox);
|
||||
TextRelay yrelay = info.GetTextEntry((int)Buttons.YCoordTextBox);
|
||||
string xtext = (xrelay == null ? null : xrelay.Text.Trim());
|
||||
string ytext = (yrelay == null ? null : yrelay.Text.Trim());
|
||||
if (xtext == null || xtext.Length == 0 || ytext == null || ytext.Length == 0)
|
||||
{
|
||||
from.SendMessage("You must enter an integer value in each box. (0 , 400, 245 )");
|
||||
}
|
||||
else
|
||||
{
|
||||
int x = m_Shovel.XStart;
|
||||
int y = m_Shovel.YStart;
|
||||
try
|
||||
{
|
||||
x = Int32.Parse(xtext);
|
||||
y = Int32.Parse(ytext);
|
||||
m_Shovel.XStart = x;
|
||||
m_Shovel.YStart = y;
|
||||
}
|
||||
catch
|
||||
{
|
||||
from.SendMessage("You must enter an integer value in each box. (0 , 400, 245 )");
|
||||
}
|
||||
}
|
||||
|
||||
from.SendGump(new YardGump(from, m_Shovel, m_Shovel.Category, m_Shovel.Page, 0, 0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
250
Scripts/SubSystem/ACC/ACC Yard System/Core/YardGump.cs
Normal file
250
Scripts/SubSystem/ACC/ACC Yard System/Core/YardGump.cs
Normal file
@@ -0,0 +1,250 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections;
|
||||
using Server.Misc;
|
||||
using System.Text;
|
||||
|
||||
namespace Server.ACC.YS
|
||||
{
|
||||
public class YardGump : Gump
|
||||
{
|
||||
int m_SelectedID;
|
||||
int m_ItemPrice = 0;
|
||||
int m_PlayerGold = 0;
|
||||
YardShovel m_Shovel;
|
||||
//New registry
|
||||
string[] m_Categories;
|
||||
YardGumpCategory m_CurrentCategory;
|
||||
int m_CurrentPage;
|
||||
|
||||
public YardGump(Mobile owner, YardShovel shovel, string currentCategory, int currentPage, int itemID, int price)
|
||||
: base(shovel.XStart, shovel.YStart)
|
||||
{
|
||||
string Title = "Yard & Garden System - " + currentCategory;
|
||||
m_SelectedID = itemID;
|
||||
m_ItemPrice = price;
|
||||
m_Shovel = shovel;
|
||||
m_CurrentPage = currentPage;
|
||||
if (currentCategory != null && YardRegistry.Categories.ContainsKey(currentCategory))
|
||||
{
|
||||
m_CurrentCategory = YardRegistry.Categories[currentCategory];
|
||||
}
|
||||
m_Shovel.Category = currentCategory;
|
||||
m_Shovel.Page = currentPage;
|
||||
|
||||
ComputeGold(owner);
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
//Page 0
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(59, 55, 300, 300, 3600); //MainGround
|
||||
AddBackground(34, 0, 350, 50, 3600); //TitleGround
|
||||
AddBackground(385, 209, 150, 200, 3600); //PicGround
|
||||
|
||||
AddBackground(59, 358, 300, 50, 3600); //PriceGround
|
||||
AddBackground(372, 93, 165, 50, 3600); //PlaceGround
|
||||
AddBackground(372, 143, 165, 50, 3600); //GoldGround
|
||||
|
||||
AddButton(472, 102, 2642, 2643, (int)Buttons.Place, GumpButtonType.Reply, 0);
|
||||
AddLabel(398, 109, 197, "PLACE");
|
||||
AddItem(455, 98, 6022); //LPGrass
|
||||
AddItem(489, 98, 6024); //RPGrass
|
||||
|
||||
AddLabel(116, 375, 37, @"Price : ");
|
||||
AddLabel(166, 375, 37, String.Format("{0:0,0} Gold", m_ItemPrice));
|
||||
AddLabel(387, 160, 48, String.Format("Gold : {0:0,0}", m_PlayerGold));
|
||||
|
||||
AddItem(337, 110, 6019); //TGrass
|
||||
AddItem(337, 155, 6019); //BGrass
|
||||
AddItem(510, 183, 6024); //FGrass
|
||||
AddItem(328, 190, 3317); //TLog1
|
||||
AddItem(348, 195, 3318); //TLog2
|
||||
AddItem(371, 221, 3319); //TLog3
|
||||
AddItem(339, 354, 3316); //BLog1
|
||||
AddItem(362, 338, 3315); //BLog2
|
||||
|
||||
AddItem(0, 8, 3497); //LTree
|
||||
AddItem(330, 8, 3497); //RTree
|
||||
AddItem(334, 266, 3312); //RBVine
|
||||
AddItem(334, 192, 3312); //RMVine
|
||||
AddItem(334, 118, 3312); //RTVine
|
||||
AddItem(39, 266, 3308); //LBVine
|
||||
AddItem(39, 192, 3308); //LMVine
|
||||
AddItem(39, 118, 3308); //LTVine
|
||||
|
||||
AddItem(35, 325, 3310); //LPVine
|
||||
AddItem(307, 325, 3314); //RPVine
|
||||
AddButton(490, 365, 22124, 22125, (int)Buttons.Settings, GumpButtonType.Reply, 0);
|
||||
|
||||
AddBackground(538, 0, 165, 409, 3600);
|
||||
AddLabel(586, 16, 68, "Categories");
|
||||
|
||||
int categoryID = 0;
|
||||
m_Categories = new string[YardRegistry.Categories.Keys.Count];
|
||||
foreach (string categoryName in YardRegistry.Categories.Keys)
|
||||
{
|
||||
if (categoryName == currentCategory)
|
||||
{
|
||||
AddButton(557, 45 + (25 * categoryID), 2361, 2360, 8851 + categoryID, GumpButtonType.Reply, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(557, 45 + (25 * categoryID), 2360, 2361, 8851 + categoryID, GumpButtonType.Reply, 0);
|
||||
}
|
||||
AddLabel(570, 42 + (25 * categoryID), 69, categoryName);
|
||||
m_Categories[categoryID] = categoryName;
|
||||
categoryID++;
|
||||
}
|
||||
|
||||
if (m_CurrentCategory != null)
|
||||
{
|
||||
int i = 0;
|
||||
foreach (YardGumpEntry entry in m_CurrentCategory.Pages[m_CurrentPage].Values)
|
||||
{
|
||||
entry.AppendToGump(this, 107 + (i >= 12 ? 143 : 0), 95 + (i >= 12 ? 20 * (i - 12) : 20 * i));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string welcome = String.Format("{0} {1} {2} spaces in front, {3} spaces to the left, {4} spaces to the right and {5} spaces behind the house. {6}",
|
||||
"<basefont color=#99AA22>Welcome to the Yard & Garden System!",
|
||||
"Here you can purchase items for your yard. These items can be placed while standing in your house,",
|
||||
YardSettings.Front, YardSettings.Left, YardSettings.Right, YardSettings.Back,
|
||||
"(Can also be placed inside) Select the catagory to the right and design away!</basefont>");
|
||||
AddHtml(86, 96, 246, 258, welcome, false, false);
|
||||
}
|
||||
|
||||
if (m_CurrentCategory != null && m_CurrentCategory.Pages.Count > m_CurrentPage + 1)
|
||||
{
|
||||
AddButton(295, 74, 9903, 9904, (int)Buttons.Next, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
if (m_CurrentCategory != null && m_CurrentPage > 0)
|
||||
{
|
||||
AddButton(109, 74, 9909, 9910, (int)Buttons.Prev, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
if (m_SelectedID != 0)
|
||||
{
|
||||
AddItem(410, 235, m_SelectedID);
|
||||
}
|
||||
|
||||
AddLabel(80, 16, 68, Title);
|
||||
}
|
||||
|
||||
public enum Buttons
|
||||
{
|
||||
Exit,
|
||||
Settings = -1,
|
||||
Place = -2,
|
||||
Next = -3,
|
||||
Prev = -4,
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
if (info.ButtonID == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (info.ButtonID == (int)Buttons.Settings)
|
||||
{
|
||||
from.SendGump(new YGSettingsGump(m_Shovel, from));
|
||||
}
|
||||
else if (info.ButtonID == (int)Buttons.Next)
|
||||
{
|
||||
if (m_CurrentCategory != null && YardRegistry.Categories[m_CurrentCategory.Name].Pages.Count > m_CurrentPage + 1)
|
||||
{
|
||||
from.SendGump(new YardGump(from, m_Shovel, m_CurrentCategory.Name, m_CurrentPage + 1, m_SelectedID, m_ItemPrice));
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendGump(new YardGump(from, m_Shovel, "", 0, m_SelectedID, m_ItemPrice));
|
||||
}
|
||||
}
|
||||
else if (info.ButtonID == (int)Buttons.Prev)
|
||||
{
|
||||
if (m_CurrentCategory != null && m_CurrentPage > 0)
|
||||
{
|
||||
from.SendGump(new YardGump(from, m_Shovel, m_CurrentCategory.Name, m_CurrentPage - 1, m_SelectedID, m_ItemPrice));
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendGump(new YardGump(from, m_Shovel, "", 0, m_SelectedID, m_ItemPrice));
|
||||
}
|
||||
}
|
||||
else if (info.ButtonID == (int)Buttons.Place)
|
||||
{
|
||||
if (m_SelectedID > 0)
|
||||
{
|
||||
from.SendMessage("Please choose where to place the item");
|
||||
from.Target = new YardTarget(m_Shovel, from, m_SelectedID, m_ItemPrice, m_CurrentCategory.Name, m_CurrentPage);
|
||||
}
|
||||
}
|
||||
else if (info.ButtonID >= 8851 && info.ButtonID <= 8859)
|
||||
{
|
||||
//Change categories
|
||||
if (m_Categories != null && m_Categories.Length > info.ButtonID - 8851)
|
||||
{
|
||||
if (m_CurrentCategory != null)
|
||||
{
|
||||
from.SendGump(new YardGump(from, m_Shovel,
|
||||
m_Categories[info.ButtonID - 8851] == m_CurrentCategory.Name ? "" : m_Categories[info.ButtonID - 8851],
|
||||
0, m_SelectedID, m_ItemPrice));
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendGump(new YardGump(from, m_Shovel, m_Categories[info.ButtonID - 8851], 0, m_SelectedID, m_ItemPrice));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendGump(new YardGump(from, m_Shovel, "", 0, m_SelectedID, m_ItemPrice));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_SelectedID = info.ButtonID;
|
||||
if (m_CurrentCategory != null)
|
||||
{
|
||||
YardGumpEntry entry = m_CurrentCategory.GetEntry(m_SelectedID);
|
||||
if (entry != null)
|
||||
{
|
||||
m_ItemPrice = entry.Price;
|
||||
}
|
||||
|
||||
from.SendGump(new YardGump(from, m_Shovel, m_CurrentCategory.Name, m_CurrentPage, m_SelectedID, m_ItemPrice));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ComputeGold(Mobile from)
|
||||
{
|
||||
int goldInPack = 0;
|
||||
int goldInBank = 0;
|
||||
foreach (Gold gold in from.Backpack.FindItemsByType<Gold>(true))
|
||||
{
|
||||
goldInPack += gold.Amount;
|
||||
}
|
||||
|
||||
foreach (Gold gold in from.BankBox.FindItemsByType<Gold>(true))
|
||||
{
|
||||
goldInBank += gold.Amount;
|
||||
}
|
||||
|
||||
m_PlayerGold = goldInPack + goldInBank;
|
||||
}
|
||||
}
|
||||
}
|
||||
905
Scripts/SubSystem/ACC/ACC Yard System/Core/YardRegistry.cs
Normal file
905
Scripts/SubSystem/ACC/ACC Yard System/Core/YardRegistry.cs
Normal file
@@ -0,0 +1,905 @@
|
||||
using System.Collections.Generic;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.ACC.YS
|
||||
{
|
||||
public class YardGumpEntry
|
||||
{
|
||||
private int m_ItemID;
|
||||
public int ItemID
|
||||
{
|
||||
get { return m_ItemID; }
|
||||
set { m_ItemID = value; }
|
||||
}
|
||||
|
||||
private string m_Name;
|
||||
public string Name
|
||||
{
|
||||
get { return m_Name; }
|
||||
set { m_Name = value; }
|
||||
}
|
||||
|
||||
private int m_Price;
|
||||
public int Price
|
||||
{
|
||||
get { return m_Price; }
|
||||
set { m_Price = value; }
|
||||
}
|
||||
|
||||
public YardGumpEntry(int itemID, string name, int price)
|
||||
{
|
||||
ItemID = itemID;
|
||||
Price = price;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public void AppendToGump(Gump g, int x, int y)
|
||||
{
|
||||
g.AddLabel(x, y, 1150, Name);
|
||||
g.AddButton(x - 18, y + 5, 5032, 2361, ItemID, GumpButtonType.Reply, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public class YardGumpCategory
|
||||
{
|
||||
private string m_Name;
|
||||
public string Name
|
||||
{
|
||||
get { return m_Name; }
|
||||
set { m_Name = value; }
|
||||
}
|
||||
|
||||
private List<Dictionary<int, YardGumpEntry>> m_Pages;
|
||||
public List<Dictionary<int, YardGumpEntry>> Pages
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_Pages == null)
|
||||
{
|
||||
m_Pages = new List<Dictionary<int, YardGumpEntry>>();
|
||||
}
|
||||
return m_Pages;
|
||||
}
|
||||
set { m_Pages = value; }
|
||||
}
|
||||
|
||||
public YardGumpCategory(string name)
|
||||
{
|
||||
Name = name;
|
||||
Pages = new List<Dictionary<int, YardGumpEntry>>();
|
||||
}
|
||||
|
||||
public void AddEntry(YardGumpEntry entry)
|
||||
{
|
||||
if (Pages.Count == 0)
|
||||
{
|
||||
Pages.Add(new Dictionary<int, YardGumpEntry>());
|
||||
Pages[0].Add(entry.ItemID, entry);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Pages[Pages.Count - 1].Count >= 24)
|
||||
{
|
||||
Pages.Add(new Dictionary<int, YardGumpEntry>());
|
||||
}
|
||||
|
||||
Pages[Pages.Count - 1].Add(entry.ItemID, entry);
|
||||
}
|
||||
}
|
||||
|
||||
public YardGumpEntry GetEntry(int itemID)
|
||||
{
|
||||
if (Pages.Count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
foreach (Dictionary<int, YardGumpEntry> item in Pages)
|
||||
{
|
||||
if (item.ContainsKey(itemID) && item[itemID] != null)
|
||||
{
|
||||
return item[itemID];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class YardRegistry
|
||||
{
|
||||
public static Dictionary<int, List<YardMultiInfo>> YardMultiIDs;
|
||||
|
||||
/* This dictionary keeps track of the directions for each primary stair ID
|
||||
* When a YardStair is double clicked, it changes the ItemID to the next in the list
|
||||
* which changes the direction of the stair.
|
||||
*/
|
||||
public static Dictionary<int, int[]> YardStairIDGroups;
|
||||
|
||||
public static Dictionary<string, YardGumpCategory> Categories = new Dictionary<string, YardGumpCategory>();
|
||||
|
||||
public static void RegisterCategory(string category)
|
||||
{
|
||||
if (Categories == null)
|
||||
{
|
||||
Categories = new Dictionary<string, YardGumpCategory>();
|
||||
}
|
||||
|
||||
if (Categories.ContainsKey(category))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Categories.Add(category, new YardGumpCategory(category));
|
||||
}
|
||||
|
||||
public static YardGumpCategory GetRegisteredCategory(string category)
|
||||
{
|
||||
if (!Categories.ContainsKey(category))
|
||||
{
|
||||
RegisterCategory(category);
|
||||
}
|
||||
|
||||
return Categories[category];
|
||||
}
|
||||
|
||||
public static void RegisterEntry(string categoryName, int itemID, string name, int price)
|
||||
{
|
||||
YardGumpCategory category = GetRegisteredCategory(categoryName);
|
||||
if (category == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
YardGumpEntry entry = new YardGumpEntry(itemID, name, price);
|
||||
|
||||
category.AddEntry(entry);
|
||||
}
|
||||
|
||||
public static void Configure()
|
||||
{
|
||||
RegisterItems();
|
||||
RegisterMultis();
|
||||
RegisterStairs();
|
||||
}
|
||||
|
||||
public static void RegisterItems()
|
||||
{
|
||||
//Each category will hold 24 entries per page in order of their registration.
|
||||
|
||||
//Fences & Gates
|
||||
//For adding new gates/doors, please see YardGate.cs in the Items folder for examples.
|
||||
RegisterEntry("Fences & Gates", 2081, "T Iron N", 150);
|
||||
RegisterEntry("Fences & Gates", 2083, "T Iron E", 150);
|
||||
RegisterEntry("Fences & Gates", 2082, "T Iron C", 150);
|
||||
RegisterEntry("Fences & Gates", 2084, "T Iron Gate SDW", 150);
|
||||
RegisterEntry("Fences & Gates", 2086, "T Iron Gate SDE", 150);
|
||||
RegisterEntry("Fences & Gates", 2088, "T Iron Gate SUW", 150);
|
||||
RegisterEntry("Fences & Gates", 2090, "T Iron Gate SUE", 150);
|
||||
RegisterEntry("Fences & Gates", 2092, "T Iron Gate EUE", 150);
|
||||
RegisterEntry("Fences & Gates", 2094, "T Iron Gate EDE", 150);
|
||||
RegisterEntry("Fences & Gates", 2096, "T Iron Gate EDW", 150);
|
||||
RegisterEntry("Fences & Gates", 2098, "T Iron Gate EUW", 150);
|
||||
RegisterEntry("Fences & Gates", 2121, "S Iron N", 150);
|
||||
RegisterEntry("Fences & Gates", 2123, "S Iron E", 150);
|
||||
RegisterEntry("Fences & Gates", 2122, "S Iron C", 150);
|
||||
RegisterEntry("Fences & Gates", 2124, "S Iron Gate SDW", 150);
|
||||
RegisterEntry("Fences & Gates", 2126, "S Iron Gate SDE", 150);
|
||||
RegisterEntry("Fences & Gates", 2128, "S Iron Gate SUW", 150);
|
||||
RegisterEntry("Fences & Gates", 2130, "S Iron Gate SUE", 150);
|
||||
RegisterEntry("Fences & Gates", 2132, "S Iron Gate EUE", 150);
|
||||
RegisterEntry("Fences & Gates", 2134, "S Iron Gate EDE", 150);
|
||||
RegisterEntry("Fences & Gates", 2136, "S Iron Gate EDW", 150);
|
||||
RegisterEntry("Fences & Gates", 2138, "S Iron Gate EUW", 150);
|
||||
RegisterEntry("Fences & Gates", 2103, "Wood 1N", 150);
|
||||
RegisterEntry("Fences & Gates", 2102, "Wood 1E", 150);
|
||||
RegisterEntry("Fences & Gates", 2101, "Wood 1C", 150);
|
||||
RegisterEntry("Fences & Gates", 2104, "Wood 1T", 150);
|
||||
RegisterEntry("Fences & Gates", 2142, "Wood 2N", 150);
|
||||
RegisterEntry("Fences & Gates", 2141, "Wood 2E", 150);
|
||||
RegisterEntry("Fences & Gates", 2140, "Wood 2C", 150);
|
||||
RegisterEntry("Fences & Gates", 2143, "Wood 2T", 150);
|
||||
RegisterEntry("Fences & Gates", 2145, "Wood 2NLink", 150);
|
||||
RegisterEntry("Fences & Gates", 2144, "Wood 2ELink", 150);
|
||||
RegisterEntry("Fences & Gates", 2148, "Wood 3N", 150);
|
||||
RegisterEntry("Fences & Gates", 2147, "Wood 3E", 150);
|
||||
RegisterEntry("Fences & Gates", 2146, "Wood 3C", 150);
|
||||
RegisterEntry("Fences & Gates", 2149, "Wood 3T", 150);
|
||||
RegisterEntry("Fences & Gates", 2105, "L Wood Gate SDW", 150);
|
||||
RegisterEntry("Fences & Gates", 2107, "L Wood Gate SDE", 150);
|
||||
RegisterEntry("Fences & Gates", 2109, "L Wood Gate SUW", 150);
|
||||
RegisterEntry("Fences & Gates", 2111, "L Wood Gate SUE", 150);
|
||||
RegisterEntry("Fences & Gates", 2113, "L Wood Gate EUE", 150);
|
||||
RegisterEntry("Fences & Gates", 2115, "L Wood Gate EDE", 150);
|
||||
RegisterEntry("Fences & Gates", 2117, "L Wood Gate EDW", 150);
|
||||
RegisterEntry("Fences & Gates", 2119, "L Wood Gate EUW", 150);
|
||||
RegisterEntry("Fences & Gates", 2150, "D Wood Gate SDW", 150);
|
||||
RegisterEntry("Fences & Gates", 2152, "D Wood Gate SDE", 150);
|
||||
RegisterEntry("Fences & Gates", 2154, "D Wood Gate SUW", 150);
|
||||
RegisterEntry("Fences & Gates", 2156, "D Wood Gate SUE", 150);
|
||||
RegisterEntry("Fences & Gates", 2158, "D Wood Gate EUE", 150);
|
||||
RegisterEntry("Fences & Gates", 2160, "D Wood Gate EDE", 150);
|
||||
RegisterEntry("Fences & Gates", 2162, "D Wood Gate EDW", 150);
|
||||
RegisterEntry("Fences & Gates", 2164, "D Wood Gate EUW", 150);
|
||||
|
||||
//Ground"
|
||||
RegisterEntry("Ground", 3512, "Tall Bush", 150);
|
||||
RegisterEntry("Ground", 3215, "Short Bush 1", 150);
|
||||
RegisterEntry("Ground", 3217, "Short Bush 2", 150);
|
||||
RegisterEntry("Ground", 4963, "Rock 1", 50);
|
||||
RegisterEntry("Ground", 4964, "Rock 2", 50);
|
||||
RegisterEntry("Ground", 4965, "Rock 3", 50);
|
||||
RegisterEntry("Ground", 4966, "Rock 4", 50);
|
||||
RegisterEntry("Ground", 4967, "Rock 5", 50);
|
||||
RegisterEntry("Ground", 4968, "Rock 6", 50);
|
||||
RegisterEntry("Ground", 4969, "Rock 7", 50);
|
||||
RegisterEntry("Ground", 4970, "Rock 8", 50);
|
||||
RegisterEntry("Ground", 4971, "Rock 9", 50);
|
||||
RegisterEntry("Ground", 4972, "Rock 10", 50);
|
||||
RegisterEntry("Ground", 4973, "Rock 11", 50);
|
||||
RegisterEntry("Ground", 6001, "Rock 12", 50);
|
||||
RegisterEntry("Ground", 6002, "Rock 13", 50);
|
||||
RegisterEntry("Ground", 6003, "Rock 14", 50);
|
||||
RegisterEntry("Ground", 6004, "Rock 15", 50);
|
||||
RegisterEntry("Ground", 6005, "Rock 16", 50);
|
||||
RegisterEntry("Ground", 6006, "Rock 17", 50);
|
||||
RegisterEntry("Ground", 6007, "Rock 18", 50);
|
||||
RegisterEntry("Ground", 6008, "Rock 19", 50);
|
||||
RegisterEntry("Ground", 6009, "Rock 20", 50);
|
||||
RegisterEntry("Ground", 6010, "Rock 21", 50);
|
||||
RegisterEntry("Ground", 6011, "Rock 22", 50);
|
||||
RegisterEntry("Ground", 6012, "Rock 23", 50);
|
||||
RegisterEntry("Ground", 4534, "Rotating Rock", 100);
|
||||
|
||||
//Stairs"
|
||||
RegisterEntry("Stairs", 1006, "S1 Block", 50);
|
||||
RegisterEntry("Stairs", 1007, "S1 Stair", 50);
|
||||
RegisterEntry("Stairs", 1011, "S1 Corner", 50);
|
||||
RegisterEntry("Stairs", 1015, "S1 Curved", 50);
|
||||
RegisterEntry("Stairs", 1019, "S1 Invert", 50);
|
||||
RegisterEntry("Stairs", 1023, "S1 ICurved", 50);
|
||||
RegisterEntry("Stairs", 1801, "M Block", 50);
|
||||
RegisterEntry("Stairs", 1802, "M Stair", 50);
|
||||
RegisterEntry("Stairs", 1806, "M Corner", 50);
|
||||
RegisterEntry("Stairs", 1810, "M Curved", 50);
|
||||
RegisterEntry("Stairs", 1814, "M Invert", 50);
|
||||
RegisterEntry("Stairs", 1818, "M ICurved", 50);
|
||||
RegisterEntry("Stairs", 1822, "S2 Block", 50);
|
||||
RegisterEntry("Stairs", 1823, "S2 Stair", 50);
|
||||
RegisterEntry("Stairs", 1866, "S2 Corner", 50);
|
||||
RegisterEntry("Stairs", 1870, "S2 Curved", 50);
|
||||
RegisterEntry("Stairs", 1952, "S2 Invert", 50);
|
||||
RegisterEntry("Stairs", 2015, "S2 ICurved", 50);
|
||||
RegisterEntry("Stairs", 1825, "W1 Block", 50);
|
||||
RegisterEntry("Stairs", 1826, "W1 Stair", 50);
|
||||
RegisterEntry("Stairs", 1830, "W1 Corner", 50);
|
||||
RegisterEntry("Stairs", 1834, "W1 Curved", 50);
|
||||
RegisterEntry("Stairs", 1838, "W1 Invert", 50);
|
||||
RegisterEntry("Stairs", 1842, "W1 ICurved", 50);
|
||||
|
||||
//Stairs"
|
||||
RegisterEntry("Stairs", 1848, "W2 Block", 50);
|
||||
RegisterEntry("Stairs", 1849, "W2 Stair", 50);
|
||||
RegisterEntry("Stairs", 1853, "W2 Corner", 50);
|
||||
RegisterEntry("Stairs", 1861, "W2 Curved", 50);
|
||||
RegisterEntry("Stairs", 1857, "W2 Invert", 50);
|
||||
RegisterEntry("Stairs", 2170, "Wood Ramp", 50);
|
||||
RegisterEntry("Stairs", 1872, "S3 Block", 50);
|
||||
RegisterEntry("Stairs", 1873, "S3 Stair", 50);
|
||||
RegisterEntry("Stairs", 1877, "S3 Corner", 50);
|
||||
RegisterEntry("Stairs", 1881, "S3 Curved", 50);
|
||||
RegisterEntry("Stairs", 1885, "S3 Invert", 50);
|
||||
RegisterEntry("Stairs", 1889, "S3 ICurved", 50);
|
||||
RegisterEntry("Stairs", 1900, "SS1 Block", 50);
|
||||
RegisterEntry("Stairs", 1901, "SS1 Stair", 50);
|
||||
RegisterEntry("Stairs", 1905, "SS1 Corner", 50);
|
||||
RegisterEntry("Stairs", 1909, "SS1 Curved", 50);
|
||||
RegisterEntry("Stairs", 1913, "SS1 Invert", 50);
|
||||
RegisterEntry("Stairs", 1917, "SS1 ICurved", 50);
|
||||
RegisterEntry("Stairs", 1928, "S4 Block", 50);
|
||||
RegisterEntry("Stairs", 1929, "S4 Stair", 50);
|
||||
RegisterEntry("Stairs", 1933, "S4 Corner", 50);
|
||||
RegisterEntry("Stairs", 1937, "S4 Curved", 50);
|
||||
RegisterEntry("Stairs", 1941, "S4 Invert", 50);
|
||||
RegisterEntry("Stairs", 1945, "S4 ICurved", 50);
|
||||
|
||||
//Stairs"
|
||||
RegisterEntry("Stairs", 1955, "S5 Block", 50);
|
||||
RegisterEntry("Stairs", 1956, "S5 Stair", 50);
|
||||
RegisterEntry("Stairs", 1960, "S5 Corner", 50);
|
||||
RegisterEntry("Stairs", 1964, "S5 Invert", 50);
|
||||
RegisterEntry("Stairs", 1978, "Red Block", 50);
|
||||
RegisterEntry("Stairs", 1979, "Red Stair", 50);
|
||||
RegisterEntry("Stairs", 1991, "Red Curved", 50);
|
||||
RegisterEntry("Stairs", 1981, "Platform 1", 50);
|
||||
RegisterEntry("Stairs", 1983, "Platform 2", 50);
|
||||
RegisterEntry("Stairs", 1987, "Platform 3", 50);
|
||||
RegisterEntry("Stairs", 1993, "Wood Planks 1", 50);
|
||||
RegisterEntry("Stairs", 1997, "Wood Planks 2", 50);
|
||||
RegisterEntry("Stairs", 1173, "Floor 1", 50);
|
||||
RegisterEntry("Stairs", 1193, "Floor 2", 50);
|
||||
RegisterEntry("Stairs", 1250, "Floor 3", 50);
|
||||
RegisterEntry("Stairs", 1289, "Floor 4", 50);
|
||||
RegisterEntry("Stairs", 1294, "Floor 5", 50);
|
||||
RegisterEntry("Stairs", 1301, "Floor 6", 50);
|
||||
RegisterEntry("Stairs", 1035, "Dirt 1", 50);
|
||||
RegisterEntry("Stairs", 1039, "Dirt 2", 50);
|
||||
RegisterEntry("Stairs", 1043, "Dirt 3", 50);
|
||||
RegisterEntry("Stairs", 1047, "Dirt 4", 50);
|
||||
RegisterEntry("Stairs", 1051, "Dirt 5", 50);
|
||||
RegisterEntry("Stairs", 12789, "Dirt 6", 50);
|
||||
|
||||
//Water"
|
||||
RegisterEntry("Water", 13422, "Water East", 100);
|
||||
RegisterEntry("Water", 13460, "Water South", 100);
|
||||
RegisterEntry("Water", 6039, "Water Stagnant", 100);
|
||||
RegisterEntry("Water", 13493, "Whirlpool", 100);
|
||||
RegisterEntry("Water", 13555, "Waterfall E1", 100);
|
||||
RegisterEntry("Water", 13549, "Waterfall E2", 100);
|
||||
RegisterEntry("Water", 13561, "Waterfall E3", 100);
|
||||
RegisterEntry("Water", 13567, "Waterfall E4", 100);
|
||||
RegisterEntry("Water", 13573, "Waterfall E5", 100);
|
||||
RegisterEntry("Water", 13585, "Waterfall S1", 100);
|
||||
RegisterEntry("Water", 13579, "Waterfall S2", 100);
|
||||
RegisterEntry("Water", 13591, "Waterfall S3", 100);
|
||||
RegisterEntry("Water", 13597, "Waterfall S4", 100);
|
||||
RegisterEntry("Water", 13603, "Waterfall S5", 100);
|
||||
RegisterEntry("Water", 13446, "Large Rock E1", 100);
|
||||
RegisterEntry("Water", 13451, "Large Rock E2", 100);
|
||||
RegisterEntry("Water", 13345, "Large Rock S", 100);
|
||||
RegisterEntry("Water", 13356, "Small Rock E1", 100);
|
||||
RegisterEntry("Water", 13484, "Small Rock E2", 100);
|
||||
RegisterEntry("Water", 13488, "Small Rock S1", 100);
|
||||
RegisterEntry("Water", 13350, "Small Rock S2", 100);
|
||||
RegisterEntry("Water", 942, "Post", 100);
|
||||
RegisterEntry("Water", 5952, "Fountain 1", 500);
|
||||
RegisterEntry("Water", 6610, "Fountain 2", 500);
|
||||
|
||||
//Water"
|
||||
RegisterEntry("Water", 8099, "Small Wave N", 100);
|
||||
RegisterEntry("Water", 8104, "Small Wave W", 100);
|
||||
RegisterEntry("Water", 8109, "Small Wave E", 100);
|
||||
RegisterEntry("Water", 8114, "Small Wave S", 100);
|
||||
RegisterEntry("Water", 8119, "Large Wave N", 100);
|
||||
RegisterEntry("Water", 8124, "Large Wave W", 100);
|
||||
RegisterEntry("Water", 8129, "Large Wave E", 100);
|
||||
RegisterEntry("Water", 8134, "Large Wave S", 100);
|
||||
RegisterEntry("Water", 6045, "Edging 1", 50);
|
||||
RegisterEntry("Water", 6046, "Edging 2", 50);
|
||||
RegisterEntry("Water", 6047, "Edging 3", 50);
|
||||
RegisterEntry("Water", 6048, "Edging 4", 50);
|
||||
RegisterEntry("Water", 6049, "Edging 5", 50);
|
||||
RegisterEntry("Water", 6050, "Edging 6", 50);
|
||||
RegisterEntry("Water", 6051, "Edging 7", 50);
|
||||
RegisterEntry("Water", 6052, "Edging 8", 50);
|
||||
RegisterEntry("Water", 6053, "Edging 9", 50);
|
||||
RegisterEntry("Water", 6054, "Edging 10", 50);
|
||||
RegisterEntry("Water", 6055, "Edging 11", 50);
|
||||
RegisterEntry("Water", 6056, "Edging 12", 50);
|
||||
RegisterEntry("Water", 6057, "Edging 13", 50);
|
||||
RegisterEntry("Water", 6058, "Edging 14", 50);
|
||||
RegisterEntry("Water", 6059, "Edging 15", 50);
|
||||
RegisterEntry("Water", 6060, "Edging 16", 50);
|
||||
|
||||
//Lava"
|
||||
RegisterEntry("Lava", 4846, "Lava East 1", 100);
|
||||
RegisterEntry("Lava", 4852, "Lava East 2", 100);
|
||||
RegisterEntry("Lava", 4858, "Lava East 3", 100);
|
||||
RegisterEntry("Lava", 4864, "Lava East 4", 100);
|
||||
RegisterEntry("Lava", 4870, "Lava South 1", 100);
|
||||
RegisterEntry("Lava", 4876, "Lava South 2", 100);
|
||||
RegisterEntry("Lava", 4882, "Lava South 3", 100);
|
||||
RegisterEntry("Lava", 4888, "Lava South 4", 100);
|
||||
RegisterEntry("Lava", 4894, "Lava Edge 1", 100);
|
||||
RegisterEntry("Lava", 4897, "Lava Edge 2", 100);
|
||||
RegisterEntry("Lava", 4900, "Lava Edge 3", 100);
|
||||
RegisterEntry("Lava", 4903, "Lava Edge 4", 100);
|
||||
RegisterEntry("Lava", 4906, "Lava Edge 5", 100);
|
||||
RegisterEntry("Lava", 4909, "Lava Edge 6", 100);
|
||||
RegisterEntry("Lava", 4912, "Lava Edge 7", 100);
|
||||
RegisterEntry("Lava", 4915, "Lava Edge 8", 100);
|
||||
RegisterEntry("Lava", 4918, "Lava Edge 9", 100);
|
||||
RegisterEntry("Lava", 4921, "Lava Edge 10", 100);
|
||||
RegisterEntry("Lava", 4924, "Lava Edge 11", 100);
|
||||
RegisterEntry("Lava", 4927, "Lava Edge 12", 100);
|
||||
RegisterEntry("Lava", 4930, "Lava Edge 13", 100);
|
||||
RegisterEntry("Lava", 4933, "Lava Edge 14", 100);
|
||||
RegisterEntry("Lava", 4936, "Lava Edge 15", 100);
|
||||
RegisterEntry("Lava", 4939, "Lava Edge 16", 100);
|
||||
|
||||
//Lava"
|
||||
RegisterEntry("Lava", 6681, "Lavafall East 1", 100);
|
||||
RegisterEntry("Lava", 6686, "Lavafall East 2", 100);
|
||||
RegisterEntry("Lava", 6691, "Lavafall East 3", 100);
|
||||
RegisterEntry("Lava", 6696, "Lavafall East 4", 100);
|
||||
RegisterEntry("Lava", 6701, "Lavafall East 5", 100);
|
||||
RegisterEntry("Lava", 6706, "Lavafall East 6", 100);
|
||||
RegisterEntry("Lava", 6711, "Lavafall East 7", 100);
|
||||
RegisterEntry("Lava", 6715, "Lavafall East 8", 100);
|
||||
RegisterEntry("Lava", 6719, "Lavafall East 9", 100);
|
||||
RegisterEntry("Lava", 6723, "Lavafall East 10", 100);
|
||||
RegisterEntry("Lava", 13410, "Lava Stagnant 1", 100);
|
||||
RegisterEntry("Lava", 13371, "Bubble 1", 100);
|
||||
RegisterEntry("Lava", 13401, "Bubble 2", 100);
|
||||
RegisterEntry("Lava", 6727, "Lavafall South 1", 100);
|
||||
RegisterEntry("Lava", 6732, "Lavafall South 2", 100);
|
||||
RegisterEntry("Lava", 6737, "Lavafall South 3", 100);
|
||||
RegisterEntry("Lava", 6742, "Lavafall South 4", 100);
|
||||
RegisterEntry("Lava", 6747, "Lavafall South 5", 100);
|
||||
RegisterEntry("Lava", 6752, "Lavafall South 6", 100);
|
||||
RegisterEntry("Lava", 6757, "Lavafall South 7", 100);
|
||||
RegisterEntry("Lava", 6761, "Lavafall South 8", 100);
|
||||
RegisterEntry("Lava", 6765, "Lavafall South 9", 100);
|
||||
RegisterEntry("Lava", 6769, "Lavafall South 10", 100);
|
||||
RegisterEntry("Lava", 13416, "Lava Stagnant 2", 100);
|
||||
RegisterEntry("Lava", 13390, "Bubble 3", 100);
|
||||
|
||||
//Swamp"
|
||||
RegisterEntry("Swamp", 12813, "Swamp 1", 100);
|
||||
RegisterEntry("Swamp", 12819, "Swamp 2", 100);
|
||||
RegisterEntry("Swamp", 12826, "Swamp 3", 100);
|
||||
RegisterEntry("Swamp", 12832, "Swamp 4", 100);
|
||||
RegisterEntry("Swamp", 12838, "Swamp 5", 100);
|
||||
RegisterEntry("Swamp", 12844, "Bubble 1", 100);
|
||||
RegisterEntry("Swamp", 12854, "Bubble 2", 100);
|
||||
RegisterEntry("Swamp", 12865, "Bubble 3", 100);
|
||||
RegisterEntry("Swamp", 12876, "Stump 1", 100);
|
||||
RegisterEntry("Swamp", 12877, "Stump 2", 100);
|
||||
RegisterEntry("Swamp", 12878, "Log N1", 100);
|
||||
RegisterEntry("Swamp", 12879, "Log N2", 100);
|
||||
RegisterEntry("Swamp", 12880, "Log E1", 100);
|
||||
RegisterEntry("Swamp", 12881, "Log E2", 100);
|
||||
RegisterEntry("Swamp", 12888, "Edging 1", 100);
|
||||
RegisterEntry("Swamp", 12889, "Edging 2", 100);
|
||||
RegisterEntry("Swamp", 12890, "Edging 3", 100);
|
||||
RegisterEntry("Swamp", 12891, "Edging 4", 100);
|
||||
RegisterEntry("Swamp", 12892, "Edging 5", 100);
|
||||
RegisterEntry("Swamp", 12893, "Edging 6", 100);
|
||||
RegisterEntry("Swamp", 12894, "Edging 7", 100);
|
||||
RegisterEntry("Swamp", 12895, "Edging 8", 100);
|
||||
RegisterEntry("Swamp", 12896, "Edging 9", 100);
|
||||
RegisterEntry("Swamp", 12897, "Edging 10", 100);
|
||||
|
||||
//Swamp"
|
||||
RegisterEntry("Swamp", 12898, "Edging 11", 100);
|
||||
RegisterEntry("Swamp", 12899, "Edging 12", 100);
|
||||
RegisterEntry("Swamp", 12900, "Edging 13", 100);
|
||||
RegisterEntry("Swamp", 12901, "Edging 14", 100);
|
||||
RegisterEntry("Swamp", 12902, "Edging 15", 100);
|
||||
RegisterEntry("Swamp", 12903, "Edging 16", 100);
|
||||
RegisterEntry("Swamp", 12904, "Edging 17", 100);
|
||||
RegisterEntry("Swamp", 12912, "Edging 18", 50);
|
||||
RegisterEntry("Swamp", 12913, "Edging 19", 50);
|
||||
RegisterEntry("Swamp", 12914, "Edging 20", 50);
|
||||
RegisterEntry("Swamp", 12915, "Edging 21", 50);
|
||||
RegisterEntry("Swamp", 12916, "Edging 22", 50);
|
||||
RegisterEntry("Swamp", 12917, "Edging 23", 50);
|
||||
RegisterEntry("Swamp", 12918, "Edging 24", 50);
|
||||
RegisterEntry("Swamp", 12919, "Edging 25", 50);
|
||||
RegisterEntry("Swamp", 12920, "Edging 26", 50);
|
||||
RegisterEntry("Swamp", 12921, "Edging 27", 50);
|
||||
RegisterEntry("Swamp", 12922, "Edging 28", 50);
|
||||
RegisterEntry("Swamp", 12923, "Edging 29", 50);
|
||||
RegisterEntry("Swamp", 12924, "Edging 30", 50);
|
||||
RegisterEntry("Swamp", 12925, "Edging 31", 50);
|
||||
RegisterEntry("Swamp", 12926, "Edging 32", 50);
|
||||
RegisterEntry("Swamp", 12927, "Edging 33", 50);
|
||||
|
||||
//Plants"
|
||||
RegisterEntry("Plants", 3203, "Campion Flowers 1", 100);
|
||||
RegisterEntry("Plants", 3204, "Foxglove Flowers 1", 100);
|
||||
RegisterEntry("Plants", 3205, "Orfluer Flower", 100);
|
||||
RegisterEntry("Plants", 3206, "Red Poppies", 100);
|
||||
RegisterEntry("Plants", 3207, "Campion Flowers 2", 100);
|
||||
RegisterEntry("Plants", 3208, "Snowdrops 1", 100);
|
||||
RegisterEntry("Plants", 3209, "Campion Flowers 3", 100);
|
||||
RegisterEntry("Plants", 3210, "Foxglove Flowers 2", 100);
|
||||
RegisterEntry("Plants", 3211, "White Flowers 1", 100);
|
||||
RegisterEntry("Plants", 3212, "White Flowers 2", 100);
|
||||
RegisterEntry("Plants", 3213, "White Poppies", 100);
|
||||
RegisterEntry("Plants", 3214, "Snowdrops 2", 100);
|
||||
RegisterEntry("Plants", 3219, "Blade Plant", 100);
|
||||
RegisterEntry("Plants", 3220, "Bulrushes", 100);
|
||||
RegisterEntry("Plants", 3221, "Coconut Palm", 100);
|
||||
RegisterEntry("Plants", 3222, "Date Palm", 100);
|
||||
RegisterEntry("Plants", 3223, "Elephant Ear", 100);
|
||||
RegisterEntry("Plants", 3224, "Fan Plant", 100);
|
||||
RegisterEntry("Plants", 3225, "Small Palm 1", 100);
|
||||
RegisterEntry("Plants", 3226, "Small Palm 2", 100);
|
||||
RegisterEntry("Plants", 3227, "Small Palm 3", 100);
|
||||
RegisterEntry("Plants", 3228, "Small Palm 4", 100);
|
||||
RegisterEntry("Plants", 3229, "Small Palm 5", 100);
|
||||
RegisterEntry("Plants", 3230, "O'hii Tree", 100);
|
||||
|
||||
//Plants"
|
||||
RegisterEntry("Plants", 3244, "Grasses 1", 50);
|
||||
RegisterEntry("Plants", 3245, "Grasses 2", 50);
|
||||
RegisterEntry("Plants", 3246, "Grasses 3", 50);
|
||||
RegisterEntry("Plants", 3247, "Grasses 4", 50);
|
||||
RegisterEntry("Plants", 3248, "Grasses 5", 50);
|
||||
RegisterEntry("Plants", 3249, "Grasses 6", 50);
|
||||
RegisterEntry("Plants", 3250, "Grasses 7", 50);
|
||||
RegisterEntry("Plants", 3251, "Grasses 8", 50);
|
||||
RegisterEntry("Plants", 3252, "Grasses 9", 50);
|
||||
RegisterEntry("Plants", 3253, "Grasses 10", 50);
|
||||
RegisterEntry("Plants", 3254, "Grasses 11", 50);
|
||||
RegisterEntry("Plants", 3257, "Grasses 12", 50);
|
||||
RegisterEntry("Plants", 3258, "Grasses 13", 50);
|
||||
RegisterEntry("Plants", 3259, "Grasses 14", 50);
|
||||
RegisterEntry("Plants", 3260, "Grasses 15", 50);
|
||||
RegisterEntry("Plants", 3261, "Grasses 16", 50);
|
||||
RegisterEntry("Plants", 3269, "Grasses 17", 50);
|
||||
RegisterEntry("Plants", 3270, "Grasses 18", 50);
|
||||
RegisterEntry("Plants", 3278, "Grasses 19", 50);
|
||||
RegisterEntry("Plants", 3279, "Grasses 20", 50);
|
||||
RegisterEntry("Plants", 3255, "Cattails 1", 50);
|
||||
RegisterEntry("Plants", 3256, "Cattails 2", 50);
|
||||
RegisterEntry("Plants", 3262, "Poppies 1", 50);
|
||||
RegisterEntry("Plants", 3263, "Poppies 2", 50);
|
||||
|
||||
//Plants"
|
||||
RegisterEntry("Plants", 3264, "Orfluer Flowers 1", 100);
|
||||
RegisterEntry("Plants", 3265, "Orfluer Flowers 2", 100);
|
||||
RegisterEntry("Plants", 3237, "Pampas Grass 1", 100);
|
||||
RegisterEntry("Plants", 3276, "Century Plant 1", 150);
|
||||
RegisterEntry("Plants", 3277, "Century Plant 2", 150);
|
||||
RegisterEntry("Plants", 3283, "Yucca", 150);
|
||||
RegisterEntry("Plants", 3268, "Pampas Grass 2", 100);
|
||||
RegisterEntry("Plants", 3238, "Ponytail Palm", 100);
|
||||
RegisterEntry("Plants", 3239, "Rushes", 100);
|
||||
RegisterEntry("Plants", 3240, "Small Banana Tree", 150);
|
||||
RegisterEntry("Plants", 3241, "Snake Plant", 100);
|
||||
RegisterEntry("Plants", 3242, "Banana Tree", 150);
|
||||
RegisterEntry("Plants", 3231, "Fern 1", 100);
|
||||
RegisterEntry("Plants", 3232, "Fern 2", 100);
|
||||
RegisterEntry("Plants", 3233, "Fern 3", 100);
|
||||
RegisterEntry("Plants", 3234, "Fern 4", 100);
|
||||
RegisterEntry("Plants", 3235, "Fern 5", 100);
|
||||
RegisterEntry("Plants", 3236, "Fern 6", 100);
|
||||
RegisterEntry("Plants", 3273, "Spider Tree", 150);
|
||||
RegisterEntry("Plants", 3305, "Sapling 1", 150);
|
||||
RegisterEntry("Plants", 3306, "Sapling 2", 150);
|
||||
RegisterEntry("Plants", 3267, "Muck", 50);
|
||||
RegisterEntry("Plants", 3271, "Weed", 50);
|
||||
RegisterEntry("Plants", 3272, "Juniper Bush", 150);
|
||||
|
||||
//Plants"
|
||||
RegisterEntry("Plants", 3332, "Water Plant", 100);
|
||||
RegisterEntry("Plants", 3333, "Reeds", 100);
|
||||
RegisterEntry("Plants", 3334, "Lilypad 1", 50);
|
||||
RegisterEntry("Plants", 3335, "Lilypad 2", 50);
|
||||
RegisterEntry("Plants", 3336, "Lilypad 3", 50);
|
||||
RegisterEntry("Plants", 3337, "Lilypad 4", 50);
|
||||
RegisterEntry("Plants", 3338, "Lilypad 5", 50);
|
||||
RegisterEntry("Plants", 3339, "Lilypads", 100);
|
||||
RegisterEntry("Plants", 3381, "Pipe Cactus", 150);
|
||||
RegisterEntry("Plants", 3365, "Cactus 1", 100);
|
||||
RegisterEntry("Plants", 3366, "Cactus 2", 100);
|
||||
RegisterEntry("Plants", 3367, "Cactus 3", 100);
|
||||
RegisterEntry("Plants", 3368, "Cactus 4", 100);
|
||||
RegisterEntry("Plants", 3370, "Cactus 5", 100);
|
||||
RegisterEntry("Plants", 3372, "Cactus 6", 100);
|
||||
RegisterEntry("Plants", 3374, "Cactus 7", 100);
|
||||
RegisterEntry("Plants", 3342, "Mushrooms 1", 50);
|
||||
RegisterEntry("Plants", 3343, "Mushrooms 2", 50);
|
||||
RegisterEntry("Plants", 3344, "Mushrooms 3", 50);
|
||||
RegisterEntry("Plants", 3347, "Mushrooms 4", 50);
|
||||
RegisterEntry("Plants", 3348, "Mushrooms 5", 50);
|
||||
RegisterEntry("Plants", 3349, "Mushrooms 6", 50);
|
||||
RegisterEntry("Plants", 3350, "Mushrooms 7", 50);
|
||||
RegisterEntry("Plants", 3351, "Mushrooms 8", 50);
|
||||
|
||||
//Plants"
|
||||
RegisterEntry("Plants", 3307, "Vines 1", 100);
|
||||
RegisterEntry("Plants", 3308, "Vines 2", 100);
|
||||
RegisterEntry("Plants", 3309, "Vines 3", 100);
|
||||
RegisterEntry("Plants", 3310, "Vines 4", 100);
|
||||
RegisterEntry("Plants", 3311, "Vines 5", 100);
|
||||
RegisterEntry("Plants", 3312, "Vines 6", 100);
|
||||
RegisterEntry("Plants", 3313, "Vines 7", 100);
|
||||
RegisterEntry("Plants", 3314, "Vines 8", 100);
|
||||
RegisterEntry("Plants", 3380, "Morning Glories", 50);
|
||||
RegisterEntry("Plants", 3355, "Grapevines 1", 100);
|
||||
RegisterEntry("Plants", 3356, "Grapevines 2", 100);
|
||||
RegisterEntry("Plants", 3357, "Grapevines 3", 100);
|
||||
RegisterEntry("Plants", 3358, "Grapevines 4", 100);
|
||||
RegisterEntry("Plants", 3359, "Grapevines 5", 100);
|
||||
RegisterEntry("Plants", 3360, "Grapevines 6", 100);
|
||||
RegisterEntry("Plants", 3361, "Grapevines 7", 100);
|
||||
RegisterEntry("Plants", 3362, "Grapevines 8", 100);
|
||||
RegisterEntry("Plants", 3363, "Grapevines 9", 100);
|
||||
RegisterEntry("Plants", 3364, "Grapevines 10", 100);
|
||||
RegisterEntry("Plants", 3315, "Log Piece 1", 50);
|
||||
RegisterEntry("Plants", 3316, "Log Piece 2", 50);
|
||||
RegisterEntry("Plants", 3317, "Log Piece 3", 33);
|
||||
RegisterEntry("Plants", 3318, "Log Piece 4", 33);
|
||||
RegisterEntry("Plants", 3319, "Log Piece 5", 33);
|
||||
|
||||
//Trees"
|
||||
RegisterEntry("Trees", 3277, "Tree 1T", 200);
|
||||
RegisterEntry("Trees", 3278, "Leaves 1N ", 50);
|
||||
RegisterEntry("Trees", 3279, "Leaves 1F", 50);
|
||||
RegisterEntry("Trees", 3280, "Tree 2T", 200);
|
||||
RegisterEntry("Trees", 3281, "Leaves 2N", 50);
|
||||
RegisterEntry("Trees", 3282, "Leaves 2F", 50);
|
||||
RegisterEntry("Trees", 3283, "Tree 3T", 200);
|
||||
RegisterEntry("Trees", 3284, "Leaves 3N", 50);
|
||||
RegisterEntry("Trees", 3285, "Leaves 3F", 50);
|
||||
RegisterEntry("Trees", 3290, "Tree 4T", 200);
|
||||
RegisterEntry("Trees", 3291, "Leaves 4N", 50);
|
||||
RegisterEntry("Trees", 3292, "Leaves 4F", 50);
|
||||
RegisterEntry("Trees", 3293, "Tree 5T", 200);
|
||||
RegisterEntry("Trees", 3294, "Leaves 5N", 50);
|
||||
RegisterEntry("Trees", 3295, "Leaves 5F", 50);
|
||||
RegisterEntry("Trees", 3296, "Tree 6T", 200);
|
||||
RegisterEntry("Trees", 3297, "Leaves 6N", 50);
|
||||
RegisterEntry("Trees", 3298, "Leaves 6F", 50);
|
||||
RegisterEntry("Trees", 3299, "Tree 7T", 200);
|
||||
RegisterEntry("Trees", 3300, "Leaves 7N", 50);
|
||||
RegisterEntry("Trees", 3301, "Leaves 7F", 50);
|
||||
RegisterEntry("Trees", 3302, "Tree 8T", 200);
|
||||
RegisterEntry("Trees", 3303, "Leaves 8N", 50);
|
||||
RegisterEntry("Trees", 3304, "Leaves 8F", 50);
|
||||
|
||||
//Trees"
|
||||
RegisterEntry("Trees", 3476, "Tree 9T", 200);
|
||||
RegisterEntry("Trees", 3477, "Leaves 9N", 50);
|
||||
RegisterEntry("Trees", 3478, "Leaves 9O", 50);
|
||||
RegisterEntry("Trees", 3479, "Leaves 9F", 50);
|
||||
RegisterEntry("Trees", 3480, "Tree 10T", 200);
|
||||
RegisterEntry("Trees", 3481, "Leaves 10N", 50);
|
||||
RegisterEntry("Trees", 3482, "Leaves 10O", 50);
|
||||
RegisterEntry("Trees", 3483, "Leaves 10F", 50);
|
||||
RegisterEntry("Trees", 3484, "Tree 11T", 200);
|
||||
RegisterEntry("Trees", 3485, "Leaves 11N", 50);
|
||||
RegisterEntry("Trees", 3486, "Leaves 11O", 50);
|
||||
RegisterEntry("Trees", 3487, "Leaves 11F", 50);
|
||||
RegisterEntry("Trees", 3488, "Tree 12T", 200);
|
||||
RegisterEntry("Trees", 3489, "Leaves 12N", 50);
|
||||
RegisterEntry("Trees", 3490, "Leaves 12O", 50);
|
||||
RegisterEntry("Trees", 3491, "Leaves 12F", 50);
|
||||
RegisterEntry("Trees", 3492, "Tree 13T", 200);
|
||||
RegisterEntry("Trees", 3493, "Leaves 13N", 50);
|
||||
RegisterEntry("Trees", 3494, "Leaves 13O", 50);
|
||||
RegisterEntry("Trees", 3495, "Leaves 13F", 50);
|
||||
RegisterEntry("Trees", 3496, "Tree 14T", 200);
|
||||
RegisterEntry("Trees", 3497, "Leaves 14N", 50);
|
||||
RegisterEntry("Trees", 3498, "Leaves 14O", 50);
|
||||
RegisterEntry("Trees", 3499, "Leaves 14F", 50);
|
||||
|
||||
//Trees"
|
||||
RegisterEntry("Trees", 3286, "Tree 15T", 200);
|
||||
RegisterEntry("Trees", 3287, "Leaves 15N", 100);
|
||||
RegisterEntry("Trees", 3288, "Tree 16T", 200);
|
||||
RegisterEntry("Trees", 3289, "Leaves 16N", 100);
|
||||
RegisterEntry("Trees", 3395, "Jungle 1T", 400);
|
||||
RegisterEntry("Trees", 3401, "Leaves 1N", 200);
|
||||
RegisterEntry("Trees", 3408, "Leaves 1O", 200);
|
||||
RegisterEntry("Trees", 3417, "Jungle 2T", 400);
|
||||
RegisterEntry("Trees", 3423, "Leaves 2N", 200);
|
||||
RegisterEntry("Trees", 3430, "Leaves 2O", 200);
|
||||
RegisterEntry("Trees", 3440, "Jungle 3T", 400);
|
||||
RegisterEntry("Trees", 3446, "Leaves 3N", 200);
|
||||
RegisterEntry("Trees", 3453, "Leaves 3O", 200);
|
||||
RegisterEntry("Trees", 3461, "Jungle 4T", 400);
|
||||
RegisterEntry("Trees", 3465, "Leaves 4N", 200);
|
||||
RegisterEntry("Trees", 3470, "Leaves 4O", 200);
|
||||
RegisterEntry("Trees", 4793, "Yew Tree T", 1000);
|
||||
RegisterEntry("Trees", 4802, "Yew Tree L", 500);
|
||||
RegisterEntry("Trees", 3413, "Vines 1", 100);
|
||||
RegisterEntry("Trees", 3457, "Vines 3", 100);
|
||||
RegisterEntry("Trees", 3436, "Vines 2", 100);
|
||||
RegisterEntry("Trees", 3474, "Vines 4", 100);
|
||||
}
|
||||
|
||||
public static void RegisterMultis()
|
||||
{
|
||||
YardMultiIDs = new Dictionary<int, List<YardMultiInfo>>();
|
||||
int locationID;
|
||||
List<YardMultiInfo> infos;
|
||||
|
||||
#region Fountains
|
||||
//Sand
|
||||
infos = new List<YardMultiInfo>();
|
||||
locationID = 5946;
|
||||
infos.Add(new YardMultiInfo(locationID - 9, new Point3D(-2, 1, 0)));
|
||||
infos.Add(new YardMultiInfo(locationID - 8, new Point3D(-1, 1, 0)));
|
||||
infos.Add(new YardMultiInfo(locationID - 7, new Point3D(-0, 1, 0)));
|
||||
infos.Add(new YardMultiInfo(locationID - 6, new Point3D(+1, 1, 0)));
|
||||
|
||||
infos.Add(new YardMultiInfo(locationID - 5, new Point3D(+1, +0, 0)));
|
||||
infos.Add(new YardMultiInfo(locationID - 4, new Point3D(+1, -1, 0)));
|
||||
infos.Add(new YardMultiInfo(locationID - 3, new Point3D(+1, -2, 0)));
|
||||
|
||||
infos.Add(new YardMultiInfo(locationID - 2, new Point3D(+0, -2, 0)));
|
||||
infos.Add(new YardMultiInfo(locationID - 1, new Point3D(+0, -1, 0)));
|
||||
|
||||
infos.Add(new YardMultiInfo(locationID + 1, new Point3D(-1, +0, 0)));
|
||||
infos.Add(new YardMultiInfo(locationID + 2, new Point3D(-2, +0, 0)));
|
||||
|
||||
infos.Add(new YardMultiInfo(locationID + 3, new Point3D(-2, -1, 0)));
|
||||
infos.Add(new YardMultiInfo(locationID + 4, new Point3D(-1, -1, 0)));
|
||||
|
||||
infos.Add(new YardMultiInfo(locationID + 5, new Point3D(-1, -2, 0)));
|
||||
infos.Add(new YardMultiInfo(locationID + 6, new Point3D(-2, -2, 0)));
|
||||
YardMultiIDs.Add(locationID, infos);
|
||||
|
||||
//Stone
|
||||
infos = new List<YardMultiInfo>();
|
||||
locationID = 6604;
|
||||
infos.Add(new YardMultiInfo(locationID - 9, new Point3D(-2, 1, 0)));
|
||||
infos.Add(new YardMultiInfo(locationID - 8, new Point3D(-1, 1, 0)));
|
||||
infos.Add(new YardMultiInfo(locationID - 7, new Point3D(-0, 1, 0)));
|
||||
infos.Add(new YardMultiInfo(locationID - 6, new Point3D(+1, 1, 0)));
|
||||
|
||||
infos.Add(new YardMultiInfo(locationID - 5, new Point3D(+1, +0, 0)));
|
||||
infos.Add(new YardMultiInfo(locationID - 4, new Point3D(+1, -1, 0)));
|
||||
infos.Add(new YardMultiInfo(locationID - 3, new Point3D(+1, -2, 0)));
|
||||
|
||||
infos.Add(new YardMultiInfo(locationID - 2, new Point3D(+0, -2, 0)));
|
||||
infos.Add(new YardMultiInfo(locationID - 1, new Point3D(+0, -1, 0)));
|
||||
|
||||
infos.Add(new YardMultiInfo(locationID + 1, new Point3D(-1, +0, 0)));
|
||||
infos.Add(new YardMultiInfo(locationID + 2, new Point3D(-2, +0, 0)));
|
||||
|
||||
infos.Add(new YardMultiInfo(locationID + 3, new Point3D(-2, -1, 0)));
|
||||
infos.Add(new YardMultiInfo(locationID + 4, new Point3D(-1, -1, 0)));
|
||||
|
||||
infos.Add(new YardMultiInfo(locationID + 5, new Point3D(-1, -2, 0)));
|
||||
infos.Add(new YardMultiInfo(locationID + 6, new Point3D(-2, -2, 0)));
|
||||
YardMultiIDs.Add(locationID, infos);
|
||||
#endregion
|
||||
|
||||
#region Trees
|
||||
AddTreeInfo(3395, 2, 1, out infos);
|
||||
YardMultiIDs.Add(3395, infos);
|
||||
|
||||
AddTreeInfo(3401, 4, 3, out infos);
|
||||
YardMultiIDs.Add(3401, infos);
|
||||
|
||||
AddTreeInfo(3408, 3, 3, out infos);
|
||||
YardMultiIDs.Add(3408, infos);
|
||||
|
||||
AddTreeInfo(3417, 2, 2, out infos);
|
||||
YardMultiIDs.Add(3417, infos);
|
||||
|
||||
AddTreeInfo(3423, 3, 3, out infos);
|
||||
YardMultiIDs.Add(3423, infos);
|
||||
|
||||
AddTreeInfo(3430, 3, 3, out infos);
|
||||
YardMultiIDs.Add(3430, infos);
|
||||
|
||||
AddTreeInfo(3440, 2, 2, out infos);
|
||||
YardMultiIDs.Add(3440, infos);
|
||||
|
||||
AddTreeInfo(3446, 2, 2, out infos);
|
||||
YardMultiIDs.Add(3446, infos);
|
||||
|
||||
AddTreeInfo(3453, 3, 2, out infos);
|
||||
YardMultiIDs.Add(3453, infos);
|
||||
|
||||
AddTreeInfo(3461, 1, 1, out infos);
|
||||
YardMultiIDs.Add(3461, infos);
|
||||
|
||||
AddTreeInfo(3465, 2, 2, out infos);
|
||||
YardMultiIDs.Add(3465, infos);
|
||||
|
||||
AddTreeInfo(3470, 2, 2, out infos);
|
||||
YardMultiIDs.Add(3470, infos);
|
||||
|
||||
AddTreeInfo(4793, 3, 4, out infos);
|
||||
YardMultiIDs.Add(4793, infos);
|
||||
|
||||
AddTreeInfo(4802, 4, 5, out infos);
|
||||
YardMultiIDs.Add(4802, infos);
|
||||
|
||||
AddTreeInfo(3413, 1, 1, out infos);
|
||||
YardMultiIDs.Add(3413, infos);
|
||||
|
||||
AddTreeInfo(3436, -2, -1, out infos);
|
||||
YardMultiIDs.Add(3436, infos);
|
||||
|
||||
AddTreeInfo(3457, 1, 2, out infos);
|
||||
YardMultiIDs.Add(3457, infos);
|
||||
|
||||
AddTreeInfo(3474, 1, 1, out infos);
|
||||
YardMultiIDs.Add(3474, infos);
|
||||
#endregion
|
||||
}
|
||||
|
||||
public static void AddTreeInfo(int locationID, int lowRange, int highRange, out List<YardMultiInfo> infos)
|
||||
{//Used while registering any trees that contain multiple itemIDs
|
||||
infos = new List<YardMultiInfo>();
|
||||
while (lowRange > 0)
|
||||
{
|
||||
infos.Add(new YardMultiInfo(locationID - lowRange, new Point3D(-lowRange, +lowRange, 0)));
|
||||
lowRange--;
|
||||
}
|
||||
while (highRange > 0)
|
||||
{
|
||||
infos.Add(new YardMultiInfo(locationID + highRange, new Point3D(+highRange, -highRange, 0)));
|
||||
highRange--;
|
||||
}
|
||||
}
|
||||
#region YardStairIDGroups
|
||||
|
||||
public static void RegisterStairs()
|
||||
{
|
||||
YardStairIDGroups = new Dictionary<int, int[]>();
|
||||
|
||||
YardStairIDGroups.Add(1006, new int[] { 1006, 1006, 1006, 1006 });
|
||||
YardStairIDGroups.Add(1007, new int[] { 1007, 1008, 1009, 1010 });
|
||||
YardStairIDGroups.Add(1011, new int[] { 1011, 1012, 1013, 1014 });
|
||||
YardStairIDGroups.Add(1015, new int[] { 1015, 1016, 1017, 1018 });
|
||||
YardStairIDGroups.Add(1019, new int[] { 1019, 1020, 1021, 1022 });
|
||||
YardStairIDGroups.Add(1023, new int[] { 1023, 1024, 1025, 1026 });
|
||||
YardStairIDGroups.Add(1035, new int[] { 1035, 1036, 1037, 1038 });
|
||||
YardStairIDGroups.Add(1039, new int[] { 1039, 1040, 1041, 1042 });
|
||||
YardStairIDGroups.Add(1043, new int[] { 1043, 1044, 1045, 1046 });
|
||||
YardStairIDGroups.Add(1047, new int[] { 1047, 1048, 1049, 1051 });
|
||||
YardStairIDGroups.Add(1051, new int[] { 1051, 1052, 1053, 1054 });
|
||||
YardStairIDGroups.Add(1173, new int[] { 1173, 1179, 1180, 1181 });
|
||||
YardStairIDGroups.Add(1193, new int[] { 1193, 1194, 1205, 1206 });
|
||||
YardStairIDGroups.Add(1250, new int[] { 1250, 1276, 1317, 1327 });
|
||||
YardStairIDGroups.Add(1289, new int[] { 1289, 1290, 1291, 1292 });
|
||||
YardStairIDGroups.Add(1294, new int[] { 1294, 1295, 1297, 1299 });
|
||||
YardStairIDGroups.Add(1301, new int[] { 1301, 1374, 1397, 1401 });
|
||||
YardStairIDGroups.Add(1801, new int[] { 1801, 1801, 1801, 1801 });
|
||||
YardStairIDGroups.Add(1802, new int[] { 1802, 1803, 1804, 1805 });
|
||||
YardStairIDGroups.Add(1806, new int[] { 1806, 1807, 1808, 1809 });
|
||||
YardStairIDGroups.Add(1810, new int[] { 1810, 1811, 1812, 1813 });
|
||||
YardStairIDGroups.Add(1814, new int[] { 1814, 1815, 1816, 1817 });
|
||||
YardStairIDGroups.Add(1818, new int[] { 1818, 1819, 1820, 1821 });
|
||||
YardStairIDGroups.Add(1822, new int[] { 1822, 1822, 1822, 1822 });
|
||||
YardStairIDGroups.Add(1823, new int[] { 1823, 1846, 1847, 1865 });
|
||||
YardStairIDGroups.Add(1825, new int[] { 1825, 1825, 1825, 1825 });
|
||||
YardStairIDGroups.Add(1826, new int[] { 1826, 1827, 1828, 1829 });
|
||||
YardStairIDGroups.Add(1830, new int[] { 1830, 1831, 1832, 1833 });
|
||||
YardStairIDGroups.Add(1834, new int[] { 1834, 1835, 1836, 1837 });
|
||||
YardStairIDGroups.Add(1838, new int[] { 1838, 1839, 1840, 1841 });
|
||||
YardStairIDGroups.Add(1842, new int[] { 1842, 1843, 1844, 1845 });
|
||||
YardStairIDGroups.Add(1848, new int[] { 1848, 1848, 1848, 1848 });
|
||||
YardStairIDGroups.Add(1849, new int[] { 1849, 1850, 1851, 1852 });
|
||||
YardStairIDGroups.Add(1853, new int[] { 1853, 1854, 1855, 1856 });
|
||||
YardStairIDGroups.Add(1857, new int[] { 1857, 1858, 1859, 1860 });
|
||||
YardStairIDGroups.Add(1861, new int[] { 1861, 1862, 1863, 1864 });
|
||||
YardStairIDGroups.Add(1866, new int[] { 1866, 1867, 1868, 1869 });
|
||||
YardStairIDGroups.Add(1870, new int[] { 1870, 1871, 1922, 1923 });
|
||||
YardStairIDGroups.Add(1872, new int[] { 1872, 1872, 1872, 1872 });
|
||||
YardStairIDGroups.Add(1873, new int[] { 1873, 1874, 1875, 1876 });
|
||||
YardStairIDGroups.Add(1877, new int[] { 1877, 1878, 1879, 1880 });
|
||||
YardStairIDGroups.Add(1881, new int[] { 1881, 1882, 1883, 1884 });
|
||||
YardStairIDGroups.Add(1885, new int[] { 1885, 1886, 1887, 1888 });
|
||||
YardStairIDGroups.Add(1889, new int[] { 1889, 1890, 1891, 1892 });
|
||||
YardStairIDGroups.Add(1900, new int[] { 1900, 1900, 1900, 1900 });
|
||||
YardStairIDGroups.Add(1901, new int[] { 1901, 1902, 1903, 1904 });
|
||||
YardStairIDGroups.Add(1905, new int[] { 1905, 1906, 1907, 1908 });
|
||||
YardStairIDGroups.Add(1909, new int[] { 1909, 1910, 1911, 1912 });
|
||||
YardStairIDGroups.Add(1913, new int[] { 1913, 1914, 1915, 1916 });
|
||||
YardStairIDGroups.Add(1917, new int[] { 1917, 1918, 1919, 1920 });
|
||||
YardStairIDGroups.Add(1928, new int[] { 1928, 1928, 1928, 1928 });
|
||||
YardStairIDGroups.Add(1929, new int[] { 1929, 1930, 1931, 1932 });
|
||||
YardStairIDGroups.Add(1933, new int[] { 1933, 1934, 1935, 1936 });
|
||||
YardStairIDGroups.Add(1937, new int[] { 1937, 1938, 1939, 1940 });
|
||||
YardStairIDGroups.Add(1941, new int[] { 1941, 1942, 1943, 1944 });
|
||||
YardStairIDGroups.Add(1945, new int[] { 1945, 1946, 1947, 1948 });
|
||||
YardStairIDGroups.Add(1952, new int[] { 1952, 1953, 1954, 2010 });
|
||||
YardStairIDGroups.Add(1955, new int[] { 1955, 1955, 1955, 1955 });
|
||||
YardStairIDGroups.Add(1956, new int[] { 1956, 1957, 1958, 1959 });
|
||||
YardStairIDGroups.Add(1960, new int[] { 1960, 1961, 1962, 1963 });
|
||||
YardStairIDGroups.Add(1964, new int[] { 1964, 1965, 1966, 1967 });
|
||||
YardStairIDGroups.Add(1978, new int[] { 1978, 1978, 1978, 1978 });
|
||||
YardStairIDGroups.Add(1979, new int[] { 1979, 1980, 1979, 1980 });
|
||||
YardStairIDGroups.Add(1981, new int[] { 1981, 1982, 1981, 1982 });
|
||||
YardStairIDGroups.Add(1983, new int[] { 1983, 1984, 1985, 1986 });
|
||||
YardStairIDGroups.Add(1987, new int[] { 1987, 1988, 1989, 1990 });
|
||||
YardStairIDGroups.Add(1991, new int[] { 1991, 1992, 1991, 1992 });
|
||||
YardStairIDGroups.Add(1993, new int[] { 1993, 1994, 1995, 1996 });
|
||||
YardStairIDGroups.Add(1997, new int[] { 1997, 1998, 1999, 2000 });
|
||||
YardStairIDGroups.Add(2015, new int[] { 2015, 2016, 2100, 2166 });
|
||||
YardStairIDGroups.Add(2170, new int[] { 2170, 2171, 2172, 2173 });
|
||||
YardStairIDGroups.Add(12789, new int[] { 12789, 12793, 12794, 12795 });
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.ACC.YS
|
||||
{
|
||||
public class YardSecurityGump : Gump
|
||||
{
|
||||
BaseDoor m_Gate;
|
||||
Mobile m_From;
|
||||
public YardSecurityGump(Mobile from, BaseDoor gate)
|
||||
: base(50, 50)
|
||||
{
|
||||
m_Gate = gate;
|
||||
m_From = from;
|
||||
this.Closable = true;
|
||||
this.Disposable = true;
|
||||
this.Dragable = true;
|
||||
this.Resizable = false;
|
||||
this.AddPage(0);
|
||||
this.AddBackground(0, 0, 200, 100, 9250);
|
||||
this.AddLabel(58, 13, 0, @"SET ACCESS");
|
||||
this.AddButton(131, 38, 1150, 1152, (int)Buttons.Unlock, GumpButtonType.Reply, 0);
|
||||
this.AddButton(40, 38, 1153, 1155, (int)Buttons.Lock, GumpButtonType.Reply, 0);
|
||||
this.AddLabel(38, 58, 0, @"Lock");
|
||||
this.AddLabel(123, 58, 0, @"Unlock");
|
||||
}
|
||||
|
||||
public enum Buttons
|
||||
{
|
||||
Lock,
|
||||
Unlock,
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case (int)Buttons.Lock:
|
||||
{
|
||||
m_Gate.Locked = true;
|
||||
m_From.SendMessage("You lock your gate");
|
||||
break;
|
||||
}
|
||||
case (int)Buttons.Unlock:
|
||||
{
|
||||
m_Gate.Locked = false;
|
||||
m_From.SendMessage("You unlock your gate");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
34
Scripts/SubSystem/ACC/ACC Yard System/Core/YardSettings.cs
Normal file
34
Scripts/SubSystem/ACC/ACC Yard System/Core/YardSettings.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Server.ACC.YS
|
||||
{
|
||||
public class YardSettings
|
||||
{
|
||||
//Demensions of the yard can be set here.
|
||||
//Set all to 0 if you only want the player to place inside their house.
|
||||
|
||||
// Spaces to left of house allowed for placement.
|
||||
public const int Left = 10;
|
||||
|
||||
// Spaces to right of house allowed for placement.
|
||||
public const int Right = 10;
|
||||
|
||||
// Spaces to front of house allowed for placement.
|
||||
public const int Front = 10;
|
||||
|
||||
// Spaces to back of house allowed for placement.
|
||||
public const int Back = 10;
|
||||
|
||||
//This variable is used to tell the system how many seconds after
|
||||
//the World.Save the cleanup of any orphaned YardItems happens.
|
||||
//Set it so it runs after the save is complete, so if your saves
|
||||
//take 10 seconds, set it to 15.
|
||||
public const int SecondsToCleanup = 30;
|
||||
|
||||
//This variable is used to tell the system if it allows placement
|
||||
//in other player's house.
|
||||
public const bool AllowOtherHouses = false;
|
||||
}
|
||||
}
|
||||
139
Scripts/SubSystem/ACC/ACC Yard System/Core/YardSystem.cs
Normal file
139
Scripts/SubSystem/ACC/ACC Yard System/Core/YardSystem.cs
Normal file
@@ -0,0 +1,139 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using Server.Commands;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.ACC.YS
|
||||
{
|
||||
public class YardSystem
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.WorldSave += new WorldSaveEventHandler(StartTimer);
|
||||
CommandSystem.Register("UpdateYardGates", AccessLevel.GameMaster, new CommandEventHandler(UpdateOldGates));
|
||||
}
|
||||
|
||||
//This command should not need to be used, but I left it in just in case.
|
||||
[Usage("UpdateYardGates")]
|
||||
[Description("Updates the old version of yard gates to the new version.")]
|
||||
public static void UpdateOldGates(CommandEventArgs e)
|
||||
{
|
||||
List<Item> toDelete = new List<Item>();
|
||||
|
||||
foreach (Item item in World.Items.Values)
|
||||
{
|
||||
if (item.GetType() == typeof(YardIronGate) ||
|
||||
item.GetType() == typeof(YardShortIronGate) ||
|
||||
item.GetType() == typeof(YardLightWoodGate) ||
|
||||
item.GetType() == typeof(YardDarkWoodGate))
|
||||
{
|
||||
toDelete.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < toDelete.Count; i++)
|
||||
{
|
||||
if (toDelete[i].GetType() == typeof(YardIronGate))
|
||||
{
|
||||
YardIronGate gate = (YardIronGate)toDelete[i];
|
||||
if (gate != null)
|
||||
{
|
||||
YardGate newGate = new YardGate(2084, gate.Placer, gate.Price, null, gate.Location, (DoorFacing)((gate.ClosedID - 2084) / 2));
|
||||
}
|
||||
}
|
||||
else if (toDelete[i].GetType() == typeof(YardShortIronGate))
|
||||
{
|
||||
YardShortIronGate gate = (YardShortIronGate)toDelete[i];
|
||||
if (gate != null)
|
||||
{
|
||||
YardGate newGate = new YardGate(2124, gate.Placer, gate.Price, null, gate.Location, (DoorFacing)((gate.ClosedID - 2124) / 2));
|
||||
}
|
||||
}
|
||||
else if (toDelete[i].GetType() == typeof(YardLightWoodGate))
|
||||
{
|
||||
YardLightWoodGate gate = (YardLightWoodGate)toDelete[i];
|
||||
if (gate != null)
|
||||
{
|
||||
YardGate newGate = new YardGate(2105, gate.Placer, gate.Price, null, gate.Location, (DoorFacing)((gate.ClosedID - 2105) / 2));
|
||||
}
|
||||
}
|
||||
else if (toDelete[i].GetType() == typeof(YardDarkWoodGate))
|
||||
{
|
||||
YardDarkWoodGate gate = (YardDarkWoodGate)toDelete[i];
|
||||
if (gate != null)
|
||||
{
|
||||
YardGate newGate = new YardGate(2150, gate.Placer, gate.Price, null, gate.Location, (DoorFacing)((gate.ClosedID - 2150) / 2));
|
||||
}
|
||||
}
|
||||
|
||||
toDelete[i].Delete();
|
||||
}
|
||||
|
||||
World.Save();
|
||||
}
|
||||
|
||||
public static List<Item> OrphanedYardItems = new List<Item>();
|
||||
|
||||
public static void AddOrphanedItem(Item item)
|
||||
{
|
||||
if (OrphanedYardItems == null)
|
||||
{
|
||||
OrphanedYardItems = new List<Item>();
|
||||
}
|
||||
|
||||
if (item == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
OrphanedYardItems.Add(item);
|
||||
}
|
||||
|
||||
public static void StartTimer(WorldSaveEventArgs args)
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(YardSettings.SecondsToCleanup), CleanYards);
|
||||
}
|
||||
|
||||
public static void CleanYards()
|
||||
{
|
||||
if (OrphanedYardItems == null || OrphanedYardItems.Count <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine(String.Format("Cleaning {0} Orphaned Yard Items...", OrphanedYardItems.Count));
|
||||
for (int i = 0; i < OrphanedYardItems.Count; i++)
|
||||
{
|
||||
if (OrphanedYardItems[i] is YardItem)
|
||||
{
|
||||
YardItem item = (YardItem)OrphanedYardItems[i];
|
||||
if (item == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
item.FindHouseOfPlacer();
|
||||
if (item.House == null)
|
||||
{
|
||||
item.Refund();
|
||||
}
|
||||
}
|
||||
else if (OrphanedYardItems[i] is YardGate)
|
||||
{
|
||||
YardGate item = (YardGate)OrphanedYardItems[i];
|
||||
if (item == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
item.FindHouseOfPlacer();
|
||||
if (item.House == null)
|
||||
{
|
||||
item.Refund();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OrphanedYardItems.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
177
Scripts/SubSystem/ACC/ACC Yard System/Core/YardTarget.cs
Normal file
177
Scripts/SubSystem/ACC/ACC Yard System/Core/YardTarget.cs
Normal file
@@ -0,0 +1,177 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
using Server.Targeting;
|
||||
using Server.Misc;
|
||||
using Server.Multis;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.ACC.YS
|
||||
{
|
||||
public class YardTarget : Target
|
||||
{
|
||||
private Mobile m_From;
|
||||
private int m_SelectedID;
|
||||
private int m_Price;
|
||||
private YardShovel m_Shovel;
|
||||
private BaseHouse m_House;
|
||||
private string m_Category;
|
||||
private int m_Page;
|
||||
|
||||
public YardTarget(YardShovel shovel, Mobile from, int itemID, int price, string category, int page)
|
||||
: base(-1, true, TargetFlags.None)
|
||||
{
|
||||
m_Shovel = shovel;
|
||||
m_From = from;
|
||||
m_SelectedID = itemID;
|
||||
m_Price = price;
|
||||
m_Category = category;
|
||||
m_Page = page;
|
||||
CheckLOS = false;
|
||||
m_Shovel.Category = category;
|
||||
m_Shovel.Page = page;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
IPoint3D t = targeted as IPoint3D;
|
||||
if (t == null)
|
||||
return;
|
||||
|
||||
Point3D loc = new Point3D(t);
|
||||
if (t is StaticTarget)
|
||||
loc.Z -= TileData.ItemTable[((StaticTarget)t).ItemID & 0x3FFF].CalcHeight;
|
||||
|
||||
if (!YardSettings.AllowOtherHouses && m_From.AccessLevel == AccessLevel.Player)
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(loc, from.Map, 20);
|
||||
if (house != null && house.Owner != m_From)
|
||||
{
|
||||
m_From.SendMessage("You cannot place a yard item in someone else's house.");
|
||||
GumpUp();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (ValidatePlacement(loc))
|
||||
EndPlace(loc);
|
||||
else
|
||||
GumpUp();
|
||||
}
|
||||
|
||||
public bool ValidatePlacement(Point3D loc)
|
||||
{
|
||||
Map map = m_From.Map;
|
||||
if (map == null)
|
||||
return false;
|
||||
|
||||
m_House = BaseHouse.FindHouseAt(m_From.Location, map, 20);
|
||||
if (m_House == null || !m_House.IsOwner(m_From))
|
||||
{
|
||||
m_From.SendMessage("You must be standing in your house to place this");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (loc.Y > m_From.Location.Y + YardSettings.Front || loc.Y < m_From.Location.Y - YardSettings.Back)
|
||||
{
|
||||
m_From.SendMessage("This is outside of your yard. Please re-try the placement");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (loc.X > m_From.Location.X + YardSettings.Right || loc.X < m_From.Location.X - YardSettings.Left)
|
||||
{
|
||||
m_From.SendMessage("This is outside of your yard. Please re-try the placement");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void EndPlace(Point3D loc)
|
||||
{
|
||||
bool Paid = false;
|
||||
if (m_From.Backpack.ConsumeTotal(typeof(Gold), m_Price))
|
||||
{
|
||||
Paid = true;
|
||||
}
|
||||
else if (Banker.Withdraw(m_From, m_Price, true))
|
||||
{
|
||||
Paid = true;
|
||||
}
|
||||
|
||||
if (Paid)
|
||||
{
|
||||
switch (m_SelectedID)
|
||||
{
|
||||
//Tall Iron
|
||||
case 2084: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.WestCW); break; }
|
||||
case 2086: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.EastCCW); break; }
|
||||
case 2088: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.WestCCW); break; }
|
||||
case 2090: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.EastCW); break; }
|
||||
case 2092: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.SouthCW); break; }
|
||||
case 2094: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.NorthCCW); break; }
|
||||
case 2096: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.SouthCCW); break; }
|
||||
case 2098: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.NorthCW); break; }
|
||||
//Short Iron
|
||||
case 2124: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.WestCW); break; }
|
||||
case 2126: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.EastCCW); break; }
|
||||
case 2128: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.WestCCW); break; }
|
||||
case 2130: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.EastCW); break; }
|
||||
case 2132: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.SouthCW); break; }
|
||||
case 2134: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.NorthCCW); break; }
|
||||
case 2136: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.SouthCCW); break; }
|
||||
case 2138: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.NorthCW); break; }
|
||||
//Light Wood
|
||||
case 2105: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.WestCW); break; }
|
||||
case 2107: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.EastCCW); break; }
|
||||
case 2109: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.WestCCW); break; }
|
||||
case 2111: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.EastCW); break; }
|
||||
case 2113: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.SouthCW); break; }
|
||||
case 2115: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.NorthCCW); break; }
|
||||
case 2117: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.SouthCCW); break; }
|
||||
case 2119: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.NorthCW); break; }
|
||||
//Dark Wood
|
||||
case 2150: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.WestCW); break; }
|
||||
case 2152: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.EastCCW); break; }
|
||||
case 2154: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.WestCCW); break; }
|
||||
case 2156: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.EastCW); break; }
|
||||
case 2158: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.SouthCW); break; }
|
||||
case 2160: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.NorthCCW); break; }
|
||||
case 2162: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.SouthCCW); break; }
|
||||
case 2164: { new YardGate(m_SelectedID, m_From, m_Price, m_House, loc, DoorFacing.NorthCW); break; }
|
||||
|
||||
case 5952: { new YardItem(5946, m_From, "Fountain", loc, m_Price, m_House); break; }
|
||||
case 6610: { new YardItem(6604, m_From, "Fountain", loc, m_Price, m_House); break; }
|
||||
|
||||
default:
|
||||
{
|
||||
if (YardRegistry.YardStairIDGroups.ContainsKey(m_SelectedID))
|
||||
{
|
||||
new YardStair(m_From, m_SelectedID, loc, m_Price, m_House);
|
||||
}
|
||||
else
|
||||
{
|
||||
new YardItem(m_SelectedID, m_From, "Yard", loc, m_Price, m_House);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
GumpUp();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_From.SendMessage("You do not have enough gold for that");
|
||||
GumpUp();
|
||||
}
|
||||
}
|
||||
|
||||
public void GumpUp()
|
||||
{
|
||||
m_From.SendGump(new YardGump(m_From, m_Shovel, m_Category, m_Page, m_SelectedID, m_Price));
|
||||
}
|
||||
}
|
||||
}
|
||||
234
Scripts/SubSystem/ACC/ACC Yard System/Items/YardDecorator.cs
Normal file
234
Scripts/SubSystem/ACC/ACC Yard System/Items/YardDecorator.cs
Normal file
@@ -0,0 +1,234 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
using Server.Regions;
|
||||
using Server.Multis;
|
||||
using Server.Gumps;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.ACC.YS
|
||||
{
|
||||
public class YardDecorator : InteriorDecorator
|
||||
{
|
||||
[Constructable]
|
||||
public YardDecorator()
|
||||
: base()
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
Name = "Yard Decorator";
|
||||
ItemID = 0xFC1;
|
||||
}
|
||||
|
||||
public override int LabelNumber { get { return 1041280; } } // an interior decorator
|
||||
|
||||
public YardDecorator(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Command != DecorateCommand.None)
|
||||
list.Add(1018322 + (int)Command); // Turn/Up/Down
|
||||
}
|
||||
|
||||
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 override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!CheckUse(this, from))
|
||||
return;
|
||||
|
||||
if (Command == DecorateCommand.None)
|
||||
from.SendGump(new InternalGump(this));
|
||||
else
|
||||
from.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private YardDecorator m_Decorator;
|
||||
|
||||
public InternalGump(YardDecorator decorator)
|
||||
: base(150, 50)
|
||||
{
|
||||
m_Decorator = decorator;
|
||||
|
||||
AddBackground(0, 0, 200, 150, 2600);
|
||||
|
||||
AddButton(50, 47, 2152, 2154, 2, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(90, 50, 70, 40, 1018324, false, false); // Up
|
||||
|
||||
AddButton(50, 87, 2152, 2154, 3, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(90, 100, 70, 40, 1018325, false, false); // Down
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
DecorateCommand command = DecorateCommand.None;
|
||||
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case 2: command = DecorateCommand.Up; break;
|
||||
case 3: command = DecorateCommand.Down; break;
|
||||
}
|
||||
|
||||
if (command != DecorateCommand.None)
|
||||
{
|
||||
m_Decorator.Command = command;
|
||||
sender.Mobile.Target = new InternalTarget(m_Decorator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private YardDecorator m_Decorator;
|
||||
|
||||
public InternalTarget(YardDecorator decorator)
|
||||
: base(-1, false, TargetFlags.None)
|
||||
{
|
||||
CheckLOS = false;
|
||||
|
||||
m_Decorator = decorator;
|
||||
}
|
||||
|
||||
protected override void OnTargetNotAccessible(Mobile from, object targeted)
|
||||
{
|
||||
OnTarget(from, targeted);
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted == m_Decorator)
|
||||
{
|
||||
m_Decorator.Command = DecorateCommand.None;
|
||||
from.SendGump(new InternalGump(m_Decorator));
|
||||
}
|
||||
else if (targeted is Item && InteriorDecorator.CheckUse(m_Decorator, from))
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(from);
|
||||
Item item = (Item)targeted;
|
||||
|
||||
if (item is YardPiece || item is YardItem ||
|
||||
item is YardIronGate || item is YardShortIronGate ||
|
||||
item is YardLightWoodGate || item is YardDarkWoodGate ||
|
||||
item is YardStair)
|
||||
{
|
||||
switch (m_Decorator.Command)
|
||||
{
|
||||
case DecorateCommand.Up: Up(item, from); break;
|
||||
case DecorateCommand.Down: Down(item, from); break;
|
||||
}
|
||||
}
|
||||
else if (house == null || !house.IsCoOwner(from))
|
||||
{
|
||||
from.SendLocalizedMessage(502092); // You must be in your house to do this.
|
||||
}
|
||||
else if (item.Parent != null || !house.IsInside(item))
|
||||
{
|
||||
from.SendLocalizedMessage(1042270); // That is not in your house.
|
||||
}
|
||||
else if (!house.IsLockedDown(item) && !house.IsSecure(item))
|
||||
{
|
||||
from.SendLocalizedMessage(1042271); // That is not locked down.
|
||||
}
|
||||
else if (item.TotalWeight + item.PileWeight > 100)
|
||||
{
|
||||
from.SendLocalizedMessage(1042272); // That is too heavy.
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (m_Decorator.Command)
|
||||
{
|
||||
case DecorateCommand.Up: Up(item, from); break;
|
||||
case DecorateCommand.Down: Down(item, from); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void Up(Item item, Mobile from)
|
||||
{
|
||||
int floorZ = GetFloorZ(item);
|
||||
|
||||
if (item is YardPiece || item is YardItem ||
|
||||
item is YardIronGate || item is YardShortIronGate ||
|
||||
item is YardLightWoodGate || item is YardDarkWoodGate ||
|
||||
item is YardStair)
|
||||
{
|
||||
item.Location = new Point3D(item.Location, item.Z + 1);
|
||||
}
|
||||
else if (floorZ > int.MinValue && item.Z < (floorZ + 15)) // Confirmed : no height checks here
|
||||
{
|
||||
item.Location = new Point3D(item.Location, item.Z + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042274); // You cannot raise it up any higher.
|
||||
}
|
||||
}
|
||||
|
||||
private static void Down(Item item, Mobile from)
|
||||
{
|
||||
int floorZ = GetFloorZ(item);
|
||||
if (item is YardPiece || item is YardItem ||
|
||||
item is YardIronGate || item is YardShortIronGate ||
|
||||
item is YardLightWoodGate || item is YardDarkWoodGate ||
|
||||
item is YardStair)
|
||||
{
|
||||
item.Location = new Point3D(item.Location, item.Z - 1);
|
||||
}
|
||||
else if (floorZ > int.MinValue && item.Z > GetFloorZ(item))
|
||||
{
|
||||
item.Location = new Point3D(item.Location, item.Z - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042275); // You cannot lower it down any further.
|
||||
}
|
||||
}
|
||||
|
||||
private static int GetFloorZ(Item item)
|
||||
{
|
||||
Map map = item.Map;
|
||||
|
||||
if (map == null)
|
||||
return int.MinValue;
|
||||
|
||||
StaticTile[] tiles = map.Tiles.GetStaticTiles(item.X, item.Y, true);
|
||||
|
||||
int z = int.MinValue;
|
||||
|
||||
for (int i = 0; i < tiles.Length; ++i)
|
||||
{
|
||||
StaticTile tile = tiles[i];
|
||||
ItemData id = TileData.ItemTable[tile.ID & 0x3FFF];
|
||||
|
||||
int top = tile.Z; // Confirmed : no height checks here
|
||||
|
||||
if (id.Surface && !id.Impassable && top > z && top <= item.Z)
|
||||
z = top;
|
||||
}
|
||||
|
||||
return z;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
582
Scripts/SubSystem/ACC/ACC Yard System/Items/YardGate.cs
Normal file
582
Scripts/SubSystem/ACC/ACC Yard System/Items/YardGate.cs
Normal file
@@ -0,0 +1,582 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Commands;
|
||||
using Server.ContextMenus;
|
||||
using Server.Items;
|
||||
using Server.Multis;
|
||||
|
||||
namespace Server.ACC.YS
|
||||
{
|
||||
public class YardGate : BaseDoor
|
||||
{
|
||||
#region Properties
|
||||
private Mobile m_Placer;
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Placer
|
||||
{
|
||||
get { return m_Placer; }
|
||||
set { m_Placer = value; }
|
||||
}
|
||||
|
||||
private int m_Price;
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Price
|
||||
{
|
||||
get { return m_Price; }
|
||||
set { m_Price = value; }
|
||||
}
|
||||
|
||||
private BaseHouse m_House;
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseHouse House
|
||||
{
|
||||
get { return m_House; }
|
||||
set { m_House = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
public YardGate(int itemID, Mobile placer, int price, BaseHouse house, Point3D location, DoorFacing facing)
|
||||
: base(itemID, itemID + 1, GetOpenedSound(itemID), GetClosedSound(itemID), BaseDoor.GetOffset(facing))
|
||||
{
|
||||
Placer = placer;
|
||||
Price = price;
|
||||
|
||||
Movable = false;
|
||||
MoveToWorld(location, placer.Map);
|
||||
|
||||
if (house == null)
|
||||
{
|
||||
FindHouseOfPlacer();
|
||||
}
|
||||
else
|
||||
{
|
||||
House = house;
|
||||
}
|
||||
|
||||
SetName();
|
||||
}
|
||||
|
||||
public YardGate(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Overrides
|
||||
public override void Use(Mobile from)
|
||||
{
|
||||
if (Locked && from == Placer)
|
||||
{
|
||||
Locked = false;
|
||||
from.SendMessage("You quickly unlock your gate, enter, and lock it behind you");
|
||||
base.Use(from);
|
||||
Locked = true;
|
||||
}
|
||||
else if (Locked && from != Placer)
|
||||
{
|
||||
from.SendMessage("You are not wanted here. Please go away!");
|
||||
}
|
||||
else
|
||||
{
|
||||
base.Use(from);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, System.Collections.Generic.List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
if (m_Placer == null || from == m_Placer || from.AccessLevel >= AccessLevel.GameMaster)
|
||||
{
|
||||
list.Add(new YardSecurityEntry(from, this));
|
||||
list.Add(new RefundEntry(from, this, m_Price));
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
|
||||
if (House == null || House.Deleted)
|
||||
{
|
||||
writer.Write(false);
|
||||
YardSystem.AddOrphanedItem(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.Write(true);
|
||||
writer.Write(House);
|
||||
}
|
||||
|
||||
writer.WriteMobile(Placer);
|
||||
writer.Write(Price);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (reader.ReadBool())
|
||||
{
|
||||
House = reader.ReadItem() as BaseHouse;
|
||||
}
|
||||
|
||||
Placer = reader.ReadMobile();
|
||||
Price = reader.ReadInt();
|
||||
|
||||
if (House == null)
|
||||
{
|
||||
FindHouseOfPlacer();
|
||||
if (House == null)
|
||||
{
|
||||
Refund();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
public void SetName()
|
||||
{
|
||||
switch (ItemID)
|
||||
{
|
||||
case 0x824:
|
||||
Name = Placer.Name + "'s Gate"; break;
|
||||
case 0x84C:
|
||||
Name = Placer.Name + "'s Gate"; break;
|
||||
case 0x839:
|
||||
Name = Placer.Name + "'s Gate"; break;
|
||||
case 0x866:
|
||||
Name = Placer.Name + "'s Gate"; break;
|
||||
case 0x675:
|
||||
Name = Placer.Name + "'s Door"; break;
|
||||
case 0x6C5:
|
||||
Name = Placer.Name + "'s Door"; break;
|
||||
case 0x685:
|
||||
Name = Placer.Name + "'s Door"; break;
|
||||
case 0x1FED:
|
||||
Name = Placer.Name + "'s Door"; break;
|
||||
case 0x695:
|
||||
Name = Placer.Name + "'s Door"; break;
|
||||
case 0x6A5:
|
||||
Name = Placer.Name + "'s Door"; break;
|
||||
case 0x6B5:
|
||||
Name = Placer.Name + "'s Door"; break;
|
||||
case 0x6D5:
|
||||
Name = Placer.Name + "'s Door"; break;
|
||||
case 0x6EF:
|
||||
Name = Placer.Name + "'s Door"; break;
|
||||
default:
|
||||
Name = Placer.Name + "'s Gate"; break;
|
||||
}
|
||||
}
|
||||
|
||||
public void Refund()
|
||||
{
|
||||
Gold toGive = new Gold(Price);
|
||||
if (Placer.BankBox.TryDropItem(Placer, toGive, false))
|
||||
{
|
||||
Delete();
|
||||
Placer.SendLocalizedMessage(1060397, toGive.Amount.ToString()); // ~1_AMOUNT~ gold has been deposited into your bank box.
|
||||
}
|
||||
else
|
||||
{
|
||||
toGive.Delete();
|
||||
Placer.SendMessage("Your bankbox is full!");
|
||||
}
|
||||
}
|
||||
|
||||
public void FindHouseOfPlacer()
|
||||
{
|
||||
if (Placer == null || House != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IPooledEnumerable eable = Map.GetItemsInRange(Location, 20);
|
||||
foreach (Item item in eable)
|
||||
{
|
||||
if (item is BaseHouse)
|
||||
{
|
||||
BaseHouse house = (BaseHouse)item;
|
||||
if (house.Owner == Placer)
|
||||
{
|
||||
House = house;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Static
|
||||
public static int GetClosedSound(int itemID)
|
||||
{
|
||||
if ((itemID >= 2084 && itemID <= 2098) ||
|
||||
(itemID >= 2124 && itemID <= 2138))
|
||||
{
|
||||
return 243;
|
||||
}
|
||||
else if ((itemID >= 2105 && itemID <= 2119) ||
|
||||
(itemID >= 2150 && itemID <= 2162))
|
||||
{
|
||||
return 242;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 243;
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetOpenedSound(int itemID)
|
||||
{
|
||||
if ((itemID >= 2084 && itemID <= 2098) ||
|
||||
(itemID >= 2124 && itemID <= 2138))
|
||||
{
|
||||
return 236;
|
||||
}
|
||||
else if ((itemID >= 2105 && itemID <= 2119) ||
|
||||
(itemID >= 2150 && itemID <= 2162))
|
||||
{
|
||||
return 235;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 236;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
#region Old Gates
|
||||
public class YardIronGate : IronGate
|
||||
{
|
||||
private Mobile m_Placer;
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Placer
|
||||
{
|
||||
get { return m_Placer; }
|
||||
set { m_Placer = value; }
|
||||
}
|
||||
|
||||
private int m_Price;
|
||||
public int Price
|
||||
{
|
||||
get { return m_Price; }
|
||||
set { m_Price = value; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public YardIronGate(Mobile from, int price, DoorFacing facing, Point3D loc)
|
||||
: base(facing)
|
||||
{
|
||||
Price = price;
|
||||
Placer = from;
|
||||
Movable = false;
|
||||
MoveToWorld(loc, from.Map);
|
||||
Name = from.Name + "'s Gate";
|
||||
}
|
||||
|
||||
public override void Use(Mobile from)
|
||||
{
|
||||
if (((BaseDoor)this).Locked && from == Placer)
|
||||
{
|
||||
((BaseDoor)this).Locked = false;
|
||||
from.SendMessage("You quickly unlock your gate, enter, and lock it behind you");
|
||||
base.Use(from);
|
||||
((BaseDoor)this).Locked = true;
|
||||
}
|
||||
else if (((BaseDoor)this).Locked && from != Placer)
|
||||
{
|
||||
from.SendMessage("You are not wanted here. Please go away!");
|
||||
}
|
||||
else
|
||||
{
|
||||
base.Use(from);
|
||||
}
|
||||
}
|
||||
|
||||
public YardIronGate(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
writer.WriteMobile(Placer);
|
||||
writer.Write(Price);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
Placer = reader.ReadMobile();
|
||||
Price = reader.ReadInt();
|
||||
Console.WriteLine();
|
||||
Console.Write("Updating YardIronGate...");
|
||||
YardGate newGate = new YardGate(2084, Placer, Price, null, Location, (DoorFacing)((ClosedID - 2084) / 2));
|
||||
newGate.Map = Map;
|
||||
if (newGate != null)
|
||||
{
|
||||
Console.WriteLine(String.Format("New gate = {0}, ItemID = {1}, Location = {2}", newGate.Serial.ToString(), newGate.ItemID, newGate.Location));
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Null");
|
||||
}
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public class YardShortIronGate : IronGateShort
|
||||
{
|
||||
private Mobile m_Placer;
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Placer
|
||||
{
|
||||
get { return m_Placer; }
|
||||
set { m_Placer = value; }
|
||||
}
|
||||
|
||||
private int m_Price;
|
||||
public int Price
|
||||
{
|
||||
get { return m_Price; }
|
||||
set { m_Price = value; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public YardShortIronGate(Mobile from, int price, DoorFacing facing, Point3D loc)
|
||||
: base(facing)
|
||||
{
|
||||
Price = price;
|
||||
Placer = from;
|
||||
Movable = false;
|
||||
MoveToWorld(loc, from.Map);
|
||||
Name = from.Name + "'s Gate";
|
||||
}
|
||||
|
||||
public override void Use(Mobile from)
|
||||
{
|
||||
if (((BaseDoor)this).Locked && from == Placer)
|
||||
{
|
||||
((BaseDoor)this).Locked = false;
|
||||
from.SendMessage("You quickly unlock your gate, enter, and lock it behind you");
|
||||
base.Use(from);
|
||||
((BaseDoor)this).Locked = true;
|
||||
}
|
||||
else if (((BaseDoor)this).Locked && from != Placer)
|
||||
{
|
||||
from.SendMessage("You are not wanted here. Please go away!");
|
||||
}
|
||||
else
|
||||
{
|
||||
base.Use(from);
|
||||
}
|
||||
}
|
||||
|
||||
public YardShortIronGate(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
writer.WriteMobile(Placer);
|
||||
writer.Write(Price);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
Placer = reader.ReadMobile();
|
||||
Price = reader.ReadInt();
|
||||
Console.WriteLine();
|
||||
Console.Write("Updating YardShortIronGate...");
|
||||
YardGate newGate = new YardGate(2124, Placer, Price, null, Location, (DoorFacing)((ClosedID - 2124) / 2));
|
||||
newGate.Map = Map;
|
||||
if (newGate != null)
|
||||
{
|
||||
Console.WriteLine(String.Format("New gate = {0}, ItemID = {1}, Location = {2}", newGate.Serial.ToString(), newGate.ItemID, newGate.Location));
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Null");
|
||||
}
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public class YardLightWoodGate : LightWoodGate
|
||||
{
|
||||
private Mobile m_Placer;
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Placer
|
||||
{
|
||||
get { return m_Placer; }
|
||||
set { m_Placer = value; }
|
||||
}
|
||||
|
||||
private int m_Price;
|
||||
public int Price
|
||||
{
|
||||
get { return m_Price; }
|
||||
set { m_Price = value; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public YardLightWoodGate(Mobile from, int price, DoorFacing facing, Point3D loc)
|
||||
: base(facing)
|
||||
{
|
||||
Price = price;
|
||||
Placer = from;
|
||||
Movable = false;
|
||||
MoveToWorld(loc, from.Map);
|
||||
Name = from.Name + "'s Gate";
|
||||
}
|
||||
|
||||
public override void Use(Mobile from)
|
||||
{
|
||||
if (((BaseDoor)this).Locked && from == Placer)
|
||||
{
|
||||
((BaseDoor)this).Locked = false;
|
||||
from.SendMessage("You quickly unlock your gate, enter, and lock it behind you");
|
||||
base.Use(from);
|
||||
((BaseDoor)this).Locked = true;
|
||||
}
|
||||
else if (((BaseDoor)this).Locked && from != Placer)
|
||||
{
|
||||
from.SendMessage("You are not wanted here. Please go away!");
|
||||
}
|
||||
else
|
||||
{
|
||||
base.Use(from);
|
||||
}
|
||||
}
|
||||
|
||||
public YardLightWoodGate(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
writer.WriteMobile(Placer);
|
||||
writer.Write(Price);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
Placer = reader.ReadMobile();
|
||||
Price = reader.ReadInt();
|
||||
Console.WriteLine();
|
||||
Console.Write("Updating YardLightWoodGate...");
|
||||
YardGate newGate = new YardGate(2105, Placer, Price, null, Location, (DoorFacing)((ClosedID - 2105) / 2));
|
||||
newGate.Map = Map;
|
||||
if (newGate != null)
|
||||
{
|
||||
Console.WriteLine(String.Format("New gate = {0}, ItemID = {1}, Location = {2}", newGate.Serial.ToString(), newGate.ItemID, newGate.Location));
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Null");
|
||||
}
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public class YardDarkWoodGate : DarkWoodGate
|
||||
{
|
||||
private Mobile m_Placer;
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Placer
|
||||
{
|
||||
get { return m_Placer; }
|
||||
set { m_Placer = value; }
|
||||
}
|
||||
|
||||
private int m_Price;
|
||||
public int Price
|
||||
{
|
||||
get { return m_Price; }
|
||||
set { m_Price = value; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public YardDarkWoodGate(Mobile from, int price, DoorFacing facing, Point3D loc)
|
||||
: base(facing)
|
||||
{
|
||||
Price = price;
|
||||
Placer = from;
|
||||
Movable = false;
|
||||
MoveToWorld(loc, from.Map);
|
||||
Name = from.Name + "'s Gate";
|
||||
}
|
||||
|
||||
public override void Use(Mobile from)
|
||||
{
|
||||
if (((BaseDoor)this).Locked && from == Placer)
|
||||
{
|
||||
((BaseDoor)this).Locked = false;
|
||||
from.SendMessage("You quickly unlock your gate, enter, and lock it behind you");
|
||||
base.Use(from);
|
||||
((BaseDoor)this).Locked = true;
|
||||
}
|
||||
else if (((BaseDoor)this).Locked && from != Placer)
|
||||
{
|
||||
from.SendMessage("You are not wanted here. Please go away!");
|
||||
}
|
||||
else
|
||||
{
|
||||
base.Use(from);
|
||||
}
|
||||
}
|
||||
|
||||
public YardDarkWoodGate(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
writer.Write(Placer);
|
||||
writer.Write(Price);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
Placer = reader.ReadMobile();
|
||||
Price = reader.ReadInt();
|
||||
Console.WriteLine();
|
||||
Console.Write("Updating YardDarkWoodGate...");
|
||||
YardGate newGate = new YardGate(2150, Placer, Price, null, Location, (DoorFacing)((ClosedID - 2150) / 2));
|
||||
newGate.Map = Map;
|
||||
if (newGate != null)
|
||||
{
|
||||
Console.WriteLine(String.Format("New gate = {0}, ItemID = {1}, Location = {2}", newGate.Serial.ToString(), newGate.ItemID, newGate.Location));
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Null");
|
||||
}
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
365
Scripts/SubSystem/ACC/ACC Yard System/Items/YardItem.cs
Normal file
365
Scripts/SubSystem/ACC/ACC Yard System/Items/YardItem.cs
Normal file
@@ -0,0 +1,365 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Items;
|
||||
using Server.Multis;
|
||||
|
||||
namespace Server.ACC.YS
|
||||
{
|
||||
public class YardMultiInfo
|
||||
{
|
||||
public int ItemID;
|
||||
public Point3D Offset;
|
||||
|
||||
public YardMultiInfo(int itemID, Point3D offset)
|
||||
{
|
||||
ItemID = itemID;
|
||||
Offset = offset;
|
||||
}
|
||||
}
|
||||
|
||||
public class YardItem : YardPiece
|
||||
{
|
||||
#region Properties
|
||||
private Mobile m_Placer;
|
||||
public Mobile Placer
|
||||
{
|
||||
get { return m_Placer; }
|
||||
set { m_Placer = value; }
|
||||
}
|
||||
|
||||
private int m_Price;
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Price
|
||||
{
|
||||
get { return m_Price; }
|
||||
set { m_Price = value; }
|
||||
}
|
||||
|
||||
private BaseHouse m_House;
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseHouse House
|
||||
{
|
||||
get { return m_House; }
|
||||
set { m_House = value; }
|
||||
}
|
||||
|
||||
private List<YardPiece> m_Pieces;
|
||||
public List<YardPiece> Pieces
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_Pieces == null)
|
||||
{
|
||||
m_Pieces = new List<YardPiece>();
|
||||
}
|
||||
return m_Pieces;
|
||||
}
|
||||
set { m_Pieces = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
public YardItem(int itemID, Mobile from, string itemName, Point3D location, int price, BaseHouse house)
|
||||
: base(itemID, from.Name + "'s " + itemName)
|
||||
{
|
||||
Price = price;
|
||||
Placer = from;
|
||||
|
||||
Movable = false;
|
||||
HasMoved = true;
|
||||
MoveToWorld(location, from.Map);
|
||||
|
||||
if (house == null)
|
||||
{
|
||||
FindHouseOfPlacer();
|
||||
}
|
||||
else
|
||||
{
|
||||
House = house;
|
||||
}
|
||||
|
||||
Pieces = new List<YardPiece>();
|
||||
ParentYardItem = this;
|
||||
Pieces.Add(this);
|
||||
|
||||
if (YardRegistry.YardMultiIDs.ContainsKey(ItemID) && YardRegistry.YardMultiIDs[ItemID] != null)
|
||||
{
|
||||
YardPiece piece;
|
||||
foreach (YardMultiInfo info in YardRegistry.YardMultiIDs[ItemID])
|
||||
{
|
||||
piece = new YardPiece(info.ItemID, Name, this);
|
||||
piece.HasMoved = true;
|
||||
piece.MoveToWorld(new Point3D(Location.X + info.Offset.X,
|
||||
Location.Y + info.Offset.Y,
|
||||
Location.Z + info.Offset.Z),
|
||||
from.Map);
|
||||
Pieces.Add(piece);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < Pieces.Count; i++)
|
||||
{
|
||||
Pieces[i].HasMoved = false;
|
||||
}
|
||||
}
|
||||
|
||||
public YardItem(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Overrides
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
for (int i = 0; i < Pieces.Count; ++i)
|
||||
{
|
||||
Pieces[i].Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.InRange(this.GetWorldLocation(), 10))
|
||||
{
|
||||
if (Placer == null || from == Placer || from.AccessLevel >= AccessLevel.GameMaster)
|
||||
{
|
||||
Refund();
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("Stay out of my yard!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("The item is too far away");
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1); // version
|
||||
|
||||
//Version 1
|
||||
if (House == null || House.Deleted)
|
||||
{
|
||||
writer.Write(false);
|
||||
YardSystem.AddOrphanedItem(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.Write(true);
|
||||
writer.Write(House);
|
||||
}
|
||||
|
||||
//Version 0
|
||||
writer.WriteMobile(Placer);
|
||||
writer.Write(Price);
|
||||
writer.WriteItemList(Pieces);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
if (reader.ReadBool())
|
||||
{
|
||||
House = reader.ReadItem() as BaseHouse;
|
||||
}
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
Placer = reader.ReadMobile();
|
||||
Price = reader.ReadInt();
|
||||
|
||||
Pieces = new List<YardPiece>();
|
||||
foreach (YardPiece item in reader.ReadItemList())
|
||||
{
|
||||
Pieces.Add(item);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (House == null)
|
||||
{
|
||||
FindHouseOfPlacer();
|
||||
if (House == null)
|
||||
{
|
||||
Refund();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
public void Refund()
|
||||
{
|
||||
Gold toGive = new Gold(Price);
|
||||
if (Placer.BankBox.TryDropItem(Placer, toGive, false))
|
||||
{
|
||||
Delete();
|
||||
Placer.SendLocalizedMessage(1060397, toGive.Amount.ToString()); // ~1_AMOUNT~ gold has been deposited into your bank box.
|
||||
}
|
||||
else
|
||||
{
|
||||
toGive.Delete();
|
||||
Placer.SendMessage("Your bankbox is full!");
|
||||
}
|
||||
}
|
||||
|
||||
public void FindHouseOfPlacer()
|
||||
{
|
||||
if (Placer == null || House != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IPooledEnumerable eable = Map.GetItemsInRange(Location, 20);
|
||||
foreach (Item item in eable)
|
||||
{
|
||||
if (item is BaseHouse)
|
||||
{
|
||||
BaseHouse house = (BaseHouse)item;
|
||||
if (house.Owner == Placer)
|
||||
{
|
||||
House = house;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
public class YardPiece : Item
|
||||
{
|
||||
private YardItem m_ParentYardItem;
|
||||
public YardItem ParentYardItem
|
||||
{
|
||||
get { return m_ParentYardItem; }
|
||||
set { m_ParentYardItem = value; }
|
||||
}
|
||||
|
||||
private bool m_HasMoved;
|
||||
public bool HasMoved
|
||||
{
|
||||
get { return m_HasMoved; }
|
||||
set { m_HasMoved = value; }
|
||||
}
|
||||
|
||||
public YardPiece(int itemID, string name)
|
||||
: this(itemID, name, null)
|
||||
{
|
||||
}
|
||||
|
||||
public YardPiece(int itemID, string name, YardItem multiParent)
|
||||
: base(itemID)
|
||||
{
|
||||
Movable = false;
|
||||
Name = name;
|
||||
ItemID = itemID;
|
||||
Light = LightType.Circle150;
|
||||
|
||||
if (multiParent != null)
|
||||
{
|
||||
ParentYardItem = multiParent;
|
||||
}
|
||||
}
|
||||
|
||||
public YardPiece(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if (ParentYardItem != null)
|
||||
{
|
||||
ParentYardItem.OnAfterDelete();
|
||||
}
|
||||
else
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (ParentYardItem != null)
|
||||
{
|
||||
ParentYardItem.OnDoubleClick(from);
|
||||
}
|
||||
else
|
||||
{
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnLocationChange(Point3D oldLocation)
|
||||
{
|
||||
if (HasMoved)
|
||||
{
|
||||
base.OnLocationChange(oldLocation);
|
||||
return;
|
||||
}
|
||||
|
||||
int xOff = 0, yOff = 0, zOff = 0;
|
||||
|
||||
xOff = Location.X - oldLocation.X;
|
||||
yOff = Location.Y - oldLocation.Y;
|
||||
zOff = Location.Z - oldLocation.Z;
|
||||
|
||||
if (ParentYardItem != null && ParentYardItem.Pieces != null)
|
||||
{
|
||||
HasMoved = true;
|
||||
|
||||
for (int i = 0; i < ParentYardItem.Pieces.Count; i++)
|
||||
{
|
||||
if (!ParentYardItem.Pieces[i].HasMoved)
|
||||
{
|
||||
ParentYardItem.Pieces[i].HasMoved = true;
|
||||
ParentYardItem.Pieces[i].MoveToWorld(new Point3D(ParentYardItem.Pieces[i].Location.X + xOff,
|
||||
ParentYardItem.Pieces[i].Location.Y + yOff,
|
||||
ParentYardItem.Pieces[i].Location.Z + zOff),
|
||||
Map);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < ParentYardItem.Pieces.Count; i++)
|
||||
{
|
||||
ParentYardItem.Pieces[i].HasMoved = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
writer.Write(ParentYardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
ParentYardItem = reader.ReadItem() as YardItem;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
99
Scripts/SubSystem/ACC/ACC Yard System/Items/YardShovel.cs
Normal file
99
Scripts/SubSystem/ACC/ACC Yard System/Items/YardShovel.cs
Normal file
@@ -0,0 +1,99 @@
|
||||
using System;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
using Server.Misc;
|
||||
|
||||
namespace Server.ACC.YS
|
||||
{
|
||||
public class YardShovel : Item
|
||||
{
|
||||
private string m_Category;
|
||||
public string Category
|
||||
{
|
||||
get { return m_Category; }
|
||||
set { m_Category = value; }
|
||||
}
|
||||
|
||||
private int m_Page;
|
||||
public int Page
|
||||
{
|
||||
get { return m_Page; }
|
||||
set { m_Page = value; }
|
||||
}
|
||||
|
||||
private int m_XStart;
|
||||
public int XStart
|
||||
{
|
||||
get { return m_XStart < 0 ? 0 : m_XStart; }
|
||||
set { m_XStart = value < 0 ? 0 : value; }
|
||||
}
|
||||
|
||||
private int m_YStart;
|
||||
public int YStart
|
||||
{
|
||||
get { return m_YStart < 0 ? 0 : m_YStart; }
|
||||
set { m_YStart = value < 0 ? 0 : value; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public YardShovel()
|
||||
: base(3897)
|
||||
{
|
||||
Movable = true;
|
||||
Name = "Yard Shovel";
|
||||
XStart = 50;
|
||||
YStart = 10;
|
||||
Category = "";
|
||||
Page = 0;
|
||||
}
|
||||
|
||||
public YardShovel(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
YardTarget yt;
|
||||
|
||||
if (m_Category != null)
|
||||
{
|
||||
yt = new YardTarget(this, from, 0, 0, Category, Page);
|
||||
}
|
||||
else
|
||||
{
|
||||
yt = new YardTarget(this, from, 0, 0, "", 0);
|
||||
}
|
||||
|
||||
yt.GumpUp();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
writer.Write(Category);
|
||||
writer.Write(Page);
|
||||
writer.Write(XStart);
|
||||
writer.Write(YStart);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
Category = reader.ReadString();
|
||||
Page = reader.ReadInt();
|
||||
XStart = reader.ReadInt();
|
||||
YStart = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
126
Scripts/SubSystem/ACC/ACC Yard System/Items/YardStair.cs
Normal file
126
Scripts/SubSystem/ACC/ACC Yard System/Items/YardStair.cs
Normal file
@@ -0,0 +1,126 @@
|
||||
using System;
|
||||
using Server.ContextMenus;
|
||||
using Server.Items;
|
||||
using Server.Multis;
|
||||
|
||||
namespace Server.ACC.YS
|
||||
{
|
||||
public class YardStair : YardItem
|
||||
{
|
||||
#region Properties
|
||||
private int m_DefaultID;
|
||||
public int DefaultID
|
||||
{
|
||||
get { return m_DefaultID; }
|
||||
set { m_DefaultID = value; }
|
||||
}
|
||||
|
||||
//private Mobile m_Placer;
|
||||
//public Mobile Placer
|
||||
//{
|
||||
// get { return m_Placer; }
|
||||
// set { m_Placer = value; }
|
||||
//}
|
||||
|
||||
//private int m_Price;
|
||||
//public int Price
|
||||
//{
|
||||
// get { return m_Price; }
|
||||
// set { m_Price = value; }
|
||||
//}
|
||||
|
||||
//private BaseHouse m_House;
|
||||
//public BaseHouse House
|
||||
//{
|
||||
// get { return m_House; }
|
||||
// set { m_House = value; }
|
||||
//}
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
[Constructable]
|
||||
public YardStair(Mobile placer, int defaultID, Point3D loc, int price, BaseHouse house)
|
||||
: base(defaultID, placer, "Stairs", loc, price, house)
|
||||
{
|
||||
DefaultID = defaultID;
|
||||
//Placer = placer;
|
||||
//Name = placer.Name + "'s Yard";
|
||||
|
||||
//Light = LightType.Circle150;
|
||||
|
||||
//Movable = false;
|
||||
//MoveToWorld(loc, placer.Map);
|
||||
//if (house == null)
|
||||
//{
|
||||
// FindHouseOfPlacer();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// House = house;
|
||||
//}
|
||||
}
|
||||
|
||||
public YardStair(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Overrides
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); //version
|
||||
|
||||
writer.Write((int)DefaultID);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
DefaultID = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, System.Collections.Generic.List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
if (Placer == null || from == Placer || from.AccessLevel >= AccessLevel.GameMaster)
|
||||
{
|
||||
list.Add(new StairRefundEntry(from, this, Price));
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.InRange(this.GetWorldLocation(), 10))
|
||||
{
|
||||
if (Placer == null || from == Placer || from.AccessLevel >= AccessLevel.GameMaster)
|
||||
{
|
||||
if (YardRegistry.YardStairIDGroups.ContainsKey(DefaultID) && YardRegistry.YardStairIDGroups[DefaultID] != null && YardRegistry.YardStairIDGroups[DefaultID].Length > 0)
|
||||
{
|
||||
int index;
|
||||
for (index = 0; index < YardRegistry.YardStairIDGroups[DefaultID].Length; index++)
|
||||
{
|
||||
if (YardRegistry.YardStairIDGroups[DefaultID][index] == ItemID)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
ItemID = (index == YardRegistry.YardStairIDGroups[DefaultID].Length - 1 ? YardRegistry.YardStairIDGroups[DefaultID][0] : YardRegistry.YardStairIDGroups[DefaultID][index+1]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("Stay out of my yard!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("The item is too far away");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
202
Scripts/SubSystem/ACC/ACC.cs
Normal file
202
Scripts/SubSystem/ACC/ACC.cs
Normal file
@@ -0,0 +1,202 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
|
||||
namespace Server.ACC
|
||||
{
|
||||
public partial class ACC
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.WorldSave += new WorldSaveEventHandler( Save );
|
||||
Load();
|
||||
}
|
||||
|
||||
private static Dictionary<string,bool> m_RegSystems = new Dictionary<string,bool>();
|
||||
public static Dictionary<string,bool> RegisteredSystems{ get{ return m_RegSystems; } }
|
||||
|
||||
public static void RegisterSystem( string system )
|
||||
{
|
||||
if( m_RegSystems.ContainsKey( system ) )
|
||||
return;
|
||||
|
||||
Type t = Type.GetType( system );
|
||||
if( t == null )
|
||||
{
|
||||
Console.WriteLine( "Invalid System String: " + system );
|
||||
return;
|
||||
}
|
||||
|
||||
ACCSystem sys = (ACCSystem)Activator.CreateInstance( t );
|
||||
if( sys != null )
|
||||
{
|
||||
m_RegSystems.Add( system, true );
|
||||
Console.WriteLine( "ACC Registered: " + system );
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SysEnabled( string system )
|
||||
{
|
||||
return m_RegSystems.ContainsKey( system ) && (bool)m_RegSystems[system];
|
||||
}
|
||||
|
||||
public static void DisableSystem( string system )
|
||||
{
|
||||
if( m_RegSystems.ContainsKey( system ) )
|
||||
{
|
||||
Type t = ScriptCompiler.FindTypeByFullName( system );
|
||||
if( t != null )
|
||||
{
|
||||
if( !Directory.Exists( "ACC Backups" ) )
|
||||
Directory.CreateDirectory( "ACC Backups" );
|
||||
|
||||
ACCSystem sys = (ACCSystem)Activator.CreateInstance( t );
|
||||
if( sys != null )
|
||||
{
|
||||
sys.StartSave( "ACC Backups/" );
|
||||
sys.Disable();
|
||||
}
|
||||
m_RegSystems[system] = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
Console.WriteLine( "Invalid System - {0} - Cannot disable.", system );
|
||||
}
|
||||
|
||||
public static void EnableSystem( string system )
|
||||
{
|
||||
if( m_RegSystems.ContainsKey( system ) )
|
||||
{
|
||||
Type t = ScriptCompiler.FindTypeByFullName( system );
|
||||
if( t != null )
|
||||
{
|
||||
if( !Directory.Exists( "ACC Backups" ) )
|
||||
Directory.CreateDirectory( "ACC Backups" );
|
||||
|
||||
ACCSystem sys = (ACCSystem)Activator.CreateInstance( t );
|
||||
if( sys != null )
|
||||
{
|
||||
sys.StartLoad( "ACC Backups/" );
|
||||
sys.Enable();
|
||||
}
|
||||
m_RegSystems[system] = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
Console.WriteLine( "Invalid System - {0} - Cannot enable.", system );
|
||||
}
|
||||
|
||||
public static void Save( WorldSaveEventArgs args )
|
||||
{
|
||||
if( !Directory.Exists( "Saves/ACC" ) )
|
||||
Directory.CreateDirectory( "Saves/ACC" );
|
||||
|
||||
string filename = "acc.sav";
|
||||
string path =@"Saves/ACC/";
|
||||
string pathNfile = path+filename;
|
||||
DateTime start = DateTime.Now;
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine();
|
||||
Console.WriteLine( "----------" );
|
||||
Console.WriteLine( "Saving ACC..." );
|
||||
|
||||
try
|
||||
{
|
||||
using( FileStream m_FileStream = new FileStream( pathNfile, FileMode.OpenOrCreate, FileAccess.Write ) )
|
||||
{
|
||||
BinaryFileWriter writer = new BinaryFileWriter( m_FileStream, true );
|
||||
|
||||
writer.Write( (int) m_RegSystems.Count );
|
||||
foreach( KeyValuePair<string,bool> kvp in m_RegSystems )
|
||||
{
|
||||
Type t = ScriptCompiler.FindTypeByFullName( kvp.Key );
|
||||
if( t != null )
|
||||
{
|
||||
writer.Write( kvp.Key );
|
||||
writer.Write( kvp.Value );
|
||||
|
||||
if( kvp.Value )
|
||||
{
|
||||
ACCSystem system = (ACCSystem)Activator.CreateInstance( t );
|
||||
if( system != null )
|
||||
system.StartSave( path );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
writer.Close();
|
||||
m_FileStream.Close();
|
||||
}
|
||||
|
||||
Console.WriteLine( "Done in {0:F1} seconds.", (DateTime.Now-start).TotalSeconds );
|
||||
Console.WriteLine( "----------" );
|
||||
Console.WriteLine();
|
||||
}
|
||||
catch( Exception err )
|
||||
{
|
||||
Console.WriteLine( "Failed. Exception: "+err );
|
||||
}
|
||||
}
|
||||
|
||||
public static void Load()
|
||||
{
|
||||
if( !Directory.Exists( "Saves/ACC" ) )
|
||||
return;
|
||||
|
||||
string filename = "acc.sav";
|
||||
string path = @"Saves/ACC/";
|
||||
string pathNfile = path+filename;
|
||||
DateTime start = DateTime.Now;
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine( "----------" );
|
||||
Console.WriteLine( "Loading ACC..." );
|
||||
|
||||
try
|
||||
{
|
||||
using( FileStream m_FileStream = new FileStream( pathNfile, FileMode.Open, FileAccess.Read ) )
|
||||
{
|
||||
BinaryReader m_BinaryReader = new BinaryReader( m_FileStream );
|
||||
BinaryFileReader reader = new BinaryFileReader( m_BinaryReader );
|
||||
|
||||
if( m_RegSystems == null )
|
||||
m_RegSystems = new Dictionary<string,bool>();
|
||||
|
||||
int Count = reader.ReadInt();
|
||||
for( int i = 0; i < Count; i++ )
|
||||
{
|
||||
string system = reader.ReadString();
|
||||
Type t = ScriptCompiler.FindTypeByFullName( system );
|
||||
bool enabled = reader.ReadBool();
|
||||
|
||||
if( t != null )
|
||||
{
|
||||
m_RegSystems[system] = enabled;
|
||||
|
||||
if( m_RegSystems[system] )
|
||||
{
|
||||
ACCSystem sys = (ACCSystem)Activator.CreateInstance( t );
|
||||
if( sys != null )
|
||||
sys.StartLoad( path );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
reader.Close();
|
||||
m_FileStream.Close();
|
||||
}
|
||||
|
||||
Console.WriteLine( "Done in {0:F1} seconds.", (DateTime.Now-start).TotalSeconds );
|
||||
Console.WriteLine( "----------" );
|
||||
Console.WriteLine();
|
||||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
Console.WriteLine( "Failed. Exception: "+e );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
142
Scripts/SubSystem/ACC/ACCGump.cs
Normal file
142
Scripts/SubSystem/ACC/ACCGump.cs
Normal file
@@ -0,0 +1,142 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Commands;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.ACC
|
||||
{
|
||||
public class ACCGump : Gump
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register( "ACC", ACC.GlobalMinimumAccessLevel, new CommandEventHandler( OnCommand ) );
|
||||
}
|
||||
|
||||
[Usage( "ACC" )]
|
||||
[Description( "Sends the ACC Gump" )]
|
||||
private static void OnCommand( CommandEventArgs e )
|
||||
{
|
||||
e.Mobile.SendGump( new ACCGump( e.Mobile, null, null ) );
|
||||
}
|
||||
|
||||
private List<string> m_List;
|
||||
private string m_SysString;
|
||||
private ACCSystem m_Syst;
|
||||
private ACCGumpParams m_SubP;
|
||||
|
||||
public ACCGump( Mobile from, string system, ACCGumpParams subParams ) : base( 0, 0 )
|
||||
{
|
||||
if( from.AccessLevel < ACC.GlobalMinimumAccessLevel )
|
||||
return;
|
||||
|
||||
m_List = new List<string>();
|
||||
m_SysString = system;
|
||||
m_SubP = subParams;
|
||||
|
||||
foreach( KeyValuePair<string,bool> kvp in ACC.RegisteredSystems )
|
||||
{
|
||||
m_List.Add( kvp.Key );
|
||||
}
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddBackground( 0, 0, 630, 360, 5120 ); //Top BG
|
||||
AddBackground( 0, 360, 630, 113, 5120 ); //Bottom BG
|
||||
AddImageTiled( 0, 446, 620, 50, 10452 ); //Bottom
|
||||
|
||||
if( system == null )
|
||||
{
|
||||
AddHtml( 175, 40, 375, 30, "<basefont size=7 color=#33CC33><center>A_Li_N - Completely Custom</center></basefont>", false, false );
|
||||
AddHtml( 175, 80, 420, 265, "<basefont size=4 color=white>Thanks for choosing to test A_Li_N - Completely Custom. With this gump, you will be able to control every aspect of my systems that are changable in-game. Currently, there are only a couple test bases that I have made to do minimal testing. If you have any questions, concerns, requests, bugs or anything else having to do with my systems, please email me at anAliengmail.com with the topic of 'ACC'. Enjoy!</basefont>", false, false );
|
||||
}
|
||||
|
||||
for( int i = 0; i < m_List.Count; i++ )
|
||||
{
|
||||
Type t = Type.GetType( m_List[i] );
|
||||
if( t == null )
|
||||
continue;
|
||||
|
||||
ACCSystem sys = (ACCSystem)Activator.CreateInstance( t );
|
||||
if( sys == null )
|
||||
continue;
|
||||
|
||||
AddButton( (i<3?35:(i<6?225:415)), (i%3==0?372:(i%3==1?397:422)), 1122, 1124, i+1, GumpButtonType.Reply, 0 );
|
||||
AddHtml( (i<3?35:(i<6?225:415)), (i%3==0?370:(i%3==1?395:420)), 184, 20, String.Format( "<basefont color=white><center>{0}</center></basefont>", sys.Name() ), false, false );
|
||||
|
||||
if( system == m_List[i] )
|
||||
m_Syst = sys;
|
||||
}
|
||||
|
||||
if( m_Syst != null )
|
||||
{
|
||||
AddButton( 560, 0, 1417, 1417, 10, GumpButtonType.Reply, 0 );
|
||||
if( m_Syst.Enabled )
|
||||
AddLabel( 592, 45, 66, "On" );
|
||||
else
|
||||
AddLabel( 588, 45, 36, "Off" );
|
||||
|
||||
// AddButton( 15, 340, 22153, 22155, 11, GumpButtonType.Reply, 0 ); //Help
|
||||
}
|
||||
|
||||
AddImage( 0, 0, 9002); //Border
|
||||
AddImage( 580, 350, 10410); //Dragon
|
||||
|
||||
if( m_Syst != null )
|
||||
{
|
||||
AddPage(1);
|
||||
m_Syst.Gump( from, this, m_SubP );
|
||||
}
|
||||
}
|
||||
/*
|
||||
Reserved ButtonIDs
|
||||
1-9 = System Buttons
|
||||
10 = Dis/Enable System
|
||||
11 = System Help
|
||||
*/
|
||||
|
||||
public override void OnResponse( NetState state, RelayInfo info )
|
||||
{
|
||||
if( info.ButtonID == 0 || state.Mobile.AccessLevel < ACC.GlobalMinimumAccessLevel )
|
||||
return;
|
||||
|
||||
if( info.ButtonID >= 1 && info.ButtonID < 10 )
|
||||
{
|
||||
int page = info.ButtonID-1;
|
||||
if( m_SysString == m_List[page] )
|
||||
state.Mobile.SendGump( new ACCGump( state.Mobile, null, null ) );
|
||||
else if( page >= 0 && page <= m_List.Count )
|
||||
state.Mobile.SendGump( new ACCGump( state.Mobile, m_List[page], null ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if( info.ButtonID == 10 && m_Syst != null )
|
||||
{
|
||||
state.Mobile.SendMessage( "{0} {1}", (m_Syst.Enabled?"Disabling":"Enabling"), m_Syst.Name() );
|
||||
if( m_Syst.Enabled )
|
||||
ACC.DisableSystem( m_Syst.ToString() );
|
||||
else
|
||||
ACC.EnableSystem( m_Syst.ToString() );
|
||||
|
||||
state.Mobile.SendGump( new ACCGump( state.Mobile, m_SysString, m_SubP ) );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* if( info.ButtonID == 11 && m_Syst != null )
|
||||
{
|
||||
m_Syst.Help();
|
||||
}
|
||||
*/
|
||||
if( m_Syst != null )
|
||||
m_Syst.OnResponse( state, info, m_SubP );
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Scripts/SubSystem/ACC/ACCGumpParams.cs
Normal file
13
Scripts/SubSystem/ACC/ACCGumpParams.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Server.ACC
|
||||
{
|
||||
public class ACCGumpParams
|
||||
{
|
||||
public ACCGumpParams()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
92
Scripts/SubSystem/ACC/ACCSystem.cs
Normal file
92
Scripts/SubSystem/ACC/ACCSystem.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.ACC
|
||||
{
|
||||
public abstract class ACCSystem
|
||||
{
|
||||
public abstract string Name();
|
||||
public abstract void Save( GenericWriter idx, GenericWriter tdb, GenericWriter writer );
|
||||
public abstract void Load( BinaryReader idx, BinaryReader tdb, BinaryFileReader reader );
|
||||
public abstract void Gump( Mobile from, Gump gump, ACCGumpParams subParams );
|
||||
public abstract void Help( Mobile from, Gump gump );
|
||||
public abstract void OnResponse( NetState state, RelayInfo info, ACCGumpParams subParams );
|
||||
public abstract void Enable();
|
||||
public abstract void Disable();
|
||||
|
||||
public bool Enabled{ get{ return ACC.SysEnabled( this.ToString() ); } }
|
||||
|
||||
public void StartSave( string path )
|
||||
{
|
||||
path += Name()+"/";
|
||||
|
||||
if( !Directory.Exists( path ) )
|
||||
Directory.CreateDirectory( path );
|
||||
|
||||
try
|
||||
{
|
||||
GenericWriter idx = new BinaryFileWriter( path+Name()+".idx", false );
|
||||
GenericWriter tdb = new BinaryFileWriter( path+Name()+".tdb", false );
|
||||
GenericWriter bin = new BinaryFileWriter( path+Name()+".bin", true );
|
||||
|
||||
Console.Write( " - Saving {0}...", Name() );
|
||||
Save( idx, tdb, bin );
|
||||
|
||||
idx.Close();
|
||||
tdb.Close();
|
||||
bin.Close();
|
||||
|
||||
Console.WriteLine( "Done." );
|
||||
}
|
||||
catch( Exception err )
|
||||
{
|
||||
Console.WriteLine( "Failed. Exception: "+err );
|
||||
}
|
||||
}
|
||||
|
||||
public void StartLoad( string path )
|
||||
{
|
||||
path += Name()+"/";
|
||||
|
||||
string idxPath = path+Name()+".idx";
|
||||
string tdbPath = path+Name()+".tdb";
|
||||
string binPath = path+Name()+".bin";
|
||||
|
||||
if( !Directory.Exists( path ) )
|
||||
Directory.CreateDirectory( path );
|
||||
|
||||
if( File.Exists( idxPath ) && File.Exists( tdbPath ) && File.Exists( binPath ) )
|
||||
{
|
||||
using( FileStream idx = new FileStream( idxPath, FileMode.Open, FileAccess.Read, FileShare.Read ) )
|
||||
{
|
||||
BinaryReader idxReader = new BinaryReader( idx );
|
||||
|
||||
using( FileStream tdb = new FileStream( tdbPath, FileMode.Open, FileAccess.Read, FileShare.Read ) )
|
||||
{
|
||||
BinaryReader tdbReader = new BinaryReader( tdb );
|
||||
|
||||
using( FileStream bin = new FileStream( binPath, FileMode.Open, FileAccess.Read, FileShare.Read ) )
|
||||
{
|
||||
BinaryFileReader binReader = new BinaryFileReader( new BinaryReader( bin ) );
|
||||
|
||||
Console.Write( " - Loading {0}", Name() );
|
||||
Load( idxReader, tdbReader, binReader );
|
||||
|
||||
idxReader.Close();
|
||||
tdbReader.Close();
|
||||
binReader.Close();
|
||||
|
||||
bin.Close();
|
||||
tdb.Close();
|
||||
idx.Close();
|
||||
|
||||
Console.WriteLine( " - Done." );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
715
Scripts/SubSystem/ACC/Central Memory/CentralMemory.cs
Normal file
715
Scripts/SubSystem/ACC/Central Memory/CentralMemory.cs
Normal file
@@ -0,0 +1,715 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
|
||||
namespace Server.ACC.CM
|
||||
{
|
||||
public enum Pages
|
||||
{
|
||||
Home,
|
||||
ListMobiles,
|
||||
ListItems,
|
||||
ListModulesFor
|
||||
};
|
||||
|
||||
public class CMGumpParams : ACCGumpParams
|
||||
{
|
||||
public Pages PageName;
|
||||
public Serial SelectedSerial;
|
||||
public int PageIndex;
|
||||
|
||||
public CMGumpParams()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public partial class CentralMemory : ACCSystem
|
||||
{
|
||||
internal static List<Type> m_Types = new List<Type>();
|
||||
private static Dictionary<Serial, ModuleList> m_DictionaryOfModuleLists = new Dictionary<Serial, ModuleList>();
|
||||
public static Dictionary<Serial, ModuleList> DictionaryOfModuleLists
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_DictionaryOfModuleLists;
|
||||
}
|
||||
}
|
||||
|
||||
public static void Configure()
|
||||
{
|
||||
ACC.RegisterSystem("Server.ACC.CM.CentralMemory");
|
||||
}
|
||||
|
||||
public static bool Running
|
||||
{
|
||||
get { return ACC.SysEnabled("Server.ACC.CM.CentralMemory"); }
|
||||
}
|
||||
|
||||
#region BasicOverrides
|
||||
public override string Name() { return "Central Memory"; }
|
||||
|
||||
public override void Enable()
|
||||
{
|
||||
Console.WriteLine("{0} has just been enabled!", Name());
|
||||
}
|
||||
|
||||
public override void Disable()
|
||||
{
|
||||
Console.WriteLine("{0} has just been disabled!", Name());
|
||||
}
|
||||
#endregion //BasicOverrides
|
||||
|
||||
#region Methods
|
||||
public static void Flush()
|
||||
{
|
||||
List<Serial> RemoveList = new List<Serial>();
|
||||
|
||||
foreach (Serial s in m_DictionaryOfModuleLists.Keys)
|
||||
{
|
||||
if (s.IsItem)
|
||||
{
|
||||
Item i = World.FindItem(s);
|
||||
if (i == null || i.Deleted)
|
||||
RemoveList.Add(s);
|
||||
}
|
||||
else if (s.IsMobile)
|
||||
{
|
||||
Mobile m = World.FindMobile(s);
|
||||
if (m == null || m.Deleted)
|
||||
RemoveList.Add(s);
|
||||
}
|
||||
|
||||
if (m_DictionaryOfModuleLists[s].Count == 0)
|
||||
RemoveList.Add(s);
|
||||
}
|
||||
|
||||
foreach (Serial s in RemoveList)
|
||||
{
|
||||
Remove(s);
|
||||
}
|
||||
|
||||
RemoveList.Clear();
|
||||
|
||||
Console.Write("Flushed...");
|
||||
}
|
||||
|
||||
public static bool Contains(Serial ser)
|
||||
{
|
||||
return m_DictionaryOfModuleLists.ContainsKey(ser);
|
||||
}
|
||||
|
||||
public static bool ContainsModule(Serial ser, Type type)
|
||||
{
|
||||
if (Contains(ser))
|
||||
{
|
||||
if (m_DictionaryOfModuleLists[ser] != null)
|
||||
return m_DictionaryOfModuleLists[ser].Contains(type);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void Add(Serial ser)
|
||||
{
|
||||
if (Contains(ser))
|
||||
return;
|
||||
|
||||
m_DictionaryOfModuleLists.Add(ser, new ModuleList(ser));
|
||||
}
|
||||
|
||||
public static void Add(Serial ser, ModuleList list)
|
||||
{
|
||||
m_DictionaryOfModuleLists[ser] = list;
|
||||
}
|
||||
|
||||
public static void AddModule(Module mod)
|
||||
{
|
||||
if (!m_DictionaryOfModuleLists.ContainsKey(mod.Owner))
|
||||
Add(mod.Owner);
|
||||
|
||||
m_DictionaryOfModuleLists[mod.Owner].Add(mod);
|
||||
}
|
||||
|
||||
public static void AddModule(Serial ser, Type type)
|
||||
{
|
||||
if (!m_DictionaryOfModuleLists.ContainsKey(ser))
|
||||
Add(ser);
|
||||
|
||||
m_DictionaryOfModuleLists[ser].Add(type);
|
||||
}
|
||||
|
||||
public static void ChangeModule(Serial ser, Module mod)
|
||||
{
|
||||
if (!m_DictionaryOfModuleLists.ContainsKey(ser))
|
||||
Add(ser);
|
||||
|
||||
m_DictionaryOfModuleLists[ser].Change(mod);
|
||||
}
|
||||
|
||||
public static void AppendModule(Serial ser, Module mod, bool negatively)
|
||||
{
|
||||
if (!m_DictionaryOfModuleLists.ContainsKey(ser))
|
||||
Add(ser);
|
||||
else if (!ContainsModule(ser, mod.GetType()))
|
||||
{
|
||||
AddModule(mod);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_DictionaryOfModuleLists[ser].Append(mod, negatively);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Remove(Serial ser)
|
||||
{
|
||||
m_DictionaryOfModuleLists.Remove(ser);
|
||||
}
|
||||
|
||||
public static void RemoveModule(Serial ser, Module mod)
|
||||
{
|
||||
if (m_DictionaryOfModuleLists.ContainsKey(ser))
|
||||
m_DictionaryOfModuleLists[ser].Remove(mod);
|
||||
}
|
||||
|
||||
public static void RemoveModule(Serial ser, Type type)
|
||||
{
|
||||
if (m_DictionaryOfModuleLists.ContainsKey(ser))
|
||||
m_DictionaryOfModuleLists[ser].Remove(type);
|
||||
}
|
||||
|
||||
public static Module GetModule(Serial ser, Type type)
|
||||
{
|
||||
if (m_DictionaryOfModuleLists.ContainsKey(ser))
|
||||
return m_DictionaryOfModuleLists[ser].Get(type);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<Mobile> GetMobiles()
|
||||
{
|
||||
List<Mobile> list = new List<Mobile>();
|
||||
foreach (Serial s in m_DictionaryOfModuleLists.Keys)
|
||||
{
|
||||
if (s.IsMobile)
|
||||
{
|
||||
Mobile m = World.FindMobile(s);
|
||||
if (m != null && !m.Deleted)
|
||||
list.Add(m);
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<Item> GetItems()
|
||||
{
|
||||
List<Item> list = new List<Item>();
|
||||
foreach (Serial s in m_DictionaryOfModuleLists.Keys)
|
||||
{
|
||||
if (s.IsItem)
|
||||
{
|
||||
Item i = World.FindItem(s);
|
||||
if (i != null && !i.Deleted)
|
||||
list.Add(i);
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
#endregion //Methods
|
||||
|
||||
private CMGumpParams Params;
|
||||
private List<Mobile> m_MobileList;
|
||||
private List<Item> m_ItemList;
|
||||
private List<Module> m_ModuleList;
|
||||
private Module m_Module;
|
||||
|
||||
#region Gump
|
||||
public override void Gump(Mobile from, Gump gump, ACCGumpParams subParams)
|
||||
{
|
||||
gump.AddButton(190, 40, 2445, 2445, 101, GumpButtonType.Reply, 0);
|
||||
gump.AddLabel(204, 42, 1153, "List Mobiles");
|
||||
gump.AddButton(310, 40, 2445, 2445, 102, GumpButtonType.Reply, 0);
|
||||
gump.AddLabel(331, 42, 1153, "List Items");
|
||||
gump.AddButton(430, 40, 2445, 2445, 103, GumpButtonType.Reply, 0);
|
||||
gump.AddLabel(450, 42, 1153, "List Types");
|
||||
// gump.AddButton( 190, 70, 2445, 2445, 104, GumpButtonType.Reply, 0 );
|
||||
// gump.AddLabel( 208, 72, 1153, "Add Module" );
|
||||
// gump.AddButton( 310, 70, 2445, 2445, 105, GumpButtonType.Reply, 0 );
|
||||
// gump.AddLabel( 326, 72, 1153, "Edit Module" );
|
||||
// gump.AddButton( 430, 70, 2445, 2445, 106, GumpButtonType.Reply, 0 );
|
||||
// gump.AddLabel( 439, 72, 1153, "Delete Module" );
|
||||
|
||||
if (subParams == null || !(subParams is CMGumpParams))
|
||||
{
|
||||
gump.AddHtml(215, 15, 300, 25, "<basefont size=7 color=white><center>Central Memory</center></font>", false, false);
|
||||
gump.AddHtml(140, 95, 450, 250, "<basefont color=white><center>Welcome to the Central Memory Admin Gump!</center><br>With this gump, you can see a list of all entries that the CM contains. You can add new Modules or modify or delete existing Modules.<br><br>Make your selection from the top buttons, either List Mobiles or Items. This will bring up a list of all Mobiles or Items that the CM is keeping track of.<br><br>You may then select one of the entries to list the Modules that are stored to that entry. You can then add, modify or remove modules to that entry.</font>", false, false);
|
||||
return;
|
||||
}
|
||||
|
||||
Params = subParams as CMGumpParams;
|
||||
|
||||
switch ((int)Params.PageName)
|
||||
{
|
||||
#region ListMobiles
|
||||
case (int)Pages.ListMobiles:
|
||||
gump.AddLabel(120, 95, 1153, "Listing all Mobiles:");
|
||||
|
||||
m_MobileList = GetMobiles();
|
||||
if (m_MobileList == null || m_MobileList.Count == 0)
|
||||
return;
|
||||
|
||||
if (Params.PageIndex < 0)
|
||||
Params.PageIndex = 0;
|
||||
|
||||
|
||||
if (Params.PageIndex > 0)
|
||||
gump.AddButton(120, 332, 4014, 4015, 104, GumpButtonType.Reply, 0);
|
||||
if ((Params.PageIndex + 1) * 21 <= m_MobileList.Count)
|
||||
gump.AddButton(540, 332, 4005, 4006, 105, GumpButtonType.Reply, 0);
|
||||
|
||||
for (int i = Params.PageIndex * 21, r = 0, c = 0; i < m_MobileList.Count; i++)
|
||||
{
|
||||
if (m_MobileList[i] == null)
|
||||
continue;
|
||||
gump.AddButton(120 + c * 155, 125 + r * 30, 2501, 2501, 1000 + i, GumpButtonType.Reply, 0);
|
||||
gump.AddLabel(130 + c * 155, 126 + r * 30, 1153, (m_MobileList[i].Name == null ? m_MobileList[i].Serial.ToString() : m_MobileList[i].Name));
|
||||
}
|
||||
|
||||
break;
|
||||
#endregion //ListMobiles
|
||||
|
||||
#region ListItems
|
||||
case (int)Pages.ListItems:
|
||||
gump.AddLabel(120, 95, 1153, "Listing all Items:");
|
||||
|
||||
m_ItemList = GetItems();
|
||||
if (m_ItemList == null || m_ItemList.Count == 0)
|
||||
return;
|
||||
|
||||
if (Params.PageIndex < 0)
|
||||
Params.PageIndex = 0;
|
||||
|
||||
if (Params.PageIndex > 0)
|
||||
gump.AddButton(120, 332, 4014, 4015, 104, GumpButtonType.Reply, 0);
|
||||
if ((Params.PageIndex + 1) * 21 <= m_ItemList.Count)
|
||||
gump.AddButton(540, 332, 4005, 4006, 105, GumpButtonType.Reply, 0);
|
||||
|
||||
for (int i = Params.PageIndex * 21, r = 0, c = 0; i < m_ItemList.Count; i++)
|
||||
{
|
||||
if (m_ItemList[i] == null)
|
||||
continue;
|
||||
gump.AddButton(120 + c * 155, 125 + r * 30, 2501, 2501, 1000 + i, GumpButtonType.Reply, 0);
|
||||
gump.AddLabel(130 + c * 155, 126 + r * 30, 1153, (m_ItemList[i].Name == null ? m_ItemList[i].Serial.ToString() : m_ItemList[i].Name));
|
||||
}
|
||||
|
||||
break;
|
||||
#endregion //ListItems
|
||||
|
||||
#region ListModulesFor
|
||||
case (int)Pages.ListModulesFor:
|
||||
if (!m_DictionaryOfModuleLists.ContainsKey(Params.SelectedSerial))
|
||||
{
|
||||
gump.AddLabel(120, 95, 1153, "This entity no longer exists in the Central Memory!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_DictionaryOfModuleLists[Params.SelectedSerial] == null || m_DictionaryOfModuleLists[Params.SelectedSerial].Count == 0)
|
||||
{
|
||||
gump.AddLabel(120, 95, 1153, "This entity has no Modules!");
|
||||
Remove(Params.SelectedSerial);
|
||||
return;
|
||||
}
|
||||
|
||||
string name = "";
|
||||
if (Params.SelectedSerial.IsMobile)
|
||||
name = World.FindMobile(Params.SelectedSerial).Name;
|
||||
else if (Params.SelectedSerial.IsItem)
|
||||
name = World.FindItem(Params.SelectedSerial).Name;
|
||||
|
||||
if (name == null || name.Length == 0)
|
||||
name = Params.SelectedSerial.ToString();
|
||||
|
||||
gump.AddLabel(120, 95, 1153, String.Format("Listing all Modules for {0}:", name));
|
||||
|
||||
m_ModuleList = m_DictionaryOfModuleLists[Params.SelectedSerial].GetListOfModules();
|
||||
|
||||
if (m_ModuleList == null || m_ModuleList.Count == 0)
|
||||
return;
|
||||
|
||||
if (Params.PageIndex < 0)
|
||||
Params.PageIndex = 0;
|
||||
if (Params.PageIndex * 21 >= m_ModuleList.Count)
|
||||
Params.PageIndex = m_ModuleList.Count - 21;
|
||||
|
||||
if (Params.PageIndex > 0)
|
||||
gump.AddButton(120, 332, 4014, 4015, 104, GumpButtonType.Reply, 0);
|
||||
if ((Params.PageIndex + 1) * 21 <= m_ModuleList.Count)
|
||||
gump.AddButton(540, 332, 4005, 4006, 105, GumpButtonType.Reply, 0);
|
||||
|
||||
gump.AddButton(331, 332, 4008, 4009, 106, GumpButtonType.Reply, 0);
|
||||
|
||||
for (int i = Params.PageIndex * 21, r = 0, c = 0; i < m_ModuleList.Count; i++)
|
||||
{
|
||||
if (m_ModuleList[i] == null)
|
||||
continue;
|
||||
|
||||
gump.AddButton(120 + c * 155, 125 + r * 30, 2501, 2501, 1000 + i, GumpButtonType.Reply, 0);
|
||||
gump.AddLabel(130 + c * 155, 126 + r * 30, 1153, (m_ModuleList[i].Name().Length == 0 ? m_ModuleList[i].Owner.ToString() : m_ModuleList[i].Name()));
|
||||
}
|
||||
|
||||
break;
|
||||
#endregion //ListModulesFor
|
||||
}
|
||||
}
|
||||
|
||||
public override void Help(Mobile from, Gump gump)
|
||||
{
|
||||
}
|
||||
|
||||
/* ID's
|
||||
101 = Button List Mobiles
|
||||
102 = Button List Items
|
||||
103 = Button List Types
|
||||
104 = Button Previous
|
||||
105 = Button Next
|
||||
106 = Button Back to List
|
||||
1000+ = Button Selections
|
||||
*/
|
||||
public override void OnResponse(NetState state, RelayInfo info, ACCGumpParams subParams)
|
||||
{
|
||||
if (!Running || info.ButtonID == 0)
|
||||
return;
|
||||
|
||||
if (subParams is CMGumpParams)
|
||||
Params = subParams as CMGumpParams;
|
||||
|
||||
CMGumpParams newParams = new CMGumpParams();
|
||||
|
||||
//Switch to List Mobiles
|
||||
if (info.ButtonID == 101)
|
||||
{
|
||||
newParams.PageName = Pages.ListMobiles;
|
||||
}
|
||||
|
||||
//Switch to List Items
|
||||
else if (info.ButtonID == 102)
|
||||
{
|
||||
newParams.PageName = Pages.ListItems;
|
||||
}
|
||||
|
||||
//Previous Page
|
||||
else if (info.ButtonID == 104)
|
||||
{
|
||||
newParams.PageIndex = Params.PageIndex - 1;
|
||||
}
|
||||
|
||||
//Next Page
|
||||
else if (info.ButtonID == 105)
|
||||
{
|
||||
newParams.PageIndex = Params.PageIndex + 1;
|
||||
}
|
||||
|
||||
//Back to List
|
||||
else if (info.ButtonID == 106)
|
||||
{
|
||||
newParams.PageName = Pages.Home;
|
||||
}
|
||||
|
||||
//Select Item from List
|
||||
else if (info.ButtonID >= 1000)
|
||||
{
|
||||
int selectedID = info.ButtonID - 1000;
|
||||
|
||||
if (selectedID < 0 || selectedID >= m_DictionaryOfModuleLists.Count)
|
||||
return;
|
||||
|
||||
switch ((int)Params.PageName)
|
||||
{
|
||||
//Change page to List Modules with serial of selected item
|
||||
case (int)Pages.ListItems:
|
||||
{
|
||||
if (selectedID < 0 || selectedID >= m_ItemList.Count)
|
||||
return;
|
||||
|
||||
newParams.PageName = Pages.ListModulesFor;
|
||||
newParams.SelectedSerial = m_ItemList[selectedID].Serial;
|
||||
newParams.PageIndex = 0;
|
||||
|
||||
break;
|
||||
}
|
||||
//Change page to List Modules with serial of selected mobile
|
||||
case (int)Pages.ListMobiles:
|
||||
{
|
||||
if (selectedID < 0 || selectedID >= m_MobileList.Count)
|
||||
return;
|
||||
|
||||
newParams.PageName = Pages.ListModulesFor;
|
||||
newParams.SelectedSerial = m_MobileList[selectedID].Serial;
|
||||
newParams.PageIndex = 0;
|
||||
break;
|
||||
}
|
||||
//Open the Edit Module Gump
|
||||
//Not implemented yet
|
||||
case (int)Pages.ListModulesFor:
|
||||
{
|
||||
if (selectedID < 0 || selectedID >= m_ModuleList.Count)
|
||||
return;
|
||||
|
||||
if (m_ModuleList[selectedID] == null)
|
||||
return;
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerStateCallback(SendEMG), state.Mobile);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
state.Mobile.SendGump(new ACCGump(state.Mobile, this.ToString(), newParams));
|
||||
}
|
||||
|
||||
private void SendEMG(object state)
|
||||
{
|
||||
Mobile m = state as Mobile;
|
||||
if (m == null || m.Deleted || m_Module == null)
|
||||
return;
|
||||
|
||||
m.SendMessage("Sent EMG for {0}", m_Module.Name());
|
||||
//m.SendGump( new EditModuleGump( m_Module ) );
|
||||
}
|
||||
#endregion //Gump
|
||||
|
||||
public override void Save(GenericWriter idx, GenericWriter tdb, GenericWriter writer)
|
||||
{
|
||||
Flush();
|
||||
|
||||
List<Module> fullList = new List<Module>();
|
||||
foreach (ModuleList ml in m_DictionaryOfModuleLists.Values)
|
||||
{
|
||||
foreach (Module m in ml.Values)
|
||||
{
|
||||
fullList.Add(m);
|
||||
}
|
||||
}
|
||||
|
||||
writer.Write((int)0); //Version
|
||||
|
||||
idx.Write((int)fullList.Count);
|
||||
foreach (Module m in fullList)
|
||||
{
|
||||
Type t = m.GetType();
|
||||
long start = writer.Position;
|
||||
idx.Write((int)m.m_TypeRef);
|
||||
idx.Write((int)m.Owner);
|
||||
idx.Write((long)start);
|
||||
|
||||
m.Serialize(writer);
|
||||
|
||||
idx.Write((int)(writer.Position - start));
|
||||
}
|
||||
|
||||
tdb.Write((int)m_Types.Count);
|
||||
for (int i = 0; i < m_Types.Count; ++i)
|
||||
tdb.Write(((Type)m_Types[i]).FullName);
|
||||
}
|
||||
|
||||
public override void Load(BinaryReader idx, BinaryReader tdb, BinaryFileReader reader)
|
||||
{
|
||||
object[] ctorArgs = new object[1];
|
||||
Type[] ctorTypes = new Type[1] { typeof(Serial) };
|
||||
List<ModuleEntry> modules = new List<ModuleEntry>();
|
||||
m_DictionaryOfModuleLists = new Dictionary<Serial, ModuleList>();
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
int count = tdb.ReadInt32();
|
||||
ArrayList types = new ArrayList(count);
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
string typeName = tdb.ReadString();
|
||||
Type t = ScriptCompiler.FindTypeByFullName(typeName);
|
||||
if (t == null)
|
||||
{
|
||||
Console.WriteLine("Type not found: {0}, remove?", typeName);
|
||||
if (Console.ReadKey(true).Key == ConsoleKey.Y)
|
||||
{
|
||||
types.Add(null);
|
||||
continue;
|
||||
}
|
||||
throw new Exception(String.Format("Bad type '{0}'", typeName));
|
||||
}
|
||||
|
||||
ConstructorInfo ctor = t.GetConstructor(ctorTypes);
|
||||
if (ctor != null)
|
||||
types.Add(new object[] { ctor, null });
|
||||
else
|
||||
throw new Exception(String.Format("Type '{0}' does not have a serialization constructor", t));
|
||||
}
|
||||
|
||||
int moduleCount = idx.ReadInt32();
|
||||
|
||||
for (int i = 0; i < moduleCount; ++i)
|
||||
{
|
||||
int typeID = idx.ReadInt32();
|
||||
int serial = idx.ReadInt32();
|
||||
long pos = idx.ReadInt64();
|
||||
int length = idx.ReadInt32();
|
||||
|
||||
object[] objs = (object[])types[typeID];
|
||||
if (objs == null)
|
||||
continue;
|
||||
|
||||
Module m = null;
|
||||
ConstructorInfo ctor = (ConstructorInfo)objs[0];
|
||||
string typeName = (string)objs[1];
|
||||
|
||||
try
|
||||
{
|
||||
ctorArgs[0] = (Serial)serial;
|
||||
m = (Module)(ctor.Invoke(ctorArgs));
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
if (m != null)
|
||||
{
|
||||
modules.Add(new ModuleEntry(m, typeID, typeName, pos, length));
|
||||
AddModule(m);
|
||||
}
|
||||
}
|
||||
|
||||
bool failedModules = false;
|
||||
Type failedType = null;
|
||||
Exception failed = null;
|
||||
int failedTypeID = 0;
|
||||
|
||||
for (int i = 0; i < modules.Count; ++i)
|
||||
{
|
||||
ModuleEntry entry = modules[i];
|
||||
Module m = entry.Module;
|
||||
|
||||
if (m != null)
|
||||
{
|
||||
reader.Seek(entry.Position, SeekOrigin.Begin);
|
||||
|
||||
try
|
||||
{
|
||||
m.Deserialize(reader);
|
||||
|
||||
if (reader.Position != (entry.Position + entry.Length))
|
||||
throw new Exception(String.Format("Bad serialize on {0}", m.GetType()));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
modules.RemoveAt(i);
|
||||
|
||||
failed = e;
|
||||
failedModules = true;
|
||||
failedType = m.GetType();
|
||||
failedTypeID = entry.TypeID;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (failedModules)
|
||||
{
|
||||
Console.WriteLine("An error was encountered while loading a Module of Type: {0}", failedType);
|
||||
Console.WriteLine("Remove this type of Module? (y/n)");
|
||||
if (Console.ReadLine() == "y")
|
||||
{
|
||||
for (int i = 0; i < modules.Count; )
|
||||
{
|
||||
if (((ModuleEntry)modules[i]).TypeID == failedTypeID)
|
||||
modules.RemoveAt(i);
|
||||
else
|
||||
++i;
|
||||
}
|
||||
|
||||
SaveIndex<ModuleEntry>(modules);
|
||||
}
|
||||
|
||||
Console.WriteLine("After pressing return an exception will be thrown and the server will terminate");
|
||||
Console.ReadLine();
|
||||
|
||||
throw new Exception(String.Format("Load failed (type={0})", failedType), failed);
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveIndex<T>(List<T> list) where T : IEntityMod
|
||||
{
|
||||
string path = "";
|
||||
if (CentralMemory.Running)
|
||||
{
|
||||
if (!Directory.Exists("ACC Backups/Central Memory/"))
|
||||
Directory.CreateDirectory("ACC Backups/Central Memory/");
|
||||
path = "ACC Backups/Central Memory/Central Memory.idx";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Directory.Exists("Saves/ACC/Central Memory/"))
|
||||
Directory.CreateDirectory("Saves/ACC/Central Memory/");
|
||||
path = "Saves/ACC/Central Memory/Central Memory.idx";
|
||||
}
|
||||
|
||||
using (FileStream idx = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None))
|
||||
{
|
||||
BinaryWriter idxWriter = new BinaryWriter(idx);
|
||||
|
||||
idxWriter.Write(list.Count);
|
||||
for (int i = 0; i < list.Count; ++i)
|
||||
{
|
||||
T e = list[i];
|
||||
|
||||
idxWriter.Write(e.TypeID);
|
||||
idxWriter.Write(e.Serial);
|
||||
idxWriter.Write(e.Position);
|
||||
idxWriter.Write(e.Length);
|
||||
}
|
||||
|
||||
idxWriter.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private interface IEntityMod
|
||||
{
|
||||
Serial Serial { get; }
|
||||
int TypeID { get; }
|
||||
long Position { get; }
|
||||
int Length { get; }
|
||||
}
|
||||
|
||||
private sealed class ModuleEntry : IEntityMod
|
||||
{
|
||||
private Module m_Module;
|
||||
private int m_TypeID;
|
||||
private string m_TypeName;
|
||||
private long m_Position;
|
||||
private int m_Length;
|
||||
|
||||
public Module Module { get { return m_Module; } }
|
||||
public Serial Serial { get { return m_Module == null ? Serial.MinusOne : m_Module.Owner; } }
|
||||
public int TypeID { get { return m_TypeID; } }
|
||||
public string TypeName { get { return m_TypeName; } }
|
||||
public long Position { get { return m_Position; } }
|
||||
public int Length { get { return m_Length; } }
|
||||
|
||||
public ModuleEntry(Module module, int typeID, string typeName, long pos, int length)
|
||||
{
|
||||
m_Module = module;
|
||||
m_TypeID = typeID;
|
||||
m_TypeName = typeName;
|
||||
m_Position = pos;
|
||||
m_Length = length;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
47
Scripts/SubSystem/ACC/Central Memory/Module.cs
Normal file
47
Scripts/SubSystem/ACC/Central Memory/Module.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.ACC.CM
|
||||
{
|
||||
public abstract class Module
|
||||
{
|
||||
/*
|
||||
* Append( Module mod, bool negatively )
|
||||
* This method MUST be inherited.
|
||||
* This method is used to take what is already in CM
|
||||
* and add/subtract from it what is on the Module mod.
|
||||
* if( negatively ) means you want to remove stuff.
|
||||
*/
|
||||
public abstract void Append( Module mod, bool negatively );
|
||||
|
||||
public abstract string Name();
|
||||
|
||||
internal int m_TypeRef;
|
||||
private Serial m_Owner;
|
||||
public Serial Owner{ get{ return m_Owner; } }
|
||||
|
||||
public Module( Serial ser )
|
||||
{
|
||||
m_Owner = ser;
|
||||
|
||||
Type type = this.GetType();
|
||||
m_TypeRef = CentralMemory.m_Types.IndexOf( type );
|
||||
|
||||
if (m_TypeRef == -1)
|
||||
{
|
||||
CentralMemory.m_Types.Add(type);
|
||||
m_TypeRef = CentralMemory.m_Types.Count - 1;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Serialize( GenericWriter writer )
|
||||
{
|
||||
writer.Write( (int)0 ); //version
|
||||
}
|
||||
|
||||
public virtual void Deserialize( GenericReader reader )
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
82
Scripts/SubSystem/ACC/Central Memory/ModuleList.cs
Normal file
82
Scripts/SubSystem/ACC/Central Memory/ModuleList.cs
Normal file
@@ -0,0 +1,82 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
|
||||
namespace Server.ACC.CM
|
||||
{
|
||||
public class ModuleList : Dictionary<Type,Module>
|
||||
{
|
||||
private Serial m_Owner;
|
||||
|
||||
public ModuleList( Serial serial )
|
||||
{
|
||||
m_Owner = serial;
|
||||
}
|
||||
|
||||
public List<Module> GetListOfModules()
|
||||
{
|
||||
return new List<Module>(Values);
|
||||
}
|
||||
|
||||
public bool Contains( Type type )
|
||||
{
|
||||
return ContainsKey( type );
|
||||
}
|
||||
|
||||
public void Add( Module mod )
|
||||
{
|
||||
if( ContainsKey( mod.GetType() ) )
|
||||
return;
|
||||
|
||||
Add( mod.GetType(), mod );
|
||||
}
|
||||
|
||||
public void Add( Type type )
|
||||
{
|
||||
if( ContainsKey( type ) )
|
||||
return;
|
||||
|
||||
object[] Params = new object[1]{ m_Owner };
|
||||
Module mod = Activator.CreateInstance( type, Params ) as Module;
|
||||
if( mod != null )
|
||||
Add( type, mod );
|
||||
}
|
||||
|
||||
public void Change( Module mod )
|
||||
{
|
||||
if (ContainsValue(mod))
|
||||
this[mod.GetType()] = mod;
|
||||
else
|
||||
Add(mod);
|
||||
}
|
||||
|
||||
public void Append( Module mod, bool negatively )
|
||||
{
|
||||
if( ContainsKey( mod.GetType() ) )
|
||||
((Module)this[ mod.GetType() ]).Append( mod, negatively );
|
||||
}
|
||||
|
||||
public void Remove( Module mod )
|
||||
{
|
||||
Remove( mod.GetType() );
|
||||
|
||||
if( Count == 0 )
|
||||
CentralMemory.Remove( m_Owner );
|
||||
}
|
||||
|
||||
public new void Remove( Type type )
|
||||
{
|
||||
base.Remove( type );
|
||||
|
||||
if( Count == 0 )
|
||||
CentralMemory.Remove( m_Owner );
|
||||
}
|
||||
|
||||
public Module Get( Type type )
|
||||
{
|
||||
if (Contains(type))
|
||||
return this[type];
|
||||
else return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user