Barclay
Member
I'm trying to make a script for an attacker that will also make remarks.
It compiles fine but when I [Add the object in game I see this on the server console:
19:34:15 Client: 127.0.0.1: Entered World (0xA790 "Piper")
19:34:32 Offending Mobile: Server.Mobiles.banshee [0x4E5 "Chaya"]
19:34:32 Offending Item: 0x40022A34 "StuddedBustierArms" [Server.Items.StuddedBustierArms]
19:34:32 Equipped Item: 0x40022A1E "FemaleStuddedChest" [Server.Items.FemaleStuddedChest]
19:34:32 Layer: InnerTorso
Here's the script, it's cobbled together from a few sources:
using System;
using Server;
using Server.Items;
using Server.Network;
using Server.Mobiles;
using Server.ContextMenus;
using System.Collections.Generic;
using System.Data;
namespace Server.Mobiles
{
public class banshee : BaseCreature
{
// public int Clothcol;
private static bool m_Talked;
string[] kfcsay = new string[]
{
"Prepare to die!",
"You won't get away!",
"There! Get them!",
"Hurry, this way!",
"Aarrgghh!",
"Come here!",
"I can smell your fear!",
"Go meet your maker!"
};
[Constructable]
public banshee()
: base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.8, 3.0)
{
{
this.Name = NameList.RandomName("female");
this.Title = "the Banshee";
SpeechHue = 56;
Hue = Utility.RandomSkinHue();
Item hair = new Item(Utility.RandomList(0x2FC2, 0x2FC2));
hair.Hue = Utility.RandomNeutralHue();
hair.Layer = Layer.Hair;
hair.Movable = false;
AddItem(hair);
}
{
SetStr(200);
SetDex(200);
SetInt(200);
SetStr(186, 200);
SetDamage(33, 66);
SetSkill(SkillName.Fencing, 66.0, 97.5);
SetSkill(SkillName.Macing, 65.0, 87.5);
SetSkill(SkillName.MagicResist, 25.0, 47.5);
SetSkill(SkillName.Swords, 65.0, 87.5);
SetSkill(SkillName.Tactics, 65.0, 87.5);
SetSkill(SkillName.Wrestling, 15.0, 37.5);
Body = 0x191;
AddItem(new LeatherGorget());
AddItem(new LeatherSkirt());
AddItem(new FemaleStuddedChest());
AddItem(new StuddedBustierArms());
AddItem(new Boots());
Name = NameList.RandomName("female");
Fame = 1000;
Karma = -1000;
SetSkill(SkillName.Discordance, 60.0, 70.0);
}
{
Container pack = new Backpack();
pack.DropItem(new Gold(0, 50));
pack.Movable = false;
AddItem(pack);
}
{
}
switch ( Utility.Random(7))
{
case 0:
AddItem(new Longsword());
break;
case 1:
AddItem(new Cutlass());
break;
case 2:
AddItem(new Broadsword());
break;
case 3:
AddItem(new Axe());
break;
case 4:
AddItem(new Club());
break;
case 5:
AddItem(new Dagger());
break;
case 6:
AddItem(new Spear());
break;
}
}
public banshee(Serial serial)
: base(serial)
{
}
public override void OnMovement(Mobile m, Point3D oldLocation)
{
if (m_Talked == false)
{
if (m.InRange(this, 1))
{
m_Talked = true;
SayRandom(kfcsay, this);
this.Move(GetDirectionTo(m.Location));
SpamTimer t = new SpamTimer();
t.Start();
}
}
}
private class SpamTimer : Timer
{
public SpamTimer()
: base(TimeSpan.FromSeconds(10))
{
Priority = TimerPriority.OneSecond;
}
protected override void OnTick()
{
m_Talked = false;
}
}
private static void SayRandom(string[] say, Mobile m)
{
m.Say(say[Utility.Random(say.Length)]);
}
public override bool AlwaysMurderer
{
get
{
return true;
}
}
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();
}
}
}
It compiles fine but when I [Add the object in game I see this on the server console:
19:34:15 Client: 127.0.0.1: Entered World (0xA790 "Piper")
19:34:32 Offending Mobile: Server.Mobiles.banshee [0x4E5 "Chaya"]
19:34:32 Offending Item: 0x40022A34 "StuddedBustierArms" [Server.Items.StuddedBustierArms]
19:34:32 Equipped Item: 0x40022A1E "FemaleStuddedChest" [Server.Items.FemaleStuddedChest]
19:34:32 Layer: InnerTorso
Here's the script, it's cobbled together from a few sources:
using System;
using Server;
using Server.Items;
using Server.Network;
using Server.Mobiles;
using Server.ContextMenus;
using System.Collections.Generic;
using System.Data;
namespace Server.Mobiles
{
public class banshee : BaseCreature
{
// public int Clothcol;
private static bool m_Talked;
string[] kfcsay = new string[]
{
"Prepare to die!",
"You won't get away!",
"There! Get them!",
"Hurry, this way!",
"Aarrgghh!",
"Come here!",
"I can smell your fear!",
"Go meet your maker!"
};
[Constructable]
public banshee()
: base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.8, 3.0)
{
{
this.Name = NameList.RandomName("female");
this.Title = "the Banshee";
SpeechHue = 56;
Hue = Utility.RandomSkinHue();
Item hair = new Item(Utility.RandomList(0x2FC2, 0x2FC2));
hair.Hue = Utility.RandomNeutralHue();
hair.Layer = Layer.Hair;
hair.Movable = false;
AddItem(hair);
}
{
SetStr(200);
SetDex(200);
SetInt(200);
SetStr(186, 200);
SetDamage(33, 66);
SetSkill(SkillName.Fencing, 66.0, 97.5);
SetSkill(SkillName.Macing, 65.0, 87.5);
SetSkill(SkillName.MagicResist, 25.0, 47.5);
SetSkill(SkillName.Swords, 65.0, 87.5);
SetSkill(SkillName.Tactics, 65.0, 87.5);
SetSkill(SkillName.Wrestling, 15.0, 37.5);
Body = 0x191;
AddItem(new LeatherGorget());
AddItem(new LeatherSkirt());
AddItem(new FemaleStuddedChest());
AddItem(new StuddedBustierArms());
AddItem(new Boots());
Name = NameList.RandomName("female");
Fame = 1000;
Karma = -1000;
SetSkill(SkillName.Discordance, 60.0, 70.0);
}
{
Container pack = new Backpack();
pack.DropItem(new Gold(0, 50));
pack.Movable = false;
AddItem(pack);
}
{
}
switch ( Utility.Random(7))
{
case 0:
AddItem(new Longsword());
break;
case 1:
AddItem(new Cutlass());
break;
case 2:
AddItem(new Broadsword());
break;
case 3:
AddItem(new Axe());
break;
case 4:
AddItem(new Club());
break;
case 5:
AddItem(new Dagger());
break;
case 6:
AddItem(new Spear());
break;
}
}
public banshee(Serial serial)
: base(serial)
{
}
public override void OnMovement(Mobile m, Point3D oldLocation)
{
if (m_Talked == false)
{
if (m.InRange(this, 1))
{
m_Talked = true;
SayRandom(kfcsay, this);
this.Move(GetDirectionTo(m.Location));
SpamTimer t = new SpamTimer();
t.Start();
}
}
}
private class SpamTimer : Timer
{
public SpamTimer()
: base(TimeSpan.FromSeconds(10))
{
Priority = TimerPriority.OneSecond;
}
protected override void OnTick()
{
m_Talked = false;
}
}
private static void SayRandom(string[] say, Mobile m)
{
m.Say(say[Utility.Random(say.Length)]);
}
public override bool AlwaysMurderer
{
get
{
return true;
}
}
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();
}
}
}