Frames.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. namespace Client.MirObjects
  2. {
  3. public class FrameSet : Dictionary<MirAction, Frame>
  4. {
  5. public static FrameSet Player;
  6. public static FrameSet DefaultNPC, DefaultMonster;
  7. public static List<FrameSet> DragonStatue, GreatFoxSpirit, HellBomb, CaveStatue;
  8. static FrameSet()
  9. {
  10. FrameSet frame;
  11. Player = new FrameSet();
  12. //Default NPC
  13. DefaultNPC = new FrameSet
  14. {
  15. { MirAction.Standing, new Frame(0, 4, 0, 450) },
  16. { MirAction.Harvest, new Frame(12, 10, 0, 200) }
  17. };
  18. //Default Monster
  19. DefaultMonster = new FrameSet
  20. {
  21. { MirAction.Standing, new Frame(0, 4, 0, 500) },
  22. { MirAction.Walking, new Frame(32, 6, 0, 100) },
  23. { MirAction.Attack1, new Frame(80, 6, 0, 100) },
  24. { MirAction.Struck, new Frame(128, 2, 0, 200) },
  25. { MirAction.Die, new Frame(144, 10, 0, 100) },
  26. { MirAction.Dead, new Frame(153, 1, 9, 1000) },
  27. { MirAction.Revive, new Frame(144, 10, 0, 100) { Reverse = true } }
  28. };
  29. #region DragonStatue
  30. //DragonStatue 1
  31. DragonStatue = new List<FrameSet> { (frame = new FrameSet()) };
  32. frame.Add(MirAction.Standing, new Frame(300, 1, -1, 1000));
  33. frame.Add(MirAction.AttackRange1, new Frame(300, 1, -1, 120));
  34. frame.Add(MirAction.Struck, new Frame(300, 1, -1, 200));
  35. //DragonStatue 2
  36. DragonStatue.Add(frame = new FrameSet());
  37. frame.Add(MirAction.Standing, new Frame(301, 1, -1, 1000));
  38. frame.Add(MirAction.AttackRange1, new Frame(301, 1, -1, 120));
  39. frame.Add(MirAction.Struck, new Frame(301, 1, -1, 200));
  40. //DragonStatue 3
  41. DragonStatue.Add(frame = new FrameSet());
  42. frame.Add(MirAction.Standing, new Frame(302, 1, -1, 1000));
  43. frame.Add(MirAction.AttackRange1, new Frame(302, 1, -1, 120));
  44. frame.Add(MirAction.Struck, new Frame(302, 1, -1, 200));
  45. //DragonStatue 4
  46. DragonStatue.Add(frame = new FrameSet());
  47. frame.Add(MirAction.Standing, new Frame(320, 1, -1, 1000));
  48. frame.Add(MirAction.AttackRange1, new Frame(320, 1, -1, 120));
  49. frame.Add(MirAction.Struck, new Frame(320, 1, -1, 200));
  50. //DragonStatue 5
  51. DragonStatue.Add(frame = new FrameSet());
  52. frame.Add(MirAction.Standing, new Frame(321, 1, -1, 1000));
  53. frame.Add(MirAction.AttackRange1, new Frame(321, 1, -1, 120));
  54. frame.Add(MirAction.Struck, new Frame(321, 1, -1, 200));
  55. //DragonStatue 6
  56. DragonStatue.Add(frame = new FrameSet());
  57. frame.Add(MirAction.Standing, new Frame(322, 1, -1, 1000));
  58. frame.Add(MirAction.AttackRange1, new Frame(322, 1, -1, 120));
  59. frame.Add(MirAction.Struck, new Frame(322, 1, -1, 200));
  60. #endregion
  61. #region GreatFoxSpirit
  62. //GreatFoxSpirit level 0
  63. GreatFoxSpirit = new List<FrameSet> { (frame = new FrameSet()) };
  64. frame.Add(MirAction.Standing, new Frame(0, 20, -20, 100));
  65. frame.Add(MirAction.Attack1, new Frame(22, 8, -8, 120));
  66. frame.Add(MirAction.Struck, new Frame(20, 2, -2, 200));
  67. frame.Add(MirAction.Die, new Frame(300, 18, -18, 120));
  68. frame.Add(MirAction.Dead, new Frame(317, 1, -1, 1000));
  69. frame.Add(MirAction.Revive, new Frame(300, 18, -18, 150) { Reverse = true });
  70. //GreatFoxSpirit level 1
  71. GreatFoxSpirit.Add(frame = new FrameSet());
  72. frame.Add(MirAction.Standing, new Frame(60, 20, -20, 100));
  73. frame.Add(MirAction.Attack1, new Frame(82, 8, -8, 120));
  74. frame.Add(MirAction.Struck, new Frame(80, 2, -2, 200));
  75. frame.Add(MirAction.Die, new Frame(300, 18, -18, 120));
  76. frame.Add(MirAction.Dead, new Frame(317, 1, -1, 1000));
  77. frame.Add(MirAction.Revive, new Frame(300, 18, -18, 150) { Reverse = true });
  78. //GreatFoxSpirit level 2
  79. GreatFoxSpirit.Add(frame = new FrameSet());
  80. frame.Add(MirAction.Standing, new Frame(120, 20, -20, 100));
  81. frame.Add(MirAction.Attack1, new Frame(142, 8, -8, 120));
  82. frame.Add(MirAction.Struck, new Frame(140, 2, -2, 200));
  83. frame.Add(MirAction.Die, new Frame(300, 18, -18, 120));
  84. frame.Add(MirAction.Dead, new Frame(317, 1, -1, 1000));
  85. frame.Add(MirAction.Revive, new Frame(300, 18, -18, 150) { Reverse = true });
  86. //GreatFoxSpirit level 3
  87. GreatFoxSpirit.Add(frame = new FrameSet());
  88. frame.Add(MirAction.Standing, new Frame(180, 20, -20, 100));
  89. frame.Add(MirAction.Attack1, new Frame(202, 8, -8, 120));
  90. frame.Add(MirAction.Struck, new Frame(200, 2, -2, 200));
  91. frame.Add(MirAction.Die, new Frame(300, 18, -18, 120));
  92. frame.Add(MirAction.Dead, new Frame(317, 1, -1, 1000));
  93. frame.Add(MirAction.Revive, new Frame(300, 18, -18, 150) { Reverse = true });
  94. //GreatFoxSpirit level 4
  95. GreatFoxSpirit.Add(frame = new FrameSet());
  96. frame.Add(MirAction.Standing, new Frame(240, 20, -20, 100));
  97. frame.Add(MirAction.Attack1, new Frame(262, 8, -8, 120));
  98. frame.Add(MirAction.Struck, new Frame(260, 2, -2, 200));
  99. frame.Add(MirAction.Die, new Frame(300, 18, -18, 120));
  100. frame.Add(MirAction.Dead, new Frame(317, 1, -1, 1000));
  101. frame.Add(MirAction.Revive, new Frame(300, 18, -18, 150) { Reverse = true });
  102. #endregion
  103. #region HellBombs
  104. //HellBomb1
  105. HellBomb = new List<FrameSet> { (frame = new FrameSet()) };
  106. frame.Add(MirAction.Standing, new Frame(52, 9, -9, 100) { Blend = true });
  107. frame.Add(MirAction.Attack1, new Frame(999, 1, -1, 120) { Blend = true });
  108. frame.Add(MirAction.Struck, new Frame(52, 9, -9, 100) { Blend = true });
  109. //HellBomb2
  110. HellBomb.Add(frame = new FrameSet());
  111. frame.Add(MirAction.Standing, new Frame(70, 9, -9, 100) { Blend = true });
  112. frame.Add(MirAction.Attack1, new Frame(999, 1, -1, 120) { Blend = true });
  113. frame.Add(MirAction.Struck, new Frame(70, 9, -9, 100) { Blend = true });
  114. //HellBomb3
  115. HellBomb.Add(frame = new FrameSet());
  116. frame.Add(MirAction.Standing, new Frame(88, 9, -9, 100) { Blend = true });
  117. frame.Add(MirAction.Attack1, new Frame(999, 1, -1, 120) { Blend = true });
  118. frame.Add(MirAction.Struck, new Frame(88, 9, -9, 100) { Blend = true });
  119. #endregion
  120. #region CaveStatues
  121. //CaveStatue1
  122. CaveStatue = new List<FrameSet> { (frame = new FrameSet()) };
  123. frame.Add(MirAction.Standing, new Frame(0, 1, -1, 100) { Blend = false });
  124. frame.Add(MirAction.Struck, new Frame(0, 1, -1, 100) { Blend = false });
  125. frame.Add(MirAction.Die, new Frame(2, 8, -8, 100) { Blend = false });
  126. frame.Add(MirAction.Dead, new Frame(9, 1, -1, 100) { Blend = false });
  127. //CaveStatue2
  128. CaveStatue.Add(frame = new FrameSet());
  129. frame.Add(MirAction.Standing, new Frame(18, 1, -1, 100) { Blend = false });
  130. frame.Add(MirAction.Struck, new Frame(18, 1, -1, 100) { Blend = false });
  131. frame.Add(MirAction.Die, new Frame(20, 8, -8, 100) { Blend = false });
  132. frame.Add(MirAction.Dead, new Frame(27, 1, -1, 100) { Blend = false });
  133. #endregion
  134. #region Player
  135. //Common
  136. Player.Add(MirAction.Standing, new Frame(0, 4, 0, 500, 0, 8, 0, 250));
  137. Player.Add(MirAction.Walking, new Frame(32, 6, 0, 100, 64, 6, 0, 100));
  138. Player.Add(MirAction.Running, new Frame(80, 6, 0, 100, 112, 6, 0, 100));
  139. Player.Add(MirAction.Stance, new Frame(128, 1, 0, 1000, 160, 1, 0, 1000));
  140. Player.Add(MirAction.Stance2, new Frame(300, 1, 5, 1000, 332, 1, 5, 1000));
  141. Player.Add(MirAction.Attack1, new Frame(136, 6, 0, 100, 168, 6, 0, 100));
  142. Player.Add(MirAction.Attack2, new Frame(184, 6, 0, 100, 216, 6, 0, 100));
  143. Player.Add(MirAction.Attack3, new Frame(232, 8, 0, 100, 264, 8, 0, 100));
  144. Player.Add(MirAction.Attack4, new Frame(416, 6, 0, 100, 448, 6, 0, 100));
  145. Player.Add(MirAction.Spell, new Frame(296, 6, 0, 100, 328, 6, 0, 100));
  146. Player.Add(MirAction.Harvest, new Frame(344, 2, 0, 300, 376, 2, 0, 300));
  147. Player.Add(MirAction.Struck, new Frame(360, 3, 0, 100, 392, 3, 0, 100));
  148. Player.Add(MirAction.Die, new Frame(384, 4, 0, 100, 416, 4, 0, 100));
  149. Player.Add(MirAction.Dead, new Frame(387, 1, 3, 1000, 419, 1, 3, 1000));
  150. Player.Add(MirAction.Revive, new Frame(384, 4, 0, 100, 416, 4, 0, 100) { Reverse = true });
  151. Player.Add(MirAction.Mine, new Frame(184, 6, 0, 100, 216, 6, 0, 100));
  152. Player.Add(MirAction.Lunge, new Frame(139, 1, 5, 1000, 300, 1, 5, 1000));
  153. //Assassin
  154. Player.Add(MirAction.Sneek, new Frame(464, 6, 0, 100, 496, 6, 0, 100));
  155. Player.Add(MirAction.DashAttack, new Frame(80, 3, 3, 100, 112, 3, 3, 100));
  156. //Archer
  157. Player.Add(MirAction.WalkingBow, new Frame(0, 6, 0, 100, 0, 6, 0, 100));
  158. Player.Add(MirAction.RunningBow, new Frame(48, 6, 0, 100, 48, 6, 0, 100));
  159. Player.Add(MirAction.AttackRange1, new Frame(96, 8, 0, 100, 96, 8, 0, 100));
  160. Player.Add(MirAction.AttackRange2, new Frame(160, 8, 0, 100, 160, 8, 0, 100));
  161. Player.Add(MirAction.AttackRange3, new Frame(224, 8, 0, 100, 224, 8, 0, 100));
  162. Player.Add(MirAction.Jump, new Frame(288, 8, 0, 100, 288, 8, 0, 100));
  163. //Mounts
  164. Player.Add(MirAction.MountStanding, new Frame(416, 4, 0, 500, 448, 4, 0, 500));
  165. Player.Add(MirAction.MountWalking, new Frame(448, 8, 0, 100, 480, 8, 0, 500));
  166. Player.Add(MirAction.MountRunning, new Frame(512, 6, 0, 100, 544, 6, 0, 100));
  167. Player.Add(MirAction.MountStruck, new Frame(560, 3, 0, 100, 592, 3, 0, 100));
  168. Player.Add(MirAction.MountAttack, new Frame(584, 6, 0, 100, 616, 6, 0, 100));
  169. //Fishing
  170. Player.Add(MirAction.FishingCast, new Frame(632, 8, 0, 100));
  171. Player.Add(MirAction.FishingWait, new Frame(696, 6, 0, 120));
  172. Player.Add(MirAction.FishingReel, new Frame(744, 8, 0, 100));
  173. #endregion
  174. }
  175. }
  176. public class Frame
  177. {
  178. public int Start, Count, Skip, EffectStart, EffectCount, EffectSkip;
  179. public int Interval, EffectInterval;
  180. public bool Reverse, Blend;
  181. public int OffSet
  182. {
  183. get { return Count + Skip; }
  184. }
  185. public int EffectOffSet
  186. {
  187. get { return EffectCount + EffectSkip; }
  188. }
  189. public Frame(int start, int count, int skip, int interval, int effectstart = 0, int effectcount = 0, int effectskip = 0, int effectinterval = 0)
  190. {
  191. Start = start;
  192. Count = count;
  193. Skip = skip;
  194. Interval = interval;
  195. EffectStart = effectstart;
  196. EffectCount = effectcount;
  197. EffectSkip = effectskip;
  198. EffectInterval = effectinterval;
  199. }
  200. public Frame(BinaryReader reader)
  201. {
  202. Start = reader.ReadInt32();
  203. Count = reader.ReadInt32();
  204. Skip = reader.ReadInt32();
  205. Interval = reader.ReadInt32();
  206. EffectStart = reader.ReadInt32();
  207. EffectCount = reader.ReadInt32();
  208. EffectSkip = reader.ReadInt32();
  209. EffectInterval = reader.ReadInt32();
  210. Reverse = reader.ReadBoolean();
  211. Blend = reader.ReadBoolean();
  212. }
  213. }
  214. }