servuo/Scripts/Mobiles/Normal/Gremlin.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

63 lines
1.6 KiB
C#

using Server.Items;
namespace Server.Mobiles
{
[CorpseName("a gremlin corpse")]
public class Gremlin : BaseCreature
{
[Constructable]
public Gremlin()
: base(AIType.AI_Archer, FightMode.Closest, 10, 1, 0.2, 0.4)
{
Name = "a gremlin";
Body = 724;
SetStr(106);
SetDex(130);
SetInt(36);
SetHits(70);
SetDamage(5, 7);
SetDamageType(ResistanceType.Physical, 100);
SetResistance(ResistanceType.Physical, 26);
SetResistance(ResistanceType.Fire, 36);
SetResistance(ResistanceType.Cold, 22);
SetResistance(ResistanceType.Poison, 17);
SetResistance(ResistanceType.Energy, 30);
SetSkill(SkillName.Anatomy, 78.5);
SetSkill(SkillName.MagicResist, 82.5);
SetSkill(SkillName.Tactics, 65.3);
SetWearable(new Bow(), dropChance: 1);
}
public Gremlin(Serial serial)
: base(serial)
{
}
public override void GenerateLoot()
{
AddLoot(LootPack.Rich);
AddLoot(LootPack.LootItem<Arrow>(60, 80));
AddLoot(LootPack.LootItem<Apple>(5));
AddLoot(LootPack.LootItem<LuckyCoin>(1.0));
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}