Overwrite

Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
Unstable Kitsune
2023-11-28 23:20:26 -05:00
parent 3cd54811de
commit b918192e4e
11608 changed files with 2644205 additions and 47 deletions

View File

@@ -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();
}
}
}

View 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;
}
}
}
}
}

View 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;
}
}
}

View 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
}
}

View File

@@ -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;
}
}
}
}
}

View 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;
}
}

View 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();
}
}
}

View 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));
}
}
}

View 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;
}
}
}
}

View 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
}

View 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;
}
}
}
}
}

View 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;
}
}
}
}
}

View 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
}
}