Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
484
Scripts/Services/Expansions/High Seas/Generate.cs
Normal file
484
Scripts/Services/Expansions/High Seas/Generate.cs
Normal file
@@ -0,0 +1,484 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Commands;
|
||||
using Server.Mobiles;
|
||||
using Server.Engines.Quests;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public static class GenerateHighSeas
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
if (Core.HS)
|
||||
{
|
||||
CommandSystem.Register("DecorateHS", AccessLevel.Administrator, GenerateDeco);
|
||||
CommandSystem.Register("DeleteHS", AccessLevel.Administrator, DeleteHS);
|
||||
|
||||
CommandSystem.Register("CharydbisSpawner", AccessLevel.Administrator, Spawner);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Spawner(CommandEventArgs e)
|
||||
{
|
||||
if (CharydbisSpawner.SpawnInstance == null)
|
||||
e.Mobile.SendMessage("Charydbis spawner does not exist.");
|
||||
else
|
||||
e.Mobile.SendGump(new Server.Gumps.PropertiesGump(e.Mobile, CharydbisSpawner.SpawnInstance));
|
||||
}
|
||||
|
||||
public static void DeleteHS(CommandEventArgs e)
|
||||
{
|
||||
WeakEntityCollection.Delete("highseas");
|
||||
|
||||
if (CharydbisSpawner.SpawnInstance != null)
|
||||
CharydbisSpawner.SpawnInstance.Active = false;
|
||||
|
||||
if (BountyQuestSpawner.Instance != null)
|
||||
BountyQuestSpawner.Instance.Active = false;
|
||||
}
|
||||
|
||||
public static void GenerateDeco(CommandEventArgs e)
|
||||
{
|
||||
string name = "highseas";
|
||||
|
||||
CharydbisSpawner.GenerateCharydbisSpawner();
|
||||
BountyQuestSpawner.GenerateShipSpawner();
|
||||
|
||||
CorgulAltar altar;
|
||||
|
||||
altar = new CorgulAltar();
|
||||
altar.MoveToWorld(new Point3D(2453, 865, 0), Map.Felucca);
|
||||
WeakEntityCollection.Add(name, altar);
|
||||
|
||||
altar = new CorgulAltar();
|
||||
altar.MoveToWorld(new Point3D(2453, 865, 0), Map.Trammel);
|
||||
WeakEntityCollection.Add(name, altar);
|
||||
|
||||
ProfessionalBountyBoard board;
|
||||
|
||||
board = new ProfessionalBountyBoard();
|
||||
board.MoveToWorld(new Point3D(4544, 2298, -1), Map.Trammel);
|
||||
WeakEntityCollection.Add(name, board);
|
||||
|
||||
board = new ProfessionalBountyBoard();
|
||||
board.MoveToWorld(new Point3D(4544, 2298, -1), Map.Felucca);
|
||||
WeakEntityCollection.Add(name, board);
|
||||
|
||||
LocalizedSign sign;
|
||||
|
||||
sign = new LocalizedSign(3025, 1152653); //The port of Zento Parking Area
|
||||
sign.MoveToWorld(new Point3D(713, 1359, 53), Map.Tokuno);
|
||||
WeakEntityCollection.Add(name, sign);
|
||||
|
||||
sign = new LocalizedSign(3023, 1149821); //Winds Tavern
|
||||
sign.MoveToWorld(new Point3D(4548, 2300, -6), Map.Trammel);
|
||||
WeakEntityCollection.Add(name, sign);
|
||||
|
||||
sign = new LocalizedSign(3023, 1149821); //Winds Tavern
|
||||
sign.MoveToWorld(new Point3D(4548, 2300, -6), Map.Felucca);
|
||||
WeakEntityCollection.Add(name, sign);
|
||||
|
||||
sign = new LocalizedSign(3023, 1149820); //General Store
|
||||
sign.MoveToWorld(new Point3D(4543, 2317, -3), Map.Trammel);
|
||||
WeakEntityCollection.Add(name, sign);
|
||||
|
||||
sign = new LocalizedSign(3023, 1149820); //General Store
|
||||
sign.MoveToWorld(new Point3D(4543, 2317, -3), Map.Felucca);
|
||||
WeakEntityCollection.Add(name, sign);
|
||||
|
||||
XmlSpawner sp;
|
||||
string toSpawn = "FishMonger";
|
||||
|
||||
//Britain
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(1482, 1754, -2), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(1482, 1754, -2), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
//Moonglow
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(4406, 1049, -2), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(4406, 1049, -2), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
//Trinsic
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(2061, 2855, -2), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(2061, 2855, -2), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
//Vesper
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(3009, 826, -2), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(3009, 826, -2), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
//Jhelom
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(1373, 3885, -2), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(1373, 3885, -2), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
//Skara Brae
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(641, 2234, -2), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.MoveToWorld(new Point3D(641, 2234, -2), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
//Papua
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(5827, 3258, -2), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(5827, 3258, -2), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
//Floating Eproriam
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 0;
|
||||
sp.HomeRange = 0;
|
||||
sp.MoveToWorld(new Point3D(4552, 2299, -1), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 0;
|
||||
sp.HomeRange = 0;
|
||||
sp.MoveToWorld(new Point3D(4540, 2321, -1), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
toSpawn = "DocksAlchemist";
|
||||
|
||||
//Britain
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(1482, 1754, -2), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(1482, 1754, -2), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
//Moonglow
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(4406, 1049, -2), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(4406, 1049, -2), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
//Trinsic
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(2061, 2855, -2), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(2061, 2855, -2), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
//Vesper
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(3009, 826, -2), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(3009, 826, -2), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
//Jhelom
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(1373, 3885, -2), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(1373, 3885, -2), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
//Skara Brae
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(641, 2234, -2), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.MoveToWorld(new Point3D(641, 2234, -2), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
//Papua
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(5827, 3258, -2), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(5827, 3258, -2), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
//Floating Eproriam
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(4552, 2299, -1), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(4540, 2321, -1), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
toSpawn = "GBBigglesby";
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(4544, 2302, -1), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(4544, 2302, -1), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
toSpawn = "GBBigglesby/Name/Mitsubishi/Title/the fleet officer";
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 10;
|
||||
sp.MoveToWorld(new Point3D(713, 1370, 6), Map.Tokuno);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
toSpawn = "BoatPainter";
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 15;
|
||||
sp.MoveToWorld(new Point3D(4552, 2337, -2), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 15;
|
||||
sp.MoveToWorld(new Point3D(4552, 2337, -2), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
toSpawn = "Banker";
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(4554, 2315, -2), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(4554, 2315, -2), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
toSpawn = "CrabFisher";
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 15;
|
||||
sp.MoveToWorld(new Point3D(4552, 2336, -2), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 15;
|
||||
sp.MoveToWorld(new Point3D(4552, 2336, -2), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 15;
|
||||
sp.MoveToWorld(new Point3D(4552, 2378, -2), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 15;
|
||||
sp.MoveToWorld(new Point3D(4552, 2378, -2), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
toSpawn = "DockMaster";
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 10;
|
||||
sp.MoveToWorld(new Point3D(4565, 2307, -2), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 10;
|
||||
sp.MoveToWorld(new Point3D(4565, 2307, -2), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
toSpawn = "SeaMarketTavernKeeper";
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(4544, 2302, -1), Map.Trammel);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
sp = new XmlSpawner(toSpawn);
|
||||
sp.SpawnRange = 1;
|
||||
sp.HomeRange = 5;
|
||||
sp.MoveToWorld(new Point3D(4544, 2302, -1), Map.Felucca);
|
||||
sp.Respawn();
|
||||
WeakEntityCollection.Add(name, sp);
|
||||
|
||||
SeaMarketBuoy bouy1 = new SeaMarketBuoy();
|
||||
SeaMarketBuoy bouy2 = new SeaMarketBuoy();
|
||||
SeaMarketBuoy bouy3 = new SeaMarketBuoy();
|
||||
SeaMarketBuoy bouy4 = new SeaMarketBuoy();
|
||||
SeaMarketBuoy bouy5 = new SeaMarketBuoy();
|
||||
SeaMarketBuoy bouy6 = new SeaMarketBuoy();
|
||||
SeaMarketBuoy bouy7 = new SeaMarketBuoy();
|
||||
SeaMarketBuoy bouy8 = new SeaMarketBuoy();
|
||||
|
||||
Rectangle2D bound = Server.Regions.SeaMarketRegion.Bounds[0];
|
||||
|
||||
bouy1.MoveToWorld(new Point3D(bound.X, bound.Y, -5), Map.Felucca);
|
||||
bouy2.MoveToWorld(new Point3D(bound.X, bound.Y, -5), Map.Trammel);
|
||||
WeakEntityCollection.Add(name, bouy1);
|
||||
WeakEntityCollection.Add(name, bouy2);
|
||||
|
||||
bouy3.MoveToWorld(new Point3D(bound.X + bound.Width, bound.Y, -5), Map.Felucca);
|
||||
bouy4.MoveToWorld(new Point3D(bound.X + bound.Width, bound.Y, -5), Map.Trammel);
|
||||
WeakEntityCollection.Add(name, bouy3);
|
||||
WeakEntityCollection.Add(name, bouy4);
|
||||
|
||||
bouy5.MoveToWorld(new Point3D(bound.X + bound.Width, bound.Y + bound.Height, -5), Map.Felucca);
|
||||
bouy6.MoveToWorld(new Point3D(bound.X + bound.Width, bound.Y + bound.Height, -5), Map.Trammel);
|
||||
WeakEntityCollection.Add(name, bouy5);
|
||||
WeakEntityCollection.Add(name, bouy6);
|
||||
|
||||
bouy7.MoveToWorld(new Point3D(bound.X, bound.Y + bound.Height, -5), Map.Felucca);
|
||||
bouy8.MoveToWorld(new Point3D(bound.X, bound.Y + bound.Height, -5), Map.Trammel);
|
||||
WeakEntityCollection.Add(name, bouy7);
|
||||
WeakEntityCollection.Add(name, bouy8);
|
||||
|
||||
Console.WriteLine("High Seas Content generated.");
|
||||
}
|
||||
}
|
||||
}
|
||||
68
Scripts/Services/Expansions/High Seas/Gumps/BaseShipGump.cs
Normal file
68
Scripts/Services/Expansions/High Seas/Gumps/BaseShipGump.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class BaseShipGump : Gump
|
||||
{
|
||||
public static readonly int NAHue = 0x5EF7;
|
||||
public static readonly int PassengerHue = 0x1CFF;
|
||||
public static readonly int CrewHue = 0x1FE7;
|
||||
public static readonly int OfficerHue = 0x7FE7;
|
||||
public static readonly int DenyHue = 0x7CE7;
|
||||
public static readonly int CaptainHue = 0x7DE7;
|
||||
public static readonly int LabelColor = 0x7FFF;
|
||||
public static readonly int NoHue = 0x3DEF;
|
||||
|
||||
public BaseShipGump(BaseGalleon galleon)
|
||||
: base(100, 100)
|
||||
{
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, 320, 385, 0xA3C);
|
||||
AddHtmlLocalized(10, 10, 300, 18, 1149724, 0x7FEF, false, false); //<CENTER>Passenger and Crew Manifest</CENTER>
|
||||
|
||||
string shipName = "unnamed ship";
|
||||
|
||||
if (galleon.ShipName != null && galleon.ShipName != string.Empty && galleon.ShipName != "")
|
||||
shipName = galleon.ShipName;
|
||||
|
||||
AddHtmlLocalized(10, 38, 75, 18, 1149761, LabelColor, false, false); //Ship:
|
||||
AddLabel(80, 38, 0x53, shipName);
|
||||
|
||||
AddHtmlLocalized(10, 56, 75, 18, 1149762, LabelColor, false, false); //Owner:
|
||||
AddLabel(80, 56, 0x53, galleon.Owner != null ? galleon.Owner.Name : "Unknown");
|
||||
}
|
||||
|
||||
public int GetHue(SecurityLevel level)
|
||||
{
|
||||
switch (level)
|
||||
{
|
||||
case SecurityLevel.Captain: return CaptainHue;
|
||||
case SecurityLevel.Officer: return OfficerHue;
|
||||
case SecurityLevel.Crewman: return CrewHue;
|
||||
case SecurityLevel.Passenger: return PassengerHue;
|
||||
case SecurityLevel.NA: return NAHue;
|
||||
case SecurityLevel.Denied: return DenyHue;
|
||||
default: return LabelColor;
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetLevel(SecurityLevel level)
|
||||
{
|
||||
switch (level)
|
||||
{
|
||||
default:
|
||||
case SecurityLevel.Denied: return 1149726;
|
||||
case SecurityLevel.Passenger: return 1149727;
|
||||
case SecurityLevel.Crewman: return 1149728;
|
||||
case SecurityLevel.Officer: return 1149729;
|
||||
case SecurityLevel.Captain: return 1149730;
|
||||
case SecurityLevel.NA: return 1149725;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
140
Scripts/Services/Expansions/High Seas/Gumps/BountyBoard.cs
Normal file
140
Scripts/Services/Expansions/High Seas/Gumps/BountyBoard.cs
Normal file
@@ -0,0 +1,140 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
using Server.Engines.Quests;
|
||||
using Server.Engines.VendorSearching;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ProfessionalBountyBoard : Item
|
||||
{
|
||||
[Constructable]
|
||||
public ProfessionalBountyBoard() : base(7774)
|
||||
{
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.HasGump(typeof(BountyBoardGump)))
|
||||
BaseGump.SendGump(new BountyBoardGump(from));
|
||||
}
|
||||
|
||||
public ProfessionalBountyBoard(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BountyBoardGump : BaseGump
|
||||
{
|
||||
public int Index { get; set; }
|
||||
|
||||
private int darkHue = 19686;
|
||||
private int lightHue = 19884;
|
||||
|
||||
public BountyBoardGump(Mobile from, int index = 0)
|
||||
: base(from as PlayerMobile, 20, 20)
|
||||
{
|
||||
Index = index;
|
||||
}
|
||||
|
||||
public override void AddGumpLayout()
|
||||
{
|
||||
AddAlphaRegion(50, 50, 50, 50);
|
||||
AddImage(0, 0, 5400);
|
||||
|
||||
AddHtmlLocalized(150, 37, 190, 16, CenterLoc, "#1116689", darkHue, false, false); // WANTED FOR PIRACY
|
||||
AddHtmlLocalized(150, 320, 190, 16, CenterLoc, "#1116703", darkHue, false, false); // WANTED DEAD OR ALIVE
|
||||
|
||||
AddHtmlLocalized(180, 135, 200, 16, 1116704, lightHue, false, false); //Notice to all sailors
|
||||
AddHtmlLocalized(130, 150, 300, 16, 1116705, lightHue, false, false); //There be a bounty on these lowlifes!
|
||||
AddHtmlLocalized(150, 170, 300, 16, 1116706, lightHue, false, false); //See officers fer information.
|
||||
AddHtmlLocalized(195, 190, 300, 16, 1116707, lightHue, false, false); //********
|
||||
|
||||
if (Index < 0)
|
||||
Index = 0;
|
||||
if (Index >= BountyQuestSpawner.Bounties.Count)
|
||||
Index = BountyQuestSpawner.Bounties.Count - 1;
|
||||
|
||||
List<Mobile> mobs = new List<Mobile>(BountyQuestSpawner.Bounties.Keys);
|
||||
|
||||
if (mobs.Count == 0)
|
||||
return;
|
||||
|
||||
int y = 210;
|
||||
int idx = 0;
|
||||
|
||||
for (int i = Index; i < mobs.Count; i++)
|
||||
{
|
||||
if (idx++ > 4)
|
||||
break;
|
||||
|
||||
Mobile mob = mobs[i];
|
||||
int toReward = 1000;
|
||||
|
||||
BountyQuestSpawner.Bounties.TryGetValue(mob, out toReward);
|
||||
PirateCaptain capt = mob as PirateCaptain;
|
||||
|
||||
if (capt == null)
|
||||
continue;
|
||||
|
||||
string args;
|
||||
|
||||
if (User.NetState != null && User.NetState.IsEnhancedClient && VendorSearch.StringList != null)
|
||||
{
|
||||
var strList = VendorSearch.StringList;
|
||||
|
||||
args = String.Format("{0} {1} {2}", strList.GetString(capt.Adjective), strList.GetString(capt.Noun), capt.PirateName > 0 ? strList.GetString(capt.PirateName) : capt.Name);
|
||||
|
||||
AddHtml(110, y, 400, 16, Color(C16232(lightHue), args), false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (capt.PirateName > 0)
|
||||
args = String.Format("#{0}\t#{1}\t#{2}", capt.Adjective, capt.Noun, capt.PirateName);
|
||||
else
|
||||
args = String.Format("#{0}\t#{1}\t{2}", capt.Adjective, capt.Noun, capt.Name);
|
||||
|
||||
AddHtmlLocalized(110, y, 400, 16, 1116690 + (idx - 1), args, lightHue, false, false); // ~1_val~ ~2_val~ ~3_val~
|
||||
}
|
||||
|
||||
AddHtmlLocalized(280, y, 125, 16, 1116696 + (idx - 1), toReward.ToString(), lightHue, false, false); // Reward: ~1_val~
|
||||
|
||||
y += 16;
|
||||
}
|
||||
|
||||
AddButton(362, 115, 2084, 2084, 1 + Index, GumpButtonType.Reply, 0);
|
||||
AddButton(362, 342, 2085, 2085, 500 + Index, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
public override void OnResponse(RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID == 0)
|
||||
return;
|
||||
|
||||
if (info.ButtonID < 500)
|
||||
{
|
||||
Index--;
|
||||
Refresh();
|
||||
}
|
||||
else
|
||||
{
|
||||
Index++;
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
142
Scripts/Services/Expansions/High Seas/Gumps/CannonGump.cs
Normal file
142
Scripts/Services/Expansions/High Seas/Gumps/CannonGump.cs
Normal file
@@ -0,0 +1,142 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class CannonGump : Gump
|
||||
{
|
||||
public static readonly int LabelColor = 0xFFFFFF;
|
||||
public static readonly int GreenHue = 5057;
|
||||
public static readonly int RedHue = 28776;
|
||||
|
||||
private BaseCannon m_Cannon;
|
||||
private Mobile m_From;
|
||||
|
||||
public BaseCannon Cannon { get { return m_Cannon; } }
|
||||
|
||||
public CannonGump(BaseCannon cannon, Mobile from)
|
||||
: base(50, 50)
|
||||
{
|
||||
m_Cannon = cannon;
|
||||
m_From = from;
|
||||
|
||||
AddBackground(0, 0, 300, 200, 2620);
|
||||
|
||||
Type charge = cannon is LightShipCannon ? typeof(LightPowderCharge) : typeof(HeavyPowderCharge);
|
||||
|
||||
bool cleaned = cannon.Cleaned;
|
||||
bool charged = cannon.Charged;
|
||||
bool primed = cannon.Primed;
|
||||
bool loaded = cannon.AmmoType != AmmunitionType.Empty;
|
||||
|
||||
AddHtmlLocalized(0, 10, 300, 16, 1149614 + (int)m_Cannon.Position, 21758, false, false);
|
||||
|
||||
AddHtmlLocalized(45, 40, 100, 16, 1149626, LabelColor, false, false); //CLEAN
|
||||
|
||||
if(!charged)
|
||||
AddHtmlLocalized(45, 60, 100, 16, 1149630, LabelColor, false, false); //CHARGE
|
||||
else
|
||||
AddHtmlLocalized(45, 60, 100, 16, 1149629, LabelColor, false, false); //REMOVE
|
||||
|
||||
if(!loaded)
|
||||
AddHtmlLocalized(45, 80, 100, 16, 1149635, LabelColor, false, false); //LOAD
|
||||
else
|
||||
AddHtmlLocalized(45, 80, 100, 16, 1149629, LabelColor, false, false); //REMOVE
|
||||
|
||||
if(!primed)
|
||||
AddHtmlLocalized(45, 100, 100, 16, 1149637, LabelColor, false, false); //PRIME
|
||||
else if (cannon.CanLight)
|
||||
AddHtmlLocalized(45, 100, 100, 16, 1149638, LabelColor, false, false); //FIRE
|
||||
else
|
||||
AddHtmlLocalized(45, 100, 100, 16, 1149629, LabelColor, false, false); //REMOVE
|
||||
|
||||
if (!cleaned)
|
||||
AddHtmlLocalized(150, 40, 100, 16, 1149628, RedHue, false, false); //Dirty
|
||||
else
|
||||
AddHtmlLocalized(150, 40, 100, 16, 1149627, GreenHue, false, false); //Clean
|
||||
|
||||
if (!charged)
|
||||
AddHtmlLocalized(150, 60, 100, 16, 1149632, RedHue, false, false); //Not Charged
|
||||
else
|
||||
AddHtmlLocalized(150, 60, 100, 16, 1149631, GreenHue, false, false); //Charged
|
||||
|
||||
if (!loaded)
|
||||
AddHtmlLocalized(150, 80, 100, 16, 1149636, RedHue, false, false); //Not Loaded
|
||||
else
|
||||
AddHtmlLocalized(150, 80, 100, 16, 1114057, AmmoInfo.GetAmmoName(cannon).ToString(), GreenHue, false, false);
|
||||
//AddHtmlLocalized(150, 80, 100, 16, cannon.AmmoType == AmmoType.Grapeshot ? 1095741 : 1116029, GreenHue, false, false);
|
||||
|
||||
if (!primed)
|
||||
AddHtmlLocalized(150, 100, 100, 16, 1149639, RedHue, false, false); //No Fuse
|
||||
else
|
||||
AddHtmlLocalized(150, 100, 100, 16, 1149640, GreenHue, false, false); //Primed
|
||||
|
||||
AddButton(10, 40, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
|
||||
AddButton(10, 60, 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0);
|
||||
AddButton(10, 80, 0xFA5, 0xFA7, 3, GumpButtonType.Reply, 0);
|
||||
AddButton(10, 100, 0xFA5, 0xFA7, 4, GumpButtonType.Reply, 0);
|
||||
|
||||
if (!cannon.Actions.ContainsKey(from) || cannon.Actions[from].Count == 0)
|
||||
cannon.AddAction(from, 1149653); //You are now operating the cannon.
|
||||
|
||||
int y = 170;
|
||||
int count = cannon.Actions[from].Count - 1;
|
||||
int hue = 0;
|
||||
|
||||
for (int i = count; i >= 0; i--)
|
||||
{
|
||||
if (i < count - 3)
|
||||
break;
|
||||
|
||||
if (i == count)
|
||||
hue = 29315; //0xFFFF00;
|
||||
else hue = 12684;
|
||||
|
||||
AddHtmlLocalized(10, y, 385, 20, cannon.Actions[from][i], hue, false, false);
|
||||
y -= 16;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
if (m_Cannon == null || m_Cannon.Deleted || !from.InRange(m_Cannon.Location, 3))
|
||||
return;
|
||||
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
default:
|
||||
case 0: return;
|
||||
case 1: //clean
|
||||
m_Cannon.TryClean(from);
|
||||
break;
|
||||
case 2: //Charge
|
||||
if (!m_Cannon.Charged)
|
||||
m_Cannon.TryCharge(from);
|
||||
else
|
||||
m_Cannon.RemoveCharge(from);
|
||||
break;
|
||||
case 3: //load
|
||||
if (m_Cannon.AmmoType == AmmunitionType.Empty)
|
||||
m_Cannon.TryLoad(from);
|
||||
else
|
||||
m_Cannon.RemoveLoad(from);
|
||||
break;
|
||||
case 4: //prime
|
||||
if (!m_Cannon.Primed)
|
||||
m_Cannon.TryPrime(from);
|
||||
else if (m_Cannon.CanLight)
|
||||
m_Cannon.TryLightFuse(from);
|
||||
else
|
||||
m_Cannon.RemovePrime(from);
|
||||
break;
|
||||
}
|
||||
|
||||
from.SendGump(new CannonGump(m_Cannon, m_From));
|
||||
}
|
||||
}
|
||||
}
|
||||
185
Scripts/Services/Expansions/High Seas/Gumps/GrantAccessGump.cs
Normal file
185
Scripts/Services/Expansions/High Seas/Gumps/GrantAccessGump.cs
Normal file
@@ -0,0 +1,185 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GrantAccessGump : BaseShipGump
|
||||
{
|
||||
private Mobile m_Player;
|
||||
private BaseGalleon m_Galleon;
|
||||
private SecurityEntry m_Entry;
|
||||
|
||||
public GrantAccessGump(Mobile player, BaseGalleon galleon)
|
||||
: base(galleon)
|
||||
{
|
||||
player.CloseGump(typeof(GrantAccessGump));
|
||||
|
||||
m_Player = player;
|
||||
m_Galleon = galleon;
|
||||
m_Entry = galleon.SecurityEntry;
|
||||
|
||||
if (m_Entry == null)
|
||||
{
|
||||
m_Entry = new SecurityEntry(m_Galleon);
|
||||
m_Galleon.SecurityEntry = m_Entry;
|
||||
}
|
||||
|
||||
bool isAccessed = m_Entry.Manifest.ContainsKey(player);
|
||||
bool inGuild = m_Entry.IsInGuild(player);
|
||||
bool inParty = m_Entry.IsInParty(player);
|
||||
bool isPublic = m_Entry.IsPublic;
|
||||
SecurityLevel level = m_Entry.GetEffectiveLevel(player);
|
||||
|
||||
//Player Info
|
||||
AddHtmlLocalized(10, 79, 125, 18, 1149763, LabelColor, false, false); // Player:
|
||||
AddLabel(140, 79, 0x30, player.Name);
|
||||
|
||||
AddHtmlLocalized(10, 97, 125, 18, 1149768, LabelColor, false, false); // Effective Level:
|
||||
AddHtmlLocalized(140, 97, 160, 18, GetLevel(level), GetHue(level), false, false);
|
||||
|
||||
//Default Info
|
||||
int cliloc = isPublic ? 1149756 : 1149757;
|
||||
int hue = isPublic ? CrewHue : NoHue;
|
||||
|
||||
AddHtmlLocalized(10, 120, 125, 18, 1149731, LabelColor, false, false); // Public Access:
|
||||
AddHtmlLocalized(140, 120, 50, 18, cliloc, hue, false, false); // Yes/No
|
||||
|
||||
if (isPublic)
|
||||
AddHtmlLocalized(200, 120, 100, 18, GetLevel(m_Entry.DefaultPublicAccess), GetHue(m_Entry.DefaultPublicAccess), false, false);
|
||||
|
||||
cliloc = inParty ? 1149756 : 1149757;
|
||||
hue = inParty ? CrewHue : NoHue;
|
||||
|
||||
AddHtmlLocalized(10, 138, 125, 18, 1149769, LabelColor, false, false); // Is Party Member:
|
||||
AddHtmlLocalized(140, 138, 50, 18, cliloc, hue, false, false);
|
||||
|
||||
if (inParty)
|
||||
AddHtmlLocalized(200, 138, 50, 18, GetLevel(m_Entry.DefaultPartyAccess), GetHue(m_Entry.DefaultPartyAccess), false, false);
|
||||
|
||||
cliloc = inGuild ? 1149756 : 1149757;
|
||||
hue = inGuild ? CrewHue : NoHue;
|
||||
|
||||
AddHtmlLocalized(10, 156, 125, 18, 1149770, LabelColor, false, false); // Is Guild Member
|
||||
AddHtmlLocalized(140, 156, 50, 18, cliloc, hue, false, false);
|
||||
|
||||
if (inGuild)
|
||||
AddHtmlLocalized(200, 156, 50, 18, GetLevel(m_Entry.DefaultGuildAccess), GetHue(m_Entry.DefaultGuildAccess), false, false);
|
||||
|
||||
AddHtmlLocalized(10, 179, 300, 18, 1149747, LabelColor, false, false); // Access List Status:
|
||||
|
||||
if (level == SecurityLevel.NA)
|
||||
{
|
||||
AddImage(65, 197, 0xFA6);
|
||||
AddHtmlLocalized(100, 199, 200, 18, 1149775, NoHue, false, false); // NOT IN ACCESS LIST
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(65, 197, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(100, 199, 200, 18, 1149776, NoHue, false, false); // REMOVE FROM LIST
|
||||
}
|
||||
|
||||
if (level == SecurityLevel.Denied)
|
||||
{
|
||||
AddImage(65, 215, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(65, 215, 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(100, 217, 100, 18, 1149726, level == SecurityLevel.Denied ? GetHue(level) : LabelColor, false, false); // DENY ACCESS
|
||||
|
||||
if (level == SecurityLevel.Passenger)
|
||||
{
|
||||
AddImage(65, 233, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(65, 233, 0xFA5, 0xFA7, 3, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(100, 235, 100, 18, 1149727, level == SecurityLevel.Passenger ? GetHue(level) : LabelColor, false, false); // PASSENGER
|
||||
|
||||
if (level == SecurityLevel.Crewman)
|
||||
{
|
||||
AddImage(65, 251, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(65, 251, 0xFA5, 0xFA7, 4, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(100, 253, 100, 18, 1149728, level == SecurityLevel.Crewman ? GetHue(level) : LabelColor, false, false); // CREW
|
||||
|
||||
if (level == SecurityLevel.Officer)
|
||||
{
|
||||
AddImage(65, 269, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(65, 269, 0xFA5, 0xFA7, 5, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(100, 271, 100, 18, 1149729, level == SecurityLevel.Officer ? GetHue(level) : LabelColor, false, false); // OFFICER
|
||||
|
||||
if (level == SecurityLevel.Captain)
|
||||
{
|
||||
AddImage(65, 287, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(65, 287, 0xFA5, 0xFA7, 6, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(100, 289, 100, 18, 1149730, level == SecurityLevel.Captain ? GetHue(level) : LabelColor, false, false); // CAPTAIN
|
||||
|
||||
AddButton(10, 355, 0xFA5, 0xFA7, 7, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(45, 357, 100, 18, 1149777, LabelColor, false, false); // MAIN MENU
|
||||
|
||||
AddButton(160, 355, 0xFA5, 0xFA, 8, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(195, 357, 100, 18, 1149734, LabelColor, false, false); // ACCESS LIST
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
if (from == null)
|
||||
return;
|
||||
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case 0: return;
|
||||
case 1: // REMOVE FROM LIST
|
||||
m_Entry.RemoveFromAccessList(m_Player);
|
||||
from.SendGump(new AccessListGump(m_Player, m_Galleon));
|
||||
return;
|
||||
case 2: // DENY ACCESS
|
||||
m_Entry.AddToManifest(m_Player, SecurityLevel.Denied);
|
||||
break;
|
||||
case 3: // PASSENGER
|
||||
m_Entry.AddToManifest(m_Player, SecurityLevel.Passenger);
|
||||
break;
|
||||
case 4: // CREW
|
||||
m_Entry.AddToManifest(m_Player, SecurityLevel.Crewman);
|
||||
break;
|
||||
case 5: // OFFICER
|
||||
m_Entry.AddToManifest(m_Player, SecurityLevel.Officer);
|
||||
break;
|
||||
case 6: // CAPTAIN
|
||||
m_Entry.AddToManifest(m_Player, SecurityLevel.Captain);
|
||||
break;
|
||||
case 7: // MAIN MENU
|
||||
from.SendGump(new ShipSecurityGump(from, m_Galleon));
|
||||
return;
|
||||
case 8: // ACCESS LIST
|
||||
from.SendGump(new AccessListGump(m_Player, m_Galleon));
|
||||
return;
|
||||
}
|
||||
|
||||
from.SendGump(new GrantAccessGump(m_Player, m_Galleon));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Multis;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class AccessListGump : BaseShipGump
|
||||
{
|
||||
private BaseGalleon m_Galleon;
|
||||
private SecurityEntry m_Entry;
|
||||
private List<Mobile> m_UseList;
|
||||
|
||||
public AccessListGump(Mobile from, BaseGalleon galleon)
|
||||
: base(galleon)
|
||||
{
|
||||
from.CloseGump(typeof(AccessListGump));
|
||||
|
||||
m_Galleon = galleon;
|
||||
m_Entry = galleon.SecurityEntry;
|
||||
|
||||
if (m_Entry == null)
|
||||
{
|
||||
m_Entry = new SecurityEntry(m_Galleon);
|
||||
m_Galleon.SecurityEntry = m_Entry;
|
||||
}
|
||||
|
||||
AddButton(10, 355, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(45, 357, 100, 18, 1149777, LabelColor, false, false); // MAIN MENU
|
||||
|
||||
m_UseList = new List<Mobile>(m_Entry.Manifest.Keys);
|
||||
|
||||
int page = 1;
|
||||
int y = 79;
|
||||
|
||||
AddPage(page);
|
||||
|
||||
for (int i = 0; i < m_UseList.Count; i++)
|
||||
{
|
||||
if (page > 1)
|
||||
AddButton(270, 390, 4014, 4016, 0, GumpButtonType.Page, page - 1);
|
||||
|
||||
Mobile mob = m_UseList[i];
|
||||
|
||||
if (mob == null || m_Galleon.IsOwner(mob))
|
||||
continue;
|
||||
|
||||
string name = mob.Name;
|
||||
SecurityLevel level = m_Entry.GetEffectiveLevel(mob);
|
||||
|
||||
AddButton(10, y, 0xFA5, 0xFA7, i + 2, GumpButtonType.Reply, 0);
|
||||
AddLabel(45, y + 2, 0x3E7, name);
|
||||
AddHtmlLocalized(160, y + 2, 150, 18, GetLevel(level), GetHue(level), false, false);
|
||||
|
||||
y += 25;
|
||||
|
||||
bool pages = (i + 1) % 10 == 0;
|
||||
|
||||
if (pages && m_UseList.Count - 1 != i)
|
||||
{
|
||||
AddButton(310, 390, 4005, 4007, 0, GumpButtonType.Page, page + 1);
|
||||
page++;
|
||||
y = 0;
|
||||
|
||||
AddPage(page);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
if (info.ButtonID == 1)
|
||||
from.SendGump(new ShipSecurityGump(from, m_Galleon));
|
||||
else if (info.ButtonID > 1)
|
||||
{
|
||||
int index = info.ButtonID - 2;
|
||||
|
||||
if (index < 0 || index >= m_UseList.Count)
|
||||
return;
|
||||
|
||||
Mobile mob = m_UseList[index];
|
||||
|
||||
from.SendGump(new GrantAccessGump(mob, m_Galleon));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
120
Scripts/Services/Expansions/High Seas/Gumps/ShipPlacementGump.cs
Normal file
120
Scripts/Services/Expansions/High Seas/Gumps/ShipPlacementGump.cs
Normal file
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Multis;
|
||||
using Server.Regions;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class BoatPlacementGump : Gump
|
||||
{
|
||||
private Item m_Item;
|
||||
private Mobile m_From;
|
||||
|
||||
public BoatPlacementGump(Item item, Mobile from)
|
||||
: base(0, 0)
|
||||
{
|
||||
m_From = from;
|
||||
m_Item = item;
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, 220, 170, 0x13BE);
|
||||
AddBackground(10, 10, 200, 150, 0xBB8);
|
||||
|
||||
AddHtmlLocalized(20, 20, 180, 70, 1116329, true, false); // Select the ship direction for placement.
|
||||
|
||||
AddHtmlLocalized(55, 100, 50, 25, 1116330, false, false); // WEST
|
||||
AddButton(20, 100, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
|
||||
|
||||
AddHtmlLocalized(150, 100, 50, 25, 1116331, false, false); // NORTH
|
||||
AddButton(115, 100, 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0);
|
||||
|
||||
AddHtmlLocalized(55, 125, 50, 25, 1116332, false, false); // SOUTH
|
||||
AddButton(20, 125, 0xFA5, 0xFA7, 3, GumpButtonType.Reply, 0);
|
||||
|
||||
AddHtmlLocalized(150, 125, 50, 25, 1116333, false, false); // EAST
|
||||
AddButton(115, 125, 0xFA5, 0xFA7, 4, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
int id = 0;
|
||||
Point3D offset = Point3D.Zero;
|
||||
Direction direction;
|
||||
|
||||
if(info.ButtonID == 0)
|
||||
return;
|
||||
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
default:
|
||||
case 1: //North
|
||||
direction = Direction.West; break;
|
||||
case 2: //East
|
||||
direction = Direction.North; break;
|
||||
case 3: //South
|
||||
direction = Direction.South; break;
|
||||
case 4: //West
|
||||
direction = Direction.East; break;
|
||||
}
|
||||
|
||||
if (m_Item is BaseBoatDeed)
|
||||
{
|
||||
id = BaseBoat.GetID(((BaseBoatDeed)m_Item).MultiID, direction);
|
||||
offset = ((BaseBoatDeed)m_Item).Offset;
|
||||
}
|
||||
else if (m_Item is BaseDockedBoat)
|
||||
{
|
||||
id = BaseBoat.GetID(((BaseDockedBoat)m_Item).MultiID, direction);
|
||||
offset = ((BaseDockedBoat)m_Item).Offset;
|
||||
}
|
||||
|
||||
m_From.Target = new InternalTarget(id, offset, m_Item, direction);
|
||||
}
|
||||
|
||||
private class InternalTarget : MultiTarget
|
||||
{
|
||||
private Item m_Item;
|
||||
private Direction m_Facing;
|
||||
private int m_ItemID;
|
||||
|
||||
public InternalTarget(int itemID, Point3D offset, Item item, Direction facing)
|
||||
: base(itemID, offset)
|
||||
{
|
||||
m_Item = item;
|
||||
m_Facing = facing;
|
||||
m_ItemID = itemID;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
IPoint3D ip = o as IPoint3D;
|
||||
|
||||
if (ip != null)
|
||||
{
|
||||
if (ip is Item)
|
||||
ip = ((Item)ip).GetWorldTop();
|
||||
|
||||
Point3D p = new Point3D(ip);
|
||||
|
||||
Region region = Region.Find(p, from.Map);
|
||||
|
||||
if (region.IsPartOf<DungeonRegion>())
|
||||
from.SendLocalizedMessage(502488); // You can not place a ship inside a dungeon.
|
||||
else if (region.IsPartOf<HouseRegion>() || region.IsPartOf<Engines.CannedEvil.ChampionSpawnRegion>())
|
||||
from.SendLocalizedMessage(1042549); // A boat may not be placed in this area.
|
||||
else
|
||||
{
|
||||
if (m_Item is BaseBoatDeed)
|
||||
((BaseBoatDeed)m_Item).OnPlacement(from, p, m_ItemID, m_Facing);
|
||||
else if (m_Item is BaseDockedBoat)
|
||||
((BaseDockedBoat)m_Item).OnPlacement(from, p, m_ItemID, m_Facing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
304
Scripts/Services/Expansions/High Seas/Gumps/ShipSecurityGump.cs
Normal file
304
Scripts/Services/Expansions/High Seas/Gumps/ShipSecurityGump.cs
Normal file
@@ -0,0 +1,304 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class ShipSecurityGump : BaseShipGump
|
||||
{
|
||||
private Mobile m_From;
|
||||
private BaseGalleon m_Galleon;
|
||||
private SecurityEntry m_Entry;
|
||||
|
||||
public ShipSecurityGump(Mobile from, BaseGalleon galleon)
|
||||
: base(galleon)
|
||||
{
|
||||
from.CloseGump(typeof(ShipSecurityGump));
|
||||
|
||||
m_From = from;
|
||||
m_Galleon = galleon;
|
||||
m_Entry = galleon.SecurityEntry;
|
||||
|
||||
if (m_Entry == null)
|
||||
{
|
||||
m_Entry = new SecurityEntry(m_Galleon);
|
||||
m_Galleon.SecurityEntry = m_Entry;
|
||||
}
|
||||
|
||||
PartyAccess pa = m_Entry.PartyAccess;
|
||||
|
||||
AddHtmlLocalized(10, 79, 300, 18, 1149743, LabelColor, false, false); // Party membership modifies access to this ship:
|
||||
|
||||
if (pa == PartyAccess.Never)
|
||||
{
|
||||
AddImage(55, 97, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(55, 97, 0xFA5, 0xFA7, 1001, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(90, 99, 210, 18, 1149778, LabelColor, false, false); // Never
|
||||
|
||||
if (pa == PartyAccess.LeaderOnly)
|
||||
{
|
||||
AddImage(55, 115, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(55, 115, 0xFA5, 0xFA7, 1002, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(90, 117, 210, 18, 1149744, LabelColor, false, false); // When I am Party Leader
|
||||
|
||||
if (pa == PartyAccess.MemberOnly)
|
||||
{
|
||||
AddImage(55, 133, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(55, 133, 0xFA5, 0xFA7, 1003, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(90, 135, 210, 18, 1149745, LabelColor, false, false); // When I am a Party Member
|
||||
|
||||
AddHtmlLocalized(10, 158, 125, 18, 1149731, LabelColor, false, false); // Public Access:
|
||||
AddButton(140, 156, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 2);
|
||||
AddHtmlLocalized(175, 158, 125, 18, GetLevel(m_Entry.DefaultPublicAccess), GetHue(m_Entry.DefaultPublicAccess), false, false);
|
||||
|
||||
AddHtmlLocalized(10, 175, 150, 18, 1149732, LabelColor, false, false); // Party Access:
|
||||
AddButton(140, 173, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 3);
|
||||
AddHtmlLocalized(175, 175, 125, 18, GetLevel(m_Entry.DefaultPartyAccess), GetHue(m_Entry.DefaultPartyAccess), false, false);
|
||||
|
||||
AddHtmlLocalized(10, 193, 150, 18, 1149733, LabelColor, false, false); // Guild Access:
|
||||
AddButton(140, 191, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 4);
|
||||
AddHtmlLocalized(175, 193, 125, 18, GetLevel(m_Entry.DefaultGuildAccess), GetHue(m_Entry.DefaultGuildAccess), false, false);
|
||||
|
||||
AddHtmlLocalized(195, 357, 100, 18, 1149734, LabelColor, false, false); // ACCESS LIST
|
||||
AddButton(160, 355, 0xFA5, 0xFA7, 2000, GumpButtonType.Reply, 0);
|
||||
|
||||
AddPage(2);
|
||||
|
||||
AddBackground(30, 215, 190, 130, 0xA3C);
|
||||
AddHtmlLocalized(80, 220, 100, 18, 1149731, LabelColor, false, false); // Public Access:
|
||||
|
||||
if (m_Entry.DefaultPublicAccess == SecurityLevel.NA)
|
||||
{
|
||||
AddImage(40, 243, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(40, 243, 0xFA5, 0xFA7, 1100, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(75, 245, 140, 18, 1149725, m_Entry.DefaultPublicAccess == SecurityLevel.NA ? NAHue : LabelColor, false, false); // N/A
|
||||
|
||||
if (m_Entry.DefaultPublicAccess == SecurityLevel.Passenger)
|
||||
{
|
||||
AddImage(40, 261, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(40, 261, 0xFA5, 0xFA7, 1102, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(75, 263, 140, 18, 1149727, m_Entry.DefaultPublicAccess == SecurityLevel.Passenger ? PassengerHue : LabelColor, false, false); // PASSENGER
|
||||
|
||||
if (m_Entry.DefaultPublicAccess == SecurityLevel.Crewman)
|
||||
{
|
||||
AddImage(40, 279, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(40, 279, 0xFA5, 0xFA7, 1103, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(75, 281, 140, 18, 1149728, m_Entry.DefaultPublicAccess == SecurityLevel.Crewman ? CrewHue : LabelColor, false, false); // CREW
|
||||
|
||||
if (m_Entry.DefaultPublicAccess == SecurityLevel.Officer)
|
||||
{
|
||||
AddImage(40, 297, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(40, 297, 0xFA5, 0xFA7, 1104, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(75, 299, 140, 18, 1149729, m_Entry.DefaultPublicAccess == SecurityLevel.Officer ? OfficerHue : LabelColor, false, false); // OFFICER
|
||||
|
||||
if (m_Entry.DefaultPublicAccess == SecurityLevel.Denied)
|
||||
{
|
||||
AddImage(40, 315, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(40, 315, 0xFA5, 0xFA7, 1101, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(75, 317, 140, 18, 1149726, m_Entry.DefaultPublicAccess == SecurityLevel.Denied ? DenyHue : LabelColor, false, false); // DENY ACCESS
|
||||
|
||||
AddPage(3);
|
||||
|
||||
AddBackground(70, 215, 190, 130, 0xA3C);
|
||||
AddHtmlLocalized(120, 220, 100, 18, 1149732, LabelColor, false, false); // Party Access:
|
||||
|
||||
if (m_Entry.DefaultPartyAccess == SecurityLevel.NA)
|
||||
{
|
||||
AddImage(80, 243, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(80, 243, 0xFA5, 0xFA7, 1200, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(115, 245, 140, 18, 1149725, m_Entry.DefaultPartyAccess == SecurityLevel.NA ? NAHue : LabelColor, false, false); // N/A
|
||||
|
||||
if (m_Entry.DefaultPartyAccess == SecurityLevel.Passenger)
|
||||
{
|
||||
AddImage(80, 261, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(80, 261, 0xFA5, 0xFA7, 1202, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(115, 263, 140, 18, 1149727, m_Entry.DefaultPartyAccess == SecurityLevel.Passenger ? PassengerHue : LabelColor, false, false); // PASSENGER
|
||||
|
||||
if (m_Entry.DefaultPartyAccess == SecurityLevel.Crewman)
|
||||
{
|
||||
AddImage(80, 279, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(80, 279, 0xFA5, 0xFA7, 1203, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(115, 281, 140, 18, 1149728, m_Entry.DefaultPartyAccess == SecurityLevel.Crewman ? CrewHue : LabelColor, false, false); // CREW
|
||||
|
||||
if (m_Entry.DefaultPartyAccess == SecurityLevel.Officer)
|
||||
{
|
||||
AddImage(80, 297, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(80, 297, 0xFA5, 0xFA7, 1204, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(115, 299, 140, 18, 1149729, m_Entry.DefaultPartyAccess == SecurityLevel.Officer ? OfficerHue : LabelColor, false, false); // OFFICER
|
||||
|
||||
if (m_Entry.DefaultPartyAccess == SecurityLevel.Denied)
|
||||
{
|
||||
AddImage(80, 315, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(80, 315, 0xFA5, 0xFA7, 1201, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(115, 317, 140, 18, 1149726, m_Entry.DefaultPartyAccess == SecurityLevel.Denied ? DenyHue : LabelColor, false, false); // DENY ACCESS
|
||||
|
||||
AddPage(4);
|
||||
|
||||
AddBackground(110, 215, 190, 130, 0xA3C);
|
||||
AddHtmlLocalized(160, 220, 100, 18, 1149733, LabelColor, false, false); // Guild Access:
|
||||
|
||||
if (m_Entry.DefaultGuildAccess == SecurityLevel.NA)
|
||||
{
|
||||
AddImage(120, 243, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(120, 243, 0xFA5, 0xFA7, 1300, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(155, 245, 140, 18, 1149725, m_Entry.DefaultGuildAccess == SecurityLevel.NA ? NAHue : LabelColor, false, false); // N/A
|
||||
|
||||
if (m_Entry.DefaultGuildAccess == SecurityLevel.Passenger)
|
||||
{
|
||||
AddImage(120, 261, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(120, 261, 0xFA5, 0xFA7, 1302, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(155, 263, 140, 18, 1149727, m_Entry.DefaultGuildAccess == SecurityLevel.Passenger ? PassengerHue : LabelColor, false, false); // PASSENGER
|
||||
|
||||
if (m_Entry.DefaultGuildAccess == SecurityLevel.Crewman)
|
||||
{
|
||||
AddImage(120, 279, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(120, 279, 0xFA5, 0xFA7, 1303, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(155, 281, 140, 18, 1149728, m_Entry.DefaultGuildAccess == SecurityLevel.Crewman ? CrewHue : LabelColor, false, false); // CREW
|
||||
|
||||
if (m_Entry.DefaultGuildAccess == SecurityLevel.Officer)
|
||||
{
|
||||
AddImage(120, 297, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(120, 297, 0xFA5, 0xFA7, 1304, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(155, 299, 140, 18, 1149729, m_Entry.DefaultGuildAccess == SecurityLevel.Officer ? OfficerHue : LabelColor, false, false); // OFFICER
|
||||
|
||||
if (m_Entry.DefaultGuildAccess == SecurityLevel.Denied)
|
||||
{
|
||||
AddImage(120, 315, 0xFA6);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(120, 315, 0xFA5, 0xFA7, 1301, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(155, 317, 140, 18, 1149726, m_Entry.DefaultGuildAccess == SecurityLevel.Denied ? DenyHue : LabelColor, false, false); // DENY ACCESS
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case 0: return;
|
||||
case 1001: //party access...Never
|
||||
m_Entry.PartyAccess = PartyAccess.Never;
|
||||
m_From.SendGump(new ShipSecurityGump(m_From, m_Galleon));
|
||||
break;
|
||||
case 1002: //party access...leaderonly
|
||||
m_Entry.PartyAccess = PartyAccess.LeaderOnly;
|
||||
m_From.SendGump(new ShipSecurityGump(m_From, m_Galleon));
|
||||
break;
|
||||
case 1003: //party access...member only
|
||||
m_Entry.PartyAccess = PartyAccess.MemberOnly;
|
||||
m_From.SendGump(new ShipSecurityGump(m_From, m_Galleon));
|
||||
break;
|
||||
case 2000: //Access List
|
||||
m_From.SendGump(new AccessListGump(m_From, m_Galleon));
|
||||
return;
|
||||
default:
|
||||
{
|
||||
if (info.ButtonID >= 1100 && info.ButtonID <= 1104)
|
||||
{
|
||||
m_Entry.DefaultPublicAccess = (SecurityLevel)(info.ButtonID - 1100);
|
||||
}
|
||||
else if (info.ButtonID >= 1200 && info.ButtonID <= 1204)
|
||||
{
|
||||
m_Entry.DefaultPartyAccess = (SecurityLevel)(info.ButtonID - 1200);
|
||||
}
|
||||
else if (info.ButtonID >= 1300 && info.ButtonID <= 1304)
|
||||
{
|
||||
m_Entry.DefaultGuildAccess = (SecurityLevel)(info.ButtonID - 1300);
|
||||
}
|
||||
|
||||
m_From.SendGump(new ShipSecurityGump(m_From, m_Galleon));
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CorgulsEnchantedSash : BodySash
|
||||
{
|
||||
public override int LabelNumber { get { return 1149781; } }
|
||||
|
||||
[Constructable]
|
||||
public CorgulsEnchantedSash()
|
||||
{
|
||||
Attributes.BonusStam = 1;
|
||||
Attributes.DefendChance = 5;
|
||||
}
|
||||
|
||||
public CorgulsEnchantedSash(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CorgulsHandbookOnMysticism : MysticBook
|
||||
{
|
||||
public override int LabelNumber { get { return 1149779; } }
|
||||
|
||||
[Constructable]
|
||||
public CorgulsHandbookOnMysticism ()
|
||||
{
|
||||
Hue = 1159;
|
||||
Attributes.RegenMana = 3;
|
||||
Attributes.DefendChance = 5;
|
||||
Attributes.LowerManaCost = 10;
|
||||
Attributes.LowerRegCost = 20;
|
||||
}
|
||||
|
||||
public CorgulsHandbookOnMysticism(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CorgulsHandbookOnTheUndead : NecromancerSpellbook
|
||||
{
|
||||
public override int LabelNumber { get { return 1149780; } }
|
||||
|
||||
[Constructable]
|
||||
public CorgulsHandbookOnTheUndead()
|
||||
{
|
||||
Hue = 2953;
|
||||
Attributes.RegenMana = 3;
|
||||
Attributes.DefendChance = 5;
|
||||
Attributes.LowerManaCost = 10;
|
||||
Attributes.LowerRegCost = 20;
|
||||
}
|
||||
|
||||
public CorgulsHandbookOnTheUndead(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CullingBlade : BoneHarvester
|
||||
{
|
||||
public override int LabelNumber { get { return 1116630; } }
|
||||
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
[Constructable]
|
||||
public CullingBlade()
|
||||
{
|
||||
WeaponAttributes.HitManaDrain = 30;
|
||||
WeaponAttributes.HitFatigue = 30;
|
||||
WeaponAttributes.HitLowerDefend = 40;
|
||||
Attributes.RegenHits = 3;
|
||||
Attributes.WeaponSpeed = 20;
|
||||
Attributes.WeaponDamage = 50;
|
||||
}
|
||||
|
||||
public override void GetDamageTypes(Mobile wielder, out int phys, out int fire, out int cold, out int pois, out int nrgy, out int chaos, out int direct)
|
||||
{
|
||||
phys = fire = cold = nrgy = pois = direct = 0;
|
||||
chaos = 100;
|
||||
}
|
||||
|
||||
public CullingBlade(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EnchantedBladeAddon : BaseAddon
|
||||
{
|
||||
|
||||
public override BaseAddonDeed Deed{ get{ return new EnchantedBladeDeed(); } }
|
||||
|
||||
[Constructable]
|
||||
public EnchantedBladeAddon()
|
||||
{
|
||||
AddComponent( new LocalizedAddonComponent(14240, 1034240), 0, 0, 0 );
|
||||
}
|
||||
|
||||
public EnchantedBladeAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class EnchantedBladeDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon{ get{ return new EnchantedBladeAddon(); } }
|
||||
|
||||
[Constructable]
|
||||
public EnchantedBladeDeed()
|
||||
{
|
||||
Name = "A deed for an enchanted blade";
|
||||
}
|
||||
|
||||
public EnchantedBladeDeed( 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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EnchantedCoralBracelet : SilverBracelet
|
||||
{
|
||||
public override int LabelNumber { get { return 1116624; } }
|
||||
|
||||
[Constructable]
|
||||
public EnchantedCoralBracelet()
|
||||
{
|
||||
Hue = 1548;
|
||||
Attributes.BonusHits = 5;
|
||||
Attributes.RegenMana = 1;
|
||||
Attributes.AttackChance = 5;
|
||||
Attributes.DefendChance = 15;
|
||||
Attributes.CastSpeed = 1;
|
||||
Attributes.CastRecovery = 3;
|
||||
Attributes.SpellDamage = 10;
|
||||
}
|
||||
|
||||
public EnchantedCoralBracelet(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EnchantedVortexAddon : BaseAddon
|
||||
{
|
||||
|
||||
public override BaseAddonDeed Deed { get { return new EnchantedVortexDeed(); } }
|
||||
|
||||
[Constructable]
|
||||
public EnchantedVortexAddon()
|
||||
{
|
||||
AddonComponent comp = new AddonComponent(14284);
|
||||
comp.Name = "an enchanted vortex";
|
||||
AddComponent(comp, 0, 0, 0);
|
||||
}
|
||||
|
||||
public EnchantedVortexAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class EnchantedVortexDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon { get { return new EnchantedVortexAddon(); } }
|
||||
|
||||
[Constructable]
|
||||
public EnchantedVortexDeed()
|
||||
{
|
||||
Name = "A deed for an enchanted vortex";
|
||||
}
|
||||
|
||||
public EnchantedVortexDeed(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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class HelmOfVengence : NorseHelm
|
||||
{
|
||||
public override int LabelNumber { get { return 1116621; } }
|
||||
|
||||
public override int BasePhysicalResistance { get { return 11; } }
|
||||
public override int BaseFireResistance { get { return 10; } }
|
||||
public override int BaseColdResistance { get { return 14; } }
|
||||
public override int BasePoisonResistance { get { return 7; } }
|
||||
public override int BaseEnergyResistance { get { return 8; } }
|
||||
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
[Constructable]
|
||||
public HelmOfVengence()
|
||||
{
|
||||
Hue = 2012;
|
||||
Attributes.RegenMana = 3;
|
||||
Attributes.ReflectPhysical = 30;
|
||||
Attributes.AttackChance = 7;
|
||||
Attributes.WeaponDamage = 10;
|
||||
Attributes.LowerManaCost = 8;
|
||||
}
|
||||
|
||||
public HelmOfVengence(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LeviathanHideBracers : LeatherArms
|
||||
{
|
||||
public override int LabelNumber { get { return 1116619; } }
|
||||
|
||||
public override int BasePhysicalResistance { get { return 7; } }
|
||||
public override int BaseFireResistance { get { return 9; } }
|
||||
public override int BaseColdResistance { get { return 10; } }
|
||||
public override int BasePoisonResistance { get { return 13; } }
|
||||
public override int BaseEnergyResistance { get { return 14; } }
|
||||
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
[Constructable]
|
||||
public LeviathanHideBracers()
|
||||
{
|
||||
Hue = 1274;
|
||||
|
||||
AbsorptionAttributes.CastingFocus = 2;
|
||||
Attributes.BonusInt = 6;
|
||||
Attributes.AttackChance = 5;
|
||||
Attributes.RegenStam = 2;
|
||||
Attributes.RegenMana = 2;
|
||||
Attributes.LowerManaCost = 8;
|
||||
Attributes.LowerRegCost = 10;
|
||||
}
|
||||
|
||||
public LeviathanHideBracers(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RingOfTheSoulbinder : SilverRing
|
||||
{
|
||||
public override int LabelNumber { get { return 1116620; } }
|
||||
|
||||
[Constructable]
|
||||
public RingOfTheSoulbinder()
|
||||
{
|
||||
Hue = 288;
|
||||
Attributes.RegenMana = 2;
|
||||
Attributes.DefendChance = 15;
|
||||
Attributes.CastSpeed = 1;
|
||||
Attributes.CastRecovery = 3;
|
||||
Attributes.SpellDamage = 10;
|
||||
Attributes.LowerRegCost = 10;
|
||||
}
|
||||
|
||||
public RingOfTheSoulbinder(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RuneEngravedPegLeg : Club
|
||||
{
|
||||
public override int LabelNumber { get { return 1116622; } }
|
||||
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
[Constructable]
|
||||
public RuneEngravedPegLeg()
|
||||
{
|
||||
WeaponAttributes.HitLightning = 40;
|
||||
WeaponAttributes.HitLowerDefend = 40;
|
||||
Attributes.RegenHits = 3;
|
||||
Attributes.AttackChance = 5;
|
||||
Attributes.WeaponSpeed = 30;
|
||||
Attributes.WeaponDamage = 50;
|
||||
}
|
||||
|
||||
public override void GetDamageTypes(Mobile wielder, out int phys, out int fire, out int cold, out int pois, out int nrgy, out int chaos, out int direct)
|
||||
{
|
||||
phys = fire = cold = nrgy = pois = direct = 0;
|
||||
chaos = 100;
|
||||
}
|
||||
|
||||
public RuneEngravedPegLeg(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SmilingMoonBlade : CrescentBlade
|
||||
{
|
||||
public override int LabelNumber { get { return 1116628; } }
|
||||
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
[Constructable]
|
||||
public SmilingMoonBlade()
|
||||
{
|
||||
Hue = 2567;
|
||||
WeaponAttributes.HitManaDrain = 10;
|
||||
WeaponAttributes.HitFireball = 45;
|
||||
WeaponAttributes.HitLowerDefend = 40;
|
||||
WeaponAttributes.BattleLust = 1;
|
||||
Attributes.WeaponSpeed = 30;
|
||||
Attributes.WeaponDamage = 45;
|
||||
}
|
||||
|
||||
public override void GetDamageTypes(Mobile wielder, out int phys, out int fire, out int cold, out int pois, out int nrgy, out int chaos, out int direct)
|
||||
{
|
||||
phys = fire = chaos = nrgy = pois = direct = 0;
|
||||
cold = 100;
|
||||
}
|
||||
|
||||
public SmilingMoonBlade(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WandOfThunderingGlory : BaseWand
|
||||
{
|
||||
public override int LabelNumber { get { return 1116623; } }
|
||||
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
[Constructable]
|
||||
public WandOfThunderingGlory() : base(WandEffect.None, 0, 0)
|
||||
{
|
||||
WeaponAttributes.HitLightning = 40;
|
||||
Attributes.AttackChance = 5;
|
||||
Attributes.WeaponSpeed = 10;
|
||||
Attributes.WeaponDamage = 50;
|
||||
Attributes.SpellDamage = 10;
|
||||
}
|
||||
|
||||
public override void GetDamageTypes(Mobile wielder, out int phys, out int fire, out int cold, out int pois, out int nrgy, out int chaos, out int direct)
|
||||
{
|
||||
phys = fire = cold = nrgy = pois = direct = 0;
|
||||
chaos = 100;
|
||||
}
|
||||
|
||||
public WandOfThunderingGlory(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
132
Scripts/Services/Expansions/High Seas/Items/BoatPaint.cs
Normal file
132
Scripts/Services/Expansions/High Seas/Items/BoatPaint.cs
Normal file
@@ -0,0 +1,132 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Multis;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BoatPaint : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1116236; } }
|
||||
public override double DefaultWeight { get { return 10.0; } }
|
||||
|
||||
private bool m_Permanent;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool Permanent { get { return m_Permanent; } set { m_Permanent = value; } }
|
||||
|
||||
public BoatPaint(object hue) : this((int)hue)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BoatPaint(int hue) : base(4011)
|
||||
{
|
||||
Hue = hue;
|
||||
m_Permanent = false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.Target = new InternalTarget(from, this);
|
||||
from.SendLocalizedMessage(1116613); //Select the main mast of the ship you wish to dye.
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private BoatPaint m_Paint;
|
||||
private Mobile m_From;
|
||||
|
||||
public InternalTarget(Mobile from, BoatPaint paint) : base(5, false, TargetFlags.None)
|
||||
{
|
||||
m_From = from;
|
||||
m_Paint = paint;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is IPoint3D)
|
||||
{
|
||||
IPoint3D pnt = (IPoint3D)targeted;
|
||||
BaseGalleon galleon = BaseGalleon.FindGalleonAt(pnt, from.Map);
|
||||
|
||||
if (galleon == null || !galleon.Contains(from))
|
||||
return;
|
||||
|
||||
if (galleon.GetSecurityLevel(from) < SecurityLevel.Captain)
|
||||
from.SendMessage("You must be the captain to paint this ship!");
|
||||
|
||||
else if (galleon.Contains(pnt)/*&& boat.X == pnt.X && boat.Y == pnt.Y*/)
|
||||
{
|
||||
if (m_Paint.Permanent)
|
||||
{
|
||||
if (galleon.TryPermanentPaintBoat(from, m_Paint.Hue))
|
||||
m_Paint.Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (galleon.TryPaintBoat(from, m_Paint.Hue))
|
||||
m_Paint.Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1116612); //You must target the main mast of the ship you wish to dye.
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BoatPaint(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class PermanentBoatPaint : BoatPaint
|
||||
{
|
||||
public override int LabelNumber { get { return 1116768; } }
|
||||
|
||||
[Constructable]
|
||||
public PermanentBoatPaint()
|
||||
: this(Utility.RandomMinMax(1954, 1997))
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public PermanentBoatPaint(int hue) : base(hue)
|
||||
{
|
||||
Permanent = true;
|
||||
}
|
||||
|
||||
public static PermanentBoatPaint DropRandom()
|
||||
{
|
||||
return new PermanentBoatPaint(Utility.RandomMinMax(1954, 1997));
|
||||
}
|
||||
|
||||
public PermanentBoatPaint(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Multis;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BoatPaintRemover : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1116766; } }
|
||||
public override double DefaultWeight { get { return 10.0; } }
|
||||
|
||||
[Constructable]
|
||||
public BoatPaintRemover() : base(4011)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if(IsChildOf(from.Backpack))
|
||||
from.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private BoatPaintRemover m_PaintRemover;
|
||||
|
||||
public InternalTarget(BoatPaintRemover paintremover)
|
||||
: base(5, false, TargetFlags.None)
|
||||
{
|
||||
m_PaintRemover = paintremover;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is IPoint3D)
|
||||
{
|
||||
IPoint3D pnt = (IPoint3D)targeted;
|
||||
BaseBoat boat = BaseBoat.FindBoatAt(pnt, from.Map);
|
||||
|
||||
if (boat is BaseGalleon && boat.Contains(from))
|
||||
{
|
||||
if (((BaseGalleon)boat).RemovePaint())
|
||||
m_PaintRemover.Delete();
|
||||
}
|
||||
|
||||
else
|
||||
from.SendLocalizedMessage(1116612); //You must target the main mast of the ship you wish to dye.
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BoatPaintRemover(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Multis;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public interface ICannonAmmo
|
||||
{
|
||||
AmmunitionType AmmoType { get; }
|
||||
}
|
||||
|
||||
public enum AmmunitionType
|
||||
{
|
||||
Empty,
|
||||
Cannonball,
|
||||
Grapeshot,
|
||||
FrostCannonball,
|
||||
FlameCannonball
|
||||
}
|
||||
|
||||
public class AmmoInfo
|
||||
{
|
||||
private static Dictionary<Type, AmmoInfo> Infos { get; set; } = new Dictionary<Type, AmmoInfo>();
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
if (Core.EJ)
|
||||
{
|
||||
Infos[typeof(Cannonball)] = new AmmoInfo(typeof(HeavyCannonball), AmmunitionType.Cannonball, 1095804, 5000, 5000, 3);
|
||||
Infos[typeof(Grapeshot)] = new AmmoInfo(typeof(HeavyGrapeshot), AmmunitionType.Grapeshot, 1095741, 100, 150, 3);
|
||||
|
||||
Infos[typeof(FlameCannonball)] = new AmmoInfo(typeof(HeavyFlameCannonball), AmmunitionType.FlameCannonball, 1149633, 5000, 5000, 3, true, 50, 50, 0, 0, 0, false);
|
||||
Infos[typeof(FrostCannonball)] = new AmmoInfo(typeof(HeavyFrostCannonball), AmmunitionType.FrostCannonball, 1149634, 30, 50, 3, true, 50, 0, 50, 0, 0, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
Infos[typeof(LightCannonball)] = new AmmoInfo(typeof(LightCannonball), AmmunitionType.Cannonball, 1095804, 5000, 5000, 3);
|
||||
Infos[typeof(HeavyCannonball)] = new AmmoInfo(typeof(HeavyCannonball), AmmunitionType.Cannonball, 1095804, 6500, 6500, 3);
|
||||
Infos[typeof(LightGrapeshot)] = new AmmoInfo(typeof(LightGrapeshot), AmmunitionType.Grapeshot, 1095741, 40, 50, 3);
|
||||
Infos[typeof(HeavyGrapeshot)] = new AmmoInfo(typeof(HeavyGrapeshot), AmmunitionType.Grapeshot, 1095741, 50, 75, 3);
|
||||
|
||||
Infos[typeof(HeavyFlameCannonball)] = new AmmoInfo(typeof(HeavyFlameCannonball), AmmunitionType.FlameCannonball, 1149633, 5000, 5000, 3, true, 50, 50, 0, 0, 0, false);
|
||||
Infos[typeof(LightFlameCannonball)] = new AmmoInfo(typeof(LightFlameCannonball), AmmunitionType.FlameCannonball, 1149633, 5000, 5000, 3, true, 50, 50, 0, 0, 0, false);
|
||||
Infos[typeof(HeavyFrostCannonball)] = new AmmoInfo(typeof(HeavyFrostCannonball), AmmunitionType.FrostCannonball, 1149634, 5000, 5000, 3, true, 50, 0, 50, 0, 0, false);
|
||||
Infos[typeof(LightFrostCannonball)] = new AmmoInfo(typeof(LightFrostCannonball), AmmunitionType.FrostCannonball, 1149634, 5000, 5000, 3, true, 50, 0, 50, 0, 0, false);
|
||||
}
|
||||
}
|
||||
|
||||
public Type Type { get; set; }
|
||||
public AmmunitionType AmmoType { get; set; }
|
||||
public TextDefinition Name { get; set; }
|
||||
public int MinDamage { get; set; }
|
||||
public int MaxDamage { get; set; }
|
||||
public int LateralOffset { get; set; }
|
||||
public int PhysicalDamage { get; set; }
|
||||
public int FireDamage { get; set; }
|
||||
public int ColdDamage { get; set; }
|
||||
public int PoisonDamage { get; set; }
|
||||
public int EnergyDamage { get; set; }
|
||||
public bool SingleTarget { get; set; }
|
||||
public bool RequiresSurface { get; set; }
|
||||
|
||||
public AmmoInfo(Type type, AmmunitionType ammoType, TextDefinition name, int minDamage, int maxDamage, int lateralOffset)
|
||||
: this(type, ammoType, name, minDamage, maxDamage, lateralOffset, true, 100, 0, 0, 0, 0, false)
|
||||
{
|
||||
}
|
||||
|
||||
public AmmoInfo(Type type, AmmunitionType ammoType, TextDefinition name, int minDamage, int maxDamage, int lateralOffset, bool singleOnly)
|
||||
: this(type, ammoType, name, minDamage, maxDamage, lateralOffset, singleOnly, 100, 0, 0, 0, 0, false)
|
||||
{
|
||||
}
|
||||
|
||||
public AmmoInfo(Type type, AmmunitionType ammoType, TextDefinition name, int minDamage, int maxDamage, int lateralOffset, bool singleOnly, int phys, int fire, int cold, int poison, int energy, bool requiresSurface)
|
||||
{
|
||||
Type = type;
|
||||
AmmoType = ammoType;
|
||||
Name = name;
|
||||
MinDamage = minDamage;
|
||||
MaxDamage = maxDamage;
|
||||
LateralOffset = lateralOffset;
|
||||
PhysicalDamage = phys;
|
||||
FireDamage = fire;
|
||||
ColdDamage = cold;
|
||||
PoisonDamage = poison;
|
||||
EnergyDamage = energy;
|
||||
SingleTarget = singleOnly;
|
||||
RequiresSurface = requiresSurface;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets damage for Rising Tides Cannons. This differentiates between the cannon sizes.
|
||||
/// </summary>
|
||||
/// <param name="cannon"></param>
|
||||
/// <returns></returns>
|
||||
public int GetDamage(BaseShipCannon cannon)
|
||||
{
|
||||
return Utility.RandomMinMax(MinDamage, MaxDamage);
|
||||
|
||||
// Fucking EA, after rising tide, made all cannons deal the same amount of damage. I don't get it. If they ever pull their head out of their asses, or you
|
||||
// want, use the code below...
|
||||
|
||||
/*if (AmmoType == AmmunitionType.Grapeshot)
|
||||
{
|
||||
return Utility.RandomMinMax(MinDamage, MaxDamage);
|
||||
}
|
||||
|
||||
int baseDamage = Utility.RandomMinMax(info.MinDamage, info.MaxDamage);
|
||||
|
||||
switch (cannon.Power)
|
||||
{
|
||||
default:
|
||||
case CannonPower.Light: return baseDamage;
|
||||
case CannonPower.Heavy: return baseDamage + 1500;
|
||||
case CannonPower.Massive: return baseDamage + 3000;
|
||||
}*/
|
||||
}
|
||||
|
||||
public static AmmoInfo GetAmmoInfo(Type ammoType)
|
||||
{
|
||||
if (ammoType != null && Infos.ContainsKey(ammoType))
|
||||
{
|
||||
return Infos[ammoType];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static AmmoInfo GetAmmoInfo(AmmunitionType ammoType)
|
||||
{
|
||||
return Infos.Values.FirstOrDefault(i => i.AmmoType == ammoType);
|
||||
}
|
||||
|
||||
public static void GetSurfaceTop(ref Point3D p, Map map)
|
||||
{
|
||||
StaticTile[] tiles = map.Tiles.GetStaticTiles(p.X, p.Y, true);
|
||||
int z = p.Z;
|
||||
|
||||
foreach (StaticTile tile in tiles)
|
||||
{
|
||||
ItemData id = TileData.ItemTable[tile.ID & TileData.MaxItemValue];
|
||||
|
||||
if (id.Surface && (z == p.Z || tile.Z + id.CalcHeight > z))
|
||||
{
|
||||
z = tile.Z + id.CalcHeight;
|
||||
}
|
||||
}
|
||||
|
||||
if (z != p.Z)
|
||||
p.Z = z;
|
||||
}
|
||||
|
||||
public static TextDefinition GetAmmoName(IShipCannon cannon)
|
||||
{
|
||||
var info = Infos.Values.FirstOrDefault(i => i.AmmoType == cannon.AmmoType);
|
||||
|
||||
if (info == null)
|
||||
{
|
||||
return 1116033; // None
|
||||
}
|
||||
|
||||
return info.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,388 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Cannonball : Item, ICommodity, ICannonAmmo
|
||||
{
|
||||
public override int LabelNumber { get { return 1116266; } }
|
||||
public override double DefaultWeight { get { return 1.0; } }
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public virtual AmmunitionType AmmoType { get { return AmmunitionType.Cannonball; } }
|
||||
|
||||
[Constructable]
|
||||
public Cannonball() : this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Cannonball(int amount) : this(amount, 16932)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Cannonball(int amount, int itemid)
|
||||
: base(itemid)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public Cannonball(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class FrostCannonball : Cannonball, ICommodity
|
||||
{
|
||||
public override int LabelNumber { get { return 1116267; } }
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public override AmmunitionType AmmoType { get { return AmmunitionType.FrostCannonball; } }
|
||||
|
||||
[Constructable]
|
||||
public FrostCannonball() : this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FrostCannonball(int amount) : this(amount, 16939)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FrostCannonball(int amount, int itemid)
|
||||
: base(itemid)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public FrostCannonball(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class FlameCannonball : Cannonball, ICommodity
|
||||
{
|
||||
public override int LabelNumber { get { return 1116759; } }
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public override AmmunitionType AmmoType { get { return AmmunitionType.FlameCannonball; } }
|
||||
|
||||
[Constructable]
|
||||
public FlameCannonball() : this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FlameCannonball(int amount) : this(amount, 17601)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FlameCannonball(int amount, int itemid)
|
||||
: base(itemid)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public FlameCannonball(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LightCannonball : Item, ICommodity, ICannonAmmo
|
||||
{
|
||||
public override int LabelNumber { get { return 1116266; } }
|
||||
public override double DefaultWeight { get { return 1.0; } }
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public virtual AmmunitionType AmmoType { get { return AmmunitionType.Cannonball; } }
|
||||
|
||||
[Constructable]
|
||||
public LightCannonball() : this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LightCannonball(int amount) : this(amount, 16932)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LightCannonball(int amount, int itemid)
|
||||
: base(itemid)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public LightCannonball(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();
|
||||
|
||||
if (Core.EJ)
|
||||
{
|
||||
Replacer.Replace(this, new Cannonball());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class HeavyCannonball : Item, ICommodity, ICannonAmmo
|
||||
{
|
||||
public override int LabelNumber { get { return 1116267; } }
|
||||
public override double DefaultWeight { get { return 1.0; } }
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public virtual AmmunitionType AmmoType { get { return AmmunitionType.Cannonball; } }
|
||||
|
||||
[Constructable]
|
||||
public HeavyCannonball() : this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HeavyCannonball(int amount) : this(amount, 16932)
|
||||
{
|
||||
}
|
||||
|
||||
public HeavyCannonball(int amount, int itemID) : base(itemID)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public HeavyCannonball(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();
|
||||
|
||||
if (Core.EJ)
|
||||
{
|
||||
Replacer.Replace(this, new Cannonball());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class LightFlameCannonball : Cannonball, ICommodity
|
||||
{
|
||||
public override int LabelNumber { get { return 1116759; } }
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public override AmmunitionType AmmoType { get { return AmmunitionType.FlameCannonball; } }
|
||||
|
||||
[Constructable]
|
||||
public LightFlameCannonball() : this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LightFlameCannonball(int amount) : base(amount, 17601)
|
||||
{
|
||||
}
|
||||
|
||||
public LightFlameCannonball(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();
|
||||
|
||||
if (Core.EJ)
|
||||
{
|
||||
Replacer.Replace(this, new FlameCannonball());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class HeavyFlameCannonball : Cannonball, ICommodity
|
||||
{
|
||||
public override int LabelNumber { get { return 1116267; } }
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public override AmmunitionType AmmoType { get { return AmmunitionType.FlameCannonball; } }
|
||||
|
||||
[Constructable]
|
||||
public HeavyFlameCannonball()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HeavyFlameCannonball(int amount)
|
||||
: base(amount, 17601)
|
||||
{
|
||||
}
|
||||
|
||||
public HeavyFlameCannonball(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();
|
||||
|
||||
if (Core.EJ)
|
||||
{
|
||||
Replacer.Replace(this, new FlameCannonball());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class LightFrostCannonball : Cannonball, ICommodity
|
||||
{
|
||||
public override int LabelNumber { get { return 1116759; } }
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public override AmmunitionType AmmoType { get { return AmmunitionType.FrostCannonball; } }
|
||||
|
||||
[Constructable]
|
||||
public LightFrostCannonball()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LightFrostCannonball(int amount)
|
||||
: base(amount, 16939)
|
||||
{
|
||||
}
|
||||
|
||||
public LightFrostCannonball(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();
|
||||
|
||||
if (Core.EJ)
|
||||
{
|
||||
Replacer.Replace(this, new FrostCannonball());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class HeavyFrostCannonball : Cannonball, ICommodity
|
||||
{
|
||||
public override int LabelNumber { get { return 1116267; } }
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public override AmmunitionType AmmoType { get { return AmmunitionType.FrostCannonball; } }
|
||||
|
||||
[Constructable]
|
||||
public HeavyFrostCannonball()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HeavyFrostCannonball(int amount)
|
||||
: base(amount, 16939)
|
||||
{
|
||||
}
|
||||
|
||||
public HeavyFrostCannonball(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();
|
||||
|
||||
if (Core.EJ)
|
||||
{
|
||||
Replacer.Replace(this, new FrostCannonball());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Multis;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum CannonPower
|
||||
{
|
||||
Light,
|
||||
Heavy,
|
||||
Massive,
|
||||
Pumpkin
|
||||
}
|
||||
|
||||
public abstract class ShipCannonDeed : Item
|
||||
{
|
||||
public abstract CannonPower CannonType { get; }
|
||||
|
||||
public ShipCannonDeed() : base(5362)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
BaseGalleon galleon = BaseGalleon.FindGalleonAt(from, from.Map);
|
||||
|
||||
if (galleon != null)
|
||||
{
|
||||
if (galleon.Owner == from)
|
||||
{
|
||||
from.Target = new InternalTarget(this, galleon);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1116627); // You must be the owner of the ship to do this.
|
||||
}
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1116625); //You must be on the ship to deploy a weapon.
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
public ShipCannonDeed Deed { get; set; }
|
||||
public BaseGalleon Galleon { get; set; }
|
||||
|
||||
public InternalTarget(ShipCannonDeed deed, BaseGalleon galleon)
|
||||
: base(2, false, TargetFlags.None)
|
||||
{
|
||||
Deed = deed;
|
||||
Galleon = galleon;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
Map map = from.Map;
|
||||
|
||||
if (targeted is IPoint3D)
|
||||
{
|
||||
Point3D pnt = new Point3D((IPoint3D)targeted);
|
||||
|
||||
var galleon = BaseGalleon.FindGalleonAt(new Point2D(pnt.X, pnt.Y), map);
|
||||
|
||||
if (galleon != null && Galleon == galleon)
|
||||
{
|
||||
galleon.TryAddCannon(from, pnt, Deed);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ShipCannonDeed(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class CulverinDeed : ShipCannonDeed
|
||||
{
|
||||
public override CannonPower CannonType { get { return CannonPower.Light; } }
|
||||
public override int LabelNumber { get { return 1095793; } }
|
||||
|
||||
[Constructable]
|
||||
public CulverinDeed()
|
||||
{
|
||||
Hue = 1117;
|
||||
}
|
||||
|
||||
public CulverinDeed(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class CarronadeDeed : ShipCannonDeed
|
||||
{
|
||||
public override CannonPower CannonType { get { return CannonPower.Heavy; } }
|
||||
public override int LabelNumber { get { return 1095794; } }
|
||||
|
||||
[Constructable]
|
||||
public CarronadeDeed()
|
||||
{
|
||||
Hue = 1118;
|
||||
}
|
||||
|
||||
public CarronadeDeed(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BlundercannonDeed : ShipCannonDeed
|
||||
{
|
||||
public override CannonPower CannonType { get { return CannonPower.Massive; } }
|
||||
public override int LabelNumber { get { return 1095794; } }
|
||||
|
||||
[Constructable]
|
||||
public BlundercannonDeed()
|
||||
{
|
||||
Hue = 1126;
|
||||
}
|
||||
|
||||
public BlundercannonDeed(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LightShipCannonDeed : ShipCannonDeed
|
||||
{
|
||||
public override CannonPower CannonType { get { return CannonPower.Light; } }
|
||||
public override int LabelNumber { get { return 1095793; } }
|
||||
|
||||
[Constructable]
|
||||
public LightShipCannonDeed()
|
||||
{
|
||||
Hue = 1117;
|
||||
}
|
||||
|
||||
public LightShipCannonDeed(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class HeavyShipCannonDeed : ShipCannonDeed
|
||||
{
|
||||
public override CannonPower CannonType { get { return CannonPower.Heavy; } }
|
||||
public override int LabelNumber { get { return 1095794; } }
|
||||
|
||||
[Constructable]
|
||||
public HeavyShipCannonDeed()
|
||||
{
|
||||
Hue = 1118;
|
||||
}
|
||||
|
||||
public HeavyShipCannonDeed(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[TypeAlias("Server.Items.Fusecord")]
|
||||
public class FuseCord : Item, ICommodity
|
||||
{
|
||||
public override int LabelNumber { get { return 1116305; } } // fuse cord
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public FuseCord()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FuseCord(int amount)
|
||||
: base(0x1420)
|
||||
{
|
||||
Stackable = true;
|
||||
Hue = 1164;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public FuseCord(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Grapeshot : Item, ICommodity, ICannonAmmo
|
||||
{
|
||||
public override int LabelNumber { get { return 1116030; } } // grapeshot
|
||||
public override double DefaultWeight { get { return 3.5; } }
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public AmmunitionType AmmoType { get { return AmmunitionType.Grapeshot; } }
|
||||
|
||||
[Constructable]
|
||||
public Grapeshot()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Grapeshot(int amount)
|
||||
: base(0xA2BF)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public Grapeshot(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LightGrapeshot : Item, ICommodity, ICannonAmmo
|
||||
{
|
||||
public override int LabelNumber { get { return 1116030; } }
|
||||
public override double DefaultWeight { get { return 3.5; } }
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public AmmunitionType AmmoType { get { return AmmunitionType.Grapeshot; } }
|
||||
|
||||
[Constructable]
|
||||
public LightGrapeshot() : this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LightGrapeshot(int amount) : base(16869)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public LightGrapeshot(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();
|
||||
|
||||
if (Core.EJ)
|
||||
{
|
||||
Replacer.Replace(this, new Grapeshot());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class HeavyGrapeshot : Item, ICommodity, ICannonAmmo
|
||||
{
|
||||
public override int LabelNumber { get { return 1116166; } }
|
||||
public override double DefaultWeight { get { return 7.0; } }
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public AmmunitionType AmmoType { get { return AmmunitionType.Grapeshot; } }
|
||||
|
||||
[Constructable]
|
||||
public HeavyGrapeshot() : this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HeavyGrapeshot(int amount) : base(16869)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public HeavyGrapeshot(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();
|
||||
|
||||
if (Core.EJ)
|
||||
{
|
||||
Replacer.Replace(this, new Grapeshot());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Matches : Item, ICommodity
|
||||
{
|
||||
public override int LabelNumber { get { return 1116112; } }
|
||||
|
||||
private static readonly TimeSpan LightDuration = TimeSpan.FromMinutes(60);
|
||||
|
||||
private bool m_IsLight;
|
||||
|
||||
public bool IsLight { get { return m_IsLight; } set { m_IsLight = value; } }
|
||||
|
||||
[Constructable]
|
||||
public Matches() : this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Matches(int amount) : base(3947)
|
||||
{
|
||||
Stackable = true;
|
||||
Layer = Layer.TwoHanded;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
if (Amount > 1)
|
||||
{
|
||||
Container pack = from.Backpack;
|
||||
|
||||
if(pack != null)
|
||||
{
|
||||
Matches match = new Matches();
|
||||
|
||||
if (pack.CheckHold(from, match, true))
|
||||
{
|
||||
pack.DropItem(match);
|
||||
this.Amount--;
|
||||
|
||||
match.ItemID = 2578;
|
||||
from.SendSound(0x047);
|
||||
match.IsLight = true;
|
||||
}
|
||||
else
|
||||
match.Delete();
|
||||
}
|
||||
}
|
||||
else if (!m_IsLight)
|
||||
{
|
||||
new InternalTimer(this);
|
||||
from.SendLocalizedMessage(1116114); //You ignite the match.
|
||||
|
||||
ItemID = 2578;
|
||||
from.SendSound(0x047);
|
||||
m_IsLight = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
from.Target = new InternalTarget(this);
|
||||
from.SendLocalizedMessage(1116113); //Target the cannon whose fuse you wish to light.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void BurnOut()
|
||||
{
|
||||
if (RootParent is PlayerMobile)
|
||||
((PlayerMobile)RootParent).SendLocalizedMessage(1116115); //Your match splutters and dies.
|
||||
|
||||
Delete();
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Matches m_Match;
|
||||
|
||||
public InternalTimer(Matches match) : base(Matches.LightDuration)
|
||||
{
|
||||
m_Match = match;
|
||||
Start();
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (m_Match != null)
|
||||
m_Match.BurnOut();
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private Matches m_Match;
|
||||
|
||||
public InternalTarget(Matches match) : base (3, false, TargetFlags.None)
|
||||
{
|
||||
m_Match = match;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object obj)
|
||||
{
|
||||
if (obj is IShipCannon)
|
||||
{
|
||||
IShipCannon cannon = (IShipCannon)obj;
|
||||
|
||||
if (cannon.CanLight)
|
||||
{
|
||||
cannon.LightFuse(from);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1116078); //There is no fuse to light! Prime the cannon first.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Matches(Serial serial) : base(serial) { }
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
writer.Write(m_IsLight);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
if (reader.ReadBool())
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PowderCharge : Item, ICommodity
|
||||
{
|
||||
public override int LabelNumber { get { return 1116160; } } // powder charge
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public PowderCharge()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public PowderCharge(int amount)
|
||||
: base(0xA2BE)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public PowderCharge(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LightPowderCharge : Item, ICommodity
|
||||
{
|
||||
public override int LabelNumber { get { return 1116159; } }
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public LightPowderCharge() : this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LightPowderCharge(int amount) : base(16932)
|
||||
{
|
||||
Hue = 2031;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
|
||||
public LightPowderCharge(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();
|
||||
|
||||
if (Core.EJ)
|
||||
{
|
||||
Replacer.Replace(this, new PowderCharge());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class HeavyPowderCharge : Item, ICommodity
|
||||
{
|
||||
public override int LabelNumber { get { return 1116160; } }
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public HeavyPowderCharge() : this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HeavyPowderCharge(int amount)
|
||||
: base(16932)
|
||||
{
|
||||
Hue = 2031;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public HeavyPowderCharge(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();
|
||||
|
||||
if (Core.EJ)
|
||||
{
|
||||
Replacer.Replace(this, new PowderCharge());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Ramrod : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1095838; } } // ramrod
|
||||
|
||||
[Constructable]
|
||||
public Ramrod()
|
||||
: base(0x4246)
|
||||
{
|
||||
}
|
||||
|
||||
public Ramrod(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,245 @@
|
||||
/*using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LightScatterShot : Item, ICommodity, ICannonAmmo
|
||||
{
|
||||
public override double DefaultWeight { get { return 4.0; } }
|
||||
public override string DefaultName { get { return "Light Scatter Shot"; } }
|
||||
|
||||
int ICommodity.DescriptionNumber { get { return 0; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public AmmoType AmmoType { get { return AmmoType.Grapeshot; } }
|
||||
|
||||
[Constructable]
|
||||
public LightScatterShot()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LightScatterShot(int amount)
|
||||
: base(16869)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Hue = 898;
|
||||
}
|
||||
|
||||
public LightScatterShot(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class HeavyScatterShot : Item, ICommodity, ICannonAmmo
|
||||
{
|
||||
public override double DefaultWeight { get { return 8.0; } }
|
||||
public override string DefaultName { get { return "Heavy Scatter Shot"; } }
|
||||
|
||||
int ICommodity.DescriptionNumber { get { return 0; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public AmmoType AmmoType { get { return AmmoType.Grapeshot; } }
|
||||
|
||||
[Constructable]
|
||||
public HeavyScatterShot()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HeavyScatterShot(int amount)
|
||||
: base(16869)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Hue = 899;
|
||||
}
|
||||
|
||||
public HeavyScatterShot(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LightFragShot : Item, ICommodity, ICannonAmmo
|
||||
{
|
||||
public override double DefaultWeight { get { return 6.0; } }
|
||||
public override string DefaultName { get { return "Light Fragmentation Shot"; } }
|
||||
|
||||
int ICommodity.DescriptionNumber { get { return 0; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public AmmoType AmmoType { get { return AmmoType.Grapeshot; } }
|
||||
|
||||
[Constructable]
|
||||
public LightFragShot()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LightFragShot(int amount)
|
||||
: base(16869)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Hue = 390;
|
||||
}
|
||||
|
||||
public LightFragShot(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class HeavyFragShot : Item, ICommodity, ICannonAmmo
|
||||
{
|
||||
public override double DefaultWeight { get { return 12.0; } }
|
||||
public override string DefaultName { get { return "Heavy Fragmentation Shot"; } }
|
||||
|
||||
int ICommodity.DescriptionNumber { get { return 0; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public AmmoType AmmoType { get { return AmmoType.Grapeshot; } }
|
||||
|
||||
[Constructable]
|
||||
public HeavyFragShot()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HeavyFragShot(int amount)
|
||||
: base(16869)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Hue = 391;
|
||||
}
|
||||
|
||||
public HeavyFragShot(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LightHotShot : Item, ICommodity, ICannonAmmo
|
||||
{
|
||||
public override double DefaultWeight { get { return 6.0; } }
|
||||
public override string DefaultName { get { return "Light Hot Shot"; } }
|
||||
|
||||
int ICommodity.DescriptionNumber { get { return 0; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public AmmoType AmmoType { get { return AmmoType.Cannonball; } }
|
||||
|
||||
[Constructable]
|
||||
public LightHotShot()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LightHotShot(int amount)
|
||||
: base(16932)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Hue = 1288;
|
||||
}
|
||||
|
||||
public LightHotShot(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class HeavyHotShot : Item, ICommodity, ICannonAmmo
|
||||
{
|
||||
public override double DefaultWeight { get { return 12.0; } }
|
||||
public override string DefaultName { get { return "Heavy Hot Shot"; } }
|
||||
|
||||
int ICommodity.DescriptionNumber { get { return 0; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public AmmoType AmmoType { get { return AmmoType.Cannonball; } }
|
||||
|
||||
[Constructable]
|
||||
public HeavyHotShot()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HeavyHotShot(int amount)
|
||||
: base(16932)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Hue = 1288;
|
||||
}
|
||||
|
||||
public HeavyHotShot(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Swab : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Swab()
|
||||
: base(Utility.RandomMinMax(16968, 16969))
|
||||
{
|
||||
}
|
||||
|
||||
public Swab(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
454
Scripts/Services/Expansions/High Seas/Items/CorgulAltar.cs
Normal file
454
Scripts/Services/Expansions/High Seas/Items/CorgulAltar.cs
Normal file
@@ -0,0 +1,454 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
using Server.Multis;
|
||||
using Server.Regions;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CorgulAltar : Container
|
||||
{
|
||||
|
||||
#region Statics
|
||||
private static TimeSpan ExpireTime = TimeSpan.FromMinutes(180);
|
||||
private static TimeSpan CompleteTime = TimeSpan.FromMinutes(15);
|
||||
|
||||
private static readonly int m_RegionSize = 186;
|
||||
|
||||
private static Rectangle2D[] m_WarpLocations = new Rectangle2D[]
|
||||
{
|
||||
new Rectangle2D(2885, 1373, 500, 800),
|
||||
new Rectangle2D(330, 2940, 400, 400),
|
||||
new Rectangle2D(4040, 2550, 500, 350),
|
||||
new Rectangle2D(4040, 1755, 500, 250),
|
||||
new Rectangle2D(180, 180, 300, 300)
|
||||
};
|
||||
|
||||
public static Rectangle2D[] WarpLocations { get { return m_WarpLocations; } }
|
||||
|
||||
private static Rectangle2D m_BoatKickLocation = new Rectangle2D(2400, 2500, 500, 500);
|
||||
public static Rectangle2D BoatKickLocation { get { return m_BoatKickLocation; } }
|
||||
|
||||
private static Rectangle2D m_LandKickLocation = new Rectangle2D(2125, 3090, 25, 30);
|
||||
public static Rectangle2D LandKickLocation { get { return m_LandKickLocation; } }
|
||||
|
||||
private static Rectangle2D m_CorgulBounds = new Rectangle2D(6337, 1156, m_RegionSize, m_RegionSize);
|
||||
|
||||
public static Rectangle2D CorgulBounds { get { return m_CorgulBounds; } }
|
||||
#endregion
|
||||
|
||||
private bool m_Activated;
|
||||
private bool m_Active;
|
||||
private CorgulWarpRegion m_WarpRegion;
|
||||
private CorgulRegion m_BossRegion;
|
||||
private Point3D m_WarpPoint;
|
||||
private DateTime m_DeadLine;
|
||||
private Mobile m_Boss;
|
||||
private int m_KeyStage;
|
||||
private List<Item> m_IslandMaps = new List<Item>();
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool Activated { get { return m_Activated; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool Active
|
||||
{
|
||||
get { return m_Active; }
|
||||
set
|
||||
{
|
||||
m_Active = value;
|
||||
PublicOverheadMessage(Server.Network.MessageType.Regular, 25, false, String.Format("Corgul Altar for {0} has been {1}", this.Map, m_Active ? "activated" : "deactivated"));
|
||||
}
|
||||
}
|
||||
|
||||
public CorgulWarpRegion WarpRegion { get { return m_WarpRegion; } }
|
||||
public CorgulRegion BossRegion { get { return m_BossRegion; } }
|
||||
|
||||
private Type[] m_Keys = new Type[] { typeof(TreasureMap), typeof(WorldMap) };
|
||||
|
||||
public static Point3D SpawnLoc = new Point3D(6431, 1236, 10);
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DateTime DeadLine { get { return m_DeadLine; } }
|
||||
|
||||
public int KeyStage { get { return m_KeyStage; } }
|
||||
|
||||
public override int LabelNumber { get { return 1074818; } }
|
||||
|
||||
public CorgulAltar()
|
||||
: base(13807)
|
||||
{
|
||||
Movable = false;
|
||||
Hue = 2075;
|
||||
m_Activated = false;
|
||||
m_Active = true;
|
||||
m_WarpRegion = null;
|
||||
m_WarpPoint = Point3D.Zero;
|
||||
m_KeyStage = 0;
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1.0), InitializeBossRegion);
|
||||
}
|
||||
|
||||
public void InitializeBossRegion()
|
||||
{
|
||||
m_BossRegion = new CorgulRegion(m_CorgulBounds, this);
|
||||
m_BossRegion.Register();
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
Active = false;
|
||||
Reset();
|
||||
|
||||
if (m_BossRegion != null)
|
||||
{
|
||||
m_BossRegion.Unregister();
|
||||
m_BossRegion = null;
|
||||
}
|
||||
|
||||
if (m_WarpRegion != null)
|
||||
{
|
||||
m_WarpRegion.Unregister();
|
||||
m_WarpRegion = null;
|
||||
}
|
||||
|
||||
base.Delete();
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if (m_BossRegion != null)
|
||||
{
|
||||
m_BossRegion.Unregister();
|
||||
InitializeBossRegion();
|
||||
}
|
||||
|
||||
Reset();
|
||||
}
|
||||
|
||||
private Point3D GetRandomWarpPoint()
|
||||
{
|
||||
Rectangle2D rec = m_WarpLocations[Utility.Random(m_WarpLocations.Length)];
|
||||
|
||||
int x = Utility.Random(rec.X, rec.Width);
|
||||
int y = Utility.Random(rec.Y, rec.Height);
|
||||
|
||||
return new Point3D(x, y, -5);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!m_Active)
|
||||
from.SendMessage("This altar has been deactivated.");
|
||||
else if (!CheckCanUse(from))
|
||||
from.SendLocalizedMessage(1116791); // You must wait a few minutes before making your sacrifice.
|
||||
else if (from.InRange(this.Location, 3))
|
||||
{
|
||||
from.Target = new InternalTarget(this);
|
||||
|
||||
if (m_KeyStage == 0)
|
||||
from.SendLocalizedMessage(1116586); // Your offering will be consumed by the altar if the sacrifice is accepted. You will then have 30 seconds to re-use the shrine to mark your map and pay the blood cost.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private bool CheckCanUse(Mobile from)
|
||||
{
|
||||
if (m_Activated)
|
||||
{
|
||||
if (this.Map == Map.Trammel)
|
||||
return false;
|
||||
|
||||
if (m_Boss == null || !m_Boss.Alive || m_Boss.Hits < m_Boss.HitsMax / 2)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private CorgulAltar m_Altar;
|
||||
|
||||
public InternalTarget(CorgulAltar altar) : base(-1, false, TargetFlags.None)
|
||||
{
|
||||
m_Altar = altar;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is Item && ((Item)targeted).IsChildOf(from.Backpack) && m_Altar.IsKey((Item)targeted, from))
|
||||
m_Altar.OnSacraficedItem((Item)targeted, from);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnSacraficedItem(Item item, Mobile from)
|
||||
{
|
||||
if (m_KeyStage == 1)
|
||||
{
|
||||
if (!m_Activated)
|
||||
{
|
||||
SpawnBoss(from);
|
||||
m_DeadLineTimer = Timer.DelayCall(ExpireTime, new TimerCallback(OnDeadLine));
|
||||
m_DeadLine = DateTime.UtcNow + ExpireTime;
|
||||
}
|
||||
|
||||
from.Hits = 0;
|
||||
from.Mana = 0;
|
||||
from.Stam = 2;
|
||||
from.PlaySound(0x244);
|
||||
from.FixedParticles(0x3709, 1, 30, 9965, 5, 7, EffectLayer.Waist);
|
||||
from.FixedParticles(0x376A, 1, 30, 9502, 5, 3, EffectLayer.Waist);
|
||||
|
||||
GiveMap(from);
|
||||
ResetKeys();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_KeyStage = 1;
|
||||
from.SendLocalizedMessage(1116585); // Your offering has been accepted. The price of blood will be taken when your -world map- is marked with the secret location.
|
||||
|
||||
m_KeyResetTimer = Timer.DelayCall(TimeSpan.FromSeconds(30), new TimerCallback(ResetKeys));
|
||||
}
|
||||
|
||||
item.Delete();
|
||||
}
|
||||
|
||||
private void ResetKeys()
|
||||
{
|
||||
m_KeyStage = 0;
|
||||
|
||||
if (m_KeyResetTimer != null)
|
||||
m_KeyResetTimer.Stop();
|
||||
|
||||
m_KeyResetTimer = null;
|
||||
}
|
||||
|
||||
public bool IsKey(Item item, Mobile from)
|
||||
{
|
||||
Type type = item.GetType();
|
||||
|
||||
if (m_KeyStage >= 0 && m_KeyStage < m_Keys.Length && type == m_Keys[m_KeyStage])
|
||||
return true;
|
||||
else if (m_KeyStage == 1 && item is PresetMap && item.LabelNumber == 1041204)
|
||||
return true;
|
||||
else if (m_KeyStage == 1 && item is TreasureMap)
|
||||
from.SendLocalizedMessage(1116360); // The island's location cannot be marked on a treasure map.
|
||||
else if (m_KeyStage == 1 && item is MapItem)
|
||||
from.SendLocalizedMessage(1116358); // The island's location cannot be marked on this map.
|
||||
else
|
||||
from.SendLocalizedMessage(1072682); // This is not the proper key.
|
||||
return false;
|
||||
}
|
||||
|
||||
public void OnBossKilled()
|
||||
{
|
||||
m_ResetTimer = Timer.DelayCall(CompleteTime, new TimerCallback(Reset));
|
||||
|
||||
EndDeadLineTimer();
|
||||
|
||||
if (m_BossRegion == null)
|
||||
return;
|
||||
|
||||
foreach (Mobile m in m_BossRegion.GetMobiles())
|
||||
{
|
||||
if (m is PlayerMobile)
|
||||
m.SendLocalizedMessage(1072681); // The master of this realm has been slain! You may only stay here so long.
|
||||
}
|
||||
}
|
||||
|
||||
public void OnDeadLine()
|
||||
{
|
||||
if (m_BossRegion == null)
|
||||
return;
|
||||
|
||||
foreach (Mobile m in m_BossRegion.GetMobiles())
|
||||
{
|
||||
if (m is PlayerMobile)
|
||||
m.SendMessage("You have failed to slay Corgul in time.");
|
||||
}
|
||||
Reset();
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
m_Activated = false;
|
||||
|
||||
m_WarpPoint = Point3D.Zero;
|
||||
|
||||
if(m_BossRegion != null)
|
||||
m_BossRegion.RemovePlayers(false);
|
||||
|
||||
EndResetTimer();
|
||||
EndDeadLineTimer();
|
||||
|
||||
if (m_Boss != null && !m_Boss.Deleted)
|
||||
m_Boss.Delete();
|
||||
|
||||
m_Boss = null;
|
||||
|
||||
foreach (Item item in m_IslandMaps)
|
||||
{
|
||||
if (item != null && !item.Deleted)
|
||||
item.Delete();
|
||||
}
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1), UnregisterWarpRegion);
|
||||
|
||||
m_IslandMaps.Clear();
|
||||
ResetKeys();
|
||||
}
|
||||
|
||||
private Timer m_ResetTimer;
|
||||
private Timer m_DeadLineTimer;
|
||||
private Timer m_KeyResetTimer;
|
||||
|
||||
public void EndResetTimer()
|
||||
{
|
||||
if (m_ResetTimer != null)
|
||||
m_ResetTimer.Stop();
|
||||
|
||||
m_ResetTimer = null;
|
||||
}
|
||||
|
||||
public void EndDeadLineTimer()
|
||||
{
|
||||
if (m_DeadLineTimer != null)
|
||||
m_DeadLineTimer.Stop();
|
||||
|
||||
m_DeadLine = DateTime.MinValue;
|
||||
m_DeadLineTimer = null;
|
||||
}
|
||||
|
||||
public void UnregisterWarpRegion()
|
||||
{
|
||||
if (m_WarpRegion != null)
|
||||
{
|
||||
m_WarpRegion.Unregister();
|
||||
m_WarpRegion = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void SpawnBoss(Mobile from)
|
||||
{
|
||||
//Spawn boss
|
||||
CorgulTheSoulBinder boss = new CorgulTheSoulBinder(this);
|
||||
boss.MoveToWorld(SpawnLoc, this.Map);
|
||||
boss.SpawnHelpers();
|
||||
m_Boss = boss;
|
||||
|
||||
//create dummy spawn point and bounds for warp region
|
||||
m_WarpPoint = GetRandomWarpPoint();
|
||||
Rectangle2D bounds = GetRectangle(m_WarpPoint);
|
||||
|
||||
//create region based on dummy spot and bounds
|
||||
m_WarpRegion = new CorgulWarpRegion(this, bounds);
|
||||
m_WarpRegion.Register();
|
||||
m_Activated = true;
|
||||
}
|
||||
|
||||
private void GiveMap(Mobile from)
|
||||
{
|
||||
CorgulIslandMap map = new CorgulIslandMap(m_WarpPoint);
|
||||
from.AddToBackpack(map);
|
||||
|
||||
m_IslandMaps.Add(map);
|
||||
|
||||
from.SendLocalizedMessage(1116359); // The island's location has been marked on your map. You should make haste while the island is still afloat.
|
||||
}
|
||||
|
||||
public static Point3D GetRandomPoint(Rectangle2D rec, Map map)
|
||||
{
|
||||
int x = Utility.Random(rec.X, rec.Width);
|
||||
int y = Utility.Random(rec.Y, rec.Height);
|
||||
int z = map.GetAverageZ(x, y);
|
||||
|
||||
return new Point3D(x, y, z);
|
||||
}
|
||||
|
||||
public Rectangle2D GetRectangle(Point3D pnt)
|
||||
{
|
||||
return new Rectangle2D(pnt.X - (m_RegionSize / 2), pnt.Y - (m_RegionSize / 2), m_RegionSize, m_RegionSize);
|
||||
}
|
||||
|
||||
public CorgulAltar(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
|
||||
writer.Write(m_DeadLine);
|
||||
writer.Write(m_Boss);
|
||||
writer.Write(m_Activated);
|
||||
writer.Write(m_Active);
|
||||
writer.Write(m_WarpPoint);
|
||||
//writer.Write(m_IslandMap); Old version 0
|
||||
|
||||
writer.Write(m_IslandMaps.Count);
|
||||
foreach (Item item in m_IslandMaps)
|
||||
writer.Write(item);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_DeadLine = reader.ReadDateTime();
|
||||
m_Boss = reader.ReadMobile();
|
||||
m_Activated = reader.ReadBool();
|
||||
m_Active = reader.ReadBool();
|
||||
m_WarpPoint = reader.ReadPoint3D();
|
||||
|
||||
int count = reader.ReadInt();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Item map = reader.ReadItem();
|
||||
|
||||
if (map != null && !map.Deleted && map is CorgulIslandMap)
|
||||
m_IslandMaps.Add(map);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_DeadLine = reader.ReadDateTime();
|
||||
m_Boss = reader.ReadMobile();
|
||||
m_Activated = reader.ReadBool();
|
||||
m_Active = reader.ReadBool();
|
||||
m_WarpPoint = reader.ReadPoint3D();
|
||||
//m_IslandMap = reader.ReadItem() as CorgulIslandMap;
|
||||
Item item = reader.ReadItem();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
InitializeBossRegion();
|
||||
|
||||
if (m_Active && m_Activated && m_WarpPoint != Point3D.Zero)
|
||||
{
|
||||
if (m_DeadLine < DateTime.UtcNow || m_Boss == null || m_Boss.Deleted)
|
||||
Reset();
|
||||
else
|
||||
{
|
||||
Rectangle2D bounds = GetRectangle(m_WarpPoint);
|
||||
m_WarpRegion = new CorgulWarpRegion(this, bounds);
|
||||
m_WarpRegion.Register();
|
||||
TimeSpan ts = m_DeadLine - DateTime.UtcNow;
|
||||
m_DeadLineTimer = Timer.DelayCall(ts, new TimerCallback(OnDeadLine));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
275
Scripts/Services/Expansions/High Seas/Items/Fish/Bait.cs
Normal file
275
Scripts/Services/Expansions/High Seas/Items/Fish/Bait.cs
Normal file
@@ -0,0 +1,275 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Prompts;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Bait : Item
|
||||
{
|
||||
public static readonly bool UsePrompt = true;
|
||||
|
||||
private Type m_BaitType;
|
||||
private object m_Label;
|
||||
private int m_UsesRemaining;
|
||||
private int m_Index;
|
||||
private bool m_Enhanced;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Type BaitType { get { return m_BaitType; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int UsesRemaining { get { return m_UsesRemaining; } set { m_UsesRemaining = value; InvalidateProperties(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Index
|
||||
{
|
||||
get { return m_Index; }
|
||||
set
|
||||
{
|
||||
m_Index = value;
|
||||
|
||||
if (value < 0)
|
||||
m_Index = 0;
|
||||
if (value >= FishInfo.FishInfos.Count)
|
||||
m_Index = FishInfo.FishInfos.Count - 1;
|
||||
|
||||
m_BaitType = FishInfo.GetTypeFromIndex(m_Index);
|
||||
Hue = FishInfo.GetFishHue(m_Index);
|
||||
m_Label = FishInfo.GetFishLabel(m_Index);
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool Enhanced { get { return m_Enhanced; } set { m_Enhanced = value; InvalidateProperties(); } }
|
||||
|
||||
[Constructable]
|
||||
public Bait(int index) : base(2454)
|
||||
{
|
||||
Index = index;
|
||||
m_UsesRemaining = 1;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Bait() : base(2454)
|
||||
{
|
||||
m_UsesRemaining = 1;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
if (UsePrompt && m_UsesRemaining > 1)
|
||||
{
|
||||
from.SendMessage("How much bait would you like to use?");
|
||||
from.Prompt = new InternalPrompt(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.Target = new InternalTarget(this, 1);
|
||||
from.SendMessage("Target the fishing pole or lobster trap that you would like to apply the bait to.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TryBeginTarget(Mobile from, int amount)
|
||||
{
|
||||
if (amount < 0) amount = 1;
|
||||
if (amount > m_UsesRemaining) amount = m_UsesRemaining;
|
||||
|
||||
from.Target = new InternalTarget(this, amount);
|
||||
from.SendMessage("Target the fishing pole or lobster trap that you would like to apply the bait to.");
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
object label = FishInfo.GetFishLabel(m_Index);
|
||||
|
||||
if (m_Enhanced)
|
||||
{
|
||||
//~1_token~ ~2_token~ bait
|
||||
if (label is int)
|
||||
list.Add(1116464, "#{0}\t#{1}", 1116470, (int)label);
|
||||
else if (label is string)
|
||||
list.Add(1116464, "#{0}\t{1}", 1116470, (string)label);
|
||||
}
|
||||
else if (label is int)
|
||||
list.Add(1116465, String.Format("#{0}", (int)label)); //~1_token~ bait
|
||||
else if (label is string)
|
||||
list.Add(1116465, (string)label);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1116466, m_UsesRemaining.ToString()); //amount: ~1_val~
|
||||
}
|
||||
|
||||
private class InternalPrompt : Prompt
|
||||
{
|
||||
private Bait m_Bait;
|
||||
|
||||
public InternalPrompt(Bait bait)
|
||||
{
|
||||
m_Bait = bait;
|
||||
}
|
||||
|
||||
public override void OnResponse(Mobile from, string text)
|
||||
{
|
||||
int amount = Utility.ToInt32( text );
|
||||
m_Bait.TryBeginTarget(from, amount);
|
||||
}
|
||||
|
||||
public override void OnCancel(Mobile from)
|
||||
{
|
||||
from.SendMessage("Not applying bait...");
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private Bait m_Bait;
|
||||
private int m_Amount;
|
||||
|
||||
public InternalTarget(Bait bait, int amount)
|
||||
: base(0, false, TargetFlags.None)
|
||||
{
|
||||
m_Bait = bait;
|
||||
m_Amount = amount;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted == m_Bait)
|
||||
return;
|
||||
|
||||
if (targeted is FishingPole)
|
||||
{
|
||||
if (!m_Bait.IsFishBait())
|
||||
{
|
||||
from.SendMessage("Think again before applying lobster or crab bait to a fishing pole!");
|
||||
return;
|
||||
}
|
||||
|
||||
FishingPole pole = (FishingPole)targeted;
|
||||
|
||||
bool hasBait = pole.BaitType != null;
|
||||
|
||||
if (hasBait && pole.BaitType != m_Bait.BaitType)
|
||||
from.SendMessage("You swap out the old bait for new.");
|
||||
|
||||
if (pole.BaitType == m_Bait.BaitType)
|
||||
pole.BaitUses += m_Amount;
|
||||
else
|
||||
{
|
||||
pole.BaitType = m_Bait.BaitType;
|
||||
pole.BaitUses += m_Amount;
|
||||
}
|
||||
|
||||
if (m_Bait.Enhanced)
|
||||
pole.EnhancedBait = true;
|
||||
|
||||
from.SendLocalizedMessage(1149759); //You bait the hook.
|
||||
m_Bait.UsesRemaining -= m_Amount;
|
||||
}
|
||||
else if (targeted is LobsterTrap)
|
||||
{
|
||||
if (m_Bait.IsFishBait())
|
||||
{
|
||||
from.SendMessage("Think again before applying fish bait to a lobster trap!");
|
||||
return;
|
||||
}
|
||||
|
||||
LobsterTrap trap = (LobsterTrap)targeted;
|
||||
|
||||
bool hasBait = trap.BaitType != null;
|
||||
|
||||
trap.BaitType = m_Bait.BaitType;
|
||||
//trap.Hue = m_Bait.Hue;
|
||||
|
||||
if (hasBait && trap.BaitType != m_Bait.BaitType)
|
||||
from.SendMessage("You swap out the old bait for new.");
|
||||
|
||||
if (trap.BaitType == m_Bait.BaitType)
|
||||
trap.BaitUses += m_Amount;
|
||||
else
|
||||
{
|
||||
trap.BaitType = m_Bait.BaitType;
|
||||
trap.BaitUses += m_Amount;
|
||||
}
|
||||
|
||||
if (m_Bait.Enhanced)
|
||||
trap.EnhancedBait = true;
|
||||
|
||||
from.SendLocalizedMessage(1149760); //You bait the trap.
|
||||
m_Bait.UsesRemaining -= m_Amount;
|
||||
}
|
||||
else if (targeted is Bait && ((Bait)targeted).IsChildOf(from.Backpack) && ((Bait)targeted).BaitType == m_Bait.BaitType)
|
||||
{
|
||||
Bait bait = (Bait)targeted;
|
||||
|
||||
bait.UsesRemaining += m_Amount;
|
||||
m_Bait.UsesRemaining -= m_Amount;
|
||||
|
||||
if (m_Bait.UsesRemaining <= 0)
|
||||
{
|
||||
m_Bait.Delete();
|
||||
from.SendLocalizedMessage(1116469); //You combine these baits into one cup and destroy the other cup.
|
||||
}
|
||||
else
|
||||
from.SendMessage("You combine these baits into one cup.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_Bait.UsesRemaining <= 0)
|
||||
{
|
||||
m_Bait.Delete();
|
||||
from.SendLocalizedMessage(1116467); //Your bait is used up so you destroy the container.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsFishBait()
|
||||
{
|
||||
if (m_BaitType == null)
|
||||
Index = Utility.RandomMinMax(0, 34);
|
||||
|
||||
return !m_BaitType.IsSubclassOf(typeof(BaseCrabAndLobster));
|
||||
}
|
||||
|
||||
public Bait(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write(m_UsesRemaining);
|
||||
writer.Write(m_Index);
|
||||
writer.Write(m_Enhanced);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
m_Index = reader.ReadInt();
|
||||
m_Enhanced = reader.ReadBool();
|
||||
|
||||
if (m_Index < 0)
|
||||
m_Index = 0;
|
||||
if (m_Index >= FishInfo.FishInfos.Count)
|
||||
m_Index = FishInfo.FishInfos.Count - 1;
|
||||
|
||||
m_BaitType = FishInfo.FishInfos[m_Index].Type;
|
||||
//Hue = FishInfo.FishInfos[m_Index].Hue;
|
||||
m_Label = FishInfo.GetFishLabel(m_Index);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,703 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Misc;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BaseCrabAndLobster : BaseHighseasFish
|
||||
{
|
||||
public override Item GetCarved { get { return null; } }
|
||||
public override int GetCarvedAmount { get { return 1; } }
|
||||
public override double DefaultWeight { get { return 2.0; } }
|
||||
|
||||
public BaseCrabAndLobster(int itemID) : base(itemID)
|
||||
{
|
||||
}
|
||||
|
||||
public BaseCrabAndLobster(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class RareCrabAndLobster : BaseCrabAndLobster
|
||||
{
|
||||
private Mobile m_CaughtBy;
|
||||
private DateTime m_DateCaught;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Fisher { get { return m_CaughtBy; } set { m_CaughtBy = value; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DateTime DateCaught { get { return m_DateCaught; } set { m_DateCaught = value; } }
|
||||
|
||||
public RareCrabAndLobster(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
}
|
||||
|
||||
public RareCrabAndLobster(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
writer.Write(m_CaughtBy);
|
||||
writer.Write(m_DateCaught);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
m_CaughtBy = reader.ReadMobile();
|
||||
m_DateCaught = reader.ReadDateTime();
|
||||
}
|
||||
}
|
||||
|
||||
public class Crab : BaseCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1096489; } }
|
||||
|
||||
[Constructable]
|
||||
public Crab()
|
||||
: base(BaseHighseasFish.GetCrabID())
|
||||
{
|
||||
}
|
||||
|
||||
public Crab(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class Lobster : BaseCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1096491; } }
|
||||
|
||||
[Constructable]
|
||||
public Lobster()
|
||||
: base(BaseHighseasFish.GetLobsterID())
|
||||
{
|
||||
}
|
||||
|
||||
public Lobster(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class AppleCrab : BaseCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116378; } }
|
||||
|
||||
[Constructable]
|
||||
public AppleCrab() : base (BaseHighseasFish.GetCrabID())
|
||||
{
|
||||
}
|
||||
|
||||
public AppleCrab(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BlueCrab : BaseCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116374; } }
|
||||
|
||||
[Constructable]
|
||||
public BlueCrab()
|
||||
: base(BaseHighseasFish.GetCrabID())
|
||||
{
|
||||
}
|
||||
|
||||
public BlueCrab(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class DungeonessCrab : BaseCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116373; } }
|
||||
|
||||
[Constructable]
|
||||
public DungeonessCrab()
|
||||
: base(BaseHighseasFish.GetCrabID())
|
||||
{
|
||||
}
|
||||
|
||||
public DungeonessCrab(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class KingCrab : BaseCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116375; } }
|
||||
|
||||
[Constructable]
|
||||
public KingCrab()
|
||||
: base(BaseHighseasFish.GetCrabID())
|
||||
{
|
||||
}
|
||||
|
||||
public KingCrab(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class RockCrab : BaseCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116376; } }
|
||||
|
||||
[Constructable]
|
||||
public RockCrab()
|
||||
: base(BaseHighseasFish.GetCrabID())
|
||||
{
|
||||
}
|
||||
|
||||
public RockCrab(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SnowCrab : BaseCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116377; } }
|
||||
|
||||
[Constructable]
|
||||
public SnowCrab()
|
||||
: base(BaseHighseasFish.GetCrabID())
|
||||
{
|
||||
}
|
||||
|
||||
public SnowCrab(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class StoneCrab : RareCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116334; } }
|
||||
public override Item GetCarved { get { return new StoneCrabMeat(); } }
|
||||
|
||||
[Constructable]
|
||||
public StoneCrab()
|
||||
: base(BaseHighseasFish.GetCrabID())
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(StoneCrab));
|
||||
}
|
||||
|
||||
public StoneCrab(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SpiderCrab : RareCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116336; } }
|
||||
public override Item GetCarved { get { return new SpiderCrabMeat(); } }
|
||||
|
||||
[Constructable]
|
||||
public SpiderCrab()
|
||||
: base(BaseHighseasFish.GetCrabID())
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(SpiderCrab));
|
||||
}
|
||||
|
||||
public SpiderCrab(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class TunnelCrab : RareCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116372; } }
|
||||
|
||||
[Constructable]
|
||||
public TunnelCrab()
|
||||
: base(BaseHighseasFish.GetCrabID())
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(TunnelCrab));
|
||||
}
|
||||
|
||||
public TunnelCrab(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class VoidCrab : RareCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116368; } }
|
||||
|
||||
[Constructable]
|
||||
public VoidCrab()
|
||||
: base(BaseHighseasFish.GetCrabID())
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(VoidCrab));
|
||||
}
|
||||
public VoidCrab(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class CrustyLobster : BaseCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116383; } }
|
||||
|
||||
[Constructable]
|
||||
public CrustyLobster()
|
||||
: base(BaseHighseasFish.GetLobsterID())
|
||||
{
|
||||
}
|
||||
|
||||
public CrustyLobster(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class FredLobster : BaseCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116382; } }
|
||||
|
||||
[Constructable]
|
||||
public FredLobster()
|
||||
: base(BaseHighseasFish.GetLobsterID())
|
||||
{
|
||||
}
|
||||
|
||||
public FredLobster(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class HummerLobster : BaseCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116381; } }
|
||||
|
||||
[Constructable]
|
||||
public HummerLobster()
|
||||
: base(BaseHighseasFish.GetLobsterID())
|
||||
{
|
||||
}
|
||||
|
||||
public HummerLobster(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class RockLobster : BaseCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116380; } }
|
||||
|
||||
[Constructable]
|
||||
public RockLobster()
|
||||
: base(BaseHighseasFish.GetLobsterID())
|
||||
{
|
||||
}
|
||||
|
||||
public RockLobster(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class ShovelNoseLobster : BaseCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116384; } }
|
||||
|
||||
[Constructable]
|
||||
public ShovelNoseLobster()
|
||||
: base(BaseHighseasFish.GetLobsterID())
|
||||
{
|
||||
}
|
||||
|
||||
public ShovelNoseLobster(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SpineyLobster : BaseCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116379; } }
|
||||
|
||||
[Constructable]
|
||||
public SpineyLobster()
|
||||
: base(BaseHighseasFish.GetLobsterID())
|
||||
{
|
||||
}
|
||||
|
||||
public SpineyLobster(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BlueLobster : RareCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116366; } }
|
||||
public override Item GetCarved { get { return new BlueLobsterMeat(); } }
|
||||
|
||||
[Constructable]
|
||||
public BlueLobster()
|
||||
: base(BaseHighseasFish.GetLobsterID())
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(BlueLobster));
|
||||
}
|
||||
|
||||
public BlueLobster(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BloodLobster : RareCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116370; } }
|
||||
|
||||
[Constructable]
|
||||
public BloodLobster()
|
||||
: base(BaseHighseasFish.GetLobsterID())
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(BloodLobster));
|
||||
}
|
||||
|
||||
public BloodLobster(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class DreadLobster : RareCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116371; } }
|
||||
|
||||
[Constructable]
|
||||
public DreadLobster()
|
||||
: base(BaseHighseasFish.GetLobsterID())
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(DreadLobster));
|
||||
}
|
||||
|
||||
public DreadLobster(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class VoidLobster : RareCrabAndLobster
|
||||
{
|
||||
public override int LabelNumber { get { return 1116369; } }
|
||||
|
||||
[Constructable]
|
||||
public VoidLobster()
|
||||
: base(BaseHighseasFish.GetLobsterID())
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(VoidLobster));
|
||||
}
|
||||
|
||||
public VoidLobster(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class StoneCrabMeat : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1116317; } }
|
||||
|
||||
[Constructable]
|
||||
public StoneCrabMeat() : base(4159)
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(StoneCrab));
|
||||
}
|
||||
|
||||
public StoneCrabMeat(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SpiderCrabMeat : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1116320; } }
|
||||
|
||||
[Constructable]
|
||||
public SpiderCrabMeat()
|
||||
: base(4159)
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(SpiderCrab));
|
||||
}
|
||||
|
||||
public SpiderCrabMeat(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BlueLobsterMeat : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1116318; } }
|
||||
|
||||
[Constructable]
|
||||
public BlueLobsterMeat()
|
||||
: base(4159)
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(BlueLobster));
|
||||
}
|
||||
|
||||
public BlueLobsterMeat(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
1176
Scripts/Services/Expansions/High Seas/Items/Fish/Fish.cs
Normal file
1176
Scripts/Services/Expansions/High Seas/Items/Fish/Fish.cs
Normal file
File diff suppressed because it is too large
Load Diff
449
Scripts/Services/Expansions/High Seas/Items/Fish/FishInfo.cs
Normal file
449
Scripts/Services/Expansions/High Seas/Items/Fish/FishInfo.cs
Normal file
@@ -0,0 +1,449 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Server;
|
||||
using Server.Multis;
|
||||
using Server.Regions;
|
||||
using Server.Mobiles;
|
||||
using Server.Engines.Quests;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FishInfo
|
||||
{
|
||||
public static void Configure()
|
||||
{
|
||||
//Rare Fish; 0 - 15
|
||||
m_FishInfos.Add(new FishInfo(2506, typeof(AutumnDragonfish), 1116090, "Ilshenar", false, RareChance, 105.4));//Confirmed
|
||||
m_FishInfos.Add(new FishInfo(2591, typeof(BlueLobster), 1116366, "Ice", false, RareChance, 103.1)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(1157, typeof(BullFish), 1116095, "Labyrinth", false, RareChance, 105.4)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(1167, typeof(CrystalFish), 1116092, "Prism of Light", false, RareChance, 105.4)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(2578, typeof(FairySalmon), 1116089, "TerMur", false, RareChance, 85.8)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(1461, typeof(FireFish), 1116093, "Shame", false, RareChance, 95.8)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(1257, typeof(GiantKoi), 1116088, "Tokuno", true, RareChance, 95.8)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(2579/*1287*/, typeof(GreatBarracuda),1116100, "Felucca", true, RareChance, 89.0)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(2959, typeof(HolyMackerel), 1116087, "Gravewater Lake", false, RareChance, 102.9)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(2075, typeof(LavaFish), 1116096, "Abyss", false, RareChance, 110.0)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(2075/*1152*/, typeof(ReaperFish), 1116094, "Doom", false, RareChance, 98.1)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(2539, typeof(SpiderCrab), 1116367, "Terathan Keep", false, RareChance, 103.1)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(2558, typeof(StoneCrab), 1116365, "T2A", true, RareChance, 103.1)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(43, typeof(SummerDragonfish), 1116091, "Destard", false, RareChance, 105.2)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(1154, typeof(UnicornFish), 1116086, "Twisted Weald", false, RareChance, 110.0)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(2515, typeof(YellowtailBarracuda), 1116098, "Trammel", true, RareChance, 81.9));//Confirmed
|
||||
|
||||
//Legendary Fish ; 16-34
|
||||
m_FishInfos.Add(new FishInfo(2406, typeof(AbyssalDragonfish), 1116118, "Destard", false, LegendaryChance, 120.0)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(2500, typeof(BlackMarlin), 1116099, "Felucca", true, LegendaryChance, 110.1)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(2117, typeof(BloodLobster), 1116370, "Shame", false, LegendaryChance, 115.1)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(0, typeof(BlueMarlin), 1116097, "Trammel", true, LegendaryChance, 105.0)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(1777, typeof(DreadLobster), 1116371, "Doom", false, LegendaryChance, 115.1));
|
||||
m_FishInfos.Add(new FishInfo(1158, typeof(DungeonPike), 1116107, "Terathan Keep", false, LegendaryChance, 105.1)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(2576, typeof(GiantSamuraiFish), 1116103, "Tokuno", true, LegendaryChance, 110.1)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(1281, typeof(GoldenTuna), 1116102, "Tokuno", true, LegendaryChance, 105.0)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(2604, typeof(Kingfish), 1116085, "TrammelAndFelucca", true, LegendaryChance, 92.2)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(1463, typeof(LanternFish), 1116106, "Prism of Light", false, LegendaryChance, 105.1)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(1283, typeof(RainbowFish), 1116108, "Twisted Weald", false, LegendaryChance, 105.1));
|
||||
m_FishInfos.Add(new FishInfo(2076, typeof(SeekerFish), 1116109, "Labyrinth", false, LegendaryChance, 105.1));
|
||||
m_FishInfos.Add(new FishInfo(0, typeof(SpringDragonfish), 1116104, "Ilshenar", false, LegendaryChance, 120.0)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(1837, typeof(StoneFish), 1116110, "T2A", true, LegendaryChance, 115.1)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(2600, typeof(TunnelCrab), 1116372, "Underworld", false, LegendaryChance, 115.1)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(2069, typeof(VoidCrab), 1116368, "TerMur", false, LegendaryChance, 120.0)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(2071, typeof(VoidLobster), 1116369, "Abyss", false, LegendaryChance, 120.0));
|
||||
m_FishInfos.Add(new FishInfo(2499, typeof(WinterDragonfish), 1116105, "Ice", false, LegendaryChance, 120.0)); //Confirmed
|
||||
m_FishInfos.Add(new FishInfo(2551, typeof(ZombieFish), 1116101, "Gravewater Lake", false, LegendaryChance, 115.1)); //Confirmed
|
||||
|
||||
//Cannot fish up but used for bait
|
||||
m_FishInfos.Add(new FishInfo(1170, typeof(Charydbis), 1150208, "cannotfishup", true, LegendaryChance, 120.0));
|
||||
|
||||
m_InvalidatedLocations = false;
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(10), new TimerCallback(InvalidateLocations));
|
||||
}
|
||||
|
||||
public static List<FishInfo> FishInfos { get { return m_FishInfos; } }
|
||||
private static List<FishInfo> m_FishInfos = new List<FishInfo>();
|
||||
|
||||
private int m_Hue;
|
||||
private Type m_Type;
|
||||
private object m_Label;
|
||||
private object m_Location;
|
||||
private bool m_RequiresDeepWater;
|
||||
private double m_BaseChance;
|
||||
private double m_MinSkill;
|
||||
|
||||
public int Hue { get { return m_Hue; } }
|
||||
public Type Type { get { return m_Type; } }
|
||||
public object LabelNumber { get { return m_Label; } }
|
||||
public object Location { get { return m_Location; } set { m_Location = value; } }
|
||||
public bool RequiresDeepWater { get { return m_RequiresDeepWater; } }
|
||||
public double BaseChance { get { return m_BaseChance; } }
|
||||
public double MinSkill { get { return m_MinSkill; } }
|
||||
|
||||
public static readonly double RareChance = 0.0075;
|
||||
public static readonly double LegendaryChance = 0.001;
|
||||
|
||||
public static bool m_InvalidatedLocations;
|
||||
|
||||
public FishInfo(int hue, Type type, object label, object found, bool deepwater, double basechance, double minskill)
|
||||
{
|
||||
m_Hue = hue;
|
||||
m_Type = type;
|
||||
m_Label = label;
|
||||
m_Location = found;
|
||||
m_RequiresDeepWater = deepwater;
|
||||
m_BaseChance = basechance;
|
||||
m_MinSkill = minskill;
|
||||
}
|
||||
|
||||
public static void InvalidateLocations()
|
||||
{
|
||||
if (m_InvalidatedLocations)
|
||||
return;
|
||||
|
||||
int c = 0;
|
||||
|
||||
foreach (FishInfo info in m_FishInfos)
|
||||
{
|
||||
if (info.Location is string)
|
||||
{
|
||||
string str = info.Location as string;
|
||||
|
||||
if (str == "Trammel")
|
||||
{
|
||||
info.Location = Map.Trammel;
|
||||
c++;
|
||||
}
|
||||
else if (str == "Felucca")
|
||||
{
|
||||
info.Location = Map.Felucca;
|
||||
c++;
|
||||
}
|
||||
else if (str == "Tokuno")
|
||||
{
|
||||
info.Location = Map.Tokuno;
|
||||
c++;
|
||||
}
|
||||
else if (str == "Ilshenar")
|
||||
{
|
||||
info.Location = Map.Ilshenar;
|
||||
c++;
|
||||
}
|
||||
else if (str == "Malas")
|
||||
{
|
||||
info.Location = Map.Malas;
|
||||
c++;
|
||||
}
|
||||
else if (str == "TerMur")
|
||||
{
|
||||
info.Location = Map.TerMur;
|
||||
c++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_InvalidatedLocations = true;
|
||||
//Console.WriteLine("Invalidated {0} Map Locations in FishInfo.cs", c.ToString());
|
||||
}
|
||||
|
||||
public static bool IsRareFish(Type type)
|
||||
{
|
||||
return m_FishInfos.Any(info => info.Type == type);
|
||||
}
|
||||
|
||||
public static FishInfo GetInfo(Type type)
|
||||
{
|
||||
return m_FishInfos.FirstOrDefault(info => info.Type == type);
|
||||
}
|
||||
|
||||
public static FishInfo GetInfo(int hue)
|
||||
{
|
||||
return m_FishInfos.FirstOrDefault(info => info.Hue == hue);
|
||||
}
|
||||
|
||||
public static int GetIndexFromType(Type type)
|
||||
{
|
||||
if(type == null)
|
||||
return -1;
|
||||
|
||||
for(int i = 0; i < m_FishInfos.Count; i++)
|
||||
if(m_FishInfos[i].Type == type)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static Type GetTypeFromIndex(int index)
|
||||
{
|
||||
if(index < 0 || index >= m_FishInfos.Count)
|
||||
return m_FishInfos[0].Type;
|
||||
|
||||
return m_FishInfos[index].Type;
|
||||
}
|
||||
|
||||
public static int GetFishHue(int index)
|
||||
{
|
||||
if (index < 0 || index >= m_FishInfos.Count)
|
||||
return 0;
|
||||
|
||||
return m_FishInfos[index].Hue;
|
||||
}
|
||||
|
||||
public static int GetFishHue(Type type)
|
||||
{
|
||||
foreach (FishInfo info in m_FishInfos)
|
||||
if (info.Type == type)
|
||||
return info.Hue;
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static object GetFishLabel(int index)
|
||||
{
|
||||
if (index < 0 || index >= m_FishInfos.Count)
|
||||
return 0;
|
||||
|
||||
return m_FishInfos[index].LabelNumber;
|
||||
}
|
||||
|
||||
public static object GetFishLabel(Type type)
|
||||
{
|
||||
foreach (FishInfo info in FishInfos)
|
||||
{
|
||||
if (info.Type == type)
|
||||
return info.LabelNumber;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static string GetFishLocation(Type type)
|
||||
{
|
||||
foreach (FishInfo info in FishInfos)
|
||||
{
|
||||
if (info.Type == type)
|
||||
return info.Location.ToString();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Type GetSpecialItem(Mobile from, Item harvestItem, Point3D pnt, bool rareOnly)
|
||||
{
|
||||
return GetSpecialItem(from, harvestItem, pnt, 0, rareOnly);
|
||||
}
|
||||
|
||||
public static Type GetSpecialItem(Mobile from, Item harvestItem, Point3D pnt, double bump, bool rareOnly)
|
||||
{
|
||||
InvalidateLocations();
|
||||
|
||||
Map map = from.Map;
|
||||
Point3D fromLoc = from.Location;
|
||||
|
||||
Region reg = from.Region;
|
||||
|
||||
if (reg.Parent != null)
|
||||
reg = reg.Parent;
|
||||
|
||||
double skill = from.Skills[SkillName.Fishing].Value;
|
||||
bool fishing = harvestItem is FishingPole;
|
||||
|
||||
Type bait = null;
|
||||
Type item = null;
|
||||
bool enhanced = false;
|
||||
|
||||
if (harvestItem is FishingPole)
|
||||
{
|
||||
bait = ((FishingPole)harvestItem).BaitType;
|
||||
enhanced = ((FishingPole)harvestItem).EnhancedBait;
|
||||
}
|
||||
else if (harvestItem is LobsterTrap)
|
||||
{
|
||||
bait = ((LobsterTrap)harvestItem).BaitType;
|
||||
enhanced = ((LobsterTrap)harvestItem).EnhancedBait;
|
||||
}
|
||||
|
||||
//insertion of baited type first to increase chances of fishing it up!
|
||||
List<FishInfo> infos = new List<FishInfo>(m_FishInfos);
|
||||
|
||||
if (bait != null)
|
||||
{
|
||||
for (int i = 0; i < infos.Count; i++)
|
||||
{
|
||||
FishInfo info = infos[i];
|
||||
if (info.Type == bait)
|
||||
{
|
||||
infos.Remove(info);
|
||||
infos.Insert(0, info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < infos.Count; i++)
|
||||
{
|
||||
FishInfo info = infos[i];
|
||||
|
||||
double baitStr = info.GetBaitStrength(bait, from, enhanced);
|
||||
|
||||
if ((info.RequiresDeepWater && !IsDeepWater(pnt, map, reg)) || skill < info.MinSkill)
|
||||
continue;
|
||||
|
||||
if (fishing && info.Type.IsSubclassOf(typeof(BaseCrabAndLobster)))
|
||||
continue;
|
||||
|
||||
if (!fishing && !info.Type.IsSubclassOf(typeof(BaseCrabAndLobster)))
|
||||
continue;
|
||||
|
||||
if (info.Location is string)
|
||||
{
|
||||
string loc = (string)info.Location;
|
||||
|
||||
if (loc.ToLower() == "cannotfishup")
|
||||
continue;
|
||||
|
||||
if (loc.ToLower() == "t2a" && Server.Spells.SpellHelper.IsAnyT2A(map, fromLoc) && info.Roll(from, baitStr, bump))
|
||||
item = info.Type;
|
||||
|
||||
if (loc.ToLower() == "trammelandfelucca" && (map == Map.Trammel || map == Map.Felucca) && !Server.Spells.SpellHelper.IsAnyT2A(map, fromLoc) && info.Roll(from, baitStr, bump))
|
||||
item = info.Type;
|
||||
|
||||
if (loc.ToLower() == "fire island" && IsFireIsland(fromLoc, map) && info.Roll(from, baitStr, bump))
|
||||
item = info.Type;
|
||||
|
||||
if (loc.ToLower() == "gravewater lake" && IsGravewaterLake(fromLoc, map))
|
||||
item = info.Type;
|
||||
|
||||
if (from.Region != null && from.Region.IsPartOf(loc) && info.Roll(from, baitStr, bump))
|
||||
item = info.Type;
|
||||
|
||||
}
|
||||
else if (info.Location is Map)
|
||||
{
|
||||
Map locMap = (Map)info.Location;
|
||||
|
||||
if (map == locMap && info.Roll(from, baitStr, bump))
|
||||
item = info.Type;
|
||||
}
|
||||
}
|
||||
|
||||
ColUtility.Free(infos);
|
||||
|
||||
if (!rareOnly && item == null && from is PlayerMobile)
|
||||
{
|
||||
double chance = skill / 121.5;
|
||||
|
||||
bool dungeon = IsDungeon(pnt, map, reg);
|
||||
bool shore = IsShore(pnt, map, reg);
|
||||
bool deep = IsDeepWater(pnt, map, reg);
|
||||
|
||||
if (fishing && chance >= Utility.RandomDouble())
|
||||
{
|
||||
if (dungeon && skill >= 106.0)
|
||||
item = BaseHighseasFish.DungeonFish[Utility.Random(BaseHighseasFish.DungeonFish.Length)];
|
||||
else if (deep && skill >= 80.0)
|
||||
item = BaseHighseasFish.DeepWaterFish[Utility.Random(BaseHighseasFish.DeepWaterFish.Length)];
|
||||
else if(shore && skill >= 50.0)
|
||||
item = BaseHighseasFish.ShoreFish[Utility.Random(BaseHighseasFish.ShoreFish.Length)];
|
||||
}
|
||||
else if (skill >= 50.0 && !fishing && chance >= Utility.RandomDouble())
|
||||
{
|
||||
item = BaseHighseasFish.LobstersAndCrabs[Utility.Random(BaseHighseasFish.LobstersAndCrabs.Length)];
|
||||
}
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
public double GetBaitStrength(Type baitType, Mobile from, bool enhanced)
|
||||
{
|
||||
if (baitType != this.Type)
|
||||
return 1.0;
|
||||
|
||||
double str = enhanced ? 3.0 : 2.0;
|
||||
|
||||
for (int i = 0; i < from.Items.Count; i++)
|
||||
{
|
||||
Item item = from.Items[i];
|
||||
if (item is IFishingAttire)
|
||||
{
|
||||
if (item is ISetItem)
|
||||
{
|
||||
if (((ISetItem)item).SetEquipped)
|
||||
{
|
||||
str += ((double)((IFishingAttire)item).SetBonus / 100) / (double)((ISetItem)item).Pieces;
|
||||
}
|
||||
else
|
||||
{
|
||||
str += (double)((IFishingAttire)item).BaitBonus / 100;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
str += (double)((IFishingAttire)item).BaitBonus / 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
public bool Roll(Mobile from, double baitStr, double bump)
|
||||
{
|
||||
double baseChance = MagicalFishFinder.HasSchool(from) ? BaseChance * 10 : BaseChance;
|
||||
|
||||
return (baseChance + bump) * baitStr > Utility.RandomDouble();
|
||||
}
|
||||
|
||||
public static bool IsDeepWater(Point3D pnt, Map map, Region region)
|
||||
{
|
||||
return SpecialFishingNet.FullValidation(map, pnt.X, pnt.Y) && !IsDungeon(pnt, map, region);
|
||||
}
|
||||
|
||||
public static bool IsShore(Point3D pnt, Map map, Region region)
|
||||
{
|
||||
return !IsDeepWater(pnt, map, region) && !IsDungeon(pnt, map, region);
|
||||
}
|
||||
|
||||
public static bool IsDungeon(Point3D pnt, Map map, Region region)
|
||||
{
|
||||
return region.IsPartOf<DungeonRegion>() || IsMondainDungeon(region) || Server.Spells.SpellHelper.IsTrammelWind(map, pnt) || Server.Spells.SpellHelper.IsFeluccaWind(map, pnt);
|
||||
}
|
||||
|
||||
public static bool IsMondainDungeon(Region region)
|
||||
{
|
||||
if (region.IsPartOf("Twisted Weald"))
|
||||
return true;
|
||||
if (region.IsPartOf("Sanctuary"))
|
||||
return true;
|
||||
if (region.IsPartOf("Prism of Light"))
|
||||
return true;
|
||||
if (region.IsPartOf("Citadel"))
|
||||
return true;
|
||||
if (region.IsPartOf("Bedlam"))
|
||||
return true;
|
||||
if (region.IsPartOf("Blighted Grove"))
|
||||
return true;
|
||||
if (region.IsPartOf("Painted Caves"))
|
||||
return true;
|
||||
if (region.IsPartOf("Palace of Paroxysmus"))
|
||||
return true;
|
||||
if (region.IsPartOf("Labyrinth"))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool IsFireIsland(Point3D p, Map map)
|
||||
{
|
||||
return (map == Map.Felucca || map == Map.Trammel) && (p.X > 4559 && p.X < 4636 && p.Y > 3548 && p.Y < 3627
|
||||
|| p.X > 4465 && p.X < 4493 && p.Y > 4479 && p.Y < 3746);
|
||||
}
|
||||
|
||||
public static bool IsGravewaterLake(Point3D p, Map map)
|
||||
{
|
||||
return map == Map.Malas && ((p.X >= 1440 && p.X <= 1863 && p.Y >= 1527 && p.Y <= 1746) || (p.X >= 1381 && p.X <= 1596 && p.Y >= 1565 && p.Y <= 1789));
|
||||
}
|
||||
|
||||
public static Type[] SOSArtifacts { get { return m_SOSArtifacts; } }
|
||||
private static Type[] m_SOSArtifacts = new Type[]
|
||||
{
|
||||
typeof(AntiqueWeddingDress), typeof(GrapeVine),
|
||||
typeof(KelpWovenLeggings), typeof(LargeFishingNet),
|
||||
typeof(RunedDriftwoodBow), typeof(ValkyrieArmor)
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
690
Scripts/Services/Expansions/High Seas/Items/Fish/FishPies.cs
Normal file
690
Scripts/Services/Expansions/High Seas/Items/Fish/FishPies.cs
Normal file
@@ -0,0 +1,690 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Engines.Craft;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum FishPieEffect
|
||||
{
|
||||
None,
|
||||
MedBoost,
|
||||
FocusBoost,
|
||||
ColdSoak,
|
||||
EnergySoak,
|
||||
FireSoak,
|
||||
PoisonSoak,
|
||||
PhysicalSoak,
|
||||
WeaponDam,
|
||||
HitChance,
|
||||
DefChance,
|
||||
SpellDamage,
|
||||
ManaRegen,
|
||||
HitsRegen,
|
||||
StamRegen,
|
||||
SoulCharge,
|
||||
CastFocus,
|
||||
}
|
||||
|
||||
public class BaseFishPie : Item, IQuality
|
||||
{
|
||||
private ItemQuality _Quality;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ItemQuality Quality { get { return _Quality; } set { _Quality = value; InvalidateProperties(); } }
|
||||
|
||||
public bool PlayerConstructed { get { return true; } }
|
||||
|
||||
public virtual TimeSpan Duration { get { return TimeSpan.FromMinutes(5); } }
|
||||
public virtual int BuffName { get { return 0; } }
|
||||
public virtual int BuffAmount { get { return 0; } }
|
||||
public virtual FishPieEffect Effect { get { return FishPieEffect.None; } }
|
||||
|
||||
public static Dictionary<Mobile, List<FishPieEffect>> m_EffectsList = new Dictionary<Mobile, List<FishPieEffect>>();
|
||||
|
||||
public BaseFishPie() : base(4161)
|
||||
{
|
||||
Stackable = true;
|
||||
}
|
||||
|
||||
public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
|
||||
{
|
||||
Quality = (ItemQuality)quality;
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
||||
public static bool IsUnderEffects(Mobile from, FishPieEffect type)
|
||||
{
|
||||
if (!m_EffectsList.ContainsKey(from) || m_EffectsList[from] == null)
|
||||
return false;
|
||||
|
||||
return m_EffectsList[from].Contains(type);
|
||||
}
|
||||
|
||||
public static bool TryAddBuff(Mobile from, FishPieEffect type)
|
||||
{
|
||||
if (IsUnderEffects(from, type))
|
||||
return false;
|
||||
|
||||
if (!m_EffectsList.ContainsKey(from))
|
||||
m_EffectsList.Add(from, new List<FishPieEffect>());
|
||||
|
||||
m_EffectsList[from].Add(type);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void RemoveBuff(Mobile from, FishPieEffect type)
|
||||
{
|
||||
if(!m_EffectsList.ContainsKey(from))
|
||||
return;
|
||||
|
||||
if (m_EffectsList[from] != null && m_EffectsList[from].Contains(type))
|
||||
m_EffectsList[from].Remove(type);
|
||||
|
||||
if (m_EffectsList[from] == null || m_EffectsList[from].Count == 0)
|
||||
m_EffectsList.Remove(from);
|
||||
|
||||
BuffInfo.RemoveBuff(from, BuffIcon.FishPie);
|
||||
from.Delta(MobileDelta.WeaponDamage);
|
||||
}
|
||||
|
||||
public static void ScaleDamage(Mobile from, Mobile to, ref int totalDamage, int phys, int fire, int cold, int pois, int nrgy, int direct)
|
||||
{
|
||||
if (Core.EJ && from is PlayerMobile && to is PlayerMobile)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsUnderEffects(to, FishPieEffect.PhysicalSoak) && phys > 0)
|
||||
totalDamage -= (int)Math.Min(5.0, totalDamage * ((double)phys / 100.0));
|
||||
|
||||
if (IsUnderEffects(to, FishPieEffect.FireSoak) && fire > 0)
|
||||
totalDamage -= (int)Math.Min(5.0, totalDamage * ((double)fire / 100.0));
|
||||
|
||||
if (IsUnderEffects(to, FishPieEffect.ColdSoak) && cold > 0)
|
||||
totalDamage -= (int)Math.Min(5.0, totalDamage * ((double)cold / 100.0));
|
||||
|
||||
if (IsUnderEffects(to, FishPieEffect.PoisonSoak) && pois > 0)
|
||||
totalDamage -= (int)Math.Min(5.0, totalDamage * ((double)pois / 100.0));
|
||||
|
||||
if (IsUnderEffects(to, FishPieEffect.EnergySoak) && nrgy > 0)
|
||||
totalDamage -= (int)Math.Min(5.0, totalDamage * ((double)nrgy / 100.0));
|
||||
}
|
||||
|
||||
public virtual bool Apply(Mobile from)
|
||||
{
|
||||
if (TryAddBuff(from, Effect))
|
||||
{
|
||||
switch (Effect)
|
||||
{
|
||||
default:
|
||||
case FishPieEffect.None: break;
|
||||
case FishPieEffect.MedBoost:
|
||||
TimedSkillMod mod1 = new TimedSkillMod(SkillName.Meditation, true, 10.0, Duration);
|
||||
mod1.ObeyCap = true;
|
||||
from.AddSkillMod(mod1);
|
||||
break;
|
||||
case FishPieEffect.FocusBoost:
|
||||
TimedSkillMod mod2 = new TimedSkillMod(SkillName.Focus, true, 10.0, Duration);
|
||||
mod2.ObeyCap = true;
|
||||
from.AddSkillMod(mod2);
|
||||
break;
|
||||
case FishPieEffect.ColdSoak: break;
|
||||
case FishPieEffect.EnergySoak: break;
|
||||
case FishPieEffect.PoisonSoak: break;
|
||||
case FishPieEffect.FireSoak: break;
|
||||
case FishPieEffect.PhysicalSoak: break;
|
||||
case FishPieEffect.WeaponDam: break;
|
||||
case FishPieEffect.HitChance: break;
|
||||
case FishPieEffect.DefChance: break;
|
||||
case FishPieEffect.SpellDamage: break;
|
||||
case FishPieEffect.ManaRegen: break;
|
||||
case FishPieEffect.StamRegen: break;
|
||||
case FishPieEffect.HitsRegen: break;
|
||||
case FishPieEffect.SoulCharge: break;
|
||||
case FishPieEffect.CastFocus: break;
|
||||
}
|
||||
|
||||
if (Effect != FishPieEffect.None)
|
||||
{
|
||||
new InternalTimer(Duration, from, Effect);
|
||||
|
||||
BuffInfo.AddBuff(from, new BuffInfo(BuffIcon.FishPie, 1116340, LabelNumber));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(502173); // You are already under a similar effect.
|
||||
return false;
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_From;
|
||||
private FishPieEffect m_EffectType;
|
||||
|
||||
public InternalTimer(TimeSpan duration, Mobile from, FishPieEffect type) : base(duration)
|
||||
{
|
||||
m_From = from;
|
||||
m_EffectType = type;
|
||||
Start();
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
BaseFishPie.RemoveBuff(m_From, m_EffectType);
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddCraftedProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (_Quality == ItemQuality.Exceptional)
|
||||
{
|
||||
list.Add(1060636); // Exceptional
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(BuffName, BuffAmount.ToString());
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
else if (Apply(from))
|
||||
{
|
||||
from.FixedEffect(0x375A, 10, 15);
|
||||
from.PlaySound(0x1E7);
|
||||
from.SendLocalizedMessage(1116285, String.Format("#{0}", LabelNumber)); //You eat the ~1_val~. Mmm, tasty!
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public BaseFishPie(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((int)_Quality);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version > 0)
|
||||
_Quality = (ItemQuality)reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class AutumnDragonfishPie : BaseFishPie
|
||||
{
|
||||
public override int LabelNumber { get { return 1116224; } }
|
||||
public override int BuffName { get { return 1116280; } }
|
||||
public override int BuffAmount { get { return 10; } }
|
||||
public override FishPieEffect Effect { get { return FishPieEffect.MedBoost; } }
|
||||
|
||||
[Constructable]
|
||||
public AutumnDragonfishPie()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(AutumnDragonfish));
|
||||
}
|
||||
|
||||
public AutumnDragonfishPie(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class BullFishPie : BaseFishPie
|
||||
{
|
||||
public override int LabelNumber { get { return 1116220; } }
|
||||
public override int BuffName { get { return 1116276; } }
|
||||
public override int BuffAmount { get { return 5; } }
|
||||
public override FishPieEffect Effect { get { return FishPieEffect.WeaponDam; } }
|
||||
|
||||
[Constructable]
|
||||
public BullFishPie()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(BullFish));
|
||||
}
|
||||
|
||||
public BullFishPie(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class CrystalFishPie : BaseFishPie
|
||||
{
|
||||
public override int LabelNumber { get { return 1116219; } }
|
||||
public override int BuffName { get { return 1116275; } }
|
||||
public override int BuffAmount { get { return 5; } }
|
||||
public override FishPieEffect Effect { get { return FishPieEffect.EnergySoak; } }
|
||||
|
||||
[Constructable]
|
||||
public CrystalFishPie()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(CrystalFish));
|
||||
}
|
||||
|
||||
public CrystalFishPie(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class FairySalmonPie : BaseFishPie
|
||||
{
|
||||
public override int LabelNumber { get { return 1116222; } }
|
||||
public override int BuffName { get { return 1116278; } }
|
||||
public override int BuffAmount { get { return 2; } }
|
||||
public override FishPieEffect Effect { get { return FishPieEffect.CastFocus; } }
|
||||
|
||||
[Constructable]
|
||||
public FairySalmonPie()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(FairySalmon));
|
||||
}
|
||||
|
||||
public FairySalmonPie(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class FireFishPie : BaseFishPie
|
||||
{
|
||||
public override int LabelNumber { get { return 1116217; } }
|
||||
public override int BuffName { get { return 1116271; } }
|
||||
public override int BuffAmount { get { return 5; } }
|
||||
public override FishPieEffect Effect { get { return FishPieEffect.FireSoak; } }
|
||||
|
||||
[Constructable]
|
||||
public FireFishPie()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(FireFish));
|
||||
}
|
||||
|
||||
public FireFishPie(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class GiantKoiPie : BaseFishPie
|
||||
{
|
||||
public override int LabelNumber { get { return 1116216; } }
|
||||
public override int BuffName { get { return 1116270; } }
|
||||
public override int BuffAmount { get { return 5; } }
|
||||
public override FishPieEffect Effect { get { return FishPieEffect.DefChance; } }
|
||||
|
||||
[Constructable]
|
||||
public GiantKoiPie()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(GiantKoi));
|
||||
}
|
||||
|
||||
public GiantKoiPie(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class GreatBarracudaPie : BaseFishPie
|
||||
{
|
||||
public override int LabelNumber { get { return 1116214; } }
|
||||
public override int BuffName { get { return 1116269; } }
|
||||
public override int BuffAmount { get { return 5; } }
|
||||
public override FishPieEffect Effect { get { return FishPieEffect.HitChance; } }
|
||||
|
||||
[Constructable]
|
||||
public GreatBarracudaPie()
|
||||
{
|
||||
Hue = 1287;// FishInfo.GetFishHue(typeof(GreatBarracuda));
|
||||
}
|
||||
|
||||
public GreatBarracudaPie(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class HolyMackerelPie : BaseFishPie
|
||||
{
|
||||
public override int LabelNumber { get { return 1116225; } }
|
||||
public override int BuffName { get { return 1116283; } }
|
||||
public override int BuffAmount { get { return 3; } }
|
||||
public override FishPieEffect Effect { get { return FishPieEffect.ManaRegen; } }
|
||||
|
||||
[Constructable]
|
||||
public HolyMackerelPie()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(HolyMackerel));
|
||||
}
|
||||
|
||||
public HolyMackerelPie(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class LavaFishPie : BaseFishPie
|
||||
{
|
||||
public override int LabelNumber { get { return 1116223; } }
|
||||
public override int BuffName { get { return 1116279; } }
|
||||
public override int BuffAmount { get { return 5; } }
|
||||
public override FishPieEffect Effect { get { return FishPieEffect.SoulCharge; } }
|
||||
|
||||
[Constructable]
|
||||
public LavaFishPie()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(LavaFish));
|
||||
}
|
||||
|
||||
public LavaFishPie(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ReaperFishPie : BaseFishPie
|
||||
{
|
||||
public override int LabelNumber { get { return 1116218; } }
|
||||
public override int BuffName { get { return 1116274; } }
|
||||
public override int BuffAmount { get { return 5; } }
|
||||
public override FishPieEffect Effect { get { return FishPieEffect.PoisonSoak; } }
|
||||
|
||||
[Constructable]
|
||||
public ReaperFishPie()
|
||||
{
|
||||
Hue = 1152;// FishInfo.GetFishHue(typeof(ReaperFish));
|
||||
}
|
||||
|
||||
public ReaperFishPie(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class SummerDragonfishPie : BaseFishPie
|
||||
{
|
||||
public override int LabelNumber { get { return 1116221; } }
|
||||
public override int BuffName { get { return 1116277; } }
|
||||
public override int BuffAmount { get { return 5; } }
|
||||
public override FishPieEffect Effect { get { return FishPieEffect.SpellDamage; } }
|
||||
|
||||
[Constructable]
|
||||
public SummerDragonfishPie()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(SummerDragonfish));
|
||||
}
|
||||
|
||||
public SummerDragonfishPie(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class UnicornFishPie : BaseFishPie
|
||||
{
|
||||
public override int LabelNumber { get { return 1116226; } }
|
||||
public override int BuffName { get { return 1116284; } }
|
||||
public override int BuffAmount { get { return 3; } }
|
||||
public override FishPieEffect Effect { get { return FishPieEffect.StamRegen; } }
|
||||
|
||||
[Constructable]
|
||||
public UnicornFishPie()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(UnicornFish));
|
||||
}
|
||||
|
||||
public UnicornFishPie(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class YellowtailBarracudaPie : BaseFishPie
|
||||
{
|
||||
public override int LabelNumber { get { return 1116215; } }
|
||||
public override int BuffName { get { return 1116282; } }
|
||||
public override int BuffAmount { get { return 3; } }
|
||||
public override FishPieEffect Effect { get { return FishPieEffect.HitsRegen; } }
|
||||
|
||||
[Constructable]
|
||||
public YellowtailBarracudaPie()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(YellowtailBarracuda));
|
||||
}
|
||||
|
||||
public YellowtailBarracudaPie(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class StoneCrabPie : BaseFishPie
|
||||
{
|
||||
public override int LabelNumber { get { return 1116227; } }
|
||||
public override int BuffName { get { return 1116272; } }
|
||||
public override int BuffAmount { get { return 3; } }
|
||||
public override FishPieEffect Effect { get { return FishPieEffect.PhysicalSoak; } }
|
||||
|
||||
[Constructable]
|
||||
public StoneCrabPie()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(StoneCrab));
|
||||
}
|
||||
|
||||
public StoneCrabPie(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SpiderCrabPie : BaseFishPie
|
||||
{
|
||||
public override int LabelNumber { get { return 1116229; } }
|
||||
public override int BuffName { get { return 1116281; } }
|
||||
public override int BuffAmount { get { return 10; } }
|
||||
public override FishPieEffect Effect { get { return FishPieEffect.FocusBoost; } }
|
||||
|
||||
[Constructable]
|
||||
public SpiderCrabPie()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(SpiderCrab));
|
||||
}
|
||||
|
||||
public SpiderCrabPie(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BlueLobsterPie : BaseFishPie
|
||||
{
|
||||
public override int LabelNumber { get { return 1116228; } }
|
||||
public override int BuffName { get { return 1116273; } }
|
||||
public override int BuffAmount { get { return 5; } }
|
||||
public override FishPieEffect Effect { get { return FishPieEffect.ColdSoak; } }
|
||||
|
||||
[Constructable]
|
||||
public BlueLobsterPie()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(BlueLobster));
|
||||
}
|
||||
|
||||
public BlueLobsterPie(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
245
Scripts/Services/Expansions/High Seas/Items/Fish/Hooks.cs
Normal file
245
Scripts/Services/Expansions/High Seas/Items/Fish/Hooks.cs
Normal file
@@ -0,0 +1,245 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum HookType
|
||||
{
|
||||
None,
|
||||
Lava,
|
||||
Dredging,
|
||||
JunkProof
|
||||
}
|
||||
|
||||
[Flipable(19270, 19271)]
|
||||
public class BaseFishingHook : Item
|
||||
{
|
||||
private int m_Uses;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Uses
|
||||
{
|
||||
get { return m_Uses; }
|
||||
set { m_Uses = value; }
|
||||
}
|
||||
|
||||
public virtual HookType HookType { get { return HookType.None; } }
|
||||
public override int LabelNumber { get { return 1098140; } }
|
||||
|
||||
public BaseFishingHook() : this(50)
|
||||
{
|
||||
}
|
||||
|
||||
public BaseFishingHook(int uses) : base(19270)
|
||||
{
|
||||
m_Uses = uses;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
int condition = GetCondition(m_Uses);
|
||||
list.Add(1149847, String.Format("#{0}", condition)); //Condition: ~1_val~
|
||||
}
|
||||
|
||||
public static int GetCondition(int uses)
|
||||
{
|
||||
if (uses < 10)
|
||||
return 1149853; //worn
|
||||
else if (uses < 20)
|
||||
return 1149852; //fair
|
||||
else if (uses < 30)
|
||||
return 1149851; //very good
|
||||
else if (uses < 40)
|
||||
return 1149850; //good
|
||||
else if (uses < 50)
|
||||
return 1149849; //excellent
|
||||
else
|
||||
return 1149848; //new
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.Target = new InternalTarget(this);
|
||||
//TODO: Message?
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetHookType(HookType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case HookType.Lava:
|
||||
return 1150888;
|
||||
case HookType.Dredging:
|
||||
return 1150890;
|
||||
case HookType.JunkProof:
|
||||
return 1150883;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private BaseFishingHook m_Hook;
|
||||
|
||||
public InternalTarget(BaseFishingHook hook)
|
||||
: base(-1, false, TargetFlags.None)
|
||||
{
|
||||
m_Hook = hook;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is FishingPole)
|
||||
{
|
||||
FishingPole pole = (FishingPole)targeted;
|
||||
|
||||
if (pole.HookType != HookType.None)
|
||||
{
|
||||
Item hook = null;
|
||||
|
||||
switch (pole.HookType)
|
||||
{
|
||||
case HookType.None: break;
|
||||
case HookType.Lava: hook = new LavaHook(pole.HookUses); break;
|
||||
case HookType.Dredging: hook = new DredgingHook(pole.HookUses); break;
|
||||
case HookType.JunkProof: hook = new JunkProofHook(pole.HookUses); break;
|
||||
}
|
||||
|
||||
if (hook != null)
|
||||
from.AddToBackpack(hook);
|
||||
}
|
||||
|
||||
pole.HookType = m_Hook.HookType;
|
||||
pole.HookUses = m_Hook.Uses;
|
||||
pole.OriginalHue = pole.Hue;
|
||||
pole.Hue = m_Hook.Hue;
|
||||
from.SendLocalizedMessage(1150884); //You tie the hook to the fishing line.
|
||||
m_Hook.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BaseFishingHook(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
writer.Write(m_Uses);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
m_Uses = reader.ReadInt();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[Flipable(19268, 19269)]
|
||||
public class LavaHook : BaseFishingHook
|
||||
{
|
||||
public override HookType HookType { get { return HookType.Lava; } }
|
||||
public override int LabelNumber { get { return 1150888; } }
|
||||
|
||||
[Constructable]
|
||||
public LavaHook(int uses) : base(uses)
|
||||
{
|
||||
Hue = 2075;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LavaHook()
|
||||
{
|
||||
Hue = 2075;
|
||||
}
|
||||
|
||||
public LavaHook(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();
|
||||
}
|
||||
}
|
||||
|
||||
[Flipable(19268, 19269)]
|
||||
public class DredgingHook : BaseFishingHook
|
||||
{
|
||||
public override HookType HookType { get { return HookType.Dredging; } }
|
||||
public override int LabelNumber { get { return 1150890; } }
|
||||
|
||||
[Constructable]
|
||||
public DredgingHook(int uses) : base(uses)
|
||||
{
|
||||
Hue = 33;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DredgingHook()
|
||||
{
|
||||
Hue = 33;
|
||||
}
|
||||
|
||||
public DredgingHook(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();
|
||||
}
|
||||
}
|
||||
|
||||
[Flipable(19268, 19269)]
|
||||
public class JunkProofHook : BaseFishingHook
|
||||
{
|
||||
public override HookType HookType { get { return HookType.JunkProof; } }
|
||||
public override int LabelNumber { get { return 1150883; } }
|
||||
|
||||
[Constructable]
|
||||
public JunkProofHook(int uses) : base(uses)
|
||||
{
|
||||
Hue = 99;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public JunkProofHook()
|
||||
{
|
||||
Hue = 99;
|
||||
}
|
||||
|
||||
public JunkProofHook(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,369 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AbyssalDragonfish : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116118; } }
|
||||
|
||||
[Constructable]
|
||||
public AbyssalDragonfish()
|
||||
: base(Utility.RandomMinMax(17637, 17638))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public AbyssalDragonfish(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BlackMarlin : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116099; } }
|
||||
|
||||
[Constructable]
|
||||
public BlackMarlin()
|
||||
: base(Utility.RandomMinMax(17156, 17157))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public BlackMarlin(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BlueMarlin : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116097; } }
|
||||
|
||||
[Constructable]
|
||||
public BlueMarlin()
|
||||
: base(Utility.RandomMinMax(17156, 17157))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public BlueMarlin(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class DungeonPike : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116107; } }
|
||||
|
||||
[Constructable]
|
||||
public DungeonPike()
|
||||
: base(Utility.RandomMinMax(17603, 17604))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public DungeonPike(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class GiantSamuraiFish : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116103; } }
|
||||
|
||||
[Constructable]
|
||||
public GiantSamuraiFish()
|
||||
: base(Utility.RandomMinMax(17158, 17159))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public GiantSamuraiFish(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class GoldenTuna : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116102; } }
|
||||
|
||||
[Constructable]
|
||||
public GoldenTuna()
|
||||
: base(Utility.RandomMinMax(17154, 17155))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public GoldenTuna(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class Kingfish : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116085; } }
|
||||
|
||||
[Constructable]
|
||||
public Kingfish()
|
||||
: base(Utility.RandomMinMax(17158, 17159))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public Kingfish(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LanternFish : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116106; } }
|
||||
|
||||
[Constructable]
|
||||
public LanternFish()
|
||||
: base(Utility.RandomMinMax(17605, 17606))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public LanternFish(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class RainbowFish : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116108; } }
|
||||
|
||||
[Constructable]
|
||||
public RainbowFish()
|
||||
: base(Utility.RandomMinMax(17154, 17155))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public RainbowFish(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SeekerFish : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116109; } }
|
||||
|
||||
[Constructable]
|
||||
public SeekerFish()
|
||||
: base(Utility.RandomMinMax(17158, 17159))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public SeekerFish(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SpringDragonfish : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116104; } }
|
||||
|
||||
[Constructable]
|
||||
public SpringDragonfish()
|
||||
: base(Utility.RandomMinMax(17637, 17638))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public SpringDragonfish(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class StoneFish : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116110; } }
|
||||
|
||||
[Constructable]
|
||||
public StoneFish()
|
||||
: base(Utility.RandomMinMax(17605, 17606))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public StoneFish(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class WinterDragonfish : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116105; } }
|
||||
|
||||
[Constructable]
|
||||
public WinterDragonfish()
|
||||
: base(Utility.RandomMinMax(17637, 17638))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public WinterDragonfish(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class ZombieFish : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116101; } }
|
||||
|
||||
[Constructable]
|
||||
public ZombieFish()
|
||||
: base(Utility.RandomMinMax(17603, 17604))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public ZombieFish(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
738
Scripts/Services/Expansions/High Seas/Items/Fish/RareFish.cs
Normal file
738
Scripts/Services/Expansions/High Seas/Items/Fish/RareFish.cs
Normal file
@@ -0,0 +1,738 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RareFish : BaseHighseasFish
|
||||
{
|
||||
private Mobile m_CaughtBy;
|
||||
private DateTime m_DateCaught;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Fisher { get { return m_CaughtBy; } set { m_CaughtBy = value; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DateTime DateCaught { get { return m_DateCaught; } set { m_DateCaught = value; } }
|
||||
|
||||
public RareFish(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1070857, m_CaughtBy != null ? m_CaughtBy.Name : "An Unknown Fisher"); //Caught by ~1_fisherman~
|
||||
|
||||
if (m_DateCaught != DateTime.MinValue)
|
||||
list.Add("[{0}]", m_DateCaught.ToShortDateString());
|
||||
}
|
||||
|
||||
public RareFish(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
writer.Write(m_CaughtBy);
|
||||
writer.Write(m_DateCaught);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
m_CaughtBy = reader.ReadMobile();
|
||||
m_DateCaught = reader.ReadDateTime();
|
||||
}
|
||||
}
|
||||
|
||||
public class AutumnDragonfish : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116090; } }
|
||||
public override Item GetCarved { get { return new AutumnDragonfishSteak(); } }
|
||||
|
||||
[Constructable]
|
||||
public AutumnDragonfish()
|
||||
: base(Utility.RandomMinMax(17637, 17638))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public AutumnDragonfish(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BullFish : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116095; } }
|
||||
public override Item GetCarved { get { return new BullFishSteak(); } }
|
||||
|
||||
[Constructable]
|
||||
public BullFish()
|
||||
: base(Utility.RandomMinMax(17605, 17606))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public BullFish(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class CrystalFish : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116092; } }
|
||||
public override Item GetCarved { get { return new CrystalFishSteak(); } }
|
||||
|
||||
[Constructable]
|
||||
public CrystalFish()
|
||||
: base(Utility.RandomMinMax(17154, 17155))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public CrystalFish(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class FairySalmon : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116089; } }
|
||||
public override Item GetCarved { get { return new FairySalmonSteak(); } }
|
||||
|
||||
[Constructable]
|
||||
public FairySalmon()
|
||||
: base(Utility.RandomMinMax(17154, 17155))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public FairySalmon(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class FireFish : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116093; } }
|
||||
public override Item GetCarved { get { return new FireFishSteak(); } }
|
||||
|
||||
[Constructable]
|
||||
public FireFish()
|
||||
: base(Utility.RandomMinMax(17158, 17159))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public FireFish(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class GiantKoi : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116088; } }
|
||||
public override Item GetCarved { get { return new GiantKoiSteak(); } }
|
||||
|
||||
[Constructable]
|
||||
public GiantKoi()
|
||||
: base(Utility.RandomMinMax(17605, 17606))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public GiantKoi(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class GreatBarracuda : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116100; } }
|
||||
public override Item GetCarved { get { return new GreatBarracudaSteak(); } }
|
||||
|
||||
[Constructable]
|
||||
public GreatBarracuda()
|
||||
: base(Utility.RandomMinMax(17603, 17604))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public GreatBarracuda(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class HolyMackerel : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116087; } }
|
||||
public override Item GetCarved { get { return new HolyMackerelSteak(); } }
|
||||
|
||||
[Constructable]
|
||||
public HolyMackerel()
|
||||
: base(Utility.RandomMinMax(17154, 17155))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public HolyMackerel(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LavaFish : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116096; } }
|
||||
public override Item GetCarved { get { return new LavaFishSteak(); } }
|
||||
|
||||
[Constructable]
|
||||
public LavaFish()
|
||||
: base(Utility.RandomMinMax(17156, 17157))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public LavaFish(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class ReaperFish : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116094; } }
|
||||
public override Item GetCarved { get { return new ReaperFishSteak(); } }
|
||||
|
||||
[Constructable]
|
||||
public ReaperFish()
|
||||
: base(Utility.RandomMinMax(17603, 17604))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public ReaperFish(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SummerDragonfish : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116091; } }
|
||||
public override Item GetCarved { get { return new SummerDragonfishSteak(); } }
|
||||
|
||||
[Constructable]
|
||||
public SummerDragonfish()
|
||||
: base(Utility.RandomMinMax(17637, 17638))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public SummerDragonfish(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class UnicornFish : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116086; } }
|
||||
public override Item GetCarved { get { return new UnicornFishSteak(); } }
|
||||
|
||||
[Constructable]
|
||||
public UnicornFish()
|
||||
: base(Utility.RandomMinMax(17156, 17157))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public UnicornFish(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class YellowtailBarracuda : RareFish
|
||||
{
|
||||
public override int LabelNumber { get { return 1116098; } }
|
||||
public override Item GetCarved { get { return new YellowtailBarracudaSteak(); } }
|
||||
|
||||
[Constructable]
|
||||
public YellowtailBarracuda()
|
||||
: base(Utility.RandomMinMax(17603, 17604))
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(this.GetType());
|
||||
}
|
||||
|
||||
public YellowtailBarracuda(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class AutumnDragonfishSteak : RawFishSteak
|
||||
{
|
||||
public override int LabelNumber { get { return 1116314; } }
|
||||
|
||||
[Constructable]
|
||||
public AutumnDragonfishSteak()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(AutumnDragonfish));
|
||||
}
|
||||
|
||||
public AutumnDragonfishSteak(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class BullFishSteak : RawFishSteak
|
||||
{
|
||||
public override int LabelNumber { get { return 1116310; } }
|
||||
|
||||
[Constructable]
|
||||
public BullFishSteak()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(BullFish));
|
||||
}
|
||||
|
||||
public BullFishSteak(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class CrystalFishSteak : RawFishSteak
|
||||
{
|
||||
public override int LabelNumber { get { return 1116309; } }
|
||||
|
||||
[Constructable]
|
||||
public CrystalFishSteak()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(CrystalFish));
|
||||
}
|
||||
|
||||
public CrystalFishSteak(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class FairySalmonSteak : RawFishSteak
|
||||
{
|
||||
public override int LabelNumber { get { return 1116312; } }
|
||||
|
||||
[Constructable]
|
||||
public FairySalmonSteak()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(FairySalmon));
|
||||
}
|
||||
|
||||
public FairySalmonSteak(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class FireFishSteak : RawFishSteak
|
||||
{
|
||||
public override int LabelNumber { get { return 1116307; } }
|
||||
|
||||
[Constructable]
|
||||
public FireFishSteak()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(FireFish));
|
||||
}
|
||||
|
||||
public FireFishSteak(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class GiantKoiSteak : RawFishSteak
|
||||
{
|
||||
public override int LabelNumber { get { return 1116306; } }
|
||||
|
||||
[Constructable]
|
||||
public GiantKoiSteak()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(GiantKoi));
|
||||
}
|
||||
|
||||
public GiantKoiSteak(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class GreatBarracudaSteak : RawFishSteak
|
||||
{
|
||||
public override int LabelNumber { get { return 1116298; } }
|
||||
|
||||
[Constructable]
|
||||
public GreatBarracudaSteak()
|
||||
{
|
||||
Hue = 1287; // FishInfo.GetFishHue(typeof(GreatBarracuda));
|
||||
}
|
||||
|
||||
public GreatBarracudaSteak(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class HolyMackerelSteak : RawFishSteak
|
||||
{
|
||||
public override int LabelNumber { get { return 1116315; } }
|
||||
|
||||
[Constructable]
|
||||
public HolyMackerelSteak()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(HolyMackerel));
|
||||
}
|
||||
|
||||
public HolyMackerelSteak(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class LavaFishSteak : RawFishSteak
|
||||
{
|
||||
public override int LabelNumber { get { return 1116313; } }
|
||||
|
||||
[Constructable]
|
||||
public LavaFishSteak()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(LavaFish));
|
||||
}
|
||||
|
||||
public LavaFishSteak(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ReaperFishSteak : RawFishSteak
|
||||
{
|
||||
public override int LabelNumber { get { return 1116308; } }
|
||||
|
||||
[Constructable]
|
||||
public ReaperFishSteak()
|
||||
{
|
||||
Hue = 1152; // FishInfo.GetFishHue(typeof(ReaperFish));
|
||||
}
|
||||
|
||||
public ReaperFishSteak(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class SummerDragonfishSteak : RawFishSteak
|
||||
{
|
||||
public override int LabelNumber { get { return 1116311; } }
|
||||
|
||||
[Constructable]
|
||||
public SummerDragonfishSteak()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(SummerDragonfish));
|
||||
}
|
||||
|
||||
public SummerDragonfishSteak(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class UnicornFishSteak : RawFishSteak
|
||||
{
|
||||
public override int LabelNumber { get { return 1116316; } }
|
||||
|
||||
[Constructable]
|
||||
public UnicornFishSteak()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(UnicornFish));
|
||||
}
|
||||
|
||||
public UnicornFishSteak(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class YellowtailBarracudaSteak : RawFishSteak
|
||||
{
|
||||
public override int LabelNumber { get { return 1116301; } }
|
||||
|
||||
[Constructable]
|
||||
public YellowtailBarracudaSteak()
|
||||
{
|
||||
Hue = FishInfo.GetFishHue(typeof(YellowtailBarracuda));
|
||||
}
|
||||
|
||||
public YellowtailBarracudaSteak(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
416
Scripts/Services/Expansions/High Seas/Items/Fish/Trophies.cs
Normal file
416
Scripts/Services/Expansions/High Seas/Items/Fish/Trophies.cs
Normal file
@@ -0,0 +1,416 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Multis;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum TrophyStyle
|
||||
{
|
||||
Marlin,
|
||||
Dragonfish,
|
||||
BoardGrouper,
|
||||
BoardMahi,
|
||||
Lobster,
|
||||
Crab
|
||||
}
|
||||
|
||||
public class FishTrophyDeed : Item
|
||||
{
|
||||
private int m_Weight;
|
||||
private Mobile m_Fisher;
|
||||
private DateTime m_DateCaught;
|
||||
private int m_DeedName;
|
||||
private int m_TrophyName;
|
||||
private int m_TrophyID;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Fisher { get { return m_Fisher; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int TrophyWeight { get { return m_Weight; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DateTime DateCaught { get { return m_DateCaught; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int TrophyName { get { return m_TrophyName; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int DeedName { get { return m_DeedName; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int TrophyID { get { return m_TrophyID; } }
|
||||
|
||||
public override int LabelNumber { get { return m_DeedName; } }
|
||||
|
||||
public FishTrophyDeed(int weight, Mobile fisher, DateTime caught, int deedname, int trophyname, int id) : base(0x14F0)
|
||||
{
|
||||
m_Weight = weight;
|
||||
m_Fisher = fisher;
|
||||
m_DateCaught = caught;
|
||||
m_DeedName = deedname;
|
||||
m_TrophyName = trophyname;
|
||||
m_TrophyID = id;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(from);
|
||||
|
||||
if (house != null && house.IsCoOwner(from))
|
||||
{
|
||||
bool northWall = BaseAddon.IsWall(from.X, from.Y - 1, from.Z, from.Map);
|
||||
bool westWall = BaseAddon.IsWall(from.X - 1, from.Y, from.Z, from.Map);
|
||||
|
||||
if (northWall && westWall)
|
||||
{
|
||||
switch (from.Direction & Direction.Mask)
|
||||
{
|
||||
case Direction.North:
|
||||
case Direction.South: northWall = true; westWall = false; break;
|
||||
|
||||
case Direction.East:
|
||||
case Direction.West: northWall = false; westWall = true; break;
|
||||
|
||||
default: from.SendMessage("Turn to face the wall on which to hang this trophy."); return;
|
||||
}
|
||||
}
|
||||
|
||||
BaseAddon addon = null;
|
||||
|
||||
if (northWall)
|
||||
addon = ConstructTrophy(true);
|
||||
else if (westWall)
|
||||
addon = ConstructTrophy(false);
|
||||
else
|
||||
from.SendLocalizedMessage(1042626); // The trophy must be placed next to a wall.
|
||||
|
||||
if (addon != null)
|
||||
{
|
||||
house.Addons[addon] = from;
|
||||
addon.MoveToWorld(from.Location, from.Map);
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(502092); // You must be in your house to do this.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (m_Weight >= 20)
|
||||
{
|
||||
if (m_Fisher != null)
|
||||
list.Add(1070857, m_Fisher.Name); // Caught by ~1_fisherman~
|
||||
|
||||
list.Add(1070858, m_Weight.ToString()); // ~1_weight~ stones
|
||||
}
|
||||
}
|
||||
|
||||
public BaseAddon ConstructTrophy(bool north)
|
||||
{
|
||||
BaseAddon addon = null;
|
||||
switch (m_TrophyID)
|
||||
{
|
||||
case 0: addon = new FishTrophy(typeof(AutumnDragonfish), TrophyStyle.Dragonfish, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 1: addon = new FishTrophy(typeof(BullFish), TrophyStyle.BoardMahi, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 2: addon = new FishTrophy(typeof(FireFish), TrophyStyle.BoardGrouper, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 3: addon = new FishTrophy(typeof(GiantKoi), TrophyStyle.BoardMahi, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 4: addon = new FishTrophy(typeof(LavaFish), TrophyStyle.Marlin, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 5: addon = new FishTrophy(typeof(SummerDragonfish), TrophyStyle.Dragonfish, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 6: addon = new FishTrophy(typeof(UnicornFish), TrophyStyle.Marlin, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 7: addon = new FishTrophy(typeof(AbyssalDragonfish), TrophyStyle.Dragonfish, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 8: addon = new FishTrophy(typeof(BlackMarlin), TrophyStyle.Marlin, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 9: addon = new FishTrophy(typeof(BlueMarlin), TrophyStyle.Marlin, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 10: addon = new FishTrophy(typeof(GiantSamuraiFish), TrophyStyle.BoardGrouper, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 11: addon = new FishTrophy(typeof(Kingfish), TrophyStyle.BoardGrouper, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 12: addon = new FishTrophy(typeof(LanternFish), TrophyStyle.BoardMahi, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 13: addon = new FishTrophy(typeof(SeekerFish), TrophyStyle.BoardGrouper, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 14: addon = new FishTrophy(typeof(SpringDragonfish), TrophyStyle.Dragonfish, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 15: addon = new FishTrophy(typeof(StoneFish), TrophyStyle.BoardMahi, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 16: addon = new FishTrophy(typeof(WinterDragonfish), TrophyStyle.Dragonfish, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
|
||||
case 17: addon = new FishTrophy(typeof(BlueLobster), TrophyStyle.Lobster, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 18: addon = new FishTrophy(typeof(BloodLobster), TrophyStyle.Lobster, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 19: addon = new FishTrophy(typeof(DreadLobster), TrophyStyle.Lobster, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 20: addon = new FishTrophy(typeof(VoidLobster), TrophyStyle.Lobster, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 21: addon = new FishTrophy(typeof(StoneCrab), TrophyStyle.Crab, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 22: addon = new FishTrophy(typeof(SpiderCrab), TrophyStyle.Crab, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 23: addon = new FishTrophy(typeof(TunnelCrab), TrophyStyle.Crab, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 24: addon = new FishTrophy(typeof(VoidCrab), TrophyStyle.Crab, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
|
||||
case 25: addon = new FishTrophy(typeof(CrystalFish), TrophyStyle.BoardGrouper, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 26: addon = new FishTrophy(typeof(FairySalmon), TrophyStyle.BoardGrouper, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 27: addon = new FishTrophy(typeof(GreatBarracuda), TrophyStyle.BoardGrouper, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 28: addon = new FishTrophy(typeof(HolyMackerel), TrophyStyle.BoardGrouper, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 29: addon = new FishTrophy(typeof(ReaperFish), TrophyStyle.BoardGrouper, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 30: addon = new FishTrophy(typeof(YellowtailBarracuda), TrophyStyle.BoardGrouper, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 31: addon = new FishTrophy(typeof(DungeonPike), TrophyStyle.BoardGrouper, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 32: addon = new FishTrophy(typeof(GoldenTuna), TrophyStyle.BoardGrouper, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 33: addon = new FishTrophy(typeof(RainbowFish), TrophyStyle.BoardGrouper, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
case 34: addon = new FishTrophy(typeof(ZombieFish), TrophyStyle.BoardGrouper, north, m_TrophyName, m_Weight, m_Fisher, m_DateCaught); break;
|
||||
}
|
||||
return addon;
|
||||
}
|
||||
|
||||
public FishTrophyDeed(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write(m_Weight);
|
||||
writer.Write(m_Fisher);
|
||||
writer.Write(m_DateCaught);
|
||||
writer.Write(m_TrophyName);
|
||||
writer.Write(m_DeedName);
|
||||
writer.Write(m_TrophyID);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Weight = reader.ReadInt();
|
||||
m_Fisher = reader.ReadMobile();
|
||||
m_DateCaught = reader.ReadDateTime();
|
||||
m_TrophyName = reader.ReadInt();
|
||||
m_DeedName = reader.ReadInt();
|
||||
m_TrophyID = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class FishTrophy : BaseAddon
|
||||
{
|
||||
private int m_FishWeight;
|
||||
private Mobile m_Fisher;
|
||||
private DateTime m_DateCaught;
|
||||
private Type m_TypeName;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Fisher { get { return m_Fisher; } }
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DateTime DateCaught { get { return m_DateCaught; } }
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int FishWeight { get { return m_FishWeight; } }
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Type TypeName { get { return m_TypeName; } }
|
||||
|
||||
public FishTrophy(Type type, TrophyStyle style, bool north, int label, int weight, Mobile fisher, DateTime datecaught)
|
||||
{
|
||||
int hue = FishInfo.GetFishHue(type);
|
||||
m_TypeName = type;
|
||||
|
||||
m_FishWeight = weight;
|
||||
m_Fisher = fisher;
|
||||
m_DateCaught = datecaught;
|
||||
|
||||
switch(style)
|
||||
{
|
||||
case TrophyStyle.Marlin:
|
||||
{
|
||||
if(north)
|
||||
{
|
||||
AddComponent(new TrophyComponent(17641, label, hue), 0, 0, 0);
|
||||
AddComponent(new TrophyComponent(17642, label, hue), -1, 0, 0);
|
||||
AddComponent(new TrophyComponent(17643, label, hue), 1, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddComponent(new TrophyComponent(17644, label, hue), 0, 0, 0);
|
||||
AddComponent(new TrophyComponent(17645, label, hue), 0, 1, 0);
|
||||
AddComponent(new TrophyComponent(17646, label, hue), 0, -1, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TrophyStyle.Dragonfish:
|
||||
{
|
||||
if (north)
|
||||
AddComponent(new TrophyComponent(17639, label, hue), 0, 0, 0);
|
||||
else
|
||||
AddComponent(new TrophyComponent(17640, label, hue), 0, 0, 0);
|
||||
break;
|
||||
}
|
||||
case TrophyStyle.BoardMahi:
|
||||
{
|
||||
if (north)
|
||||
{
|
||||
AddComponent(new TrophyComponent(19283, label, 0), 0, 0, 0);
|
||||
AddComponent(new TrophyComponent(19287, label, hue), 0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddComponent(new TrophyComponent(19282, label, 0), 0, 0, 0);
|
||||
AddComponent(new TrophyComponent(19286, label, hue), 0, 0, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TrophyStyle.BoardGrouper:
|
||||
{
|
||||
if (north)
|
||||
{
|
||||
AddComponent(new TrophyComponent(19281, label, 0), 0, 0, 0);
|
||||
AddComponent(new TrophyComponent(19285, label, hue), 0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddComponent(new TrophyComponent(19280, label, 0), 0, 0, 0);
|
||||
AddComponent(new TrophyComponent(19284, label, hue), 0, 0, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TrophyStyle.Crab:
|
||||
{
|
||||
if (north)
|
||||
{
|
||||
AddComponent(new TrophyComponent(18106, label, hue), 0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddComponent(new TrophyComponent(18107, label, hue), 0, 0, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TrophyStyle.Lobster:
|
||||
{
|
||||
if (north)
|
||||
{
|
||||
AddComponent(new TrophyComponent(18108, label, hue), 0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddComponent(new TrophyComponent(18109, label, hue), 0, 0, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Item TrophyDeed
|
||||
{
|
||||
get
|
||||
{
|
||||
var info = TaxidermyKit.TrophyInfos.FirstOrDefault(i => i.CreatureType == m_TypeName);
|
||||
|
||||
if (info != null)
|
||||
{
|
||||
return new FishTrophyDeed(m_FishWeight, m_Fisher, m_DateCaught, info.DeedNumber, info.AddonNumber, info.NorthID);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnChop(Mobile from)
|
||||
{
|
||||
if (Components.Count > 0)
|
||||
{
|
||||
OnComponentUsed(Components[0], from);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnComponentUsed(AddonComponent c, Mobile from)
|
||||
{
|
||||
if (m_TypeName == null)
|
||||
return;
|
||||
|
||||
var info = TaxidermyKit.TrophyInfos.FirstOrDefault(i => i.CreatureType == m_TypeName);
|
||||
|
||||
if (info != null)
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(c);
|
||||
|
||||
if (house != null && (house.IsCoOwner(from) || (house.Addons.ContainsKey(this) && house.Addons[this] == from)))
|
||||
{
|
||||
from.AddToBackpack(new FishTrophyDeed(m_FishWeight, m_Fisher, m_DateCaught, info.DeedNumber, info.AddonNumber, info.NorthID));
|
||||
|
||||
if(house.Addons.ContainsKey(this))
|
||||
house.Addons.Remove(this);
|
||||
|
||||
Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(502092); // You must be in your house to do this.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public FishTrophy(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
writer.Write(m_TypeName.Name);
|
||||
writer.Write(m_FishWeight);
|
||||
writer.Write(m_Fisher);
|
||||
writer.Write(m_DateCaught);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
string name = reader.ReadString();
|
||||
m_TypeName = ScriptCompiler.FindTypeByName(name);
|
||||
m_FishWeight = reader.ReadInt();
|
||||
m_Fisher = reader.ReadMobile();
|
||||
m_DateCaught = reader.ReadDateTime();
|
||||
}
|
||||
}
|
||||
|
||||
public class TrophyComponent : LocalizedAddonComponent
|
||||
{
|
||||
public override bool ForceShowProperties { get { return true; } }
|
||||
|
||||
public TrophyComponent(int itemID, int label, int hue) : base(itemID, label)
|
||||
{
|
||||
Hue = hue;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Addon != null && Addon is FishTrophy)
|
||||
{
|
||||
FishTrophy trophy = Addon as FishTrophy;
|
||||
|
||||
list.Add(1070858, trophy.FishWeight.ToString());
|
||||
list.Add(1070857, trophy.Fisher != null ? trophy.Fisher.Name : "Unknown");
|
||||
list.Add(String.Format("[{0}]", trophy.DateCaught.ToShortDateString()));
|
||||
}
|
||||
}
|
||||
|
||||
public TrophyComponent(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Scripts/Services/Expansions/High Seas/Items/IslandMap.cs
Normal file
41
Scripts/Services/Expansions/High Seas/Items/IslandMap.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CorgulIslandMap : SeaChart
|
||||
{
|
||||
private Point3D m_DestinationPoint;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Point3D DestinationPoint { get { return m_DestinationPoint; } }
|
||||
|
||||
[Constructable]
|
||||
public CorgulIslandMap(Point3D pnt)
|
||||
{
|
||||
Name = "Island Map";
|
||||
m_DestinationPoint = pnt;
|
||||
AddWorldPin(pnt.X, pnt.Y);
|
||||
Protected = true;
|
||||
}
|
||||
|
||||
public CorgulIslandMap(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
writer.Write(m_DestinationPoint);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
m_DestinationPoint = reader.ReadPoint3D();
|
||||
}
|
||||
}
|
||||
}
|
||||
407
Scripts/Services/Expansions/High Seas/Items/LavaFishItems.cs
Normal file
407
Scripts/Services/Expansions/High Seas/Items/LavaFishItems.cs
Normal file
@@ -0,0 +1,407 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class StoneFootwear : BaseShoes
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.Movement += new MovementEventHandler(EventSink_Movement);
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public StoneFootwear() : this(Utility.Random(5899, 8))
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public StoneFootwear(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
string name = GetNameInfo(ItemID);
|
||||
|
||||
if (name == "thigh boots")
|
||||
{
|
||||
Weight = 4.0;
|
||||
}
|
||||
else if (name == "boots")
|
||||
{
|
||||
Weight = 3.0;
|
||||
}
|
||||
else if (name == "shoes")
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
else if (name == "sandals")
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
StrRequirement = 10;
|
||||
}
|
||||
|
||||
public string GetNameInfo(int itemID)
|
||||
{
|
||||
string name = "foot wear";
|
||||
switch (itemID)
|
||||
{
|
||||
case 5899:
|
||||
case 5900: name = "boots"; break;
|
||||
case 5901:
|
||||
case 5902: name = "sandals"; break;
|
||||
case 5903:
|
||||
case 5904: name = "shoes"; break;
|
||||
case 5905:
|
||||
case 5906: name = "thigh boots"; break;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
public override void OnAdded(object parent)
|
||||
{
|
||||
if (parent is Mobile)
|
||||
{
|
||||
Mobile m = (Mobile)parent as Mobile;
|
||||
|
||||
if (SpiderWebbing.IsTrapped(m))
|
||||
{
|
||||
SpiderWebbing.RemoveEffects(m);
|
||||
}
|
||||
|
||||
m.SendLocalizedMessage(1151094, GetNameInfo(ItemID)); // You manage to equip the stone ~1_token~ and find you can no longer move!
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
list.Add(1151095, GetNameInfo(ItemID)); // stone ~1_token~
|
||||
}
|
||||
|
||||
public static void EventSink_Movement(MovementEventArgs e)
|
||||
{
|
||||
Mobile from = e.Mobile;
|
||||
|
||||
if (from != null && from.Alive)
|
||||
{
|
||||
Item item = from.FindItemOnLayer(Layer.Shoes);
|
||||
|
||||
if (item is StoneFootwear)
|
||||
e.Blocked = true;
|
||||
}
|
||||
}
|
||||
|
||||
public StoneFootwear(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version < 1)
|
||||
{
|
||||
string name = GetNameInfo(ItemID);
|
||||
|
||||
if (name == "thigh boots")
|
||||
{
|
||||
Weight = 4.0;
|
||||
}
|
||||
else if (name == "boots")
|
||||
{
|
||||
Weight = 3.0;
|
||||
}
|
||||
else if (name == "shoes")
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
else if (name == "sandals")
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
StrRequirement = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class CrackedLavaRockSouth : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1098151; } }
|
||||
|
||||
[Constructable]
|
||||
public CrackedLavaRockSouth() : base(19279)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnCrack(Mobile from)
|
||||
{
|
||||
Item item;
|
||||
|
||||
switch (Utility.Random(5))
|
||||
{
|
||||
default:
|
||||
case 0: item = new GeodeEast(); break;
|
||||
case 1: item = new GeodeSouth(); break;
|
||||
case 2: item = new GeodeShardEast(); break;
|
||||
case 3: item = new GeodeShardSouth(); break;
|
||||
case 4: item = new LavaRock(); break;
|
||||
}
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
from.AddToBackpack(item);
|
||||
from.SendMessage("You have split the lava rock!");
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public CrackedLavaRockSouth(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class CrackedLavaRockEast : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1098151; } }
|
||||
|
||||
[Constructable]
|
||||
public CrackedLavaRockEast() : base(19275)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnCrack(Mobile from)
|
||||
{
|
||||
Item item;
|
||||
from.SendSound(0x3B3);
|
||||
|
||||
if (from.RawStr < Utility.Random(150))
|
||||
{
|
||||
from.SendMessage("You swing, but fail to crack the rock any further.");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (Utility.Random(5))
|
||||
{
|
||||
default:
|
||||
case 0: item = new GeodeEast(); break;
|
||||
case 1: item = new GeodeSouth(); break;
|
||||
case 2: item = new GeodeShardEast(); break;
|
||||
case 3: item = new GeodeShardSouth(); break;
|
||||
case 4: item = new LavaRock(); break;
|
||||
}
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
from.AddToBackpack(item);
|
||||
from.SendMessage("You have split the lava rock!");
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public CrackedLavaRockEast(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class GeodeSouth : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1098145; } }
|
||||
|
||||
[Constructable]
|
||||
public GeodeSouth() : base(Utility.Random(19277, 2))
|
||||
{
|
||||
switch (Utility.Random(4))
|
||||
{
|
||||
case 0: Hue = 2658; break;
|
||||
case 1: Hue = 2659; break;
|
||||
case 2: Hue = 2660; break;
|
||||
case 3: Hue = 2654; break;
|
||||
}
|
||||
}
|
||||
|
||||
public GeodeSouth(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class GeodeEast : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1098145; } }
|
||||
|
||||
[Constructable]
|
||||
public GeodeEast() : base(Utility.Random(19273, 2))
|
||||
{
|
||||
switch (Utility.Random(4))
|
||||
{
|
||||
case 0: Hue = 2658; break;
|
||||
case 1: Hue = 2659; break;
|
||||
case 2: Hue = 2660; break;
|
||||
case 3: Hue = 2654; break;
|
||||
}
|
||||
}
|
||||
|
||||
public GeodeEast(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class GeodeShardSouth : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1098148; } }
|
||||
|
||||
[Constructable]
|
||||
public GeodeShardSouth() : base(19276)
|
||||
{
|
||||
switch (Utility.Random(4))
|
||||
{
|
||||
case 0: Hue = 2658; break;
|
||||
case 1: Hue = 2659; break;
|
||||
case 2: Hue = 2660; break;
|
||||
case 3: Hue = 2654; break;
|
||||
}
|
||||
}
|
||||
|
||||
public GeodeShardSouth(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class GeodeShardEast : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1098148; } }
|
||||
|
||||
[Constructable]
|
||||
public GeodeShardEast() : base(19272)
|
||||
{
|
||||
switch (Utility.Random(4))
|
||||
{
|
||||
case 0: Hue = 2658; break;
|
||||
case 1: Hue = 2659; break;
|
||||
case 2: Hue = 2660; break;
|
||||
case 3: Hue = 2654; break;
|
||||
}
|
||||
}
|
||||
|
||||
public GeodeShardEast(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LavaRock : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1151166; } }
|
||||
|
||||
[Constructable]
|
||||
public LavaRock() : base(Utility.Random(4964, 6))
|
||||
{
|
||||
Hue = 1175;
|
||||
}
|
||||
|
||||
public LavaRock(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class StonePaver : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1097277; } }
|
||||
|
||||
[Constructable]
|
||||
public StonePaver()
|
||||
: base(Utility.RandomList(18396, 18397, 18398, 18399, 18400, 18405, 18652, 18653, 18654, 18655))
|
||||
{
|
||||
Weight = 5;
|
||||
}
|
||||
|
||||
public StonePaver(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using Server;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LavaLobsterTrap : LobsterTrap
|
||||
{
|
||||
[Constructable]
|
||||
public LavaLobsterTrap()
|
||||
{
|
||||
}
|
||||
|
||||
public override int[] UseableTiles { get { return Server.Engines.Harvest.Fishing.LavaTiles; } }
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
list.Add(1116474); //lava lobster trap
|
||||
}
|
||||
|
||||
public LavaLobsterTrap(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
473
Scripts/Services/Expansions/High Seas/Items/LobsterTrap.cs
Normal file
473
Scripts/Services/Expansions/High Seas/Items/LobsterTrap.cs
Normal file
@@ -0,0 +1,473 @@
|
||||
using Server;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Engines.PartySystem;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(17615, 17616)]
|
||||
public class LobsterTrap : Container, ITelekinesisable
|
||||
{
|
||||
public static readonly int TrapID = Utility.RandomMinMax(17615, 17616);
|
||||
public static readonly int BuoyID = 17611;
|
||||
public static readonly int MaxCatch = 5;
|
||||
|
||||
private Type m_BaitType;
|
||||
private bool m_EnhancedBait;
|
||||
private int m_BaitUses;
|
||||
private bool m_InUse;
|
||||
private Timer m_Timer;
|
||||
private Mobile m_Owner;
|
||||
private int m_Bobs;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Type BaitType
|
||||
{
|
||||
get { return m_BaitType; }
|
||||
set
|
||||
{
|
||||
m_BaitType = value;
|
||||
|
||||
if (m_BaitType == null)
|
||||
{
|
||||
m_EnhancedBait = false;
|
||||
m_BaitUses = 0;
|
||||
}
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool EnhancedBait { get { return m_EnhancedBait; } set { m_EnhancedBait = value; InvalidateProperties(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int BaitUses { get { return m_BaitUses; } set { m_BaitUses = value; InvalidateProperties(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool InUse { get { return m_InUse; } set { m_InUse = value; InvalidateProperties(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Owner { get { return m_Owner; } set { m_Owner = value; InvalidateProperties(); } }
|
||||
|
||||
public override int LabelNumber { get { if (m_Owner == null) return 1096487; else return 0; } }
|
||||
public override bool DisplaysContent { get { return false; } }
|
||||
|
||||
[Constructable]
|
||||
public LobsterTrap() : base(17615)
|
||||
{
|
||||
}
|
||||
|
||||
public void OnTelekinesis(Mobile from)
|
||||
{
|
||||
if (m_InUse && ItemID == BuoyID && CanUseTrap(from))
|
||||
EndTimer(from);
|
||||
}
|
||||
|
||||
public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool TryDropItem(Mobile from, Item dropped, bool sendFullMessage)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
if (ItemID == TrapID)
|
||||
{
|
||||
if (Items.Count == 0)
|
||||
list.Add(1116389); //empty lobster trap
|
||||
else if (Items.Count >= MaxCatch)
|
||||
list.Add(1149599); //full lobster trap
|
||||
else
|
||||
list.Add(1096487); //lobster trap
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_Owner == null)
|
||||
list.Add(1096487); //lobster trap
|
||||
else
|
||||
list.Add(1116390, m_Owner.Name);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (m_BaitType != null)
|
||||
{
|
||||
object label = FishInfo.GetFishLabel(m_BaitType);
|
||||
if (label is int)
|
||||
list.Add(1116468, String.Format("#{0}", (int)label)); //baited to attract: ~1_val~
|
||||
else if (label is string)
|
||||
list.Add(1116468, (string)label);
|
||||
|
||||
list.Add(1116466, m_BaitUses.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
if (ItemID == BuoyID)
|
||||
ItemID = TrapID;
|
||||
|
||||
if (Items.Count > 0)
|
||||
{
|
||||
DumpContents(from);
|
||||
from.SendMessage("You dump the contents of the lobster trap into your pack.");
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(500974); //What water do you want to fish in?
|
||||
from.BeginTarget(-1, true, TargetFlags.None, new TargetCallback(OnTarget));
|
||||
}
|
||||
}
|
||||
else if (ItemID == BuoyID)
|
||||
{
|
||||
if (RootParent != null)
|
||||
ItemID = TrapID;
|
||||
|
||||
InvalidateProperties();
|
||||
|
||||
if (CanUseTrap(from))
|
||||
EndTimer(from);
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
private void DumpContents(Mobile from)
|
||||
{
|
||||
Container pack = from.Backpack;
|
||||
|
||||
foreach (Item item in new List<Item>(this.Items))
|
||||
{
|
||||
if (item == null)
|
||||
continue;
|
||||
|
||||
if (!pack.TryDropItem(from, item, false))
|
||||
item.MoveToWorld(from.Location, from.Map);
|
||||
|
||||
from.SendLocalizedMessage(1116386, String.Format("#{0}", item.LabelNumber));
|
||||
}
|
||||
}
|
||||
|
||||
public void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (Deleted || m_InUse)
|
||||
return;
|
||||
|
||||
IPoint3D pnt = (IPoint3D)targeted;
|
||||
Map map = from.Map;
|
||||
|
||||
if (map == null || map == Map.Internal)
|
||||
return;
|
||||
|
||||
int x = pnt.X; int y = pnt.Y; int z = pnt.Z;
|
||||
|
||||
if (!from.InRange(pnt, 6))
|
||||
{
|
||||
from.SendLocalizedMessage(1116388); // The trap is too cumbersome to deploy that far away.
|
||||
}
|
||||
else if (!IsValidTile(targeted, map))
|
||||
from.SendMessage("You cannot deploy a trap there!"); //TODO: Get Cliloc
|
||||
else if (!IsValidLocation(x, y, z, map))
|
||||
from.SendLocalizedMessage(1116393); //The location is too close to another trap.
|
||||
else
|
||||
{
|
||||
m_Owner = from;
|
||||
ItemID = BuoyID;
|
||||
InvalidateProperties();
|
||||
Movable = false;
|
||||
MoveToWorld(new Point3D(x, y, z), map);
|
||||
m_Bobs = 0;
|
||||
m_InUse = true;
|
||||
StartTimer();
|
||||
|
||||
Effects.PlaySound(this, map, Utility.Random(0x025, 3));
|
||||
Effects.SendMovingEffect(from, this, TrapID, 7, 0, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
public void StartTimer()
|
||||
{
|
||||
if (m_Timer != null)
|
||||
m_Timer.Stop();
|
||||
|
||||
m_Timer = Timer.DelayCall(TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1), new TimerCallback(OnTick));
|
||||
}
|
||||
|
||||
public void EndTimer(Mobile from)
|
||||
{
|
||||
if (m_Timer != null)
|
||||
{
|
||||
m_Timer.Stop();
|
||||
m_Timer = null;
|
||||
}
|
||||
|
||||
if (from == null) from = m_Owner;
|
||||
if (from == null)
|
||||
return;
|
||||
|
||||
Movable = true;
|
||||
ItemID = TrapID;
|
||||
InvalidateProperties();
|
||||
m_InUse = false;
|
||||
|
||||
if (RootParent == null)
|
||||
{
|
||||
if (from.Backpack == null || !from.Backpack.TryDropItem(from, this, false))
|
||||
this.MoveToWorld(from.Location, from.Map);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnTick()
|
||||
{
|
||||
m_Bobs++;
|
||||
|
||||
PublicOverheadMessage(MessageType.Regular, 0, 1116364); //**bob**
|
||||
|
||||
if (m_Owner != null && (!SpecialFishingNet.ValidateDeepWater(Map, X, Y) || m_Owner.Skills[SkillName.Fishing].Base >= 75.0))
|
||||
{
|
||||
m_Owner.CheckSkill(SkillName.Fishing, 0, m_Owner.Skills[SkillName.Fishing].Cap);
|
||||
}
|
||||
|
||||
if (!m_InUse)
|
||||
{
|
||||
EndTimer(null);
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_Bobs * 5 > Utility.Random(100))
|
||||
{
|
||||
OnTrapLost();
|
||||
return;
|
||||
}
|
||||
|
||||
bool rare = true;
|
||||
double bump = (double)m_Bobs / 100.0;
|
||||
|
||||
Type type = FishInfo.GetSpecialItem(m_Owner, this, this.Location, bump, this is LavaLobsterTrap);
|
||||
|
||||
if (type != null)
|
||||
{
|
||||
Item item = Loot.Construct(type);
|
||||
DropItem(item);
|
||||
|
||||
if (item is RareCrabAndLobster && rare)
|
||||
{
|
||||
RareCrabAndLobster fish = (RareCrabAndLobster)item;
|
||||
|
||||
fish.Fisher = m_Owner;
|
||||
fish.DateCaught = DateTime.UtcNow;
|
||||
fish.Weight = Utility.RandomMinMax(10, 200);
|
||||
fish.Stackable = false;
|
||||
}
|
||||
|
||||
if (m_Owner != null)
|
||||
m_Owner.SendMessage("It looks like you caught something!");
|
||||
|
||||
CheckBait();
|
||||
}
|
||||
else if (Utility.RandomBool())
|
||||
{
|
||||
Item item;
|
||||
|
||||
if (Utility.RandomBool())
|
||||
item = new Crab();
|
||||
else
|
||||
item = new Lobster();
|
||||
|
||||
if (m_Owner != null)
|
||||
m_Owner.SendMessage("It looks like you caught something!");
|
||||
|
||||
DropItem(item);
|
||||
CheckBait();
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckBait()
|
||||
{
|
||||
if (m_BaitType != null)
|
||||
{
|
||||
BaitUses--;
|
||||
|
||||
if (m_BaitUses == 0)
|
||||
{
|
||||
BaitType = null;
|
||||
EnhancedBait = false;
|
||||
|
||||
if (m_Owner != null)
|
||||
m_Owner.SendMessage("You have used up the bait on your lobster trap.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OnTrapLost()
|
||||
{
|
||||
if (m_Timer != null)
|
||||
m_Timer.Stop();
|
||||
|
||||
Effects.PlaySound(this, this.Map, Utility.Random(0x025, 3));
|
||||
|
||||
IPooledEnumerable eable = this.GetMobilesInRange(12);
|
||||
foreach (Mobile mob in eable)
|
||||
{
|
||||
if (mob is PlayerMobile && m_Owner != null)
|
||||
mob.SendLocalizedMessage(1116385, m_Owner.Name); //~1_NAME~'s trap bouy is pulled beneath the waves.
|
||||
}
|
||||
eable.Free();
|
||||
|
||||
Delete();
|
||||
}
|
||||
|
||||
private bool CanUseTrap(Mobile from)
|
||||
{
|
||||
if (m_Owner == null || RootParent != null)
|
||||
return false;
|
||||
|
||||
if (!from.InRange(this.Location, 6))
|
||||
{
|
||||
from.SendLocalizedMessage(500295); //You are too far away to do that.
|
||||
return false;
|
||||
}
|
||||
|
||||
//is owner, or in same guild
|
||||
if (m_Owner == from || (from.Guild != null && from.Guild == m_Owner.Guild))
|
||||
return true;
|
||||
|
||||
//partied
|
||||
if (Party.Get(from) == Party.Get(m_Owner))
|
||||
return true;
|
||||
|
||||
//fel rules
|
||||
if (from.Map != null && from.Map.Rules == MapRules.FeluccaRules)
|
||||
{
|
||||
from.CriminalAction(true);
|
||||
from.SendLocalizedMessage(1149823); //The owner of the lobster trap notices you committing a criminal act!
|
||||
|
||||
if (m_Owner != null)
|
||||
m_Owner.SendMessage("You notice {0} taking your lobster trap out of the water!", from.Name);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(1116391); //You realize that the trap isn't yours so you leave it alone.
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool IsValidTile(object targeted, Map map)
|
||||
{
|
||||
int tileID = 0;
|
||||
|
||||
if (targeted is LandTarget)
|
||||
{
|
||||
LandTarget obj = (LandTarget)targeted;
|
||||
tileID = obj.TileID;
|
||||
}
|
||||
|
||||
else if (targeted is StaticTarget)
|
||||
{
|
||||
StaticTarget obj = (StaticTarget)targeted;
|
||||
tileID = obj.ItemID;
|
||||
}
|
||||
|
||||
for (int i = 0; i < UseableTiles.Length; i++)
|
||||
{
|
||||
if (UseableTiles[i] == tileID)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsValidLocation(int x, int y, int z, Map map)
|
||||
{
|
||||
IPooledEnumerable eable = map.GetItemsInRange(new Point3D(x, y, z), 1);
|
||||
|
||||
foreach (Item item in eable)
|
||||
{
|
||||
if (item is LobsterTrap)
|
||||
{
|
||||
eable.Free();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
eable.Free();
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual int[] UseableTiles { get { return m_WaterTiles; } }
|
||||
private int[] m_WaterTiles = new int[]
|
||||
{
|
||||
//Deep Water
|
||||
0x00AA, 0x00A9,
|
||||
0x00A8, 0x00AB,
|
||||
0x0136, 0x0137,
|
||||
//Shallow Water
|
||||
0x5797, 0x579C,
|
||||
0x746E, 0x7485,
|
||||
0x7490, 0x74AB,
|
||||
0x74B5, 0x75D5,
|
||||
//Static tiles
|
||||
0x1797, 0x1798,
|
||||
0x1799, 0x179A,
|
||||
0x179B, 0x179C,
|
||||
|
||||
};
|
||||
|
||||
public LobsterTrap(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
int index = FishInfo.GetIndexFromType(m_BaitType);
|
||||
writer.Write(index);
|
||||
writer.Write(m_Bobs);
|
||||
writer.Write(m_InUse);
|
||||
writer.Write(m_Owner);
|
||||
writer.Write(m_BaitUses);
|
||||
writer.Write(m_EnhancedBait);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
int index = reader.ReadInt();
|
||||
m_BaitType = FishInfo.GetTypeFromIndex(index);
|
||||
|
||||
m_Bobs = reader.ReadInt();
|
||||
m_InUse = reader.ReadBool();
|
||||
m_Owner = reader.ReadMobile();
|
||||
m_BaitUses = reader.ReadInt();
|
||||
m_EnhancedBait = reader.ReadBool();
|
||||
|
||||
if (m_BaitType != null && m_BaitUses <= 0)
|
||||
BaitType = null;
|
||||
|
||||
if (m_InUse)
|
||||
StartTimer();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class OracleOfTheSea : Spyglass
|
||||
{
|
||||
public static readonly int MaxUses = 5;
|
||||
|
||||
public override int LabelNumber { get { return 1150184; } }
|
||||
|
||||
private int m_UsesRemaining;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int UsesRemaining { get { return m_UsesRemaining; } set { m_UsesRemaining = value; InvalidateProperties(); } }
|
||||
|
||||
[Constructable]
|
||||
public OracleOfTheSea()
|
||||
{
|
||||
Hue = 1265;
|
||||
Weight = 3.0;
|
||||
m_UsesRemaining = 5;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1060728, "{0}\t{1}", m_UsesRemaining.ToString(), MaxUses.ToString());
|
||||
list.Add(1150207, "#{0}\t", 1150208);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (m_UsesRemaining <= 0 || !IsChildOf(from.Backpack))
|
||||
base.OnDoubleClick(from);
|
||||
|
||||
if (CharydbisSpawner.SpawnInstance != null && CharydbisSpawner.SpawnInstance.TrySpawnCharybdis(from))
|
||||
UsesRemaining--;
|
||||
}
|
||||
|
||||
public OracleOfTheSea(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
writer.Write(m_UsesRemaining);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BlackPowder : Item, ICommodity
|
||||
{
|
||||
public override int LabelNumber { get { return 1095826; } } // black powder
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public BlackPowder()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BlackPowder(int amount)
|
||||
: base(0x423A)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Hue = 1109;
|
||||
}
|
||||
|
||||
public BlackPowder(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Charcoal : Item, ICommodity
|
||||
{
|
||||
public override int LabelNumber { get { return 1116303; } } // charcoal
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public Charcoal()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Charcoal(int amount)
|
||||
: base(0x423A)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Hue = 1190;
|
||||
}
|
||||
|
||||
public Charcoal(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MentoSeasoning : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1116299; } }
|
||||
|
||||
[Constructable]
|
||||
public MentoSeasoning()
|
||||
: base(2454)
|
||||
{
|
||||
Hue = 95;
|
||||
}
|
||||
|
||||
public MentoSeasoning(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SamuelsSecretSauce : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1116338; } }
|
||||
|
||||
[Constructable]
|
||||
public SamuelsSecretSauce() : base(2463)
|
||||
{
|
||||
Hue = 1461;
|
||||
}
|
||||
|
||||
public SamuelsSecretSauce(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class DarkTruffle : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1116300; } }
|
||||
|
||||
[Constructable]
|
||||
public DarkTruffle()
|
||||
: base(3352)
|
||||
{
|
||||
Hue = 1908;
|
||||
}
|
||||
|
||||
public DarkTruffle(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class FreshGinger : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1031235; } }
|
||||
|
||||
[Constructable]
|
||||
public FreshGinger()
|
||||
: base(11235)
|
||||
{
|
||||
}
|
||||
|
||||
public FreshGinger(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class FishOilFlask : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1150863; } }
|
||||
|
||||
[Constructable]
|
||||
public FishOilFlask()
|
||||
: base(7192)
|
||||
{
|
||||
Hue = 2404;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if(IsChildOf(from.Backpack))
|
||||
from.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private FishOilFlask m_Flask;
|
||||
|
||||
public InternalTarget(FishOilFlask flask) : base(-1, false, TargetFlags.None)
|
||||
{
|
||||
m_Flask = flask;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is OracleOfTheSea)
|
||||
{
|
||||
if (((OracleOfTheSea)targeted).UsesRemaining >= 5)
|
||||
from.SendMessage("That is already fully charged!");
|
||||
else
|
||||
{
|
||||
((OracleOfTheSea)targeted).UsesRemaining = 5;
|
||||
from.SendMessage("You charge the oracle with the fish oil.");
|
||||
m_Flask.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public FishOilFlask(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Matchcord : Item, ICommodity
|
||||
{
|
||||
public override int LabelNumber { get { return 1095184; } }
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public Matchcord() : this(1) { }
|
||||
|
||||
[Constructable]
|
||||
public Matchcord(int amount)
|
||||
: base(5153)
|
||||
{
|
||||
Hue = 1171;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public Matchcord(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
211
Scripts/Services/Expansions/High Seas/Items/Resources/Niter.cs
Normal file
211
Scripts/Services/Expansions/High Seas/Items/Resources/Niter.cs
Normal file
@@ -0,0 +1,211 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Engines.Harvest;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
|
||||
public class NiterDeposit : Item
|
||||
{
|
||||
public enum NiterSize
|
||||
{
|
||||
Gigantic = 1,
|
||||
Massive,
|
||||
Huge,
|
||||
Large,
|
||||
Small
|
||||
}
|
||||
|
||||
private NiterSize m_Size;
|
||||
private int m_Hits;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Hits
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Hits;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Hits = value;
|
||||
InvalidateSize();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public NiterSize Size
|
||||
{
|
||||
get { return m_Size; }
|
||||
set
|
||||
{
|
||||
m_Size = value;
|
||||
InvalidateID();
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Decays { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public NiterDeposit() : this(Utility.RandomMinMax(1, 5))
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public NiterDeposit(int size)
|
||||
{
|
||||
if (size < 1) size = 1;
|
||||
if (size > 5) size = 5;
|
||||
|
||||
m_Hits = 40 * size;
|
||||
InvalidateSize();
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public void OnMine(Mobile from, Item tool)
|
||||
{
|
||||
if (tool is IUsesRemaining && ((IUsesRemaining)tool).UsesRemaining < 1)
|
||||
return;
|
||||
|
||||
from.Direction = from.GetDirectionTo(this.Location);
|
||||
from.Animate(11, 5, 1, true, false, 0);
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1), new TimerStateCallback(DoMine), new object[] { from, tool });
|
||||
}
|
||||
|
||||
public void DoMine(object obj)
|
||||
{
|
||||
object[] os = (object[])obj;
|
||||
Mobile from = (Mobile)os[0];
|
||||
Item tool = (Item)os[1];
|
||||
|
||||
if (from != null && from.CheckSkill(SkillName.Mining, 60.0, 100.0))
|
||||
{
|
||||
Container pack = from.Backpack;
|
||||
int count = 1;
|
||||
|
||||
if (from.Skills[SkillName.Mining].Value > 100 && Utility.RandomBool())
|
||||
count++;
|
||||
|
||||
from.SendLocalizedMessage(1149924, count.ToString()); //You extract ~1_COUNT~ saltpeter from the niter deposit.
|
||||
Saltpeter sp = new Saltpeter(count);
|
||||
|
||||
if (pack == null || !pack.TryDropItem(from, sp, false))
|
||||
sp.MoveToWorld(from.Location, from.Map);
|
||||
|
||||
Hits--;
|
||||
|
||||
from.PlaySound(Utility.RandomMinMax(0x125, 0x126));
|
||||
CheckTool(tool);
|
||||
|
||||
if (m_Hits <= 0)
|
||||
{
|
||||
from.SendMessage("You have mined the last of the niter deposit.");
|
||||
Delete();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1149923); //You mine the niter deposit but fail to produce any usable saltpeter.
|
||||
}
|
||||
|
||||
public void CheckTool(Item tool)
|
||||
{
|
||||
if (tool != null && tool is IUsesRemaining)
|
||||
{
|
||||
IUsesRemaining toolWithUses = (IUsesRemaining)tool;
|
||||
|
||||
toolWithUses.ShowUsesRemaining = true;
|
||||
|
||||
if (toolWithUses.UsesRemaining > 0)
|
||||
--toolWithUses.UsesRemaining;
|
||||
|
||||
if (toolWithUses.UsesRemaining < 1)
|
||||
tool.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public void InvalidateSize()
|
||||
{
|
||||
if (m_Hits > 160)
|
||||
Size = NiterSize.Gigantic;
|
||||
else if (m_Hits > 120)
|
||||
Size = NiterSize.Massive;
|
||||
else if (m_Hits > 80)
|
||||
Size = NiterSize.Huge;
|
||||
else if (m_Hits > 40)
|
||||
Size = NiterSize.Large;
|
||||
else
|
||||
Size = NiterSize.Small;
|
||||
}
|
||||
|
||||
public void InvalidateID()
|
||||
{
|
||||
switch (m_Size)
|
||||
{
|
||||
default:
|
||||
case NiterSize.Gigantic: ItemID = 4962; break;
|
||||
case NiterSize.Massive: ItemID = 4961; break;
|
||||
case NiterSize.Huge: ItemID = 4967; break;
|
||||
case NiterSize.Large: ItemID = 4964; break;
|
||||
case NiterSize.Small: ItemID = 4965; break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
list.Add(1149912, m_Size.ToString());
|
||||
}
|
||||
|
||||
public static bool HasBeenChecked(HarvestBank bank)
|
||||
{
|
||||
if (m_BankTable.ContainsKey(bank) && m_BankTable[bank] < DateTime.UtcNow)
|
||||
m_BankTable.Remove(bank);
|
||||
|
||||
return m_BankTable.ContainsKey(bank);
|
||||
}
|
||||
|
||||
private static Dictionary<HarvestBank, DateTime> m_BankTable = new Dictionary<HarvestBank, DateTime>();
|
||||
|
||||
public static void AddBank(HarvestBank bank)
|
||||
{
|
||||
if (bank == null)
|
||||
return;
|
||||
|
||||
m_BankTable[bank] = DateTime.UtcNow + TimeSpan.FromMinutes(5);
|
||||
}
|
||||
|
||||
public void DefragBanks()
|
||||
{
|
||||
List<HarvestBank> toRemove = new List<HarvestBank>();
|
||||
|
||||
foreach (KeyValuePair<HarvestBank, DateTime> kvp in m_BankTable)
|
||||
if (kvp.Value < DateTime.UtcNow)
|
||||
toRemove.Add(kvp.Key);
|
||||
|
||||
foreach (HarvestBank bank in toRemove)
|
||||
m_BankTable.Remove(bank);
|
||||
}
|
||||
|
||||
public NiterDeposit(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
writer.Write(m_Hits);
|
||||
writer.Write((int)m_Size);
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(30), new TimerCallback(DefragBanks));
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
m_Hits = reader.ReadInt();
|
||||
m_Size = (NiterSize)reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Potash : Item, ICommodity
|
||||
{
|
||||
public override int LabelNumber { get { return 1116319; } } // potash
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public Potash()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Potash(int amount)
|
||||
: base(0x423A)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Hue = 1102;
|
||||
}
|
||||
|
||||
public Potash(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Saltpeter : Item, ICommodity
|
||||
{
|
||||
public override int LabelNumber { get { return 1116302; } } // saltpeter
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public Saltpeter()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Saltpeter(int count)
|
||||
: base(0x423A)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = count;
|
||||
Hue = 1150;
|
||||
}
|
||||
|
||||
public Saltpeter(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
155
Scripts/Services/Expansions/High Seas/Items/RuinedShipPlans.cs
Normal file
155
Scripts/Services/Expansions/High Seas/Items/RuinedShipPlans.cs
Normal file
@@ -0,0 +1,155 @@
|
||||
using Server;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Targeting;
|
||||
using Server.Multis;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RuinedShipPlans : Item
|
||||
{
|
||||
public enum PlanType
|
||||
{
|
||||
One = 1,
|
||||
Two,
|
||||
Three,
|
||||
Four,
|
||||
Five,
|
||||
Six,
|
||||
Seven,
|
||||
Eight
|
||||
}
|
||||
|
||||
private PlanType m_PlanType;
|
||||
public PlanType Type { get { return m_PlanType; } set { m_PlanType = value; } }
|
||||
|
||||
private List<PlanType> m_Joined = new List<PlanType>();
|
||||
public List<PlanType> Joined { get { return m_Joined; } }
|
||||
|
||||
public override int LabelNumber { get { return 1116784; } }
|
||||
|
||||
[Constructable]
|
||||
public RuinedShipPlans() : this((PlanType)Utility.RandomMinMax(1, 8))
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RuinedShipPlans(PlanType type) : base(5360)
|
||||
{
|
||||
m_PlanType = type;
|
||||
m_Joined.Add(type);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1116747); //Orc Ship
|
||||
|
||||
if(m_Joined.Count == 1)
|
||||
list.Add(1116776, String.Format("{0}\t{1}", ((int)m_PlanType).ToString(), "8")); //Part ~1_val~ of ~2_val~
|
||||
else
|
||||
list.Add(1116777, String.Format("{0}\t{1}", m_Joined.Count.ToString(), "8")); //Parts ~1_val~ of ~2_val~
|
||||
|
||||
if (m_Joined.Count > 1)
|
||||
{
|
||||
m_Joined.Sort();
|
||||
|
||||
string str = "Contains Parts ";
|
||||
foreach (int i in m_Joined)
|
||||
str += (i.ToString() + ", ");
|
||||
|
||||
list.Add(1114057, str);
|
||||
}
|
||||
}
|
||||
|
||||
public bool TryCombine(Mobile from, RuinedShipPlans plans)
|
||||
{
|
||||
if (m_Joined.Contains(plans.Type))
|
||||
{
|
||||
from.SendLocalizedMessage(1116787); //This part is already attached.
|
||||
return false;
|
||||
}
|
||||
|
||||
plans.Delete();
|
||||
from.PlaySound(0x249);
|
||||
|
||||
foreach (PlanType type in plans.Joined)
|
||||
{
|
||||
if(!m_Joined.Contains(type))
|
||||
m_Joined.Add(type);
|
||||
}
|
||||
|
||||
InvalidateProperties();
|
||||
|
||||
if (m_Joined.Count == 8)
|
||||
{
|
||||
from.AddToBackpack(new OrcishGalleonDeed());
|
||||
from.SendLocalizedMessage(1116788); //You have completed a deed for an Orc Ship!
|
||||
|
||||
this.Delete();
|
||||
}
|
||||
else
|
||||
from.Target = new InternalTarget(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.Target = new InternalTarget(this);
|
||||
from.SendLocalizedMessage(1116785); //Target another piece of ship plans to combine.
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private RuinedShipPlans m_Plans;
|
||||
|
||||
public InternalTarget(RuinedShipPlans plans) : base(-1, false, TargetFlags.None)
|
||||
{
|
||||
m_Plans = plans;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is Item && !((Item)targeted).IsChildOf(from.Backpack))
|
||||
from.SendMessage("That must be in your pack to combine.");
|
||||
else if (targeted is RuinedShipPlans)
|
||||
{
|
||||
RuinedShipPlans toAttach = (RuinedShipPlans)targeted;
|
||||
m_Plans.TryCombine(from, toAttach);
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1116786); //These do not fit together.
|
||||
}
|
||||
}
|
||||
|
||||
public RuinedShipPlans(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
writer.Write((int)m_PlanType);
|
||||
|
||||
writer.Write(m_Joined.Count);
|
||||
for (int i = 0; i < m_Joined.Count; i++)
|
||||
writer.Write((int)m_Joined[i]);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
m_PlanType = (PlanType)reader.ReadInt();
|
||||
|
||||
int count = reader.ReadInt();
|
||||
for(int i = 0; i < count; i++)
|
||||
m_Joined.Add((PlanType)reader.ReadInt());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class YellowPolkaDotBikini : LeatherBustierArms
|
||||
{
|
||||
public override int LabelNumber { get { return 1149962; } }
|
||||
|
||||
[Constructable]
|
||||
public YellowPolkaDotBikini()
|
||||
{
|
||||
Hue = 1169;
|
||||
}
|
||||
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
list.Add(1041645); // recovered from a shipwrecklist
|
||||
}
|
||||
|
||||
public YellowPolkaDotBikini(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
Hue = 1169;
|
||||
}
|
||||
}
|
||||
}
|
||||
43
Scripts/Services/Expansions/High Seas/Items/SeaMarketBuoy.cs
Normal file
43
Scripts/Services/Expansions/High Seas/Items/SeaMarketBuoy.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SeaMarketBuoy : BaseAddon
|
||||
{
|
||||
[Constructable]
|
||||
public SeaMarketBuoy()
|
||||
{
|
||||
AddonComponent comp1 = new AddonComponent(18102);
|
||||
comp1.Name = "buoy";
|
||||
|
||||
AddonComponent comp2 = new AddonComponent(18103);
|
||||
comp1.Name = "buoy";
|
||||
|
||||
AddonComponent comp3 = new AddonComponent(18104);
|
||||
comp1.Name = "buoy";
|
||||
|
||||
AddonComponent comp4 = new AddonComponent(18105);
|
||||
comp1.Name = "buoy";
|
||||
|
||||
AddComponent(comp1, 0, 0, 0);
|
||||
AddComponent(comp2, 0, -1, 0);
|
||||
AddComponent(comp3, -1, -1, 0);
|
||||
AddComponent(comp4, -1, 0, 0);
|
||||
}
|
||||
|
||||
public SeaMarketBuoy(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,525 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public interface IFishingAttire
|
||||
{
|
||||
int BaitBonus { get; set; }
|
||||
int SetBonus { get; set; }
|
||||
}
|
||||
|
||||
public class FishermansHat : TallStrawHat, ISetItem, IFishingAttire
|
||||
{
|
||||
public override int LabelNumber { get { return 1151190; } } //Fisherman's Tall Straw Hat
|
||||
|
||||
#region ISetItem Members
|
||||
public override SetItem SetID { get { return SetItem.Fisherman; } }
|
||||
public override int Pieces { get { return 4; } }
|
||||
#endregion
|
||||
|
||||
#region IFishingAttire Members
|
||||
public int BaitBonus { get { return 10; } set { } }
|
||||
public int SetBonus { get { return 50; } set { } }
|
||||
#endregion
|
||||
|
||||
public override int InitMinHits { get { return 125; } }
|
||||
public override int InitMaxHits { get { return 125; } }
|
||||
|
||||
public override int BasePhysicalResistance { get { return Resistances.Physical == 0 ? 3 : base.BasePhysicalResistance; } }
|
||||
public override int BaseFireResistance { get { return Resistances.Fire == 0 ? 8 : base.BaseFireResistance; } }
|
||||
public override int BaseColdResistance { get { return Resistances.Cold == 0 ? 23 : base.BaseColdResistance; } }
|
||||
public override int BasePoisonResistance { get { return Resistances.Poison == 0 ? 8 : base.BasePoisonResistance; } }
|
||||
public override int BaseEnergyResistance { get { return Resistances.Energy == 0 ? 8 : base.BaseEnergyResistance; } }
|
||||
|
||||
public override int[] BaseResists
|
||||
{
|
||||
get
|
||||
{
|
||||
var list = new int[5];
|
||||
|
||||
list[0] = base.BasePhysicalResistance;
|
||||
list[1] = base.BaseFireResistance;
|
||||
list[2] = base.BaseColdResistance;
|
||||
list[3] = base.BasePoisonResistance;
|
||||
list[4] = base.BaseEnergyResistance;
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FishermansHat()
|
||||
{
|
||||
Hue = 2578;
|
||||
SetHue = 2578;
|
||||
}
|
||||
|
||||
public FishermansHat(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class FishermansTrousers : StuddedLegs, ISetItem, IFishingAttire
|
||||
{
|
||||
public override int LabelNumber { get { return 1151191; } } //Fisherman's Trousers
|
||||
|
||||
#region ISetItem Members
|
||||
public override SetItem SetID { get { return SetItem.Fisherman; } }
|
||||
public override int Pieces { get { return 4; } }
|
||||
#endregion
|
||||
|
||||
#region IFishingAttire Members
|
||||
public int BaitBonus { get { return 10; } set { } }
|
||||
public int SetBonus { get { return 50; } set { } }
|
||||
#endregion
|
||||
|
||||
public override int InitMinHits { get { return 125; } }
|
||||
public override int InitMaxHits { get { return 125; } }
|
||||
|
||||
public override int BasePhysicalResistance { get { return PhysicalBonus == 0 ? 6 : base.BasePhysicalResistance; } }
|
||||
public override int BaseFireResistance { get { return FireBonus == 0 ? 20 : base.BaseFireResistance; } }
|
||||
public override int BaseColdResistance { get { return ColdBonus == 0 ? 7 : base.BaseColdResistance; } }
|
||||
public override int BasePoisonResistance { get { return PoisonBonus == 0 ? 7 : base.BasePoisonResistance; } }
|
||||
public override int BaseEnergyResistance { get { return EnergyBonus == 0 ? 8 : base.BaseEnergyResistance ; } }
|
||||
|
||||
public override int[] BaseResists
|
||||
{
|
||||
get
|
||||
{
|
||||
var list = new int[5];
|
||||
|
||||
list[0] = base.BasePhysicalResistance;
|
||||
list[1] = base.BaseFireResistance;
|
||||
list[2] = base.BaseColdResistance;
|
||||
list[3] = base.BasePoisonResistance;
|
||||
list[4] = base.BaseEnergyResistance;
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FishermansTrousers()
|
||||
{
|
||||
Hue = 2578;
|
||||
SetHue = 2578;
|
||||
|
||||
ArmorAttributes.MageArmor = 1;
|
||||
}
|
||||
|
||||
public FishermansTrousers(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class FishermansVest : LeatherChest, ISetItem, IFishingAttire
|
||||
{
|
||||
public override int LabelNumber { get { return 1151192; } } //Fisherman's Vest
|
||||
|
||||
#region ISetItem Members
|
||||
public override SetItem SetID { get { return SetItem.Fisherman; } }
|
||||
public override int Pieces { get { return 4; } }
|
||||
#endregion
|
||||
|
||||
#region IFishingAttire Members
|
||||
public int BaitBonus { get { return 10; } set { } }
|
||||
public int SetBonus { get { return 50; } set { } }
|
||||
#endregion
|
||||
|
||||
public override int InitMinHits { get { return 125; } }
|
||||
public override int InitMaxHits { get { return 125; } }
|
||||
|
||||
public override int BasePhysicalResistance { get { return PhysicalBonus == 0 ? 4 : base.BasePhysicalResistance; } }
|
||||
public override int BaseFireResistance { get { return FireBonus == 0 ? 19 : base.BaseFireResistance; } }
|
||||
public override int BaseColdResistance { get { return ColdBonus == 0 ? 5 : base.BaseColdResistance; } }
|
||||
public override int BasePoisonResistance { get { return PoisonBonus == 0 ? 5 : base.BasePoisonResistance; } }
|
||||
public override int BaseEnergyResistance { get { return EnergyBonus == 0 ? 5 : base.BaseEnergyResistance; } }
|
||||
|
||||
public override int[] BaseResists
|
||||
{
|
||||
get
|
||||
{
|
||||
var list = new int[5];
|
||||
|
||||
list[0] = base.BasePhysicalResistance;
|
||||
list[1] = base.BaseFireResistance;
|
||||
list[2] = base.BaseColdResistance;
|
||||
list[3] = base.BasePoisonResistance;
|
||||
list[4] = base.BaseEnergyResistance;
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FishermansVest()
|
||||
{
|
||||
Hue = 2578;
|
||||
SetHue = 2578;
|
||||
}
|
||||
|
||||
public FishermansVest(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class FishermansEelskinGloves : LeatherGloves, ISetItem, IFishingAttire
|
||||
{
|
||||
public override int LabelNumber { get { return 1151189; } } //Fisherman's Eelskin Gloves
|
||||
|
||||
#region ISetItem Members
|
||||
public override SetItem SetID { get { return SetItem.Fisherman; } }
|
||||
public override int Pieces { get { return 4; } }
|
||||
#endregion
|
||||
|
||||
#region IFishingAttire Members
|
||||
public int BaitBonus { get { return 10; } set { } }
|
||||
public int SetBonus { get { return 50; } set { } }
|
||||
#endregion
|
||||
|
||||
public override int InitMinHits { get { return 125; } }
|
||||
public override int InitMaxHits { get { return 125; } }
|
||||
|
||||
public override int BasePhysicalResistance { get { return PhysicalBonus == 0 ? 4 : base.BasePhysicalResistance; } }
|
||||
public override int BaseFireResistance { get { return FireBonus == 0 ? 19 : base.BaseFireResistance; } }
|
||||
public override int BaseColdResistance { get { return ColdBonus == 0 ? 5 : base.BaseColdResistance; } }
|
||||
public override int BasePoisonResistance { get { return PoisonBonus == 0 ? 5 : base.BasePoisonResistance; } }
|
||||
public override int BaseEnergyResistance { get { return EnergyBonus == 0 ? 5 : base.BaseEnergyResistance; } }
|
||||
|
||||
public override int[] BaseResists
|
||||
{
|
||||
get
|
||||
{
|
||||
var list = new int[5];
|
||||
|
||||
list[0] = base.BasePhysicalResistance;
|
||||
list[1] = base.BaseFireResistance;
|
||||
list[2] = base.BaseColdResistance;
|
||||
list[3] = base.BasePoisonResistance;
|
||||
list[4] = base.BaseEnergyResistance;
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FishermansEelskinGloves()
|
||||
{
|
||||
Hue = 2578;
|
||||
SetHue = 2578;
|
||||
}
|
||||
|
||||
public FishermansEelskinGloves(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class FishermansChestguard : GargishPlateChest, ISetItem, IFishingAttire
|
||||
{
|
||||
public override int LabelNumber { get { return 1151574; } } //Fisherman's Chestguard
|
||||
|
||||
#region ISetItem Members
|
||||
public override SetItem SetID { get { return SetItem.Fisherman; } }
|
||||
public override int Pieces { get { return 4; } }
|
||||
#endregion
|
||||
|
||||
#region IFishingAttire Members
|
||||
public int BaitBonus { get { return 10; } set { } }
|
||||
public int SetBonus { get { return 50; } set { } }
|
||||
#endregion
|
||||
|
||||
public override int InitMinHits { get { return 125; } }
|
||||
public override int InitMaxHits { get { return 125; } }
|
||||
|
||||
public override int BasePhysicalResistance { get { return PhysicalBonus == 0 ? 24 : base.BasePhysicalResistance; } }
|
||||
public override int BaseFireResistance { get { return FireBonus == 0 ? 10 : base.BaseFireResistance; } }
|
||||
public override int BaseColdResistance { get { return ColdBonus == 0 ? 9 : base.BaseColdResistance; } }
|
||||
public override int BasePoisonResistance { get { return PoisonBonus == 0 ? 10 : base.BasePoisonResistance; } }
|
||||
public override int BaseEnergyResistance { get { return EnergyBonus == 0 ? 9 : base.BaseEnergyResistance; } }
|
||||
|
||||
public override int[] BaseResists
|
||||
{
|
||||
get
|
||||
{
|
||||
var list = new int[5];
|
||||
|
||||
list[0] = base.BasePhysicalResistance;
|
||||
list[1] = base.BaseFireResistance;
|
||||
list[2] = base.BaseColdResistance;
|
||||
list[3] = base.BasePoisonResistance;
|
||||
list[4] = base.BaseEnergyResistance;
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FishermansChestguard()
|
||||
{
|
||||
ItemID = 0x4052;
|
||||
Hue = 2578;
|
||||
SetHue = 2578;
|
||||
}
|
||||
|
||||
public FishermansChestguard(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class FishermansKilt : GargishClothKiltArmor, ISetItem, IFishingAttire
|
||||
{
|
||||
public override int LabelNumber { get { return 1151575; } } // Fisherman's Kilt
|
||||
|
||||
#region ISetItem Members
|
||||
public override SetItem SetID { get { return SetItem.Fisherman; } }
|
||||
public override int Pieces { get { return 4; } }
|
||||
#endregion
|
||||
|
||||
#region IFishingAttire Members
|
||||
public int BaitBonus { get { return 10; } set { } }
|
||||
public int SetBonus { get { return 50; } set { } }
|
||||
#endregion
|
||||
|
||||
public override int InitMinHits { get { return 125; } }
|
||||
public override int InitMaxHits { get { return 125; } }
|
||||
|
||||
public override int BasePhysicalResistance { get { return PhysicalBonus == 0 ? 7 : base.BasePhysicalResistance; } }
|
||||
public override int BaseFireResistance { get { return FireBonus == 0 ? 21 : base.BaseFireResistance; } }
|
||||
public override int BaseColdResistance { get { return ColdBonus == 0 ? 8 : base.BaseColdResistance; } }
|
||||
public override int BasePoisonResistance { get { return PoisonBonus == 0 ? 8 : base.BasePoisonResistance; } }
|
||||
public override int BaseEnergyResistance { get { return EnergyBonus == 0 ? 8 : base.BaseEnergyResistance; } }
|
||||
|
||||
public override int[] BaseResists
|
||||
{
|
||||
get
|
||||
{
|
||||
var list = new int[5];
|
||||
|
||||
list[0] = base.BasePhysicalResistance;
|
||||
list[1] = base.BaseFireResistance;
|
||||
list[2] = base.BaseColdResistance;
|
||||
list[3] = base.BasePoisonResistance;
|
||||
list[4] = base.BaseEnergyResistance;
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FishermansKilt()
|
||||
{
|
||||
Hue = 2578;
|
||||
SetHue = 2578;
|
||||
}
|
||||
|
||||
public FishermansKilt(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class FishermansArms : GargishLeatherArms, ISetItem, IFishingAttire
|
||||
{
|
||||
public override int LabelNumber { get { return 1151576; } } // Fisherman's Arms
|
||||
|
||||
#region ISetItem Members
|
||||
public override SetItem SetID { get { return SetItem.Fisherman; } }
|
||||
public override int Pieces { get { return 4; } }
|
||||
#endregion
|
||||
|
||||
#region IFishingAttire Members
|
||||
public int BaitBonus { get { return 10; } set { } }
|
||||
public int SetBonus { get { return 50; } set { } }
|
||||
#endregion
|
||||
|
||||
public override int InitMinHits { get { return 125; } }
|
||||
public override int InitMaxHits { get { return 125; } }
|
||||
|
||||
public override int BasePhysicalResistance { get { return PhysicalBonus == 0 ? 7 : base.BasePhysicalResistance; } }
|
||||
public override int BaseFireResistance { get { return FireBonus == 0 ? 8 : base.BaseFireResistance; } }
|
||||
public override int BaseColdResistance { get { return ColdBonus == 0 ? 21 : base.BaseColdResistance; } }
|
||||
public override int BasePoisonResistance { get { return PoisonBonus == 0 ? 8 : base.BasePoisonResistance; } }
|
||||
public override int BaseEnergyResistance { get { return EnergyBonus == 0 ? 8 : base.BaseEnergyResistance; } }
|
||||
|
||||
public override int[] BaseResists
|
||||
{
|
||||
get
|
||||
{
|
||||
var list = new int[5];
|
||||
|
||||
list[0] = base.BasePhysicalResistance;
|
||||
list[1] = base.BaseFireResistance;
|
||||
list[2] = base.BaseColdResistance;
|
||||
list[3] = base.BasePoisonResistance;
|
||||
list[4] = base.BaseEnergyResistance;
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FishermansArms()
|
||||
{
|
||||
Hue = 2578;
|
||||
SetHue = 2578;
|
||||
}
|
||||
|
||||
public FishermansArms(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class FishermansEarrings : GargishEarrings, ISetItem, IFishingAttire
|
||||
{
|
||||
public override int LabelNumber { get { return 1151577; } } // Fisherman's Earrings
|
||||
|
||||
#region ISetItem Members
|
||||
public override SetItem SetID { get { return SetItem.Fisherman; } }
|
||||
public override int Pieces { get { return 4; } }
|
||||
#endregion
|
||||
|
||||
#region IFishingAttire Members
|
||||
public int BaitBonus { get { return 10; } set { } }
|
||||
public int SetBonus { get { return 50; } set { } }
|
||||
#endregion
|
||||
|
||||
public override int InitMinHits { get { return 125; } }
|
||||
public override int InitMaxHits { get { return 125; } }
|
||||
|
||||
public override int BasePhysicalResistance { get { return PhysicalBonus == 0 ? 3 : base.BasePhysicalResistance; } }
|
||||
public override int BaseFireResistance { get { return FireBonus == 0 ? 4 : base.BaseFireResistance; } }
|
||||
public override int BaseColdResistance { get { return ColdBonus == 0 ? 4 : base.BaseColdResistance; } }
|
||||
public override int BasePoisonResistance { get { return PoisonBonus == 0 ? 4 : base.BasePoisonResistance; } }
|
||||
public override int BaseEnergyResistance { get { return EnergyBonus == 0 ? 17 : base.BaseEnergyResistance; } }
|
||||
|
||||
public override int[] BaseResists
|
||||
{
|
||||
get
|
||||
{
|
||||
var list = new int[5];
|
||||
|
||||
list[0] = base.BasePhysicalResistance;
|
||||
list[1] = base.BaseFireResistance;
|
||||
list[2] = base.BaseColdResistance;
|
||||
list[3] = base.BasePoisonResistance;
|
||||
list[4] = base.BaseEnergyResistance;
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FishermansEarrings()
|
||||
{
|
||||
Hue = 2578;
|
||||
SetHue = 2578;
|
||||
}
|
||||
|
||||
public FishermansEarrings(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
187
Scripts/Services/Expansions/High Seas/Items/ShippingCrate.cs
Normal file
187
Scripts/Services/Expansions/High Seas/Items/ShippingCrate.cs
Normal file
@@ -0,0 +1,187 @@
|
||||
using Server;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
using Server.Multis;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ShipCrate : SmallCrate
|
||||
{
|
||||
public static readonly int DT = 30;
|
||||
|
||||
private Mobile m_Owner;
|
||||
private BaseBoat m_Boat;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Owner { get { return m_Owner; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseBoat Boat { get { return m_Boat; } }
|
||||
|
||||
public override TimeSpan DecayTime
|
||||
{
|
||||
get
|
||||
{
|
||||
return TimeSpan.FromMinutes(DT);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Decays
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public ShipCrate(Mobile owner, BaseBoat boat)
|
||||
{
|
||||
LiftOverride = true;
|
||||
m_Owner = owner;
|
||||
m_Boat = boat;
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
Server.Mobiles.DockMaster.RemoveCrate(this);
|
||||
base.Delete();
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
if (m_Owner != null)
|
||||
list.Add(1116515, m_Owner.Name);
|
||||
else
|
||||
list.Add("a shipping crate");
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
list.Add(new DestroyCrate(from, this));
|
||||
|
||||
if(m_Boat != null && this.Items.Count > 0)
|
||||
list.Add(new LoadShip(from, this));
|
||||
}
|
||||
|
||||
private class DestroyCrate : ContextMenuEntry
|
||||
{
|
||||
private Mobile m_From;
|
||||
private ShipCrate m_Crate;
|
||||
|
||||
public DestroyCrate(Mobile from, ShipCrate crate) : base(1116522, 3)
|
||||
{
|
||||
m_From = from;
|
||||
m_Crate = crate;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
m_From.SendGump(new InternalGump(m_Crate));
|
||||
}
|
||||
}
|
||||
|
||||
private class LoadShip : ContextMenuEntry
|
||||
{
|
||||
private Mobile m_From;
|
||||
private ShipCrate m_Crate;
|
||||
|
||||
public LoadShip(Mobile from, ShipCrate crate)
|
||||
: base(1116521, 3) //Load Ship from Crate
|
||||
{
|
||||
m_From = from;
|
||||
m_Crate = crate;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (m_Crate == null || m_Crate.Boat == null)
|
||||
return;
|
||||
|
||||
Container hold;
|
||||
|
||||
if(m_Crate.Boat is BaseGalleon)
|
||||
hold = ((BaseGalleon)m_Crate.Boat).GalleonHold;
|
||||
else
|
||||
hold = m_Crate.Boat.Hold;
|
||||
|
||||
if(hold == null)
|
||||
return;
|
||||
|
||||
if (m_From.InRange(m_Crate.Boat.Location, Server.Mobiles.DockMaster.DryDockDistance))
|
||||
{
|
||||
List<Item> items = new List<Item>(m_Crate.Items);
|
||||
foreach (Item item in items)
|
||||
hold.DropItem(item);
|
||||
|
||||
m_From.SendMessage("You hold has been loaded from the shipping crate.");
|
||||
}
|
||||
else
|
||||
m_From.SendLocalizedMessage(1116519); //I can't find your ship! You need to bring it in closer.
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalGump : BaseConfirmGump
|
||||
{
|
||||
private ShipCrate m_Crate;
|
||||
|
||||
public override int LabelNumber { get { return 1116523; } } // Are you sure you want to destroy your shipping crate and its contents?
|
||||
|
||||
public InternalGump(ShipCrate crate)
|
||||
{
|
||||
m_Crate = crate;
|
||||
}
|
||||
|
||||
public override void Confirm(Mobile from)
|
||||
{
|
||||
if(m_Crate != null)
|
||||
m_Crate.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from != m_Owner)
|
||||
{
|
||||
from.SendLocalizedMessage(1112589); //This does not belong to you! Find your own!
|
||||
return;
|
||||
}
|
||||
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void OnItemRemoved(Item item)
|
||||
{
|
||||
base.OnItemRemoved(item);
|
||||
|
||||
if (this.TotalItems == 0)
|
||||
Delete();
|
||||
}
|
||||
|
||||
public ShipCrate(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write(m_Owner);
|
||||
writer.Write(m_Boat);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Owner = reader.ReadMobile();
|
||||
m_Boat = reader.ReadItem() as BaseBoat;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SmugglersCache : Container
|
||||
{
|
||||
public override int LabelNumber { get { return 1150042; } }
|
||||
|
||||
public SmugglersCache()
|
||||
: base(Utility.RandomList(3644, 3645, 3646, 3647, 3648, 3649, 3650, 3651))
|
||||
{
|
||||
int toDrop = Utility.RandomMinMax(15, 20);
|
||||
for (int i = 0; i < toDrop; i++)
|
||||
{
|
||||
DropItem(GetRandomBeverage());
|
||||
}
|
||||
|
||||
if (0.5 < Utility.RandomDouble())
|
||||
DropItem(SmugglersLiquor.GetRandom());
|
||||
|
||||
DropItem(SmugglersLiquor.GetRandom());
|
||||
}
|
||||
|
||||
public BeverageType RandomBeverageType()
|
||||
{
|
||||
switch (Utility.Random(4))
|
||||
{
|
||||
case 0: return BeverageType.Ale;
|
||||
case 1: return BeverageType.Cider;
|
||||
case 2: return BeverageType.Liquor;
|
||||
case 3: return BeverageType.Wine;
|
||||
}
|
||||
|
||||
return BeverageType.Milk;
|
||||
}
|
||||
|
||||
public BaseBeverage GetRandomBeverage()
|
||||
{
|
||||
switch (Utility.Random(2))
|
||||
{
|
||||
default:
|
||||
case 0: return new BeverageBottle(RandomBeverageType());
|
||||
case 1: return new Jug(RandomBeverageType());
|
||||
}
|
||||
}
|
||||
|
||||
public SmugglersCache(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int)0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
256
Scripts/Services/Expansions/High Seas/Items/SmugglersLiquor.cs
Normal file
256
Scripts/Services/Expansions/High Seas/Items/SmugglersLiquor.cs
Normal file
@@ -0,0 +1,256 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SmugglersLiquor : BaseBeverage
|
||||
{
|
||||
private int m_Label;
|
||||
private SmugglersLiquorType m_Type;
|
||||
|
||||
public override int LabelNumber { get { return m_Label; } }
|
||||
public override int MaxQuantity { get { return 5; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public SmugglersLiquorType LiquorType { get { return m_Type; } set { m_Type = value; ItemID = ComputeItemID(); } }
|
||||
|
||||
public enum SmugglersLiquorType
|
||||
{
|
||||
AppleIsleWhiskey,
|
||||
ArabellasGargishStout,
|
||||
DiablosBlazePort,
|
||||
EldadorElvenWine,
|
||||
EquinoxWine,
|
||||
FitchsWhiteAle,
|
||||
GatheredSpiritsWhisky,
|
||||
GoldenBrewRum,
|
||||
JoesSpicyBrew,
|
||||
KazolasTreeTopWine,
|
||||
Moonshine,
|
||||
NapaValleysChardonnay,
|
||||
OtisHomemadeBrew,
|
||||
PandorasPinotNoir,
|
||||
RedEyeRum,
|
||||
RoyalGuardAle,
|
||||
SaltyDogMead,
|
||||
SapewinWine,
|
||||
SerpentsCrossLager,
|
||||
SummerSolsticeBrew,
|
||||
VesperAle,
|
||||
WaxingDarkBrew,
|
||||
WhiteRoseZinfandel,
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SmugglersLiquor() : this((SmugglersLiquorType)Utility.Random(26))
|
||||
{
|
||||
}
|
||||
|
||||
public SmugglersLiquor(SmugglersLiquorType type) : base(GetContents(type))
|
||||
{
|
||||
this.LiquorType = type;
|
||||
}
|
||||
|
||||
public static BeverageType GetContents(SmugglersLiquorType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
default:
|
||||
case SmugglersLiquorType.AppleIsleWhiskey: return BeverageType.Liquor;
|
||||
case SmugglersLiquorType.ArabellasGargishStout: return BeverageType.Ale;
|
||||
case SmugglersLiquorType.DiablosBlazePort: return BeverageType.Ale;
|
||||
case SmugglersLiquorType.EldadorElvenWine: return BeverageType.Wine;
|
||||
case SmugglersLiquorType.EquinoxWine: return BeverageType.Wine;
|
||||
case SmugglersLiquorType.FitchsWhiteAle: return BeverageType.Ale;
|
||||
case SmugglersLiquorType.GatheredSpiritsWhisky: return BeverageType.Liquor;
|
||||
case SmugglersLiquorType.GoldenBrewRum: return BeverageType.Liquor;
|
||||
case SmugglersLiquorType.JoesSpicyBrew: return BeverageType.Ale;
|
||||
case SmugglersLiquorType.KazolasTreeTopWine: return BeverageType.Wine;
|
||||
case SmugglersLiquorType.Moonshine: return BeverageType.Liquor;
|
||||
case SmugglersLiquorType.NapaValleysChardonnay: return BeverageType.Wine;
|
||||
case SmugglersLiquorType.OtisHomemadeBrew: return BeverageType.Ale;
|
||||
case SmugglersLiquorType.PandorasPinotNoir: return BeverageType.Wine;
|
||||
case SmugglersLiquorType.RedEyeRum: return BeverageType.Liquor;
|
||||
case SmugglersLiquorType.RoyalGuardAle: return BeverageType.Ale;
|
||||
case SmugglersLiquorType.SaltyDogMead: return BeverageType.Ale;
|
||||
case SmugglersLiquorType.SapewinWine: return BeverageType.Wine;
|
||||
case SmugglersLiquorType.SerpentsCrossLager: return BeverageType.Ale;
|
||||
case SmugglersLiquorType.SummerSolsticeBrew: return BeverageType.Ale;
|
||||
case SmugglersLiquorType.VesperAle: return BeverageType.Ale;
|
||||
case SmugglersLiquorType.WaxingDarkBrew: return BeverageType.Ale;
|
||||
case SmugglersLiquorType.WhiteRoseZinfandel: return BeverageType.Wine;
|
||||
}
|
||||
}
|
||||
|
||||
public override int ComputeItemID()
|
||||
{
|
||||
int id = 0;
|
||||
switch (m_Type)
|
||||
{
|
||||
case SmugglersLiquorType.AppleIsleWhiskey:
|
||||
id = 2504;
|
||||
Hue = 692; //Confirmed
|
||||
m_Label = 1150020;
|
||||
break;
|
||||
case SmugglersLiquorType.ArabellasGargishStout:
|
||||
id = 2459;
|
||||
Hue = 507; //Confirmed
|
||||
m_Label = 1150033;
|
||||
break;
|
||||
case SmugglersLiquorType.DiablosBlazePort:
|
||||
id = 2459;
|
||||
Hue = 675; //Confirmed
|
||||
m_Label = 1150034;
|
||||
break;
|
||||
case SmugglersLiquorType.EldadorElvenWine:
|
||||
id = 2459;
|
||||
Hue = 540; //Confirmed
|
||||
m_Label = 1150029;
|
||||
break;
|
||||
case SmugglersLiquorType.EquinoxWine:
|
||||
id = 2459;
|
||||
Hue = 634; //Confirmed
|
||||
m_Label = 1150037;
|
||||
break;
|
||||
case SmugglersLiquorType.FitchsWhiteAle:
|
||||
id = 2459;
|
||||
Hue = 687; //Confirmed
|
||||
m_Label = 1150035;
|
||||
break;
|
||||
case SmugglersLiquorType.GatheredSpiritsWhisky:
|
||||
id = 2459;
|
||||
Hue = 654; //Confirmed
|
||||
m_Label = 1150026;
|
||||
break;
|
||||
case SmugglersLiquorType.GoldenBrewRum:
|
||||
id = 2459;
|
||||
Hue = 584; //Confirmed
|
||||
m_Label = 1150039;
|
||||
break;
|
||||
case SmugglersLiquorType.JoesSpicyBrew:
|
||||
id = 2459;
|
||||
Hue = 535; //Confirmed
|
||||
m_Label = 1150027;
|
||||
break;
|
||||
case SmugglersLiquorType.KazolasTreeTopWine:
|
||||
id = 2504;
|
||||
Hue = 512; //Confirmed
|
||||
m_Label = 1150036;
|
||||
break;
|
||||
case SmugglersLiquorType.Moonshine:
|
||||
id = 2504;
|
||||
Hue = 555; //Confirmed
|
||||
m_Label = 1150041;
|
||||
break;
|
||||
case SmugglersLiquorType.NapaValleysChardonnay:
|
||||
id = 2459;
|
||||
Hue = 600; //Confirmed
|
||||
m_Label = 1150025;
|
||||
break;
|
||||
case SmugglersLiquorType.OtisHomemadeBrew:
|
||||
id = 2459;
|
||||
Hue = 680; //Confirmed
|
||||
m_Label = 1150019;
|
||||
break;
|
||||
case SmugglersLiquorType.PandorasPinotNoir:
|
||||
id = 2459;
|
||||
Hue = 621; //Confirmed
|
||||
m_Label = 1150023;
|
||||
break;
|
||||
case SmugglersLiquorType.RedEyeRum:
|
||||
id = 2459;
|
||||
Hue = 687; //Confirmed
|
||||
m_Label = 1150022;
|
||||
break;
|
||||
case SmugglersLiquorType.RoyalGuardAle:
|
||||
id = 2504;
|
||||
Hue = 651; //Confirmed
|
||||
m_Label = 1150024;
|
||||
break;
|
||||
case SmugglersLiquorType.SaltyDogMead:
|
||||
id = 2504;
|
||||
Hue = 566; //Confirmed
|
||||
m_Label = 1150028;
|
||||
break;
|
||||
case SmugglersLiquorType.SapewinWine:
|
||||
id = 2459;
|
||||
Hue = 557; //Confirmed
|
||||
m_Label = 1150040;
|
||||
break;
|
||||
case SmugglersLiquorType.SerpentsCrossLager:
|
||||
id = 2459;
|
||||
Hue = 593; //Confirmed
|
||||
m_Label = 1150031;
|
||||
break;
|
||||
case SmugglersLiquorType.SummerSolsticeBrew:
|
||||
id = 2459;
|
||||
Hue = 663; //Confirmed
|
||||
m_Label = 1150038;
|
||||
break;
|
||||
case SmugglersLiquorType.VesperAle:
|
||||
id = 2504;
|
||||
Hue = 519; //Confirmed
|
||||
m_Label = 1150032;
|
||||
break;
|
||||
case SmugglersLiquorType.WaxingDarkBrew:
|
||||
id = 2459;
|
||||
Hue = 567; //Confirmed
|
||||
m_Label = 1150030;
|
||||
break;
|
||||
case SmugglersLiquorType.WhiteRoseZinfandel:
|
||||
id = 2459;
|
||||
Hue = 516; //Confirmed
|
||||
m_Label = 1150021;
|
||||
break;
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
public static Item GetRandom()
|
||||
{
|
||||
int pick = Utility.Random(22);
|
||||
|
||||
return new SmugglersLiquor((SmugglersLiquorType)pick) as Item;
|
||||
}
|
||||
|
||||
public SmugglersLiquor(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)2);
|
||||
|
||||
writer.Write(m_Label);
|
||||
writer.Write((int)m_Type);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 2:
|
||||
m_Label = reader.ReadInt();
|
||||
m_Type = (SmugglersLiquorType)reader.ReadInt();
|
||||
break;
|
||||
case 1:
|
||||
m_Type = (SmugglersLiquorType)reader.ReadInt();
|
||||
ComputeItemID();
|
||||
break;
|
||||
case 0:
|
||||
int type = reader.ReadInt();
|
||||
|
||||
if (type > (int)SmugglersLiquorType.WhiteRoseZinfandel)
|
||||
m_Type = SmugglersLiquorType.WhiteRoseZinfandel;
|
||||
else
|
||||
m_Type = (SmugglersLiquorType)type;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WhiteClothDyeTub : DyeTub
|
||||
{
|
||||
[Constructable]
|
||||
public WhiteClothDyeTub()
|
||||
{
|
||||
Hue = DyedHue = 2498;
|
||||
Redyable = false;
|
||||
}
|
||||
|
||||
public WhiteClothDyeTub(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
274
Scripts/Services/Expansions/High Seas/Mobiles/BaseSeaChampion.cs
Normal file
274
Scripts/Services/Expansions/High Seas/Mobiles/BaseSeaChampion.cs
Normal file
@@ -0,0 +1,274 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Multis;
|
||||
using Server.Items;
|
||||
using Server.Engines.CannedEvil;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class BaseSeaChampion : BaseChampion
|
||||
{
|
||||
public override Type[] UniqueList { get { return new Type[] { }; } }
|
||||
public override Type[] SharedList { get { return new Type[] { }; } }
|
||||
public override Type[] DecorativeList { get { return new Type[] { }; } }
|
||||
public override MonsterStatuetteType[] StatueTypes { get { return new MonsterStatuetteType[] { }; } }
|
||||
|
||||
public override ChampionSkullType SkullType
|
||||
{
|
||||
get
|
||||
{
|
||||
return ChampionSkullType.None;
|
||||
}
|
||||
}
|
||||
|
||||
private DateTime m_NextBoatDamage;
|
||||
private bool m_InDamageMode;
|
||||
private Mobile m_Fisher;
|
||||
|
||||
public virtual bool CanDamageBoats { get { return false; } }
|
||||
public virtual TimeSpan BoatDamageCooldown { get { return TimeSpan.MaxValue; } }
|
||||
public virtual DateTime NextBoatDamage { get { return m_NextBoatDamage; } }
|
||||
public virtual int MinBoatDamage { get { return 0; } }
|
||||
public virtual int MaxBoatDamage { get { return 0; } }
|
||||
public virtual int DamageRange { get { return 15; } }
|
||||
|
||||
public override double BonusPetDamageScalar { get { return 1.75; } }
|
||||
|
||||
public BaseSeaChampion(Mobile fisher, AIType ai, FightMode fm)
|
||||
: base(ai, fm)
|
||||
{
|
||||
m_NextBoatDamage = DateTime.UtcNow;
|
||||
m_InDamageMode = false;
|
||||
m_Fisher = fisher;
|
||||
|
||||
m_DamageEntries = new Dictionary<Mobile, int>();
|
||||
}
|
||||
|
||||
public override void OnThink()
|
||||
{
|
||||
base.OnThink();
|
||||
|
||||
if (m_InDamageMode)
|
||||
TryDamageBoat();
|
||||
|
||||
else if (CanDamageBoats && DateTime.UtcNow >= NextBoatDamage)
|
||||
m_InDamageMode = true;
|
||||
}
|
||||
|
||||
public override bool OnBeforeDeath()
|
||||
{
|
||||
RegisterDamageTo(this);
|
||||
AwardArtifact(GetArtifact());
|
||||
|
||||
return base.OnBeforeDeath();
|
||||
}
|
||||
|
||||
Dictionary<Mobile, int> m_DamageEntries;
|
||||
|
||||
public virtual void RegisterDamageTo(Mobile m)
|
||||
{
|
||||
if (m == null)
|
||||
return;
|
||||
|
||||
foreach (DamageEntry de in m.DamageEntries)
|
||||
{
|
||||
Mobile damager = de.Damager;
|
||||
|
||||
Mobile master = damager.GetDamageMaster(m);
|
||||
|
||||
if (master != null)
|
||||
damager = master;
|
||||
|
||||
RegisterDamage(damager, de.DamageGiven);
|
||||
}
|
||||
}
|
||||
|
||||
public void RegisterDamage(Mobile from, int amount)
|
||||
{
|
||||
if (from == null || !from.Player)
|
||||
return;
|
||||
|
||||
if (m_DamageEntries.ContainsKey(from))
|
||||
m_DamageEntries[from] += amount;
|
||||
else
|
||||
m_DamageEntries.Add(from, amount);
|
||||
}
|
||||
|
||||
public void AwardArtifact(Item artifact)
|
||||
{
|
||||
if (artifact == null)
|
||||
return;
|
||||
|
||||
int totalDamage = 0;
|
||||
|
||||
Dictionary<Mobile, int> validEntries = new Dictionary<Mobile, int>();
|
||||
|
||||
foreach (KeyValuePair<Mobile, int> kvp in m_DamageEntries)
|
||||
{
|
||||
if (IsEligible(kvp.Key, artifact))
|
||||
{
|
||||
validEntries.Add(kvp.Key, kvp.Value);
|
||||
totalDamage += kvp.Value;
|
||||
}
|
||||
}
|
||||
|
||||
int randomDamage = Utility.RandomMinMax(1, totalDamage);
|
||||
|
||||
totalDamage = 0;
|
||||
|
||||
foreach (KeyValuePair<Mobile, int> kvp in m_DamageEntries)
|
||||
{
|
||||
totalDamage += kvp.Value;
|
||||
|
||||
if (totalDamage > randomDamage)
|
||||
{
|
||||
GiveArtifact(kvp.Key, artifact);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (artifact != null)
|
||||
artifact.Delete();
|
||||
}
|
||||
|
||||
public void GiveArtifact(Mobile to, Item artifact)
|
||||
{
|
||||
if (to == null || artifact == null)
|
||||
return;
|
||||
|
||||
Container pack = to.Backpack;
|
||||
|
||||
if (pack == null || !pack.TryDropItem(to, artifact, false))
|
||||
artifact.Delete();
|
||||
else
|
||||
to.SendLocalizedMessage(1062317); // For your valor in combating the fallen beast, a special artifact has been bestowed on you.
|
||||
}
|
||||
|
||||
public bool IsEligible(Mobile m, Item Artifact)
|
||||
{
|
||||
return m.Player && m.Alive && m.InRange(Location, 32) && m.Backpack != null && m.Backpack.CheckHold(m, Artifact, false);
|
||||
}
|
||||
|
||||
public void TryDamageBoat()
|
||||
{
|
||||
Mobile focusMob = m_Fisher;
|
||||
|
||||
if (focusMob == null || !focusMob.Alive)
|
||||
focusMob = Combatant as Mobile;
|
||||
|
||||
if (focusMob == null || focusMob.AccessLevel > AccessLevel.Player || !InRange(focusMob.Location, DamageRange) || BaseBoat.FindBoatAt(focusMob, focusMob.Map) == null)
|
||||
return;
|
||||
|
||||
BaseBoat boat = BaseBoat.FindBoatAt(focusMob, focusMob.Map);
|
||||
|
||||
if (boat != null)
|
||||
{
|
||||
int range = DamageRange;
|
||||
for (int x = X - range; x <= X + range; x++)
|
||||
{
|
||||
for (int y = Y - range; y <= Y + range; y++)
|
||||
{
|
||||
if (BaseBoat.FindBoatAt(new Point2D(x, y), Map) == boat)
|
||||
{
|
||||
DoDamageBoat(boat);
|
||||
m_NextBoatDamage = DateTime.UtcNow + BoatDamageCooldown;
|
||||
m_InDamageMode = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void DoDamageBoat(BaseBoat boat)
|
||||
{
|
||||
int damage = Utility.RandomMinMax(MinBoatDamage, MaxBoatDamage);
|
||||
|
||||
boat.OnTakenDamage(this, damage);
|
||||
|
||||
for (int x = X - 2; x <= X + 2; x++)
|
||||
{
|
||||
for (int y = Y - 2; y <= Y + 2; y++)
|
||||
{
|
||||
BaseBoat b = BaseBoat.FindBoatAt(new Point2D(x, y), Map);
|
||||
|
||||
if (b != null && boat == b)
|
||||
{
|
||||
Direction toPush = Direction.North;
|
||||
if (X < x && x - X > 1)
|
||||
toPush = Direction.West;
|
||||
else if (X > x && X - x > 1)
|
||||
toPush = Direction.East;
|
||||
else if (Y < y)
|
||||
toPush = Direction.South;
|
||||
else if (Y > y)
|
||||
toPush = Direction.North;
|
||||
|
||||
boat.StartMove(toPush, 1, 0x2, boat.SlowDriftInterval, true, false);
|
||||
//TODO: Message and Sound?
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Point3D GetValidPoint(BaseBoat boat, Map map, int distance)
|
||||
{
|
||||
if (boat == null || map == null || map == Map.Internal)
|
||||
return new Point3D(X + Utility.RandomMinMax(-1, 1), Y + Utility.RandomMinMax(-1, 1), Z);
|
||||
|
||||
if (distance < 5) distance = 5;
|
||||
if (distance > 15) distance = 15;
|
||||
|
||||
int x = boat.X;
|
||||
int y = boat.Y;
|
||||
int z = boat.Z;
|
||||
int size = boat is BritannianShip ? 4 : 3;
|
||||
|
||||
int range = distance - size;
|
||||
if (range < 1) range = 1;
|
||||
|
||||
switch (boat.Facing)
|
||||
{
|
||||
default:
|
||||
case Direction.South:
|
||||
case Direction.North:
|
||||
x = Utility.RandomBool() ? Utility.RandomMinMax(x -= distance, x -= (distance - range)) : Utility.RandomMinMax(x += (distance - range), x += distance);
|
||||
y = Utility.RandomMinMax(y - 8, y + 8);
|
||||
z = map.GetAverageZ(x, y);
|
||||
break;
|
||||
case Direction.East:
|
||||
case Direction.West:
|
||||
x = Utility.RandomMinMax(x - 8, x + 8);
|
||||
y = Utility.RandomBool() ? Utility.RandomMinMax(y -= distance, y -= (distance - range)) : Utility.RandomMinMax(y += (distance - range), y += distance);
|
||||
z = map.GetAverageZ(x, y);
|
||||
break;
|
||||
}
|
||||
return new Point3D(x, y, z);
|
||||
}
|
||||
|
||||
public BaseSeaChampion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnHitByCannon(IShipCannon cannon, int damage)
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
m_NextBoatDamage = DateTime.UtcNow;
|
||||
m_DamageEntries = new Dictionary<Mobile, int>();
|
||||
}
|
||||
}
|
||||
}
|
||||
776
Scripts/Services/Expansions/High Seas/Mobiles/Charybdis.cs
Normal file
776
Scripts/Services/Expansions/High Seas/Mobiles/Charybdis.cs
Normal file
@@ -0,0 +1,776 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Multis;
|
||||
using System.Collections.Generic;
|
||||
using Server.Items;
|
||||
using Server.Misc;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class Charydbis : BaseSeaChampion
|
||||
{
|
||||
public static readonly TimeSpan SpawnRate = TimeSpan.FromSeconds(30);
|
||||
public static readonly TimeSpan TeleportRate = TimeSpan.FromSeconds(60);
|
||||
public static readonly int SpawnMax = 25;
|
||||
|
||||
private List<Mobile> m_Tentacles = new List<Mobile>();
|
||||
private DateTime m_NextSpawn;
|
||||
private DateTime m_NextTeleport;
|
||||
|
||||
public override bool CanDamageBoats { get { return true; } }
|
||||
public override TimeSpan BoatDamageCooldown { get { return TimeSpan.FromSeconds(Utility.RandomMinMax(45, 80)); } }
|
||||
public override int MinBoatDamage { get { return 5; } }
|
||||
public override int MaxBoatDamage { get { return 15; } }
|
||||
public override int DamageRange { get { return 10; } }
|
||||
|
||||
public override int Meat { get { return 5; } }
|
||||
public override double TreasureMapChance { get { return .50; } }
|
||||
public override int TreasureMapLevel { get { return 7; } }
|
||||
|
||||
public override Type[] UniqueList { get { return new Type[] { typeof(FishermansHat), typeof(FishermansVest), typeof(FishermansEelskinGloves), typeof(FishermansTrousers) }; } }
|
||||
public override Type[] SharedList { get { return new Type[] { typeof(HelmOfVengence), typeof(RingOfTheSoulbinder), typeof(RuneEngravedPegLeg), typeof(CullingBlade) }; } }
|
||||
public override Type[] DecorativeList { get { return new Type[] { typeof(EnchantedBladeDeed), typeof(EnchantedVortexDeed) }; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Tentacles { get { return m_Tentacles.Count; } }
|
||||
|
||||
[Constructable]
|
||||
public Charydbis() : this(null) { }
|
||||
|
||||
public Charydbis(Mobile fisher)
|
||||
: base(fisher, AIType.AI_Mage, FightMode.Closest)
|
||||
{
|
||||
RangeFight = 8;
|
||||
|
||||
Name = "charydbis";
|
||||
Body = 1244;
|
||||
BaseSoundID = 353;
|
||||
|
||||
m_NextSpawn = DateTime.UtcNow + SpawnRate;
|
||||
m_NextTeleport = DateTime.UtcNow + TeleportRate;
|
||||
|
||||
CanSwim = true;
|
||||
CantWalk = true;
|
||||
|
||||
SetStr(533, 586);
|
||||
SetDex(113, 131);
|
||||
SetInt(110, 155);
|
||||
|
||||
SetHits(30000);
|
||||
SetMana(8000);
|
||||
SetDamage(24, 33);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 50);
|
||||
SetDamageType(ResistanceType.Energy, 50);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 70, 80);
|
||||
SetResistance(ResistanceType.Fire, 70, 80);
|
||||
SetResistance(ResistanceType.Cold, 45, 55);
|
||||
SetResistance(ResistanceType.Poison, 80, 90);
|
||||
SetResistance(ResistanceType.Energy, 60, 70);
|
||||
|
||||
SetSkill(SkillName.Wrestling, 120.1, 121.2);
|
||||
SetSkill(SkillName.Tactics, 120.15, 123.1);
|
||||
SetSkill(SkillName.MagicResist, 165.2, 178.7);
|
||||
SetSkill(SkillName.Anatomy, 111.0, 111.7);
|
||||
SetSkill(SkillName.Magery, 134.6, 140.5);
|
||||
SetSkill(SkillName.EvalInt, 200.8, 243.6);
|
||||
SetSkill(SkillName.Meditation, 565);
|
||||
|
||||
Fame = 32000;
|
||||
Karma = -32000;
|
||||
|
||||
if (IsSoulboundEnemies)
|
||||
IsSoulbound = true;
|
||||
}
|
||||
|
||||
public void AddTentacle(Mobile tent)
|
||||
{
|
||||
if (!m_Tentacles.Contains(tent))
|
||||
m_Tentacles.Add(tent);
|
||||
}
|
||||
|
||||
public void RemoveTentacle(Mobile tent)
|
||||
{
|
||||
if (m_Tentacles.Contains(tent))
|
||||
m_Tentacles.Remove(tent);
|
||||
}
|
||||
|
||||
public override void OnThink()
|
||||
{
|
||||
base.OnThink();
|
||||
|
||||
if (m_NextSpawn < DateTime.UtcNow && m_Tentacles.Count < SpawnMax)
|
||||
SpawnTentacle();
|
||||
|
||||
if (m_NextTeleport < DateTime.UtcNow)
|
||||
DoTeleport();
|
||||
}
|
||||
|
||||
private Point3D m_LastLocation;
|
||||
private Map m_LastMap;
|
||||
|
||||
public void DoTeleport()
|
||||
{
|
||||
var combatant = Combatant as Mobile;
|
||||
|
||||
if (combatant == null)
|
||||
{
|
||||
m_NextTeleport = DateTime.UtcNow + TeleportRate;
|
||||
return;
|
||||
}
|
||||
|
||||
m_LastLocation = Location;
|
||||
m_LastMap = Map;
|
||||
DoTeleportEffects(m_LastLocation, m_LastMap);
|
||||
|
||||
Hidden = true;
|
||||
Internalize();
|
||||
|
||||
DoAreaLightningAttack(combatant);
|
||||
|
||||
Timer.DelayCall<Mobile>(TimeSpan.FromSeconds(3), FinishTeleport, combatant);
|
||||
m_NextTeleport = DateTime.UtcNow + TeleportRate;
|
||||
}
|
||||
|
||||
public void FinishTeleport(Mobile combatant)
|
||||
{
|
||||
Point3D focusLoc;
|
||||
|
||||
if (combatant == null || combatant.Map == null)
|
||||
{
|
||||
focusLoc = Location;
|
||||
}
|
||||
else
|
||||
{
|
||||
focusLoc = combatant.Location;
|
||||
}
|
||||
|
||||
Map map = m_LastMap;
|
||||
Point3D newLoc = Point3D.Zero;
|
||||
BaseBoat boat = BaseBoat.FindBoatAt(focusLoc, map);
|
||||
|
||||
for (int i = 0; i < 25; i++)
|
||||
{
|
||||
if (boat != null)
|
||||
{
|
||||
newLoc = GetValidPoint(boat, map, 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
int x = focusLoc.X + Utility.RandomMinMax(-12, 12);
|
||||
int y = focusLoc.Y + Utility.RandomMinMax(-12, 12);
|
||||
int z = map.GetAverageZ(x, y);
|
||||
|
||||
newLoc = new Point3D(x, y, z);
|
||||
}
|
||||
|
||||
LandTile t = map.Tiles.GetLandTile(newLoc.X, newLoc.Y);
|
||||
|
||||
if (!Spells.SpellHelper.CheckMulti(new Point3D(newLoc.X, newLoc.Y, newLoc.Z), map) && IsSeaTile(t))
|
||||
break;
|
||||
}
|
||||
|
||||
if (newLoc == Point3D.Zero || GetDistanceToSqrt(newLoc) > 15)
|
||||
newLoc = m_LastLocation;
|
||||
|
||||
DoTeleportEffects(newLoc, map);
|
||||
Hidden = false;
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(.5), new TimerStateCallback(TimedMoveToWorld), new object[] { newLoc, map, combatant });
|
||||
}
|
||||
|
||||
public void TimedMoveToWorld(object o)
|
||||
{
|
||||
object[] ojs = (object[])o;
|
||||
Point3D pnt = (Point3D)ojs[0];
|
||||
Map map = ojs[1] as Map;
|
||||
Mobile focus = ojs[2] as Mobile;
|
||||
|
||||
MoveToWorld(pnt, map);
|
||||
Combatant = focus;
|
||||
|
||||
DoAreaLightningAttack(focus);
|
||||
}
|
||||
|
||||
public void DoAreaLightningAttack(Mobile focus)
|
||||
{
|
||||
if (focus == null)
|
||||
return;
|
||||
|
||||
BaseBoat boat = BaseBoat.FindBoatAt(focus, focus.Map);
|
||||
|
||||
if (boat != null)
|
||||
{
|
||||
foreach (var mob in boat.GetMobilesOnBoard().Where(m => CanBeHarmful(m, false) && m.Alive))
|
||||
{
|
||||
double damage = Math.Max(40, Utility.RandomMinMax(50, 100) * ((double)Hits / (double)HitsMax));
|
||||
|
||||
mob.BoltEffect(0);
|
||||
AOS.Damage((Mobile)mob, this, (int)damage, false, 0, 0, 0, 0, 0, 0, 100, false, false, false);
|
||||
mob.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void DoTeleportEffects(Point3D p, Map map)
|
||||
{
|
||||
for (int x = -2; x <= 2; x++)
|
||||
{
|
||||
for (int y = -2; y <= 2; y++)
|
||||
{
|
||||
if (Math.Abs(x) == 2 && Math.Abs(y) == 2)
|
||||
continue;
|
||||
|
||||
Point3D pnt = new Point3D(p.X + x, p.Y + y, Map.GetAverageZ(p.X + x, p.Y + y));
|
||||
Effects.SendLocationEffect(pnt, map, 0x3728, 16, 4);
|
||||
}
|
||||
}
|
||||
|
||||
Effects.PlaySound(p, map, 0x025);
|
||||
Effects.PlaySound(p, map, 0x026);
|
||||
Effects.PlaySound(p, map, 0x027);
|
||||
}
|
||||
|
||||
private bool m_HasPushed;
|
||||
|
||||
public override void DoDamageBoat(BaseBoat boat)
|
||||
{
|
||||
if (boat == null)
|
||||
return;
|
||||
|
||||
m_HasPushed = false;
|
||||
IPoint2D pnt = boat;
|
||||
|
||||
if (Combatant != null && boat.Contains(Combatant))
|
||||
pnt = Combatant;
|
||||
|
||||
Direction dir = Utility.GetDirection(this, pnt);
|
||||
Point3DList path = new Point3DList();
|
||||
|
||||
for (int i = 0; i < DamageRange; i++)
|
||||
{
|
||||
int x = 0, y = 0;
|
||||
switch ((int)dir)
|
||||
{
|
||||
case (int)Direction.Running:
|
||||
case (int)Direction.North: { y -= i; break; }
|
||||
case 129:
|
||||
case (int)Direction.Right: { y -= i; x += i; break; }
|
||||
case 130:
|
||||
case (int)Direction.East: { x += i; break; }
|
||||
case 131:
|
||||
case (int)Direction.Down: { x += i; y += i; break; }
|
||||
case 132:
|
||||
case (int)Direction.South: { y += i; break; }
|
||||
case 133:
|
||||
case (int)Direction.Left: { y += i; x -= i; break; }
|
||||
case 134:
|
||||
case (int)Direction.West: { x -= i; break; }
|
||||
case (int)Direction.ValueMask:
|
||||
case (int)Direction.Up: { x -= i; y -= i; break; }
|
||||
}
|
||||
|
||||
path.Add(X + x, Y + y, Z);
|
||||
}
|
||||
|
||||
new EffectsTimer(this, path, dir, DamageRange);
|
||||
}
|
||||
|
||||
public void OnTick(Point3DList path, Direction dir, int i)
|
||||
{
|
||||
if (path.Count > i)
|
||||
{
|
||||
Point3D point = path[i];
|
||||
int o = i - 1;
|
||||
|
||||
Server.Effects.PlaySound(point, Map, 278);
|
||||
Server.Effects.PlaySound(point, Map, 279);
|
||||
|
||||
for (int rn = 0; rn < (o * 2) + 1; rn++)
|
||||
{
|
||||
int y = 0, x = 0, y2 = 0, x2 = 0;
|
||||
bool diag = false;
|
||||
switch ((int)dir)
|
||||
{
|
||||
case (int)Direction.Running:
|
||||
case (int)Direction.North: { x = x - o + rn; break; }
|
||||
case 129:
|
||||
case (int)Direction.Right: { x = x - o + rn; y = y - o + rn; break; }
|
||||
case 130:
|
||||
case (int)Direction.East: { y = y - o + rn; break; }
|
||||
case 131:
|
||||
case (int)Direction.Down: { y = y - o + rn; x = x + o - rn; break; }
|
||||
case 132:
|
||||
case (int)Direction.South: { x = x + o - rn; break; }
|
||||
case 133:
|
||||
case (int)Direction.Left: { x = x + o - rn; y = y + o - rn; break; }
|
||||
case 134:
|
||||
case (int)Direction.West: { y = y + o - rn; break; }
|
||||
case (int)Direction.ValueMask:
|
||||
case (int)Direction.Up: { y = y + o - rn; x = x - o + rn; break; }
|
||||
}
|
||||
switch ((int)dir)
|
||||
{
|
||||
case 129:
|
||||
case (int)Direction.Right: { y2++; diag = true; break; }
|
||||
case 131:
|
||||
case (int)Direction.Down: { x2--; diag = true; break; }
|
||||
case 133:
|
||||
case (int)Direction.Left: { y2--; diag = true; break; }
|
||||
case (int)Direction.ValueMask:
|
||||
case (int)Direction.Up: { x2++; diag = true; break; }
|
||||
default: { break; }
|
||||
}
|
||||
|
||||
Point3D ep = new Point3D(point.X + x, point.Y + y, point.Z);
|
||||
Point3D ep2 = new Point3D(ep.X + x2, ep.Y + y2, ep.Z);
|
||||
|
||||
if (diag && i >= ((2 * path.Count) / 3))
|
||||
return;
|
||||
|
||||
Point3D p;
|
||||
if (diag && rn < (o * 2))
|
||||
p = ep2;
|
||||
else
|
||||
p = ep;
|
||||
|
||||
if (Spells.SpellHelper.CheckMulti(p, Map))
|
||||
{
|
||||
BaseBoat boat = BaseBoat.FindBoatAt(p, Map);
|
||||
|
||||
if (boat != null && !m_HasPushed)
|
||||
{
|
||||
int damage = Utility.RandomMinMax(MinBoatDamage, MaxBoatDamage);
|
||||
boat.OnTakenDamage(this, damage);
|
||||
|
||||
boat.StartMove(dir, 1, 0x2, boat.SlowDriftInterval, true, false);
|
||||
m_HasPushed = true;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
LandTile t = Map.Tiles.GetLandTile(x, y);
|
||||
|
||||
if (IsSeaTile(t))
|
||||
{
|
||||
Mobile spawn = new EffectSpawn();
|
||||
spawn.MoveToWorld(p, Map);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class EffectSpawn : BaseCreature
|
||||
{
|
||||
public EffectSpawn()
|
||||
: base(AIType.AI_Vendor, FightMode.Closest, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
Body = 16;
|
||||
BaseSoundID = 278;
|
||||
CantWalk = true;
|
||||
CanSwim = false;
|
||||
Frozen = true;
|
||||
|
||||
SetHits(150000);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 100);
|
||||
SetResistance(ResistanceType.Fire, 100);
|
||||
SetResistance(ResistanceType.Cold, 100);
|
||||
SetResistance(ResistanceType.Poison, 100);
|
||||
SetResistance(ResistanceType.Energy, 100);
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(2), new TimerCallback(DoDelete));
|
||||
}
|
||||
|
||||
public override bool DeleteCorpseOnDeath
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public void DoDelete()
|
||||
{
|
||||
if (Alive)
|
||||
Kill();
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
Effects.SendLocationEffect(Location, Map, 0x352D, 16, 4);
|
||||
Effects.PlaySound(Location, Map, 0x364);
|
||||
|
||||
Effects.SendLocationParticles(EffectItem.Create(Location, Map, EffectItem.DefaultDuration), 0x3728, 1, 14, 0, 7, 9915, 0);
|
||||
|
||||
base.OnDelete();
|
||||
}
|
||||
|
||||
public override bool AutoDispel { get { return true; } }
|
||||
public override double AutoDispelChance { get { return 1.0; } }
|
||||
public override bool BardImmune { get { return true; } }
|
||||
public override bool Unprovokable { get { return true; } }
|
||||
public override bool Uncalmable { get { return true; } }
|
||||
public override Poison PoisonImmune { get { return Poison.Lethal; } }
|
||||
|
||||
public override int Meat { get { return 1; } }
|
||||
|
||||
public EffectSpawn(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();
|
||||
}
|
||||
}
|
||||
|
||||
private class EffectsTimer : Timer
|
||||
{
|
||||
private Direction m_Dir;
|
||||
private int m_I, m_IMax;
|
||||
private Point3DList m_Path;
|
||||
private Charydbis m_Mobile;
|
||||
|
||||
public EffectsTimer(Charydbis mobile, Point3DList path, Direction dir, int imax)
|
||||
: base(TimeSpan.FromSeconds(0.25), TimeSpan.FromSeconds(0.25))
|
||||
{
|
||||
m_Dir = dir;
|
||||
m_I = 1;
|
||||
m_IMax = imax;
|
||||
m_Path = path;
|
||||
m_Mobile = mobile;
|
||||
Priority = TimerPriority.FiftyMS;
|
||||
Start();
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Mobile.OnTick(m_Path, m_Dir, m_I);
|
||||
|
||||
if (m_I >= m_IMax)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
m_I++;
|
||||
}
|
||||
}
|
||||
|
||||
public void SpawnTentacle()
|
||||
{
|
||||
if (Combatant == null)
|
||||
{
|
||||
m_NextSpawn = DateTime.UtcNow + SpawnRate;
|
||||
return;
|
||||
}
|
||||
|
||||
Map map = Map;
|
||||
|
||||
List<Mobile> list = new List<Mobile>();
|
||||
|
||||
IPooledEnumerable eable = GetMobilesInRange(15);
|
||||
foreach (Mobile m in eable)
|
||||
{
|
||||
if (m == this || !CanBeHarmful(m))
|
||||
continue;
|
||||
|
||||
if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != Team))
|
||||
list.Add(m);
|
||||
else if (m.Player)
|
||||
list.Add(m);
|
||||
}
|
||||
eable.Free();
|
||||
|
||||
if (list.Count > 0)
|
||||
{
|
||||
Mobile spawn = list[Utility.Random(list.Count)];
|
||||
BaseBoat boat = BaseBoat.FindBoatAt(spawn, map);
|
||||
Point3D loc = spawn.Location;
|
||||
|
||||
for (int i = 0; i < 25; i++)
|
||||
{
|
||||
Point3D spawnLoc = Point3D.Zero;
|
||||
|
||||
if (boat != null)
|
||||
spawnLoc = GetValidPoint(boat, map, 4);
|
||||
else
|
||||
{
|
||||
int y = Utility.RandomMinMax(loc.X - 10, loc.Y + 10);
|
||||
int x = Utility.RandomMinMax(loc.X - 10, loc.Y + 10);
|
||||
int z = map.GetAverageZ(x, y);
|
||||
|
||||
spawnLoc = new Point3D(x, y, z);
|
||||
}
|
||||
|
||||
if (Spells.SpellHelper.CheckMulti(spawnLoc, map))
|
||||
continue;
|
||||
|
||||
LandTile t = map.Tiles.GetLandTile(spawnLoc.X, spawnLoc.Y);
|
||||
|
||||
if (IsSeaTile(t) && spawnLoc != Point3D.Zero)
|
||||
{
|
||||
GiantTentacle tent = new GiantTentacle(this);
|
||||
|
||||
tent.MoveToWorld(spawnLoc, map);
|
||||
tent.Home = tent.Location;
|
||||
tent.RangeHome = 15;
|
||||
tent.Team = Team;
|
||||
if (spawn != this)
|
||||
tent.Combatant = spawn;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
m_NextSpawn = DateTime.UtcNow + SpawnRate;
|
||||
}
|
||||
|
||||
public bool IsSeaTile(LandTile t)
|
||||
{
|
||||
return t.Z == -5 && ((t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137));
|
||||
}
|
||||
|
||||
public override bool OnBeforeDeath()
|
||||
{
|
||||
if (Map == Map.Internal)
|
||||
MoveToWorld(m_LastLocation, m_LastMap);
|
||||
|
||||
if (CharydbisSpawner.SpawnInstance != null && CharydbisSpawner.SpawnInstance.Charydbis == this)
|
||||
CharydbisSpawner.SpawnInstance.OnCharybdisKilled();
|
||||
|
||||
return base.OnBeforeDeath();
|
||||
}
|
||||
|
||||
public override void OnDeath(Container c)
|
||||
{
|
||||
base.OnDeath(c);
|
||||
|
||||
int drop = Utility.RandomMinMax(2, 5);
|
||||
|
||||
for (int i = 0; i < drop; i++)
|
||||
{
|
||||
Type pieType = m_Pies[Utility.Random(m_Pies.Length)];
|
||||
|
||||
Item pie = Loot.Construct(pieType);
|
||||
|
||||
if (pie != null)
|
||||
c.DropItem(pie);
|
||||
}
|
||||
|
||||
drop = Utility.RandomMinMax(2, 5);
|
||||
|
||||
for (int i = 0; i < drop; i++)
|
||||
{
|
||||
Type steakType = m_Steaks[Utility.Random(m_Steaks.Length)];
|
||||
|
||||
Item steak = Loot.Construct(steakType);
|
||||
|
||||
if (steak != null)
|
||||
c.DropItem(steak);
|
||||
}
|
||||
|
||||
c.DropItem(new MessageInABottle(c.Map));
|
||||
c.DropItem(new SpecialFishingNet());
|
||||
c.DropItem(new SpecialFishingNet());
|
||||
c.DropItem(new SpecialFishingNet());
|
||||
c.DropItem(new SpecialFishingNet());
|
||||
|
||||
FishingPole pole = new FishingPole();
|
||||
BaseRunicTool.ApplyAttributesTo(pole, false, 0, Utility.RandomMinMax(2, 5), 50, 100);
|
||||
c.DropItem(pole);
|
||||
|
||||
#region TOL
|
||||
if (Core.TOL)
|
||||
SkillMasteryPrimer.CheckPrimerDrop(this);
|
||||
#endregion
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
if (m_Tentacles != null)
|
||||
{
|
||||
List<Mobile> tents = new List<Mobile>(m_Tentacles);
|
||||
for (int i = 0; i < tents.Count; i++)
|
||||
{
|
||||
if (tents[i] != null)
|
||||
tents[i].Kill();
|
||||
}
|
||||
}
|
||||
|
||||
base.Delete();
|
||||
}
|
||||
|
||||
private Type[] m_Pies = new Type[]
|
||||
{
|
||||
typeof(AutumnDragonfishPie),
|
||||
typeof(BlueLobsterPie),
|
||||
typeof(BullFishPie),
|
||||
typeof(CrystalFishPie),
|
||||
typeof(FairySalmonPie),
|
||||
typeof(FireFishPie),
|
||||
typeof(GiantKoiPie),
|
||||
typeof(GreatBarracudaPie),
|
||||
typeof(HolyMackerelPie),
|
||||
typeof(LavaFishPie),
|
||||
typeof(ReaperFishPie),
|
||||
typeof(SpiderCrabPie),
|
||||
typeof(StoneCrabPie),
|
||||
typeof(SummerDragonfishPie),
|
||||
typeof(UnicornFishPie),
|
||||
typeof(YellowtailBarracudaPie),
|
||||
};
|
||||
|
||||
private Type[] m_Steaks = new Type[]
|
||||
{
|
||||
typeof(AutumnDragonfishSteak),
|
||||
typeof(BlueLobsterMeat),
|
||||
typeof(BullFishSteak),
|
||||
typeof(CrystalFishSteak),
|
||||
typeof(FairySalmonSteak),
|
||||
typeof(FireFishSteak),
|
||||
typeof(GiantKoiSteak),
|
||||
typeof(GreatBarracudaSteak),
|
||||
typeof(HolyMackerelSteak),
|
||||
typeof(LavaFishSteak),
|
||||
typeof(ReaperFishSteak),
|
||||
typeof(SpiderCrabMeat),
|
||||
typeof(StoneCrabMeat),
|
||||
typeof(SummerDragonfishSteak),
|
||||
typeof(UnicornFishSteak),
|
||||
typeof(YellowtailBarracudaSteak),
|
||||
};
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot(LootPack.SuperBoss, 8);
|
||||
}
|
||||
|
||||
public Charydbis(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write(m_Tentacles.Count);
|
||||
foreach (Mobile tent in m_Tentacles)
|
||||
writer.Write(tent);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
int cnt = reader.ReadInt();
|
||||
for (int i = 0; i < cnt; i++)
|
||||
{
|
||||
Mobile tent = reader.ReadMobile();
|
||||
if (tent != null && !tent.Deleted && tent.Alive)
|
||||
m_Tentacles.Add(tent);
|
||||
}
|
||||
|
||||
m_NextSpawn = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
|
||||
public class GiantTentacle : BaseCreature
|
||||
{
|
||||
private Mobile m_Master;
|
||||
|
||||
public GiantTentacle(Mobile master) : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
if (master is Charydbis)
|
||||
{
|
||||
m_Master = master;
|
||||
((Charydbis)master).AddTentacle(this);
|
||||
}
|
||||
|
||||
Name = "a giant tentacle";
|
||||
Body = 1245;
|
||||
BaseSoundID = 0x161;
|
||||
|
||||
CanSwim = true;
|
||||
|
||||
SetStr(127, 155);
|
||||
SetDex(66, 85);
|
||||
SetInt(102, 123);
|
||||
|
||||
SetHits(105, 113);
|
||||
|
||||
SetDamage(10, 15);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 50);
|
||||
SetDamageType(ResistanceType.Cold, 50);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 35, 45);
|
||||
SetResistance(ResistanceType.Fire, 10, 25);
|
||||
SetResistance(ResistanceType.Cold, 10, 25);
|
||||
SetResistance(ResistanceType.Poison, 60, 70);
|
||||
SetResistance(ResistanceType.Energy, 5, 10);
|
||||
|
||||
SetSkill(SkillName.Wrestling, 52.0, 70.0);
|
||||
SetSkill(SkillName.Tactics, 0.0);
|
||||
SetSkill(SkillName.MagicResist, 100.4, 113.5);
|
||||
SetSkill(SkillName.Anatomy, 1.0, 0.0);
|
||||
SetSkill(SkillName.Magery, 60.2, 72.4);
|
||||
SetSkill(SkillName.EvalInt, 60.1, 73.4);
|
||||
SetSkill(SkillName.Meditation, 100.0);
|
||||
|
||||
Fame = 2500;
|
||||
Karma = -2500;
|
||||
|
||||
if (IsSoulboundEnemies)
|
||||
IsSoulbound = true;
|
||||
}
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot(LootPack.FilthyRich, 1);
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
if (m_Master != null && m_Master is Charydbis)
|
||||
((Charydbis)m_Master).RemoveTentacle(this);
|
||||
|
||||
base.Delete();
|
||||
}
|
||||
|
||||
public GiantTentacle(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write(m_Master);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Master = reader.ReadMobile();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class BoundSoul : BaseCreature
|
||||
{
|
||||
public override bool AlwaysMurderer { get { return true; } }
|
||||
|
||||
public BoundSoul()
|
||||
: base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
Name = "a bound soul";
|
||||
Body = 0x3CA;
|
||||
Hue = 0x4001;
|
||||
|
||||
SetStr(150, 180);
|
||||
SetDex(120, 150);
|
||||
SetInt(20, 40);
|
||||
|
||||
SetHits(600, 620);
|
||||
|
||||
SetDamage(17, 22);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 10);
|
||||
SetDamageType(ResistanceType.Cold, 30);
|
||||
SetDamageType(ResistanceType.Poison, 30);
|
||||
SetDamageType(ResistanceType.Energy, 30);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 80, 95);
|
||||
SetResistance(ResistanceType.Fire, 30, 40);
|
||||
SetResistance(ResistanceType.Cold, 20, 30);
|
||||
SetResistance(ResistanceType.Poison, 70, 80);
|
||||
SetResistance(ResistanceType.Energy, 30, 40);
|
||||
|
||||
SetSkill(SkillName.Wrestling, 100.0, 110.0);
|
||||
SetSkill(SkillName.Tactics, 110.0);
|
||||
SetSkill(SkillName.MagicResist, 100.0, 115.0);
|
||||
|
||||
Fame = 5000;
|
||||
Karma = -5000;
|
||||
}
|
||||
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot(LootPack.FilthyRich, 3);
|
||||
}
|
||||
|
||||
public BoundSoul(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int TreasureMapLevel { get { return 3; } }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,508 @@
|
||||
using Server;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Items;
|
||||
using Server.Misc;
|
||||
using Server.Regions;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class CorgulTheSoulBinder : BaseSeaChampion
|
||||
{
|
||||
private DateTime m_NextDismount;
|
||||
private DateTime m_NextArea;
|
||||
private DateTime m_NextReturn;
|
||||
private bool m_HasDone2ndSpawn;
|
||||
private CorgulAltar m_Altar;
|
||||
private List<BaseCreature> m_Helpers = new List<BaseCreature>();
|
||||
|
||||
public override bool CanDamageBoats { get { return false; } }
|
||||
public override bool TaintedLifeAura { get { return true; } }
|
||||
public override int Meat { get { return 5; } }
|
||||
public override double TreasureMapChance { get { return .25; } }
|
||||
public override int TreasureMapLevel { get { return 7; } }
|
||||
public override Poison PoisonImmune { get { return Poison.Deadly; } }
|
||||
|
||||
public override bool TeleportsTo { get { return true; } }
|
||||
public override TimeSpan TeleportDuration { get { return TimeSpan.FromSeconds(Utility.RandomMinMax(10, 50)); } }
|
||||
public override double TeleportProb { get { return 1.0; } }
|
||||
public override bool TeleportsPets { get { return true; } }
|
||||
|
||||
public override Type[] UniqueList { get { return new Type[] { typeof(CorgulsEnchantedSash), typeof(CorgulsHandbookOnMysticism), typeof(CorgulsHandbookOnTheUndead) }; } }
|
||||
public override Type[] SharedList { get { return new Type[] { typeof(HelmOfVengence), typeof(RingOfTheSoulbinder), typeof(RuneEngravedPegLeg), typeof(CullingBlade) }; } }
|
||||
public override Type[] DecorativeList { get { return new Type[] { typeof(EnchantedBladeDeed), typeof(EnchantedVortexDeed) }; } }
|
||||
|
||||
public override bool NoGoodies { get { return true; } }
|
||||
public override bool CanGivePowerscrolls { get { return false; } }
|
||||
|
||||
private readonly int _SpawnPerLoc = 15;
|
||||
|
||||
private Point3D[] _SpawnLocs =
|
||||
{
|
||||
new Point3D(6447, 1262, 10),
|
||||
new Point3D(6424, 1279, 10),
|
||||
new Point3D(6406, 1250, 10),
|
||||
new Point3D(6423, 1220, 10),
|
||||
new Point3D(6461, 1237, 10),
|
||||
};
|
||||
|
||||
[Constructable]
|
||||
public CorgulTheSoulBinder()
|
||||
: this(null)
|
||||
{
|
||||
}
|
||||
|
||||
public CorgulTheSoulBinder(CorgulAltar altar)
|
||||
: base(null, AIType.AI_NecroMage, FightMode.Closest)
|
||||
{
|
||||
m_Altar = altar;
|
||||
Name = "Corgul the Soulbinder";
|
||||
BaseSoundID = 609;
|
||||
Body = 0x4C;
|
||||
Hue = 2076;
|
||||
|
||||
m_NextDismount = DateTime.UtcNow;
|
||||
m_NextArea = DateTime.UtcNow;
|
||||
m_HasDone2ndSpawn = false;
|
||||
|
||||
SetStr(800, 900);
|
||||
SetDex(121, 165);
|
||||
SetInt(300, 400);
|
||||
|
||||
SetMana(4500);
|
||||
SetHits(65000);
|
||||
|
||||
SetDamage(19, 24);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 10);
|
||||
SetDamageType(ResistanceType.Fire, 10);
|
||||
SetDamageType(ResistanceType.Cold, 30);
|
||||
SetDamageType(ResistanceType.Poison, 40);
|
||||
SetDamageType(ResistanceType.Energy, 10);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 50, 60);
|
||||
SetResistance(ResistanceType.Fire, 80, 90);
|
||||
SetResistance(ResistanceType.Cold, 85, 95);
|
||||
SetResistance(ResistanceType.Poison, 80, 90);
|
||||
SetResistance(ResistanceType.Energy, 80, 90);
|
||||
|
||||
SetSkill(SkillName.Wrestling, 110.0, 120.0);
|
||||
SetSkill(SkillName.Tactics, 110.0, 120.0);
|
||||
SetSkill(SkillName.Magery, 110.9, 120.0);
|
||||
SetSkill(SkillName.EvalInt, 110.9, 120.0);
|
||||
SetSkill(SkillName.Meditation, 110.9, 120.0);
|
||||
SetSkill(SkillName.Necromancy, 110.9, 120.0);
|
||||
SetSkill(SkillName.SpiritSpeak, 110.9, 120.0);
|
||||
|
||||
Fame = 25000;
|
||||
Karma = -25000;
|
||||
|
||||
m_NextReturn = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(120, 180));
|
||||
|
||||
if (IsSoulboundEnemies)
|
||||
IsSoulbound = true;
|
||||
}
|
||||
|
||||
public double SharedChance { get { return Map != null && Map.Rules == MapRules.FeluccaRules ? .12 : .08; } }
|
||||
public double DecorativeChance { get { return Map != null && Map.Rules == MapRules.FeluccaRules ? .40 : .25; } }
|
||||
|
||||
public override bool OnBeforeDeath()
|
||||
{
|
||||
List<DamageStore> rights = GetLootingRights();
|
||||
|
||||
Mobile winner = null;
|
||||
|
||||
if (rights != null && rights.Count > 0)
|
||||
{
|
||||
rights.Sort();
|
||||
|
||||
if(rights.Count >= 5)
|
||||
winner = rights[Utility.Random(5)].m_Mobile;
|
||||
else if(rights.Count > 1)
|
||||
winner = rights[Utility.Random(rights.Count)].m_Mobile;
|
||||
else
|
||||
winner = rights[0].m_Mobile;
|
||||
}
|
||||
|
||||
if(winner != null)
|
||||
GiveArtifact(winner, CreateArtifact(UniqueList));
|
||||
|
||||
if (IsSoulboundEnemies)
|
||||
EtherealSandShower.Do(Location, Map, 50, 100, 500);
|
||||
|
||||
return base.OnBeforeDeath();
|
||||
}
|
||||
|
||||
public override Item GetArtifact()
|
||||
{
|
||||
double random = Utility.RandomDouble();
|
||||
|
||||
if (SharedChance >= random)
|
||||
return CreateArtifact(SharedList);
|
||||
else if (DecorativeChance >= random)
|
||||
return CreateArtifact(DecorativeList);
|
||||
return null;
|
||||
}
|
||||
|
||||
public void SpawnHelpers()
|
||||
{
|
||||
foreach (var pnt in _SpawnLocs)
|
||||
{
|
||||
for (int i = 0; i < _SpawnPerLoc; i++)
|
||||
{
|
||||
BaseCreature bc;
|
||||
|
||||
switch (Utility.Random(7))
|
||||
{
|
||||
default:
|
||||
case 0: bc = new BoundSoul(); break;
|
||||
case 1: bc = new SoulboundApprenticeMage(); break;
|
||||
case 2: bc = new SoulboundBattleMage(); break;
|
||||
case 3: bc = new SoulboundPirateCaptain(); break;
|
||||
case 4: bc = new SoulboundPirateRaider(); break;
|
||||
case 5: bc = new SoulboundSpellSlinger(); break;
|
||||
case 6: bc = new SoulboundSwashbuckler(); break;
|
||||
}
|
||||
|
||||
m_Helpers.Add(bc);
|
||||
SpawnMobile(bc, pnt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SpawnMobile(BaseCreature bc, Point3D p)
|
||||
{
|
||||
if(Map == null || bc == null)
|
||||
{
|
||||
if(bc != null)
|
||||
bc.Delete();
|
||||
return;
|
||||
}
|
||||
|
||||
int x, y, z = 0;
|
||||
|
||||
for(int i = 0; i < 25; i++)
|
||||
{
|
||||
x = Utility.RandomMinMax(p.X - 4, p.X + 4);
|
||||
y = Utility.RandomMinMax(p.Y - 4, p.Y + 4);
|
||||
z = Map.GetAverageZ(x, y);
|
||||
|
||||
if (Map.CanSpawnMobile(x, y, z))
|
||||
{
|
||||
p = new Point3D(x, y, z);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bc.MoveToWorld(p, Map);
|
||||
bc.Home = p;
|
||||
bc.RangeHome = 5;
|
||||
}
|
||||
|
||||
public override void OnThink()
|
||||
{
|
||||
base.OnThink();
|
||||
|
||||
if (m_NextReturn < DateTime.UtcNow)
|
||||
{
|
||||
Point3D p = CorgulAltar.SpawnLoc;
|
||||
|
||||
if (Region.IsPartOf<CorgulRegion>() && !Utility.InRange(Location, p, 15))
|
||||
{
|
||||
PlaySound(0x1FE);
|
||||
FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
|
||||
|
||||
Location = p;
|
||||
ProcessDelta();
|
||||
|
||||
PlaySound(0x1FE);
|
||||
FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
|
||||
|
||||
m_NextReturn = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(120, 180));
|
||||
}
|
||||
}
|
||||
|
||||
if (Combatant == null)
|
||||
return;
|
||||
|
||||
if (DateTime.UtcNow > m_NextDismount && 0.1 > Utility.RandomDouble())
|
||||
DoDismount();
|
||||
|
||||
else if (DateTime.UtcNow > m_NextArea && 0.1 > Utility.RandomDouble())
|
||||
DoAreaAttack();
|
||||
|
||||
if (!m_HasDone2ndSpawn && m_Helpers.Count > 0)
|
||||
{
|
||||
if (m_Helpers.Where(bc => bc.Alive && !bc.Deleted).Count() == 0)
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(5), SpawnHelpers);
|
||||
m_HasDone2ndSpawn = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void DoDismount()
|
||||
{
|
||||
List<Mobile> targets = new List<Mobile>();
|
||||
|
||||
IPooledEnumerable eable = GetMobilesInRange(12);
|
||||
foreach (Mobile mob in eable)
|
||||
{
|
||||
if (!CanBeHarmful(mob) || mob == this)
|
||||
continue;
|
||||
if (mob is BaseCreature && (((BaseCreature)mob).Controlled || ((BaseCreature)mob).Summoned || ((BaseCreature)mob).Team != Team))
|
||||
targets.Add(mob);
|
||||
else if (mob is PlayerMobile && mob.Alive)
|
||||
targets.Add(mob);
|
||||
}
|
||||
eable.Free();
|
||||
|
||||
PlaySound(0x2F3);
|
||||
for (int i = 0; i < targets.Count; ++i)
|
||||
{
|
||||
Mobile m = (Mobile)targets[i];
|
||||
|
||||
if (m != null && !m.Deleted && m is PlayerMobile)
|
||||
{
|
||||
PlayerMobile pm = m as PlayerMobile;
|
||||
|
||||
if (pm != null && (pm.Mounted || pm.Flying))
|
||||
{
|
||||
pm.SetMountBlock(BlockMountType.DismountRecovery, TimeSpan.FromSeconds(10), true);
|
||||
}
|
||||
}
|
||||
|
||||
double damage = m.Hits * 0.6;
|
||||
if (damage < 10.0)
|
||||
damage = 10.0;
|
||||
else if (damage > 75.0)
|
||||
damage = 75.0;
|
||||
DoHarmful(m);
|
||||
AOS.Damage(m, this, (int)damage, 100, 0, 0, 0, 0);
|
||||
if (m.Alive && m.Body.IsHuman && !m.Mounted)
|
||||
m.Animate(20, 7, 1, true, false, 0);
|
||||
}
|
||||
|
||||
|
||||
m_NextDismount = DateTime.UtcNow + TimeSpan.FromMinutes(2);
|
||||
}
|
||||
|
||||
public void DoAreaAttack()
|
||||
{
|
||||
int range = 18;
|
||||
|
||||
new InternalTimer(this, range);
|
||||
|
||||
IPooledEnumerable eable = GetMobilesInRange(range);
|
||||
foreach (Mobile m in eable)
|
||||
{
|
||||
if ((m is PlayerMobile || (m is BaseCreature && ((BaseCreature)m).GetMaster() is PlayerMobile)) && CanBeHarmful(m))
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1), new TimerStateCallback(DoDamage_Callback), m);
|
||||
}
|
||||
eable.Free();
|
||||
|
||||
m_NextArea = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(60, 180));
|
||||
}
|
||||
|
||||
public void DoDamage_Callback(object o)
|
||||
{
|
||||
Mobile m = (Mobile)o;
|
||||
|
||||
if (m != null)
|
||||
{
|
||||
DoHarmful(m);
|
||||
AOS.Damage(m, this, Utility.RandomMinMax(100, 150), 0, 100, 0, 0, 0);
|
||||
|
||||
if (Utility.RandomBool())
|
||||
{
|
||||
WeaponAbility bleed = WeaponAbility.BleedAttack;
|
||||
bleed.OnHit(this, m, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void DoEffect(Point3D p, Map map)
|
||||
{
|
||||
int[] effect = new int[] { 14000, 14013 };
|
||||
Effects.PlaySound(p, map, 0x307);
|
||||
Effects.SendLocationEffect(p, map, Utility.RandomBool() ? 14000 : 14013, 20);
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private CorgulTheSoulBinder m_Mobile;
|
||||
private int m_Tick;
|
||||
|
||||
public InternalTimer(CorgulTheSoulBinder mob, int range)
|
||||
: base(TimeSpan.FromMilliseconds(100), TimeSpan.FromMilliseconds(100), range)
|
||||
{
|
||||
m_Tick = 1;
|
||||
m_Mobile = mob;
|
||||
Priority = TimerPriority.FiftyMS;
|
||||
Start();
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
Geometry.Circle2D(m_Mobile.Location, m_Mobile.Map, m_Tick, new DoEffect_Callback(m_Mobile.DoEffect));
|
||||
|
||||
m_Tick++;
|
||||
}
|
||||
}
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot(LootPack.SuperBoss, 6);
|
||||
}
|
||||
|
||||
public override void OnDeath(Container c)
|
||||
{
|
||||
base.OnDeath(c);
|
||||
|
||||
if (m_Altar != null)
|
||||
m_Altar.OnBossKilled();
|
||||
|
||||
c.DropItem(new MessageInABottle(c.Map));
|
||||
c.DropItem(new SpecialFishingNet());
|
||||
c.DropItem(new SpecialFishingNet());
|
||||
|
||||
if (m_Helpers != null)
|
||||
{
|
||||
foreach (BaseCreature bc in m_Helpers)
|
||||
{
|
||||
RegisterDamageTo(bc);
|
||||
|
||||
if (bc != null && bc.Alive)
|
||||
bc.Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public CorgulTheSoulBinder(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
writer.Write(m_HasDone2ndSpawn);
|
||||
writer.Write(m_Altar);
|
||||
writer.Write(m_Helpers.Count);
|
||||
foreach (BaseCreature bc in m_Helpers)
|
||||
writer.Write(bc);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
m_HasDone2ndSpawn = reader.ReadBool();
|
||||
goto case 0;
|
||||
case 0:
|
||||
m_Altar = reader.ReadItem() as CorgulAltar;
|
||||
|
||||
int cnt = reader.ReadInt();
|
||||
for (int i = 0; i < cnt; i++)
|
||||
{
|
||||
BaseCreature bc = reader.ReadMobile() as BaseCreature;
|
||||
if (bc != null)
|
||||
m_Helpers.Add(bc);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
m_NextDismount = DateTime.UtcNow;
|
||||
m_NextArea = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
|
||||
public class EtherealSandShower
|
||||
{
|
||||
public static void Do(Point3D center, Map map, int piles, int minAmount, int maxAmount)
|
||||
{
|
||||
new GoodiesTimer(center, map, piles, minAmount, maxAmount).Start();
|
||||
}
|
||||
|
||||
private class GoodiesTimer : Timer
|
||||
{
|
||||
private readonly Map m_Map;
|
||||
private readonly Point3D m_Location;
|
||||
private readonly int m_PilesMax;
|
||||
private int m_PilesDone = 0;
|
||||
private readonly int m_MinAmount;
|
||||
private readonly int m_MaxAmount;
|
||||
|
||||
public GoodiesTimer(Point3D center, Map map, int piles, int minAmount, int maxAmount)
|
||||
: base(TimeSpan.FromSeconds(0.25d), TimeSpan.FromSeconds(0.25d))
|
||||
{
|
||||
m_Location = center;
|
||||
m_Map = map;
|
||||
m_PilesMax = piles;
|
||||
m_MinAmount = minAmount;
|
||||
m_MaxAmount = maxAmount;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (m_PilesDone >= m_PilesMax)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
Point3D p = FindGoldLocation(m_Map, m_Location, m_PilesMax / 8);
|
||||
EtherealSand g = new EtherealSand(m_MinAmount, m_MaxAmount);
|
||||
g.MoveToWorld(p, m_Map);
|
||||
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 0: // Fire column
|
||||
Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);
|
||||
Effects.PlaySound(g, g.Map, 0x208);
|
||||
break;
|
||||
case 1: // Explosion
|
||||
Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36BD, 20, 10, 5044);
|
||||
Effects.PlaySound(g, g.Map, 0x307);
|
||||
break;
|
||||
case 2: // Ball of fire
|
||||
Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36FE, 10, 10, 5052);
|
||||
break;
|
||||
}
|
||||
++m_PilesDone;
|
||||
}
|
||||
|
||||
private static Point3D FindGoldLocation(Map map, Point3D center, int range)
|
||||
{
|
||||
int cx = center.X;
|
||||
int cy = center.Y;
|
||||
|
||||
for (int i = 0; i < 20; ++i)
|
||||
{
|
||||
int x = cx + Utility.Random(range * 2) - range;
|
||||
int y = cy + Utility.Random(range * 2) - range;
|
||||
if ((cx - x) * (cx - x) + (cy - y) * (cy - y) > range * range)
|
||||
continue;
|
||||
|
||||
int z = map.GetAverageZ(x, y);
|
||||
if (!map.CanFit(x, y, z, 6, false, false))
|
||||
continue;
|
||||
|
||||
int topZ = z;
|
||||
foreach (Item item in map.GetItemsInRange(new Point3D(x, y, z), 0))
|
||||
{
|
||||
topZ = Math.Max(topZ, item.Z + item.ItemData.CalcHeight);
|
||||
}
|
||||
return new Point3D(x, y, topZ);
|
||||
}
|
||||
return center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class SoulboundApprenticeMage : EvilMage
|
||||
{
|
||||
[Constructable]
|
||||
public SoulboundApprenticeMage()
|
||||
{
|
||||
Title = "the soulbound apprentice mage";
|
||||
|
||||
SetStr(115);
|
||||
SetDex(97);
|
||||
SetInt(106);
|
||||
|
||||
SetHits(128);
|
||||
SetMana(210);
|
||||
|
||||
SetDamage(5, 10);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 100);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 20);
|
||||
SetResistance(ResistanceType.Fire, 21);
|
||||
SetResistance(ResistanceType.Cold, 22);
|
||||
SetResistance(ResistanceType.Poison, 20);
|
||||
SetResistance(ResistanceType.Energy, 25);
|
||||
|
||||
SetSkill(SkillName.Wrestling, 40.0, 50.0);
|
||||
SetSkill(SkillName.MagicResist, 40.0, 50.0);
|
||||
SetSkill(SkillName.Magery, 60.2, 72.4);
|
||||
SetSkill(SkillName.EvalInt, 60.1, 73.4);
|
||||
SetSkill(SkillName.Meditation, 40.0, 50.0);
|
||||
|
||||
Fame = 1000;
|
||||
Karma = -1000;
|
||||
}
|
||||
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot(LootPack.Rich, 3);
|
||||
}
|
||||
|
||||
public SoulboundApprenticeMage(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class SoulboundBattleMage : EvilMageLord
|
||||
{
|
||||
[Constructable]
|
||||
public SoulboundBattleMage()
|
||||
{
|
||||
Title = "the soulbound battle mage";
|
||||
|
||||
SetStr(156);
|
||||
SetDex(101);
|
||||
SetInt(181);
|
||||
|
||||
SetHits(419);
|
||||
SetMana(619);
|
||||
|
||||
SetDamage(12, 17);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 20);
|
||||
SetDamageType(ResistanceType.Fire, 20);
|
||||
SetDamageType(ResistanceType.Cold, 20);
|
||||
SetDamageType(ResistanceType.Poison, 20);
|
||||
SetDamageType(ResistanceType.Energy, 20);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 50, 60);
|
||||
SetResistance(ResistanceType.Fire, 50, 60);
|
||||
SetResistance(ResistanceType.Cold, 50, 60);
|
||||
SetResistance(ResistanceType.Poison, 50, 60);
|
||||
SetResistance(ResistanceType.Energy, 50, 60);
|
||||
|
||||
SetSkill(SkillName.Wrestling, 120.0, 125.0);
|
||||
SetSkill(SkillName.Tactics, 110.0, 120.0);
|
||||
SetSkill(SkillName.MagicResist, 100.0, 110.0);
|
||||
SetSkill(SkillName.Anatomy, 1.0, 0.0);
|
||||
SetSkill(SkillName.Magery, 105.0, 110.0);
|
||||
SetSkill(SkillName.EvalInt, 95.0, 100.0);
|
||||
SetSkill(SkillName.Meditation, 20.0, 30.0);
|
||||
|
||||
Fame = 5000;
|
||||
Karma = -5000;
|
||||
}
|
||||
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot(LootPack.FilthyRich, 3);
|
||||
}
|
||||
|
||||
public SoulboundBattleMage(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class SoulboundPirateCaptain : BaseCreature
|
||||
{
|
||||
public override bool ClickTitle { get { return false; } }
|
||||
public override bool AlwaysMurderer { get { return true; } }
|
||||
|
||||
public SoulboundPirateCaptain()
|
||||
: base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
Name = "a soulbound pirate captain";
|
||||
Body = 0x190;
|
||||
Hue = Utility.RandomSkinHue();
|
||||
Utility.AssignRandomHair(this);
|
||||
|
||||
SetStr(150, 200);
|
||||
SetDex(150);
|
||||
SetInt(95, 110);
|
||||
|
||||
SetHits(450, 600);
|
||||
|
||||
SetDamage(20, 28);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 100);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 45, 55);
|
||||
SetResistance(ResistanceType.Fire, 45, 55);
|
||||
SetResistance(ResistanceType.Cold, 45, 55);
|
||||
SetResistance(ResistanceType.Poison, 45, 55);
|
||||
SetResistance(ResistanceType.Energy, 45, 55);
|
||||
|
||||
SetSkill(SkillName.MagicResist, 100.0, 120.0);
|
||||
SetSkill(SkillName.Swords, 110.0, 120.0);
|
||||
SetSkill(SkillName.Tactics, 110.0, 120.0);
|
||||
SetSkill(SkillName.Anatomy, 110.0, 120.0);
|
||||
|
||||
Fame = 8000;
|
||||
Karma = -8000;
|
||||
|
||||
AddItem(new TricorneHat(1));
|
||||
AddItem(new LeatherArms());
|
||||
AddItem(new FancyShirt(1));
|
||||
AddItem(new ShortPants(1));
|
||||
AddItem(new Cutlass());
|
||||
AddItem(new Boots(Utility.RandomNeutralHue()));
|
||||
AddItem(new GoldEarrings());
|
||||
|
||||
}
|
||||
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot(LootPack.UltraRich, 3);
|
||||
}
|
||||
|
||||
public SoulboundPirateCaptain(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class SoulboundPirateRaider : BaseCreature
|
||||
{
|
||||
public override bool ClickTitle { get { return false; } }
|
||||
public override bool AlwaysMurderer { get { return true; } }
|
||||
|
||||
public override WeaponAbility GetWeaponAbility()
|
||||
{
|
||||
Item weapon = FindItemOnLayer(Layer.TwoHanded);
|
||||
|
||||
if (weapon == null)
|
||||
return null;
|
||||
|
||||
if (weapon is BaseWeapon)
|
||||
{
|
||||
if (Utility.RandomBool())
|
||||
return ((BaseWeapon)weapon).PrimaryAbility;
|
||||
else
|
||||
return ((BaseWeapon)weapon).SecondaryAbility;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SoulboundPirateRaider()
|
||||
: base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
Name = "a soulbound pirate raider";
|
||||
Body = 0x190;
|
||||
Hue = Utility.RandomSkinHue();
|
||||
Utility.AssignRandomHair(this);
|
||||
|
||||
SetStr(150, 200);
|
||||
SetDex(125, 150);
|
||||
SetInt(95, 110);
|
||||
|
||||
SetHits(200, 250);
|
||||
|
||||
SetDamage(15, 25);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 100);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 45, 55);
|
||||
SetResistance(ResistanceType.Fire, 45, 55);
|
||||
SetResistance(ResistanceType.Cold, 45, 55);
|
||||
SetResistance(ResistanceType.Poison, 45, 55);
|
||||
SetResistance(ResistanceType.Energy, 45, 55);
|
||||
|
||||
SetSkill(SkillName.MagicResist, 50.0, 75.5);
|
||||
SetSkill(SkillName.Archery, 90.0, 105.5);
|
||||
SetSkill(SkillName.Tactics, 90.0, 105.5);
|
||||
SetSkill(SkillName.Anatomy, 90.0, 105.5);
|
||||
|
||||
Fame = 2000;
|
||||
Karma = -2000;
|
||||
|
||||
AddItem(new TricorneHat());
|
||||
AddItem(new LeatherArms());
|
||||
AddItem(new FancyShirt());
|
||||
AddItem(new ShortPants());
|
||||
AddItem(new Cutlass());
|
||||
AddItem(new Boots(Utility.RandomNeutralHue()));
|
||||
AddItem(new GoldEarrings());
|
||||
|
||||
Item bow;
|
||||
|
||||
switch (Utility.Random(4))
|
||||
{
|
||||
default:
|
||||
case 0: bow = new CompositeBow(); PackItem(new Arrow(25)); break;
|
||||
case 1: bow = new Crossbow(); PackItem(new Bolt(25)); break;
|
||||
case 2: bow = new Bow(); PackItem(new Arrow(25)); break;
|
||||
case 3: bow = new HeavyCrossbow(); PackItem(new Bolt(25)); break;
|
||||
}
|
||||
|
||||
AddItem(bow);
|
||||
}
|
||||
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot(LootPack.FilthyRich, 2);
|
||||
}
|
||||
|
||||
public SoulboundPirateRaider(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class SoulboundSpellSlinger : EvilMageLord
|
||||
{
|
||||
[Constructable]
|
||||
public SoulboundSpellSlinger()
|
||||
{
|
||||
Title = "the soulbound spellslinger";
|
||||
|
||||
SetStr(120, 130);
|
||||
SetDex(90, 100);
|
||||
SetInt(120, 150);
|
||||
|
||||
SetHits(190, 200);
|
||||
SetMana(400, 500);
|
||||
|
||||
SetDamage(8, 12);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 100);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 30, 40);
|
||||
SetResistance(ResistanceType.Fire, 30, 40);
|
||||
SetResistance(ResistanceType.Cold, 30, 40);
|
||||
SetResistance(ResistanceType.Poison, 30, 40);
|
||||
SetResistance(ResistanceType.Energy, 30, 40);
|
||||
|
||||
SetSkill(SkillName.Wrestling, 90.0, 100.0);
|
||||
SetSkill(SkillName.Tactics, 80.0, 90.0);
|
||||
SetSkill(SkillName.MagicResist, 90, 100.0);
|
||||
SetSkill(SkillName.Anatomy, 1.0, 0.0);
|
||||
SetSkill(SkillName.Magery, 100.0, 110.0);
|
||||
SetSkill(SkillName.EvalInt, 80.0, 90.0);
|
||||
SetSkill(SkillName.Meditation, 20.0, 30.0);
|
||||
|
||||
Fame = 3000;
|
||||
Karma = -3000;
|
||||
}
|
||||
|
||||
public override int TreasureMapLevel { get { return 3; } }
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot(LootPack.FilthyRich, 1);
|
||||
}
|
||||
|
||||
public SoulboundSpellSlinger(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class SoulboundSwashbuckler : BaseCreature
|
||||
{
|
||||
public override bool ClickTitle { get { return false; } }
|
||||
public override bool AlwaysMurderer { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public SoulboundSwashbuckler()
|
||||
: base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
Name = "a soulbound swashbuckler";
|
||||
Body = 0x190;
|
||||
Hue = Utility.RandomSkinHue();
|
||||
Utility.AssignRandomHair(this);
|
||||
|
||||
SetStr(120, 130);
|
||||
SetDex(105, 115);
|
||||
SetInt(95, 110);
|
||||
|
||||
SetHits(100, 125);
|
||||
|
||||
SetDamage(12, 18);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 100);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 30, 40);
|
||||
SetResistance(ResistanceType.Fire, 30, 40);
|
||||
SetResistance(ResistanceType.Cold, 30, 40);
|
||||
SetResistance(ResistanceType.Poison, 30, 40);
|
||||
SetResistance(ResistanceType.Energy, 30, 40);
|
||||
|
||||
SetSkill(SkillName.MagicResist, 25.0, 47.5);
|
||||
SetSkill(SkillName.Swords, 65.0, 87.5);
|
||||
SetSkill(SkillName.Tactics, 65.0, 87.5);
|
||||
SetSkill(SkillName.Anatomy, 65.0, 87.5);
|
||||
|
||||
Fame = 2000;
|
||||
Karma = -2000;
|
||||
|
||||
AddItem(new Bandana());
|
||||
AddItem(new LeatherArms());
|
||||
AddItem(new FancyShirt());
|
||||
AddItem(new ShortPants());
|
||||
AddItem(new Cutlass());
|
||||
AddItem(new Boots(Utility.RandomNeutralHue()));
|
||||
AddItem(new SilverEarrings());
|
||||
|
||||
}
|
||||
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot(LootPack.FilthyRich, 1);
|
||||
}
|
||||
|
||||
public SoulboundSwashbuckler(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,374 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Multis;
|
||||
using System.Collections.Generic;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class Osiredon : BaseSeaChampion
|
||||
{
|
||||
public static readonly TimeSpan SpawnRate = TimeSpan.FromSeconds(30);
|
||||
public static readonly int SpawnMax = 25;
|
||||
|
||||
private List<Mobile> m_Eels = new List<Mobile>();
|
||||
private DateTime m_NextSpawn;
|
||||
private DateTime m_NextSpecial;
|
||||
private DateTime m_NextWaterBall;
|
||||
|
||||
public override bool CanDamageBoats { get { return true; } }
|
||||
public override bool TaintedLifeAura { get { return true; } }
|
||||
public override TimeSpan BoatDamageCooldown { get { return TimeSpan.FromSeconds(120); } }
|
||||
public override int MinBoatDamage { get { return 3; } }
|
||||
public override int MaxBoatDamage { get { return 8; } }
|
||||
public override int DamageRange { get { return 2; } }
|
||||
|
||||
public override int Meat { get { return 5; } }
|
||||
|
||||
public override ScaleType ScaleType { get { return ScaleType.All; } }
|
||||
public override int Scales { get { return 20; } }
|
||||
|
||||
public override double TreasureMapChance { get { return .50; } }
|
||||
public override int TreasureMapLevel { get { return 7; } }
|
||||
|
||||
public override Type[] UniqueList { get { return new Type[] { typeof(EnchantedCoralBracelet), typeof(WandOfThunderingGlory), typeof(LeviathanHideBracers), typeof(SmilingMoonBlade) }; } }
|
||||
public override Type[] SharedList { get { return new Type[] { typeof(MiniSoulForgeDeed) }; } }
|
||||
public override Type[] DecorativeList { get { return new Type[] { typeof(EnchantedBladeDeed), typeof(EnchantedVortexDeed) }; } }
|
||||
|
||||
public override bool NoGoodies { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public Osiredon()
|
||||
: this(null)
|
||||
{
|
||||
}
|
||||
|
||||
public Osiredon(Mobile fisher)
|
||||
: base(fisher, AIType.AI_NecroMage, FightMode.Closest)
|
||||
{
|
||||
Name = "osiredon the scalis enforcer";
|
||||
Body = 1068;
|
||||
BaseSoundID = 589;
|
||||
|
||||
Combatant = fisher;
|
||||
|
||||
m_NextSpawn = DateTime.UtcNow + SpawnRate;
|
||||
m_NextSpecial = DateTime.UtcNow;
|
||||
m_NextWaterBall = DateTime.UtcNow;
|
||||
|
||||
CanSwim = true;
|
||||
CantWalk = true;
|
||||
|
||||
SetStr(805, 900);
|
||||
SetDex(121, 165);
|
||||
SetInt(125, 137);
|
||||
|
||||
SetMana(4000);
|
||||
SetHits(75000);
|
||||
|
||||
SetDamage(19, 26);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 40);
|
||||
SetDamageType(ResistanceType.Cold, 30);
|
||||
SetDamageType(ResistanceType.Energy, 30);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 80, 90);
|
||||
SetResistance(ResistanceType.Fire, 80, 90);
|
||||
SetResistance(ResistanceType.Cold, 85, 95);
|
||||
SetResistance(ResistanceType.Poison, 80, 90);
|
||||
SetResistance(ResistanceType.Energy, 80, 90);
|
||||
|
||||
SetSkill(SkillName.Wrestling, 122.9, 128.0);
|
||||
SetSkill(SkillName.Tactics, 127.7, 132.9);
|
||||
SetSkill(SkillName.MagicResist, 120.9, 129.4);
|
||||
SetSkill(SkillName.Necromancy, 122.9, 128.0);
|
||||
SetSkill(SkillName.SpiritSpeak, 160.1, 220.0);
|
||||
SetSkill(SkillName.Magery, 120.1, 129.4);
|
||||
SetSkill(SkillName.EvalInt, 100.1, 120.0);
|
||||
SetSkill(SkillName.DetectHidden, 100.0);
|
||||
|
||||
Fame = 25000;
|
||||
Karma = -25000;
|
||||
|
||||
if (IsSoulboundEnemies)
|
||||
IsSoulbound = true;
|
||||
}
|
||||
|
||||
public void AddEel(Mobile eel)
|
||||
{
|
||||
if (!m_Eels.Contains(eel) && eel is ParasiticEel)
|
||||
m_Eels.Add(eel);
|
||||
}
|
||||
|
||||
public void RemoveEel(Mobile eel)
|
||||
{
|
||||
if (m_Eels.Contains(eel))
|
||||
m_Eels.Remove(eel);
|
||||
}
|
||||
|
||||
public override void DoDamageBoat(BaseBoat boat)
|
||||
{
|
||||
DoAreaExplosion();
|
||||
base.DoDamageBoat(boat);
|
||||
}
|
||||
|
||||
public override void OnDamagedBySpell(Mobile from)
|
||||
{
|
||||
base.OnDamagedBySpell(from);
|
||||
|
||||
if (m_NextSpawn < DateTime.UtcNow && m_Eels.Count < SpawnMax && 0.25 > Utility.RandomDouble())
|
||||
SpawnEel(from);
|
||||
}
|
||||
|
||||
public override void OnGotMeleeAttack(Mobile attacker)
|
||||
{
|
||||
base.OnGotMeleeAttack(attacker);
|
||||
|
||||
if (attacker.Weapon is BaseRanged && m_NextSpawn < DateTime.UtcNow && m_Eels.Count < SpawnMax && 0.25 > Utility.RandomDouble())
|
||||
SpawnEel(attacker);
|
||||
}
|
||||
|
||||
public override void OnThink()
|
||||
{
|
||||
base.OnThink();
|
||||
|
||||
if (m_NextSpecial < DateTime.UtcNow)
|
||||
DoAreaExplosion();
|
||||
}
|
||||
|
||||
public override void OnActionCombat()
|
||||
{
|
||||
Mobile combatant = this.Combatant as Mobile;
|
||||
|
||||
if (combatant == null || combatant.Deleted || combatant.Map != this.Map || !this.InRange(combatant, 12) || !this.CanBeHarmful(combatant) || !this.InLOS(combatant))
|
||||
return;
|
||||
|
||||
if (DateTime.UtcNow >= this.m_NextWaterBall)
|
||||
{
|
||||
double damage = combatant.Hits * 0.3;
|
||||
|
||||
if (damage < 10.0)
|
||||
damage = 10.0;
|
||||
else if (damage > 40.0)
|
||||
damage = 40.0;
|
||||
|
||||
this.DoHarmful(combatant);
|
||||
this.MovingParticles(combatant, 0x36D4, 5, 0, false, false, 195, 0, 9502, 3006, 0, 0, 0);
|
||||
AOS.Damage(combatant, this, (int)damage, 100, 0, 0, 0, 0);
|
||||
|
||||
if (combatant is PlayerMobile && combatant.Mount != null)
|
||||
{
|
||||
(combatant as PlayerMobile).SetMountBlock(BlockMountType.DismountRecovery, TimeSpan.FromSeconds(10), true);
|
||||
}
|
||||
|
||||
m_NextWaterBall = DateTime.UtcNow + TimeSpan.FromMinutes(1);
|
||||
}
|
||||
}
|
||||
|
||||
public void SpawnEel(Mobile m)
|
||||
{
|
||||
Map map = this.Map;
|
||||
|
||||
int x = m.X; int y = m.Y; int z = m.Z;
|
||||
|
||||
Point3D loc = m.Location;
|
||||
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
for (int i = 0; i < 25; i++)
|
||||
{
|
||||
x = Utility.RandomMinMax(loc.X - 1, loc.X + 1);
|
||||
y = Utility.RandomMinMax(loc.Y - 1, loc.Y + 1);
|
||||
|
||||
if (Spells.SpellHelper.CheckMulti(new Point3D(x, y, m.Z), map) || map.CanSpawnMobile(x, y, z))
|
||||
{
|
||||
ParasiticEel eel = new ParasiticEel(this);
|
||||
eel.MoveToWorld(new Point3D(x, y, loc.Z), map);
|
||||
|
||||
if (m is PlayerMobile)
|
||||
eel.Combatant = m;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_NextSpawn = DateTime.UtcNow + SpawnRate;
|
||||
}
|
||||
|
||||
public void DoAreaExplosion()
|
||||
{
|
||||
List<Mobile> toExplode = new List<Mobile>();
|
||||
|
||||
IPooledEnumerable eable = this.GetMobilesInRange(8);
|
||||
foreach (Mobile mob in eable)
|
||||
{
|
||||
if (!CanBeHarmful(mob, false) || mob == this || (mob is BaseCreature && ((BaseCreature)mob).GetMaster() == this))
|
||||
continue;
|
||||
if (mob.Player)
|
||||
toExplode.Add(mob);
|
||||
if (mob is BaseCreature && (((BaseCreature)mob).Controlled || ((BaseCreature)mob).Summoned || ((BaseCreature)mob).Team != this.Team))
|
||||
toExplode.Add(mob);
|
||||
}
|
||||
eable.Free();
|
||||
|
||||
foreach (Mobile mob in toExplode)
|
||||
{
|
||||
mob.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
|
||||
mob.PlaySound(0x307);
|
||||
|
||||
int damage = Utility.RandomMinMax(50, 125);
|
||||
AOS.Damage(mob, this, damage, 0, 100, 0, 0, 0);
|
||||
}
|
||||
|
||||
m_NextSpecial = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(15, 20));
|
||||
}
|
||||
|
||||
public override void OnDeath(Container c)
|
||||
{
|
||||
base.OnDeath(c);
|
||||
|
||||
FishingPole pole = new FishingPole();
|
||||
BaseRunicTool.ApplyAttributesTo(pole, false, 0, Utility.RandomMinMax(2, 5), 50, 100);
|
||||
c.DropItem(pole);
|
||||
|
||||
c.DropItem(new MessageInABottle(c.Map));
|
||||
c.DropItem(new SpecialFishingNet());
|
||||
c.DropItem(new SpecialFishingNet());
|
||||
|
||||
#region TOL
|
||||
if (Core.TOL)
|
||||
SkillMasteryPrimer.CheckPrimerDrop(this);
|
||||
#endregion
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
if (m_Eels != null)
|
||||
{
|
||||
List<Mobile> eels = new List<Mobile>(m_Eels);
|
||||
for (int i = 0; i < eels.Count; i++)
|
||||
{
|
||||
if (eels[i] != null)
|
||||
eels[i].Kill();
|
||||
}
|
||||
}
|
||||
|
||||
base.Delete();
|
||||
}
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot(LootPack.SuperBoss, 5);
|
||||
}
|
||||
|
||||
public Osiredon(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();
|
||||
|
||||
m_NextSpawn = DateTime.UtcNow;
|
||||
m_NextSpecial = DateTime.UtcNow;
|
||||
m_NextWaterBall = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ParasiticEel : BaseCreature
|
||||
{
|
||||
private Mobile m_Master;
|
||||
|
||||
public ParasiticEel(Mobile master)
|
||||
: base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
if (master is Osiredon)
|
||||
{
|
||||
m_Master = master;
|
||||
((Osiredon)master).AddEel(this);
|
||||
}
|
||||
|
||||
Name = "a parasitic eel";
|
||||
Body = 0x34;
|
||||
//BaseSoundID = 589;
|
||||
//TODO: soundid, Body
|
||||
|
||||
//CanSwim = true;
|
||||
//CantWalk = true;
|
||||
|
||||
SetStr(80, 125);
|
||||
SetDex(150, 250);
|
||||
SetInt(20, 40);
|
||||
|
||||
SetHits(100);
|
||||
|
||||
SetDamage(4, 12);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 25);
|
||||
SetDamageType(ResistanceType.Cold, 25);
|
||||
SetDamageType(ResistanceType.Poison, 50);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 20);
|
||||
SetResistance(ResistanceType.Fire, 10, 25);
|
||||
SetResistance(ResistanceType.Cold, 10, 25);
|
||||
SetResistance(ResistanceType.Poison, 99);
|
||||
SetResistance(ResistanceType.Energy, 5, 10);
|
||||
|
||||
SetSkill(SkillName.Wrestling, 52.0, 70.0);
|
||||
SetSkill(SkillName.Tactics, 0.0);
|
||||
SetSkill(SkillName.MagicResist, 100.4, 113.5);
|
||||
SetSkill(SkillName.Anatomy, 1.0, 0.0);
|
||||
SetSkill(SkillName.Magery, 60.2, 72.4);
|
||||
SetSkill(SkillName.EvalInt, 60.1, 73.4);
|
||||
SetSkill(SkillName.Meditation, 100.0);
|
||||
|
||||
Fame = 2500;
|
||||
Karma = -2500;
|
||||
}
|
||||
|
||||
public override Poison PoisonImmune { get { return Poison.Parasitic; } }
|
||||
public override Poison HitPoison { get { return Poison.Parasitic; } }
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
if (m_Master != null && m_Master is Osiredon)
|
||||
((Osiredon)m_Master).RemoveEel(this);
|
||||
|
||||
base.Delete();
|
||||
}
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot(LootPack.FilthyRich, 1);
|
||||
}
|
||||
|
||||
public ParasiticEel(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
writer.Write(m_Master);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
m_Master = reader.ReadMobile();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class BoatPainter : BaseVendor
|
||||
{
|
||||
private List<SBInfo> m_SBInfos = new List<SBInfo>();
|
||||
protected override List<SBInfo> SBInfos { get { return m_SBInfos; } }
|
||||
|
||||
[Constructable]
|
||||
public BoatPainter()
|
||||
: base("the boat painter")
|
||||
{
|
||||
SetSkill(SkillName.Carpentry, 36.0, 68.0);
|
||||
}
|
||||
|
||||
public override void InitSBInfo()
|
||||
{
|
||||
m_SBInfos.Add(new SBBoatPainter());
|
||||
}
|
||||
|
||||
public BoatPainter(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class CrabFisher : BaseVendor
|
||||
{
|
||||
private List<SBInfo> m_SBInfos = new List<SBInfo>();
|
||||
protected override List<SBInfo> SBInfos { get { return m_SBInfos; } }
|
||||
|
||||
[Constructable]
|
||||
public CrabFisher()
|
||||
: base("the crab fisher")
|
||||
{
|
||||
SetSkill(SkillName.Fishing, 36.0, 68.0);
|
||||
}
|
||||
|
||||
public override void InitSBInfo()
|
||||
{
|
||||
m_SBInfos.Add(new SBCrabFisher());
|
||||
}
|
||||
|
||||
public CrabFisher(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.ContextMenus;
|
||||
using System.Collections.Generic;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class DockMaster : BaseVendor
|
||||
{
|
||||
public static readonly int DryDockDistance = 300;
|
||||
public static readonly int DryDockAmount = 2500;
|
||||
|
||||
public override bool IsActiveVendor { get { return false; } }
|
||||
public override bool IsInvulnerable { get { return true; } }
|
||||
|
||||
private List<SBInfo> m_SBInfos = new List<SBInfo>();
|
||||
protected override List<SBInfo> SBInfos { get { return m_SBInfos; } }
|
||||
|
||||
public override void InitSBInfo()
|
||||
{
|
||||
m_SBInfos.Add(new SBFisherman());
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DockMaster() : base( "the dockmaster" )
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
list.Add(new DryDockEntry(from, this));
|
||||
list.Add(new RetrieveHoldEntry(from, this));
|
||||
}
|
||||
|
||||
private class DryDockEntry : ContextMenuEntry
|
||||
{
|
||||
private Mobile m_From;
|
||||
private DockMaster m_DockMaster;
|
||||
|
||||
public DryDockEntry(Mobile from, DockMaster dockmaster) : base(1149575, 5)
|
||||
{
|
||||
m_From = from;
|
||||
m_DockMaster = dockmaster;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
var boat = BaseBoat.GetBoat(m_From);
|
||||
|
||||
if (boat != null && m_DockMaster.InRange(boat.Location, 100))
|
||||
boat.BeginDryDock(m_From, m_DockMaster);
|
||||
else
|
||||
m_DockMaster.SayTo(m_From, 502581); //I cannot find the ship!
|
||||
}
|
||||
}
|
||||
|
||||
private class RetrieveHoldEntry : ContextMenuEntry
|
||||
{
|
||||
private Mobile m_From;
|
||||
private DockMaster m_DockMaster;
|
||||
|
||||
public RetrieveHoldEntry(Mobile from, DockMaster dockmaster)
|
||||
: base(1116504, 5)
|
||||
{
|
||||
m_From = from;
|
||||
m_DockMaster = dockmaster;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (m_DockMaster.Map == null)
|
||||
return;
|
||||
|
||||
Container pack = m_From.Backpack;
|
||||
|
||||
if (pack != null && pack.GetAmount(typeof(Gold)) < DockMaster.DryDockAmount && Banker.GetBalance(m_From) < DryDockAmount)
|
||||
{
|
||||
m_DockMaster.PrivateOverheadMessage(MessageType.Regular, m_DockMaster.SpeechHue, 1116506, DockMaster.DryDockAmount.ToString(), m_From.NetState); //The price is ~1_price~ and I will accept nothing less!
|
||||
return;
|
||||
}
|
||||
|
||||
var boat = BaseBoat.GetBoat(m_From);
|
||||
|
||||
if (boat != null && m_DockMaster.InRange(boat.Location, 50))
|
||||
m_DockMaster.TryRetrieveHold(m_From, boat);
|
||||
else
|
||||
m_DockMaster.SayTo(m_From, 502581); //I cannot find the ship!
|
||||
}
|
||||
}
|
||||
|
||||
public void TryRetrieveHold(Mobile from, BaseBoat boat)
|
||||
{
|
||||
for (int i = 0; i < m_Crates.Count; i++) {
|
||||
if (m_Crates[i].Owner == from) {
|
||||
from.SendLocalizedMessage(1116516); //Thou must return thy current shipping crate before I can retrieve another shipment for you.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Container pack = from.Backpack;
|
||||
Container hold;
|
||||
|
||||
if (boat is BaseGalleon)
|
||||
hold = ((BaseGalleon)boat).GalleonHold;
|
||||
else
|
||||
hold = boat.Hold;
|
||||
|
||||
if (hold == null || hold.Items.Count == 0)
|
||||
{
|
||||
from.SendMessage("Your hold is empty!");
|
||||
return;
|
||||
}
|
||||
|
||||
ShipCrate crate = new ShipCrate(from, boat);
|
||||
m_Crates.Add(crate);
|
||||
|
||||
if (!pack.ConsumeTotal(typeof(Gold), DryDockAmount))
|
||||
Banker.Withdraw(from, DryDockAmount);
|
||||
|
||||
bool cantMove = false;
|
||||
List<Item> items = new List<Item>(hold.Items);
|
||||
foreach (Item item in items)
|
||||
{
|
||||
if (item.Movable)
|
||||
crate.DropItem(item);
|
||||
else
|
||||
cantMove = true;
|
||||
}
|
||||
|
||||
Point3D pnt = Point3D.Zero;
|
||||
|
||||
if (!CanDropCrate(ref pnt, this.Map))
|
||||
{
|
||||
SayTo(from, 1116517); //Arrrgh! My dock has no more room. Please come back later.
|
||||
from.BankBox.DropItem(crate);
|
||||
from.SendMessage("Your shipping crate has been placed in your bank box.");
|
||||
//from.SendMessage("You have 30 minutes to obtain the contents of your shipping crate. You can find it in the wearhouse on the westernmost tip of the floating emproiam");
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1116542, ShipCrate.DT.ToString()); //Yer ship has been unloaded to a crate inside this here warehouse. You have ~1_time~ minutes to get yer goods or it be gone.
|
||||
crate.MoveToWorld(pnt, this.Map);
|
||||
}
|
||||
|
||||
if (cantMove)
|
||||
from.SendMessage("We were unable to pack up one or more of the items in your cargo hold.");
|
||||
}
|
||||
|
||||
private Rectangle2D m_Bounds = new Rectangle2D(4561, 2298, 8, 5);
|
||||
private static List<ShipCrate> m_Crates = new List<ShipCrate>();
|
||||
|
||||
public static void RemoveCrate(ShipCrate crate)
|
||||
{
|
||||
if (m_Crates.Contains(crate))
|
||||
m_Crates.Remove(crate);
|
||||
}
|
||||
|
||||
private bool CanDropCrate(ref Point3D pnt, Map map)
|
||||
{
|
||||
for (int i = 0; i < 45; i++)
|
||||
{
|
||||
int x = Utility.Random(m_Bounds.X, m_Bounds.Width);
|
||||
int y = Utility.Random(m_Bounds.Y, m_Bounds.Height);
|
||||
int z = -2;
|
||||
|
||||
bool badSpot = false;
|
||||
Point3D p = new Point3D(x, y, z);
|
||||
IPooledEnumerable eable = map.GetItemsInRange(pnt, 0);
|
||||
|
||||
foreach (Item item in eable)
|
||||
{
|
||||
if (item != null && item is Container && !item.Movable)
|
||||
{
|
||||
badSpot = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
|
||||
if (!badSpot)
|
||||
{
|
||||
pnt = p;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public BaseBoat GetBoatInRegion(Mobile from)
|
||||
{
|
||||
if (this.Map == null || this.Map == Map.Internal || this.Region == null)
|
||||
return null;
|
||||
|
||||
foreach (Rectangle3D rec in this.Region.Area)
|
||||
{
|
||||
IPooledEnumerable eable = this.Map.GetItemsInBounds(new Rectangle2D(rec.Start.X, rec.Start.Y, rec.Width, rec.Height));
|
||||
|
||||
foreach (Item item in eable)
|
||||
{
|
||||
if (item is BaseBoat && ((BaseBoat)item).Owner == from && InRange(item.Location, DryDockDistance))
|
||||
{
|
||||
eable.Free();
|
||||
return (BaseBoat)item;
|
||||
}
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public DockMaster(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class DocksAlchemist : BaseVendor
|
||||
{
|
||||
private List<SBInfo> m_SBInfos = new List<SBInfo>();
|
||||
protected override List<SBInfo> SBInfos { get { return m_SBInfos; } }
|
||||
|
||||
public override NpcGuild NpcGuild { get { return NpcGuild.MagesGuild; } }
|
||||
|
||||
[Constructable]
|
||||
public DocksAlchemist() : base( "the alchemist" )
|
||||
{
|
||||
SetSkill(SkillName.Alchemy, 85.0, 100.0);
|
||||
SetSkill(SkillName.TasteID, 65.0, 88.0);
|
||||
}
|
||||
|
||||
public override void InitSBInfo()
|
||||
{
|
||||
m_SBInfos.Add(new SBDocksAlchemist());
|
||||
}
|
||||
|
||||
public override VendorShoeType ShoeType
|
||||
{
|
||||
get { return Utility.RandomBool() ? VendorShoeType.Shoes : VendorShoeType.Sandals; }
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
base.InitOutfit();
|
||||
|
||||
AddItem( new Server.Items.HalfApron() );
|
||||
}
|
||||
|
||||
public DocksAlchemist( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class SBDocksAlchemist : SBInfo
|
||||
{
|
||||
private List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
|
||||
private IShopSellInfo m_SellInfo = new InternalSellInfo();
|
||||
|
||||
public SBDocksAlchemist()
|
||||
{
|
||||
}
|
||||
|
||||
public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
|
||||
public override List<GenericBuyInfo> BuyInfo { get { return m_BuyInfo; } }
|
||||
|
||||
public class InternalBuyInfo : List<GenericBuyInfo>
|
||||
{
|
||||
public InternalBuyInfo()
|
||||
{
|
||||
Add( new GenericBuyInfo( "1116302", typeof( Saltpeter ), 167, 20, 16954, 1150 ) );
|
||||
|
||||
Add(new GenericBuyInfo(typeof(RefreshPotion), 15, 10, 0xF0B, 0));
|
||||
Add(new GenericBuyInfo(typeof(AgilityPotion), 15, 10, 0xF08, 0));
|
||||
Add(new GenericBuyInfo(typeof(NightSightPotion), 15, 10, 0xF06, 0));
|
||||
Add(new GenericBuyInfo(typeof(LesserHealPotion), 15, 10, 0xF0C, 0));
|
||||
Add(new GenericBuyInfo(typeof(StrengthPotion), 15, 10, 0xF09, 0));
|
||||
Add(new GenericBuyInfo(typeof(LesserPoisonPotion), 15, 10, 0xF0A, 0));
|
||||
Add(new GenericBuyInfo(typeof(LesserCurePotion), 15, 10, 0xF07, 0));
|
||||
Add(new GenericBuyInfo(typeof(LesserExplosionPotion), 21, 10, 0xF0D, 0));
|
||||
Add(new GenericBuyInfo(typeof(MortarPestle), 8, 10, 0xE9B, 0));
|
||||
|
||||
Add(new GenericBuyInfo(typeof(BlackPearl), 5, 20, 0xF7A, 0));
|
||||
Add(new GenericBuyInfo(typeof(Bloodmoss), 5, 20, 0xF7B, 0));
|
||||
Add(new GenericBuyInfo(typeof(Garlic), 3, 20, 0xF84, 0));
|
||||
Add(new GenericBuyInfo(typeof(Ginseng), 3, 20, 0xF85, 0));
|
||||
Add(new GenericBuyInfo(typeof(MandrakeRoot), 3, 20, 0xF86, 0));
|
||||
Add(new GenericBuyInfo(typeof(Nightshade), 3, 20, 0xF88, 0));
|
||||
Add(new GenericBuyInfo(typeof(SpidersSilk), 3, 20, 0xF8D, 0));
|
||||
Add(new GenericBuyInfo(typeof(SulfurousAsh), 3, 20, 0xF8C, 0));
|
||||
|
||||
Add(new GenericBuyInfo(typeof(Bottle), 5, 100, 0xF0E, 0));
|
||||
Add(new GenericBuyInfo(typeof(HeatingStand), 2, 100, 0x1849, 0));
|
||||
|
||||
Add(new GenericBuyInfo("1041060", typeof(HairDye), 37, 10, 0xEFF, 0));
|
||||
|
||||
Add(new GenericBuyInfo(typeof(HeatingStand), 2, 100, 0x1849, 0)); // This is on OSI :-P
|
||||
}
|
||||
}
|
||||
|
||||
public class InternalSellInfo : GenericSellInfo
|
||||
{
|
||||
public InternalSellInfo()
|
||||
{
|
||||
Add( typeof( Saltpeter ), 10 );
|
||||
|
||||
Add(typeof(BlackPearl), 3);
|
||||
Add(typeof(Bloodmoss), 3);
|
||||
Add(typeof(MandrakeRoot), 2);
|
||||
Add(typeof(Garlic), 2);
|
||||
Add(typeof(Ginseng), 2);
|
||||
Add(typeof(Nightshade), 2);
|
||||
Add(typeof(SpidersSilk), 2);
|
||||
Add(typeof(SulfurousAsh), 2);
|
||||
Add(typeof(Bottle), 3);
|
||||
Add(typeof(MortarPestle), 4);
|
||||
Add(typeof(HairDye), 19);
|
||||
|
||||
Add(typeof(NightSightPotion), 7);
|
||||
Add(typeof(AgilityPotion), 7);
|
||||
Add(typeof(StrengthPotion), 7);
|
||||
Add(typeof(RefreshPotion), 7);
|
||||
Add(typeof(LesserCurePotion), 7);
|
||||
Add(typeof(LesserHealPotion), 7);
|
||||
Add(typeof(LesserPoisonPotion), 7);
|
||||
Add(typeof(LesserExplosionPotion), 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class SBBoatPainter : SBInfo
|
||||
{
|
||||
private List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
|
||||
private IShopSellInfo m_SellInfo = new InternalSellInfo();
|
||||
|
||||
public SBBoatPainter()
|
||||
{
|
||||
}
|
||||
|
||||
public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
|
||||
public override List<GenericBuyInfo> BuyInfo { get { return m_BuyInfo; } }
|
||||
|
||||
public class InternalBuyInfo : List<GenericBuyInfo>
|
||||
{
|
||||
public InternalBuyInfo()
|
||||
{
|
||||
Add(new GenericBuyInfo("Boat Paint", typeof(BoatPaint), 6256, 20, 4011, 276, new object[] { 276 }));
|
||||
Add(new GenericBuyInfo("Boat Paint", typeof(BoatPaint), 6256, 20, 4011, 396, new object[] { 396 }));
|
||||
Add(new GenericBuyInfo("Boat Paint", typeof(BoatPaint), 6256, 20, 4011, 516, new object[] { 516 }));
|
||||
Add(new GenericBuyInfo("Boat Paint", typeof(BoatPaint), 6256, 20, 4011, 1900, new object[] { 1900 }));
|
||||
Add(new GenericBuyInfo("Boat Paint", typeof(BoatPaint), 6256, 20, 4011, 251, new object[] { 251 }));
|
||||
Add(new GenericBuyInfo("Boat Paint", typeof(BoatPaint), 6256, 20, 4011, 246, new object[] { 246 }));
|
||||
Add(new GenericBuyInfo("Boat Paint", typeof(BoatPaint), 6256, 20, 4011, 2213, new object[] { 2213 }));
|
||||
Add(new GenericBuyInfo("Boat Paint", typeof(BoatPaint), 6256, 20, 4011, 36, new object[] { 36 }));
|
||||
Add(new GenericBuyInfo("Boat Paint Remover", typeof(BoatPaintRemover), 6256, 20, 4011, 0));
|
||||
}
|
||||
}
|
||||
|
||||
public class InternalSellInfo : GenericSellInfo
|
||||
{
|
||||
public InternalSellInfo()
|
||||
{
|
||||
Add(typeof(LobsterTrap), 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class SBCrabFisher : SBInfo
|
||||
{
|
||||
private List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
|
||||
private IShopSellInfo m_SellInfo = new InternalSellInfo();
|
||||
|
||||
public SBCrabFisher()
|
||||
{
|
||||
}
|
||||
|
||||
public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
|
||||
public override List<GenericBuyInfo> BuyInfo { get { return m_BuyInfo; } }
|
||||
|
||||
public class InternalBuyInfo : List<GenericBuyInfo>
|
||||
{
|
||||
public InternalBuyInfo()
|
||||
{
|
||||
Add(new GenericBuyInfo("empty lobster trap", typeof(LobsterTrap), 137, 500, 17615, 0));
|
||||
}
|
||||
}
|
||||
|
||||
public class InternalSellInfo : GenericSellInfo
|
||||
{
|
||||
public InternalSellInfo()
|
||||
{
|
||||
Add(typeof(LobsterTrap), 10);
|
||||
Add(typeof(AppleCrab), 10);
|
||||
Add(typeof(BlueCrab), 10);
|
||||
Add(typeof(DungeonessCrab), 10);
|
||||
Add(typeof(KingCrab), 10);
|
||||
Add(typeof(RockCrab), 10);
|
||||
Add(typeof(SnowCrab), 10);
|
||||
Add(typeof(StoneCrab), 250);
|
||||
Add(typeof(SpiderCrab), 250);
|
||||
Add(typeof(TunnelCrab), 2500);
|
||||
Add(typeof(VoidCrab), 2500);
|
||||
|
||||
Add(typeof(CrustyLobster), 10);
|
||||
Add(typeof(FredLobster), 10);
|
||||
Add(typeof(HummerLobster), 10);
|
||||
Add(typeof(RockLobster), 10);
|
||||
Add(typeof(ShovelNoseLobster), 10);
|
||||
Add(typeof(SpineyLobster), 10);
|
||||
Add(typeof(BlueLobster), 250);
|
||||
Add(typeof(BloodLobster), 2500);
|
||||
Add(typeof(DreadLobster), 2500);
|
||||
Add(typeof(VoidLobster), 2500);
|
||||
|
||||
Add(typeof(StoneCrabMeat), 100);
|
||||
Add(typeof(SpiderCrabMeat), 100);
|
||||
Add(typeof(BlueLobsterMeat), 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class SBSeaMarketTavernKeeper : SBInfo
|
||||
{
|
||||
private List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
|
||||
private IShopSellInfo m_SellInfo = new InternalSellInfo();
|
||||
|
||||
public SBSeaMarketTavernKeeper()
|
||||
{
|
||||
}
|
||||
|
||||
public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
|
||||
public override List<GenericBuyInfo> BuyInfo { get { return m_BuyInfo; } }
|
||||
|
||||
public class InternalBuyInfo : List<GenericBuyInfo>
|
||||
{
|
||||
public InternalBuyInfo()
|
||||
{
|
||||
Add(new GenericBuyInfo("1116299", typeof(MentoSeasoning), 1002, 10, 2454, 95));
|
||||
Add(new GenericBuyInfo("1116338", typeof(SamuelsSecretSauce), 1007, 10, 2463, 1461));
|
||||
Add(new GenericBuyInfo("1116300", typeof(DarkTruffle), 1001, 10, 3352, 1908));
|
||||
|
||||
Add( new BeverageBuyInfo( typeof( BeverageBottle ), BeverageType.Ale, 7, 20, 0x99F, 0 ) );
|
||||
Add( new BeverageBuyInfo( typeof( BeverageBottle ), BeverageType.Wine, 7, 20, 0x9C7, 0 ) );
|
||||
Add( new BeverageBuyInfo( typeof( BeverageBottle ), BeverageType.Liquor, 7, 20, 0x99B, 0 ) );
|
||||
Add( new BeverageBuyInfo( typeof( Jug ), BeverageType.Cider, 13, 20, 0x9C8, 0 ) );
|
||||
Add( new BeverageBuyInfo( typeof( Pitcher ), BeverageType.Milk, 7, 20, 0x9F0, 0 ) );
|
||||
Add( new BeverageBuyInfo( typeof( Pitcher ), BeverageType.Ale, 11, 20, 0x1F95, 0 ) );
|
||||
Add( new BeverageBuyInfo( typeof( Pitcher ), BeverageType.Cider, 11, 20, 0x1F97, 0 ) );
|
||||
Add( new BeverageBuyInfo( typeof( Pitcher ), BeverageType.Liquor, 11, 20, 0x1F99, 0 ) );
|
||||
Add( new BeverageBuyInfo( typeof( Pitcher ), BeverageType.Wine, 11, 20, 0x1F9B, 0 ) );
|
||||
Add( new BeverageBuyInfo( typeof( Pitcher ), BeverageType.Water, 11, 20, 0x1F9D, 0 ) );
|
||||
|
||||
Add( new GenericBuyInfo( typeof( BreadLoaf ), 6, 10, 0x103B, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( CheeseWheel ), 21, 10, 0x97E, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( CookedBird ), 17, 20, 0x9B7, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( LambLeg ), 8, 20, 0x160A, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( ChickenLeg ), 5, 20, 0x1608, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( Ribs ), 7, 20, 0x9F2, 0 ) );
|
||||
|
||||
Add( new GenericBuyInfo( typeof( WoodenBowlOfCarrots ), 3, 20, 0x15F9, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( WoodenBowlOfCorn ), 3, 20, 0x15FA, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( WoodenBowlOfLettuce ), 3, 20, 0x15FB, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( WoodenBowlOfPeas ), 3, 20, 0x15FC, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( EmptyPewterBowl ), 2, 20, 0x15FD, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( PewterBowlOfCorn ), 3, 20, 0x15FE, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( PewterBowlOfLettuce ), 3, 20, 0x15FF, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( PewterBowlOfPeas ), 3, 20, 0x1601, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( PewterBowlOfPotatos ), 3, 20, 0x1601, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( WoodenBowlOfStew ), 3, 20, 0x1604, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( WoodenBowlOfTomatoSoup ), 3, 20, 0x1606, 0 ) );
|
||||
|
||||
Add( new GenericBuyInfo( typeof( ApplePie ), 7, 20, 0x1041, 0 ) ); //OSI just has Pie, not Apple/Fruit/Meat
|
||||
|
||||
Add( new GenericBuyInfo( "1016450", typeof( Chessboard ), 2, 20, 0xFA6, 0 ) );
|
||||
Add( new GenericBuyInfo( "1016449", typeof( CheckerBoard ), 2, 20, 0xFA6, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( Backgammon ), 2, 20, 0xE1C, 0 ) );
|
||||
Add(new GenericBuyInfo(typeof(Dices), 2, 20, 0xFA7, 0));
|
||||
Add( new GenericBuyInfo( "1041243", typeof( ContractOfEmployment ), 1252, 20, 0x14F0, 0 ) );
|
||||
Add( new GenericBuyInfo( "a barkeep contract", typeof( BarkeepContract ), 1252, 20, 0x14F0, 0 ) );
|
||||
|
||||
if ( Multis.BaseHouse.NewVendorSystem )
|
||||
Add( new GenericBuyInfo( "1062332", typeof( VendorRentalContract ), 1252, 20, 0x14F0, 0x672 ) );
|
||||
|
||||
/*if ( Map == Tokuno )
|
||||
{
|
||||
Add( new GenericBuyInfo( typeof( Wasabi ), 2, 20, 0x24E8, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( Wasabi ), 2, 20, 0x24E9, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( BentoBox ), 6, 20, 0x2836, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( BentoBox ), 6, 20, 0x2837, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( GreenTeaBasket ), 2, 20, 0x284B, 0 ) );
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
public class InternalSellInfo : GenericSellInfo
|
||||
{
|
||||
public InternalSellInfo()
|
||||
{
|
||||
Add( typeof( WoodenBowlOfCarrots ), 1 );
|
||||
Add( typeof( WoodenBowlOfCorn ), 1 );
|
||||
Add( typeof( WoodenBowlOfLettuce ), 1 );
|
||||
Add( typeof( WoodenBowlOfPeas ), 1 );
|
||||
Add( typeof( EmptyPewterBowl ), 1 );
|
||||
Add( typeof( PewterBowlOfCorn ), 1 );
|
||||
Add( typeof( PewterBowlOfLettuce ), 1 );
|
||||
Add( typeof( PewterBowlOfPeas ), 1 );
|
||||
Add( typeof( PewterBowlOfPotatos ), 1 );
|
||||
Add( typeof( WoodenBowlOfStew ), 1 );
|
||||
Add( typeof( WoodenBowlOfTomatoSoup ), 1 );
|
||||
Add( typeof( BeverageBottle ), 3 );
|
||||
Add( typeof( Jug ), 6 );
|
||||
Add( typeof( Pitcher ), 5 );
|
||||
Add( typeof( GlassMug ), 1 );
|
||||
Add( typeof( BreadLoaf ), 3 );
|
||||
//Add( typeof( CheeseWheel ), 12 );
|
||||
//Add( typeof( Ribs ), 6 );
|
||||
//Add( typeof( Peach ), 1 );
|
||||
//Add( typeof( Pear ), 1 );
|
||||
//Add( typeof( Grapes ), 1 );
|
||||
//Add( typeof( Apple ), 1 );
|
||||
//Add( typeof( Banana ), 1 );
|
||||
Add( typeof( Candle ), 3 );
|
||||
Add( typeof( Chessboard ), 1 );
|
||||
Add( typeof( CheckerBoard ), 1 );
|
||||
Add( typeof( Backgammon ), 1 );
|
||||
Add( typeof( Dices ), 1 );
|
||||
Add( typeof( ContractOfEmployment ), 626 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class SeaMarketTavernKeeper : BaseVendor
|
||||
{
|
||||
private List<SBInfo> m_SBInfos = new List<SBInfo>();
|
||||
protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
|
||||
|
||||
[Constructable]
|
||||
public SeaMarketTavernKeeper() : base( "the tavern keeper" )
|
||||
{
|
||||
}
|
||||
|
||||
public override void InitSBInfo()
|
||||
{
|
||||
m_SBInfos.Add(new SBSeaMarketTavernKeeper());
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
base.InitOutfit();
|
||||
|
||||
AddItem( new Server.Items.HalfApron() );
|
||||
}
|
||||
|
||||
public SeaMarketTavernKeeper( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
1848
Scripts/Services/Expansions/High Seas/Multis/BaseGalleon.cs
Normal file
1848
Scripts/Services/Expansions/High Seas/Multis/BaseGalleon.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,49 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class BoatMountItem : Item, IMountItem
|
||||
{
|
||||
private BaseBoat m_Mount;
|
||||
public IMount Mount { get { return m_Mount; } }
|
||||
|
||||
public BoatMountItem(BaseBoat mount) : base(0x3E96)
|
||||
{
|
||||
Layer = Layer.Mount;
|
||||
|
||||
Movable = false;
|
||||
m_Mount = mount;
|
||||
}
|
||||
|
||||
public BoatMountItem(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
|
||||
writer.Write((Item)m_Mount);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Mount = reader.ReadItem() as BaseBoat;
|
||||
|
||||
if (m_Mount == null)
|
||||
Delete();
|
||||
else
|
||||
Internalize();
|
||||
}
|
||||
}
|
||||
}
|
||||
364
Scripts/Services/Expansions/High Seas/Multis/BritannianShip.cs
Normal file
364
Scripts/Services/Expansions/High Seas/Multis/BritannianShip.cs
Normal file
@@ -0,0 +1,364 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class BritannianShip : BaseGalleon
|
||||
{
|
||||
public override int NorthID { get { return 0x40 + (DamageValue * 4); } }
|
||||
public override int EastID { get { return 0x41 + (DamageValue * 4); } }
|
||||
public override int SouthID { get { return 0x42 + (DamageValue * 4); } }
|
||||
public override int WestID { get { return 0x43 + (DamageValue * 4); } }
|
||||
|
||||
public override int HoldDistance { get { return 9; } }
|
||||
public override int TillerManDistance { get { return 7; } }
|
||||
public override int RuneOffset { get { return -5; } }
|
||||
public override int MaxAddons { get { return 2; } }
|
||||
|
||||
public override int WheelDistance { get { return 3; } }
|
||||
public override int CaptiveOffset { get { return 5; } }
|
||||
public override int MaxCannons { get { return 9; } }
|
||||
public override int MaxHits { get { return 200000; } }
|
||||
|
||||
public override double TurnDelay { get { return 3; } }
|
||||
public override TimeSpan BoatDecayDelay { get { return TimeSpan.FromDays(30); } }
|
||||
public override int ZSurface { get { return 18; } }
|
||||
|
||||
public override BaseDockedBoat DockedBoat { get { return new DockedBritannianShip(this); } }
|
||||
|
||||
public override int DamageValue
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (DamageTaken)
|
||||
{
|
||||
default:
|
||||
case DamageLevel.Pristine:
|
||||
case DamageLevel.Slightly:
|
||||
case DamageLevel.Moderately: return 0;
|
||||
case DamageLevel.Heavily:
|
||||
case DamageLevel.Severely: return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BritannianShip() : this(Direction.North) { }
|
||||
|
||||
[Constructable]
|
||||
public BritannianShip(Direction facing)
|
||||
: base(facing)
|
||||
{
|
||||
}
|
||||
|
||||
public override int[][] CannonTileIDs { get { return m_CannonTileIDs; } }
|
||||
private int[][] m_CannonTileIDs = new int[][]
|
||||
{
|
||||
new int[] { 23612, 23631, 23630, 23632, 23634, 23639, 23637, 23643, 23641 }, //SOUTH
|
||||
new int[] { 23666, 23684, 23685, 23686, 23688, 23691, 23693, 23695, 23697 }, //WEST
|
||||
new int[] { 23558, 23576, 23577, 23580, 23578, 23583, 23585, 23587, 23589 }, //NORTH
|
||||
new int[] { 23504, 23522, 23523, 23526, 23524, 23529, 23531, 23533, 23535 }, //EAST
|
||||
|
||||
new int[] { 23612, 23631, 23630, 23632, 23634, 23639, 23637, 23643, 23641 }, //SOUTH
|
||||
new int[] { 23666, 23684, 23685, 23686, 23688, 23691, 23693, 23695, 23697 }, //WEST
|
||||
new int[] { 23558, 23576, 23577, 23580, 23578, 23583, 23585, 23587, 23589 }, //NORTH
|
||||
new int[] { 23504, 23522, 23523, 23526, 23524, 23529, 23531, 23533, 23535 }, //EAST
|
||||
};
|
||||
|
||||
public override int[][] FillerIDs { get { return m_FillerIDs; } }
|
||||
private int[][] m_FillerIDs = new int[][]
|
||||
{
|
||||
// fsail faddn baddn
|
||||
new int[] { 23833, 23664, 23665 }, //SOUTH
|
||||
new int[] { 23887, 23718, 23719 }, //WEST
|
||||
new int[] { 23779, 23610, 23611 }, //NORTH
|
||||
new int[] { 23725, 23556, 23557 }, //EAST
|
||||
|
||||
new int[] { 23833, 23664, 23665 }, //SOUTH
|
||||
new int[] { 23887, 23718, 23719 }, //WEST
|
||||
new int[] { 23779, 23610, 23611 }, //NORTH
|
||||
new int[] { 23725, 23556, 23557 }, //EAST
|
||||
};
|
||||
|
||||
public override int[][] HoldIDs { get { return m_HoldIDs; } }
|
||||
private int[][] m_HoldIDs = new int[][]
|
||||
{
|
||||
new int[] { 23649, 23650, 23652, 23653, 23654, 23655, 23656, 23651}, //SOUTH
|
||||
new int[] { 23703, 23704, 23706, 23707, 23708, 23709, 23710, 23705}, //WEST
|
||||
new int[] { 23595, 23596, 23598, 23599, 23600, 23601, 23602, 23597}, //NORTH
|
||||
new int[] { 23541, 23542, 23544, 23545, 23546, 23547, 23548, 23543}, //EAST
|
||||
|
||||
new int[] { 23649, 23650, 23652, 23653, 23654, 23655, 23656, 23651}, //SOUTH
|
||||
new int[] { 23703, 23704, 23706, 23707, 23708, 23709, 23710, 23705}, //WEST
|
||||
new int[] { 23595, 23596, 23598, 23599, 23600, 23601, 23602, 23597}, //NORTH
|
||||
new int[] { 23541, 23542, 23544, 23545, 23546, 23547, 23548, 23543}, //EAST
|
||||
};
|
||||
|
||||
public override int[][] HoldItemIDs { get { return m_HoldItemIDs; } }
|
||||
private int[][] m_HoldItemIDs = new int[][]
|
||||
{
|
||||
new int[] { 23648 },
|
||||
new int[] { 23702 },
|
||||
new int[] { 23594 },
|
||||
new int[] { 23540 },
|
||||
|
||||
new int[] { 23648 },
|
||||
new int[] { 23702 },
|
||||
new int[] { 23594 },
|
||||
new int[] { 23540 },
|
||||
};
|
||||
|
||||
public override int[][] WheelItemIDs { get { return m_WheelItemIDs; } }
|
||||
private int[][] m_WheelItemIDs = new int[][]
|
||||
{
|
||||
|
||||
new int[] { 23618 },
|
||||
new int[] { 23618 },
|
||||
new int[] { 23618 },
|
||||
new int[] { 23618 },
|
||||
};
|
||||
|
||||
public override ShipPosition GetCannonPosition(Point3D pnt)
|
||||
{
|
||||
int x = pnt.X; int y = pnt.Y;
|
||||
|
||||
switch (Facing)
|
||||
{
|
||||
default:
|
||||
case Direction.North:
|
||||
if (x == this.X && y < this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x > this.X && y + 5 == this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x < this.X && y + 5 == this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x > this.X && y + 1 == this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x < this.X && y + 1 == this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x > this.X && y - 3 == this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x < this.X && y - 3 == this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x > this.X && y - 3 > this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.West:
|
||||
if (x < this.X && y == this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x + 5 == this.X && y < this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x + 5 == this.X && y > this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x + 1 == this.X && y < this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x + 1 == this.X && y > this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x - 3 == this.X && y < this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x - 3 == this.X && y > this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x - 3 > this.X && y < this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.South:
|
||||
if (x == this.X && y > this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x < this.X && y - 5 == this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x > this.X && y - 5 == this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x < this.X && y - 1 == this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x > this.X && y - 1 == this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x < this.X && y + 3 == this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x > this.X && y + 3 == this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x < this.X && y + 3 < this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.East:
|
||||
if (x > this.X && y == this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x - 5 == this.X && y > this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x - 5 == this.X && y < this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x - 1 == this.X && y > this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x - 1 == this.X && y < this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x + 3 == this.X && y > this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x + 3 == this.X && y < this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x + 3 < this.X && y > this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly int PortAndStarboardOffset = 4;
|
||||
private readonly int AftOffset = 18;
|
||||
private readonly int BowOffset = 17;
|
||||
|
||||
public override bool Contains(int x, int y)
|
||||
{
|
||||
bool contains = base.Contains(x, y);
|
||||
|
||||
if (contains)
|
||||
{
|
||||
int boatX = this.X;
|
||||
int boatY = this.Y;
|
||||
|
||||
switch (Facing)
|
||||
{
|
||||
case Direction.North:
|
||||
if (x > boatX + PortAndStarboardOffset || x < boatX - PortAndStarboardOffset)
|
||||
return false;
|
||||
if (y > boatY + AftOffset || y < boatY - BowOffset)
|
||||
return false;
|
||||
return true;
|
||||
case Direction.South:
|
||||
if (x > boatX + PortAndStarboardOffset || x < boatX - PortAndStarboardOffset)
|
||||
return false;
|
||||
if (y > boatY + BowOffset || y < boatY - AftOffset)
|
||||
return false;
|
||||
return true;
|
||||
case Direction.East:
|
||||
if (x > boatX + BowOffset || x < boatX - AftOffset)
|
||||
return false;
|
||||
if (y > boatY + PortAndStarboardOffset || y < boatY - PortAndStarboardOffset)
|
||||
return false;
|
||||
return true;
|
||||
case Direction.West:
|
||||
if (x > boatX + AftOffset || x < boatX - BowOffset)
|
||||
return false;
|
||||
if (y > boatY + PortAndStarboardOffset || y < boatY - PortAndStarboardOffset)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return contains;
|
||||
}
|
||||
|
||||
public override bool ExemptOverheadComponent(Point3D newPnt, int itemID, int x, int y, int height)
|
||||
{
|
||||
//if (height > this.Z + 16) //TODO: Get height of mast
|
||||
// return false;
|
||||
|
||||
switch (itemID)
|
||||
{
|
||||
case 0x18: //North/South ID's
|
||||
case 0x1A:
|
||||
case 0x1C:
|
||||
case 0x1E:
|
||||
case 0x20:
|
||||
case 0x22:
|
||||
if (x > newPnt.X + PortAndStarboardOffset || x < newPnt.X - PortAndStarboardOffset)
|
||||
return true;
|
||||
break;
|
||||
case 0x19: //East/West ID's
|
||||
case 0x1B:
|
||||
case 0x1D:
|
||||
case 0x1F:
|
||||
case 0x21:
|
||||
case 0x23:
|
||||
if (y > newPnt.Y + PortAndStarboardOffset || y < newPnt.Y - PortAndStarboardOffset)
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
||||
return base.ExemptOverheadComponent(newPnt, itemID, x, y, height);
|
||||
}
|
||||
|
||||
public BritannianShip(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BritannianShipDeed : BaseBoatDeed
|
||||
{
|
||||
public override int LabelNumber { get { return 1150017; } }
|
||||
public override BaseBoat Boat { get { return new BritannianShip(this.BoatDirection); } }
|
||||
|
||||
[Constructable]
|
||||
public BritannianShipDeed()
|
||||
: base(0x40, Point3D.Zero)
|
||||
{
|
||||
}
|
||||
|
||||
public BritannianShipDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
}
|
||||
|
||||
public class DockedBritannianShip : BaseDockedBoat
|
||||
{
|
||||
public override int LabelNumber { get { return 1150100; } } //Britannian Ship
|
||||
public override BaseBoat Boat { get { return new BritannianShip(this.BoatDirection); } }
|
||||
|
||||
public DockedBritannianShip(BaseBoat boat)
|
||||
: base(0x40, Point3D.Zero, boat)
|
||||
{
|
||||
}
|
||||
|
||||
public DockedBritannianShip(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
}
|
||||
}
|
||||
164
Scripts/Services/Expansions/High Seas/Multis/GalleonContainer.cs
Normal file
164
Scripts/Services/Expansions/High Seas/Multis/GalleonContainer.cs
Normal file
@@ -0,0 +1,164 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Multis;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.ContextMenus;
|
||||
using Server.Targeting;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GalleonContainer : WoodenChest, IChopable
|
||||
{
|
||||
private BaseGalleon m_Galleon;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseGalleon Galleon { get { return m_Galleon; } }
|
||||
|
||||
public override bool IsDecoContainer { get { return false; } }
|
||||
|
||||
public override string DefaultName { get { return "Ship Container"; } }
|
||||
|
||||
public override int DefaultMaxWeight { get { return 1250; } }
|
||||
|
||||
public GalleonContainer(BaseGalleon galleon)
|
||||
{
|
||||
m_Galleon = galleon;
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
list.Add(new RelocateContainerEntry(this, m_Galleon));
|
||||
}
|
||||
|
||||
private class RelocateContainerEntry : ContextMenuEntry
|
||||
{
|
||||
private GalleonContainer m_Container;
|
||||
private BaseGalleon m_Galleon;
|
||||
|
||||
public RelocateContainerEntry(GalleonContainer container, BaseGalleon galleon)
|
||||
: base(1061829, 3)
|
||||
{
|
||||
m_Galleon = galleon;
|
||||
m_Container = container;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
Owner.From.Target = new RelocateTarget(m_Container, m_Galleon);
|
||||
Owner.From.SendMessage("Where do you wish to relocate the ship container?");
|
||||
}
|
||||
}
|
||||
|
||||
private class RelocateTarget : Target
|
||||
{
|
||||
private GalleonContainer m_Container;
|
||||
private BaseGalleon m_Galleon;
|
||||
|
||||
public RelocateTarget(GalleonContainer container, BaseGalleon galleon)
|
||||
: base(12, false, TargetFlags.None)
|
||||
{
|
||||
m_Container = container;
|
||||
m_Galleon = galleon;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is IPoint3D && from.Map != null)
|
||||
{
|
||||
IPoint3D pnt = (IPoint3D)targeted;
|
||||
|
||||
BaseBoat boat = BaseBoat.FindBoatAt(pnt, from.Map);
|
||||
|
||||
if (boat != null && boat == m_Galleon && IsSurface(pnt))
|
||||
{
|
||||
IPooledEnumerable eable = from.Map.GetObjectsInRange(new Point3D(pnt), 0);
|
||||
|
||||
foreach (object o in eable)
|
||||
{
|
||||
if (o is Mobile || o is Item)
|
||||
{
|
||||
from.SendMessage("You cannot place the ship container there, try again.");
|
||||
from.Target = new RelocateTarget(m_Container, m_Galleon);
|
||||
eable.Free();
|
||||
return;
|
||||
}
|
||||
}
|
||||
eable.Free();
|
||||
|
||||
StaticTarget st = (StaticTarget)pnt;
|
||||
int z = m_Galleon.ZSurface;
|
||||
|
||||
if (st != null)
|
||||
z = st.Z;
|
||||
|
||||
m_Container.MoveToWorld(new Point3D(pnt.X, pnt.Y, z), from.Map);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("You cannot place the ship container there, try again.");
|
||||
from.Target = new RelocateTarget(m_Container, m_Galleon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsSurface(IPoint3D pnt)
|
||||
{
|
||||
if (pnt is StaticTarget)
|
||||
{
|
||||
StaticTarget st = (StaticTarget)pnt;
|
||||
|
||||
if ((st.Flags & TileFlag.Surface) > 0)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (m_Galleon == null || from.AccessLevel > AccessLevel.Player)
|
||||
base.OnDoubleClick(from);
|
||||
else if (!m_Galleon.Contains(from))
|
||||
{
|
||||
if(m_Galleon.TillerMan != null)
|
||||
m_Galleon.TillerManSay("You must be on the ship to open the container.");
|
||||
}
|
||||
else if (m_Galleon.Owner is PlayerMobile && !m_Galleon.Scuttled && m_Galleon.GetSecurityLevel(from) < SecurityLevel.Crewman)
|
||||
from.SendMessage("You must be at least a crewman to access the ship container.");
|
||||
else
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public void OnChop(Mobile from)
|
||||
{
|
||||
if (m_Galleon != null && m_Galleon.Owner == from)
|
||||
{
|
||||
Effects.PlaySound(Location, Map, 0x3B3);
|
||||
from.SendLocalizedMessage(500461); // You destroy the item.
|
||||
Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
public GalleonContainer(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
writer.Write(m_Galleon);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Galleon = reader.ReadItem() as BaseGalleon;
|
||||
}
|
||||
}
|
||||
}
|
||||
141
Scripts/Services/Expansions/High Seas/Multis/GalleonHold.cs
Normal file
141
Scripts/Services/Expansions/High Seas/Multis/GalleonHold.cs
Normal file
@@ -0,0 +1,141 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Multis;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GalleonHold : Container, IGalleonFixture
|
||||
{
|
||||
public override int LabelNumber { get { return 1149699; } } // cargo hold
|
||||
public override bool ForceShowProperties { get { return true; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseGalleon Galleon { get; set; }
|
||||
|
||||
public override int DefaultMaxWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Galleon is BritannianShip)
|
||||
return 28000;
|
||||
else if (Galleon is GargishGalleon)
|
||||
return 12000;
|
||||
else if (Galleon is OrcishGalleon)
|
||||
return 14000;
|
||||
else
|
||||
return 16000;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsDecoContainer { get { return false; } }
|
||||
|
||||
public override Rectangle2D Bounds { get { return new Rectangle2D(46, 74, 150, 110); } }
|
||||
public override int DefaultGumpID { get { return 0x4C; } }
|
||||
public override int DefaultDropSound { get { return 0x42; } }
|
||||
|
||||
public GalleonHold(BaseGalleon galleon, int itemID) : base(itemID)
|
||||
{
|
||||
Galleon = galleon;
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Galleon == null || from.AccessLevel > AccessLevel.Player)
|
||||
{
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
else if (!Galleon.Contains(from))
|
||||
{
|
||||
if (Galleon.TillerMan != null)
|
||||
Galleon.TillerManSay(502490); // You must be on the ship to open the hold.
|
||||
}
|
||||
else if (Galleon.Owner is PlayerMobile && !Galleon.Scuttled && Galleon.GetSecurityLevel(from) < SecurityLevel.Officer)
|
||||
{
|
||||
from.Say(1010436); // You do not have permission to do this.
|
||||
}
|
||||
else
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public GalleonHold(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
{
|
||||
reader.ReadItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class HoldItem : Item, IGalleonFixture
|
||||
{
|
||||
public override int LabelNumber { get { return 1149699; } } // cargo hold
|
||||
public override bool ForceShowProperties { get { return true; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseGalleon Galleon { get; set; }
|
||||
|
||||
public HoldItem(BaseGalleon g, int itemid)
|
||||
: base(itemid)
|
||||
{
|
||||
Galleon = g;
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Galleon == null || Galleon.GalleonHold == null || !from.InRange(Location, 2))
|
||||
return;
|
||||
|
||||
Galleon.GalleonHold.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Galleon != null && Galleon.GalleonHold != null)
|
||||
{
|
||||
var hold = Galleon.GalleonHold;
|
||||
list.Add(1072241, String.Format("{0}\t{1}\t{2}\t{3}", hold.TotalItems, hold.MaxItems, hold.TotalWeight, hold.MaxWeight)); // Contents: ~1_COUNT~/~2_MAXCOUNT~ items, ~3_WEIGHT~/~4_MAXWEIGHT~ stones
|
||||
}
|
||||
}
|
||||
|
||||
public HoldItem(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
{
|
||||
reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
63
Scripts/Services/Expansions/High Seas/Multis/GalleonItem.cs
Normal file
63
Scripts/Services/Expansions/High Seas/Multis/GalleonItem.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Multis;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DeckItem : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1035994; } } // deck
|
||||
|
||||
public DeckItem(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public DeckItem(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class WeaponPad : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1102376; } } // weapon pad
|
||||
|
||||
public WeaponPad(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public WeaponPad(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
531
Scripts/Services/Expansions/High Seas/Multis/GalleonPilot.cs
Normal file
531
Scripts/Services/Expansions/High Seas/Multis/GalleonPilot.cs
Normal file
@@ -0,0 +1,531 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Multis;
|
||||
using Server.ContextMenus;
|
||||
using System.Collections.Generic;
|
||||
using Server.Gumps;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class GalleonPilot : BaseCreature
|
||||
{
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseGalleon Galleon { get; private set; }
|
||||
|
||||
public List<Item> OriginalItems { get; private set; }
|
||||
|
||||
public GalleonPilot(BaseGalleon galleon)
|
||||
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
|
||||
{
|
||||
Body = 0x190;
|
||||
CantWalk = true;
|
||||
Galleon = galleon;
|
||||
Blessed = true;
|
||||
|
||||
InitBody();
|
||||
InitOutfit();
|
||||
|
||||
OriginalItems = new List<Item>();
|
||||
|
||||
foreach (Item item in Items)
|
||||
OriginalItems.Add(item);
|
||||
|
||||
SetSkill(SkillName.Cartography, 100.0);
|
||||
}
|
||||
|
||||
public virtual void InitBody()
|
||||
{
|
||||
InitStats(100, 100, 25);
|
||||
|
||||
SpeechHue = Utility.RandomDyedHue();
|
||||
Hue = Utility.RandomSkinHue();
|
||||
|
||||
if (Blessed && !Core.AOS)
|
||||
NameHue = 0x35;
|
||||
|
||||
if (Female = GetGender())
|
||||
{
|
||||
Body = 0x191;
|
||||
Name = NameList.RandomName("female");
|
||||
}
|
||||
else
|
||||
{
|
||||
Body = 0x190;
|
||||
Name = NameList.RandomName("male");
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool GetGender()
|
||||
{
|
||||
return Utility.RandomBool();
|
||||
}
|
||||
|
||||
public virtual int GetHairHue()
|
||||
{
|
||||
return Utility.RandomHairHue();
|
||||
}
|
||||
|
||||
public virtual int GetShoeHue()
|
||||
{
|
||||
if (0.1 > Utility.RandomDouble())
|
||||
return 0;
|
||||
|
||||
return Utility.RandomNeutralHue();
|
||||
}
|
||||
|
||||
public virtual void InitOutfit()
|
||||
{
|
||||
if (Core.SE && this.Map == Map.Tokuno)
|
||||
{
|
||||
|
||||
if (Utility.Random(2) == 0)
|
||||
SetWearable(new Kasa(GetRandomHue()));
|
||||
if (Utility.Random(2) == 0)
|
||||
SetWearable(new Obi(GetRandomHue()));
|
||||
if (Utility.RandomDouble() < 0.25)
|
||||
{
|
||||
if (Female)
|
||||
SetWearable(new FemaleKimono(GetRandomHue()));
|
||||
else
|
||||
{
|
||||
if (Utility.Random(2) == 0)
|
||||
SetWearable(new MaleKimono(GetRandomHue()));
|
||||
else
|
||||
SetWearable(new Kamishimo(GetRandomHue()));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (Utility.Random(2))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
SetWearable(new FancyShirt(GetRandomHue()));
|
||||
SetWearable(new JinBaori(GetRandomHue())); break;
|
||||
}
|
||||
case 1: SetWearable(new HakamaShita(GetRandomHue())); break;
|
||||
|
||||
}
|
||||
switch (Utility.Random(2))
|
||||
{
|
||||
case 0: SetWearable(new Hakama(GetRandomHue())); break;
|
||||
case 1: SetWearable(new TattsukeHakama(GetRandomHue())); break;
|
||||
|
||||
}
|
||||
}
|
||||
switch (Utility.Random(2))
|
||||
{
|
||||
case 0: SetWearable(new Sandals(GetShoeHue())); break;
|
||||
case 1: SetWearable(new Waraji(GetShoeHue())); break;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 0: SetWearable(new FancyShirt(GetRandomHue())); break;
|
||||
case 1: SetWearable(new Doublet(GetRandomHue())); break;
|
||||
case 2: SetWearable(new Shirt(GetRandomHue())); break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
switch (Utility.Random(4))
|
||||
{
|
||||
case 0: SetWearable(new Shoes(GetShoeHue())); break;
|
||||
case 1: SetWearable(new Boots(GetShoeHue())); break;
|
||||
case 2: SetWearable(new Sandals(GetShoeHue())); break;
|
||||
case 3: SetWearable(new ThighBoots(GetShoeHue())); break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (Female)
|
||||
{
|
||||
switch (Utility.Random(6))
|
||||
{
|
||||
case 0: SetWearable(new ShortPants(GetRandomHue())); break;
|
||||
case 1:
|
||||
case 2: SetWearable(new Kilt(GetRandomHue())); break;
|
||||
case 3:
|
||||
case 4:
|
||||
case 5: SetWearable(new Skirt(GetRandomHue())); break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (Utility.Random(2))
|
||||
{
|
||||
case 0: SetWearable(new LongPants(GetRandomHue())); break;
|
||||
case 1: SetWearable(new ShortPants(GetRandomHue())); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
int hairHue = GetHairHue();
|
||||
|
||||
Utility.AssignRandomHair(this, hairHue);
|
||||
Utility.AssignRandomFacialHair(this, hairHue);
|
||||
}
|
||||
|
||||
public virtual int GetRandomHue()
|
||||
{
|
||||
switch (Utility.Random(5))
|
||||
{
|
||||
default:
|
||||
case 0: return Utility.RandomBlueHue();
|
||||
case 1: return Utility.RandomGreenHue();
|
||||
case 2: return Utility.RandomRedHue();
|
||||
case 3: return Utility.RandomYellowHue();
|
||||
case 4: return Utility.RandomNeutralHue();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetFacing(Direction dir)
|
||||
{
|
||||
Direction = dir;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Galleon != null)
|
||||
{
|
||||
list.Add(Galleon.Status);
|
||||
list.Add(1116580 + (int)Galleon.DamageTaken); //State: Prisine
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Galleon == null || !Galleon.IsOwner(from))
|
||||
base.OnDoubleClick(from);
|
||||
else if (Galleon != null && Galleon.Contains(from))
|
||||
Galleon.BeginRename(from);
|
||||
else if (Galleon != null)
|
||||
Galleon.BeginDryDock(from);
|
||||
}
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
if (dropped is MapItem && Galleon != null && Galleon.CanCommand(from) && Galleon.Contains(from))
|
||||
{
|
||||
Galleon.AssociateMap((MapItem)dropped);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckNonlocalLift(Mobile from, Item item)
|
||||
{
|
||||
if (Galleon == null || from == null)
|
||||
return false;
|
||||
|
||||
if (Galleon.GetSecurityLevel(from) >= SecurityLevel.Captain)
|
||||
return true;
|
||||
|
||||
return base.CheckNonlocalLift(from, item);
|
||||
}
|
||||
|
||||
public override bool AllowEquipFrom(Mobile from)
|
||||
{
|
||||
if (Galleon == null || from == null)
|
||||
return false;
|
||||
|
||||
if (Galleon.GetSecurityLevel(from) >= SecurityLevel.Captain)
|
||||
return true;
|
||||
|
||||
return base.AllowEquipFrom(from);
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (Galleon != null)
|
||||
{
|
||||
if (Galleon.Contains(from))
|
||||
{
|
||||
SecurityLevel level = Galleon.GetSecurityLevel(from);
|
||||
|
||||
if (level >= SecurityLevel.Crewman)
|
||||
{
|
||||
list.Add(new EmergencyRepairEntry(this, from));
|
||||
list.Add(new ShipRepairEntry(this, from));
|
||||
}
|
||||
|
||||
if (level == SecurityLevel.Captain)
|
||||
{
|
||||
list.Add(new RenameShipEntry(Galleon, from));
|
||||
list.Add(new MoveTillermanEntry(this, from));
|
||||
list.Add(new SecuritySettingsEntry(this, from));
|
||||
list.Add(new ResetSecuritySettings(this, from));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(new DryDockEntry(Galleon, from));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class EmergencyRepairEntry : ContextMenuEntry
|
||||
{
|
||||
private GalleonPilot m_Pilot;
|
||||
private Mobile m_From;
|
||||
|
||||
public EmergencyRepairEntry(GalleonPilot pilot, Mobile from)
|
||||
: base(1116589, 5) // Emergency Repairs
|
||||
{
|
||||
m_Pilot = pilot;
|
||||
m_From = from;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (m_Pilot != null && m_Pilot.Galleon != null)
|
||||
{
|
||||
BaseGalleon g = m_Pilot.Galleon;
|
||||
|
||||
if (!g.Scuttled)
|
||||
m_From.SendLocalizedMessage(1116595); // Your ship is not in need of emergency repairs in order to sail.
|
||||
else if (g.IsUnderEmergencyRepairs())
|
||||
{
|
||||
TimeSpan left = g.GetEndEmergencyRepairs();
|
||||
m_From.SendLocalizedMessage(1116592, left != TimeSpan.Zero ? left.TotalMinutes.ToString() : "0"); // Your ship is underway with emergency repairs holding for an estimated ~1_TIME~ more minutes.
|
||||
}
|
||||
else if (!g.TryEmergencyRepair(m_From))
|
||||
m_From.SendLocalizedMessage(1116591, string.Format("{0}\t{1}", BaseBoat.EmergencyRepairClothCost.ToString(), BaseBoat.EmergencyRepairWoodCost)); //You need a minimum of ~1_CLOTH~ yards of cloth and ~2_WOOD~ pieces of lumber to effect emergency repairs.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class ShipRepairEntry : ContextMenuEntry
|
||||
{
|
||||
private GalleonPilot m_Pilot;
|
||||
private Mobile m_From;
|
||||
|
||||
public ShipRepairEntry(GalleonPilot pilot, Mobile from)
|
||||
: base(1116590, 5) // Permanent Repairs
|
||||
{
|
||||
m_Pilot = pilot;
|
||||
m_From = from;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (m_Pilot != null && m_Pilot.Galleon != null)
|
||||
{
|
||||
if (!BaseGalleon.IsNearLandOrDocks(m_Pilot.Galleon))
|
||||
m_From.SendLocalizedMessage(1116594); // Your ship must be near shore or a sea market in order to effect permanent repairs.
|
||||
else if (m_Pilot.Galleon.DamageTaken == DamageLevel.Pristine)
|
||||
m_From.SendLocalizedMessage(1116596); // Your ship is in pristine condition and does not need repairs.
|
||||
else
|
||||
m_Pilot.Galleon.TryRepairs(m_From);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class MoveTillermanEntry : ContextMenuEntry
|
||||
{
|
||||
private GalleonPilot m_Pilot;
|
||||
private Mobile m_From;
|
||||
|
||||
public MoveTillermanEntry(GalleonPilot pilot, Mobile from)
|
||||
: base(1116729, 5) // Move Tillerman
|
||||
{
|
||||
m_Pilot = pilot;
|
||||
m_From = from;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
m_From.Target = new RelocateTarget(m_Pilot, m_Pilot.Galleon);
|
||||
m_From.SendLocalizedMessage(1116736); // Where do you wish to station the pilot?
|
||||
}
|
||||
}
|
||||
|
||||
private class RelocateTarget : Target
|
||||
{
|
||||
private GalleonPilot m_Pilot;
|
||||
private BaseGalleon m_Galleon;
|
||||
|
||||
public RelocateTarget(GalleonPilot pilot, BaseGalleon galleon)
|
||||
: base(12, false, TargetFlags.None)
|
||||
{
|
||||
m_Pilot = pilot;
|
||||
m_Galleon = galleon;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is IPoint3D && from.Map != null)
|
||||
{
|
||||
IPoint3D pnt = (IPoint3D)targeted;
|
||||
|
||||
BaseBoat boat = BaseBoat.FindBoatAt(pnt, from.Map);
|
||||
|
||||
if (boat != null && boat == m_Galleon && IsSurface(pnt))
|
||||
{
|
||||
IPooledEnumerable eable = m_Pilot.Map.GetObjectsInRange(new Point3D(pnt), 0);
|
||||
|
||||
foreach (object o in eable)
|
||||
{
|
||||
if (o is Mobile || o is Item)
|
||||
{
|
||||
from.SendLocalizedMessage(1011577); // This is an invalid location.
|
||||
from.Target = new RelocateTarget(m_Pilot, m_Galleon);
|
||||
eable.Free();
|
||||
return;
|
||||
}
|
||||
}
|
||||
eable.Free();
|
||||
|
||||
StaticTarget st = (StaticTarget)pnt;
|
||||
int z = m_Galleon.ZSurface;
|
||||
|
||||
if (st != null)
|
||||
z = st.Z;
|
||||
|
||||
m_Pilot.MoveToWorld(new Point3D(pnt.X, pnt.Y, z), from.Map);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1011577); // This is an invalid location.
|
||||
from.Target = new RelocateTarget(m_Pilot, m_Galleon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsSurface(IPoint3D pnt)
|
||||
{
|
||||
if (pnt is StaticTarget)
|
||||
{
|
||||
StaticTarget st = (StaticTarget)pnt;
|
||||
|
||||
if ((st.Flags & TileFlag.Surface) > 0)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private class SecuritySettingsEntry : ContextMenuEntry
|
||||
{
|
||||
private GalleonPilot m_Pilot;
|
||||
private Mobile m_From;
|
||||
|
||||
public SecuritySettingsEntry(GalleonPilot pilot, Mobile from)
|
||||
: base(1149786, 5) // Security Settings
|
||||
{
|
||||
m_Pilot = pilot;
|
||||
m_From = from;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (m_Pilot != null && m_Pilot.Galleon != null && !m_From.HasGump(typeof(ShipSecurityGump)))
|
||||
m_From.SendGump(new ShipSecurityGump(m_From, m_Pilot.Galleon));
|
||||
}
|
||||
}
|
||||
|
||||
private class ResetSecuritySettings : ContextMenuEntry
|
||||
{
|
||||
private GalleonPilot m_Pilot;
|
||||
private Mobile m_From;
|
||||
|
||||
public ResetSecuritySettings(GalleonPilot pilot, Mobile from)
|
||||
: base(1060700, 5) // Reset Security
|
||||
{
|
||||
m_Pilot = pilot;
|
||||
m_From = from;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (m_Pilot != null && m_Pilot.Galleon != null)
|
||||
{
|
||||
m_From.SendGump(new BasicConfirmGump<BaseGalleon>(new TextDefinition(1116618), (m, boat) => // Are you sure you wish to clear your ship's access list?
|
||||
{
|
||||
boat.SecurityEntry.Manifest.Keys.Where(x => !boat.IsOwner(x)).ToList().ForEach(y =>
|
||||
{
|
||||
boat.SecurityEntry.RemoveFromAccessList(y);
|
||||
});
|
||||
|
||||
}, m_Pilot.Galleon));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if (Galleon != null)
|
||||
Galleon.Delete();
|
||||
}
|
||||
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (Galleon != null)
|
||||
{
|
||||
string nameStr;
|
||||
|
||||
if (Galleon.ShipName == null || Galleon.ShipName.Length == 0)
|
||||
nameStr = "an unnamed ship";
|
||||
else
|
||||
nameStr = string.Format("the {0}", Galleon.ShipName);
|
||||
|
||||
list.Add(string.Format("{0} the Pilot of {1}", Name, nameStr));
|
||||
}
|
||||
else
|
||||
base.AddNameProperties(list);
|
||||
}
|
||||
|
||||
public GalleonPilot(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
|
||||
writer.Write(OriginalItems.Count);
|
||||
foreach (Item item in OriginalItems)
|
||||
writer.Write(item);
|
||||
|
||||
writer.Write(Galleon);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
OriginalItems = new List<Item>();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
int count = reader.ReadInt();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Item item = reader.ReadItem();
|
||||
if (item != null && !item.Deleted)
|
||||
OriginalItems.Add(item);
|
||||
}
|
||||
goto case 0;
|
||||
case 0:
|
||||
Galleon = (BaseGalleon)reader.ReadItem();
|
||||
break;
|
||||
}
|
||||
|
||||
if (Galleon == null)
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
295
Scripts/Services/Expansions/High Seas/Multis/GargishGalleon.cs
Normal file
295
Scripts/Services/Expansions/High Seas/Multis/GargishGalleon.cs
Normal file
@@ -0,0 +1,295 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class GargishGalleon : BaseGalleon
|
||||
{
|
||||
public override int NorthID { get { return 0x24 + (DamageValue * 4); } }
|
||||
public override int EastID { get { return 0x25 + (DamageValue * 4); } }
|
||||
public override int SouthID { get { return 0x26 + (DamageValue * 4); } }
|
||||
public override int WestID { get { return 0x27 + (DamageValue * 4); } }
|
||||
|
||||
public override int HoldDistance { get { return 6; } }
|
||||
public override int TillerManDistance { get { return 1; } }
|
||||
public override int RuneOffset { get { return 3; } }
|
||||
|
||||
public override int WheelDistance { get { return 2; } }
|
||||
public override int CaptiveOffset { get { return 3; } }
|
||||
public override int MaxCannons { get { return 7; } }
|
||||
|
||||
public override double TurnDelay { get { return 1; } }
|
||||
public override int MaxHits { get { return 140000; } }
|
||||
|
||||
public override int ZSurface { get { return 16; } }
|
||||
|
||||
public override BaseDockedBoat DockedBoat { get { return new DockedGargishGalleon(this); } }
|
||||
|
||||
[Constructable]
|
||||
public GargishGalleon() : this(Direction.North) { }
|
||||
|
||||
[Constructable]
|
||||
public GargishGalleon(Direction facing)
|
||||
: base(facing)
|
||||
{
|
||||
}
|
||||
|
||||
public override int[][] CannonTileIDs { get { return m_CannonTileIDs; } }
|
||||
private int[][] m_CannonTileIDs = new int[][]
|
||||
{
|
||||
new int[] { 33463, 33440, 33438, 33327, 33322, 33357, 33355 }, //SOUTH
|
||||
new int[] { 33768, 33745, 33743, 33632, 33627, 33662, 33660 }, //WEST
|
||||
new int[] { 34070, 34047, 34045, 33934, 33929, 33964, 33962 }, //NORTH
|
||||
new int[] { 34373, 34350, 34348, 34237, 34232, 34267, 34265 }, //EAST
|
||||
|
||||
new int[] { 19059, 19042, 19040, 18958, 18956, 18979, 18977 }, //SOUTH D1
|
||||
new int[] { 35582, 35559, 35557, 35446, 35441, 35476, 35474 }, //WEST D1
|
||||
new int[] { 34978, 34955, 34953, 34842, 34837, 34872, 34870 }, //NORTH D1
|
||||
new int[] { 34674, 34651, 34649, 34538, 34533, 34568, 34566 }, //EAST D1
|
||||
|
||||
new int[] { 36442, 36425, 36423, 36341, 36339, 36362, 36360 }, //SOUTH D2
|
||||
new int[] { 36744, 36727, 36725, 36733, 36641, 36664, 36662 }, //WEST D2
|
||||
new int[] { 36140, 36123, 36121, 36039, 36037, 36060, 36058 }, //NORTH D2
|
||||
new int[] { 35156, 35139, 35137, 35055, 35053, 35076, 35074 }, //EAST D2
|
||||
};
|
||||
|
||||
public override int[][] FillerIDs { get { return m_FillerIDs; } }
|
||||
private int[][] m_FillerIDs = new int[][]
|
||||
{
|
||||
// 110 103 96 89 87 88 93 91 98 105 112
|
||||
|
||||
// BL ML1 ML2 FL F1 F2 F3 FR MR2 MR1 BR
|
||||
new int[] { 33410, 33403, 33396, 33389, 33388, 33393, 33391, 33398, 33405, 33412}, //SOUTH
|
||||
new int[] { 33715, 33708, 33701, 33694, 33693, 33698, 33696, 33703, 33710, 33717 }, //WEST
|
||||
new int[] { 34017, 34010, 34003, 33996, 33995, 34000, 33998, 34005, 34012, 34019 }, //NORTH
|
||||
new int[] { 34320, 34313, 34306, 34299, 34298, 34303, 34301, 34308, 34315, 34322 }, //EAST
|
||||
|
||||
// 110 103 96 89 87 88 93 91 98 105 112
|
||||
//35419
|
||||
new int[] { 19026, 19019, 19012, 19005, 19004, 19009, 19007, 19014, 19021, 19028 }, //SOUTH D1
|
||||
new int[] { 35529, 35522, 35515, 35508, 35507, 35512, 35510, 35517, 35524, 35531 }, //WEST D1
|
||||
new int[] { 34925, 34918, 34911, 34904, 34903, 34908, 34906, 34913, 34920, 34927 }, //NORTH D1
|
||||
new int[] { 34621, 34614, 34607, 34600, 34599, 34604, 34602, 34609, 34616, 34623 }, //EAST D1
|
||||
|
||||
// +86 -7 -7 -7 -2 +1 +5 -2 +7 +7 +7
|
||||
// 110 103 96 89 87 88 93 91 98 105 112
|
||||
new int[] { 36409, 36402, 36395, 36388, 36387, 36392, 36390, 36397, 36404, 36411 }, //SOUTH D2
|
||||
new int[] { 36711, 36704, 36697, 36690, 36689, 36694, 36692, 36699, 36706, 36713 }, //WEST D2
|
||||
new int[] { 36107, 36100, 36093, 36086, 36085, 36090, 36088, 36095, 36102, 36109 }, //NORTH D2
|
||||
new int[] { 35123, 35116, 35109, 35102, 35101, 35106, 35104, 35111, 35118, 35125 }, //EAST D2
|
||||
};
|
||||
|
||||
public override int[][] HoldIDs { get { return m_HoldIDs; } }
|
||||
private int[][] m_HoldIDs = new int[][]
|
||||
{
|
||||
// 108 109 114 94 95 100 101 102
|
||||
// BL BM BR MR MM ML FL FR
|
||||
new int[] { 33408, 33409, 33414, 33394, 33395, 33400, 33401, 33402, 33407,
|
||||
33410, 33403, 33396, 33389, 33388, 33393, 33391, 33398, 33405, 33412 }, //SOUTH
|
||||
new int[] { 33713, 33714, 33719, 33699, 33700, 33705, 33706, 33707, 33712,
|
||||
33715, 33708, 33701, 33694, 33693, 33698, 33696, 33703, 33710, 33717}, //WEST
|
||||
new int[] { 34015, 34016, 34021, 34001, 34002, 34007, 34008, 34009, 34007,
|
||||
34017, 34010, 34003, 33996, 33995, 34000, 33998, 34005, 34012, 34019 }, //NORTH
|
||||
new int[] { 34318, 34319, 34324, 34304, 34305, 34310, 34311, 34312, 34317,
|
||||
34320, 34313, 34306, 34299, 34298, 34303, 34301, 34308, 34315, 34322 }, //EAST
|
||||
//18940
|
||||
// +85 +1 +1 -15 +1 +1 +1 +1
|
||||
new int[] { 19025, 19024, 19025, 19010, 19011, 19016, 19017, 19018, 33407,
|
||||
19026, 19019, 19012, 19005, 19004, 19009, 19007, 19014, 19021, 19028 }, //SOUTH D1
|
||||
new int[] { 35506, 35507, 35512, 35513, 35514, 35519, 35520, 35521, 33712,
|
||||
35529, 35522, 35515, 35508, 35507, 35512, 35510, 35517, 35524, 35531 }, //WEST D1
|
||||
new int[] { 34902, 34903, 34908, 34909, 34910, 34915, 34916, 34917, 34007,
|
||||
34925, 34918, 34911, 34904, 34903, 34908, 34906, 34913, 34920, 34927 }, //NORTH D1
|
||||
new int[] { 34598, 34599, 34604, 34605, 34606, 34611, 34612, 34613, 34317,
|
||||
34621, 34614, 34607, 34600, 34599, 34604, 34602, 34609, 34616, 34623 }, //EAST D1
|
||||
|
||||
new int[] { 36386, 36387, 36392, 36393, 36394, 36399, 36400, 36401, 33407,
|
||||
36409, 36402, 36395, 36388, 36387, 36392, 36390, 36397, 36404, 36411 }, //SOUTH D2
|
||||
new int[] { 36688, 36689, 36694, 36695, 36696, 36701, 36702, 36703, 33712,
|
||||
36711, 36704, 36697, 36690, 36689, 36694, 36692, 36699, 36706, 36713 }, //WEST D2
|
||||
new int[] { 36084, 36085, 36090, 36091, 36092, 36097, 36098, 36099, 34007,
|
||||
36107, 36100, 36093, 36086, 36085, 36090, 36088, 36095, 36102, 36109 }, //NORTH D2
|
||||
new int[] { 35121, 35122, 35127, 35107, 35108, 35113, 35114, 35115, 34317,
|
||||
35123, 35116, 35109, 35102, 35101, 35106, 35104, 35111, 35118, 35125}, //EAST D1
|
||||
};
|
||||
|
||||
public override int[][] HoldItemIDs { get { return m_HoldItemIDs; } }
|
||||
private int[][] m_HoldItemIDs = new int[][]
|
||||
{
|
||||
new int[] { 33387 },
|
||||
new int[] { 33692 },
|
||||
new int[] { 33994 },
|
||||
new int[] { 34297 },
|
||||
|
||||
new int[] { 19003 },
|
||||
new int[] { 35506 },
|
||||
new int[] { 34902 },
|
||||
new int[] { 34598 },
|
||||
|
||||
new int[] { 36386 },
|
||||
new int[] { 36688 },
|
||||
new int[] { 36084 },
|
||||
new int[] { 35100 },
|
||||
};
|
||||
|
||||
public override int[][] WheelItemIDs { get { return m_WheelItemIDs; } }
|
||||
private int[][] m_WheelItemIDs = new int[][]
|
||||
{
|
||||
|
||||
new int[] { 33604 },
|
||||
new int[] { 33906 },
|
||||
new int[] { 34208 },
|
||||
new int[] { 34510 },
|
||||
};
|
||||
|
||||
public override ShipPosition GetCannonPosition(Point3D pnt)
|
||||
{
|
||||
int x = pnt.X; int y = pnt.Y;
|
||||
|
||||
switch (Facing)
|
||||
{
|
||||
default:
|
||||
case Direction.North:
|
||||
if (x == this.X && y < this.Y)
|
||||
return ShipPosition.Bow;
|
||||
if (x > this.X && y < this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
if (x < this.X && y < this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
if (x > this.X && y - 2 == this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x < this.X && y - 2 == this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x > this.X && y > this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.West:
|
||||
if (x < this.X && y == this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x < this.X && y < this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x < this.X && y > this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x - 2 == this.X && y < this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x - 2 == this.X && y > this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x > this.X && y < this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.South:
|
||||
if (x == this.X && y > this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x < this.X && y > this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x > this.X && y > this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x < this.X && y + 2 == this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x > this.X && y + 2 == this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x < this.X && y < this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.East:
|
||||
if (x > this.X && y == this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x > this.X && y > this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x > this.X && y < this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x + 2 == this.X && y > this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x + 2 == this.X && y < this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x < this.X && y > this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
}
|
||||
}
|
||||
|
||||
public GargishGalleon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class GargishGalleonDeed : BaseBoatDeed
|
||||
{
|
||||
public override int LabelNumber { get { return 1116739; } }
|
||||
public override BaseBoat Boat { get { return new GargishGalleon(this.BoatDirection); } }
|
||||
|
||||
[Constructable]
|
||||
public GargishGalleonDeed()
|
||||
: base(0x24, Point3D.Zero)
|
||||
{
|
||||
}
|
||||
|
||||
public GargishGalleonDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
}
|
||||
|
||||
public class DockedGargishGalleon : BaseDockedBoat
|
||||
{
|
||||
public override int LabelNumber { get { return 1116748; } } //Gargoyle Ship
|
||||
public override BaseBoat Boat { get { return new GargishGalleon(this.BoatDirection); } }
|
||||
|
||||
public DockedGargishGalleon(BaseBoat boat)
|
||||
: base(0x24, Point3D.Zero, boat)
|
||||
{
|
||||
}
|
||||
|
||||
public DockedGargishGalleon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
}
|
||||
}
|
||||
217
Scripts/Services/Expansions/High Seas/Multis/MooringLine.cs
Normal file
217
Scripts/Services/Expansions/High Seas/Multis/MooringLine.cs
Normal file
@@ -0,0 +1,217 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Multis;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MooringLine : Item
|
||||
{
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseBoat Boat { get; private set; }
|
||||
|
||||
public override int LabelNumber => Boat == null || Boat.IsRowBoat ? 1020935 : 1149697; // rope || mooring line
|
||||
|
||||
public MooringLine(BaseBoat boat)
|
||||
: base(5368)
|
||||
{
|
||||
Boat = boat;
|
||||
Movable = false;
|
||||
Weight = 0;
|
||||
}
|
||||
|
||||
public override void OnDoubleClickDead(Mobile m)
|
||||
{
|
||||
OnDoubleClick(m);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Boat == null || from == null)
|
||||
return;
|
||||
|
||||
BaseBoat boat = BaseBoat.FindBoatAt(from, from.Map);
|
||||
|
||||
int range = boat != null && boat == Boat ? 3 : 8;
|
||||
bool canMove = false;
|
||||
|
||||
if (!Boat.IsRowBoat)
|
||||
Boat.Refresh(from);
|
||||
|
||||
if (!from.InRange(Location, range))
|
||||
from.SendLocalizedMessage(500295); //You are too far away to do that.
|
||||
else if (!from.InLOS(Location))
|
||||
from.SendLocalizedMessage(500950); //You cannot see that.
|
||||
else if (Boat.IsMoving || Boat.IsTurning)
|
||||
from.SendLocalizedMessage(1116611); //You can't use that while the ship is moving!
|
||||
else if (BaseBoat.IsDriving(from))
|
||||
from.SendLocalizedMessage(1116610); //You can't do that while piloting a ship!
|
||||
else if (BaseHouse.FindHouseAt(from) != null)
|
||||
from.SendLocalizedMessage(1149795); //You may not dock a ship while on another ship or inside a house.
|
||||
else if (Boat == boat && !MoveToNearestDockOrLand(from))
|
||||
from.SendLocalizedMessage(1149796); //You can not dock a ship this far out to sea. You must be near land or shallow water.
|
||||
else if (boat == null || boat != null && Boat != boat)
|
||||
{
|
||||
if (Boat.HasAccess(from))
|
||||
canMove = true;
|
||||
else
|
||||
from.SendLocalizedMessage(1116617); //You do not have permission to board this ship.
|
||||
}
|
||||
|
||||
if (canMove)
|
||||
{
|
||||
BaseCreature.TeleportPets(from, Location, Map);
|
||||
from.MoveToWorld(Location, Map);
|
||||
|
||||
Boat.SendContainerPacket();
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (Boat != null && Boat.IsRowBoat && from.Alive && !Boat.Contains(from))
|
||||
{
|
||||
list.Add(new DryDockEntry(Boat, from));
|
||||
}
|
||||
}
|
||||
|
||||
public bool MoveToNearestDockOrLand(Mobile from)
|
||||
{
|
||||
if ((Boat != null && !Boat.Contains(from)) || !ValidateDockOrLand())
|
||||
return false;
|
||||
|
||||
Map map = Map;
|
||||
|
||||
if (map == null)
|
||||
return false;
|
||||
|
||||
Rectangle2D rec;
|
||||
Point3D nearest = Point3D.Zero;
|
||||
Point3D p = Point3D.Zero;
|
||||
|
||||
if (Boat.IsRowBoat)
|
||||
rec = new Rectangle2D(Boat.X - 8, Boat.Y - 8, 16, 16);
|
||||
else
|
||||
{
|
||||
switch (Boat.Facing)
|
||||
{
|
||||
default:
|
||||
case Direction.North:
|
||||
case Direction.South:
|
||||
if (X < Boat.X)
|
||||
{
|
||||
rec = new Rectangle2D(X - 8, Y - 8, 8, 16);
|
||||
}
|
||||
else
|
||||
{
|
||||
rec = new Rectangle2D(X, Y - 8, 8, 16);
|
||||
}
|
||||
break;
|
||||
case Direction.West:
|
||||
case Direction.East:
|
||||
if (Y < Boat.Y)
|
||||
{
|
||||
rec = new Rectangle2D(X - 8, Y - 8, 16, 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
rec = new Rectangle2D(X - 8, Y, 16, 8);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (int x = rec.X; x <= rec.X + rec.Width; x++)
|
||||
{
|
||||
for (int y = rec.Y; y <= rec.Y + rec.Height; y++)
|
||||
{
|
||||
p = new Point3D(x, y, map.GetAverageZ(x, y));
|
||||
|
||||
if (ValidateTile(from, ref p))
|
||||
{
|
||||
if (nearest == Point3D.Zero || from.GetDistanceToSqrt(p) < from.GetDistanceToSqrt(nearest))
|
||||
nearest = p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nearest != Point3D.Zero)
|
||||
{
|
||||
BaseCreature.TeleportPets(from, nearest, Map);
|
||||
from.MoveToWorld(nearest, Map);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool ValidateTile(Mobile from, ref Point3D p)
|
||||
{
|
||||
int x = p.X;
|
||||
int y = p.Y;
|
||||
int z = p.Z;
|
||||
|
||||
Map map = from.Map;
|
||||
|
||||
if (Spells.SpellHelper.CheckMulti(p, map) || Region.Find(p, map).IsPartOf<Factions.StrongholdRegion>())
|
||||
return false;
|
||||
|
||||
StaticTile[] staticTiles = map.Tiles.GetStaticTiles(x, y, true);
|
||||
object highest = null;
|
||||
|
||||
//Gets highest tile, which will be used to determine if we can walk on it.
|
||||
foreach (StaticTile tile in staticTiles)
|
||||
{
|
||||
if (highest == null || (highest is StaticTile && tile.Z + tile.Height > ((StaticTile)highest).Z + ((StaticTile)highest).Height))
|
||||
highest = tile;
|
||||
}
|
||||
|
||||
if (highest != null && highest is StaticTile)
|
||||
{
|
||||
StaticTile st = (StaticTile)highest;
|
||||
|
||||
ItemData id = TileData.ItemTable[st.ID & TileData.MaxItemValue];
|
||||
|
||||
if (id.Surface && !id.Impassable)
|
||||
{
|
||||
p.Z = st.Z + st.Height;
|
||||
return from.InLOS(p);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return map.CanFit(x, y, z, 16, false, false);
|
||||
}
|
||||
|
||||
public bool ValidateDockOrLand()
|
||||
{
|
||||
return BaseGalleon.IsNearLandOrDocks(Boat);
|
||||
}
|
||||
|
||||
public MooringLine(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write(Boat);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Boat = reader.ReadItem() as BaseBoat;
|
||||
}
|
||||
}
|
||||
}
|
||||
347
Scripts/Services/Expansions/High Seas/Multis/OrcishGalleon.cs
Normal file
347
Scripts/Services/Expansions/High Seas/Multis/OrcishGalleon.cs
Normal file
@@ -0,0 +1,347 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class OrcishGalleon : BaseGalleon
|
||||
{
|
||||
public override int NorthID { get { return 0x18 + (DamageValue * 4); } }
|
||||
public override int EastID { get { return 0x19 + (DamageValue * 4); } }
|
||||
public override int SouthID { get { return 0x1A + (DamageValue * 4); } }
|
||||
public override int WestID { get { return 0x1B + (DamageValue * 4); } }
|
||||
|
||||
public override int HoldDistance { get { return 9; } }
|
||||
public override int TillerManDistance { get { return 6; } }
|
||||
public override int RuneOffset { get { return -3; } }
|
||||
|
||||
public override int WheelDistance { get { return 7; } }
|
||||
public override int CaptiveOffset { get { return 4; } }
|
||||
public override int MaxCannons { get { return 7; } }
|
||||
public override double CannonDamageMod { get { return 1.3; } }
|
||||
|
||||
public override double TurnDelay { get { return 2; } }
|
||||
public override int MaxHits { get { return 100000; } }
|
||||
|
||||
public override int ZSurface { get { return 14; } }
|
||||
|
||||
public override BaseDockedBoat DockedBoat { get { return new DockedOrcishGalleon(this); } }
|
||||
|
||||
[Constructable]
|
||||
public OrcishGalleon() : this(Direction.North) { }
|
||||
|
||||
[Constructable]
|
||||
public OrcishGalleon(Direction facing) : base(facing)
|
||||
{
|
||||
}
|
||||
|
||||
public override int[][] CannonTileIDs { get { return m_CannonTileIDs; } }
|
||||
private int[][] m_CannonTileIDs = new int[][]
|
||||
{
|
||||
|
||||
new int[] { 30012, 30037, 30041, 30065, 30069, 30093, 30097 }, //SOUTH
|
||||
new int[] { 30512, 30537, 30541, 30565, 30569, 30593, 30597 }, //WEST
|
||||
new int[] { 31012, 31037, 31041, 31065, 31069, 31093, 31097 }, //NORTH
|
||||
new int[] { 31512, 31537, 31541, 31565, 31569, 31593, 31597 }, //EAST
|
||||
|
||||
new int[] { 31712, 31737, 31741, 31765, 31769, 31793, 31797 }, //SOUTH D1
|
||||
new int[] { 31913, 31938, 31942, 31966, 31970, 31994, 31998 }, //WEST D1
|
||||
new int[] { 32112, 32137, 32141, 32165, 32169, 32193, 32197 }, //NORTH D1
|
||||
new int[] { 32312, 32337, 32341, 32365, 32369, 32393, 32397 }, //EAST D1
|
||||
|
||||
new int[] { 32512, 32537, 32541, 32565, 32569, 32593, 32597 }, //NORTH D2
|
||||
new int[] { 32712, 32737, 32741, 32765, 32769, 32793, 32797 }, //WEST D2
|
||||
new int[] { 32912, 32937, 32941, 32965, 32969, 32993, 32997 }, //NORTH D2
|
||||
new int[] { 33112, 33137, 33141, 33165, 33169, 33193, 33197 }, //NORTH D2
|
||||
};
|
||||
|
||||
public override int[][] FillerIDs { get { return m_FillerIDs; } }
|
||||
private int[][] m_FillerIDs = new int[][]
|
||||
{
|
||||
new int[] { 30030, 30034, 30048, 30044, 30090, 30086 }, //SOUTH
|
||||
new int[] { 30530, 30534, 30548, 30544, 30590, 30586 }, //WEST
|
||||
new int[] { 31030, 31034, 31048, 31044, 31090, 31086 }, //NORTH
|
||||
new int[] { 31530, 31534, 31548, 31544, 31590, 31586 }, //EAST
|
||||
|
||||
new int[] { 31730, 31734, 31748, 31744, 31790, 31786 }, //SOUTH D1
|
||||
new int[] { 31931, 31935, 31949, 31945, 31991, 31987 }, //WEST D1
|
||||
new int[] { 32130, 32134, 32148, 32144, 32190, 32186 }, //NORTH D1
|
||||
new int[] { 32330, 32334, 32348, 32344, 32390, 32386 }, //EAST D1
|
||||
|
||||
new int[] { 32530, 32534, 32548, 32544, 32590, 32586 }, //SOUTH D2
|
||||
new int[] { 32730, 32734, 32748, 32744, 32790, 32786 }, //WEST D2
|
||||
new int[] { 32930, 32934, 32948, 32944, 32990, 32986 }, //NORTH D2
|
||||
new int[] { 33130, 33134, 33148, 33144, 33190, 33186 }, //EAST D2
|
||||
};
|
||||
|
||||
public override int[][] HoldIDs { get { return m_HoldIDs; } }
|
||||
private int[][] m_HoldIDs = new int[][]
|
||||
{
|
||||
new int[] { 30127, 30124, 30122, 30115, 30120 }, //SOUTH
|
||||
new int[] { 30627, 30624, 30622, 30615, 30620 }, //WEST
|
||||
new int[] { 31127, 31124, 31122, 31115, 31120 }, //NORTH
|
||||
new int[] { 31627, 31624, 31622, 31615, 31620 }, //EAST
|
||||
|
||||
new int[] { 31827, 31824, 31822, 31815, 31820 }, //SOUTH D1
|
||||
new int[] { 32028, 32025, 32023, 32016, 32021 }, //WEST D1
|
||||
new int[] { 32227, 32224, 32222, 32215, 32220 }, //NORTH D1
|
||||
new int[] { 32427, 32424, 32422, 32415, 32420 }, //EAST D1
|
||||
|
||||
new int[] { 32627, 32624, 32622, 32615, 32620 }, //SOUTH D2
|
||||
new int[] { 32827, 32824, 32822, 32815, 32820 }, //WEST D2
|
||||
new int[] { 33027, 33024, 33022, 33015, 33020 }, //NORTH D2
|
||||
new int[] { 33227, 33224, 33222, 33215, 33220 }, //EAST D1
|
||||
};
|
||||
|
||||
public override int[][] HoldItemIDs { get { return m_HoldItemIDs; } }
|
||||
private int[][] m_HoldItemIDs = new int[][]
|
||||
{
|
||||
new int[] { 30117 },
|
||||
new int[] { 30617 },
|
||||
new int[] { 31117 },
|
||||
new int[] { 31617 },
|
||||
|
||||
new int[] { 31817 },
|
||||
new int[] { 32018 },
|
||||
new int[] { 32217 },
|
||||
new int[] { 32417 },
|
||||
|
||||
new int[] { 32617 },
|
||||
new int[] { 32817 },
|
||||
new int[] { 33017 },
|
||||
new int[] { 33217 },
|
||||
};
|
||||
|
||||
public override int[][] WheelItemIDs { get { return m_WheelItemIDs; } }
|
||||
private int[][] m_WheelItemIDs = new int[][]
|
||||
{
|
||||
new int[] { 30141 },
|
||||
new int[] { 30641 },
|
||||
new int[] { 31141 },
|
||||
new int[] { 31642 },
|
||||
};
|
||||
|
||||
public override ShipPosition GetCannonPosition(Point3D pnt)
|
||||
{
|
||||
int x = pnt.X; int y = pnt.Y;
|
||||
|
||||
switch (Facing)
|
||||
{
|
||||
default:
|
||||
case Direction.North:
|
||||
if (x == this.X && y < this.Y)
|
||||
return ShipPosition.Bow;
|
||||
if (x > this.X && y < this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
if (x < this.X && y < this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
if (x > this.X && y + 2 == this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if(x < this.X && y + 2 == this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x > this.X && y > this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.West:
|
||||
if (x < this.X && y == this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x < this.X && y < this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x < this.X && y > this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if(x + 2 == this.X && y < this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x + 2 == this.X && y > this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x > this.X && y < this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.South:
|
||||
if (x == this.X && y > this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x < this.X && y > this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x > this.X && y > this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if (x < this.X && y - 2 == this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x > this.X && y - 2 == this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x < this.X && y < this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
case Direction.East:
|
||||
if (x > this.X && y == this.Y)
|
||||
return ShipPosition.Bow;
|
||||
else if (x > this.X && y > this.Y)
|
||||
return ShipPosition.BowStarboard;
|
||||
else if (x > this.X && y < this.Y)
|
||||
return ShipPosition.BowPort;
|
||||
else if(x - 2 == this.X && y > this.Y)
|
||||
return ShipPosition.AmidShipStarboard;
|
||||
else if (x - 2 == this.X && y < this.Y)
|
||||
return ShipPosition.AmidShipPort;
|
||||
else if (x < this.X && y > this.Y)
|
||||
return ShipPosition.AftStarboard;
|
||||
else
|
||||
return ShipPosition.AftPort;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly int PortAndStarboardOffset = 3;
|
||||
private readonly int AftOffset = 12; //TODO: Get this
|
||||
private readonly int BowOffset = 9;
|
||||
|
||||
public override bool Contains(int x, int y)
|
||||
{
|
||||
bool contains = base.Contains(x, y);
|
||||
|
||||
if (contains)
|
||||
{
|
||||
int boatX = this.X;
|
||||
int boatY = this.Y;
|
||||
|
||||
switch (Facing)
|
||||
{
|
||||
case Direction.North:
|
||||
if (x > boatX + PortAndStarboardOffset || x < boatX - PortAndStarboardOffset)
|
||||
return false;
|
||||
if (y > boatY + AftOffset || y < boatY - BowOffset)
|
||||
return false;
|
||||
return true;
|
||||
case Direction.South:
|
||||
if (x > boatX + PortAndStarboardOffset || x < boatX - PortAndStarboardOffset)
|
||||
return false;
|
||||
if (y > boatY + BowOffset || y < boatY - AftOffset)
|
||||
return false;
|
||||
return true;
|
||||
case Direction.East:
|
||||
if (x > boatX + BowOffset || x < boatX - AftOffset)
|
||||
return false;
|
||||
if (y > boatY + PortAndStarboardOffset || y < boatY - PortAndStarboardOffset)
|
||||
return false;
|
||||
return true;
|
||||
case Direction.West:
|
||||
if (x > boatX + AftOffset || x < boatX - BowOffset)
|
||||
return false;
|
||||
if (y > boatY + PortAndStarboardOffset || y < boatY - PortAndStarboardOffset)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return contains;
|
||||
}
|
||||
|
||||
public override bool ExemptOverheadComponent(Point3D newPnt, int itemID, int x , int y, int height)
|
||||
{
|
||||
//if(height > this.Z + 16) //TODO: Get height of mast
|
||||
// return false;
|
||||
|
||||
switch(itemID)
|
||||
{
|
||||
case 0x18: //North/South ID's
|
||||
case 0x1A:
|
||||
case 0x1C:
|
||||
case 0x1E:
|
||||
case 0x20:
|
||||
case 0x22:
|
||||
if(x > newPnt.X + PortAndStarboardOffset || x < newPnt.X - PortAndStarboardOffset)
|
||||
return true;
|
||||
break;
|
||||
case 0x19: //East/West ID's
|
||||
case 0x1B:
|
||||
case 0x1D:
|
||||
case 0x1F:
|
||||
case 0x21:
|
||||
case 0x23:
|
||||
if(y > newPnt.Y + PortAndStarboardOffset || y < newPnt.Y - PortAndStarboardOffset)
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
||||
return base.ExemptOverheadComponent(newPnt, itemID, x, y, height);
|
||||
}
|
||||
|
||||
public OrcishGalleon(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class OrcishGalleonDeed : BaseBoatDeed
|
||||
{
|
||||
public override int LabelNumber { get { return 1116738; } } // small dragon ship deed
|
||||
public override BaseBoat Boat { get { return new OrcishGalleon(this.BoatDirection); } }
|
||||
|
||||
[Constructable]
|
||||
public OrcishGalleonDeed()
|
||||
: base(0x18, Point3D.Zero)
|
||||
{
|
||||
}
|
||||
|
||||
public OrcishGalleonDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
}
|
||||
|
||||
public class DockedOrcishGalleon : BaseDockedBoat
|
||||
{
|
||||
public override int LabelNumber { get { return 1116747; } } //Orc Ship
|
||||
public override BaseBoat Boat { get { return new OrcishGalleon(this.BoatDirection); } }
|
||||
|
||||
public DockedOrcishGalleon(BaseBoat boat)
|
||||
: base(0x18, Point3D.Zero, boat)
|
||||
{
|
||||
}
|
||||
|
||||
public DockedOrcishGalleon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
}
|
||||
}
|
||||
404
Scripts/Services/Expansions/High Seas/Multis/Rowboat.cs
Normal file
404
Scripts/Services/Expansions/High Seas/Multis/Rowboat.cs
Normal file
@@ -0,0 +1,404 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Engines.PartySystem;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class RowBoat : BaseBoat
|
||||
{
|
||||
public override int NorthID { get { return 0x3C; } }
|
||||
public override int EastID { get { return 0x3D; } }
|
||||
public override int SouthID { get { return 0x3E; } }
|
||||
public override int WestID { get { return 0x3F; } }
|
||||
|
||||
public override int HoldDistance { get { return -1; } }
|
||||
public override int TillerManDistance { get { return -4; } }
|
||||
|
||||
public override Point3D MarkOffset { get { return new Point3D(0, 1, 3); } }
|
||||
|
||||
public override BaseDockedBoat DockedBoat { get { return new DockedRowBoat(this); } }
|
||||
|
||||
public override bool IsClassicBoat { get { return false; } }
|
||||
public override bool IsRowBoat { get { return true; } }
|
||||
public override bool CanLinkToLighthouse { get { return false; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public MooringLine Line { get; private set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Rudder Rudder { get; private set; }
|
||||
|
||||
[Constructable]
|
||||
public RowBoat(Direction d)
|
||||
: base(d, false)
|
||||
{
|
||||
Rudder = new Rudder(this, d);
|
||||
TillerMan = Rudder;
|
||||
Line = new MooringLine(this);
|
||||
|
||||
switch (d)
|
||||
{
|
||||
default:
|
||||
case Direction.North:
|
||||
Rudder.Location = new Point3D(X, Y - TillerManDistance, Z);
|
||||
Line.Location = new Point3D(X, Y - 2, Z + 5);
|
||||
break;
|
||||
case Direction.South:
|
||||
Rudder.Location = new Point3D(X, Y + TillerManDistance, Z);
|
||||
Line.Location = new Point3D(X, Y + 2, Z + 5);
|
||||
break;
|
||||
case Direction.East:
|
||||
Rudder.Location = new Point3D(X + TillerManDistance, Y, Z);
|
||||
Line.Location = new Point3D(X + 2, Y, Z + 5);
|
||||
break;
|
||||
case Direction.West:
|
||||
Rudder.Location = new Point3D(X - TillerManDistance, Y, Z);
|
||||
Line.Location = new Point3D(X - 2, Y, Z + 5);
|
||||
break;
|
||||
}
|
||||
|
||||
Rudder.Handle = new RudderHandle(Rudder, d);
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
if (Line != null)
|
||||
Line.Delete();
|
||||
|
||||
if (Rudder != null && Rudder.Handle != null)
|
||||
Rudder.Handle.Delete();
|
||||
|
||||
base.Delete();
|
||||
}
|
||||
|
||||
public override void SetFacingComponents(Direction facing, Direction old, bool ignore)
|
||||
{
|
||||
if (Rudder == null || Rudder.Handle == null)
|
||||
return;
|
||||
|
||||
if (Rudder != null && facing == Direction.North)
|
||||
Rudder.X--;
|
||||
|
||||
Rudder.Handle.SetFacing(facing);
|
||||
}
|
||||
|
||||
public override void OnLocationChange(Point3D old)
|
||||
{
|
||||
base.OnLocationChange(old);
|
||||
|
||||
if (Line != null)
|
||||
Line.Location = new Point3D(X + (Line.X - old.X), Y + (Line.Y - old.Y), Z + (Line.Z - old.Z));
|
||||
|
||||
if(Rudder != null && Rudder.Handle != null)
|
||||
Rudder.Handle.Location = new Point3D(X + (Rudder.Handle.X - old.X), Y + (Rudder.Handle.Y - old.Y), Z + (Rudder.Handle.Z - old.Z));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This must be overriden due to the tillerman not being in the MCL bounds
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override IEnumerable<IEntity> GetEntitiesOnBoard()
|
||||
{
|
||||
Map map = Map;
|
||||
|
||||
if (map == null || map == Map.Internal)
|
||||
yield break;
|
||||
|
||||
MultiComponentList mcl = Components;
|
||||
IPooledEnumerable eable = map.GetObjectsInBounds(new Rectangle2D(X + mcl.Min.X, Y + mcl.Min.Y, mcl.Width, mcl.Height));
|
||||
|
||||
foreach (IEntity ent in eable)
|
||||
{
|
||||
if (Contains(ent) && CheckOnBoard(ent))
|
||||
{
|
||||
yield return ent;
|
||||
}
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
yield return Rudder;
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
base.OnMapChange();
|
||||
|
||||
if (Line != null)
|
||||
Line.Map = Map;
|
||||
}
|
||||
|
||||
public override void OnPlacement(Mobile from)
|
||||
{
|
||||
base.OnPlacement(from);
|
||||
|
||||
if (Line == null)
|
||||
return;
|
||||
|
||||
switch (Facing)
|
||||
{
|
||||
default:
|
||||
case Direction.North:
|
||||
Line.Location = new Point3D(X, Y - 2, Z + 5);
|
||||
break;
|
||||
case Direction.South:
|
||||
Line.Location = new Point3D(X, Y + 2, Z + 5);
|
||||
break;
|
||||
case Direction.East:
|
||||
Line.Location = new Point3D(X + 2, Y, Z + 5);
|
||||
break;
|
||||
case Direction.West:
|
||||
Line.Location = new Point3D(X - 2, Y, Z + 5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsComponentItem(IEntity item)
|
||||
{
|
||||
return item == this || item == Line || item == Rudder || (Rudder != null && item == Rudder.Handle);
|
||||
}
|
||||
|
||||
public override bool HasAccess(Mobile from)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public RowBoat(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write(Rudder);
|
||||
writer.Write(Line);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Rudder = reader.ReadItem() as Rudder;
|
||||
Line = reader.ReadItem() as MooringLine;
|
||||
|
||||
TillerMan = Rudder;
|
||||
}
|
||||
}
|
||||
|
||||
public class Rudder : TillerMan
|
||||
{
|
||||
public override int LabelNumber { get { return 1149698; } } // wheel
|
||||
|
||||
public override bool ForceShowProperties { get { return true; } }
|
||||
|
||||
public override bool Babbles { get { return false; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public RudderHandle Handle { get; set; }
|
||||
|
||||
public Rudder(BaseBoat boat, Direction d)
|
||||
: base(boat)
|
||||
{
|
||||
SetFacing(d);
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
base.OnMapChange();
|
||||
|
||||
if (Handle != null)
|
||||
Handle.Map = Map;
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
if (Handle != null)
|
||||
Handle.Delete();
|
||||
|
||||
base.Delete();
|
||||
}
|
||||
|
||||
public override void SetFacing(Direction dir)
|
||||
{
|
||||
switch (dir)
|
||||
{
|
||||
case Direction.South:
|
||||
ItemID = 16068;
|
||||
break;
|
||||
case Direction.North:
|
||||
ItemID = 16062;
|
||||
X--;
|
||||
break;
|
||||
case Direction.West:
|
||||
ItemID = 15990;
|
||||
break;
|
||||
case Direction.East:
|
||||
ItemID = 15971;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Say(int number)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Say(int number, string args)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public Rudder(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write(Handle);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Handle = reader.ReadItem() as RudderHandle;
|
||||
|
||||
if (ItemID == 16062)
|
||||
X--;
|
||||
}
|
||||
}
|
||||
|
||||
public class RudderHandle : Static
|
||||
{
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Rudder Rudder { get; set; }
|
||||
|
||||
public RudderHandle(Rudder rudder, Direction d)
|
||||
{
|
||||
Rudder = rudder;
|
||||
SetFacing(d);
|
||||
}
|
||||
|
||||
public virtual void SetFacing(Direction dir)
|
||||
{
|
||||
if (Rudder == null)
|
||||
Delete();
|
||||
else
|
||||
{
|
||||
switch (dir)
|
||||
{
|
||||
default:
|
||||
case Direction.South:
|
||||
ItemID = 16067;
|
||||
MoveToWorld(new Point3D(Rudder.X, Rudder.Y + 1, Rudder.Z), Map);
|
||||
break;
|
||||
case Direction.North:
|
||||
ItemID = 16063;
|
||||
MoveToWorld(new Point3D(Rudder.X + 1, Rudder.Y - 1, Rudder.Z), Map);
|
||||
break;
|
||||
case Direction.West:
|
||||
ItemID = 15991;
|
||||
MoveToWorld(new Point3D(Rudder.X -1, Rudder.Y + 1, Rudder.Z), Map);
|
||||
break;
|
||||
case Direction.East:
|
||||
ItemID = 15970;
|
||||
MoveToWorld(new Point3D(Rudder.X + 1, Rudder.Y, Rudder.Z), Map);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Rudder != null)
|
||||
Rudder.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public RudderHandle(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
writer.Write(Rudder);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
Rudder = reader.ReadItem() as Rudder;
|
||||
}
|
||||
}
|
||||
|
||||
public class RowBoatDeed : BaseBoatDeed
|
||||
{
|
||||
public override int LabelNumber { get { return 1116491; } }
|
||||
public override BaseBoat Boat { get { return new RowBoat(BoatDirection); } }
|
||||
|
||||
[Constructable]
|
||||
public RowBoatDeed()
|
||||
: base(0x3C, Point3D.Zero)
|
||||
{
|
||||
}
|
||||
|
||||
public RowBoatDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
}
|
||||
|
||||
public class DockedRowBoat : BaseDockedBoat
|
||||
{
|
||||
public override BaseBoat Boat { get { return new RowBoat(BoatDirection); } }
|
||||
|
||||
public DockedRowBoat(BaseBoat boat)
|
||||
: base(0x3C, Point3D.Zero, boat)
|
||||
{
|
||||
}
|
||||
|
||||
public DockedRowBoat(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
}
|
||||
}
|
||||
101
Scripts/Services/Expansions/High Seas/Multis/ShipRune.cs
Normal file
101
Scripts/Services/Expansions/High Seas/Multis/ShipRune.cs
Normal file
@@ -0,0 +1,101 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Multis;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
// This item is no longer used.
|
||||
[FlipableAttribute(0x1f14, 0x1f15, 0x1f16, 0x1f17)]
|
||||
public class ShipRune : Item
|
||||
{
|
||||
private BaseGalleon m_Galleon;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseGalleon Galleon { get { return m_Galleon; } set { m_Galleon = value; } }
|
||||
|
||||
public BaseDockedBoat DockedBoat
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_Galleon != null)
|
||||
return m_Galleon.BoatItem;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public override int LabelNumber { get { return 1149570; } } //A Ship Rune
|
||||
|
||||
[Constructable]
|
||||
public ShipRune() : this(null)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ShipRune(BaseGalleon galleon) : base(0x1F14)
|
||||
{
|
||||
m_Galleon = galleon;
|
||||
Hue = 0x47F;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Galleon != null)
|
||||
{
|
||||
RecallRune rune = new RecallRune();
|
||||
rune.SetGalleon(Galleon);
|
||||
from.AddToBackpack(rune);
|
||||
}
|
||||
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (m_Galleon != null)
|
||||
{
|
||||
list.Add(1149571, m_Galleon.Owner != null ? m_Galleon.Owner.Name : "Nobody"); //Owner: ~1_NAME~
|
||||
|
||||
if (m_Galleon.ShipName != null)
|
||||
list.Add(1149572, m_Galleon.ShipName); //Name: the ~1_NAME~
|
||||
else list.Add(1149573); //Name: the Unnamed Ship
|
||||
|
||||
if (m_Galleon.Map != Map.Internal)
|
||||
list.Add(1149574, m_Galleon.Map != null ? m_Galleon.Map.ToString() : "Unknown"); //Location: ~1_FACET~
|
||||
else
|
||||
{
|
||||
string name = m_Galleon.ShipName != null && m_Galleon.ShipName != "" ? m_Galleon.ShipName : "Unnamed Ship";
|
||||
list.Add(1041644, name); //The ~1_VAL~ (Dry Docked)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public ShipRune(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
writer.Write(m_Galleon);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
m_Galleon = reader.ReadItem() as BaseGalleon;
|
||||
if (version == 0)
|
||||
reader.ReadItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
249
Scripts/Services/Expansions/High Seas/Multis/ShipTracking.cs
Normal file
249
Scripts/Services/Expansions/High Seas/Multis/ShipTracking.cs
Normal file
@@ -0,0 +1,249 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class ShipTrackingContext
|
||||
{
|
||||
private static Dictionary<Mobile, ShipTrackingContext> m_Table = new Dictionary<Mobile, ShipTrackingContext>();
|
||||
|
||||
private Mobile m_Mobile;
|
||||
|
||||
public List<BoatTrackingArrow> Arrows { get { return m_Arrows; } }
|
||||
private List<BoatTrackingArrow> m_Arrows = new List<BoatTrackingArrow>();
|
||||
|
||||
public ShipTrackingContext(Mobile mobile, List<BoatTrackingArrow> arrows)
|
||||
{
|
||||
m_Mobile = mobile;
|
||||
m_Arrows = arrows;
|
||||
|
||||
m_Table.Add(mobile, this);
|
||||
}
|
||||
|
||||
public static bool RemoveContext(Mobile from)
|
||||
{
|
||||
if(!m_Table.ContainsKey(from))
|
||||
return false;
|
||||
|
||||
m_Table.Remove(from);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool CanAddContext(Mobile from)
|
||||
{
|
||||
if(!m_Table.ContainsKey(from))
|
||||
return true;
|
||||
|
||||
if(m_Table[from] != null && m_Table[from].Arrows.Count > 5)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public static ShipTrackingContext GetContext(Mobile from)
|
||||
{
|
||||
if(!m_Table.ContainsKey(from))
|
||||
return null;
|
||||
|
||||
return m_Table[from];
|
||||
}
|
||||
|
||||
public bool IsTrackingBoat(Item item)
|
||||
{
|
||||
if (item is BaseBoat || item is PlunderBeaconAddon)
|
||||
{
|
||||
foreach (BoatTrackingArrow arrow in m_Arrows)
|
||||
{
|
||||
if (arrow.Boat == item)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void AddArrow(BoatTrackingArrow arrow)
|
||||
{
|
||||
m_Arrows.Add(arrow);
|
||||
}
|
||||
|
||||
public void RemoveArrow(BoatTrackingArrow arrow)
|
||||
{
|
||||
if (m_Arrows.Contains(arrow))
|
||||
m_Arrows.Remove(arrow);
|
||||
|
||||
if(m_Mobile == null)
|
||||
return;
|
||||
|
||||
if (m_Arrows.Count == 0)
|
||||
{
|
||||
m_Mobile.QuestArrow = null;
|
||||
RemoveContext(m_Mobile);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_Mobile.QuestArrow == arrow)
|
||||
m_Mobile.QuestArrow = null;
|
||||
|
||||
if (m_Arrows.Count > 0)
|
||||
m_Mobile.QuestArrow = m_Arrows[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BoatTrackingArrow : QuestArrow
|
||||
{
|
||||
public static readonly int MaxRange = 200;
|
||||
public static readonly int MaxBoats = 5;
|
||||
|
||||
private Mobile m_From;
|
||||
private Timer m_Timer;
|
||||
private Item m_Boat;
|
||||
|
||||
public Mobile From { get { return m_From; } }
|
||||
public Timer Timer { get { return m_Timer; } }
|
||||
public Item Boat { get { return m_Boat; } }
|
||||
|
||||
public BoatTrackingArrow(Mobile from, Item boat, int range) : base(from, boat)
|
||||
{
|
||||
m_Boat = boat;
|
||||
m_From = from;
|
||||
m_Timer = new BoatTrackingTimer(from, boat, range, this);
|
||||
m_Timer.Start();
|
||||
}
|
||||
|
||||
public override void OnClick(bool rightClick)
|
||||
{
|
||||
if (rightClick && m_From != null)
|
||||
{
|
||||
ShipTrackingContext st = ShipTrackingContext.GetContext(m_From);
|
||||
|
||||
if (st != null)
|
||||
st.RemoveArrow(this);
|
||||
|
||||
m_From = null;
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnStop()
|
||||
{
|
||||
if(m_Timer != null)
|
||||
m_Timer.Stop();
|
||||
|
||||
if(m_From != null)
|
||||
m_From.SendLocalizedMessage(503177); // You have lost your quarry.
|
||||
}
|
||||
|
||||
public static void StopTracking(Mobile from)
|
||||
{
|
||||
ShipTrackingContext st = ShipTrackingContext.GetContext(from);
|
||||
|
||||
if (st != null)
|
||||
{
|
||||
for (int i = 0; i < st.Arrows.Count; i++)
|
||||
st.Arrows[i].Stop();
|
||||
|
||||
ShipTrackingContext.RemoveContext(from);
|
||||
}
|
||||
|
||||
from.QuestArrow = null;
|
||||
}
|
||||
|
||||
public static void StartTracking(Mobile from)
|
||||
{
|
||||
if(!ShipTrackingContext.CanAddContext(from))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var targets = new List<Item>();
|
||||
Map map = from.Map;
|
||||
|
||||
if(map == null || map == Map.Internal)
|
||||
return;
|
||||
|
||||
BaseBoat fromBoat = BaseBoat.FindBoatAt(from, map);
|
||||
ShipTrackingContext context = ShipTrackingContext.GetContext(from);
|
||||
|
||||
if(fromBoat == null)
|
||||
{
|
||||
from.SendMessage("You must be on your boat to use this command.");
|
||||
}
|
||||
|
||||
IPooledEnumerable eable = map.GetItemsInRange(from.Location, MaxRange);
|
||||
|
||||
foreach(Item item in eable)
|
||||
{
|
||||
if(context != null && context.IsTrackingBoat(item))
|
||||
continue;
|
||||
if(!targets.Contains(item) && ((item is BaseBoat && (BaseBoat)item != fromBoat) || item is PlunderBeaconAddon))
|
||||
targets.Add(item);
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
|
||||
List<BoatTrackingArrow> arrows = new List<BoatTrackingArrow>();
|
||||
|
||||
for(int i = 0; i < targets.Count; i++)
|
||||
{
|
||||
if(i >= MaxBoats)
|
||||
break;
|
||||
|
||||
BoatTrackingArrow arrow = new BoatTrackingArrow(from, targets[i], MaxRange);
|
||||
|
||||
if(context == null)
|
||||
arrows.Add(arrow);
|
||||
else
|
||||
context.AddArrow(arrow);
|
||||
}
|
||||
|
||||
if (from.QuestArrow == null && arrows.Count > 0)
|
||||
from.QuestArrow = arrows[0];
|
||||
|
||||
if(context == null)
|
||||
new ShipTrackingContext(from, arrows);
|
||||
}
|
||||
}
|
||||
|
||||
public class BoatTrackingTimer : Timer
|
||||
{
|
||||
private Mobile m_From;
|
||||
private Item m_Target;
|
||||
private int m_Range;
|
||||
private int m_LastX, m_LastY;
|
||||
private QuestArrow m_Arrow;
|
||||
|
||||
public BoatTrackingTimer(Mobile from, Item target, int range, QuestArrow arrow) : base( TimeSpan.FromSeconds( 0.25 ), TimeSpan.FromSeconds( 2.5 ) )
|
||||
{
|
||||
m_From = from;
|
||||
m_Target = target;
|
||||
m_Range = range;
|
||||
m_Arrow = arrow;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if(!m_Arrow.Running)
|
||||
{
|
||||
this.Stop();
|
||||
return;
|
||||
}
|
||||
else if (m_From.NetState == null || m_From.Deleted || m_Target.Deleted || m_From.Map != m_Target.Map || !m_From.InRange(m_Target, m_Range))
|
||||
{
|
||||
m_Arrow.Stop();
|
||||
this.Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if(m_LastX != m_Target.X || m_LastY != m_Target.Y)
|
||||
{
|
||||
m_LastX = m_Target.X;
|
||||
m_LastY = m_Target.Y;
|
||||
|
||||
m_Arrow.Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
98
Scripts/Services/Expansions/High Seas/Multis/ShipWheel.cs
Normal file
98
Scripts/Services/Expansions/High Seas/Multis/ShipWheel.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Multis;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ShipWheel : Item, IGalleonFixture
|
||||
{
|
||||
public override int LabelNumber { get { return 1149698; } } // wheel
|
||||
|
||||
public BaseGalleon Galleon { get; set; }
|
||||
|
||||
public Mobile Pilot { get { return Galleon != null ? Galleon.Pilot : null; } }
|
||||
|
||||
public ShipWheel(BaseGalleon galleon, int id)
|
||||
: base(id)
|
||||
{
|
||||
Galleon = galleon;
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClickDead(Mobile m)
|
||||
{
|
||||
OnDoubleClick(m);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
from.RevealingAction();
|
||||
|
||||
BaseBoat boat = BaseBoat.FindBoatAt(from, from.Map);
|
||||
Item mount = from.FindItemOnLayer(Layer.Mount);
|
||||
|
||||
if (boat == null || Galleon == null || boat != Galleon)
|
||||
{
|
||||
from.SendLocalizedMessage(1116724); // You cannot pilot a ship unless you are aboard it!
|
||||
}
|
||||
else if (Galleon.GetSecurityLevel(from) < SecurityLevel.Crewman)
|
||||
{
|
||||
from.SendLocalizedMessage(1116726); // This is not your ship!
|
||||
}
|
||||
else if (Pilot != null && Pilot != from && (Galleon.GetSecurityLevel(from) < Galleon.GetSecurityLevel(Pilot) || Pilot == Galleon.Owner))
|
||||
{
|
||||
from.SendLocalizedMessage(502221); // Someone else is already using this item.
|
||||
}
|
||||
else if (from.Flying)
|
||||
{
|
||||
from.SendLocalizedMessage(1116615); // You cannot pilot a ship while flying!
|
||||
}
|
||||
else if (from.Mounted && !(mount is BoatMountItem))
|
||||
{
|
||||
from.SendLocalizedMessage(1010097); // You cannot use this while mounted or flying.
|
||||
}
|
||||
else if (Pilot == null && Galleon.Scuttled)
|
||||
{
|
||||
from.SendLocalizedMessage(1116725); // This ship is too damaged to sail!
|
||||
}
|
||||
else if (Pilot != null)
|
||||
{
|
||||
if (from != Pilot) // High authorized player takes control of the ship
|
||||
{
|
||||
boat.RemovePilot(from);
|
||||
boat.LockPilot(from);
|
||||
}
|
||||
else
|
||||
{
|
||||
boat.RemovePilot(from);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
boat.LockPilot(from);
|
||||
}
|
||||
}
|
||||
|
||||
public ShipWheel(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();
|
||||
|
||||
if (version == 0)
|
||||
{
|
||||
reader.ReadItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user