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,110 @@
using System;
using Server.ContextMenus;
namespace Server.Items
{
public class SearingWeapon : ItemSocket
{
public bool Extinguished { get; set; } = true;
public SearingWeapon()
{
}
public SearingWeapon(BaseWeapon wep)
{
wep.NegativeAttributes.Brittle = 1;
wep.MaxHitPoints = 200;
wep.HitPoints = 200;
wep.Hue = 2500;
}
public override void OnRemoved()
{
if (Owner is BaseWeapon)
{
((BaseWeapon)Owner).NegativeAttributes.Brittle = 0;
Owner.Hue = ((BaseWeapon)Owner).GetElementalDamageHue();
}
}
public static void OnWeaponRemoved(BaseWeapon wep)
{
var socket = wep.GetSocket<SearingWeapon>();
if (socket != null && !socket.Extinguished)
{
socket.Extinguished = true;
wep.Hue = 2500;
}
}
public void ToggleExtinguish(Mobile from)
{
if (Extinguished)
{
Extinguished = false;
Owner.Hue = 1174;
from.SendLocalizedMessage(1151175); // You ignite your weapon.
}
else
{
Extinguished = true;
Owner.Hue = 2500;
from.SendLocalizedMessage(1151176); // You extinguish your weapon.
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
writer.Write(Extinguished);
}
public static bool CanSear(BaseWeapon weapon)
{
var socket = weapon.GetSocket<SearingWeapon>();
return socket != null && !socket.Extinguished;
}
public override void Deserialize(Item owner, GenericReader reader)
{
base.Deserialize(owner, reader);
reader.ReadInt(); // version
Extinguished = reader.ReadBool();
}
public class ToggleExtinguishEntry : ContextMenuEntry
{
public BaseWeapon Weapon { get; set; }
public Mobile From { get; set; }
public ToggleExtinguishEntry(Mobile from, BaseWeapon weapon)
: base(weapon.GetSocket<SearingWeapon>().Extinguished ? 1151173 : 1151174, -1)
{
From = from;
Weapon = weapon;
}
public override void OnClick()
{
if (Weapon.Parent == From)
{
var socket = Weapon.GetSocket<SearingWeapon>();
if (socket != null)
{
socket.ToggleExtinguish(From);
}
}
}
}
}
}