servuo/Scripts/Mobiles/Normal/Executioner.cs
pyro17 bebc100d6c
Ranger Equipment fix, Additem delete (#5012)
* Ranger Equipment fix, Additem delete
- add parameter with default value to AddItem
- On Conflict, still log conflict, but delete the conflicting Item by default

- Delete the base boots of Rangers befor adding the new boots

* Updated Mobile Scripts

- went through all scripts to update them to SetWearable
- reverted change to AddItem

* Update to SetWearable

- last item being set will be worn (if no override to OnEquip returns false
- delete the item on the layer that is the same as the new item (if existend)
- used ifs to cap item.Movable, therefor no need to call to Random if <= 0 or >= 1

* Update base InitOutFit

- replaced the Additem for Backpack with SetWearable, Movable is getting set this way too
- altered the other SetWearable calls, to allow the items to be moved / dropped (as they should normally)

* Null reference sanity check.

Co-authored-by: Voxpire <admin@vita-nex.com>
2022-06-16 04:44:54 +01:00

106 lines
3 KiB
C#

using Server.Items;
namespace Server.Mobiles
{
public class Executioner : BaseCreature
{
[Constructable]
public Executioner()
: base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
{
SpeechHue = Utility.RandomDyedHue();
Title = "the executioner";
Hue = Utility.RandomSkinHue();
if (Female = Utility.RandomBool())
{
Body = 0x191;
Name = NameList.RandomName("female");
SetWearable(new Skirt(), Utility.RandomRedHue(), 1);
}
else
{
Body = 0x190;
Name = NameList.RandomName("male");
SetWearable(new ShortPants(), Utility.RandomRedHue(), 1);
}
SetStr(386, 400);
SetDex(151, 165);
SetInt(161, 175);
SetDamage(8, 10);
SetDamageType(ResistanceType.Physical, 100);
SetResistance(ResistanceType.Physical, 35, 45);
SetResistance(ResistanceType.Fire, 25, 30);
SetResistance(ResistanceType.Cold, 25, 30);
SetResistance(ResistanceType.Poison, 10, 20);
SetResistance(ResistanceType.Energy, 10, 20);
SetSkill(SkillName.Anatomy, 125.0);
SetSkill(SkillName.Fencing, 46.0, 77.5);
SetSkill(SkillName.Macing, 35.0, 57.5);
SetSkill(SkillName.Poisoning, 60.0, 82.5);
SetSkill(SkillName.MagicResist, 83.5, 92.5);
SetSkill(SkillName.Swords, 125.0);
SetSkill(SkillName.Tactics, 125.0);
SetSkill(SkillName.Lumberjacking, 125.0);
Fame = 5000;
Karma = -5000;
SetWearable(new ThighBoots(), Utility.RandomRedHue(), 1);
SetWearable(new Surcoat(), Utility.RandomRedHue(), 1);
SetWearable(new ExecutionersAxe(), dropChance: 1);
Utility.AssignRandomHair(this);
}
public Executioner(Serial serial)
: base(serial)
{
}
public override bool AlwaysMurderer => true;
public bool BlockReflect { get; set; }
public override int Damage(int amount, Mobile from, bool informMount, bool checkDisrupt)
{
int dam = base.Damage(amount, from, informMount, checkDisrupt);
if (!BlockReflect && from != null && dam > 0)
{
BlockReflect = true;
AOS.Damage(from, this, dam, 0, 0, 0, 0, 0, 0, 100);
BlockReflect = false;
from.PlaySound(0x1F1);
}
return dam;
}
public override void GenerateLoot()
{
AddLoot(LootPack.FilthyRich);
AddLoot(LootPack.Meager);
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}