Proto.lua 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. local Attr = require("role.Proto").Attr
  2. local RoleBase = require("role.Proto").RoleBase
  3. local ItemData = require("bag.Proto").ItemData
  4. local HeroSimple = require("hero.Proto").HeroSimple
  5. local MoshouSkill = require("moshou.Proto").MoshouSkill
  6. CG_COMBAT_POS_QUERY = {
  7. {"type", 1, "byte"},--阵容类型
  8. {"groupID", 1, "byte"},--0 查询某个战斗类型,type为阵容类型 ,不等于0,查询某个组
  9. {"param", 1, "string"},--0 查询参数
  10. }
  11. --上阵英雄战力
  12. CombatHeroZdl={
  13. {"uuid", 1, "string"},
  14. {"zdl", 1, "int"},
  15. }
  16. --上阵英雄结构体
  17. CombatPosNet = {
  18. {"pos" , 1, "byte"},--坑位序号
  19. {"bagIndex" , 1, "int"},--英雄背包索引
  20. {"uuid" , 1, "string"},--英雄标识
  21. }
  22. --辅助结构体(援兵,魔兽,神女,神龙)
  23. CombatPosHelpNet = {
  24. {"type" , 1, "byte"},--辅助类型
  25. {"id" , 1, "byte"},--辅助id
  26. {"icon" , 1, "byte"},--辅助图标
  27. }
  28. CombatTypeNet = {
  29. {"type", 1, "byte"},--战斗类型
  30. {"name", 1, "string"},--战斗类型名字
  31. {"needLv", 1, "int"}, -- 布阵所需要等级
  32. {"isQuickTime", 1, "string"}, --跳过设置
  33. }
  34. GC_COMBAT_POS_QUERY = {
  35. {"list", 20, CombatTypeNet},
  36. {"formation", 1, "short"}, --阵法
  37. {"heroList", 6, CombatPosNet}, --上阵英雄列表
  38. {"helpList", 6, CombatPosHelpNet},--辅助对象列表
  39. {"type", 1, "byte"}, --战斗类型
  40. {"mapID", 1, "short"}, --布阵地图
  41. {"backUpLock", 1, "byte"}, --援军是否已解锁
  42. {"jibanLv", 1, "short"}, --羁绊所需等级
  43. {"flag", 1, "byte"}, --请求标志
  44. {"teamType", 1, "byte"}, --阵容共享
  45. {"moshouLock", 1, "byte"}, --魔兽开启
  46. {"moshouSkill", 1, "string"}, --魔兽开启
  47. {"totalZdl", 1, "int"}, --战斗力
  48. }
  49. POS_ATTR_DATA = {
  50. {"posAttr", 2, Attr}, --战斗力
  51. }
  52. CG_COMBAT_FORMATION_QUERY = {}
  53. CombatFormationNet = {
  54. {"id", 1, "byte"}, -- 阵法id
  55. {"name", 1, "string"}, -- 阵法名字
  56. {"icon", 1, "int"}, -- 阵法图标
  57. {"lv", 1, "int"}, -- 阵法解锁等级
  58. {"list", 9, "byte"}, -- 阵法可用位置
  59. {"posAttrLit", 9, POS_ATTR_DATA}, --阵法位置属性加成列表
  60. }
  61. GC_COMBAT_FORMATION_QUERY = {
  62. {"list", 10, CombatFormationNet},
  63. {"lv", 1, "int"}, -- 玩家等级
  64. }
  65. CG_COMBAT_POS_UPDATE = {
  66. {"type", 1, "byte"},--阵容类型
  67. {"formation", 1, "short"},--阵法
  68. {"heroList" , 1, "string"},--上阵英雄
  69. {"helpList" , 1, "string"},--辅助对象
  70. }
  71. GC_COMBAT_POS_UPDATE = {
  72. {"type", 1, "byte"},--阵容类型
  73. {"teamType", 1, "byte"},--阵容类型
  74. }
  75. CG_COMBAT_POS_ATTR_QUERY = {
  76. }
  77. CombatPosAttrSubNet = {
  78. {"cnt", 1, "byte"},
  79. {"attrs", 4, Attr},
  80. }
  81. CombatPosAttrNet = {
  82. {"camp", 1, "byte"},
  83. {"name", 1, "string"}, -- 阵营光环名字
  84. {"list", 5, CombatPosAttrSubNet},
  85. }
  86. GC_COMBAT_POS_ATTR_QUERY = {
  87. {"list", 6, CombatPosAttrNet},--阵营光环属性
  88. {"attrs", 4, Attr},--克制属性
  89. }
  90. -- 设置战斗跳过
  91. CG_COMBAT_SET_QUICK = {
  92. {"combatType", 1, "byte"},
  93. {"isQuick", 1, "byte"},
  94. }
  95. -- 战斗开始
  96. CG_COMBAT_BEGIN = {
  97. {"param", 1, "string"},
  98. {"combatType", 1, "byte"},
  99. {"nServerIndex",1, "int"}
  100. }
  101. CombatSkillConf = {
  102. {"skillID", 1, "int"},
  103. {"fireType", 1, "short"},
  104. {"readyAction", 1, "string"},
  105. {"attackPart", 1, "string"},
  106. {"attackAction", 1, "string"},
  107. {"readyEffect", 1, "string"},
  108. {"attackEffect", 1, "string"},
  109. {"hitEffect", 1, "string"},
  110. {"flyEffect", 1, "string"},
  111. {"flyCoords", 1, "string"},
  112. {"quake", 1, "string"},
  113. {"hitBack", 1, "int"},
  114. {"effectTime", 1, "short"},
  115. {"contentType", 1, "byte"},
  116. {"content", 1, "string"},
  117. {"fireSound", 1, "int"},
  118. {"movieEffect", 1, "byte"},
  119. {"flySound", 1, "int"},
  120. {"hitSound", 1, "string"},
  121. {"cvSound", 1, "int"},
  122. {"screenMask", 1, "string"},
  123. {"screenCam", 1, "string"},
  124. {"largeEffect", 1, "string"},
  125. {"lie", 1, "string"},
  126. {"cuoZhen", 1, "short"},
  127. {"skillDelay", 1, "short"},
  128. {"isFraming", 1, "byte"},
  129. }
  130. CombatCmdConf = {
  131. {"cmd", 1, "int"},
  132. {"hitEffect", 1, "string"},
  133. {"hitSound", 1, "int"},
  134. }
  135. CombatBufferConf = {
  136. {"bufferID", 1, "int"},
  137. {"name", 1, "string"},
  138. {"desc", 1, "string"},
  139. {"icon", 1, "string"},
  140. {"keepEffect", 1, "string"},
  141. {"hitEffect", 1, "string"},
  142. {"validateEffect", 1, "string"},
  143. {"dieEffect", 1, "string"},
  144. {"cmd", 1, "string"},
  145. {"hitSound", 1, "int"},
  146. {"holdOnDie", 1, "byte"},--死亡是否保留
  147. {"effectOffset", 1, "string"},--特效偏移
  148. {"canAppend", 1, "byte"},--
  149. {"appendCnt", 1, "byte"},--
  150. }
  151. CombatHeroNet = {
  152. {"pos", 1, "byte"}, -- 需要跟客户端商定一下,暂定1-6己方 7-12敌方
  153. {"heroID", 1, "int"}, -- 英雄id
  154. {"icon", 1, "int"},
  155. {"width" , 1, "short"},
  156. {"height" , 1, "short"},
  157. {"star" , 1, "short"},
  158. {"lv" , 1, "short"}, -- 等级
  159. {"camp", 1, "byte"}, -- 阵营
  160. {"name", 1, "string"},
  161. {"body", 1, "int"}, -- 形象
  162. {"hpMax", 1, "double"}, -- 最大血量
  163. {"hpNow", 1, "double"}, -- 当前血量
  164. {"size", 1, "int"},
  165. {"posX", 1, "short"},
  166. {"posY", 1, "short"},
  167. {"isBoss", 1, "byte"}, -- 会加光效,但是代码没实现,迟点看情况加
  168. {"isGongMing", 1, "byte"}, -- 是否共鸣
  169. {"grade", 1, "byte"}, -- 确定是否是ssr 用于特殊表现
  170. {"sayList", 20, "int"},
  171. }
  172. CombatHelpNet = {
  173. {"pos", 1, "byte"},
  174. {"id", 1, "int"},
  175. {"head", 1, "int"},
  176. {"body", 1, "int"},
  177. {"args", 10, "int"}, -- 其他参数
  178. {"skill", 2, MoshouSkill}, --
  179. }
  180. GC_COMBAT_BEGIN = {
  181. {"isLogin", 1, "byte"}, -- 是否登录时下发 客户端需要
  182. {"combatType", 1, "byte"}, -- 战斗类型
  183. {"keepTime", 1, "short"},-- 服务端经过了多少时间
  184. {"heros", 12, CombatHeroNet}, -- 对战英雄信息(站位)
  185. {"helps", 10, CombatHelpNet}, -- 对战辅助对象信息(站位)
  186. {"mapID", 1, "int"}, -- 战斗场景
  187. {"skillList", 60, CombatSkillConf}, -- 战斗中使用过的技能
  188. {"cmdList", 16, CombatCmdConf}, -- 战斗中使用过的作用
  189. {"bufferList", 60, CombatBufferConf}, -- 战斗中使用过的技能
  190. {"speed", 1, "byte"},
  191. {"attrsAtk", 10, Attr},
  192. {"attrsDef", 10, Attr},
  193. {"atkName", 1, "string"},
  194. {"defName", 1, "string"},
  195. {"atkUuid", 1, "string"},
  196. {"defUuid", 1, "string"},
  197. {"maxRound", 1, "short"},
  198. {"isVideo", 1, "byte"},
  199. {"petCD", 1, "short"},
  200. {"atkJibanDesc", 1, "string"},
  201. {"defJibanDesc", 1, "string"},
  202. {"atkFormation", 1, "short"},
  203. {"defFormation", 1, "short"},
  204. {"isQuick", 1, "byte"},
  205. {"backup", 2, "byte"}, --第一个是攻方援军的站位,第二个是守方援军的站位。0值表示援军还没上
  206. --{"isBoss", 1, "byte"}, -- 敌方是否是boss
  207. }
  208. CombatHitNet = {
  209. {"pos", 1, "byte"},
  210. {"flag", 1, "byte"},
  211. {"cmd", 1, "byte"},
  212. {"hpNow", 1, "double"},
  213. {"attrs", 10, Attr},
  214. }
  215. CombatPetNet = {
  216. {"pos", 1, "byte"},
  217. }
  218. CombatSkillData = {
  219. {"attackPos", 1, "byte"},
  220. {"skillID", 1, "int"},
  221. {"hitList", 12, CombatHitNet},
  222. {"extraList", 12, CombatHitNet},
  223. {"helpList", 12, CombatPetNet},
  224. }
  225. CombatBufferNet = {
  226. {"op", 1, "byte"},--1 添加 2 持续 3 删除
  227. {"bufferID", 1, "int"},
  228. {"cnt", 1, "short"},
  229. {"round", 1, "short"},
  230. {"hpNow", 1, "double"},
  231. {"attrs", 10, Attr},
  232. }
  233. CombatBufferData = {
  234. {"pos", 1, "byte"},
  235. {"list", 40, CombatBufferNet},
  236. }
  237. CombatSayData = {
  238. {"pos", 1, "byte"},
  239. {"skillID", 1, "int"},
  240. }
  241. CombatFrameNet = {
  242. {"round", 1, "byte"}, -- 回合,从1开始
  243. {"petCD", 1, "byte"}, -- 魔兽技能cd
  244. {"skillList", 12, CombatSkillData},
  245. {"bufferList", 12, CombatBufferData},
  246. {"sayList", 36, CombatSayData}, --喊话技能列表
  247. }
  248. GC_COMBAT_FRAME = {
  249. {"isLogin", 1, "byte"}, -- 是否登录时下发 客户端需要
  250. {"isEnd", 1, "byte"}, -- 是否最后一帧
  251. {"combatType", 1, "byte"}, -- 战斗类型 reyes test
  252. {"frames", 60, CombatFrameNet}, -- 战斗过程
  253. }
  254. CombatResultNet = {
  255. {"pos", 1, "byte"},
  256. {"hurt", 1, "double"},--输出
  257. {"hp", 1, "double"},--治疗
  258. {"beHurt", 1, "double"},--承受伤害
  259. {"bout", 1, "int"},--出手回合数
  260. {"isDie", 1, "byte"},
  261. {"heroID", 1, "int"},
  262. {"head", 1, "int"},
  263. {"lv", 1, "short"},
  264. {"camp", 1, "byte"},
  265. {"star", 1, "byte"},
  266. {"name", 1, "string"},
  267. {"body", 1, "string"},
  268. {"grade", 1, "byte"}, --评级
  269. }
  270. --
  271. CombatFinishData = {
  272. {"ret", 1, "byte"}, -- 1 胜利 2 失败
  273. {"type", 1, "byte"}, --战斗类型
  274. {"self", 1, RoleBase},
  275. {"target", 1, RoleBase},
  276. {"items", 20, ItemData},
  277. {"result", 14, CombatResultNet},
  278. {"param", 1, "string"},
  279. {"isVideo", 1, "byte"},
  280. {"lookType", 1, "byte"}, --查看途径 0-原始 1-聊天 2-个人记录
  281. {"panelIDs", 5, "short"},
  282. {"isQuick", 1, "byte"},
  283. {"combatTime", 1, "short"},
  284. {"double", 1, "byte"}, -- 是否为福利 双倍
  285. {"oldLv", 1, "short"}, -- 历史等级
  286. {"nBattleType", 1, "short"}, -- 战斗类型,当type 为1主线时有用
  287. {"nextCombatType", 1, "short"}, -- 战斗类型,对应combat配置表中combat分页的id。用于多队伍战斗,为0表示不用继续挑战,非0表示需要继续挑战
  288. }
  289. -- 战斗结果
  290. GC_COMBAT_FINISH = {
  291. {"data", 1, CombatFinishData},
  292. }
  293. -- 战斗结束,返回记录Uuid
  294. GC_COMBAT_RETURN_RECORD = {
  295. {"videoUuid",1,"string"},
  296. {"type",1,"byte"},
  297. }
  298. -- 战斗播放速度 1or2
  299. CG_COMBAT_SPEED = {
  300. {"speed", 1, "byte"},
  301. }
  302. GC_COMBAT_SPEED = {
  303. {"speed", 1, "byte"},
  304. }
  305. -- 个人战斗记录列表
  306. CG_COMBAT_VIDEO_QUERY = {}
  307. CombatVideoData = {
  308. {"videoUuid", 1, "string"},
  309. {"combatTime", 1, "int"},
  310. {"isWin", 1, "int"},
  311. {"type", 1, "int"},
  312. {"atkRoleBase", 1, RoleBase},
  313. {"defRoleBase", 1, RoleBase},
  314. }
  315. GC_COMBAT_VIDEO_QUERY = {
  316. {"list", 50, CombatVideoData}
  317. }
  318. -- 保存
  319. CG_COMBAT_SAVE_VIDEO = {}
  320. -- 删除
  321. CG_COMBAT_DEL_VIDEO = {
  322. {"videoUuid", 1, "string"},
  323. }
  324. -- 战斗记录回放
  325. CG_COMBAT_LOOK_VIDEO = {
  326. {"videoUuid", 1, "string"},
  327. {"lookType", 1, "byte"}, --查看途径 0-原始 1-聊天 2-个人记录
  328. }
  329. -- 客户端播放战斗过程结束 reyes test
  330. CG_COMBAT_CLIENT_FINISH = {
  331. {"type", 1, "byte"}, --战斗类型
  332. }
  333. -- 客户端播放战斗过程的时间设置
  334. CG_COMBAT_CLIENT_PASS_TIME = {
  335. {"type", 1, "byte"}, --战斗类型
  336. {"passTime", 1, "short"}, --服务端时间
  337. }
  338. CG_JIBAN_QUERY = {
  339. {"combatType", 1, "byte"},
  340. {"heroID", 1, "int"},
  341. }
  342. JibanInfoNet = {
  343. {"id", 1, "short"},
  344. {"quality", 1, "byte"},
  345. {"name", 1, "string"},
  346. {"desc", 1, "string"},
  347. {"heroList", 10, HeroSimple},
  348. }
  349. JibanPosNet = {
  350. {"id", 1, "short"},
  351. {"hero", 1, HeroSimple},
  352. {"isOpen", 1, "byte"}, --0 未解锁 1 已解锁
  353. {"tip", 1, "string"}, --提示
  354. {"sort", 1, "byte"}, --提示
  355. }
  356. GC_JIBAN_QUERY = {
  357. {"jibanList", 20, JibanInfoNet},
  358. {"posList", 5, JibanPosNet}
  359. }
  360. GC_JIBAN_QUERY_ALL = {
  361. {"posList", 5, JibanPosNet},
  362. {"type", 1, "byte"}
  363. }
  364. CG_JIBAN_PREVIEW = {}
  365. GC_JIBAN_PREVIEW = {
  366. {"list", 40, JibanInfoNet},
  367. {"isend", 1, "byte"},
  368. }
  369. CG_JIBAN_UPDATE = {
  370. {"combatType", 1, "byte"},
  371. {"jibanList", 1, "string"},--羁绊
  372. }
  373. GC_JIBAN_UPDATE = {
  374. }
  375. CG_HERO_UPDATE_ALL_POS = {
  376. {"uuid", 1, "string"},
  377. }
  378. GC_HERO_UPDATE_ALL_POS = {
  379. }
  380. CG_HERO_UPDATE_ZDL = {
  381. {"uuid", 1, "string"},
  382. }
  383. GC_HERO_UPDATE_ZDL = {
  384. {"list", 10, CombatHeroZdl},
  385. }