DecoObject.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. using System.Drawing;
  2. using Server.MirEnvir;
  3. using S = ServerPackets;
  4. namespace Server.MirObjects
  5. {
  6. public sealed class DecoObject : MapObject
  7. {
  8. public override ObjectType Race
  9. {
  10. get { return ObjectType.Deco; }
  11. }
  12. public override string Name { get; set; }
  13. public override int CurrentMapIndex { get; set; }
  14. public override Point CurrentLocation { get; set; }
  15. public override MirDirection Direction { get; set; }
  16. public override ushort Level { get; set; }
  17. public override bool Blocking
  18. {
  19. get
  20. {
  21. return false;
  22. }
  23. }
  24. public int Image;
  25. public override int Health
  26. {
  27. get { throw new NotSupportedException(); }
  28. }
  29. public override int MaxHealth
  30. {
  31. get { throw new NotSupportedException(); }
  32. }
  33. public override void Process()
  34. {
  35. //Cell cell = CurrentMap.GetCell(CurrentLocation);
  36. //for (int i = 0; i < cell.Objects.Count; i++)
  37. // ProcessDeco(cell.Objects[i]);
  38. }
  39. public override void SetOperateTime()
  40. {
  41. long time = Envir.Time + 2000;
  42. //if (TickTime < time && TickTime > Envir.Time)
  43. // time = TickTime;
  44. if (OwnerTime < time && OwnerTime > Envir.Time)
  45. time = OwnerTime;
  46. if (ExpireTime < time && ExpireTime > Envir.Time)
  47. time = ExpireTime;
  48. if (PKPointTime < time && PKPointTime > Envir.Time)
  49. time = PKPointTime;
  50. if (LastHitTime < time && LastHitTime > Envir.Time)
  51. time = LastHitTime;
  52. if (EXPOwnerTime < time && EXPOwnerTime > Envir.Time)
  53. time = EXPOwnerTime;
  54. if (BrownTime < time && BrownTime > Envir.Time)
  55. time = BrownTime;
  56. for (int i = 0; i < ActionList.Count; i++)
  57. {
  58. if (ActionList[i].Time >= time && ActionList[i].Time > Envir.Time) continue;
  59. time = ActionList[i].Time;
  60. }
  61. for (int i = 0; i < PoisonList.Count; i++)
  62. {
  63. if (PoisonList[i].TickTime >= time && PoisonList[i].TickTime > Envir.Time) continue;
  64. time = PoisonList[i].TickTime;
  65. }
  66. for (int i = 0; i < Buffs.Count; i++)
  67. {
  68. if (Buffs[i].NextTime >= time && Buffs[i].NextTime > Envir.Time) continue;
  69. time = Buffs[i].NextTime;
  70. }
  71. if (OperateTime <= Envir.Time || time < OperateTime)
  72. OperateTime = time;
  73. }
  74. public override void Process(DelayedAction action)
  75. {
  76. throw new NotSupportedException();
  77. }
  78. public override bool IsAttackTarget(HumanObject attacker)
  79. {
  80. throw new NotSupportedException();
  81. }
  82. public override bool IsAttackTarget(MonsterObject attacker)
  83. {
  84. throw new NotSupportedException();
  85. }
  86. public override int Attacked(HumanObject attacker, int damage, DefenceType type = DefenceType.ACAgility, bool damageWeapon = true)
  87. {
  88. throw new NotSupportedException();
  89. }
  90. public override int Attacked(MonsterObject attacker, int damage, DefenceType type = DefenceType.ACAgility)
  91. {
  92. throw new NotSupportedException();
  93. }
  94. public override int Struck(int damage, DefenceType type = DefenceType.ACAgility)
  95. {
  96. throw new NotSupportedException();
  97. }
  98. public override bool IsFriendlyTarget(HumanObject ally)
  99. {
  100. throw new NotSupportedException();
  101. }
  102. public override bool IsFriendlyTarget(MonsterObject ally)
  103. {
  104. throw new NotSupportedException();
  105. }
  106. public override void ReceiveChat(string text, ChatType type)
  107. {
  108. throw new NotSupportedException();
  109. }
  110. public override Packet GetInfo()
  111. {
  112. return new S.ObjectDeco
  113. {
  114. ObjectID = ObjectID,
  115. Location = CurrentLocation,
  116. Image = Image
  117. };
  118. }
  119. public override void ApplyPoison(Poison p, MapObject Caster = null, bool NoResist = false, bool ignoreDefence = true)
  120. {
  121. throw new NotSupportedException();
  122. }
  123. public override void Die()
  124. {
  125. throw new NotSupportedException();
  126. }
  127. public override int Pushed(MapObject pusher, MirDirection dir, int distance)
  128. {
  129. throw new NotSupportedException();
  130. }
  131. public override void SendHealth(HumanObject player)
  132. {
  133. throw new NotSupportedException();
  134. }
  135. public override void Despawn()
  136. {
  137. base.Despawn();
  138. }
  139. }
  140. }