Struct.cs 7.5 KB

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