thisguy883
Member
- ServUO Version
- Publish 58
- Ultima Expansion
- Endless Journey
I've been at this for a few days now.
My goal: Create the Militia Fighter
Purpose:
Have this NPC do one thing, and one thing only: Fight mobs.
Specifically act the same as the previous Militia Fighter back in the runUO days during the AOS era.
What I did:
I managed to copy the militiacannoneer.cs file and edit it to make militiafighter.cs
Code:
While this new mob loads, it doesn't load with the behavior I want.
See attached image:
Not only is he immortal, but he doesnt move and he doesnt attack anything. I'm scratching my head with this one. Any ideas or suggestions will be MUCH appreciated.
My goal: Create the Militia Fighter
Purpose:
Have this NPC do one thing, and one thing only: Fight mobs.
Specifically act the same as the previous Militia Fighter back in the runUO days during the AOS era.
What I did:
I managed to copy the militiacannoneer.cs file and edit it to make militiafighter.cs
Code:
C#:
using Server.Items;
using Server.Mobiles;
namespace Server.Engines.Quests.Haven
{
public class MilitiaFighter : BaseQuester
{
private bool m_Active;
[Constructable]
public MilitiaFighter()
: base("the Militia Fighter")
{
m_Active = true;
}
public MilitiaFighter(Serial serial)
: base(serial)
{
}
[CommandProperty(AccessLevel.GameMaster)]
public bool Active
{
get
{
return m_Active;
}
set
{
m_Active = value;
}
}
public override void InitBody()
{
InitStats(100, 125, 25);
Hue = Utility.RandomSkinHue();
Female = false;
Body = 0x190;
Name = NameList.RandomName("male");
}
public override void InitOutfit()
{
Utility.AssignRandomHair(this);
Utility.AssignRandomFacialHair(this, HairHue);
AddItem(new RingmailChest());
AddItem(new PlateArms());
AddItem(new RingmailGloves());
AddItem(new RingmailLegs());
AddItem(new Boots());
AddItem(new Broadsword());
AddItem(new BronzeShield());
}
public override bool CanTalkTo(PlayerMobile to)
{
return false;
}
public override void OnTalk(PlayerMobile player, bool contextMenu)
{
}
public override bool IsEnemy(Mobile m)
{
if (m.Player || m is BaseVendor)
return false;
if (m is BaseCreature)
{
BaseCreature bc = (BaseCreature)m;
Mobile master = bc.GetMaster();
if (master != null)
return IsEnemy(master);
}
return m.Karma < 0;
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // version
writer.Write(m_Active);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
m_Active = reader.ReadBool();
}
}
}
While this new mob loads, it doesn't load with the behavior I want.
See attached image:
Not only is he immortal, but he doesnt move and he doesnt attack anything. I'm scratching my head with this one. Any ideas or suggestions will be MUCH appreciated.