Initial commit
This commit is contained in:
+128
@@ -0,0 +1,128 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Commands;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class AddGateGump : Gump
|
||||
{
|
||||
private int m_Type;
|
||||
|
||||
public AddGateGump()
|
||||
: this( -1 )
|
||||
{
|
||||
}
|
||||
|
||||
public void AddBlueBack( int width, int height )
|
||||
{
|
||||
AddBackground( 0, 0, width - 00, height - 00, 0xE10 );
|
||||
AddBackground( 8, 5, width - 16, height - 11, 0x053 );
|
||||
AddImageTiled( 15, 14, width - 29, height - 29, 0xE14 );
|
||||
AddAlphaRegion( 15, 14, width - 29, height - 29 );
|
||||
}
|
||||
|
||||
public AddGateGump( int type )
|
||||
: base( 50, 40 )
|
||||
{
|
||||
m_Type = type;
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
if( m_Type >= 0 && m_Type < m_Types.Length )
|
||||
{
|
||||
AddBlueBack( 155, 174 );
|
||||
|
||||
int baseID = m_Types[m_Type].m_BaseID;
|
||||
|
||||
AddItem( 25, 24, baseID );
|
||||
AddButton( 26, 37, 0x5782, 0x5782, 1, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddItem( 47, 45, baseID + 2 );
|
||||
AddButton( 43, 57, 0x5783, 0x5783, 2, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddItem( 87, 22, baseID + 10 );
|
||||
AddButton( 116, 35, 0x5785, 0x5785, 6, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddItem( 65, 45, baseID + 8 );
|
||||
AddButton( 96, 55, 0x5784, 0x5784, 5, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddButton( 73, 36, 0x2716, 0x2716, 9, GumpButtonType.Reply, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
AddBlueBack( 265, 145 );
|
||||
|
||||
for( int i = 0; i < m_Types.Length; ++i )
|
||||
{
|
||||
AddButton( 30 + (i * 49), 13, 0x2624, 0x2625, i + 1, GumpButtonType.Reply, 0 );
|
||||
AddItem( 22 + (i * 49), 20, m_Types[i].m_BaseID );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
Mobile from = sender.Mobile;
|
||||
int button = info.ButtonID - 1;
|
||||
|
||||
if( m_Type == -1 )
|
||||
{
|
||||
if( button >= 0 && button < m_Types.Length )
|
||||
from.SendGump( new AddGateGump( button ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( button >= 0 && button < 8 )
|
||||
{
|
||||
from.SendGump( new AddGateGump( m_Type ) );
|
||||
CommandSystem.Handle( from, String.Format( "{0}Add {1} {2}", CommandSystem.Prefix, m_Types[m_Type].m_Type.Name, (DoorFacing)button ) );
|
||||
}
|
||||
else if( button == 8 )
|
||||
{
|
||||
from.SendGump( new AddGateGump( m_Type ) );
|
||||
CommandSystem.Handle( from, String.Format( "{0}Link", CommandSystem.Prefix ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendGump( new AddGateGump() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
Server.Commands.CommandSystem.Register( "AddGate", AccessLevel.GameMaster, new CommandEventHandler( AddDoor_OnCommand ) );
|
||||
}
|
||||
|
||||
[Usage( "AddGate" )]
|
||||
[Description( "Displays a menu from which you can interactively add gates." )]
|
||||
public static void AddDoor_OnCommand( Server.Commands.CommandEventArgs e )
|
||||
{
|
||||
e.Mobile.SendGump( new AddGateGump() );
|
||||
}
|
||||
|
||||
public static DoorInfo[] m_Types = new DoorInfo[]
|
||||
{
|
||||
new DoorInfo( typeof( IronGateShort ), 0x84C ),
|
||||
new DoorInfo( typeof( IronGate ), 0x824 ),
|
||||
new DoorInfo( typeof( DarkWoodGate ), 0x866 ),
|
||||
new DoorInfo( typeof( LightWoodGate ), 0x839 ),
|
||||
new DoorInfo( typeof( BarredMetalDoor ), 0x1FED )
|
||||
};
|
||||
}
|
||||
|
||||
/* public class DoorInfo
|
||||
{
|
||||
public Type m_Type;
|
||||
public int m_BaseID;
|
||||
|
||||
public DoorInfo( Type type, int baseID )
|
||||
{
|
||||
m_Type = type;
|
||||
m_BaseID = baseID;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Commands;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class AddSecretDoorGump : Gump
|
||||
{
|
||||
private int m_Type;
|
||||
|
||||
public AddSecretDoorGump()
|
||||
: this( -1 )
|
||||
{
|
||||
}
|
||||
|
||||
public void AddBlueBack( int width, int height )
|
||||
{
|
||||
AddBackground( 0, 0, width - 00, height - 00, 0xE10 );
|
||||
AddBackground( 8, 5, width - 16, height - 11, 0x053 );
|
||||
AddImageTiled( 15, 14, width - 29, height - 29, 0xE14 );
|
||||
AddAlphaRegion( 15, 14, width - 29, height - 29 );
|
||||
}
|
||||
|
||||
public AddSecretDoorGump( int type )
|
||||
: base( 50, 40 )
|
||||
{
|
||||
m_Type = type;
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
if( m_Type >= 0 && m_Type < m_Types.Length )
|
||||
{
|
||||
AddBlueBack( 155, 174 );
|
||||
|
||||
int baseID = m_Types[m_Type].m_BaseID;
|
||||
|
||||
AddItem( 25, 24, baseID );
|
||||
AddButton( 26, 37, 0x5782, 0x5782, 1, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddItem( 47, 45, baseID + 2 );
|
||||
AddButton( 43, 57, 0x5783, 0x5783, 2, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddItem( 87, 22, baseID + 10 );
|
||||
AddButton( 116, 35, 0x5785, 0x5785, 6, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddItem( 65, 45, baseID + 8 );
|
||||
AddButton( 96, 55, 0x5784, 0x5784, 5, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddButton( 73, 36, 0x2716, 0x2716, 9, GumpButtonType.Reply, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
AddBlueBack( 265, 145 );
|
||||
|
||||
for( int i = 0; i < m_Types.Length; ++i )
|
||||
{
|
||||
AddButton( 30 + (i * 49), 13, 0x2624, 0x2625, i + 1, GumpButtonType.Reply, 0 );
|
||||
AddItem( 22 + (i * 49), 20, m_Types[i].m_BaseID );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
Mobile from = sender.Mobile;
|
||||
int button = info.ButtonID - 1;
|
||||
|
||||
if( m_Type == -1 )
|
||||
{
|
||||
if( button >= 0 && button < m_Types.Length )
|
||||
from.SendGump( new AddSecretDoorGump( button ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( button >= 0 && button < 8 )
|
||||
{
|
||||
from.SendGump( new AddSecretDoorGump( m_Type ) );
|
||||
CommandSystem.Handle( from, String.Format( "{0}Add {1} {2}", CommandSystem.Prefix, m_Types[m_Type].m_Type.Name, (DoorFacing)button ) );
|
||||
}
|
||||
else if( button == 8 )
|
||||
{
|
||||
from.SendGump( new AddSecretDoorGump( m_Type ) );
|
||||
CommandSystem.Handle( from, String.Format( "{0}Link", CommandSystem.Prefix ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendGump( new AddSecretDoorGump() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register( "AddSecretDoor", AccessLevel.GameMaster, new CommandEventHandler( AddDoor_OnCommand ) );
|
||||
}
|
||||
|
||||
[Usage( "AddSecretDoor" )]
|
||||
[Description( "Displays a menu from which you can interactively add secret doors." )]
|
||||
public static void AddDoor_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
e.Mobile.SendGump( new AddSecretDoorGump() );
|
||||
}
|
||||
|
||||
public static DoorInfo[] m_Types = new DoorInfo[]
|
||||
{
|
||||
new DoorInfo( typeof( SecretStoneDoor1 ), 0xE9 ),
|
||||
new DoorInfo( typeof( SecretDungeonDoor ), 0x315 ),
|
||||
new DoorInfo( typeof( SecretStoneDoor2 ), 0x325 ),
|
||||
new DoorInfo( typeof( SecretWoodenDoor ), 0x335 ),
|
||||
new DoorInfo( typeof( SecretLightWoodDoor ), 0x345 ),
|
||||
new DoorInfo( typeof( SecretStoneDoor3 ), 0x355 )
|
||||
};
|
||||
}
|
||||
|
||||
/* public class DoorInfo
|
||||
{
|
||||
public Type m_Type;
|
||||
public int m_BaseID;
|
||||
|
||||
public DoorInfo( Type type, int baseID )
|
||||
{
|
||||
m_Type = type;
|
||||
m_BaseID = baseID;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
Executable
+130
@@ -0,0 +1,130 @@
|
||||
#region References
|
||||
using System;
|
||||
|
||||
using Server.Factions;
|
||||
using Server.Gumps;
|
||||
using Server.Misc;
|
||||
using Server.Mobiles;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
using Server.Regions;
|
||||
using Server.Spells;
|
||||
#endregion
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AdminGate : Moongate
|
||||
{
|
||||
private bool m_StaffOnly = true;
|
||||
private AdminGate m_LinkedGate;
|
||||
private InternalTimer m_Timer;
|
||||
|
||||
public override bool ShowFeluccaWarning { get { return false; } }
|
||||
public override bool TeleportPets { get { return true; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool StaffOnly
|
||||
{
|
||||
get { return m_StaffOnly; }
|
||||
set { m_StaffOnly = value; }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public AdminGate LinkedGate
|
||||
{
|
||||
get { return m_LinkedGate; }
|
||||
set { m_LinkedGate = value; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AdminGate()
|
||||
: base(Point3D.Zero, null)
|
||||
{
|
||||
Name = "Golden Moongate";
|
||||
Dispellable = false;
|
||||
Hue = 2503;
|
||||
|
||||
if(m_Timer == null)
|
||||
m_Timer = new InternalTimer(this);
|
||||
|
||||
m_Timer.Start();
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AdminGate(Point3D target, Map targetMap)
|
||||
: base(target, targetMap)
|
||||
{
|
||||
Name = "Golden Moongate";
|
||||
Dispellable = false;
|
||||
Movable = false;
|
||||
Light = LightType.Circle300;
|
||||
Hue = 2503;
|
||||
|
||||
Target = target;
|
||||
TargetMap = targetMap;
|
||||
|
||||
if(m_Timer == null)
|
||||
m_Timer = new InternalTimer(this);
|
||||
|
||||
m_Timer.Start();
|
||||
}
|
||||
|
||||
public AdminGate(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (StaffOnly && !from.IsStaff())
|
||||
from.SendMessage("You cannot access this gate.");
|
||||
else
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
|
||||
public override void UseGate(Mobile m)
|
||||
{
|
||||
|
||||
if (StaffOnly && !m.IsStaff())
|
||||
m.SendMessage("You cannot access this gate.");
|
||||
else
|
||||
base.UseGate(m);
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(1); // version
|
||||
|
||||
writer.Write(m_StaffOnly);
|
||||
writer.Write(m_LinkedGate);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
m_StaffOnly = reader.ReadBool();
|
||||
m_LinkedGate = reader.ReadItem() as AdminGate;
|
||||
m_Timer = new InternalTimer(this);
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private readonly Item m_Item;
|
||||
|
||||
public InternalTimer(Item item)
|
||||
: base(TimeSpan.FromSeconds(30.0))
|
||||
{
|
||||
Priority = TimerPriority.OneSecond;
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Item.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+215
@@ -0,0 +1,215 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
using Server.Engines.Craft;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
using Server.Prompts;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AdminRunebook : Item, ISecurable
|
||||
{
|
||||
private List <AdminRunebookEntry> m_Entries;
|
||||
private string m_Description;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public SecureLevel Level { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Description;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Description = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual int MaxEntries { get { return 9; } }
|
||||
|
||||
[Constructable]
|
||||
public AdminRunebook()
|
||||
: base(0x9C16) //0x22C5 OG runebook itemID, 0x2259 BOD book ID
|
||||
{
|
||||
Name = "admin runebook";
|
||||
Weight = 0.0;
|
||||
Hue = 2503;
|
||||
m_Entries = new List<AdminRunebookEntry>();
|
||||
}
|
||||
|
||||
public List<AdminRunebookEntry> Entries { get { return m_Entries; } }
|
||||
|
||||
public void AddEntry(PlayerMobile pm)
|
||||
{
|
||||
if(m_Entries == null)
|
||||
{
|
||||
m_Entries = new List<AdminRunebookEntry>();
|
||||
pm.SendMessage("New list added.");
|
||||
}
|
||||
else
|
||||
{
|
||||
AdminRunebookEntry entry = new AdminRunebookEntry(pm.Location, pm.Map, "a new location");
|
||||
m_Entries.Add(entry);
|
||||
pm.SendMessage(entry.Description + " added to list");
|
||||
pm.SendMessage(m_Entries.Count + " entries total");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if(from is PlayerMobile)
|
||||
{
|
||||
PlayerMobile pm = (PlayerMobile)from;
|
||||
if (!pm.IsStaff())
|
||||
pm.SendMessage("You do not have the power to access this book.");
|
||||
else
|
||||
{
|
||||
BaseGump.SendGump(new AdminRunebookGump(this, pm));
|
||||
pm.SendMessage("You open the admin runebook.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public AdminRunebook(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public void GetDescriptionPrompt(PlayerMobile admin)
|
||||
{
|
||||
admin.Prompt = new DescriptionPrompt(this);
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
SetSecureLevelEntry.AddTo(from, this, list);
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0); // version
|
||||
|
||||
writer.Write(m_Entries.Count);
|
||||
|
||||
for (int i = 0; i < m_Entries.Count; ++i)
|
||||
m_Entries[i].Serialize(writer);
|
||||
|
||||
writer.Write(m_Description);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
int count = reader.ReadInt();
|
||||
m_Entries = new List<AdminRunebookEntry>(count);
|
||||
|
||||
for (int i = 0; i < count; ++i)
|
||||
m_Entries.Add(new AdminRunebookEntry(reader));
|
||||
|
||||
m_Description = reader.ReadString();
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (m_Description != null && m_Description.Length > 0)
|
||||
list.Add(m_Description);
|
||||
|
||||
}
|
||||
|
||||
private class DescriptionPrompt : Prompt
|
||||
{
|
||||
//public override int MessageCliloc { get { return 501804; } }
|
||||
private readonly AdminRunebook m_Book;
|
||||
|
||||
public DescriptionPrompt(AdminRunebook book)
|
||||
{
|
||||
m_Book = book;
|
||||
}
|
||||
|
||||
public override void OnResponse(Mobile from, string text)
|
||||
{
|
||||
if (m_Book != null)
|
||||
{
|
||||
m_Book.Description = text;
|
||||
from.SendMessage("You add a description to your book");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class AdminRunebookEntry
|
||||
{
|
||||
private Map m_TargetMap;
|
||||
private string m_Description;
|
||||
private bool m_Selected = false;
|
||||
|
||||
public bool Selected
|
||||
{
|
||||
get { return m_Selected; }
|
||||
set { m_Selected = value; }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
|
||||
public Point3D Target { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
|
||||
public Map TargetMap
|
||||
{
|
||||
get { return m_TargetMap; }
|
||||
set
|
||||
{
|
||||
if (m_TargetMap != value)
|
||||
{
|
||||
m_TargetMap = value;
|
||||
//InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
public string Description
|
||||
{
|
||||
get { return m_Description; }
|
||||
set { m_Description = value; }
|
||||
}
|
||||
|
||||
public BaseGalleon Galleon { get; }
|
||||
|
||||
public AdminRunebookEntry(Point3D loc, Map map, string desc)
|
||||
{
|
||||
Target = loc;
|
||||
m_TargetMap = map;
|
||||
m_Description = desc;
|
||||
}
|
||||
|
||||
public AdminRunebookEntry(GenericReader reader)
|
||||
{
|
||||
int version = reader.ReadByte();
|
||||
|
||||
//int version = reader.ReadInt();
|
||||
Target = reader.ReadPoint3D();
|
||||
m_TargetMap = reader.ReadMap();
|
||||
m_Description = reader.ReadString();
|
||||
}
|
||||
|
||||
public void Serialize(GenericWriter writer)
|
||||
{
|
||||
writer.Write((byte)3);
|
||||
|
||||
writer.Write(Target);
|
||||
writer.Write(m_TargetMap);
|
||||
writer.Write(m_Description);
|
||||
}
|
||||
}
|
||||
}
|
||||
+381
@@ -0,0 +1,381 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
using Server.Targets;
|
||||
using Server.Targeting;
|
||||
using System.Globalization;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class AdminRunebookGump : BaseGump
|
||||
{
|
||||
private AdminRunebook m_Book;
|
||||
private List<AdminRunebookEntry> m_Entries;
|
||||
private PlayerMobile m_Admin;
|
||||
private int MaxEntries = 24;
|
||||
private int PageOneEntries;
|
||||
private int PageTwoEntries;
|
||||
private bool StaffOnly = false;
|
||||
private bool OptionsMenu = false;
|
||||
private int Page;
|
||||
|
||||
public AdminRunebookGump(AdminRunebook book, PlayerMobile admin)
|
||||
: base(admin, 100, 100)
|
||||
{
|
||||
m_Book = book;
|
||||
m_Entries = book.Entries;
|
||||
m_Admin = admin;
|
||||
Page = 1;
|
||||
}
|
||||
|
||||
public AdminRunebookGump(AdminRunebook book, PlayerMobile admin, int page)
|
||||
: base(admin, 100, 100)
|
||||
{
|
||||
m_Book = book;
|
||||
m_Entries = book.Entries;
|
||||
m_Admin = admin;
|
||||
Page = page;
|
||||
}
|
||||
|
||||
public override void AddGumpLayout()
|
||||
{
|
||||
AddPage(0);
|
||||
AddImage(0, 0, 0x9BF3);
|
||||
|
||||
AddHtml(60, 10, 190, 16, FormatOptions("Admin Runebook", "#504107"), false, false);
|
||||
|
||||
|
||||
AddHtml(80, 300, 400, 16, FormatOptions("Add Location", "#F0F8FF"), false, false);
|
||||
AddButton(50, 300, 0x16CE, 0x16CD, 1, GumpButtonType.Reply, 0);
|
||||
|
||||
AddHtml(80, 330, 400, 16, FormatOptions("Options", "#F0F8FF"), false, false);
|
||||
AddButton(50, 330, 0x16CE, 0x16CD, 2, GumpButtonType.Reply, 0);
|
||||
|
||||
/* Options menu */
|
||||
if (OptionsMenu == true)
|
||||
{
|
||||
AddHtml(275, 10, 400, 16, FormatOptions("Options", "#504107"), false, false);
|
||||
|
||||
AddButton(250, 105, 0x868, 0x869, 6, GumpButtonType.Reply, 0);
|
||||
AddHtml(285, 110, 400, 16, FormatOptions("Subtitle Book", "#F0F8FF"), false, false);
|
||||
|
||||
AddButton(250, 155, 0x868, 0x869, 5, GumpButtonType.Reply, 0);
|
||||
AddHtml(285, 160, 400, 16, FormatOptions("Clear Entries", "#F0F8FF"), false, false);
|
||||
|
||||
AddButton(250, 205, 0x868, 0x869, 4, GumpButtonType.Reply, 0);
|
||||
AddHtml(285, 210, 400, 16, FormatOptions("Copy Entries", "#F0F8FF"), false, false);
|
||||
|
||||
}
|
||||
|
||||
AddPage(1);
|
||||
if (Page == 1)
|
||||
{
|
||||
AddButton(374, 4, 0x89E, 0x89E, 1002, GumpButtonType.Reply, 0);
|
||||
|
||||
if (m_Entries.Count < 12)
|
||||
PageOneEntries = m_Entries.Count;
|
||||
else
|
||||
PageOneEntries = 12;
|
||||
|
||||
int y = 30;
|
||||
if(m_Entries != null )
|
||||
{
|
||||
|
||||
for(int i = 0; i < PageOneEntries; i++)
|
||||
{
|
||||
|
||||
if (m_Entries[i] == null)
|
||||
{
|
||||
m_Entries.RemoveAt(i);
|
||||
i--;
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(40, y+2, 0x4B9, 0x4BA, i + 100, GumpButtonType.Reply, 0);
|
||||
AddHtml(65, y, 400, 16, FormatOptions(m_Entries[i].Description, m_Entries[i].Selected ? "#504107" : "#F0F8FF"), false, false);
|
||||
|
||||
if (m_Entries[i].Selected)
|
||||
{
|
||||
|
||||
AddImageTiled(270, 10, 100, 21, 0xBBC);
|
||||
AddTextEntry(275, 10, 140, 21, 0, 1, m_Entries[i].Description);
|
||||
AddButton(260, 52, 0x4B9, 0x4BA, i + 500, GumpButtonType.Reply, 0); //Remove Entry
|
||||
AddHtml(280, 50, 400, 16, FormatOptions("Remove Entry", "#504107"), false, false);
|
||||
|
||||
AddButton(250, 85, 0x868, 0x869, i + 600, GumpButtonType.Reply, 0);
|
||||
AddHtml(285, 90, 400, 16, FormatOptions("Create Rune", "#504107"), false, false);
|
||||
|
||||
AddButton(250, 135, 0x868, 0x869, i + 400, GumpButtonType.Reply, 0);
|
||||
AddHtml(285, 140, 400, 16, FormatOptions("Send Player", "#504107"), false, false);
|
||||
|
||||
AddHtml(255, 255, 400, 16, FormatOptions("Travel", "#504107"), false, false);
|
||||
AddHtml(315, 255, 400, 16, FormatOptions( "Admin Gate", "#504107"), false, false);
|
||||
|
||||
AddHtml(264, 185, 400, 16, FormatOptions("Gate Access: ", "#504107"), false, false);
|
||||
AddButton(250, 205, StaffOnly ? 0x86A : 0x868, StaffOnly ? 0x867 : 0x869, 3, GumpButtonType.Reply, 0); //Staff Only
|
||||
AddHtml(285, 210, 400, 16, FormatOptions("Staff Only", "#504107"), false, false);
|
||||
|
||||
AddButton(245, 11, 0x4B9, 0x4BA, i + 150, GumpButtonType.Reply, 0); //Rename
|
||||
AddButton(250, 290, 0x1B77, 0x1B77, i + 200, GumpButtonType.Reply, 0); // Travel
|
||||
AddButton(315, 290, 0x1B8B, 0x1B8B, i + 250, GumpButtonType.Reply, 0); // Admin Gate
|
||||
}
|
||||
|
||||
y += 20;
|
||||
}
|
||||
}
|
||||
|
||||
if( m_Entries.Count == 0)
|
||||
AddHtml(60, 30, 400, 16, FormatOptions("No entries", "#F0F8FF"), false, false);
|
||||
}
|
||||
else
|
||||
AddHtml(60, 30, 400, 16, FormatOptions("No entries", "#F0F8FF"), false, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ( Page == 2)
|
||||
{
|
||||
AddButton(22, 4, 0x89D, 0x89D, 1001, GumpButtonType.Reply, 0);
|
||||
|
||||
if (m_Entries.Count < 12)
|
||||
PageTwoEntries = 0;
|
||||
else if (m_Entries.Count > 9 && m_Entries.Count < 24)
|
||||
PageTwoEntries = m_Entries.Count;
|
||||
else
|
||||
PageTwoEntries = 24;
|
||||
|
||||
int y = 30;
|
||||
if(m_Entries != null )
|
||||
{
|
||||
|
||||
for(int i = 12; i < PageTwoEntries; i++)
|
||||
{
|
||||
|
||||
if (m_Entries[i] == null)
|
||||
{
|
||||
m_Entries.RemoveAt(i);
|
||||
i--;
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(40, y+2, 0x4B9, 0x4BA, i + 100, GumpButtonType.Reply, 0);
|
||||
AddHtml(65, y, 400, 16, FormatOptions(m_Entries[i].Description, m_Entries[i].Selected ? "#504107" : "#F0F8FF"), false, false);
|
||||
|
||||
if (m_Entries[i].Selected)
|
||||
{
|
||||
|
||||
AddImageTiled(270, 10, 100, 21, 0xBBC);
|
||||
AddTextEntry(275, 10, 140, 21, 0, 1, m_Entries[i].Description);
|
||||
AddButton(260, 52, 0x4B9, 0x4BA, i + 500, GumpButtonType.Reply, 0); //Remove Entry
|
||||
AddHtml(280, 50, 400, 16, FormatOptions("Remove Entry", "#504107"), false, false);
|
||||
|
||||
AddButton(250, 85, 0x868, 0x869, i + 600, GumpButtonType.Reply, 0);
|
||||
AddHtml(285, 90, 400, 16, FormatOptions("Create Rune", "#504107"), false, false);
|
||||
|
||||
AddButton(250, 135, 0x868, 0x869, i + 400, GumpButtonType.Reply, 0);
|
||||
AddHtml(285, 140, 400, 16, FormatOptions("Send Player", "#504107"), false, false);
|
||||
|
||||
AddHtml(255, 255, 400, 16, FormatOptions("Travel", "#504107"), false, false);
|
||||
AddHtml(315, 255, 400, 16, FormatOptions( "Admin Gate", "#504107"), false, false);
|
||||
|
||||
AddHtml(264, 185, 400, 16, FormatOptions("Gate Access: ", "#504107"), false, false);
|
||||
AddButton(250, 205, StaffOnly ? 0x86A : 0x868, StaffOnly ? 0x867 : 0x869, 3, GumpButtonType.Reply, 0); //Staff Only
|
||||
AddHtml(285, 210, 400, 16, FormatOptions("Staff Only", "#504107"), false, false);
|
||||
|
||||
AddButton(245, 11, 0x4B9, 0x4BA, i + 150, GumpButtonType.Reply, 0); //Rename
|
||||
AddButton(250, 290, 0x1B77, 0x1B77, i + 200, GumpButtonType.Reply, 0); // Travel
|
||||
AddButton(315, 290, 0x1B8B, 0x1B8B, i + 250, GumpButtonType.Reply, 0); // Admin Gate
|
||||
}
|
||||
|
||||
y += 20;
|
||||
}
|
||||
}
|
||||
|
||||
if( m_Entries.Count == 0)
|
||||
AddHtml(60, 30, 400, 16, FormatOptions("No entries", "#F0F8FF"), false, false);
|
||||
}
|
||||
else
|
||||
AddHtml(60, 30, 400, 16, FormatOptions("No entries", "#F0F8FF"), false, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public string Rename(RelayInfo info, Mobile from)
|
||||
{
|
||||
TextRelay tn = info.GetTextEntry(1); //Text Name
|
||||
|
||||
string name = tn.Text;
|
||||
|
||||
return name;
|
||||
}
|
||||
public string FormatOptions(string val, string color)
|
||||
{
|
||||
if( color == null)
|
||||
return String.Format("<div align=left>{0}</div>", val);
|
||||
else
|
||||
return String.Format("<BASEFONT COLOR={1}><dic align=left>{0}</div>", val, color);
|
||||
}
|
||||
|
||||
public override void OnResponse(RelayInfo info)
|
||||
{
|
||||
if(info.ButtonID == 0)
|
||||
return;
|
||||
|
||||
if(info.ButtonID == 1)
|
||||
{
|
||||
if( m_Entries.Count < MaxEntries)
|
||||
m_Book.AddEntry(m_Admin);
|
||||
else
|
||||
{
|
||||
m_Admin.SendMessage("Your entry list is full.");
|
||||
Refresh();
|
||||
}
|
||||
|
||||
}
|
||||
if(info.ButtonID == 2)
|
||||
{
|
||||
|
||||
if (m_Entries != null)
|
||||
{
|
||||
for(int n = 0; n < m_Entries.Count; n++)
|
||||
m_Entries[n].Selected = false;
|
||||
}
|
||||
|
||||
OptionsMenu = true;
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
if (info.ButtonID == 3)
|
||||
{
|
||||
if(!StaffOnly)
|
||||
StaffOnly = true;
|
||||
else
|
||||
StaffOnly = false;
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
if(info.ButtonID == 4)
|
||||
{
|
||||
m_Admin.Target = new CopyEntriesTarget(m_Book);
|
||||
}
|
||||
|
||||
if(info.ButtonID == 5)
|
||||
{
|
||||
if(m_Entries != null)
|
||||
m_Entries.Clear();
|
||||
}
|
||||
if(info.ButtonID == 6)
|
||||
{
|
||||
m_Book.GetDescriptionPrompt(m_Admin);
|
||||
}
|
||||
|
||||
if (info.ButtonID >= 400 && info.ButtonID < 425) // send player
|
||||
{
|
||||
m_Admin.Target = new AdminRunebookPlayerTarget(m_Entries[info.ButtonID - 400].Target, m_Entries[info.ButtonID - 400].TargetMap);
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
if (info.ButtonID >= 100 && info.ButtonID < 125) // select entry
|
||||
{
|
||||
OptionsMenu = false;
|
||||
for(int e = 0; e < m_Entries.Count; e++)
|
||||
m_Entries[e].Selected = false;
|
||||
|
||||
m_Entries[info.ButtonID - 100].Selected = true;
|
||||
|
||||
if (info.ButtonID > 112)
|
||||
Page = 2;
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
if (info.ButtonID >= 150 && info.ButtonID < 175)
|
||||
{
|
||||
string newName = Rename(info, m_Admin);
|
||||
m_Entries[info.ButtonID - 150].Description = newName;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
if (info.ButtonID >= 200 && info.ButtonID < 225) // admin gate
|
||||
{
|
||||
m_Admin.MoveToWorld(m_Entries[info.ButtonID - 200].Target, m_Entries[info.ButtonID - 200].TargetMap);
|
||||
}
|
||||
if (info.ButtonID >= 250 && info.ButtonID < 275)
|
||||
{
|
||||
AdminGate gateOne = new AdminGate(m_Entries[info.ButtonID - 250].Target, m_Entries[info.ButtonID - 250].TargetMap);
|
||||
gateOne.MoveToWorld(m_Admin.Location, m_Admin.Map);
|
||||
AdminGate gateTwo = new AdminGate(m_Admin.Location, m_Admin.Map);
|
||||
gateTwo.MoveToWorld(m_Entries[info.ButtonID - 250].Target, m_Entries[info.ButtonID - 250].TargetMap);
|
||||
|
||||
if(!StaffOnly)
|
||||
{
|
||||
gateOne.StaffOnly = false;
|
||||
gateTwo.StaffOnly = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
gateOne.StaffOnly = true;
|
||||
gateTwo.StaffOnly = true;
|
||||
}
|
||||
|
||||
gateOne.LinkedGate = gateTwo;
|
||||
gateTwo.LinkedGate = gateOne;
|
||||
}
|
||||
|
||||
if (info.ButtonID >= 500 && info.ButtonID < 525)
|
||||
{
|
||||
m_Entries.RemoveAt(info.ButtonID - 500);
|
||||
}
|
||||
|
||||
if (info.ButtonID >= 600 && info.ButtonID < 625)
|
||||
{
|
||||
RecallRune rune = new RecallRune();
|
||||
rune.Marked = true;
|
||||
rune.TargetMap = m_Entries[info.ButtonID - 600].TargetMap;
|
||||
rune.Target = m_Entries[info.ButtonID - 600].Target;
|
||||
rune.Description = m_Entries[info.ButtonID - 600].Description;
|
||||
m_Admin.Backpack.DropItem(rune);
|
||||
}
|
||||
|
||||
if (info.ButtonID == 1001)
|
||||
{
|
||||
BaseGump.SendGump(new AdminRunebookGump(m_Book, m_Admin, 1));
|
||||
}
|
||||
|
||||
if (info.ButtonID == 1002)
|
||||
{
|
||||
BaseGump.SendGump(new AdminRunebookGump(m_Book, m_Admin, 2));
|
||||
}
|
||||
}
|
||||
private class CopyEntriesTarget : Target
|
||||
{
|
||||
private AdminRunebook m_Original;
|
||||
public CopyEntriesTarget(AdminRunebook book)
|
||||
: base( -1, true, TargetFlags.None)
|
||||
{
|
||||
m_Original = book;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (from is PlayerMobile && o is AdminRunebook)
|
||||
{
|
||||
PlayerMobile pm = from as PlayerMobile;
|
||||
AdminRunebook book = o as AdminRunebook;
|
||||
book.Entries.Clear();
|
||||
for( int i = 0; i < m_Original.Entries.Count; i++)
|
||||
{
|
||||
book.AddEntry(pm);
|
||||
book.Entries[i] = m_Original.Entries[i];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Targets
|
||||
{
|
||||
public class AdminRunebookPlayerTarget : Target
|
||||
{
|
||||
Point3D TargetLocation;
|
||||
Map TargetMap;
|
||||
|
||||
public AdminRunebookPlayerTarget(Point3D loc, Map map)
|
||||
: base( 12, false, TargetFlags.None)
|
||||
{
|
||||
TargetLocation = loc;
|
||||
TargetMap = map;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is PlayerMobile && TargetLocation != Point3D.Zero && TargetMap != null)
|
||||
{
|
||||
PlayerMobile pm = (PlayerMobile)targeted;
|
||||
|
||||
pm.MoveToWorld(TargetLocation, TargetMap);
|
||||
pm.SendMessage("You have been sent to a new location though divine intervention!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+265
@@ -0,0 +1,265 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AdminToken : Item
|
||||
{
|
||||
private Timer m_Timer;
|
||||
private DateTime m_EndTime;
|
||||
|
||||
public DateTime EndTime
|
||||
{
|
||||
get { return m_EndTime; }
|
||||
set { m_EndTime = value; }
|
||||
}
|
||||
|
||||
public Timer Timer
|
||||
{
|
||||
get { return m_Timer; }
|
||||
set { m_Timer = value; }
|
||||
}
|
||||
|
||||
public enum Level
|
||||
{
|
||||
Player = 0,
|
||||
VIP = 1,
|
||||
Counselor = 2,
|
||||
Decorator = 3,
|
||||
Spawner = 4,
|
||||
GameMaster = 5,
|
||||
Seer = 6,
|
||||
Administrator = 7,
|
||||
Developer = 8,
|
||||
CoOwner = 9,
|
||||
Owner = 10,
|
||||
None = 11
|
||||
}
|
||||
|
||||
private Level m_Level = Level.None;
|
||||
public Level StaffLevel
|
||||
{
|
||||
get { return m_Level; }
|
||||
set { m_Level = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AdminToken()
|
||||
: base(0x23C) //0xF8B)
|
||||
{
|
||||
Name = "admin token";
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public AdminToken(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (m_Level == Level.None && m.AccessLevel != AccessLevel.Player)
|
||||
{
|
||||
|
||||
switch(m.AccessLevel)
|
||||
{
|
||||
case AccessLevel.Owner:
|
||||
m_Level = Level.Owner;
|
||||
break;
|
||||
|
||||
case AccessLevel.CoOwner:
|
||||
m_Level = Level.CoOwner;
|
||||
break;
|
||||
|
||||
case AccessLevel.Developer:
|
||||
m_Level = Level.Developer;
|
||||
break;
|
||||
|
||||
case AccessLevel.Administrator:
|
||||
m_Level = Level.Administrator;
|
||||
break;
|
||||
|
||||
case AccessLevel.Seer:
|
||||
m_Level = Level.Seer;
|
||||
break;
|
||||
|
||||
case AccessLevel.GameMaster:
|
||||
m_Level = Level.GameMaster;
|
||||
break;
|
||||
|
||||
case AccessLevel.Spawner:
|
||||
m_Level = Level.Spawner;
|
||||
break;
|
||||
|
||||
case AccessLevel.Counselor:
|
||||
m_Level = Level.Counselor;
|
||||
break;
|
||||
|
||||
case AccessLevel.VIP:
|
||||
m_Level = Level.VIP;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (m.AccessLevel != AccessLevel.Player && m_Level != Level.None)
|
||||
{
|
||||
AdminToken token = FindToken(m);
|
||||
int IntLevel = (int)token.StaffLevel;
|
||||
Server.AccessLevel tokenLevel = (AccessLevel)Enum.ToObject(typeof(AccessLevel), IntLevel);
|
||||
m.AccessLevel = AccessLevel.Player;
|
||||
m_EndTime = DateTime.UtcNow + TimeSpan.FromMinutes(5);
|
||||
if (m is PlayerMobile)
|
||||
{
|
||||
PlayerMobile pm = m as PlayerMobile;
|
||||
DoTimer(pm);
|
||||
}
|
||||
m.SendMessage( "You are now in Player Mode.");
|
||||
}
|
||||
else if (m.AccessLevel == AccessLevel.Player && m_Level != Level.None)
|
||||
{
|
||||
AdminToken token = FindToken(m);
|
||||
int IntLevel = (int)token.StaffLevel;
|
||||
Server.AccessLevel tokenLevel = (AccessLevel)Enum.ToObject(typeof(AccessLevel), IntLevel);
|
||||
m.AccessLevel = tokenLevel;
|
||||
m.SendMessage( "You are now in Admin Mode.");
|
||||
if (m_Timer != null)
|
||||
{
|
||||
m_Timer.Stop();
|
||||
m_Timer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetLevel(Level level)
|
||||
{
|
||||
m_Level = level;
|
||||
}
|
||||
|
||||
private static AdminToken FindToken(Mobile from)
|
||||
{
|
||||
if ((from == null) || from.Backpack == null)
|
||||
return null;
|
||||
|
||||
if (from.Holding is AdminToken)
|
||||
{
|
||||
return (AdminToken)from.Holding;
|
||||
}
|
||||
|
||||
return from.Backpack.FindItemByType<AdminToken>();
|
||||
}
|
||||
|
||||
public void DoTimer(PlayerMobile pm)
|
||||
{
|
||||
if(pm.AccessLevel == AccessLevel.Player)
|
||||
{
|
||||
if (m_Timer != null)
|
||||
{
|
||||
m_Timer.Stop();
|
||||
m_Timer = null;
|
||||
}
|
||||
|
||||
m_Timer = new InternalTimer(this, pm, TimeSpan.FromSeconds(1), m_EndTime);
|
||||
m_Timer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
base.OnDelete();
|
||||
|
||||
if(m_Timer != null)
|
||||
m_Timer.Stop();
|
||||
}
|
||||
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
|
||||
list.Add( "Acess Level: " + m_Level.ToString());
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private readonly AdminToken Token;
|
||||
private readonly PlayerMobile Owner;
|
||||
private DateTime EndTime;
|
||||
private readonly TimeSpan Delay;
|
||||
public InternalTimer(AdminToken token, PlayerMobile owner, TimeSpan delay, DateTime end)
|
||||
: base(delay)
|
||||
{
|
||||
|
||||
Token = token;
|
||||
Owner = owner;
|
||||
Delay = delay;
|
||||
EndTime = end;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (Token == null && !Token.Deleted)
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
|
||||
if (Owner.Hits < (Owner.HitsMax/3) && !Owner.Blessed)
|
||||
{
|
||||
Owner.Blessed = true;
|
||||
EndTime = DateTime.UtcNow + TimeSpan.FromSeconds(5);
|
||||
Owner.SendMessage("You have been blessed.");
|
||||
|
||||
if (Token.Timer != null)
|
||||
{
|
||||
Token.Timer.Stop();
|
||||
Token.Timer = null;
|
||||
}
|
||||
|
||||
Token.Timer = new InternalTimer(Token, Owner, Delay, EndTime);
|
||||
Token.Timer.Start();
|
||||
}
|
||||
|
||||
if (DateTime.UtcNow > EndTime)
|
||||
{
|
||||
if (Owner.Blessed)
|
||||
{
|
||||
if (!Owner.Alive)
|
||||
Owner.Resurrect();
|
||||
|
||||
Owner.FixedParticles(0x376A, 9, 32, 5005, EffectLayer.Waist);
|
||||
Owner.PlaySound(0x1F2);
|
||||
Owner.Hits = Owner.HitsMax;
|
||||
Owner.Blessed = false;
|
||||
}
|
||||
|
||||
int IntLevel = (int)Token.StaffLevel;
|
||||
Server.AccessLevel tokenLevel = (AccessLevel)Enum.ToObject(typeof(AccessLevel), IntLevel);
|
||||
Owner.AccessLevel = tokenLevel;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Token.Timer != null)
|
||||
{
|
||||
Token.Timer.Stop();
|
||||
Token.Timer = null;
|
||||
}
|
||||
|
||||
Token.Timer = new InternalTimer(Token, Owner, Delay, EndTime);
|
||||
Token.Timer.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+299
@@ -0,0 +1,299 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
using Server.SkillHandlers;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Server.Misc;
|
||||
using Server.Commands;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
using Server.Targets;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class CommandGump : BaseGump
|
||||
{
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("CommandGump",AccessLevel.Administrator, new CommandEventHandler(CommandGump_OnCommand));
|
||||
}
|
||||
|
||||
[Usage("CommandGump")]
|
||||
[Description("Displays a gump of various admin commands")]
|
||||
public static void CommandGump_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
if(e.Mobile is PlayerMobile)
|
||||
{
|
||||
PlayerMobile pm = (PlayerMobile)e.Mobile;
|
||||
pm.SendGump(new CommandGump(pm));
|
||||
//pm.SendMessage("Is the Gump sending?");
|
||||
}
|
||||
}
|
||||
|
||||
private bool Vertical = false;
|
||||
private PlayerMobile Admin;
|
||||
|
||||
public CommandGump(PlayerMobile pm)
|
||||
: base(pm, 50, 50)
|
||||
{
|
||||
Admin = pm;
|
||||
AddGumpLayout();
|
||||
}
|
||||
|
||||
public override void AddGumpLayout()
|
||||
{
|
||||
int TotalCommands = 7;
|
||||
int width;
|
||||
int height;
|
||||
|
||||
|
||||
if (!Vertical)
|
||||
{
|
||||
width = 650;
|
||||
height = 50;
|
||||
}
|
||||
else
|
||||
{
|
||||
width = 100;
|
||||
height = 400;
|
||||
}
|
||||
|
||||
AddBackground(0, 0, width, height, 0x6DB);
|
||||
|
||||
string[] commands = { "teleport", "hide", "bless", "kill", "remove", "props"};
|
||||
|
||||
if (!Vertical)
|
||||
{
|
||||
for( int j = 0; j < commands.Length; j++)
|
||||
{
|
||||
int x = width / TotalCommands;
|
||||
AddHtml( 35 + (j * x), 15, 250, 20, FormatGump( commands[j].ToString(), "#F0F8FF"), false, false);
|
||||
}
|
||||
|
||||
for( int i = 0; i < (TotalCommands - 1); i++)
|
||||
{
|
||||
int space = width / TotalCommands;
|
||||
AddButton(10 + (i * space), 15, 0x4B9, 0x4BA, i + 1, GumpButtonType.Reply, 0);
|
||||
}
|
||||
AddButton(width - 25, 15, 0x15E2, 0x15E6, 10, GumpButtonType.Reply, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for( int j = 0; j < commands.Length; j++)
|
||||
{
|
||||
int y = height / TotalCommands;
|
||||
AddHtml(35, 5 + (y * j), 250, 20, FormatGump( commands[j].ToString(), "#F0F8FF"), false, false);
|
||||
}
|
||||
|
||||
for( int i = 0; i < (TotalCommands -1); i++)
|
||||
{
|
||||
int space = height / TotalCommands;
|
||||
AddButton(10, 10 + (i * space), 0x4B9, 0x4BA, i + 1, GumpButtonType.Reply, 0);
|
||||
}
|
||||
AddButton(5, height - 25, 0x15E0, 0x15E4, 10, GumpButtonType.Reply, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public string FormatGump(string str, string color)
|
||||
{
|
||||
if( color == null)
|
||||
return String.Format("<div align=left>{0}</div>", str);
|
||||
else
|
||||
return String.Format("<BASEFONT COLOR={1}><dic align=left>{0}</div>", str, color);
|
||||
|
||||
}
|
||||
|
||||
public override void OnResponse(RelayInfo info)
|
||||
{
|
||||
int button = info.ButtonID;
|
||||
|
||||
if (button == 1)
|
||||
{
|
||||
//Admin.Target = new MoveTarget(Admin);
|
||||
Admin.Target = new TeleTarget(Admin);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
||||
if (button == 2)
|
||||
{
|
||||
if (!Admin.Hidden)
|
||||
Admin.Hidden = true;
|
||||
else
|
||||
Admin.Hidden = false;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
if (button == 3)
|
||||
{
|
||||
if (!Admin.Blessed)
|
||||
{
|
||||
Admin.Blessed = true;
|
||||
Admin.SendMessage("You are invulnerable.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Admin.Blessed = false;
|
||||
Admin.SendMessage("You are vulnerable.");
|
||||
}
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
if (button == 4)
|
||||
{
|
||||
Admin.Target = new KillTarget();
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
if (button == 5)
|
||||
{
|
||||
Admin.Target = new RemoveTarget();
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
if (button == 6)
|
||||
{
|
||||
Admin.Target = new PropsTarget();
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
if (button == 10)
|
||||
{
|
||||
if (!Vertical)
|
||||
Vertical = true;
|
||||
else
|
||||
Vertical = false;
|
||||
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
private class TeleTarget : Target
|
||||
{
|
||||
private readonly object m_Object;
|
||||
public TeleTarget(object o)
|
||||
: base (-1, true, TargetFlags.None)
|
||||
{
|
||||
this.m_Object = o;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
IPoint3D p = o as IPoint3D;
|
||||
|
||||
if( p != null)
|
||||
{
|
||||
if (p is Item)
|
||||
((Item)p).GetWorldTop();
|
||||
|
||||
if (this.m_Object is Mobile)
|
||||
{
|
||||
Mobile m = (Mobile)this.m_Object;
|
||||
|
||||
if (!m.Deleted)
|
||||
{
|
||||
|
||||
m.MoveToWorld(new Point3D(p), from.Map);
|
||||
from.Target = new TeleTarget(from);
|
||||
|
||||
var fromLoc = from.Location;
|
||||
var toLoc = new Point3D(p);
|
||||
|
||||
from.Location = toLoc;
|
||||
from.ProcessDelta();
|
||||
|
||||
if (!from.Hidden)
|
||||
{
|
||||
Effects.SendLocationParticles( EffectItem.Create(fromLoc, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
|
||||
Effects.SendLocationParticles(EffectItem.Create(toLoc, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);
|
||||
from.PlaySound(0x1FE);
|
||||
}
|
||||
}
|
||||
else
|
||||
from.SendMessage("Invalid Mobile.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private class KillTarget : Target
|
||||
{
|
||||
public KillTarget()
|
||||
: base( -1, true, TargetFlags.None)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if ( from != null && o != null)
|
||||
{
|
||||
if (o is Mobile)
|
||||
{
|
||||
Mobile m = o as Mobile;
|
||||
if (!m.Blessed)
|
||||
{
|
||||
m.Kill();
|
||||
from.SendMessage( m.Name + " has been killed.");
|
||||
}
|
||||
else
|
||||
from.SendMessage( m.Name + " is invulnerable.");
|
||||
}
|
||||
else
|
||||
from.SendMessage( "That is an invalid target.");
|
||||
}
|
||||
}
|
||||
}
|
||||
private class PropsTarget : Target
|
||||
{
|
||||
public PropsTarget()
|
||||
: base ( -1, true, TargetFlags.None)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (from != null && o != null)
|
||||
{
|
||||
from.SendGump( new PropertiesGump(from, o));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class RemoveTarget : Target
|
||||
{
|
||||
public RemoveTarget()
|
||||
: base( -1, true, TargetFlags.None)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if ( from != null && o != null)
|
||||
{
|
||||
if (o is Mobile)
|
||||
{
|
||||
Mobile m = o as Mobile;
|
||||
m.Delete();
|
||||
from.SendMessage( "The Mobile has been deleted.");
|
||||
|
||||
}
|
||||
else if (o is Item)
|
||||
{
|
||||
Item i = o as Item;
|
||||
i.Delete();
|
||||
from.SendMessage( "The item has been deleted.");
|
||||
}
|
||||
else
|
||||
from.SendMessage( "That is an invalid target.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+93
@@ -0,0 +1,93 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Commands;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class SOSGump : BaseGump
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("SOSGump",AccessLevel.Administrator, new CommandEventHandler(SOSGump_OnCommand));
|
||||
}
|
||||
|
||||
[Usage("SOSGump")]
|
||||
[Description("Can full heal, cure, and bless yourself")]
|
||||
public static void SOSGump_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
if(e.Mobile is PlayerMobile)
|
||||
{
|
||||
PlayerMobile pm = (PlayerMobile)e.Mobile;
|
||||
pm.SendGump(new SOSGump(pm));
|
||||
//pm.SendMessage("Is the Gump sending?");
|
||||
}
|
||||
}
|
||||
|
||||
PlayerMobile User;
|
||||
public SOSGump(PlayerMobile pm)
|
||||
: base(pm, 50, 50)
|
||||
{
|
||||
User = pm;
|
||||
AddGumpLayout();
|
||||
}
|
||||
public override void AddGumpLayout()
|
||||
{
|
||||
AddBackground(0, 0, 100, 100, 0x1400);
|
||||
|
||||
AddButton(10, 15, 0x16CE, 0x16CD, 1, GumpButtonType.Reply, 0);
|
||||
AddHtml(35, 15, 250, 20, FormatGump( "Full Heal", "#F0F8FF"), false, false);
|
||||
AddButton(10, 35, 0x16CE, 0x16CD, 2, GumpButtonType.Reply, 0);
|
||||
AddHtml(35, 35, 250, 20, FormatGump( "Cure", "#F0F8FF"), false, false);
|
||||
AddButton(10, 55, 0x16CE, 0x16CD, 3, GumpButtonType.Reply, 0);
|
||||
AddHtml(35, 55, 250, 20, FormatGump( "Bless", "#F0F8FF"), false, false);
|
||||
}
|
||||
|
||||
public string FormatGump(string str, string color)
|
||||
{
|
||||
if( color == null)
|
||||
return String.Format("<div align=left>{0}</div>", str);
|
||||
else
|
||||
return String.Format("<BASEFONT COLOR={1}><dic align=left>{0}</div>", str, color);
|
||||
|
||||
}
|
||||
|
||||
public override void OnResponse(RelayInfo info)
|
||||
{
|
||||
int button = info.ButtonID;
|
||||
|
||||
if (button == 1)
|
||||
{
|
||||
if (User.Hits < User.HitsMax)
|
||||
{
|
||||
User.Hits = User.HitsMax;
|
||||
User.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
|
||||
User.PlaySound(0x202);
|
||||
}
|
||||
Refresh();
|
||||
}
|
||||
|
||||
if (button == 2)
|
||||
{
|
||||
if (User.Poison != null)
|
||||
User.Poison = null;
|
||||
|
||||
User.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
|
||||
User.PlaySound(0x1E0);
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
if (button == 3)
|
||||
{
|
||||
if (!User.Blessed)
|
||||
User.Blessed = true;
|
||||
else
|
||||
User.Blessed = false;
|
||||
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Executable
+88
@@ -0,0 +1,88 @@
|
||||
using System;
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ViewEffectItem : Item
|
||||
{
|
||||
private int m_ItemID = 0;
|
||||
private int m_Duration = 30;
|
||||
private int m_Speed = 10;
|
||||
private int m_Hue = 0;
|
||||
private int m_RenderMode = 0;
|
||||
private int m_Height = 0;
|
||||
private Point3D p;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int itemID
|
||||
{
|
||||
get { return m_ItemID; }
|
||||
set { m_ItemID = value; }
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Duration
|
||||
{
|
||||
get { return m_Duration; }
|
||||
set { m_Duration = value; }
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Speed
|
||||
{
|
||||
get { return m_Speed; }
|
||||
set { m_Speed = value; }
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int effectHue
|
||||
{
|
||||
get { return m_Hue; }
|
||||
set { m_Hue = value; }
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int RenderMode
|
||||
{
|
||||
get { return m_RenderMode; }
|
||||
set { m_RenderMode = value; }
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Height
|
||||
{
|
||||
get { return m_Height; }
|
||||
set { m_Height = value; }
|
||||
}
|
||||
|
||||
|
||||
[Constructable]
|
||||
public ViewEffectItem()
|
||||
: base(0x1BC3)
|
||||
{
|
||||
Movable = false;
|
||||
Weight = 1.0;
|
||||
Visible = false;
|
||||
}
|
||||
|
||||
public ViewEffectItem (Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
p = Location;
|
||||
p.Z += m_Height;
|
||||
Effects.SendLocationEffect(EffectItem.Create(p, Map, EffectItem.DefaultDuration), Map, m_ItemID, m_Duration, m_Speed, m_Hue, m_RenderMode);
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Executable
+47
@@ -0,0 +1,47 @@
|
||||
using Server.Mobiles;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BountiedHead : Head
|
||||
{
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public DateTime Created { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Bounty { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public PlayerMobile Player { get; set; }
|
||||
|
||||
public BountiedHead(string owner) : base(owner)
|
||||
{
|
||||
}
|
||||
|
||||
public BountiedHead(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
|
||||
writer.Write(Created);
|
||||
writer.Write(Bounty);
|
||||
writer.Write(Player);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
Created = reader.ReadDateTime();
|
||||
Bounty = reader.ReadInt();
|
||||
Player = reader.ReadMobile<PlayerMobile>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+250
@@ -0,0 +1,250 @@
|
||||
using Server.Misc;
|
||||
using Server.Network;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Server.Network.Misc;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BountyBoard : BaseBulletinBoard
|
||||
{
|
||||
private static readonly List<BountyBoard> AllBoards = new List<BountyBoard>();
|
||||
|
||||
[Constructable]
|
||||
public BountyBoard() : base(0x1E5E)
|
||||
{
|
||||
BoardName = "bounty board";
|
||||
AllBoards.Add(this);
|
||||
GetInitialBounties();
|
||||
}
|
||||
|
||||
private void GetInitialBounties()
|
||||
{
|
||||
var bountyPlayers = BountyInformation.GetValidBounties().Select(x=>x.BountyPlayer);
|
||||
|
||||
foreach (var bounty in bountyPlayers)
|
||||
{
|
||||
AddBountyToBoard(bounty);
|
||||
}
|
||||
}
|
||||
|
||||
public BountyBoard(Serial serial) : base(serial)
|
||||
{
|
||||
AllBoards.Add(this);
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
LabelTo(from,
|
||||
string.Format("a bounty board with {0} posted bount{1}", Items.Count, Items.Count == 1 ? "y" : "ies"));
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
list.Add("Bounty Board");
|
||||
list.Add("{0} posted bount{1}", Items.Count, Items.Count == 1 ? "y" : "ies");
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (CheckRange(from))
|
||||
{
|
||||
Cleanup();
|
||||
|
||||
var state = from.NetState;
|
||||
|
||||
state.Send(new BBDisplayBoard(this));
|
||||
if (state.ContainerGridLines)
|
||||
state.Send(new BountyPackets.BBContent6017(from, this));
|
||||
else
|
||||
state.Send(new BountyPackets.BBContent(from, this));
|
||||
}
|
||||
else
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnItemAdded(Item item)
|
||||
{
|
||||
if (!(item is BountyMessage))
|
||||
{
|
||||
var bm = item as BulletinMessage;
|
||||
if (bm != null && bm.Poster != null)
|
||||
bm.Poster.SendMessage("This board is for bounty messages only.");
|
||||
item.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Cleanup()
|
||||
{
|
||||
// Remove any outdated bounties, and remove any posts made by players. Cannot deny player postings without editing BaseBulletinBoard.
|
||||
var validBountyPlayers = BountyInformation.GetValidBounties().Select(x=>x.BountyPlayer);
|
||||
Items.Where(x => !validBountyPlayers.Contains(((BountyMessage)x).BountyPlayer))
|
||||
.ToList()
|
||||
.ForEach( message => message.Delete() );
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
AllBoards.Remove(this);
|
||||
base.Delete();
|
||||
}
|
||||
|
||||
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 static void GloballyCreateMessage(Mobile m)
|
||||
{
|
||||
foreach(var bb in AllBoards)
|
||||
bb.AddBountyToBoard(m);
|
||||
}
|
||||
|
||||
private static void GloballyDeleteMessage(Mobile m)
|
||||
{
|
||||
foreach (var bb in AllBoards)
|
||||
{
|
||||
var curMsg = bb.Items.FirstOrDefault(x => x is BountyMessage && ((BountyMessage)x).BountyPlayer == m);
|
||||
if (curMsg != null)
|
||||
curMsg.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
private void AddBountyToBoard(Mobile m)
|
||||
{
|
||||
AddItem(new BountyMessage(m));
|
||||
}
|
||||
|
||||
public static void UpdateBounty(PlayerMobile pk)
|
||||
{
|
||||
// Unfortunately BulletinMessage does not allow updating of the subject. So we have to delete and remake the bounty message.
|
||||
GloballyDeleteMessage(pk);
|
||||
GloballyCreateMessage(pk);
|
||||
}
|
||||
}
|
||||
|
||||
public class BountyMessage : BulletinMessage
|
||||
{
|
||||
public Mobile BountyPlayer;
|
||||
public int BountyAmount;
|
||||
|
||||
public BountyMessage(Mobile m) : this(m, BountyInformation.GetBounty(m))
|
||||
{
|
||||
}
|
||||
|
||||
public BountyMessage(Mobile bountied, int bounty) : base(bountied, null, bounty + " gold pieces", CreateDescription(bountied))
|
||||
{
|
||||
BountyPlayer = bountied;
|
||||
BountyAmount = bounty;
|
||||
}
|
||||
|
||||
public static string[] CreateDescription(Mobile bountyPlayer)
|
||||
{
|
||||
string subtext1 = null;
|
||||
string subtext2 = null;
|
||||
|
||||
switch (Utility.Random(18))
|
||||
{
|
||||
case 0: subtext1 = "hath murdered one too many!"; break;
|
||||
case 1: subtext1 = "shall not slay again!"; break;
|
||||
case 2: subtext1 = "hath slain too many!"; break;
|
||||
case 3: subtext1 = "cannot continue to kill!"; break;
|
||||
case 4: subtext1 = "must be stopped."; break;
|
||||
case 5: subtext1 = "is a bloodthirsty monster."; break;
|
||||
case 6: subtext1 = "is a killer of the worst sort."; break;
|
||||
case 7: subtext1 = "hath no conscience!"; break;
|
||||
case 8: subtext1 = "hath cowardly slain many."; break;
|
||||
case 9: subtext1 = "must die for all our sakes."; break;
|
||||
case 10: subtext1 = "sheds innocent blood!"; break;
|
||||
case 11: subtext1 = "must fall to preserve us."; break;
|
||||
case 12: subtext1 = "must be taken care of."; break;
|
||||
case 13: subtext1 = "is a thug and must die."; break;
|
||||
case 14: subtext1 = "cannot be redeemed."; break;
|
||||
case 15: subtext1 = "is a shameless butcher."; break;
|
||||
case 16: subtext1 = "is a callous monster."; break;
|
||||
case 17: subtext1 = "is a cruel, casual killer."; break;
|
||||
}
|
||||
|
||||
switch (Utility.Random(7))
|
||||
{
|
||||
case 0: subtext2 = "A bounty is hereby offered"; break;
|
||||
case 1: subtext2 = "Lord British sets a price"; break;
|
||||
case 2: subtext2 = "Claim the reward! 'Tis"; break;
|
||||
case 3: subtext2 = "Lord Blackthorn set a price"; break;
|
||||
case 4: subtext2 = "The Paladins set a price"; break;
|
||||
case 5: subtext2 = "The Merchants set a price"; break;
|
||||
case 6: subtext2 = "Lord British's bounty"; break;
|
||||
}
|
||||
|
||||
var text = string.Format("The foul scum known as {0} {1} For {2} is responsible for {3} murders. {4} of {5} gold pieces for {6} head!", bountyPlayer.RawName, subtext1, (bountyPlayer.Body.IsFemale ? "she" : "he"), bountyPlayer.Kills, subtext2, BountyInformation.GetBounty(bountyPlayer).ToString(), (bountyPlayer.Body.IsFemale ? "her" : "his"));
|
||||
|
||||
var current = 0;
|
||||
var linesList = new List<string>();
|
||||
|
||||
// break up the text into single line length pieces
|
||||
while (current < text.Length)
|
||||
{
|
||||
// make each line 25 chars long
|
||||
var length = text.Length - current;
|
||||
|
||||
if (length > 25)
|
||||
{
|
||||
length = 25;
|
||||
|
||||
while (text[current + length] != ' ')
|
||||
length--;
|
||||
|
||||
length++;
|
||||
linesList.Add(text.Substring(current, length));
|
||||
}
|
||||
else
|
||||
{
|
||||
linesList.Add(string.Format("{0} ", text.Substring(current, length)));
|
||||
}
|
||||
|
||||
current += length;
|
||||
}
|
||||
|
||||
return linesList.ToArray();
|
||||
}
|
||||
|
||||
public BountyMessage(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
|
||||
writer.Write(BountyPlayer);
|
||||
writer.Write(BountyAmount);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
BountyPlayer = reader.ReadMobile();
|
||||
BountyAmount = reader.ReadInt();
|
||||
|
||||
if (BountyPlayer == null)
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+122
@@ -0,0 +1,122 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Misc;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
/*
|
||||
This class is a bit of a hack to make the system drag droppable. We are specifically looking to "override" Carve
|
||||
(which is not virtual in the first place). To do this, the old corpse handler is deregistered. Instead, we call the old
|
||||
CreateCorpseHandler if the corpse should not have a bounty.
|
||||
*/
|
||||
|
||||
public class BountyCorpse : Corpse, ICarvable
|
||||
{
|
||||
[CallPriority(1)]
|
||||
public new static void Initialize()
|
||||
{
|
||||
Mobile.CreateCorpseHandler -= Corpse.Mobile_CreateCorpseHandler;
|
||||
Mobile.CreateCorpseHandler += Mobile_CreateCorpseHandler;
|
||||
}
|
||||
|
||||
public new static Container Mobile_CreateCorpseHandler(Mobile owner, HairInfo hair, FacialHairInfo facialhair,
|
||||
List<Item> initialContent, List<Item> equipItems)
|
||||
{
|
||||
var pm = owner as PlayerMobile;
|
||||
if (pm == null || BountyInformation.GetBounty(pm) <= 0)
|
||||
return Corpse.Mobile_CreateCorpseHandler(owner, hair, facialhair, initialContent, equipItems);
|
||||
|
||||
Corpse c = new BountyCorpse(owner, hair, facialhair, equipItems);
|
||||
|
||||
owner.Corpse = c;
|
||||
|
||||
for (var i = 0; i < initialContent.Count; ++i)
|
||||
{
|
||||
var item = initialContent[i];
|
||||
|
||||
if (Core.AOS && item.Parent == owner.Backpack)
|
||||
c.AddItem(item);
|
||||
else
|
||||
c.DropItem(item);
|
||||
|
||||
if (Core.AOS)
|
||||
c.SetRestoreInfo(item, item.Location);
|
||||
}
|
||||
|
||||
if (Core.AOS)
|
||||
{
|
||||
c.RestoreEquip = pm.EquipSnapshot;
|
||||
}
|
||||
|
||||
var loc = owner.Location;
|
||||
var map = owner.Map;
|
||||
|
||||
if (map == null || map == Map.Internal)
|
||||
{
|
||||
loc = owner.LogoutLocation;
|
||||
map = owner.LogoutMap;
|
||||
}
|
||||
|
||||
c.MoveToWorld(loc, map);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
public BountyCorpse(Mobile owner, HairInfo hair, FacialHairInfo facialhair, List<Item> equipItems)
|
||||
: base(owner, hair, facialhair, equipItems)
|
||||
{
|
||||
}
|
||||
|
||||
public BountyCorpse(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);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public new void Carve(Mobile from, Item item)
|
||||
{
|
||||
base.Carve(from, item);
|
||||
|
||||
var charName = Owner.Name;
|
||||
var itemsInRange = GetItemsInRange(0);
|
||||
Head oldHead = null;
|
||||
foreach (var it in itemsInRange)
|
||||
{
|
||||
var h = it as Head;
|
||||
if (h == null || h is BountiedHead || h.PlayerName != charName)
|
||||
continue;
|
||||
|
||||
oldHead = h;
|
||||
break;
|
||||
}
|
||||
/* RunUO 2.2 IPooledEnumerable does not support ToList()?
|
||||
var oldHead = GetItemsInRange(0)
|
||||
.ToList()
|
||||
.FirstOrDefault(x => x is Head && ((Head) x).PlayerName == charName);*/
|
||||
if (oldHead == null)
|
||||
return;
|
||||
|
||||
var bh = new BountiedHead(charName)
|
||||
{
|
||||
Player = Owner as PlayerMobile,
|
||||
Bounty = BountyInformation.GetBounty(Owner),
|
||||
Created = DateTime.UtcNow
|
||||
};
|
||||
bh.MoveToWorld(oldHead.Location, oldHead.Map);
|
||||
oldHead.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+124
@@ -0,0 +1,124 @@
|
||||
using Server.Items;
|
||||
using Server.Misc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class BountyGuard : WarriorGuard
|
||||
{
|
||||
[Constructable]
|
||||
public BountyGuard()
|
||||
{
|
||||
}
|
||||
|
||||
private static readonly List<int> RejectedHeadSayings = new List<int>()
|
||||
{
|
||||
500661, // I shall place this on my mantle!
|
||||
500662, // This tasteth like chicken.
|
||||
500663, // This tasteth just like the juicy peach I just ate.
|
||||
500664, // Ahh! That was the one piece I was missing!
|
||||
500665, // Somehow, it reminds me of mother.
|
||||
500666, // It's a sign! I can see Elvis in this!
|
||||
500667, // Thanks, I was missing mine.
|
||||
500668, // I'll put this in the lost-and-found box.
|
||||
500669 // My family will eat well tonight!
|
||||
};
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
var bh = dropped as BountiedHead;
|
||||
if (bh != null && bh.Player != null && !bh.Player.Deleted &&
|
||||
bh.Created + TimeSpan.FromDays(1.0) > DateTime.UtcNow)
|
||||
{
|
||||
SayTo(from, 500670); // Ah, a head! Let me check to see if there is a bounty on this.
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(5.0), CheckBountyOnHead, new object[] {bh, from});
|
||||
return true;
|
||||
}
|
||||
else if (dropped is Head)
|
||||
{
|
||||
Say(RejectedHeadSayings[Utility.Random(RejectedHeadSayings.Count)]);
|
||||
dropped.Delete();
|
||||
return true;
|
||||
}
|
||||
|
||||
SayTo(from, 500660); // If this were the head of a murderer, I would check for a bounty.
|
||||
return false;
|
||||
}
|
||||
|
||||
private void CheckBountyOnHead(object[] states)
|
||||
{
|
||||
var head = (BountiedHead) states[0];
|
||||
var bountyHunter = (Mobile) states[1];
|
||||
var bi = BountyInformation.GetBountyInformation(head.Player);
|
||||
|
||||
if (bi == null)
|
||||
{
|
||||
Say("The reward on this scoundrel's head has already been claimed!");
|
||||
head.Delete();
|
||||
return;
|
||||
}
|
||||
|
||||
var totalBounty = bi.Bounty;
|
||||
var headBounty = head.Bounty;
|
||||
var difference = totalBounty - headBounty;
|
||||
|
||||
if (difference < 0)
|
||||
{
|
||||
Say("The reward on this scoundrel's head has already been claimed!");
|
||||
head.Delete();
|
||||
return;
|
||||
}
|
||||
|
||||
bi.SubtractBounty(headBounty);
|
||||
AwardBounty(bountyHunter, head.PlayerName, headBounty);
|
||||
head.Delete();
|
||||
}
|
||||
|
||||
private void AwardBounty(Mobile bountyHunter, string killer, int total)
|
||||
{
|
||||
var bountySize = 0;
|
||||
|
||||
if (total > 15000)
|
||||
bountySize = 2;
|
||||
else if (total > 100)
|
||||
bountySize = 1;
|
||||
|
||||
switch (bountySize)
|
||||
{
|
||||
case 2:
|
||||
bountyHunter.PlaySound(0x2E6);
|
||||
Say("Thou hast brought the infamous " + killer + " to justice! Thy reward of " + total + "gp hath been deposited in thy bank account.");
|
||||
break;
|
||||
case 1:
|
||||
bountyHunter.PlaySound(0x2E5);
|
||||
Say("Tis a minor criminal, thank thee. Thy reward of " + total + "gp hath been deposited in thy bank account.");
|
||||
break;
|
||||
default:
|
||||
bountyHunter.PlaySound(0x2E4);
|
||||
Say("Thou hast wasted thy time for " + total + "gp.");
|
||||
break;
|
||||
}
|
||||
|
||||
Banker.Deposit(bountyHunter, total);
|
||||
}
|
||||
|
||||
public BountyGuard(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+239
@@ -0,0 +1,239 @@
|
||||
using Server.Commands;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Misc
|
||||
{
|
||||
public class BountyInformation
|
||||
{
|
||||
public static void Configure()
|
||||
{
|
||||
EventSink.WorldLoad += Load;
|
||||
EventSink.WorldSave += Save;
|
||||
CommandSystem.Register("BountyProps", AccessLevel.Counselor, BeginBountyProps);
|
||||
}
|
||||
|
||||
private static void BeginBountyProps(CommandEventArgs e)
|
||||
{
|
||||
e.Mobile.BeginTarget(-1, false, TargetFlags.None, ShowBountyProps);
|
||||
}
|
||||
|
||||
private static void ShowBountyProps(Mobile from, object targeted)
|
||||
{
|
||||
var pm = targeted as PlayerMobile;
|
||||
if (pm == null)
|
||||
{
|
||||
from.SendMessage("Only players can have bounties.");
|
||||
return;
|
||||
}
|
||||
|
||||
var bounty = AllInfo.FirstOrDefault(x => x.BountyPlayer == pm);
|
||||
if (bounty == null)
|
||||
{
|
||||
from.SendMessage("That player has no bounty.");
|
||||
return;
|
||||
}
|
||||
|
||||
from.SendGump(new PropertiesGump(from, bounty));
|
||||
}
|
||||
|
||||
private static void Save(WorldSaveEventArgs e)
|
||||
{
|
||||
if (!Directory.Exists("Saves/Bounties"))
|
||||
Directory.CreateDirectory("Saves/Bounties");
|
||||
|
||||
var fullPath = Path.Combine("Saves/Bounties", "BountyInformation.xml");
|
||||
|
||||
using (var op = new StreamWriter(fullPath))
|
||||
{
|
||||
var xml = new XmlTextWriter(op)
|
||||
{
|
||||
Formatting = Formatting.Indented,
|
||||
IndentChar = '\t',
|
||||
Indentation = 1
|
||||
};
|
||||
|
||||
xml.WriteStartDocument(true);
|
||||
xml.WriteStartElement("bounties");
|
||||
xml.WriteAttributeString("count", AllInfo.Count.ToString());
|
||||
|
||||
var toSave = GetValidBounties();
|
||||
foreach (var bi in toSave)
|
||||
{
|
||||
bi.SaveBounty(xml);
|
||||
}
|
||||
|
||||
xml.WriteEndElement();
|
||||
|
||||
xml.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private static void Load()
|
||||
{
|
||||
if (!Directory.Exists("Saves/Bounties"))
|
||||
return;
|
||||
|
||||
var fullPath = Path.Combine("Saves/Bounties", "BountyInformation.xml");
|
||||
|
||||
if (!File.Exists(fullPath))
|
||||
return;
|
||||
|
||||
var saveFile = new XmlDocument();
|
||||
saveFile.Load(fullPath);
|
||||
|
||||
var root = saveFile["bounties"];
|
||||
var noFail = true;
|
||||
var tried = 0;
|
||||
|
||||
foreach (XmlElement bountyInfo in root.GetElementsByTagName("bounty"))
|
||||
{
|
||||
LoadBounty(bountyInfo, ref noFail);
|
||||
tried++;
|
||||
}
|
||||
|
||||
if (noFail)
|
||||
{
|
||||
Console.WriteLine("\n" + AllInfo.Count + " bounties loaded successfully.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("An error occurred while loading bounties." + AllInfo.Count + " out of " + tried +
|
||||
" loaded successfully.");
|
||||
}
|
||||
}
|
||||
|
||||
public static List<BountyInformation> AllInfo = new List<BountyInformation>();
|
||||
|
||||
private PlayerMobile _bountyPlayer;
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public PlayerMobile BountyPlayer { get { return _bountyPlayer; } }
|
||||
|
||||
private int _bounty;
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Bounty
|
||||
{
|
||||
get { return _bounty; }
|
||||
set
|
||||
{
|
||||
var changed = _bounty != value;
|
||||
_bounty = value;
|
||||
|
||||
if (changed)
|
||||
UpdateBountyBoards();
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateBountyBoards()
|
||||
{
|
||||
BountyBoard.UpdateBounty(BountyPlayer);
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public DateTime LastBounty { get; set; }
|
||||
|
||||
public bool Expired
|
||||
{
|
||||
get
|
||||
{
|
||||
return BountyPlayer.Deleted || BountyPlayer.Kills < 5 || Bounty <= 0 ||
|
||||
LastBounty + TimeSpan.FromDays(14.0) < DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
|
||||
public static BountyInformation AddBounty(PlayerMobile pm, int bounty, bool updateBoards)
|
||||
{
|
||||
var bi = AllInfo.FirstOrDefault(info => info.BountyPlayer == pm);
|
||||
|
||||
if (bi == null)
|
||||
{
|
||||
bi = new BountyInformation { _bountyPlayer = pm};
|
||||
AllInfo.Add(bi);
|
||||
}
|
||||
|
||||
bi.AddBounty(bounty, updateBoards);
|
||||
return bi;
|
||||
}
|
||||
|
||||
public static List<BountyInformation> GetValidBounties()
|
||||
{
|
||||
AllInfo = AllInfo.Where(x => !x.Expired).ToList();
|
||||
return AllInfo;
|
||||
}
|
||||
|
||||
private void AddBounty(int bounty, bool updateBoards)
|
||||
{
|
||||
if (updateBoards)
|
||||
Bounty += bounty;
|
||||
else
|
||||
_bounty += bounty;
|
||||
|
||||
LastBounty = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public void SubtractBounty(int headBounty)
|
||||
{
|
||||
Bounty -= headBounty;
|
||||
}
|
||||
|
||||
public static BountyInformation GetBountyInformation(Mobile bountyPlayer)
|
||||
{
|
||||
return AllInfo.FirstOrDefault(info => info.BountyPlayer == bountyPlayer);
|
||||
}
|
||||
|
||||
public static int GetBounty(Mobile bountyPlayer)
|
||||
{
|
||||
var bi = GetBountyInformation(bountyPlayer);
|
||||
return bi == null ? 0 : bi.Bounty;
|
||||
}
|
||||
|
||||
private static void LoadBounty(XmlElement node, ref bool noFail)
|
||||
{
|
||||
try
|
||||
{
|
||||
var serial = Utility.GetXMLInt32(Utility.GetText(node["serial"], "-1"), -1);
|
||||
var mob = World.FindMobile(serial) as PlayerMobile;
|
||||
var bounty = Utility.GetXMLInt32(Utility.GetText(node["bountyAmount"], "-1"), -1);
|
||||
var lastBounty = Utility.GetXMLDateTime(Utility.GetText(node["lastBountyTime"], null), DateTime.UtcNow);
|
||||
|
||||
if (mob == null || bounty == -1 || lastBounty + TimeSpan.FromDays(14.0) < DateTime.UtcNow)
|
||||
return;
|
||||
|
||||
var bi = AddBounty(mob, bounty, false);
|
||||
bi.LastBounty = lastBounty;
|
||||
}
|
||||
catch
|
||||
{
|
||||
noFail = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveBounty(XmlTextWriter xml)
|
||||
{
|
||||
xml.WriteStartElement("bounty");
|
||||
|
||||
xml.WriteStartElement("serial");
|
||||
xml.WriteString(BountyPlayer.Serial.Value.ToString());
|
||||
xml.WriteEndElement();
|
||||
|
||||
xml.WriteStartElement("bountyAmount");
|
||||
xml.WriteString(Bounty.ToString());
|
||||
xml.WriteEndElement();
|
||||
|
||||
xml.WriteStartElement("lastBountyTime");
|
||||
xml.WriteString(XmlConvert.ToString(LastBounty, XmlDateTimeSerializationMode.Utc));
|
||||
xml.WriteEndElement();
|
||||
|
||||
xml.WriteEndElement();
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+96
@@ -0,0 +1,96 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Network.Misc
|
||||
{
|
||||
// The entire reason this class exists is to sort the bounties. "Items" only has a get accessor.
|
||||
public class BountyPackets
|
||||
{
|
||||
public sealed class BBContent : Packet
|
||||
{
|
||||
public BBContent(Mobile beholder, Item beheld) : base(0x3C)
|
||||
{
|
||||
List<Item> items = new List<Item>(beheld.Items);
|
||||
items = items.Where(x => x is BountyMessage).OrderByDescending(x => ((BountyMessage)x).BountyAmount).ToList();
|
||||
int count = items.Count;
|
||||
|
||||
this.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 = items[i];
|
||||
|
||||
if (!child.Deleted && beholder.CanSee(child))
|
||||
{
|
||||
Point3D loc = child.Location;
|
||||
|
||||
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)loc.X);
|
||||
m_Stream.Write((short)loc.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);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class BBContent6017 : Packet
|
||||
{
|
||||
public BBContent6017(Mobile beholder, Item beheld) : base(0x3C)
|
||||
{
|
||||
List<Item> items = new List<Item>(beheld.Items);
|
||||
items = items.Where(x => x is BountyMessage).OrderByDescending(x => ((BountyMessage)x).BountyAmount).ToList();
|
||||
int count = items.Count;
|
||||
|
||||
this.EnsureCapacity(5 + (count * 20));
|
||||
|
||||
long pos = m_Stream.Position;
|
||||
|
||||
int written = 0;
|
||||
|
||||
m_Stream.Write((ushort)0);
|
||||
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
Item child = items[i];
|
||||
|
||||
if (!child.Deleted && beholder.CanSee(child))
|
||||
{
|
||||
Point3D loc = child.Location;
|
||||
|
||||
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)loc.X);
|
||||
m_Stream.Write((short)loc.Y);
|
||||
m_Stream.Write((byte)0); // Grid Location?
|
||||
m_Stream.Write((int)beheld.Serial);
|
||||
m_Stream.Write((ushort)(child.Hue));
|
||||
|
||||
++written;
|
||||
}
|
||||
}
|
||||
|
||||
m_Stream.Seek(pos, SeekOrigin.Begin);
|
||||
m_Stream.Write((ushort)written);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+230
@@ -0,0 +1,230 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Misc;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
using System.Linq;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class ReportMurdererBountyGump : Gump
|
||||
{
|
||||
private int _idx;
|
||||
private readonly List<Mobile> _killers;
|
||||
private readonly Mobile _victim;
|
||||
|
||||
[CallPriority(1)]
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.PlayerDeath -= ReportMurdererGump.EventSink_PlayerDeath;
|
||||
EventSink.PlayerDeath += EventSink_PlayerDeath;
|
||||
}
|
||||
|
||||
public static void EventSink_PlayerDeath(PlayerDeathEventArgs e)
|
||||
{
|
||||
var m = e.Mobile;
|
||||
|
||||
var killers = new List<Mobile>();
|
||||
var toGive = new List<Mobile>();
|
||||
|
||||
foreach (var ai in m.Aggressors)
|
||||
{
|
||||
if (ai.Attacker.Player && ai.CanReportMurder && !ai.Reported)
|
||||
{
|
||||
// Note: The default reportmurderer script only allows reporting the same player once every 10 minutes in the Core.SE expansion.
|
||||
// This was also the case in the T2A era, so I'm not sure why it was set to a minimum expansion of Core.SE
|
||||
if (!((PlayerMobile) m).RecentlyReported.Contains(ai.Attacker))
|
||||
{
|
||||
killers.Add(ai.Attacker);
|
||||
ai.Reported = true;
|
||||
ai.CanReportMurder = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (ai.Attacker.Player && DateTime.UtcNow - ai.LastCombatTime < TimeSpan.FromSeconds(30.0) &&
|
||||
!toGive.Contains(ai.Attacker))
|
||||
toGive.Add(ai.Attacker);
|
||||
}
|
||||
|
||||
toGive.AddRange(
|
||||
m.Aggressed.Where(
|
||||
x =>
|
||||
x.Defender is PlayerMobile && DateTime.UtcNow - x.LastCombatTime < TimeSpan.FromSeconds(30.0) &&
|
||||
!toGive.Contains(x.Defender)).Select(x => x.Defender));
|
||||
|
||||
foreach (var g in toGive)
|
||||
{
|
||||
var n = Notoriety.Compute(g, m);
|
||||
|
||||
var ourKarma = g.Karma;
|
||||
var innocent = n == Notoriety.Innocent;
|
||||
var criminal = n == Notoriety.Criminal || n == Notoriety.Murderer;
|
||||
|
||||
var fameAward = m.Fame/200;
|
||||
var karmaAward = 0;
|
||||
|
||||
if (innocent)
|
||||
karmaAward = ourKarma > -2500 ? -850 : -110 - m.Karma/100;
|
||||
else if (criminal)
|
||||
karmaAward = 50;
|
||||
|
||||
Titles.AwardFame(g, fameAward, false);
|
||||
Titles.AwardKarma(g, karmaAward, true);
|
||||
}
|
||||
|
||||
if (m is PlayerMobile && ((PlayerMobile) m).NpcGuild == NpcGuild.ThievesGuild || killers.Count == 0)
|
||||
return;
|
||||
|
||||
var gump = m.FindGump(typeof (ReportMurdererBountyGump)) as ReportMurdererBountyGump;
|
||||
if (gump != null)
|
||||
gump.TryAddKillers(killers);
|
||||
else
|
||||
new GumpTimer(m, killers).Start();
|
||||
}
|
||||
|
||||
private class GumpTimer : Timer
|
||||
{
|
||||
private readonly Mobile _victim;
|
||||
private readonly List<Mobile> _killers;
|
||||
|
||||
public GumpTimer(Mobile victim, List<Mobile> killers) : base(TimeSpan.FromSeconds(4.0))
|
||||
{
|
||||
_victim = victim;
|
||||
_killers = killers;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
_victim.SendGump(new ReportMurdererBountyGump(_victim, _killers));
|
||||
}
|
||||
}
|
||||
|
||||
public ReportMurdererBountyGump(Mobile victum, List<Mobile> killers) : this(victum, killers, 0)
|
||||
{
|
||||
}
|
||||
|
||||
private ReportMurdererBountyGump(Mobile victum, List<Mobile> killers, int idx) : base(0, 0)
|
||||
{
|
||||
_killers = killers;
|
||||
_victim = victum;
|
||||
_idx = idx;
|
||||
BuildGump();
|
||||
}
|
||||
|
||||
private void BuildGump()
|
||||
{
|
||||
AddBackground(265, 205, 393, 270, 70000);
|
||||
AddImage(265, 205, 1140);
|
||||
|
||||
Closable = false;
|
||||
Resizable = false;
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddHtml(325, 255, 300, 60,
|
||||
"<BIG>Would you like to report " + _killers[_idx].Name + " as a murderer?</BIG>", false, false);
|
||||
|
||||
var bountymax = Banker.GetBalance(_victim);
|
||||
|
||||
if (_killers[_idx].Kills >= 4 && bountymax > 0)
|
||||
{
|
||||
AddHtml(325, 325, 300, 60, "<BIG>Optional Bounty: [" + bountymax + " max] </BIG>", false, false);
|
||||
AddImage(323, 343, 0x475);
|
||||
AddTextEntry(329, 346, 311, 16, 0, 1, "");
|
||||
}
|
||||
|
||||
AddButton(385, 395, 0x47B, 0x47D, 1, GumpButtonType.Reply, 0);
|
||||
AddButton(465, 395, 0x478, 0x47A, 2, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
private void TryAddKillers(IEnumerable<Mobile> killers)
|
||||
{
|
||||
_killers.AddRange(
|
||||
killers.Where(
|
||||
killer =>
|
||||
!_killers.Contains(killer) && !((PlayerMobile) _victim).RecentlyReported.Contains(killer)));
|
||||
}
|
||||
|
||||
public static void ReportedListExpiry_Callback(object state)
|
||||
{
|
||||
var states = (object[]) state;
|
||||
|
||||
var from = (PlayerMobile) states[0];
|
||||
var killer = (Mobile) states[1];
|
||||
|
||||
if (from.RecentlyReported.Contains(killer))
|
||||
{
|
||||
from.RecentlyReported.Remove(killer);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
var killer = _killers[_idx];
|
||||
if (killer != null && !killer.Deleted)
|
||||
{
|
||||
killer.Kills++;
|
||||
killer.ShortTermMurders++;
|
||||
|
||||
|
||||
((PlayerMobile) from).RecentlyReported.Add(killer);
|
||||
Timer.DelayCall(TimeSpan.FromMinutes(10), new TimerStateCallback(ReportedListExpiry_Callback),
|
||||
new object[] {from, killer});
|
||||
|
||||
var pk = (PlayerMobile) killer;
|
||||
|
||||
if (info.GetTextEntry(1) != null)
|
||||
{
|
||||
var c = info.GetTextEntry(1);
|
||||
if (c != null)
|
||||
{
|
||||
var bounty = Math.Min( Utility.ToInt32(c.Text), Banker.GetBalance(from) );
|
||||
|
||||
if (bounty > 0)
|
||||
{
|
||||
Banker.Withdraw(from, bounty);
|
||||
BountyInformation.AddBounty(pk, bounty, true);
|
||||
|
||||
pk.SendMessage("{0} has placed a bounty of {1} {2} on your head!", from.Name,
|
||||
bounty, bounty == 1 ? "gold piece" : "gold pieces");
|
||||
pk.Say(500546); // I am now bounty hunted!
|
||||
|
||||
from.SendMessage("You place a bounty of {0}gp on {1}'s head.", bounty, pk.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pk.ResetKillTime();
|
||||
pk.SendLocalizedMessage(1049067); //You have been reported for murder!
|
||||
|
||||
if (pk.Kills == 5)
|
||||
{
|
||||
pk.SendLocalizedMessage(502134); //You are now known as a murderer!
|
||||
}
|
||||
else if (SkillHandlers.Stealing.SuspendOnMurder && pk.Kills == 1 &&
|
||||
pk.NpcGuild == NpcGuild.ThievesGuild)
|
||||
{
|
||||
pk.SendLocalizedMessage(501562); // You have been suspended by the Thieves Guild.
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_idx++;
|
||||
if (_idx < _killers.Count)
|
||||
from.SendGump(new ReportMurdererBountyGump(from, _killers, _idx));
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+183
@@ -0,0 +1,183 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Commands;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Engines.XmlSpawner2;
|
||||
|
||||
namespace Server.Misc
|
||||
{
|
||||
public class GenCrops
|
||||
{
|
||||
private static List<string> vegetableTypes = new List<string>
|
||||
{
|
||||
"FarmableCarrot", "FarmableCabbage", "FarmableLettuce", "FarmableOnion", "FarmablePumpkin", "FarmableCotton", "FarmableFlax", "FarmableTurnip", "FarmableWheat"
|
||||
};
|
||||
|
||||
private const int NPCCount = 1;
|
||||
private static TimeSpan MinTime = TimeSpan.FromMinutes(2.5);
|
||||
private static TimeSpan MaxTime = TimeSpan.FromMinutes(10.0);
|
||||
private const int Team = 0;
|
||||
private const int HomeRange = 0;
|
||||
private const int SpawnRange = 0;
|
||||
private const bool TotalRespawn = true;
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("GenCrops", AccessLevel.Administrator, new CommandEventHandler(Generate_OnCommand));
|
||||
}
|
||||
|
||||
[Usage("GenCrops")]
|
||||
[Description("Generates vegetable spawners on dirt tiles on all maps")]
|
||||
private static void Generate_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
Parse(e.Mobile);
|
||||
}
|
||||
|
||||
public static void Parse(Mobile from)
|
||||
{
|
||||
from.SendMessage("Generating vegetable spawners on dirt tiles on all maps...");
|
||||
|
||||
List<Map> maps = new List<Map>
|
||||
{
|
||||
Map.Felucca,
|
||||
Map.Trammel,
|
||||
Map.Ilshenar,
|
||||
Map.Malas,
|
||||
Map.Tokuno,
|
||||
Map.TerMur
|
||||
};
|
||||
|
||||
foreach (Map map in maps)
|
||||
{
|
||||
GenerateCropsOnMap(from, map);
|
||||
}
|
||||
|
||||
from.SendMessage("Vegetable generation complete on all maps.");
|
||||
Console.WriteLine("Vegetable generation complete on all maps.");
|
||||
}
|
||||
|
||||
public static void GenerateCropsOnMap(Mobile from, Map map)
|
||||
{
|
||||
int mapWidth = map.Width;
|
||||
int mapHeight = map.Height;
|
||||
Random random = new Random();
|
||||
int spawnerCount = 0;
|
||||
int cropIndex = 0;
|
||||
|
||||
HashSet<Point2D> visited = new HashSet<Point2D>();
|
||||
|
||||
for (int x = 0; x < mapWidth; x++)
|
||||
{
|
||||
for (int y = 0; y < mapHeight; y++)
|
||||
{
|
||||
Point2D point = new Point2D(x, y);
|
||||
if (!visited.Contains(point) && IsDirtTile(map, x, y))
|
||||
{
|
||||
List<Point2D> field = new List<Point2D>();
|
||||
FindField(map, x, y, visited, field);
|
||||
|
||||
if (field.Count > 0)
|
||||
{
|
||||
string vegetableType = vegetableTypes[cropIndex];
|
||||
cropIndex = (cropIndex + 1) % vegetableTypes.Count; // Move to the next crop type
|
||||
|
||||
foreach (var tile in field)
|
||||
{
|
||||
// 50% chance to place a spawner on this tile
|
||||
if (random.NextDouble() < 0.5)
|
||||
{
|
||||
MakeSpawner(new string[] { vegetableType }, tile.X, tile.Y, map.Tiles.GetLandTile(tile.X, tile.Y).Z, map);
|
||||
spawnerCount++;
|
||||
}
|
||||
}
|
||||
//Display each spawned coordinate
|
||||
/* from.SendMessage(String.Format("Field planted with {0} at starting point ({1}, {2}) on {3}", vegetableType, x, y, map.Name)); */
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
from.SendMessage(String.Format("{0} vegetable spawners generated on {1}.", spawnerCount, map.Name));
|
||||
Console.WriteLine(String.Format("{0} vegetable spawners generated on {1}.", spawnerCount, map.Name));
|
||||
}
|
||||
|
||||
private static bool IsDirtTile(Map map, int x, int y)
|
||||
{
|
||||
LandTile landTile = map.Tiles.GetLandTile(x, y);
|
||||
return landTile.ID == 0x9;
|
||||
}
|
||||
|
||||
private static void FindField(Map map, int x, int y, HashSet<Point2D> visited, List<Point2D> field)
|
||||
{
|
||||
Stack<Point2D> stack = new Stack<Point2D>();
|
||||
stack.Push(new Point2D(x, y));
|
||||
|
||||
while (stack.Count > 0)
|
||||
{
|
||||
Point2D point = stack.Pop();
|
||||
if (!visited.Contains(point) && IsDirtTile(map, point.X, point.Y))
|
||||
{
|
||||
visited.Add(point);
|
||||
field.Add(point);
|
||||
|
||||
foreach (var neighbor in GetNeighbors(point))
|
||||
{
|
||||
if (!visited.Contains(neighbor) && IsDirtTile(map, neighbor.X, neighbor.Y))
|
||||
{
|
||||
stack.Push(neighbor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static IEnumerable<Point2D> GetNeighbors(Point2D point)
|
||||
{
|
||||
yield return new Point2D(point.X + 1, point.Y);
|
||||
yield return new Point2D(point.X - 1, point.Y);
|
||||
yield return new Point2D(point.X, point.Y + 1);
|
||||
yield return new Point2D(point.X, point.Y - 1);
|
||||
}
|
||||
|
||||
private static void MakeSpawner(string[] types, int x, int y, int z, Map map)
|
||||
{
|
||||
if (types.Length == 0)
|
||||
return;
|
||||
|
||||
ClearSpawners(x, y, z, map);
|
||||
|
||||
for (int i = 0; i < types.Length; ++i)
|
||||
{
|
||||
XmlSpawner xs = new XmlSpawner(types[i]);
|
||||
|
||||
xs.MaxCount = NPCCount;
|
||||
xs.MinDelay = MinTime;
|
||||
xs.MaxDelay = MaxTime;
|
||||
xs.Team = Team;
|
||||
xs.HomeRange = HomeRange;
|
||||
xs.SpawnRange = SpawnRange;
|
||||
|
||||
xs.MoveToWorld(new Point3D(x, y, z), map);
|
||||
|
||||
if (TotalRespawn)
|
||||
{
|
||||
xs.Respawn();
|
||||
xs.BringToHome();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ClearSpawners(int x, int y, int z, Map map)
|
||||
{
|
||||
foreach (Item item in map.GetItemsInRange(new Point3D(x, y, z), 0))
|
||||
{
|
||||
if (item is XmlSpawner)
|
||||
{
|
||||
item.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+40
@@ -0,0 +1,40 @@
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Bittiez.CustomLoot
|
||||
{
|
||||
public static class CustomLoot
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.CreatureDeath += EventSink_CreatureDeath;
|
||||
}
|
||||
|
||||
private static void EventSink_CreatureDeath(CreatureDeathEventArgs e)
|
||||
{
|
||||
/*if (e.Creature == null) return;
|
||||
|
||||
//Add 1 gold to all horses.
|
||||
if (e.Creature is Mongbat)
|
||||
{
|
||||
e.Corpse.AddItem(new Gold(1));
|
||||
}*/
|
||||
|
||||
|
||||
/* if (e.Creature.Str > 10000) //Is it a strong creature? ¯\_(ツ)_/¯
|
||||
{
|
||||
if (Server.RandomImpl.NextDouble() > 0.2) //~ 80% chance
|
||||
{
|
||||
e.Corpse.AddItem(new HertiageSovereign(100));
|
||||
}
|
||||
}
|
||||
|
||||
if (e.Killer != null)
|
||||
if (e.Killer.LastKiller != e.Creature) //Did the player die to this creature? If not, lets give him a bonus
|
||||
{
|
||||
e.Corpse.AddItem(new HeritageSovereign(5));;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
//=================================================
|
||||
//This script was created by Gizmo's Uo Quest Maker
|
||||
//This script was created on 1/6/2020 7:14:32 PM
|
||||
//=================================================
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class Alberto : MondainQuester
|
||||
{
|
||||
private List<SBInfo> m_SBInfos = new List<SBInfo>();
|
||||
protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
|
||||
public override bool DisallowAllMoves{ get{ return true; } }
|
||||
|
||||
public override Type[] Quests
|
||||
{
|
||||
get{ return new Type[]
|
||||
{
|
||||
typeof( Kill100Dragon )
|
||||
};}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Alberto() : base("Alberto", "The Dragon Slayer [?]")
|
||||
{
|
||||
new Horse().Rider = this;
|
||||
InitBody();
|
||||
}
|
||||
public Alberto(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 override void InitBody()
|
||||
{
|
||||
InitStats(100, 100, 100);
|
||||
Female = false;
|
||||
Race = Race.Human;
|
||||
base.InitBody();
|
||||
}
|
||||
public override void InitOutfit()
|
||||
{
|
||||
AddItem( new DragonChest() );
|
||||
AddItem( new DragonArms() );
|
||||
AddItem( new DragonGloves() );
|
||||
AddItem( new DragonLegs() );
|
||||
AddItem( new Cloak() );
|
||||
AddItem( new ThighBoots() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
//=================================================
|
||||
//This script was created by Gizmo's Uo Quest Maker
|
||||
//This script was created on 1/6/2020 7:12:32 PM
|
||||
//=================================================
|
||||
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class Kill100Dragon : BaseQuest
|
||||
{
|
||||
//The player will have a delay before they can redo quest again
|
||||
public override TimeSpan RestartDelay { get { return TimeSpan.FromMinutes(1440); } }
|
||||
|
||||
//This is the Quest Title the player sees at the top of the Gump
|
||||
public override object Title{ get{ return "Kill 100 Dragons Daily Quest"; } }
|
||||
//This tells the story of the quest
|
||||
public override object Description { get { return "Hail Adventurer!<BR>To combat the ever growing presence of this new evil that is beginning to plague our world. Lord Blackthorn has decreed that bounties shall be set on these foul beasts! You, in the funny hat! Do you have what it takes to become a hero!?<BR><BR>Kill 100 dragons and return to me for your reward!<BR>"; } }
|
||||
//This decides how the npc reacts in text the player refusing the quest
|
||||
public override object Refuse{ get{ return "Awe! scared of some little dragons? The off with you!"; } }
|
||||
//This is what the npc says when the player returns without completing the objective(s)
|
||||
public override object Uncomplete{ get{ return "You need to kill more dragons!"; } }
|
||||
//This is what the Quest Giver says when the player completes the quest.
|
||||
public override object Complete{ get{ return "Good Job Adventurer! Heres Your Reward!"; } }
|
||||
|
||||
public Kill100Dragon() : base()
|
||||
{
|
||||
//Slay Objective #1
|
||||
AddObjective(new SlayObjective(typeof(Dragon),"Dragon",100));
|
||||
|
||||
//AddReward( new BaseReward( typeof( GoldenQuestTicket ), 150, "Daily Golden Quest Ticket" ) );
|
||||
AddReward(new BaseReward(typeof(HeritageSovereign), 150, "Sovereigns"));
|
||||
}
|
||||
|
||||
public override void GiveRewards()
|
||||
{
|
||||
base.GiveRewards();
|
||||
}
|
||||
|
||||
public override bool CanOffer()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
//=================================================
|
||||
//This script was created by Gizmo's Uo Quest Maker
|
||||
//This script was created on 1/6/2020 7:14:32 PM
|
||||
//=================================================
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class Dax : MondainQuester
|
||||
{
|
||||
private List<SBInfo> m_SBInfos = new List<SBInfo>();
|
||||
protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
|
||||
public override bool DisallowAllMoves{ get{ return true; } }
|
||||
|
||||
public override Type[] Quests
|
||||
{
|
||||
get{ return new Type[]
|
||||
{
|
||||
typeof( Kill100Lich )
|
||||
};}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Dax() : base("Dax", "The Lich Slayer [?]")
|
||||
{
|
||||
new Horse().Rider = this;
|
||||
InitBody();
|
||||
}
|
||||
public Dax(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 override void InitBody()
|
||||
{
|
||||
InitStats(100, 100, 100);
|
||||
Female = false;
|
||||
Race = Race.Human;
|
||||
base.InitBody();
|
||||
}
|
||||
public override void InitOutfit()
|
||||
{
|
||||
AddItem( new DragonChest() );
|
||||
AddItem( new DragonArms() );
|
||||
AddItem( new DragonGloves() );
|
||||
AddItem( new DragonLegs() );
|
||||
AddItem( new Cloak() );
|
||||
AddItem( new ThighBoots() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
//=================================================
|
||||
//This script was created by Gizmo's Uo Quest Maker
|
||||
//This script was created on 1/6/2020 7:12:32 PM
|
||||
//=================================================
|
||||
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class Kill100Lich : BaseQuest
|
||||
{
|
||||
//The player will have a delay before they can redo quest again
|
||||
public override TimeSpan RestartDelay { get { return TimeSpan.FromMinutes(1440); } }
|
||||
|
||||
//This is the Quest Title the player sees at the top of the Gump
|
||||
public override object Title{ get{ return "Kill 100 Lich Daily Quest"; } }
|
||||
//This tells the story of the quest
|
||||
public override object Description { get { return "Hail Adventurer!<BR>To combat the ever growing presence of this new evil that is beginning to plague our world. Lord Blackthorn has decreed that bounties shall be set on these foul beasts! Hey! You!, with the ugly horse! Do you have what it takes to become a hero!?<BR><BR>Kill 100 Lich and return to me for your reward!<BR>"; } }
|
||||
//This decides how the npc reacts in text the player refusing the quest
|
||||
public override object Refuse{ get{ return "Awe! scared of a few lich? The off with you!"; } }
|
||||
//This is what the npc says when the player returns without completing the objective(s)
|
||||
public override object Uncomplete{ get{ return "You need to kill more Liches!"; } }
|
||||
//This is what the Quest Giver says when the player completes the quest.
|
||||
public override object Complete{ get{ return "Good Job Adventurer! Heres Your Reward!"; } }
|
||||
|
||||
public Kill100Lich() : base()
|
||||
{
|
||||
//Slay Objective #1
|
||||
AddObjective(new SlayObjective(typeof(Lich),"Lich",100));
|
||||
|
||||
//AddReward(new BaseReward(typeof(GoldenQuestTicket), 50, "Golden Quest Ticket"));
|
||||
AddReward(new BaseReward(typeof(HeritageSovereign), 100, "Sovereigns"));
|
||||
}
|
||||
|
||||
public override void GiveRewards()
|
||||
{
|
||||
base.GiveRewards();
|
||||
}
|
||||
|
||||
public override bool CanOffer()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
//=================================================
|
||||
//This script was created by Gizmo's Uo Quest Maker
|
||||
//This script was created on 1/6/2020 7:14:32 PM
|
||||
//=================================================
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class Garick : MondainQuester
|
||||
{
|
||||
private List<SBInfo> m_SBInfos = new List<SBInfo>();
|
||||
protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
|
||||
public override bool DisallowAllMoves{ get{ return true; } }
|
||||
|
||||
public override Type[] Quests
|
||||
{
|
||||
get{ return new Type[]
|
||||
{
|
||||
typeof( Kill100Ettin )
|
||||
};}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Garick() : base("Garick", "The Ettin Slayer [?]")
|
||||
{
|
||||
new Horse().Rider = this;
|
||||
InitBody();
|
||||
}
|
||||
public Garick(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 override void InitBody()
|
||||
{
|
||||
InitStats(100, 100, 100);
|
||||
Female = false;
|
||||
Race = Race.Human;
|
||||
base.InitBody();
|
||||
}
|
||||
public override void InitOutfit()
|
||||
{
|
||||
AddItem( new DragonChest() );
|
||||
AddItem( new DragonArms() );
|
||||
AddItem( new DragonGloves() );
|
||||
AddItem( new DragonLegs() );
|
||||
AddItem( new Cloak() );
|
||||
AddItem( new ThighBoots() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
//=================================================
|
||||
//This script was created by Gizmo's Uo Quest Maker
|
||||
//This script was created on 1/6/2020 7:12:32 PM
|
||||
//=================================================
|
||||
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class Kill100Ettin : BaseQuest
|
||||
{
|
||||
//The player will have a delay before they can redo quest again
|
||||
public override TimeSpan RestartDelay { get { return TimeSpan.FromMinutes(1440); } }
|
||||
|
||||
//This is the Quest Title the player sees at the top of the Gump
|
||||
public override object Title{ get{ return "Kill 100 Ettins Daily Quest"; } }
|
||||
//This tells the story of the quest
|
||||
public override object Description { get { return "Hail Adventurer!<BR>To combat the ever growing presence of this new evil that is beginning to plague our world. Lord Blackthorn has decreed that bounties shall be set on these foul beasts! You, in the smelly tunic! Do you have what it takes to become a hero!?<BR><BR>Kill 100 ettin and return to me for your reward!<BR>"; } }
|
||||
//This decides how the npc reacts in text the player refusing the quest
|
||||
public override object Refuse{ get{ return "Awe! scared of a few ettins? The off with you!"; } }
|
||||
//This is what the npc says when the player returns without completing the objective(s)
|
||||
public override object Uncomplete{ get{ return "You need to kill more ettin!"; } }
|
||||
//This is what the Quest Giver says when the player completes the quest.
|
||||
public override object Complete{ get{ return "Good Job Adventurer! Heres Your Reward!"; } }
|
||||
|
||||
public Kill100Ettin() : base()
|
||||
{
|
||||
//Slay Objective #1
|
||||
AddObjective(new SlayObjective(typeof(Ettin),"Ettin",100));
|
||||
|
||||
//AddReward( new BaseReward( typeof( GoldenQuestTicket ), 25, "Daily Golden Quest Ticket" ) );
|
||||
AddReward(new BaseReward(typeof(HeritageSovereign), 75, "Sovereigns"));
|
||||
}
|
||||
|
||||
public override void GiveRewards()
|
||||
{
|
||||
base.GiveRewards();
|
||||
}
|
||||
|
||||
public override bool CanOffer()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
[CorpseName("a Alpine Polar Bear corpse")]
|
||||
public class AlphaPolarBearz : Troglodyte
|
||||
{
|
||||
[Constructable]
|
||||
public AlphaPolarBearz()
|
||||
{
|
||||
Name = "Alpine Polar Bear";
|
||||
Hue = 1153;
|
||||
BodyValue = 213;
|
||||
|
||||
SetStr(584, 625);
|
||||
SetDex(163, 176);
|
||||
SetInt(90, 106);
|
||||
|
||||
SetHits(3034, 3189);
|
||||
SetStam(163, 176);
|
||||
SetMana(90, 106);
|
||||
|
||||
SetDamage(16, 19);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 100);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 50, 53);
|
||||
SetResistance(ResistanceType.Fire, 45, 47);
|
||||
SetResistance(ResistanceType.Cold, 80, 90);
|
||||
SetResistance(ResistanceType.Poison, 50, 60);
|
||||
SetResistance(ResistanceType.Energy, 41, 56);
|
||||
|
||||
SetSkill(SkillName.Wrestling, 122.7, 130.5);
|
||||
SetSkill(SkillName.Tactics, 109.3, 118.5);
|
||||
SetSkill(SkillName.MagicResist, 72.9, 87.6);
|
||||
SetSkill(SkillName.Anatomy, 110.5, 124.0);
|
||||
SetSkill(SkillName.Healing, 84.1, 105.0);
|
||||
|
||||
Fame = 10000;
|
||||
Karma = -10000;
|
||||
PackItem( new AlphaPolarFur() );
|
||||
|
||||
for (int i = 0; i < Utility.RandomMinMax(0, 1); i++)
|
||||
{
|
||||
PackItem(Loot.RandomScroll(0, Loot.ArcanistScrollTypes.Length, SpellbookType.Arcanist));
|
||||
}
|
||||
|
||||
SetWeaponAbility(WeaponAbility.CrushingBlow);
|
||||
}
|
||||
|
||||
public AlphaPolarBearz(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
public override bool CanBeParagon { get { return false; } }
|
||||
public override bool GivesMLMinorArtifact
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public override int TreasureMapLevel
|
||||
{
|
||||
get
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
public override bool AllureImmune
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot(LootPack.UltraRich, 2);
|
||||
}
|
||||
|
||||
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,47 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AlphaPolarFur : Item
|
||||
{
|
||||
[Constructable]
|
||||
public AlphaPolarFur() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AlphaPolarFur( int amount ) : base( 0x1875 )
|
||||
{
|
||||
Name = "Pristine Polar Bear Hide";
|
||||
Weight = 0.0;
|
||||
Hue = 1153;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile m )
|
||||
{
|
||||
m.SendMessage( "A Pristine Polar Bear Hide, Brijit Will Be Wanting These. You can find her at the Last Chance Inn, In the Town of Winterhome" );
|
||||
m.PlaySound( 367 );
|
||||
}
|
||||
|
||||
public AlphaPolarFur( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
//=================================================
|
||||
//This script was created by Gizmo's Uo Quest Maker
|
||||
//This script was created on 1/6/2020 7:14:32 PM
|
||||
//=================================================
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class Brijit : MondainQuester
|
||||
{
|
||||
private List<SBInfo> m_SBInfos = new List<SBInfo>();
|
||||
protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
|
||||
public override bool DisallowAllMoves{ get{ return true; } }
|
||||
|
||||
public override Type[] Quests
|
||||
{
|
||||
get{ return new Type[]
|
||||
{
|
||||
typeof( KillPolarBear )
|
||||
};}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Brijit() : base("Brijit", "The Tailor [?]")
|
||||
{
|
||||
new Horse().Rider = this;
|
||||
InitBody();
|
||||
}
|
||||
public Brijit(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 override void InitBody()
|
||||
{
|
||||
InitStats(100, 100, 100);
|
||||
Female = true;
|
||||
Race = Race.Human;
|
||||
base.InitBody();
|
||||
}
|
||||
public override void InitOutfit()
|
||||
{
|
||||
AddItem( new FancyShirt() );
|
||||
AddItem( new LeatherArms() );
|
||||
AddItem( new LeatherGloves() );
|
||||
AddItem( new Skirt() );
|
||||
AddItem( new Cloak() );
|
||||
AddItem( new ThighBoots() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
//=================================================
|
||||
//This script was created by Gizmo's Uo Quest Maker
|
||||
//This script was created on 1/6/2020 7:12:32 PM
|
||||
//=================================================
|
||||
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class KillPolarBear : BaseQuest
|
||||
{
|
||||
//The player will have a delay before they can redo quest again
|
||||
public override TimeSpan RestartDelay { get { return TimeSpan.FromMinutes(1440); } }
|
||||
|
||||
//This is the Quest Title the player sees at the top of the Gump
|
||||
public override object Title{ get{ return "Hunting The Alpine's"; } }
|
||||
//This tells the story of the quest
|
||||
public override object Description { get { return "Uhmm.. Hello! Excuse Me! But...<BR><BR> I have been tasked to crafting fur boots for my shop, and I like to use the pristine hides that you get from skinning Alpine Polar Bears! <BR><BR> My old supplier seems to have gone off on a new route! I have not seen him in months! Would you help me gather some?<BR><BR> Gather 50 Pristine Polar Bear Hide and Bring Them To Brijit!<BR><BR>(This is a repeatable quest, it can be done again 24 hours after completion.)"; } }
|
||||
//This decides how the npc reacts in text the player refusing the quest
|
||||
public override object Refuse{ get{ return "Very Well, I will be here if you change your mind"; } }
|
||||
//This is what the npc says when the player returns without completing the objective(s)
|
||||
public override object Uncomplete{ get{ return "You need to kill more alpha!"; } }
|
||||
//This is what the Quest Giver says when the player completes the quest.
|
||||
public override object Complete{ get{ return "Good Job Adventurer! Heres Your Reward!"; } }
|
||||
|
||||
public KillPolarBear() : base()
|
||||
{
|
||||
//Slay Objective #1
|
||||
AddObjective(new ObtainObjective(typeof(AlphaPolarFur), "Pristine Polar Bear Hide", 50, 0x1875));
|
||||
|
||||
//AddReward( new BaseReward(typeof(GoldenQuestTicket), 50, "Daily Golden Quest Tickets" ) );
|
||||
AddReward(new BaseReward(typeof(HeritageSovereign), 15, "Sovereigns"));
|
||||
}
|
||||
|
||||
public override void GiveRewards()
|
||||
{
|
||||
base.GiveRewards();
|
||||
}
|
||||
|
||||
public override bool CanOffer()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ChutiHead : Item
|
||||
{
|
||||
[Constructable]
|
||||
public ChutiHead() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ChutiHead( int amount ) : base( 0x1545 )
|
||||
{
|
||||
Name = "the head of the Chuti Yeti [Quest Relic 1 of 3]";
|
||||
//Stackable = false;
|
||||
//Amount = amount;
|
||||
Weight = 0;
|
||||
Hue = 1153;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile m )
|
||||
{
|
||||
m.SendMessage( "The head of the Chuti Yeti, Tom Biscardi at the Winterhome Inn will be very interested in this!" );
|
||||
m.PlaySound( 0x0A0 );
|
||||
}
|
||||
|
||||
public ChutiHead( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class NyalmoHead : Item
|
||||
{
|
||||
[Constructable]
|
||||
public NyalmoHead() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public NyalmoHead( int amount ) : base( 0x1545 )
|
||||
{
|
||||
Name = "the head of the Nyalmo Yeti [Quest Relic 2 of 3]";
|
||||
//Stackable = true;
|
||||
//Amount = amount;
|
||||
Weight = 0;
|
||||
Hue = 1175;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile m )
|
||||
{
|
||||
m.SendMessage( "The head of the Nyalmo Yeti, Tom Biscardi at the Winterhome Inn will be very interested in this!" );
|
||||
m.PlaySound( 0x0A0 );
|
||||
}
|
||||
|
||||
public NyalmoHead( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RangShimBomboHead : Item
|
||||
{
|
||||
[Constructable]
|
||||
public RangShimBomboHead() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RangShimBomboHead( int amount ) : base( 0x1545 )
|
||||
{
|
||||
Name = "the head of the Rang Shim Bombo Yeti [Quest Relic 3 of 3]";
|
||||
//Stackable = true;
|
||||
//Amount = amount;
|
||||
Weight = 0;
|
||||
Hue = 142;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile m )
|
||||
{
|
||||
m.SendMessage( "The head of the Rang Shim Bombo Yeti, Tom Biscardi at the Winterhome Inn will be very interested in this!" );
|
||||
m.PlaySound( 0x0A0 );
|
||||
}
|
||||
|
||||
public RangShimBomboHead( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
//=================================================
|
||||
//This script was created by Gizmo's Uo Quest Maker
|
||||
//This script was created on 1/6/2020 7:12:32 PM
|
||||
//=================================================
|
||||
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class KillYetiQuest : BaseQuest
|
||||
{
|
||||
//The player will have a delay before they can redo quest again
|
||||
public override TimeSpan RestartDelay { get { return TimeSpan.FromMinutes(1440); } }
|
||||
|
||||
//This is the Quest Title the player sees at the top of the Gump
|
||||
public override object Title{ get{ return "The Hunt For Bigfoot!"; } }
|
||||
//This tells the story of the quest
|
||||
public override object Description { get { return "(This is a repeatable quest, you can accept the quest again, 24 hours after completion!)<BR><BR> Pardon me friend..<BR><BR> My name is Tom, I am the head investigator from the Moonglow Cryptozoology Dept.<BR><BR> I have been hunting down the elusive Bigfoot! In my adventures I have found that there are many different species of Bigfoot! I am ivestigating the reports of the Northern Yeti!!<BR><BR> *Tom picks up a book and fumbles through the pages*<BR><BR> Ah yes, here it is, The Yeti or as some call it, the 'Abominable Snowman' is often described as being a large, bipedal ape-like creature that is covered with brown, grey, or white hair, and it is sometimes depicted as having large, sharp teeth & are found mostly in the Northern Regions Of Sosaria.<BR><BR> Lore describes three main varieties of Yetis. The Nyalmo, which has black fur and is the largest and fiercest, the Chuti Yeti that has a pure white fur, and the Rang Shim Bombo, which has reddish-brown fur.<BR><BR> If you are up for it, I will reward any adventurer who can bring me proof of these 3 variants! "; } }
|
||||
//This decides how the npc reacts in text the player refusing the quest
|
||||
public override object Refuse{ get{ return "Very well then, I will leave you be."; } }
|
||||
//This is what the npc says when the player returns without completing the objective(s)
|
||||
public override object Uncomplete{ get{ return "Keep searching friend, I will be here at the Inn if you find anything!"; } }
|
||||
//This is what the Quest Giver says when the player completes the quest.
|
||||
public override object Complete{ get{ return "Oh my! These are perfect! I cannot wait to show the other memebers at the Cryptozoology Dept! Here is your reward!"; } }
|
||||
|
||||
public KillYetiQuest() : base()
|
||||
{
|
||||
//Slay Objective #1
|
||||
AddObjective(new ObtainObjective(typeof(ChutiHead), "Chuti Yeti Head", 1, 0x1545));
|
||||
AddObjective(new ObtainObjective(typeof(NyalmoHead), "Nyalmo Yeti Head", 1, 0x1545));
|
||||
AddObjective(new ObtainObjective(typeof(RangShimBomboHead), "Rang Shim Bombo Yeti Head", 1, 0x1545));
|
||||
|
||||
|
||||
//AddReward(new BaseReward(typeof(GoldenQuestTicket), 100, "Golden Quest Ticket"));
|
||||
AddReward(new BaseReward(typeof(HeritageSovereign), 15, "Sovereigns"));
|
||||
}
|
||||
|
||||
public override void GiveRewards()
|
||||
{
|
||||
base.GiveRewards();
|
||||
}
|
||||
|
||||
public override bool CanOffer()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
//=================================================
|
||||
//This script was created by Gizmo's Uo Quest Maker
|
||||
//This script was created on 1/6/2020 7:14:32 PM
|
||||
//=================================================
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class TomBiscardi : MondainQuester
|
||||
{
|
||||
private List<SBInfo> m_SBInfos = new List<SBInfo>();
|
||||
protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
|
||||
public override bool DisallowAllMoves{ get{ return true; } }
|
||||
|
||||
public override Type[] Quests
|
||||
{
|
||||
get{ return new Type[]
|
||||
{
|
||||
typeof( KillYetiQuest )
|
||||
};}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public TomBiscardi() : base("Tom Biscardi", "Cryptozoologist [?]")
|
||||
{
|
||||
new Horse().Rider = this;
|
||||
InitBody();
|
||||
}
|
||||
public TomBiscardi(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 override void InitBody()
|
||||
{
|
||||
InitStats(100, 100, 100);
|
||||
Female = false;
|
||||
Race = Race.Human;
|
||||
base.InitBody();
|
||||
}
|
||||
public override void InitOutfit()
|
||||
{
|
||||
AddItem( new FancyShirt() );
|
||||
AddItem( new LeatherArms() );
|
||||
AddItem( new LeatherGloves() );
|
||||
AddItem( new LeatherLegs() );
|
||||
AddItem( new Cloak() );
|
||||
AddItem( new ThighBoots() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,244 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
[CorpseName("a Chuti Yeti corpse")]
|
||||
public class ChutiYeti : BaseCreature
|
||||
{
|
||||
public override bool CanStealth { get { return true; } }
|
||||
|
||||
private Timer m_SoundTimer;
|
||||
private bool m_HasTeleportedAway;
|
||||
[Constructable]
|
||||
public ChutiYeti()
|
||||
: base(AIType.AI_NecroMage, FightMode.Closest, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
Name = "Chuti Yeti";
|
||||
//Title = "the Shadow Knight";
|
||||
Body = 241;
|
||||
Hue = 1153;
|
||||
|
||||
SetStr(250);
|
||||
SetDex(100);
|
||||
SetInt(100, 120);
|
||||
|
||||
SetHits(3000);
|
||||
|
||||
SetDamage(15, 25);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 60);
|
||||
SetDamageType(ResistanceType.Cold, 40);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 90);
|
||||
SetResistance(ResistanceType.Fire, 65);
|
||||
SetResistance(ResistanceType.Cold, 75);
|
||||
SetResistance(ResistanceType.Poison, 75);
|
||||
SetResistance(ResistanceType.Energy, 55);
|
||||
|
||||
SetSkill(SkillName.Wrestling, 100.0);
|
||||
SetSkill(SkillName.Tactics, 100.0);
|
||||
SetSkill(SkillName.MagicResist, 120.0);
|
||||
SetSkill(SkillName.Poisoning, 75.0, 85.0);
|
||||
SetSkill(SkillName.DetectHidden, 100.0);
|
||||
SetSkill(SkillName.Hiding, 100.0);
|
||||
SetSkill(SkillName.Magery, 100.0);
|
||||
SetSkill(SkillName.EvalInt, 100.0);
|
||||
SetSkill(SkillName.Meditation, 100.0);
|
||||
SetSkill(SkillName.Necromancy, 110.0);
|
||||
SetSkill(SkillName.SpiritSpeak, 110.0);
|
||||
SetSkill(SkillName.Focus, 120.0);
|
||||
|
||||
Fame = 25000;
|
||||
Karma = -25000;
|
||||
|
||||
VirtualArmor = 54;
|
||||
|
||||
SetWeaponAbility(WeaponAbility.ConcussionBlow);
|
||||
SetWeaponAbility(WeaponAbility.CrushingBlow);
|
||||
|
||||
PackItem( new ChutiHead() );
|
||||
}
|
||||
|
||||
public ChutiYeti(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDamage(int amount, Mobile from, bool willKill)
|
||||
{
|
||||
RevealingAction();
|
||||
base.OnDamage(amount, from, willKill);
|
||||
}
|
||||
|
||||
public override void OnDamagedBySpell(Mobile from)
|
||||
{
|
||||
RevealingAction();
|
||||
base.OnDamagedBySpell(from);
|
||||
}
|
||||
|
||||
public override bool IgnoreYoungProtection
|
||||
{
|
||||
get
|
||||
{
|
||||
return Core.ML;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanFlee { get { return true; } }
|
||||
public override TribeType Tribe { get { return TribeType.Undead; } }
|
||||
|
||||
public override OppositionGroup OppositionGroup
|
||||
{
|
||||
get
|
||||
{
|
||||
return OppositionGroup.FeyAndUndead;
|
||||
}
|
||||
}
|
||||
public override bool BardImmune
|
||||
{
|
||||
get
|
||||
{
|
||||
return !Core.SE;
|
||||
}
|
||||
}
|
||||
public override bool Unprovokable
|
||||
{
|
||||
get
|
||||
{
|
||||
return Core.SE;
|
||||
}
|
||||
}
|
||||
public override bool AreaPeaceImmune
|
||||
{
|
||||
get
|
||||
{
|
||||
return Core.SE;
|
||||
}
|
||||
}
|
||||
public override Poison PoisonImmune
|
||||
{
|
||||
get
|
||||
{
|
||||
return Poison.Lethal;
|
||||
}
|
||||
}
|
||||
public override int TreasureMapLevel
|
||||
{
|
||||
get
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot(LootPack.UltraRich, 2);
|
||||
}
|
||||
|
||||
public override int GetIdleSound()
|
||||
{
|
||||
return 0x569;
|
||||
}
|
||||
|
||||
public override int GetDeathSound()
|
||||
{
|
||||
return 0xA2;
|
||||
}
|
||||
|
||||
public override int GetHurtSound()
|
||||
{
|
||||
return 0x158;
|
||||
}
|
||||
|
||||
public override int GetAttackSound()
|
||||
{
|
||||
return 0x25E;
|
||||
}
|
||||
|
||||
public override void OnCombatantChange()
|
||||
{
|
||||
base.OnCombatantChange();
|
||||
|
||||
if (Hidden && Combatant != null)
|
||||
Combatant = null;
|
||||
}
|
||||
|
||||
public virtual void SendTrackingSound()
|
||||
{
|
||||
if (Hidden)
|
||||
{
|
||||
Effects.PlaySound(Location, Map, 0x2C8);
|
||||
Combatant = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
Frozen = false;
|
||||
|
||||
if (m_SoundTimer != null)
|
||||
m_SoundTimer.Stop();
|
||||
|
||||
m_SoundTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnThink()
|
||||
{
|
||||
if (!m_HasTeleportedAway && Hits < (HitsMax / 2))
|
||||
{
|
||||
Map map = Map;
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
// try 10 times to find a teleport spot
|
||||
for (int i = 0; i < 10; ++i)
|
||||
{
|
||||
int x = X + (Utility.RandomMinMax(5, 10) * (Utility.RandomBool() ? 1 : -1));
|
||||
int y = Y + (Utility.RandomMinMax(5, 10) * (Utility.RandomBool() ? 1 : -1));
|
||||
int z = Z;
|
||||
|
||||
if (!map.CanFit(x, y, z, 16, false, false))
|
||||
continue;
|
||||
|
||||
Point3D from = Location;
|
||||
Point3D to = new Point3D(x, y, z);
|
||||
|
||||
if (!InLOS(to))
|
||||
continue;
|
||||
|
||||
Location = to;
|
||||
ProcessDelta();
|
||||
Hidden = true;
|
||||
Combatant = null;
|
||||
|
||||
Effects.SendLocationParticles(EffectItem.Create(from, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
|
||||
Effects.SendLocationParticles(EffectItem.Create(to, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);
|
||||
|
||||
Effects.PlaySound(to, map, 0x1FE);
|
||||
|
||||
m_HasTeleportedAway = true;
|
||||
m_SoundTimer = Timer.DelayCall(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(2.5), new TimerCallback(SendTrackingSound));
|
||||
|
||||
Frozen = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
base.OnThink();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,244 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
[CorpseName("a Nyalmo Yeti corpse")]
|
||||
public class NyalmoYeti : BaseCreature
|
||||
{
|
||||
public override bool CanStealth { get { return true; } }
|
||||
|
||||
private Timer m_SoundTimer;
|
||||
private bool m_HasTeleportedAway;
|
||||
[Constructable]
|
||||
public NyalmoYeti()
|
||||
: base(AIType.AI_NecroMage, FightMode.Closest, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
Name = "Nyalmo Yeti";
|
||||
//Title = "the Shadow Knight";
|
||||
Body = 241;
|
||||
Hue = 1175;
|
||||
|
||||
SetStr(250);
|
||||
SetDex(100);
|
||||
SetInt(100, 120);
|
||||
|
||||
SetHits(3000);
|
||||
|
||||
SetDamage(15, 25);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 60);
|
||||
SetDamageType(ResistanceType.Cold, 40);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 90);
|
||||
SetResistance(ResistanceType.Fire, 65);
|
||||
SetResistance(ResistanceType.Cold, 75);
|
||||
SetResistance(ResistanceType.Poison, 75);
|
||||
SetResistance(ResistanceType.Energy, 55);
|
||||
|
||||
SetSkill(SkillName.Wrestling, 100.0);
|
||||
SetSkill(SkillName.Tactics, 100.0);
|
||||
SetSkill(SkillName.MagicResist, 120.0);
|
||||
SetSkill(SkillName.Poisoning, 75.0, 85.0);
|
||||
SetSkill(SkillName.DetectHidden, 100.0);
|
||||
SetSkill(SkillName.Hiding, 100.0);
|
||||
SetSkill(SkillName.Magery, 100.0);
|
||||
SetSkill(SkillName.EvalInt, 100.0);
|
||||
SetSkill(SkillName.Meditation, 100.0);
|
||||
SetSkill(SkillName.Necromancy, 110.0);
|
||||
SetSkill(SkillName.SpiritSpeak, 110.0);
|
||||
SetSkill(SkillName.Focus, 120.0);
|
||||
|
||||
Fame = 25000;
|
||||
Karma = -25000;
|
||||
|
||||
VirtualArmor = 54;
|
||||
|
||||
SetWeaponAbility(WeaponAbility.ConcussionBlow);
|
||||
SetWeaponAbility(WeaponAbility.CrushingBlow);
|
||||
|
||||
PackItem( new NyalmoHead() );
|
||||
}
|
||||
|
||||
public NyalmoYeti(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDamage(int amount, Mobile from, bool willKill)
|
||||
{
|
||||
RevealingAction();
|
||||
base.OnDamage(amount, from, willKill);
|
||||
}
|
||||
|
||||
public override void OnDamagedBySpell(Mobile from)
|
||||
{
|
||||
RevealingAction();
|
||||
base.OnDamagedBySpell(from);
|
||||
}
|
||||
|
||||
public override bool IgnoreYoungProtection
|
||||
{
|
||||
get
|
||||
{
|
||||
return Core.ML;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanFlee { get { return true; } }
|
||||
public override TribeType Tribe { get { return TribeType.Undead; } }
|
||||
|
||||
public override OppositionGroup OppositionGroup
|
||||
{
|
||||
get
|
||||
{
|
||||
return OppositionGroup.FeyAndUndead;
|
||||
}
|
||||
}
|
||||
public override bool BardImmune
|
||||
{
|
||||
get
|
||||
{
|
||||
return !Core.SE;
|
||||
}
|
||||
}
|
||||
public override bool Unprovokable
|
||||
{
|
||||
get
|
||||
{
|
||||
return Core.SE;
|
||||
}
|
||||
}
|
||||
public override bool AreaPeaceImmune
|
||||
{
|
||||
get
|
||||
{
|
||||
return Core.SE;
|
||||
}
|
||||
}
|
||||
public override Poison PoisonImmune
|
||||
{
|
||||
get
|
||||
{
|
||||
return Poison.Lethal;
|
||||
}
|
||||
}
|
||||
public override int TreasureMapLevel
|
||||
{
|
||||
get
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot(LootPack.UltraRich, 2);
|
||||
}
|
||||
|
||||
public override int GetIdleSound()
|
||||
{
|
||||
return 0x569;
|
||||
}
|
||||
|
||||
public override int GetDeathSound()
|
||||
{
|
||||
return 0xA2;
|
||||
}
|
||||
|
||||
public override int GetHurtSound()
|
||||
{
|
||||
return 0x158;
|
||||
}
|
||||
|
||||
public override int GetAttackSound()
|
||||
{
|
||||
return 0x25E;
|
||||
}
|
||||
|
||||
public override void OnCombatantChange()
|
||||
{
|
||||
base.OnCombatantChange();
|
||||
|
||||
if (Hidden && Combatant != null)
|
||||
Combatant = null;
|
||||
}
|
||||
|
||||
public virtual void SendTrackingSound()
|
||||
{
|
||||
if (Hidden)
|
||||
{
|
||||
Effects.PlaySound(Location, Map, 0x2C8);
|
||||
Combatant = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
Frozen = false;
|
||||
|
||||
if (m_SoundTimer != null)
|
||||
m_SoundTimer.Stop();
|
||||
|
||||
m_SoundTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnThink()
|
||||
{
|
||||
if (!m_HasTeleportedAway && Hits < (HitsMax / 2))
|
||||
{
|
||||
Map map = Map;
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
// try 10 times to find a teleport spot
|
||||
for (int i = 0; i < 10; ++i)
|
||||
{
|
||||
int x = X + (Utility.RandomMinMax(5, 10) * (Utility.RandomBool() ? 1 : -1));
|
||||
int y = Y + (Utility.RandomMinMax(5, 10) * (Utility.RandomBool() ? 1 : -1));
|
||||
int z = Z;
|
||||
|
||||
if (!map.CanFit(x, y, z, 16, false, false))
|
||||
continue;
|
||||
|
||||
Point3D from = Location;
|
||||
Point3D to = new Point3D(x, y, z);
|
||||
|
||||
if (!InLOS(to))
|
||||
continue;
|
||||
|
||||
Location = to;
|
||||
ProcessDelta();
|
||||
Hidden = true;
|
||||
Combatant = null;
|
||||
|
||||
Effects.SendLocationParticles(EffectItem.Create(from, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
|
||||
Effects.SendLocationParticles(EffectItem.Create(to, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);
|
||||
|
||||
Effects.PlaySound(to, map, 0x1FE);
|
||||
|
||||
m_HasTeleportedAway = true;
|
||||
m_SoundTimer = Timer.DelayCall(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(2.5), new TimerCallback(SendTrackingSound));
|
||||
|
||||
Frozen = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
base.OnThink();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
+244
@@ -0,0 +1,244 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
[CorpseName("a Rang Shim Bombo Yeti corpse")]
|
||||
public class RangShimBomboYeti : BaseCreature
|
||||
{
|
||||
public override bool CanStealth { get { return true; } }
|
||||
|
||||
private Timer m_SoundTimer;
|
||||
private bool m_HasTeleportedAway;
|
||||
[Constructable]
|
||||
public RangShimBomboYeti()
|
||||
: base(AIType.AI_NecroMage, FightMode.Closest, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
Name = "Rang Shim Bombo Yeti";
|
||||
//Title = "the Shadow Knight";
|
||||
Body = 241;
|
||||
Hue = 142;
|
||||
|
||||
SetStr(250);
|
||||
SetDex(100);
|
||||
SetInt(100, 120);
|
||||
|
||||
SetHits(3000);
|
||||
|
||||
SetDamage(15, 25);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 60);
|
||||
SetDamageType(ResistanceType.Cold, 40);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 90);
|
||||
SetResistance(ResistanceType.Fire, 65);
|
||||
SetResistance(ResistanceType.Cold, 75);
|
||||
SetResistance(ResistanceType.Poison, 75);
|
||||
SetResistance(ResistanceType.Energy, 55);
|
||||
|
||||
SetSkill(SkillName.Wrestling, 100.0);
|
||||
SetSkill(SkillName.Tactics, 100.0);
|
||||
SetSkill(SkillName.MagicResist, 120.0);
|
||||
SetSkill(SkillName.Poisoning, 75.0, 85.0);
|
||||
SetSkill(SkillName.DetectHidden, 100.0);
|
||||
SetSkill(SkillName.Hiding, 100.0);
|
||||
SetSkill(SkillName.Magery, 100.0);
|
||||
SetSkill(SkillName.EvalInt, 100.0);
|
||||
SetSkill(SkillName.Meditation, 100.0);
|
||||
SetSkill(SkillName.Necromancy, 110.0);
|
||||
SetSkill(SkillName.SpiritSpeak, 110.0);
|
||||
SetSkill(SkillName.Focus, 120.0);
|
||||
|
||||
Fame = 25000;
|
||||
Karma = -25000;
|
||||
|
||||
VirtualArmor = 54;
|
||||
|
||||
SetWeaponAbility(WeaponAbility.ConcussionBlow);
|
||||
SetWeaponAbility(WeaponAbility.CrushingBlow);
|
||||
|
||||
PackItem( new RangShimBomboHead() );
|
||||
}
|
||||
|
||||
public RangShimBomboYeti(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDamage(int amount, Mobile from, bool willKill)
|
||||
{
|
||||
RevealingAction();
|
||||
base.OnDamage(amount, from, willKill);
|
||||
}
|
||||
|
||||
public override void OnDamagedBySpell(Mobile from)
|
||||
{
|
||||
RevealingAction();
|
||||
base.OnDamagedBySpell(from);
|
||||
}
|
||||
|
||||
public override bool IgnoreYoungProtection
|
||||
{
|
||||
get
|
||||
{
|
||||
return Core.ML;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanFlee { get { return true; } }
|
||||
public override TribeType Tribe { get { return TribeType.Undead; } }
|
||||
|
||||
public override OppositionGroup OppositionGroup
|
||||
{
|
||||
get
|
||||
{
|
||||
return OppositionGroup.FeyAndUndead;
|
||||
}
|
||||
}
|
||||
public override bool BardImmune
|
||||
{
|
||||
get
|
||||
{
|
||||
return !Core.SE;
|
||||
}
|
||||
}
|
||||
public override bool Unprovokable
|
||||
{
|
||||
get
|
||||
{
|
||||
return Core.SE;
|
||||
}
|
||||
}
|
||||
public override bool AreaPeaceImmune
|
||||
{
|
||||
get
|
||||
{
|
||||
return Core.SE;
|
||||
}
|
||||
}
|
||||
public override Poison PoisonImmune
|
||||
{
|
||||
get
|
||||
{
|
||||
return Poison.Lethal;
|
||||
}
|
||||
}
|
||||
public override int TreasureMapLevel
|
||||
{
|
||||
get
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot(LootPack.UltraRich, 2);
|
||||
}
|
||||
|
||||
public override int GetIdleSound()
|
||||
{
|
||||
return 0x569;
|
||||
}
|
||||
|
||||
public override int GetDeathSound()
|
||||
{
|
||||
return 0xA2;
|
||||
}
|
||||
|
||||
public override int GetHurtSound()
|
||||
{
|
||||
return 0x158;
|
||||
}
|
||||
|
||||
public override int GetAttackSound()
|
||||
{
|
||||
return 0x25E;
|
||||
}
|
||||
|
||||
public override void OnCombatantChange()
|
||||
{
|
||||
base.OnCombatantChange();
|
||||
|
||||
if (Hidden && Combatant != null)
|
||||
Combatant = null;
|
||||
}
|
||||
|
||||
public virtual void SendTrackingSound()
|
||||
{
|
||||
if (Hidden)
|
||||
{
|
||||
Effects.PlaySound(Location, Map, 0x2C8);
|
||||
Combatant = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
Frozen = false;
|
||||
|
||||
if (m_SoundTimer != null)
|
||||
m_SoundTimer.Stop();
|
||||
|
||||
m_SoundTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnThink()
|
||||
{
|
||||
if (!m_HasTeleportedAway && Hits < (HitsMax / 2))
|
||||
{
|
||||
Map map = Map;
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
// try 10 times to find a teleport spot
|
||||
for (int i = 0; i < 10; ++i)
|
||||
{
|
||||
int x = X + (Utility.RandomMinMax(5, 10) * (Utility.RandomBool() ? 1 : -1));
|
||||
int y = Y + (Utility.RandomMinMax(5, 10) * (Utility.RandomBool() ? 1 : -1));
|
||||
int z = Z;
|
||||
|
||||
if (!map.CanFit(x, y, z, 16, false, false))
|
||||
continue;
|
||||
|
||||
Point3D from = Location;
|
||||
Point3D to = new Point3D(x, y, z);
|
||||
|
||||
if (!InLOS(to))
|
||||
continue;
|
||||
|
||||
Location = to;
|
||||
ProcessDelta();
|
||||
Hidden = true;
|
||||
Combatant = null;
|
||||
|
||||
Effects.SendLocationParticles(EffectItem.Create(from, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
|
||||
Effects.SendLocationParticles(EffectItem.Create(to, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);
|
||||
|
||||
Effects.PlaySound(to, map, 0x1FE);
|
||||
|
||||
m_HasTeleportedAway = true;
|
||||
m_SoundTimer = Timer.DelayCall(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(2.5), new TimerCallback(SendTrackingSound));
|
||||
|
||||
Frozen = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
base.OnThink();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
//=================================================
|
||||
//This script was created by Gizmo's Uo Quest Maker
|
||||
//This script was created on 1/6/2020 7:12:32 PM
|
||||
//=================================================
|
||||
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class Kill100Succubus : BaseQuest
|
||||
{
|
||||
//The player will have a delay before they can redo quest again
|
||||
public override TimeSpan RestartDelay { get { return TimeSpan.FromMinutes(1440); } }
|
||||
|
||||
//This is the Quest Title the player sees at the top of the Gump
|
||||
public override object Title{ get{ return "Kill 100 Succubus Daily Quest"; } }
|
||||
//This tells the story of the quest
|
||||
public override object Description { get { return "Hail Adventurer!<BR>To combat the ever growing presence of this new evil that is beginning to plague our world. Lord Blackthorn has decreed that bounties shall be set on these foul beasts! You, in the smelly tunic! Do you have what it takes to become a hero!?<BR><BR>Kill 100 Succubus and return to me for your reward!<BR>"; } }
|
||||
//This decides how the npc reacts in text the player refusing the quest
|
||||
public override object Refuse{ get{ return "Awe! scared of a few Succubus? The off with you!"; } }
|
||||
//This is what the npc says when the player returns without completing the objective(s)
|
||||
public override object Uncomplete{ get{ return "You need to kill more Succubus!"; } }
|
||||
//This is what the Quest Giver says when the player completes the quest.
|
||||
public override object Complete{ get{ return "Good Job Adventurer! Heres Your Reward!"; } }
|
||||
|
||||
public Kill100Succubus() : base()
|
||||
{
|
||||
//Slay Objective #1
|
||||
AddObjective(new SlayObjective(typeof(Succubus),"Succubus",100));
|
||||
|
||||
//AddReward( new BaseReward( typeof( GoldenQuestTicket ), 50, "Daily Golden Quest Ticket" ) );
|
||||
AddReward(new BaseReward(typeof(HeritageSovereign), 275, "Sovereigns"));
|
||||
}
|
||||
|
||||
public override void GiveRewards()
|
||||
{
|
||||
base.GiveRewards();
|
||||
}
|
||||
|
||||
public override bool CanOffer()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
//=================================================
|
||||
//This script was created by Gizmo's Uo Quest Maker
|
||||
//This script was created on 1/6/2020 7:14:32 PM
|
||||
//=================================================
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class Obrian : MondainQuester
|
||||
{
|
||||
private List<SBInfo> m_SBInfos = new List<SBInfo>();
|
||||
protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
|
||||
public override bool DisallowAllMoves{ get{ return true; } }
|
||||
|
||||
public override Type[] Quests
|
||||
{
|
||||
get{ return new Type[]
|
||||
{
|
||||
typeof( Kill100Succubus )
|
||||
};}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Obrian() : base("Obrian", "The Succubus Slayer [?]")
|
||||
{
|
||||
new Horse().Rider = this;
|
||||
InitBody();
|
||||
}
|
||||
public Obrian(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 override void InitBody()
|
||||
{
|
||||
InitStats(100, 100, 100);
|
||||
Female = false;
|
||||
Race = Race.Human;
|
||||
base.InitBody();
|
||||
}
|
||||
public override void InitOutfit()
|
||||
{
|
||||
AddItem( new DragonChest() );
|
||||
AddItem( new DragonArms() );
|
||||
AddItem( new DragonGloves() );
|
||||
AddItem( new DragonLegs() );
|
||||
AddItem( new Cloak() );
|
||||
AddItem( new ThighBoots() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
//=================================================
|
||||
//This script was created by Gizmo's Uo Quest Maker
|
||||
//This script was created on 1/6/2020 7:12:32 PM
|
||||
//=================================================
|
||||
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class Kill100EElementals : BaseQuest
|
||||
{
|
||||
//The player will have a delay before they can redo quest again
|
||||
public override TimeSpan RestartDelay { get { return TimeSpan.FromMinutes(1440); } }
|
||||
|
||||
//This is the Quest Title the player sees at the top of the Gump
|
||||
public override object Title{ get{ return "Kill 100 Earth Elementals Daily Quest"; } }
|
||||
//This tells the story of the quest
|
||||
public override object Description { get { return "Hail Adventurer!<BR><BR>Kill 100 Earth Elementals and return to me for your reward!<BR>"; } }
|
||||
//This decides how the npc reacts in text the player refusing the quest
|
||||
public override object Refuse{ get{ return "Awe! scared of few Earth Elementals? Then off with you!"; } }
|
||||
//This is what the npc says when the player returns without completing the objective(s)
|
||||
public override object Uncomplete{ get{ return "You need to kill more elementals!"; } }
|
||||
//This is what the Quest Giver says when the player completes the quest.
|
||||
public override object Complete{ get{ return "Good Job Adventurer! Heres Your Reward!"; } }
|
||||
|
||||
public Kill100EElementals() : base()
|
||||
{
|
||||
//Slay Objective #1
|
||||
AddObjective(new SlayObjective(typeof(EarthElemental),"Earth Elemental",100));
|
||||
|
||||
//AddReward( new BaseReward( typeof( GoldenQuestTicket ), 25, "Daily Golden Quest Ticket" ) );
|
||||
AddReward(new BaseReward(typeof(HeritageSovereign), 100, "Sovereigns"));
|
||||
}
|
||||
|
||||
public override void GiveRewards()
|
||||
{
|
||||
base.GiveRewards();
|
||||
}
|
||||
|
||||
public override bool CanOffer()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
//=================================================
|
||||
//This script was created by Gizmo's Uo Quest Maker
|
||||
//This script was created on 1/6/2020 7:14:32 PM
|
||||
//=================================================
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class Omerc : MondainQuester
|
||||
{
|
||||
private List<SBInfo> m_SBInfos = new List<SBInfo>();
|
||||
protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
|
||||
public override bool DisallowAllMoves{ get{ return true; } }
|
||||
|
||||
public override Type[] Quests
|
||||
{
|
||||
get{ return new Type[]
|
||||
{
|
||||
typeof( Kill100EElementals )
|
||||
};}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Omerc() : base("Omerc", "The Elemental Slayer [?]")
|
||||
{
|
||||
new Horse().Rider = this;
|
||||
InitBody();
|
||||
}
|
||||
public Omerc(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 override void InitBody()
|
||||
{
|
||||
InitStats(100, 100, 100);
|
||||
Female = false;
|
||||
Race = Race.Human;
|
||||
base.InitBody();
|
||||
}
|
||||
public override void InitOutfit()
|
||||
{
|
||||
AddItem( new DragonChest() );
|
||||
AddItem( new DragonArms() );
|
||||
AddItem( new DragonGloves() );
|
||||
AddItem( new DragonLegs() );
|
||||
AddItem( new Cloak() );
|
||||
AddItem( new ThighBoots() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
//=================================================
|
||||
//This script was created by Gizmo's Uo Quest Maker
|
||||
//This script was created on 1/6/2020 7:12:32 PM
|
||||
//=================================================
|
||||
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class Kill100Daemon : BaseQuest
|
||||
{
|
||||
//The player will have a delay before they can redo quest again
|
||||
public override TimeSpan RestartDelay { get { return TimeSpan.FromMinutes(1440); } }
|
||||
|
||||
//This is the Quest Title the player sees at the top of the Gump
|
||||
public override object Title{ get{ return "Kill 100 Daemons Daily Quest"; } }
|
||||
//This tells the story of the quest
|
||||
public override object Description { get { return "Hail Adventurer!<BR>To combat the ever growing presence of this new evil that is beginning to plague our world. Lord Blackthorn has decreed that bounties shall be set on these foul beasts! Hey! You!, in the smelly tunic! Do you have what it takes to become a hero!?<BR><BR>Kill 100 daemon and return to me for your reward!<BR>"; } }
|
||||
//This decides how the npc reacts in text the player refusing the quest
|
||||
public override object Refuse{ get{ return "Awe! scared of a few daemons? The off with you!"; } }
|
||||
//This is what the npc says when the player returns without completing the objective(s)
|
||||
public override object Uncomplete{ get{ return "You need to kill more daemons!"; } }
|
||||
//This is what the Quest Giver says when the player completes the quest.
|
||||
public override object Complete{ get{ return "Good Job Adventurer! Heres Your Reward!"; } }
|
||||
|
||||
public Kill100Daemon() : base()
|
||||
{
|
||||
//Slay Objective #1
|
||||
AddObjective(new SlayObjective(typeof(Daemon),"Daemon",100));
|
||||
|
||||
//AddReward( new BaseReward( typeof( GoldenQuestTicket ), 50, "Daily Golden Quest Ticket" ) );
|
||||
AddReward(new BaseReward(typeof(HeritageSovereign), 125, "Sovereigns"));
|
||||
}
|
||||
|
||||
public override void GiveRewards()
|
||||
{
|
||||
base.GiveRewards();
|
||||
}
|
||||
|
||||
public override bool CanOffer()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
//=================================================
|
||||
//This script was created by Gizmo's Uo Quest Maker
|
||||
//This script was created on 1/6/2020 7:14:32 PM
|
||||
//=================================================
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
public class Sisco : MondainQuester
|
||||
{
|
||||
private List<SBInfo> m_SBInfos = new List<SBInfo>();
|
||||
protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
|
||||
public override bool DisallowAllMoves{ get{ return true; } }
|
||||
|
||||
public override Type[] Quests
|
||||
{
|
||||
get{ return new Type[]
|
||||
{
|
||||
typeof( Kill100Daemon )
|
||||
};}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Sisco() : base("Sisco", "The Daemon Slayer [?]")
|
||||
{
|
||||
new Horse().Rider = this;
|
||||
InitBody();
|
||||
}
|
||||
public Sisco(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 override void InitBody()
|
||||
{
|
||||
InitStats(100, 100, 100);
|
||||
Female = false;
|
||||
Race = Race.Human;
|
||||
base.InitBody();
|
||||
}
|
||||
public override void InitOutfit()
|
||||
{
|
||||
AddItem( new DragonChest() );
|
||||
AddItem( new DragonArms() );
|
||||
AddItem( new DragonGloves() );
|
||||
AddItem( new DragonLegs() );
|
||||
AddItem( new Cloak() );
|
||||
AddItem( new ThighBoots() );
|
||||
}
|
||||
}
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
|
||||
public class ArmsofApathy : PlateArms
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public ArmsofApathy() : base()
|
||||
{
|
||||
Name = "Arms of Apathy";
|
||||
|
||||
Weight = 5.0;
|
||||
|
||||
this.SetHue = 1109;
|
||||
this.Attributes.RegenHits = 1;
|
||||
this.Attributes.AttackChance = 5;
|
||||
|
||||
this.SetAttributes.ReflectPhysical = 25;
|
||||
this.SetAttributes.NightSight = 1;
|
||||
|
||||
this.SetSkillBonuses.SetValues(0, SkillName.Swords, 10);
|
||||
|
||||
this.SetSelfRepair = 3;
|
||||
|
||||
this.SetPhysicalBonus = 2;
|
||||
this.SetFireBonus = 5;
|
||||
this.SetColdBonus = 5;
|
||||
this.SetPoisonBonus = 3;
|
||||
this.SetEnergyBonus = 5;
|
||||
}
|
||||
|
||||
public ArmsofApathy( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override SetItem SetID
|
||||
{
|
||||
get
|
||||
{
|
||||
return SetItem.ForsakenVirtues;
|
||||
}
|
||||
}
|
||||
public override int Pieces
|
||||
{
|
||||
get
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
public override int BasePhysicalResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
}
|
||||
public override int BaseFireResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
public override int BaseColdResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
public override int BasePoisonResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
}
|
||||
public override int BaseEnergyResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
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,99 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0x1450, 0x1455)]
|
||||
public class GlovesofInjustice : PlateGloves
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
[Constructable]
|
||||
public GlovesofInjustice()
|
||||
: base()
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
this.Name = "Gloves of Injustice";
|
||||
this.SetHue = 1109;
|
||||
this.Attributes.RegenHits = 1;
|
||||
this.Attributes.AttackChance = 5;
|
||||
|
||||
this.SetAttributes.ReflectPhysical = 25;
|
||||
this.SetAttributes.NightSight = 1;
|
||||
|
||||
this.SetSkillBonuses.SetValues(0, SkillName.Swords, 10);
|
||||
|
||||
this.SetSelfRepair = 3;
|
||||
this.SetPhysicalBonus = 2;
|
||||
this.SetFireBonus = 5;
|
||||
this.SetColdBonus = 5;
|
||||
this.SetPoisonBonus = 3;
|
||||
this.SetEnergyBonus = 5;
|
||||
}
|
||||
|
||||
public GlovesofInjustice(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
public override SetItem SetID
|
||||
{
|
||||
get
|
||||
{
|
||||
return SetItem.ForsakenVirtues;
|
||||
}
|
||||
}
|
||||
public override int Pieces
|
||||
{
|
||||
get
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
public override int BasePhysicalResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
}
|
||||
public override int BaseFireResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
public override int BaseColdResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
public override int BasePoisonResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
}
|
||||
public override int BaseEnergyResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
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,99 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class HeartofObsidian : PlateChest
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
[Constructable]
|
||||
public HeartofObsidian()
|
||||
: base()
|
||||
{
|
||||
|
||||
this.Name = "Heart of Obsidian";
|
||||
this.SetHue = 1109;
|
||||
this.Attributes.RegenHits = 1;
|
||||
this.Attributes.AttackChance = 5;
|
||||
|
||||
this.SetAttributes.ReflectPhysical = 25;
|
||||
this.SetAttributes.NightSight = 1;
|
||||
|
||||
this.SetSkillBonuses.SetValues(0, SkillName.Swords, 10);
|
||||
|
||||
this.SetSelfRepair = 3;
|
||||
this.SetPhysicalBonus = 2;
|
||||
this.SetFireBonus = 5;
|
||||
this.SetColdBonus = 5;
|
||||
this.SetPoisonBonus = 3;
|
||||
this.SetEnergyBonus = 5;
|
||||
}
|
||||
|
||||
public HeartofObsidian(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override SetItem SetID
|
||||
{
|
||||
get
|
||||
{
|
||||
return SetItem.ForsakenVirtues;
|
||||
}
|
||||
}
|
||||
public override int Pieces
|
||||
{
|
||||
get
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
public override int BasePhysicalResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
}
|
||||
public override int BaseFireResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
public override int BaseColdResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
public override int BasePoisonResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
}
|
||||
public override int BaseEnergyResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class HelmofIgnorance : NorseHelm
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
[Constructable]
|
||||
public HelmofIgnorance()
|
||||
: base()
|
||||
{
|
||||
|
||||
|
||||
this.SetHue = 1109;
|
||||
this.Name = "Helm of Ignorance";
|
||||
this.Attributes.RegenHits = 1;
|
||||
this.Attributes.AttackChance = 5;
|
||||
|
||||
this.SetAttributes.ReflectPhysical = 25;
|
||||
this.SetAttributes.NightSight = 1;
|
||||
|
||||
this.SetSkillBonuses.SetValues(0, SkillName.Swords, 10);
|
||||
|
||||
this.SetSelfRepair = 3;
|
||||
|
||||
this.SetPhysicalBonus = 2;
|
||||
this.SetFireBonus = 5;
|
||||
this.SetColdBonus = 5;
|
||||
this.SetPoisonBonus = 3;
|
||||
this.SetEnergyBonus = 5;
|
||||
}
|
||||
|
||||
public HelmofIgnorance(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override SetItem SetID
|
||||
{
|
||||
get
|
||||
{
|
||||
return SetItem.ForsakenVirtues;
|
||||
}
|
||||
}
|
||||
public override int Pieces
|
||||
{
|
||||
get
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
public override int BasePhysicalResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
public override int BaseFireResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
}
|
||||
public override int BaseColdResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
public override int BasePoisonResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
public override int BaseEnergyResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LegsofSloth : PlateLegs
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
[Constructable]
|
||||
public LegsofSloth()
|
||||
: base()
|
||||
{
|
||||
|
||||
this.Name = "Legs of Sloth";
|
||||
this.SetHue = 1109;
|
||||
|
||||
this.Attributes.RegenHits = 1;
|
||||
this.Attributes.AttackChance = 5;
|
||||
|
||||
this.SetAttributes.ReflectPhysical = 25;
|
||||
this.SetAttributes.NightSight = 1;
|
||||
|
||||
this.SetSkillBonuses.SetValues(0, SkillName.Swords, 10);
|
||||
|
||||
this.SetSelfRepair = 3;
|
||||
|
||||
this.SetPhysicalBonus = 2;
|
||||
this.SetFireBonus = 5;
|
||||
this.SetColdBonus = 5;
|
||||
this.SetPoisonBonus = 3;
|
||||
this.SetEnergyBonus = 5;
|
||||
}
|
||||
|
||||
public LegsofSloth(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override SetItem SetID
|
||||
{
|
||||
get
|
||||
{
|
||||
return SetItem.ForsakenVirtues;
|
||||
}
|
||||
}
|
||||
public override int Pieces
|
||||
{
|
||||
get
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
public override int BasePhysicalResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
}
|
||||
public override int BaseFireResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
public override int BaseColdResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
public override int BasePoisonResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
}
|
||||
public override int BaseEnergyResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
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,98 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class UnbendingNeck : PlateGorget
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
[Constructable]
|
||||
public UnbendingNeck()
|
||||
: base()
|
||||
{
|
||||
this.SetHue = 1109;
|
||||
this.Name = "Unbending Neck";
|
||||
this.Attributes.RegenHits = 1;
|
||||
this.Attributes.AttackChance = 5;
|
||||
|
||||
this.SetAttributes.ReflectPhysical = 25;
|
||||
this.SetAttributes.NightSight = 1;
|
||||
|
||||
this.SetSkillBonuses.SetValues(0, SkillName.Swords, 10);
|
||||
|
||||
this.SetSelfRepair = 3;
|
||||
this.SetPhysicalBonus = 2;
|
||||
this.SetFireBonus = 5;
|
||||
this.SetColdBonus = 5;
|
||||
this.SetPoisonBonus = 3;
|
||||
this.SetEnergyBonus = 5;
|
||||
}
|
||||
|
||||
public UnbendingNeck(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override SetItem SetID
|
||||
{
|
||||
get
|
||||
{
|
||||
return SetItem.ForsakenVirtues;
|
||||
}
|
||||
}
|
||||
public override int Pieces
|
||||
{
|
||||
get
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
public override int BasePhysicalResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
}
|
||||
public override int BaseFireResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
public override int BaseColdResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
public override int BasePoisonResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
}
|
||||
public override int BaseEnergyResistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+83
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GMRobe : BaseSuit
|
||||
{
|
||||
|
||||
[Constructable]
|
||||
public GMRobe()
|
||||
: base(AccessLevel.Counselor, 0x0, 0x204F)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public GMRobe(int hue)
|
||||
: base(0x204F)
|
||||
{
|
||||
Weight = 0.0;
|
||||
}
|
||||
|
||||
public GMRobe(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.IsPlayer())
|
||||
{
|
||||
from.SendMessage("This item is to only be used by staff members.");
|
||||
this.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
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 bool OnEquip(Mobile from)
|
||||
{
|
||||
if ((this.ItemID == 0x204F) && (from.IsStaff()))
|
||||
this.ItemID = 0x204F;
|
||||
|
||||
switch (from.AccessLevel)
|
||||
{
|
||||
case AccessLevel.Owner:
|
||||
this.Name = "Owner's Robe";
|
||||
break;
|
||||
case AccessLevel.CoOwner:
|
||||
this.Name = "Co-Owner's Robe";
|
||||
break;
|
||||
case AccessLevel.Administrator:
|
||||
this.Name = "Administrator's Robe";
|
||||
break;
|
||||
case AccessLevel.Developer:
|
||||
this.Name = "Developer's Robe";
|
||||
break;
|
||||
case AccessLevel.Seer:
|
||||
this.Name = "Seer's Robe";;
|
||||
break;
|
||||
case AccessLevel.GameMaster:
|
||||
this.Name = "GameMaster's Robe";
|
||||
break;
|
||||
case AccessLevel.Counselor:
|
||||
this.Name = "Counselor's Robe";
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Executable
+433
@@ -0,0 +1,433 @@
|
||||
// ___|========================|___
|
||||
// \ | Written by Felladrin | / This script was released on RunUO Forums under the GPL licensing terms.
|
||||
// > | March 2010 | <
|
||||
// /__|========================|__\ [Gobal Donation Box] - Current version: 2.0.1 (December 04, 2010)
|
||||
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Commands;
|
||||
using Server.Targeting;
|
||||
using Server.Accounting;
|
||||
using System.Collections;
|
||||
|
||||
namespace Server.Commands
|
||||
{
|
||||
public class DonationSystem
|
||||
{
|
||||
//_________________________System Settings_____________________________//
|
||||
|
||||
public static bool OnlyYoungs = false; // Change this to true if you want only youngs to be able to open the box.
|
||||
|
||||
public static int DonationsLimit = 0; // Choose the maximum number of times each player can open the box. Leave it as 0 (zero) to make it unlimited.
|
||||
|
||||
public static bool CanBeGloballyAccessed = true; // Can players use commands to get items from the box wherever they are?
|
||||
|
||||
public static bool AutoOrganizerEnabled = true; // Should the items in the box be automatically organized in categories?
|
||||
|
||||
public static TimeSpan AutoOrganizerDelay = TimeSpan.FromMinutes( 5 ); // How often should the box be automatically organized?
|
||||
|
||||
//_____________________________________________________________________//
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register( "Donate", AccessLevel.Player, new CommandEventHandler( Donate_OnCommand ) );
|
||||
CommandSystem.Register( "Donations", CanBeGloballyAccessed == true ? AccessLevel.Player : AccessLevel.Administrator, new CommandEventHandler( Donations_OnCommand ) );
|
||||
|
||||
if ( AutoOrganizerEnabled )
|
||||
new AutoOrganizer().Start();
|
||||
}
|
||||
|
||||
[Usage( "Donate" )]
|
||||
[Description( "Used to donate items from your backpack. Also to move the backpacks inside the Donation Box." )]
|
||||
public static void Donate_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
if ( box == null )
|
||||
VerifyExistence();
|
||||
|
||||
e.Mobile.Target = new SelectItem();
|
||||
e.Mobile.SendMessage( Utility.RandomMinMax(2,600), "Select the items you want to donate." );
|
||||
e.Mobile.SendMessage( 67, "Press ESC when you finish." );
|
||||
}
|
||||
|
||||
[Usage( "Donations" )]
|
||||
[Description( "Opens the Donation Box, wherever you are, and allow you to get items via target." )]
|
||||
public static void Donations_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
PlayerMobile pm = e.Mobile as PlayerMobile;
|
||||
|
||||
if ( box == null )
|
||||
VerifyExistence();
|
||||
|
||||
if( pm.AccessLevel >= AccessLevel.Administrator )
|
||||
{
|
||||
box.MoveToWorld( pm.Location, pm.Map );
|
||||
box.Open( pm );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( VerifyLimitations ( pm ) )
|
||||
{
|
||||
box.MoveToWorld( pm.Location, pm.Map );
|
||||
box.Open( pm );
|
||||
pm.SendMessage( Utility.RandomMinMax(2,600), "Select the items you want to take from the box." );
|
||||
pm.SendMessage( 67, "Press ESC when you finish." );
|
||||
pm.Target = new TakeDonation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static DonationBox box;
|
||||
|
||||
public static void VerifyExistence()
|
||||
{
|
||||
bool exist = false;
|
||||
|
||||
foreach (Item item in World.Items.Values)
|
||||
{
|
||||
if ( item is DonationBox )
|
||||
{
|
||||
box = item as DonationBox;
|
||||
exist = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !exist )
|
||||
{
|
||||
if (CanBeGloballyAccessed)
|
||||
box = new DonationBox(true);
|
||||
else
|
||||
box = new DonationBox();
|
||||
}
|
||||
}
|
||||
|
||||
private class SelectItem : Target
|
||||
{
|
||||
public SelectItem() : base( -1, false, TargetFlags.None ) { }
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( targeted is Item )
|
||||
{
|
||||
Item item = targeted as Item;
|
||||
|
||||
if ( item is DonationBackpack )
|
||||
{
|
||||
box.DropItem( item );
|
||||
from.Target = new SelectItem();
|
||||
}
|
||||
else if ( from.AccessLevel >= AccessLevel.Administrator && item.Movable != false )
|
||||
{
|
||||
box.DropItem( item );
|
||||
from.Target = new SelectItem();
|
||||
}
|
||||
else if ( item.IsChildOf( from.Backpack ) && item.Movable != false )
|
||||
{
|
||||
box.DropItem( item );
|
||||
Emotionate ( from );
|
||||
from.Target = new SelectItem();
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( 67, "You can only donate items from your backpack." );
|
||||
from.Target = new SelectItem();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( 33, "You can only donate items!" );
|
||||
from.Target = new SelectItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Emotionate ( Mobile from )
|
||||
{
|
||||
from.SendMessage( Utility.RandomMinMax(2,600), "Thanks for your donation!" );
|
||||
from.PlaySound( from.Female ? 823 : 1097 ); from.PlaySound( 1051 );
|
||||
from.Emote( "*{0} donates an item*", from.Name );
|
||||
}
|
||||
|
||||
public static bool VerifyLimitations ( Mobile from )
|
||||
{
|
||||
PlayerMobile pm = from as PlayerMobile;
|
||||
|
||||
if( pm.AccessLevel == AccessLevel.Player )
|
||||
{
|
||||
if ( OnlyYoungs && !(pm.Young))
|
||||
{
|
||||
pm.SendMessage( 32, "Only the young players can get items from the donation box." );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( DonationsLimit != 0 )
|
||||
{
|
||||
int DontationsTaken;
|
||||
|
||||
try { DontationsTaken = int.Parse( ((Account)pm.Account).GetTag( "DonationBox" ) ); }
|
||||
catch { DontationsTaken = 1; }
|
||||
|
||||
if ( DontationsTaken > DonationsLimit )
|
||||
{
|
||||
pm.SendMessage( Utility.RandomMinMax(2,600), "You have already taken many items, please let the other new players enjoy it too." );
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( (DonationsLimit - DontationsTaken) > 0 )
|
||||
pm.SendMessage( Utility.RandomMinMax(2,600), "You can use the donation box {0} more time{1}.", (DonationsLimit - DontationsTaken), (DonationsLimit - DontationsTaken) == 1 ? "" : "s" );
|
||||
else
|
||||
pm.SendMessage( Utility.RandomMinMax(2,600), "After you close the donation box, you won't be able to use it anymore, so take a good look on the items, get those you think you'll need, and then start donating to help other players." );
|
||||
}
|
||||
|
||||
((Account)pm.Account).SetTag( "DonationBox", (DontationsTaken + 1).ToString() );
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private class TakeDonation : Target
|
||||
{
|
||||
public TakeDonation() : base( -1, false, TargetFlags.None ) { }
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( targeted is Item )
|
||||
{
|
||||
Item item = targeted as Item;
|
||||
|
||||
if ( item is DonationBackpack )
|
||||
{
|
||||
((DonationBackpack)item).Open( from );
|
||||
from.Target = new TakeDonation();
|
||||
}
|
||||
else if ( item.Parent is DonationBackpack || item.Parent is DonationBox )
|
||||
{
|
||||
from.AddToBackpack( item );
|
||||
from.Target = new TakeDonation();
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( 67, "You can only use this command to take items from the donation box." );
|
||||
from.Target = new TakeDonation();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( 33, "You can only use this command to take items from the donation box." );
|
||||
from.Target = new TakeDonation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class AutoOrganizer : Timer
|
||||
{
|
||||
public AutoOrganizer() : base( TimeSpan.Zero, AutoOrganizerDelay ) { }
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if ( box == null )
|
||||
VerifyExistence();
|
||||
|
||||
ArrayList itemlist = new ArrayList();
|
||||
|
||||
foreach ( Item item in box.Items )
|
||||
{
|
||||
if ( !(item is DonationBackpack) )
|
||||
itemlist.Add( item );
|
||||
else
|
||||
{
|
||||
foreach ( Item subitem in item.Items )
|
||||
{
|
||||
if ( subitem is Container )
|
||||
{
|
||||
foreach ( Item iteminside in ((Container)subitem).Items )
|
||||
itemlist.Add( iteminside );
|
||||
}
|
||||
else
|
||||
itemlist.Add( subitem );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Item item in itemlist)
|
||||
{
|
||||
bool exist = false;
|
||||
|
||||
string name;
|
||||
|
||||
if ( item is BaseWeapon || item is BaseRanged || item is BaseWand )
|
||||
name = "Weapons";
|
||||
else if ( item is BaseArmor || item is BaseLeather )
|
||||
name = "Armors";
|
||||
else if (item is BaseShield )
|
||||
name = "Shields";
|
||||
else if ( item is Gold || item is BankCheck)
|
||||
name = "Gold";
|
||||
else if ( item is BaseClothing || item is Cloth )
|
||||
name = "Clothes";
|
||||
else if ( item is BaseTool || item is Lockpick )
|
||||
name = "Tools";
|
||||
else if ( item is Food || item is BaseBeverage )
|
||||
name = "Food";
|
||||
else if (item is Bolt || item is Arrow )
|
||||
name = "Ammunition";
|
||||
else if (item is BaseReagent )
|
||||
name = "Reagents";
|
||||
else if (item is BaseJewel )
|
||||
name = "Jewels";
|
||||
else if (item is SpellScroll || item is Spellbook )
|
||||
name = "Spells";
|
||||
else if (item is BaseOre || item is BaseScales || item is BaseIngot )
|
||||
name = "Resources";
|
||||
else if (item is BaseAddonDeed )
|
||||
name = "Addons";
|
||||
else if (item is BaseBook )
|
||||
name = "Books";
|
||||
else if (item is BaseContainer )
|
||||
name = "Containers";
|
||||
else if (item is BasePotion || item is Bandage )
|
||||
name = "Potions";
|
||||
else
|
||||
name = "Miscellaneous";
|
||||
|
||||
ArrayList packlist = new ArrayList( box.FindItemsByType( typeof(DonationBackpack) ) );
|
||||
|
||||
foreach ( DonationBackpack backpack in packlist )
|
||||
{
|
||||
if ( backpack.Name == name )
|
||||
{
|
||||
backpack.DropItem( item );
|
||||
exist = true;
|
||||
}
|
||||
|
||||
if ( backpack.TotalItems == 0 )
|
||||
backpack.Delete();
|
||||
}
|
||||
|
||||
if ( !exist )
|
||||
{
|
||||
DonationBackpack newdb = new DonationBackpack();
|
||||
newdb.Name = name;
|
||||
newdb.DropItem( item );
|
||||
box.DropItem( newdb );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable( 0x2811, 0x2812 )]
|
||||
public class DonationBox : BaseContainer
|
||||
{
|
||||
public override int DefaultMaxWeight { get { return 0; } }
|
||||
public override int DefaultMaxItems { get { return 0; } }
|
||||
public override int DefaultGumpID { get { return 0x43; } }
|
||||
public override int DefaultDropSound { get { return 0x42; } }
|
||||
public override bool Decays { get { return false; } }
|
||||
|
||||
public DonationBox( bool global ) : base( 0x1011 )
|
||||
{
|
||||
Name = "The Donation Box";
|
||||
Movable = false;
|
||||
LiftOverride = true;
|
||||
Weight = 0;
|
||||
}
|
||||
|
||||
public DonationBox() : base( 0x2811 )
|
||||
{
|
||||
Name = "The Donation Box";
|
||||
Movable = false;
|
||||
LiftOverride = true;
|
||||
Weight = 0;
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
list.Add( Name );
|
||||
list.Add( "Donations: {0} Item{1}, {2} Stone{3}", TotalItems, TotalItems == 1 ? "" : "s", TotalWeight, TotalWeight == 1 ? "" : "s" );
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( DonationSystem.VerifyLimitations ( from ) )
|
||||
base.OnDoubleClick ( from );
|
||||
}
|
||||
|
||||
public override bool OnDragDrop( Mobile from, Item item )
|
||||
{
|
||||
DonationSystem.Emotionate ( from );
|
||||
return base.OnDragDrop( from, item );
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
DonationSystem.box = null;
|
||||
|
||||
foreach ( Mobile pm in World.Mobiles.Values )
|
||||
{
|
||||
if ( pm is PlayerMobile )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ((Account)pm.Account).GetTag( "DonationBox" ) != null )
|
||||
((Account)pm.Account).RemoveTag( "DonationBox" );
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public DonationBox( Serial serial ) : base( serial ) { }
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class DonationBackpack : Backpack
|
||||
{
|
||||
public override int DefaultMaxWeight { get { return 0; } }
|
||||
public override int DefaultMaxItems { get { return 0; } }
|
||||
public override bool Decays { get { return false; } }
|
||||
|
||||
public DonationBackpack()
|
||||
{
|
||||
Movable = false;
|
||||
LiftOverride = true;
|
||||
Weight = 0;
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
list.Add( Name );
|
||||
list.Add( "Contents: {0} Item{1}, {2} Stone{3}", TotalItems, TotalItems == 1 ? "" : "s", TotalWeight, TotalWeight == 1 ? "" : "s" );
|
||||
}
|
||||
|
||||
public DonationBackpack( Serial serial ) : base( serial ) { }
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+325
@@ -0,0 +1,325 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Custom
|
||||
{
|
||||
internal class GoldenShovel : Item
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.CreatureDeath += EventSink_CreatureDeath;
|
||||
}
|
||||
|
||||
private static void EventSink_CreatureDeath(CreatureDeathEventArgs e)
|
||||
{
|
||||
if (e.Creature is GoldenElemental && Utility.RandomDouble() < 0.01)
|
||||
{
|
||||
e.Corpse.AddItem(new GoldenShovel());
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Administrator)]
|
||||
public int Used { get; private set; }
|
||||
|
||||
private DateTime lastTarget = DateTime.MinValue;
|
||||
|
||||
private List<Snake> snakes;
|
||||
|
||||
private void InitSnakes()
|
||||
{
|
||||
snakes = new List<Snake>();
|
||||
}
|
||||
|
||||
private DirtPatch dirt;
|
||||
|
||||
[Constructable]
|
||||
public GoldenShovel() : base(0xF39)
|
||||
{
|
||||
Name = "Golden Shovel";
|
||||
|
||||
Hue = 2734;
|
||||
|
||||
Weight = 5.0;
|
||||
|
||||
Used = 1;
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
list.Add($"{Name}");
|
||||
|
||||
list.Add($"Chance {Used * 0.1}%");
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
LabelTo(from, $"{Name}");
|
||||
|
||||
LabelTo(from, $"Chance {Used * 0.1}%");
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.Alive)
|
||||
{
|
||||
from.SendMessage(43, "Must be alive!");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (RootParent != from)
|
||||
{
|
||||
from.SendMessage(43, "Must be in backpack!");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (from.Mounted)
|
||||
{
|
||||
from.SendMessage(43, "Must not be mounted!");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!from.HasFreeHand())
|
||||
{
|
||||
from.SendMessage(43, "Must have free hand!");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (from.Hidden)
|
||||
{
|
||||
from.SendMessage(43, "Must not be hidden!");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
double skillMod = Used * 0.1 / 2;
|
||||
|
||||
if (skillMod > 50)
|
||||
{
|
||||
skillMod = 50;
|
||||
}
|
||||
|
||||
if (from.Skills.Mining.Value < skillMod)
|
||||
{
|
||||
from.SendMessage(43, "Your mining skill is too low!");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (lastTarget < DateTime.Now - TimeSpan.FromSeconds(Utility.RandomMinMax(0, 1)))
|
||||
{
|
||||
from.Target = new ArtifactTarget(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage(33, $"{from.Name}, you are exhausted from digging!");
|
||||
}
|
||||
|
||||
CleanUpSnakes();
|
||||
}
|
||||
|
||||
private void CleanUpSnakes()
|
||||
{
|
||||
if (snakes != null && snakes.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < snakes.Count; i++)
|
||||
{
|
||||
if (snakes[i].Combatant == null)
|
||||
{
|
||||
snakes[i].Delete();
|
||||
}
|
||||
}
|
||||
|
||||
var tempList = snakes.Where(s => !s.Deleted)?.ToList();
|
||||
|
||||
snakes.Clear();
|
||||
|
||||
if (tempList != null && tempList.Count > 0)
|
||||
{
|
||||
snakes.AddRange(tempList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Item RandomGoldenStatue()
|
||||
{
|
||||
MonsterStatuette statue = new MonsterStatuette((MonsterStatuetteType)Utility.Random(Enum.GetValues(typeof(MonsterStatuetteType)).Length - 1));
|
||||
|
||||
statue.Name = $"Golden {statue.Name}";
|
||||
|
||||
statue.Hue = 2734;
|
||||
|
||||
return statue;
|
||||
}
|
||||
|
||||
public GoldenShovel(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(Used);
|
||||
|
||||
CleanUpSnakes();
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
Used = reader.ReadInt();
|
||||
}
|
||||
|
||||
private class ArtifactTarget : Target
|
||||
{
|
||||
private readonly GoldenShovel _Shovel;
|
||||
|
||||
public ArtifactTarget(GoldenShovel sovel) : base (3, true, TargetFlags.None)
|
||||
{
|
||||
_Shovel = sovel;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (from.Alive && !from.Mounted && targeted is LandTarget lt)
|
||||
{
|
||||
if (from.Body.IsHuman)
|
||||
{
|
||||
from.Direction = from.GetDirectionTo(lt.Location);
|
||||
|
||||
if (Core.SA)
|
||||
{
|
||||
from.Animate(AnimationType.Attack, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.Animate(11, 5, 1, true, false, 0);
|
||||
}
|
||||
|
||||
from.PlaySound(Utility.RandomList(0x125, 0x126));
|
||||
|
||||
if (_Shovel.dirt == null || _Shovel.dirt.Deleted)
|
||||
{
|
||||
_Shovel.dirt = new DirtPatch();
|
||||
|
||||
_Shovel.dirt.MoveToWorld(lt.Location, from.Map);
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1), () =>
|
||||
{
|
||||
_Shovel.dirt.Delete();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
double chance = _Shovel.Used * 0.001 + 0.01;
|
||||
|
||||
if (chance > 1.0)
|
||||
{
|
||||
chance = 0.999;
|
||||
}
|
||||
|
||||
if (Utility.RandomDouble() < chance)
|
||||
{
|
||||
_Shovel.Used++;
|
||||
|
||||
_Shovel.lastTarget = DateTime.Now;
|
||||
|
||||
int reward = _Shovel.Used > 100 ? Utility.RandomMinMax(1, 100) : Utility.RandomMinMax(1, _Shovel.Used);
|
||||
|
||||
if (reward == 100 && Utility.RandomDouble() < 0.01)
|
||||
{
|
||||
from.SendMessage(63, $"{from.Name}, you found a golden statue!");
|
||||
|
||||
from.AddToBackpack(_Shovel.RandomGoldenStatue());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_Shovel.Used > 199)
|
||||
{
|
||||
if (_Shovel.Used < 1000)
|
||||
{
|
||||
reward *= (int)(chance / 0.1);
|
||||
}
|
||||
else
|
||||
{
|
||||
reward *= 10;
|
||||
}
|
||||
}
|
||||
|
||||
from.SendMessage(63, $"{from.Name}, you found {reward} gold coins!");
|
||||
|
||||
from.AddToBackpack(new Gold(reward));
|
||||
}
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromMilliseconds(250), () =>
|
||||
{
|
||||
from.PlaySound(Utility.RandomList(0x5A6, 0x5A7));
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.3)
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.FromMilliseconds(250), () =>
|
||||
{
|
||||
if (from.Female)
|
||||
{
|
||||
from.PlaySound(Utility.RandomList(0x324, 0x325, 0x326, 0x327, 0x328, 0x329, 0x32A));
|
||||
}
|
||||
else
|
||||
{
|
||||
from.PlaySound(Utility.RandomList(0x434, 0x435, 0x436, 0x437, 0x438, 0x439, 0x43A, 0x43B, 0x43C));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (Utility.RandomDouble() < chance)
|
||||
{
|
||||
int num = Utility.RandomMinMax(2, 5 + (int)(chance / 0.1));
|
||||
|
||||
if (_Shovel.snakes == null)
|
||||
{
|
||||
_Shovel.InitSnakes();
|
||||
}
|
||||
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
Snake snake = new Snake()
|
||||
{
|
||||
Name = "Golden Snake",
|
||||
|
||||
IsParagon = true,
|
||||
|
||||
Combatant = from
|
||||
};
|
||||
|
||||
snake.MoveToWorld(lt.Location, from.Map);
|
||||
|
||||
_Shovel.snakes.Add(snake);
|
||||
}
|
||||
|
||||
from.SendMessage(53, $"{from.Name}, you found a nest of golden snakes!");
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage(53, $"{from.Name}, you found nothng!");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage(53, $"{from.Name}, you can only target the ground!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+524
@@ -0,0 +1,524 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
[CorpseName("the Greatest Mongbat corpse")]
|
||||
public sealed class GreatestMongbat : Mongbat
|
||||
{
|
||||
public static GreatestMongbat Mongbat { get; private set; }
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.ServerStarted += HandleServerStarted;
|
||||
EventSink.CreatureDeath += HandleCreatureDeath;
|
||||
}
|
||||
|
||||
private static void HandleServerStarted()
|
||||
{
|
||||
if (Mongbat?.Deleted != false)
|
||||
{
|
||||
SpawnMongbat();
|
||||
}
|
||||
}
|
||||
|
||||
private static void HandleCreatureDeath(CreatureDeathEventArgs e)
|
||||
{
|
||||
if (e.Creature == Mongbat)
|
||||
{
|
||||
|
||||
Mongbat = null;
|
||||
|
||||
SpawnMongbat();
|
||||
}
|
||||
}
|
||||
|
||||
private static void SpawnMongbat()
|
||||
{
|
||||
if (GetSpawnLoc(out var loc, out var map))
|
||||
{
|
||||
Mongbat?.Delete();
|
||||
|
||||
Mongbat = new GreatestMongbat();
|
||||
|
||||
Mongbat.MoveToWorld(loc, map);
|
||||
}
|
||||
}
|
||||
|
||||
private static bool GetSpawnLoc(out Point3D loc, out Map map)
|
||||
{
|
||||
loc = Point3D.Zero;
|
||||
map = Utility.RandomList(Map.Felucca, Map.Trammel, Map.Ilshenar, Map.Malas, Map.Tokuno, Map.TerMur);
|
||||
|
||||
if (map == null || map == Map.Internal)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Rectangle2D bounds;
|
||||
|
||||
if (map.MapID == 0 || map.MapID == 1)
|
||||
{
|
||||
bounds = new Rectangle2D(16, 16, 5120 - 32, 4096 - 32);
|
||||
}
|
||||
else if (map.MapID == 2)
|
||||
{
|
||||
bounds = new Rectangle2D(16, 16, 2304 - 32, 1600 - 32);
|
||||
}
|
||||
else if (map.MapID == 4)
|
||||
{
|
||||
bounds = new Rectangle2D(16, 16, 1448 - 32, 1448 - 32);
|
||||
}
|
||||
else
|
||||
{
|
||||
bounds = new Rectangle2D(0, 0, map.Width, map.Height);
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
loc = map.GetRandomSpawnPoint(bounds);
|
||||
}
|
||||
while (Mobiles.Spawner.IsValidWater(map, loc.X, loc.Y, loc.Z) || !map.CanSpawnMobile(loc));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private DateTime m_Delay;
|
||||
|
||||
[Constructable]
|
||||
public GreatestMongbat()
|
||||
|
||||
{
|
||||
AI = AIType.AI_Mage;
|
||||
FightMode = FightMode.Closest;
|
||||
|
||||
Name = "The Greatest Mongbat";
|
||||
Body = 39;
|
||||
BaseSoundID = 422;
|
||||
|
||||
VirtualArmor = 15;
|
||||
|
||||
ForceActiveSpeed = 0.2;
|
||||
ForcePassiveSpeed = 0.4;
|
||||
|
||||
SetStr(702);
|
||||
SetDex(250);
|
||||
SetInt(180);
|
||||
|
||||
SetHits(30000);
|
||||
SetStam(431);
|
||||
SetMana(180);
|
||||
|
||||
SetDamage(33, 55);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 25);
|
||||
SetDamageType(ResistanceType.Fire, 50);
|
||||
SetDamageType(ResistanceType.Energy, 25);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 80, 90);
|
||||
SetResistance(ResistanceType.Fire, 80, 90);
|
||||
SetResistance(ResistanceType.Cold, 60, 70);
|
||||
SetResistance(ResistanceType.Poison, 80, 90);
|
||||
SetResistance(ResistanceType.Energy, 80, 90);
|
||||
|
||||
SetSkill(SkillName.Anatomy, 100.0);
|
||||
SetSkill(SkillName.MagicResist, 150.0, 155.0);
|
||||
SetSkill(SkillName.Tactics, 120.7, 125.0);
|
||||
SetSkill(SkillName.Wrestling, 115.0, 117.7);
|
||||
|
||||
Fame = 15000;
|
||||
Karma = -15000;
|
||||
|
||||
VirtualArmor = 60;
|
||||
|
||||
Tamable = false;
|
||||
|
||||
SetWeaponAbility(WeaponAbility.Bladeweave);
|
||||
SetWeaponAbility(WeaponAbility.TalonStrike);
|
||||
SetSpecialAbility(SpecialAbility.DragonBreath);
|
||||
}
|
||||
|
||||
public GreatestMongbat(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool AlwaysMurderer { get { return true; } }
|
||||
public override bool Unprovokable { get { return false; } }
|
||||
public override bool BardImmune { get { return false; } }
|
||||
public override bool AutoDispel { get { return !Controlled; } }
|
||||
public override int Meat { get { return 19; } }
|
||||
public override int Hides { get { return 30; } }
|
||||
public override HideType HideType { get { return HideType.Barbed; } }
|
||||
public override int Scales { get { return 7; } }
|
||||
public override ScaleType ScaleType { get { return (Body == 12 ? ScaleType.Yellow : ScaleType.Red); } }
|
||||
public override int DragonBlood { get { return 48; } }
|
||||
public override bool CanFlee { get { return false; } }
|
||||
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot(LootPack.AosSuperBoss, 8);
|
||||
AddLoot(LootPack.Gems, 8);
|
||||
}
|
||||
|
||||
public override void OnThink()
|
||||
{
|
||||
base.OnThink();
|
||||
|
||||
if (Combatant == null || !(Combatant is Mobile))
|
||||
return;
|
||||
|
||||
if (DateTime.UtcNow > m_Delay)
|
||||
{
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 0: CrimsonMeteor(this, (Mobile)Combatant, 70, 125); break;
|
||||
case 1: DoStygianFireball(); break;
|
||||
case 2: DoFireColumn(); break;
|
||||
}
|
||||
|
||||
m_Delay = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(30, 60));
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDeath(Container c)
|
||||
{
|
||||
base.OnDeath(c);
|
||||
|
||||
|
||||
if ( Paragon.ChestChance > Utility.RandomDouble() )
|
||||
c.DropItem( new ParagonChest( Name, 5 ) );
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
#region Crimson Meteor
|
||||
public static void CrimsonMeteor(Mobile owner, Mobile combatant, int minDamage, int maxDamage)
|
||||
{
|
||||
if (!combatant.Alive || combatant.Map == null || combatant.Map == Map.Internal)
|
||||
return;
|
||||
|
||||
new CrimsonMeteorTimer(owner, combatant.Location, minDamage, maxDamage).Start();
|
||||
}
|
||||
|
||||
public class CrimsonMeteorTimer : Timer
|
||||
{
|
||||
private Mobile m_From;
|
||||
private Map m_Map;
|
||||
private int m_Count;
|
||||
private int m_MaxCount;
|
||||
private bool m_DoneDamage;
|
||||
private Point3D m_LastTarget;
|
||||
private Rectangle2D m_ShowerArea;
|
||||
private List<Mobile> m_ToDamage;
|
||||
|
||||
private int m_MinDamage, m_MaxDamage;
|
||||
|
||||
public CrimsonMeteorTimer(Mobile from, Point3D loc, int min, int max)
|
||||
: base(TimeSpan.FromMilliseconds(250.0), TimeSpan.FromMilliseconds(250.0))
|
||||
{
|
||||
m_From = from;
|
||||
m_Map = from.Map;
|
||||
m_Count = 0;
|
||||
m_MaxCount = 25; // in ticks
|
||||
m_LastTarget = loc;
|
||||
m_DoneDamage = false;
|
||||
m_ShowerArea = new Rectangle2D(loc.X - 2, loc.Y - 2, 4, 4);
|
||||
|
||||
m_MinDamage = min;
|
||||
m_MaxDamage = max;
|
||||
|
||||
m_ToDamage = new List<Mobile>();
|
||||
|
||||
IPooledEnumerable eable = m_Map.GetMobilesInBounds(m_ShowerArea);
|
||||
|
||||
foreach (Mobile m in eable)
|
||||
{
|
||||
if (m != from && m_From.CanBeHarmful(m))
|
||||
m_ToDamage.Add(m);
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (m_From == null || m_From.Deleted || m_Map == null || m_Map == Map.Internal)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (0.33 > Utility.RandomDouble())
|
||||
{
|
||||
var field = new FireField(m_From, 25, Utility.RandomBool());
|
||||
field.MoveToWorld(m_LastTarget, m_Map);
|
||||
}
|
||||
|
||||
Point3D start = new Point3D();
|
||||
Point3D finish = new Point3D();
|
||||
|
||||
finish.X = m_ShowerArea.X + Utility.Random(m_ShowerArea.Width);
|
||||
finish.Y = m_ShowerArea.Y + Utility.Random(m_ShowerArea.Height);
|
||||
finish.Z = m_From.Z;
|
||||
|
||||
SpellHelper.AdjustField(ref finish, m_Map, 16, false);
|
||||
|
||||
//objects move from upper right/right to left as per OSI
|
||||
start.X = finish.X + Utility.RandomMinMax(-4, 4);
|
||||
start.Y = finish.Y - 15;
|
||||
start.Z = finish.Z + 50;
|
||||
|
||||
Effects.SendMovingParticles(
|
||||
new Entity(Serial.Zero, start, m_Map),
|
||||
new Entity(Serial.Zero, finish, m_Map),
|
||||
0x36D4, 15, 0, false, false, 0, 0, 9502, 1, 0, (EffectLayer)255, 0x100);
|
||||
|
||||
Effects.PlaySound(finish, m_Map, 0x11D);
|
||||
|
||||
m_LastTarget = finish;
|
||||
m_Count++;
|
||||
|
||||
if (m_Count >= m_MaxCount / 2 && !m_DoneDamage)
|
||||
{
|
||||
if (m_ToDamage != null && m_ToDamage.Count > 0)
|
||||
{
|
||||
int damage;
|
||||
|
||||
foreach (Mobile mob in m_ToDamage)
|
||||
{
|
||||
damage = Utility.RandomMinMax(m_MinDamage, m_MaxDamage);
|
||||
|
||||
m_From.DoHarmful(mob);
|
||||
AOS.Damage(mob, m_From, damage, 0, 100, 0, 0, 0);
|
||||
|
||||
mob.FixedParticles(0x36BD, 1, 15, 9502, 0, 3, (EffectLayer)255);
|
||||
}
|
||||
}
|
||||
|
||||
m_DoneDamage = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_Count >= m_MaxCount)
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Fire Column
|
||||
public void DoFireColumn()
|
||||
{
|
||||
var map = Map;
|
||||
|
||||
if (map == null)
|
||||
return;
|
||||
|
||||
Direction columnDir = Utility.GetDirection(this, Combatant);
|
||||
|
||||
Packet flash = ScreenLightFlash.Instance;
|
||||
IPooledEnumerable e = Map.GetClientsInRange(Location, Core.GlobalUpdateRange);
|
||||
|
||||
foreach (NetState ns in e)
|
||||
{
|
||||
if (ns.Mobile != null)
|
||||
ns.Mobile.Send(flash);
|
||||
}
|
||||
|
||||
e.Free();
|
||||
|
||||
int x = X;
|
||||
int y = Y;
|
||||
bool south = columnDir == Direction.East || columnDir == Direction.West;
|
||||
|
||||
Movement.Movement.Offset(columnDir, ref x, ref y);
|
||||
Point3D p = new Point3D(x, y, Z);
|
||||
SpellHelper.AdjustField(ref p, map, 16, false);
|
||||
|
||||
var fire = new FireField(this, Utility.RandomMinMax(25, 32), south);
|
||||
fire.MoveToWorld(p, map);
|
||||
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
Movement.Movement.Offset(columnDir, ref x, ref y);
|
||||
|
||||
p = new Point3D(x, y, Z);
|
||||
SpellHelper.AdjustField(ref p, map, 16, false);
|
||||
|
||||
fire = new FireField(this, Utility.RandomMinMax(25, 32), south);
|
||||
fire.MoveToWorld(p, map);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Fire Field
|
||||
public class FireField : Item
|
||||
{
|
||||
private Mobile m_Owner;
|
||||
private Timer m_Timer;
|
||||
private DateTime m_Destroy;
|
||||
|
||||
[Constructable]
|
||||
public FireField(Mobile owner, int duration, bool south)
|
||||
: base(GetItemID(south))
|
||||
{
|
||||
Movable = false;
|
||||
m_Destroy = DateTime.UtcNow + TimeSpan.FromSeconds(duration);
|
||||
|
||||
m_Owner = owner;
|
||||
m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), new TimerCallback(OnTick));
|
||||
}
|
||||
|
||||
private static int GetItemID(bool south)
|
||||
{
|
||||
if (south)
|
||||
return 0x398C;
|
||||
else
|
||||
return 0x3996;
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if (m_Timer != null)
|
||||
m_Timer.Stop();
|
||||
}
|
||||
|
||||
private void OnTick()
|
||||
{
|
||||
if (DateTime.UtcNow > m_Destroy)
|
||||
{
|
||||
Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
IPooledEnumerable eable = GetMobilesInRange(0);
|
||||
List<Mobile> list = new List<Mobile>();
|
||||
|
||||
foreach (Mobile m in eable)
|
||||
{
|
||||
if (m == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_Owner == null || CanTargetMob(m))
|
||||
{
|
||||
list.Add(m);
|
||||
}
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
|
||||
foreach (var mob in list)
|
||||
{
|
||||
DealDamage(mob);
|
||||
}
|
||||
|
||||
ColUtility.Free(list);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
DealDamage(m);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void DealDamage(Mobile m)
|
||||
{
|
||||
if (m != m_Owner && (m_Owner == null || CanTargetMob(m)))
|
||||
AOS.Damage(m, m_Owner, Utility.RandomMinMax(2, 4), 0, 100, 0, 0, 0);
|
||||
}
|
||||
|
||||
public bool CanTargetMob(Mobile m)
|
||||
{
|
||||
return m != m_Owner && m_Owner.CanBeHarmful(m, false) && (m is PlayerMobile || (m is BaseCreature && ((BaseCreature)m).GetMaster() is PlayerMobile));
|
||||
}
|
||||
|
||||
public FireField(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
// Unsaved.
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Stygian Fireball
|
||||
public void DoStygianFireball()
|
||||
{
|
||||
if (!(Combatant is Mobile) || !InRange(Combatant.Location, 10))
|
||||
return;
|
||||
|
||||
new StygianFireballTimer(this, (Mobile)Combatant);
|
||||
PlaySound(0x1F3);
|
||||
}
|
||||
|
||||
private class StygianFireballTimer : Timer
|
||||
{
|
||||
private GreatestMongbat m_Dragon;
|
||||
private Mobile m_Combatant;
|
||||
private int m_Ticks;
|
||||
|
||||
public StygianFireballTimer(GreatestMongbat dragon, Mobile combatant)
|
||||
: base(TimeSpan.FromMilliseconds(200), TimeSpan.FromMilliseconds(200))
|
||||
{
|
||||
m_Dragon = dragon;
|
||||
m_Combatant = combatant;
|
||||
m_Ticks = 0;
|
||||
Start();
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Dragon.MovingParticles(m_Combatant, 0x46E6, 7, 0, false, true, 1265, 0, 9502, 4019, 0x026, 0);
|
||||
|
||||
if (m_Ticks >= 10)
|
||||
{
|
||||
int damage = Utility.RandomMinMax(120, 150);
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(.20), new TimerStateCallback(DoDamage_Callback), new object[] { m_Combatant, m_Dragon, damage });
|
||||
|
||||
Stop();
|
||||
}
|
||||
|
||||
m_Ticks++;
|
||||
}
|
||||
|
||||
public void DoDamage_Callback(object state)
|
||||
{
|
||||
object[] obj = (object[])state;
|
||||
|
||||
Mobile c = (Mobile)obj[0];
|
||||
Mobile d = (Mobile)obj[1];
|
||||
int dam = (int)obj[2];
|
||||
|
||||
d.DoHarmful(c);
|
||||
AOS.Damage(c, d, dam, false, 0, 0, 0, 0, 0, 100, 0, false);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Executable
+225
@@ -0,0 +1,225 @@
|
||||
//based on reworked from the Heritage Sovereign System by Dan Tasar at TrueUO.com
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
// ============================
|
||||
// HERITAGE SOVEREIGN ITEM
|
||||
// ============================
|
||||
public class HeritageSovereign : Item
|
||||
{
|
||||
[Constructable]
|
||||
public HeritageSovereign() : this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HeritageSovereign(int amount) : base(0x14EF) // ORIGINAL ITEM ID
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Hue = 2713; // ORIGINAL HUE
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
|
||||
UpdateName();
|
||||
}
|
||||
|
||||
public HeritageSovereign(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
private void UpdateName()
|
||||
{
|
||||
if (Amount == 1)
|
||||
Name = "This dirty, crumpled paper appears to be a voucher good for 1 Sovereign store credit";
|
||||
else
|
||||
Name = $"This dirty, crumpled paper appears to be a voucher good for {Amount} Sovereign store credits";
|
||||
}
|
||||
|
||||
protected override void OnAmountChange(int oldValue)
|
||||
{
|
||||
base.OnAmountChange(oldValue);
|
||||
UpdateName();
|
||||
}
|
||||
|
||||
// Prevents the client from auto-prefixing the amount
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
list.Add(Name);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add("Reward Currency");
|
||||
list.Add("Double Click: Deposit to your virtual wallet");
|
||||
}
|
||||
|
||||
public override double DefaultWeight => (Core.ML ? (0.01 / 3) : 0.01);
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // Must be in pack
|
||||
return;
|
||||
}
|
||||
|
||||
if (from is PlayerMobile pm)
|
||||
{
|
||||
pm.DepositSovereigns(Amount);
|
||||
Delete();
|
||||
|
||||
from.SendMessage("Your Sovereigns have been added to your virtual wallet. Visit the UO Store to view and spend your Sovereigns");
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
UpdateName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Server.CustomSystems
|
||||
{
|
||||
// ============================
|
||||
// LOOT SYSTEM
|
||||
// ============================
|
||||
public static class StoreCurrencyLootSystem
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.CreatureDeath += OnCreatureDeath;
|
||||
}
|
||||
|
||||
public static void OnCreatureDeath(CreatureDeathEventArgs e)
|
||||
{
|
||||
BaseCreature c = e.Creature as BaseCreature;
|
||||
|
||||
// 1. Safety Filters
|
||||
if (c == null || c.Player || c.Summoned || c.Controlled)
|
||||
return;
|
||||
|
||||
// 2. Build the Eligible Player Pool
|
||||
List<PlayerMobile> eligiblePlayers = new List<PlayerMobile>();
|
||||
|
||||
if (c.DamageEntries != null)
|
||||
{
|
||||
foreach (DamageEntry de in c.DamageEntries)
|
||||
{
|
||||
Mobile m = de.Damager;
|
||||
if (m == null) continue;
|
||||
|
||||
// Resolve pet/summon damage back to the actual player owner
|
||||
if (m is BaseCreature bc && bc.Controlled && bc.ControlMaster is PlayerMobile pmMaster)
|
||||
m = pmMaster;
|
||||
|
||||
if (m is PlayerMobile pm && pm.Alive && !eligiblePlayers.Contains(pm))
|
||||
eligiblePlayers.Add(pm);
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to final killer
|
||||
if (eligiblePlayers.Count == 0 && e.Killer != null)
|
||||
{
|
||||
Mobile k = e.Killer;
|
||||
|
||||
if (k is BaseCreature bc && bc.Controlled && bc.ControlMaster is PlayerMobile pmMaster)
|
||||
k = pmMaster;
|
||||
|
||||
if (k is PlayerMobile pm)
|
||||
eligiblePlayers.Add(pm);
|
||||
}
|
||||
|
||||
if (eligiblePlayers.Count == 0)
|
||||
return;
|
||||
|
||||
// 3. Randomly Select ONE Winner
|
||||
PlayerMobile targetWinner = eligiblePlayers[Utility.Random(eligiblePlayers.Count)];
|
||||
|
||||
bool isParagon = c.IsParagon;
|
||||
bool isEndgameBoss =
|
||||
(c is BaseChampion) ||
|
||||
(c.GetType().Namespace != null &&
|
||||
c.GetType().Namespace.Contains("Server.Engines.Peerless"));
|
||||
|
||||
// 4. Determine Drop Chance
|
||||
if (!isEndgameBoss)
|
||||
{
|
||||
if (Utility.RandomDouble() > 0.10)
|
||||
return;
|
||||
}
|
||||
|
||||
// 5. Evaluate Base Tiers
|
||||
int maxHits = c.HitsMax;
|
||||
int baseReward = 0;
|
||||
|
||||
if (isEndgameBoss)
|
||||
{
|
||||
baseReward = 200;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (maxHits >= 500 && maxHits < 1000)
|
||||
baseReward = 5;
|
||||
else if (maxHits >= 1000 && maxHits < 5000)
|
||||
baseReward = 10;
|
||||
else if (maxHits >= 5000 && maxHits < 10000)
|
||||
baseReward = 50;
|
||||
else if (maxHits >= 10000)
|
||||
baseReward = 100;
|
||||
}
|
||||
|
||||
if (baseReward == 0)
|
||||
return;
|
||||
|
||||
// 6. Double Reward Check (Luck-based)
|
||||
double doubleChance = 0.01;
|
||||
double playerLuck = Math.Max(0, targetWinner.Luck);
|
||||
double luckFactor = playerLuck / 2500.0;
|
||||
|
||||
if (luckFactor > 1.0)
|
||||
luckFactor = 1.0;
|
||||
|
||||
doubleChance += (luckFactor * 0.09);
|
||||
|
||||
if (!isEndgameBoss && Utility.RandomDouble() <= doubleChance)
|
||||
{
|
||||
baseReward *= 2;
|
||||
targetWinner.PlaySound(0x5B6);
|
||||
|
||||
string percentDisplay = (doubleChance * 100.0).ToString("F1");
|
||||
targetWinner.SendMessage(0x35,
|
||||
$"Your Luck ({percentDisplay}% chance) triggered a double reward drop! ({baseReward} Sovereigns)");
|
||||
}
|
||||
else
|
||||
{
|
||||
targetWinner.SendMessage(0x59,
|
||||
"You notice a strange note shifting inside the monster's remains...");
|
||||
}
|
||||
|
||||
// 7. Drop the Sovereign Item into the Corpse
|
||||
Container corpse = c.Corpse;
|
||||
|
||||
if (corpse != null && !corpse.Deleted)
|
||||
{
|
||||
corpse.DropItem(new HeritageSovereign(baseReward));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+480
@@ -0,0 +1,480 @@
|
||||
/****************************************
|
||||
* Author: ImaNewb *
|
||||
* Script Name: ImaNewbsChatSystem.cs *
|
||||
* For use with ServUO *
|
||||
* Date: July 09, 2024 *
|
||||
****************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Commands;
|
||||
|
||||
|
||||
namespace Server.ChatSystem
|
||||
{
|
||||
public class ChatChannel
|
||||
{
|
||||
public string Name { get; }
|
||||
public bool IsPrivate { get; }
|
||||
public bool IsDynamic { get; }
|
||||
public int SpeechColor { get; }
|
||||
private Mobile _owner;
|
||||
private List<Mobile> _members;
|
||||
private List<string> _messages;
|
||||
private List<Mobile> _invited;
|
||||
|
||||
public ChatChannel(string name, Mobile owner, int speechColor, bool isPrivate = false, bool isDynamic = false)
|
||||
{
|
||||
Name = name;
|
||||
_owner = owner;
|
||||
IsPrivate = isPrivate;
|
||||
IsDynamic = isDynamic;
|
||||
SpeechColor = speechColor;
|
||||
_members = new List<Mobile>();
|
||||
_messages = new List<string>();
|
||||
_invited = new List<Mobile>();
|
||||
|
||||
if (owner != null)
|
||||
{
|
||||
Join(owner);
|
||||
}
|
||||
}
|
||||
|
||||
public void Join(Mobile m)
|
||||
{
|
||||
if (IsPrivate && !_invited.Contains(m) && m != _owner)
|
||||
{
|
||||
m.SendMessage(0x35, $"You are not invited to the {Name} channel.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_members.Contains(m))
|
||||
{
|
||||
_members.Add(m);
|
||||
m.SendMessage(0x35, $"You have joined the {Name} channel.");
|
||||
}
|
||||
}
|
||||
|
||||
public void Leave(Mobile m)
|
||||
{
|
||||
if (_members.Contains(m))
|
||||
{
|
||||
_members.Remove(m);
|
||||
m.SendMessage(0x35, $"You have left the {Name} channel.");
|
||||
|
||||
// If the channel is dynamic and the last member leaves, delete the channel
|
||||
if (IsDynamic && _members.Count == 0)
|
||||
{
|
||||
ImaNewbsChatSystem.DeleteChannel(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Invite(Mobile m)
|
||||
{
|
||||
if (!_invited.Contains(m))
|
||||
{
|
||||
_invited.Add(m);
|
||||
m.SendMessage(0x35, $"You have been invited to the {Name} channel. Type [AcceptInvite {Name} to join.");
|
||||
}
|
||||
}
|
||||
|
||||
public void SendMessage(Mobile sender, string message)
|
||||
{
|
||||
string formattedMessage = $"{sender.Name}: {message}";
|
||||
_messages.Add(formattedMessage);
|
||||
|
||||
if (_messages.Count > 50)
|
||||
_messages.RemoveAt(0);
|
||||
|
||||
foreach (var member in _members)
|
||||
{
|
||||
member.SendMessage(SpeechColor, formattedMessage);
|
||||
}
|
||||
|
||||
// Send message to all staff members with HearAll flag set
|
||||
foreach (var mobile in World.Mobiles.Values)
|
||||
{
|
||||
if (mobile.AccessLevel >= AccessLevel.GameMaster && HearAllSystem.IsHearAllEnabled(mobile) && !_members.Contains(mobile))
|
||||
{
|
||||
mobile.SendMessage(SpeechColor, $"[{Name}] {formattedMessage}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string GetMessagesHtml()
|
||||
{
|
||||
return string.Join("<br>", _messages);
|
||||
}
|
||||
|
||||
public List<Mobile> Members => _members;
|
||||
public List<Mobile> Invited => _invited;
|
||||
}
|
||||
|
||||
public static class ImaNewbsChatSystem
|
||||
{
|
||||
private static bool _enabled = true;
|
||||
public static Dictionary<string, ChatChannel> _channels = new Dictionary<string, ChatChannel>();
|
||||
private static Dictionary<Mobile, ChatChannel> _currentChannels = new Dictionary<Mobile, ChatChannel>();
|
||||
|
||||
static ImaNewbsChatSystem()
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
if (_enabled)
|
||||
{
|
||||
CommandSystem.Register("Chat", AccessLevel.Player, OpenChatWindow_OnCommand);
|
||||
CommandSystem.Register("c", AccessLevel.Player, SendChatMessage_OnCommand);
|
||||
CommandSystem.Register("CreateChannel", AccessLevel.Player, CreateChannel_OnCommand);
|
||||
CommandSystem.Register("Invite", AccessLevel.Player, Invite_OnCommand);
|
||||
CommandSystem.Register("AcceptInvite", AccessLevel.Player, AcceptInvite_OnCommand);
|
||||
|
||||
// Register the HearAll command for staff
|
||||
CommandSystem.Register("HearAll", AccessLevel.GameMaster, HearAll_OnCommand);
|
||||
|
||||
InitializeChannels();
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.Blue;
|
||||
Console.Write("Chat System: Loading...");
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write("done ");
|
||||
Console.WriteLine("( ***Chat System Activated*** )");
|
||||
Console.ResetColor();
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Blue;
|
||||
Console.Write("Chat System: Loading...");
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write("done ");
|
||||
Console.ForegroundColor = ConsoleColor.DarkRed;
|
||||
Console.WriteLine("( ***Turned Off*** )");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
|
||||
private static void InitializeChannels()
|
||||
{
|
||||
_channels["Global Chat"] = new ChatChannel("Global Chat", null, 0x22); // Red
|
||||
_channels["General"] = new ChatChannel("General", null, 0x35); // Yellow
|
||||
_channels["Trade"] = new ChatChannel("Trade", null, 0x3E); // Green
|
||||
_channels["LFGuild"] = new ChatChannel("LFGuild", null, 0x4F); // Light Blue
|
||||
_channels["LFGroup"] = new ChatChannel("LFGroup", null, 0x2B); // Orange
|
||||
_channels["Help"] = new ChatChannel("Help", null, 0x5E); // Cyan
|
||||
}
|
||||
|
||||
public static void DeleteChannel(ChatChannel channel)
|
||||
{
|
||||
if (_channels.ContainsKey(channel.Name))
|
||||
{
|
||||
_channels.Remove(channel.Name);
|
||||
Console.WriteLine($"Dynamic channel '{channel.Name}' has been deleted.");
|
||||
}
|
||||
}
|
||||
|
||||
private static void OpenChatWindow_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
// Close any existing chat gumps
|
||||
e.Mobile.CloseGump(typeof(ChatGump));
|
||||
e.Mobile.SendGump(new ChatGump(e.Mobile));
|
||||
}
|
||||
|
||||
private static void SendChatMessage_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
if (_currentChannels.TryGetValue(e.Mobile, out var channel))
|
||||
{
|
||||
if (e.Length >= 1)
|
||||
{
|
||||
string message = e.ArgString.Trim();
|
||||
channel.SendMessage(e.Mobile, message);
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SendMessage(0x35, "Usage: c <message>");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SendMessage(0x35, "You are not in any channel. Use [chat to open the chat window.");
|
||||
}
|
||||
|
||||
// Refresh the chat gump
|
||||
e.Mobile.CloseGump(typeof(ChatGump));
|
||||
e.Mobile.SendGump(new ChatGump(e.Mobile));
|
||||
}
|
||||
|
||||
private static void CreateChannel_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
if (e.Length >= 1)
|
||||
{
|
||||
string channelName = e.GetString(0);
|
||||
if (channelName.Length > 13)
|
||||
{
|
||||
e.Mobile.SendMessage(0x35, "Channel name cannot exceed 13 characters.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_channels.ContainsKey(channelName))
|
||||
{
|
||||
var channel = new ChatChannel(channelName, e.Mobile, 0x35, true, true); // All dynamic channels are private by default
|
||||
_channels[channelName] = channel;
|
||||
JoinChannel(e.Mobile, channelName);
|
||||
e.Mobile.SendMessage(0x35, $"Private channel '{channelName}' has been created.");
|
||||
|
||||
// Refresh the gump
|
||||
e.Mobile.CloseGump(typeof(ChatGump));
|
||||
e.Mobile.SendGump(new ChatGump(e.Mobile));
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SendMessage(0x35, $"Channel '{channelName}' already exists.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SendMessage(0x35, "Usage: CreateChannel <channelName>");
|
||||
}
|
||||
}
|
||||
|
||||
private static void Invite_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
if (e.Length >= 1)
|
||||
{
|
||||
string targetName = e.GetString(0);
|
||||
Mobile target = GetMobileByName(targetName);
|
||||
if (target != null)
|
||||
{
|
||||
if (_currentChannels.TryGetValue(e.Mobile, out var channel))
|
||||
{
|
||||
channel.Invite(target);
|
||||
e.Mobile.SendMessage(0x35, $"You have invited {targetName} to the {channel.Name} channel.");
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SendMessage(0x35, "You are not in any channel to invite players.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SendMessage(0x35, $"Player '{targetName}' not found.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SendMessage(0x35, "Usage: Invite <playerName>");
|
||||
}
|
||||
}
|
||||
|
||||
private static void AcceptInvite_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
if (e.Length >= 1)
|
||||
{
|
||||
string channelName = e.GetString(0);
|
||||
if (_channels.TryGetValue(channelName, out var channel))
|
||||
{
|
||||
if (channel.Invited.Contains(e.Mobile))
|
||||
{
|
||||
JoinChannel(e.Mobile, channelName);
|
||||
e.Mobile.SendMessage(0x35, $"You have joined the '{channelName}' channel.");
|
||||
|
||||
// Refresh the gump
|
||||
e.Mobile.CloseGump(typeof(ChatGump));
|
||||
e.Mobile.SendGump(new ChatGump(e.Mobile));
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SendMessage(0x35, $"You do not have an invite to the '{channelName}' channel.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SendMessage(0x35, $"Channel '{channelName}' does not exist.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SendMessage(0x35, "Usage: AcceptInvite <channelName>");
|
||||
}
|
||||
}
|
||||
|
||||
private static Mobile GetMobileByName(string name)
|
||||
{
|
||||
foreach (Mobile mobile in World.Mobiles.Values)
|
||||
{
|
||||
if (mobile.Name.Equals(name, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return mobile;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void JoinChannel(Mobile mobile, string channelName)
|
||||
{
|
||||
if (_channels.TryGetValue(channelName, out var channel))
|
||||
{
|
||||
// Check if the channel is private and if the mobile is invited
|
||||
if (channel.IsPrivate && !channel.Members.Contains(mobile) && !channel.Invited.Contains(mobile))
|
||||
{
|
||||
mobile.SendMessage(0x35, "You are not invited to this channel.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Leave current channel if already in one
|
||||
if (_currentChannels.TryGetValue(mobile, out var currentChannel))
|
||||
{
|
||||
currentChannel.Leave(mobile);
|
||||
_currentChannels.Remove(mobile);
|
||||
}
|
||||
|
||||
// Join new channel
|
||||
channel.Join(mobile);
|
||||
_currentChannels[mobile] = channel;
|
||||
|
||||
// Refresh the chat gump
|
||||
mobile.CloseGump(typeof(ChatGump));
|
||||
mobile.SendGump(new ChatGump(mobile));
|
||||
}
|
||||
}
|
||||
|
||||
public static void LeaveCurrentChannel(Mobile mobile)
|
||||
{
|
||||
if (_currentChannels.TryGetValue(mobile, out var channel))
|
||||
{
|
||||
channel.Leave(mobile);
|
||||
_currentChannels.Remove(mobile);
|
||||
|
||||
// Refresh the chat gump
|
||||
mobile.CloseGump(typeof(ChatGump));
|
||||
mobile.SendGump(new ChatGump(mobile));
|
||||
}
|
||||
else
|
||||
{
|
||||
mobile.SendMessage(0x35, "You are not in any channel.");
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetCurrentChannelName(Mobile mobile)
|
||||
{
|
||||
if (_currentChannels.TryGetValue(mobile, out var channel))
|
||||
{
|
||||
return $"{channel.Name} ({channel.Members.Count})";
|
||||
}
|
||||
return "None";
|
||||
}
|
||||
|
||||
private static void HearAll_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
HearAllSystem.ToggleHearAll(e.Mobile);
|
||||
}
|
||||
}
|
||||
|
||||
public class ChatGump : Gump
|
||||
{
|
||||
private Mobile _mobile;
|
||||
|
||||
public ChatGump(Mobile mobile) : base(50, 50)
|
||||
{
|
||||
_mobile = mobile;
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
Resizable = false;
|
||||
|
||||
AddPage(0);
|
||||
|
||||
// Background must be added first
|
||||
AddBackground(0, 0, 200, 270, 9270);
|
||||
AddAlphaRegion(10, 10, 180, 250); // Transparent background
|
||||
|
||||
AddLabel(20, 20, 1350, "Available Channels");
|
||||
|
||||
string currentChannelName = ImaNewbsChatSystem.GetCurrentChannelName(mobile);
|
||||
AddLabel(20, 40, 1350, $"Connected: {currentChannelName}");
|
||||
|
||||
int y = 70;
|
||||
foreach (var channel in ImaNewbsChatSystem._channels.Values)
|
||||
{
|
||||
if (!channel.IsPrivate)
|
||||
{
|
||||
int memberCount = channel.Members.Count;
|
||||
AddButton(20, y, 4005, 4007, channel.Name.GetHashCode(), GumpButtonType.Reply, 0);
|
||||
AddLabel(55, y, channel.SpeechColor, $"{channel.Name} ({memberCount})"); // Match label color with speech color and add member count
|
||||
y += 25;
|
||||
}
|
||||
}
|
||||
|
||||
AddButton(20, y, 4005, 4007, 1, GumpButtonType.Reply, 0);
|
||||
AddLabel(55, y, 1153, "Leave Chat");
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
int buttonId = info.ButtonID;
|
||||
if (buttonId != 0)
|
||||
{
|
||||
if (buttonId == 1)
|
||||
{
|
||||
// Leave current channel
|
||||
ImaNewbsChatSystem.LeaveCurrentChannel(_mobile);
|
||||
|
||||
// Update Gump to show disconnected state
|
||||
_mobile.CloseGump(typeof(ChatGump));
|
||||
_mobile.SendGump(new ChatGump(_mobile));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Join a channel
|
||||
string channelName = null;
|
||||
foreach (var channel in ImaNewbsChatSystem._channels.Values)
|
||||
{
|
||||
if (channel.Name.GetHashCode() == buttonId)
|
||||
{
|
||||
channelName = channel.Name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (channelName != null)
|
||||
{
|
||||
ImaNewbsChatSystem.JoinChannel(_mobile, channelName);
|
||||
|
||||
// Refresh the gump
|
||||
_mobile.CloseGump(typeof(ChatGump));
|
||||
_mobile.SendGump(new ChatGump(_mobile));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class HearAllSystem
|
||||
{
|
||||
private static readonly Dictionary<Mobile, bool> _hearAllFlags = new Dictionary<Mobile, bool>();
|
||||
|
||||
public static bool IsHearAllEnabled(Mobile mobile)
|
||||
{
|
||||
return _hearAllFlags.TryGetValue(mobile, out bool isEnabled) && isEnabled;
|
||||
}
|
||||
|
||||
public static void ToggleHearAll(Mobile mobile)
|
||||
{
|
||||
if (_hearAllFlags.TryGetValue(mobile, out bool isEnabled))
|
||||
{
|
||||
_hearAllFlags[mobile] = !isEnabled;
|
||||
}
|
||||
else
|
||||
{
|
||||
_hearAllFlags[mobile] = true;
|
||||
}
|
||||
|
||||
mobile.SendMessage(0x35, $"Hear all channels is now {(IsHearAllEnabled(mobile) ? "enabled" : "disabled")}.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+45
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
|
||||
public class InsuranceAgent : BaseCreature
|
||||
{
|
||||
[Constructable]
|
||||
public InsuranceAgent()
|
||||
: base(AIType.AI_Vendor, FightMode.None, 0, 0, 0.2, 0.4)
|
||||
{
|
||||
Name = "an Insurance Agent";
|
||||
Body = 0x190; // male human
|
||||
Hue = Utility.RandomSkinHue();
|
||||
|
||||
Blessed = true; // invulnerable
|
||||
CantWalk = true; // stationary
|
||||
Frozen = true; // cannot be moved
|
||||
Warmode = false; // never fights
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from is PlayerMobile pm && pm !=null)
|
||||
{
|
||||
this.Say("Here are your insurance options.");
|
||||
|
||||
pm.OpenItemInsuranceMenu(new ItemInsuranceMenuGump(pm, pm.Items, null, 0));
|
||||
}
|
||||
}
|
||||
|
||||
public InsuranceAgent(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
reader.ReadInt();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Accounting;
|
||||
|
||||
public class InsuranceAgent : BaseCreature
|
||||
{
|
||||
[Constructable]
|
||||
public InsuranceAgent()
|
||||
: base(AIType.AI_Vendor, FightMode.None, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
|
||||
Title = "the Claims Specialist";
|
||||
|
||||
CantWalk = true; // allow wandering
|
||||
Blessed = true; // invulnerable
|
||||
Frozen = false;
|
||||
|
||||
Hue = Utility.RandomSkinHue();
|
||||
|
||||
if (Female = Utility.RandomBool())
|
||||
{
|
||||
Body = 0x191;
|
||||
Name = NameList.RandomName("female");
|
||||
|
||||
AddItem(new PlateChest());
|
||||
AddItem(new PlateArms());
|
||||
AddItem(new PlateLegs());
|
||||
AddItem(new Cloak(113));
|
||||
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 0:
|
||||
AddItem(new Doublet(Utility.RandomNondyedHue()));
|
||||
break;
|
||||
case 1:
|
||||
AddItem(new Tunic(Utility.RandomNondyedHue()));
|
||||
break;
|
||||
case 2:
|
||||
AddItem(new BodySash(Utility.RandomNondyedHue()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Body = 0x190;
|
||||
Name = NameList.RandomName("male");
|
||||
|
||||
AddItem(new PlateChest());
|
||||
AddItem(new PlateArms());
|
||||
AddItem(new PlateLegs());
|
||||
AddItem(new Cloak(113));
|
||||
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 0:
|
||||
AddItem(new Doublet(Utility.RandomNondyedHue()));
|
||||
break;
|
||||
case 1:
|
||||
AddItem(new Tunic(Utility.RandomNondyedHue()));
|
||||
break;
|
||||
case 2:
|
||||
AddItem(new BodySash(Utility.RandomNondyedHue()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
Utility.AssignRandomHair(this);
|
||||
|
||||
if (Utility.RandomBool())
|
||||
{
|
||||
Utility.AssignRandomFacialHair(this, HairHue);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from is PlayerMobile pm)
|
||||
{
|
||||
Say("Here are your insurance options.");
|
||||
pm.OpenItemInsuranceMenu(); // The correct ServUO method
|
||||
}
|
||||
}
|
||||
|
||||
public InsuranceAgent(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
Executable
+377
@@ -0,0 +1,377 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Custom.Misc
|
||||
{
|
||||
public class LegendaryMaster : BaseCreature
|
||||
{
|
||||
private static List<SkillTaskInfo> taskInfos;
|
||||
|
||||
private static TimeSpan TaskTime = TimeSpan.FromMinutes(60); // task time to start!
|
||||
|
||||
private static TimeSpan ExtraTaskTime = TimeSpan.FromMinutes(10); // additional time added per kill!
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.CreatureDeath += EventSink_CreatureDeath;
|
||||
}
|
||||
|
||||
private static void EventSink_CreatureDeath(CreatureDeathEventArgs e)
|
||||
{
|
||||
if (e.Killer == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.Creature != null && ValidateName(e.Creature.GetType()))
|
||||
{
|
||||
if (taskInfos != null && taskInfos.Count > 0)
|
||||
{
|
||||
PlayerMobile pm = null;
|
||||
|
||||
if (e.Killer is BaseCreature bc)
|
||||
{
|
||||
if (bc.Controlled && bc.ControlMaster is PlayerMobile cm)
|
||||
{
|
||||
pm = cm;
|
||||
}
|
||||
else if (bc.Summoned && bc.SummonMaster is PlayerMobile sm)
|
||||
{
|
||||
pm = sm;
|
||||
}
|
||||
}
|
||||
|
||||
if (pm == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SkillTaskInfo currentInfo = null;
|
||||
|
||||
foreach (var info in taskInfos)
|
||||
{
|
||||
if (pm.Serial == info.PlayerSerial)
|
||||
{
|
||||
if (info.TargetName == e.Creature.GetType())
|
||||
{
|
||||
if (!info.Completed && info.TimeLimit > DateTime.Now)
|
||||
{
|
||||
if (info.TaskAmount == 0)
|
||||
{
|
||||
pm.AddToBackpack(new PowerScroll(info.PlayerSkill, info.SkillCap + 5));
|
||||
|
||||
pm.SendMessage(53, $"You were rewarded a {info.SkillCap + 5} {info.PlayerSkill} Powerscroll!");
|
||||
|
||||
TryGiveStatScroll(pm);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (info.Completed)
|
||||
{
|
||||
pm.SendMessage(53, $"You already completed this task!");
|
||||
}
|
||||
else
|
||||
{
|
||||
pm.SendMessage(53, $"You ran out of time for this task!");
|
||||
}
|
||||
}
|
||||
|
||||
currentInfo = info;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (currentInfo != null)
|
||||
{
|
||||
if (currentInfo.TaskAmount > 0 && currentInfo.TimeLimit > DateTime.Now)
|
||||
{
|
||||
currentInfo.TaskAmount--;
|
||||
|
||||
currentInfo.TimeLimit += ExtraTaskTime;
|
||||
|
||||
currentInfo.TargetName = GetRandomCreature();
|
||||
|
||||
KillMessage(pm, currentInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
currentInfo.Completed = true;
|
||||
}
|
||||
}
|
||||
|
||||
CleanTaskInfos();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void TryGiveStatScroll(PlayerMobile pm)
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.01)
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.01)
|
||||
{
|
||||
pm.AddToBackpack(new StatCapScroll(pm.StatCap + RandomStatScrollLevel()));
|
||||
}
|
||||
else
|
||||
{
|
||||
pm.AddToBackpack(new StatCapScroll(pm.StatCap + 5));
|
||||
}
|
||||
|
||||
pm.SendLocalizedMessage(1049524); // You have received a scroll of power!
|
||||
}
|
||||
}
|
||||
|
||||
private static int RandomStatScrollLevel()
|
||||
{
|
||||
double random = Utility.RandomDouble();
|
||||
|
||||
if (0.1 >= random)
|
||||
return 25;
|
||||
else if (0.25 >= random)
|
||||
return 20;
|
||||
else if (0.45 >= random)
|
||||
return 15;
|
||||
else if (0.70 >= random)
|
||||
return 10;
|
||||
return 5;
|
||||
}
|
||||
|
||||
private static void CleanTaskInfos()
|
||||
{
|
||||
if (taskInfos != null && taskInfos.Count > 0)
|
||||
{
|
||||
taskInfos.RemoveAll(i => i.Completed);
|
||||
}
|
||||
}
|
||||
|
||||
private static bool ValidateName(Type creature)
|
||||
{
|
||||
if (CreatureList().Contains(creature)) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static Type GetRandomCreature()
|
||||
{
|
||||
return CreatureList()[Utility.Random(CreatureList().Count - 1)];
|
||||
}
|
||||
|
||||
private static List<Type> creatureCache;
|
||||
|
||||
private static List<Type> CreatureList()
|
||||
{
|
||||
if (creatureCache == null)
|
||||
{
|
||||
creatureCache = new List<Type>()
|
||||
{
|
||||
typeof(Balron),
|
||||
typeof(ShadowWyrm),
|
||||
typeof(EvilMageLord),
|
||||
typeof(AncientLich),
|
||||
typeof(AncientWyrm),
|
||||
typeof(SkeletalDragon),
|
||||
typeof(WhiteWyrm)
|
||||
};
|
||||
}
|
||||
|
||||
return creatureCache;
|
||||
}
|
||||
|
||||
public override bool IsInvulnerable => true;
|
||||
|
||||
[Constructable]
|
||||
public LegendaryMaster() : base(AIType.AI_Vendor, FightMode.None, 10, 1, .2, .4)
|
||||
{
|
||||
if (taskInfos == null)
|
||||
{
|
||||
taskInfos = new List<SkillTaskInfo>();
|
||||
}
|
||||
|
||||
Name = "Legendary Master of Skills";
|
||||
|
||||
Body = 0x190;
|
||||
|
||||
Hue = Race.RandomSkinHue();
|
||||
|
||||
HairItemID = 0x203C;
|
||||
|
||||
HairHue = 0x481;
|
||||
|
||||
FacialHairItemID = 0x203E;
|
||||
|
||||
FacialHairHue = 0x481;
|
||||
|
||||
InitStats(150, 150, 150);
|
||||
|
||||
SetWearable(new HoodedShroudOfShadows(), 0x481);
|
||||
|
||||
SetWearable(new Sandals(), 0x481);
|
||||
|
||||
Blessed = true;
|
||||
|
||||
CantWalk = true;
|
||||
|
||||
SpeechHue = 53;
|
||||
}
|
||||
|
||||
public override bool HandlesOnSpeech(Mobile from)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnSpeech(SpeechEventArgs e)
|
||||
{
|
||||
if (e.Mobile is PlayerMobile pm && pm.InRange(Location, 5))
|
||||
{
|
||||
if (e.Speech.StartsWith("give task"))
|
||||
{
|
||||
if (pm.IsStaff())
|
||||
{
|
||||
SayTo(pm, "I am on duty, waiting for a player to help!");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (taskInfos.Any(i => i.PlayerSerial == pm.Serial))
|
||||
{
|
||||
pm.SendMessage(53, $"You already have a task!");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var skill in pm.Skills)
|
||||
{
|
||||
if (e.Speech.EndsWith(skill.Name.ToLower()) && skill.Value > 99)
|
||||
{
|
||||
if (skill.Cap == 120)
|
||||
{
|
||||
if (skill.Value < 120)
|
||||
{
|
||||
SayTo(pm, $"You need to get {skill.Name} to {skill.Cap}!");
|
||||
|
||||
SayTo(pm, "Have fun!");
|
||||
}
|
||||
else
|
||||
{
|
||||
SayTo(pm, $"Your {skill.Name} is already {skill.Value}, your not fooling me!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int skilldiff = (int)skill.Cap - 100;
|
||||
|
||||
skilldiff = skilldiff > 0 ? skilldiff / 5 : 0;
|
||||
|
||||
UpdateSkillTask(pm, skill, GetRandomCreature(), Utility.RandomMinMax(1, 3 + skilldiff));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (e.Speech.StartsWith("remove task"))
|
||||
{
|
||||
if (taskInfos.Any(i => i.PlayerSerial == e.Mobile.Serial))
|
||||
{
|
||||
taskInfos.RemoveAll(ti => ti.PlayerSerial == e.Mobile.Serial);
|
||||
|
||||
SayTo(e.Mobile, "You are now free of any tasks!");
|
||||
}
|
||||
else
|
||||
{
|
||||
SayTo(e.Mobile, "You don't have any tasks!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.1)
|
||||
{
|
||||
SayTo(e.Mobile, "You do you need a task? I trade Powerscrolls!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
base.OnSpeech(e);
|
||||
}
|
||||
|
||||
private void UpdateSkillTask(PlayerMobile pm, Skill skill, Type target, int amount)
|
||||
{
|
||||
if (skill.Value == skill.Cap)
|
||||
{
|
||||
taskInfos.Add(new SkillTaskInfo()
|
||||
{
|
||||
PlayerSerial = pm.Serial,
|
||||
PlayerSkill = skill.SkillName,
|
||||
SkillCap = skill.Cap,
|
||||
TargetName = target,
|
||||
TimeLimit = DateTime.Now + TaskTime,
|
||||
TaskAmount = amount
|
||||
});
|
||||
|
||||
KillMessage(pm, taskInfos.Last());
|
||||
|
||||
Effects.SendBoltEffect(pm, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
SayTo(pm, $"You need to get {skill.Name} to {skill.Cap}!");
|
||||
|
||||
SayTo(pm, "Come back when done!");
|
||||
}
|
||||
}
|
||||
|
||||
private static void KillMessage(Mobile m, SkillTaskInfo info)
|
||||
{
|
||||
if (info.TaskAmount > 1)
|
||||
{
|
||||
m.SendMessage(53, $"You have {info.TimeLimit} minutes, to kill {info.TargetName}!");
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendMessage($"Kill {info.TargetName} to receive a {info.SkillCap + 5} {info.PlayerSkill} powerscroll within {info.TimeLimit} minutes!");
|
||||
}
|
||||
}
|
||||
|
||||
public LegendaryMaster(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
_ = reader.ReadInt();
|
||||
|
||||
if (taskInfos == null)
|
||||
{
|
||||
taskInfos = new List<SkillTaskInfo>();
|
||||
}
|
||||
}
|
||||
|
||||
private class SkillTaskInfo
|
||||
{
|
||||
public Serial PlayerSerial;
|
||||
|
||||
public SkillName PlayerSkill;
|
||||
|
||||
public double SkillCap;
|
||||
|
||||
public Type TargetName;
|
||||
|
||||
public DateTime TimeLimit;
|
||||
|
||||
public bool Completed = false;
|
||||
|
||||
public int TaskAmount;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
using System.Collections.Generic;
|
||||
|
||||
/* To add additional ticket types, update the following scripts:
|
||||
*
|
||||
* This: TicketType enum
|
||||
* ScratcherGump.cs: TicketType enum switches in the contructor and at in GetBackground() method.
|
||||
* ScratcherStongGump.cs: The appropriate info in ticket info region, new page for its stats, and a new response to buy a ticket.
|
||||
* Background length will need to be adjusted accordingly as well.
|
||||
* ScratcherLotto: GetGameType() Method will need to reflect the ticket name.
|
||||
* LottoTicketVendor: Add the new ticket, ID, Hue to the SBInfo
|
||||
*/
|
||||
|
||||
namespace Server.Engines.LotterySystem
|
||||
{
|
||||
public enum TicketType
|
||||
{
|
||||
GoldenTicket = 1, //1 mil jackpot
|
||||
CrazedCrafting = 2, //250k - bonus if owner is 100+ craft skill;
|
||||
SkiesTheLimit = 3, //Progressive
|
||||
Powerball = 4, //Standard Powerball 5white/1red
|
||||
}
|
||||
|
||||
public class BaseLottoTicket : Item, IOwnerRestricted
|
||||
{
|
||||
//Serialized fields/props
|
||||
private int m_Payout;
|
||||
private bool m_CashedOut;
|
||||
private bool m_Checked;
|
||||
private Mobile m_Owner;
|
||||
private TicketType m_Type;
|
||||
|
||||
private int m_Scratch1;
|
||||
private int m_Scratch2;
|
||||
private int m_Scratch3;
|
||||
private bool m_FreeTicket;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Payout { get { return m_Payout; } set { m_Payout = value; } }
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool CashedOut { get { return m_CashedOut; } set { m_CashedOut = value; } }
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool Checked { get { return m_Checked; } set { m_Checked = value; } }
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Owner { get { return m_Owner; } set { m_Owner = value; } }
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public TicketType Type { get { return m_Type; } set { m_Type = value; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Scratch1 { get { return m_Scratch1; } set { m_Scratch1 = value; } }
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Scratch2 { get { return m_Scratch2; } set { m_Scratch2 = value; } }
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Scratch3 { get { return m_Scratch3; } set { m_Scratch3 = value; } }
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool FreeTicket { get { return m_FreeTicket; } set { m_FreeTicket = value; } }
|
||||
|
||||
public virtual string OwnerName { get { return m_Owner != null ? m_Owner.Name : "unknown"; } set { } }
|
||||
|
||||
public BaseLottoTicket(Mobile owner, TicketType type, bool quickScratch) : base(0x0FF3)
|
||||
{
|
||||
m_Type = type;
|
||||
m_Owner = owner;
|
||||
m_CashedOut = false;
|
||||
m_Payout = 0;
|
||||
m_Checked = false;
|
||||
m_FreeTicket = false;
|
||||
|
||||
if (quickScratch)
|
||||
DoQuickScratch();
|
||||
}
|
||||
|
||||
public virtual void CheckScratches()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual bool DoScratch(int scratch, Mobile from)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (m_Owner == null)
|
||||
m_Owner = from;
|
||||
|
||||
if (!IsChildOf(from.Backpack))
|
||||
from.SendLocalizedMessage(1042001);
|
||||
|
||||
else if (from != m_Owner)
|
||||
from.SendMessage("Only the owner can view this ticket.");
|
||||
|
||||
else if (this is PowerBallTicket)
|
||||
{
|
||||
if (from.HasGump(typeof(PowerballTicketGump)))
|
||||
from.CloseGump(typeof(PowerballTicketGump));
|
||||
|
||||
from.SendGump(new PowerballTicketGump((PowerBallTicket)this, from));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (from.HasGump(typeof(ScratcherGump)))
|
||||
from.CloseGump(typeof(ScratcherGump));
|
||||
|
||||
from.SendGump(new ScratcherGump(this, from));
|
||||
}
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
string amount = "0";
|
||||
if (m_Payout > 0)
|
||||
{
|
||||
amount = String.Format("{0:##,###,###}", m_Payout);
|
||||
list.Add(1060847, "{0}\t{1}", "Winnings:", amount);
|
||||
}
|
||||
if (m_FreeTicket)
|
||||
list.Add("Free Ticket");
|
||||
}
|
||||
|
||||
public override void OnItemLifted(Mobile from, Item item)
|
||||
{
|
||||
base.OnItemLifted(from, item);
|
||||
|
||||
if (this is PowerBallTicket)
|
||||
{
|
||||
from.CloseGump(typeof(PowerballTicketGump));
|
||||
}
|
||||
else
|
||||
{
|
||||
from.CloseGump(typeof(ScratcherGump));
|
||||
}
|
||||
}
|
||||
|
||||
private void DoQuickScratch()
|
||||
{
|
||||
if (m_Owner == null)
|
||||
return;
|
||||
|
||||
for (int i = 1; i < 4; ++i)
|
||||
DoScratch(i, m_Owner);
|
||||
|
||||
m_Owner.SendMessage("You quickly scratch your ticket once you purchase it.");
|
||||
|
||||
m_Owner.PlaySound(0x249);
|
||||
|
||||
if (m_Owner.HasGump(typeof(ScratcherGump)))
|
||||
m_Owner.CloseGump(typeof(ScratcherGump));
|
||||
|
||||
m_Owner.SendGump(new ScratcherGump(this, m_Owner));
|
||||
|
||||
if (ScratcherLotto.Stone != null && ScratcherLotto.Stone.DeleteTicketOnLoss && m_Checked && !m_FreeTicket && m_Payout == 0)
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerCallback(TrashLosingTicket));
|
||||
|
||||
}
|
||||
|
||||
public void TrashLosingTicket()
|
||||
{
|
||||
if (m_Owner != null)
|
||||
{
|
||||
m_Owner.SendMessage("You trash the losing ticket.");
|
||||
m_Owner.SendSound(0x48, m_Owner.Location);
|
||||
}
|
||||
|
||||
Delete();
|
||||
}
|
||||
|
||||
public BaseLottoTicket(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); //Version
|
||||
|
||||
writer.Write(m_Owner);
|
||||
writer.Write(m_Payout);
|
||||
writer.Write(m_CashedOut);
|
||||
writer.Write(m_Checked);
|
||||
writer.Write((int)m_Type);
|
||||
|
||||
writer.Write(m_Scratch1);
|
||||
writer.Write(m_Scratch2);
|
||||
writer.Write(m_Scratch3);
|
||||
writer.Write(m_FreeTicket);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Owner = reader.ReadMobile();
|
||||
m_Payout = reader.ReadInt();
|
||||
m_CashedOut = reader.ReadBool();
|
||||
m_Checked = reader.ReadBool();
|
||||
m_Type = (TicketType)reader.ReadInt();
|
||||
|
||||
m_Scratch1 = reader.ReadInt();
|
||||
m_Scratch2 = reader.ReadInt();
|
||||
m_Scratch3 = reader.ReadInt();
|
||||
m_FreeTicket = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Factions;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server.Gumps;
|
||||
using Server.Guilds;
|
||||
using Server.Items;
|
||||
using Server.Engines.LotterySystem;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class LottoTicketVendor : Mobile
|
||||
{
|
||||
|
||||
[Constructable]
|
||||
public LottoTicketVendor()
|
||||
{
|
||||
Name = NameList.RandomName("female");
|
||||
Title = "the lottery attendant";
|
||||
|
||||
Female = true;
|
||||
NameHue = 0x35;
|
||||
BodyValue = 401;
|
||||
Frozen = true;
|
||||
Blessed = true;
|
||||
|
||||
Hue = Utility.RandomSkinHue();
|
||||
AddItem(new Sandals());
|
||||
AddItem(new Kilt(Utility.RandomBlueHue()));
|
||||
AddItem(new FeatheredHat(Utility.RandomGreenHue()));
|
||||
AddItem(new FancyShirt(Utility.RandomBlueHue()));
|
||||
|
||||
Hits = HitsMax;
|
||||
Stam = StamMax;
|
||||
Mana = ManaMax;
|
||||
}
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
if (dropped is BaseLottoTicket)
|
||||
{
|
||||
BaseLottoTicket ticket = (BaseLottoTicket)dropped;
|
||||
int payOut = ticket.Payout;
|
||||
Container pack = from.Backpack;
|
||||
|
||||
if (!ticket.Checked)
|
||||
{
|
||||
Say("You haven't played this ticket yet!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ticket.CashedOut && ticket.FreeTicket)
|
||||
GiveFreeTicket(from, ticket);
|
||||
|
||||
if (ticket.CashedOut)
|
||||
Say("This ticket has already been cashed out!");
|
||||
|
||||
else if (payOut == 0)
|
||||
Say("I'm sorry, but this ticket is not a winning ticket.");
|
||||
|
||||
else
|
||||
{
|
||||
if (payOut <= 1000000 && pack != null)
|
||||
{
|
||||
pack.DropItem(new BankCheck(payOut));
|
||||
from.SendMessage("Your winnings of {0} has been placed into your backpack. Please play again.", payOut);
|
||||
}
|
||||
else
|
||||
{
|
||||
Banker.Deposit(from, payOut);
|
||||
from.SendMessage("Your winnings of {0} has been deposited into your bankbox. Please play again.", payOut);
|
||||
}
|
||||
|
||||
from.PlaySound(52);
|
||||
from.PlaySound(53);
|
||||
from.PlaySound(54);
|
||||
from.PlaySound(55);
|
||||
ticket.CashedOut = true;
|
||||
}
|
||||
|
||||
dropped.Delete();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void GiveFreeTicket(Mobile from, BaseLottoTicket ticket)
|
||||
{
|
||||
if (from == null) return;
|
||||
|
||||
Item item = null;
|
||||
string name = "";
|
||||
|
||||
switch (ticket.Type)
|
||||
{
|
||||
default:
|
||||
case TicketType.GoldenTicket: item = new GoldenTicket(from, false); name = "Golden Ticket"; break;
|
||||
case TicketType.CrazedCrafting: item = new CrazedCrafting(from, false); name = "Crazed Crafting"; break;
|
||||
case TicketType.SkiesTheLimit: item = new SkiesTheLimit(from, false); name = "Skies the Limit"; break;
|
||||
}
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
from.SendMessage("You have recived your free {0} ticket.", name);
|
||||
if (from.Backpack != null)
|
||||
from.Backpack.DropItem(item);
|
||||
else
|
||||
from.BankBox.DropItem(item);
|
||||
}
|
||||
ticket.FreeTicket = false;
|
||||
}
|
||||
|
||||
public LottoTicketVendor( 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();
|
||||
|
||||
Frozen = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
+373
@@ -0,0 +1,373 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
using Server.Engines.LotterySystem;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class PowerBallStatsGump : Gump
|
||||
{
|
||||
private const int labelColor = 2101;
|
||||
private const int GMColor = 33;
|
||||
|
||||
private PowerBall m_PowerBall;
|
||||
private Mobile m_From;
|
||||
|
||||
public PowerBallStatsGump(PowerBall item, Mobile from)
|
||||
: base(50, 50)
|
||||
{
|
||||
m_PowerBall = item;
|
||||
m_From = from;
|
||||
|
||||
int gameNumber = 0;
|
||||
|
||||
if (PowerBall.Game != null)
|
||||
gameNumber = PowerBall.Game.GameNumber;
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(50, 0, 350, 350, 9250);
|
||||
|
||||
AddPage(1);
|
||||
|
||||
if (PowerBall.Game != null && PowerBall.Game.IsActive)
|
||||
AddLabel(70, 15, labelColor, String.Format("Current Powerball Game: {0}", gameNumber));
|
||||
else
|
||||
AddLabel(70, 20, GMColor, "Offline");
|
||||
|
||||
if (m_From.AccessLevel > AccessLevel.Player)
|
||||
{
|
||||
AddLabel(70, 40, GMColor, String.Format("Gold Sink: {0}", PowerBall.GoldSink));
|
||||
|
||||
if (PowerBall.Instance != null)
|
||||
{
|
||||
AddLabel(225, 40, GMColor, "Current Game's Profit:");
|
||||
AddLabel(325, 60, GMColor, String.Format("{0}", PowerBall.Instance.Profit));
|
||||
}
|
||||
|
||||
AddLabel(70, 185, GMColor, "*Warning* GM Options *Warning*");
|
||||
|
||||
AddLabel(105, 215, GMColor, "Reset All Stats");
|
||||
AddButton(70, 215, 0xFBD, 0xFBF, 2, GumpButtonType.Reply, 0);
|
||||
|
||||
AddLabel(105, 245, GMColor, "Current Game Guaratee Jackpot");
|
||||
AddButton(70, 245, 0xFBD, 0xFBF, 3, GumpButtonType.Reply, 0);
|
||||
|
||||
AddLabel(105, 275, GMColor, m_PowerBall.IsActive ? "Set Game Inactive" : "Set Active");
|
||||
AddButton(70, 275, 0xFBD, 0xFBF, 4, GumpButtonType.Reply, 0);
|
||||
|
||||
if (PowerBall.Game != null && PowerBall.Game.MaxWhiteBalls <= 20)
|
||||
{
|
||||
long odds = GetOdds();
|
||||
if (odds > 6)
|
||||
AddLabel(70, 305, GMColor, String.Format("Jackpot Odds: 1 in {0}", odds));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int hue = 2041;
|
||||
|
||||
AddImage(70, 200, 0x15A9, hue);
|
||||
AddImage(115, 265, 0x15A9, hue);
|
||||
AddImage(160, 200, 0x15A9, hue);
|
||||
AddImage(205, 265, 0x15A9, hue);
|
||||
AddImage(250, 200, 0x15A9, hue);
|
||||
AddImage(295, 265, 0x15A9, 0x21);
|
||||
|
||||
TimeSpan ts = m_PowerBall.NextGame - DateTime.Now;
|
||||
string text;
|
||||
|
||||
if (ts.TotalHours >= 1)
|
||||
{
|
||||
int minutes = (int)ts.TotalMinutes - (((int)ts.TotalHours) * 60);
|
||||
text = String.Format("Next Picks: {0} {1} and {2} {3}", ((int)ts.TotalHours).ToString(), ts.TotalHours == 1 ? "hour" : "hours", minutes.ToString(), ts.TotalMinutes == 1 ? "minute" : "minutes");
|
||||
}
|
||||
else
|
||||
text = String.Format("Next Picks: {0} {1}", ((int)ts.TotalMinutes).ToString(), ts.TotalMinutes == 1 ? "minute" : "minutes");
|
||||
|
||||
AddLabel(70, 40, labelColor, text);
|
||||
}
|
||||
|
||||
AddHtml(105, 65, 200, 16, "<Basefont Color=#FFFFFF>Purchase Ticket</Basefont>", false, false);
|
||||
if (PowerBall.Instance != null && PowerBall.Instance.CanBuyTickets)
|
||||
AddButton(70, 65, 0xFBD, 0xFBF, 1, GumpButtonType.Reply, 0);
|
||||
//else
|
||||
// AddImage(70, 65, 0xFB4);
|
||||
|
||||
AddButton(70, 95, 0xFBD, 0xFBF, 0, GumpButtonType.Page, 2);
|
||||
AddHtml(105, 95, 200, 16, "<Basefont Color=#FFFFFF>Archived Picks</Basefont>", false, false);
|
||||
|
||||
AddButton(70, 125, 0xFBD, 0xFBF, 0, GumpButtonType.Page, 3);
|
||||
AddHtml(105, 125, 200, 16, "<Basefont Color=#FFFFFF>Jackpot Winners</Basefont>", false, false);
|
||||
|
||||
AddHtml(105, 155, 200, 16, "<Basefont Color=#FFFFFF>Current Game Info</Basefont>", false, false);
|
||||
if (m_PowerBall.IsActive)
|
||||
AddButton(70, 155, 0xFBD, 0xFBF, 0, GumpButtonType.Page, 4);
|
||||
//else
|
||||
// AddImage(70, 155, 0xFB4);
|
||||
|
||||
AddPage(2); //Archived Picks
|
||||
|
||||
AddLabel(70, 20, labelColor, "Game");
|
||||
AddLabel(150, 20, labelColor, "Last 10 Picks");
|
||||
AddLabel(275, 20, labelColor, "Total Payout");
|
||||
|
||||
int count = 0;
|
||||
for (int i = PowerBallStats.PicksStats.Count - 1; i >= 0; --i)
|
||||
{
|
||||
PowerBallStats stats = PowerBallStats.PicksStats[i];
|
||||
string payout = String.Format("{0:##,###,###}", stats.Payout);
|
||||
|
||||
AddHtml(70, 50 + (count * 25), 50, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", stats.GameNumber.ToString()), false, false);
|
||||
AddHtml(305, 50 + (count * 25), 50, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", payout), false, false);
|
||||
|
||||
if (stats.Picks != null && stats.Picks.Count > 0)
|
||||
{
|
||||
for (int j = 0; j < stats.Picks.Count; ++j)
|
||||
{
|
||||
if (j + 1 < stats.Picks.Count)
|
||||
AddHtml(125 + (j * 25), 50 + (count * 25), 25, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", stats.Picks[j]), false, false);
|
||||
else
|
||||
AddHtml(250, 50 + (count * 25), 25, 16, String.Format("<Basefont Color=#FF0000>{0}</Basefont>", stats.Picks[j]), false, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (count++ >= 9)
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
AddButton(350, 300, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1);
|
||||
|
||||
AddPage(3); //Jackpot Winners
|
||||
|
||||
AddLabel(70, 20, labelColor, "Player");
|
||||
AddLabel(150, 20, labelColor, "Jackpot Amount");
|
||||
AddLabel(300, 20, labelColor, "Time");
|
||||
|
||||
count = 0;
|
||||
for (int i = PowerBallStats.JackpotStats.Count - 1; i >= 0; --i)
|
||||
{
|
||||
PowerBallStats stats = PowerBallStats.JackpotStats[i];
|
||||
Mobile mob = stats.JackpotWinner;
|
||||
string jackpotamount = String.Format("{0:##,###,### Gold}", stats.JackpotAmount);
|
||||
|
||||
AddHtml(70, 50 + (count * 25), 100, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", mob != null ? mob.Name : "Unanimous"), false, false);
|
||||
AddHtml(150, 50 + (count * 25), 100, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", jackpotamount), false, false);
|
||||
AddHtml(270, 50 + (count * 25), 100, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", stats.JackpotTime.ToString()), false, false);
|
||||
|
||||
if (count++ >= 9)
|
||||
break;
|
||||
}
|
||||
|
||||
AddButton(350, 300, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1);
|
||||
|
||||
AddPage(4); //Current Game info
|
||||
|
||||
List<Mobile> ticketList = new List<Mobile>();
|
||||
if (PowerBall.Instance != null)
|
||||
{
|
||||
foreach (PowerBallTicket ticket in PowerBall.Instance.Tickets)
|
||||
{
|
||||
if (!ticketList.Contains(ticket.Owner) && ticket.Owner != null)
|
||||
ticketList.Add(ticket.Owner);
|
||||
}
|
||||
}
|
||||
|
||||
AddLabel(70, 20, labelColor, "Current Game Information");
|
||||
|
||||
if (PowerBall.Instance != null || PowerBall.Instance.PowerBall != null && PowerBall.Instance.PowerBall.IsActive)
|
||||
{
|
||||
AddLabel(70, 80, labelColor, "Game Number:");
|
||||
AddHtml(200, 80, 300, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", gameNumber), false, false);
|
||||
|
||||
string jackpotamount = String.Format("{0:##,###,### Gold}", PowerBall.Instance.JackPot);
|
||||
AddLabel(70, 110, labelColor, "Jackpot Amount:");
|
||||
AddHtml(200, 110, 300, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", PowerBall.Instance.JackPot > 0 ? jackpotamount : "0 Gold"), false, false);
|
||||
|
||||
AddLabel(70, 140, labelColor, "Players:");
|
||||
AddHtml(200, 140, 300, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", ticketList.Count), false, false);
|
||||
|
||||
if (PowerBall.Instance != null)
|
||||
{
|
||||
int entryCount = 0;
|
||||
foreach (PowerBallTicket t in PowerBall.Instance.Tickets)
|
||||
foreach (TicketEntry e in t.Entries)
|
||||
entryCount++;
|
||||
|
||||
AddLabel(70, 170, labelColor, "Tickets:");
|
||||
AddHtml(200, 170, 300, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", entryCount.ToString()), false, false);
|
||||
|
||||
AddLabel(70, 200, labelColor, "Next Picks:");
|
||||
AddHtml(200, 200, 300, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", PowerBall.Instance.PowerBall.NextGame), false, false);
|
||||
}
|
||||
|
||||
if (ticketList != null && ticketList.Count > 0)
|
||||
{
|
||||
AddButton(70, 300, 0x483, 0x481, 0, GumpButtonType.Page, 5);
|
||||
AddHtml(110, 300, 200, 16, "<Basefont Color=#FFFFFF>Players</Basefont>", false, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
AddLabel(70, 80, labelColor, "Inactive");
|
||||
|
||||
AddButton(350, 300, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1);
|
||||
|
||||
AddPage(5);
|
||||
|
||||
AddLabel(70, 20, labelColor, "Players in Current Game");
|
||||
|
||||
for (int k = 0; k < ticketList.Count; ++k)
|
||||
{
|
||||
if (k < 12)
|
||||
AddHtml(70, 45 + (k * 25), 100, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", ticketList[k] != null ? ticketList[k].Name : "Unanimous"), false, false);
|
||||
else if (k < 24)
|
||||
AddHtml(180, 45 + ((k - 12) * 25), 100, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", ticketList[k] != null ? ticketList[k].Name : "Unanimous"), false, false);
|
||||
else if (k < 36)
|
||||
AddHtml(290, 45 + ((k - 24) * 25), 100, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", ticketList[k] != null ? ticketList[k].Name : "Unanimous"), false, false);
|
||||
|
||||
}
|
||||
|
||||
AddButton(290, 20, 0xFB1, 0xFB3, 0, GumpButtonType.Page, 1);
|
||||
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
default:
|
||||
case 0: break;
|
||||
case 1:
|
||||
{
|
||||
Container pack = m_From.Backpack;
|
||||
|
||||
if (PowerBall.Instance != null && PowerBall.Game != null && PowerBall.Instance.CanBuyTickets)
|
||||
{
|
||||
int cost = PowerBall.Game.TicketCost;
|
||||
if (pack != null && pack.GetAmount(typeof(Gold)) >= cost)
|
||||
{
|
||||
pack.ConsumeTotal(typeof(Gold), cost);
|
||||
m_From.SendMessage("You purchase a Powerball ticket with {0} gold from your backpack.", cost);
|
||||
pack.DropItem(new PowerBallTicket(m_From, m_PowerBall));
|
||||
|
||||
if (PowerBall.Instance != null)
|
||||
PowerBall.Instance.Profit += cost;
|
||||
}
|
||||
else if (Banker.Withdraw(m_From, cost, true))
|
||||
{
|
||||
var ticket = new PowerBallTicket(m_From, m_PowerBall);
|
||||
|
||||
if (!pack.TryDropItem(m_From, ticket, false))
|
||||
{
|
||||
m_From.SendMessage("There is no room in your pack, so the ticket was placed in your bank box!");
|
||||
m_From.BankBox.DropItem(ticket);
|
||||
}
|
||||
|
||||
if (PowerBall.Instance != null)
|
||||
PowerBall.Instance.Profit += cost;
|
||||
}
|
||||
else
|
||||
m_From.SendLocalizedMessage(500191); //Begging thy pardon, but thy bank account lacks these funds.
|
||||
}
|
||||
|
||||
m_From.SendGump(new PowerBallStatsGump(m_PowerBall, m_From));
|
||||
break;
|
||||
}
|
||||
case 2: //Reset all stats
|
||||
{
|
||||
if (m_From.AccessLevel == AccessLevel.Player)
|
||||
break;
|
||||
|
||||
for (int i = 0; i < PowerBallStats.PicksStats.Count; ++i)
|
||||
{
|
||||
PowerBallStats.PicksStats.Clear();
|
||||
}
|
||||
|
||||
for (int i = 0; i < PowerBallStats.JackpotStats.Count; ++i)
|
||||
{
|
||||
PowerBallStats.JackpotStats.Clear();
|
||||
}
|
||||
|
||||
if (PowerBall.Instance != null)
|
||||
{
|
||||
PowerBall.Game.InvalidateProperties();
|
||||
PowerBall.Game.UpdateSatellites();
|
||||
}
|
||||
|
||||
m_From.SendMessage("Stats erased!");
|
||||
m_From.SendGump(new PowerBallStatsGump(m_PowerBall, m_From));
|
||||
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
if (m_From.AccessLevel == AccessLevel.Player)
|
||||
break;
|
||||
|
||||
if (!m_PowerBall.DoJackpot)
|
||||
{
|
||||
m_PowerBall.DoJackpot = true;
|
||||
m_From.SendGump(new PowerBallStatsGump(m_PowerBall, m_From));
|
||||
m_From.SendMessage("Next picks will result in a jackpot!");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
if (m_From.AccessLevel == AccessLevel.Player)
|
||||
break;
|
||||
|
||||
if (m_PowerBall.IsActive)
|
||||
{
|
||||
m_PowerBall.IsActive = false;
|
||||
m_From.SendMessage("Powerball set to inactive.");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_PowerBall.IsActive = true;
|
||||
m_From.SendMessage("Powerball set to active.");
|
||||
}
|
||||
m_From.SendGump(new PowerBallStatsGump(m_PowerBall, m_From));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private long GetOdds()
|
||||
{
|
||||
if (PowerBall.Game == null)
|
||||
return 1;
|
||||
|
||||
int white = PowerBall.Game.MaxWhiteBalls;
|
||||
int red = PowerBall.Game.MaxRedBalls;
|
||||
|
||||
long amount1 = GetFact(white);
|
||||
long amount2 = GetFact(5);
|
||||
long amount3 = GetFact(white - 5);
|
||||
|
||||
try
|
||||
{
|
||||
return (amount1 / (amount2 * amount3)) * red;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
private long GetFact(int balls)
|
||||
{
|
||||
long value = balls;
|
||||
|
||||
for (int i = balls; i > 1; --i)
|
||||
value *= (i - 1);
|
||||
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
+278
@@ -0,0 +1,278 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
using Server.Misc;
|
||||
using Server.Engines.LotterySystem;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class PowerballTicketGump : Gump
|
||||
{
|
||||
private const int labelColor = 88;
|
||||
private const int maxEntries = 10;
|
||||
|
||||
private PowerBallTicket m_Ticket;
|
||||
private Mobile m_From;
|
||||
|
||||
public PowerballTicketGump(PowerBallTicket ticket, Mobile from) : this(ticket, from, true)
|
||||
{
|
||||
}
|
||||
|
||||
public PowerballTicketGump(PowerBallTicket ticket, Mobile from, bool powerBall)
|
||||
: base(50, 50)
|
||||
{
|
||||
m_Ticket = ticket;
|
||||
m_From = from;
|
||||
|
||||
if (ticket.Owner == null)
|
||||
ticket.Owner = from;
|
||||
|
||||
int gameNumber = 0;
|
||||
|
||||
if (PowerBall.Game != null)
|
||||
gameNumber = PowerBall.Game.GameNumber;
|
||||
|
||||
int entries = ticket.Entries.Count;
|
||||
int yoffSet = 25;
|
||||
string title = String.Format("<BASEFONT SIZE=8 COLOR=#FF0000><Center>Powerball</Center></BASEFONT>");
|
||||
|
||||
AddBackground(50, 0, 300, 200 + (yoffSet * entries), 9270);
|
||||
AddHtml(65, 170 + (yoffSet * entries), 350, 20, String.Format("<Basefont Size=2>Lotto Association of {0}, All Rights Reserved</Basefont>", ServerList.ServerName), false, false);
|
||||
|
||||
AddHtml(50, 20, 300, 30, title, false, false);
|
||||
AddLabel(65, 50, labelColor, String.Format("Picks: {0}", entries));
|
||||
AddLabel(65, 70, labelColor, String.Format("Game: {0}", m_Ticket.GameNumber));
|
||||
|
||||
if (ticket.GameNumber == gameNumber && entries < maxEntries)
|
||||
{
|
||||
AddHtml(180, 50, 80, 16, "<BASEFONT COLOR=#FFFFFF>Powerball</BASEFONT>", false, false);
|
||||
AddRadio(260, 50, 0x25F8, 0x25FB, powerBall, 0);
|
||||
AddHtml(180, 80, 80, 16, "<BASEFONT COLOR=#FFFFFF>No Powerball</BASEFONT>", false, false);
|
||||
AddRadio(260, 80, 0x25F8, 0x25FB, !powerBall, 1);
|
||||
|
||||
AddLabel(245, 120, labelColor, "Quick Picks");
|
||||
AddButton(321, 123, 0x837, 0x838, 2, GumpButtonType.Reply, 0); //Quick Pick
|
||||
}
|
||||
|
||||
if (entries > 0)
|
||||
{
|
||||
AddLabel(65, 120, labelColor, "Pick");
|
||||
|
||||
for (int i = 0; i < ticket.Entries.Count; ++i)
|
||||
{
|
||||
TicketEntry entry = ticket.Entries[i];
|
||||
int index = i + 1;
|
||||
|
||||
List<int> entryList = new List<int>();
|
||||
entryList.Add(entry.One);
|
||||
entryList.Add(entry.Two);
|
||||
entryList.Add(entry.Three);
|
||||
entryList.Add(entry.Four);
|
||||
entryList.Add(entry.Five);
|
||||
|
||||
AddLabel(75, 150 + (i * yoffSet), labelColor, String.Format("{0}", index.ToString()));
|
||||
AddHtml(270, 150 + (i * yoffSet), 50, 16, String.Format("<BASEFONT COLOR=#FF0000>{0}</BASEFONT>", entry.PowerBall > 0 ? entry.PowerBall.ToString() : "<B>-</B>"), false, false);
|
||||
AddHtml(310, 150 + (i * yoffSet), 50, 16, entry.Winner ? "<BASEFONT COLOR=#FFFFFF><b>*</b></BASEFONT>" : "", false, false);
|
||||
|
||||
for (int j = entryList.Count - 1; j >= 0; --j)
|
||||
{
|
||||
AddHtml(105 + (j * 30), 150 + (i * yoffSet), 50, 16, String.Format("<BASEFONT COLOR=#FFFFFF>{0}</BASEFONT>", entryList[j]), false, false);
|
||||
}
|
||||
|
||||
ColUtility.Free(entryList);
|
||||
}
|
||||
}
|
||||
|
||||
if (entries < maxEntries && ticket.GameNumber == gameNumber)
|
||||
{
|
||||
int yStart = 130 + (yoffSet * (entries));
|
||||
|
||||
AddButton(75, yStart + (yoffSet + 2), 0x837, 0x838, 1, GumpButtonType.Reply, 0);
|
||||
|
||||
AddTextEntry(100, yStart + yoffSet, 20, 16, labelColor, 1, "*");
|
||||
AddTextEntry(130, yStart + yoffSet, 20, 16, labelColor, 2, "*");
|
||||
AddTextEntry(160, yStart + yoffSet, 20, 16, labelColor, 3, "*");
|
||||
AddTextEntry(190, yStart + yoffSet, 20, 16, labelColor, 4, "*");
|
||||
AddTextEntry(220, yStart + yoffSet, 20, 16, labelColor, 5, "*");
|
||||
AddTextEntry(250, yStart + yoffSet, 20, 16, labelColor, 6, "*");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
bool powerball = info.IsSwitched(0);
|
||||
|
||||
if (PowerBall.Game == null || m_Ticket.GameNumber != PowerBall.Game.GameNumber)
|
||||
return;
|
||||
|
||||
int white = PowerBall.Game.MaxWhiteBalls;
|
||||
int red = PowerBall.Game.MaxRedBalls;
|
||||
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
default:
|
||||
case 0: m_From.CloseGump(typeof(PowerballTicketGump)); break;
|
||||
case 1:
|
||||
{
|
||||
int pick1 = 0; int pick2 = 0; int pick3 = 0;
|
||||
int pick4 = 0; int pick5 = 0; int pick6 = 0;
|
||||
|
||||
TextRelay s1 = info.GetTextEntry(1);
|
||||
TextRelay s2 = info.GetTextEntry(2);
|
||||
TextRelay s3 = info.GetTextEntry(3);
|
||||
TextRelay s4 = info.GetTextEntry(4);
|
||||
TextRelay s5 = info.GetTextEntry(5);
|
||||
TextRelay s6 = info.GetTextEntry(6);
|
||||
|
||||
try
|
||||
{
|
||||
pick1 = Convert.ToInt32(s1.Text);
|
||||
pick2 = Convert.ToInt32(s2.Text);
|
||||
pick3 = Convert.ToInt32(s3.Text);
|
||||
pick4 = Convert.ToInt32(s4.Text);
|
||||
pick5 = Convert.ToInt32(s5.Text);
|
||||
pick6 = Convert.ToInt32(s6.Text);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
if (PowerBall.Instance != null && PowerBall.Game != null)
|
||||
{
|
||||
|
||||
if (pick1 < 1 || pick2 < 1 || pick3 < 1 || pick4 < 1 || pick5 < 1)
|
||||
m_From.SendMessage(String.Format("You must choose a number from 1 to {0} on a non-powerball pick.", white.ToString()));
|
||||
else if (pick1 == pick2 || pick1 == pick3 || pick1 == pick4 || pick1 == pick5 || pick2 == pick3 || pick2 == pick4 || pick2 == pick5 || pick3 == pick4 || pick3 == pick5 || pick4 == pick5)
|
||||
m_From.SendMessage("You should think twice before picking the same number twice.");
|
||||
else if (pick1 > white || pick2 > white || pick3 > white || pick4 > white || pick5 > white)
|
||||
m_From.SendMessage(String.Format("White numbers cannot be any higher than {0}.", white.ToString()));
|
||||
else if (pick6 > red)
|
||||
m_From.SendMessage(String.Format("Red numbers cannot be any higher than {0}.", red.ToString()));
|
||||
else if (powerball)
|
||||
{
|
||||
if (pick6 < 1)
|
||||
m_From.SendMessage(String.Format("You must choose a number from 1 to {0} on your powerball pick.", red.ToString()));
|
||||
else
|
||||
{
|
||||
Container pack = m_From.Backpack;
|
||||
int price = PowerBall.Game.TicketEntryPrice + PowerBall.Game.PowerBallPrice;
|
||||
|
||||
if (pack != null && pack.GetAmount(typeof(Gold)) >= price)
|
||||
{
|
||||
pack.ConsumeTotal(typeof(Gold), price);
|
||||
m_From.SendMessage("You purchase a powerball ticket with {0} gold from your backpack.", price);
|
||||
new TicketEntry(m_Ticket, pick1, pick2, pick3, pick4, pick5, pick6, false);
|
||||
PowerBall.Instance.Profit += price;
|
||||
}
|
||||
else if (Banker.Withdraw(m_From, price, true))
|
||||
{
|
||||
new TicketEntry(m_Ticket, pick1, pick2, pick3, pick4, pick5, pick6, false);
|
||||
|
||||
PowerBall.Instance.Profit += price;
|
||||
}
|
||||
else
|
||||
m_From.SendLocalizedMessage(500191); //Begging thy pardon, but thy bank account lacks these funds.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Container pack = m_From.Backpack;
|
||||
int price = PowerBall.Game.TicketEntryPrice;
|
||||
|
||||
if (pack != null && pack.GetAmount(typeof(Gold)) >= price)
|
||||
{
|
||||
pack.ConsumeTotal(typeof(Gold), price);
|
||||
m_From.SendMessage("You purchase a powerball ticket with {0} gold from your backpack.", price);
|
||||
new TicketEntry(m_Ticket, pick1, pick2, pick3, pick4, pick5, false);
|
||||
PowerBall.Instance.Profit += price;
|
||||
}
|
||||
else if (Banker.Withdraw(m_From, price, true))
|
||||
{
|
||||
new TicketEntry(m_Ticket, pick1, pick2, pick3, pick4, pick5, false);
|
||||
|
||||
PowerBall.Instance.Profit += price;
|
||||
}
|
||||
else
|
||||
m_From.SendLocalizedMessage(500191); //Begging thy pardon, but thy bank account lacks these funds.
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
m_From.SendGump(new PowerballTicketGump(m_Ticket, m_From, powerball));
|
||||
break;
|
||||
}
|
||||
case 2: //Quickpick
|
||||
{
|
||||
Container pack = m_From.Backpack;
|
||||
int price;
|
||||
|
||||
if (powerball)
|
||||
price = PowerBall.Game.TicketEntryPrice + PowerBall.Game.PowerBallPrice;
|
||||
else
|
||||
price = PowerBall.Game.TicketEntryPrice;
|
||||
|
||||
if (pack != null && pack.GetAmount(typeof(Gold)) >= price)
|
||||
{
|
||||
m_From.SendMessage("You purchase a powerball ticket with {0} gold from your backpack.", price);
|
||||
pack.ConsumeTotal(typeof(Gold), price);
|
||||
}
|
||||
else if (!Banker.Withdraw(m_From, price, true))
|
||||
{
|
||||
m_From.SendLocalizedMessage(1060398, price.ToString()); //~1_AMOUNT~ gold has been withdrawn from your bank box.
|
||||
|
||||
m_From.SendLocalizedMessage(500191); //Begging thy pardon, but thy bank account lacks these funds.
|
||||
m_From.SendGump(new PowerballTicketGump(m_Ticket, m_From, powerball));
|
||||
break;
|
||||
}
|
||||
|
||||
int pick1 = 0; int pick2 = 0; int pick3 = 0;
|
||||
int pick4 = 0; int pick5 = 0; int pick6 = 0;
|
||||
|
||||
List<int> whiteList = new List<int>();
|
||||
|
||||
for (int i = 1; i < white + 1; ++i)
|
||||
whiteList.Add(i);
|
||||
|
||||
int count = 0;
|
||||
while (++count < 6)
|
||||
{
|
||||
int ran = Utility.Random(whiteList.Count);
|
||||
|
||||
if (count == 1)
|
||||
pick1 = whiteList[ran];
|
||||
else if (count == 2)
|
||||
pick2 = whiteList[ran];
|
||||
else if (count == 3)
|
||||
pick3 = whiteList[ran];
|
||||
else if (count == 4)
|
||||
pick4 = whiteList[ran];
|
||||
else
|
||||
pick5 = whiteList[ran];
|
||||
|
||||
whiteList.Remove(whiteList[ran]);
|
||||
|
||||
pick6 = Utility.RandomMinMax(1, red);
|
||||
}
|
||||
|
||||
if (powerball)
|
||||
{
|
||||
new TicketEntry(m_Ticket, pick1, pick2, pick3, pick4, pick5, pick6, false);
|
||||
PowerBall.Instance.Profit += price;
|
||||
}
|
||||
else
|
||||
{
|
||||
new TicketEntry(m_Ticket, pick1, pick2, pick3, pick4, pick5, false);
|
||||
PowerBall.Instance.Profit += price;
|
||||
}
|
||||
m_From.SendGump(new PowerballTicketGump(m_Ticket, m_From, powerball));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,458 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
using Server.Gumps;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.LotterySystem
|
||||
{
|
||||
public class PowerBall : Item
|
||||
{
|
||||
public static PowerBall PowerBallInstance { get; set; }
|
||||
|
||||
#region Getters/Setters
|
||||
|
||||
private int m_TimeOfDay; //Time Powerball numbers are Picked in military time
|
||||
private int m_TicketCost; //Price per empty ticket
|
||||
private int m_TicketEntryPrice; //Price per entry, ie picks - 10 Max per ticket
|
||||
private int m_PowerBallPrice; //Price per powerball pick
|
||||
private int m_MaxWhiteBalls; //Determines amount of white balls rolled per game
|
||||
private int m_MaxRedBalls; //Determines amount of Powerballs rolled per game
|
||||
private bool m_GuaranteedJackpot; //Chance to pick a jackpot - minimum 5 games without a winner, chances increasing each jackpotless game
|
||||
private int m_GameNumber; //Current Game Number
|
||||
private bool m_HasProcessed; //Has current game been processed?
|
||||
|
||||
private TimeSpan m_GameDelay; //Time inbetween Picks
|
||||
private TimeSpan m_DeadLine; //Deadline before Picks you can purchase a ticket
|
||||
|
||||
private static List<PowerBallSatellite> m_SatList = new List<PowerBallSatellite>();
|
||||
public static List<PowerBallSatellite> SatList { get { return m_SatList; } }
|
||||
|
||||
private static PowerBallGame m_Instance; //Convenience accessor for current game instance
|
||||
private static int m_GoldSink; //Profit - Payouts = Total goldsink
|
||||
private static PowerBall m_Game; //Easily Accessed instance of the powerball item
|
||||
private static bool m_Announcement;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int TimeOfDay { get { return m_TimeOfDay; } set { m_TimeOfDay = value; m_NextGame = GetNextGameTime(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int TicketCost { get { return m_TicketCost; } set { m_TicketCost = value; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int TicketEntryPrice { get { return m_TicketEntryPrice; } set { m_TicketEntryPrice = value; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int PowerBallPrice { get { return m_PowerBallPrice; } set { m_PowerBallPrice = value; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int MaxWhiteBalls
|
||||
{
|
||||
get { return m_MaxWhiteBalls; }
|
||||
set { m_MaxWhiteBalls = value; }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int MaxRedBalls
|
||||
{
|
||||
get { return m_MaxRedBalls; }
|
||||
set { m_MaxRedBalls = value; }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool GuaranteedJackpot { get { return m_GuaranteedJackpot; } set { m_GuaranteedJackpot = value; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public TimeSpan GameDelay { get { return m_GameDelay; } set { m_GameDelay = value; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public TimeSpan DeadLine { get { return m_DeadLine; } set { m_DeadLine = value; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int NoWins { get { if (m_Instance != null) return m_Instance.NoWins; return 0; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int GameNumber { get { return m_GameNumber; } set { m_GameNumber = value; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool HasProcessed { get { return m_HasProcessed; } set { m_HasProcessed = value; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public static bool Announcement { get { return m_Announcement; } set { m_Announcement = value; } }
|
||||
|
||||
public static PowerBallGame Instance { get { return m_Instance; } set { m_Instance = value; } }
|
||||
//These 2 are backwards, but oh well!
|
||||
public static PowerBall Game { get { return m_Game; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public static int GoldSink { get { return m_GoldSink; } set { m_GoldSink = value; } }
|
||||
|
||||
private DateTime m_NextGame;
|
||||
private bool m_Active;
|
||||
private bool m_DoJackpot;
|
||||
private Timer m_Timer;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DateTime LastGame { get { return m_NextGame - GameDelay; } }
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DateTime NextGame { get { return m_NextGame; } set { m_NextGame = value; } }
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool DoJackpot { get { return m_DoJackpot; } set { m_DoJackpot = value; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsActive
|
||||
{
|
||||
get { return m_Active; }
|
||||
set
|
||||
{
|
||||
m_Active = value;
|
||||
|
||||
if (m_Active)
|
||||
{
|
||||
if (m_Instance == null)
|
||||
m_Instance = new PowerBallGame(this);
|
||||
|
||||
if (m_Timer != null)
|
||||
{
|
||||
m_Timer.Stop();
|
||||
m_Timer = null;
|
||||
}
|
||||
|
||||
m_NextGame = GetNextGameTime();
|
||||
m_Timer = new PowerBallTimer(this);
|
||||
m_Timer.Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_Timer != null)
|
||||
{
|
||||
m_Timer.Stop();
|
||||
m_Timer = null;
|
||||
}
|
||||
}
|
||||
UpdateSatellites();
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
[Constructable]
|
||||
public PowerBall()
|
||||
: base(0xED4)
|
||||
{
|
||||
if (PowerBallInstance != null)
|
||||
{
|
||||
Console.WriteLine("You can only have one shard PowerBall Item.");
|
||||
Delete();
|
||||
return;
|
||||
}
|
||||
|
||||
Hue = 592;
|
||||
Name = "Let's Play Powerball!";
|
||||
m_Game = this;
|
||||
m_Instance = new PowerBallGame(this);
|
||||
m_Timer = new PowerBallTimer(this);
|
||||
m_Timer.Start();
|
||||
m_Active = true;
|
||||
Movable = false;
|
||||
m_HasProcessed = false;
|
||||
|
||||
/*Modify below for custom values. See readme file for info*/
|
||||
|
||||
m_TicketCost = 100;
|
||||
m_TicketEntryPrice = 1000;
|
||||
m_PowerBallPrice = 500;
|
||||
m_MaxWhiteBalls = 20;
|
||||
m_MaxRedBalls = 8;
|
||||
m_GuaranteedJackpot = true;
|
||||
m_Announcement = true;
|
||||
m_GameNumber = 1;
|
||||
|
||||
m_GameDelay = TimeSpan.FromHours(24);
|
||||
m_DeadLine = TimeSpan.FromMinutes(30);
|
||||
|
||||
m_TimeOfDay = 18;
|
||||
m_NextGame = GetNextGameTime();
|
||||
|
||||
PowerBallInstance = this;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!m_Active && from.AccessLevel == AccessLevel.Player)
|
||||
from.SendMessage("Powerball is currenlty inactive at this time.");
|
||||
else if (from.InRange(Location, 3))
|
||||
{
|
||||
if (from.HasGump(typeof(PowerBallStatsGump)))
|
||||
from.CloseGump(typeof(PowerBallStatsGump));
|
||||
|
||||
from.SendGump(new PowerBallStatsGump(this, from));
|
||||
}
|
||||
else if (from.AccessLevel > AccessLevel.Player)
|
||||
from.SendGump(new PropertiesGump(from, this));
|
||||
else
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (!m_Active)
|
||||
list.Add(1060658, "Status\tOffline");
|
||||
else
|
||||
list.Add(1060658, "Status\tActive");
|
||||
|
||||
if (PowerBallStats.JackpotStats.Count > 0)
|
||||
{
|
||||
int index = PowerBallStats.JackpotStats.Count - 1; //Most Recent Jackpot!
|
||||
|
||||
string name = PowerBallStats.JackpotStats[index].JackpotWinner != null ? PowerBallStats.JackpotStats[index].JackpotWinner.Name : "unknown";
|
||||
list.Add(1060659, "Last Jackpot\t{0}", name);
|
||||
list.Add(1060660, "Date\t{0}", PowerBallStats.JackpotStats[index].JackpotTime);
|
||||
list.Add(1060661, "Amount\t{0}", PowerBallStats.JackpotStats[index].JackpotAmount);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public DateTime GetNextGameTime()
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
DateTime nDT;
|
||||
|
||||
if (now.Hour >= m_TimeOfDay && now.Second >= 0)
|
||||
{
|
||||
DateTime check = new DateTime(now.Year, now.Month, now.Day, m_TimeOfDay, 1, 0) + m_GameDelay;
|
||||
if (check < now)
|
||||
nDT = now + m_GameDelay;
|
||||
else
|
||||
nDT = check;
|
||||
}
|
||||
else
|
||||
nDT = new DateTime(now.Year, now.Month, now.Day, m_TimeOfDay, 0, 0);
|
||||
|
||||
return nDT;
|
||||
}
|
||||
|
||||
public void UpdateSatellites()
|
||||
{
|
||||
foreach (PowerBallSatellite sat in m_SatList)
|
||||
{
|
||||
if (sat != null && !sat.Deleted)
|
||||
sat.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if (m_Timer != null)
|
||||
m_Timer.Stop();
|
||||
|
||||
for (int i = 0; i < m_SatList.Count; ++i)
|
||||
{
|
||||
if (m_SatList[i] != null && !m_SatList[i].Deleted)
|
||||
m_SatList[i].Delete();
|
||||
}
|
||||
|
||||
base.OnAfterDelete();
|
||||
}
|
||||
|
||||
public PowerBall(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); //Version
|
||||
|
||||
writer.Write(m_TimeOfDay);
|
||||
writer.Write(m_TicketCost);
|
||||
writer.Write(m_TicketEntryPrice);
|
||||
writer.Write(m_PowerBallPrice);
|
||||
writer.Write(m_MaxWhiteBalls);
|
||||
writer.Write(m_MaxRedBalls);
|
||||
writer.Write(m_GuaranteedJackpot);
|
||||
writer.Write(m_GoldSink);
|
||||
writer.Write(m_NextGame);
|
||||
writer.Write(m_Active);
|
||||
writer.Write(m_GameNumber);
|
||||
writer.Write(m_GameDelay);
|
||||
writer.Write(m_DeadLine);
|
||||
writer.Write(m_Announcement);
|
||||
//writer.Write(m_HasProcessed);
|
||||
|
||||
if (m_Instance == null)
|
||||
m_Instance = new PowerBallGame(this);
|
||||
|
||||
writer.Write(m_Instance.Profit);
|
||||
writer.Write(m_Instance.NoWins);
|
||||
|
||||
writer.Write(PowerBallStats.JackpotStats.Count);
|
||||
for (int i = 0; i < PowerBallStats.JackpotStats.Count; ++i)
|
||||
{
|
||||
PowerBallStats.JackpotStats[i].Serialize(writer);
|
||||
}
|
||||
writer.Write(PowerBallStats.PicksStats.Count);
|
||||
for (int i = 0; i < PowerBallStats.PicksStats.Count; ++i)
|
||||
{
|
||||
PowerBallStats.PicksStats[i].Serialize(writer);
|
||||
}
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
m_Game = this;
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_TimeOfDay = reader.ReadInt();
|
||||
m_TicketCost = reader.ReadInt();
|
||||
m_TicketEntryPrice = reader.ReadInt();
|
||||
m_PowerBallPrice = reader.ReadInt();
|
||||
m_MaxWhiteBalls = reader.ReadInt();
|
||||
m_MaxRedBalls = reader.ReadInt();
|
||||
m_GuaranteedJackpot = reader.ReadBool();
|
||||
m_GoldSink = reader.ReadInt();
|
||||
m_NextGame = reader.ReadDateTime();
|
||||
m_Active = reader.ReadBool();
|
||||
m_GameNumber = reader.ReadInt();
|
||||
m_GameDelay = reader.ReadTimeSpan();
|
||||
m_DeadLine = reader.ReadTimeSpan();
|
||||
m_Announcement = reader.ReadBool();
|
||||
|
||||
if (version == 0)
|
||||
m_HasProcessed = reader.ReadBool();
|
||||
else
|
||||
m_HasProcessed = false;
|
||||
|
||||
if (m_Active)
|
||||
{
|
||||
m_Timer = new PowerBallTimer(this);
|
||||
m_Timer.Start();
|
||||
}
|
||||
|
||||
if (m_Instance == null)
|
||||
m_Instance = new PowerBallGame(this);
|
||||
|
||||
m_Instance.Profit = reader.ReadInt();
|
||||
m_Instance.NoWins = reader.ReadInt();
|
||||
|
||||
int jackpotCount = reader.ReadInt();
|
||||
for (int i = 0; i < jackpotCount; i++)
|
||||
{
|
||||
new PowerBallStats(reader);
|
||||
}
|
||||
int picksCount = reader.ReadInt();
|
||||
for (int i = 0; i < picksCount; i++)
|
||||
{
|
||||
new PowerBallStats(reader);
|
||||
}
|
||||
|
||||
PowerBallInstance = this;
|
||||
}
|
||||
|
||||
public static void AddToArchive(List<int> numbers, int payOut)
|
||||
{
|
||||
if (numbers == null || PowerBall.Game == null)
|
||||
return;
|
||||
|
||||
new PowerBallStats(numbers, PowerBall.Game.GameNumber, payOut);
|
||||
}
|
||||
|
||||
public static void AddToArchive(Mobile mob, int amount) //Jackpot entry
|
||||
{
|
||||
if (mob == null || PowerBall.Game == null)
|
||||
return;
|
||||
|
||||
new PowerBallStats(mob, amount, PowerBall.Game.GameNumber);
|
||||
PowerBall.Game.UpdateSatellites();
|
||||
}
|
||||
|
||||
public void AddToSatList(PowerBallSatellite satellite)
|
||||
{
|
||||
if (m_SatList != null && !m_SatList.Contains(satellite))
|
||||
m_SatList.Add(satellite);
|
||||
}
|
||||
|
||||
public void RemoveFromSatList(PowerBallSatellite satellite)
|
||||
{
|
||||
if (m_SatList != null && m_SatList.Contains(satellite))
|
||||
m_SatList.Remove(satellite);
|
||||
}
|
||||
|
||||
public void NewGame(bool hasjackpot)
|
||||
{
|
||||
if (hasjackpot || m_Instance == null)
|
||||
m_Instance = new PowerBallGame(this);
|
||||
else
|
||||
{
|
||||
int noWins = m_Instance.NoWins;
|
||||
int profit = m_Instance.Profit;
|
||||
|
||||
m_Instance = new PowerBallGame(this, noWins, profit); //No jackpot? Sure! carry over how many non-wins and total profit
|
||||
}
|
||||
|
||||
if (m_DoJackpot)
|
||||
m_DoJackpot = false;
|
||||
|
||||
m_GameNumber++;
|
||||
m_NextGame = GetNextGameTime();
|
||||
m_HasProcessed = false;
|
||||
}
|
||||
}
|
||||
|
||||
public class PowerBallTimer : Timer
|
||||
{
|
||||
|
||||
private PowerBall m_PowerBall;
|
||||
|
||||
public PowerBallTimer(PowerBall pb) : base (TimeSpan.Zero, TimeSpan.FromSeconds(5))
|
||||
{
|
||||
m_PowerBall = pb;
|
||||
Priority = TimerPriority.FiveSeconds;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (PowerBall.Instance == null || PowerBall.Game == null || m_PowerBall == null)
|
||||
{
|
||||
Stop();
|
||||
Console.WriteLine("There is a null error with Powerball.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_PowerBall.NextGame < DateTime.Now && !m_PowerBall.HasProcessed)
|
||||
{
|
||||
m_PowerBall.HasProcessed = true;
|
||||
PowerBall.Instance.ProcessGame();
|
||||
}
|
||||
else if (m_PowerBall.NextGame != DateTime.MinValue && m_PowerBall.NextGame + TimeSpan.FromSeconds(30) < DateTime.Now)
|
||||
{
|
||||
int dur = 1000;
|
||||
|
||||
foreach (PowerBallSatellite sat in PowerBall.SatList)
|
||||
{
|
||||
if (sat != null && !sat.Deleted)
|
||||
{
|
||||
Effects.SendLocationEffect(new Point3D(sat.X, sat.Y + 1, sat.Z + 3), sat.Map, 0x373A, dur, 0, 0);
|
||||
Effects.SendLocationEffect(new Point3D(sat.X + 1, sat.Y, sat.Z + 3), sat.Map, 0x373A, dur, 0, 0);
|
||||
Effects.SendLocationEffect(new Point3D(sat.X, sat.Y, sat.Z + 2), sat.Map, 0x373A, dur, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
Effects.SendLocationEffect(new Point3D(m_PowerBall.X, m_PowerBall.Y + 1, m_PowerBall.Z), m_PowerBall.Map, 0x373A, dur, 0, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m_PowerBall.X + 1, m_PowerBall.Y, m_PowerBall.Z), m_PowerBall.Map, 0x373A, dur, 0, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m_PowerBall.X, m_PowerBall.Y, m_PowerBall.Z - 1), m_PowerBall.Map, 0x373A, dur, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,469 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using System.Collections.Generic;
|
||||
|
||||
/* To give a reward for a jackpot, you can add it to GiveReward(Mobile m) method.
|
||||
* RewardChance is the chance that reward is given, on Jackpot. This reward, which
|
||||
* is NOT given by default, would be in addition to the normal jackpot.*/
|
||||
|
||||
namespace Server.Engines.LotterySystem
|
||||
{
|
||||
public class PowerBallGame
|
||||
{
|
||||
public static double RewardChance = 0.5;
|
||||
|
||||
private int m_Profit; //Total ticket/entry costs per string of games - resets to zero once a jackpot is won
|
||||
private int m_NoWins; //Increases each game there is not jackpot
|
||||
private int m_Payout; //Total payout on any winning tickets
|
||||
private bool m_Jackpot; //Did this game yeild a jackpot?
|
||||
private PowerBall m_PowerBall; //Instanced Powerball Item
|
||||
private List<PowerBallTicket> m_Tickets = new List<PowerBallTicket>(); //Tickets for current game
|
||||
private List<int> m_Picks; //Picked at the end of the game
|
||||
private int m_JackpotWinners; //Used for jackpot message
|
||||
|
||||
public int Profit { get { return m_Profit; } set { m_Profit = value; } }
|
||||
public int Payout { get { return m_Payout; } }
|
||||
public int JackPot { get { return m_Profit / 2; } }
|
||||
public int NoWins { get { return m_NoWins; } set { m_NoWins = value; } }
|
||||
public bool HasJackpot { get { return m_Jackpot; } }
|
||||
public PowerBall PowerBall { get { return m_PowerBall; } }
|
||||
public List<PowerBallTicket> Tickets { get { return m_Tickets; } }
|
||||
public List<int> Picks { get { return m_Picks; } }
|
||||
public bool CanBuyTickets { get { return m_PowerBall.NextGame - m_PowerBall.DeadLine > DateTime.Now && m_PowerBall.IsActive; } }
|
||||
public int JackpotWinners { get { return m_JackpotWinners; } }
|
||||
|
||||
public PowerBallGame(PowerBall item, int noWins, int profit)
|
||||
{
|
||||
m_PowerBall = item;
|
||||
|
||||
m_NoWins = noWins;
|
||||
m_Profit = profit;
|
||||
}
|
||||
|
||||
public PowerBallGame(PowerBall item)
|
||||
{
|
||||
m_PowerBall = item;
|
||||
|
||||
m_NoWins = 0;
|
||||
m_Profit = 0;
|
||||
}
|
||||
|
||||
public void ProcessGame()
|
||||
{
|
||||
m_Payout = 0;
|
||||
m_JackpotWinners = 0;
|
||||
|
||||
if (m_PowerBall == null)
|
||||
return;;
|
||||
|
||||
if (m_PowerBall.DoJackpot)
|
||||
m_Picks = ChooseJackpotPicks();
|
||||
|
||||
if (m_Picks == null)
|
||||
{
|
||||
m_Picks = new List<int>();
|
||||
|
||||
List<int> whiteList = new List<int>();
|
||||
int whiteCount = m_PowerBall.MaxWhiteBalls;
|
||||
|
||||
for (int i = 1; i < whiteCount + 1; ++i)
|
||||
whiteList.Add(i);
|
||||
|
||||
int count = 0;
|
||||
int pick = 0;
|
||||
int powerBall;
|
||||
|
||||
while (++count < 6)
|
||||
{
|
||||
pick = whiteList[Utility.Random(whiteList.Count)];
|
||||
m_Picks.Add(pick);
|
||||
whiteList.Remove(pick);
|
||||
}
|
||||
|
||||
powerBall = Utility.RandomMinMax(1, m_PowerBall.MaxRedBalls);
|
||||
m_Picks.Add(powerBall);
|
||||
}
|
||||
|
||||
if (m_PowerBall.GuaranteedJackpot && m_NoWins > 5 && Utility.Random(20) < m_NoWins)
|
||||
{
|
||||
List<int> list = ChooseJackpotPicks();
|
||||
|
||||
if (list != null)
|
||||
{
|
||||
m_Picks.Clear();
|
||||
m_Picks = list;
|
||||
}
|
||||
}
|
||||
|
||||
new InternalTimer(this);
|
||||
}
|
||||
|
||||
public void CheckForWinners()
|
||||
{
|
||||
|
||||
if (m_Picks == null || m_Tickets == null || m_Tickets.Count == 0)
|
||||
return;
|
||||
|
||||
List<TicketEntry> jackpotList = new List<TicketEntry>();
|
||||
Dictionary<TicketEntry, int> prizeTable = new Dictionary<TicketEntry, int>();
|
||||
|
||||
for(int i = 0; i < m_Tickets.Count; ++i)
|
||||
{
|
||||
PowerBallTicket ticket = m_Tickets[i];
|
||||
ticket.Checked = true;
|
||||
|
||||
foreach (TicketEntry entry in ticket.Entries)
|
||||
{
|
||||
int matches = 0;
|
||||
bool powerball = false;
|
||||
|
||||
for (int j = 0; j < m_Picks.Count; ++j)
|
||||
{
|
||||
if (j == m_Picks.Count - 1)
|
||||
{
|
||||
if (entry.PowerBall == m_Picks[j])
|
||||
powerball = true;
|
||||
}
|
||||
|
||||
else if (entry.One == m_Picks[j] || entry.Two == m_Picks[j] || entry.Three == m_Picks[j] || entry.Four == m_Picks[j] || entry.Five == m_Picks[j])
|
||||
matches++;
|
||||
}
|
||||
|
||||
if (matches == 5 && powerball)
|
||||
{
|
||||
jackpotList.Add(entry);
|
||||
entry.Winner = true;
|
||||
m_Jackpot = true;
|
||||
}
|
||||
|
||||
if (matches >= 3 && !entry.Winner && !prizeTable.ContainsKey(entry))
|
||||
{
|
||||
prizeTable.Add(entry, matches);
|
||||
entry.Winner = true;
|
||||
}
|
||||
|
||||
if (powerball && !m_Jackpot)
|
||||
{
|
||||
entry.Ticket.Payout += 500;
|
||||
m_Profit -= 500;
|
||||
m_Payout += 500;
|
||||
|
||||
entry.Winner = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DistributeAwards(jackpotList, prizeTable);
|
||||
}
|
||||
|
||||
private void DistributeAwards(List<TicketEntry> jackpot, Dictionary<TicketEntry, int> prize)
|
||||
{
|
||||
|
||||
int pot = m_Profit;
|
||||
|
||||
if (jackpot != null && jackpot.Count > 0)
|
||||
{
|
||||
foreach (TicketEntry entry in jackpot)
|
||||
{
|
||||
if (entry.Ticket != null && entry.Ticket.Owner != null)
|
||||
{
|
||||
int amount = JackPot / jackpot.Count;
|
||||
|
||||
m_Jackpot = true;
|
||||
entry.Ticket.Payout += amount;
|
||||
m_Payout += amount;
|
||||
m_Profit -= amount;
|
||||
PowerBall.AddToArchive(entry.Ticket.Owner, amount);
|
||||
m_JackpotWinners++;
|
||||
m_PowerBall.InvalidateProperties();
|
||||
|
||||
if (RewardChance > Utility.RandomDouble())
|
||||
{
|
||||
GiveReward(entry.Ticket.Owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (prize != null && prize.Count > 0)
|
||||
{
|
||||
int award = 0;
|
||||
int match3 = 0;
|
||||
int match4 = 0;
|
||||
int match5 = 0;
|
||||
|
||||
|
||||
foreach (KeyValuePair<TicketEntry, int> kvp in prize)
|
||||
{
|
||||
if (kvp.Value == 3)
|
||||
match3++;
|
||||
else if (kvp.Value == 4)
|
||||
match4++;
|
||||
else
|
||||
match5++;
|
||||
}
|
||||
|
||||
foreach (KeyValuePair<TicketEntry, int> kvp in prize)
|
||||
{
|
||||
TicketEntry entry = kvp.Key;
|
||||
int matches = kvp.Value;
|
||||
|
||||
if (matches == 3)
|
||||
award = (pot / 50) / match3; //2% of Pot
|
||||
else if (matches == 4)
|
||||
award = (pot / 20) / match4; //5% of Pot
|
||||
else
|
||||
award = (pot / 10) / match5; //10% of Pot
|
||||
|
||||
entry.Ticket.Payout += award;
|
||||
m_Payout += award;
|
||||
m_Profit -= award;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void GiveReward(Mobile m)
|
||||
{
|
||||
}
|
||||
|
||||
private List<int> ChooseJackpotPicks()
|
||||
{
|
||||
if (m_Tickets == null || m_Tickets.Count == 0)
|
||||
return null;
|
||||
|
||||
List<TicketEntry> entryList = new List<TicketEntry>();
|
||||
|
||||
foreach (PowerBallTicket ticket in m_Tickets)
|
||||
{
|
||||
if (ticket.Entries.Count > 0 && ticket.Owner != null)
|
||||
{
|
||||
foreach (TicketEntry entry in ticket.Entries)
|
||||
{
|
||||
if (entry.PowerBall > 0)
|
||||
entryList.Add(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int random = Utility.Random(entryList.Count);
|
||||
for (int j = 0; j < entryList.Count; ++j)
|
||||
{
|
||||
if (j == random)
|
||||
{
|
||||
TicketEntry entry = entryList[j];
|
||||
List<int> list = new List<int>();
|
||||
|
||||
list.Add(entry.One);
|
||||
list.Add(entry.Two);
|
||||
list.Add(entry.Three);
|
||||
list.Add(entry.Four);
|
||||
list.Add(entry.Five);
|
||||
list.Add(entry.PowerBall);
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void AddTicket(PowerBallTicket ticket)
|
||||
{
|
||||
if (!m_Tickets.Contains(ticket))
|
||||
m_Tickets.Add(ticket);
|
||||
}
|
||||
|
||||
public void RemoveTicket(PowerBallTicket ticket)
|
||||
{
|
||||
if (m_Tickets.Contains(ticket))
|
||||
m_Tickets.Remove(ticket);
|
||||
}
|
||||
|
||||
public class InternalTimer : Timer
|
||||
{
|
||||
private PowerBallGame m_Game;
|
||||
private int m_Ticks;
|
||||
private DateTime m_Start;
|
||||
|
||||
public InternalTimer(PowerBallGame game) : base (TimeSpan.Zero, TimeSpan.FromSeconds(1.0))
|
||||
{
|
||||
m_Game = game;
|
||||
m_Ticks = 0;
|
||||
m_Start = DateTime.Now;
|
||||
Start();
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (m_Game == null || m_Game.PowerBall == null || m_Game.Picks == null || m_Game.Picks.Count < 6)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_Start > DateTime.Now)
|
||||
return;
|
||||
|
||||
if (m_Ticks <= 5)
|
||||
{
|
||||
string text;
|
||||
int num = 0;
|
||||
try
|
||||
{
|
||||
num = m_Game.Picks[m_Ticks];
|
||||
}
|
||||
catch
|
||||
{
|
||||
this.Stop();
|
||||
Console.WriteLine("Error with PowerBallGame Timer");
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_Ticks == 0)
|
||||
text = "The first pick is... ";
|
||||
else if (m_Ticks < 5)
|
||||
text = "The next pick is... ";
|
||||
else
|
||||
text = "And the powerball is... ";
|
||||
|
||||
if (m_Game != null && m_Game.PowerBall != null)
|
||||
{
|
||||
m_Game.PowerBall.PublicOverheadMessage(0, m_Ticks < 5 ? 2041 : 0x21, false, text);
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(2), new TimerStateCallback(DoDelayMessage), new object[] { m_Game.PowerBall, num, m_Ticks });
|
||||
}
|
||||
|
||||
foreach (PowerBallSatellite sat in PowerBall.SatList)
|
||||
{
|
||||
sat.PublicOverheadMessage(0, m_Ticks < 5 ? 2041 : 0x21, false, text);
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(2), new TimerStateCallback(DoDelayMessage), new object[] { sat, num, m_Ticks });
|
||||
}
|
||||
|
||||
m_Ticks++;
|
||||
m_Start = DateTime.Now + TimeSpan.FromSeconds(8 + Utility.Random(10));
|
||||
}
|
||||
else //Time to tally picks and start up a new game!
|
||||
{
|
||||
m_Game.CheckForWinners();
|
||||
PowerBall.AddToArchive(m_Game.Picks, m_Game.Payout); //Adds pickslist to Archive for stats gump
|
||||
|
||||
if (!m_Game.HasJackpot) //Still no jackpot eh?
|
||||
{
|
||||
m_Game.NoWins++;
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(2), new TimerStateCallback(DoMessage), m_Game);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (PowerBall.Announcement)
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(2), new TimerStateCallback(DoJackpotMessage), m_Game.JackpotWinners);
|
||||
|
||||
PowerBall.GoldSink += PowerBall.Instance.Profit;
|
||||
}
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(10), new TimerStateCallback(DoWinnersMessage), m_Game);
|
||||
m_Game.PowerBall.NewGame(m_Game.HasJackpot);
|
||||
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
|
||||
public static void DoDelayMessage(object state)
|
||||
{
|
||||
object[] o = (object[])state;
|
||||
Item item = o[0] as Item;
|
||||
int num = (int)o[1];
|
||||
int tick = (int)o[2];
|
||||
|
||||
item.PublicOverheadMessage(0, tick < 5 ? 2041 : 0x21, false, num.ToString());
|
||||
}
|
||||
|
||||
#region Messages
|
||||
public static void DoMessage(object state)
|
||||
{
|
||||
if (state is PowerBallGame)
|
||||
{
|
||||
PowerBallGame powerball = (PowerBallGame)state;
|
||||
List<Mobile> mobList = new List<Mobile>();
|
||||
|
||||
if (powerball == null)
|
||||
return;
|
||||
|
||||
foreach (PowerBallTicket ticket in powerball.Tickets)
|
||||
{
|
||||
if (ticket.Owner != null && !mobList.Contains(ticket.Owner))
|
||||
mobList.Add(ticket.Owner);
|
||||
}
|
||||
|
||||
if (mobList.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < mobList.Count; ++i)
|
||||
{
|
||||
mobList[i].SendMessage("New Powerball numbers have been chosen so check your tickets!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void DoJackpotMessage(object state)
|
||||
{
|
||||
if (state is int && (int)state > 0)
|
||||
{
|
||||
int amount = (int)state;
|
||||
foreach (NetState netState in NetState.Instances)
|
||||
{
|
||||
Mobile m = netState.Mobile;
|
||||
if (m != null)
|
||||
{
|
||||
m.PlaySound(1460);
|
||||
m.SendMessage(33, "There {0} {1} winning jackpot {2} in powerball!", amount > 1 ? "are" : "is", amount, amount > 1 ? "tickets" : "ticket");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void DoWinnersMessage(object state)
|
||||
{
|
||||
if (state is PowerBallGame)
|
||||
{
|
||||
PowerBallGame powerball = (PowerBallGame)state;
|
||||
List<Mobile> winList = new List<Mobile>();
|
||||
|
||||
if (powerball == null)
|
||||
return;
|
||||
|
||||
foreach (PowerBallTicket ticket in powerball.Tickets)
|
||||
{
|
||||
if (ticket.Owner != null && ticket.Owner is PlayerMobile && ticket.Owner.NetState != null)
|
||||
{
|
||||
foreach (TicketEntry entry in ticket.Entries)
|
||||
{
|
||||
if (entry.Winner && !winList.Contains(ticket.Owner))
|
||||
winList.Add(ticket.Owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Mobile mob in winList)
|
||||
{
|
||||
int sound;
|
||||
if (mob.Female)
|
||||
{
|
||||
sound = Utility.RandomList(0x30C, 0x30F, 0x313, 0x31A, 0x31D, 0x32B, 0x330, 0x337);
|
||||
mob.PlaySound(sound);
|
||||
}
|
||||
else
|
||||
{
|
||||
sound = Utility.RandomList(0x41A, 0x41B, 0x41E, 0x422, 0x42A, 0x42D, 0x431, 0x429);
|
||||
mob.PlaySound(sound);
|
||||
}
|
||||
|
||||
mob.SendMessage("It looks like you have a winning ticket!");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
using Server.Gumps;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.LotterySystem
|
||||
{
|
||||
public class PowerBallSatellite : Item
|
||||
{
|
||||
private PowerBall m_PowerBall;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public PowerBall PowerBall { get { return m_PowerBall; } set { m_PowerBall = value; } }
|
||||
|
||||
[Constructable]
|
||||
public PowerBallSatellite() : base(0xED4)
|
||||
{
|
||||
Hue = 592;
|
||||
|
||||
Name = "Let's Play Powerball!";
|
||||
Movable = false;
|
||||
|
||||
if (PowerBall.PowerBallInstance != null)
|
||||
{
|
||||
m_PowerBall = PowerBall.PowerBallInstance;
|
||||
m_PowerBall.AddToSatList(this);
|
||||
}
|
||||
else Delete();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (m_PowerBall == null)
|
||||
base.OnDoubleClick(from);
|
||||
|
||||
else if (!m_PowerBall.IsActive && from.AccessLevel == AccessLevel.Player)
|
||||
from.SendMessage("Powerball is currenlty inactive at this time.");
|
||||
else if (from.InRange(Location, 3))
|
||||
{
|
||||
if (from.HasGump(typeof(PowerBallStatsGump)))
|
||||
from.CloseGump(typeof(PowerBallStatsGump));
|
||||
|
||||
from.SendGump(new PowerBallStatsGump(m_PowerBall, from));
|
||||
}
|
||||
else if (from.AccessLevel > AccessLevel.Player)
|
||||
from.SendGump(new PropertiesGump(from, m_PowerBall));
|
||||
else
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (m_PowerBall != null && !m_PowerBall.Deleted)
|
||||
{
|
||||
if (!m_PowerBall.IsActive)
|
||||
list.Add(1060658, "Status\tOffline");
|
||||
else
|
||||
list.Add(1060658, "Status\tActive");
|
||||
|
||||
if (PowerBallStats.JackpotStats.Count > 0)
|
||||
{
|
||||
int index = PowerBallStats.JackpotStats.Count - 1;
|
||||
|
||||
list.Add(1060659, "Last Jackpot\t{0}", PowerBallStats.JackpotStats[index].JackpotWinner.Name);
|
||||
list.Add(1060660, "Date\t{0}", PowerBallStats.JackpotStats[index].JackpotTime);
|
||||
list.Add(1060661, "Amount\t{0}", PowerBallStats.JackpotStats[index].JackpotAmount);
|
||||
}
|
||||
}
|
||||
else
|
||||
list.Add("Disabled");
|
||||
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if (m_PowerBall != null)
|
||||
m_PowerBall.RemoveFromSatList(this);
|
||||
|
||||
base.OnAfterDelete();
|
||||
}
|
||||
|
||||
public PowerBallSatellite(Serial serial) : base (serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); //Version
|
||||
writer.Write(m_PowerBall);
|
||||
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
m_PowerBall = reader.ReadItem() as PowerBall;
|
||||
|
||||
if (m_PowerBall != null)
|
||||
m_PowerBall.AddToSatList(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.LotterySystem
|
||||
{
|
||||
public class PowerBallStats
|
||||
{
|
||||
public static readonly int MaxStats = 10; //How many in the list to retain
|
||||
|
||||
private Mobile m_JackpotWinner;
|
||||
private int m_Payout;
|
||||
private int m_JackpotAmount;
|
||||
private int m_GameNumber;
|
||||
private DateTime m_JackpotTime;
|
||||
private List<int> m_Picks = new List<int>();
|
||||
private bool m_JackpotEntry;
|
||||
|
||||
public Mobile JackpotWinner { get { return m_JackpotWinner; } }
|
||||
public int Payout { get { return m_Payout; } }
|
||||
public int JackpotAmount { get { return m_JackpotAmount; } }
|
||||
public int GameNumber { get { return m_GameNumber; } }
|
||||
public DateTime JackpotTime { get { return m_JackpotTime; } }
|
||||
public List<int> Picks { get { return m_Picks; } }
|
||||
public bool IsJackpotEntry { get { return m_JackpotEntry; } }
|
||||
|
||||
private static List<PowerBallStats> m_PicksStats = new List<PowerBallStats>();
|
||||
public static List<PowerBallStats> PicksStats { get { return m_PicksStats; } }
|
||||
|
||||
private static List<PowerBallStats> m_JackpotStats = new List<PowerBallStats>();
|
||||
public static List<PowerBallStats> JackpotStats { get { return m_JackpotStats; } }
|
||||
|
||||
public PowerBallStats(Mobile winner, int amount, int gameNumber)
|
||||
{
|
||||
m_JackpotWinner = winner;
|
||||
m_JackpotAmount = amount;
|
||||
m_GameNumber = gameNumber;
|
||||
m_JackpotTime = DateTime.Now;
|
||||
m_JackpotEntry = true;
|
||||
|
||||
m_JackpotStats.Add(this);
|
||||
TrimList(m_JackpotStats); //Keeps the list at a minimum of 10
|
||||
|
||||
if (PowerBall.Game != null)
|
||||
PowerBall.Game.UpdateSatellites();
|
||||
}
|
||||
|
||||
public PowerBallStats(List<int> list, int gameNumber, int payOut)
|
||||
{
|
||||
m_Picks = list;
|
||||
m_GameNumber = gameNumber;
|
||||
m_JackpotEntry = false;
|
||||
m_Payout = payOut;
|
||||
|
||||
m_PicksStats.Add(this);
|
||||
TrimList(m_PicksStats); //Keeps the list at a minimum of 10
|
||||
}
|
||||
|
||||
public void TrimList(List<PowerBallStats> list)
|
||||
{
|
||||
if (list == null || list.Count <= MaxStats || PowerBall.Game == null)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < list.Count; ++i)
|
||||
{
|
||||
PowerBallStats stat = list[i];
|
||||
|
||||
if (stat.IsJackpotEntry && i < list.Count - MaxStats && m_JackpotStats.Contains(stat))
|
||||
m_JackpotStats.Remove(stat);
|
||||
else if (stat.GameNumber < PowerBall.Game.GameNumber - MaxStats && m_PicksStats.Contains(stat))
|
||||
m_PicksStats.Remove(stat);
|
||||
}
|
||||
}
|
||||
|
||||
public void Serialize(GenericWriter writer)
|
||||
{
|
||||
writer.Write((int)0); //version
|
||||
|
||||
writer.Write(m_JackpotEntry);
|
||||
writer.Write(m_GameNumber);
|
||||
|
||||
if (m_JackpotEntry)
|
||||
{
|
||||
writer.Write(m_JackpotWinner);
|
||||
writer.Write(m_JackpotAmount);
|
||||
writer.Write(m_JackpotTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.Write(m_Payout);
|
||||
writer.Write(m_Picks.Count);
|
||||
|
||||
for (int i = 0; i < m_Picks.Count; ++i)
|
||||
{
|
||||
writer.Write(m_Picks[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public PowerBallStats(GenericReader reader)
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_JackpotEntry = reader.ReadBool();
|
||||
m_GameNumber = reader.ReadInt();
|
||||
|
||||
if (m_JackpotEntry)
|
||||
{
|
||||
m_JackpotWinner = reader.ReadMobile();
|
||||
m_JackpotAmount = reader.ReadInt();
|
||||
m_JackpotTime = reader.ReadDateTime();
|
||||
|
||||
m_JackpotStats.Add(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Payout = reader.ReadInt();
|
||||
|
||||
int count = reader.ReadInt();
|
||||
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
int pick = reader.ReadInt();
|
||||
m_Picks.Add(pick);
|
||||
}
|
||||
|
||||
m_PicksStats.Add(this);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
using Server.Engines.LotterySystem;
|
||||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PowerBallTicket : BaseLottoTicket
|
||||
{
|
||||
private PowerBall m_PowerBall;
|
||||
private int m_Game;
|
||||
private List<TicketEntry> m_Entries = new List<TicketEntry>();
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int GameNumber { get { return m_Game; } }
|
||||
|
||||
public List<TicketEntry> Entries { get { return m_Entries; } }
|
||||
|
||||
[Constructable]
|
||||
public PowerBallTicket() : base(null, TicketType.Powerball, false)
|
||||
{
|
||||
Name = "a powerball ticket";
|
||||
LootType = LootType.Blessed;
|
||||
Hue = 2106;
|
||||
|
||||
if (PowerBall.Instance != null && PowerBall.Game != null)
|
||||
{
|
||||
m_PowerBall = PowerBall.Game;
|
||||
PowerBall.Instance.AddTicket(this);
|
||||
m_Game = m_PowerBall.GameNumber;
|
||||
}
|
||||
else
|
||||
m_Game = 0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public PowerBallTicket(Mobile owner, PowerBall powerball) : base (owner, TicketType.Powerball, false)
|
||||
{
|
||||
Name = "a powerball ticket";
|
||||
LootType = LootType.Blessed;
|
||||
Hue = 2106;
|
||||
|
||||
m_PowerBall = powerball;
|
||||
|
||||
if (m_PowerBall != null)
|
||||
m_Game = m_PowerBall.GameNumber;
|
||||
else
|
||||
m_Game = 0;
|
||||
|
||||
if (PowerBall.Instance != null)
|
||||
PowerBall.Instance.AddTicket(this);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Payout > 0 || m_PowerBall == null || m_Game != m_PowerBall.GameNumber )
|
||||
list.Add(1150487); //[Expired]
|
||||
else
|
||||
list.Add(3005117); //[Active]
|
||||
}
|
||||
|
||||
/*public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Owner == null)
|
||||
Owner = from;
|
||||
|
||||
if (!IsChildOf(from.Backpack))
|
||||
from.SendLocalizedMessage(1042001);
|
||||
|
||||
else if (from != Owner)
|
||||
from.SendMessage("Only the owner can view this ticket.");
|
||||
|
||||
else
|
||||
{
|
||||
if (from.HasGump(typeof(TicketGump)))
|
||||
from.CloseGump(typeof(TicketGump));
|
||||
|
||||
from.SendGump(new TicketGump(this, from));
|
||||
}
|
||||
|
||||
base.OnDoubleClick(from);
|
||||
}*/
|
||||
|
||||
public void AddEntry(TicketEntry entry)
|
||||
{
|
||||
if (!m_Entries.Contains(entry))
|
||||
m_Entries.Add(entry);
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if (PowerBall.Instance != null)
|
||||
PowerBall.Instance.RemoveTicket(this);
|
||||
|
||||
if (m_Entries.Count > 0)
|
||||
m_Entries.Clear();
|
||||
}
|
||||
|
||||
public PowerBallTicket(Serial serial) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int) 0); //Version
|
||||
|
||||
writer.Write(m_Game);
|
||||
writer.Write(m_Entries.Count);
|
||||
|
||||
for (int i = 0; i < m_Entries.Count; ++i)
|
||||
{
|
||||
TicketEntry entry = m_Entries[i];
|
||||
|
||||
writer.Write(entry.One);
|
||||
writer.Write(entry.Two);
|
||||
writer.Write(entry.Three);
|
||||
writer.Write(entry.Four);
|
||||
writer.Write(entry.Five);
|
||||
writer.Write(entry.PowerBall);
|
||||
writer.Write(entry.Winner);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Game = reader.ReadInt();
|
||||
int count = reader.ReadInt();
|
||||
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
int one = reader.ReadInt();
|
||||
int two = reader.ReadInt();
|
||||
int three = reader.ReadInt();
|
||||
int four = reader.ReadInt();
|
||||
int five = reader.ReadInt();
|
||||
int six = reader.ReadInt();
|
||||
bool winner = reader.ReadBool();
|
||||
|
||||
new TicketEntry(this, one, two, three, four, five, six, winner);
|
||||
}
|
||||
|
||||
m_PowerBall = PowerBall.Game;
|
||||
|
||||
if (PowerBall.Instance != null && m_PowerBall != null && m_Game == m_PowerBall.GameNumber)
|
||||
PowerBall.Instance.AddTicket(this);
|
||||
}
|
||||
}
|
||||
|
||||
public class TicketEntry
|
||||
{
|
||||
private PowerBallTicket m_Ticket;
|
||||
private int m_One;
|
||||
private int m_Two;
|
||||
private int m_Three;
|
||||
private int m_Four;
|
||||
private int m_Five;
|
||||
private int m_PowerBall;
|
||||
private bool m_Winner;
|
||||
|
||||
public PowerBallTicket Ticket { get { return m_Ticket; } }
|
||||
public int One { get { return m_One; } }
|
||||
public int Two { get { return m_Two; } }
|
||||
public int Three { get { return m_Three; } }
|
||||
public int Four { get { return m_Four; } }
|
||||
public int Five{ get { return m_Five; } }
|
||||
public int PowerBall { get { return m_PowerBall; } }
|
||||
public bool Winner { get { return m_Winner; } set { m_Winner = value; } }
|
||||
|
||||
public TicketEntry (PowerBallTicket ticket, int one, int two, int three, int four, int five, bool winner) : this (ticket, one, two, three, four, five, 0, winner)
|
||||
{
|
||||
}
|
||||
|
||||
public TicketEntry(PowerBallTicket ticket, int one, int two, int three, int four, int five, int six, bool winner)
|
||||
{
|
||||
m_Ticket = ticket;
|
||||
|
||||
m_One = one;
|
||||
m_Two = two;
|
||||
m_Three = three;
|
||||
m_Four = four;
|
||||
m_Five = five;
|
||||
m_PowerBall = six;
|
||||
m_Winner = winner;
|
||||
|
||||
m_Ticket.AddEntry(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,206 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
using Server.Engines.LotterySystem;
|
||||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CrazedCrafting : BaseLottoTicket
|
||||
{
|
||||
private int[] m_WinAmounts = new int[] { 1000, 2500, 7500, 25000, 150000, 2 };
|
||||
private int[] m_WildCards = new int[] { 0x15AF, 0x15B3, 0x15B7, 0x15CB, 0x15CD };
|
||||
|
||||
public int[] WildCards { get { return m_WildCards; } }
|
||||
|
||||
public static readonly int TicketCost = 1000;
|
||||
|
||||
[Constructable]
|
||||
public CrazedCrafting() : this(null, false)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CrazedCrafting(Mobile owner, bool quickScratch) : base (owner, TicketType.CrazedCrafting, quickScratch)
|
||||
{
|
||||
Name = "a crazed crafting ticket";
|
||||
LootType = LootType.Blessed;
|
||||
Hue = 0x972;
|
||||
}
|
||||
|
||||
public override bool DoScratch(int scratch, Mobile from)
|
||||
{
|
||||
if (scratch > 3 || scratch < 0 || from == null)
|
||||
return false;
|
||||
|
||||
int pick;
|
||||
int pickAmount;
|
||||
|
||||
try
|
||||
{
|
||||
if (.08 > Utility.RandomDouble())
|
||||
pickAmount = m_WildCards[Utility.Random(m_WildCards.Length)];
|
||||
else
|
||||
{
|
||||
int[] odds = ReturnOdds(from);
|
||||
pick = odds[Utility.Random(odds.Length)];
|
||||
pickAmount = m_WinAmounts[pick];
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (scratch)
|
||||
{
|
||||
case 1: Scratch1 = pickAmount; break;
|
||||
case 2: Scratch2 = pickAmount; break;
|
||||
case 3: Scratch3 = pickAmount; break;
|
||||
default: return false;
|
||||
}
|
||||
|
||||
CheckScratches();
|
||||
return true;
|
||||
}
|
||||
|
||||
private int[] ReturnOdds(Mobile from)
|
||||
{
|
||||
if (CraftingSkill(from) > 120 || (CraftingSkill(from) > 100 && Utility.RandomBool()))
|
||||
return new int[] { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 5 };
|
||||
|
||||
return new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 5 };
|
||||
}
|
||||
|
||||
public override void CheckScratches()
|
||||
{
|
||||
/*Multipler = 3 same wildcards = 10x
|
||||
2 same wildcards = 2x*/
|
||||
|
||||
if (Scratch1 > 0 && Scratch2 > 0 && Scratch3 > 0)
|
||||
{
|
||||
Checked = true;
|
||||
|
||||
bool wild1 = false;
|
||||
bool wild2 = false;
|
||||
bool wild3 = false;
|
||||
|
||||
foreach(int num in m_WildCards)
|
||||
{
|
||||
if (Scratch1 == num)
|
||||
wild1 = true;
|
||||
if (Scratch2 == num)
|
||||
wild2 = true;
|
||||
if (Scratch3 == num)
|
||||
wild3 = true;
|
||||
}
|
||||
|
||||
if (Scratch1 == 2 || Scratch2 == 2 || Scratch3 == 2)
|
||||
FreeTicket = true;
|
||||
else if ((Scratch1 == Scratch2 && Scratch2 == Scratch3) || (wild1 && Scratch2 == Scratch3) || (wild2 && Scratch1 == Scratch3)
|
||||
|| (wild3 && Scratch1 == Scratch2) || (wild1 && wild2) || (wild2 && wild3) || (wild1 && wild3))
|
||||
{
|
||||
int payOut = 0;
|
||||
|
||||
if (!wild1)
|
||||
{
|
||||
payOut = Scratch1;
|
||||
if (wild2 && wild3 && Scratch2 == Scratch3)
|
||||
payOut *= 2;
|
||||
}
|
||||
else if (!wild2)
|
||||
{
|
||||
payOut = Scratch2;
|
||||
if (wild1 && wild3 && Scratch1 == Scratch3)
|
||||
payOut *= 2;
|
||||
}
|
||||
else if (!wild3)
|
||||
{
|
||||
payOut = Scratch3;
|
||||
if (wild1 && wild2 && Scratch1 == Scratch2)
|
||||
payOut *= 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
payOut = 150000;
|
||||
|
||||
if (Scratch1 == Scratch2 && Scratch2 == Scratch3)
|
||||
payOut *= 10;
|
||||
else if (Scratch1 == Scratch2 || Scratch2 == Scratch3 || Scratch1 == Scratch3)
|
||||
payOut *= 2;
|
||||
|
||||
}
|
||||
|
||||
Payout = payOut;
|
||||
DoWin(Payout);
|
||||
|
||||
if (ScratcherLotto.Stone != null)
|
||||
ScratcherLotto.Stone.GoldSink -= Payout;
|
||||
}
|
||||
}
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
|
||||
private void DoWin(int amount)
|
||||
{
|
||||
if (Owner != null)
|
||||
Owner.PlaySound(Owner.Female ? 0x337 : 0x449);
|
||||
|
||||
if (amount >= 100000) //Jackpot
|
||||
{
|
||||
new ScratcherStats(Owner, amount, this.Type);
|
||||
|
||||
if (ScratcherLotto.Stone != null)
|
||||
{
|
||||
ScratcherLotto.Stone.InvalidateProperties();
|
||||
ScratcherLotto.Stone.UpdateSatellites();
|
||||
}
|
||||
}
|
||||
|
||||
if (Owner != null)
|
||||
Owner.SendMessage(42, "It looks like you have a winning ticket!");
|
||||
}
|
||||
|
||||
private double CraftingSkill(Mobile from)
|
||||
{
|
||||
double topSkill = from.Skills[SkillName.Alchemy].Value;
|
||||
|
||||
if (from.Skills[SkillName.Fletching].Value > topSkill)
|
||||
topSkill = from.Skills[SkillName.Fletching].Value;
|
||||
if (from.Skills[SkillName.Blacksmith].Value > topSkill)
|
||||
topSkill = from.Skills[SkillName.Blacksmith].Value;
|
||||
if (from.Skills[SkillName.Tailoring].Value > topSkill)
|
||||
topSkill = from.Skills[SkillName.Tailoring].Value;
|
||||
if (from.Skills[SkillName.Inscribe].Value > topSkill)
|
||||
topSkill = from.Skills[SkillName.Inscribe].Value;
|
||||
if (from.Skills[SkillName.Carpentry].Value > topSkill)
|
||||
topSkill = from.Skills[SkillName.Carpentry].Value;
|
||||
if (from.Skills[SkillName.Tinkering].Value > topSkill)
|
||||
topSkill = from.Skills[SkillName.Tinkering].Value;
|
||||
|
||||
return topSkill;
|
||||
}
|
||||
|
||||
public CrazedCrafting(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,131 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
using Server.Engines.LotterySystem;
|
||||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GoldenTicket : BaseLottoTicket
|
||||
{
|
||||
private int[] m_WinAmounts = new int[] { 1000, 5000, 25000, 100000, 250000, 1000000, 2 };
|
||||
|
||||
public static readonly int TicketCost = 1000;
|
||||
|
||||
[Constructable]
|
||||
public GoldenTicket() :this(null, false)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public GoldenTicket(Mobile owner, bool quickScratch) : base (owner, TicketType.GoldenTicket, quickScratch)
|
||||
{
|
||||
Name = "a golden ticket";
|
||||
LootType = LootType.Blessed;
|
||||
Hue = 0x8A5;
|
||||
}
|
||||
|
||||
public override void CheckScratches()
|
||||
{
|
||||
if (Scratch1 > 0 && Scratch2 > 0 && Scratch3 > 0 && !Checked)
|
||||
{
|
||||
Checked = true;
|
||||
if (Scratch1 == 2 || Scratch2 == 2 || Scratch3 == 2)
|
||||
FreeTicket = true;
|
||||
else if (Scratch1 == Scratch2 && Scratch1 == Scratch3)
|
||||
{
|
||||
if (Scratch1 == 2)
|
||||
Payout = 250000;
|
||||
else
|
||||
Payout = Scratch1;
|
||||
|
||||
DoWin();
|
||||
|
||||
if (ScratcherLotto.Stone != null)
|
||||
ScratcherLotto.Stone.GoldSink -= Payout;
|
||||
}
|
||||
}
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
|
||||
public override bool DoScratch(int scratch, Mobile from)
|
||||
{
|
||||
if (scratch > 3 || scratch < 0 || from == null)
|
||||
return false;
|
||||
|
||||
int pick;
|
||||
int pickAmount;
|
||||
|
||||
try
|
||||
{
|
||||
int[] odds = ReturnOdds(from);
|
||||
pick = odds[Utility.Random(odds.Length)];
|
||||
pickAmount = m_WinAmounts[pick];
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (scratch)
|
||||
{
|
||||
case 1: Scratch1 = pickAmount; break;
|
||||
case 2: Scratch2 = pickAmount; break;
|
||||
case 3: Scratch3 = pickAmount; break;
|
||||
default: return false;
|
||||
}
|
||||
|
||||
CheckScratches();
|
||||
return true;
|
||||
}
|
||||
|
||||
private int[] ReturnOdds(Mobile from)
|
||||
{
|
||||
if (from != null && from.Luck >= 1800 || (from.Luck > 1200 && Utility.RandomBool()))
|
||||
return new int[] { 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 6 };
|
||||
|
||||
return new int[] { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 6 };
|
||||
}
|
||||
|
||||
private void DoWin()
|
||||
{
|
||||
if (Owner != null)
|
||||
Owner.PlaySound(Owner.Female ? 0x337 : 0x449);
|
||||
|
||||
if (Payout >= 100000)
|
||||
{
|
||||
new ScratcherStats(Owner, Payout, this.Type);
|
||||
|
||||
if (ScratcherLotto.Stone != null)
|
||||
{
|
||||
ScratcherLotto.Stone.InvalidateProperties();
|
||||
ScratcherLotto.Stone.UpdateSatellites();
|
||||
}
|
||||
}
|
||||
|
||||
if (Owner != null)
|
||||
Owner.SendMessage(42, "It looks like you have a winning ticket!");
|
||||
}
|
||||
|
||||
public GoldenTicket(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
+258
@@ -0,0 +1,258 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
using Server.Misc;
|
||||
using Server.Engines.LotterySystem;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class ScratcherGump : Gump
|
||||
{
|
||||
private const int labelColor = 88;
|
||||
|
||||
private BaseLottoTicket m_Ticket;
|
||||
private Mobile m_From;
|
||||
|
||||
public ScratcherGump(BaseLottoTicket ticket, Mobile from)
|
||||
: base(50, 50)
|
||||
{
|
||||
m_Ticket = ticket;
|
||||
m_From = from;
|
||||
int bg = GetBackGround();
|
||||
|
||||
AddBackground(50, 0, 400, 200, bg);
|
||||
|
||||
AddImage(125, 12, 0xFC4);
|
||||
AddImage(325, 12, 0xFC4);
|
||||
|
||||
AddHtml(50, 20, 400, 30, String.Format("<Center><BASEFONT SIZE=9>{0}</Center>", ScratcherLotto.GetGameType(m_Ticket.Type)), false, false);
|
||||
|
||||
if (m_Ticket.Checked && m_Ticket.Payout > 0)
|
||||
AddHtml(75, 150, 200, 20, String.Format("<Basefont Color=#FFFF00>Winnings: {0}</Basefont>", m_Ticket.Payout), false, false);
|
||||
|
||||
switch (m_Ticket.Type)
|
||||
{
|
||||
case TicketType.GoldenTicket: GoldTicket(); break;
|
||||
case TicketType.CrazedCrafting: CrazedCrafting(); break;
|
||||
case TicketType.SkiesTheLimit: SkiesTheLimit(); break;
|
||||
}
|
||||
|
||||
AddHtml(75, 170, 350, 20, String.Format("<Basefont Size=2>Lotto Association of {0}, All Rights Reserved</Basefont>", ServerList.ServerName), false, false);
|
||||
}
|
||||
|
||||
private void GoldTicket()
|
||||
{
|
||||
int yStart = 90;
|
||||
|
||||
if (m_Ticket.Scratch1 == 0)
|
||||
AddButton(80, yStart, 0x98B, 0x98B, 1, GumpButtonType.Reply, 0);
|
||||
else if (m_Ticket.Scratch1 == 2)
|
||||
AddHtml(60, yStart, 100, 60, String.Format("<Basefont Size=8 COLOR=#FFFF00><Center>Free</Center></Basefont>"), false, false);
|
||||
else
|
||||
{
|
||||
string num = String.Format("{0:##,###,###}", m_Ticket.Scratch1);
|
||||
AddHtml(60, yStart, 100, 60, String.Format("<Basefont Size=8 COLOR=#FFFF00><Center>{0}</Center></Basefont>", num), false, false);
|
||||
}
|
||||
|
||||
if (m_Ticket.Scratch2 == 0)
|
||||
AddButton(220, yStart, 0x98B, 0x98B, 2, GumpButtonType.Reply, 0);
|
||||
else if (m_Ticket.Scratch2 == 2)
|
||||
AddHtml(200, yStart, 100, 60, String.Format("<Basefont Size=8 COLOR=#FFFF00><Center>Free</Center></Basefont>"), false, false);
|
||||
else
|
||||
{
|
||||
string num = String.Format("{0:##,###,###}", m_Ticket.Scratch2);
|
||||
AddHtml(200, yStart, 100, 60, String.Format("<Basefont Size=8 COLOR=#FFFF00><Center>{0}</Center></Basefont>", num), false, false);
|
||||
}
|
||||
|
||||
if (m_Ticket.Scratch3 == 0)
|
||||
AddButton(360, yStart, 0x98B, 0x98B, 3, GumpButtonType.Reply, 0);
|
||||
else if (m_Ticket.Scratch3 == 2)
|
||||
AddHtml(340, yStart, 100, 60, String.Format("<Basefont Size=8 COLOR=#FFFF00><Center>Free</Center></Basefont>"), false, false);
|
||||
else
|
||||
{
|
||||
string num = String.Format("{0:##,###,###}", m_Ticket.Scratch3);
|
||||
AddHtml(340, yStart, 100, 60, String.Format("<Basefont Size=8 COLOR=#FFFF00><Center>{0}</Center></Basefont>", num), false, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void CrazedCrafting()
|
||||
{
|
||||
int yStart = 75;
|
||||
|
||||
AddImage(70, yStart - 10, 0x589);
|
||||
AddImage(210, yStart - 10, 0x589);
|
||||
AddImage(350, yStart - 10, 0x589);
|
||||
|
||||
CrazedCrafting ticket = null;
|
||||
|
||||
if (m_Ticket is CrazedCrafting)
|
||||
ticket = (CrazedCrafting)m_Ticket;
|
||||
|
||||
if (ticket != null)
|
||||
{
|
||||
if (m_Ticket.Scratch1 == 0)
|
||||
AddButton(79, yStart, 0x15C3, 0x15C4, 1, GumpButtonType.Reply, 0);
|
||||
else if (m_Ticket.Scratch1 == 2)
|
||||
AddHtml(71, yStart + 20, 80, 20, String.Format("<Basefont Size=6 Color=#FFFF00><Center>Free</Center></Basefont>"), false, false);
|
||||
else
|
||||
{
|
||||
bool wildCard = false;
|
||||
foreach (int num in ticket.WildCards)
|
||||
{
|
||||
if (m_Ticket.Scratch1 == num)
|
||||
{
|
||||
AddImage(80, yStart, num, 2);
|
||||
wildCard = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!wildCard)
|
||||
{
|
||||
string value = String.Format("{0:##,###,###}", ticket.Scratch1);
|
||||
AddHtml(71, yStart + 20, 80, 20, String.Format("<Basefont Size=6 Color=#FFFF00><Center>{0}</Center></Basefont>", value), false, false);
|
||||
AddImage(80, yStart, 0x15AA, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_Ticket.Scratch2 == 0)
|
||||
AddButton(219, yStart, 0x15C3, 0x15C4, 2, GumpButtonType.Reply, 0);
|
||||
else if (m_Ticket.Scratch2 == 2)
|
||||
AddHtml(211, yStart + 20, 80, 20, String.Format("<Basefont Size=6 Color=#FFFF00><Center>Free</Center></Basefont>"), false, false);
|
||||
else
|
||||
{
|
||||
bool wildCard = false;
|
||||
foreach (int num in ticket.WildCards)
|
||||
{
|
||||
if (m_Ticket.Scratch2 == num)
|
||||
{
|
||||
AddImage(220, yStart, num, 2);
|
||||
wildCard = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!wildCard)
|
||||
{
|
||||
string value = String.Format("{0:##,###,###}", ticket.Scratch2);
|
||||
AddHtml(211, yStart + 20, 80, 20, String.Format("<Basefont Size=6 Color=#FFFF00><Center>{0}</Center></Basefont>", value), false, false);
|
||||
AddImage(220, yStart, 0x15AA, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_Ticket.Scratch3 == 0)
|
||||
AddButton(359, yStart, 0x15C3, 0x15C4, 3, GumpButtonType.Reply, 0);
|
||||
else if (m_Ticket.Scratch3 == 2)
|
||||
AddHtml(351, yStart + 20, 80, 20, String.Format("<Basefont Size=6 Color=#FFFF00><Center>Free</Center></Basefont>"), false, false);
|
||||
else
|
||||
{
|
||||
bool wildCard = false;
|
||||
foreach (int num in ticket.WildCards)
|
||||
{
|
||||
if (m_Ticket.Scratch3 == num)
|
||||
{
|
||||
AddImage(360, yStart, num, 2);
|
||||
wildCard = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!wildCard)
|
||||
{
|
||||
string value = String.Format("{0:##,###,###}", ticket.Scratch3);
|
||||
AddHtml(351, yStart + 20, 80, 20, String.Format("<Basefont Size=6 Color=#FFFF00><Center>{0}</Center></Basefont>", value), false, false);
|
||||
AddImage(360, yStart, 0x15AA, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHtml(110, yStart, 80, 20, "<Basefont Size=6 Color=#FFFF00><Center>Void</Center></Basefont>", false, false);
|
||||
AddHtml(250, yStart, 80, 20, "<Basefont Size=6 Color=#FFFF00><Center>Void</Center></Basefont>", false, false);
|
||||
AddHtml(250, yStart, 80, 20, "<Basefont Size=6 Color=#FFFF00><Center>Void</Center></Basefont>", false, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void SkiesTheLimit()
|
||||
{
|
||||
int yStart = 90;
|
||||
|
||||
if (m_Ticket.Scratch1 == 0)
|
||||
AddButton(80, yStart, 0x98B, 0x98B, 1, GumpButtonType.Reply, 0);
|
||||
else if (m_Ticket.Scratch1 == 2)
|
||||
AddHtml(60, yStart, 100, 60, String.Format("<Basefont Size=8 COLOR=#0000FF><Center>Free</Center></Basefont>"), false, false);
|
||||
else if (m_Ticket.Scratch1 == 1)
|
||||
{
|
||||
AddImage(100, yStart - 5, 0x265A);
|
||||
AddItem(98, yStart, 0xEEF);
|
||||
AddItem(108, yStart, 0xEEF);
|
||||
}
|
||||
else
|
||||
{
|
||||
string value = String.Format("{0:##,###,###}", m_Ticket.Scratch1);
|
||||
AddHtml(60, yStart, 100, 60, String.Format("<Basefont Size=8 COLOR=#0000FF><Center>{0}</Center></Basefont>", value), false, false);
|
||||
}
|
||||
|
||||
if (m_Ticket.Scratch2 == 0)
|
||||
AddButton(220, yStart, 0x98B, 0x98B, 2, GumpButtonType.Reply, 0);
|
||||
else if (m_Ticket.Scratch2 == 2)
|
||||
AddHtml(200, yStart, 100, 60, String.Format("<Basefont Size=8 COLOR=#0000FF><Center>Free</Center></Basefont>"), false, false);
|
||||
else if (m_Ticket.Scratch2 == 1)
|
||||
{
|
||||
AddImage(240, yStart - 5, 0x265A);
|
||||
AddItem(238, yStart, 0xEEF);
|
||||
AddItem(248, yStart, 0xEEF);
|
||||
}
|
||||
else
|
||||
{
|
||||
string value = String.Format("{0:##,###,###}", m_Ticket.Scratch2);
|
||||
AddHtml(200, yStart, 100, 60, String.Format("<Basefont Size=8 COLOR=#0000FF><Center>{0}</Center></Basefont>", value), false, false);
|
||||
}
|
||||
|
||||
if (m_Ticket.Scratch3 == 0)
|
||||
AddButton(360, yStart, 0x98B, 0x98B, 3, GumpButtonType.Reply, 0);
|
||||
else if (m_Ticket.Scratch3 == 2)
|
||||
AddHtml(340, yStart, 100, 60, String.Format("<Basefont Size=8 COLOR=#0000FF><Center>Free</Center></Basefont>"), false, false);
|
||||
else if (m_Ticket.Scratch3 == 1)
|
||||
{
|
||||
AddImage(380, yStart - 5, 0x265A);
|
||||
AddItem(378, yStart, 0xEEF);
|
||||
AddItem(388, yStart, 0xEEF);
|
||||
}
|
||||
else
|
||||
{
|
||||
string value = String.Format("{0:##,###,###}", m_Ticket.Scratch3);
|
||||
AddHtml(340, yStart, 100, 60, String.Format("<Basefont Size=8 COLOR=#0000FF><Center>{0}</Center></Basefont>", value), false, false);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
int res = info.ButtonID;
|
||||
|
||||
if (res < 4 && res > 0)
|
||||
{
|
||||
if (!m_Ticket.DoScratch(res, m_From))
|
||||
m_From.SendMessage("Put some elbow greese in it next time!");
|
||||
|
||||
m_From.PlaySound(0x249);
|
||||
m_From.SendGump(new ScratcherGump(m_Ticket, m_From));
|
||||
}
|
||||
}
|
||||
|
||||
private int GetBackGround()
|
||||
{
|
||||
if (m_Ticket != null)
|
||||
{
|
||||
switch (m_Ticket.Type)
|
||||
{
|
||||
case TicketType.CrazedCrafting: return 0x2454;
|
||||
case TicketType.SkiesTheLimit: return 0x2486;
|
||||
case TicketType.GoldenTicket: return 0xDAC;
|
||||
}
|
||||
}
|
||||
|
||||
return 9270;
|
||||
}
|
||||
}
|
||||
}
|
||||
+416
@@ -0,0 +1,416 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
using Server.Misc;
|
||||
using Server.Network;
|
||||
using Server.Engines.LotterySystem;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class ScratcherStoneGump : Gump
|
||||
{
|
||||
private const int labelColor = 2106;
|
||||
private const int GMColor = 33;
|
||||
|
||||
private ScratcherLotto m_Stone;
|
||||
private Mobile m_From;
|
||||
|
||||
public ScratcherStoneGump(ScratcherLotto stone, Mobile from) : this( stone, from, true)
|
||||
{
|
||||
}
|
||||
|
||||
public ScratcherStoneGump(ScratcherLotto stone, Mobile from, bool quickScratch)
|
||||
: base(50, 50)
|
||||
{
|
||||
m_Stone = stone;
|
||||
m_From = from;
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(50, 0, 350, 350, 9250);
|
||||
|
||||
AddPage(1);
|
||||
|
||||
if (m_From.AccessLevel > AccessLevel.Player)
|
||||
{
|
||||
AddLabel(70, 265, GMColor, String.Format("Gold Sink: {0}", m_Stone.GoldSink));
|
||||
|
||||
if (ScratcherLotto.Stone != null)
|
||||
{
|
||||
AddLabel(230, 265, GMColor, "Next Stats Reset:");
|
||||
AddLabel(230, 295, GMColor, String.Format("{0}", ScratcherLotto.Stone.StatStart + ScratcherLotto.Stone.WipeStats));
|
||||
}
|
||||
|
||||
AddLabel(105, 295, GMColor, m_Stone.IsActive ? "Set Game Inactive" : "Set Active");
|
||||
AddButton(70, 295, 0xFBD, 0xFBF, 6, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtml(70, 20, 300, 16, String.Format("<Center>{0} Lottery Scratchers</Center>", ServerList.ServerName), false, false);
|
||||
|
||||
#region Quick/Normal Scratch Radio
|
||||
AddLabel(110, 40, labelColor, "Quick Scratch");
|
||||
AddLabel(110, 73, labelColor, "Normal Scratch");
|
||||
|
||||
AddRadio(70, 40, 0x25F8, 0x25FB, quickScratch, 0);
|
||||
AddRadio(70, 70, 0x25F8, 0x25FB, !quickScratch, 1);
|
||||
#endregion
|
||||
|
||||
#region Ticket Info
|
||||
AddLabel(60, 117, labelColor, "Buy Ticket");
|
||||
AddLabel(230, 117, labelColor, "Cost");
|
||||
AddLabel(350, 117, labelColor, "Stats");
|
||||
|
||||
AddLabel(110, 140, 0, "Golden Ticket");
|
||||
if (ScratcherLotto.Stone != null && ScratcherLotto.Stone.IsActive)
|
||||
{
|
||||
AddButton(70, 140, 0xFBD, 0xFBF, (int)TicketType.GoldenTicket, GumpButtonType.Reply, 0);
|
||||
AddLabel(230, 140, 0, GoldenTicket.TicketCost.ToString());
|
||||
AddButton(350, 140, 0xFA5, 0xFA7, 0, GumpButtonType.Page, (int)TicketType.GoldenTicket + 1);
|
||||
}
|
||||
else
|
||||
AddLabel(230, 140, GMColor, "Offline");
|
||||
|
||||
AddLabel(110, 170, 0, "Crazed Crafting");
|
||||
if (ScratcherLotto.Stone != null && ScratcherLotto.Stone.IsActive)
|
||||
{
|
||||
AddButton(70, 170, 0xFBD, 0xFBF, (int)TicketType.CrazedCrafting, GumpButtonType.Reply, 0);
|
||||
AddLabel(230, 170, 0, CrazedCrafting.TicketCost.ToString());
|
||||
AddButton(350, 170, 0xFA5, 0xFA7, 0, GumpButtonType.Page, (int)TicketType.CrazedCrafting + 1);
|
||||
}
|
||||
else
|
||||
AddLabel(230, 170, GMColor, "Offline");
|
||||
|
||||
AddLabel(110, 200, 0, "Skies the Limit");
|
||||
if (ScratcherLotto.Stone != null && ScratcherLotto.Stone.IsActive)
|
||||
{
|
||||
AddButton(70, 200, 0xFBD, 0xFBF, (int)TicketType.SkiesTheLimit, GumpButtonType.Reply, 0);
|
||||
AddLabel(230, 200, 0, SkiesTheLimit.TicketCost.ToString());
|
||||
AddButton(350, 200, 0xFA5, 0xFA7, 0, GumpButtonType.Page, (int)TicketType.SkiesTheLimit + 1);
|
||||
}
|
||||
else
|
||||
AddLabel(230, 200, GMColor, "Offline");
|
||||
|
||||
AddLabel(110, 230, 0, "Powerball");
|
||||
if (PowerBall.Instance != null && PowerBall.Game != null && !PowerBall.Game.Deleted && PowerBall.Instance.CanBuyTickets)
|
||||
{
|
||||
AddLabel(230, 230, 0, PowerBall.Game != null ? PowerBall.Game.TicketCost.ToString() : "");
|
||||
AddButton(70, 230, 0xFBD, 0xFBF, (int)TicketType.Powerball, GumpButtonType.Reply, 0);
|
||||
}
|
||||
else
|
||||
AddLabel(230, 230, GMColor, "Offline");
|
||||
|
||||
#endregion
|
||||
|
||||
AddPage(2); //Golden Ticket Stats
|
||||
|
||||
AddLabel(70, 20, labelColor, "Golden Ticket Top 10 Winners");
|
||||
|
||||
int index = 0;
|
||||
for(int i = ScratcherStats.Stats.Count - 1; i >= 0; --i)
|
||||
{
|
||||
if (ScratcherStats.Stats[i].Type == TicketType.GoldenTicket)
|
||||
{
|
||||
string num = String.Format("{0:##,###,###}", ScratcherStats.Stats[i].Payout);
|
||||
string name = "unknown player";
|
||||
|
||||
if (ScratcherStats.Stats[i].Winner != null)
|
||||
name = ScratcherStats.Stats[i].Winner.Name;
|
||||
|
||||
AddHtml(70, 50 + (index * 25), 100, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", name), false, false);
|
||||
AddHtml(150, 50 + (index * 25), 100, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", num), false, false);
|
||||
AddHtml(270, 50 + (index * 25), 100, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", ScratcherStats.Stats[i].WinTime), false, false);
|
||||
index++;
|
||||
}
|
||||
|
||||
if (index >= 9)
|
||||
break;
|
||||
}
|
||||
|
||||
AddButton(350, 300, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1);
|
||||
|
||||
AddPage(3); //Crazed Crafting Stats
|
||||
|
||||
|
||||
AddLabel(70, 20, labelColor, "Crazed Crafting Highest Winners");
|
||||
|
||||
index = 0;
|
||||
for (int i = ScratcherStats.Stats.Count - 1; i >= 0; --i)
|
||||
{
|
||||
if (ScratcherStats.Stats[i].Type == TicketType.CrazedCrafting)
|
||||
{
|
||||
string num = String.Format("{0:##,###,###}", ScratcherStats.Stats[i].Payout);
|
||||
string name = "unknown player";
|
||||
|
||||
if (ScratcherStats.Stats[i].Winner != null)
|
||||
name = ScratcherStats.Stats[i].Winner.Name;
|
||||
|
||||
AddHtml(70, 50 + (index * 25), 100, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", name), false, false);
|
||||
AddHtml(150, 50 + (index * 25), 100, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", num), false, false);
|
||||
AddHtml(270, 50 + (index * 25), 100, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", ScratcherStats.Stats[i].WinTime), false, false);
|
||||
index++;
|
||||
}
|
||||
|
||||
if (index >= 9)
|
||||
break;
|
||||
}
|
||||
|
||||
AddButton(350, 300, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1);
|
||||
|
||||
AddPage(4); //Skies the Limit Stats
|
||||
|
||||
AddLabel(70, 20, labelColor, "Skies the Limit");
|
||||
AddLabel(70, 300, labelColor, String.Format("Progressive Jackpot: {0}", m_Stone.SkiesProgressive));
|
||||
|
||||
index = 0;
|
||||
for (int i = ScratcherStats.Stats.Count - 1; i >= 0; --i)
|
||||
{
|
||||
if (ScratcherStats.Stats[i].Type == TicketType.SkiesTheLimit)
|
||||
{
|
||||
string num = String.Format("{0:##,###,###}", ScratcherStats.Stats[i].Payout);
|
||||
string name = "unknown player";
|
||||
|
||||
if (ScratcherStats.Stats[i].Winner != null)
|
||||
name = ScratcherStats.Stats[i].Winner.Name;
|
||||
|
||||
AddHtml(70, 50 + (index * 25), 100, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", name), false, false);
|
||||
AddHtml(150, 50 + (index * 25), 100, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", num), false, false);
|
||||
AddHtml(270, 50 + (index * 25), 100, 16, String.Format("<Basefont Color=#FFFFFF>{0}</Basefont>", ScratcherStats.Stats[i].WinTime), false, false);
|
||||
index++;
|
||||
}
|
||||
|
||||
if (index >= 9)
|
||||
break;
|
||||
}
|
||||
|
||||
AddButton(350, 300, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1);
|
||||
}
|
||||
|
||||
private BaseLottoTicket FindFreeTicket(Container pack, Type type)
|
||||
{
|
||||
if (pack == null)
|
||||
return null;
|
||||
|
||||
Item[] items = pack.FindItemsByType(typeof(BaseLottoTicket));
|
||||
|
||||
foreach (Item item in items)
|
||||
{
|
||||
if (item is BaseLottoTicket && item.GetType() == type && ((BaseLottoTicket)item).FreeTicket)
|
||||
return (BaseLottoTicket)item;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
if (m_From == null)
|
||||
return;
|
||||
|
||||
Container pack = m_From.Backpack;
|
||||
bool quickScratch = info.IsSwitched(0);
|
||||
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
default:
|
||||
case 0: break;
|
||||
case 1: //Golden Ticket
|
||||
{
|
||||
int cost = GoldenTicket.TicketCost;
|
||||
|
||||
if (ScratcherLotto.Stone != null && ScratcherLotto.Stone.IsActive)
|
||||
{
|
||||
BaseLottoTicket free = FindFreeTicket(pack, typeof(GoldenTicket));
|
||||
|
||||
if (free != null && free is GoldenTicket)
|
||||
{
|
||||
free.Delete();
|
||||
m_From.SendMessage("You purchase a lottery ticket with your free ticket.", cost);
|
||||
|
||||
DropItem(new GoldenTicket(m_From, quickScratch));
|
||||
}
|
||||
else if (pack != null && pack.GetAmount(typeof(Gold)) >= cost)
|
||||
{
|
||||
pack.ConsumeTotal(typeof(Gold), cost);
|
||||
m_From.SendMessage("You purchase a lottery ticket with {0} gold from your backpack.", cost);
|
||||
|
||||
DropItem(new GoldenTicket(m_From, quickScratch));
|
||||
|
||||
if (m_Stone != null)
|
||||
m_Stone.GoldSink += cost;
|
||||
}
|
||||
else if (Banker.Withdraw(m_From, cost, true))
|
||||
{
|
||||
m_From.SendMessage("You purchase a lottery ticket with {0} gold from your bankbox.", cost);
|
||||
|
||||
DropItem(new GoldenTicket(m_From, quickScratch));
|
||||
|
||||
if (m_Stone != null)
|
||||
m_Stone.GoldSink += cost;
|
||||
}
|
||||
else
|
||||
m_From.SendLocalizedMessage(500191); //Begging thy pardon, but thy bank account lacks these funds.
|
||||
}
|
||||
m_From.SendGump(new ScratcherStoneGump(m_Stone, m_From, quickScratch));
|
||||
break;
|
||||
}
|
||||
case 2: //Crazed Crafting
|
||||
{
|
||||
int cost = CrazedCrafting.TicketCost;
|
||||
|
||||
if (ScratcherLotto.Stone != null && ScratcherLotto.Stone.IsActive)
|
||||
{
|
||||
BaseLottoTicket free = FindFreeTicket(pack, typeof(CrazedCrafting));
|
||||
if (free != null && free is CrazedCrafting)
|
||||
{
|
||||
free.Delete();
|
||||
m_From.SendMessage("You purchase a lottery ticket with your free ticket.", cost);
|
||||
|
||||
DropItem(new CrazedCrafting(m_From, quickScratch));
|
||||
}
|
||||
else if (pack != null && pack.GetAmount(typeof(Gold)) >= cost)
|
||||
{
|
||||
pack.ConsumeTotal(typeof(Gold), cost);
|
||||
m_From.SendMessage("You purchase a lottery ticket with {0} gold from your backpack.", cost);
|
||||
|
||||
DropItem(new CrazedCrafting(m_From, quickScratch));
|
||||
|
||||
if (m_Stone != null)
|
||||
m_Stone.GoldSink += cost;
|
||||
}
|
||||
else if (Banker.Withdraw(m_From, cost, true))
|
||||
{
|
||||
m_From.SendMessage("You purchase a lottery ticket with {0} gold from your bankbox.", cost);
|
||||
|
||||
DropItem(new CrazedCrafting(m_From, quickScratch));
|
||||
|
||||
if (m_Stone != null)
|
||||
m_Stone.GoldSink += cost;
|
||||
}
|
||||
else
|
||||
m_From.SendLocalizedMessage(500191); //Begging thy pardon, but thy bank account lacks these funds.
|
||||
}
|
||||
m_From.SendGump(new ScratcherStoneGump(m_Stone, m_From, quickScratch));
|
||||
break;
|
||||
}
|
||||
case 3: //Skies the Limit
|
||||
{
|
||||
int cost = SkiesTheLimit.TicketCost;
|
||||
|
||||
if (ScratcherLotto.Stone != null && ScratcherLotto.Stone.IsActive)
|
||||
{
|
||||
BaseLottoTicket free = FindFreeTicket(pack, typeof(SkiesTheLimit));
|
||||
if (free != null && free is SkiesTheLimit)
|
||||
{
|
||||
free.Delete();
|
||||
m_From.SendMessage("You purchase a lottery ticket with your free ticket.", cost);
|
||||
|
||||
DropItem(new SkiesTheLimit(m_From, quickScratch));
|
||||
}
|
||||
else if (pack != null && pack.GetAmount(typeof(Gold)) >= cost)
|
||||
{
|
||||
pack.ConsumeTotal(typeof(Gold), cost);
|
||||
m_From.SendMessage("You purchase a lottery ticket with {0} gold from your backpack.", cost);
|
||||
|
||||
DropItem(new SkiesTheLimit(m_From, quickScratch));
|
||||
|
||||
if (m_Stone != null)
|
||||
m_Stone.GoldSink += cost;
|
||||
|
||||
m_Stone.SkiesProgressive += cost / 10;
|
||||
}
|
||||
else if (Banker.Withdraw(m_From, cost, true))
|
||||
{
|
||||
m_From.SendMessage("You purchase a lottery ticket with {0} gold from your bankbox.", cost);
|
||||
|
||||
DropItem(new SkiesTheLimit(m_From, quickScratch));
|
||||
|
||||
if (m_Stone != null)
|
||||
m_Stone.GoldSink += cost;
|
||||
|
||||
m_Stone.SkiesProgressive += cost / 10;
|
||||
}
|
||||
else
|
||||
m_From.SendLocalizedMessage(500191); //Begging thy pardon, but thy bank account lacks these funds.
|
||||
}
|
||||
m_From.SendGump(new ScratcherStoneGump(m_Stone, m_From, quickScratch));
|
||||
break;
|
||||
}
|
||||
case 4: //PowerBall Ticket
|
||||
{
|
||||
if (PowerBall.Instance != null && PowerBall.Game != null && !PowerBall.Game.Deleted && PowerBall.Instance.CanBuyTickets)
|
||||
{
|
||||
int cost = PowerBall.Game.TicketCost;
|
||||
|
||||
if (pack != null && pack.GetAmount(typeof(Gold)) >= cost)
|
||||
{
|
||||
pack.ConsumeTotal(typeof(Gold), cost);
|
||||
m_From.SendMessage("You purchase a Powerball ticket with {0} gold from your backpack.", cost);
|
||||
|
||||
DropItem(new PowerBallTicket(m_From, PowerBall.Game));
|
||||
|
||||
if (PowerBall.Instance != null)
|
||||
PowerBall.Instance.Profit += cost;
|
||||
}
|
||||
else if (Banker.Withdraw(m_From, cost, true))
|
||||
{
|
||||
m_From.SendMessage("You purchase a Powerball ticket with {0} gold from your bankbox.", cost);
|
||||
|
||||
DropItem(new PowerBallTicket(m_From, PowerBall.Game));
|
||||
|
||||
if (PowerBall.Instance != null)
|
||||
PowerBall.Instance.Profit += cost;
|
||||
}
|
||||
else
|
||||
m_From.SendLocalizedMessage(500191); //Begging thy pardon, but thy bank account lacks these funds.
|
||||
}
|
||||
|
||||
m_From.SendGump(new ScratcherStoneGump(m_Stone, m_From, quickScratch));
|
||||
break;
|
||||
}
|
||||
|
||||
case 5:
|
||||
{
|
||||
if (PowerBall.Game != null)
|
||||
m_From.SendGump(new PowerBallStatsGump(PowerBall.Game, m_From));
|
||||
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
if (m_From.AccessLevel == AccessLevel.Player)
|
||||
break;
|
||||
|
||||
if (m_Stone != null)
|
||||
{
|
||||
if (m_Stone.IsActive)
|
||||
{
|
||||
m_From.SendMessage("set to inactive.");
|
||||
m_Stone.IsActive = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_From.SendMessage("set to active.");
|
||||
m_Stone.IsActive = true;
|
||||
}
|
||||
}
|
||||
|
||||
m_From.SendGump(new ScratcherStoneGump(m_Stone, m_From, quickScratch));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DropItem(Item item)
|
||||
{
|
||||
Container pack = m_From.Backpack;
|
||||
|
||||
if (pack == null || !pack.TryDropItem(m_From, item, false))
|
||||
{
|
||||
m_From.SendMessage("Your pack is full, so the ticket has been placed in your bank box!");
|
||||
m_From.BankBox.DropItem(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
Lotto Scratchers
|
||||
|
||||
All scratchers derive from BaseLottoTicket class. You can adjust the odds in the ReturnOdds(...)
|
||||
function of each ticket type. Player luck effects Golden Ticket and Skies the Limit. Player
|
||||
Crafting skill (highest skill) effects Crazed Crafting. Luck/craft skill bumps do not increase
|
||||
the chace of a win, but increased the odds of a higher prize per scratch.
|
||||
|
||||
First, place LottoScratcher, this is the item that controls the stats, progressive jackpots, etc.
|
||||
You can then place LottoScratcherSatellite that acts as the LottoScratcher item, like the PowerBallSatellite.
|
||||
|
||||
ScratcherLotto.cs -
|
||||
DeleteTicketOnLoss defaulted to true. When true, and you purchase a ticket as a quick scratch,
|
||||
the ticket will auto delete if it's not a winner.
|
||||
|
||||
Golden Ticket
|
||||
- Traditional lotto scratch ticket
|
||||
- Prizes range from 1000 to 1,000,000
|
||||
- 1200+ luck and a 50% chance odds will go in favor of higher prize
|
||||
- 1800+ odds will go in favor of a higher price
|
||||
|
||||
Crazed Crafting
|
||||
- This has a lower standard payout, however, wild cards can increase the chances for a win
|
||||
- 2 of the same wild cards give a 2x reward multiplier
|
||||
- 3 of the same wild cards, which always will result in a jackpot, give a 10x multiplier
|
||||
- prizes range from 2,500 to 250,000, or 2,500,000 with a wildcard multiplier
|
||||
- 8% flat chance to get a wildcard
|
||||
|
||||
Skies the Limit
|
||||
- Progressive lotto scrather
|
||||
- Progressive gold amount is saved in the ScratherLotto item
|
||||
- Resets to 500,000 with a win
|
||||
- 3 Treasure chests win the progressive
|
||||
- Normal payout is from 1,000 to 500,000
|
||||
|
||||
Stats reset every 90 days
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.LotterySystem
|
||||
{
|
||||
public class ScratcherLotto : Item
|
||||
{
|
||||
private bool m_DeleteTicket; //Deletes ticket on quick scratch if it is a losing ticket
|
||||
private bool m_Active;
|
||||
private int m_GoldSink; //Eye candy for GM's!!!
|
||||
private int m_SkiesProgressive; //Progressive for Skies the Limit
|
||||
private DateTime m_StatStart;
|
||||
private TimeSpan m_WipeStats;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool DeleteTicketOnLoss { get { return m_DeleteTicket; } set { m_DeleteTicket = value; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsActive { get { return m_Active; } set { m_Active = value; InvalidateProperties(); UpdateSatellites(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int GoldSink { get { return m_GoldSink; } set { m_GoldSink = value; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int SkiesProgressive { get { return m_SkiesProgressive; } set { m_SkiesProgressive = value; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DateTime StatStart { get { return m_StatStart; } set { m_StatStart = value; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public TimeSpan WipeStats { get { return m_WipeStats; } set { m_WipeStats = value; } }
|
||||
|
||||
public bool CanWipe { get { return m_StatStart + m_WipeStats < DateTime.Now; } }
|
||||
|
||||
private static ScratcherLotto m_Stone; //Instanced Stone for easy access
|
||||
public static ScratcherLotto Stone{ get { return m_Stone; } set { m_Stone = value; } }
|
||||
|
||||
private static List<ScratcherLottoSatellite> m_SatList = new List<ScratcherLottoSatellite>();
|
||||
public static List<ScratcherLottoSatellite> SatList { get { return m_SatList; } }
|
||||
|
||||
[Constructable]
|
||||
public ScratcherLotto()
|
||||
: base(0xED4)
|
||||
{
|
||||
if (CheckForScratcherStone())
|
||||
{
|
||||
Console.WriteLine("You can only have one Lotto Scratcher Stone Item.");
|
||||
Delete();
|
||||
return;
|
||||
}
|
||||
|
||||
Name = "Lottery Scratch Tickets";
|
||||
Hue = Utility.RandomSlimeHue();
|
||||
Movable = false;
|
||||
m_Active = true;
|
||||
m_Stone = this;
|
||||
m_SkiesProgressive = 500000;
|
||||
m_DeleteTicket = true;
|
||||
m_WipeStats = TimeSpan.FromDays(90);
|
||||
m_StatStart = DateTime.Now;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!m_Active && from.AccessLevel == AccessLevel.Player)
|
||||
from.SendMessage("Scratch tickets are currenlty inactive at this time.");
|
||||
else if (from.InRange(Location, 3))
|
||||
{
|
||||
if (from.HasGump(typeof(ScratcherStoneGump)))
|
||||
from.CloseGump(typeof(ScratcherStoneGump));
|
||||
|
||||
from.SendGump(new ScratcherStoneGump(this, from));
|
||||
}
|
||||
else if (from.AccessLevel > AccessLevel.Player)
|
||||
from.SendGump( new PropertiesGump( from, this ) );
|
||||
else
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (!m_Active)
|
||||
list.Add(1060658, "Status\tOffline");
|
||||
else
|
||||
list.Add(1060658, "Status\tActive");
|
||||
|
||||
if (ScratcherStats.Stats.Count > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
int index = ScratcherStats.Stats.Count - 1;
|
||||
string jackpotAmount = String.Format("{0:##,###,###}", ScratcherStats.Stats[index].Payout);
|
||||
|
||||
list.Add(1060659, "Last Big Win\t{0}", ScratcherStats.Stats[index].Winner.Name);
|
||||
list.Add(1060660, "Date\t{0}", ScratcherStats.Stats[index].WinTime);
|
||||
list.Add(1060661, "Amount\t{0}", jackpotAmount);
|
||||
list.Add(1060662, "Game\t{0}", GetGameType(ScratcherStats.Stats[index].Type));
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static string GetGameType(TicketType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
default: return "";
|
||||
case TicketType.GoldenTicket: return "Golden Ticket";
|
||||
case TicketType.CrazedCrafting: return "Crazed Crafting";
|
||||
case TicketType.SkiesTheLimit: return "Skies the Limit";
|
||||
case TicketType.Powerball: return "Powerball";
|
||||
}
|
||||
}
|
||||
|
||||
public static void DoProgressiveMessage(Mobile winner, int amount)
|
||||
{
|
||||
string name = "Somebody";
|
||||
|
||||
if (winner != null)
|
||||
name = winner.Name;
|
||||
|
||||
foreach (NetState netState in NetState.Instances)
|
||||
{
|
||||
Mobile m = netState.Mobile;
|
||||
if (m != null)
|
||||
{
|
||||
m.PlaySound(1460);
|
||||
m.SendMessage(33, "{0} has won {1} gold in the Skies the Limit Progressive Scratcher!", name, amount.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DoWipe()
|
||||
{
|
||||
if (ScratcherStats.Stats != null)
|
||||
ScratcherStats.Stats.Clear();
|
||||
|
||||
UpdateSatellites();
|
||||
InvalidateProperties();
|
||||
m_StatStart = DateTime.Now;
|
||||
}
|
||||
|
||||
public void UpdateSatellites()
|
||||
{
|
||||
foreach (ScratcherLottoSatellite sat in m_SatList)
|
||||
{
|
||||
if (sat != null && !sat.Deleted)
|
||||
sat.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public ScratcherLotto(Serial serial) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)2); //Version
|
||||
|
||||
writer.Write(m_WipeStats);
|
||||
writer.Write(m_StatStart);
|
||||
writer.Write(m_DeleteTicket);
|
||||
|
||||
writer.Write(m_Active);
|
||||
writer.Write(m_GoldSink);
|
||||
writer.Write(m_SkiesProgressive);
|
||||
|
||||
writer.Write(ScratcherStats.Stats.Count);
|
||||
for (int i = 0; i < ScratcherStats.Stats.Count; ++i)
|
||||
{
|
||||
ScratcherStats.Stats[i].Serialize(writer);
|
||||
}
|
||||
|
||||
if (CanWipe)
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(5), new TimerCallback(DoWipe));
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 2:
|
||||
{
|
||||
m_WipeStats = reader.ReadTimeSpan();
|
||||
m_StatStart = reader.ReadDateTime();
|
||||
goto case 1;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
m_DeleteTicket = reader.ReadBool();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_Active = reader.ReadBool();
|
||||
m_GoldSink = reader.ReadInt();
|
||||
m_SkiesProgressive = reader.ReadInt();
|
||||
|
||||
int statsCount = reader.ReadInt();
|
||||
for (int i = 0; i < statsCount; i++)
|
||||
{
|
||||
new ScratcherStats(reader);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_Stone = this;
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
for (int i = 0; i < m_SatList.Count; ++i)
|
||||
{
|
||||
if (m_SatList[i] != null && !m_SatList[i].Deleted)
|
||||
m_SatList[i].Delete();
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckForScratcherStone()
|
||||
{
|
||||
foreach (Item item in World.Items.Values)
|
||||
{
|
||||
if (item is ScratcherLotto && !item.Deleted && item != this)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void AddToSatList(ScratcherLottoSatellite satellite)
|
||||
{
|
||||
if (m_SatList != null && !m_SatList.Contains(satellite))
|
||||
m_SatList.Add(satellite);
|
||||
}
|
||||
|
||||
public void RemoveFromSatList(ScratcherLottoSatellite satellite)
|
||||
{
|
||||
if (m_SatList != null && m_SatList.Contains(satellite))
|
||||
m_SatList.Remove(satellite);
|
||||
}
|
||||
}
|
||||
}
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.LotterySystem
|
||||
{
|
||||
public class ScratcherLottoSatellite : Item
|
||||
{
|
||||
private ScratcherLotto m_Stone;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ScratcherLotto LottoStone { get { return m_Stone; } set { m_Stone = value; } }
|
||||
|
||||
[Constructable]
|
||||
public ScratcherLottoSatellite()
|
||||
: base(0xED4)
|
||||
{
|
||||
|
||||
Name = "Lottery Scratch Tickets";
|
||||
Hue = Utility.RandomSlimeHue();
|
||||
Movable = false;
|
||||
|
||||
if (ScratcherLotto.Stone != null)
|
||||
{
|
||||
m_Stone = ScratcherLotto.Stone;
|
||||
m_Stone.AddToSatList(this);
|
||||
}
|
||||
else Delete();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (m_Stone == null || (!m_Stone.IsActive && from.AccessLevel == AccessLevel.Player))
|
||||
from.SendMessage("Scratch tickets are currenlty inactive at this time.");
|
||||
else if (from.InRange(Location, 3))
|
||||
{
|
||||
if (from.HasGump(typeof(ScratcherStoneGump)))
|
||||
from.CloseGump(typeof(ScratcherStoneGump));
|
||||
|
||||
from.SendGump(new ScratcherStoneGump(m_Stone, from));
|
||||
}
|
||||
else if (from.AccessLevel > AccessLevel.Player)
|
||||
from.SendGump( new PropertiesGump( from, m_Stone ) );
|
||||
else
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (m_Stone == null || !m_Stone.IsActive)
|
||||
list.Add(1060658, "Status\tOffline");
|
||||
else
|
||||
list.Add(1060658, "Status\tActive");
|
||||
|
||||
if (ScratcherStats.Stats.Count > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
int index = ScratcherStats.Stats.Count - 1;
|
||||
string jackpotAmount = String.Format("{0:##,###,###}", ScratcherStats.Stats[index].Payout);
|
||||
|
||||
list.Add(1060659, "Last Big Win\t{0}", ScratcherStats.Stats[index].Winner.Name);
|
||||
list.Add(1060660, "Date\t{0}", ScratcherStats.Stats[index].WinTime);
|
||||
list.Add(1060661, "Amount\t{0}", jackpotAmount);
|
||||
list.Add(1060662, "Game\t{0}", ScratcherLotto.GetGameType(ScratcherStats.Stats[index].Type));
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if (m_Stone != null)
|
||||
m_Stone.RemoveFromSatList(this);
|
||||
|
||||
base.OnAfterDelete();
|
||||
}
|
||||
|
||||
public ScratcherLottoSatellite(Serial serial) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); //Version
|
||||
|
||||
writer.Write(m_Stone);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
m_Stone = (ScratcherLotto)reader.ReadItem();
|
||||
if (m_Stone != null)
|
||||
m_Stone.AddToSatList(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.LotterySystem
|
||||
{
|
||||
public class ScratcherStats
|
||||
{
|
||||
private Mobile m_Winner;
|
||||
private TicketType m_Type;
|
||||
private int m_Payout;
|
||||
private DateTime m_WinTime;
|
||||
|
||||
public Mobile Winner { get { return m_Winner; } }
|
||||
public TicketType Type { get { return m_Type; } }
|
||||
public int Payout { get { return m_Payout; } }
|
||||
public DateTime WinTime { get { return m_WinTime; } }
|
||||
|
||||
private static List<ScratcherStats> m_Stats = new List<ScratcherStats>();
|
||||
public static List<ScratcherStats> Stats { get { return m_Stats; } }
|
||||
|
||||
public ScratcherStats(Mobile winner, int amount, TicketType type) : this(winner, amount, type, DateTime.Now)
|
||||
{
|
||||
}
|
||||
|
||||
public ScratcherStats(Mobile winner, int amount, TicketType type, DateTime time)
|
||||
{
|
||||
m_Winner = winner;
|
||||
m_Type = type;
|
||||
m_Payout = amount;
|
||||
m_WinTime = time;
|
||||
|
||||
m_Stats.Add(this);
|
||||
}
|
||||
|
||||
public void Serialize(GenericWriter writer)
|
||||
{
|
||||
writer.Write((int)0); //version
|
||||
|
||||
writer.Write(m_Winner);
|
||||
writer.Write((int)m_Type);
|
||||
writer.Write(m_Payout);
|
||||
writer.Write(m_WinTime);
|
||||
}
|
||||
|
||||
public ScratcherStats(GenericReader reader)
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Winner = reader.ReadMobile();
|
||||
m_Type = (TicketType)reader.ReadInt();
|
||||
m_Payout = reader.ReadInt();
|
||||
m_WinTime = reader.ReadDateTime();
|
||||
|
||||
m_Stats.Add(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
using Server.Engines.LotterySystem;
|
||||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SkiesTheLimit : BaseLottoTicket
|
||||
{
|
||||
private int[] m_WinAmounts = new int[] { 1000, 10000, 50000, 100000, 500000, 1, 2};
|
||||
|
||||
public static readonly int TicketCost = 1000;
|
||||
|
||||
[Constructable]
|
||||
public SkiesTheLimit() : this(null, false)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SkiesTheLimit(Mobile owner, bool quickScratch) : base (owner, TicketType.SkiesTheLimit, quickScratch)
|
||||
{
|
||||
Name = "skies the limit";
|
||||
LootType = LootType.Blessed;
|
||||
Hue = 0x8AB;
|
||||
|
||||
this.Type = TicketType.SkiesTheLimit;
|
||||
}
|
||||
|
||||
public override void CheckScratches()
|
||||
{
|
||||
if (Scratch1 > 0 && Scratch2 > 0 && Scratch3 > 0)
|
||||
{
|
||||
Checked = true;
|
||||
if (Scratch1 == 2 || Scratch2 == 2 || Scratch3 == 2)
|
||||
FreeTicket = true;
|
||||
else if (Scratch1 == Scratch2 && Scratch1 == Scratch3)
|
||||
{
|
||||
|
||||
int payOut = 0;
|
||||
if (Scratch1 == 2)
|
||||
payOut = 250000;
|
||||
else
|
||||
payOut = Scratch1;
|
||||
|
||||
if (ScratcherLotto.Stone != null && Scratch1 == 1)
|
||||
{
|
||||
payOut = ScratcherLotto.Stone.SkiesProgressive;
|
||||
ScratcherLotto.Stone.SkiesProgressive = 500000;
|
||||
ScratcherLotto.DoProgressiveMessage(Owner, payOut);
|
||||
}
|
||||
|
||||
Payout = payOut;
|
||||
DoWin(payOut);
|
||||
|
||||
if (ScratcherLotto.Stone != null)
|
||||
ScratcherLotto.Stone.GoldSink -= Payout;
|
||||
}
|
||||
}
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
|
||||
public override bool DoScratch(int scratch, Mobile from)
|
||||
{
|
||||
if (scratch > 3 || scratch < 0 || from == null)
|
||||
return false;
|
||||
|
||||
int pick;
|
||||
int pickAmount;
|
||||
|
||||
try
|
||||
{
|
||||
int[] odds = ReturnOdds(from);
|
||||
pick = odds[Utility.Random(odds.Length)];
|
||||
pickAmount = m_WinAmounts[pick];
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (scratch)
|
||||
{
|
||||
case 1: Scratch1 = pickAmount; break;
|
||||
case 2: Scratch2 = pickAmount; break;
|
||||
case 3: Scratch3 = pickAmount; break;
|
||||
default: return false;
|
||||
}
|
||||
|
||||
CheckScratches();
|
||||
return true;
|
||||
}
|
||||
|
||||
private int[] ReturnOdds(Mobile from)
|
||||
{
|
||||
if (from != null && from.Luck >= 1800 || (from.Luck > 1200 && Utility.RandomBool()))
|
||||
return new int[] { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 6 };
|
||||
|
||||
return new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 6 };
|
||||
}
|
||||
|
||||
private void DoWin(int amount)
|
||||
{
|
||||
if (Owner != null)
|
||||
Owner.PlaySound(Owner.Female ? 0x337 : 0x449);
|
||||
|
||||
if (amount >= 100000)
|
||||
{
|
||||
new ScratcherStats(Owner, Payout, this.Type);
|
||||
|
||||
if (ScratcherLotto.Stone != null)
|
||||
{
|
||||
ScratcherLotto.Stone.InvalidateProperties();
|
||||
ScratcherLotto.Stone.UpdateSatellites();
|
||||
}
|
||||
}
|
||||
|
||||
if (Owner != null)
|
||||
Owner.SendMessage(42, "It looks like you have a winning ticket!");
|
||||
}
|
||||
|
||||
public SkiesTheLimit(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+57
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
using Server.ContextMenus;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Server.Gumps;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class Mannequin2 : BaseCreature
|
||||
{
|
||||
public override bool IsInvulnerable { get { return true; } }
|
||||
[Constructable]
|
||||
public Mannequin2(): base(AIType.AI_Use_Default, FightMode.None, 1, 1, 0.2, 0.2)
|
||||
{
|
||||
InitStats(100, 100, 25);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 0);
|
||||
SetDamageType(ResistanceType.Fire, 0);
|
||||
SetDamageType(ResistanceType.Cold, 0);
|
||||
SetDamageType(ResistanceType.Poison, 0);
|
||||
SetDamageType(ResistanceType.Energy, 0);
|
||||
|
||||
Hits = HitsMax;
|
||||
|
||||
Body = 0x190;
|
||||
Race = Race.Human;
|
||||
Name = "a Mannequin";
|
||||
Hue = 1828;
|
||||
Direction = Direction.South;
|
||||
|
||||
}
|
||||
|
||||
public override bool CanBeDamaged()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public Mannequin2( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LargeAutTree1Addon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{42597, 1, 0, 0}, {42600, 0, 2, 0}, {42593, -1, 0, 16}// 1 4 6
|
||||
, {8781, -1, 0, 0}// 7
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree1AddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public LargeAutTree1Addon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
AddComplexComponent( (BaseAddon) this, 2514, -1, -1, 0, 2128, -1, "walnut", 1);// 2
|
||||
AddComplexComponent( (BaseAddon) this, 2514, -1, 1, 0, 2128, -1, "walnut", 1);// 3
|
||||
AddComplexComponent( (BaseAddon) this, 6868, -1, 0, 18, 2415, -1, "", 1);// 5
|
||||
|
||||
}
|
||||
|
||||
public LargeAutTree1Addon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource)
|
||||
{
|
||||
AddComplexComponent(addon, item, xoffset, yoffset, zoffset, hue, lightsource, null, 1);
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource, string name, int amount)
|
||||
{
|
||||
AddonComponent ac;
|
||||
ac = new AddonComponent(item);
|
||||
if (name != null && name.Length > 0)
|
||||
ac.Name = name;
|
||||
if (hue != 0)
|
||||
ac.Hue = hue;
|
||||
if (amount > 1)
|
||||
{
|
||||
ac.Stackable = true;
|
||||
ac.Amount = amount;
|
||||
}
|
||||
if (lightsource != -1)
|
||||
ac.Light = (LightType) lightsource;
|
||||
addon.AddComponent(ac, xoffset, yoffset, zoffset);
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeAutTree1AddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree1Addon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LargeAutTree1AddonDeed()
|
||||
{
|
||||
Name = "LargeAutTree1";
|
||||
}
|
||||
|
||||
public LargeAutTree1AddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LargeAutTree1wGoatAddon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{9600, 0, -1, 0}, {42597, 1, 0, 0}, {42600, 0, 2, 0}// 1 2 5
|
||||
, {42593, -1, 0, 16}, {8781, -1, 0, 0}// 7 8
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree1wGoatAddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public LargeAutTree1wGoatAddon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
AddComplexComponent( (BaseAddon) this, 2514, -1, -1, 0, 2128, -1, "walnut", 1);// 3
|
||||
AddComplexComponent( (BaseAddon) this, 2514, -1, 1, 0, 2128, -1, "walnut", 1);// 4
|
||||
AddComplexComponent( (BaseAddon) this, 6868, -1, 0, 18, 2415, -1, "", 1);// 6
|
||||
|
||||
}
|
||||
|
||||
public LargeAutTree1wGoatAddon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource)
|
||||
{
|
||||
AddComplexComponent(addon, item, xoffset, yoffset, zoffset, hue, lightsource, null, 1);
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource, string name, int amount)
|
||||
{
|
||||
AddonComponent ac;
|
||||
ac = new AddonComponent(item);
|
||||
if (name != null && name.Length > 0)
|
||||
ac.Name = name;
|
||||
if (hue != 0)
|
||||
ac.Hue = hue;
|
||||
if (amount > 1)
|
||||
{
|
||||
ac.Stackable = true;
|
||||
ac.Amount = amount;
|
||||
}
|
||||
if (lightsource != -1)
|
||||
ac.Light = (LightType) lightsource;
|
||||
addon.AddComponent(ac, xoffset, yoffset, zoffset);
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeAutTree1wGoatAddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree1wGoatAddon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LargeAutTree1wGoatAddonDeed()
|
||||
{
|
||||
Name = "LargeAutTree1wGoat";
|
||||
}
|
||||
|
||||
public LargeAutTree1wGoatAddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LargeAutTree2Addon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{42600, 1, 1, 0}, {3484, 0, 0, 0}, {3285, 0, 0, 7}// 1 3 4
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree2AddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public LargeAutTree2Addon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
AddComplexComponent( (BaseAddon) this, 6868, 0, 1, 14, 2415, -1, "", 1);// 2
|
||||
|
||||
}
|
||||
|
||||
public LargeAutTree2Addon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource)
|
||||
{
|
||||
AddComplexComponent(addon, item, xoffset, yoffset, zoffset, hue, lightsource, null, 1);
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource, string name, int amount)
|
||||
{
|
||||
AddonComponent ac;
|
||||
ac = new AddonComponent(item);
|
||||
if (name != null && name.Length > 0)
|
||||
ac.Name = name;
|
||||
if (hue != 0)
|
||||
ac.Hue = hue;
|
||||
if (amount > 1)
|
||||
{
|
||||
ac.Stackable = true;
|
||||
ac.Amount = amount;
|
||||
}
|
||||
if (lightsource != -1)
|
||||
ac.Light = (LightType) lightsource;
|
||||
addon.AddComponent(ac, xoffset, yoffset, zoffset);
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeAutTree2AddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree2Addon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LargeAutTree2AddonDeed()
|
||||
{
|
||||
Name = "LargeAutTree2";
|
||||
}
|
||||
|
||||
public LargeAutTree2AddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LargeAutTree3Addon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{42600, 1, 1, 0}, {8781, 0, 0, 0}, {3295, 0, 0, 17}// 3 5 6
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree3AddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public LargeAutTree3Addon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
AddComplexComponent( (BaseAddon) this, 2514, 1, 1, 0, 2128, -1, "walnut", 1);// 1
|
||||
AddComplexComponent( (BaseAddon) this, 2514, -1, 0, 0, 2128, -1, "walnut", 1);// 2
|
||||
AddComplexComponent( (BaseAddon) this, 6868, 0, 0, 19, 2415, -1, "", 1);// 4
|
||||
|
||||
}
|
||||
|
||||
public LargeAutTree3Addon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource)
|
||||
{
|
||||
AddComplexComponent(addon, item, xoffset, yoffset, zoffset, hue, lightsource, null, 1);
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource, string name, int amount)
|
||||
{
|
||||
AddonComponent ac;
|
||||
ac = new AddonComponent(item);
|
||||
if (name != null && name.Length > 0)
|
||||
ac.Name = name;
|
||||
if (hue != 0)
|
||||
ac.Hue = hue;
|
||||
if (amount > 1)
|
||||
{
|
||||
ac.Stackable = true;
|
||||
ac.Amount = amount;
|
||||
}
|
||||
if (lightsource != -1)
|
||||
ac.Light = (LightType) lightsource;
|
||||
addon.AddComponent(ac, xoffset, yoffset, zoffset);
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeAutTree3AddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree3Addon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LargeAutTree3AddonDeed()
|
||||
{
|
||||
Name = "LargeAutTree3";
|
||||
}
|
||||
|
||||
public LargeAutTree3AddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LargeAutTree4Addon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{42600, 1, 1, 0}, {3299, 0, 0, 0}, {3483, 0, 0, 4}// 1 3 4
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree4AddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public LargeAutTree4Addon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
AddComplexComponent( (BaseAddon) this, 6868, 1, 0, 14, 2415, -1, "", 1);// 2
|
||||
|
||||
}
|
||||
|
||||
public LargeAutTree4Addon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource)
|
||||
{
|
||||
AddComplexComponent(addon, item, xoffset, yoffset, zoffset, hue, lightsource, null, 1);
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource, string name, int amount)
|
||||
{
|
||||
AddonComponent ac;
|
||||
ac = new AddonComponent(item);
|
||||
if (name != null && name.Length > 0)
|
||||
ac.Name = name;
|
||||
if (hue != 0)
|
||||
ac.Hue = hue;
|
||||
if (amount > 1)
|
||||
{
|
||||
ac.Stackable = true;
|
||||
ac.Amount = amount;
|
||||
}
|
||||
if (lightsource != -1)
|
||||
ac.Light = (LightType) lightsource;
|
||||
addon.AddComponent(ac, xoffset, yoffset, zoffset);
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeAutTree4AddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree4Addon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LargeAutTree4AddonDeed()
|
||||
{
|
||||
Name = "LargeAutTree4";
|
||||
}
|
||||
|
||||
public LargeAutTree4AddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LargeAutTree5Addon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{2514, 0, 0, 0}, {42599, 1, 1, 0}, {3487, 1, 0, 6}// 1 2 3
|
||||
, {3296, 1, 0, 0}// 4
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree5AddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public LargeAutTree5Addon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
}
|
||||
|
||||
public LargeAutTree5Addon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeAutTree5AddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree5Addon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LargeAutTree5AddonDeed()
|
||||
{
|
||||
Name = "LargeAutTree5";
|
||||
}
|
||||
|
||||
public LargeAutTree5AddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LargeAutTree6Addon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{42596, 0, 0, 9}, {8780, 0, 0, 0}// 1 3
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree6AddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public LargeAutTree6Addon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
AddComplexComponent( (BaseAddon) this, 6868, 0, 0, 12, 2415, -1, "", 1);// 2
|
||||
|
||||
}
|
||||
|
||||
public LargeAutTree6Addon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource)
|
||||
{
|
||||
AddComplexComponent(addon, item, xoffset, yoffset, zoffset, hue, lightsource, null, 1);
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource, string name, int amount)
|
||||
{
|
||||
AddonComponent ac;
|
||||
ac = new AddonComponent(item);
|
||||
if (name != null && name.Length > 0)
|
||||
ac.Name = name;
|
||||
if (hue != 0)
|
||||
ac.Hue = hue;
|
||||
if (amount > 1)
|
||||
{
|
||||
ac.Stackable = true;
|
||||
ac.Amount = amount;
|
||||
}
|
||||
if (lightsource != -1)
|
||||
ac.Light = (LightType) lightsource;
|
||||
addon.AddComponent(ac, xoffset, yoffset, zoffset);
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeAutTree6AddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree6Addon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LargeAutTree6AddonDeed()
|
||||
{
|
||||
Name = "LargeAutTree6";
|
||||
}
|
||||
|
||||
public LargeAutTree6AddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LargeAutTree7Addon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{42597, 1, 1, 1}, {42592, 0, 0, 2}, {3290, 0, 0, 0}// 1 2 3
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree7AddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public LargeAutTree7Addon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
}
|
||||
|
||||
public LargeAutTree7Addon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeAutTree7AddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree7Addon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LargeAutTree7AddonDeed()
|
||||
{
|
||||
Name = "LargeAutTree7";
|
||||
}
|
||||
|
||||
public LargeAutTree7AddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LargeAutTree8wHiveAddon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{42594, 1, 2, 37}, {42600, -1, 0, 0}, {2330, -1, -1, 18}// 1 2 3
|
||||
, {3484, 0, 1, 26}// 4
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree8wHiveAddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public LargeAutTree8wHiveAddon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
}
|
||||
|
||||
public LargeAutTree8wHiveAddon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeAutTree8wHiveAddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree8wHiveAddon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LargeAutTree8wHiveAddonDeed()
|
||||
{
|
||||
Name = "LargeAutTree8wHive";
|
||||
}
|
||||
|
||||
public LargeAutTree8wHiveAddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LargeAutTree9Addon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{42600, 1, 1, 0}, {42595, 0, 0, 9}, {8779, 0, 0, 0}// 3 4 5
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree9AddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public LargeAutTree9Addon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
AddComplexComponent( (BaseAddon) this, 2514, 0, -1, 0, 2128, -1, "walnut", 1);// 1
|
||||
AddComplexComponent( (BaseAddon) this, 2514, 0, 1, 0, 2128, -1, "walnut", 1);// 2
|
||||
|
||||
}
|
||||
|
||||
public LargeAutTree9Addon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource)
|
||||
{
|
||||
AddComplexComponent(addon, item, xoffset, yoffset, zoffset, hue, lightsource, null, 1);
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource, string name, int amount)
|
||||
{
|
||||
AddonComponent ac;
|
||||
ac = new AddonComponent(item);
|
||||
if (name != null && name.Length > 0)
|
||||
ac.Name = name;
|
||||
if (hue != 0)
|
||||
ac.Hue = hue;
|
||||
if (amount > 1)
|
||||
{
|
||||
ac.Stackable = true;
|
||||
ac.Amount = amount;
|
||||
}
|
||||
if (lightsource != -1)
|
||||
ac.Light = (LightType) lightsource;
|
||||
addon.AddComponent(ac, xoffset, yoffset, zoffset);
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeAutTree9AddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTree9Addon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LargeAutTree9AddonDeed()
|
||||
{
|
||||
Name = "LargeAutTree9";
|
||||
}
|
||||
|
||||
public LargeAutTree9AddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LargeAutTreeAAddon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{42598, 1, 1, 0}, {42591, 0, 0, 11}, {8780, 0, 0, 0}// 1 3 4
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTreeAAddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public LargeAutTreeAAddon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
AddComplexComponent( (BaseAddon) this, 6868, 0, 0, 12, 2415, -1, "", 1);// 2
|
||||
|
||||
}
|
||||
|
||||
public LargeAutTreeAAddon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource)
|
||||
{
|
||||
AddComplexComponent(addon, item, xoffset, yoffset, zoffset, hue, lightsource, null, 1);
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource, string name, int amount)
|
||||
{
|
||||
AddonComponent ac;
|
||||
ac = new AddonComponent(item);
|
||||
if (name != null && name.Length > 0)
|
||||
ac.Name = name;
|
||||
if (hue != 0)
|
||||
ac.Hue = hue;
|
||||
if (amount > 1)
|
||||
{
|
||||
ac.Stackable = true;
|
||||
ac.Amount = amount;
|
||||
}
|
||||
if (lightsource != -1)
|
||||
ac.Light = (LightType) lightsource;
|
||||
addon.AddComponent(ac, xoffset, yoffset, zoffset);
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeAutTreeAAddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTreeAAddon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LargeAutTreeAAddonDeed()
|
||||
{
|
||||
Name = "LargeAutTreeA";
|
||||
}
|
||||
|
||||
public LargeAutTreeAAddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LargeAutTreeBAddon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{42597, 1, -1, 0}, {42600, 0, 1, 0}, {42590, -1, -1, 6}// 1 2 4
|
||||
, {42593, 0, 0, 15}, {3293, -1, -1, 0}, {42589, -1, 1, 16}// 5 6 7
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTreeBAddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public LargeAutTreeBAddon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
AddComplexComponent( (BaseAddon) this, 6868, 0, -1, 13, 2415, -1, "", 1);// 3
|
||||
|
||||
}
|
||||
|
||||
public LargeAutTreeBAddon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource)
|
||||
{
|
||||
AddComplexComponent(addon, item, xoffset, yoffset, zoffset, hue, lightsource, null, 1);
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource, string name, int amount)
|
||||
{
|
||||
AddonComponent ac;
|
||||
ac = new AddonComponent(item);
|
||||
if (name != null && name.Length > 0)
|
||||
ac.Name = name;
|
||||
if (hue != 0)
|
||||
ac.Hue = hue;
|
||||
if (amount > 1)
|
||||
{
|
||||
ac.Stackable = true;
|
||||
ac.Amount = amount;
|
||||
}
|
||||
if (lightsource != -1)
|
||||
ac.Light = (LightType) lightsource;
|
||||
addon.AddComponent(ac, xoffset, yoffset, zoffset);
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeAutTreeBAddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeAutTreeBAddon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LargeAutTreeBAddonDeed()
|
||||
{
|
||||
Name = "LargeAutTreeB";
|
||||
}
|
||||
|
||||
public LargeAutTreeBAddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LargeOrangeAutumnTree2Addon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{42592, 1, 1, 33}, {42600, 1, 1, 0}, {42590, 0, 0, 21}// 1 2 3
|
||||
, {42595, 0, 2, 62}, {42592, 0, 0, 68}, {3417, 0, 0, 1}// 4 5 6
|
||||
, {42596, 2, -1, 25}, {42598, 2, -1, 0}, {42600, 0, -2, 0}// 7 8 9
|
||||
, {42590, 1, -1, 20}, {42596, 1, -1, 42}, {42595, 1, -1, 50}// 10 11 12
|
||||
, {3418, 1, -1, 0}, {42596, -1, 3, 28}, {42599, -1, 2, 0}// 13 14 15
|
||||
, {42600, -2, 0, 0}, {42590, -2, 1, 14}, {42596, -1, 2, 41}// 16 17 18
|
||||
, {3416, -1, 1, 0}// 19
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeOrangeAutumnTree2AddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public LargeOrangeAutumnTree2Addon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
}
|
||||
|
||||
public LargeOrangeAutumnTree2Addon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeOrangeAutumnTree2AddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeOrangeAutumnTree2Addon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LargeOrangeAutumnTree2AddonDeed()
|
||||
{
|
||||
Name = "LargeOrangeAutumnTree2";
|
||||
}
|
||||
|
||||
public LargeOrangeAutumnTree2AddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LargeOrangeAutumnTreeAddon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{42600, 2, 0, 0}, {42595, 2, 0, 30}, {42596, 2, -1, 47}// 1 2 3
|
||||
, {42596, 2, -2, 27}, {42600, 0, 2, 0}, {42600, -2, 1, 0}// 4 7 8
|
||||
, {42600, -2, -1, 0}, {42595, 0, 2, 33}, {42596, -2, 2, 27}// 9 10 11
|
||||
, {42595, 1, 1, 39}, {42596, -1, 2, 47}, {42595, 1, 1, 60}// 12 13 14
|
||||
, {42600, 0, -2, 1}// 18
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeOrangeAutumnTreeAddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public LargeOrangeAutumnTreeAddon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
AddComplexComponent( (BaseAddon) this, 3387, 0, -1, 9, 2418, -1, "", 1);// 5
|
||||
AddComplexComponent( (BaseAddon) this, 3388, -1, 0, 14, 2418, -1, "", 1);// 6
|
||||
AddComplexComponent( (BaseAddon) this, 3439, -1, 1, 0, 2418, -1, "", 1);// 15
|
||||
AddComplexComponent( (BaseAddon) this, 3441, 1, -1, 0, 2418, -1, "", 1);// 16
|
||||
AddComplexComponent( (BaseAddon) this, 3440, 0, 0, 0, 2418, -1, "", 1);// 17
|
||||
|
||||
}
|
||||
|
||||
public LargeOrangeAutumnTreeAddon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource)
|
||||
{
|
||||
AddComplexComponent(addon, item, xoffset, yoffset, zoffset, hue, lightsource, null, 1);
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource, string name, int amount)
|
||||
{
|
||||
AddonComponent ac;
|
||||
ac = new AddonComponent(item);
|
||||
if (name != null && name.Length > 0)
|
||||
ac.Name = name;
|
||||
if (hue != 0)
|
||||
ac.Hue = hue;
|
||||
if (amount > 1)
|
||||
{
|
||||
ac.Stackable = true;
|
||||
ac.Amount = amount;
|
||||
}
|
||||
if (lightsource != -1)
|
||||
ac.Light = (LightType) lightsource;
|
||||
addon.AddComponent(ac, xoffset, yoffset, zoffset);
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeOrangeAutumnTreeAddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeOrangeAutumnTreeAddon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LargeOrangeAutumnTreeAddonDeed()
|
||||
{
|
||||
Name = "LargeOrangeAutumnTree";
|
||||
}
|
||||
|
||||
public LargeOrangeAutumnTreeAddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LargeRedAutumnTree2Addon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{42589, 3, 0, 31}, {42591, 1, 0, 58}, {42598, 1, 2, 0}// 2 3 4
|
||||
, {42598, 2, -1, 0}, {42598, -1, 2, 0}, {42598, 0, -2, 0}// 5 6 7
|
||||
, {42591, -1, 2, 29}, {42593, 1, 0, 31}, {42589, 0, 1, 23}// 9 10 11
|
||||
, {42594, 2, 0, 42}, {42594, -1, 2, 41}, {42591, 2, 3, 76}// 12 13 14
|
||||
, {3441, 1, -1, 0}// 16
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeRedAutumnTree2AddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public LargeRedAutumnTree2Addon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
AddComplexComponent( (BaseAddon) this, 3387, 0, -1, 11, 2418, -1, "", 1);// 1
|
||||
AddComplexComponent( (BaseAddon) this, 42598, -2, 0, 0, 2418, -1, "", 1);// 8
|
||||
AddComplexComponent( (BaseAddon) this, 3439, -1, 1, 0, 2418, -1, "", 1);// 15
|
||||
AddComplexComponent( (BaseAddon) this, 3440, 0, 0, 0, 2418, -1, "", 1);// 17
|
||||
|
||||
}
|
||||
|
||||
public LargeRedAutumnTree2Addon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource)
|
||||
{
|
||||
AddComplexComponent(addon, item, xoffset, yoffset, zoffset, hue, lightsource, null, 1);
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource, string name, int amount)
|
||||
{
|
||||
AddonComponent ac;
|
||||
ac = new AddonComponent(item);
|
||||
if (name != null && name.Length > 0)
|
||||
ac.Name = name;
|
||||
if (hue != 0)
|
||||
ac.Hue = hue;
|
||||
if (amount > 1)
|
||||
{
|
||||
ac.Stackable = true;
|
||||
ac.Amount = amount;
|
||||
}
|
||||
if (lightsource != -1)
|
||||
ac.Light = (LightType) lightsource;
|
||||
addon.AddComponent(ac, xoffset, yoffset, zoffset);
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeRedAutumnTree2AddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeRedAutumnTree2Addon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LargeRedAutumnTree2AddonDeed()
|
||||
{
|
||||
Name = "LargeRedAutumnTree2";
|
||||
}
|
||||
|
||||
public LargeRedAutumnTree2AddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LargeRedAutumnTreeAddon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{42594, 0, 0, 25}, {6868, 0, 1, 35}, {3292, -1, 1, 44}// 1 2 3
|
||||
, {3292, 1, -1, 49}, {3295, 1, 0, 46}, {3282, -1, 2, 19}// 4 5 6
|
||||
, {3285, 1, 1, 67}, {3279, 2, -1, 18}// 7 8
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeRedAutumnTreeAddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public LargeRedAutumnTreeAddon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
AddComplexComponent( (BaseAddon) this, 3388, -1, 1, 25, 2418, -1, "", 1);// 9
|
||||
AddComplexComponent( (BaseAddon) this, 3387, 0, -1, 6, 2418, -1, "", 1);// 10
|
||||
AddComplexComponent( (BaseAddon) this, 3441, 1, -1, 0, 2418, -1, "", 1);// 11
|
||||
AddComplexComponent( (BaseAddon) this, 3439, -1, 1, 0, 2418, -1, "", 1);// 12
|
||||
AddComplexComponent( (BaseAddon) this, 3440, 0, 0, 1, 2418, -1, "", 1);// 13
|
||||
|
||||
}
|
||||
|
||||
public LargeRedAutumnTreeAddon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource)
|
||||
{
|
||||
AddComplexComponent(addon, item, xoffset, yoffset, zoffset, hue, lightsource, null, 1);
|
||||
}
|
||||
|
||||
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource, string name, int amount)
|
||||
{
|
||||
AddonComponent ac;
|
||||
ac = new AddonComponent(item);
|
||||
if (name != null && name.Length > 0)
|
||||
ac.Name = name;
|
||||
if (hue != 0)
|
||||
ac.Hue = hue;
|
||||
if (amount > 1)
|
||||
{
|
||||
ac.Stackable = true;
|
||||
ac.Amount = amount;
|
||||
}
|
||||
if (lightsource != -1)
|
||||
ac.Light = (LightType) lightsource;
|
||||
addon.AddComponent(ac, xoffset, yoffset, zoffset);
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeRedAutumnTreeAddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LargeRedAutumnTreeAddon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LargeRedAutumnTreeAddonDeed()
|
||||
{
|
||||
Name = "LargeRedAutumnTree";
|
||||
}
|
||||
|
||||
public LargeRedAutumnTreeAddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SmallAutTree1Addon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{42599, 1, 1, 0}, {3499, 0, 0, 2}, {3496, 0, 0, 0}// 1 2 3
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new SmallAutTree1AddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public SmallAutTree1Addon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
}
|
||||
|
||||
public SmallAutTree1Addon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SmallAutTree1AddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new SmallAutTree1Addon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SmallAutTree1AddonDeed()
|
||||
{
|
||||
Name = "SmallAutTree1";
|
||||
}
|
||||
|
||||
public SmallAutTree1AddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SmallAutTree2Addon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{2514, 0, 1, 7}, {2514, 1, 0, 0}, {42599, 1, 1, 0}// 1 2 3
|
||||
, {3491, 1, 1, 8}, {3496, 0, 0, 1}// 4 5
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new SmallAutTree2AddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public SmallAutTree2Addon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
}
|
||||
|
||||
public SmallAutTree2Addon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SmallAutTree2AddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new SmallAutTree2Addon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SmallAutTree2AddonDeed()
|
||||
{
|
||||
Name = "SmallAutTree2";
|
||||
}
|
||||
|
||||
public SmallAutTree2AddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SmallAutTree3Addon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{2514, 1, 0, 0}, {42599, 1, 1, 0}, {3495, 0, 0, 1}// 1 2 3
|
||||
, {3496, 0, 0, 0}// 4
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new SmallAutTree3AddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public SmallAutTree3Addon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
}
|
||||
|
||||
public SmallAutTree3Addon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SmallAutTree3AddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new SmallAutTree3Addon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SmallAutTree3AddonDeed()
|
||||
{
|
||||
Name = "SmallAutTree3";
|
||||
}
|
||||
|
||||
public SmallAutTree3AddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SmallAutTree4Addon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{42597, 1, 1, 0}, {42588, 0, 0, 0}// 1 2
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new SmallAutTree4AddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public SmallAutTree4Addon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
}
|
||||
|
||||
public SmallAutTree4Addon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SmallAutTree4AddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new SmallAutTree4Addon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SmallAutTree4AddonDeed()
|
||||
{
|
||||
Name = "SmallAutTree4";
|
||||
}
|
||||
|
||||
public SmallAutTree4AddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Boulder001Addon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{4950, 0, 0, 0}, {4949, 0, 1, 0}// 1 2
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Boulder001AddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public Boulder001Addon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
}
|
||||
|
||||
public Boulder001Addon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class Boulder001AddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Boulder001Addon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Boulder001AddonDeed()
|
||||
{
|
||||
Name = "Boulder001";
|
||||
}
|
||||
|
||||
public Boulder001AddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// //
|
||||
// Generated by CEO's YAAAG - Ver 2 //
|
||||
// (Yet Another Arya Addon Generator) //
|
||||
// Modified by Hammerhand for //
|
||||
// SA & High Seas content //
|
||||
// //
|
||||
////////////////////////////////////////
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Boulder002Addon : BaseAddon
|
||||
{
|
||||
private static int[,] m_AddOnSimpleComponents = new int[,] {
|
||||
{4951, 0, 1, 0}, {4953, 1, 0, 0}, {4952, 1, 1, 0}// 1 2 3
|
||||
};
|
||||
|
||||
|
||||
|
||||
public override BaseAddonDeed Deed
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Boulder002AddonDeed();
|
||||
}
|
||||
}
|
||||
|
||||
[ Constructable ]
|
||||
public Boulder002Addon()
|
||||
{
|
||||
|
||||
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
|
||||
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
|
||||
|
||||
|
||||
}
|
||||
|
||||
public Boulder002Addon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class Boulder002AddonDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Boulder002Addon();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Boulder002AddonDeed()
|
||||
{
|
||||
Name = "Boulder002";
|
||||
}
|
||||
|
||||
public Boulder002AddonDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 ); // Version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user