/
MilitiaFighter.cs
151 lines (122 loc) · 3.83 KB
/
MilitiaFighter.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Network;
namespace Server.Engines.Quests.Haven
{
public class MilitiaFighter : BaseCreature
{
[Constructable]
public MilitiaFighter() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
InitStats( 40, 30, 5 );
Title = "the Militia Fighter";
SpeechHue = Utility.RandomDyedHue();
Hue = Utility.RandomSkinHue();
Female = false;
Body = 0x190;
Name = NameList.RandomName( "male" );
Utility.AssignRandomHair( this );
Utility.AssignRandomFacialHair( this, HairHue );
AddItem( new ThighBoots( 0x1BB ) );
AddItem( new LeatherChest() );
AddItem( new LeatherArms() );
AddItem( new LeatherLegs() );
AddItem( new LeatherCap() );
AddItem( new LeatherGloves() );
AddItem( new LeatherGorget() );
Item weapon;
switch ( Utility.Random( 6 ) )
{
case 0: weapon = new Broadsword(); break;
case 1: weapon = new Cutlass(); break;
case 2: weapon = new Katana(); break;
case 3: weapon = new Longsword(); break;
case 4: weapon = new Scimitar(); break;
default: weapon = new VikingSword(); break;
}
weapon.Movable = false;
AddItem( weapon );
Item shield = new BronzeShield();
shield.Movable = false;
AddItem( shield );
SetSkill( SkillName.Swords, 20.0 );
}
public override bool ClickTitle { get { return false; } }
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 MilitiaFighter( 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();
}
}
public class MilitiaFighterCorpse : Corpse
{
public MilitiaFighterCorpse( Mobile owner, HairInfo hair, FacialHairInfo facialhair, List<Item> equipItems ) : base( owner, hair, facialhair, equipItems )
{
}
public override void AddNameProperty( ObjectPropertyList list )
{
if ( ItemID == 0x2006 ) // Corpse form
{
list.Add( "a human corpse" );
list.Add( 1049318, this.Name ); // the remains of ~1_NAME~ the militia fighter
}
else
{
list.Add( 1049319 ); // the remains of a militia fighter
}
}
public override void OnSingleClick( Mobile from )
{
int hue = Notoriety.GetHue( Server.Misc.NotorietyHandlers.CorpseNotoriety( from, this ) );
if ( ItemID == 0x2006 ) // Corpse form
from.Send( new MessageLocalized( Serial, ItemID, MessageType.Label, hue, 3, 1049318, "", Name ) ); // the remains of ~1_NAME~ the militia fighter
else
from.Send( new MessageLocalized( Serial, ItemID, MessageType.Label, hue, 3, 1049319, "", "" ) ); // the remains of a militia fighter
}
public override void Open( Mobile from, bool checkSelfLoot )
{
if ( from.InRange( this.GetWorldLocation(), 2 ) )
{
from.SendLocalizedMessage( 1049661, "", 0x22 ); // Thinking about his sacrifice, you can't bring yourself to loot the body of this militia fighter.
}
}
public MilitiaFighterCorpse( 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();
}
}
}