Overwrite

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

View File

@@ -0,0 +1,66 @@
// Anti-Gravity Diamond by Snobothehobo
using System;
using Server;
namespace Server.Items
{
public class AntiGravityDiamond : Item
{
private string m_dateobtained;
[Constructable]
public AntiGravityDiamond() : this( 1 )
{
}
[Constructable]
public AntiGravityDiamond( int amount ) : base( 0xF26 )
{
Name = "Anti-Gravity Diamond";
Stackable = false;
Hue = 38;
// Edit the weight here.
Weight = -5000;
DateTime dt = DateTime.Now;
m_dateobtained = dt.ToString("y");
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
list.Add("Obtained in ({0})", m_dateobtained);
}
public AntiGravityDiamond( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write((string)this.m_dateobtained);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch (version)
{
case 0:
{
this.m_dateobtained = reader.ReadString();
break;
}
}
}
}
}

View File

@@ -0,0 +1,138 @@
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Prompts;
using Server.Network;
using System.Collections;
namespace Server.Items
{
public class AutoResStone : Item
{
private int m_Charges = 1;
[CommandProperty( AccessLevel.GameMaster )]
public int Charges
{
get { return m_Charges; }
set { m_Charges = value; InvalidateProperties(); }
}
private Timer m_Timer;
private TimeSpan m_Delay = TimeSpan.FromSeconds( 5.0 ); /*TimeSpan.Zero*/
[CommandProperty(AccessLevel.GameMaster)]
public TimeSpan Delay { get { return m_Delay; } set { m_Delay = value; } }
public static void Initialize()
{
EventSink.PlayerDeath += new PlayerDeathEventHandler(EventSink_Death);
}
private static void EventSink_Death(PlayerDeathEventArgs e)
{
PlayerMobile owner = e.Mobile as PlayerMobile;
if (owner != null && !owner.Deleted)
{
if (owner.Alive)
return;
if (owner.Backpack == null || owner.Backpack.Deleted)
return;
AutoResStone stone = owner.Backpack.FindItemByType(typeof(AutoResStone)) as AutoResStone;
if (stone != null && !stone.Deleted)
{
stone.CountDown(owner);
}
}
}
[Constructable]
public AutoResStone() : this( 1 )
{ }
[Constructable]
public AutoResStone(int charges) /*int amount*/
: base(0x1870)
{
m_Charges = charges;
Name = "Stone Of Rebirth";
LootType = LootType.Blessed;
/*Stackable = true;*/
Weight = 1.0;
/*Amount = amount;*/
}
public AutoResStone(Serial serial)
: base(serial)
{ }
private void CountDown(PlayerMobile owner)
{
m_Timer = Timer.DelayCall(m_Delay, new TimerStateCallback(Resurrect_OnTick), new object[] { owner });
}
private void Resurrect_OnTick(object state)
{
object[] states = (object[])state;
PlayerMobile owner = (PlayerMobile)states[0];
if (owner != null && !owner.Deleted)
{
if (owner.Alive || m_Charges < 1)
return;
owner.SendMessage("Your stone of rebirth has saved you from the farplane.");
owner.Resurrect();
owner.Hits = owner.HitsMax;
owner.Stam = owner.StamMax;
owner.Mana = owner.ManaMax;
//m_Charges--;
InvalidateProperties();
}
}
public override void GetProperties( ObjectPropertyList list )
{
base.GetProperties( list );
//list.Add(String.Format("{0} Charges", m_Charges));
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 0 ); // version
writer.Write( (TimeSpan) m_Delay );
writer.Write( (int) m_Charges );
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 0:
{
m_Delay = reader.ReadTimeSpan();
m_Charges = reader.ReadInt();
} break;
}
}
}
}

View File

@@ -0,0 +1,212 @@
using System;
using Server;
using Server.Mobiles;
namespace Server.Items
{
public class BankBell : Item
{
[Constructable]
public BankBell() : base(0x1C12)
{
Name = "Bank Bell";
Hue = Utility.RandomBrightHue();
Weight = 3;
LootType = LootType.Blessed;
}
public override void AddNameProperties(ObjectPropertyList list)
{
base.AddNameProperties(list);
list.Add(1070722, "Double Click To Open Bank Box");
}
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
from.SendMessage("This item must be in your pack before you are able to use it");
}
else
{
BankBox box = from.BankBox;
if (box != null)
box.Open();
}
}
public override bool HandlesOnSpeech { get { return true; } }
public override void OnSpeech(SpeechEventArgs e)
{
if (!e.Handled && e.Mobile.InRange(this.Location, 12))
{
for (int i = 0; i < e.Keywords.Length; ++i)
{
int keyword = e.Keywords[i];
switch (keyword)
{
case 0x0000: // *withdraw*
{
e.Handled = true;
if (e.Mobile.Criminal)
{
e.Mobile.Say(500389); // I will not do business with a criminal!
break;
}
string[] split = e.Speech.Split(' ');
if (split.Length >= 2)
{
int amount;
try
{
amount = Convert.ToInt32(split[1]);
}
catch
{
break;
}
if (amount > 5000)
{
e.Mobile.Say(500381); // Thou canst not withdraw so much at one time!
}
else if (amount > 0)
{
BankBox box = e.Mobile.FindBankNoCreate();
if (box == null || !box.ConsumeTotal(typeof(Gold), amount))
{
e.Mobile.Say(500384); // Ah, art thou trying to fool me? Thou hast not so much gold!
}
else
{
e.Mobile.AddToBackpack(new Gold(amount));
e.Mobile.Say(1010005); // Thou hast withdrawn gold from thy account.
}
}
}
break;
}
case 0x0001: // *balance*
{
e.Handled = true;
if (e.Mobile.Criminal)
{
e.Mobile.Say(500389); // I will not do business with a criminal!
break;
}
BankBox box = e.Mobile.FindBankNoCreate();
if (box != null)
e.Mobile.Say(1042759, box.TotalGold.ToString()); // Thy current bank balance is ~1_AMOUNT~ gold.
else
e.Mobile.Say(1042759, "0"); // Thy current bank balance is ~1_AMOUNT~ gold.
break;
}
case 0x0002: // *bank*
{
e.Handled = true;
if (e.Mobile.Criminal)
{
e.Mobile.Say(500378); // Thou art a criminal and cannot access thy bank box.
break;
}
e.Mobile.BankBox.Open();
break;
}
case 0x0003: // *check*
{
e.Handled = true;
if (e.Mobile.Criminal)
{
e.Mobile.Say(500389); // I will not do business with a criminal!
break;
}
string[] split = e.Speech.Split(' ');
if (split.Length >= 2)
{
int amount;
try
{
amount = Convert.ToInt32(split[1]);
}
catch
{
break;
}
if (amount < 5000)
{
e.Mobile.Say(1010006); // We cannot create checks for such a paltry amount of gold!
}
else if (amount > 1000000)
{
e.Mobile.Say(1010007); // Our policies prevent us from creating checks worth that much!
}
else
{
BankCheck check = new BankCheck(amount);
BankBox box = e.Mobile.BankBox;
if (!box.TryDropItem(e.Mobile, check, false))
{
e.Mobile.Say(500386); // There's not enough room in your bankbox for the check!
check.Delete();
}
else if (!box.ConsumeTotal(typeof(Gold), amount))
{
e.Mobile.Say(500384); // Ah, art thou trying to fool me? Thou hast not so much gold!
check.Delete();
}
else
{
e.Mobile.Say(1042673, amount.ToString()); // Into your bank box I have placed a check in the amount of:
}
}
}
break;
}
}
}
}
base.OnSpeech(e);
}
public BankBell(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();
}
}
}

View File

@@ -0,0 +1,56 @@
using System;
using System.Collections;
using Server.Multis;
using Server.Mobiles;
using Server.Network;
namespace Server.Items
{
public class BlessedBag : BaseContainer, IDyable
{
public override int DefaultGumpID{ get{ return 0x3D; } }
public override int DefaultDropSound{ get{ return 0x48; } }
public override Rectangle2D Bounds
{
get{ return new Rectangle2D( 29, 34, 108, 94 ); }
}
[Constructable]
public BlessedBag() : base( 0xE76 )
{
Weight = 1.0;
Name = "Blessed Bag";
Hue = 1366;
LootType = LootType.Blessed;
}
public BlessedBag( Serial serial ) : base( serial )
{
}
public bool Dye( Mobile from, DyeTub sender )
{
if ( Deleted ) return false;
Hue = sender.DyedHue;
return true;
}
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();
}
}
}

View File

@@ -0,0 +1,49 @@
using System;
namespace Server.Items
{
public class BossDyeTub : DyeTub
{
[Constructable]
public BossDyeTub(int i)
{
//this.Redyable = false; //Remove this before the 'switch (i)'
switch (i)
{
case 1:
{
this.Hue = 0x300;
this.DyedHue = this.Hue;
this.Redyable = false;//<--add this into the switch case itself
break;
}
case 2:
{
this.Hue = 0x489;
this.DyedHue = this.Hue;
this.Redyable = false;//<--add this into the switch case itself
break;
}
}
}
public BossDyeTub(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();
}
}
}

View File

@@ -0,0 +1,422 @@
//Map Locations Book
//by henry_r--- Changed by REDSNOW
//03/14/12
using System;
using System.Collections;
using System.Text;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Mobiles;
using Server.Commands;
namespace Server.Items
{
public class ChampSpawnAltarLocations : Item
{
[Constructable]
public ChampSpawnAltarLocations() : base( 0x2D50 )
{
Movable = true;
Hue = 1152; //Icy Blue
Weight = 0.0;
Name = " Champ Spawn Altar Locations";
LootType = LootType.Blessed;
}
public ChampSpawnAltarLocations(Serial serial)
: base(serial)
{
}
public override void OnDoubleClick( Mobile from )
{
if ( !from.Player )
return;
if ( from.InRange( GetWorldLocation(), 1 ) )
UseGate( from );
else
from.SendLocalizedMessage( 500446 ); // That is too far away.
}
public override bool OnMoveOver( Mobile m )
{
return !m.Player || UseGate( m );
}
public bool UseGate( Mobile m )
{
if ( m.Criminal )
{
m.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
return false;
}
else if ( Server.Spells.SpellHelper.CheckCombat( m ) )
{
m.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
return false;
}
else if ( Server.Misc.WeightOverloading.IsOverloaded( m ) )
{
m.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
return false;
}
else if ( m.Spell != null )
{
m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
return false;
}
else
{
m.CloseGump(typeof(ChampSpawnAltarLocationsGump));
m.SendGump(new ChampSpawnAltarLocationsGump(m));
//Effects.PlaySound( m.Location, m.Map, 0x20E );
return true;
}
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
public class TMEntry
{
private Point3D m_Location;
private string m_Text;
public Point3D Location
{
get
{
return m_Location;
}
}
public string Text
{
get
{
return m_Text;
}
}
public TMEntry( Point3D loc, string text )
{
m_Location = loc;
m_Text = text;
}
}
public class TMList
{
private string m_Text, m_SelText;
private Map m_Map;
private TMEntry[] m_Entries;
public string Text
{
get
{
return m_Text;
}
}
public string SelText
{
get
{
return m_SelText;
}
}
public Map Map
{
get
{
return m_Map;
}
}
public TMEntry[] Entries
{
get
{
return m_Entries;
}
}
public TMList( string text, string selText, Map map, TMEntry[] entries )
{
m_Text = text;
m_SelText = selText;
m_Map = map;
m_Entries = entries;
}
public static readonly TMList MapLocations1 =
new TMList( "Felucca Champ Altars", "Felucca Champ Altars", Map.Felucca, new TMEntry[] //Fel including T2
{
new TMEntry( new Point3D( 5179, 708, 5 ), "Deceit" ),
new TMEntry( new Point3D( 5557, 824, 50 ), "Despise" ),
new TMEntry( new Point3D( 5259, 837, 46 ), "Destard" ),
new TMEntry( new Point3D( 5815, 1351, -13 ), "Fire" ),
new TMEntry( new Point3D( 5191, 1606, 5 ), "Terathan Keep" ),
new TMEntry( new Point3D( 5511, 2361, 25 ), "Ice Land T2" ),
new TMEntry( new Point3D( 6038, 2400, 31 ), "East Ice Land T2" ),
new TMEntry( new Point3D( 5550, 2641, 0 ), "South Oasis T2" ),
new TMEntry( new Point3D( 5637, 2917, 22 ), "West of Fire T2" ),
new TMEntry( new Point3D( 6035, 2944, 37 ), "Terra Sanctum T2" ),
new TMEntry( new Point3D( 5267, 3172, 89 ), "Marble Passage T2" ),
new TMEntry( new Point3D( 5281, 3368, 36 ), "Darwin Thicket T2" ),
new TMEntry( new Point3D( 5954, 3475, 10 ), "Harpers Bog T2" ),
new TMEntry( new Point3D( 5207, 3637, 5 ), "City of the Dead T2" ),
new TMEntry( new Point3D( 5559, 3757, 6 ), "Vesper Passage T2" ),
new TMEntry( new Point3D( 5982, 3882, 5 ), "South Khaldun T2" ),
new TMEntry( new Point3D( 5724, 3991, 27 ), "Tortoise Lagoon T2" )
} );
public static readonly TMList MapLocations2 =
new TMList("Ilshenar", "Ilshenar", Map.Ilshenar, new TMEntry[] //IlSH
{
new TMEntry( new Point3D( 382, 328, -45 ), "Valor" ),
new TMEntry( new Point3D( 462, 926, -82 ), "Humility" ),
new TMEntry( new Point3D( 1645, 1108, -7 ), "Spirituality" ),
new TMEntry( new Point3D( 2212, 1260, 10 ), "Twisted Weald" )
} );
public static readonly TMList MapLocations3 =
new TMList( "Malas Champ", "Malas Champ", Map.Malas, new TMEntry[] //Malas
{
new TMEntry( new Point3D( 175, 1629, -7 ), "Bedlam Crypt" )
} );
public static readonly TMList MapLocations4 =
new TMList( "Tokuno Champ", "Tokuno Champ", Map.Tokuno, new TMEntry[] //Tokuno
{
new TMEntry( new Point3D( 949, 435, 14 ), "Sleeping Dragon" )
});
public static readonly TMList MapLocations5 =
new TMList("Ter Mur Champs", "Ter Mur Champs", Map.Felucca, new TMEntry[] //Ter Mur
{
new TMEntry( new Point3D( 7000, 1004, 5 ), "Primeval Lich" ),
new TMEntry( new Point3D( 6993, 734, 77 ), "Abyssal Champ" )
// new TMEntry( new Point3D( 2099, 1976, 0 ), "XXXX" ),
// new TMEntry( new Point3D( 2090, 1987, 0 ), "XXXX" ),
// new TMEntry( new Point3D( 2094, 2006, 0 ), "XXXX" ),
// new TMEntry( new Point3D( 1426, 2405, 5 ), "XXXX" ),
// new TMEntry( new Point3D( 1426, 2405, 5 ), "XXXX" ),
// new TMEntry( new Point3D( 1434, 2381, 5 ), "XXXX" ),
// new TMEntry( new Point3D( 1470, 2340, 5 ), "XXXX" ),
// new TMEntry( new Point3D( 1451, 2301, 0 ), "XXXX" ),
// new TMEntry( new Point3D( 1437, 2294, 0 ), "XXXX" ),
// new TMEntry( new Point3D( 1439, 2217, 0 ), "XXXX" ),
// new TMEntry( new Point3D( 1467, 2181, 0 ), "XXXX" ),
// new TMEntry( new Point3D( 1464, 2246, 5 ), "XXXX" ),
// new TMEntry( new Point3D( 1478, 2273, 5 ), "XXXX" ),
// new TMEntry( new Point3D( 1562, 2312, 5 ), "XXXX" ),
// new TMEntry( new Point3D( 1546, 2223, 10 ), "XXXX" )
// } );
});
public static readonly TMList[] UORLists = new TMList[] { MapLocations1, MapLocations2, MapLocations3, MapLocations4, MapLocations5 };
public static readonly TMList[] UORlistsYoung = new TMList[] { MapLocations1, MapLocations2, MapLocations3, MapLocations4, MapLocations5 };
public static readonly TMList[] LBRLists = new TMList[] { MapLocations1, MapLocations2, MapLocations3, MapLocations4, MapLocations5 };
public static readonly TMList[] LBRListsYoung = new TMList[] { MapLocations1, MapLocations2, MapLocations3, MapLocations4, MapLocations5 };
public static readonly TMList[] AOSLists = new TMList[] { MapLocations1, MapLocations2, MapLocations3, MapLocations4, MapLocations5 };
public static readonly TMList[] AOSListsYoung = new TMList[] { MapLocations1, MapLocations2, MapLocations3, MapLocations4, MapLocations5 };
public static readonly TMList[] SELists = new TMList[] { MapLocations1, MapLocations2, MapLocations3, MapLocations4, MapLocations5 };
public static readonly TMList[] SEListsYoung = new TMList[] { MapLocations1, MapLocations2, MapLocations3, MapLocations4, MapLocations5 };
public static readonly TMList[] RedLists = new TMList[] { };
public static readonly TMList[] SigilLists = new TMList[] { };
}
public class ChampSpawnAltarLocationsGump : Gump
{
public static void Initialize()
{
CommandSystem.Register("CSALGump", AccessLevel.GameMaster, new CommandEventHandler(ChampSpawnAltarLocationsGump_OnCommand));
}
private static void ChampSpawnAltarLocationsGump_OnCommand(CommandEventArgs e)
{
e.Mobile.SendGump(new ChampSpawnAltarLocationsGump(e.Mobile));
}
private Mobile m_Mobile;
private TMList[] m_Lists;
public ChampSpawnAltarLocationsGump(Mobile mobile)
: base(100, 100)
{
m_Mobile = mobile;
TMList[] checkLists;
if ( mobile.Player )
{
if ( mobile.Kills >= 5 )
{
checkLists = TMList.RedLists;
}
else
{
int flags = mobile.NetState == null ? 0 : (int)mobile.NetState.Flags;
if ( Core.AOS && (flags & 0x8) != 0 )
checkLists = TMList.AOSLists;
else if ( (flags & 0x4) != 0 )
checkLists = TMList.LBRLists;
else
checkLists = TMList.UORLists;
}
}
else
{
checkLists = TMList.AOSLists;
}
m_Lists = new TMList[checkLists.Length];
for ( int i = 0; i < m_Lists.Length; ++i )
m_Lists[i] = checkLists[i];
for ( int i = 0; i < m_Lists.Length; ++i )
{
if ( m_Lists[i].Map == mobile.Map )
{
TMList temp = m_Lists[i];
m_Lists[i] = m_Lists[0];
m_Lists[0] = temp;
break;
}
}
AddPage( 0 );
AddBackground( 0, 0, 380, 500, 9200 );
AddButton( 10, 345, 4005, 4007, 1, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 45, 345, 140, 25, 1011036, false, false ); // OKAY
AddButton( 10, 370, 4005, 4007, 0, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 45, 370, 140, 25, 1011012, false, false ); // CANCEL
// AddButton( 10, 475, 4005, 4007, 2, GumpButtonType.Reply, 0 );
//AddLabel( 45, 475, 0x34, "Visit UO.STRATICS.COM Treasure Map Archive" );
AddHtmlLocalized( 5, 5, 200, 20, 1012011, false, false ); // Pick your destination:
for ( int i = 0; i < checkLists.Length; ++i )
{
AddButton( 10, 35 + (i * 25), 2117, 2118, 0, GumpButtonType.Page, Array.IndexOf( m_Lists, checkLists[i] ) + 1 );
AddHtml( 30, 35 + (i * 25), 150, 20, checkLists[i].Text, false, false );
}
for ( int i = 0; i < m_Lists.Length; ++i )
RenderPage( i, Array.IndexOf( checkLists, m_Lists[i] ) );
}
private void RenderPage( int index, int offset )
{
TMList list = m_Lists[index];
AddPage( index + 1 );
AddButton( 10, 35 + (offset * 25), 2117, 2118, 0, GumpButtonType.Page, index + 1 );
AddHtml( 30, 35 + (offset * 25), 150, 20, list.SelText, false, false );
TMEntry[] entries = list.Entries;
for ( int i = 0; i < entries.Length; ++i )
{
AddRadio( 200, 35 + (i * 25), 210, 211, false, (index * 100) + i );
AddHtml( 225, 35 + (i * 25), 150, 20, entries[i].Text, false, false );
}
}
public override void OnResponse( NetState state, RelayInfo info )
{
if ( info.ButtonID == 0 ) // Cancel
return;
else if ( m_Mobile.Deleted || m_Mobile.Map == null )
return;
int[] switches = info.Switches;
if ( switches.Length == 0 )
return;
int switchID = switches[0];
int listIndex = switchID / 100;
int listEntry = switchID % 100;
if ( listIndex < 0 || listIndex >= m_Lists.Length )
return;
TMList list = m_Lists[listIndex];
if ( listEntry < 0 || listEntry >= list.Entries.Length )
return;
TMEntry entry = list.Entries[listEntry];
if ( m_Mobile.Player && m_Mobile.Kills >= 5 && list.Map != Map.Trammel )
{
m_Mobile.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
}
else if ( m_Mobile.Criminal )
{
m_Mobile.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
}
else if ( Server.Spells.SpellHelper.CheckCombat( m_Mobile ) )
{
m_Mobile.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
}
else if ( m_Mobile.Spell != null )
{
m_Mobile.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
}
else if ( m_Mobile.Map == list.Map && m_Mobile.InRange( entry.Location, 1 ) )
{
m_Mobile.SendLocalizedMessage( 1019003 ); // You are already there.
}
else
{
BaseCreature.TeleportPets( m_Mobile, entry.Location, list.Map );
m_Mobile.Combatant = null;
m_Mobile.Warmode = false;
m_Mobile.Map = list.Map;
m_Mobile.Location = entry.Location;
}
}
}
} }

View File

@@ -0,0 +1,38 @@
using System;
using Server;
namespace Server.Items
{
public class ChampionScroll : BaseDecorationArtifact
{
public override int ArtifactRarity{ get{ return 5; } }
[Constructable]
public ChampionScroll() : base( 0xEF3 )
{
Name = "Champion Scroll";
Hue = 1175;
Weight = .01;
Stackable = true;
}
public ChampionScroll( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.WriteEncodedInt( 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadEncodedInt();
}
}
}

View File

@@ -0,0 +1,64 @@
using System;
using Server;
namespace Server.Items
{
public class ChickenSoup : Item
{
public override int LabelNumber{ get{ return 1062926; } }
[Constructable]
public ChickenSoup() : this( 1 )
{
}
[Constructable]
public ChickenSoup( int amount ) : base( 0x1606 )
{
Name = "Chicken Soup";
Stackable = true;
Amount = amount;
Movable = true;
Weight = 3.0;
}
public override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1042038 );
}
else if ( from.GetStatMod( "ChickenSoup" ) != null )
{
from.SendLocalizedMessage( 1062927 ); // This gives the player the message "You have eaten one of these recently and eating another would provide no benefit."
}
else
{
from.PlaySound( 0x1EE );
from.AddStatMod( new StatMod( StatType.Str, "ChickenSoup", 5, TimeSpan.FromMinutes( 5.0 ) ) ); // this makes DantesInks give you 5 INT for 15 mins when eaten
Consume();
}
}
public ChickenSoup( 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();
}
}
}

View File

