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
+2 -2
View File
@@ -32,7 +32,7 @@ namespace Server.Misc
if (!Enabled || IsExempt(ourAddress))
return true;
List<NetState> netStates = NetState.Instances;
IList<NetState> netStates = NetState.Instances;
int count = 0;
@@ -52,4 +52,4 @@ namespace Server.Misc
return true;
}
}
}
}
@@ -1,5 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Network;
namespace Server.Commands.Generic
@@ -36,7 +38,7 @@ namespace Server.Commands.Generic
ArrayList list = new ArrayList();
ArrayList addresses = new ArrayList();
System.Collections.Generic.List<NetState> states = NetState.Instances;
IList<NetState> states = NetState.Instances;
for (int i = 0; i < states.Count; ++i)
{
@@ -60,4 +62,4 @@ namespace Server.Commands.Generic
}
}
}
}
}
@@ -36,7 +36,7 @@ namespace Server.Commands.Generic
ArrayList list = new ArrayList();
List<NetState> states = NetState.Instances;
IList<NetState> states = NetState.Instances;
for (int i = 0; i < states.Count; ++i)
{
@@ -63,4 +63,4 @@ namespace Server.Commands.Generic
}
}
}
}
}
+4 -1
View File
@@ -164,6 +164,9 @@ namespace Server.Commands
while ((line = ip.ReadLine()) != null)
{
if (string.IsNullOrEmpty(line))
continue;
string[] split = line.Split(' ');
SignEntry e = new SignEntry(
@@ -346,4 +349,4 @@ namespace Server.Commands
}
}
}
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ namespace Server.Commands
public static void CheckTime_OnCommand(CommandEventArgs e)
{
Mobile m = e.Mobile;
DateTime now = DateTime.Now;
DateTime now = DateTime.UtcNow;
m.SendMessage("The Current Date And Time Is " + now + "(EST)");
}
}
+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)
{
+29 -32
View File
@@ -325,41 +325,38 @@ namespace Server.Gumps
sb.Append(((maxIOCP - curIOCP) * 100) / maxIOCP);
sb.Append("%");
List<BufferPool> pools = BufferPool.Pools;
IList<BufferPool> pools = BufferPool.Pools;
lock (pools)
for (int i = 0; i < pools.Count; ++i)
{
for (int i = 0; i < pools.Count; ++i)
{
BufferPool pool = pools[i];
string name;
int freeCount;
int initialCapacity;
int currentCapacity;
int bufferSize;
int misses;
BufferPool pool = pools[i];
string name;
int freeCount;
int initialCapacity;
int currentCapacity;
int bufferSize;
int misses;
pool.GetInfo(out name, out freeCount, out initialCapacity, out currentCapacity, out bufferSize, out misses);
pool.GetInfo(out name, out freeCount, out initialCapacity, out currentCapacity, out bufferSize, out misses);
if (sb.Length > 0)
sb.Append("<br><br>");
if (sb.Length > 0)
sb.Append("<br><br>");
sb.Append(name);
sb.Append("<br>Size: ");
sb.Append(FormatByteAmount(bufferSize));
sb.Append("<br>Capacity: ");
sb.Append(currentCapacity);
sb.Append(" (");
sb.Append(misses);
sb.Append(" misses)<br>Available: ");
sb.Append(freeCount);
sb.Append("<br>Usage: ");
sb.Append(((currentCapacity - freeCount) * 100) / currentCapacity);
sb.Append("% : ");
sb.Append(FormatByteAmount((currentCapacity - freeCount) * bufferSize));
sb.Append(" of ");
sb.Append(FormatByteAmount(currentCapacity * bufferSize));
}
sb.Append(name);
sb.Append("<br>Size: ");
sb.Append(FormatByteAmount(bufferSize));
sb.Append("<br>Capacity: ");
sb.Append(currentCapacity);
sb.Append(" (");
sb.Append(misses);
sb.Append(" misses)<br>Available: ");
sb.Append(freeCount);
sb.Append("<br>Usage: ");
sb.Append(((currentCapacity - freeCount) * 100) / currentCapacity);
sb.Append("% : ");
sb.Append(FormatByteAmount((currentCapacity - freeCount) * bufferSize));
sb.Append(" of ");
sb.Append(FormatByteAmount(currentCapacity * bufferSize));
}
this.AddLabel(20, 200, LabelHue, "Pooling:");
@@ -2041,7 +2038,7 @@ namespace Server.Gumps
if (level > AccessLevel.VIP)
{
List<NetState> clients = NetState.Instances;
IList<NetState> clients = NetState.Instances;
int count = 0;
for (int i = 0; i < clients.Count; ++i)
@@ -2178,7 +2175,7 @@ namespace Server.Gumps
}
else
{
List<NetState> instances = NetState.Instances;
IList<NetState> instances = NetState.Instances;
for (int i = 0; i < instances.Count; ++i)
{
+1 -1
View File
@@ -510,4 +510,4 @@ namespace Server.Gumps
}
}
}
}
}
+2 -2
View File
@@ -81,7 +81,7 @@ namespace Server.Gumps
filter = filter.ToLower();
List<Mobile> list = new List<Mobile>();
List<NetState> states = NetState.Instances;
IList<NetState> states = NetState.Instances;
for (int i = 0; i < states.Count; ++i)
{
@@ -293,4 +293,4 @@ namespace Server.Gumps
}
}
}
}
}
@@ -30,7 +30,7 @@ namespace Server
Virtuoso,
Aloron,
Darden,
ForsakenVirtues
ForsakenVirtues
}
public interface ISetItem
+1 -1
View File
@@ -562,4 +562,4 @@ namespace Server.Items
}
}
}
}
}
+174 -187
View File
@@ -1,65 +1,53 @@
using System;
using Server.Network;
using Server.Targeting;
using Server.Custom; // Required for durability extension methods
namespace Server.Items
{
public class PowderOfTemperament : Item, IUsesRemaining
{
public static bool CanPOFJewelry = Config.Get("Loot.CanPOFJewelry", false);
private int m_UsesRemaining;
[Constructable]
public PowderOfTemperament()
: this(10)
public PowderOfTemperament() : this(10)
{
}
[Constructable]
public PowderOfTemperament(int charges)
: base(4102)
public PowderOfTemperament(int charges) : base(4102)
{
Weight = 1.0;
Hue = 2419;
UsesRemaining = charges;
}
public PowderOfTemperament(Serial serial)
: base(serial)
public PowderOfTemperament(Serial serial) : base(serial)
{
}
[CommandProperty(AccessLevel.GameMaster)]
public int UsesRemaining
{
get
{
return m_UsesRemaining;
}
get { return m_UsesRemaining; }
set
{
m_UsesRemaining = value;
InvalidateProperties();
}
}
public bool ShowUsesRemaining
{
get
{
return true;
}
set
{
}
get { return true; }
set { }
}
public override int LabelNumber
{
get
{
return 1049082;
}
}// powder of fortifying
get { return 1049082; } // powder of fortifying
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
@@ -74,31 +62,13 @@ namespace Server.Items
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
m_UsesRemaining = reader.ReadInt();
break;
}
}
if (version == 0)
m_UsesRemaining = reader.ReadInt();
}
public override void AddUsesRemainingProperties(ObjectPropertyList list)
{
list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~
}
public virtual void DisplayDurabilityTo(Mobile m)
{
LabelToAffix(m, 1017323, AffixType.Append, ": " + m_UsesRemaining.ToString()); // Durability
}
public override void OnSingleClick(Mobile from)
{
DisplayDurabilityTo(from);
base.OnSingleClick(from);
list.Add(1060584, m_UsesRemaining.ToString());
}
public override void OnDoubleClick(Mobile from)
@@ -106,12 +76,13 @@ namespace Server.Items
if (IsChildOf(from.Backpack))
from.Target = new InternalTarget(this);
else
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
from.SendLocalizedMessage(1042001); // Must be in pack
}
private class InternalTarget : Target
{
private readonly PowderOfTemperament m_Powder;
private PowderOfTemperament m_Powder;
public InternalTarget(PowderOfTemperament powder)
: base(2, false, TargetFlags.None)
{
@@ -122,153 +93,169 @@ namespace Server.Items
{
if (m_Powder.Deleted || m_Powder.UsesRemaining <= 0)
{
from.SendLocalizedMessage(1049086); // You have used up your powder of temperament.
from.SendLocalizedMessage(1049086); // used up
return;
}
if (targeted is Item)
Item item = targeted as Item;
if (item == null)
{
Item item = (Item)targeted;
bool noGo = false;
int antique = 0;
if (!Server.Engines.Craft.Repair.AllowsRepair(item, null) || (item is BaseJewel && !CanPOFJewelry))
{
from.SendLocalizedMessage(1049083); // You cannot use the powder on that item.
return;
}
#region SA
if (item is BaseWeapon)
{
if (((BaseWeapon)item).Attributes.Brittle > 0 || ((BaseWeapon)item).NegativeAttributes.Brittle > 0)
noGo = true;
antique = ((BaseWeapon)item).NegativeAttributes.Antique;
}
else if (item is BaseArmor)
{
if (((BaseArmor)item).Attributes.Brittle > 0 || ((BaseArmor)item).NegativeAttributes.Brittle > 0)
noGo = true;
antique = ((BaseArmor)item).NegativeAttributes.Antique;
}
else if (item is BaseClothing)
{
if (((BaseClothing)item).Attributes.Brittle > 0 || ((BaseClothing)item).NegativeAttributes.Brittle > 0)
noGo = true;
antique = ((BaseClothing)item).NegativeAttributes.Antique;
}
else if (item is BaseJewel)
{
if (((BaseJewel)item).Attributes.Brittle > 0 || ((BaseJewel)item).NegativeAttributes.Brittle > 0)
noGo = true;
antique = ((BaseJewel)item).NegativeAttributes.Antique;
}
else if (item is BaseTalisman && ((BaseTalisman)item).Attributes.Brittle > 0)
{
noGo = true;
}
if (noGo)
{
from.SendLocalizedMessage(1149799); //That cannot be used on brittle items.
return;
}
#endregion
if (targeted is IDurability)
{
IDurability wearable = (IDurability)targeted;
if (!wearable.CanFortify)
{
from.SendLocalizedMessage(1049083); // You cannot use the powder on that item.
return;
}
if ((item.IsChildOf(from.Backpack) || (Core.ML && item.Parent == from)) && m_Powder.IsChildOf(from.Backpack))
{
int origMaxHP = wearable.MaxHitPoints;
int origCurHP = wearable.HitPoints;
if (origMaxHP > 0)
{
int initMaxHP = antique <= 0 ? 255 : antique == 1 ? 250 : antique == 2 ? 200 : 150;
wearable.UnscaleDurability();
if (wearable.MaxHitPoints < initMaxHP)
{
if (antique > 0)
{
wearable.MaxHitPoints = initMaxHP;
wearable.HitPoints += initMaxHP;
}
else
{
int bonus = initMaxHP - wearable.MaxHitPoints;
if (bonus > 10)
bonus = 10;
wearable.MaxHitPoints += bonus;
wearable.HitPoints += bonus;
}
wearable.ScaleDurability();
if (wearable.MaxHitPoints > 255)
wearable.MaxHitPoints = 255;
if (wearable.HitPoints > 255)
wearable.HitPoints = 255;
if (wearable.MaxHitPoints > origMaxHP)
{
from.SendLocalizedMessage(1049084); // You successfully use the powder on the item.
from.PlaySound(0x247);
--m_Powder.UsesRemaining;
if (m_Powder.UsesRemaining <= 0)
{
from.SendLocalizedMessage(1049086); // You have used up your powder of fortifying.
m_Powder.Delete();
}
if (antique > 0)
{
if (item is BaseWeapon) ((BaseWeapon)item).NegativeAttributes.Antique++;
if (item is BaseArmor) ((BaseArmor)item).NegativeAttributes.Antique++;
if (item is BaseJewel) ((BaseJewel)item).NegativeAttributes.Antique++;
if (item is BaseClothing) ((BaseClothing)item).NegativeAttributes.Antique++;
}
}
else
{
wearable.MaxHitPoints = origMaxHP;
wearable.HitPoints = origCurHP;
from.SendLocalizedMessage(1049085); // The item cannot be improved any further.
}
}
else
{
from.SendLocalizedMessage(1049085); // The item cannot be improved any further.
wearable.ScaleDurability();
}
}
else
{
from.SendLocalizedMessage(1049083); // You cannot use the powder on that item.
}
}
else
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
}
from.SendLocalizedMessage(1042001);
return;
}
else
// Jewelry cannot be fortified (OSI)
if (item is BaseJewel)
{
from.SendLocalizedMessage(1049083); // You cannot use the powder on that item.
from.SendLocalizedMessage(1049083);
return;
}
// Brittle or Antique items cannot be fortified (OSI)
if (IsBrittle(item) || IsAntique(item))
{
from.SendLocalizedMessage(1049083);
return;
}
IDurability wearable = targeted as IDurability;
if (wearable == null || !wearable.CanFortify)
{
from.SendLocalizedMessage(1049083);
return;
}
if (!(item.IsChildOf(from.Backpack) || (Core.ML && item.Parent == from)) || !m_Powder.IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1049085);
return;
}
// ===============================
// HARD CAP CHECK — OSI ACCURATE
// ===============================
int oldMax = wearable.MaxHitPoints;
if (oldMax >= 255)
{
from.SendMessage("This item cannot be fortified any further.");
return;
}
// ===============================
// APPLY +10 DURABILITY (CAPPED)
// ===============================
int delta = 10;
if (oldMax + delta > 255)
delta = 255 - oldMax;
if (delta <= 0)
{
from.SendMessage("This item cannot be fortified any further.");
return;
}
int newMax = oldMax + delta;
wearable.MaxHitPoints = newMax;
wearable.HitPoints += delta;
if (wearable.HitPoints > wearable.MaxHitPoints)
wearable.HitPoints = wearable.MaxHitPoints;
// ===============================================
// REMOVE SELF REPAIR ON FIRST PoF USE
// ===============================================
if (item is BaseWeapon bw)
{
bw.WeaponAttributes.SelfRepair = 0;
}
if (item is BaseArmor ba)
{
ba.ArmorAttributes.SelfRepair = 0;
}
if (item is BaseShield bs)
{
bs.ArmorAttributes.SelfRepair = 0;
}
if (item is BaseClothing bc)
{
bc.ClothingAttributes.SelfRepair = 0;
}
// ===============================
// TRACK POF USES
// ===============================
item.SetPoFUses(item.GetPoFUses() + 1);
// ===============================
// APPLY REPAIR LOCK
// ===============================
item.SetRepairLocked(true);
from.SendMessage("You successfully fortify the item.");
from.PlaySound(0x247);
m_Powder.UsesRemaining--;
if (m_Powder.UsesRemaining <= 0)
{
from.SendLocalizedMessage(1049086);
m_Powder.Delete();
}
}
private bool IsBrittle(Item item)
{
BaseWeapon bw = item as BaseWeapon;
if (bw != null && (bw.Attributes.Brittle > 0 || bw.NegativeAttributes.Brittle > 0))
return true;
BaseArmor ba = item as BaseArmor;
if (ba != null && (ba.Attributes.Brittle > 0 || ba.NegativeAttributes.Brittle > 0))
return true;
BaseClothing bc = item as BaseClothing;
if (bc != null && (bc.Attributes.Brittle > 0 || bc.NegativeAttributes.Brittle > 0))
return true;
BaseJewel bj = item as BaseJewel;
if (bj != null && (bj.Attributes.Brittle > 0 || bj.NegativeAttributes.Brittle > 0))
return true;
BaseTalisman bt = item as BaseTalisman;
if (bt != null && bt.Attributes.Brittle > 0)
return true;
return false;
}
private bool IsAntique(Item item)
{
BaseWeapon bw = item as BaseWeapon;
if (bw != null && bw.NegativeAttributes.Antique > 0)
return true;
BaseArmor ba = item as BaseArmor;
if (ba != null && ba.NegativeAttributes.Antique > 0)
return true;
BaseClothing bc = item as BaseClothing;
if (bc != null && bc.NegativeAttributes.Antique > 0)
return true;
BaseJewel bj = item as BaseJewel;
if (bj != null && bj.NegativeAttributes.Antique > 0)
return true;
return false;
}
}
}
+99 -87
View File
@@ -284,7 +284,7 @@ namespace Server.Items
}
}
public virtual bool CanAlter { get { return true; } }
public virtual bool CanAlter { get { return true; } }
public virtual bool UseIntOrDexProperty
{
@@ -401,9 +401,9 @@ namespace Server.Items
return m_ArmorBase;
}
set
{
{
m_ArmorBase = value;
Invalidate();
Invalidate();
}
}
@@ -424,7 +424,7 @@ namespace Server.Items
if (m_Protection != ArmorProtectionLevel.Regular)
ar += 10 + (5 * (int)m_Protection);
switch ( m_Resource )
switch (m_Resource)
{
case CraftResource.DullCopper:
ar += 2;
@@ -538,7 +538,7 @@ namespace Server.Items
armor.m_RefinedPoison > 0 ||
armor.m_RefinedEnergy > 0);
}
public override void AddResistanceProperties(ObjectPropertyList list)
{
if (PhysicalResistance != 0 || m_RefinedPhysical != 0)
@@ -761,9 +761,9 @@ namespace Server.Items
#region Runic Reforging
[CommandProperty(AccessLevel.GameMaster)]
public ReforgedPrefix ReforgedPrefix
{
get { return m_ReforgedPrefix; }
public ReforgedPrefix ReforgedPrefix
{
get { return m_ReforgedPrefix; }
set { m_ReforgedPrefix = value; InvalidateProperties(); }
}
@@ -776,9 +776,9 @@ namespace Server.Items
[CommandProperty(AccessLevel.GameMaster)]
public ItemPower ItemPower
{
get { return m_ItemPower; }
set { m_ItemPower = value; InvalidateProperties(); }
{
get { return m_ItemPower; }
set { m_ItemPower = value; InvalidateProperties(); }
}
#endregion
@@ -963,11 +963,11 @@ namespace Server.Items
[CommandProperty(AccessLevel.GameMaster)]
public int HitPoints
{
get
get
{
return m_HitPoints;
}
set
set
{
if (value != m_HitPoints && MaxHitPoints > 0)
{
@@ -1298,7 +1298,7 @@ namespace Server.Items
{
get
{
switch ( Layer )
switch (Layer)
{
default:
case Layer.Neck:
@@ -1327,7 +1327,7 @@ namespace Server.Items
public int GetProtOffset()
{
switch ( m_Protection )
switch (m_Protection)
{
case ArmorProtectionLevel.Guarding:
return 1;
@@ -1372,10 +1372,10 @@ namespace Server.Items
{
int bonus = 0;
if (m_Quality == ItemQuality.Exceptional &&!(this is GargishLeatherWingArmor))
if (m_Quality == ItemQuality.Exceptional && !(this is GargishLeatherWingArmor))
bonus += 20;
switch ( m_Durability )
switch (m_Durability)
{
case ArmorDurabilityLevel.Durable:
bonus += 20;
@@ -1630,10 +1630,10 @@ namespace Server.Items
PlayerConstructed = 0x01000000,
xAbsorptionAttributes = 0x02000000,
xWeaponAttributes = 0x04000000,
NegativeAttributes = 0x08000000,
Altered = 0x10000000,
NegativeAttributes = 0x08000000,
Altered = 0x10000000,
TalismanProtection = 0x20000000,
EngravedText = 0x40000000
EngravedText = 0x40000000
}
#region Mondain's Legacy Sets
@@ -1720,7 +1720,7 @@ namespace Server.Items
// Version 8
writer.Write((int)m_TimesImbued);
#endregion
writer.Write((Mobile)m_BlessedBy);
@@ -1903,7 +1903,7 @@ namespace Server.Items
int version = reader.ReadInt();
switch ( version )
switch (version)
{
case 15:
case 14:
@@ -1961,12 +1961,12 @@ namespace Server.Items
case 8:
{
m_TimesImbued = reader.ReadInt();
#endregion
m_BlessedBy = reader.ReadMobile();
SetFlag sflags = (SetFlag)reader.ReadEncodedInt();
SetFlag sflags = (SetFlag)reader.ReadEncodedInt();
if (GetSaveFlag(sflags, SetFlag.Attributes))
m_SetAttributes = new AosAttributes(this, reader);
@@ -2198,7 +2198,8 @@ namespace Server.Items
if (m_ArmorBase == RevertArmorBase)
m_ArmorBase = -1;
/*m_BodyPos = (ArmorBodyType)*/reader.ReadInt();
/*m_BodyPos = (ArmorBodyType)*/
reader.ReadInt();
if (version < 4)
{
@@ -2217,7 +2218,7 @@ namespace Server.Items
{
OreInfo info;
switch ( reader.ReadInt() )
switch (reader.ReadInt())
{
default:
case 0:
@@ -2595,7 +2596,7 @@ namespace Server.Items
damageTaken -= Absorbed;
if (damageTaken < 0)
if (damageTaken < 0)
damageTaken = 0;
if (Absorbed < 2)
@@ -2682,7 +2683,7 @@ namespace Server.Items
{
int oreType;
switch ( m_Resource )
switch (m_Resource)
{
case CraftResource.DullCopper: oreType = 1053108; break; // dull copper
case CraftResource.ShadowIron: oreType = 1053107; break; // shadow iron
@@ -2701,7 +2702,7 @@ namespace Server.Items
case CraftResource.GreenScales: oreType = 1060819; break; // green
case CraftResource.WhiteScales: oreType = 1060821; break; // white
case CraftResource.BlueScales: oreType = 1060815; break; // blue
case CraftResource.OakWood: oreType = 1072533; break; // oak
case CraftResource.OakWood: oreType = 1072533; break; // oak
case CraftResource.AshWood: oreType = 1072534; break; // ash
case CraftResource.YewWood: oreType = 1072535; break; // yew
case CraftResource.Heartwood: oreType = 1072536; break; // heartwood
@@ -2794,6 +2795,17 @@ namespace Server.Items
{
base.AddNameProperties(list);
// ===============================================
// DURABILITY TOOLTIP: TEMPERED / REPAIR LOCKED
// ===============================================
var dura = XmlAttach.FindAttachment(this, typeof(Server.Custom.DurabilityAttachment))
as Server.Custom.DurabilityAttachment;
if (dura != null && dura.RepairLocked)
{
list.Add("Tempered — Cannot be repaired");
}
#region Factions
FactionEquipment.AddFactionProperties(this, list);
#endregion
@@ -2895,14 +2907,14 @@ namespace Server.Items
if (m_TalismanProtection != null && !m_TalismanProtection.IsEmpty && m_TalismanProtection.Amount > 0)
list.Add(1072387, "{0}\t{1}", m_TalismanProtection.Name != null ? m_TalismanProtection.Name.ToString() : "Unknown", m_TalismanProtection.Amount); // ~1_NAME~ Protection: +~2_val~%
if ((prop = m_AosArmorAttributes.SoulCharge) != 0)
if ((prop = m_AosArmorAttributes.SoulCharge) != 0)
list.Add(1113630, prop.ToString()); // Soul Charge ~1_val~%
if((prop = m_AosArmorAttributes.ReactiveParalyze) != 0)
if ((prop = m_AosArmorAttributes.ReactiveParalyze) != 0)
list.Add(1112364); // reactive paralyze
if ((prop = m_SAAbsorptionAttributes.EaterFire) != 0)
if ((prop = m_SAAbsorptionAttributes.EaterFire) != 0)
list.Add(1113593, prop.ToString()); // Fire Eater ~1_Val~%
if ((prop = m_SAAbsorptionAttributes.EaterCold) != 0)
@@ -2919,8 +2931,8 @@ namespace Server.Items
if ((prop = m_SAAbsorptionAttributes.EaterDamage) != 0)
list.Add(1113598, prop.ToString()); // Damage Eater ~1_Val~%
if ((prop = m_SAAbsorptionAttributes.ResonanceFire) != 0)
if ((prop = m_SAAbsorptionAttributes.ResonanceFire) != 0)
list.Add(1113691, prop.ToString()); // Fire Resonance ~1_val~%
if ((prop = m_SAAbsorptionAttributes.ResonanceCold) != 0)
@@ -2934,41 +2946,41 @@ namespace Server.Items
if ((prop = m_SAAbsorptionAttributes.ResonanceKinetic) != 0)
list.Add(1113695, prop.ToString()); // Kinetic Resonance ~1_val~%
if ((prop = m_SAAbsorptionAttributes.CastingFocus) != 0)
if ((prop = m_SAAbsorptionAttributes.CastingFocus) != 0)
list.Add(1113696, prop.ToString()); // Casting Focus ~1_val~%
if ((prop = m_AosAttributes.SpellChanneling) != 0)
if ((prop = m_AosAttributes.SpellChanneling) != 0)
list.Add(1060482); // spell channeling
if ((prop = m_AosArmorAttributes.SelfRepair) != 0)
if ((prop = m_AosArmorAttributes.SelfRepair) != 0)
list.Add(1060450, prop.ToString()); // self repair ~1_val~
if ((prop = m_AosAttributes.NightSight) != 0)
if ((prop = m_AosAttributes.NightSight) != 0)
list.Add(1060441); // night sight
if ((prop = m_AosAttributes.BonusStr) != 0)
if ((prop = m_AosAttributes.BonusStr) != 0)
list.Add(1060485, prop.ToString()); // strength bonus ~1_val~
if ((prop = m_AosAttributes.BonusDex) != 0)
if ((prop = m_AosAttributes.BonusDex) != 0)
list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~
if ((prop = m_AosAttributes.BonusInt) != 0)
list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~
if ((prop = m_AosAttributes.BonusHits) != 0)
if ((prop = m_AosAttributes.BonusHits) != 0)
list.Add(1060431, prop.ToString()); // hit point increase ~1_val~
if ((prop = m_AosAttributes.BonusStam) != 0)
if ((prop = m_AosAttributes.BonusStam) != 0)
list.Add(1060484, prop.ToString()); // stamina increase ~1_val~
if ((prop = m_AosAttributes.BonusMana) != 0)
if ((prop = m_AosAttributes.BonusMana) != 0)
list.Add(1060439, prop.ToString()); // mana increase ~1_val~
if ((prop = m_AosAttributes.RegenHits) != 0)
if ((prop = m_AosAttributes.RegenHits) != 0)
list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~
if ((prop = m_AosAttributes.RegenStam) != 0)
if ((prop = m_AosAttributes.RegenStam) != 0)
list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~
if ((prop = m_AosAttributes.RegenMana) != 0)
@@ -2976,8 +2988,8 @@ namespace Server.Items
if ((prop = (GetLuckBonus() + m_AosAttributes.Luck)) != 0)
list.Add(1060436, prop.ToString()); // luck ~1_val~
if ((prop = m_AosAttributes.EnhancePotions) != 0)
if ((prop = m_AosAttributes.EnhancePotions) != 0)
list.Add(1060411, prop.ToString()); // enhance potions ~1_val~%
if ((prop = m_AosAttributes.ReflectPhysical) != 0)
@@ -2985,45 +2997,45 @@ namespace Server.Items
if (this is SurgeShield && ((SurgeShield)this).Surge > SurgeType.None)
list.Add(1153098, ((SurgeShield)this).Charges.ToString());
if ((prop = m_AosAttributes.AttackChance) != 0)
if ((prop = m_AosAttributes.AttackChance) != 0)
list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~%
if ((prop = m_AosAttributes.WeaponSpeed) != 0)
if ((prop = m_AosAttributes.WeaponSpeed) != 0)
list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~%
if ((prop = m_AosAttributes.WeaponDamage) != 0)
if ((prop = m_AosAttributes.WeaponDamage) != 0)
list.Add(1060401, prop.ToString()); // damage increase ~1_val~%
if ((prop = m_AosAttributes.DefendChance) != 0)
list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~%
if ((prop = m_AosAttributes.CastRecovery) != 0)
if ((prop = m_AosAttributes.CastRecovery) != 0)
list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~
if ((prop = m_AosAttributes.CastSpeed) != 0)
if ((prop = m_AosAttributes.CastSpeed) != 0)
list.Add(1060413, prop.ToString()); // faster casting ~1_val~
if ((prop = m_AosAttributes.SpellDamage) != 0)
if ((prop = m_AosAttributes.SpellDamage) != 0)
list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~%
if ((prop = m_AosAttributes.LowerManaCost) != 0)
if ((prop = m_AosAttributes.LowerManaCost) != 0)
list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~%
if ((prop = m_AosAttributes.LowerRegCost) != 0)
list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~%
if (Core.ML && (prop = m_AosAttributes.IncreasedKarmaLoss) != 0)
if (Core.ML && (prop = m_AosAttributes.IncreasedKarmaLoss) != 0)
list.Add(1075210, prop.ToString()); // Increased Karma Loss ~1val~%
AddResistanceProperties(list);
if ((prop = m_AosArmorAttributes.MageArmor) != 0)
if ((prop = m_AosArmorAttributes.MageArmor) != 0)
list.Add(1060437); // mage armor
if ((prop = GetLowerStatReq()) != 0)
if ((prop = GetLowerStatReq()) != 0)
list.Add(1060435, prop.ToString()); // lower requirements ~1_val~%
if ((prop = ComputeStatReq(StatType.Str)) > 0)
list.Add(1061170, prop.ToString()); // strength requirement ~1_val~
@@ -3122,15 +3134,15 @@ namespace Server.Items
#region Mondain's Legacy
if (!Core.ML || !craftItem.ForceNonExceptional)
{
if (typeRes == null)
typeRes = craftItem.Resources.GetAt(0).ItemType;
if (typeRes == null)
typeRes = craftItem.Resources.GetAt(0).ItemType;
Resource = CraftResources.GetFromType(typeRes);
Resource = CraftResources.GetFromType(typeRes);
}
#endregion
if (typeRes == null || craftItem.ForceNonExceptional)
typeRes = craftItem.Resources.GetAt(0).ItemType;
typeRes = craftItem.Resources.GetAt(0).ItemType;
PlayerConstructed = true;
@@ -3239,7 +3251,7 @@ namespace Server.Items
}
info = GetResourceAttrs(m_Resource);
// add new bonus
m_PhysicalBonus += info.ArmorPhysicalResist;
m_FireBonus += info.ArmorFireResist;
@@ -1,5 +1,7 @@
using System;
using Server.Network;
using Server.Engines.XmlSpawner2;
namespace Server.Items
{
@@ -69,6 +71,16 @@ namespace Server.Items
public override void AddNameProperties(ObjectPropertyList list)
{
base.AddNameProperties(list);
// ===============================================
// DURABILITY TOOLTIP: TEMPERED / REPAIR LOCKED
// ===============================================
var dura = XmlAttach.FindAttachment(this, typeof(Server.Custom.DurabilityAttachment))
as Server.Custom.DurabilityAttachment;
if (dura != null && dura.RepairLocked)
{
list.Add("Tempered — Cannot be repaired");
}
if (Core.EJ && LastParryChance > 0)
{
@@ -5,6 +5,8 @@ using Server.Engines.Craft;
using Server.Factions;
using Server.Network;
using Server.Mobiles;
using Server.Engines.XmlSpawner2;
namespace Server.Items
{
@@ -78,7 +80,7 @@ namespace Server.Items
public virtual bool CanFortify { get { return !IsImbued && NegativeAttributes.Antique < 4; } }
public virtual bool CanRepair { get { return m_NegativeAttributes.NoRepair == 0; } }
public virtual bool CanAlter { get { return true; } }
public virtual bool CanAlter { get { return true; } }
private int m_MaxHitPoints;
private int m_HitPoints;
@@ -126,7 +128,7 @@ namespace Server.Items
public int HitPoints
{
get { return m_HitPoints; }
set
set
{
if (value != m_HitPoints && MaxHitPoints > 0)
{
@@ -362,10 +364,10 @@ namespace Server.Items
public AosArmorAttributes ClothingAttributes { get { return m_AosClothingAttributes; } set { } }
[CommandProperty(AccessLevel.GameMaster)]
public AosSkillBonuses SkillBonuses { get { return m_AosSkillBonuses; } set { } }
public AosSkillBonuses SkillBonuses { get { return m_AosSkillBonuses; } set { } }
[CommandProperty(AccessLevel.GameMaster)]
public AosElementAttributes Resistances { get { return m_AosResistances; } set { } }
public AosElementAttributes Resistances { get { return m_AosResistances; } set { } }
[CommandProperty(AccessLevel.GameMaster)]
public SAAbsorptionAttributes SAAbsorptionAttributes { get { return m_SAAbsorptionAttributes; } set { } }
@@ -381,7 +383,7 @@ namespace Server.Items
public virtual int BaseColdResistance { get { return 0; } }
public virtual int BasePoisonResistance { get { return 0; } }
public virtual int BaseEnergyResistance { get { return 0; } }
#region Mondain's Legacy Sets
public override int PhysicalResistance
{
@@ -779,7 +781,7 @@ namespace Server.Items
damageTaken -= Absorbed;
if (damageTaken < 0)
if (damageTaken < 0)
damageTaken = 0;
double chance = NegativeAttributes.Antique > 0 ? 80 : 25;
@@ -955,7 +957,7 @@ namespace Server.Items
{
int oreType;
switch ( m_Resource )
switch (m_Resource)
{
case CraftResource.DullCopper:
oreType = 1053108;
@@ -1071,6 +1073,16 @@ namespace Server.Items
public override void AddNameProperties(ObjectPropertyList list)
{
base.AddNameProperties(list);
// ===============================================
// DURABILITY TOOLTIP: TEMPERED / REPAIR LOCKED
// ===============================================
var dura = XmlAttach.FindAttachment(this, typeof(Server.Custom.DurabilityAttachment))
as Server.Custom.DurabilityAttachment;
if (dura != null && dura.RepairLocked)
{
list.Add("Tempered — Cannot be repaired");
}
#region Factions
FactionEquipment.AddFactionProperties(this, list);
@@ -1078,7 +1090,7 @@ namespace Server.Items
if (m_GorgonLenseCharges > 0)
list.Add(1112590, m_GorgonLenseCharges.ToString()); //Gorgon Lens Charges: ~1_val~
#region Mondain's Legacy Sets
if (IsSetItem)
{
@@ -1122,8 +1134,8 @@ namespace Server.Items
if ((prop = ArtifactRarity) > 0)
list.Add(1061078, prop.ToString()); // artifact rarity ~1_val~
#region SA
#region SA
if ((prop = m_SAAbsorptionAttributes.EaterFire) != 0)
list.Add(1113593, prop.ToString()); // Fire Eater ~1_Val~%
@@ -1156,8 +1168,8 @@ namespace Server.Items
if ((prop = m_SAAbsorptionAttributes.ResonanceKinetic) != 0)
list.Add(1113695, prop.ToString()); // Kinetic Resonance ~1_val~%
if ((prop = m_SAAbsorptionAttributes.CastingFocus) != 0)
if ((prop = m_SAAbsorptionAttributes.CastingFocus) != 0)
list.Add(1113696, prop.ToString()); // Casting Focus ~1_val~%
#endregion
@@ -1208,91 +1220,91 @@ namespace Server.Items
if ((prop = m_AosAttributes.SpellChanneling) != 0)
list.Add(1060482); // spell channeling
if ((prop = m_AosClothingAttributes.SelfRepair) != 0)
if ((prop = m_AosClothingAttributes.SelfRepair) != 0)
list.Add(1060450, prop.ToString()); // self repair ~1_val~
if ((prop = m_AosAttributes.NightSight) != 0)
if ((prop = m_AosAttributes.NightSight) != 0)
list.Add(1060441); // night sight
if ((prop = m_AosAttributes.BonusStr) != 0)
list.Add(1060485, prop.ToString()); // strength bonus ~1_val~
if ((prop = m_AosAttributes.BonusDex) != 0)
if ((prop = m_AosAttributes.BonusDex) != 0)
list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~
if ((prop = m_AosAttributes.BonusInt) != 0)
if ((prop = m_AosAttributes.BonusInt) != 0)
list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~
if ((prop = m_AosAttributes.BonusHits) != 0)
if ((prop = m_AosAttributes.BonusHits) != 0)
list.Add(1060431, prop.ToString()); // hit point increase ~1_val~
if ((prop = m_AosAttributes.BonusStam) != 0)
if ((prop = m_AosAttributes.BonusStam) != 0)
list.Add(1060484, prop.ToString()); // stamina increase ~1_val~
if ((prop = m_AosAttributes.BonusMana) != 0)
if ((prop = m_AosAttributes.BonusMana) != 0)
list.Add(1060439, prop.ToString()); // mana increase ~1_val~
if ((prop = m_AosAttributes.RegenHits) != 0)
list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~
if ((prop = m_AosAttributes.RegenStam) != 0)
if ((prop = m_AosAttributes.RegenStam) != 0)
list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~
if ((prop = m_AosAttributes.RegenMana) != 0)
if ((prop = m_AosAttributes.RegenMana) != 0)
list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~
if ((prop = m_AosAttributes.Luck) != 0)
if ((prop = m_AosAttributes.Luck) != 0)
list.Add(1060436, prop.ToString()); // luck ~1_val~
if ((prop = m_AosAttributes.EnhancePotions) != 0)
if ((prop = m_AosAttributes.EnhancePotions) != 0)
list.Add(1060411, prop.ToString()); // enhance potions ~1_val~%
if ((prop = m_AosAttributes.ReflectPhysical) != 0)
if ((prop = m_AosAttributes.ReflectPhysical) != 0)
list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~%
if ((prop = m_AosAttributes.AttackChance) != 0)
if ((prop = m_AosAttributes.AttackChance) != 0)
list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~%
if ((prop = m_AosAttributes.WeaponSpeed) != 0)
list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~%
if ((prop = m_AosAttributes.WeaponDamage) != 0)
if ((prop = m_AosAttributes.WeaponDamage) != 0)
list.Add(1060401, prop.ToString()); // damage increase ~1_val~%
if ((prop = m_AosAttributes.DefendChance) != 0)
if ((prop = m_AosAttributes.DefendChance) != 0)
list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~%
if ((prop = m_AosAttributes.CastRecovery) != 0)
if ((prop = m_AosAttributes.CastRecovery) != 0)
list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~
if ((prop = m_AosAttributes.CastSpeed) != 0)
if ((prop = m_AosAttributes.CastSpeed) != 0)
list.Add(1060413, prop.ToString()); // faster casting ~1_val~
if ((prop = m_AosAttributes.SpellDamage) != 0)
if ((prop = m_AosAttributes.SpellDamage) != 0)
list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~%
if ((prop = m_AosAttributes.LowerManaCost) != 0)
if ((prop = m_AosAttributes.LowerManaCost) != 0)
list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~%
if ((prop = m_AosAttributes.LowerRegCost) != 0)
list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~%
if ((prop = m_AosAttributes.LowerAmmoCost) != 0)
list.Add(1075208, prop.ToString()); // Lower Ammo Cost ~1_Percentage~%
list.Add(1075208, prop.ToString()); // Lower Ammo Cost ~1_Percentage~%
if (Core.ML && (prop = m_AosAttributes.IncreasedKarmaLoss) != 0)
list.Add(1075210, prop.ToString()); // Increased Karma Loss ~1val~%
base.AddResistanceProperties(list);
if ((prop = m_AosClothingAttributes.MageArmor) != 0)
if ((prop = m_AosClothingAttributes.MageArmor) != 0)
list.Add(1060437); // mage armor
if ((prop = m_AosClothingAttributes.LowerStatReq) != 0)
if ((prop = m_AosClothingAttributes.LowerStatReq) != 0)
list.Add(1060435, prop.ToString()); // lower requirements ~1_val~%
if ((prop = ComputeStatReq(StatType.Str)) > 0)
if ((prop = ComputeStatReq(StatType.Str)) > 0)
list.Add(1061170, prop.ToString()); // strength requirement ~1_val~
if ((prop = m_AosClothingAttributes.DurabilityBonus) > 0)
@@ -1402,7 +1414,7 @@ namespace Server.Items
Crafter = 0x00000100,
Quality = 0x00000200,
StrReq = 0x00000400,
NegativeAttributes = 0x00000800,
NegativeAttributes = 0x00000800,
#region Imbuing
//TimesImbued = 0x12000000,
#endregion
@@ -1614,7 +1626,7 @@ namespace Server.Items
int version = reader.ReadInt();
switch ( version )
switch (version)
{
case 12:
case 11:
@@ -1633,10 +1645,10 @@ namespace Server.Items
goto case 8;
}
case 8:
{
m_IsImbued = reader.ReadBool();
goto case 7;
}
{
m_IsImbued = reader.ReadBool();
goto case 7;
}
case 7:
{
m_SAAbsorptionAttributes = new SAAbsorptionAttributes(this, reader);
@@ -1668,11 +1680,11 @@ namespace Server.Items
}
case 6:
{
if(version == 6)
if (version == 6)
m_SAAbsorptionAttributes = new SAAbsorptionAttributes(this);
m_TimesImbued = reader.ReadInt();
#endregion
m_BlessedBy = reader.ReadMobile();
@@ -1933,7 +1945,7 @@ namespace Server.Items
{
for (int i = 0; i < amount; ++i)
{
switch ( Utility.Random(5) )
switch (Utility.Random(5))
{
case 0: ++m_AosResistances.Physical; break;
case 1: ++m_AosResistances.Fire; break;
File diff suppressed because it is too large Load Diff
+10 -3
View File
@@ -119,7 +119,7 @@ namespace Server.Items
{
m_BagOfSendingHue = value;
switch ( value )
switch (value)
{
case BagOfSendingHue.Yellow:
Hue = 0x8A5;
@@ -135,7 +135,7 @@ namespace Server.Items
}
public static BagOfSendingHue RandomHue()
{
switch ( Utility.Random(3) )
switch (Utility.Random(3))
{
case 0:
return BagOfSendingHue.Yellow;
@@ -206,7 +206,7 @@ namespace Server.Items
int version = reader.ReadEncodedInt();
switch ( version )
switch (version)
{
case 1:
{
@@ -260,6 +260,13 @@ namespace Server.Items
if (m_Bag.Deleted)
return;
// Block usage anywhere in Felucca
if (from.Map == Map.Felucca)
{
from.SendMessage("A mysterious force prevents the bag from working in Felucca.");
return;
}
if (from.Region.IsPartOf<Regions.Jail>())
{
from.SendMessage("You may not do that in jail.");
+318
View File
@@ -0,0 +1,318 @@
using System;
using System.Collections.Generic;
using Server.ContextMenus;
using Server.Network;
using Server.Targeting;
namespace Server.Items
{
public enum BagOfSendingHue
{
Yellow,
Blue,
Red
}
public class BagOfSending : Item, TranslocationItem
{
private int m_Charges;
private int m_Recharges;
private BagOfSendingHue m_BagOfSendingHue;
[Constructable]
public BagOfSending()
: this(RandomHue())
{
}
[Constructable]
public BagOfSending(BagOfSendingHue hue)
: base(0xE76)
{
Weight = 2.0;
BagOfSendingHue = hue;
m_Charges = Utility.RandomMinMax(3, 9);
}
public BagOfSending(Serial serial)
: base(serial)
{
}
[CommandProperty(AccessLevel.GameMaster)]
public int Charges
{
get
{
return m_Charges;
}
set
{
if (value > MaxCharges)
m_Charges = MaxCharges;
else if (value < 0)
m_Charges = 0;
else
m_Charges = value;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int Recharges
{
get
{
return m_Recharges;
}
set
{
if (value > MaxRecharges)
m_Recharges = MaxRecharges;
else if (value < 0)
m_Recharges = 0;
else
m_Recharges = value;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int MaxCharges
{
get
{
return 30;
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int MaxRecharges
{
get
{
return 255;
}
}
public string TranslocationItemName
{
get
{
return "bag of sending";
}
}
public override int LabelNumber
{
get
{
return 1054104;
}
}// a bag of sending
[CommandProperty(AccessLevel.GameMaster)]
public BagOfSendingHue BagOfSendingHue
{
get
{
return m_BagOfSendingHue;
}
set
{
m_BagOfSendingHue = value;
switch ( value )
{
case BagOfSendingHue.Yellow:
Hue = 0x8A5;
break;
case BagOfSendingHue.Blue:
Hue = 0x8AD;
break;
case BagOfSendingHue.Red:
Hue = 0x89B;
break;
}
}
}
public static BagOfSendingHue RandomHue()
{
switch ( Utility.Random(3) )
{
case 0:
return BagOfSendingHue.Yellow;
case 1:
return BagOfSendingHue.Blue;
default:
return BagOfSendingHue.Red;
}
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
list.Add(1060741, m_Charges.ToString()); // charges: ~1_val~
}
public override void OnSingleClick(Mobile from)
{
base.OnSingleClick(from);
LabelTo(from, 1060741, m_Charges.ToString()); // charges: ~1_val~
}
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
{
base.GetContextMenuEntries(from, list);
if (from.Alive)
list.Add(new UseBagEntry(this, Charges > 0 && IsChildOf(from.Backpack)));
}
public override void OnDoubleClick(Mobile from)
{
if (from.Region.IsPartOf<Regions.Jail>())
{
from.SendMessage("You may not do that in jail.");
}
else if (!IsChildOf(from.Backpack))
{
MessageHelper.SendLocalizedMessageTo(this, from, 1062334, 0x59); // The bag of sending must be in your backpack.
}
else if (Charges == 0)
{
MessageHelper.SendLocalizedMessageTo(this, from, 1042544, 0x59); // This item is out of charges.
}
else
{
from.Target = new SendTarget(this);
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)1); // version
writer.WriteEncodedInt((int)m_Recharges);
writer.WriteEncodedInt((int)m_Charges);
writer.WriteEncodedInt((int)m_BagOfSendingHue);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
switch ( version )
{
case 1:
{
m_Recharges = reader.ReadEncodedInt();
goto case 0;
}
case 0:
{
m_Charges = Math.Min(reader.ReadEncodedInt(), MaxCharges);
m_BagOfSendingHue = (BagOfSendingHue)reader.ReadEncodedInt();
break;
}
}
}
private class UseBagEntry : ContextMenuEntry
{
private readonly BagOfSending m_Bag;
public UseBagEntry(BagOfSending bag, bool enabled)
: base(6189)
{
m_Bag = bag;
if (!enabled)
Flags |= CMEFlags.Disabled;
}
public override void OnClick()
{
if (m_Bag.Deleted)
return;
Mobile from = Owner.From;
if (from.CheckAlive())
m_Bag.OnDoubleClick(from);
}
}
private class SendTarget : Target
{
private readonly BagOfSending m_Bag;
public SendTarget(BagOfSending bag)
: base(-1, false, TargetFlags.None)
{
m_Bag = bag;
}
protected override void OnTarget(Mobile from, object targeted)
{
if (m_Bag.Deleted)
return;
if (from.Region.IsPartOf<Regions.Jail>())
{
from.SendMessage("You may not do that in jail.");
}
else if (!m_Bag.IsChildOf(from.Backpack))
{
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1062334, 0x59); // The bag of sending must be in your backpack. 1054107 is gone from client, using generic response
}
else if (m_Bag.Charges == 0)
{
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1042544, 0x59); // This item is out of charges.
}
else if (targeted is Item)
{
Item item = (Item)targeted;
int reqCharges = 1; // (int)Math.Max(1, Math.Ceiling(item.TotalWeight / 10.0));
// change was ML, however reverted during ML period so we can put it at 1
if (!item.IsChildOf(from.Backpack))
{
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054152, 0x59); // You may only send items from your backpack to your bank box.
}
else if (item is BagOfSending || item is Container)
{
from.Send(new AsciiMessage(m_Bag.Serial, m_Bag.ItemID, MessageType.Regular, 0x3B2, 3, "", "You cannot send a container through the bag of sending."));
}
else if (item.LootType == LootType.Cursed)
{
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054108, 0x59); // The bag of sending rejects the cursed item.
}
else if (!item.VerifyMove(from) || item is Server.Engines.Quests.QuestItem || item.QuestItem)
{
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054109, 0x59); // The bag of sending rejects that item.
}
else if (Spells.SpellHelper.IsDoomGauntlet(from.Map, from.Location))
{
from.SendLocalizedMessage(1062089); // You cannot use that here.
}
else if (!from.BankBox.TryDropItem(from, item, false))
{
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054110, 0x59); // Your bank box is full.
}
else if (Core.ML && reqCharges > m_Bag.Charges)
{
from.SendLocalizedMessage(1079932); //You don't have enough charges to send that much weight
}
else
{
m_Bag.Charges -= (Core.ML ? reqCharges : 1);
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054150, 0x59); // The item was placed in your bank box.
}
}
}
}
}
}
+10
View File
@@ -192,6 +192,16 @@ namespace Server
totalDamage += (int)((double)totalDamage * .1);
}
if (Core.HS && type == DamageType.Spell)
{
if (from?.FindItemOnLayer(Layer.MiddleTorso) is SpellFocusingSash spellSash)
{
spellSash.ValidateTarget(from, m, out var sdiOffset);
totalDamage += Scale(totalDamage, sdiOffset);
}
}
if (totalDamage < 1)
totalDamage = 1;
}
+3 -3
View File
@@ -139,7 +139,7 @@ namespace Server.Misc
return;
}
var ns = states.Find(o => o.Account != null && o.Mobile != null && Insensitive.StartsWith(sub, o.Mobile.RawName));
var ns = states.FirstOrDefault(o => o.Account != null && o.Mobile != null && Insensitive.StartsWith(sub, o.Mobile.RawName));
if (ns != null)
{
@@ -163,7 +163,7 @@ namespace Server.Misc
return;
}
var ns = states.Find(o => o.Account != null && o.Mobile != null && Insensitive.StartsWith(sub, o.Mobile.RawName));
var ns = states.FirstOrDefault(o => o.Account != null && o.Mobile != null && Insensitive.StartsWith(sub, o.Mobile.RawName));
if (ns != null)
{
@@ -523,4 +523,4 @@ namespace Server.Misc
World.Broadcast(hue, false, ac, message);
}
}
}
}
+1 -1
View File
@@ -212,7 +212,7 @@ namespace Server.Misc
try
{
List<NetState> states = NetState.Instances;
IList<NetState> states = NetState.Instances;
op.WriteLine("- Count: {0}", states.Count);
+1 -1
View File
@@ -43,7 +43,7 @@ namespace Server
PacketHandlers.SingleClickProps = true; // single click for everything is overriden to check object property list
}
Mobile.ActionDelay = Core.TOL ? 500 : Core.AOS ? 750 : 500;
Mobile.ActionDelay = Core.TOL ? 500 : Core.AOS ? 1000 : 500;
Mobile.AOSStatusHandler = AOS.GetStatus;
}
}
+7 -10
View File
@@ -125,8 +125,6 @@ namespace Server
}
}
public static readonly LootPackItem[] HeritageSovereign = new[] {new LootPackItem(typeof(HeritageSovereign), 1)};
public static readonly LootPackItem[] Gold = new[] {new LootPackItem(typeof(Gold), 1)};
public static readonly LootPackItem[] Instruments = new[] {new LootPackItem(typeof(BaseInstrument), 1)};
@@ -340,7 +338,7 @@ namespace Server
new[]
{
new LootPackEntry(true, Gold, 100.00, "1d10+10"), new LootPackEntry(false, AosMagicItemsPoor, 0.02, 1, 5, 0, 90),
new LootPackEntry(false, Instruments, 0.02, 1), new LootPackEntry(true, HeritageSovereign, 1, "1d10+1")
new LootPackEntry(false, Instruments, 0.02, 1)
});
public static readonly LootPack AosMeager =
@@ -350,7 +348,7 @@ namespace Server
new LootPackEntry(true, Gold, 100.00, "3d10+20"),
new LootPackEntry(false, AosMagicItemsMeagerType1, 1.00, 1, 2, 0, 10),
new LootPackEntry(false, AosMagicItemsMeagerType2, 0.20, 1, 5, 0, 90),
new LootPackEntry(false, Instruments, 0.10, 1), new LootPackEntry(true, HeritageSovereign, 1, "1d10+5")
new LootPackEntry(false, Instruments, 0.10, 1)
});
public static readonly LootPack AosAverage =
@@ -361,7 +359,7 @@ namespace Server
new LootPackEntry(false, AosMagicItemsAverageType1, 5.00, 1, 4, 0, 20),
new LootPackEntry(false, AosMagicItemsAverageType1, 2.00, 1, 3, 0, 50),
new LootPackEntry(false, AosMagicItemsAverageType2, 0.50, 1, 5, 0, 90),
new LootPackEntry(false, Instruments, 0.40, 1), new LootPackEntry(true, HeritageSovereign, 1, "1d10+10")
new LootPackEntry(false, Instruments, 0.40, 1)
});
public static readonly LootPack AosRich =
@@ -371,8 +369,7 @@ namespace Server
new LootPackEntry(true, Gold, 100.00, "10d10+150"),
new LootPackEntry(false, AosMagicItemsRichType1, 20.00, 1, 4, 0, 40),
new LootPackEntry(false, AosMagicItemsRichType1, 10.00, 1, 5, 0, 60),
new LootPackEntry(false, AosMagicItemsRichType2, 1.00, 1, 5, 0, 90), new LootPackEntry(false, Instruments, 1.00, 1),
new LootPackEntry(true, HeritageSovereign, 10, "1d10+1")
new LootPackEntry(false, AosMagicItemsRichType2, 1.00, 1, 5, 0, 90), new LootPackEntry(false, Instruments, 1.00, 1)
});
public static readonly LootPack AosFilthyRich =
@@ -384,7 +381,7 @@ namespace Server
new LootPackEntry(false, AosMagicItemsFilthyRichType1, 33.00, 1, 4, 0, 60),
new LootPackEntry(false, AosMagicItemsFilthyRichType2, 20.00, 1, 5, 0, 75),
new LootPackEntry(false, AosMagicItemsFilthyRichType2, 5.00, 1, 5, 0, 100),
new LootPackEntry(false, Instruments, 2.00, 1), new LootPackEntry(true, HeritageSovereign, 10, "1d10+5")
new LootPackEntry(false, Instruments, 2.00, 1)
});
public static readonly LootPack AosUltraRich =
@@ -398,7 +395,7 @@ namespace Server
new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 25, 100),
new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 25, 100),
new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 35, 100),
new LootPackEntry(false, Instruments, 2.00, 1), new LootPackEntry(true, HeritageSovereign, 10, "1d10+10")
new LootPackEntry(false, Instruments, 2.00, 1)
});
public static readonly LootPack AosSuperBoss =
@@ -416,7 +413,7 @@ namespace Server
new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 33, 100),
new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 50, 100),
new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 50, 100),
new LootPackEntry(false, Instruments, 2.00, 1), new LootPackEntry(true, HeritageSovereign, 20, "1d10+10")
new LootPackEntry(false, Instruments, 2.00, 1)
});
#endregion
+15 -180
View File
@@ -7,64 +7,20 @@ using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Text.RegularExpressions;
using System.Threading;
using Server.Network;
#endregion
namespace Server.Misc
{
public class ServerList
{
/*
* The default setting for Address, a value of 'null', will use your local IP address. If all of your local IP addresses
* are private network addresses and AutoDetect is 'true' then ServUO will attempt to discover your public IP address
* for you automatically.
*
* If you do not plan on allowing clients outside of your LAN to connect, you can set AutoDetect to 'false' and leave
* Address set to 'null'.
*
* If your public IP address cannot be determined, you must change the value of Address to your public IP address
* manually to allow clients outside of your LAN to connect to your server. Address can be either an IP address or
* a hostname that will be resolved when ServUO starts.
*
* If you want players outside your LAN to be able to connect to your server and you are behind a router, you must also
* forward TCP port 2593 to your private IP address. The procedure for doing this varies by manufacturer but generally
* involves configuration of the router through your web browser.
*
* ServerList will direct connecting clients depending on both the address they are connecting from and the address and
* port they are connecting to. If it is determined that both ends of a connection are private IP addresses, ServerList
* will direct the client to the local private IP address. If a client is connecting to a local public IP address, they
* will be directed to whichever address and port they initially connected to. This allows multihomed servers to function
* properly and fully supports listening on multiple ports. If a client with a public IP address is connecting to a
* locally private address, the server will direct the client to either the AutoDetected IP address or the manually entered
* IP address or hostname, whichever is applicable. Loopback clients will be directed to loopback.
*
* If you would like to listen on additional ports (i.e. 22, 23, 80, for clients behind highly restrictive egress
* firewalls) or specific IP adddresses you can do so by modifying the file SocketOptions.cs found in this directory.
*/
{
public static string ServerName = Config.Get("Server.Name", "My Shard");
public static readonly string Address = Config.Get("Server.Address", default(string));
public static readonly bool AutoDetect = Config.Get("Server.AutoDetect", true);
public static string ServerName = Config.Get("Server.Name", "My Shard");
private static IPAddress _PublicAddress;
private static readonly Regex _AddressPattern = new Regex(@"([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})");
public static void Initialize()
{
if (Address == null)
{
if (AutoDetect)
{
AutoDetection();
}
}
else
{
Resolve(Address, out _PublicAddress);
}
public static IPAddress Address => Config.Get("Server.Address", IPAddress.Loopback);
public static void Initialize()
{
EventSink.ServerList += EventSink_ServerList;
}
@@ -80,15 +36,15 @@ namespace Server.Misc
var localAddress = ipep.Address;
var localPort = ipep.Port;
if (IsPrivateNetwork(localAddress))
{
ipep = (IPEndPoint)s.RemoteEndPoint;
if (!IPAddress.IsLoopback(localAddress) && IsPrivateNetwork(localAddress))
{
ipep = (IPEndPoint)s.RemoteEndPoint;
if (!IsPrivateNetwork(ipep.Address) && _PublicAddress != null)
{
localAddress = _PublicAddress;
}
}
if (!IsPrivateNetwork(ipep.Address))
{
localAddress = Address;
}
}
e.AddServer(ServerName, new IPEndPoint(localAddress, localPort));
}
@@ -98,67 +54,6 @@ namespace Server.Misc
}
}
public static string[] IPServices =
{
"http://services.servuo.com/ip.php", "http://api.ipify.org",
"http://checkip.dyndns.org/"
};
private static void AutoDetection()
{
if (!HasPublicIPAddress())
{
Utility.PushColor(ConsoleColor.Yellow);
Console.WriteLine("ServerList: Auto-detecting public IP address...");
_PublicAddress = FindPublicAddress(IPServices);
if (_PublicAddress != null)
{
Console.WriteLine("ServerList: Done: '{0}'", _PublicAddress);
}
else
{
_PublicAddress = IPAddress.Any;
Console.WriteLine("ServerList: Failed: reverting to private IP address...");
}
Utility.PopColor();
}
}
private static void Resolve(string addr, out IPAddress outValue)
{
if (IPAddress.TryParse(addr, out outValue))
{
return;
}
try
{
var iphe = Dns.GetHostEntry(addr);
if (iphe.AddressList.Length > 0)
{
outValue = iphe.AddressList[iphe.AddressList.Length - 1];
}
}
catch
{ }
}
private static bool HasPublicIPAddress()
{
var adapters = NetworkInterface.GetAllNetworkInterfaces();
var uips = adapters.Select(a => a.GetIPProperties())
.SelectMany(p => p.UnicastAddresses.Cast<IPAddressInformation>(), (p, u) => u.Address);
return
uips.Any(
ip => !IPAddress.IsLoopback(ip) && ip.AddressFamily != AddressFamily.InterNetworkV6 && !IsPrivateNetwork(ip));
}
private static bool IsPrivateNetwork(IPAddress ip)
{
// 10.0.0.0/8
@@ -199,65 +94,5 @@ namespace Server.Misc
return false;
}
public static IPAddress FindPublicAddress(params string[] services)
{
if (services == null || services.Length == 0)
{
services = IPServices;
}
if (services == null || services.Length == 0)
{
return null;
}
IPAddress ip = null;
Uri uri;
string data;
Match match;
foreach (var service in services.Where(s => !String.IsNullOrWhiteSpace(s)))
{
try
{
uri = new Uri(service);
Console.WriteLine("ServerList: >>> {0}", uri.Host);
using (var client = new WebClient())
{
data = client.DownloadString(uri);
}
Console.WriteLine("ServerList: <<< {0}", data);
match = _AddressPattern.Match(data);
if (!match.Success || !IPAddress.TryParse(match.Value, out ip))
{
ip = null;
}
}
catch (UriFormatException)
{
Console.WriteLine("ServerList: Invalid IP service Uri '{0}'", service);
ip = null;
}
catch
{
ip = null;
}
if (ip != null)
{
break;
}
}
return ip;
}
}
}
+1 -1
View File
@@ -25,7 +25,7 @@ namespace System
{
get
{
return String.Format("{0:D2}:{1:D2}:{2:D2} ", DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
return String.Format("{0:D2}:{1:D2}:{2:D2} ", DateTime.UtcNow.Hour, DateTime.UtcNow.Minute, DateTime.UtcNow.Second);
}
}
public static void Initialize()
+2 -2
View File
@@ -381,7 +381,7 @@ namespace Server.Misc
else
type = 2;
List<NetState> states = NetState.Instances;
IList<NetState> states = NetState.Instances;
Packet weatherPacket = null;
@@ -471,4 +471,4 @@ namespace Server.Misc
int version = reader.ReadInt();
}
}
}
}
+1 -1
View File
@@ -284,7 +284,7 @@ namespace Server.Mobiles
int level;
double random = Utility.RandomDouble();
if (0.2 >= random)
if (0.05 >= random)
level = 20;
else if (0.4 >= random)
level = 15;
+15 -13
View File
@@ -1282,7 +1282,7 @@ namespace Server.Mobiles
{
mount.Rider = from;
}
},
},
(EtherealMount)from.Mount);
}
@@ -2373,10 +2373,12 @@ namespace Server.Mobiles
}
}
}
else if (Siege.SiegeShard)
/* else if (Siege.SiegeShard)
{
list.Add(new CallbackEntry(3006168, SiegeBlessItem));
}
} */
list.Add(new CallbackEntry(3006168, SiegeBlessItem));
if (Core.ML && Alive)
{
@@ -2408,7 +2410,7 @@ namespace Server.Mobiles
if (Core.HS)
{
list.Add(new CallbackEntry(RefuseTrades ? 1154112 : 1154113, ToggleTrades)); // Allow Trades / Refuse Trades
list.Add(new CallbackEntry(RefuseTrades ? 1154112 : 1154113, ToggleTrades)); // Allow Trades / Refuse Trades
}
if (m_JusticeProtectors.Count > 0)
@@ -3350,7 +3352,7 @@ namespace Server.Mobiles
}
else if (to.Backpack == null || !to.Backpack.CheckHold(to, item, false, checkItems, plusItems, plusWeight))
{
msgNum = 1004039; // The recipient of this trade would not be able to carry
msgNum = 1004039; // The recipient of this trade would not be able to carry
}
else
{
@@ -3520,7 +3522,7 @@ namespace Server.Mobiles
}
BaseGump.CheckCloseGumps(this);
DesignContext context = m_DesignContext;
if (context == null || m_NoRecursion)
@@ -4013,7 +4015,7 @@ namespace Server.Mobiles
Faction.HandleDeath(this, killer);
Guilds.Guild.HandleDeath(this, killer);
if (m_BuffTable != null)
{
var list = new List<BuffInfo>();
@@ -4397,7 +4399,7 @@ namespace Server.Mobiles
public override int Luck { get { return AosAttributes.GetValue(this, AosAttribute.Luck) + TenthAnniversarySculpture.GetLuckBonus(this); } }
public int RealLuck
{
{
get
{
int facetBonus = !Siege.SiegeShard && this.Map == Map.Felucca ? RandomItemGenerator.FeluccaLuckBonus : 0;
@@ -4977,7 +4979,7 @@ namespace Server.Mobiles
writer.Write((int)m_ExtendedFlags);
writer.Write(RewardStableSlots);
if (_BlessedItem != null && _BlessedItem.RootParent != this)
{
_BlessedItem = null;
@@ -5513,7 +5515,7 @@ namespace Server.Mobiles
#region Factions
public PlayerState FactionPlayerState { get; set; }
#endregion
#region Quests
private QuestSystem m_Quest;
private List<QuestRestartInfo> m_DoneQuests;
@@ -5632,7 +5634,7 @@ namespace Server.Mobiles
{
m_SelectedTitle = num;
if (!silent)
if (!silent)
SendLocalizedMessage(1074010); // You elect to hide your Reward Title.
}
else if (num < m_RewardTitles.Count && num >= -1)
@@ -5746,7 +5748,7 @@ namespace Server.Mobiles
}
public override void AddNameProperties(ObjectPropertyList list)
{
{
string prefix = "";
if (ShowFameTitle && Fame >= 10000)
@@ -6989,4 +6991,4 @@ namespace Server.Mobiles
m_AutoStabled.Clear();
}
}
}
}
@@ -47,6 +47,10 @@ namespace Server.Items
case ChampionSkullType.Pain:
Hue = 0x035;
break;
//Soth Skull
case ChampionSkullType.Despair:
Hue = 0x455;
break;
}
}
@@ -10,6 +10,8 @@ namespace Server.Engines.CannedEvil
Venom,
Pain,
Greed,
Death
Death,
//Dupre Skull
Despair
}
}
@@ -467,7 +467,7 @@ namespace Server.Engines.CannedEvil
{
if (RandomizeType)
{
switch (Utility.Random(5))
switch (Utility.Random(6))
{
case 0:
Type = ChampionSpawnType.Abyss; break;
@@ -479,6 +479,7 @@ namespace Server.Engines.CannedEvil
Type = ChampionSpawnType.VerminHorde; break;
case 4:
Type = ChampionSpawnType.UnholyTerror; break;
}
}
@@ -20,7 +20,7 @@ namespace Server.Engines.CleanUpBritannia
Rewards.Add(new CollectionItem(typeof(WeArePiratesRobe), 0x1F03, 1151204, 0, 1000));
Rewards.Add(new CollectionItem(typeof(FollowerOfBaneRobe), 0x1F03, 1151205, 0, 1000));
Rewards.Add(new CollectionItem(typeof(QueenDawnForeverRobe), 0x1F03, 1151206, 0, 1000));
Rewards.Add(new CollectionItem(typeof(LillyPad), 0xDBC, 1023516, 0, 5000));
Rewards.Add(new CollectionItem(typeof(LillyPads), 0xDBE, 1023518, 0, 5000));
Rewards.Add(new CollectionItem(typeof(Mushrooms1), 0x0D0F, 1023340, 0, 5000));
@@ -96,7 +96,6 @@ namespace Server.Engines.CleanUpBritannia
Rewards.Add(new CollectionItem(typeof(DragonHeadAddonDeed), 0x2234, 1028756, 0, 50000));
Rewards.Add(new CollectionItem(typeof(NestWithEggs), 0x1AD4, 1026868, 2415, 50000));
if (Core.HS)
{
@@ -173,7 +172,6 @@ namespace Server.Engines.CleanUpBritannia
Rewards.Add(new CollectionItem(typeof(MysticsMemento), 0x2F5B, 1154744, 1912, 300000));
Rewards.Add(new CollectionItem(typeof(VollemHeldInCrystal), 0x1f19, 1113629, 1154, 500000));
Rewards.Add(new CollectionItem(typeof(ItemBlessDeed),0x14F0, 1006018, 0, 500000));
}
}
}
+16 -1
View File
@@ -3,6 +3,7 @@ using Server.Items;
using Server.Mobiles;
using Server.Targeting;
using Server.Factions;
using Server.Custom;
namespace Server.Engines.Craft
{
@@ -225,6 +226,20 @@ namespace Server.Engines.Craft
return;
}
// ===============================
// CUSTOM REPAIR LOCK ENFORCEMENT
// ===============================
Item it = targeted as Item;
if (it != null && it.GetRepairLocked())
{
from.SendMessage("This item has been fortified and cannot be repaired until it is restored.");
if (m_Addon != null)
m_Addon.Using = false;
return;
}
if (m_CraftSystem.CanCraft(from, m_Tool, targeted.GetType()) == 1044267)
{
@@ -638,7 +653,7 @@ namespace Server.Engines.Craft
if (toDelete)
m_Deed.Delete();
}
}
}
}
@@ -25,7 +25,7 @@ namespace Server
typeof(HelmOfSwiftness), typeof(PadsOfTheCuSidhe), typeof(QuiverOfRage), typeof(QuiverOfElements),
typeof(RaedsGlory), typeof(RighteousAnger), typeof(RobeOfTheEclipse), typeof(RobeOfTheEquinox),
typeof(SoulSeeker), typeof(TalonBite), typeof(TotemOfVoid), typeof(WildfireBow),
typeof(Windsong),typeof(UrcuchiallianRidingShoes)
typeof(Windsong)
};
// true - dungeon is enabled, false - dungeon is disabled
private static bool m_PalaceOfParoxysmus;
@@ -2236,9 +2236,9 @@ namespace Server.Mobiles
public bool SomeOneHasGumpOpen
{
get
{
// go through all online mobiles and see if any have xmlspawner gumps open
List<NetState> states = NetState.Instances;
{
// go through all online mobiles and see if any have xmlspawner gumps open
IList<NetState> states = NetState.Instances;
for (int i = 0; i < states.Count; ++i)
{
+38 -39
View File
@@ -159,12 +159,12 @@ namespace Server.Spells
{
return CheckMulti(p, map, true, 0);
}
public static bool CheckMulti(Point3D p, Map map, bool houses)
{
return CheckMulti(p, map, houses, 0);
}
public static bool CheckMulti(Point3D p, Map map, bool houses, int housingrange)
{
if (map == null || map == Map.Internal)
@@ -188,7 +188,7 @@ namespace Server.Spells
return true;
}
}
return false;
}
@@ -265,7 +265,7 @@ namespace Server.Spells
{
Type t = item.GetType();
if(t.IsDefined(typeof(DispellableFieldAttribute), false) || t.IsDefined(typeof(DispellableFieldAttribute), true))
if (t.IsDefined(typeof(DispellableFieldAttribute), false) || t.IsDefined(typeof(DispellableFieldAttribute), true))
{
eable.Free();
return false;
@@ -297,17 +297,17 @@ namespace Server.Spells
return true;
}
public static bool CanRevealCaster(Mobile m)
{
if (m is BaseCreature)
{
BaseCreature c = (BaseCreature)m;
if (!c.Controlled)
return true;
}
return false;
}
@@ -329,13 +329,13 @@ namespace Server.Spells
}
}
protected static void RemoveStatOffsetCallback(object state)
{
if (!(state is Mobile))
return;
// This call has the side-effect of updating all stats
((Mobile)state).CheckStatTimers();
}
protected static void RemoveStatOffsetCallback(object state)
{
if (!(state is Mobile))
return;
// This call has the side-effect of updating all stats
((Mobile)state).CheckStatTimers();
}
public static bool AddStatOffset(Mobile m, StatType type, int offset, TimeSpan duration)
{
@@ -365,7 +365,7 @@ namespace Server.Spells
}
target.AddStatMod(new StatMod(type, name, offset, duration));
Timer.DelayCall(duration, RemoveStatOffsetCallback, target);
Timer.DelayCall(duration, RemoveStatOffsetCallback, target);
return true;
}
@@ -401,13 +401,13 @@ namespace Server.Spells
StatMod mod = target.GetStatMod(name);
if (mod != null)
offset = Math.Max(mod.Offset, offset);
if (mod != null)
offset = Math.Max(mod.Offset, offset);
offset *= -1;
offset *= -1;
target.AddStatMod(new StatMod(type, name, offset, TimeSpan.Zero));
return true;
return true;
}
public static TimeSpan GetDuration(Mobile caster, Mobile target)
@@ -469,7 +469,7 @@ namespace Server.Spells
double percent = GetOffsetScalar(caster, target, curse);
switch( type )
switch (type)
{
case StatType.Str:
return (int)Math.Ceiling(target.RawStr * percent);
@@ -636,7 +636,7 @@ namespace Server.Spells
}
public static IEnumerable<IDamageable> AcquireIndirectTargets(Mobile caster, IPoint3D p, Map map, int range, bool losCheck)
{
{
if (map == null)
{
yield break;
@@ -825,13 +825,13 @@ namespace Server.Spells
private static readonly bool[,] m_Rules = new bool[,]
{
/*T2A(Fel), Khaldun, Ilshenar, Wind(Tram), Wind(Fel), Dungeons(Fel), Solen(Tram), Solen(Fel), CrystalCave(Malas), Gauntlet(Malas), Gauntlet(Ferry), SafeZone, Stronghold, ChampionSpawn, Dungeons(Tokuno[Malas]), LampRoom(Doom), GuardianRoom(Doom), Heartwood, MLDungeons, SA Dungeons Tomb of Kings Maze of Death SA Entrance, Eodon*/
/* Recall From */ { false, false, true, true, false, false, true, false, false, false, false, true, true, false, true, false, false, false, false, true, true, false, false, true} ,
/* Recall To */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Gate From */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Gate To */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Mark In */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Tele From */ { true, true, true, true, true, true, true, true, false, true, true, true, false, true, true, true, true, false, true, true, false, false, false, true },
/* Tele To */ { true, true, true, true, true, true, true, true, false, true, false, false, false, true, true, true, true, false, false, true, false, false, false, true },
/* Recall From */ { false, false, true, true, false, false, true, false, false, false, false, true, true, false, true, false, false, false, false, true, true, false, false, true} ,
/* Recall To */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Gate From */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Gate To */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Mark In */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Tele From */ { true, true, true, true, true, true, true, true, false, true, true, true, false, true, true, true, true, false, true, true, false, false, false, true },
/* Tele To */ { true, true, true, true, true, true, true, true, false, true, false, false, false, true, true, true, true, false, false, true, false, false, false, true },
};
public static void SendInvalidMessage(Mobile caster, TravelCheckType type)
@@ -866,7 +866,6 @@ namespace Server.Spells
return false;
}
if (caster != null)
{
if (caster.IsPlayer())
@@ -887,7 +886,7 @@ namespace Server.Spells
// Always allow monsters to teleport
if (caster is BaseCreature && (type == TravelCheckType.TeleportTo || type == TravelCheckType.TeleportFrom))
{
BaseCreature bc = (BaseCreature) caster;
BaseCreature bc = (BaseCreature)caster;
if (!bc.Controlled && !bc.Summoned)
return true;
@@ -926,7 +925,7 @@ namespace Server.Spells
if ((int)type <= 4 && (IsNewDungeon(caster.Map, caster.Location) || IsNewDungeon(map, loc)))
isValid = false;
#endregion
#region High Seas
@@ -1206,7 +1205,7 @@ namespace Server.Spells
if (map == null)
return false;
GuardedRegion reg = (GuardedRegion)Region.Find(loc, map).GetRegion(typeof(GuardedRegion));
return (reg != null && !reg.IsDisabled());
@@ -1475,7 +1474,7 @@ namespace Server.Spells
int damageGiven = AOS.Damage(damageable, from, iDamage, phys, fire, cold, pois, nrgy, chaos, direct, dtype);
if(target != null)
if (target != null)
Spells.Mysticism.SpellPlagueSpell.OnMobileDamaged(target);
if (target != null && target.DFA != DFAlgorithm.Standard)
@@ -1485,7 +1484,7 @@ namespace Server.Spells
NegativeAttributes.OnCombatAction(from);
if(from != target)
if (from != target)
NegativeAttributes.OnCombatAction(target);
}
else
@@ -1747,11 +1746,11 @@ namespace Server.Spells
caster.SendLocalizedMessage(1061091); // You cannot cast that spell in this form.
return false;
}
else if (caster.Flying && !(spell is VampiricEmbraceSpell))
{
caster.SendLocalizedMessage(1112567); // You are flying.
return false;
}
else if (caster.Flying && !(spell is VampiricEmbraceSpell))
{
caster.SendLocalizedMessage(1112567); // You are flying.
return false;
}
return true;
}