TequanLogic.lua 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939
  1. local TequanExcel = require("excel.qqTequan")
  2. local Msg = require("core.Msg")
  3. local Grid = require("bag.Grid")
  4. local BagLogic = require("bag.BagLogic")
  5. local Util = require("common.Util")
  6. local Lang = require("common.Lang")
  7. local HeroLogic = require("hero.HeroLogic")
  8. local RoleSystemLogic = require("roleSystem.RoleSystemLogic")
  9. local RoleSystemDefine = require("roleSystem.RoleSystemDefine")
  10. TEQUAN_TYPE_1 = 1 -- 黄钻特权
  11. TEQUAN_TYPE_2 = 2 -- 蓝钻特权
  12. function activateTequan(human,type,tequanType,lv,hh,pf)
  13. if lv ~= nil and lv < 0 then
  14. return
  15. end
  16. if type == TEQUAN_TYPE_1 then -- 黄钻
  17. if human.db.yellow == nil then
  18. human.db.yellow = {}
  19. human.db.yellow.lv = lv
  20. human.db.yellow.isAdd = 1
  21. if tequanType == 1 then
  22. human.db.yellow.year = human.db.yellow.year or {}
  23. else
  24. human.db.yellow.year = nil
  25. end
  26. if hh == 1 then
  27. human.db.yellow.lux = human.db.yellow.lux or {}
  28. else
  29. human.db.yellow.lux = nil
  30. end
  31. else
  32. human.db.yellow.lv = lv
  33. if tequanType == 1 then
  34. human.db.yellow.year = human.db.yellow.year or {}
  35. else
  36. human.db.yellow.year = nil
  37. end
  38. if hh == 1 then
  39. human.db.yellow.lux = human.db.yellow.lux or {}
  40. else
  41. human.db.yellow.lux = nil
  42. end
  43. end
  44. elseif type == TEQUAN_TYPE_2 then
  45. if human.db.blue == nil then
  46. human.db.blue = {}
  47. human.db.blue.lv = lv
  48. human.db.blue.isAdd = 1
  49. if tequanType == 1 then
  50. human.db.blue.year = human.db.blue.year or {}
  51. else
  52. human.db.blue.year = nil
  53. end
  54. if hh == 1 then
  55. human.db.blue.lux = human.db.blue.lux or {}
  56. else
  57. human.db.blue.lux = nil
  58. end
  59. else
  60. human.db.blue.lv = lv
  61. if tequanType == 1 then
  62. human.db.blue.year = human.db.blue.year or {}
  63. else
  64. human.db.blue.year = nil
  65. end
  66. if hh == 1 then
  67. human.db.blue.lux = human.db.blue.lux or {}
  68. else
  69. human.db.blue.lux = nil
  70. end
  71. end
  72. end
  73. if pf == 1 then
  74. human.db.txHall = {}
  75. human.pf_info.pf = "qqgame"
  76. elseif pf == 2 then
  77. human.db.qqZone = {}
  78. human.pf_info.pf = "qzone"
  79. end
  80. HeroLogic.sendHeroBagCap(human)
  81. end
  82. function tencentXinShouQuery(human,tType,platformType)
  83. local msgRet = Msg.gc.GC_QQ_TEQUAN_VIP_XINSHOU_QUERY
  84. local config = nil
  85. if platformType ~= 2 then -- 查询平台类型
  86. if platformType == tType then
  87. config = TequanExcel.txXinshou
  88. local len = #config[1].reward
  89. if platformType == 1 then
  90. if human.pf_info.pf ~= "qqgame" then
  91. checkDot(human,tType,platformType)
  92. return
  93. end
  94. if human.db.txHall == nil then
  95. msgRet.isGet = 2
  96. else
  97. if human.db.txHall.isGet ~= nil then
  98. msgRet.isGet = 1
  99. else
  100. msgRet.isGet = 0
  101. end
  102. end
  103. else
  104. if human.pf_info.pf ~= "qzone" and human.pf_info.pf ~= "website" then
  105. checkDot(human,tType,platformType)
  106. return
  107. end
  108. if human.db.qqZone == nil then
  109. msgRet.isGet = 2
  110. else
  111. if human.db.qqZone.isGet ~= nil then
  112. msgRet.isGet = 1
  113. else
  114. msgRet.isGet = 0
  115. end
  116. end
  117. end
  118. for i = 1,len do
  119. Grid.makeItem(msgRet.reward[i], config[1].reward[i][1],config[1].reward[i][2])
  120. end
  121. msgRet.reward[0] = len
  122. msgRet.str = ""
  123. Msg.send(msgRet,human.fd)
  124. checkDot(human,tType,platformType)
  125. end
  126. return
  127. end
  128. if tType == 1 then -- 蓝钻
  129. config = TequanExcel.lzXinshou
  130. local len = #config[1].reward
  131. if human.db.blue == nil or human.db.blue.lv == 0 then
  132. msgRet.isGet = 2
  133. else
  134. if human.db.blue.isGet ~= nil then
  135. msgRet.isGet = 1
  136. else
  137. msgRet.isGet = 0
  138. end
  139. end
  140. for i = 1,len do
  141. Grid.makeItem(msgRet.reward[i], config[1].reward[i][1],config[1].reward[i][2])
  142. end
  143. config = TequanExcel.tequan[1]
  144. msgRet.str = Util.format(Lang.YELLOW_VIP_PRIVILEGE,config.privilege)
  145. msgRet.reward[0] = len
  146. elseif tType == 0 then -- 黄钻
  147. config = TequanExcel.hzXinshou
  148. local len = #config[1].reward
  149. if human.db.yellow == nil or human.db.yellow.lv == 0 then
  150. msgRet.isGet = 2
  151. else
  152. if human.db.yellow.isGet ~= nil then
  153. msgRet.isGet = 1
  154. else
  155. msgRet.isGet = 0
  156. end
  157. end
  158. for i = 1,len do
  159. Grid.makeItem(msgRet.reward[i], config[1].reward[i][1],config[1].reward[i][2])
  160. end
  161. config = TequanExcel.tequan[2]
  162. msgRet.str = Util.format(Lang.YELLOW_VIP_PRIVILEGE,config.privilege)
  163. msgRet.reward[0] = len
  164. else
  165. checkDot(human,tType,platformType)
  166. return
  167. end
  168. Msg.send(msgRet,human.fd)
  169. checkDot(human,tType,platformType)
  170. end
  171. function tencentXinShouGet(human,tType,platformType)
  172. if platformType ~= 2 then
  173. if platformType == tType then
  174. if platformType == 1 then
  175. if human.pf_info.pf ~= "qqgame" then
  176. return
  177. end
  178. if human.db.txHall == nil then
  179. return -- 不是大厅玩
  180. end
  181. if human.db.txHall.isGet ~= nil then
  182. return -- 已经领取过
  183. end
  184. human.db.txHall.isGet = 1
  185. else
  186. if human.pf_info.pf ~= "qzone" and human.pf_info.pf ~= "website" then
  187. return
  188. end
  189. if human.db.qqZone == nil then
  190. return -- 不是大厅玩
  191. end
  192. if human.db.qqZone.isGet ~= nil then
  193. return -- 已经领取过
  194. end
  195. human.db.qqZone.isGet = 1
  196. end
  197. local config = TequanExcel.txXinshou
  198. BagLogic.addItemList(human,config[1].reward, "hall_reward")
  199. end
  200. tencentXinShouQuery(human,tType,platformType)
  201. RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_107)
  202. return
  203. end
  204. if tType == 1 then
  205. if human.db.blue == nil or human.db.blue.lv == 0 then
  206. return -- 当前黄钻未开通
  207. end
  208. if human.db.blue.isGet ~= nil then
  209. return -- 已经领取过
  210. end
  211. human.db.blue.isGet = 1
  212. local config = TequanExcel.lzXinshou
  213. BagLogic.addItemList(human,config[1].reward, "blue_reward")
  214. elseif tType == 0 then
  215. if human.db.yellow == nil or human.db.yellow.lv == 0 then
  216. return -- 当前黄钻未开通
  217. end
  218. if human.db.yellow.isGet ~= nil then
  219. return -- 已经领取过
  220. end
  221. human.db.yellow.isGet = 1
  222. local config = TequanExcel.hzXinshou
  223. BagLogic.addItemList(human,config[1].reward, "yellow_reward")
  224. else
  225. return
  226. end
  227. tencentXinShouQuery(human,tType,platformType)
  228. RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_106)
  229. end
  230. function tencentLvUpQuery(human,tType,platformType)
  231. local msgRet = Msg.gc.GC_QQ_TEQUAN_VIP_LVUP_QUERY
  232. if platformType ~= 2 then
  233. if platformType == tType then
  234. local config = TequanExcel.txLvUp
  235. local lenConfig = #config
  236. for i = 1,lenConfig do
  237. if platformType == 1 then
  238. if human.pf_info.pf ~= "qqgame" then
  239. return
  240. end
  241. if human.db.txHall ~= nil and human.db.txHall.lvup ~= nil and human.db.txHall.lvup[i] ~= nil then
  242. msgRet.rewardMsg[i].isGet = 1
  243. else
  244. if human.db.txHall == nil then
  245. msgRet.rewardMsg[i].isGet = 2
  246. else
  247. msgRet.rewardMsg[i].isGet = 0
  248. end
  249. end
  250. else
  251. if human.pf_info.pf ~= "qzone" and human.pf_info.pf ~= "website" then
  252. return
  253. end
  254. if human.db.qqZone ~= nil and human.db.qqZone.lvup ~= nil and human.db.qqZone.lvup[i] ~= nil then
  255. msgRet.rewardMsg[i].isGet = 1
  256. else
  257. if human.db.qqZone == nil then
  258. msgRet.rewardMsg[i].isGet = 2
  259. else
  260. msgRet.rewardMsg[i].isGet = 0
  261. end
  262. end
  263. end
  264. if human.db.lv < config[i].needLv then
  265. msgRet.rewardMsg[i].isGet = 2
  266. end
  267. msgRet.rewardMsg[i].id = i
  268. msgRet.rewardMsg[i].lv = config[i].needLv
  269. local lenReward = #config[i].reward
  270. for j = 1,lenReward do
  271. Grid.makeItem(msgRet.rewardMsg[i].reward[j],config[i].reward[j][1],config[i].reward[j][2])
  272. end
  273. msgRet.rewardMsg[i].reward[0] = lenReward
  274. end
  275. msgRet.rewardMsg[0] = lenConfig
  276. end
  277. Msg.send(msgRet,human.fd)
  278. return
  279. end
  280. if tType == 1 then
  281. local config = TequanExcel.lzLvUp
  282. local lenConfig = #config
  283. for i = 1,lenConfig do
  284. if human.db.blue ~= nil and human.db.blue.lv ~= 0 and human.db.blue.lvup ~= nil and human.db.blue.lvup[i] ~= nil then
  285. msgRet.rewardMsg[i].isGet = 1
  286. else
  287. if human.db.blue == nil or human.db.blue.lv == 0 then
  288. msgRet.rewardMsg[i].isGet = 2
  289. else
  290. msgRet.rewardMsg[i].isGet = 0
  291. end
  292. end
  293. if human.db.lv < config[i].needLv then
  294. msgRet.rewardMsg[i].isGet = 2
  295. end
  296. msgRet.rewardMsg[i].id = i
  297. msgRet.rewardMsg[i].lv = config[i].needLv
  298. local lenReward = #config[i].reward
  299. for j = 1,lenReward do
  300. Grid.makeItem(msgRet.rewardMsg[i].reward[j],config[i].reward[j][1],config[i].reward[j][2])
  301. end
  302. msgRet.rewardMsg[i].reward[0] = lenReward
  303. end
  304. msgRet.rewardMsg[0] = lenConfig
  305. elseif tType == 0 then
  306. local config = TequanExcel.hzLvUp
  307. local lenConfig = #config
  308. for i = 1,lenConfig do
  309. if human.db.yellow ~= nil and human.db.yellow.lv ~= 0 and human.db.yellow.lvup ~= nil and human.db.yellow.lvup[i] ~= nil then
  310. msgRet.rewardMsg[i].isGet = 1
  311. else
  312. if human.db.yellow == nil or human.db.yellow.lv == 0 then
  313. msgRet.rewardMsg[i].isGet = 2
  314. else
  315. msgRet.rewardMsg[i].isGet = 0
  316. end
  317. end
  318. if human.db.lv < config[i].needLv then
  319. msgRet.rewardMsg[i].isGet = 2
  320. end
  321. msgRet.rewardMsg[i].id = i
  322. msgRet.rewardMsg[i].lv = config[i].needLv
  323. local lenReward = #config[i].reward
  324. for j = 1,lenReward do
  325. Grid.makeItem(msgRet.rewardMsg[i].reward[j],config[i].reward[j][1],config[i].reward[j][2])
  326. end
  327. msgRet.rewardMsg[i].reward[0] = lenReward
  328. end
  329. msgRet.rewardMsg[0] = lenConfig
  330. else
  331. return
  332. end
  333. Msg.send(msgRet,human.fd)
  334. end
  335. function tencentLvUpGet(human,id,tType,platformType)
  336. if platformType ~= 2 then
  337. if platformType == tType then
  338. local config = TequanExcel.txLvUp
  339. if id == nil or id > #config or id <= 0 then
  340. return -- 无效礼包id
  341. end
  342. if human.db.lv < config[id].needLv then
  343. return
  344. end
  345. if platformType == 1 then
  346. if human.pf_info.pf ~= "qqgame" then
  347. return
  348. end
  349. if human.db.txHall == nil then
  350. return -- 当前黄钻未开通
  351. end
  352. if human.db.txHall.lvup ~= nil and human.db.txHall.lvup[id] ~= nil then
  353. return -- 已经领取过
  354. end
  355. human.db.txHall.lvup = human.db.txHall.lvup or {}
  356. human.db.txHall.lvup[id] = 1
  357. else
  358. if human.pf_info.pf ~= "qzone" and human.pf_info.pf ~= "website" then
  359. return
  360. end
  361. if human.db.qqZone == nil then
  362. return -- 当前黄钻未开通
  363. end
  364. if human.db.qqZone.lvup ~= nil and human.db.qqZone.lvup[id] ~= nil then
  365. return -- 已经领取过
  366. end
  367. human.db.qqZone.lvup = human.db.qqZone.lvup or {}
  368. human.db.qqZone.lvup[id] = 1
  369. end
  370. BagLogic.addItemList(human,config[id].reward, "hall_reward")
  371. end
  372. tencentLvUpQuery(human,tType,platformType)
  373. checkDot(human,tType,platformType)
  374. RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_107)
  375. return
  376. end
  377. if tType == 1 then
  378. if human.db.blue == nil or human.db.blue.lv == 0 then
  379. return -- 当前黄钻未开通
  380. end
  381. local config = TequanExcel.lzLvUp
  382. if human.db.lv < config[id].needLv then
  383. return
  384. end
  385. if id == nil or id > #config or id <= 0 then
  386. return -- 无效礼包id
  387. end
  388. if human.db.blue.lvup ~= nil and human.db.blue.lvup[id] ~= nil then
  389. return -- 已经领取过
  390. end
  391. human.db.blue.lvup = human.db.blue.lvup or {}
  392. human.db.blue.lvup[id] = 1
  393. BagLogic.addItemList(human,config[id].reward, "yellow_reward")
  394. elseif tType == 0 then
  395. if human.db.yellow == nil or human.db.yellow.lv == 0 then
  396. return -- 当前黄钻未开通
  397. end
  398. local config = TequanExcel.hzLvUp
  399. if human.db.lv < config[id].needLv then
  400. return
  401. end
  402. if id == nil or id > #config or id <= 0 then
  403. return -- 无效礼包id
  404. end
  405. if human.db.yellow.lvup ~= nil and human.db.yellow.lvup[id] ~= nil then
  406. return -- 已经领取过
  407. end
  408. human.db.yellow.lvup = human.db.yellow.lvup or {}
  409. human.db.yellow.lvup[id] = 1
  410. BagLogic.addItemList(human,config[id].reward, "yellow_reward")
  411. else
  412. return
  413. end
  414. tencentLvUpQuery(human,tType,platformType)
  415. checkDot(human,tType,platformType)
  416. RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_106)
  417. end
  418. function tencentDailyQuery(human,tType,platformType)
  419. local msgRet = Msg.gc.GC_QQ_TEQUAN_VIP_DAILY_QUERY
  420. if platformType ~= 2 then
  421. if platformType == tType then
  422. local config = TequanExcel.txDaily[1]
  423. msgRet.tencent_daily[1].vipLv = 0
  424. local lenReward = #config.reward
  425. for j = 1,lenReward do
  426. Grid.makeItem(msgRet.tencent_daily[1].reward[j],config.reward[j][1],config.reward[j][2])
  427. end
  428. msgRet.tencent_daily[1].reward[0] = lenReward
  429. if platformType == 1 then
  430. if human.pf_info.pf ~= "qqgame" then
  431. return
  432. end
  433. if human.db.txHall ~= nil and human.db.txHall.daily == nil then
  434. msgRet.isGet = {0,0,0}
  435. elseif human.db.txHall == nil then
  436. msgRet.isGet = {2,0,0}
  437. else
  438. msgRet.isGet = {1,0,0}
  439. end
  440. else
  441. if human.pf_info.pf ~= "qzone" and human.pf_info.pf ~= "website" then
  442. return
  443. end
  444. if human.db.qqZone ~= nil and human.db.qqZone.daily == nil then
  445. msgRet.isGet = {0,0,0}
  446. elseif human.db.qqZone == nil then
  447. msgRet.isGet = {2,0,0}
  448. else
  449. msgRet.isGet = {1,0,0}
  450. end
  451. end
  452. msgRet.tencent_daily[0] = 1
  453. msgRet.extraRewardYear[0] = 0
  454. msgRet.extraRewardLux[0] = 0
  455. msgRet.isGet[0] = 3
  456. Msg.send(msgRet,human.fd)
  457. end
  458. return
  459. end
  460. local config = nil
  461. if tType == 1 then
  462. config = TequanExcel.lzDaily
  463. elseif tType == 0 then
  464. config = TequanExcel.hzDaily
  465. else
  466. return
  467. end
  468. local lenConfig = #config
  469. for i = 1,lenConfig do
  470. msgRet.tencent_daily[i].vipLv = config[i].needVipLv
  471. local lenReward = #config[i].reward
  472. for j = 1,lenReward do
  473. Grid.makeItem(msgRet.tencent_daily[i].reward[j],config[i].reward[j][1],config[i].reward[j][2])
  474. end
  475. msgRet.tencent_daily[i].reward[0] = lenReward
  476. end
  477. msgRet.tencent_daily[0] = lenConfig
  478. local lenExtra = #config[1].extraRewardYear
  479. for i = 1,lenExtra do
  480. Grid.makeItem(msgRet.extraRewardYear[i],config[1].extraRewardYear[i][1],config[1].extraRewardYear[i][2])
  481. end
  482. msgRet.extraRewardYear[0] = lenExtra
  483. lenExtra = #config[1].extraRewardLux
  484. for i = 1,lenExtra do
  485. Grid.makeItem(msgRet.extraRewardLux[i],config[1].extraRewardLux[i][1],config[1].extraRewardLux[i][2])
  486. end
  487. msgRet.extraRewardLux[0] = lenExtra
  488. msgRet.isGet = {0,0,0}
  489. if tType == 0 then
  490. if human.db.yellow == nil or human.db.yellow.lv == 0 then
  491. msgRet.isGet = {2,2,2}
  492. else
  493. if human.db.yellow.daily ~= nil then
  494. msgRet.isGet[1] = 1
  495. end
  496. if human.db.yellow.lux ~= nil and human.db.yellow.lux.isGet ~= nil then
  497. msgRet.isGet[2] = 1
  498. elseif human.db.yellow.lux == nil then
  499. msgRet.isGet[2] = 2
  500. end
  501. if human.db.yellow.year ~= nil and human.db.yellow.year.isGet ~= nil then
  502. msgRet.isGet[3] = 1
  503. elseif human.db.yellow.year == nil then
  504. msgRet.isGet[3] = 2
  505. end
  506. end
  507. elseif tType == 1 then
  508. if human.db.blue == nil or human.db.blue.lv == 0 then
  509. msgRet.isGet = {2,2,2}
  510. else
  511. if human.db.blue.daily ~= nil then
  512. msgRet.isGet[1] = 1
  513. end
  514. if human.db.blue.lux ~= nil and human.db.blue.lux.isGet ~= nil then
  515. msgRet.isGet[2] = 1
  516. elseif human.db.blue.lux == nil then
  517. msgRet.isGet[2] = 2
  518. end
  519. if human.db.blue.year ~= nil and human.db.blue.year.isGet ~= nil then
  520. msgRet.isGet[3] = 1
  521. elseif human.db.blue.year == nil then
  522. msgRet.isGet[3] = 2
  523. end
  524. end
  525. end
  526. msgRet.isGet[0] = 3
  527. Msg.send(msgRet,human.fd)
  528. end
  529. function tencentDailyGet(human,tType,platformType,rType)
  530. if platformType ~= 2 then
  531. if platformType == tType then
  532. if platformType == 1 then
  533. if human.pf_info.pf ~= "qqgame" then
  534. return
  535. end
  536. if human.db.txHall ~= nil and human.db.txHall.daily ~= nil then
  537. return
  538. end
  539. human.db.txHall.daily = 1
  540. else
  541. if human.pf_info.pf ~= "qzone" and human.pf_info.pf ~= "website" then
  542. return
  543. end
  544. if human.db.qqZone ~= nil and human.db.qqZone.daily ~= nil then
  545. return
  546. end
  547. human.db.qqZone.daily = 1
  548. end
  549. local config = TequanExcel.txDaily[1]
  550. BagLogic.addItemList(human,config.reward, "blue_reward")
  551. end
  552. tencentDailyQuery(human,tType,platformType)
  553. checkDot(human,tType,platformType)
  554. RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_107)
  555. return
  556. end
  557. if tType == 1 then
  558. if human.db.blue == nil or human.db.blue.lv == 0 then
  559. return -- 当前黄钻未开通
  560. end
  561. local config = TequanExcel.lzDaily
  562. local lv = human.db.blue.lv
  563. local lenItem = 0
  564. local item = nil
  565. if human.db.blue.daily == nil then
  566. human.db.blue.daily = 1
  567. local lenReward = #config[lv].reward
  568. for i = 1,lenReward do
  569. lenItem = lenItem + 1
  570. item = item or {}
  571. item[lenItem] = {}
  572. item[lenItem][1] = config[lv].reward[i][1]
  573. item[lenItem][2] = config[lv].reward[i][2]
  574. end
  575. end
  576. if human.db.blue.year ~= nil and human.db.blue.year.isGet == nil then
  577. human.db.blue.year.isGet = 1
  578. local lenExtra = #config[lv].extraRewardYear
  579. for i = 1,lenExtra do
  580. lenItem = lenItem + 1
  581. item = item or {}
  582. item[lenItem] = {}
  583. item[lenItem][1] = config[1].extraRewardYear[i][1]
  584. item[lenItem][2] = config[1].extraRewardYear[i][2]
  585. end
  586. end
  587. if human.db.blue.lux ~= nil and human.db.blue.lux.isGet == nil then
  588. human.db.blue.lux.isGet = 1
  589. local lenExtra = #config[lv].extraRewardLux
  590. for i = 1,lenExtra do
  591. lenItem = lenItem + 1
  592. item = item or {}
  593. item[lenItem] = {}
  594. item[lenItem][1] = config[1].extraRewardLux[i][1]
  595. item[lenItem][2] = config[1].extraRewardLux[i][2]
  596. end
  597. end
  598. if item then
  599. BagLogic.addItemList(human,item, "blue_reward")
  600. end
  601. elseif tType == 0 then
  602. if human.db.yellow == nil or human.db.yellow.lv == 0 then
  603. return -- 当前黄钻未开通
  604. end
  605. local config = TequanExcel.hzDaily
  606. local lv = human.db.yellow.lv
  607. local lenItem = 0
  608. local item = nil
  609. if human.db.yellow.daily == nil then
  610. human.db.yellow.daily = 1
  611. local lenReward = #config[lv].reward
  612. for i = 1,lenReward do
  613. lenItem = lenItem + 1
  614. item = item or {}
  615. item[lenItem] = {}
  616. item[lenItem][1] = config[lv].reward[i][1]
  617. item[lenItem][2] = config[lv].reward[i][2]
  618. end
  619. end
  620. if human.db.yellow.year ~= nil and human.db.yellow.year.isGet == nil then
  621. human.db.yellow.year.isGet = 1
  622. local lenExtra = #config[lv].extraRewardYear
  623. for i = 1,lenExtra do
  624. lenItem = lenItem + 1
  625. item = item or {}
  626. item[lenItem] = {}
  627. item[lenItem][1] = config[1].extraRewardYear[i][1]
  628. item[lenItem][2] = config[1].extraRewardYear[i][2]
  629. end
  630. end
  631. if human.db.yellow.lux ~= nil and human.db.yellow.lux.isGet == nil then
  632. human.db.yellow.lux.isGet = 1
  633. local lenExtra = #config[lv].extraRewardLux
  634. for i = 1,lenExtra do
  635. lenItem = lenItem + 1
  636. item = item or {}
  637. item[lenItem] = {}
  638. item[lenItem][1] = config[1].extraRewardLux[i][1]
  639. item[lenItem][2] = config[1].extraRewardLux[i][2]
  640. end
  641. end
  642. if item then
  643. BagLogic.addItemList(human,item, "blue_reward")
  644. end
  645. else
  646. return
  647. end
  648. tencentDailyQuery(human,tType,platformType)
  649. checkDot(human,tType,platformType)
  650. RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_106)
  651. end
  652. function cleanDaily(human)
  653. if human.db.yellow ~= nil and human.db.yellow.lv ~= 0 then
  654. human.db.yellow.daily = nil
  655. if human.db.yellow.year ~= nil then
  656. human.db.yellow.year = {}
  657. end
  658. if human.db.yellow.lux ~= nil then
  659. human.db.yellow.lux = {}
  660. end
  661. end
  662. if human.db.blue ~= nil and human.db.blue.lv ~= 0 then
  663. human.db.blue.daily = nil
  664. if human.db.blue.year ~= nil then
  665. human.db.blue.year = {}
  666. end
  667. if human.db.blue.lux ~= nil then
  668. human.db.blue.lux = {}
  669. end
  670. end
  671. if human.db.txHall ~= nil then
  672. human.db.txHall.daily = nil
  673. end
  674. if human.db.qqZone ~= nil then
  675. human.db.qqZone.daily = nil
  676. end
  677. end
  678. function isDot(human)
  679. if (human.db.yellow == nil or human.db.yellow.lv == 0) and (human.db.blue == nil or human.db.blue.lv == 0) and human.db.txHall == nil and human.db.qqZone == nil then
  680. return
  681. end
  682. if human.db.yellow ~= nil and human.db.yellow.lv ~= 0 then
  683. if human.db.yellow.isGet == nil then
  684. return true
  685. end
  686. if human.db.yellow.daily == nil then
  687. return true
  688. end
  689. if human.db.yellow.year ~= nil and human.db.yellow.year.isGet == nil then
  690. return true
  691. end
  692. if human.db.yellow.lux ~= nil and human.db.yellow.lux.isGet == nil then
  693. return true
  694. end
  695. local config = TequanExcel.hzLvUp
  696. local lenConfig = #config
  697. for i = 1,lenConfig do
  698. if human.db.yellow ~= nil and human.db.yellow.lv ~= 0 and (human.db.yellow.lvup == nil or human.db.yellow.lvup[i] == nil) then
  699. if human.db.lv >= config[i].needLv then
  700. return true
  701. end
  702. end
  703. end
  704. end
  705. if human.db.blue ~= nil and human.db.blue.lv ~= 0 then
  706. if human.db.blue.isGet == nil then
  707. return true
  708. end
  709. if human.db.blue.daily == nil then
  710. return true
  711. end
  712. if human.db.blue.year ~= nil and human.db.blue.year.isGet == nil then
  713. return true
  714. end
  715. if human.db.blue.lux ~= nil and human.db.blue.lux.isGet == nil then
  716. return true
  717. end
  718. local config = TequanExcel.lzLvUp
  719. local lenConfig = #config
  720. for i = 1,lenConfig do
  721. if human.db.blue ~= nil and human.db.blue.lv ~= 0 and (human.db.blue.lvup == nil or human.db.blue.lvup[i] == nil) then
  722. if human.db.lv >= config[i].needLv then
  723. return true
  724. end
  725. end
  726. end
  727. end
  728. return
  729. end
  730. function checkDot(human,tType,platformType)
  731. local msgRet = Msg.gc.GC_QQ_TEQUAN_CHECK_DOT
  732. msgRet.xinshou = 0
  733. msgRet.daily = 0
  734. msgRet.lvup = 0
  735. if platformType == 2 then
  736. msgRet.type = 1
  737. if tType == 0 then
  738. if human.db.yellow ~= nil and human.db.yellow.lv ~= 0 then
  739. if human.db.yellow.isGet == nil then
  740. msgRet.xinshou = 1
  741. end
  742. if human.db.yellow.daily == nil then
  743. msgRet.daily = 1
  744. end
  745. if human.db.yellow.year ~= nil and human.db.yellow.year.isGet == nil then
  746. msgRet.daily = 1
  747. end
  748. if human.db.yellow.lux ~= nil and human.db.yellow.lux.isGet == nil then
  749. msgRet.daily = 1
  750. end
  751. local config = TequanExcel.hzLvUp
  752. local lenConfig = #config
  753. for i = 1,lenConfig do
  754. if human.db.yellow ~= nil and human.db.yellow.lv ~= 0 then
  755. if human.db.yellow.lvup == nil or human.db.yellow.lvup[i] == nil then
  756. if human.db.lv >= config[i].needLv then
  757. msgRet.lvup = 1
  758. break
  759. end
  760. end
  761. end
  762. end
  763. end
  764. else
  765. if human.db.blue ~= nil and human.db.blue.lv ~= 0 then
  766. if human.db.blue.isGet == nil then
  767. msgRet.xinshou = 1
  768. end
  769. if human.db.blue.daily == nil then
  770. msgRet.daily = 1
  771. end
  772. if human.db.blue.year ~= nil and human.db.blue.year.isGet == nil then
  773. msgRet.daily = 1
  774. end
  775. if human.db.blue.lux ~= nil and human.db.blue.lux.isGet == nil then
  776. msgRet.daily = 1
  777. end
  778. local config = TequanExcel.lzLvUp
  779. local lenConfig = #config
  780. for i = 1,lenConfig do
  781. if human.db.blue ~= nil and human.db.blue.lv ~= 0 then
  782. if human.db.blue.lvup == nil or human.db.blue.lvup[i] == nil then
  783. if human.db.lv >= config[i].needLv then
  784. msgRet.lvup = 1
  785. break
  786. end
  787. end
  788. end
  789. end
  790. end
  791. end
  792. else
  793. msgRet.type = 2
  794. if platformType == 1 then
  795. if human.pf_info.pf ~= "qqgame" then
  796. return
  797. end
  798. if human.db.txHall ~= nil then
  799. if human.db.txHall.isGet == nil then
  800. msgRet.xinshou = 1
  801. end
  802. if human.db.txHall.daily == nil then
  803. msgRet.daily = 1
  804. end
  805. local config = TequanExcel.txLvUp
  806. local lenConfig = #config
  807. for i = 1,lenConfig do
  808. if human.db.txHall ~= nil then
  809. if human.db.txHall.lvup == nil or human.db.txHall.lvup[i] == nil then
  810. if human.db.lv >= config[i].needLv then
  811. msgRet.lvup = 1
  812. break
  813. end
  814. end
  815. end
  816. end
  817. end
  818. else
  819. if human.pf_info.pf ~= "qzone" and human.pf_info.pf ~= "website" then
  820. return
  821. end
  822. if human.db.qqZone ~= nil then
  823. if human.db.qqZone.isGet == nil then
  824. msgRet.xinshou = 1
  825. end
  826. if human.db.qqZone.daily == nil then
  827. msgRet.daily = 1
  828. end
  829. local config = TequanExcel.txLvUp
  830. local lenConfig = #config
  831. for i = 1,lenConfig do
  832. if human.db.qqZone ~= nil then
  833. if human.db.qqZone.lvup == nil or human.db.qqZone.lvup[i] == nil then
  834. if human.db.lv >= config[i].needLv then
  835. msgRet.lvup = 1
  836. break
  837. end
  838. end
  839. end
  840. end
  841. end
  842. end
  843. end
  844. Msg.send(msgRet,human.fd)
  845. end
  846. function setHumanTequan(human,net)
  847. if net.lvYellow ~= nil and net.lvYellow ~= "0" and net.lvYellow ~= 0 then
  848. human.db.yellow = human.db.yellow or {}
  849. human.db.yellow.isAdd = 1
  850. human.db.yellow.lv = tonumber(net.lvYellow)
  851. else
  852. if human.db.yellow ~= nil then
  853. human.db.yellow.lv = 0
  854. human.db.yellow.isAdd = nil
  855. end
  856. end
  857. if net.lvBlue ~= nil and net.lvBlue ~= "0" and net.lvBlue ~= 0 then
  858. human.db.blue = human.db.blue or {}
  859. human.db.blue.isAdd = 1
  860. human.db.blue.lv = tonumber(net.lvBlue)
  861. else
  862. if human.db.blue ~= nil then
  863. human.db.blue.lv = 0
  864. human.db.blue.isAdd = nil
  865. end
  866. end
  867. if net.yearYellow ~= nil and net.yearYellow ~= "0" and net.yearYellow ~= 0 then
  868. human.db.yellow = human.db.yellow or {}
  869. human.db.yellow.year = human.db.yellow.year or {}
  870. else
  871. if human.db.yellow ~= nil then
  872. human.db.yellow.year = nil
  873. end
  874. end
  875. if net.yearBlue ~= nil and net.yearBlue ~= "0" and net.yearBlue ~= 0 then
  876. human.db.blue = human.db.blue or {}
  877. human.db.blue.year = human.db.blue.year or {}
  878. else
  879. if human.db.blue ~= nil then
  880. human.db.blue.year = nil
  881. end
  882. end
  883. if net.superYellow ~= nil and net.superYellow ~= "0" and net.superYellow ~= 0 then
  884. human.db.yellow = human.db.yellow or {}
  885. human.db.yellow.lux = human.db.yellow.lux or {}
  886. else
  887. if human.db.yellow ~= nil then
  888. human.db.yellow.lux = nil
  889. end
  890. end
  891. if net.superBlue ~= nil and net.superBlue ~= "0" and net.superBlue ~= 0 then
  892. human.db.blue = human.db.blue or {}
  893. human.db.blue.lux = human.db.blue.lux or {}
  894. else
  895. if human.db.blue ~= nil then
  896. human.db.blue.lux = nil
  897. end
  898. end
  899. if net.pf == "qzone" or net.pf == "website" then
  900. human.db.qqZone = human.db.qqZone or {}
  901. end
  902. if net.pf == "qqgame" then
  903. human.db.txHall = human.db.txHall or {}
  904. end
  905. end
  906. function jihuopt(human)
  907. if human.pf_info.pf == "qzone" or human.pf_info.pf == "website" then
  908. human.db.qqZone = human.db.qqZone or {}
  909. end
  910. if human.pf_info.pf == "qqgame" then
  911. human.db.txHall = human.db.txHall or {}
  912. end
  913. end