Struct.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. namespace ET.Server
  2. {
  3. /// <summary>
  4. /// 游戏服数据结构
  5. /// </summary>
  6. public class Struct
  7. {
  8. public class IntIntData
  9. {
  10. public int value1 { get; set; }
  11. public int value2 { get; set; }
  12. public IntIntData(int value1, int value2)
  13. {
  14. this.value1 = value1;
  15. this.value2 = value2;
  16. }
  17. }
  18. /// <summary>
  19. /// 玩家技能数据
  20. /// </summary>
  21. public class SkillInfo
  22. {
  23. /** 技能id **/
  24. public int id { get; set; }
  25. /** 技能等级 **/
  26. public int level { get; set; }
  27. /** 斩妖特殊含义: 冷却时间减少,触发几率增加,持续时间增加 **/
  28. public int[] talentLevel = new int[3];
  29. /** 技能类型 **/
  30. public int type { get; set; }
  31. /** 技能到期时间戳 **/
  32. public long skillTime { get; set; }
  33. /** 技能cd变更,万分比 **/
  34. public int cdTime { get; set; }
  35. public int flag { get; set; }
  36. }
  37. /// <summary>
  38. /// 玩家技能存储数据
  39. /// </summary>
  40. public class PlayerSkillBaseData
  41. {
  42. /** 技能id **/
  43. public int id { get; set; }
  44. /** 技能等级 **/
  45. public int level { get; set; }
  46. /** 是否已解锁 */
  47. public bool unlock { get; set; }
  48. /** 技能到期时间戳 **/
  49. public long skillTime { get; set; }
  50. public PlayerSkillBaseData(int skillId, int level, bool unlock, long skillTime)
  51. {
  52. this.id = skillId;
  53. this.level = level;
  54. this.unlock = unlock;
  55. this.skillTime = skillTime;
  56. }
  57. /** 是否已解锁 */
  58. public bool isUnlock() {
  59. return this.unlock;
  60. }
  61. }
  62. /// <summary>
  63. /// 场景数据
  64. /// </summary>
  65. public class AreaData
  66. {
  67. public MapConfig prop { get; set; }
  68. public int areaId { get; set; }
  69. public long instanceId { get; set; }
  70. public float targetX { get; set; }
  71. public float targetY { get; set; }
  72. public int logicServerId { get; set; }
  73. public ENTER_TYPE enterType = ENTER_TYPE.NONE;
  74. public AreaData(int areaId) {
  75. this.prop = MapConfigCategory.Instance.Get(areaId);
  76. this.areaId = areaId;
  77. }
  78. public AreaData(MapConfig prop) {
  79. this.areaId = prop.Id;
  80. this.prop = prop;
  81. }
  82. public AreaData(int areaId, long instanceId) {
  83. this.prop = MapConfigCategory.Instance.Get(areaId);
  84. this.areaId = areaId;
  85. this.instanceId = instanceId;
  86. }
  87. public AreaData(int areaId, float targetX, float targetY) {
  88. this.prop = MapConfigCategory.Instance.Get(areaId);
  89. this.areaId = areaId;
  90. this.targetX = targetX;
  91. this.targetY = targetY;
  92. }
  93. public AreaData(int areaId, float targetX, float targetY, ENTER_TYPE enterType) {
  94. this.prop = MapConfigCategory.Instance.Get(areaId);
  95. this.areaId = areaId;
  96. this.targetX = targetX;
  97. this.targetY = targetY;
  98. this.enterType = enterType;
  99. }
  100. public AreaData(int areaId, long instanceId, ENTER_TYPE enterType) {
  101. this.prop = MapConfigCategory.Instance.Get(areaId);
  102. this.areaId = areaId;
  103. this.instanceId = instanceId;
  104. this.enterType = enterType;
  105. }
  106. }
  107. /// <summary>
  108. /// 怪物单位数据
  109. /// </summary>
  110. public class MonsterUnit
  111. {
  112. /** 怪物名字 **/
  113. public string name{ get; set; }
  114. /** 怪物模板ID **/
  115. public int id{ get; set; }
  116. /** 阵营信息 **/
  117. public int force{ get; set; }
  118. /** 刷新点名字,为空才去读x, y **/
  119. public string flag{ get; set; }
  120. public bool autoGuard{ get; set; }
  121. /** 同一个Area是否只能同时有一个怪存在 **/
  122. public bool unique = false;
  123. /** 坐标x **/
  124. public int x{ get; set; }
  125. /** 坐标y **/
  126. public int y{ get; set; }
  127. /** 是否是任务 共享怪 **/
  128. public int shareType{ get; set; }
  129. /** 动态怪物等级,战斗服根据此计算怪物的动态数值 **/
  130. public int level{ get; set; }
  131. /** 初始朝向 **/
  132. public float birthDirection{ get; set; }
  133. /** 服务器标记字段,怪物死亡时,会回传回来 **/
  134. public int gsFlag{ get; set; }
  135. /** 指定血量 **/
  136. public int hp{ get; set; }
  137. public int maxHP{ get; set; }
  138. /** 指定追击玩家id(必须是无限追击怪才会联动生效) **/
  139. public string attackPlayer{ get; set; }
  140. /** 创建护卫怪,主人ObjectId(主人脱战或者死亡消失) **/
  141. public int masterID{ get; set; }
  142. public MonsterUnit() {
  143. }
  144. public MonsterUnit(int monsterID, int force, bool unique, int x, int y) {
  145. this.id = monsterID;
  146. this.force = force;
  147. this.unique = unique;
  148. this.x = x;
  149. this.y = y;
  150. }
  151. public MonsterUnit(int monsterID, string refrushEvent, bool unique, int force) {
  152. this.id = monsterID;
  153. this.force = force;
  154. this.unique = unique;
  155. this.flag = refrushEvent;
  156. }
  157. public MonsterUnit(int monsterID, string refrushEvent, bool unique, int force, float birthDirection) {
  158. this.id = monsterID;
  159. this.force = force;
  160. this.unique = unique;
  161. this.flag = refrushEvent;
  162. this.birthDirection = birthDirection;
  163. }
  164. }
  165. }
  166. }