Inital Commit

This commit is contained in:
Ubuntu
2026-07-07 13:40:15 -04:00
parent 73701ff86e
commit b491e327dc
83 changed files with 8591 additions and 6895 deletions
+48
View File
@@ -0,0 +1,48 @@
using System;
using Server;
using Server.Items;
using Server.Engines.XmlSpawner2;
using Server.Custom;
namespace Server.Custom
{
public class DurabilityAttachment : XmlAttachment
{
public bool RepairLocked { get; set; }
public int PoFUses { get; set; }
public int MaxPoFUses { get; set; }
public DurabilityAttachment() : base()
{
}
public DurabilityAttachment(ASerial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
writer.Write(RepairLocked);
writer.Write(PoFUses);
writer.Write(MaxPoFUses);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
if (version >= 0)
{
RepairLocked = reader.ReadBool();
PoFUses = reader.ReadInt();
MaxPoFUses = reader.ReadInt();
}
}
}
}
+52
View File
@@ -0,0 +1,52 @@
using Server;
using Server.Items;
using Server.Engines.XmlSpawner2;
namespace Server.Custom
{
public static class DurabilityExtensions
{
private static DurabilityAttachment GetAttach(Item item)
{
var att = XmlAttach.FindAttachment(item, typeof(DurabilityAttachment)) as DurabilityAttachment;
if (att == null)
{
att = new DurabilityAttachment();
XmlAttach.AttachTo(item, att);
}
return att;
}
public static bool GetRepairLocked(this Item item)
{
return GetAttach(item).RepairLocked;
}
public static void SetRepairLocked(this Item item, bool value)
{
GetAttach(item).RepairLocked = value;
}
public static int GetPoFUses(this Item item)
{
return GetAttach(item).PoFUses;
}
public static void SetPoFUses(this Item item, int value)
{
GetAttach(item).PoFUses = value;
}
public static int GetMaxPoFUses(this Item item)
{
return GetAttach(item).MaxPoFUses;
}
public static void SetMaxPoFUses(this Item item, int value)
{
GetAttach(item).MaxPoFUses = value;
}
}
}
@@ -0,0 +1,88 @@
using System;
using Server.Items;
namespace Server.Items
{
public class ArmsofApathy2 : PlateArms
{
public override bool IsArtifact { get { return true; } }
[Constructable]
public ArmsofApathy2() : base()
{
Name = "Arms of Apathy";
LootType = LootType.Blessed;
Weight = 5.0;
this.SetHue = 1109;
this.Attributes.RegenHits = 1;
this.Attributes.AttackChance = 5;
this.SetAttributes.ReflectPhysical = 25;
this.SetAttributes.NightSight = 1;
this.SetSkillBonuses.SetValues(0, SkillName.Swords, 10);
this.SetSelfRepair = 3;
this.SetPhysicalBonus = 2;
this.SetFireBonus = 5;
this.SetColdBonus = 5;
this.SetPoisonBonus = 3;
this.SetEnergyBonus = 5;
}
public ArmsofApathy2( Serial serial ) : base( serial )
{
}
public override int BasePhysicalResistance
{
get
{
return 8;
}
}
public override int BaseFireResistance
{
get
{
return 5;
}
}
public override int BaseColdResistance
{
get
{
return 5;
}
}
public override int BasePoisonResistance
{
get
{
return 7;
}
}
public override int BaseEnergyResistance
{
get
{
return 5;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
@@ -0,0 +1,88 @@
using System;
namespace Server.Items
{
[FlipableAttribute(0x1450, 0x1455)]
public class GlovesofInjustice2 : PlateGloves
{
public override bool IsArtifact { get { return true; } }
[Constructable]
public GlovesofInjustice2()
: base()
{
this.Weight = 2.0;
this.Name = "Goves of Injustice";
LootType = LootType.Blessed;
this.SetHue = 1109;
this.Attributes.RegenHits = 1;
this.Attributes.AttackChance = 5;
this.SetAttributes.ReflectPhysical = 25;
this.SetAttributes.NightSight = 1;
this.SetSkillBonuses.SetValues(0, SkillName.Swords, 10);
this.SetSelfRepair = 3;
this.SetPhysicalBonus = 2;
this.SetFireBonus = 5;
this.SetColdBonus = 5;
this.SetPoisonBonus = 3;
this.SetEnergyBonus = 5;
}
public GlovesofInjustice2(Serial serial)
: base(serial)
{
}
public override int BasePhysicalResistance
{
get
{
return 8;
}
}
public override int BaseFireResistance
{
get
{
return 5;
}
}
public override int BaseColdResistance
{
get
{
return 5;
}
}
public override int BasePoisonResistance
{
get
{
return 7;
}
}
public override int BaseEnergyResistance
{
get
{
return 5;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
@@ -0,0 +1,86 @@
using System;
namespace Server.Items
{
public class HeartofObsidian2 : PlateChest
{
public override bool IsArtifact { get { return true; } }
[Constructable]
public HeartofObsidian2()
: base()
{
this.Name = "Heart of Obsidian";
LootType = LootType.Blessed;
this.SetHue = 1109;
this.Attributes.RegenHits = 1;
this.Attributes.AttackChance = 5;
this.SetAttributes.ReflectPhysical = 25;
this.SetAttributes.NightSight = 1;
this.SetSkillBonuses.SetValues(0, SkillName.Swords, 10);
this.SetSelfRepair = 3;
this.SetPhysicalBonus = 2;
this.SetFireBonus = 5;
this.SetColdBonus = 5;
this.SetPoisonBonus = 3;
this.SetEnergyBonus = 5;
}
public HeartofObsidian2(Serial serial)
: base(serial)
{
}
public override int BasePhysicalResistance
{
get
{
return 8;
}
}
public override int BaseFireResistance
{
get
{
return 5;
}
}
public override int BaseColdResistance
{
get
{
return 5;
}
}
public override int BasePoisonResistance
{
get
{
return 7;
}
}
public override int BaseEnergyResistance
{
get
{
return 5;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
@@ -0,0 +1,89 @@
using System;
namespace Server.Items
{
public class HelmofIgnorance2 : NorseHelm
{
public override bool IsArtifact { get { return true; } }
[Constructable]
public HelmofIgnorance2()
: base()
{
this.Name = "Helm of Ignorance";
LootType = LootType.Blessed;
this.SetHue = 1109;
this.Attributes.RegenHits = 1;
this.Attributes.AttackChance = 5;
this.SetAttributes.ReflectPhysical = 25;
this.SetAttributes.NightSight = 1;
this.SetSkillBonuses.SetValues(0, SkillName.Swords, 10);
this.SetSelfRepair = 3;
this.SetPhysicalBonus = 2;
this.SetFireBonus = 5;
this.SetColdBonus = 5;
this.SetPoisonBonus = 3;
this.SetEnergyBonus = 5;
}
public HelmofIgnorance2(Serial serial)
: base(serial)
{
}
public override int BasePhysicalResistance
{
get
{
return 4;
}
}
public override int BaseFireResistance
{
get
{
return 9;
}
}
public override int BaseColdResistance
{
get
{
return 3;
}
}
public override int BasePoisonResistance
{
get
{
return 6;
}
}
public override int BaseEnergyResistance
{
get
{
return 8;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
@@ -0,0 +1,87 @@
using System;
namespace Server.Items
{
public class LegsofSloth2 : PlateLegs
{
public override bool IsArtifact { get { return true; } }
[Constructable]
public LegsofSloth2()
: base()
{
this.Name = "Legs of Sloth";
LootType = LootType.Blessed;
this.SetHue = 1109;
this.Attributes.RegenHits = 1;
this.Attributes.AttackChance = 5;
this.SetAttributes.ReflectPhysical = 25;
this.SetAttributes.NightSight = 1;
this.SetSkillBonuses.SetValues(0, SkillName.Swords, 10);
this.SetSelfRepair = 3;
this.SetPhysicalBonus = 2;
this.SetFireBonus = 5;
this.SetColdBonus = 5;
this.SetPoisonBonus = 3;
this.SetEnergyBonus = 5;
}
public LegsofSloth2(Serial serial)
: base(serial)
{
}
public override int BasePhysicalResistance
{
get
{
return 8;
}
}
public override int BaseFireResistance
{
get
{
return 5;
}
}
public override int BaseColdResistance
{
get
{
return 5;
}
}
public override int BasePoisonResistance
{
get
{
return 7;
}
}
public override int BaseEnergyResistance
{
get
{
return 5;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
@@ -0,0 +1,86 @@
using System;
namespace Server.Items
{
public class UnbendingNeck2 : PlateGorget
{
public override bool IsArtifact { get { return true; } }
[Constructable]
public UnbendingNeck2()
: base()
{
this.SetHue = 1109;
this.Name = "Unbending Neck";
LootType = LootType.Blessed;
this.Attributes.RegenHits = 1;
this.Attributes.AttackChance = 5;
this.SetAttributes.ReflectPhysical = 25;
this.SetAttributes.NightSight = 1;
this.SetSkillBonuses.SetValues(0, SkillName.Swords, 10);
this.SetSelfRepair = 3;
this.SetPhysicalBonus = 2;
this.SetFireBonus = 5;
this.SetColdBonus = 5;
this.SetPoisonBonus = 3;
this.SetEnergyBonus = 5;
}
public UnbendingNeck2(Serial serial)
: base(serial)
{
}
public override int BasePhysicalResistance
{
get
{
return 8;
}
}
public override int BaseFireResistance
{
get
{
return 5;
}
}
public override int BaseColdResistance
{
get
{
return 5;
}
}
public override int BasePoisonResistance
{
get
{
return 7;
}
}
public override int BaseEnergyResistance
{
get
{
return 5;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
@@ -0,0 +1,47 @@
using System;
using Server;
namespace Server.Items
{
public class ViceInfusedShield : BaseShield
{
public override int BasePhysicalResistance{ get{ return 0; } }
public override int BaseFireResistance{ get{ return 1; } }
public override int BaseColdResistance{ get{ return 0; } }
public override int BasePoisonResistance{ get{ return 0; } }
public override int BaseEnergyResistance{ get{ return 0; } }
public override int InitMinHits{ get{ return 50; } }
public override int InitMaxHits{ get{ return 65; } }
public override int AosStrReq{ get{ return 90; } }
public override int ArmorBase{ get{ return 23; } }
[Constructable]
public ViceInfusedShield() : base( 11009 )
{
Weight = 8.0;
Hue = 1109;
Name = "Vice Infused Shield";
}
public ViceInfusedShield( 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 );//version
}
}
}
+338
View File
@@ -0,0 +1,338 @@
//// D&D style Death Knight by Pappa Smurf ////
//// Thanks to the Following ////
//// David from RunUO.com for giving me an interest in Timers ////
//// oO_Sithid_Oo from RunUO.com for proof reading and pointing out my mistakes ////
//// and helping with the timer ////
//// TMSTKSBK for putting up with me complaining about my timers not working ////
//// The RunUO Dev Team for creating RunUO without which this script would be pointless ////
//// A_Li_N from RunUO for suggesting using a DateTime Method instead of a timer ////
//// Updated on 11/16/2008 to include new Abilities and Updates for RunUO 2.0 SVN 301 ////
//// Damage and Armor Rating calcuations, Additional Loot Drops added. ////
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
using System;
using Server.Mobiles;
using Server.Spells.Necromancy;
using Server;
using System.Collections;
using Server.Items;
using Server.Misc;
using Server.Network;
using Server.Targeting;
using Server.Spells;
using Server.Engines.CannedEvil;
namespace Server.Mobiles
{
[CorpseName("corpse of Dupre")]
public class FallenDupre : BaseChampion
{
public override ChampionSkullType SkullType { get { return ChampionSkullType.Despair; } }
public override WeaponAbility GetWeaponAbility()
{
switch (Utility.Random(2))
{
default:
case 1: return WeaponAbility.DoubleStrike;
case 2: return WeaponAbility.ArmorIgnore;
}
}
private DateTime m_NextPowerWordKillTime;
[CommandProperty(AccessLevel.GameMaster)]
public DateTime NextPowerWordKillTime
{
get
{
return m_NextPowerWordKillTime;
}
set
{
m_NextPowerWordKillTime = value;
}
}
public override bool ClickTitle { get { return false; } }
[Constructable]
public FallenDupre(): base(AIType.AI_Melee)
{
Name = "Dupre";
Title = "Fallen Champion of the Virtues";
Body = 744;
Hue = 0x4001;
SetStr(488, 620);
SetDex(121, 170);
SetInt(498, 657);
SetHits(12000 , 15000);
SetStam(102, 300);
SetDamage(10, 20);
SetDamageType(ResistanceType.Physical, 25);
SetDamageType(ResistanceType.Energy, 50);
SetResistance(ResistanceType.Physical, 35);
SetResistance(ResistanceType.Fire, 50);
SetResistance(ResistanceType.Cold, 60);
SetResistance(ResistanceType.Poison, 25);
SetResistance(ResistanceType.Energy, 40);
SetSkill( SkillName.Parry, 120.0 );
SetSkill( SkillName.Swords, 120.0 );
SetSkill( SkillName.Tactics, 120.0 );
SetSkill( SkillName.Anatomy, 120.0 );
SetSkill( SkillName.Magery, 120.0);
SetSkill( SkillName.SpiritSpeak, 120.0);
SetSkill( SkillName.Healing, 120.0);
SetSkill(SkillName.EvalInt, 120.0);
SetSkill(SkillName.MagicResist, 140.0);
SetSkill(SkillName.Chivalry, 120.0);
Fame = 25000;
Karma = -25000;
AddItem(new ArmsofApathy2());
AddItem(new HeartofObsidian2());
AddItem(new GlovesofInjustice2());
AddItem(new LegsofSloth2());
AddItem(new ThighBoots());
AddItem(new Katana());
AddItem(new HelmofIgnorance2());
AddItem(new ViceInfusedShield());
AddItem(new UnbendingNeck2());
PackGold( 200, 250 );
new Nightmare().Rider = this;
}
public override Type[] UniqueList
{
get
{
return new Type[] { typeof(FangOfRactus) };
}
}
public override Type[] SharedList
{
get
{
return new Type[]
{
typeof(RoyalGuardInvestigatorsCloak),
typeof(DjinnisRing),
typeof(DetectiveBoots),
typeof(GauntletsOfAnger)
};
}
}
public override Type[] DecorativeList
{
get
{
return new Type[] { typeof(SwampTile), typeof(MonsterStatuette) };
}
}
public override MonsterStatuetteType[] StatueTypes
{
get
{
return new MonsterStatuetteType[] { MonsterStatuetteType.Slime };
}
}
public override bool OnBeforeDeath()
{
IMount mount = this.Mount;
if (mount != null)
mount.Rider = null;
if (mount is Mobile)
((Mobile)mount).Delete();
return base.OnBeforeDeath();
}
public override void GenerateLoot()
{
AddLoot(LootPack.UltraRich, 4);
AddLoot(LootPack.FilthyRich, 2);
AddLoot(LootPack.MedScrolls, 2);
switch (Utility.Random(6))
{
case 0: AddItem(new ArmsofApathy()); break;
case 1: AddItem(new HeartofObsidian()); break;
case 2: AddItem(new LegsofSloth()); break;
case 3: AddItem(new HelmofIgnorance()); break;
case 4: AddItem(new GlovesofInjustice()); break;
case 5: AddItem(new UnbendingNeck()); break;
}
}
public override bool AlwaysMurderer { get { return true; } }
public override bool AutoDispel { get { return true; } }
public override double AutoDispelChance { get { return 1.0; } }
public override bool BardImmune { get { return !Core.SE; } }
public override bool Unprovokable { get { return Core.SE; } }
public override bool Uncalmable { get { return Core.SE; } }
public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
public override void OnDamage(int amount, Mobile from, bool willKill)
{
if (from != null && !willKill && amount > 5 && from.Player && 5 > Utility.Random(10))
{
string[] toSay = new string[]
{
"I sacraficed myself for the virtues, this was my reward",
"{0}, Fight me with Honor, Die like a Man!",
"{0}, You should retreat your skills are no match for mine",
"In life I stood against the evils of this world. Now I serve them to bring your doom!",
"{0}, You worm, you should be honored to die by my hand!" ,
"Tis' but a scratch!"
};
this.Say(true, String.Format(toSay[Utility.Random(toSay.Length)], from.Name));
}
base.OnDamage(amount, from, willKill);
}
public void PowerWordKill()
{
ArrayList list = new ArrayList();
foreach (Mobile m in this.GetMobilesInRange(1))
{
if (m == this || !CanBeHarmful(m))
continue;
if (m.Player)
list.Add(m);
}
foreach (Mobile m in list)
{
m.SendMessage("Dupre's corruption has given him a remarkable power over death, the ability to kill with a single word.....too bad you were listening!");
DoHarmful(m);
m.FixedParticles(0x36CB, 1, 9, 9911, 67, 5, EffectLayer.Head);
int toPowerWordKill = Utility.RandomMinMax(50000, 60000);
m.Damage(toPowerWordKill, this);
}
NextPowerWordKillTime = DateTime.Now + TimeSpan.FromMinutes(15.0);
}
public void SpawnUndeadArmy(Mobile target)
{
Map map = this.Map;
if (map == null)
return;
int knights = 0;
foreach (Mobile m in this.GetMobilesInRange(10))
{
if (m is UndeadKnight || m is WailingBanshee)
++knights;
}
if (knights < 1)
{
PlaySound(0x567);
int newUndead = Utility.Random(13);
for (int i = 0; i < newUndead; ++i)
{
BaseCreature skeleton;
switch (Utility.Random(2))
{
default:
case 0: skeleton = new WailingBanshee(); break;
case 1: skeleton = new UndeadKnight(); break;
}
skeleton.Team = this.Team;
bool validLocation = false;
Point3D loc = this.Location;
for (int j = 0; !validLocation && j < 10; ++j)
{
int x = X + Utility.Random(3) - 1;
int y = Y + Utility.Random(3) - 1;
int z = map.GetAverageZ(x, y);
if (validLocation = map.CanFit(x, y, this.Z, 16, false, false))
loc = new Point3D(x, y, Z);
else if (validLocation = map.CanFit(x, y, z, 16, false, false))
loc = new Point3D(x, y, z);
}
skeleton.MoveToWorld(loc, map);
skeleton.Combatant = target;
}
}
}
public override void OnThink()
{
if (Hits < 250 && DateTime.Now >= m_NextPowerWordKillTime)
PowerWordKill();
}
public void DoSpecialAbility(Mobile target)
{
if (Hits < 500 )
SpawnUndeadArmy(target);
}
public override void OnGotMeleeAttack(Mobile attacker)
{
base.OnGotMeleeAttack(attacker);
DoSpecialAbility(attacker);
}
public override void OnGaveMeleeAttack(Mobile defender)
{
base.OnGaveMeleeAttack(defender);
DoSpecialAbility(defender);
}
public FallenDupre( 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();
}
}
}
+19 -8
View File
@@ -21,14 +21,17 @@ namespace Server.Items
[Constructable]
public HeritageSovereign(int amount) : base(0x14EF) // ORIGINAL ITEM ID
{
LootType = LootType.Blessed;
LootType = LootType.Cursed;
Hue = 2713; // ORIGINAL HUE
Stackable = true;
Amount = amount;
UpdateName();
}
public static bool CanSearch(Mobile m)
{
return m != null && m.Region.GetLogoutDelay(m) <= TimeSpan.Zero;
}
public HeritageSovereign(Serial serial) : base(serial)
{
}
@@ -65,13 +68,21 @@ namespace Server.Items
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
if (from.AccessLevel < AccessLevel.Counselor && !CanSearch(from))
{
// Before using the in game store, you must be in a safe log-out location
// such as an inn or a house which has you on its Owner, Co-owner, or Friends list.
from.SendLocalizedMessage(1156586);
return;
}
else if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // Must be in pack
return;
}
if (from is PlayerMobile pm)
else if (from is PlayerMobile pm)
{
pm.DepositSovereigns(Amount);
Delete();
@@ -161,7 +172,7 @@ namespace Server.CustomSystems
// 4. Determine Drop Chance
if (!isEndgameBoss)
{
if (Utility.RandomDouble() > 0.10)
if (Utility.RandomDouble() > 0.05)
return;
}
@@ -171,7 +182,7 @@ namespace Server.CustomSystems
if (isEndgameBoss)
{
baseReward = 200;
baseReward = 100;
}
else
{
@@ -180,9 +191,9 @@ namespace Server.CustomSystems
else if (maxHits >= 1000 && maxHits < 5000)
baseReward = 10;
else if (maxHits >= 5000 && maxHits < 10000)
baseReward = 50;
baseReward = 25;
else if (maxHits >= 10000)
baseReward = 100;
baseReward = 50;
}
if (baseReward == 0)
@@ -100,4 +100,4 @@ public class InsuranceAgent : BaseCreature
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
-45
View File
@@ -1,45 +0,0 @@
using System;
using Server;
using Server.Mobiles;
using Server.Gumps;
public class InsuranceAgent : BaseCreature
{
[Constructable]
public InsuranceAgent()
: base(AIType.AI_Vendor, FightMode.None, 0, 0, 0.2, 0.4)
{
Name = "an Insurance Agent";
Body = 0x190; // male human
Hue = Utility.RandomSkinHue();
Blessed = true; // invulnerable
CantWalk = true; // stationary
Frozen = true; // cannot be moved
Warmode = false; // never fights
}
public override void OnDoubleClick(Mobile from)
{
if (from is PlayerMobile pm && pm !=null)
{
this.Say("Here are your insurance options.");
pm.OpenItemInsuranceMenu(new ItemInsuranceMenuGump(pm, pm.Items, null, 0));
}
}
public InsuranceAgent(Serial serial) : base(serial) { }
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
reader.ReadInt();
}
}
+121
View File
@@ -0,0 +1,121 @@
using System;
using Server;
using Server.Items;
using Server.Targeting;
using Server.Engines.XmlSpawner2;
namespace Server.Items
{
public class OilOfRestoration : Item
{
[Constructable]
public OilOfRestoration() : base(0x1C18) // Bottle graphic
{
Name = "Oil of Restoration";
Weight = 1.0;
Hue = 241;
}
public OilOfRestoration(Serial serial) : base(serial)
{
}
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
from.SendMessage("This must be in your pack to use.");
return;
}
from.SendMessage("Select an oil cloth to apply the oil to.");
from.Target = new OilClothTarget(this);
}
private class OilClothTarget : Target
{
private OilOfRestoration m_Oil;
public OilClothTarget(OilOfRestoration oil)
: base(1, false, TargetFlags.None)
{
m_Oil = oil;
}
protected override void OnTarget(Mobile from, object targeted)
{
if (m_Oil.Deleted)
return;
if (!(targeted is OilCloth cloth))
{
from.SendMessage("You must target an oil cloth.");
return;
}
from.SendMessage("Select the item you wish to restore.");
from.Target = new RestoreItemTarget(m_Oil, cloth);
}
}
private class RestoreItemTarget : Target
{
private OilOfRestoration m_Oil;
private OilCloth m_Cloth;
public RestoreItemTarget(OilOfRestoration oil, OilCloth cloth)
: base(1, false, TargetFlags.None)
{
m_Oil = oil;
m_Cloth = cloth;
}
protected override void OnTarget(Mobile from, object targeted)
{
if (m_Oil.Deleted || m_Cloth.Deleted)
return;
if (!(targeted is Item item))
{
from.SendMessage("That is not a valid item.");
return;
}
// Get durability attachment
var dura = XmlAttach.FindAttachment(item, typeof(Server.Custom.DurabilityAttachment))
as Server.Custom.DurabilityAttachment;
if (dura == null || !dura.RepairLocked)
{
from.SendMessage("That item is not tempered and does not require restoration.");
return;
}
// Remove repair lock
dura.RepairLocked = false;
// Refresh tooltip
item.InvalidateProperties();
// Consume both items
m_Oil.Delete();
m_Cloth.Delete();
from.SendMessage("The oil soaks in and restores the malleability of your item.");
from.PlaySound(0x240);
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
reader.ReadInt();
}
}
}
-140
View File
@@ -1,140 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Server
{
public static class MiniJson
{
public static object Parse(string json)
{
return new Parser(json).ParseValue();
}
private class Parser
{
private readonly string _json;
private int _index;
public Parser(string json)
{
_json = json;
}
public object ParseValue()
{
SkipWhitespace();
if (_index >= _json.Length)
return null;
char c = _json[_index];
if (c == '{') return ParseObject();
if (c == '[') return ParseArray();
if (c == '"') return ParseString();
if (char.IsDigit(c) || c == '-') return ParseNumber();
return null;
}
private Dictionary<string, object> ParseObject()
{
var dict = new Dictionary<string, object>();
_index++; // skip {
while (true)
{
SkipWhitespace();
if (_json[_index] == '}')
{
_index++;
return dict;
}
string key = ParseString();
SkipWhitespace();
_index++; // skip :
object value = ParseValue();
dict[key] = value;
SkipWhitespace();
if (_json[_index] == ',')
{
_index++;
continue;
}
if (_json[_index] == '}')
{
_index++;
return dict;
}
}
}
private List<object> ParseArray()
{
var list = new List<object>();
_index++; // skip [
while (true)
{
SkipWhitespace();
if (_json[_index] == ']')
{
_index++;
return list;
}
list.Add(ParseValue());
SkipWhitespace();
if (_json[_index] == ',')
{
_index++;
continue;
}
if (_json[_index] == ']')
{
_index++;
return list;
}
}
}
private string ParseString()
{
_index++; // skip "
int start = _index;
while (_json[_index] != '"')
_index++;
string s = _json.Substring(start, _index - start);
_index++; // skip closing "
return s;
}
private object ParseNumber()
{
int start = _index;
while (_index < _json.Length && (char.IsDigit(_json[_index]) || _json[_index] == '-'))
_index++;
string num = _json.Substring(start, _index - start);
return int.Parse(num);
}
private void SkipWhitespace()
{
while (_index < _json.Length && char.IsWhiteSpace(_json[_index]))
_index++;
}
}
}
}
-50
View File
@@ -1,50 +0,0 @@
using Server;
using Server.Gumps;
using Server.Network;
namespace Server.CustomSystems
{
public class RoyalMintGump : Gump
{
private readonly Mobile m_From;
private readonly RoyalMintOfficial m_NPC;
public RoyalMintGump(Mobile from, RoyalMintOfficial npc)
: base(50, 50)
{
m_From = from;
m_NPC = npc;
Closable = true;
Dragable = true;
AddPage(0);
AddBackground(0, 0, 350, 250, 9270);
AddLabel(110, 20, 1152, "Royal Mint Services");
AddButton(40, 70, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddLabel(80, 70, 0x34, "Consolidate Your Notes");
AddButton(40, 120, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddLabel(80, 120, 0x34, "Purchase Mint Box (5000)");
AddButton(40, 170, 4017, 4019, 0, GumpButtonType.Reply, 0);
AddLabel(80, 170, 0x34, "Close");
}
public override void OnResponse(NetState sender, RelayInfo info)
{
switch (info.ButtonID)
{
case 1:
m_NPC.ConsolidateNotes(m_From);
break;
case 2:
m_NPC.PurchaseMintBox(m_From);
break;
}
}
}
}
+9 -56
View File
@@ -15,62 +15,15 @@ namespace Server.CustomSystems
public RoyalMintOfficial()
: base(AIType.AI_Vendor, FightMode.None, 10, 1, 0.2, 0.4)
{
Title = "The Royal Mint Official";
Hue = Utility.RandomSkinHue();
if (Female = Utility.RandomBool())
{
Body = 0x191;
Name = NameList.RandomName("female");
AddItem(new PlateChest());
AddItem(new PlateArms());
AddItem(new PlateLegs());
AddItem(new Cloak(113));
switch (Utility.Random(3))
{
case 0:
AddItem(new Doublet(Utility.RandomNondyedHue()));
break;
case 1:
AddItem(new Tunic(Utility.RandomNondyedHue()));
break;
case 2:
AddItem(new BodySash(Utility.RandomNondyedHue()));
break;
}
}
else
{
Body = 0x190;
Name = NameList.RandomName("male");
AddItem(new PlateChest());
AddItem(new PlateArms());
AddItem(new PlateLegs());
AddItem(new Cloak(113));
switch (Utility.Random(3))
{
case 0:
AddItem(new Doublet(Utility.RandomNondyedHue()));
break;
case 1:
AddItem(new Tunic(Utility.RandomNondyedHue()));
break;
case 2:
AddItem(new BodySash(Utility.RandomNondyedHue()));
break;
}
}
Utility.AssignRandomHair(this);
if (Utility.RandomBool())
{
Utility.AssignRandomFacialHair(this, HairHue);
}
}
Name = "Royal Mint Official";
Title = "the Sovereign Clerk";
Body = 0x190;
Hue = 33770;
AddItem(new Robe(2713));
AddItem(new Sandals(1150));
AddItem(new GoldBracelet());
}
public RoyalMintOfficial(Serial serial) : base(serial)
{