region using System using System Linq using ScriptDotNet2 using Script

  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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
#region
using System;
using System.Linq;
using ScriptDotNet2;
using ScriptSDK.Core.Attributes;
#endregion
namespace ScriptSDK.Core.Mobile
{
public class Mobile : BaseObject
{
public virtual bool IsRunning
{
get { return GetValue<bool>(CoreAttribut.IsRunning); }
}
public virtual bool YellowHits
{
get { return GetValue<bool>(CoreAttribut.YellowHits); }
}
public virtual bool Poisoned
{
get { return GetValue<bool>(CoreAttribut.Poisoned); }
}
public virtual bool Paralyzed
{
get { return GetValue<bool>(CoreAttribut.Paralyzed); }
}
public virtual bool Hidden
{
get { return GetValue<bool>(CoreAttribut.Hidden); }
}
public virtual bool WarMode
{
get { return GetValue<bool>(CoreAttribut.WarMode); }
}
public virtual bool Dead
{
get { return GetValue<bool>(CoreAttribut.Dead); }
}
public virtual int Strength
{
get { return GetValue<int>(CoreAttribut.Strength); }
}
public virtual int Intelligence
{
get { return GetValue<int>(CoreAttribut.Intelligence); }
}
public virtual int Dexterity
{
get { return GetValue<int>(CoreAttribut.Dexterity); }
}
public virtual int Hits
{
get { return GetValue<int>(CoreAttribut.Hits); }
}
public virtual int MaxHits
{
get { return GetValue<int>(CoreAttribut.MaxHits); }
}
public virtual int Mana
{
get { return GetValue<int>(CoreAttribut.Mana); }
}
public virtual int MaxMana
{
get { return GetValue<int>(CoreAttribut.MaxMana); }
}
public virtual int Stamina
{
get { return GetValue<int>(CoreAttribut.Stamina); }
}
public virtual int MaxStamina
{
get { return GetValue<int>(CoreAttribut.MaxStamina); }
}
public virtual Notoriety Notoriety
{
get { return GetValue<Notoriety>(CoreAttribut.Notoriety); }
}
public virtual string Name
{
get { return GetValue<string>(CoreAttribut.Name); }
}
public virtual string Title
{
get { return GetValue<string>(CoreAttribut.Title); }
}
public virtual string AltName
{
get { return GetValue<string>(CoreAttribut.AltName); }
}
public virtual Gender Gender
{
get { return GetValue<Gender>(CoreAttribut.Gender); }
}
public Mobile(uint serial)
: base(serial)
{
Register(CoreAttribut.IsRunning);
Register(CoreAttribut.YellowHits);
Register(CoreAttribut.Poisoned);
Register(CoreAttribut.Paralyzed);
Register(CoreAttribut.Hidden);
Register(CoreAttribut.WarMode);
Register(CoreAttribut.Dead);
Register(CoreAttribut.Strength);
Register(CoreAttribut.Intelligence);
Register(CoreAttribut.Dexterity);
Register(CoreAttribut.Hits);
Register(CoreAttribut.MaxHits);
Register(CoreAttribut.Mana);
Register(CoreAttribut.MaxMana);
Register(CoreAttribut.Stamina);
Register(CoreAttribut.MaxStamina);
Register(CoreAttribut.Notoriety);
Register(CoreAttribut.Name);
Register(CoreAttribut.Title);
Register(CoreAttribut.AltName);
Register(CoreAttribut.Gender);
}
protected override object GetRawValue(CoreAttribut attrib)
{
switch (attrib)
{
case CoreAttribut.IsRunning:
return Stealth.Default.IsRunning(Serial);
case CoreAttribut.YellowHits:
return Stealth.Default.IsYellowHits(Serial);
case CoreAttribut.Poisoned:
return Stealth.Default.IsPoisoned(Serial);
case CoreAttribut.Paralyzed:
return Stealth.Default.IsParalyzed(Serial);
case CoreAttribut.Hidden:
return Stealth.Default.IsHidden(Serial);
case CoreAttribut.WarMode:
return Stealth.Default.IsWarMode(Serial);
case CoreAttribut.Dead:
return Stealth.Default.IsDead(Serial);
case CoreAttribut.Strength:
return Stealth.Default.GetStr(Serial);
case CoreAttribut.Intelligence:
return Stealth.Default.GetInt(Serial);
case CoreAttribut.Dexterity:
return Stealth.Default.GetDex(Serial);
case CoreAttribut.Hits:
return Stealth.Default.GetHP(Serial);
case CoreAttribut.MaxHits:
return Stealth.Default.GetMaxHP(Serial);
case CoreAttribut.Mana:
return Stealth.Default.GetMana(Serial);
case CoreAttribut.MaxMana:
return Stealth.Default.GetMaxMana(Serial);
case CoreAttribut.Stamina:
return Stealth.Default.GetStam(Serial);
case CoreAttribut.MaxStamina:
return Stealth.Default.GetMaxStam(Serial);
case CoreAttribut.Notoriety:
{
var b = Stealth.Default.GetNotoriety(Serial);
if ((Enum.GetValues(typeof (Notoriety)) as byte[]).Contains(b))
return (Notoriety) b;
return Notoriety.Invalid;
}
case CoreAttribut.Name:
return Stealth.Default.GetName(Serial);
case CoreAttribut.Title:
return Stealth.Default.GetTitle(Serial);
case CoreAttribut.AltName:
return Stealth.Default.GetAltName(Serial);
case CoreAttribut.Gender:
return Stealth.Default.IsFemale(Serial) ? Gender.female : Gender.male;
default:
return base.GetRawValue(attrib);
}
}
protected override CoreObject CreateInstance()
{
return new Mobile(Serial);
}
protected virtual bool _LineOfSight(BaseObject obj)
{
/* public bool OnLineOfSight(UORootObject o)
{
if (!o.Valid)
return false;
if (o.Map.Equals(Map.Unknown))
return false;
return o.RootParent == this; //|| Utils.LOSHelper.LineOfSight(this, o);
}*/
return true;
}
}
}