Struct.cs 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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. [StaticField]
  40. public bool autoLaunch = false;
  41. }
  42. /// <summary>
  43. /// 玩家技能存储数据
  44. /// </summary>
  45. public class PlayerSkillBaseData
  46. {
  47. /** 技能id **/
  48. public int id { get; set; }
  49. /** 技能等级 **/
  50. public int level { get; set; }
  51. /** 是否已解锁 */
  52. public bool unlock { get; set; }
  53. /** 技能到期时间戳 **/
  54. public long skillTime { get; set; }
  55. public PlayerSkillBaseData(int skillId, int level, bool unlock, long skillTime)
  56. {
  57. this.id = skillId;
  58. this.level = level;
  59. this.unlock = unlock;
  60. this.skillTime = skillTime;
  61. }
  62. }
  63. /// <summary>
  64. /// 场景数据
  65. /// </summary>
  66. public class AreaData
  67. {
  68. public MapConfig prop { get; set; }
  69. public int areaId { get; set; }
  70. public long instanceId { get; set; }
  71. public float targetX { get; set; }
  72. public float targetY { get; set; }
  73. public int logicServerId { get; set; }
  74. public ENTER_TYPE enterType = ENTER_TYPE.NONE;
  75. public AreaData(int areaId)
  76. {
  77. this.prop = MapConfigCategory.Instance.Get(areaId);
  78. this.areaId = areaId;
  79. }
  80. public AreaData(MapConfig prop)
  81. {
  82. this.areaId = prop.Id;
  83. this.prop = prop;
  84. }
  85. public AreaData(int areaId, long instanceId)
  86. {
  87. this.prop = MapConfigCategory.Instance.Get(areaId);
  88. this.areaId = areaId;
  89. this.instanceId = instanceId;
  90. }
  91. public AreaData(int areaId, float targetX, float targetY)
  92. {
  93. this.prop = MapConfigCategory.Instance.Get(areaId);
  94. this.areaId = areaId;
  95. this.targetX = targetX;
  96. this.targetY = targetY;
  97. }
  98. public AreaData(int areaId, float targetX, float targetY, ENTER_TYPE enterType)
  99. {
  100. this.prop = MapConfigCategory.Instance.Get(areaId);
  101. this.areaId = areaId;
  102. this.targetX = targetX;
  103. this.targetY = targetY;
  104. this.enterType = enterType;
  105. }
  106. public AreaData(int areaId, long instanceId, ENTER_TYPE enterType)
  107. {
  108. this.prop = MapConfigCategory.Instance.Get(areaId);
  109. this.areaId = areaId;
  110. this.instanceId = instanceId;
  111. this.enterType = enterType;
  112. }
  113. }
  114. /// <summary>
  115. /// 怪物单位数据
  116. /// </summary>
  117. public class MonsterUnit
  118. {
  119. /** 怪物名字 **/
  120. public string uuid { get; set; }
  121. public string alias { get; set; }
  122. /** 怪物模板ID **/
  123. public int id { get; set; }
  124. /** 阵营信息 **/
  125. public int force { get; set; }
  126. /** 刷新点名字,为空才去读x, y **/
  127. public string flag { get; set; }
  128. public bool autoGuard { get; set; }
  129. /** 同一个Area是否只能同时有一个怪存在 **/
  130. public bool unique = false;
  131. /** 坐标x **/
  132. public float x { get; set; }
  133. /** 坐标y **/
  134. public float y { get; set; }
  135. /** 是否是任务 共享怪 **/
  136. public int shareType { get; set; }
  137. /** 动态怪物等级,战斗服根据此计算怪物的动态数值 **/
  138. public int level { get; set; }
  139. /** 初始朝向 **/
  140. public float birthDirection { get; set; }
  141. /** 服务器标记字段,怪物死亡时,会回传回来 **/
  142. public int gsFlag { get; set; }
  143. /** 指定血量 **/
  144. public int hp { get; set; }
  145. public int maxHP { get; set; }
  146. /** 指定追击玩家id(必须是无限追击怪才会联动生效) **/
  147. public string attackPlayer { get; set; }
  148. /** 创建护卫怪,主人ObjectId(主人脱战或者死亡消失) **/
  149. public int masterID { get; set; }
  150. public MonsterUnit()
  151. {
  152. }
  153. public MonsterUnit(int monsterID, int force, bool unique, int x, int y)
  154. {
  155. this.id = monsterID;
  156. this.force = force;
  157. this.unique = unique;
  158. this.x = x;
  159. this.y = y;
  160. }
  161. public MonsterUnit(int monsterID, string refrushEvent, bool unique, int force)
  162. {
  163. this.id = monsterID;
  164. this.force = force;
  165. this.unique = unique;
  166. this.flag = refrushEvent;
  167. }
  168. public MonsterUnit(int monsterID, string refrushEvent, bool unique, int force, float birthDirection)
  169. {
  170. this.id = monsterID;
  171. this.force = force;
  172. this.unique = unique;
  173. this.flag = refrushEvent;
  174. this.birthDirection = birthDirection;
  175. }
  176. }
  177. /// <summary>
  178. /// 场景中的角色
  179. /// </summary>
  180. public class Actor
  181. {
  182. public bool Ready { get; set; }
  183. public bool Leave { get; set; }
  184. public bool Alive = true;
  185. }
  186. /// <summary>
  187. /// 通知战斗服事件
  188. /// </summary>
  189. public class TriggerEventNotify
  190. {
  191. /** 事件名称 **/
  192. public string message { get; set; }
  193. /** 触发的单位objectId列表 **/
  194. public string TriggerUnits { get; set; }
  195. }
  196. }
  197. }