Struct.cs 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. namespace ET.Server
  2. {
  3. /// <summary>
  4. /// 游戏服数据结构
  5. /// </summary>
  6. public class Struct
  7. {
  8. /// <summary>
  9. /// 数据结构 int_int
  10. /// </summary>
  11. public class IntIntData
  12. {
  13. public int value1 { get; set; }
  14. public int value2 { get; set; }
  15. public IntIntData(int value1, int value2)
  16. {
  17. this.value1 = value1;
  18. this.value2 = value2;
  19. }
  20. }
  21. /// <summary>
  22. /// 玩家技能数据
  23. /// </summary>
  24. public class SkillInfo
  25. {
  26. /** 技能id **/
  27. public int id { get; set; }
  28. /** 技能等级 **/
  29. public int level { get; set; }
  30. /** 斩妖特殊含义: 冷却时间减少,触发几率增加,持续时间增加 **/
  31. public int[] talentLevel = new int[3];
  32. /** 技能类型 **/
  33. public int type { get; set; }
  34. /** 技能到期时间戳 **/
  35. public long skillTime { get; set; }
  36. /** 技能cd变更,万分比 **/
  37. public int cdTime { get; set; }
  38. public int flag { get; set; }
  39. }
  40. /// <summary>
  41. /// 玩家技能存储数据
  42. /// </summary>
  43. public class PlayerSkillBaseData
  44. {
  45. /** 技能id **/
  46. public int id { get; set; }
  47. /** 技能等级 **/
  48. public int level { get; set; }
  49. /** 是否已解锁 */
  50. public bool unlock { get; set; }
  51. /** 技能到期时间戳 **/
  52. public long skillTime { get; set; }
  53. public PlayerSkillBaseData(int skillId, int level, bool unlock, long skillTime)
  54. {
  55. this.id = skillId;
  56. this.level = level;
  57. this.unlock = unlock;
  58. this.skillTime = skillTime;
  59. }
  60. /** 是否已解锁 */
  61. public bool isUnlock()
  62. {
  63. return this.unlock;
  64. }
  65. }
  66. /// <summary>
  67. /// 场景数据
  68. /// </summary>
  69. public class AreaData
  70. {
  71. public MapConfig prop { get; set; }
  72. public int areaId { get; set; }
  73. public long instanceId { get; set; }
  74. public float targetX { get; set; }
  75. public float targetY { get; set; }
  76. public int logicServerId { get; set; }
  77. public ENTER_TYPE enterType = ENTER_TYPE.NONE;
  78. public AreaData(int areaId)
  79. {
  80. this.prop = MapConfigCategory.Instance.Get(areaId);
  81. this.areaId = areaId;
  82. }
  83. public AreaData(MapConfig prop)
  84. {
  85. this.areaId = prop.Id;
  86. this.prop = prop;
  87. }
  88. public AreaData(int areaId, long instanceId)
  89. {
  90. this.prop = MapConfigCategory.Instance.Get(areaId);
  91. this.areaId = areaId;
  92. this.instanceId = instanceId;
  93. }
  94. public AreaData(int areaId, float targetX, float targetY)
  95. {
  96. this.prop = MapConfigCategory.Instance.Get(areaId);
  97. this.areaId = areaId;
  98. this.targetX = targetX;
  99. this.targetY = targetY;
  100. }
  101. public AreaData(int areaId, float targetX, float targetY, ENTER_TYPE enterType)
  102. {
  103. this.prop = MapConfigCategory.Instance.Get(areaId);
  104. this.areaId = areaId;
  105. this.targetX = targetX;
  106. this.targetY = targetY;
  107. this.enterType = enterType;
  108. }
  109. public AreaData(int areaId, long instanceId, ENTER_TYPE enterType)
  110. {
  111. this.prop = MapConfigCategory.Instance.Get(areaId);
  112. this.areaId = areaId;
  113. this.instanceId = instanceId;
  114. this.enterType = enterType;
  115. }
  116. }
  117. /// <summary>
  118. /// 怪物单位数据
  119. /// </summary>
  120. public class MonsterUnit
  121. {
  122. /** 怪物名字 **/
  123. public string name { get; set; }
  124. /** 怪物模板ID **/
  125. public int id { get; set; }
  126. /** 阵营信息 **/
  127. public int force { get; set; }
  128. /** 刷新点名字,为空才去读x, y **/
  129. public string flag { get; set; }
  130. public bool autoGuard { get; set; }
  131. /** 同一个Area是否只能同时有一个怪存在 **/
  132. public bool unique = false;
  133. /** 坐标x **/
  134. public int x { get; set; }
  135. /** 坐标y **/
  136. public int y { get; set; }
  137. /** 是否是任务 共享怪 **/
  138. public int shareType { get; set; }
  139. /** 动态怪物等级,战斗服根据此计算怪物的动态数值 **/
  140. public int level { get; set; }
  141. /** 初始朝向 **/
  142. public float birthDirection { get; set; }
  143. /** 服务器标记字段,怪物死亡时,会回传回来 **/
  144. public int gsFlag { get; set; }
  145. /** 指定血量 **/
  146. public int hp { get; set; }
  147. public int maxHP { get; set; }
  148. /** 指定追击玩家id(必须是无限追击怪才会联动生效) **/
  149. public string attackPlayer { get; set; }
  150. /** 创建护卫怪,主人ObjectId(主人脱战或者死亡消失) **/
  151. public int masterID { get; set; }
  152. public MonsterUnit()
  153. {
  154. }
  155. public MonsterUnit(int monsterID, int force, bool unique, int x, int y)
  156. {
  157. this.id = monsterID;
  158. this.force = force;
  159. this.unique = unique;
  160. this.x = x;
  161. this.y = y;
  162. }
  163. public MonsterUnit(int monsterID, string refrushEvent, bool unique, int force)
  164. {
  165. this.id = monsterID;
  166. this.force = force;
  167. this.unique = unique;
  168. this.flag = refrushEvent;
  169. }
  170. public MonsterUnit(int monsterID, string refrushEvent, bool unique, int force, float birthDirection)
  171. {
  172. this.id = monsterID;
  173. this.force = force;
  174. this.unique = unique;
  175. this.flag = refrushEvent;
  176. this.birthDirection = birthDirection;
  177. }
  178. }
  179. /// <summary>
  180. /// 战报数据
  181. /// </summary>
  182. public class BattleReports
  183. {
  184. public uint ID { get; set; }
  185. public string PlayerUUID { get; set; }
  186. /** 模板id **/
  187. public int TemplateId { get; set; }
  188. /** 单位名称 **/
  189. public string Name { get; set; }
  190. /** 阵营 **/
  191. public int Force { get; set; }
  192. /** 对所有单位输出的总伤害 **/
  193. public int TotalDamage { get; set; }
  194. /** 对所有单位输出的总治疗量 **/
  195. public int TotalHealing { get; set; }
  196. public BattleReports(uint id, string PlayerUUID, int templateId, string name, int force, int totalDamage)
  197. {
  198. this.ID = id;
  199. this.PlayerUUID = PlayerUUID;
  200. this.TemplateId = templateId;
  201. this.Name = name;
  202. this.Force = force;
  203. this.TotalDamage = totalDamage;
  204. }
  205. }
  206. /// <summary>
  207. /// 玩家单位复活数据
  208. /// </summary>
  209. public class UnitPlayerReliveData
  210. {
  211. /** 复活场景 **/
  212. public Map Map { get; set; }
  213. /** 复活单位模板id **/
  214. public int ID { get; set; }
  215. /** 复活时间 **/
  216. public long ReliveTime { get; set; }
  217. /** 复活位置x **/
  218. public int x { get; set; }
  219. /** 复活位置y **/
  220. public int y { get; set; }
  221. public UnitPlayerReliveData()
  222. {
  223. }
  224. public UnitPlayerReliveData(Map map, int id, long time, int x, int y)
  225. {
  226. this.Map = map;
  227. this.ID = id;
  228. this.ReliveTime = time;
  229. this.x = x;
  230. this.y = y;
  231. }
  232. }
  233. }
  234. }