Overwrite

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

View File

@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.Text;
using Server;
using Server.Mobiles;
namespace Server.Items
{
public class BaseBalmOrLotion : BaseThieveConsumable, ICommodity
{
public BaseBalmOrLotion(int itemId) : base(itemId)
{
m_EffectDuration = TimeSpan.FromMinutes(30);
Weight = 1.0;
}
protected override void OnUse(PlayerMobile by)
{
if (m_EffectType == ThieveConsumableEffect.None)
{
by.SendMessage("This balm or lotion is corrupted. Please contact a game master");
return;
}
if (CanUse(by, this))
{
ApplyEffect(by);
}
else
{
by.SendLocalizedMessage(1095133);//You are already under the effect of a balm or lotion.
}
}
public BaseBalmOrLotion(Serial serial)
: base(serial)
{
}
TextDefinition ICommodity.Description { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,189 @@
using System;
using System.Collections.Generic;
using Server.Mobiles;
using System.Text;
using Server;
namespace Server.Items
{
public enum ThieveConsumableEffect
{
None,
BalmOfStrengthEffect,
BalmOfWisdomEffect,
BalmOfSwiftnessEffect,
BalmOfProtectionEffect,
StoneSkinLotionEffect,
LifeShieldLotionEffect,
}
public class ThieveConsumableInfo
{
public ThieveConsumableEffect Effect;
public Timer EffectTimer;
public ThieveConsumableInfo(BaseThieveConsumable.InternalTimer t, ThieveConsumableEffect e)
{
Effect = e;
EffectTimer = t;
}
}
public abstract class BaseThieveConsumable : Item
{
public BaseThieveConsumable(int itemId)
: base(itemId)
{
}
public class InternalTimer : Timer
{
public PlayerMobile pm;
public ThieveConsumableEffect effect;
protected override void OnTick()
{
BaseThieveConsumable.RemoveEffect(pm,effect);
}
public InternalTimer(PlayerMobile p, ThieveConsumableEffect e, TimeSpan delay)
: base(delay)
{
pm = p;
effect = e;
}
}
public TimeSpan m_EffectDuration;
protected ThieveConsumableEffect m_EffectType;
protected virtual void OnUse(PlayerMobile by)
{
}
protected virtual void ApplyEffect(PlayerMobile pm)
{
if (m_EffectDuration == TimeSpan.Zero)
{
m_EffectDuration = TimeSpan.FromMinutes(30);
}
InternalTimer t = new InternalTimer(pm,m_EffectType,m_EffectDuration);
t.Start();
ThieveConsumableInfo info = new ThieveConsumableInfo(t, this.m_EffectType);
if (EffectTable.ContainsKey(pm))
{
RemoveEffect(pm, EffectTable[pm].Effect);
}
EffectTable.Add(pm, info);
this.Consume();
}
protected static void RemoveEffect(PlayerMobile pm, ThieveConsumableEffect effectType)
{
if (EffectTable.ContainsKey(pm))
{
EffectTable[pm].EffectTimer.Stop();
EffectTable.Remove(pm);
pm.SendLocalizedMessage(1095134);//The effects of the balm or lotion have worn off.
if (effectType == ThieveConsumableEffect.BalmOfStrengthEffect || effectType == ThieveConsumableEffect.BalmOfSwiftnessEffect || effectType == ThieveConsumableEffect.BalmOfWisdomEffect)
{
pm.RemoveStatMod("Balm");
}
else if (effectType == ThieveConsumableEffect.StoneSkinLotionEffect)
{
List<ResistanceMod> list = pm.ResistanceMods;
for (int i = 0; i < list.Count; i++)
{
ResistanceMod curr = list[i];
if ((curr.Type == ResistanceType.Cold && curr.Offset == -5) || (curr.Type == ResistanceType.Fire && curr.Offset == -5) || (curr.Type == ResistanceType.Physical && curr.Offset == 30))
{
list.RemoveAt(i);
i--;
}
}
}
}
}
private static Dictionary<PlayerMobile, ThieveConsumableInfo> EffectTable = new Dictionary<PlayerMobile, ThieveConsumableInfo>();
public static bool CanUse(PlayerMobile pm, BaseThieveConsumable consum)
{
if (CheckThieveConsumable(pm) != ThieveConsumableEffect.None)
{
return false;
}
else
{
return true;
}
}
public static bool IsUnderThieveConsumableEffect(PlayerMobile pm, ThieveConsumableEffect eff)
{
if (EffectTable.ContainsKey(pm))
{
if (EffectTable[pm].Effect == eff)
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
public static ThieveConsumableEffect CheckThieveConsumable(PlayerMobile pm)
{
if (EffectTable.ContainsKey(pm))
{
return EffectTable[pm].Effect;
}
else
{
return ThieveConsumableEffect.None;
}
}
public BaseThieveConsumable(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
writer.Write((int)m_EffectType);
writer.Write(m_EffectDuration);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
m_EffectType = (ThieveConsumableEffect)reader.ReadInt();
m_EffectDuration = reader.ReadTimeSpan();
}
}
}

View File

@@ -0,0 +1,255 @@
using System;
using System.Collections.Generic;
using System.Text;
using Server;
using Server.Mobiles;
using Server.Items;
using Server.Regions;
using Server.Engines.CannedEvil;
namespace Server.Engines.CreatureStealing
{
class StealingHandler
{
private static Type[] SpecialItemList =
{
typeof(SeedOfLife),
typeof(BalmOfStrength),
typeof(BalmOfWisdom),
typeof(BalmOfSwiftness),
typeof(ManaDraught),
typeof(BalmOfProtection),
typeof(StoneSkinLotion),
typeof(GemOfSalvation),
typeof(LifeShieldLotion),
typeof(SmugglersLantern),
typeof(SmugglersToolBox)
};
public static void HandleSteal(BaseCreature from, PlayerMobile thief)
{
if (from.HasBeenStolen)
{
thief.SendLocalizedMessage(1094948); //That creature has already been stolen from. There is nothing left to steal.
return;
}
if (from.Controlled || from.Summoned)
{
thief.SendLocalizedMessage(502708); //You can't steal from this.
return;
}
if (!CheckLocation(thief, from))
return;
double stealing = thief.Skills.Stealing.Value;
if (stealing < 100)
return;
int chance = GetStealingChance(thief, from, stealing);
if ((Utility.Random(100)+1) <= chance)
{
thief.SendLocalizedMessage(1094947);//You successfully steal a special item from the creature!
Item item;
if (from is ExodusZealot)
{
item = Activator.CreateInstance(ExodusChest.RituelItem[Utility.Random(ExodusChest.RituelItem.Length)]) as Item;
}
else
{
item = Activator.CreateInstance(SpecialItemList[Utility.Random(SpecialItemList.Length - 2)]) as Item;
}
thief.AddToBackpack(item);
}
from.HasBeenStolen = true;
}
public static void HandleSmugglersEdgeSteal(BaseCreature from, PlayerMobile thief)
{
if (from.HasBeenStolen || !CheckLocation(thief, from))
return;
if (0.05 > Utility.RandomDouble())
{
double tempSkill = Utility.RandomMinMax(80, 110);
double realSkill = thief.Skills[SkillName.Stealing].Value;
if (realSkill > tempSkill)
tempSkill = realSkill;
if (tempSkill > 100)
{
int chance = GetStealingChance(thief, from, tempSkill);
if (realSkill <= 109.9)
chance += 1;
else if (realSkill <= 114.9)
chance += 2;
else if (realSkill >= 115.0)
chance += 3;
if (chance >= Utility.Random(100))
{
Item item = Activator.CreateInstance(SpecialItemList[Utility.Random(SpecialItemList.Length)]) as Item;
if (item != null)
{
thief.AddToBackpack(item);
thief.SendLocalizedMessage(1094947);//You successfully steal a special item from the creature!
}
}
else
{
Container pack = from.Backpack;
if (pack != null && pack.Items.Count > 0)
{
int randomIndex = Utility.Random(pack.Items.Count);
Item stolen = TryStealItem(pack.Items[randomIndex], tempSkill);
if (stolen != null)
{
thief.AddToBackpack(stolen);
thief.SendLocalizedMessage(502724); // You succesfully steal the item.
}
else
{
thief.SendLocalizedMessage(502723); // You fail to steal the item.
}
}
}
from.HasBeenStolen = true;
}
}
}
private static bool CheckLocation(Mobile thief, Mobile from)
{
if (!((thief.Map == Map.Felucca && thief.Region is DungeonRegion) || thief.Region is ChampionSpawnRegion || from is ExodusZealot))
{
return false;
}
return true;
}
private static int GetStealingChance(Mobile thief, BaseCreature from, double stealing)
{
int fame = from.Fame;
fame = Math.Max(1, fame);
fame = Math.Min(30000, fame);
int chance = 0;
if (stealing == 120)
chance += 10;
else if (stealing >= 110.1)
chance += 8;
else if (stealing >= 100.1)
chance += 5;
else if (stealing == 100)
chance += 2;
int level = (int)(40.0 / 29999.0 * fame - 40.0 / 29999.0);
if (level >= 40)
chance += 5;
else if (level >= 35)
chance += 3;
else if (level >= 30)
chance += 2;
else if (level >= 25)
chance += 1;
return chance;
}
private static Item TryStealItem(Item toSteal, double skill)
{
Item stolen = null;
double w = toSteal.Weight + toSteal.TotalWeight;
if (w <= 10)
{
if (toSteal.Stackable && toSteal.Amount > 1)
{
int maxAmount = (int)((skill / 10.0) / toSteal.Weight);
if (maxAmount < 1)
{
maxAmount = 1;
}
else if (maxAmount > toSteal.Amount)
{
maxAmount = toSteal.Amount;
}
int amount = Utility.RandomMinMax(1, maxAmount);
if (amount >= toSteal.Amount)
{
int pileWeight = (int)Math.Ceiling(toSteal.Weight * toSteal.Amount);
pileWeight *= 10;
double chance = (skill - (pileWeight - 22.5)) / ((pileWeight + 27.5) - (pileWeight - 22.5));
if (chance >= Utility.RandomDouble())
{
stolen = toSteal;
}
}
else
{
int pileWeight = (int)Math.Ceiling(toSteal.Weight * amount);
pileWeight *= 10;
double chance = (skill - (pileWeight - 22.5)) / ((pileWeight + 27.5) - (pileWeight - 22.5));
if (chance >= Utility.RandomDouble())
{
stolen = Mobile.LiftItemDupe(toSteal, toSteal.Amount - amount);
if (stolen == null)
{
stolen = toSteal;
}
}
}
}
else
{
int iw = (int)Math.Ceiling(w);
iw *= 10;
double chance = (skill - (iw - 22.5)) / ((iw + 27.5) - (iw - 22.5));
if (chance >= Utility.RandomDouble())
{
stolen = toSteal;
}
}
if (stolen != null)
{
ItemFlags.SetTaken(stolen, true);
ItemFlags.SetStealable(stolen, false);
stolen.Movable = true;
}
}
return stolen;
}
}
}

View File

@@ -0,0 +1,62 @@
using System;
using Server.Mobiles;
using Server;
namespace Server.Items
{
[TypeAlias("drNO.ThieveItems.BalmOfProtection")]
public class BalmOfProtection : BaseBalmOrLotion
{
public static double HandleDamage(PlayerMobile pm, double damage)
{
if (IsUnderThieveConsumableEffect(pm,ThieveConsumableEffect.BalmOfProtectionEffect))
{
int rnd = 50 + Utility.Random(51);
damage = damage- (damage * (rnd / 100.0));
return damage;
}
else
{
return damage;
}
}
public override int LabelNumber { get { return 1094943; } } // Balm of Protection
[Constructable]
public BalmOfProtection()
: base(0x1C18)
{
m_EffectType = ThieveConsumableEffect.BalmOfProtectionEffect;
Hue = 0x499;
}
protected override void ApplyEffect(PlayerMobile pm)
{
base.ApplyEffect(pm);
pm.SendLocalizedMessage(1095143); // You apply the ointment and suddenly feel less vulnerable!
}
public BalmOfProtection(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,48 @@
using System;
using Server.Mobiles;
using Server;
namespace Server.Items
{
[TypeAlias("drNO.ThieveItems.BalmOfStrength")]
public class BalmOfStrength : BaseBalmOrLotion
{
public override int LabelNumber { get { return 1094940; } } // Balm of Strength
[Constructable]
public BalmOfStrength()
: base(0xEFB)
{
m_EffectType = ThieveConsumableEffect.BalmOfStrengthEffect;
}
protected override void ApplyEffect(PlayerMobile pm)
{
pm.AddStatMod(new StatMod(StatType.Str, "Balm", 10, m_EffectDuration));
pm.SendLocalizedMessage(1095136); //You apply the balm and suddenly feel stronger!
base.ApplyEffect(pm);
}
public BalmOfStrength(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,46 @@
using System;
using Server;
using Server.Mobiles;
namespace Server.Items
{
[TypeAlias("drNO.ThieveItems.BalmOfSwiftness")]
public class BalmOfSwiftness : BaseBalmOrLotion
{
public override int LabelNumber { get { return 1094942; } } // Balm of Swiftness
[Constructable]
public BalmOfSwiftness()
: base(0x1848)
{
m_EffectType = ThieveConsumableEffect.BalmOfSwiftnessEffect;
}
protected override void ApplyEffect(PlayerMobile pm)
{
pm.AddStatMod(new StatMod(StatType.Dex, "Balm", 10, m_EffectDuration));
pm.SendLocalizedMessage(1095138);//You apply the balm and suddenly feel more agile!
base.ApplyEffect(pm);
}
public BalmOfSwiftness(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,46 @@
using System;
using Server;
using Server.Mobiles;
namespace Server.Items
{
[TypeAlias("drNO.ThieveItems.BalmOfWisdom")]
public class BalmOfWisdom : BaseBalmOrLotion
{
public override int LabelNumber { get { return 1094941; } } // Balm of Wisdom
[Constructable]
public BalmOfWisdom()
: base(0x1847)
{
m_EffectType = ThieveConsumableEffect.BalmOfWisdomEffect;
}
protected override void ApplyEffect(PlayerMobile pm)
{
pm.AddStatMod(new StatMod(StatType.Int, "Balm", 10, m_EffectDuration));
pm.SendLocalizedMessage(1095137);//You apply the balm and suddenly feel wiser!
base.ApplyEffect(pm);
}
public BalmOfWisdom(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,111 @@
using System;
using Server.Gumps;
using Server.Mobiles;
using Server.Network;
namespace Server.Items
{
[TypeAlias("drNO.ThieveItems.GemOfSalvation")]
public class GemOfSalvation : Item
{
public override int LabelNumber { get { return 1094939; } } // Gem of Salvation
[Constructable]
public GemOfSalvation()
: base(0x1F13)
{
Hue = 286;
LootType = LootType.Blessed;
}
public static void Initialize()
{
EventSink.PlayerDeath += new PlayerDeathEventHandler(PlayerDeath);
}
public static void PlayerDeath(PlayerDeathEventArgs args)
{
PlayerMobile pm = (PlayerMobile)args.Mobile;
if (pm != null && pm.Backpack != null)
{
GemOfSalvation gem = pm.Backpack.FindItemByType<GemOfSalvation>();
if (gem != null)
{
Timer.DelayCall(TimeSpan.FromSeconds(2), () =>
{
if (DateTime.UtcNow < pm.NextGemOfSalvationUse)
{
TimeSpan left = pm.NextGemOfSalvationUse - DateTime.UtcNow;
if (left >= TimeSpan.FromMinutes(1.0))
pm.SendLocalizedMessage(1095131, ((left.Hours * 60) + left.Minutes).ToString()); // Your spirit lacks cohesion. You must wait ~1_minutes~ minutes before invoking the power of a Gem of Salvation.
else
pm.SendLocalizedMessage(1095130, left.Seconds.ToString()); // Your spirit lacks cohesion. You must wait ~1_seconds~ seconds before invoking the power of a Gem of Salvation.
}
else
{
pm.CloseGump(typeof(ResurrectGump));
pm.SendGump(new GemResurrectGump(pm, gem));
}
});
}
}
}
public GemOfSalvation(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
public class GemResurrectGump : ResurrectGump
{
private GemOfSalvation m_Gem;
private PlayerMobile m_Mobile;
public GemResurrectGump(PlayerMobile pm, GemOfSalvation gem)
: base(pm, ResurrectMessage.GemOfSalvation)
{
m_Gem = gem;
m_Mobile = pm;
}
public override void OnResponse(NetState state, RelayInfo info)
{
m_Mobile.CloseGump(typeof(ResurrectGump));
if (info.ButtonID == 1 && !m_Gem.Deleted && m_Gem.IsChildOf(m_Mobile.Backpack))
{
if (m_Mobile.Map == null || !m_Mobile.Map.CanFit(m_Mobile.Location, 16, false, false))
{
m_Mobile.SendLocalizedMessage(502391); // Thou can not be resurrected there!
return;
}
m_Mobile.PlaySound(0x214);
m_Mobile.Resurrect();
m_Mobile.SendLocalizedMessage(1095132); // The gem infuses you with its power and is destroyed in the process.
m_Gem.Delete();
m_Mobile.NextGemOfSalvationUse = DateTime.UtcNow + TimeSpan.FromHours(6);
}
}
}
}

View File

@@ -0,0 +1,64 @@
using System;
using Server.Mobiles;
using Server;
namespace Server.Items
{
[TypeAlias("drNO.ThieveItems.LifeShieldLotion")]
public class LifeShieldLotion : BaseBalmOrLotion
{
public override int LabelNumber { get { return 1094945; } } // Life Shield Lotion
[Constructable]
public LifeShieldLotion()
: base(0xEFC)
{
m_EffectType = ThieveConsumableEffect.LifeShieldLotionEffect;
}
public override void OnDoubleClick(Mobile from)
{
OnUse((PlayerMobile)from);
}
protected override void ApplyEffect(PlayerMobile pm)
{
base.ApplyEffect(pm);
pm.SendMessage("You applied Life Shield Lotion");
}
public static double HandleLifeDrain(PlayerMobile pm, double damage)
{
if (IsUnderThieveConsumableEffect(pm, ThieveConsumableEffect.LifeShieldLotionEffect))
{
int rnd = 50 + Utility.Random(50);
int dmgMod = (int)(damage * (rnd / 100.0));
damage = damage - dmgMod;
return damage;
}
else
{
return damage;
}
}
public LifeShieldLotion(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,117 @@
using System;
using System.Collections.Generic;
using Server;
using Server.Mobiles;
namespace Server.Items
{
[TypeAlias("drNO.ThieveItems.ManaDraught")]
public class ManaDraught : Item
{
private static Dictionary<PlayerMobile, DateTime> DaughtUsageList = new Dictionary<PlayerMobile, DateTime>();
private static TimeSpan Cooldown = TimeSpan.FromMinutes(10);
public override int LabelNumber { get { return 1094938; } } // Mana Draught
[Constructable]
public ManaDraught()
: base(0xFFB)
{
Hue = 0x48A;
Weight = 1.0;
}
public static void DoCleanup()
{
List<PlayerMobile> toRemove = new List<PlayerMobile>();
foreach (PlayerMobile pm in DaughtUsageList.Keys)
{
if (DaughtUsageList[pm] < DateTime.Now + Cooldown)
{
toRemove.Add(pm);
}
}
foreach (PlayerMobile pm in toRemove)
{
DaughtUsageList.Remove(pm);
}
toRemove.Clear();
}
private bool CheckUse(PlayerMobile pm)
{
if (DaughtUsageList.ContainsKey(pm))
{
if (DaughtUsageList[pm] + Cooldown >= DateTime.Now)
return false;
else
return true;
}
else
{
return true;
}
}
private void OnUsed(PlayerMobile by)
{
if (CheckUse(by))
{
DoHeal(by);
}
else
{
by.SendLocalizedMessage(1079263, ((int)((DaughtUsageList[by] + Cooldown)-DateTime.Now).TotalSeconds).ToString());
}
}
private void DoHeal(PlayerMobile pm)
{
int toHeal = Utility.RandomMinMax(25, 40);
int diff = pm.ManaMax - pm.Mana;
if (diff == 0)
{
pm.SendLocalizedMessage(1095127); //You are already at full mana
return;
}
toHeal = Math.Min(toHeal, diff);
pm.Mana += toHeal;
this.Consume();
if (!DaughtUsageList.ContainsKey(pm))
{
DaughtUsageList.Add(pm, DateTime.Now);
}
else
{
DaughtUsageList[pm] = DateTime.Now;
}
pm.SendLocalizedMessage(1095128);//The sour draught instantly restores some of your mana!
}
public ManaDraught(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,130 @@
using System;
using System.Collections.Generic;
using Server;
using Server.Mobiles;
namespace Server.Items
{
[TypeAlias("drNO.ThieveItems.SeedOflife")]
public class SeedOfLife : Item
{
private static Dictionary<PlayerMobile, DateTime> SeedUsageList = new Dictionary<PlayerMobile, DateTime>();
private static TimeSpan Cooldown = TimeSpan.FromMinutes(10);
public static void Initialize()
{
EventSink.AfterWorldSave += CheckCleanup;
}
public override int LabelNumber { get { return 1094937; } } // seed of life
[Constructable]
public SeedOfLife()
: base(0x1727)
{
Hue = 0x491;
Weight = 1.0;
Stackable = true;
}
public static void CheckCleanup(AfterWorldSaveEventArgs e)
{
DoCleanup();
ManaDraught.DoCleanup();
}
public static void DoCleanup()
{
List<PlayerMobile> toRemove = new List<PlayerMobile>();
foreach (PlayerMobile pm in SeedUsageList.Keys)
{
if (SeedUsageList[pm] < DateTime.Now + Cooldown)
{
toRemove.Add(pm);
}
}
foreach (PlayerMobile pm in toRemove)
{
SeedUsageList.Remove(pm);
}
toRemove.Clear();
}
private bool CheckUse(PlayerMobile pm)
{
if (SeedUsageList.ContainsKey(pm))
{
if (SeedUsageList[pm] + Cooldown >= DateTime.Now)
return false;
else
return true;
}
else
{
return true;
}
}
private void OnUsed(PlayerMobile by)
{
if (CheckUse(by))
{
DoHeal(by);
}
else
{
by.SendLocalizedMessage(1079263,((int)(((SeedUsageList[by] + Cooldown)-DateTime.Now).TotalSeconds)).ToString());
}
}
private void DoHeal(PlayerMobile pm)
{
int toHeal = Utility.RandomMinMax(25, 40);
int diff = pm.HitsMax - pm.Hits;
if (diff == 0)
{
pm.SendLocalizedMessage(1049547); //You are already at full health
return;
}
toHeal = Math.Min(toHeal, diff);
pm.Hits += toHeal;
this.Consume();
if (!SeedUsageList.ContainsKey(pm))
{
SeedUsageList.Add(pm, DateTime.Now);
}
else
{
SeedUsageList[pm] = DateTime.Now;
}
pm.SendLocalizedMessage(1095126);//The bitter seed instantly restores some of your health!
}
public SeedOfLife(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,46 @@
using System;
using Server;
namespace Server.Items
{
public class SmugglersLantern : Lantern
{
public override int LabelNumber { get { return 1071521; } } // Smuggler's Lantern
[Constructable]
public SmugglersLantern()
{
Hue = Utility.RandomMinMax(192, 291);
}
public override bool AllowEquipedCast(Mobile from)
{
return true;
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
list.Add(1079766); // Spell Channeling
}
public SmugglersLantern(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,81 @@
using System;
using Server;
namespace Server.Items
{
public class SmugglersToolBox : Item
{
private int _UsesRemaining;
[CommandProperty(AccessLevel.GameMaster)]
public int UsesRemaining { get { return _UsesRemaining; } set { _UsesRemaining = value; InvalidateProperties(); } }
public DateTime NextRecharge { get; set; }
public override int LabelNumber { get { return 1071520; } } // Smuggler's Tool Box
[Constructable]
public SmugglersToolBox()
: base(0x1EB6)
{
Hue = 953;
UsesRemaining = 10;
NextRecharge = DateTime.UtcNow;
}
public override void OnDoubleClick(Mobile m)
{
if (IsChildOf(m.Backpack) && _UsesRemaining > 0)
{
var lockpick = new Lockpick(Utility.RandomMinMax(5, 12));
if (m.Backpack == null || !m.Backpack.TryDropItem(m, lockpick, false))
{
m.SendLocalizedMessage(1077971); // Make room in your backpack first!
lockpick.Delete();
}
else
{
m.SendLocalizedMessage(1071526); // You take some lockpicks from the tool box.
UsesRemaining--;
}
}
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
list.Add(1060584, _UsesRemaining.ToString());
}
public SmugglersToolBox(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
writer.Write(_UsesRemaining);
writer.Write(NextRecharge);
if (NextRecharge < DateTime.UtcNow)
{
UsesRemaining = Math.Min(20, UsesRemaining + 1);
NextRecharge = DateTime.UtcNow + TimeSpan.FromHours(24);
}
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
_UsesRemaining = reader.ReadInt();
NextRecharge = reader.ReadDateTime();
}
}
}

View File

@@ -0,0 +1,48 @@
using System;
using Server.Mobiles;
using Server;
namespace Server.Items
{
[TypeAlias("drNO.ThieveItems.StoneSkinLotion")]
public class StoneSkinLotion : BaseBalmOrLotion
{
protected override void ApplyEffect(PlayerMobile pm)
{
pm.AddResistanceMod(new ResistanceMod(ResistanceType.Cold, -5));
pm.AddResistanceMod(new ResistanceMod(ResistanceType.Fire, -5));
pm.AddResistanceMod(new ResistanceMod(ResistanceType.Physical, 30));
base.ApplyEffect(pm);
}
public override int LabelNumber { get { return 1094944; } } // Stone Skin Lotion
[Constructable]
public StoneSkinLotion()
: base(0xEFD)
{
m_EffectType = ThieveConsumableEffect.StoneSkinLotionEffect;
}
public StoneSkinLotion(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();
}
}
}