Hi I am running ServUO and was attempting to modify the script below to be used.
I keep getting an error and I am, again no expert, trying to figure how what the missing reference is.
What I am doing is comparing to other CS files I have trying to see what the correct reference is or what the missing reference is.
My initial thought is ServUO doesn't use "OnHit". However after opening many other scripts I can't s

using System;
using Server.Network;
using Server.Items;
namespace Server.Items
{
[FlipableAttribute(0xF5C, 0xF5D)]
public class ParalyzingMace : Mace
{
public override void OnHit(Mobile attacker, Mobile defender, double damageBonus) //IT DOES NOT LIKE THIS LINE OF CODE
{
base.OnHit(attacker, defender, damageBonus);
double max = 120.0; //Set this to shard max skill value
double attack = attacker.Skills[SkillName.Macing].Value;
double defend = defender.Skills[SkillName.MagicResist].Value; //Using magic resist here, but if you prefer you can use another skill to defend
bool canParalyze = Utility.Random((int)(max - Math.Min(max, attack))) < 20;
bool canResist = Utility.Random((int)(max - Math.Min(max, defend))) < 20;
if (canParalyze)
{
int duration = Utility.Random(4) + 4;
if (attack > defend) duration *= 2;
if (defend > attack) duration /= 2;
if (canResist) duration /= 2;
defender.Paralyze(TimeSpan.FromSeconds(duration));
}
}
[Constructable]
public ParalyzingMace()
: base(0xF5C)
{
Weight = 14.0;
}
public ParalyzingMace(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();
}
}
}
I keep getting an error and I am, again no expert, trying to figure how what the missing reference is.
What I am doing is comparing to other CS files I have trying to see what the correct reference is or what the missing reference is.
My initial thought is ServUO doesn't use "OnHit". However after opening many other scripts I can't s

using System;
using Server.Network;
using Server.Items;
namespace Server.Items
{
[FlipableAttribute(0xF5C, 0xF5D)]
public class ParalyzingMace : Mace
{
public override void OnHit(Mobile attacker, Mobile defender, double damageBonus) //IT DOES NOT LIKE THIS LINE OF CODE
{
base.OnHit(attacker, defender, damageBonus);
double max = 120.0; //Set this to shard max skill value
double attack = attacker.Skills[SkillName.Macing].Value;
double defend = defender.Skills[SkillName.MagicResist].Value; //Using magic resist here, but if you prefer you can use another skill to defend
bool canParalyze = Utility.Random((int)(max - Math.Min(max, attack))) < 20;
bool canResist = Utility.Random((int)(max - Math.Min(max, defend))) < 20;
if (canParalyze)
{
int duration = Utility.Random(4) + 4;
if (attack > defend) duration *= 2;
if (defend > attack) duration /= 2;
if (canResist) duration /= 2;
defender.Paralyze(TimeSpan.FromSeconds(duration));
}
}
[Constructable]
public ParalyzingMace()
: base(0xF5C)
{
Weight = 14.0;
}
public ParalyzingMace(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();
}
}
}