@@ -0,0 +1,218 @@
/*
krazeykow's script, Known as "Purple Cow"
Edits: To edit the default corpse retrieval cost, please go to line 35, and
change the number 3500 in, this( 3500 ) to the cost you want default
stones to have!!
ENJOY!!
*/
using System;
using Server.Items;
using Server.Gumps;
using Server.Network;
using Server.Mobiles;
namespace Server.Gumps
{
public class CorpseStone : Item
{
private int m_Price;
[CommandProperty( AccessLevel.GameMaster )]
public int Price
{
get{ return m_Price; }
set{ m_Price = value; }
}
[Constructable]
public CorpseStone() : this( 5000 )
{
}
[Constructable]
public CorpseStone( int price ) : base( 0xED4 )
{
Movable = false;
Hue = 1109;
Name = "A Corpse Stone";
ItemID = 3805;
m_Price = price;
}
public override void OnDoubleClick( Mobile from )
{
if ( from.InRange( this.GetWorldLocation(), 2 ) )
{
from.SendGump( new ScriptCorpseGump( m_Price ) );
from.CantWalk = true;
}
else
{
from.SendMessage( "You are not close enough to use this.");
}
}
public override void OnDoubleClickDead( Mobile m )
{
Ankhs.Resurrect( m, this );
}
public CorpseStone( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int) m_Price );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
m_Price = reader.ReadInt();
}
}
}
namespace Server.Gumps
{
public class ScriptCorpseGump : Gump
{
private int m_Price;
public ScriptCorpseGump( int price ) : base( 150, 50 )
{
m_Price = price;
Closable = false;
AddPage( 0 );
AddImage( 0, 0, 3600 );
AddImageTiled( 0, 14, 15, 200, 3603 );
AddImageTiled( 380, 14, 14, 200, 3605 );
AddImage( 0, 201, 3606 );
AddImageTiled( 15, 201, 370, 16, 3607 );
AddImageTiled( 15, 0, 370, 16, 3601 );
AddImage( 380, 0, 3602 );
AddImage( 380, 201, 3608 );
AddImageTiled( 15, 15, 365, 190, 2624 );
AddRadio( 30, 140, 9727, 9730, true, 1 );
AddHtmlLocalized( 65, 145, 300, 25, 1060015, 0x7FFF, false, false ); // Grudgingly pay the money
AddRadio( 30, 175, 9727, 9730, false, 0 );
AddHtml( 65, 178, 300, 25, "<BASEFONT COLOR=White>I'll live without my corpse!!</BASEFONT>", false, false );
AddHtml( 30, 20, 360, 35, "<BASEFONT COLOR=Red>No way to get to your corpse? Simply pay the price, and your corpse will be brought to you...</BASEFONT>", false, false );
AddHtmlLocalized( 30, 105, 345, 40, 1060018, 0x5B2D, false, false ); // Do you accept the fee, which will be withdrawn from your bank?
AddImage( 65, 72, 5605 );
AddImageTiled( 80, 90, 200, 1, 9107 );
AddImageTiled( 95, 92, 200, 1, 9157 );
AddLabel( 90, 70, 1645, price.ToString() );
AddHtmlLocalized( 140, 70, 100, 25, 1023823, 0x7FFF, false, false ); // gold coins
AddButton( 290, 175, 247, 248, 2, GumpButtonType.Reply, 0 );
AddImageTiled( 15, 14, 365, 1, 9107 );
AddImageTiled( 380, 14, 1, 190, 9105 );
AddImageTiled( 15, 205, 365, 1, 9107 );
AddImageTiled( 15, 14, 1, 190, 9105 );
AddImageTiled( 0, 0, 395, 1, 9157 );
AddImageTiled( 394, 0, 1, 217, 9155 );
AddImageTiled( 0, 216, 395, 1, 9157 );
AddImageTiled( 0, 0, 1, 217, 9155 );
}
public override void OnResponse( NetState state, RelayInfo info )
{
Mobile from = state.Mobile;
from.CloseGump( typeof( ScriptCorpseGump ) );
if ( info.ButtonID == 1 || info.ButtonID == 2 )
{
Item corpse=from.Corpse;
if ( corpse!=null )
{
if ( m_Price > 0 )
{
if ( info.IsSwitched( 1 ) )
{
if ( Banker.Withdraw( from, m_Price ) )
{
from.SendLocalizedMessage( 1060398, m_Price.ToString() ); // Amount charged
from.SendLocalizedMessage( 1060022, Banker.GetBalance( from ).ToString() ); // Amount left, from bank
}
else
{
from.SendMessage( "Unfortunately, you do not have enough cash in your bank to summon your corpse" );
from.CantWalk = false;
return;
}
}
else
{
from.SendMessage( "You decide against paying the stone, leaving your corpse behind." );
from.CantWalk = false;
return;
}
}
from.Corpse.Location = new Point3D( from.Location );
Effects.SendLocationParticles( EffectItem.Create( from.Location, from.Map, EffectItem.DefaultDuration ), 0x3728, 10, 30, 5052 );
Effects.PlaySound( from.Location, from.Map, 0x201 );
from.Corpse.Map = from.Map;
from.CantWalk = false;
}
else
{
from.SendMessage( "Your corpse has decayed, or you did not have one to start out with." );
from.CantWalk = false;
}
}
}
}
}

View File

@@ -0,0 +1,31 @@
using System;
namespace Server.Items
{
[FlipableAttribute(0xB40, 0xB3F)]
public class Counter : Item
{
[Constructable]
public Counter() : base (0xB40)
{
Name = "a Counter";
Movable = true;
}
public Counter(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();
}
}
}

View File

@@ -0,0 +1,46 @@
using System;
namespace Server.Items
{
[FlipableAttribute(0xB40, 0xB3F)]
public class Counters : Item
{
[Constructable]
public Counters(int i)
{
switch (i)
{
case 1:
{
ItemID = 0xB40;
Name = "a Counter";
Movable = true;
break;
}
case 2:
{
ItemID = 0xB3F;
Name = "a Counter";
Movable = true;
break;
}
}
}
public Counters(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();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,165 @@
using System;
using Server;
using Server.Mobiles;
namespace Server.Items
{
public class DecietBrazier : Item
{
public TimeSpan m_TimeDelay = TimeSpan.FromMinutes(2);
public int m_iSpawnRange = 7;
public int m_iEventRange = 6;
private bool m_bShowWarning = true;
private DateTime m_TimeToCanSpawn;
private static Type[] m_tMonsters = new Type[]
{
typeof( HeadlessOne ),
typeof( Wraith ),
typeof( Ogre ),
typeof( Troll ),
typeof( Wyvern ),
typeof( GiantSpider ),
typeof( Slime ),
typeof( Mongbat ),
typeof( DireWolf ),
typeof( Lizardman ),
typeof( Orc ),
typeof( Skeleton ),
typeof( EarthElemental ),
typeof( Ettin ),
typeof( Ratman ),
typeof( Gazer ),
typeof( Gargoyle ),
typeof( Harpy ),
typeof( Lich ),
typeof( Nightmare ),
typeof( FireSteed ),
typeof( Drake ),
typeof( Dragon ),
typeof( Zombie )
};
#region CommandProperties
[CommandProperty( AccessLevel.GameMaster )]
public TimeSpan Delay
{
get { return m_TimeDelay; }
set { m_TimeDelay = value; }
}
[CommandProperty( AccessLevel.GameMaster )]
public int SpawnRange
{
get { return m_iSpawnRange; }
set { m_iSpawnRange = value; }
}
#endregion
[Constructable]
public DecietBrazier() : base( 0xE31 )
{
Movable = false;
Light = LightType.Circle225;
Weight = 20.0;
SetDelay();
}
private void SetDelay()
{
m_TimeToCanSpawn = DateTime.Now + m_TimeDelay;
}
public Point3D GetSpawnPosition()
{
Map map = Map;
if ( map == null )
return Location;
for ( int i = 0; i < 10; i++ )
{
int x = Location.X + (Utility.Random( (m_iSpawnRange * 2) + 1 ) - m_iSpawnRange);
int y = Location.Y + (Utility.Random( (m_iSpawnRange * 2) + 1 ) - m_iSpawnRange);
int z = Map.GetAverageZ( x, y );
if ( Map.CanSpawnMobile( new Point2D( x, y ), this.Z ) )
return new Point3D( x, y, this.Z );
else if ( Map.CanSpawnMobile( new Point2D( x, y ), z ) )
return new Point3D( x, y, z );
}
return this.Location;
}
public override void OnDoubleClick(Mobile from)
{
if ( !from.InRange( GetWorldLocation(), 2 ) )
{
from.SendLocalizedMessage( 500446 ); // That is too far away.
return;
}
if( DateTime.Now > m_TimeToCanSpawn )
{
BaseCreature creature = (BaseCreature) Activator.CreateInstance( m_tMonsters[Utility.Random(m_tMonsters.Length)] );
Point3D loc = GetSpawnPosition();
creature.MoveToWorld(loc, Map);
creature.Home = loc;
Effects.SendLocationParticles( EffectItem.Create( creature.Location, creature.Map, EffectItem.DefaultDuration ), 0x3709, 10, 30, 5052 );
Effects.PlaySound( creature.Location, creature.Map, 0x225 );
m_bShowWarning = true;
SetDelay();
}
else
from.SendLocalizedMessage(500759); // The brazier fizzes and pops, but nothing seems to happen.
}
public override bool HandlesOnMovement{ get{ return true; } }
public override void OnMovement( Mobile m, Point3D oldLocation )
{
if( m.Player )
{
bool inOldRange = Utility.InRange( oldLocation, Location, m_iEventRange );
bool inNewRange = Utility.InRange( m.Location, Location, m_iEventRange );
if ( inNewRange && !inOldRange && m_bShowWarning )
{
this.PublicOverheadMessage(Network.MessageType.Regular, 905, 500761); // Heed this warning well, and use this brazier at your own peril.
m_bShowWarning = false;
}
}
}
public DecietBrazier( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
writer.Write( (bool) m_bShowWarning );
writer.Write( (TimeSpan) m_TimeDelay );
writer.Write( (int) m_iSpawnRange );
writer.Write( (DateTime) m_TimeToCanSpawn );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
m_bShowWarning = reader.ReadBool();
m_TimeDelay = reader.ReadTimeSpan();
m_iSpawnRange = reader.ReadInt();
m_TimeToCanSpawn = reader.ReadDateTime();
SetDelay();
}
}
}

View File

@@ -0,0 +1,92 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Misc;
using Server.Gumps;
using Server.Items;
using Server.Mobiles;
using Server.Accounting;
namespace Server.Items
{
[FlipableAttribute(0x117B, 0x117C)]
public class DiscordStone : Item
{
private string _LabelMessage = "Use: Launches your browser to the Discord Invite";
private string _DiscordInviteLink = "https://discord.gg/#######";
[CommandProperty(AccessLevel.GameMaster)]
public string LabelMessage
{
get { return _LabelMessage; }
set { _LabelMessage = value; InvalidateProperties(); }
}
[CommandProperty(AccessLevel.GameMaster)]
public string DiscordInviteLink
{
get { return _DiscordInviteLink; }
set { _DiscordInviteLink = value; InvalidateProperties(); }
}
[Constructable]
public DiscordStone() : base(0x117C)
{
Name = "Discord Invite";
Hue = 0;
Movable = false;
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
list.Add(1070722, "<BIG><BASEFONT COLOR=#FF0000>"+ _LabelMessage + "</BIG><BASEFONT COLOR=#FFFFFF>");
}
public override void OnDoubleClick(Mobile from)
{
base.OnDoubleClick(from);
from.LaunchBrowser(_DiscordInviteLink);
}
public DiscordStone(Serial serial) : base(serial)
{ }
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
int version = 0;
writer.Write(version);
switch (version)
{
case 0:
{
writer.Write(_LabelMessage);
writer.Write(_DiscordInviteLink);
} break;
}
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 0:
{
_LabelMessage = reader.ReadString();
_DiscordInviteLink = reader.ReadString();
} break;
}
}
}
}

View File

@@ -0,0 +1,80 @@
using System;
using Server.Network;
using Server.Prompts;
using Server.Items;
using Server.Targeting;
using Server;
using Server.Engines.Plants;
using Server.Mobiles;
namespace Server.Items
{
public class EndlessSeedTypeTarget : Target
{
private EndlessSeedTypeBook m_Book;
public EndlessSeedTypeTarget( EndlessSeedTypeBook Book ) : base( 1, false, TargetFlags.None )
{
m_Book = Book;
}
protected override void OnTarget( Mobile from, object target )
{
if ( target is Seed )
{
Seed seed = (Seed)target;
if ( (seed).ShowType == true )
{
from.SendMessage( "That seed is already discovered!");
}
else if( seed.RootParent != from )
{
from.SendMessage( "You must have the seed in your backpack!" );
}
else
{
(seed).ShowType = true;
from.SendMessage( "You successfully discover the seed." );
}
}
else from.SendMessage( "You can only discover seeds!" );
}
}
}
public class EndlessSeedTypeBook : Item
{
[Constructable]
public EndlessSeedTypeBook()
: base(0xFBE)
{
Weight = 0;
LootType = LootType.Blessed;
Name = "A Un-Ending Seed Discoverey Book";
//Hue = 1266;
}
public EndlessSeedTypeBook(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 override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf( from.Backpack ) ) from.SendLocalizedMessage( 1042001 );
else
{
from.SendMessage("What seed would you like to discover?");
from.Target = new EndlessSeedTypeTarget( this );
}
}
}

View File

