PageRenderTime 78ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 1ms

/CoreNew/Server/Mobile.cs

https://bitbucket.org/Kel/crepuscule
C# | 9790 lines | 8788 code | 821 blank | 181 comment | 1936 complexity | 95deb2282523021adef688f83ac1f495 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. namespace Server
  2. {
  3. using Server.Accounting;
  4. using Server.ContextMenus;
  5. using Server.Guilds;
  6. using Server.Gumps;
  7. using Server.HuePickers;
  8. using Server.Items;
  9. using Server.Menus;
  10. using Server.Mobiles;
  11. using Server.Movement;
  12. using Server.Network;
  13. using Server.Prompts;
  14. using Server.Targeting;
  15. using System;
  16. using System.Collections;
  17. using System.Runtime.InteropServices;
  18. using System.Text;
  19. using System.Collections.Generic;
  20. public delegate bool AllowBeneficialHandler(Mobile from, Mobile target);
  21. public delegate bool AllowHarmfulHandler(Mobile from, Mobile target);
  22. public class Mobile : IEntity, IPoint3D, IPoint2D, IHued
  23. {
  24. internal int m_TypeRef;
  25. private Server.AccessLevel m_AccessLevel;
  26. private static string[] m_AccessLevelNames = new string[] { "a player", "a counselor", "a game master", "a seer", "an administrator" };
  27. private IAccount m_Account;
  28. private static TimeSpan m_ActionMessageDelay = TimeSpan.FromSeconds(0.125);
  29. private ArrayList m_Actions;
  30. private ArrayList m_Aggressed;
  31. private ArrayList m_Aggressors;
  32. private static Server.AllowBeneficialHandler m_AllowBeneficialHandler;
  33. private int m_AllowedStealthSteps;
  34. private static Server.AllowHarmfulHandler m_AllowHarmfulHandler;
  35. private static bool m_AsciiClickMessage = true;
  36. private static TimeSpan m_AutoManifestTimeout = TimeSpan.FromSeconds(5.0);
  37. private Timer m_AutoManifestTimer;
  38. private bool m_AutoPageNotify;
  39. private int m_BAC;
  40. private Container m_Backpack;
  41. private Server.Items.BankBox m_BankBox;
  42. private int m_BaseSoundID;
  43. private bool m_Blessed;
  44. private Server.Body m_Body;
  45. private Server.Body m_BodyMod;
  46. private static int m_BodyWeight = 14;
  47. private bool m_CanHearGhosts;
  48. private bool m_CanSwim;
  49. private bool m_CantWalk;
  50. private int m_ChangingCombatant;
  51. private Mobile m_Combatant;
  52. private Timer m_CombatTimer;
  53. private Server.ContextMenus.ContextMenu m_ContextMenu;
  54. private Container m_Corpse;
  55. private static Server.CreateCorpseHandler m_CreateCorpse;
  56. private DateTime m_CreationTime;
  57. private bool m_Criminal;
  58. private ArrayList m_DamageEntries;
  59. private static TimeSpan m_DefaultHitsRate;
  60. private static TimeSpan m_DefaultManaRate;
  61. private static TimeSpan m_DefaultStamRate;
  62. private static IWeapon m_DefaultWeapon;
  63. private bool m_Deleted;
  64. private MobileDelta m_DeltaFlags;
  65. private static Queue m_DeltaQueue = new Queue();
  66. private int m_Dex;
  67. private StatLockType m_DexLock;
  68. private Server.Direction m_Direction;
  69. private static bool m_DisableDismountInWarmode;
  70. private static bool m_DisableHiddenSelfClick = true;
  71. private bool m_DisarmReady;
  72. private bool m_DisplayGuildTitle;
  73. private static bool m_DragEffects = true;
  74. private int m_EmoteHue;
  75. private DateTime m_EndQueue;
  76. private Timer m_ExpireAggrTimer;
  77. private Timer m_ExpireCombatant;
  78. private Timer m_ExpireCriminal;
  79. private static TimeSpan m_ExpireCriminalDelay = TimeSpan.FromMinutes(2.0);
  80. private int m_Fame;
  81. private bool m_Female;
  82. private int m_Followers;
  83. private int m_FollowersMax;
  84. private bool m_Frozen;
  85. private FrozenTimer m_FrozenTimer;
  86. private static Server.AccessLevel m_FwdAccessOverride = Server.AccessLevel.GameMaster;
  87. private static bool m_FwdEnabled = true;
  88. private static int m_FwdMaxSteps = 4;
  89. private static bool m_FwdUOTDOverride = false;
  90. private static char[] m_GhostChars = new char[] { 'o', 'O' };
  91. private static object m_GhostMutateContext = new object();
  92. private BaseGuild m_Guild;
  93. private static bool m_GuildClickMessage = true;
  94. private Mobile m_GuildFealty;
  95. private string m_GuildTitle;
  96. private static string[] m_GuildTypes = new string[] { "", " (Chaos)", " (Order)" };
  97. private static ArrayList m_Hears;
  98. private bool m_Hidden;
  99. private int m_Hits;
  100. private static RegenRateHandler m_HitsRegenRate;
  101. private Timer m_HitsTimer;
  102. private Item m_Holding;
  103. private int m_Hue;
  104. private int m_HueMod;
  105. private int m_Hunger;
  106. private bool m_InDeltaQueue;
  107. private static bool m_InsuranceEnabled;
  108. private int m_Int;
  109. private StatLockType m_IntLock;
  110. private static int[] m_InvalidBodies = new int[] { 0x20, 0x5f, 0x9c, 0xa9, 0xc4, 0xc5, 0xc6, 0xc7 };
  111. private ArrayList m_Items;
  112. private int m_Karma;
  113. private int m_Kills;
  114. private string m_Language;
  115. private Mobile m_LastKiller;
  116. private DateTime m_LastMoveTime;
  117. private DateTime m_LastStatGain;
  118. private int m_LightLevel;
  119. private Point3D m_Location;
  120. private Point3D m_LogoutLocation;
  121. private Server.Map m_LogoutMap;
  122. private Timer m_LogoutTimer;
  123. private int m_MagicDamageAbsorb;
  124. private int m_Mana;
  125. private static RegenRateHandler m_ManaRegenRate;
  126. private Timer m_ManaTimer;
  127. private Server.Map m_Map;
  128. private static int m_MaxPlayerResistance = 70;
  129. private bool m_Meditating;
  130. private int m_MeleeDamageAbsorb;
  131. private Item m_MountItem;
  132. private static ArrayList m_MoveList = new ArrayList();
  133. private Queue m_MoveRecords;
  134. private static MobileMoving[] m_MovingPacketCache = new MobileMoving[8];
  135. private string m_Name;
  136. protected string m_RealName;
  137. private int m_NameHue;
  138. private string m_NameMod;
  139. private Server.Network.NetState m_NetState;
  140. private DateTime m_NextActionMessage;
  141. private DateTime m_NextActionTime;
  142. private DateTime m_NextCombatTime;
  143. private DateTime m_NextSkillTime;
  144. private DateTime m_NextSpellTime;
  145. private DateTime m_NextWarmodeChange;
  146. private static bool m_NoSpeechLOS;
  147. private static ArrayList m_OnSpeech;
  148. private Packet m_OPLPacket;
  149. private bool m_Paralyzed;
  150. private ParalyzedTimer m_ParaTimer;
  151. private object m_Party;
  152. private bool m_Player;
  153. private Server.Poison m_Poison;
  154. private Timer m_PoisonTimer;
  155. private string m_Profile;
  156. private bool m_ProfileLocked;
  157. private Server.Prompts.Prompt m_Prompt;
  158. private ObjectPropertyList m_PropertyList;
  159. private bool m_Pushing;
  160. private Server.QuestArrow m_QuestArrow;
  161. private Server.Region m_Region;
  162. private Packet m_RemovePacket;
  163. private int[] m_Resistances;
  164. private ArrayList m_ResistMods;
  165. private static TimeSpan m_RunFoot = TimeSpan.FromSeconds(0.2);
  166. private static TimeSpan m_RunMount = TimeSpan.FromSeconds(0.1);
  167. private Server.Serial m_Serial;
  168. private int m_ShortTermMurders;
  169. private static Server.SkillCheckDirectLocationHandler m_SkillCheckDirectLocationHandler;
  170. private static Server.SkillCheckDirectTargetHandler m_SkillCheckDirectTargetHandler;
  171. private static Server.SkillCheckLocationHandler m_SkillCheckLocationHandler;
  172. private static Server.SkillCheckTargetHandler m_SkillCheckTargetHandler;
  173. private ArrayList m_SkillMods;
  174. private Server.Skills m_Skills;
  175. private int m_SolidHueOverride;
  176. private int m_SpeechHue;
  177. private ISpell m_Spell;
  178. private bool m_Squelched;
  179. private ArrayList m_Stabled;
  180. private int m_Stam;
  181. private static RegenRateHandler m_StamRegenRate;
  182. private Timer m_StamTimer;
  183. private int m_StatCap;
  184. private ArrayList m_StatMods;
  185. private int m_Str;
  186. private StatLockType m_StrLock;
  187. private DateTime[] m_StuckMenuUses;
  188. private bool m_StunReady;
  189. private Server.Targeting.Target m_Target;
  190. private bool m_TargetLocked;
  191. private int m_Thirst;
  192. private int m_TithingPoints;
  193. private string m_Title;
  194. private int m_TotalGold;
  195. private int m_TotalWeight;
  196. private int m_VirtualArmor;
  197. private int m_VirtualArmorMod;
  198. private VirtueInfo m_Virtues;
  199. private static Server.VisibleDamageType m_VisibleDamageType;
  200. private static TimeSpan m_WalkFoot = TimeSpan.FromSeconds(0.4);
  201. private static TimeSpan m_WalkMount = TimeSpan.FromSeconds(0.2);
  202. private bool m_Warmode;
  203. private int m_WarmodeChanges;
  204. private WarmodeTimer m_WarmodeTimer;
  205. private IWeapon m_Weapon;
  206. private int m_WhisperHue;
  207. private int m_YellHue;
  208. private bool m_YellowHealthbar;
  209. private const int WarmodeCatchCount = 4;
  210. private static TimeSpan WarmodeSpamCatch = TimeSpan.FromSeconds(0.5);
  211. private static TimeSpan WarmodeSpamDelay = TimeSpan.FromSeconds(2.0);
  212. #region RunUO 2 Stuff
  213. // Pre-7.0.0.0 Packet Flags
  214. public virtual int GetOldPacketFlags()
  215. {
  216. int flags = 0x0;
  217. if (m_Female)
  218. flags |= 0x02;
  219. if (m_Poison != null)
  220. flags |= 0x04;
  221. if (m_Blessed || m_YellowHealthbar)
  222. flags |= 0x08;
  223. if (m_Warmode)
  224. flags |= 0x40;
  225. if (m_Hidden)
  226. flags |= 0x80;
  227. return flags;
  228. }
  229. #region Hair
  230. private HairInfo m_Hair;
  231. private FacialHairInfo m_FacialHair;
  232. public void ConvertHair()
  233. {
  234. Item hair;
  235. if ((hair = FindItemOnLayer(Layer.Hair)) != null)
  236. {
  237. HairItemID = hair.ItemID;
  238. HairHue = hair.Hue;
  239. hair.Delete();
  240. }
  241. if ((hair = FindItemOnLayer(Layer.FacialHair)) != null)
  242. {
  243. FacialHairItemID = hair.ItemID;
  244. FacialHairHue = hair.Hue;
  245. hair.Delete();
  246. }
  247. }
  248. [CommandProperty(AccessLevel.GameMaster)]
  249. public int HairItemID
  250. {
  251. get
  252. {
  253. if (m_Hair == null)
  254. return 0;
  255. return m_Hair.ItemID;
  256. }
  257. set
  258. {
  259. if (m_Hair == null && value > 0)
  260. m_Hair = new HairInfo(value);
  261. else if (value <= 0)
  262. m_Hair = null;
  263. else
  264. m_Hair.ItemID = value;
  265. Delta(MobileDelta.Hair);
  266. }
  267. }
  268. // [CommandProperty( AccessLevel.GameMaster )]
  269. // public int HairSerial { get { return HairInfo.FakeSerial( this ); } }
  270. [CommandProperty(AccessLevel.GameMaster)]
  271. public int FacialHairItemID
  272. {
  273. get
  274. {
  275. if (m_FacialHair == null)
  276. return 0;
  277. return m_FacialHair.ItemID;
  278. }
  279. set
  280. {
  281. if (m_FacialHair == null && value > 0)
  282. m_FacialHair = new FacialHairInfo(value);
  283. else if (value <= 0)
  284. m_FacialHair = null;
  285. else
  286. m_FacialHair.ItemID = value;
  287. Delta(MobileDelta.FacialHair);
  288. }
  289. }
  290. // [CommandProperty( AccessLevel.GameMaster )]
  291. // public int FacialHairSerial { get { return FacialHairInfo.FakeSerial( this ); } }
  292. [CommandProperty(AccessLevel.GameMaster)]
  293. public int HairHue
  294. {
  295. get
  296. {
  297. if (m_Hair == null)
  298. return 0;
  299. return m_Hair.Hue;
  300. }
  301. set
  302. {
  303. if (m_Hair != null)
  304. {
  305. m_Hair.Hue = value;
  306. Delta(MobileDelta.Hair);
  307. }
  308. }
  309. }
  310. [CommandProperty(AccessLevel.GameMaster)]
  311. public int FacialHairHue
  312. {
  313. get
  314. {
  315. if (m_FacialHair == null)
  316. return 0;
  317. return m_FacialHair.Hue;
  318. }
  319. set
  320. {
  321. if (m_FacialHair != null)
  322. {
  323. m_FacialHair.Hue = value;
  324. Delta(MobileDelta.FacialHair);
  325. }
  326. }
  327. }
  328. #endregion
  329. public void ClearProperties()
  330. {
  331. Packet.Release(ref m_PropertyList);
  332. Packet.Release(ref m_OPLPacket);
  333. }
  334. public virtual void GetChildNameProperties(ObjectPropertyList list, Item item)
  335. {
  336. }
  337. public virtual void UpdateTotal(Item sender, TotalType type, int delta)
  338. {
  339. if (delta == 0 || sender.IsVirtualItem)
  340. return;
  341. switch (type)
  342. {
  343. case TotalType.Gold:
  344. m_TotalGold += delta;
  345. Delta(MobileDelta.Gold);
  346. break;
  347. case TotalType.Items:
  348. //m_TotalItems += delta;
  349. break;
  350. case TotalType.Weight:
  351. m_TotalWeight += delta;
  352. Delta(MobileDelta.Weight);
  353. OnWeightChange(m_TotalWeight - delta);
  354. break;
  355. }
  356. }
  357. public virtual void OnItemBounceCleared(Item item)
  358. {
  359. }
  360. public virtual void OnSubItemBounceCleared( Item item )
  361. {
  362. }
  363. public static Item LiftItemDupe(Item oldItem, int amount)
  364. {
  365. Item item;
  366. try
  367. {
  368. item = (Item)Activator.CreateInstance(oldItem.GetType());
  369. }
  370. catch
  371. {
  372. Console.WriteLine("Warning: 0x{0:X}: Item must have a zero paramater constructor to be separated from a stack. '{1}'.", oldItem.Serial.Value, oldItem.GetType().Name);
  373. return null;
  374. }
  375. item.Visible = oldItem.Visible;
  376. item.Movable = oldItem.Movable;
  377. item.LootType = oldItem.LootType;
  378. item.Direction = oldItem.Direction;
  379. item.Hue = oldItem.Hue;
  380. item.ItemID = oldItem.ItemID;
  381. item.Location = oldItem.Location;
  382. item.Layer = oldItem.Layer;
  383. item.Name = oldItem.Name;
  384. item.Weight = oldItem.Weight;
  385. item.Amount = oldItem.Amount - amount;
  386. item.Map = oldItem.Map;
  387. oldItem.Amount = amount;
  388. oldItem.OnAfterDuped(item);
  389. if (oldItem.Parent is Mobile)
  390. {
  391. ((Mobile)oldItem.Parent).AddItem(item);
  392. }
  393. else if (oldItem.Parent is Item)
  394. {
  395. ((Item)oldItem.Parent).AddItem(item);
  396. }
  397. item.Delta(ItemDelta.Update);
  398. return item;
  399. }
  400. #endregion
  401. public Mobile()
  402. {
  403. this.m_NameHue = -1;
  404. this.m_WarmodeChanges = 0;
  405. this.m_SkillMods = new ArrayList(1);
  406. this.m_HueMod = -1;
  407. this.m_SolidHueOverride = -1;
  408. this.m_Region = Server.Map.Internal.DefaultRegion;
  409. this.m_Serial = Server.Serial.NewMobile;
  410. this.DefaultMobileInit();
  411. World.AddMobile(this);
  412. Type ourType = this.GetType();
  413. m_TypeRef = World.m_MobileTypes.IndexOf(ourType);
  414. if (m_TypeRef == -1)
  415. m_TypeRef = World.m_MobileTypes.Add(ourType);
  416. }
  417. public Mobile(Server.Serial serial)
  418. {
  419. this.m_NameHue = -1;
  420. this.m_WarmodeChanges = 0;
  421. this.m_SkillMods = new ArrayList(1);
  422. this.m_HueMod = -1;
  423. this.m_SolidHueOverride = -1;
  424. this.m_Region = Server.Map.Internal.DefaultRegion;
  425. this.m_Serial = serial;
  426. this.m_ExpireCombatant = new ExpireCombatantTimer(this);
  427. this.m_ExpireCriminal = new ExpireCriminalTimer(this);
  428. this.m_CombatTimer = new CombatTimer(this);
  429. this.m_Aggressors = new ArrayList(1);
  430. this.m_Aggressed = new ArrayList(1);
  431. this.m_NextSkillTime = DateTime.MinValue;
  432. this.m_DamageEntries = new ArrayList(1);
  433. this.m_LogoutTimer = new LogoutTimer(this);
  434. Type ourType = this.GetType();
  435. m_TypeRef = World.m_MobileTypes.IndexOf(ourType);
  436. if (m_TypeRef == -1)
  437. m_TypeRef = World.m_MobileTypes.Add(ourType);
  438. }
  439. public void AddItem(Item item)
  440. {
  441. if (((item != null) && !item.Deleted) && (item.Parent != this))
  442. {
  443. if (item.Parent is Mobile)
  444. {
  445. ((Mobile) item.Parent).RemoveItem(item);
  446. }
  447. else if (item.Parent is Item)
  448. {
  449. ((Item) item.Parent).RemoveItem(item);
  450. }
  451. else
  452. {
  453. item.SendRemovePacket();
  454. }
  455. item.Parent = this;
  456. item.Map = this.m_Map;
  457. this.m_Items.Add(item);
  458. if (!(item is Server.Items.BankBox))
  459. {
  460. this.TotalWeight += item.TotalWeight + item.PileWeight;
  461. this.TotalGold += item.TotalGold;
  462. }
  463. item.Delta(ItemDelta.Update);
  464. item.OnAdded(this);
  465. this.OnItemAdded(item);
  466. if (((item.PhysicalResistance != 0) || (item.FireResistance != 0)) || (((item.ColdResistance != 0) || (item.PoisonResistance != 0)) || (item.EnergyResistance != 0)))
  467. {
  468. this.UpdateResistances();
  469. }
  470. }
  471. }
  472. public virtual void AddNameProperties(ObjectPropertyList list)
  473. {
  474. string name = this.Name;
  475. if (name == null)
  476. {
  477. name = string.Empty;
  478. }
  479. string str2 = "";
  480. if ((this.ShowFameTitle && (this.m_Player || this.m_Body.IsHuman)) && (this.m_Fame >= 0x2710))
  481. {
  482. str2 = this.m_Female ? "Lady" : "Lord";
  483. }
  484. string title = "";
  485. if ((this.ClickTitle && (this.Title != null)) && (this.Title.Length > 0))
  486. {
  487. title = this.Title;
  488. }
  489. BaseGuild guild = this.m_Guild;
  490. if ((guild != null) && (this.m_Player || this.m_DisplayGuildTitle))
  491. {
  492. if (title.Length > 0)
  493. {
  494. title = string.Format("{0} [{1}]", title, Utility.FixHtml(guild.Abbreviation));
  495. }
  496. else
  497. {
  498. title = string.Format("[{0}]", Utility.FixHtml(guild.Abbreviation));
  499. }
  500. }
  501. list.Add(0x1005bd, "{0} \t{1}\t {2}", str2, name, title);
  502. if ((guild != null) && (this.m_DisplayGuildTitle || (this.m_Player && (guild.Type != GuildType.None))))
  503. {
  504. string str4;
  505. if ((guild.Type >= GuildType.None) && ((int)guild.Type < m_GuildTypes.Length))
  506. {
  507. str4 = m_GuildTypes[(int) guild.Type];
  508. }
  509. else
  510. {
  511. str4 = "";
  512. }
  513. string guildTitle = this.GuildTitle;
  514. if (guildTitle == null)
  515. {
  516. guildTitle = "";
  517. }
  518. else
  519. {
  520. guildTitle = guildTitle.Trim();
  521. }
  522. if (guildTitle.Length > 0)
  523. {
  524. list.Add("{0}, {1} Guild{2}", Utility.FixHtml(guildTitle), Utility.FixHtml(guild.Name), str4);
  525. }
  526. else
  527. {
  528. list.Add(Utility.FixHtml(guild.Name));
  529. }
  530. }
  531. }
  532. public virtual void AddResistanceMod(ResistanceMod toAdd)
  533. {
  534. if (this.m_ResistMods == null)
  535. {
  536. this.m_ResistMods = new ArrayList(2);
  537. }
  538. this.m_ResistMods.Add(toAdd);
  539. this.UpdateResistances();
  540. }
  541. public virtual void AddSkillMod(SkillMod mod)
  542. {
  543. if (mod != null)
  544. {
  545. this.ValidateSkillMods();
  546. if (!this.m_SkillMods.Contains(mod))
  547. {
  548. this.m_SkillMods.Add(mod);
  549. mod.Owner = this;
  550. Skill skill = this.m_Skills[mod.Skill];
  551. if (skill != null)
  552. {
  553. skill.Update();
  554. }
  555. }
  556. }
  557. }
  558. private void AddSpeechItemsFrom(ArrayList list, Container cont)
  559. {
  560. for (int i = 0; i < cont.Items.Count; i++)
  561. {
  562. Item item = (Item) cont.Items[i];
  563. if (item.HandlesOnSpeech)
  564. {
  565. list.Add(item);
  566. }
  567. if (item is Container)
  568. {
  569. this.AddSpeechItemsFrom(list, (Container) item);
  570. }
  571. }
  572. }
  573. public void AddStatMod(StatMod mod)
  574. {
  575. for (int i = 0; i < this.m_StatMods.Count; i++)
  576. {
  577. StatMod mod2 = (StatMod) this.m_StatMods[i];
  578. if (mod2.Name == mod.Name)
  579. {
  580. this.Delta(MobileDelta.Stat);
  581. this.m_StatMods.RemoveAt(i);
  582. break;
  583. }
  584. }
  585. this.m_StatMods.Add(mod);
  586. this.Delta(MobileDelta.Stat);
  587. this.CheckStatTimers();
  588. }
  589. public bool AddToBackpack(Item item)
  590. {
  591. if (item.Deleted)
  592. {
  593. return false;
  594. }
  595. if (!this.PlaceInBackpack(item))
  596. {
  597. item.MoveToWorld(this.Location, this.Map);
  598. return false;
  599. }
  600. return true;
  601. }
  602. public virtual void AggressiveAction(Mobile aggressor)
  603. {
  604. this.AggressiveAction(aggressor, false);
  605. }
  606. public virtual void AggressiveAction(Mobile aggressor, bool criminal)
  607. {
  608. if (aggressor != this)
  609. {
  610. AggressiveActionEventArgs e = AggressiveActionEventArgs.Create(this, aggressor, criminal);
  611. EventSink.InvokeAggressiveAction(e);
  612. e.Free();
  613. if (this.Combatant == aggressor)
  614. {
  615. this.m_ExpireCombatant.Stop();
  616. this.m_ExpireCombatant.Start();
  617. }
  618. bool flag = true;
  619. ArrayList aggressors = this.m_Aggressors;
  620. for (int i = 0; i < aggressors.Count; i++)
  621. {
  622. AggressorInfo info = (AggressorInfo) aggressors[i];
  623. if (info.Attacker == aggressor)
  624. {
  625. info.Refresh();
  626. info.CriminalAggression = criminal;
  627. info.CanReportMurder = criminal;
  628. flag = false;
  629. }
  630. }
  631. aggressors = aggressor.m_Aggressors;
  632. for (int j = 0; j < aggressors.Count; j++)
  633. {
  634. AggressorInfo info2 = (AggressorInfo) aggressors[j];
  635. if (info2.Attacker == this)
  636. {
  637. info2.Refresh();
  638. flag = false;
  639. }
  640. }
  641. bool flag2 = true;
  642. aggressors = this.m_Aggressed;
  643. for (int k = 0; k < aggressors.Count; k++)
  644. {
  645. AggressorInfo info3 = (AggressorInfo) aggressors[k];
  646. if (info3.Defender == aggressor)
  647. {
  648. info3.Refresh();
  649. flag2 = false;
  650. }
  651. }
  652. aggressors = aggressor.m_Aggressed;
  653. for (int m = 0; m < aggressors.Count; m++)
  654. {
  655. AggressorInfo info4 = (AggressorInfo) aggressors[m];
  656. if (info4.Defender == this)
  657. {
  658. info4.Refresh();
  659. info4.CriminalAggression = criminal;
  660. info4.CanReportMurder = criminal;
  661. flag2 = false;
  662. }
  663. }
  664. bool flag3 = false;
  665. if (flag)
  666. {
  667. this.m_Aggressors.Add(AggressorInfo.Create(aggressor, this, criminal));
  668. if (this.CanSee(aggressor) && (this.m_NetState != null))
  669. {
  670. this.m_NetState.Send(new MobileIncoming(this, aggressor));
  671. }
  672. if (this.Combatant == null)
  673. {
  674. flag3 = true;
  675. }
  676. this.UpdateAggrExpire();
  677. }
  678. if (flag2)
  679. {
  680. aggressor.m_Aggressed.Add(AggressorInfo.Create(aggressor, this, criminal));
  681. if (this.CanSee(aggressor) && (this.m_NetState != null))
  682. {
  683. this.m_NetState.Send(new MobileIncoming(this, aggressor));
  684. }
  685. if (this.Combatant == null)
  686. {
  687. flag3 = true;
  688. }
  689. this.UpdateAggrExpire();
  690. }
  691. if (flag3)
  692. {
  693. this.Combatant = aggressor;
  694. }
  695. this.Region.OnAggressed(aggressor, this, criminal);
  696. }
  697. }
  698. public virtual bool AllowItemUse(Item item)
  699. {
  700. return true;
  701. }
  702. public virtual bool AllowSkillUse(SkillName name)
  703. {
  704. return true;
  705. }
  706. public virtual void Animate(int action, int frameCount, int repeatCount, bool forward, bool repeat, int delay)
  707. {
  708. Server.Map map = this.m_Map;
  709. if (map != null)
  710. {
  711. this.ProcessDelta();
  712. Packet p = null;
  713. IPooledEnumerable clientsInRange = map.GetClientsInRange(this.m_Location);
  714. foreach (Server.Network.NetState state in clientsInRange)
  715. {
  716. if (state.Mobile.CanSee(this))
  717. {
  718. state.Mobile.ProcessDelta();
  719. if (p == null)
  720. {
  721. p = new MobileAnimation(this, action, frameCount, repeatCount, forward, repeat, delay);
  722. }
  723. state.Send(p);
  724. }
  725. }
  726. clientsInRange.Free();
  727. }
  728. }
  729. public virtual ApplyPoisonResult ApplyPoison(Mobile from, Server.Poison poison)
  730. {
  731. if (poison == null)
  732. {
  733. this.CurePoison(from);
  734. return ApplyPoisonResult.Cured;
  735. }
  736. if (this.CheckHigherPoison(from, poison))
  737. {
  738. this.OnHigherPoison(from, poison);
  739. return ApplyPoisonResult.HigherPoisonActive;
  740. }
  741. if (this.CheckPoisonImmunity(from, poison))
  742. {
  743. this.OnPoisonImmunity(from, poison);
  744. return ApplyPoisonResult.Immune;
  745. }
  746. Server.Poison oldPoison = this.m_Poison;
  747. this.Poison = poison;
  748. this.OnPoisoned(from, poison, oldPoison);
  749. return ApplyPoisonResult.Poisoned;
  750. }
  751. public virtual void Attack(Mobile m)
  752. {
  753. if (this.CheckAttack(m))
  754. {
  755. this.Combatant = m;
  756. }
  757. }
  758. public bool BeginAction(object toLock)
  759. {
  760. if (this.m_Actions == null)
  761. {
  762. this.m_Actions = new ArrayList(2);
  763. this.m_Actions.Add(toLock);
  764. return true;
  765. }
  766. if (!this.m_Actions.Contains(toLock))
  767. {
  768. this.m_Actions.Add(toLock);
  769. return true;
  770. }
  771. return false;
  772. }
  773. public Server.Targeting.Target BeginTarget(int range, bool allowGround, TargetFlags flags, TargetCallback callback)
  774. {
  775. Server.Targeting.Target target = new SimpleTarget(range, flags, allowGround, callback);
  776. this.Target = target;
  777. return target;
  778. }
  779. public Server.Targeting.Target BeginTarget(int range, bool allowGround, TargetFlags flags, TargetStateCallback callback, object state)
  780. {
  781. Server.Targeting.Target target = new SimpleStateTarget(range, flags, allowGround, callback, state);
  782. this.Target = target;
  783. return target;
  784. }
  785. public virtual bool BeneficialCheck(Mobile target)
  786. {
  787. if (this.CanBeBeneficial(target, true))
  788. {
  789. this.DoBeneficial(target);
  790. return true;
  791. }
  792. return false;
  793. }
  794. public void BoltEffect(int hue)
  795. {
  796. Effects.SendBoltEffect(this, true, hue);
  797. }
  798. public virtual bool CanBeBeneficial(Mobile target)
  799. {
  800. return this.CanBeBeneficial(target, true, false);
  801. }
  802. public virtual bool CanBeBeneficial(Mobile target, bool message)
  803. {
  804. return this.CanBeBeneficial(target, message, false);
  805. }
  806. public virtual bool CanBeBeneficial(Mobile target, bool message, bool allowDead)
  807. {
  808. if (target != null)
  809. {
  810. if (((this.m_Deleted || target.m_Deleted) || (!this.Alive || this.IsDeadBondedPet)) || (!allowDead && (!target.Alive || this.IsDeadBondedPet)))
  811. {
  812. if (message)
  813. {
  814. this.SendLocalizedMessage(0xf4639);
  815. }
  816. return false;
  817. }
  818. if (target == this)
  819. {
  820. return true;
  821. }
  822. if (this.Region.AllowBenificial(this, target))
  823. {
  824. return true;
  825. }
  826. if (message)
  827. {
  828. this.SendLocalizedMessage(0xf4639);
  829. }
  830. }
  831. return false;
  832. }
  833. public virtual bool CanBeDamaged()
  834. {
  835. return !this.m_Blessed;
  836. }
  837. public bool CanBeginAction(object toLock)
  838. {
  839. if (this.m_Actions != null)
  840. {
  841. return !this.m_Actions.Contains(toLock);
  842. }
  843. return true;
  844. }
  845. public virtual bool CanBeHarmful(Mobile target)
  846. {
  847. return this.CanBeHarmful(target, true);
  848. }
  849. public virtual bool CanBeHarmful(Mobile target, bool message)
  850. {
  851. return this.CanBeHarmful(target, message, false);
  852. }
  853. public virtual bool CanBeHarmful(Mobile target, bool message, bool ignoreOurBlessedness)
  854. {
  855. if (target != null)
  856. {
  857. if ((this.m_Deleted || (!ignoreOurBlessedness && this.m_Blessed)) || (((target.m_Deleted || target.m_Blessed) || (!this.Alive || this.IsDeadBondedPet)) || (!target.Alive || target.IsDeadBondedPet)))
  858. {
  859. if (message)
  860. {
  861. this.SendLocalizedMessage(0xf463a);
  862. }
  863. return false;
  864. }
  865. if (target == this)
  866. {
  867. return true;
  868. }
  869. if (this.Region.AllowHarmful(this, target))
  870. {
  871. return true;
  872. }
  873. if (message)
  874. {
  875. this.SendLocalizedMessage(0xf463a);
  876. }
  877. }
  878. return false;
  879. }
  880. public virtual bool CanBeRenamedBy(Mobile from)
  881. {
  882. return (from.m_AccessLevel > this.m_AccessLevel);
  883. }
  884. public virtual bool CanPaperdollBeOpenedBy(Mobile from)
  885. {
  886. if (!this.Body.IsHuman && !this.Body.IsGhost)
  887. {
  888. return this.IsBodyMod;
  889. }
  890. return true;
  891. }
  892. public virtual bool CanSee(Item item)
  893. {
  894. if (this.m_Map == Server.Map.Internal)
  895. {
  896. return false;
  897. }
  898. if (item.Map == Server.Map.Internal)
  899. {
  900. return false;
  901. }
  902. if (item.Parent != null)
  903. {
  904. if (item.Parent is Item)
  905. {
  906. if (!this.CanSee((Item) item.Parent))
  907. {
  908. return false;
  909. }
  910. }
  911. else if ((item.Parent is Mobile) && !this.CanSee((Mobile) item.Parent))
  912. {
  913. return false;
  914. }
  915. }
  916. if (item is Server.Items.BankBox)
  917. {
  918. Server.Items.BankBox box = item as Server.Items.BankBox;
  919. if (((box != null) && (this.m_AccessLevel <= Server.AccessLevel.Counselor)) && ((box.Owner != this) || !box.Opened))
  920. {
  921. return false;
  922. }
  923. }
  924. else if (item is SecureTradeContainer)
  925. {
  926. SecureTrade trade = ((SecureTradeContainer) item).Trade;
  927. if (((trade != null) && (trade.From.Mobile != this)) && (trade.To.Mobile != this))
  928. {
  929. return false;
  930. }
  931. }
  932. if (item.Deleted || (item.Map != this.m_Map))
  933. {
  934. return false;
  935. }
  936. if (!item.Visible)
  937. {
  938. return (this.m_AccessLevel > Server.AccessLevel.Counselor);
  939. }
  940. return true;
  941. }
  942. public virtual bool CanSee(Mobile m)
  943. {
  944. if ((this.m_Deleted || m.m_Deleted) || ((this.m_Map == Server.Map.Internal) || (m.m_Map == Server.Map.Internal)))
  945. {
  946. return false;
  947. }
  948. if (this != m)
  949. {
  950. if ((m.m_Map != this.m_Map) || (m.Hidden && (this.m_AccessLevel <= m.AccessLevel)))
  951. {
  952. return false;
  953. }
  954. if ((!m.Alive && this.Alive) && (this.m_AccessLevel <= Server.AccessLevel.Player))
  955. {
  956. return m.Warmode;
  957. }
  958. }
  959. return true;
  960. }
  961. public virtual bool CanSee(object o)
  962. {
  963. if (o is Item)
  964. {
  965. return this.CanSee((Item) o);
  966. }
  967. if (o is Mobile)
  968. {
  969. return this.CanSee((Mobile) o);
  970. }
  971. return true;
  972. }
  973. public bool CanUseStuckMenu()
  974. {
  975. if (this.m_StuckMenuUses == null)
  976. {
  977. return true;
  978. }
  979. for (int i = 0; i < this.m_StuckMenuUses.Length; i++)
  980. {
  981. if ((DateTime.Now - this.m_StuckMenuUses[i]) > TimeSpan.FromDays(1.0))
  982. {
  983. return true;
  984. }
  985. }
  986. return false;
  987. }
  988. private void CheckAggrExpire()
  989. {
  990. for (int i = this.m_Aggressors.Count - 1; i >= 0; i--)
  991. {
  992. if (i < this.m_Aggressors.Count)
  993. {
  994. AggressorInfo info = (AggressorInfo) this.m_Aggressors[i];
  995. if (info.Expired)
  996. {
  997. Mobile attacker = info.Attacker;
  998. attacker.RemoveAggressed(this);
  999. this.m_Aggressors.RemoveAt(i);
  1000. info.Free();
  1001. if (((this.m_NetState != null) && this.CanSee(attacker)) && Utility.InUpdateRange(this.m_Location, attacker.m_Location))
  1002. {
  1003. this.m_NetState.Send(new MobileIncoming(this, attacker));
  1004. }
  1005. }
  1006. }
  1007. }
  1008. for (int j = this.m_Aggressed.Count - 1; j >= 0; j--)
  1009. {
  1010. if (j < this.m_Aggressed.Count)
  1011. {
  1012. AggressorInfo info2 = (AggressorInfo) this.m_Aggressed[j];
  1013. if (info2.Expired)
  1014. {
  1015. Mobile defender = info2.Defender;
  1016. defender.RemoveAggressor(this);
  1017. this.m_Aggressed.RemoveAt(j);
  1018. info2.Free();
  1019. if (((this.m_NetState != null) && this.CanSee(defender)) && Utility.InUpdateRange(this.m_Location, defender.m_Location))
  1020. {
  1021. this.m_NetState.Send(new MobileIncoming(this, defender));
  1022. }
  1023. }
  1024. }
  1025. }
  1026. this.UpdateAggrExpire();
  1027. }
  1028. public bool CheckAlive()
  1029. {
  1030. return this.CheckAlive(true);
  1031. }
  1032. public bool CheckAlive(bool message)
  1033. {
  1034. if (this.Alive)
  1035. {
  1036. return true;
  1037. }
  1038. if (message)
  1039. {
  1040. this.LocalOverheadMessage(MessageType.Regular, 0x3b2, 0xf8ca8);
  1041. }
  1042. return false;
  1043. }
  1044. public virtual bool CheckAttack(Mobile m)
  1045. {
  1046. return ((Utility.InUpdateRange(this, m) && this.CanSee(m)) && this.InLOS(m));
  1047. }
  1048. public virtual bool CheckContextMenuDisplay(IEntity target)
  1049. {
  1050. return true;
  1051. }
  1052. public virtual bool CheckCure(Mobile from)
  1053. {
  1054. return true;
  1055. }
  1056. public virtual bool CheckEquip(Item item)
  1057. {
  1058. for (int i = 0; i < this.m_Items.Count; i++)
  1059. {
  1060. if (((Item) this.m_Items[i]).CheckConflictingLayer(this, item, item.Layer) || item.CheckConflictingLayer(this, (Item) this.m_Items[i], ((Item) this.m_Items[i]).Layer))
  1061. {
  1062. return false;
  1063. }
  1064. }
  1065. return true;
  1066. }
  1067. public virtual bool CheckHearsMutatedSpeech(Mobile m, object context)
  1068. {
  1069. return ((context != m_GhostMutateContext) || (m.Alive && !m.CanHearGhosts));
  1070. }
  1071. public virtual bool CheckHigherPoison(Mobile from, Server.Poison poison)
  1072. {
  1073. return ((this.m_Poison != null) && (this.m_Poison.Level >= poison.Level));
  1074. }
  1075. public virtual bool CheckItemUse(Mobile from, Item item)
  1076. {
  1077. return true;
  1078. }
  1079. public virtual bool CheckLift(Mobile from, Item item, ref LRReason reject)
  1080. {
  1081. return true;
  1082. }
  1083. public virtual void CheckLightLevels(bool forceResend)
  1084. {
  1085. }
  1086. public virtual bool CheckMovement(Server.Direction d, out int newZ)
  1087. {
  1088. return Server.Movement.Movement.CheckMovement(this, d, out newZ);
  1089. }
  1090. public virtual bool CheckNonlocalDrop(Mobile from, Item item, Item target)
  1091. {
  1092. if ((from != this) && ((from.AccessLevel <= this.AccessLevel) || (from.AccessLevel < Server.AccessLevel.GameMaster)))
  1093. {
  1094. return false;
  1095. }
  1096. return true;
  1097. }
  1098. public virtual bool CheckNonlocalLift(Mobile from, Item item)
  1099. {
  1100. if ((from != this) && ((from.AccessLevel <= this.AccessLevel) || (from.AccessLevel < Server.AccessLevel.GameMaster)))
  1101. {
  1102. return false;
  1103. }
  1104. return true;
  1105. }
  1106. public virtual bool CheckPoisonImmunity(Mobile from, Server.Poison poison)
  1107. {
  1108. return false;
  1109. }
  1110. public virtual bool CheckResurrect()
  1111. {
  1112. return true;
  1113. }
  1114. public bool CheckSkill(SkillName skill, double chance)
  1115. {
  1116. if (m_SkillCheckDirectLocationHandler == null)
  1117. {
  1118. return false;
  1119. }
  1120. return m_SkillCheckDirectLocationHandler(this, skill, chance);
  1121. }
  1122. public bool CheckSkill(SkillName skill, double minSkill, double maxSkill)
  1123. {
  1124. if (m_SkillCheckLocationHandler == null)
  1125. {
  1126. return false;
  1127. }
  1128. return m_SkillCheckLocationHandler(this, skill, minSkill, maxSkill);
  1129. }
  1130. public virtual bool CheckSpeechManifest()
  1131. {
  1132. if (this.Alive)
  1133. {
  1134. return false;
  1135. }
  1136. TimeSpan autoManifestTimeout = m_AutoManifestTimeout;
  1137. if ((autoManifestTimeout <= TimeSpan.Zero) || (this.Warmode && (this.m_AutoManifestTimer == null)))
  1138. {
  1139. return false;
  1140. }
  1141. this.Manifest(autoManifestTimeout);
  1142. return true;
  1143. }
  1144. public virtual bool CheckSpellCast(ISpell spell)
  1145. {
  1146. return true;
  1147. }
  1148. public virtual void CheckStatTimers()
  1149. {
  1150. if (this.Hits < this.HitsMax)
  1151. {
  1152. if (this.m_HitsTimer == null)
  1153. {
  1154. this.m_HitsTimer = new HitsTimer(this);
  1155. }
  1156. this.m_HitsTimer.Start();
  1157. }
  1158. else
  1159. {
  1160. this.Hits = this.HitsMax;
  1161. }
  1162. if (this.Stam < this.StamMax)
  1163. {
  1164. if (this.m_StamTimer == null)
  1165. {
  1166. this.m_StamTimer = new StamTimer(this);
  1167. }
  1168. this.m_StamTimer.Start();
  1169. }
  1170. else
  1171. {
  1172. this.Stam = this.StamMax;
  1173. }
  1174. if (this.Mana < this.ManaMax)
  1175. {
  1176. if (this.m_ManaTimer == null)
  1177. {
  1178. this.m_ManaTimer = new ManaTimer(this);
  1179. }
  1180. this.m_ManaTimer.Start();
  1181. }
  1182. else
  1183. {
  1184. this.Mana = this.ManaMax;
  1185. }
  1186. }
  1187. public virtual bool CheckTarget(Mobile from, Server.Targeting.Target targ, object targeted)
  1188. {
  1189. return true;
  1190. }
  1191. public bool CheckTargetSkill(SkillName skill, object target, double chance)
  1192. {
  1193. if (m_SkillCheckDirectTargetHandler == null)
  1194. {
  1195. return false;
  1196. }
  1197. return m_SkillCheckDirectTargetHandler(this, skill, target, chance);
  1198. }
  1199. public bool CheckTargetSkill(SkillName skill, object target, double minSkill, double maxSkill)
  1200. {
  1201. if (m_SkillCheckTargetHandler == null)
  1202. {
  1203. return false;
  1204. }
  1205. return m_SkillCheckTargetHandler(this, skill, target, minSkill, maxSkill);
  1206. }
  1207. public virtual void ClearFastwalkStack()
  1208. {
  1209. if ((this.m_MoveRecords != null) && (this.m_MoveRecords.Count > 0))
  1210. {
  1211. this.m_MoveRecords.Clear();
  1212. }
  1213. this.m_EndQueue = DateTime.Now;
  1214. }
  1215. public virtual void ClearHand(Item item)
  1216. {
  1217. if (((item != null) && item.Movable) && !item.AllowEquipedCast(this))
  1218. {
  1219. this.AddToBackpack(item);
  1220. }
  1221. }
  1222. public virtual void ClearHands()
  1223. {
  1224. this.ClearHand(this.FindItemOnLayer(Layer.FirstValid));
  1225. this.ClearHand(this.FindItemOnLayer(Layer.TwoHanded));
  1226. }
  1227. public void ClearQuestArrow()
  1228. {
  1229. this.m_QuestArrow = null;
  1230. }
  1231. public void ClearScreen()
  1232. {
  1233. Server.Network.NetState netState = this.m_NetState;
  1234. if ((this.m_Map != null) && (netState != null))
  1235. {
  1236. IPooledEnumerable objectsInRange = this.m_Map.GetObjectsInRange(this.m_Location, Core.GlobalMaxUpdateRange);
  1237. foreach (object obj2 in objectsInRange)
  1238. {
  1239. if (obj2 is Mobile)
  1240. {
  1241. Mobile mobile = (Mobile) obj2;
  1242. if ((mobile != this) && Utility.InUpdateRange(this.m_Location, mobile.m_Location))
  1243. {
  1244. netState.Send(mobile.RemovePacket);
  1245. }
  1246. }
  1247. else if (obj2 is Item)
  1248. {
  1249. Item item = (Item) obj2;
  1250. if (this.InRange(item.Location, item.GetUpdateRange(this)))
  1251. {
  1252. netState.Send(item.RemovePacket);
  1253. }
  1254. }
  1255. }
  1256. objectsInRange.Free();
  1257. }
  1258. }
  1259. public void ClearTarget()
  1260. {
  1261. this.m_Target = null;
  1262. }
  1263. public bool CloseAllGumps()
  1264. {
  1265. return this.CloseAllGumps(false);
  1266. }
  1267. public bool CloseAllGumps(bool throwOnOffline)
  1268. {
  1269. Server.Network.NetState netState = this.m_NetState;
  1270. if (netState != null)
  1271. {
  1272. var gumps = netState.Gumps;
  1273. foreach(Gump gump in gumps)
  1274. {
  1275. netState.Send(new Server.Network.CloseGump(gump.TypeID, 0));
  1276. }
  1277. return true;
  1278. }
  1279. if (throwOnOffline)
  1280. {
  1281. throw new MobileNotConnectedException(this, "Gump close packets could not be sent.");
  1282. }
  1283. return false;
  1284. }
  1285. public bool CloseGump(Type type)
  1286. {
  1287. return this.CloseGump(type, 0, false);
  1288. }
  1289. public bool CloseGump(Type type, int buttonID)
  1290. {
  1291. return this.CloseGump(type, buttonID, false);
  1292. }
  1293. public bool CloseGump(Type type, int buttonID, bool throwOnOffline)
  1294. {
  1295. if (this.m_NetState != null)
  1296. {
  1297. this.m_NetState.Send(new Server.Network.CloseGump(Gump.GetTypeID(type), buttonID));
  1298. return true;
  1299. }
  1300. if (throwOnOffline)
  1301. {
  1302. throw new MobileNotConnectedException(this, "Gump close packet could not be sent.");
  1303. }
  1304. return false;
  1305. }
  1306. public virtual void ComputeBaseLightLevels(out int global, out int personal)
  1307. {
  1308. global = 0;
  1309. personal = this.m_LightLevel;
  1310. }
  1311. public virtual void ComputeLightLevels(out int global, out int personal)
  1312. {
  1313. this.ComputeBaseLightLevels(out global, out personal);
  1314. if (this.m_Region != null)
  1315. {
  1316. this.m_Region.AlterLightLevel(this, ref global, ref personal);
  1317. }
  1318. }
  1319. public virtual void ComputeResistances()
  1320. {
  1321. int[] numArray;
  1322. if (this.m_Resistances == null)
  1323. {
  1324. this.m_Resistances = new int[] { -2147483648, -2147483648, -2147483648, -2147483648, -2147483648 };
  1325. }
  1326. for (int i = 0; i < this.m_Resistances.Length; i++)
  1327. {
  1328. this.m_Resistances[i] = 0;
  1329. }
  1330. (numArray = this.m_Resistances)[0] = numArray[0] + this.BasePhysicalResistance;
  1331. (numArray = this.m_Resistances)[1] = numArray[1] + this.BaseFireResistance;
  1332. (numArray = this.m_Resistances)[2] = numArray[2] + this.BaseColdResistance;
  1333. (numArray = this.m_Resistances)[3] = numArray[3] + this.BasePoisonResistance;
  1334. (numArray = this.m_Resistances)[4] = numArray[4] + this.BaseEnergyResistance;
  1335. for (int j = 0; (this.m_ResistMods != null) && (j < this.m_ResistMods.Count); j++)
  1336. {
  1337. ResistanceMod mod = (ResistanceMod) this.m_ResistMods[j];
  1338. int type = (int) mod.Type;
  1339. if ((type >= 0) && (type < this.m_Resistances.Length))
  1340. {
  1341. IntPtr ptr;
  1342. (numArray = this.m_Resistances)[(int) (ptr = (IntPtr) type)] = numArray[(int) ptr] + mod.Offset;
  1343. }
  1344. }
  1345. for (int k = 0; k < this.m_Items.Count; k++)
  1346. {
  1347. Item item = (Item) this.m_Items[k];
  1348. if (!item.CheckPropertyConfliction(this))
  1349. {
  1350. (numArray = this.m_Resistances)[0] = numArray[0] + item.PhysicalResistance;
  1351. (numArray = this.m_Resistances)[1] = numArray[1] + item.FireResistance;
  1352. (numArray = this.m_Resistances)[2] = numArray[2] + item.ColdResistance;
  1353. (numArray = this.m_Resistances)[3] = numArray[3] + item.PoisonResistance;
  1354. (numArray = this.m_Resistances)[4] = numArray[4] + item.EnergyResistance;
  1355. }
  1356. }
  1357. for (int m = 0; m < this.m_Resistances.Length; m++)

Large files files are truncated, but you can click here to view the full file