@@ -0,0 +1,414 @@
#region Header
/*
Name: FootPrints.CS
Author: Dramoor inspired by a runuo 1.0 ML server (uoex.net).
Version = 2.5
Date: 07/05/2018
All I ask if you use is to credit author and server inspired by.
this is a very stupid, and rather annoying to most, thing. Saw on a Runuo 1.0 ML server that is running.
Figured I would re-create it for a joke and then someone said they were interested in it.
Essentially lets the player have some footprints follow behind them as they walk. you can randomize
up to 5 different itemids to use.
You will need to add a function to Playermobile for this to work. (No need to serialize or deserialize
as then they will always revert all to off every restart)
private bool m_FootPrintsOn;
[CommandProperty(AccessLevel.GameMaster)]
public bool FootPrintsOn
{
get { return m_FootPrintsOn; }
set { m_FootPrintsOn = value; }
}
after adding that the rest is plug and play. Hope you enjoy.
Special Thanks to Vorspire for helping with the idea of using the Effect instead of placing actual items!
More thanks to Vorspire for helping with the placement being properly behind and not always directly below.
You have helped me learn a lot thank you!
*/
#endregion
using System;
using System.Collections;
using Server.Mobiles;
namespace Server.Items
{
public class BaseFootprints : Item
{
private bool m_TurnedOn;
private string m_PrintsName;
private int m_PrintCount;
private int m_PrintID1;
private int m_PrintID2;
private int m_PrintID3;
private int m_PrintID4;
private int m_PrintID5;
private int m_PrintsHue;
#region Getters n Setters
[CommandProperty(AccessLevel.GameMaster)]
public bool TurnedOn
{
get { return m_TurnedOn; }
set { m_TurnedOn = value; }
}
[CommandProperty(AccessLevel.GameMaster)]
public virtual string PrintsName
{
get
{
return m_PrintsName;
}
set
{
m_PrintsName = value; InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int PrintCount
{
get
{
return m_PrintCount;
}
set
{
if (value < 0)
value = 0;
m_PrintCount = value;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int PrintID1
{
get
{
return m_PrintID1;
}
set
{
if (value < 0)
value = 0;
m_PrintID1 = value;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int PrintID2
{
get
{
return m_PrintID2;
}
set
{
if (value < 0)
value = 0;
m_PrintID2 = value;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int PrintID3
{
get
{
return m_PrintID3;
}
set
{
if (value < 0)
value = 0;
m_PrintID3 = value;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int PrintID4
{
get
{
return m_PrintID4;
}
set
{
if (value < 0)
value = 0;
m_PrintID4 = value;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int PrintID5
{
get
{
return m_PrintID5;
}
set
{
if (value < 0)
value = 0;
m_PrintID5 = value;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int PrintsHue
{
get
{
return m_PrintsHue;
}
set
{
if (value < 0)
value = 0;
m_PrintsHue = value;
InvalidateProperties();
}
}
#endregion
[Constructable]
public BaseFootprints()
: base(0x1ECE)
{
PrintsName = "Base Footprint";
Name = "Footprints";
Weight = 1.0;
}
public BaseFootprints(Serial serial)
: base(serial)
{
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
if (!TurnedOn)
{
list.Add(1114774, "{0}\t{1}\t{2}", m_PrintsName, "Double click to activate.", "Turned off");
}
else
list.Add(1114774, "{0}\t{1}\t{2}", m_PrintsName, "Double click to de-activate.", "Turned on");
}
public override void OnDoubleClick(Mobile from)
{
PlayerMobile check = from as PlayerMobile;
if (!this.IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042664); // You must have the object in your backpack to use it.
return;
}
if (!TurnedOn)
{
if (!check.FootPrintsOn)
{
BeginPrints(from, this);
ItemID = 0x1ED2;
from.SendMessage("You turn the footprints on.");
TurnedOn = true;
check.FootPrintsOn = true;
}
else
{
from.SendMessage("You must turn off your other footprints first.");
}
}
else
{
if (!check.FootPrintsOn)
{
EndPrints(from);
ItemID = 0x1ECE;
from.SendMessage("Error! You obtained footprints that were turned on. Now turning off....");
TurnedOn = false;
check.FootPrintsOn = false;
}
else
{
EndPrints(from);
ItemID = 0x1ECE;
from.SendMessage("You turn the footprints off.");
TurnedOn = false;
check.FootPrintsOn = false;
}
}
}
private static Hashtable m_Table = new Hashtable();
public static void BeginPrints(Mobile m, Item z)
{
Timer t = (Timer)m_Table[m];
if (t != null)
t.Stop();
t = new InternalTimer(m, z);
m_Table[m] = t;
t.Start();
}
public static void DoPrints(Mobile m, Item b)
{
BaseFootprints c = b as BaseFootprints;
PlayerMobile pm = m as PlayerMobile;
var behind = (Direction)(((int)(m.Direction & Direction.Mask) + 4) % 8);// was 8%
int x = m.X, y = m.Y, z = m.Z;
Server.Movement.Movement.Offset(behind, ref x, ref y);
//var p = new Point3D(x, y, m.Map.GetAverageZ(x, y));
var p = new Point3D(x, y, z);
if (!c.IsChildOf(m.Backpack))
{
EndPrints(m);
c.ItemID = 0x1ECE;
m.SendMessage("The footprints must be in your pack to use. Turning them off.");
c.TurnedOn = false;
pm.FootPrintsOn = false;
return;
}
if ((m is PlayerMobile) && c != null && pm.FootPrintsOn == true)
{
if (Core.TickCount - m.LastMoveTime <= m.ComputeMovementSpeed(m.Direction) && c.IsChildOf(m.Backpack) && pm.Hidden == false)
{
int printid = 0;
switch (c.PrintCount)
{
case 0:
printid = 0x9DAC;//smoke puffs
break;
case 1:
printid = c.PrintID1;
break;
case 2:
printid = Utility.RandomList(c.PrintID1, c.PrintID2);
break;
case 3:
printid = Utility.RandomList(c.PrintID1, c.PrintID2, c.PrintID3);
break;
case 4:
printid = Utility.RandomList(c.PrintID1, c.PrintID2, c.PrintID3, c.PrintID4);
break;
case 5:
printid = Utility.RandomList(c.PrintID1, c.PrintID2, c.PrintID3, c.PrintID4, c.PrintID5);
break;
}
Effects.SendLocationEffect(p, pm.Map, printid, 13, 3, c.PrintsHue, 0);
}
}
}
public static void EndPrints(Mobile m)
{
Timer t = (Timer)m_Table[m];
if (t == null)
return;
t.Stop();
m_Table.Remove(m);
}
private class InternalTimer : Timer
{
private Mobile m_From;
private Item m_this;
private int m_Count;
public InternalTimer(Mobile from, Item o) : base(TimeSpan.FromSeconds(.1), TimeSpan.FromSeconds(.1)) //firsttime was 2 now 1
{
m_this = o;
m_From = from;
Priority = TimerPriority.TenMS;
}
protected override void OnTick()
{
DoPrints(m_From, m_this);
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)1); // version
writer.Write(m_PrintCount);
writer.Write(m_PrintID1);
writer.Write(m_PrintID2);
writer.Write(m_PrintID3);
writer.Write(m_PrintID4);
writer.Write(m_PrintID5);
writer.Write(m_PrintsHue);
writer.Write(m_PrintsName);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
switch (version)
{
case 1:
{
m_PrintCount = reader.ReadInt();
m_PrintID1 = reader.ReadInt();
m_PrintID2 = reader.ReadInt();
m_PrintID3 = reader.ReadInt();
m_PrintID4 = reader.ReadInt();
m_PrintID5 = reader.ReadInt();
m_PrintsHue = reader.ReadInt();
m_PrintsName = reader.ReadString();
goto case 0;
}
case 0:
{
if (ItemID != 0x1ECE)
ItemID = 0x1ECE;
break;
}
}
}
}
}

View File

@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using Server;
using Server.Multis;
using Server.Network;
namespace Server.Items
{
[Furniture]
[FlipableAttribute( 0x4910, 0x4911 )]
public class GothicChest : BaseContainer
{
[Constructable]
public GothicChest() : base( 0x4910 )
{
Name = "Gothic Chest";
Weight = 5.0;
}
public override int DefaultGumpID{ get{ return 0x49; } }
public override int DefaultDropSound{ get{ return 0x42; } }
public GothicChest( 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();
}
}
}

View File

@@ -0,0 +1,115 @@
using System;
using Server;
using Server.Mobiles;
using Server.Network;
using Server.Prompts;
namespace Server.Items
{
public class GuildTravelPrompt : Prompt
{
private readonly Mobile m_Mobile;
public GuildTravelPrompt(Mobile from)
{
this.m_Mobile = from;
}
public override void OnResponse(Mobile from, string name)
{
bool Flagged = false;
foreach (NetState state in NetState.Instances)
{
Mobile m = state.Mobile;
if (m != null && m.Guild == from.Guild && m.Name == name)
{
if (m.Backpack.FindItemByType(typeof(GuildTravelStone)) != null)
{
if (from.Backpack != null)
{
if (from.Backpack.FindItemByType(typeof(BlackPearl)) != null && from.Backpack.FindItemByType (typeof(Bloodmoss)) != null && from.Backpack.FindItemByType (typeof(MandrakeRoot)) != null) {
from.Backpack.FindItemByType(typeof(BlackPearl)).Consume();
from.Backpack.FindItemByType(typeof(Bloodmoss)).Consume();
from.Backpack.FindItemByType(typeof(MandrakeRoot)).Consume();
from.PublicOverheadMessage(MessageType.Spell, from.SpeechHue, true, "Kal Ort Por", false);
from.PlaySound (0x1FC);
from.SendMessage("Teleporting to guildmate...");
from.Map = m.Map;
from.Location = m.Location;
from.PlaySound(0x1FC);
Flagged = true;
}
else
{
from.SendMessage(0x22, "You do not have enough reagents to cast Recall!");
Flagged = true;
}
}
else
{
from.SendMessage(0x22, "We could not find your backpack.");
Flagged = true;
}
}
else
{
from.SendMessage(0x22, "This guild member does not have a Guild Travel Stone in his backpack!");
Flagged = true;
}
}
else if (m != null && m.Guild != from.Guild && m.Name == name)
{
from.SendMessage(0x22, "This mobile is not in your guild!");
Flagged = true;
}
}
if (Flagged == false){
from.SendMessage(0x22, "We did not find an online member of your guild with that name.");
}
}
public override void OnCancel(Mobile from)
{
return;
}
}
public class GuildTravelStone : DecoMagicalCrystal
{
private readonly PlayerMobile m_Guildmate;
[Constructable]
public GuildTravelStone()
{
this.Name = "Guild Travel Stone";
this.Hue = 0x495;
}
public GuildTravelStone(Serial serial)
: base(serial)
{
}
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
from.SendMessage("The item needs to be in your pack");
}
else
{
from.SendMessage("Type the name of the guildmate you wish to teleport too:");
from.Prompt = new GuildTravelPrompt(from);
}
}
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();
}
}
}

View File

@@ -0,0 +1,109 @@
//Created by Durant of GOP//
//based off of a pile of snow//
using System;
using System.Collections;
using Server.Network;
using Server.Items;
using Server.Targeting;
namespace Server.Items
{
public class HalloweenEggs : Item
{
[Constructable]
public HalloweenEggs() : base( 2485 )
{
Hue = 1150;
Weight = 1.0;
//LootType = LootType.Blessed;
Name = "Halloween Throwing Eggs";
}
public HalloweenEggs( Serial serial ) : base( serial )
{
}
private DateTime m_NextAbilityTime;
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();
m_NextAbilityTime = DateTime.Now;
}
public override void OnDoubleClick( Mobile from )
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage( 1042010 );
return;
}
else
{
if ( DateTime.Now >= m_NextAbilityTime )
{
from.Target = new EggTarget( from, this );
from.SendMessage( "You hide the egg in your hand and prepare to throw" );
}
else
{
from.SendMessage( "You are not ready to throw the egg yet" );
}
}
}
private class EggTarget : Target
{
private Mobile m_Thrower;
private HalloweenEggs m_Egg;
public EggTarget( Mobile thrower, HalloweenEggs egg ) : base ( 10, false, TargetFlags.None )
{
m_Thrower = thrower;
m_Egg=egg;
}
protected override void OnTarget( Mobile from, object target )
{
if( target == from )
from.SendLocalizedMessage( 1005576 );
else if( target is Mobile)
{
Mobile m = (Mobile)target;
from.PlaySound( 0x145 );
from.Animate( 9, 1, 1, true, false, 0 );
from.SendMessage( "You throw the eggs and strike your target" );
m.SendMessage( "The eggs splatter as they hit you" );
Effects.SendMovingEffect( from, m, 0x36E4, 7, 0, false, true, 1259, 0 );
m_Egg.m_NextAbilityTime = DateTime.Now + TimeSpan.FromSeconds( 2.0 ) ;
}
else
{
from.SendMessage( "You cannot throw more eggs yet" );
}
}
}
}
}

View File

@@ -0,0 +1,43 @@
using System;
using Server;
using Server.Items;
namespace Server.Items
{
public class Impassable : Item
{
/// <summary>
/// This is an Item that was created to make invisible
/// barriers for players not be able to pass.
/// </summary>
[Constructable]
public Impassable() : base(0x1184)
{
Weight = 0;
Name = "An Impassable Object";
Visible = false;
Movable = false;
}
public Impassable(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();
}
}
}

View File

@@ -0,0 +1,67 @@
using System;
namespace Server.Items
{
[FlipableAttribute( 0xFAF, 0xFB0 )]
[Server.Engines.Craft.Anvil]
public class PortableAnvil : Item
{
[Constructable]
public PortableAnvil() : base( 0xFAF )
{
Name = "Portable Anvil";
Movable = true;
LootType = LootType.Blessed;
Hue = 1150;
}
public PortableAnvil(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();
}
}
[Server.Engines.Craft.Forge]
public class PortableForge : Item
{
[Constructable]
public PortableForge() : base(0x19BB)
{
Name = "Portable Forge";
Movable = true;
LootType = LootType.Blessed;
Hue = 1150;
}
public PortableForge( 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();
}
}
}

View File

@@ -0,0 +1,55 @@
using System;
using Server;
using Server.Engines.Craft;
namespace Server.Items
{
[Server.Engines.Craft.Forge]
public class PoweredForge : Item
{
private int m_UsesRemaining;
[CommandProperty(AccessLevel.GameMaster)]
public int UsesRemaining
{
get
{
return this.m_UsesRemaining;
}
set
{
this.m_UsesRemaining = value;
this.InvalidateProperties();
}
}
[Constructable]
public PoweredForge()
: base(0xFB1)
{
this.Movable = false;
UsesRemaining = 100;
}
public PoweredForge(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
writer.Write((int)this.m_UsesRemaining);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
this.m_UsesRemaining = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,134 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Network;
using Server.Gumps;
using Server.Multis;
using Server.Engines.BulkOrders;
using Server.ContextMenus;
namespace Server.Items
{
public class RegenBODBook : Item, ISecurable
{
private int m_Deed;
[CommandProperty( AccessLevel.GameMaster )]
public int Deed
{
get{ return m_Deed; }
set{ m_Deed = value; InvalidateProperties(); }
}
private Timer m_Timer;
private SecureLevel m_Level;
[CommandProperty( AccessLevel.GameMaster )]
public SecureLevel Level { get { return m_Level; } set { m_Level = value; } }
[Constructable]
public RegenBODBook () : base(0x2259)
{
Name = "Regenerating BOD Book";//<----CHANGE NAME
Hue = 1366;//<----CHANGE HUE
Weight = 2.0;
LootType = LootType.Blessed;
m_Timer = Timer.DelayCall( TimeSpan.FromHours( 1 ), TimeSpan.FromHours( 2 ), new TimerCallback( GiveDeed ) );
}
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
{
base.GetContextMenuEntries( from, list );
SetSecureLevelEntry.AddTo( from, this, list );
}
public RegenBODBook(Serial serial)
: base(serial)
{
}
private void GiveDeed()
{
m_Deed = Math.Min( 100, m_Deed + 1 );
}
public override void OnDoubleClick( Mobile from )
{
if ( !from.InRange( GetWorldLocation(), 2 ) )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
}
else if ( m_Deed > 0 )
{
Item Deed = null;
switch ( Utility.Random( 4 ) )
{
case 0: Deed = new LargeSmithBOD(); break;
case 1: Deed = new SmallSmithBOD(); break;
case 2: Deed = new LargeTailorBOD(); break;
case 3: Deed = new SmallTailorBOD(); break;
}
int amount = Math.Min( 1, m_Deed );
Deed.Amount = amount;
if ( !from.PlaceInBackpack( Deed ) )
{
Deed.Delete();
from.SendLocalizedMessage( 1078837 ); // Your backpack is full! Please make room and try again.
}
else
{
m_Deed -= amount;
PublicOverheadMessage( MessageType.Regular, 0x3B2, 503201 ); // You take the item.
}
}
else
from.SendMessage( "There are no more BOD's available." ); // There are no more BOD's available.
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.WriteEncodedInt( 0 ); // version
writer.WriteEncodedInt( (int) m_Level );
writer.Write( (int) m_Deed );
if ( m_Timer != null )
writer.Write( (DateTime) m_Timer.Next );
else
writer.Write( (DateTime) DateTime.Now + TimeSpan.FromHours( 2 ) );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadEncodedInt();
m_Level = (SecureLevel) reader.ReadEncodedInt();
m_Deed = reader.ReadInt();
DateTime next = reader.ReadDateTime();
if ( next < DateTime.Now )
next = DateTime.Now;
m_Timer = Timer.DelayCall( next - DateTime.Now, TimeSpan.FromHours( 2 ), new TimerCallback( GiveDeed ) );
}
}
}

View File

@@ -0,0 +1,108 @@
//Created by Durant of GOP//
//based off of a pile of snow//
using System;
using System.Collections;
using Server.Network;
using Server.Items;
using Server.Targeting;
namespace Server.Items
{
public class ShavingCream : Item
{
[Constructable]
public ShavingCream() : base( 4102 )
{
Hue = 1153;
Weight = 1.0;
Name = "Shaving Cream";
}
public ShavingCream( Serial serial ) : base( serial )
{
}
private DateTime m_NextAbilityTime;
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();
m_NextAbilityTime = DateTime.Now;
}
public override void OnDoubleClick( Mobile from )
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage( 1042010 );
return;
}
else
{
if ( DateTime.Now >= m_NextAbilityTime )
{
from.Target = new CreamTarget( from, this );
from.SendMessage( "You hide the can of shaving cream as you get closer" );
}
else
{
from.SendMessage( "You are not ready to shoot the shaving cream yet" );
}
}
}
private class CreamTarget : Target
{
private Mobile m_Thrower;
private ShavingCream m_Cream;
public CreamTarget( Mobile thrower, ShavingCream cream ) : base ( 10, false, TargetFlags.None )
{
m_Thrower = thrower;
m_Cream=cream;
}
protected override void OnTarget( Mobile from, object target )
{
if( target == from )
from.SendLocalizedMessage( 1005576 );
else if( target is Mobile)
{
Mobile m = (Mobile)target;
from.PlaySound( 0x1DE );
//from.Animate( 9, 1, 1, true, false, 0 );
from.SendMessage( "You shoot the shaving cream" );
m.SendMessage( "The shaving cream covers your face" );
Effects.SendMovingEffect( from, m, 0x36F4, 7, 0, false, true, 1149, 0 );
m_Cream.m_NextAbilityTime = DateTime.Now + TimeSpan.FromSeconds( 2.0 ) ;
}
else
{
from.SendMessage( "You cannot shoot more shaving cream yet" );
}
}
}
}
}

View File

@@ -0,0 +1,271 @@
using System;
using Server;
using Server.Network;
using Server.Mobiles;
using Server.Items;
using Server.Gumps;
using Server.Misc;
// COPYRIGHT BY ROMANTHEBRAIN
namespace Server
{
public class SkilllimPickGump : Gump
{
private int switches = 7;
private SkillBall m_SkillBall;
private double val = 100;
public SkilllimPickGump(SkillBall ball, Mobile player)
: base(0, 0)
{
this.Closable = true;
this.Disposable = true;
this.Dragable = true;
this.Resizable = true;
m_SkillBall = ball;
this.AddPage(0);
this.AddBackground(39, 33, 750, 500, 9200);
this.AddLabel(67, 41, 1153, @"Please select your 7 skills");
this.AddButton(80, 500, 2071, 2072, (int)Buttons.Close, GumpButtonType.Reply, 0);
this.AddBackground(52, 60, 720, 430, 9350);
this.AddPage(1);
this.AddButton(690, 500, 2311, 2312, (int)Buttons.FinishButton, GumpButtonType.Reply, 0);
this.AddCheck(55, 65, 210, 211, false, (int)SkillName.Alchemy);
this.AddCheck(55, 90, 210, 211, false, (int)SkillName.Anatomy);
this.AddCheck(55, 115, 210, 211, false, (int)SkillName.AnimalLore);
this.AddCheck(55, 140, 210, 211, false, (int)SkillName.AnimalTaming);
if (player.Race != Race.Gargoyle)
{
this.AddCheck(55, 165, 210, 211, false, (int)SkillName.Archery);
}
else
{
this.AddCheck(55, 165, 210, 211, false, (int)SkillName.Throwing);
}
this.AddCheck(55, 190, 210, 211, false, (int)SkillName.ArmsLore);
this.AddCheck(55, 215, 210, 211, false, (int)SkillName.Begging);
this.AddCheck(55, 240, 210, 211, false, (int)SkillName.Blacksmith);
this.AddCheck(55, 265, 210, 211, false, (int)SkillName.Bushido);
this.AddCheck(55, 290, 210, 211, false, (int)SkillName.Camping);
this.AddCheck(55, 315, 210, 211, false, (int)SkillName.Carpentry);
this.AddCheck(55, 340, 210, 211, false, (int)SkillName.Cartography);
this.AddCheck(55, 365, 210, 211, false, (int)SkillName.Chivalry);
this.AddCheck(55, 390, 210, 211, false, (int)SkillName.Cooking);
this.AddCheck(55, 415, 210, 211, false, (int)SkillName.DetectHidden);
this.AddCheck(55, 440, 210, 211, false, (int)SkillName.Discordance);
this.AddCheck(55, 465, 210, 211, false, (int)SkillName.EvalInt);
this.AddLabel(80, 65, 0, SkillName.Alchemy.ToString());
this.AddLabel(80, 90, 0, SkillName.Anatomy.ToString());
this.AddLabel(80, 115, 0, SkillName.AnimalLore.ToString());
this.AddLabel(80, 140, 0, SkillName.AnimalTaming.ToString());
if (player.Race != Race.Gargoyle)
{
this.AddLabel(80, 165, 0, SkillName.Archery.ToString());
}
else
{
this.AddLabel(80, 165, 0, SkillName.Throwing.ToString());
}
this.AddLabel(80, 190, 0, SkillName.ArmsLore.ToString());
this.AddLabel(80, 215, 0, SkillName.Begging.ToString());
this.AddLabel(80, 240, 0, SkillName.Blacksmith.ToString());
this.AddLabel(80, 265, 0, SkillName.Bushido.ToString());
this.AddLabel(80, 290, 0, SkillName.Camping.ToString());
this.AddLabel(80, 315, 0, SkillName.Carpentry.ToString());
this.AddLabel(80, 340, 0, SkillName.Cartography.ToString());
this.AddLabel(80, 365, 0, SkillName.Chivalry.ToString());
this.AddLabel(80, 390, 0, SkillName.Cooking.ToString());
this.AddLabel(80, 415, 0, SkillName.DetectHidden.ToString());
this.AddLabel(80, 440, 0, SkillName.Discordance.ToString());
this.AddLabel(80, 465, 0, SkillName.EvalInt.ToString());
// ********************************************************
this.AddCheck(240, 65, 210, 211, false, (int)SkillName.Fencing);
this.AddCheck(240, 90, 210, 211, false, (int)SkillName.Fishing);
this.AddCheck(240, 115, 210, 211, false, (int)SkillName.Fletching);
this.AddCheck(240, 140, 210, 211, false, (int)SkillName.Focus);
this.AddCheck(240, 165, 210, 211, false, (int)SkillName.Forensics);
this.AddCheck(240, 190, 210, 211, false, (int)SkillName.Healing);
this.AddCheck(240, 215, 210, 211, false, (int)SkillName.Herding);
this.AddCheck(240, 240, 210, 211, false, (int)SkillName.Hiding);
this.AddCheck(240, 265, 210, 211, false, (int)SkillName.Inscribe);
this.AddCheck(240, 290, 210, 211, false, (int)SkillName.ItemID);
this.AddCheck(240, 315, 210, 211, false, (int)SkillName.Lockpicking);
this.AddCheck(240, 340, 210, 211, false, (int)SkillName.Lumberjacking);
this.AddCheck(240, 365, 210, 211, false, (int)SkillName.Macing);
this.AddCheck(240, 390, 210, 211, false, (int)SkillName.Magery);
this.AddCheck(240, 415, 210, 211, false, (int)SkillName.MagicResist);
this.AddCheck(240, 440, 210, 211, false, (int)SkillName.Meditation);
this.AddCheck(240, 465, 210, 211, false, (int)SkillName.Mining);
this.AddLabel(265, 65, 0, SkillName.Fencing.ToString());
this.AddLabel(265, 90, 0, SkillName.Fishing.ToString());
this.AddLabel(265, 115, 0, SkillName.Fletching.ToString());
this.AddLabel(265, 140, 0, SkillName.Focus.ToString());
this.AddLabel(265, 165, 0, SkillName.Forensics.ToString());
this.AddLabel(265, 190, 0, SkillName.Healing.ToString());
this.AddLabel(265, 215, 0, SkillName.Herding.ToString());
this.AddLabel(265, 240, 0, SkillName.Hiding.ToString());
this.AddLabel(265, 265, 0, SkillName.Inscribe.ToString());
this.AddLabel(265, 290, 0, SkillName.ItemID.ToString());
this.AddLabel(265, 315, 0, SkillName.Lockpicking.ToString());
this.AddLabel(265, 340, 0, SkillName.Lumberjacking.ToString());
this.AddLabel(265, 365, 0, SkillName.Macing.ToString());
this.AddLabel(265, 390, 0, SkillName.Magery.ToString());
this.AddLabel(265, 415, 0, SkillName.MagicResist.ToString());
this.AddLabel(265, 440, 0, SkillName.Meditation.ToString());
this.AddLabel(265, 465, 0, SkillName.Mining.ToString());
// ********************************************************
this.AddCheck(425, 65, 210, 211, false, (int)SkillName.Musicianship);
this.AddCheck(425, 90, 210, 211, false, (int)SkillName.Necromancy);
this.AddCheck(425, 115, 210, 211, false, (int)SkillName.Ninjitsu);
this.AddCheck(425, 140, 210, 211, false, (int)SkillName.Parry);
this.AddCheck(425, 165, 210, 211, false, (int)SkillName.Peacemaking);
this.AddCheck(425, 190, 210, 211, false, (int)SkillName.Poisoning);
this.AddCheck(425, 215, 210, 211, false, (int)SkillName.Provocation);
this.AddCheck(425, 240, 210, 211, false, (int)SkillName.RemoveTrap);
this.AddCheck(425, 265, 210, 211, false, (int)SkillName.Snooping);
this.AddCheck(425, 290, 210, 211, false, (int)SkillName.Spellweaving);
this.AddCheck(425, 315, 210, 211, false, (int)SkillName.SpiritSpeak);
this.AddCheck(425, 340, 210, 211, false, (int)SkillName.Stealing);
this.AddCheck(425, 365, 210, 211, false, (int)SkillName.Stealth);
this.AddCheck(425, 390, 210, 211, false, (int)SkillName.Swords);
this.AddCheck(425, 415, 210, 211, false, (int)SkillName.Tactics);
this.AddCheck(425, 440, 210, 211, false, (int)SkillName.Tailoring);
this.AddCheck(425, 465, 210, 211, false, (int)SkillName.TasteID);
this.AddLabel(450, 65, 0, SkillName.Musicianship.ToString());
this.AddLabel(450, 90, 0, SkillName.Necromancy.ToString());
this.AddLabel(450, 115, 0, SkillName.Ninjitsu.ToString());
this.AddLabel(450, 140, 0, SkillName.Parry.ToString());
this.AddLabel(450, 165, 0, SkillName.Peacemaking.ToString());
this.AddLabel(450, 190, 0, SkillName.Poisoning.ToString());
this.AddLabel(450, 215, 0, SkillName.Provocation.ToString());
this.AddLabel(450, 240, 0, SkillName.RemoveTrap.ToString());
this.AddLabel(450, 265, 0, SkillName.Snooping.ToString());
this.AddLabel(450, 290, 0, SkillName.Spellweaving.ToString());
this.AddLabel(450, 315, 0, SkillName.SpiritSpeak.ToString());
this.AddLabel(450, 340, 0, SkillName.Stealing.ToString());
this.AddLabel(450, 365, 0, SkillName.Stealth.ToString());
this.AddLabel(450, 390, 0, SkillName.Swords.ToString());
this.AddLabel(450, 415, 0, SkillName.Tactics.ToString());
this.AddLabel(450, 440, 0, SkillName.Tailoring.ToString());
this.AddLabel(450, 465, 0, SkillName.TasteID.ToString());
//**********************************************************
this.AddCheck(610, 65, 210, 211, false, (int)SkillName.Tinkering);
this.AddCheck(610, 90, 210, 211, false, (int)SkillName.Tracking);
this.AddCheck(610, 115, 210, 211, false, (int)SkillName.Veterinary);
this.AddCheck(610, 140, 210, 211, false, (int)SkillName.Wrestling);
this.AddCheck(610, 165, 210, 211, false, (int)SkillName.Mysticism);
this.AddCheck(610, 190, 210, 211, false, (int)SkillName.Imbuing);
this.AddLabel(635, 65, 0, SkillName.Tinkering.ToString());
this.AddLabel(635, 90, 0, SkillName.Tracking.ToString());
this.AddLabel(635, 115, 0, SkillName.Veterinary.ToString());
this.AddLabel(635, 140, 0, SkillName.Wrestling.ToString());
this.AddLabel(635, 165, 0, SkillName.Mysticism.ToString());
this.AddLabel(635, 190, 0, SkillName.Imbuing.ToString());
//**********************************************************
}
public enum Buttons
{
Close,
FinishButton,
}
public override void OnResponse(NetState state, RelayInfo info)
{
Mobile m = state.Mobile;
switch (info.ButtonID)
{
case 0: { break; }
case 1:
{
if (info.Switches.Length < switches)
{
m.SendGump(new SkilllimPickGump(m_SkillBall, m));
m.SendMessage(0, "You must pick {0} more skills.", switches - info.Switches.Length);
break;
}
else if (info.Switches.Length > switches)
{
m.SendGump(new SkilllimPickGump(m_SkillBall, m));
m.SendMessage(0, "Please get rid of {0} skills, you have exceeded the 7 skills that are allowed.", info.Switches.Length - switches);
break;
}
else
{
Server.Skills skills = m.Skills;
//for (int i = 0; i < skills.Length; ++i)
//skills[i].Base = 0;
for (int i = 0; i < skills.Length; ++i)
{
if (info.IsSwitched(i))
m.Skills[i].Base = val;
}
m_SkillBall.Delete();
}
break;
}
}
}
}
public class SkillBall : Item
{
[Constructable]
public SkillBall()
: base(0x2AAA)
{
Weight = 1.0;
Hue = 1153;
Name = "Use this to set 7 skills to 100";
LootType = LootType.Blessed;
Movable = false;
}
public override void OnDoubleClick(Mobile m)
{
if (m.Backpack != null && m.Backpack.GetAmount(typeof(SkillBall)) > 0)
{
m.SendMessage("Please choose your 7 skills to set to 7x GM.");
m.CloseGump(typeof(SkilllimPickGump));
m.SendGump(new SkilllimPickGump(this, m));
}
else
m.SendMessage(" You need to have the skill ball in your backpack.");
}
public SkillBall(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)1); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,75 @@
using System;
using System.Collections;
using Server;
using Server.Mobiles;
using Server.Network;
/*
Use < [add SpeakingSign "enter custom name" > command to set name of item when creating it.
This allows you to set name with spaces between words,
*/
namespace Server.Items
{
[FlipableAttribute(0x0BCF, 0x0BD0, 0x0BD1, 0x0BD2, 0x1F28, 0x1F29, 0x1297, 0x1298, 0x1299, 0x129A, 0x129B, 0x129C, 0x129D, 0x129E)]
public class SpeakingSign : Item
{
private DateTime LastUse;
public virtual TimeSpan Delay { get { return TimeSpan.FromMinutes(2.0); } }
public string Message { get; set; }
[Constructable]
public SpeakingSign(string message) : base(0x0BCF)
{
Movable = false;
Name = "a sign";
Message = message;
}
public virtual void HeedWarning()
{
//PublicOverheadMessage( type, hue, number, "" );
PublicOverheadMessage(MessageType.Regular, 0x3B2, false, String.Format("{0}", Message));
}
public override bool HandlesOnMovement { get { return true; } }
public override void OnMovement(Mobile m, Point3D oldLocation)
{
if (m.AccessLevel > AccessLevel.Player && m.Hidden)
return;
if (m is PlayerMobile && m.InRange(this, 10))
{
if (LastUse + Delay > DateTime.Now)
{
return;
}
else
{
HeedWarning();
LastUse = DateTime.Now;
}
}
}
public SpeakingSign(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();
}
}
}

View File

@@ -0,0 +1,228 @@
//Version 1.1
using System;
using System.Collections;
using Server;
using Server.Prompts;
using Server.Mobiles;
using Server.Network;
using Server.Gumps;
using Server.Items;
namespace Server.Items
{
public class StatBall : Item
{
[Constructable]
public StatBall() : base(0xE73)
{
Weight = 1.0;
Hue = 39;
Name = "a stat ball";
LootType = LootType.Blessed;
Movable = false;
}
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
return;
}
else if (from is PlayerMobile)
{
if (from.Str < 75)
{
from.Str = 75;
from.SendMessage("Your STR has been set to 75/{0}.", from.StrCap);
}
if (from.Int < 75)
{
from.Int = 75;
from.SendMessage("Your INT has been set to 75/{0}.", from.IntCap);
}
if (from.Dex < 75)
{
from.Dex = 75;
from.SendMessage("Your DEX has been set to 75/{0}.", from.DexCap);
}
if (from.StrMaxCap != 500)
{
from.StrMaxCap = 500;
from.SendMessage("Your STR Max Cap has been reset.");
}
if (from.DexMaxCap != 500)
{
from.DexMaxCap = 500;
from.SendMessage("Your DEX Max Cap has been reset.");
}
if (from.IntMaxCap != 500)
{
from.IntMaxCap = 500;
from.SendMessage("Your INT Max Cap has been reset.");
}
//from.SendMessage("You have been given a Starter Stat Boost of 75 in each Stat.");
this.Delete();
//from.SendGump(new StatBallGump((PlayerMobile)from, this));
}
}
public override bool DisplayLootType { get { return false; } }
public StatBall(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();
}
}
}
namespace Server.Items
{
public class StatBallGump : Gump
{
//-----------------
// Edit to your liking or leave blank for default values
//------------------------
private int statcap;
private int defaultStr;
private int defaultDex;
private int defaultInt;
private int maxStr;
private int maxDex;
private int maxInt;
//-----------------------
private PlayerMobile m_From;
private StatBall m_Ball;
private int str;
private int dex;
private int intel;
public StatBallGump(PlayerMobile from, StatBall ball) : base(50, 50)
{
m_From = from;
m_Ball = ball;
if (statcap <= 0)
{
statcap = m_From.StatCap;
}
if (defaultStr <= 0)
{
defaultStr = 50;
}
if (defaultDex <= 0)
{
defaultDex = 50;
}
if (defaultInt <= 0)
{
defaultInt = 50;
}
if (maxStr <= 0)
{
maxStr = 105;
}
if (maxDex <= 0)
{
maxDex = 105;
}
if (maxInt <= 0)
{
maxInt = 105;
}
this.Closable = true;
this.Disposable = true;
this.Dragable = true;
this.Resizable = false;
this.AddPage(0);
this.AddBackground(50, 50, 437, 215, 9200);
this.AddLabel(200, 67, 1160, "Stat Ball Selection");
this.AddLabel(114, 96, 1160, "Choose your Strength, Dexterity, and Intelligence");
this.AddLabel(69, 156, 1152, "STR");
this.AddLabel(213, 156, 1152, "DEX");
this.AddLabel(353, 156, 1152, "INT");
this.AddTextEntry(109, 156, 32, 20, 1359, 0, defaultStr.ToString());
this.AddTextEntry(253, 156, 32, 20, 1359, 1, defaultDex.ToString());
this.AddTextEntry(393, 156, 32, 20, 1359, 2, defaultInt.ToString());
this.AddLabel(139, 156, 1152, " / " + maxStr.ToString());
this.AddLabel(283, 156, 1152, " / " + maxDex.ToString());
this.AddLabel(423, 156, 1152, " / " + maxInt.ToString());
this.AddButton(405, 221, 238, 240, 4, GumpButtonType.Reply, 0);
this.AddLabel(140, 200, 1152, "* Stat totals should equal " + statcap + " *");
}
public override void OnResponse(NetState sender, RelayInfo info)
{
if (m_Ball.Deleted)
return;
TextRelay s = info.GetTextEntry(0);
try
{
str = Convert.ToInt32(s.Text);
}
catch
{
m_From.SendMessage("Bad strength entry. A number was expected.");
}
TextRelay d = info.GetTextEntry(1);
try
{
dex = Convert.ToInt32(d.Text);
}
catch
{
m_From.SendMessage("Bad dexterity entry. A number was expected.");
}
TextRelay i = info.GetTextEntry(2);
try
{
intel = Convert.ToInt32(i.Text);
}
catch
{
m_From.SendMessage("Bad intelligence entry. A number was expected.");
}
if (str > 0 && dex > 0 && intel > 0)
{
// Uncomment the line line below, and add a comment to the line under it to use a defined number instead of the standard Stat Cap
// if ( ( ( str + dex + intel ) > Cap ) || ( ( str + dex + intel ) < Cap ) || ( str < 10 ) || ( dex < 10 ) || ( intel < 10 ) )
if (((str + dex + intel) > statcap) || ((str + dex + intel) < statcap) || (str < 10) || (dex < 10) || (intel < 10) || (str > maxStr) || (dex > maxDex) || (intel > maxInt))
m_From.SendMessage("Your choice totals are invalid. Please try again!");
else
{
m_From.RawStr = str;
m_From.RawDex = dex;
m_From.RawInt = intel;
m_Ball.Delete();
}
}
}
}
}

View File

@@ -0,0 +1,627 @@
//Trammel Treasure Map Locations Book
//by henry_r
//02/16/08
//based on uo.stratics.com treasure map archive
//special thanks to Joeku for help with the weblink
using System;
using System.Collections;
using System.Text;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Mobiles;
using Server.Commands;
namespace Server.Items
{
public class TMapLocationsBook : Item
{
[Constructable]
public TMapLocationsBook() : base( 0x2D50 )
{
Movable = true;
Hue = 51;
Weight = 0.0;
Name = " Trammel Treasure Map Locations";
LootType = LootType.Blessed;
}
public TMapLocationsBook( Serial serial ) : base( serial )
{
}
public override void OnDoubleClick( Mobile from )
{
if ( !from.Player )
return;
if ( from.InRange( GetWorldLocation(), 1 ) )
UseGate( from );
else
from.SendLocalizedMessage( 500446 ); // That is too far away.
}
public override bool OnMoveOver( Mobile m )
{
return !m.Player || UseGate( m );
}
public bool UseGate( Mobile m )
{
if ( m.Criminal )
{
m.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
return false;
}
else if ( Server.Spells.SpellHelper.CheckCombat( m ) )
{
m.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
return false;
}
else if ( Server.Misc.WeightOverloading.IsOverloaded( m ) )
{
m.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
return false;
}
else if ( m.Region is Server.Regions.Jail )
{
m.SendLocalizedMessage( 1041530, "", 0x35 ); // You'll need a better jailbreak plan then that!
return false;
}
else if ( Server.Factions.Sigil.ExistsOn( m ) )
{
m.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
return false;
}
else if ( m.Spell != null )
{
m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
return false;
}
else
{
m.CloseGump( typeof( MapLocationsGump ) );
m.SendGump( new MapLocationsGump( m ) );
//Effects.PlaySound( m.Location, m.Map, 0x20E );
return true;
}
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
public class TMEntry
{
private Point3D m_Location;
private string m_Text;
public Point3D Location
{
get
{
return m_Location;
}
}
public string Text
{
get
{
return m_Text;
}
}
public TMEntry( Point3D loc, string text )
{
m_Location = loc;
m_Text = text;
}
}
public class TMList
{
private string m_Text, m_SelText;
private Map m_Map;
private TMEntry[] m_Entries;
public string Text
{
get
{
return m_Text;
}
}
public string SelText
{
get
{
return m_SelText;
}
}
public Map Map
{
get
{
return m_Map;
}
}
public TMEntry[] Entries
{
get
{
return m_Entries;
}
}
public TMList( string text, string selText, Map map, TMEntry[] entries )
{
m_Text = text;
m_SelText = selText;
m_Map = map;
m_Entries = entries;
}
public static readonly TMList MapLocations1 =
new TMList("Maps 1-17", "Maps 1-17", Map.Trammel, new TMEntry[]
{
new TMEntry( new Point3D( 961, 506, 0 ), "1" ),
new TMEntry( new Point3D( 1162, 189, 6 ), "2" ),
new TMEntry( new Point3D( 1315, 317, 22 ), "3" ),
new TMEntry( new Point3D( 1469, 230, 16 ), "4" ),
new TMEntry( new Point3D( 1504, 364, 0 ), "5" ),
new TMEntry( new Point3D( 2672, 392, 15 ), "6" ),
new TMEntry( new Point3D( 2741, 435, 15 ), "7" ),
new TMEntry( new Point3D( 2770, 345, 15 ), "8" ),
new TMEntry( new Point3D( 2781, 289, 15 ), "9" ),
new TMEntry( new Point3D( 2836, 233, 0 ), "10" ),
new TMEntry( new Point3D( 3014, 250, 0 ), "11" ),
new TMEntry( new Point3D( 3082, 202, 4 ), "12" ),
new TMEntry( new Point3D( 1028, 1181, 0 ), "13" ),
new TMEntry( new Point3D( 1318, 889, 0 ), "14" ),
new TMEntry( new Point3D( 1414, 771, 0 ), "15" ),
new TMEntry( new Point3D( 1530, 753, 16 ), "16" ),
new TMEntry( new Point3D( 1555, 806, 0 ), "17" )
} );
public static readonly TMList MapLocations2 =
new TMList("Maps 18-34", "Maps 18-34", Map.Trammel, new TMEntry[]
{
new TMEntry( new Point3D( 1510, 968, 0 ), "18" ),
new TMEntry( new Point3D( 1561, 1058, 0 ), "19" ),
new TMEntry( new Point3D( 1510, 1071, 0 ), "20" ),
new TMEntry( new Point3D( 2339, 645, 0 ), "21" ),
new TMEntry( new Point3D( 2350, 689, 0 ), "22" ),
new TMEntry( new Point3D( 2396, 723, 0 ), "23" ),
new TMEntry( new Point3D( 2433, 767, 0 ), "24" ),
new TMEntry( new Point3D( 2643, 853, 0 ), "25" ),
new TMEntry( new Point3D( 2458, 1042, 0 ), "26" ),
new TMEntry( new Point3D( 2517, 1066, 0 ), "27" ),
new TMEntry( new Point3D( 2338, 1159, 5 ), "28" ),
new TMEntry( new Point3D( 2391, 1155, 0 ), "29" ),
new TMEntry( new Point3D( 3246, 246, 4 ), "30" ),
new TMEntry( new Point3D( 3403, 238, 0 ), "31" ),
new TMEntry( new Point3D( 3376, 458, 9 ), "32" ),
new TMEntry( new Point3D( 3369, 638, 5 ), "33" ),
new TMEntry( new Point3D( 199, 1460, 0 ), "34" )
} );
public static readonly TMList MapLocations3 =
new TMList("Maps 35-51", "Maps 35-51", Map.Trammel, new TMEntry[]
{
new TMEntry( new Point3D( 207, 1444, 0 ), "35" ),
new TMEntry( new Point3D( 349, 1565, 0 ), "36" ),
new TMEntry( new Point3D( 582, 1451, 0 ), "37" ),
new TMEntry( new Point3D( 360, 1337, 6 ), "38" ),
new TMEntry( new Point3D( 620, 1706, 0 ), "39" ),
new TMEntry( new Point3D( 963, 1859, 0 ), "40" ),
new TMEntry( new Point3D( 979, 1850, 22 ), "41" ),
new TMEntry( new Point3D( 970, 1894, 0 ), "42" ),
new TMEntry( new Point3D( 970, 1884, 0 ), "43" ),
new TMEntry( new Point3D( 978, 1880, 0 ), "44" ),
new TMEntry( new Point3D( 1017, 1859, 0 ), "45" ),
new TMEntry( new Point3D( 1034, 1877, 0 ), "46" ),
new TMEntry( new Point3D( 1042, 1904, 5 ), "47" ),
new TMEntry( new Point3D( 1042, 1960, 0 ), "48" ),
new TMEntry( new Point3D( 1038, 1976, 0 ), "49" ),
new TMEntry( new Point3D( 1024, 1991, 0 ), "50" ),
new TMEntry( new Point3D( 974, 1992, 0 ), "51" )
} );
public static readonly TMList MapLocations4 =
new TMList("Maps 52-68", "Maps 52-68", Map.Trammel, new TMEntry[]
{
new TMEntry( new Point3D( 989, 1993, 0 ), "52" ),
new TMEntry( new Point3D( 450, 2054, 0 ), "53" ),
new TMEntry( new Point3D( 478, 2043, 8 ), "54" ),
new TMEntry( new Point3D( 492, 2027, 5 ), "55" ),
new TMEntry( new Point3D( 468, 2087, 8 ), "56" ),
new TMEntry( new Point3D( 466, 2100, 5 ), "57" ),
new TMEntry( new Point3D( 1651, 2030, 0 ), "58" ),
new TMEntry( new Point3D( 1689, 1992, 0 ), "59" ),
new TMEntry( new Point3D( 1709, 1964, 5 ), "60" ),
new TMEntry( new Point3D( 1725, 1999, 0 ), "61" ),
new TMEntry( new Point3D( 1732, 2017, 0 ), "62" ),
new TMEntry( new Point3D( 1742, 2028, 0 ), "63" ),
new TMEntry( new Point3D( 1753, 2020, 0 ), "64" ),
new TMEntry( new Point3D( 2034, 1942, 0 ), "65" ),
new TMEntry( new Point3D( 2054, 1963, 0 ), "66" ),
new TMEntry( new Point3D( 2065, 1979, 0 ), "67" ),
new TMEntry( new Point3D( 2058, 1990, 6 ), "68" )
} );
public static readonly TMList MapLocations5 =
new TMList("Maps 69-85", "Maps 69-85", Map.Trammel, new TMEntry[]
{
new TMEntry( new Point3D( 2070, 1990, 0 ), "69" ),
new TMEntry( new Point3D( 2062, 1962, 0 ), "70" ),
new TMEntry( new Point3D( 2098, 1976, 0 ), "71" ),
new TMEntry( new Point3D( 2089, 1987, 0 ), "72" ),
new TMEntry( new Point3D( 2093, 2006, 0 ), "73" ),
new TMEntry( new Point3D( 2188, 1991, 0 ), "74" ),
new TMEntry( new Point3D( 1426, 2405, 5 ), "75" ),
new TMEntry( new Point3D( 1434, 2381, 5 ), "76" ),
new TMEntry( new Point3D( 1470, 2340, 5 ), "77" ),
new TMEntry( new Point3D( 1451, 2301, 0 ), "78" ),
new TMEntry( new Point3D( 1436, 2294, 0 ), "79" ),
new TMEntry( new Point3D( 1438, 2217, 0 ), "80" ),
new TMEntry( new Point3D( 1467, 2181, 0 ), "81" ),
new TMEntry( new Point3D( 1464, 2246, 5 ), "82" ),
new TMEntry( new Point3D( 1478, 2273, 5 ), "83" ),
new TMEntry( new Point3D( 1562, 2312, 5 ), "84" ),
new TMEntry( new Point3D( 1546, 2223, 10 ), "85" )
} );
public static readonly TMList MapLocations6 =
new TMList("Maps 86-102", "Maps 86-102", Map.Trammel, new TMEntry[]
{
new TMEntry( new Point3D( 1518, 2214, 5 ), "86" ),
new TMEntry( new Point3D( 1533, 2189, 5 ), "87" ),
new TMEntry( new Point3D( 1522, 2150, 0 ), "88" ),
new TMEntry( new Point3D( 1541, 2115, 5 ), "89" ),
new TMEntry( new Point3D( 1594, 2193, 0 ), "90" ),
new TMEntry( new Point3D( 1618, 2236, 0 ), "91" ),
new TMEntry( new Point3D( 1654, 2268, 5 ), "92" ),
new TMEntry( new Point3D( 1724, 2288, 5 ), "93" ),
new TMEntry( new Point3D( 1773, 2321, 5 ), "94" ),
new TMEntry( new Point3D( 1758, 2333, 0 ), "95" ),
new TMEntry( new Point3D( 1765, 2431, 5 ), "96" ),
new TMEntry( new Point3D( 1702, 2318, 5 ), "97" ),
new TMEntry( new Point3D( 1654, 2304, 0 ), "98" ),
new TMEntry( new Point3D( 2061, 2144, 0 ), "99" ),
new TMEntry( new Point3D( 2104, 2124, 0 ), "100" ),
new TMEntry( new Point3D( 2098, 2101, 0 ), "101" ),
new TMEntry( new Point3D( 2129, 2108, 0 ), "102" )
} );
public static readonly TMList MapLocations7 =
new TMList("Maps 103-119", "Maps 103-119", Map.Trammel, new TMEntry[]
{
new TMEntry( new Point3D( 2153, 2121, 0 ), "103" ),
new TMEntry( new Point3D( 2186, 2143, 0 ), "104" ),
new TMEntry( new Point3D( 2177, 2151, 0 ), "105" ),
new TMEntry( new Point3D( 2161, 2149, 0 ), "106" ),
new TMEntry( new Point3D( 2130, 2133, 0 ), "107" ),
new TMEntry( new Point3D( 2123, 2121, 0 ), "108" ),
new TMEntry( new Point3D( 2647, 2167, 5 ), "109" ),
new TMEntry( new Point3D( 2628, 2221, 6 ), "110" ),
new TMEntry( new Point3D( 2642, 2289, 7 ), "111" ),
new TMEntry( new Point3D( 2682, 2291, 5 ), "112" ),
new TMEntry( new Point3D( 2727, 2309, 0 ), "113" ),
new TMEntry( new Point3D( 2781, 2294, 6 ), "114" ),
new TMEntry( new Point3D( 2804, 2255, 0 ), "115" ),
new TMEntry( new Point3D( 2850, 2252, 5 ), "116" ),
new TMEntry( new Point3D( 2957, 2150, 53 ), "117" ),
new TMEntry( new Point3D( 2967, 2171, 36 ), "118" ),
new TMEntry( new Point3D( 2952, 2177, 52 ), "119" )
} );
public static readonly TMList MapLocations8 =
new TMList("Maps 120-136", "Maps 120-136", Map.Trammel, new TMEntry[]
{
new TMEntry( new Point3D( 2955, 2200, 46 ), "120" ),
new TMEntry( new Point3D( 2932, 2240, 5 ), "121" ),
new TMEntry( new Point3D( 95, 2505, 0 ), "122" ),
new TMEntry( new Point3D( 1025, 2702, 0 ), "123" ),
new TMEntry( new Point3D( 1290, 2735, 0 ), "124" ),
new TMEntry( new Point3D( 1382, 2840, 0 ), "125" ),
new TMEntry( new Point3D( 1390, 2985, 0 ), "126" ),
new TMEntry( new Point3D( 1414, 3059, 0 ), "127" ),
new TMEntry( new Point3D( 1647, 2462, 5 ), "128" ),
new TMEntry( new Point3D( 1563, 2705, 0 ), "129" ),
new TMEntry( new Point3D( 1671, 2808, 0 ), "130" ),
new TMEntry( new Point3D( 1601, 3103, 0 ), "131" ),
new TMEntry( new Point3D( 1665, 3063, 0 ), "132" ),
new TMEntry( new Point3D( 1068, 3182, 0 ), "133" ),
new TMEntry( new Point3D( 1075, 3156, 0 ), "134" ),
new TMEntry( new Point3D( 1073, 3133, 0 ), "135" ),
new TMEntry( new Point3D( 1090, 3110, 0 ), "136" )
} );
public static readonly TMList MapLocations9 =
new TMList("Maps 137-153", "Maps 137-153", Map.Trammel, new TMEntry[]
{
new TMEntry( new Point3D( 1093, 3132, 0 ), "137" ),
new TMEntry( new Point3D( 1096, 3179, 0 ), "138" ),
new TMEntry( new Point3D( 1129, 3403, 0 ), "139" ),
new TMEntry( new Point3D( 1162, 3468, 0 ), "140" ),
new TMEntry( new Point3D( 1127, 3499, 0 ), "141" ),
new TMEntry( new Point3D( 1136, 3446, 0 ), "142" ),
new TMEntry( new Point3D( 2014, 3269, 0 ), "143" ),
new TMEntry( new Point3D( 2040, 3427, 0 ), "144" ),
new TMEntry( new Point3D( 2096, 3384, 0 ), "145" ),
new TMEntry( new Point3D( 2149, 3362, 10 ), "146" ),
new TMEntry( new Point3D( 2370, 3428, 3 ), "147" ),
new TMEntry( new Point3D( 2342, 3482, 3 ), "148" ),
new TMEntry( new Point3D( 2360, 3507, 3 ), "149" ),
new TMEntry( new Point3D( 2387, 3506, 3 ), "150" ),
new TMEntry( new Point3D( 2467, 3580, 3 ), "151" ),
new TMEntry( new Point3D( 2481, 3623, 3 ), "152" ),
new TMEntry( new Point3D( 2527, 3585, 0 ), "153" )
} );
public static readonly TMList MapLocations10 =
new TMList("Maps 154-170", "Maps 154-170", Map.Trammel, new TMEntry[]
{
new TMEntry( new Point3D( 2534, 3609, 0 ), "154" ),
new TMEntry( new Point3D( 2797, 3452, 0 ), "155" ),
new TMEntry( new Point3D( 2803, 3489, 0 ), "156" ),
new TMEntry( new Point3D( 2792, 3520, 0 ), "157" ),
new TMEntry( new Point3D( 2831, 3510, 0 ), "158" ),
new TMEntry( new Point3D( 2989, 3606, 15 ), "159" ),
new TMEntry( new Point3D( 3055, 3602, 0 ), "160" ),
new TMEntry( new Point3D( 2154, 3983, 3 ), "161" ),
new TMEntry( new Point3D( 2144, 3985, 0 ), "162" ),
new TMEntry( new Point3D( 2140, 3941, 3 ), "163" ),
new TMEntry( new Point3D( 2157, 3924, 3 ), "164" ),
new TMEntry( new Point3D( 2152, 3951, 3 ), "165" ),
new TMEntry( new Point3D( 2162, 3988, 3 ), "166" ),
new TMEntry( new Point3D( 2452, 3942, 0 ), "167" ),
new TMEntry( new Point3D( 2421, 3929, 3 ), "168" ),
new TMEntry( new Point3D( 2414, 3920, 3 ), "169" ),
new TMEntry( new Point3D( 2421, 3901, 3 ), "170" )
} );
public static readonly TMList MapLocations11 =
new TMList("Maps 171-187", "Maps 171-187", Map.Trammel, new TMEntry[]
{
new TMEntry( new Point3D( 2481, 3908, 6 ), "171" ),
new TMEntry( new Point3D( 2512, 3899, 3 ), "172" ),
new TMEntry( new Point3D( 2515, 3919, 0 ), "173" ),
new TMEntry( new Point3D( 2512, 3962, 6 ), "174" ),
new TMEntry( new Point3D( 2527, 3982, 0 ), "175" ),
new TMEntry( new Point3D( 2516, 3998, 3 ), "176" ),
new TMEntry( new Point3D( 4476, 3282, 0 ), "177" ),
new TMEntry( new Point3D( 4477, 3230, 0 ), "178" ),
new TMEntry( new Point3D( 4465, 3210, 0 ), "179" ),
new TMEntry( new Point3D( 4425, 3152, 0 ), "180" ),
new TMEntry( new Point3D( 4420, 3117, 0 ), "181" ),
new TMEntry( new Point3D( 4449, 3130, 0 ), "182" ),
new TMEntry( new Point3D( 4454, 3418, 0 ), "183" ),
new TMEntry( new Point3D( 4501, 3108, 0 ), "184" ),
new TMEntry( new Point3D( 4513, 3104, 0 ), "185" ),
new TMEntry( new Point3D( 4470, 3188, 0 ), "186" ),
new TMEntry( new Point3D( 4507, 3227, 0 ), "187" )
} );
public static readonly TMList MapLocations12 =
new TMList("Maps 188-200", "Maps 188-200", Map.Trammel, new TMEntry[]
{
new TMEntry( new Point3D( 4495, 3242, 0 ), "188" ),
new TMEntry( new Point3D( 4462, 3369, 0 ), "189" ),
new TMEntry( new Point3D( 4694, 3486, 0 ), "190" ),
new TMEntry( new Point3D( 3477, 2761, 35 ), "191" ),
new TMEntry( new Point3D( 3426, 2723, 45 ), "192" ),
new TMEntry( new Point3D( 3418, 2675, 50 ), "193" ),
new TMEntry( new Point3D( 3533, 2471, 10 ), "194" ),
new TMEntry( new Point3D( 3511, 2421, 55 ), "195" ),
new TMEntry( new Point3D( 3568, 2402, 11 ), "196" ),
new TMEntry( new Point3D( 3702, 2825, 21 ), "197" ),
new TMEntry( new Point3D( 3594, 2826, 44 ), "198" ),
new TMEntry( new Point3D( 3557, 2820, 24 ), "199" ),
new TMEntry( new Point3D( 3541, 2784, 6 ), "200" )
} );
public static readonly TMList[] UORLists = new TMList[] { MapLocations1, MapLocations2, MapLocations3, MapLocations4, MapLocations5, MapLocations6, MapLocations7, MapLocations8, MapLocations9, MapLocations10, MapLocations11, MapLocations12 };
public static readonly TMList[] UORlistsYoung = new TMList[] { MapLocations1, MapLocations2, MapLocations3, MapLocations4, MapLocations5, MapLocations6, MapLocations7, MapLocations8, MapLocations9, MapLocations10, MapLocations11, MapLocations12 };
public static readonly TMList[] LBRLists = new TMList[] { MapLocations1, MapLocations2, MapLocations3, MapLocations4, MapLocations5, MapLocations6, MapLocations7, MapLocations8, MapLocations9, MapLocations10, MapLocations11, MapLocations12 };
public static readonly TMList[] LBRListsYoung = new TMList[] { MapLocations1, MapLocations2, MapLocations3, MapLocations4, MapLocations5, MapLocations6, MapLocations7, MapLocations8, MapLocations9, MapLocations10, MapLocations11, MapLocations12 };
public static readonly TMList[] AOSLists = new TMList[] { MapLocations1, MapLocations2, MapLocations3, MapLocations4, MapLocations5, MapLocations6, MapLocations7, MapLocations8, MapLocations9, MapLocations10, MapLocations11, MapLocations12 };
public static readonly TMList[] AOSListsYoung = new TMList[] { MapLocations1, MapLocations2, MapLocations3, MapLocations4, MapLocations5, MapLocations6, MapLocations7, MapLocations8, MapLocations9, MapLocations10, MapLocations11, MapLocations12 };
public static readonly TMList[] SELists = new TMList[] { MapLocations1, MapLocations2, MapLocations3, MapLocations4, MapLocations5, MapLocations6, MapLocations7, MapLocations8, MapLocations9, MapLocations10, MapLocations11, MapLocations12 };
public static readonly TMList[] SEListsYoung = new TMList[] { MapLocations1, MapLocations2, MapLocations3, MapLocations4, MapLocations5, MapLocations6, MapLocations7, MapLocations8, MapLocations9, MapLocations10, MapLocations11, MapLocations12 };
public static readonly TMList[] RedLists = new TMList[] { };
public static readonly TMList[] SigilLists = new TMList[] { };
}
public class MapLocationsGump : Gump
{
public static void Initialize()
{
CommandSystem.Register( "TMGump", AccessLevel.GameMaster, new CommandEventHandler( MapLocationsGump_OnCommand ) );
}
private static void MapLocationsGump_OnCommand( CommandEventArgs e )
{
e.Mobile.SendGump( new MapLocationsGump( e.Mobile ) );
}
private Mobile m_Mobile;
private TMList[] m_Lists;
public MapLocationsGump( Mobile mobile ) : base( 100, 100 )
{
m_Mobile = mobile;
TMList[] checkLists;
if ( mobile.Player )
{
if ( mobile.Kills >= 999999999 )
{
checkLists = TMList.RedLists;
}
else
{
int flags = mobile.NetState == null ? 0 : (int)mobile.NetState.Flags;
if ( Core.AOS && (flags & 0x8) != 0 )
checkLists = TMList.AOSLists;
else if ( (flags & 0x4) != 0 )
checkLists = TMList.LBRLists;
else
checkLists = TMList.UORLists;
}
}
else
{
checkLists = TMList.AOSLists;
}
m_Lists = new TMList[checkLists.Length];
for ( int i = 0; i < m_Lists.Length; ++i )
m_Lists[i] = checkLists[i];
for ( int i = 0; i < m_Lists.Length; ++i )
{
if ( m_Lists[i].Map == mobile.Map )
{
TMList temp = m_Lists[i];
m_Lists[i] = m_Lists[0];
m_Lists[0] = temp;
break;
}
}
AddPage( 0 );
AddBackground( 0, 0, 380, 500, 9200 );
AddButton( 10, 345, 4005, 4007, 1, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 45, 345, 140, 25, 1011036, false, false ); // OKAY
AddButton( 10, 370, 4005, 4007, 0, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 45, 370, 140, 25, 1011012, false, false ); // CANCEL
AddButton( 10, 475, 4005, 4007, 2, GumpButtonType.Reply, 0 );
AddLabel( 45, 475, 0x34, "Visit UO.STRATICS.COM Treasure Map Archive" );
AddHtmlLocalized( 5, 5, 200, 20, 1012011, false, false ); // Pick your destination:
for ( int i = 0; i < checkLists.Length; ++i )
{
AddButton( 10, 35 + (i * 25), 2117, 2118, 0, GumpButtonType.Page, Array.IndexOf( m_Lists, checkLists[i] ) + 1 );
AddHtml( 30, 35 + (i * 25), 150, 20, checkLists[i].Text, false, false );
}
for ( int i = 0; i < m_Lists.Length; ++i )
RenderPage( i, Array.IndexOf( checkLists, m_Lists[i] ) );
}
private void RenderPage( int index, int offset )
{
TMList list = m_Lists[index];
AddPage( index + 1 );
AddButton( 10, 35 + (offset * 25), 2117, 2118, 0, GumpButtonType.Page, index + 1 );
AddHtml( 30, 35 + (offset * 25), 150, 20, list.SelText, false, false );
TMEntry[] entries = list.Entries;
for ( int i = 0; i < entries.Length; ++i )
{
AddRadio( 200, 35 + (i * 25), 210, 211, false, (index * 100) + i );
AddHtml( 225, 35 + (i * 25), 150, 20, entries[i].Text, false, false );
}
}
public override void OnResponse( NetState state, RelayInfo info )
{
if ( info.ButtonID == 0 ) // Cancel
return;
else if ( m_Mobile.Deleted || m_Mobile.Map == null )
return;
else if ( info.ButtonID == 2 ) // Launch Browser
m_Mobile.LaunchBrowser( "http://uo.stratics.com/thb/info/maparchive/Archive1.shtml" );
int[] switches = info.Switches;
if ( switches.Length == 0 )
return;
int switchID = switches[0];
int listIndex = switchID / 100;
int listEntry = switchID % 100;
if ( listIndex < 0 || listIndex >= m_Lists.Length )
return;
TMList list = m_Lists[listIndex];
if ( listEntry < 0 || listEntry >= list.Entries.Length )
return;
TMEntry entry = list.Entries[listEntry];
if ( Server.Spells.SpellHelper.CheckCombat( m_Mobile ) )
{
m_Mobile.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
}
else if ( m_Mobile.Spell != null )
{
m_Mobile.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
}
else if ( m_Mobile.Map == list.Map && m_Mobile.InRange( entry.Location, 1 ) )
{
m_Mobile.SendLocalizedMessage( 1019003 ); // You are already there.
}
else
{
BaseCreature.TeleportPets( m_Mobile, entry.Location, list.Map );
m_Mobile.Combatant = null;
m_Mobile.Warmode = false;
m_Mobile.Map = list.Map;
m_Mobile.Location = entry.Location;
}
}
}
} }

View File

@@ -0,0 +1,661 @@
using System;
using System.Collections;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Mobiles;
using Server.Commands;
using Server.Commands.Generic;
namespace Server.Items
{
public class TalismanTravelAtlas : BaseTalisman
{
[Flags]
public enum OptFlags
{
None = 0x0000,
Trammel = 0x0001,
TramDungeons = 0x0002,
Felucca = 0x0004,
FelDungeons = 0x0008,
Custom = 0x0010,
Ilshenar = 0x0020,
IlshenarShrines = 0x0040,
Malas = 0x0080,
Tokuno = 0x0100,
AllowReds = 0x0200,
TerMur = 0x0400,
UseGlobal = 0x0800
}
public static void Initialize()
{
if ( m_GlobalFlags == OptFlags.None )
{
SetOptFlag( ref m_GlobalFlags, OptFlags.Trammel, true );
SetOptFlag( ref m_GlobalFlags, OptFlags.TramDungeons, true );
SetOptFlag( ref m_GlobalFlags, OptFlags.Felucca, true );
SetOptFlag( ref m_GlobalFlags, OptFlags.FelDungeons, true );
SetOptFlag( ref m_GlobalFlags, OptFlags.Custom, true );
SetOptFlag( ref m_GlobalFlags, OptFlags.Ilshenar, true );
SetOptFlag( ref m_GlobalFlags, OptFlags.IlshenarShrines, true );
SetOptFlag( ref m_GlobalFlags, OptFlags.Malas, Core.AOS );
SetOptFlag( ref m_GlobalFlags, OptFlags.Tokuno, Core.SE );
SetOptFlag( ref m_GlobalFlags, OptFlags.TerMur, true );
SetOptFlag( ref m_GlobalFlags, OptFlags.UseGlobal, true );
}
GlobalEntries.Add("Trammel", new TalismanEntry[]
{
new TalismanEntry("Britain", new Point3D(1434, 1699, 2), Map.Trammel ),
new TalismanEntry("Bucs Den", new Point3D(2705, 2162, 0), Map.Trammel ),
new TalismanEntry("Delucia", new Point3D(5274, 3991, 37), Map.Trammel ),
new TalismanEntry("Jhelom", new Point3D(1417, 3821, 0), Map.Trammel ),
//new TAEntry("Lumyr Town", new Point3D(3707, 2185, 20), Map.Trammel ),
new TalismanEntry("New Haven", new Point3D(3505, 2574, 14), Map.Trammel ),
new TalismanEntry("Minoc", new Point3D(2525, 582, 0), Map.Trammel ),
new TalismanEntry("Moonglow", new Point3D(4471, 1177, 0), Map.Trammel ),
new TalismanEntry("Nujel'm", new Point3D(3770, 1308, 0), Map.Trammel ),
new TalismanEntry("Papua", new Point3D(5729, 3208, -6), Map.Trammel ),
new TalismanEntry("Serpents Hold", new Point3D(2895, 3479, 15), Map.Trammel ),
new TalismanEntry("Skara Brae", new Point3D(596, 2138, 0), Map.Trammel ),
new TalismanEntry("Trinsic", new Point3D(1823, 2821, 0), Map.Trammel ),
new TalismanEntry("Vesper", new Point3D(2899, 676, 0), Map.Trammel ),
new TalismanEntry("Wind", new Point3D(1361, 895, 0), Map.Trammel ),
new TalismanEntry("Yew", new Point3D(542, 985, 0), Map.Trammel )
});
GlobalEntries.Add("Trammel Dungeons", new TalismanEntry[]
{
new TalismanEntry("Covetous", new Point3D(2498, 921, 0), Map.Trammel ),
new TalismanEntry("Daemon Temple", new Point3D(4591, 3647, 80), Map.Trammel ),
new TalismanEntry("Deceit", new Point3D(4111, 434, 5), Map.Trammel ),
new TalismanEntry("Despise", new Point3D(1301, 1080, 0), Map.Trammel ),
new TalismanEntry("Destard", new Point3D(1176, 2640, 2), Map.Trammel ),
new TalismanEntry("Fire", new Point3D(2923, 3409, 8), Map.Trammel ),
new TalismanEntry("Hythloth", new Point3D(4721, 3824, 0), Map.Trammel ),
new TalismanEntry("Ice", new Point3D(1999, 81, 4), Map.Trammel ),
new TalismanEntry("Ophidian Temple", new Point3D(5766, 2634, 43), Map.Trammel ),
new TalismanEntry("Orc Caves", new Point3D(1017, 1429, 0), Map.Trammel ),
new TalismanEntry("Shame", new Point3D(511, 1565, 0), Map.Trammel ),
new TalismanEntry("Solen Hive", new Point3D(2607, 763, 0), Map.Trammel ),
new TalismanEntry("Terathan Keep", new Point3D(5451, 3143, -60), Map.Trammel ),
new TalismanEntry("Wrong", new Point3D(2043, 238, 10), Map.Trammel )
});
GlobalEntries.Add("Felucca", new TalismanEntry[]
{
new TalismanEntry("Britain", new Point3D(1434, 1699, 2), Map.Felucca ),
new TalismanEntry("Bucs Den", new Point3D(2705, 2162, 0), Map.Felucca ),
new TalismanEntry("Cove", new Point3D(2237, 1214, 0), Map.Felucca ),
new TalismanEntry("Delucia", new Point3D(5274, 3991, 37), Map.Felucca ),
new TalismanEntry("Jhelom", new Point3D(1417, 3821, 0), Map.Felucca ),
new TalismanEntry("Magincia", new Point3D(3728, 2164, 20), Map.Felucca ),
new TalismanEntry("Minoc", new Point3D(2525, 582, 0), Map.Felucca ),
new TalismanEntry("Moonglow", new Point3D(4471, 1177, 0), Map.Felucca ),
new TalismanEntry("Nujel'm", new Point3D(3770, 1308, 0), Map.Felucca ),
new TalismanEntry("Ocllo", new Point3D(3626, 2611, 0), Map.Felucca ),
new TalismanEntry("Papua", new Point3D(5729, 3208, -6), Map.Felucca ),
new TalismanEntry("Serpents Hold", new Point3D(2895, 3479, 15), Map.Felucca ),
new TalismanEntry("Skara Brae", new Point3D(596, 2138, 0), Map.Felucca ),
new TalismanEntry("Trinsic", new Point3D(1823, 2821, 0), Map.Felucca ),
new TalismanEntry("Vesper", new Point3D(2899, 676, 0), Map.Felucca ),
new TalismanEntry("Wind", new Point3D(1361, 895, 0), Map.Felucca ),
new TalismanEntry("Yew", new Point3D(542, 985, 0), Map.Felucca )
});
GlobalEntries.Add("Felucca Dungeons", new TalismanEntry[]
{
new TalismanEntry("Covetous", new Point3D(2498, 921, 0), Map.Felucca ),
new TalismanEntry("Daemon Temple", new Point3D(4591, 3647, 80), Map.Felucca ),
new TalismanEntry("Deceit", new Point3D(4111, 434, 5), Map.Felucca ),
new TalismanEntry("Despise", new Point3D(1301, 1080, 0), Map.Felucca ),
new TalismanEntry("Destard", new Point3D(1176, 2640, 2), Map.Felucca ),
new TalismanEntry("Fire", new Point3D(2923, 3409, 8), Map.Felucca ),
new TalismanEntry("Hythloth", new Point3D(4721, 3824, 0), Map.Felucca ),
new TalismanEntry("Ice", new Point3D(1999, 81, 4), Map.Felucca ),
new TalismanEntry("Ophidian Temple", new Point3D(5766, 2634, 43), Map.Felucca ),
new TalismanEntry("Orc Caves", new Point3D(1017, 1429, 0), Map.Felucca ),
new TalismanEntry("Shame", new Point3D(511, 1565, 0), Map.Felucca ),
new TalismanEntry("Solen Hive", new Point3D(2607, 763, 0), Map.Felucca ),
new TalismanEntry("Terathan Keep", new Point3D(5451, 3143, -60), Map.Felucca ),
new TalismanEntry("Wrong", new Point3D(2043, 238, 10), Map.Felucca )
});
GlobalEntries.Add("Custom Areas", new TalismanEntry[]//add locations to the Custom map here
{
new TalismanEntry("Starter Area", new Point3D(5671, 1044, 0), Map.Trammel ),
new TalismanEntry("Vendor Mall", new Point3D(1012, 466, -90), Map.Malas ),
new TalismanEntry("Casino", new Point3D(5500, 1153, 1), Map.Trammel ),
//new TAEntry("Crafters Town", new Point3D(2270, 1213, 0), Map.Trammel ),
//new TAEntry("The Suburbs", new Point3D(5207, 1181, 0), Map.Trammel ),
});
GlobalEntries.Add("Ilshenar", new TalismanEntry[]
{
new TalismanEntry("Ankh Dungeon", new Point3D(576, 1150, -100), Map.Ilshenar ),
new TalismanEntry("Blood Dungeon", new Point3D(1747, 1171, -2), Map.Ilshenar ),
new TalismanEntry("Exodus Dungeon", new Point3D(854, 778, -80), Map.Ilshenar ),
// new TalismanEntry("Gargoyle City", new Point3D(852, 602, -40), Map.Ilshenar ),
new TalismanEntry("Lakeshire", new Point3D(1203, 1124, -25), Map.Ilshenar ),
new TalismanEntry("Mistas", new Point3D(819, 1130, -29), Map.Ilshenar ),
new TalismanEntry("Montor", new Point3D(1706, 205, 104), Map.Ilshenar ),
new TalismanEntry("Rock Dungeon", new Point3D(1787, 572, 69), Map.Ilshenar ),
new TalismanEntry("Savage Camp", new Point3D(1151, 659, -80), Map.Ilshenar ),
new TalismanEntry("Sorceror's Dungeon", new Point3D(548, 462, -53), Map.Ilshenar ),
new TalismanEntry("Spectre Dungeon", new Point3D(1363, 1033, -8), Map.Ilshenar ),
new TalismanEntry("Spider Cave", new Point3D(1420, 913, -16), Map.Ilshenar ),
new TalismanEntry("Wisp Dungeon", new Point3D(651, 1302, -58), Map.Ilshenar )
});
GlobalEntries.Add("Ilshenar Shrines", new TalismanEntry[]
{
new TalismanEntry("Compassion Shrine", new Point3D(1215, 467, -13), Map.Ilshenar ),
new TalismanEntry("Honesty Shrine", new Point3D(722, 1366, -60), Map.Ilshenar ),
new TalismanEntry("Honor Shrine", new Point3D(744, 724, -28), Map.Ilshenar ),
new TalismanEntry("Humility Shrine", new Point3D(281, 1016, 0), Map.Ilshenar ),
new TalismanEntry("Justice Shrine", new Point3D(987, 1011, -32), Map.Ilshenar ),
new TalismanEntry("Sacrifice Shrine", new Point3D(1174, 1286, -30), Map.Ilshenar ),
new TalismanEntry("Spirituality Shrine", new Point3D(1532, 1340, -3), Map.Ilshenar ),
new TalismanEntry("Valor Shrine", new Point3D(528, 216, -45), Map.Ilshenar ),
new TalismanEntry("Choas Shrine", new Point3D(1721, 218, 96), Map.Ilshenar )
});
GlobalEntries.Add("Malas", new TalismanEntry[]
{
new TalismanEntry("Doom", new Point3D(2368, 1267, -85), Map.Malas ),
new TalismanEntry("Luna", new Point3D(1015, 527, -65), Map.Malas ),
new TalismanEntry("Orc Fort 1", new Point3D(912, 215, -90), Map.Malas ),
new TalismanEntry("Orc Fort 2", new Point3D(1678, 374, -50), Map.Malas ),
new TalismanEntry("Orc Fort 3", new Point3D(1375, 621, -86), Map.Malas ),
new TalismanEntry("Orc Fort 4", new Point3D(1184, 715, -89), Map.Malas ),
new TalismanEntry("Orc Fort 5", new Point3D(1279, 1324, -90), Map.Malas ),
new TalismanEntry("Orc Fort 6", new Point3D(1598, 1834, -107), Map.Malas ),
new TalismanEntry("Ruined Temple", new Point3D(1598, 1762, -110), Map.Malas ),
new TalismanEntry("Umbra", new Point3D(1997, 1386, -85), Map.Malas )
});
GlobalEntries.Add("Tokuno", new TalismanEntry[]
{
new TalismanEntry("Bushido Dojo", new Point3D(322, 430, 32), Map.Tokuno ),
new TalismanEntry("Crane Marsh", new Point3D(203, 985, 18), Map.Tokuno ),
new TalismanEntry("Fan Dancer's Dojo", new Point3D(970, 222, 23), Map.Tokuno ),
new TalismanEntry("Isamu-Jima", new Point3D(1169, 998, 41), Map.Tokuno ),
new TalismanEntry("Makoto-Jima", new Point3D(802, 1204, 25), Map.Tokuno ),
new TalismanEntry("Homare-Jima", new Point3D(270, 628, 15), Map.Tokuno ),
new TalismanEntry("Makoto Desert", new Point3D(724, 1050, 33), Map.Tokuno ),
new TalismanEntry("Makoto Zento", new Point3D(741, 1261, 30), Map.Tokuno ),
new TalismanEntry("Mt. Sho Castle", new Point3D(1234, 772, 3), Map.Tokuno ),
new TalismanEntry("Valor Shrine", new Point3D(1044, 523, 15), Map.Tokuno ),
new TalismanEntry("Yomotsu Mine", new Point3D(257, 786, 63), Map.Tokuno )
});
GlobalEntries.Add("Staff", new TalismanEntry[]//add locations to the staff map here
{
new TalismanEntry("Green Acres tram", new Point3D(5445, 1153, 0), Map.Trammel ),
new TalismanEntry("Green Acres fel", new Point3D(5445, 1153, 0), Map.Felucca ),
new TalismanEntry("Jail tram", new Point3D(5296, 1173, 0), Map.Trammel ),
new TalismanEntry("Jail fel", new Point3D(5296, 1173, 0), Map.Felucca ),
new TalismanEntry("Star Room tram", new Point3D(5146, 1774, 0), Map.Trammel ),
new TalismanEntry("Star Room fel", new Point3D(5146, 1774, 0), Map.Felucca ),
new TalismanEntry("---------------", new Point3D(0, 0, 0), Map.Trammel ),
new TalismanEntry("Addon Creations", new Point3D(5125, 2293, 0), Map.Felucca ),
});
}
public static int GenerateTalismanTravelAtlas()
{
int gen = 0;
if (GetOptFlag( m_GlobalFlags, OptFlags.Trammel )) gen += GenerateEntry( "Trammel" );
if (GetOptFlag( m_GlobalFlags, OptFlags.TramDungeons )) gen += GenerateEntry( "Trammel Dungeons" );
if (GetOptFlag( m_GlobalFlags, OptFlags.Felucca )) gen += GenerateEntry( "Felucca" );
if (GetOptFlag( m_GlobalFlags, OptFlags.FelDungeons )) gen += GenerateEntry( "Felucca Dungeons" );
if (GetOptFlag( m_GlobalFlags, OptFlags.Custom)) gen += GenerateEntry( "Custom Areas" );
if (GetOptFlag( m_GlobalFlags, OptFlags.Ilshenar)) gen += GenerateEntry( "Ilshenar" );
if (GetOptFlag( m_GlobalFlags, OptFlags.IlshenarShrines)) gen += GenerateEntry( "Ilshenar Shrines" );
if (GetOptFlag( m_GlobalFlags, OptFlags.Malas) && Core.AOS) gen += GenerateEntry( "Malas" );
if (GetOptFlag( m_GlobalFlags, OptFlags.Tokuno) && Core.SE) gen += GenerateEntry( "Tokuno" );
gen += GenerateEntry( "Staff" );
return gen;
}
private static int GenerateEntry( string map )
{
TalismanEntry[] me = (TalismanEntry[])GlobalEntries[map];
if ( me != null )
{
for (int i = 0; i < me.Length; i++)
new TalismanTravelAtlas().MoveToWorld( me[i].Destination, me[i].Map );
return me.Length;
}
return 0;
}
public static Hashtable GlobalEntries = new Hashtable();
private OptFlags m_Flags;
private static OptFlags m_GlobalFlags;
[CommandProperty(AccessLevel.Administrator)]
public bool Trammel{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.Trammel ); } set{ SetOptFlag( OptFlags.Trammel, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool TramDungeons{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.TramDungeons ); } set{ SetOptFlag( OptFlags.TramDungeons, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool Felucca{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.Felucca ); } set{ SetOptFlag( OptFlags.Felucca, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool FelDungeons{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.FelDungeons ); } set{ SetOptFlag( OptFlags.FelDungeons, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool Custom{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.Custom ); } set{ SetOptFlag( OptFlags.Custom, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool Ilshenar{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.Ilshenar ); } set{ SetOptFlag( OptFlags.Ilshenar, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool IlshenarShrines{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.IlshenarShrines ); } set{ SetOptFlag( OptFlags.IlshenarShrines, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool Malas{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.Malas ); } set{ SetOptFlag( OptFlags.Malas, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool Tokuno{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.Tokuno ); } set{ SetOptFlag( OptFlags.Tokuno, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool AllowReds{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.AllowReds ); } set{ SetOptFlag( OptFlags.AllowReds, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool UseGlobal{ get{ return GetOptFlag( m_Flags, OptFlags.UseGlobal ); } set{ SetOptFlag( ref m_Flags, OptFlags.UseGlobal, value ); } }
public void SetOptFlag( OptFlags toSet, bool value )
{
if ( UseGlobal )
{
if ( value )
m_GlobalFlags |= toSet;
else
m_GlobalFlags &= ~toSet;
}
else
{
if ( value )
m_Flags |= toSet;
else
m_Flags &= ~toSet;
}
}
public static void SetOptFlag( ref OptFlags flags, OptFlags toSet, bool value )
{
if ( value )
flags |= toSet;
else
flags &= ~toSet;
}
public static bool GetOptFlag( OptFlags flags, OptFlags flag )
{
return ( (flags & flag) != 0 );
}
[Constructable]
public TalismanTravelAtlas() : this ( (int)m_GlobalFlags )
{
}
[Constructable]
public TalismanTravelAtlas( int flags ) : base(0x2F5B)
{
Movable = true;
LootType = LootType.Blessed;
Hue = 38;
Name = "Talisman of Travel";
Light = LightType.Circle300;
m_Flags = (OptFlags)flags;
//Attributes.Luck = 500;
}
public override void OnDoubleClick( Mobile from )
{
if ( !from.Player )
return;
UseTeleporter(from);
}
public bool UseTeleporter( Mobile m )
{
if ( m.Criminal )
m.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
else if ( Server.Spells.SpellHelper.CheckCombat( m ) )
m.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
else if ( m.Spell != null )
m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
else
{
m.CloseGump( typeof(TalismanTravelAtlasGump) );
m.SendGump( new TalismanTravelAtlasGump( m, this, 0 ) );
if ( !m.Hidden || m.AccessLevel == AccessLevel.Player )
Effects.PlaySound( m.Location, m.Map, 0x20E );
return true;
}
return false;
}
public TalismanTravelAtlas( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 2 ); // version
//version 2
writer.Write( (int) m_Flags );
writer.Write( (int) m_GlobalFlags );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch (version)
{
case 2:
{
m_Flags = (OptFlags)reader.ReadInt();
m_GlobalFlags = (OptFlags)reader.ReadInt();
break;
}
case 1:
{
SetOptFlag( ref m_Flags, OptFlags.IlshenarShrines, reader.ReadBool() );
goto case 0;
}
case 0:
{
SetOptFlag( ref m_Flags, OptFlags.Trammel, reader.ReadBool() );
SetOptFlag( ref m_Flags, OptFlags.TramDungeons, reader.ReadBool() );
SetOptFlag( ref m_Flags, OptFlags.Felucca, reader.ReadBool() );
SetOptFlag( ref m_Flags, OptFlags.FelDungeons, reader.ReadBool() );
SetOptFlag( ref m_Flags, OptFlags.Custom, reader.ReadBool() );
SetOptFlag( ref m_Flags, OptFlags.Ilshenar, reader.ReadBool() );
SetOptFlag( ref m_Flags, OptFlags.Malas, reader.ReadBool() );
SetOptFlag( ref m_Flags, OptFlags.Tokuno, reader.ReadBool() );
SetOptFlag( ref m_Flags, OptFlags.AllowReds, reader.ReadBool() );
UseGlobal = false;
break;
}
}
}
}
public class TalismanTravelAtlasGump : Gump
{
private TalismanTravelAtlas m_TalismanTravelAtlas;
private int m_Page;
private bool m_Reds, m_HasLBR, m_HasAOS, m_HasSE;
public TalismanTravelAtlasGump( Mobile from, TalismanTravelAtlas TA, int page ) : base( 100, 100 )
{
ClientFlags flags = (from.NetState == null ? ClientFlags.None : from.NetState.Flags);
m_TalismanTravelAtlas = TA;
m_Page = page;
m_HasLBR = ((int)flags & 0x04) != 0;
m_HasAOS = ((int)flags & 0x08) != 0;
m_HasSE = ((int)flags & 0x10) != 0;
m_Reds = (from.Kills < 5 || TA.AllowReds);
//Did they press an invalid button or supply an invalid argument?
if ( page < 0 || page > 11 )
page = 0;
AddPage( 0 );
AddBackground( 0, 0, 660, 404, 3500 ); //white
AddImage(267, 10, 5528); // map
AddImage(45, 30, 5609); // globe
AddHtmlLocalized( 10, 10, 200, 20, 1012011, false, false ); // Pick your destination:
int p = 1;
if ( TA.Trammel && m_Reds )
{
GenerateMapListing( 1 );
AddPageButton( "Trammel", Map.Trammel, p++, 1 );
}
if ( TA.TramDungeons && m_Reds )
{
GenerateMapListing( 2 );
AddPageButton( "Trammel Dungeons", Map.Trammel, p++, 2 );
}
if ( TA.Felucca )
{
GenerateMapListing( 3 );
AddPageButton( "Felucca", Map.Felucca, p++, 3 );
}
if ( TA.FelDungeons )
{
GenerateMapListing( 4 );
AddPageButton( "Felucca Dungeons", Map.Felucca, p++, 4 );
}
if ( TA.Custom && m_Reds && Core.AOS && m_HasAOS )
{
GenerateMapListing( 5 );
AddPageButton( "<basefont color=#0000FF>Custom <basefont color=#FF0000>Areas</basefont>", null, p++, 5 );
}
if ( TA.Ilshenar && m_Reds && m_HasLBR )
{
GenerateMapListing( 6 );
AddPageButton( "Ilshenar", Map.Ilshenar, p++, 6 );
}
if ( TA.IlshenarShrines && m_Reds && m_HasLBR )
{
GenerateMapListing( 7 );
AddPageButton( "Ilshenar Shrines", Map.Ilshenar, p++, 7 );
}
if ( TA.Malas && m_Reds && Core.AOS && m_HasAOS )
{
GenerateMapListing( 8 );
AddPageButton( "Malas", Map.Malas, p++, 8 );
}
if ( TA.Tokuno && m_Reds && Core.SE && m_HasSE )
{
GenerateMapListing( 9 );
AddPageButton( "Tokuno", Map.Tokuno, p++, 9 );
}
if ( from.AccessLevel > AccessLevel.Player )
{
GenerateMapListing( 10 );
AddPageButton( "Staff Only", null, p++, 10 );
}
}
private void AddPageButton( string text, Map map, int offset, int page )
{
string label;
if ( map != null )
label = String.Format( "<basefont color=#{0}>{1}</basefont>", MapHue( map ), text );
else
label = text;
AddHtml( 30, 100 + ((offset - 1) * 25), 150, 20, label, false, false );
AddButton( 10, 100 + ((offset - 1) * 25), 2117, 2118, page, GumpButtonType.Reply, 0 );
}
private static TalismanEntry GetEntry( string name, int id )
{
TalismanEntry[] me = (TalismanEntry[])TalismanTravelAtlas.GlobalEntries[name];
if ( me != null )
{
if ( id < 0 || id >= me.Length )
id = 0;
return me[id];
}
return null;
}
private void GenerateMapListing( int page )
{
if ( m_Page == 0 )
m_Page = page;
else if ( page != m_Page )
return;
string name = m_Entries[page-1];
TalismanEntry[] me = (TalismanEntry[])TalismanTravelAtlas.GlobalEntries[name];
if ( me == null )
return;
int offset = m_Page * 100;
bool gates = name == "Custom Areas";
for (int i = 0, l = 0; i < me.Length; i++ )
{
TalismanEntry entry = me[i];
if ( ( (gates || name == "Felucca") && entry.Map == Map.Felucca && !m_TalismanTravelAtlas.Felucca) )
continue;
else if ( (gates || name == "Trammel") && entry.Map == Map.Trammel && (!m_TalismanTravelAtlas.Trammel || !m_Reds))
continue;
else if ( entry.Map == Map.Ilshenar && (!m_TalismanTravelAtlas.Ilshenar || !m_HasLBR || !m_Reds))
continue;
else if (entry.Map == Map.Malas && (!Core.AOS || !m_HasAOS || !m_TalismanTravelAtlas.Malas || !m_Reds))
continue;
else if (entry.Map == Map.Tokuno && (!Core.SE || !m_HasSE || !m_TalismanTravelAtlas.Tokuno || !m_Reds))
continue;
else
{
string label = String.Format( "<basefont color=#{0}>{1}</basefont>", MapHue( entry.Map ), entry.Name );
AddHtml( 180, 20+(l*20), 150, 20, label, false, false );
AddButton( 145, 20+(l*20), 4015, 4016, (i+offset), GumpButtonType.Reply, 0 );
l++;
}
}
}
private string MapHue( Map map )
{
if ( map == null )
return "101010";
if ( map == Map.Felucca )
return "FF0000";
else if ( map == Map.Trammel )
return "0000FF";
else if ( map == Map.Ilshenar )
return "008000";
else if ( map == Map.Malas )
return "FFFFFF";
else
return "FF00FF";
}
private static string[] m_Entries = new string[]
{
"Trammel", "Trammel Dungeons", "Felucca", "Felucca Dungeons",
"Custom Areas", "Ilshenar", "Ilshenar Shrines", "Malas",
"Tokuno", "Staff"
};
public override void OnResponse( NetState state, RelayInfo info )
{
Mobile from = state.Mobile;
if ( info.ButtonID <= 0 || from == null || from.Deleted || m_TalismanTravelAtlas == null || m_TalismanTravelAtlas.Deleted )
return;
int id = info.ButtonID / 100;
int count = info.ButtonID % 100;
if ( id == 0 && count < 12 )
{
from.SendGump( new TalismanTravelAtlasGump( from, m_TalismanTravelAtlas, count ) );
return;
}
//Invalid checks
if ( id < 1 || id > 11 || (id == 10 && from.AccessLevel < AccessLevel.GameMaster) )
id = 1;
string name = m_Entries[id-1];
TalismanEntry entry = GetEntry( name, count );
bool gates = name == "Custom Areas";
if ( entry == null )
from.SendMessage( "Error: Invalid Button Response - No Map Entries" );
else if ( ( (gates || name == "Felucca") && entry.Map == Map.Felucca && !m_TalismanTravelAtlas.Felucca) )
from.SendMessage( "Error: Invalid Button Response - Felucca Disabled" );
else if ( (gates || name == "Trammel") && entry.Map == Map.Trammel && (!m_TalismanTravelAtlas.Trammel || !m_Reds))
from.SendMessage( "Error: Invalid Button Response - Trammel Disabled" );
else if ( (name == "Ilshenar" ) && entry.Map == Map.Ilshenar && (!m_TalismanTravelAtlas.Ilshenar || !m_HasLBR || !m_Reds))
from.SendMessage( "Error: Invalid Button Response - Ilshenar Disabled" );
else if (entry.Map == Map.Malas && (!Core.AOS || !m_HasAOS || !m_TalismanTravelAtlas.Malas || !m_Reds))
from.SendMessage( "Error: Invalid Button Response - Malas Disabled" );
else if (entry.Map == Map.Tokuno && (!Core.SE || !m_HasSE || !m_TalismanTravelAtlas.Tokuno || !m_Reds))
from.SendMessage( "Error: Invalid Button Response - Tokuno Disabled" );
else if ( !from.InRange(m_TalismanTravelAtlas.GetWorldLocation(), 1 ) || from.Map != m_TalismanTravelAtlas.Map )
from.SendLocalizedMessage( 1019002 ); // You are too far away to use the gate.
else if ( from.Criminal )
from.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
else if ( Server.Spells.SpellHelper.CheckCombat( from ) )
from.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
else if ( from.Spell != null )
from.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
else if ( from.Map == entry.Map && from.InRange( entry.Destination, 1 ) )
from.SendLocalizedMessage( 1019003 ); // You are already there.
else
{
BaseCreature.TeleportPets( from, entry.Destination, entry.Map );
from.Combatant = null;
from.MoveToWorld( entry.Destination, entry.Map );
if ( !from.Hidden || from.AccessLevel == AccessLevel.Player )
Effects.PlaySound( entry.Destination, entry.Map, 0x1FE );
}
}
}
public class TalismanEntry
{
private string m_Name;
private Point3D m_Destination;
private Map m_Map;
public string Name { get { return m_Name; } }
public Point3D Destination { get { return m_Destination; } }
public Map Map { get { return m_Map; } }
public TalismanEntry(string name, Point3D p, Map map)
{
m_Name = name;
m_Destination = p;
m_Map = map;
}
}
}

View File

@@ -0,0 +1,153 @@
/*
* Created by SharpDevelop.
* User: alexanderfb
* Date: 1/25/2005
* Time: 10:27 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using Server;
namespace Server.Items
{
[Flipable( 0x12AB, 0x12AC )]
public class TarotDeck : Item
{
private static string GetFortune()
{
switch ( Utility.Random( 22 ) )
{
default:
case 0: return "The Fool! Watch your step and use your head.";
case 1: return "The Mage! You exhibit increased control of your destiny.";
case 2: return "The High Priestess! Your path will become clear to you.";
case 3: return "The Empress! Life is running smoothly.";
case 4: return "The Emperor! You must fight for what is yours.";
case 5: return "The Hierophant! You must acknowledge your falliblity.";
case 6: return "The Lovers! You will be faced with an important choice.";
case 7: return "The Chariot! You are in a position to defeat your enemies. Strike now!";
case 8: return "Justice! You will get what you deserve.";
case 9: return "The Hermit! You will discover a great truth.";
case 10: return "The Wheel! Your fate is based on the caprice of the gods.";
case 11: return "Strength! You will face a great test of your endurance.";
case 12: return "The Hanged Man! You must sacrifice to attain your goal.";
case 13: return "Death! Your life will change completely soon.";
case 14: return "Patience! You must be patient!";
case 15: return "The Devil! Don't take the easy way out, it could mean destruction!";
case 16: return "The Tower! You've overstepped your bounds.";
case 17: return "The Star! What you seek is within your grasp.";
case 18: return "The Moon! Be wary of forces beyond your control lest they control you!";
case 19: return "The Sun! You've worked hard. Now enjoy the fruits of your labour.";
case 20: return "Judgement! Your success is assured. Strike while the iron is hot!";
case 21: return "The World! You have achieved a complete success in your endeavor.";
}
}
[Constructable]
public TarotDeck() : base( 0x12AB )
{
Name = "tarot deck";
}
public TarotDeck( 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 override void OnDoubleClick( Mobile from )
{
switch ( ((Item)this).ItemID )
{
case 0x12AB: // Closed north
if ( Utility.Random( 2 ) == 0 )
((Item)this).ItemID = 0x12A5;
else
((Item)this).ItemID = 0x12A8;
break;
case 0x12AC: // Closed east
if ( Utility.Random( 2 ) == 0 )
((Item)this).ItemID = 0x12A6;
else
((Item)this).ItemID = 0x12A7;
break;
case 0x12A5: from.SendMessage( GetFortune() ); break;
case 0x12A6: from.SendMessage( GetFortune() ); break;
case 0x12A8: from.SendMessage( GetFortune() ); break;
case 0x12A7: from.SendMessage( GetFortune() ); break;
}
}
public override void OnAdded(object target)
{
switch ( ((Item)this).ItemID )
{
case 0x12A5: ((Item)this).ItemID = 0x12AB; break; // Open north
case 0x12A6: ((Item)this).ItemID = 0x12AC; break; // Open east
case 0x12A8: ((Item)this).ItemID = 0x12AB; break; // Open north
case 0x12A7: ((Item)this).ItemID = 0x12AC; break; // Open east
}
}
}
[Flipable( 0x12AB, 0x12AC )]
public class DecoTarotDeck : Item
{
[Constructable]
public DecoTarotDeck() : base( 0x12AB )
{
Name = "tarot deck";
}
public DecoTarotDeck( 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 override void OnDoubleClick( Mobile from )
{
switch ( ((Item)this).ItemID )
{
case 0x12AB: // Closed north
if ( Utility.Random( 2 ) == 0 )
((Item)this).ItemID = 0x12A5;
else
((Item)this).ItemID = 0x12A8;
break;
case 0x12AC: // Closed east
if ( Utility.Random( 2 ) == 0 )
((Item)this).ItemID = 0x12A6;
else
((Item)this).ItemID = 0x12A7;
break;
case 0x12A5: ((Item)this).ItemID = 0x12AB; break; // Open north
case 0x12A6: ((Item)this).ItemID = 0x12AC; break; // Open east
case 0x12A8: ((Item)this).ItemID = 0x12AB; break; // Open north
case 0x12A7: ((Item)this).ItemID = 0x12AC; break; // Open east
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,59 @@
using System;
namespace Server.Items
{
[FlipableAttribute( 0xE41, 0xE40 )]
public class TrashBag : Container
{
public override int DefaultMaxWeight{ get{ return 0; } } // A value of 0 signals unlimited weight
[Constructable]
public TrashBag() : base( 0xE76 )
{
Name = "a trash bag";
Movable = true;
Hue = 1150;
LootType = LootType.Blessed;
}
public TrashBag( 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 bool OnDragDrop( Mobile from, Item dropped )
{
if ( !base.OnDragDrop( from, dropped ) )
return false;
PublicOverheadMessage( Network.MessageType.Regular, 0x3B2, Utility.Random( 1042891, 8 ) ); // can comment this out to get rid of the message but leave the dropped.delete
dropped.Delete();
return true;
}
public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
{
if ( !base.OnDragDropInto( from, item, p ) )
return false;
PublicOverheadMessage( Network.MessageType.Regular, 0x3B2, Utility.Random( 1042891, 8 ) );
item.Delete();
return true;
}
}
}

View File

@@ -0,0 +1,678 @@
using System;
using System.Collections;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Mobiles;
using Server.Commands;
using Server.Commands.Generic;
namespace Server.Items
{
public class TravelAtlas : Item
{
[Flags]
public enum OptFlags
{
None = 0x0000,
Trammel = 0x0001,
TramDungeons = 0x0002,
Felucca = 0x0004,
FelDungeons = 0x0008,
Custom = 0x0010,
Ilshenar = 0x0020,
IlshenarShrines = 0x0040,
Malas = 0x0080,
Tokuno = 0x0100,
AllowReds = 0x0200,
TerMur = 0x0400,
UseGlobal = 0x0800
}
public static void Initialize()
{
if ( m_GlobalFlags == OptFlags.None )
{
SetOptFlag( ref m_GlobalFlags, OptFlags.Trammel, true );
SetOptFlag( ref m_GlobalFlags, OptFlags.TramDungeons, true );
SetOptFlag( ref m_GlobalFlags, OptFlags.Felucca, true );
SetOptFlag( ref m_GlobalFlags, OptFlags.FelDungeons, true );
SetOptFlag( ref m_GlobalFlags, OptFlags.Custom, true );
SetOptFlag( ref m_GlobalFlags, OptFlags.Ilshenar, true );
SetOptFlag( ref m_GlobalFlags, OptFlags.IlshenarShrines, true );
SetOptFlag( ref m_GlobalFlags, OptFlags.Malas, Core.AOS );
SetOptFlag( ref m_GlobalFlags, OptFlags.Tokuno, Core.SE );
SetOptFlag( ref m_GlobalFlags, OptFlags.TerMur, true );
SetOptFlag( ref m_GlobalFlags, OptFlags.UseGlobal, true );
}
GlobalEntries.Add("Trammel", new TAEntry[]
{
new TAEntry("Britain", new Point3D(1434, 1699, 2), Map.Trammel ),
new TAEntry("Bucs Den", new Point3D(2705, 2162, 0), Map.Trammel ),
new TAEntry("Cove", new Point3D(2237, 1214, 0), Map.Trammel ),
new TAEntry("Delucia", new Point3D(5274, 3991, 37), Map.Trammel ),
new TAEntry("New Haven", new Point3D(3500, 2571, 14), Map.Trammel ),
new TAEntry("Haven", new Point3D(3626, 2611, 0), Map.Trammel ),
new TAEntry("Jhelom", new Point3D(1417, 3821, 0), Map.Trammel ),
new TAEntry("Magincia", new Point3D(3728, 2164, 20), Map.Trammel ),
new TAEntry("Minoc", new Point3D(2525, 582, 0), Map.Trammel ),
new TAEntry("Moonglow", new Point3D(4471, 1177, 0), Map.Trammel ),
new TAEntry("Nujel'm", new Point3D(3770, 1308, 0), Map.Trammel ),
new TAEntry("Papua", new Point3D(5729, 3208, -6), Map.Trammel ),
new TAEntry("Serpents Hold", new Point3D(2895, 3479, 15), Map.Trammel ),
new TAEntry("Skara Brae", new Point3D(596, 2138, 0), Map.Trammel ),
new TAEntry("Trinsic", new Point3D(1823, 2821, 0), Map.Trammel ),
new TAEntry("Vesper", new Point3D(2899, 676, 0), Map.Trammel ),
new TAEntry("Wind", new Point3D(1361, 895, 0), Map.Trammel ),
new TAEntry("Yew", new Point3D(542, 985, 0), Map.Trammel )
});
GlobalEntries.Add("Trammel Dungeons", new TAEntry[]
{
new TAEntry("Covetous", new Point3D(2498, 921, 0), Map.Trammel ),
new TAEntry("Daemon Temple", new Point3D(4591, 3647, 80), Map.Trammel ),
new TAEntry("Deceit", new Point3D(4111, 434, 5), Map.Trammel ),
new TAEntry("Despise", new Point3D(1301, 1080, 0), Map.Trammel ),
new TAEntry("Destard", new Point3D(1176, 2640, 2), Map.Trammel ),
new TAEntry("Fire", new Point3D(2923, 3409, 8), Map.Trammel ),
new TAEntry("Hythloth", new Point3D(4721, 3824, 0), Map.Trammel ),
new TAEntry("Ice", new Point3D(1999, 81, 4), Map.Trammel ),
new TAEntry("Ophidian Temple", new Point3D(5766, 2634, 43), Map.Trammel ),
new TAEntry("Orc Caves", new Point3D(1017, 1429, 0), Map.Trammel ),
new TAEntry("Shame", new Point3D(511, 1565, 0), Map.Trammel ),
new TAEntry("Solen Hive", new Point3D(2607, 763, 0), Map.Trammel ),
new TAEntry("Terathan Keep", new Point3D(5451, 3143, -60), Map.Trammel ),
new TAEntry("Wrong", new Point3D(2043, 238, 10), Map.Trammel )
});
GlobalEntries.Add("Felucca", new TAEntry[]
{
new TAEntry("Britain", new Point3D(1434, 1699, 2), Map.Felucca ),
new TAEntry("Bucs Den", new Point3D(2705, 2162, 0), Map.Felucca ),
new TAEntry("Cove", new Point3D(2237, 1214, 0), Map.Felucca ),
new TAEntry("Delucia", new Point3D(5274, 3991, 37), Map.Felucca ),
new TAEntry("Jhelom", new Point3D(1417, 3821, 0), Map.Felucca ),
new TAEntry("Magincia", new Point3D(3728, 2164, 20), Map.Felucca ),
new TAEntry("Minoc", new Point3D(2525, 582, 0), Map.Felucca ),
new TAEntry("Moonglow", new Point3D(4471, 1177, 0), Map.Felucca ),
new TAEntry("Nujel'm", new Point3D(3770, 1308, 0), Map.Felucca ),
new TAEntry("Ocllo", new Point3D(3626, 2611, 0), Map.Felucca ),
new TAEntry("Papua", new Point3D(5729, 3208, -6), Map.Felucca ),
new TAEntry("Serpents Hold", new Point3D(2895, 3479, 15), Map.Felucca ),
new TAEntry("Skara Brae", new Point3D(596, 2138, 0), Map.Felucca ),
new TAEntry("Trinsic", new Point3D(1823, 2821, 0), Map.Felucca ),
new TAEntry("Vesper", new Point3D(2899, 676, 0), Map.Felucca ),
new TAEntry("Wind", new Point3D(1361, 895, 0), Map.Felucca ),
new TAEntry("Yew", new Point3D(542, 985, 0), Map.Felucca )
});
GlobalEntries.Add("Felucca Dungeons", new TAEntry[]
{
new TAEntry("Covetous", new Point3D(2498, 921, 0), Map.Felucca ),
new TAEntry("Daemon Temple", new Point3D(4591, 3647, 80), Map.Felucca ),
new TAEntry("Deceit", new Point3D(4111, 434, 5), Map.Felucca ),
new TAEntry("Despise", new Point3D(1301, 1080, 0), Map.Felucca ),
new TAEntry("Destard", new Point3D(1176, 2640, 2), Map.Felucca ),
new TAEntry("Fire", new Point3D(2923, 3409, 8), Map.Felucca ),
new TAEntry("Hythloth", new Point3D(4721, 3824, 0), Map.Felucca ),
new TAEntry("Ice", new Point3D(1999, 81, 4), Map.Felucca ),
new TAEntry("Ophidian Temple", new Point3D(5766, 2634, 43), Map.Felucca ),
new TAEntry("Orc Caves", new Point3D(1017, 1429, 0), Map.Felucca ),
new TAEntry("Shame", new Point3D(511, 1565, 0), Map.Felucca ),
new TAEntry("Solen Hive", new Point3D(2607, 763, 0), Map.Felucca ),
new TAEntry("Terathan Keep", new Point3D(5451, 3143, -60), Map.Felucca ),
new TAEntry("Wrong", new Point3D(2043, 238, 10), Map.Felucca )
});
GlobalEntries.Add("Custom Areas", new TAEntry[]//add locations to the Custom map here
{
new TAEntry("Starter Area", new Point3D(5671, 1044, 0), Map.Trammel ),
new TAEntry("Vendor Mall", new Point3D(1012, 466, -90), Map.Malas ),
});
GlobalEntries.Add("Ilshenar", new TAEntry[]
{
new TAEntry("Ankh Dungeon", new Point3D(576, 1150, -100), Map.Ilshenar ),
new TAEntry("Blood Dungeon", new Point3D(1747, 1171, -2), Map.Ilshenar ),
new TAEntry("Exodus Dungeon", new Point3D(854, 778, -80), Map.Ilshenar ),
new TAEntry("Gargoyle City", new Point3D(852, 602, -40), Map.Ilshenar ),
new TAEntry("Lakeshire", new Point3D(1203, 1124, -25), Map.Ilshenar ),
new TAEntry("Mistas", new Point3D(819, 1130, -29), Map.Ilshenar ),
new TAEntry("Montor", new Point3D(1706, 205, 104), Map.Ilshenar ),
new TAEntry("Rock Dungeon", new Point3D(1787, 572, 69), Map.Ilshenar ),
new TAEntry("Savage Camp", new Point3D(1151, 659, -80), Map.Ilshenar ),
new TAEntry("Sorceror's Dungeon", new Point3D(548, 462, -53), Map.Ilshenar ),
new TAEntry("Spectre Dungeon", new Point3D(1363, 1033, -8), Map.Ilshenar ),
new TAEntry("Spider Cave", new Point3D(1420, 913, -16), Map.Ilshenar ),
new TAEntry("Wisp Dungeon", new Point3D(651, 1302, -58), Map.Ilshenar )
});
GlobalEntries.Add("Ilshenar Shrines", new TAEntry[]
{
new TAEntry("Compassion Shrine", new Point3D(1215, 467, -13), Map.Ilshenar ),
new TAEntry("Honesty Shrine", new Point3D(722, 1366, -60), Map.Ilshenar ),
new TAEntry("Honor Shrine", new Point3D(744, 724, -28), Map.Ilshenar ),
new TAEntry("Humility Shrine", new Point3D(281, 1016, 0), Map.Ilshenar ),
new TAEntry("Justice Shrine", new Point3D(987, 1011, -32), Map.Ilshenar ),
new TAEntry("Sacrifice Shrine", new Point3D(1174, 1286, -30), Map.Ilshenar ),
new TAEntry("Spirituality Shrine", new Point3D(1532, 1340, -3), Map.Ilshenar ),
new TAEntry("Valor Shrine", new Point3D(528, 216, -45), Map.Ilshenar ),
new TAEntry("Choas Shrine", new Point3D(1721, 218, 96), Map.Ilshenar )
});
GlobalEntries.Add("Malas", new TAEntry[]
{
new TAEntry("Doom", new Point3D(2368, 1267, -85), Map.Malas ),
new TAEntry("Luna", new Point3D(1015, 527, -65), Map.Malas ),
new TAEntry("Orc Fort 1", new Point3D(912, 215, -90), Map.Malas ),
new TAEntry("Orc Fort 2", new Point3D(1678, 374, -50), Map.Malas ),
new TAEntry("Orc Fort 3", new Point3D(1375, 621, -86), Map.Malas ),
new TAEntry("Orc Fort 4", new Point3D(1184, 715, -89), Map.Malas ),
new TAEntry("Orc Fort 5", new Point3D(1279, 1324, -90), Map.Malas ),
new TAEntry("Orc Fort 6", new Point3D(1598, 1834, -107), Map.Malas ),
new TAEntry("Ruined Temple", new Point3D(1598, 1762, -110), Map.Malas ),
new TAEntry("Umbra", new Point3D(1997, 1386, -85), Map.Malas )
});
GlobalEntries.Add("Tokuno", new TAEntry[]
{
new TAEntry("Bushido Dojo", new Point3D(322, 430, 32), Map.Tokuno ),
new TAEntry("Crane Marsh", new Point3D(203, 985, 18), Map.Tokuno ),
new TAEntry("Fan Dancer's Dojo", new Point3D(970, 222, 23), Map.Tokuno ),
new TAEntry("Isamu-Jima", new Point3D(1169, 998, 41), Map.Tokuno ),
new TAEntry("Makoto-Jima", new Point3D(802, 1204, 25), Map.Tokuno ),
new TAEntry("Homare-Jima", new Point3D(270, 628, 15), Map.Tokuno ),
new TAEntry("Makoto Desert", new Point3D(724, 1050, 33), Map.Tokuno ),
new TAEntry("Makoto Zento", new Point3D(741, 1261, 30), Map.Tokuno ),
new TAEntry("Mt. Sho Castle", new Point3D(1234, 772, 3), Map.Tokuno ),
new TAEntry("Valor Shrine", new Point3D(1044, 523, 15), Map.Tokuno ),
new TAEntry("Yomotsu Mine", new Point3D(257, 786, 63), Map.Tokuno )
});
GlobalEntries.Add("Staff", new TAEntry[]//add locations to the staff map here
{
new TAEntry("Green Acres tram", new Point3D(5445, 1153, 0), Map.Trammel ),
new TAEntry("Green Acres fel", new Point3D(5445, 1153, 0), Map.Felucca ),
new TAEntry("Jail tram", new Point3D(5296, 1173, 0), Map.Trammel ),
new TAEntry("Jail fel", new Point3D(5296, 1173, 0), Map.Felucca ),
new TAEntry("Star Room tram", new Point3D(5146, 1774, 0), Map.Trammel ),
new TAEntry("Star Room fel", new Point3D(5146, 1774, 0), Map.Felucca )
});
GlobalEntries.Add("TerMur", new TAEntry[]//add locations to the TerMur map here
{
new TAEntry("East Refuge", new Point3D(1112, 3619, -45), Map.TerMur ),
new TAEntry("Fisherman Village", new Point3D(640, 3059, 38), Map.TerMur ),
new TAEntry("Holy City", new Point3D(996, 3869, -42), Map.TerMur ),
new TAEntry("Royal City", new Point3D(851, 3525, -38), Map.TerMur )
});
}
public static int GenerateTravelAtlas()
{
int gen = 0;
if (GetOptFlag( m_GlobalFlags, OptFlags.Trammel )) gen += GenerateEntry( "Trammel" );
if (GetOptFlag( m_GlobalFlags, OptFlags.TramDungeons )) gen += GenerateEntry( "Trammel Dungeons" );
if (GetOptFlag( m_GlobalFlags, OptFlags.Felucca )) gen += GenerateEntry( "Felucca" );
if (GetOptFlag( m_GlobalFlags, OptFlags.FelDungeons )) gen += GenerateEntry( "Felucca Dungeons" );
if (GetOptFlag( m_GlobalFlags, OptFlags.Custom)) gen += GenerateEntry( "Custom Areas" );
if (GetOptFlag( m_GlobalFlags, OptFlags.Ilshenar)) gen += GenerateEntry( "Ilshenar" );
if (GetOptFlag( m_GlobalFlags, OptFlags.IlshenarShrines)) gen += GenerateEntry( "Ilshenar Shrines" );
if (GetOptFlag( m_GlobalFlags, OptFlags.Malas) && Core.AOS) gen += GenerateEntry( "Malas" );
if (GetOptFlag( m_GlobalFlags, OptFlags.Tokuno) && Core.SE) gen += GenerateEntry( "Tokuno" );
if (GetOptFlag( m_GlobalFlags, OptFlags.TerMur)) gen += GenerateEntry( "TerMur" );
gen += GenerateEntry( "Staff" );
return gen;
}
private static int GenerateEntry( string map )
{
TAEntry[] me = (TAEntry[])GlobalEntries[map];
if ( me != null )
{
for (int i = 0; i < me.Length; i++)
new TravelAtlas().MoveToWorld( me[i].Destination, me[i].Map );
return me.Length;
}
return 0;
}
public static Hashtable GlobalEntries = new Hashtable();
private OptFlags m_Flags;
private static OptFlags m_GlobalFlags;
[CommandProperty(AccessLevel.Administrator)]
public bool Trammel{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.Trammel ); } set{ SetOptFlag( OptFlags.Trammel, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool TramDungeons{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.TramDungeons ); } set{ SetOptFlag( OptFlags.TramDungeons, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool Felucca{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.Felucca ); } set{ SetOptFlag( OptFlags.Felucca, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool FelDungeons{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.FelDungeons ); } set{ SetOptFlag( OptFlags.FelDungeons, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool Custom{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.Custom ); } set{ SetOptFlag( OptFlags.Custom, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool Ilshenar{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.Ilshenar ); } set{ SetOptFlag( OptFlags.Ilshenar, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool IlshenarShrines{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.IlshenarShrines ); } set{ SetOptFlag( OptFlags.IlshenarShrines, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool Malas{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.Malas ); } set{ SetOptFlag( OptFlags.Malas, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool Tokuno{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.Tokuno ); } set{ SetOptFlag( OptFlags.Tokuno, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool AllowReds{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.AllowReds ); } set{ SetOptFlag( OptFlags.AllowReds, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool TerMur{ get{ return GetOptFlag( (UseGlobal ? m_GlobalFlags : m_Flags), OptFlags.TerMur ); } set{ SetOptFlag( OptFlags.TerMur, value ); } }
[CommandProperty(AccessLevel.Administrator)]
public bool UseGlobal{ get{ return GetOptFlag( m_Flags, OptFlags.UseGlobal ); } set{ SetOptFlag( ref m_Flags, OptFlags.UseGlobal, value ); } }
public void SetOptFlag( OptFlags toSet, bool value )
{
if ( UseGlobal )
{
if ( value )
m_GlobalFlags |= toSet;
else
m_GlobalFlags &= ~toSet;
}
else
{
if ( value )
m_Flags |= toSet;
else
m_Flags &= ~toSet;
}
}
public static void SetOptFlag( ref OptFlags flags, OptFlags toSet, bool value )
{
if ( value )
flags |= toSet;
else
flags &= ~toSet;
}
public static bool GetOptFlag( OptFlags flags, OptFlags flag )
{
return ( (flags & flag) != 0 );
}
[Constructable]
public TravelAtlas() : this ( (int)m_GlobalFlags )
{
}
[Constructable]
public TravelAtlas( int flags ) : base( 0x22C5 )
{
Movable = true;
LootType = LootType.Blessed;
Hue = 38;
Name = "Travel Atlas";
Light = LightType.Circle300;
m_Flags = (OptFlags)flags;
}
public override void OnDoubleClick( Mobile from )
{
if ( !from.Player )
return;
UseTeleporter(from);
}
public bool UseTeleporter( Mobile m )
{
if ( m.Criminal )
m.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
else if ( Server.Spells.SpellHelper.CheckCombat( m ) )
m.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
else if ( m.Spell != null )
m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
else
{
m.CloseGump( typeof( TravelAtlasGump ) );
m.SendGump( new TravelAtlasGump( m, this, 0 ) );
if ( !m.Hidden || m.AccessLevel == AccessLevel.Player )
Effects.PlaySound( m.Location, m.Map, 0x20E );
return true;
}
return false;
}
public TravelAtlas( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 2 ); // version
//version 2
writer.Write( (int) m_Flags );
writer.Write( (int) m_GlobalFlags );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch (version)
{
case 2:
{
m_Flags = (OptFlags)reader.ReadInt();
m_GlobalFlags = (OptFlags)reader.ReadInt();
break;
}
case 1:
{
SetOptFlag( ref m_Flags, OptFlags.IlshenarShrines, reader.ReadBool() );
goto case 0;
}
case 0:
{
SetOptFlag( ref m_Flags, OptFlags.Trammel, reader.ReadBool() );
SetOptFlag( ref m_Flags, OptFlags.TramDungeons, reader.ReadBool() );
SetOptFlag( ref m_Flags, OptFlags.Felucca, reader.ReadBool() );
SetOptFlag( ref m_Flags, OptFlags.FelDungeons, reader.ReadBool() );
SetOptFlag( ref m_Flags, OptFlags.Custom, reader.ReadBool() );
SetOptFlag( ref m_Flags, OptFlags.Ilshenar, reader.ReadBool() );
SetOptFlag( ref m_Flags, OptFlags.Malas, reader.ReadBool() );
SetOptFlag( ref m_Flags, OptFlags.Tokuno, reader.ReadBool() );
SetOptFlag( ref m_Flags, OptFlags.AllowReds, reader.ReadBool() );
SetOptFlag( ref m_Flags, OptFlags.TerMur, reader.ReadBool() );
UseGlobal = false;
break;
}
}
}
}
public class TravelAtlasGump : Gump
{
private TravelAtlas m_TravelAtlas;
private int m_Page;
private bool m_Reds, m_HasLBR, m_HasAOS, m_HasSE;
public TravelAtlasGump( Mobile from, TravelAtlas TA, int page ) : base( 100, 100 )
{
ClientFlags flags = (from.NetState == null ? ClientFlags.None : from.NetState.Flags);
m_TravelAtlas = TA;
m_Page = page;
m_HasLBR = ((int)flags & 0x04) != 0;
m_HasAOS = ((int)flags & 0x08) != 0;
m_HasSE = ((int)flags & 0x10) != 0;
m_Reds = (from.Kills < 5 || TA.AllowReds);
//Did they press an invalid button or supply an invalid argument?
if ( page < 0 || page > 11 )
page = 0;
AddPage( 0 );
AddBackground( 0, 0, 660, 404, 3500 ); //white
AddImage(267, 10, 5528); // map
AddImage(45, 30, 5609); // globe
AddHtmlLocalized( 10, 10, 200, 20, 1012011, false, false ); // Pick your destination:
int p = 1;
if ( TA.Trammel && m_Reds )
{
GenerateMapListing( 1 );
AddPageButton( "Trammel", Map.Trammel, p++, 1 );
}
if ( TA.TramDungeons && m_Reds )
{
GenerateMapListing( 2 );
AddPageButton( "Trammel Dungeons", Map.Trammel, p++, 2 );
}
if ( TA.Felucca )
{
GenerateMapListing( 3 );
AddPageButton( "Felucca", Map.Felucca, p++, 3 );
}
if ( TA.FelDungeons )
{
GenerateMapListing( 4 );
AddPageButton( "Felucca Dungeons", Map.Felucca, p++, 4 );
}
if ( TA.Custom && m_Reds && Core.AOS && m_HasAOS )
{
GenerateMapListing( 5 );
AddPageButton( "<basefont color=#0000FF>Custom <basefont color=#FF0000>Areas</basefont>", null, p++, 5 );
}
if ( TA.Ilshenar && m_Reds && m_HasLBR )
{
GenerateMapListing( 6 );
AddPageButton( "Ilshenar", Map.Ilshenar, p++, 6 );
}
if ( TA.IlshenarShrines && m_Reds && m_HasLBR )
{
GenerateMapListing( 7 );
AddPageButton( "Ilshenar Shrines", Map.Ilshenar, p++, 7 );
}
if ( TA.Malas && m_Reds && Core.AOS && m_HasAOS )
{
GenerateMapListing( 8 );
AddPageButton( "Malas", Map.Malas, p++, 8 );
}
if ( TA.Tokuno && m_Reds && Core.SE && m_HasSE )
{
GenerateMapListing( 9 );
AddPageButton( "Tokuno", Map.Tokuno, p++, 9 );
}
if ( from.AccessLevel > AccessLevel.Player )
{
GenerateMapListing( 10 );
AddPageButton( "Staff Only", null, p++, 10 );
}
if ( TA.TerMur )
{
GenerateMapListing( 11 );
AddPageButton( "TerMur", null, p++, 11 );
}
}
private void AddPageButton( string text, Map map, int offset, int page )
{
string label;
if ( map != null )
label = String.Format( "<basefont color=#{0}>{1}</basefont>", MapHue( map ), text );
else
label = text;
AddHtml( 30, 100 + ((offset - 1) * 25), 150, 20, label, false, false );
AddButton( 10, 100 + ((offset - 1) * 25), 2117, 2118, page, GumpButtonType.Reply, 0 );
}
private static TAEntry GetEntry( string name, int id )
{
TAEntry[] me = (TAEntry[])TravelAtlas.GlobalEntries[name];
if ( me != null )
{
if ( id < 0 || id >= me.Length )
id = 0;
return me[id];
}
return null;
}
private void GenerateMapListing( int page )
{
if ( m_Page == 0 )
m_Page = page;
else if ( page != m_Page )
return;
string name = m_Entries[page-1];
TAEntry[] me = (TAEntry[])TravelAtlas.GlobalEntries[name];
if ( me == null )
return;
int offset = m_Page * 100;
bool gates = name == "Custom Areas";
for (int i = 0, l = 0; i < me.Length; i++ )
{
TAEntry entry = me[i];
if ( ( (gates || name == "Felucca") && entry.Map == Map.Felucca && !m_TravelAtlas.Felucca) )
continue;
else if ( (gates || name == "Trammel") && entry.Map == Map.Trammel && (!m_TravelAtlas.Trammel || !m_Reds))
continue;
else if ( entry.Map == Map.Ilshenar && (!m_TravelAtlas.Ilshenar || !m_HasLBR || !m_Reds))
continue;
else if (entry.Map == Map.Malas && (!Core.AOS || !m_HasAOS || !m_TravelAtlas.Malas || !m_Reds))
continue;
else if (entry.Map == Map.Tokuno && (!Core.SE || !m_HasSE || !m_TravelAtlas.Tokuno || !m_Reds))
continue;
else
{
string label = String.Format( "<basefont color=#{0}>{1}</basefont>", MapHue( entry.Map ), entry.Name );
AddHtml( 180, 20+(l*20), 150, 20, label, false, false );
AddButton( 145, 20+(l*20), 4015, 4016, (i+offset), GumpButtonType.Reply, 0 );
l++;
}
}
}
private string MapHue( Map map )
{
if ( map == null )
return "101010";
if ( map == Map.Felucca )
return "FF0000";
else if ( map == Map.Trammel )
return "0000FF";
else if ( map == Map.Ilshenar )
return "008000";
else if ( map == Map.Malas )
return "FFFFFF";
else
return "FF00FF";
}
private static string[] m_Entries = new string[]
{
"Trammel", "Trammel Dungeons", "Felucca", "Felucca Dungeons",
"Custom Areas", "Ilshenar", "Ilshenar Shrines", "Malas",
"Tokuno", "Staff", "TerMur"
};
public override void OnResponse( NetState state, RelayInfo info )
{
Mobile from = state.Mobile;
if ( info.ButtonID <= 0 || from == null || from.Deleted || m_TravelAtlas == null || m_TravelAtlas.Deleted )
return;
int id = info.ButtonID / 100;
int count = info.ButtonID % 100;
if ( id == 0 && count < 12 )
{
from.SendGump( new TravelAtlasGump( from, m_TravelAtlas, count ) );
return;
}
//Invalid checks
if ( id < 1 || id > 11 || (id == 10 && from.AccessLevel < AccessLevel.GameMaster) )
id = 1;
string name = m_Entries[id-1];
TAEntry entry = GetEntry( name, count );
bool gates = name == "Custom Areas";
if ( entry == null )
from.SendMessage( "Error: Invalid Button Response - No Map Entries" );
else if ( ( (gates || name == "Felucca") && entry.Map == Map.Felucca && !m_TravelAtlas.Felucca) )
from.SendMessage( "Error: Invalid Button Response - Felucca Disabled" );
else if ( (gates || name == "Trammel") && entry.Map == Map.Trammel && (!m_TravelAtlas.Trammel || !m_Reds))
from.SendMessage( "Error: Invalid Button Response - Trammel Disabled" );
else if ( (name == "Ilshenar" ) && entry.Map == Map.Ilshenar && (!m_TravelAtlas.Ilshenar || !m_HasLBR || !m_Reds))
from.SendMessage( "Error: Invalid Button Response - Ilshenar Disabled" );
else if (entry.Map == Map.Malas && (!Core.AOS || !m_HasAOS || !m_TravelAtlas.Malas || !m_Reds))
from.SendMessage( "Error: Invalid Button Response - Malas Disabled" );
else if (entry.Map == Map.Tokuno && (!Core.SE || !m_HasSE || !m_TravelAtlas.Tokuno || !m_Reds))
from.SendMessage( "Error: Invalid Button Response - Tokuno Disabled" );
else if ( !from.InRange( m_TravelAtlas.GetWorldLocation(), 1 ) || from.Map != m_TravelAtlas.Map )
from.SendLocalizedMessage( 1019002 ); // You are too far away to use the gate.
else if ( from.Criminal )
from.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
else if ( Server.Spells.SpellHelper.CheckCombat( from ) )
from.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
else if ( from.Spell != null )
from.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
else if ( from.Map == entry.Map && from.InRange( entry.Destination, 1 ) )
from.SendLocalizedMessage( 1019003 ); // You are already there.
else
{
BaseCreature.TeleportPets( from, entry.Destination, entry.Map );
from.Combatant = null;
from.MoveToWorld( entry.Destination, entry.Map );
if ( !from.Hidden || from.AccessLevel == AccessLevel.Player )
Effects.PlaySound( entry.Destination, entry.Map, 0x1FE );
}
}
}
public class TAEntry
{
private string m_Name;
private Point3D m_Destination;
private Map m_Map;
public string Name{ get{ return m_Name; } }
public Point3D Destination{ get{ return m_Destination; } }
public Map Map{ get{ return m_Map; } }
public TAEntry( string name, Point3D p, Map map)
{
m_Name = name;
m_Destination = p;
m_Map = map;
}
}
}

View File

@@ -0,0 +1,118 @@
// Unique Character Names v1.1.2
// Author: Felladrin
// Started: 2013-08-01
// Updated: 2016-07-28
using System;
using Server;
using Server.Gumps;
using Server.Misc;
using Server.Mobiles;
using Server.Network;
namespace Felladrin.Automations
{
public static class UniqueCharacterNames
{
public static void Initialize()
{
EventSink.Login += OnLogin;
}
static void OnLogin(LoginEventArgs args)
{
Mobile from = args.Mobile;
if (HasValidName(from))
return;
from.SendMessage(33, "Your character name '{0}' is already in use by player character or it has been marked as invalid. Please choose a new one.", from.Name);
from.RawName = "Generic Player";
from.SendGump(new NameChangeGump());
}
static bool HasValidName(Mobile m)
{
if (m.AccessLevel != AccessLevel.Player)
return true;
if (m.RawName == null || m.RawName.Trim() == String.Empty || m.RawName == "Generic Player" || !NameVerification.Validate(m.RawName, 2, 16, true, false, true, 1, NameVerification.SpaceDashPeriodQuote))
return false;
foreach (Mobile otherPlayer in World.Mobiles.Values)
if (otherPlayer is PlayerMobile && otherPlayer != m && otherPlayer.RawName != null && m.RawName != null && otherPlayer.RawName.ToLower() == m.RawName.ToLower() && m.CreationTime > otherPlayer.CreationTime)
return false;
return true;
}
public class NameChangeGump : Gump
{
void AddBlackAlpha(int x, int y, int width, int height)
{
AddImageTiled(x, y, width, height, 2624);
AddAlphaRegion(x, y, width, height);
}
void AddTextField(int x, int y, int width, int height, int index)
{
AddBackground(x - 2, y - 2, width + 4, height + 4, 0x2486);
AddTextEntry(x + 2, y + 2, width - 4, height - 4, 0, index, "");
}
static string Center(string text)
{
return String.Format("<CENTER>{0}</CENTER>", text);
}
static string Color(string text, int color)
{
return String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", color, text);
}
void AddButtonLabeled(int x, int y, int buttonID, string text)
{
AddButton(x, y - 1, 4005, 4007, buttonID, GumpButtonType.Reply, 0);
AddHtml(x + 35, y, 240, 20, Color(text, 0xFFFFFF), false, false);
}
public NameChangeGump() : base(50, 50)
{
Closable = true;
Dragable = true;
Resizable = false;
AddPage(0);
AddBlackAlpha(10, 120, 250, 85);
AddHtml(10, 125, 250, 20, Color(Center("Your name is already in use or invalid!"), 0xFFFFFF), false, false);
AddLabel(73, 15, 1152, "");
AddLabel(20, 150, 0x480, "New Name:");
AddTextField(100, 150, 150, 20, 0);
AddButtonLabeled(175, 180, 1, "Submit");
}
public override void OnResponse(NetState sender, RelayInfo info)
{
if (info.ButtonID != 1)
return;
var m = sender.Mobile;
var nameEntry = info.GetTextEntry(0);
m.RawName = nameEntry != null ? nameEntry.Text.Trim() : "Generic Player";
if (HasValidName(m))
{
m.SendMessage(66, "Your name has been changed! You are now known as '{0}'.", m.RawName);
}
else
{
m.SendMessage(33, "You can't use that name. Please choose a new one.");
m.RawName = "Generic Player";
m.CloseGump(typeof(NameChangeGump));
m.SendGump(new NameChangeGump());
}
}
}
}
}

View File

@@ -0,0 +1,305 @@
//================================================//
// Based on winecrafting grounds created by //
// dracana, modded by Manu from Splitterwelt.com //
// for use with carpets //
// Desc: For players to place carpets in their //
// houses. Especially useful for players //
// with non-custom housing.
// Modified for 2.0 by Draco Van Peeble
//================================================//
using System;
using System.Collections;
using Server;
using Server.Gumps;
using Server.Mobiles;
using Server.Multis;
using Server.Network;
namespace Server.Items
{
public class VariableCarpetAddon : BaseAddon
{
public override BaseAddonDeed Deed{ get{ return new VariableCarpetAddonDeed(); } }
#region Constructors
[Constructable]
public VariableCarpetAddon( VariableCarpetType type, int width, int height ) : this( (int)type, width, height )
{
}
public VariableCarpetAddon( int type, int width, int height )
{
VariableCarpetInfo info = VariableCarpetInfo.GetInfo( type );
AddComponent( new AddonComponent( info.GetItemPart( GroundPosition.Top ).ItemID ), 0, 0, 0 );
AddComponent( new AddonComponent( info.GetItemPart( GroundPosition.Right ).ItemID ), width, 0, 0 );
AddComponent( new AddonComponent( info.GetItemPart( GroundPosition.Left ).ItemID ), 0, height, 0 );
AddComponent( new AddonComponent( info.GetItemPart( GroundPosition.Bottom ).ItemID ), width, height, 0 );
int w = width - 1;
int h = height - 1;
for ( int y = 1; y <= h; ++y )
AddComponent( new AddonComponent( info.GetItemPart( GroundPosition.West ).ItemID ), 0, y, 0 );
for ( int x = 1; x <= w; ++x )
AddComponent( new AddonComponent( info.GetItemPart( GroundPosition.North ).ItemID ), x, 0, 0 );
for ( int y = 1; y <= h; ++y )
AddComponent( new AddonComponent( info.GetItemPart( GroundPosition.East ).ItemID ), width, y, 0 );
for ( int x = 1; x <= w; ++x )
AddComponent( new AddonComponent( info.GetItemPart( GroundPosition.South ).ItemID ), x, height, 0 );
for ( int x = 1; x <= w; ++x )
for ( int y = 1; y <= h; ++y )
AddComponent( new AddonComponent( info.GetItemPart( GroundPosition.Center ).ItemID ), x, y, 0 );
}
public VariableCarpetAddon( Serial serial ) : base( serial )
{
}
#endregion
public override void OnDoubleClick( Mobile from )
{
BaseHouse house = BaseHouse.FindHouseAt( this );
if ( house != null && house.IsCoOwner( from ) )
{
if ( from.InRange( GetWorldLocation(), 3 ) )
{
from.SendGump(new ConfirmRemovalGumpVariableCarpet( this ));
}
else
{
from.SendLocalizedMessage( 500295 ); // You are too far away to do that.
}
}
}
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 enum VariableCarpetType
{
BlueStructureBorder,
BluePlainBorder,
BlueYellowBorder,
RedStructureBorder,
RedPlainBorder,
YellowStructureBorder
}
public enum GroundPosition
{
Top,
Bottom,
Left,
Right,
West,
North,
East,
South,
Center
}
public class VariableCarpetInfo
{
private GroundItemPart[] m_Entries;
public GroundItemPart[] Entries{ get{ return m_Entries; } }
public VariableCarpetInfo( GroundItemPart[] entries )
{
m_Entries = entries;
}
public GroundItemPart GetItemPart( GroundPosition pos )
{
int i = (int)pos;
if ( i < 0 || i >= m_Entries.Length )
i = 0;
return m_Entries[i];
}
public static VariableCarpetInfo GetInfo( int type )
{
if ( type < 0 || type >= m_Infos.Length )
type = 0;
return m_Infos[type];
}
#region VariableCarpetInfo definitions
private static VariableCarpetInfo[] m_Infos = new VariableCarpetInfo[] {
/* BlueStructureBorder */ new VariableCarpetInfo( new GroundItemPart[] {
new GroundItemPart( 0xAC3, GroundPosition.Top, 44, 0 ),
new GroundItemPart( 0xAC2, GroundPosition.Bottom, 44, 68 ),
new GroundItemPart( 0xAC4, GroundPosition.Left, 0, 28 ),
new GroundItemPart( 0xAC5, GroundPosition.Right, 88, 28 ),
new GroundItemPart( 0xAF6, GroundPosition.West, 22, 12 ),
new GroundItemPart( 0xAF7, GroundPosition.North, 66, 12 ),
new GroundItemPart( 0xAF8, GroundPosition.East, 66, 46 ),
new GroundItemPart( 0xAF9, GroundPosition.South, 22, 46 ),
new GroundItemPart( 0xABD, GroundPosition.Center, 44, 24 )
}),
/* BluePlainBorder */ new VariableCarpetInfo( new GroundItemPart[] {
new GroundItemPart( 0xAC3, GroundPosition.Top, 44, 0 ),
new GroundItemPart( 0xAC2, GroundPosition.Bottom, 44, 68 ),
new GroundItemPart( 0xAC4, GroundPosition.Left, 0, 28 ),
new GroundItemPart( 0xAC5, GroundPosition.Right, 88, 28 ),
new GroundItemPart( 0xAF6, GroundPosition.West, 22, 12 ),
new GroundItemPart( 0xAF7, GroundPosition.North, 66, 12 ),
new GroundItemPart( 0xAF8, GroundPosition.East, 66, 46 ),
new GroundItemPart( 0xAF9, GroundPosition.South, 22, 46 ),
new GroundItemPart( 0xABE, GroundPosition.Center, 44, 24 )
}),
/* BlueYellowBorder */ new VariableCarpetInfo( new GroundItemPart[] {
new GroundItemPart( 0xAD3, GroundPosition.Top, 44, 0 ),
new GroundItemPart( 0xAD2, GroundPosition.Bottom, 44, 68 ),
new GroundItemPart( 0xAD4, GroundPosition.Left, 0, 28 ),
new GroundItemPart( 0xAD5, GroundPosition.Right, 88, 28 ),
new GroundItemPart( 0xAD6, GroundPosition.West, 22, 8 ),
new GroundItemPart( 0xAD7, GroundPosition.North, 66, 8 ),
new GroundItemPart( 0xAD8, GroundPosition.East, 66, 46 ),
new GroundItemPart( 0xAD9, GroundPosition.South, 22, 46 ),
new GroundItemPart( 0xAD1, GroundPosition.Center, 44, 24 )
}),
/* RedStructureBorder */ new VariableCarpetInfo( new GroundItemPart[] {
new GroundItemPart( 0xACA, GroundPosition.Top, 44, 0 ),
new GroundItemPart( 0xAC9, GroundPosition.Bottom, 44, 68 ),
new GroundItemPart( 0xACB, GroundPosition.Left, 0, 28 ),
new GroundItemPart( 0xACC, GroundPosition.Right, 88, 28 ),
new GroundItemPart( 0xACD, GroundPosition.West, 22, 10 ),
new GroundItemPart( 0xACE, GroundPosition.North, 66, 12 ),
new GroundItemPart( 0xACF, GroundPosition.East, 66, 46 ),
new GroundItemPart( 0xAD0, GroundPosition.South, 22, 46 ),
new GroundItemPart( 0xAC7, GroundPosition.Center, 44, 24 )
}),
/* RedPlainBorder */ new VariableCarpetInfo( new GroundItemPart[] {
new GroundItemPart( 0xACA, GroundPosition.Top, 44, 0 ),
new GroundItemPart( 0xAC9, GroundPosition.Bottom, 44, 68 ),
new GroundItemPart( 0xACB, GroundPosition.Left, 0, 28 ),
new GroundItemPart( 0xACC, GroundPosition.Right, 88, 28 ),
new GroundItemPart( 0xACD, GroundPosition.West, 22, 10 ),
new GroundItemPart( 0xACE, GroundPosition.North, 66, 12 ),
new GroundItemPart( 0xACF, GroundPosition.East, 66, 46 ),
new GroundItemPart( 0xAD0, GroundPosition.South, 22, 46 ),
new GroundItemPart( 0xAC8, GroundPosition.Center, 44, 24 )
}),
/* YellowStructureBorder */ new VariableCarpetInfo( new GroundItemPart[] {
new GroundItemPart( 0xADC, GroundPosition.Top, 44, 0 ),
new GroundItemPart( 0xADB, GroundPosition.Bottom, 44, 68 ),
new GroundItemPart( 0xADD, GroundPosition.Left, 0, 28 ),
new GroundItemPart( 0xADE, GroundPosition.Right, 88, 28 ),
new GroundItemPart( 0xADF, GroundPosition.West, 22, 8 ),
new GroundItemPart( 0xAE0, GroundPosition.North, 66, 8 ),
new GroundItemPart( 0xAE1, GroundPosition.East, 66, 46 ),
new GroundItemPart( 0xAE2, GroundPosition.South, 22, 46 ),
new GroundItemPart( 0xADA, GroundPosition.Center, 44, 24 )
})
};
#endregion
public static VariableCarpetInfo[] Infos{ get{ return m_Infos; } }
}
public class GroundItemPart
{
private int m_ItemID;
private GroundPosition m_Info;
private int m_OffsetX;
private int m_OffsetY;
public int ItemID
{
get{ return m_ItemID; }
}
public GroundPosition GroundPosition
{
get{ return m_Info; }
}
// For Gump Rendering
public int OffsetX
{
get{ return m_OffsetX; }
}
// For Gump Rendering
public int OffsetY
{
get{ return m_OffsetY; }
}
public GroundItemPart( int itemID, GroundPosition info, int offsetX, int offsetY )
{
m_ItemID = itemID;
m_Info = info;
m_OffsetX = offsetX;
m_OffsetY = offsetY;
}
}
public class ConfirmRemovalGumpVariableCarpet : Gump
{
private VariableCarpetAddon m_VariableCarpetAddon;
public ConfirmRemovalGumpVariableCarpet(VariableCarpetAddon VariableCarpetaddon)
: base(50, 50)
{
m_VariableCarpetAddon = VariableCarpetaddon;
AddBackground(0, 0, 450, 260, 9270);
AddAlphaRegion(12, 12, 426, 22);
AddTextEntry(13, 13, 379, 20, 32, 0, @"Warning!");
AddAlphaRegion(12, 39, 426, 209);
AddHtml(15, 50, 420, 185, "<BODY>" +
"<BASEFONT COLOR=YELLOW>You are about to remove this carpet!<BR><BR>" +
"<BASEFONT COLOR=YELLOW>If it is removed, a deed will be placed " +
"<BASEFONT COLOR=YELLOW>in your backpack.<BR><BR>" +
"<BASEFONT COLOR=YELLOW>Are you sure that you want to remove this carpet?<BR><BR>" +
"</BODY>", false, false);
AddButton(13, 220, 0xFA5, 0xFA6, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(47, 222, 150, 20, 1052072, 0x7FFF, false, false); // Continue
//AddButton(200, 245, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0);
//AddHtmlLocalized(47, 247, 450, 20, 1060051, 0x7FFF, false, false); // CANCEL
AddButton(350, 220, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(385, 222, 100, 20, 1060051, 0x7FFF, false, false); // CANCEL
}
public override void OnResponse(NetState sender, RelayInfo info)
{
if (info.ButtonID == 0 )
return;
Mobile from = sender.Mobile;
from.AddToBackpack(new VariableCarpetAddonDeed());
m_VariableCarpetAddon.Delete();
from.SendMessage( "Carpet removed" );
}
}
}

View File

@@ -0,0 +1,252 @@
//================================================//
// Based on winecrafting grounds created by //
// dracana, modded by Manu from Splitterwelt.com //
// for use with carpets //
// Desc: For players to place carpets in their //
// houses. Especially useful for players //
// with non-custom housing.
// Modified for 2.0 by Draco Van Peeble
//================================================//
using System;
using System.Collections.Generic;
using Server;
using Server.Gumps;
using Server.Items;
using Server.Multis;
using Server.Network;
using Server.Targeting;
namespace Server.Items
{
public class VariableCarpetAddonDeed : BaseAddonDeed
{
public override BaseAddon Addon{ get{ return null; } }
[Constructable]
public VariableCarpetAddonDeed()
{
Name = "Variable Carpet Addon Deed";
}
public VariableCarpetAddonDeed( Serial serial ) : base( serial )
{
}
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) )
BoundingBoxPicker.Begin( from, new BoundingBoxCallback( BoundingBox_Callback ), null );
else
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
private void BoundingBox_Callback( Mobile from, Map map, Point3D start, Point3D end, object state )
{
IPoint3D p = start as IPoint3D;
if ( p == null || map == null )
return;
int width = (end.X - start.X), height = (end.Y - start.Y);
if ( width < 2 || height < 2 )
from.SendMessage( "The carpet has to cover a minimum area of 3x3 tiles." );
else if ( IsChildOf( from.Backpack ) )
from.SendGump( new VariableCarpetGump( this, p, map, width, height ) );
else
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
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();
}
}
}
namespace Server.Gumps
{
public class VariableCarpetGump : Gump
{
private const int EntryCount = 3;
private BaseAddonDeed m_Deed;
private IPoint3D m_P3D;
private Map m_Map;
private int m_Width;
private int m_Height;
public VariableCarpetGump( BaseAddonDeed deed, IPoint3D p, Map map, int width, int height ) : base( 30, 30 )
{
m_Deed = deed;
m_P3D = p;
m_Map = map;
m_Width = width;
m_Height = height;
AddPage( 0 );
AddBackground( 0, 0, 450, 160, 9250 );
AddAlphaRegion( 12, 12, 381, 22 );
AddHtml( 13, 13, 379, 20, "<BASEFONT COLOR=WHITE>Choose your carpet</BASEFONT>", false, false );
AddAlphaRegion( 398, 12, 40, 22 );
AddAlphaRegion( 12, 39, 426, 109 );
AddImage( 400, 16, 9766 );
AddImage( 420, 16, 9762 );
AddPage( 1 );
int page = 1;
for ( int i = 0, index = 0; i < VariableCarpetInfo.Infos.Length; ++i, ++index )
{
if ( index >= EntryCount )
{
if ( (EntryCount * page) == EntryCount )
AddImage( 400, 16, 0x2626 );
AddButton( 420, 16, 0x15E1, 0x15E5, 0, GumpButtonType.Page, page + 1 );
++page;
index = 0;
AddPage( page );
AddButton( 400, 16, 0x15E3, 0x15E7, 0, GumpButtonType.Page, page - 1 );
if ( (VariableCarpetInfo.Infos.Length - (EntryCount * page)) < EntryCount )
AddImage( 420, 16, 0x2622 );
}
VariableCarpetInfo info = VariableCarpetInfo.GetInfo( i );
for ( int j = 0; j < info.Entries.Length; ++j )
{
if (info.Entries[j].OffsetX >= 0 && info.Entries[j].OffsetY >= 0 )
AddItem( 20 + (index * 140 ) + info.Entries[j].OffsetX, 46 + info.Entries[j].OffsetY, info.Entries[j].ItemID );
}
AddButton( 20 + (index * 140 ), 46, 1209, 1210, i+1, GumpButtonType.Reply, 0);
}
}
public override void OnResponse( NetState sender, RelayInfo info )
{
Mobile from = sender.Mobile;
if ( info.ButtonID >= 1 )
{
BaseAddon addon = new VariableCarpetAddon( info.ButtonID-1, m_Width, m_Height );
Server.Spells.SpellHelper.GetSurfaceTop( ref m_P3D );
BaseHouse house = null;
AddonFitResult res = addon.CouldFit( m_P3D, m_Map, from, ref house );
if ((res == AddonFitResult.NotInHouse) && (from.AccessLevel >= AccessLevel.Seer) && (res == AddonFitResult.Valid))
{
addon.MoveToWorld(new Point3D(m_P3D));
from.SendGump(new VariableCarpetPlacedGump(m_Deed));
}
if ( res == AddonFitResult.Valid )
addon.MoveToWorld( new Point3D( m_P3D ), m_Map );
else if ( res == AddonFitResult.Blocked )
from.SendLocalizedMessage( 500269 ); // You cannot build that there.
else if ( (res == AddonFitResult.NotInHouse) && (from.AccessLevel == AccessLevel.Player) )
from.SendLocalizedMessage( 500274 ); // You can only place this in a house that you own!
else if ( res == AddonFitResult.DoorsNotClosed )
from.SendMessage( "All doors must be closed!" );
if ( res == AddonFitResult.Valid )
{
if ((from.AccessLevel == AccessLevel.Player) && (house != null))
{
//if ( house != null )
//{
m_Deed.Delete();
//house.Addons.Add( addon );
addon.MoveToWorld(new Point3D(m_P3D));
from.SendGump( new VariableCarpetPlacedGump( m_Deed ) );
//}
//addon.MoveToWorld(new Point3D(m_P3D));
//from.SendGump(new VariableCarpetPlacedGump(m_Deed));
}
else
{
//house.Addons.Add(addon, from);
addon.MoveToWorld(new Point3D(m_P3D));
from.SendGump(new VariableCarpetPlacedGump(m_Deed));
}
}
else
{
addon.Delete();
}
}
}
}
public class VariableCarpetPlacedGump : Gump
{
private BaseAddonDeed m_Deed;
public VariableCarpetPlacedGump( BaseAddonDeed deed ) : base( 30, 30 )
{
m_Deed = deed;
AddPage( 0 );
AddBackground( 0, 0, 450, 250, 9250 );
AddAlphaRegion( 12, 12, 426, 22 );
AddHtml( 13, 13, 379, 20, "<BASEFONT COLOR=WHITE>Carpet successfully placed</BASEFONT>", false, false );
AddAlphaRegion( 12, 39, 426, 199 );
AddHtml( 15, 50, 420, 185, "<BODY>" +
"<BASEFONT COLOR=YELLOW>Your carpet has been placed!<BR>" +
"<BASEFONT COLOR=YELLOW>You may remove this carpet again easily. " +
"<BASEFONT COLOR=YELLOW>Simply use an axe on the carpet.<BR>" +
"<BASEFONT COLOR=YELLOW>*Notice* You have to be within 3 tiles of the west corner of the addon to remove it.<BR><BR>" +
"</BODY>", false, false );
AddButton( 190, 210, 0xF7, 0xF8, 0, GumpButtonType.Reply, 0 );
}
public override void OnResponse( NetState sender, RelayInfo info )
{
Mobile from = sender.Mobile;
switch ( info.ButtonID )
{
case 0: //Case uses the ActionIDs defined above. Case 0 defines the actions for the button with the action id 0
{
//Cancel
from.SendMessage( "Enjoy your new carpet." );
break;
}
}
}
}
}

View File

@@ -0,0 +1,124 @@
using System;
using Server;
using Server.Items;
namespace Server.Items
{
public class goldcarpetAddon2 : BaseAddon
{
public override BaseAddonDeed Deed
{
get
{
return new goldcarpetAddonDeed2();
}
}
[ Constructable ]
public goldcarpetAddon2()
{
AddonComponent ac = null;
ac = new AddonComponent( 2779 );
AddComponent( ac, 2, 2, 0 );
ac = new AddonComponent( 2785 );
AddComponent( ac, 2, 1, 0 );
ac = new AddonComponent( 2785 );
AddComponent( ac, 2, 0, 0 );
ac = new AddonComponent( 2786 );
AddComponent( ac, 1, 2, 0 );
ac = new AddonComponent( 2786 );
AddComponent( ac, 0, 2, 0 );
ac = new AddonComponent( 2781 );
AddComponent( ac, -2, 2, 0 );
ac = new AddonComponent( 2786 );
AddComponent( ac, -1, 2, 0 );
ac = new AddonComponent( 2782 );
AddComponent( ac, 2, -2, 0 );
ac = new AddonComponent( 2783 );
AddComponent( ac, -2, 1, 0 );
ac = new AddonComponent( 2783 );
AddComponent( ac, -2, 0, 0 );
ac = new AddonComponent( 2783 );
AddComponent( ac, -2, -1, 0 );
ac = new AddonComponent( 2784 );
AddComponent( ac, 1, -2, 0 );
ac = new AddonComponent( 2784 );
AddComponent( ac, 0, -2, 0 );
ac = new AddonComponent( 2784 );
AddComponent( ac, -1, -2, 0 );
ac = new AddonComponent( 2785 );
AddComponent( ac, 2, -1, 0 );
ac = new AddonComponent( 2780 );
AddComponent( ac, -2, -2, 0 );
ac = new AddonComponent( 2778 );
AddComponent( ac, -1, -1, 0 );
ac = new AddonComponent( 2778 );
AddComponent( ac, -1, 0, 0 );
ac = new AddonComponent( 2778 );
AddComponent( ac, -1, 1, 0 );
ac = new AddonComponent( 2778 );
AddComponent( ac, 0, 1, 0 );
ac = new AddonComponent( 2778 );
AddComponent( ac, 0, 0, 0 );
ac = new AddonComponent( 2778 );
AddComponent( ac, 0, -1, 0 );
ac = new AddonComponent( 2778 );
AddComponent( ac, 1, -1, 0 );
ac = new AddonComponent( 2778 );
AddComponent( ac, 1, 0, 0 );
ac = new AddonComponent( 2778 );
AddComponent( ac, 1, 1, 0 );
}
public goldcarpetAddon2( 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 goldcarpetAddonDeed2 : BaseAddonDeed
{
public override BaseAddon Addon
{
get
{
return new goldcarpetAddon2();
}
}
[Constructable]
public goldcarpetAddonDeed2()
{
Name = "goldcarpet";
}
public goldcarpetAddonDeed2( 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();
}
}
}

View File

@@ -0,0 +1,87 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Misc;
using Server.Gumps;
using Server.Items;
using Server.Mobiles;
using Server.Accounting;
namespace Server.Items
{
[FlipableAttribute(0x116D, 0x116E)]
public class WebsiteStone : Item
{
private string _Link = "(~*Set the Website*~)";
private string _Label = "Launches your browser to ";
[CommandProperty(AccessLevel.GameMaster)]
public string Link
{
get { return _Link; }
set { _Link = value; InvalidateProperties(); }
}
[CommandProperty(AccessLevel.GameMaster)]
public string Label {
get { return _Label; } set{ _Label = value; InvalidateProperties(); }
}
[Constructable]
public WebsiteStone() : base(0x116E)
{
Name = "Website Stone";
Hue = 0;
Movable = false;
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
list.Add(_Label + _Link);
}
public override void OnDoubleClick(Mobile from)
{
base.OnDoubleClick(from);
from.LaunchBrowser(_Link);
}
public WebsiteStone(Serial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
int version = 0;
writer.Write(version);
switch (version)
{
case 0:
{
writer.Write(_Link);
writer.Write(_Label);
} break;
}
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 0:
{
_Link = reader.ReadString();
_Label = reader.ReadString();
} break;
}
}
}
}

View File

@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using Server;
using Server.Multis;
using Server.Network;
using Server.Mobiles;
using Server.ContextMenus;
namespace Server.Items
{
public class BoneBox : BaseContainer
{
public override int DefaultGumpID{ get{ return 0x9; } }
public override int DefaultDropSound{ get{ return 0x42; } }
[Constructable]
public BoneBox() : base( 0xED2 )
{
Weight = 10.0;
}
public BoneBox( 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();
}
}
}

View File

@@ -0,0 +1,139 @@
using System;
namespace Server.Items
{
public class Waystone : Item
{
public static int Animation = Config.Get("Waystone.Animation", 11);
public static int FrameCount = Config.Get("Waystone.FrameCount", 5);
public static int RepeatCount = Config.Get("Waystone.RepeatCount", 1);
public static int Delay = Config.Get("Waystone.Delay", 0);
private bool m_Marked;
private Point3D m_Target;
private Map m_TargetMap;
[Constructable]
public Waystone() : base(0x41BE)
{
Name = "a Waystone";
Movable = true;
m_Marked = false;
m_TargetMap = null;
}
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001);
}
else if (m_Marked == false)
{
from.Animate(Animation, FrameCount, RepeatCount, true, false, Delay);
//from.Animate(16, 5, 1, true, false, 0);
from.PlaySound(0x1EB);
m_Target = from.Location;
m_TargetMap = from.Map;
m_Marked = true;
from.SendMessage("You Mark the stones location.");
}
else
{
from.Animate(17, 5, 1, true, false, 0);
from.PlaySound(0x0F6);
from.Location = m_Target;
from.Map = m_TargetMap;
from.SendMessage("You are sent to the Waystones saved location.");
}
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
//list.Add("Marked");
if (m_Marked == false)
{
list.Add("Not Marked");
}
else
{
list.Add("Marked");
}
}
public Waystone(Serial serial) : base(serial)
{
}
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
public bool Marked
{
get
{
return m_Marked;
}
set
{
if (m_Marked != value)
{
m_Marked = value;
InvalidateProperties();
}
}
}
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
public Point3D Target
{
get
{
return m_Target;
}
set
{
m_Target = value;
}
}
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
public Map TargetMap
{
get
{
return m_TargetMap;
}
set
{
if (m_TargetMap != value)
{
m_TargetMap = value;
InvalidateProperties();
}
}
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write((bool)m_Marked);
writer.Write((Point3D)m_Target);
writer.Write((Map)m_TargetMap);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
m_Marked = reader.ReadBool();
m_Target = reader.ReadPoint3D();
m_TargetMap = reader.ReadMap();
}
}
}