QFunction-0.lua 101 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285
  1. local this = {}
  2. local envDebug = nil
  3. function handlerequest(actor, uid, msgID, msgData)
  4. -- info("handlerequest-msgid", actor, msgID, msgData)
  5. envDebug = envDebug or getenv("debug")
  6. if envDebug then
  7. local last_lua_message = {
  8. ["uid"] = uid,
  9. ["msgID"] = msgID,
  10. ["msgData"] = msgData
  11. }
  12. setplaydef(actor, "J$gm_last_lua", last_lua_message)
  13. end
  14. -- error("角色加成方式")
  15. -- error(msgID)
  16. -- 发送客户端GM指令 SL:SendLuaNetMsg(1,{}) 可运行到这里
  17. if msgID == 1 then
  18. -- rolelist = getrolelist(actor,uid)
  19. -- print(rolelist)
  20. elseif msgID == 2 then
  21. -- setsysvar("G1",100)
  22. -- result = getsysvar("G1")
  23. -- print(result)
  24. -- 装备相关
  25. elseif msgID == LuaMessageIdToSever.SETTING_EQUIP_APPEAR then
  26. EquipAndAppear.settingequipappear(actor, msgData) -- 保存装备外观|幻化
  27. elseif msgID == LuaMessageIdToSever.GET_EQUIP_APPEAR then
  28. EquipAndAppear.getequipappear(actor, msgID) -- 获取装备外观
  29. elseif msgID == LuaMessageIdToSever.EQUIP_FASHION then
  30. EquipAndAppear.equipfashion(actor, msgData) -- 装备幻化
  31. elseif msgID == LuaMessageIdToSever.ACT_EQUIP_COLOR then
  32. EquipAndAppear.actquipcolor(actor, msgData) -- 装备染色
  33. elseif msgID == LuaMessageIdToSever.GET_EQUIP_COLOR then
  34. EquipAndAppear.getequipcolor(actor, msgID) -- 获取装备染色信息
  35. elseif msgID == LuaMessageIdToSever.SETTING_EQUIP_COLOR then
  36. EquipAndAppear.settingequipcolor(actor, msgData) -- 保存装备染色
  37. elseif msgID == LuaMessageIdToSever.REQ_ITEM_DECOMPOSITION then
  38. ItemRecycling.decompositionlua(actor, msgID, msgData) -- 装备分解
  39. elseif msgID == LuaMessageIdToSever.GET_TITLE then
  40. EquipAndAppear.gettitleinfo(actor, msgID) -- 获取称号信息
  41. elseif msgID == LuaMessageIdToSever.SET_TITLE then
  42. EquipAndAppear.settingtitleappear(actor, msgID, msgData) -- 设置当前称号
  43. elseif msgID == LuaMessageIdToSever.GET_SHAPE_RING then
  44. EquipAndAppear.getshapering(actor, msgID) -- 获取变身戒指信息
  45. elseif msgID == LuaMessageIdToSever.GET_GUARD_APPEAR then
  46. EquipAndAppear.getguardappear(actor, msgID) -- 获取守护皮肤信息
  47. elseif msgID == LuaMessageIdToSever.SET_SHAPE_RING then
  48. EquipAndAppear.wearshapering(actor, msgData) -- 穿戴变身戒指
  49. elseif msgID == LuaMessageIdToSever.REQ_STRENGTH_EQUIP then
  50. EquipAndAppear.luastrengthequip(actor, msgData) -- 请求装备强化
  51. elseif msgID == LuaMessageIdToSever.REQ_APPEND_EQUIP then
  52. EquipAndAppear.luaappendequip(actor, msgData) -- 请求装备追加
  53. elseif msgID == LuaMessageIdToSever.REQ_REFINED_EQUIP then
  54. EquipRefined.luarefinedequip(actor, msgData) -- 请求装备洗练
  55. elseif msgID == LuaMessageIdToSever.REQ_LUCK_EQUIP then
  56. EquipLuck.lualuckequip(actor, msgData) -- 请求装备幸运
  57. elseif msgID == LuaMessageIdToSever.REQ_EQUIP_FASHION then
  58. EquipAndAppear.getallequipfashion(actor) -- 请求已激活幻化外观
  59. elseif msgID == LuaMessageIdToSever.REQ_UPDATE_EQUIP_ORNAMENTS then
  60. EquipAndAppear.ssupdate(actor, msgData) -- 请求首饰升级
  61. elseif msgID == LuaMessageIdToSever.REQ_EQUIP_REGENERATION then
  62. EquipAndAppear.regeneration(actor, msgData) -- 请求装备再生
  63. elseif msgID == LuaMessageIdToSever.REQ_EQUIP_REGENERATION_MOVE then
  64. EquipAndAppear.regenerationMove(actor, msgData) -- 请求装备再生转移
  65. elseif msgID == LuaMessageIdToSever.REQ_UP_EQUIP_REGENERATION then
  66. EquipAndAppear.getupregenerationattr(actor, msgData) -- 请求装备上次洗练数据
  67. elseif msgID == LuaMessageIdToSever.REQ_REPLACE_REGENERATION_ATTR then
  68. EquipAndAppear.confirmreplaceentry(actor, msgData) -- 请求替换装备再生属性
  69. elseif msgID == LuaMessageIdToSever.REQ_STRENGTH_REGENERATION_ATTR then
  70. EquipAndAppear.strengthregenerationattr(actor, msgData) -- 请求强化装备再生属性
  71. elseif msgID == LuaMessageIdToSever.REQ_ACT_EQUIP_ORNAMENTS then
  72. EquipAndAppear.actssattr(actor, msgData) -- 请求首饰属性激活
  73. elseif msgID == LuaMessageIdToSever.REQ_TRANSFER_EQUIP then
  74. -- 装备相关结束
  75. EquipAndAppear.luatransferequip(actor, msgData) -- 请求装备属性转移
  76. elseif msgID == LuaNetMsg.Equip_QiangHua_MsgID then
  77. Equip_QiangHua.questQiangHua(actor, msgData) -- 装备强化新
  78. elseif msgID == LuaNetMsg.Equip_XiuLi_MsgID then
  79. EquipDurability.onReqEquipXiuLi(actor, msgData) -- 装备修理
  80. elseif msgID == LuaMessageIdToSever.GET_TEAM_RECRUIT then
  81. Team.getteamrecruitlua(actor, msgID) -- 获取组队喊话信息
  82. elseif msgID == LuaMessageIdToSever.LEADER_AGREE_APPLY then
  83. Team.leaderAgreeApply(actor, msgData) -- 队长一键同意申请记录
  84. elseif msgID == LuaMessageIdToSever.GET_RESET_FRUIT_COUNT then
  85. FruitScript.toGetResetCount(actor) -- 获取重置果实次数
  86. elseif msgID == LuaMessageIdToSever.S_RESET_FRUIT then
  87. FruitScript.resetFruit(actor, msgData) -- 重置果实
  88. elseif msgID == LuaMessageIdToSever.GET_MOUNSTER_COUNT_BY_MAP then
  89. DuplicateCommon.getmonstercountbymap(actor, msgData) -- 根据地图信息获取怪物数量
  90. elseif msgID == LuaMessageIdToSever.SET_FRIEND_DEGREE then
  91. Friend.sendflower(actor, msgID, msgData) -- 好友送花
  92. elseif msgID == LuaMessageIdToSever.GET_DEVIL_SQUARE_PANEL then
  93. DevilSquare.ReqGetPanelInfo(actor, msgData)
  94. elseif msgID == LuaMessageIdToSever.REQ_RECIVE_DEVIL_SQUARE_REWARD then
  95. DevilSquare.ReqReciveRewardDevilSquare(actor, msgData)
  96. elseif msgID == LuaMessageIdToSever.REQ_ENTER_DUPLICATE then
  97. DuplicateCommon.ReqEnterDupLicate(actor, msgData)
  98. elseif msgID == LuaMessageIdToSever.REQ_QUIT_DUPLICATE then
  99. DuplicateCommon.ReqQuitDuplicate(actor, msgData)
  100. elseif msgID == LuaMessageIdToSever.REQ_CHANGE_DUPLICATE_STATE then
  101. DuplicateCommon.ReqChangeDupState(actor, msgData)
  102. elseif msgID == LuaMessageIdToSever.GET_DAILY_ACTIVITY_INFO then
  103. DailyActivity.getActivityInfo(actor)
  104. elseif msgID == LuaMessageIdToSever.GET_DAILY_ACTIVITY_REWARD then
  105. DailyActivity.receiveBoxReward(actor, msgData)
  106. elseif msgID == LuaMessageIdToSever.GET_DAILY_ACTIVITY_ACTIVITY_LIST then
  107. DailyActivity.getActivityList(actor)
  108. elseif msgID == LuaMessageIdToSever.OPEN_OR_CLOSE_AUTO_BUY_POTION then
  109. AutoBuyPotionScript.openOrCloseAutoBuyPotion(actor) -- 开启或关闭自动购买药水
  110. elseif msgID == LuaMessageIdToSever.GET_CURRENT_AUTO_BUY_POTION then
  111. AutoBuyPotionScript.getCurrentOpenState(actor) -- 当前自动购买药水状态
  112. elseif msgID == LuaMessageIdToSever.LOAD_RANK_DATA then
  113. RankScript.loadRankData(actor, msgData) -- 请求排行榜数据
  114. elseif msgID == LuaMessageIdToSever.STOP_REFRESH_RANK_DATA then
  115. RankScript.stopRefreshData(actor) -- 停止自动刷新排行榜数据
  116. elseif msgID == LuaMessageIdToSever.PLAYER_IS_ON_LINE_REQ then
  117. Chat.playerIsOnLineReq(actor, msgData) -- 玩家是否在线
  118. elseif msgID == LuaMessageIdToSever.RECRUIT_INFO_REQ then
  119. Chat.reqRecruitInfo(actor, msgData) -- 发送招募信息
  120. elseif msgID == LuaMessageIdToSever.GET_GOLD_TASK_INFO then
  121. GoldTask.SendTaskInfo(actor)
  122. elseif msgID == LuaMessageIdToSever.FLUSH_GOLD_TASK_POOL then
  123. GoldTask.FlushGoldTaskPool(actor)
  124. elseif msgID == LuaMessageIdToSever.ACCEPT_GOLD_TASK then
  125. GoldTask.AcceptTask(actor, msgData)
  126. elseif msgID == LuaMessageIdToSever.SUBMIT_GOLD_TASK then
  127. GoldTask.SubmitTask(actor, msgData)
  128. elseif msgID == LuaMessageIdToSever.GIVE_UP_GOLD_TASK then
  129. GoldTask.GiveUpTask(actor, msgData)
  130. elseif msgID == LuaMessageIdToSever.GET_PRIVILEGES then
  131. PrivilegeCardScript.getHasPrivileges(actor)
  132. elseif msgID == LuaMessageIdToSever.BRAVE_TEST_PANEL_INFO then
  133. BraveTest.ReqBraveTestPanelInfo(actor)
  134. elseif msgID == LuaMessageIdToSever.REQ_BLOODY_CASTLE_PANEL then
  135. BloodyCastle.ReqGetPanelInfo(actor, msgData) -- 请求血色城堡面板
  136. elseif msgID == LuaMessageIdToSever.BRAVE_TEST_REWARD then
  137. BraveTest.ReqBraveTestReward(actor)
  138. elseif msgID == LuaMessageIdToSever.REQ_GET_ACTIVITY_COUNT then
  139. DuplicateCommon.ReqGetActivityLeftCount(actor, msgData) -- 请求活动剩余次数
  140. elseif msgID == LuaMessageIdToSever.REQ_EQUIP_OVERLAY then
  141. EquipOverlay.reqEquipOverlay(actor, msgData)
  142. elseif msgID == LuaMessageIdToSever.REQ_ENTER_SECRET_REALM then
  143. SecretRealm.reqEnterSecretRealm(actor, msgData) -- 请求进入秘境副本
  144. elseif msgID == LuaMessageIdToSever.REQ_EXIT_SECRET_REALM then
  145. SecretRealm.reqExitSecretRealm(actor) -- 请求退出秘境副本
  146. elseif msgID == LuaMessageIdToSever.REQ_GET_SECRET_REALM_COUNT then
  147. SecretRealm.sendRemainingChallenges(actor) -- 发送秘境副本挑战次数
  148. elseif msgID == LuaMessageIdToSever.GET_SECRET_REALM_MONSTER_COUNT then
  149. SecretRealm.getMonsterCount(actor, msgData) -- 获取秘境副本怪物数量
  150. elseif msgID == LuaMessageIdToSever.GET_ALREADY_USE_POINTS then
  151. FruitScript.toGetAlreadyUsePoints(actor) -- 获取已经使用的点数
  152. elseif msgID == LuaMessageIdToSever.REQ_BLOODY_CASTLE_GIVE_NPC then
  153. BloodyCastle.ReqGive2NPC(actor) -- 给武器给NPC
  154. elseif msgID == LuaMessageIdToSever.REQ_GET_UNION_INFO then
  155. UnionChangeLeader.sendUnionInfo(actor)
  156. elseif msgID == LuaMessageIdToSever.REQ_GET_OTHER_UNION_INFO then
  157. UnionChangeLeader.sendOtherUnionInfo(actor, msgData)
  158. elseif msgID == LuaMessageIdToSever.REQ_UNION_ACTIVITY_DATA then
  159. Union.UnionActivity.getUnionActivity(actor)
  160. elseif msgID == LuaMessageIdToSever.REQ_RECIVE_BLOODY_CASTLE_SETTLEMENT then
  161. BloodyCastle.ReqReciveReward(actor, msgData)
  162. elseif msgID == LuaMessageIdToSever.MONSTER_ATTACK_BOSS_INFO then
  163. MonAtk.monsterInfo(actor, msgData)
  164. elseif msgID == LuaMessageIdToSever.REQ_CHANGE_DUPLICATE_TEAM_STATE then
  165. DuplicateCommon.ChangeTeamPrepareState(actor, msgData) -- 修改副本队伍状态
  166. elseif msgID == LuaMessageIdToSever.REQ_UNION_RUN_FOR_LEADER_DATA then
  167. UnionChangeLeader.RunForLeader.getRunForLeaderData(actor)
  168. elseif msgID == LuaMessageIdToSever.REQ_PLAYER_RUN_FOR_LEADER then
  169. UnionChangeLeader.RunForLeader.actorRunForLeader(actor)
  170. elseif msgID == LuaMessageIdToSever.REQ_PLAYER_RUN_FOR_LEADER_VOTE then
  171. UnionChangeLeader.RunForLeader.actorVoteRunForLeader(actor, msgData)
  172. elseif msgID == LuaMessageIdToSever.REQ_DUPLICATE_TEAM_ENTER then
  173. DuplicateCommon.DoTeamEnterDup(actor) -- 组队进入副本
  174. elseif msgID == LuaMessageIdToSever.REQ_SET_ROLE_ATT_ADD_WAY then
  175. RoleAttr.setRoleAttAddWay(actor, msgData) -- 设置角色属性加成方式
  176. elseif msgID == LuaMessageIdToSever.REQ_GET_ROLE_ATT_ADD_WAY then
  177. RoleAttr.getRoleAttAddWay(actor) -- 获取角色属性加成方式
  178. elseif msgID == LuaMessageIdToSever.BRAVE_TEST_STAGE_REWARD then
  179. BraveTest.ReqBraveTestStageReward(actor)
  180. elseif msgID == LuaMessageIdToSever.GET_SECRET_REALM_MONSTER_LIST then
  181. SecretRealm.ReqBossList(actor, msgData) -- 请求秘境副本中boss列表信息
  182. elseif msgID == LuaMessageIdToSever.REQ_ITEM_SYNTHESIS then
  183. ItemSynthesis.synthesis(actor, msgData) -- 装备合成
  184. elseif msgID == LuaMessageIdToSever.REQ_SECRET_REALM_HURT_TOP1 then
  185. SecretRealm.getTop1HurtInfo(actor, msgData) -- 装备合成
  186. elseif msgID == LuaMessageIdToSever.REQ_GET_UNION_ARMBAND_INFO then
  187. UnionArmbands.sendArmbandInfo(actor) -- 获取ArmBand信息
  188. elseif msgID == LuaMessageIdToSever.REQ_UNION_ARMBAND_LEVEL_UP then
  189. UnionArmbands.levelupUnionArmband(actor) -- 升级ArmBand
  190. elseif msgID == LuaMessageIdToSever.REQ_UNION_ARMBAND_STRONG then
  191. UnionArmbands.strongArmband(actor) -- 强化ArmBand
  192. elseif msgID == LuaMessageIdToSever.REQ_TRADE_LISTING_GOODS then
  193. Trade.worldTradeListing(actor, msgData) -- 摆摊上架商品
  194. elseif msgID == LuaMessageIdToSever.REQ_TRADE_HALL_PLACE_IN then
  195. Trade.tradeHallPlaceIn(actor, msgData) -- 交易行上架商品
  196. elseif msgID == LuaMessageIdToSever.REQ_TRADE_OFF_GOODS then
  197. Trade.worldOffShelfGoods(actor, msgData) -- 交易行下架商品
  198. elseif msgID == LuaMessageIdToSever.REQ_GET_TRADE_GOODS then
  199. Trade.getTradeWorldGoods(actor, msgData) -- 交易行搜索商品信息
  200. elseif msgID == LuaMessageIdToSever.REQ_TRADE_PUBLICITY_GOODS then
  201. Trade.getPublicityGoods(actor, msgData) -- 交易行获取公示区域商品
  202. elseif msgID == LuaMessageIdToSever.REQ_TRADE_MY_PRE_GOODS then
  203. Trade.getPreBuyGoods(actor, msgData) -- 交易行获取预购
  204. elseif msgID == LuaMessageIdToSever.REQ_TRADE_BUY_GOODS then
  205. Trade.bugWorldGoods(actor, msgData) -- 交易行购买商品
  206. elseif msgID == LuaMessageIdToSever.REQ_TRADE_RECORD then
  207. Trade.getWorldTradeRecord(actor) -- 交易行交易记录
  208. elseif msgID == LuaMessageIdToSever.REQ_TRADE_MY_SHELVES then
  209. Trade.getWorldMyListing(actor) -- 交易行上架商品信息
  210. elseif msgID == LuaMessageIdToSever.REQ_TRADE_PRE_ORDER then
  211. Trade.preWorldGoods(actor, msgData) -- 交易行预购商品
  212. elseif msgID == LuaMessageIdToSever.REQ_GET_UNION_IMPEACH_INFO then
  213. UnionChangeLeader.Impeach.sendImpeachInfo(actor) -- 获取弹劾信息
  214. elseif msgID == LuaMessageIdToSever.REQ_UNION_IMPEACH_LEADER then
  215. UnionChangeLeader.Impeach.actorImpeach(actor) -- 弹劾盟主
  216. elseif msgID == LuaMessageIdToSever.REQ_UNION_IMPEACH_VOTE then
  217. UnionChangeLeader.Impeach.actorVoteImpeach(actor, msgData) -- 弹劾投票
  218. elseif msgID == LuaMessageIdToSever.TRIPLE_INCOME_PANEL then
  219. TripleIncome.PanelInfo(actor) -- 三倍收益时间信息
  220. elseif msgID == LuaMessageIdToSever.TRIPLE_INCOME_RECEIVE then
  221. TripleIncome.ReceiveTime(actor, msgData)
  222. elseif msgID == LuaMessageIdToSever.TRIPLE_INCOME_RETURN then
  223. TripleIncome.ReturnTime(actor)
  224. elseif msgID == LuaMessageIdToSever.REQ_BOSS_BOUNTY_DATA then
  225. BossBounty.GetBountyInfo(actor)
  226. elseif msgID == LuaMessageIdToSever.REQ_BOUNTY_MONSTER_REWARD then
  227. BossBounty.ReqReceiveMonsterAward(actor, msgData)
  228. elseif msgID == LuaMessageIdToSever.REQ_BOUNTY_GROUP_REWARD then
  229. BossBounty.ReqReceiveGroupAward(actor, msgData)
  230. elseif msgID == LuaMessageIdToSever.REQ_ALL_MOUNT_INFO then
  231. Mount.allMountInfo(actor)
  232. elseif msgID == LuaMessageIdToSever.REQ_RIDING_MOUNT then
  233. Mount.ridingMount(actor, msgData)
  234. elseif msgID == LuaMessageIdToSever.REQ_CANCEL_RIDING_MOUNT then
  235. Mount.cancelRidingMount(actor, msgData)
  236. elseif msgID == LuaMessageIdToSever.REQ_MOUNT_STORE_TO_BAG then
  237. Mount.mountStoreToBag(actor, msgData)
  238. elseif msgID == LuaMessageIdToSever.REQ_MOUNT_BAG_TO_STORE then
  239. Mount.mountBagToStore(actor, msgData)
  240. elseif msgID == LuaMessageIdToSever.REQ_TRADE_GOODS_INFO then
  241. Trade.getGoodsInfo(actor, msgData)
  242. elseif msgID == LuaMessageIdToSever.REQ_WAR_ALLIANCE_PANEL_INFO then
  243. WarAlliance.GetWarAlliancePanelInfo(actor, msgData)
  244. elseif msgID == LuaMessageIdToSever.REQ_WAR_ALLIANCE_GOODS_DETAIL then
  245. Auction.GetGoodsDetailInfo(actor, msgData)
  246. elseif msgID == LuaMessageIdToSever.REQ_WAR_ALLIANCE_BID_GOODS then
  247. Auction.PlayerBidOnItem(actor, msgData)
  248. elseif msgID == LuaMessageIdToSever.REQ_WAR_ALLIANCE_BUY_NOW then
  249. Auction.PlayerBuyNow(actor, msgData)
  250. elseif msgID == LuaMessageIdToSever.REQ_WAR_ALLIANCE_UPDATE_GOODS then
  251. Auction.GetSomeGoods(actor, msgData)
  252. elseif msgID == LuaMessageIdToSever.REQ_KING_ROAD_TASK_INFO then
  253. KingRoad.SendKingRoadTask(actor)
  254. elseif msgID == LuaMessageIdToSever.REQ_SUBMIT_KING_ROAD_TASK then
  255. KingRoad.SubmitChapterTask(actor, msgData)
  256. elseif msgID == LuaMessageIdToSever.REQ_RECEIVE_KING_ROAD_CHAPTER_AWARD then
  257. KingRoad.ReceiveChapterAward(actor, msgData)
  258. elseif msgID == LuaMessageIdToSever.REQ_PRIVILEGE_BOSS_PANEL then
  259. -- 请求特权BOSS信息
  260. PrivilegeBoss.ReqPrivilegeBossPanel(actor, msgData)
  261. elseif msgID == LuaMessageIdToSever.REQ_MOUNT_PUT_ON_ITEM then
  262. Mount.putOnItem(actor, msgData) -- 坐骑穿戴装备
  263. elseif msgID == LuaMessageIdToSever.REQ_MOUNT_TAKE_OFF_ITEM then
  264. Mount.takeOffItem(actor, msgData) -- 坐骑脱下装备
  265. elseif msgID == LuaMessageIdToSever.REQ_MOUNT_DETAIL_INFO then
  266. Mount.mountDetail(actor, msgData) -- 获取坐骑详细信息
  267. elseif msgID == LuaMessageIdToSever.REQ_OFFLINE_ON_HOOK_INFO then
  268. -- onHook.getOffLineOnHookInfo(actor) -- 请求获取离线挂机信息
  269. elseif msgID == LuaMessageIdToSever.REQ_RECEIVE_OFFLINE_ON_HOOK_EXP then
  270. -- onHook.reqReceiveOfflineOnHookExp(actor) -- 请求领取离线挂机经验
  271. elseif msgID == LuaMessageIdToSever.REQ_MASTER_INFO then
  272. Master.reqMasterInfo(actor, msgData) -- 请求:大师信息
  273. elseif msgID == LuaMessageIdToSever.REQ_OPEN_MASTER_TYPE then
  274. Master.reqOpenMasterType(actor, msgData) -- -- 请求:启用大师系列
  275. elseif msgID == LuaMessageIdToSever.REQ_EXCHANGE_MASTER_EXP then
  276. Master.reqExchangeMasterExp(actor, msgData) -- 请求:兑换大师经验
  277. elseif msgID == LuaMessageIdToSever.REQ_RESET_MASTER then
  278. Master.reqResetMaster(actor, msgData) -- 请求:重置大师天赋
  279. elseif msgID == LuaMessageIdToSever.REQ_UPGRADE_MASTER_TALENT then
  280. Master.reqUpgradeMasterTalent(actor, msgData) -- 请求:升级大师天赋
  281. elseif msgID == LuaMessageIdToSever.REQ_ENTER_WAR_ALLIANCE then
  282. WarAlliance.ReqEnterWarAlliance(actor, msgData) -- 请求进入战盟boss副本
  283. elseif msgID == LuaMessageIdToSever.REQ_GET_MONTHCARD_INFO then
  284. MonthCard.getmonthcardinfo(actor) -- 请求获取月卡信息
  285. elseif msgID == LuaMessageIdToSever.REQ_RECEIVE_MONTHCARD_THREETIME then
  286. MonthCard.receivemonthcardthreetime(actor) -- 请求领取月卡三倍收益时间
  287. elseif msgID == LuaMessageIdToSever.REQ_UP_SHELF_MONTHCARD then
  288. MonthCard.upshelfmonthcard(actor, msgData) -- 请求上架月卡
  289. elseif msgID == LuaMessageIdToSever.REQ_GET_MONTH_PRIVILEGE_DATA then
  290. PrivilegeMonth.sendPrivilegeData(actor)
  291. elseif msgID == LuaMessageIdToSever.REQ_CHECK_MONTH_PRIVILEGE_IS_OPEN then
  292. PrivilegeMonth.sendHasPrivilege(actor, msgData)
  293. elseif msgID == LuaMessageIdToSever.REQ_EXCHANGE_MONTH_PRIVILEGE then
  294. PrivilegeMonth.monthCardExchangePrivilege(actor, msgData)
  295. elseif msgID == LuaMessageIdToSever.REQ_EXIT_WAR_ALLIANCE then
  296. WarAlliance.reqExitWarAlliance(actor)
  297. elseif msgID == LuaMessageIdToSever.REQ_MAP_INFO then
  298. GoldLine.GetGoldMapInfo(actor, msgData)
  299. elseif msgID == LuaMessageIdToSever.REQ_SET_MOUNT_IS_SHOW then
  300. Mount.mountShow(actor, msgData)
  301. elseif msgID == LuaMessageIdToSever.REQ_GET_ROLE_ATTR_POINT_PROGRAMME then
  302. RoleAttr.getPrivilegeAttrPointProgramme(actor)
  303. elseif msgID == LuaMessageIdToSever.REQ_SET_ROLE_ATTR_POINT_PROGRAMME then
  304. RoleAttr.setPrivilegeAttrPointProgramme(actor, msgData)
  305. elseif msgID == LuaMessageIdToSever.REQ_CHANGE_ROLE_ATTR_POINT_PROGRAMME then
  306. RoleAttr.changePrivilegeAttrPointProgramme(actor, msgData)
  307. elseif msgID == LuaMessageIdToSever.REQ_OPEN_SERVER_FIRST_KILL_INFO then
  308. OpenServerAct.SendFirstKillInfo(actor)
  309. elseif msgID == LuaMessageIdToSever.RECEIVE_GLOBAL_FIRST_KILL_AWARD then
  310. OpenServerAct.ReceiveGlobalFirstKill(actor, msgData)
  311. elseif msgID == LuaMessageIdToSever.RECEIVE_PERSONAL_FIRST_KILL_AWARD then
  312. OpenServerAct.ReceivePersonalFirstKill(actor, msgData)
  313. elseif msgID == LuaMessageIdToSever.PRIVILEGE_BOSS_COUNT_INIT then
  314. PrivilegeBoss.initCount(actor, msgData)
  315. elseif msgID == LuaMessageIdToSever.REQ_SET_MOUNT_RANK then
  316. Mount.setMountRank(actor, msgData)
  317. elseif msgID == LuaMessageIdToSever.REQ_OTHER_MOUNT_RANK then
  318. Mount.sendOtherMountRank(actor, msgData)
  319. elseif msgID == LuaMessageIdToSever.REQ_OPEN_SERVER_ACT_TYPE_RANK_INFO then
  320. OpenServerAct.SendSubRankInfo(actor, msgData)
  321. elseif msgID == LuaMessageIdToSever.REQ_OPEN_SERVER_ACT_PERSONAL_REWARD then
  322. OpenServerAct.ReceiveNewAreaPersonalReward(actor, msgData)
  323. elseif msgID == LuaMessageIdToSever.REQ_OPEN_SERVER_ACT_RANK_REWARD then
  324. OpenServerAct.ReceiveGlobalRankReward(actor, msgData)
  325. elseif msgID == LuaMessageIdToSever.REQ_WAR_ALLIANCE_HAS_QUALIFY then
  326. Auction.ShowAutionPanel(actor)
  327. elseif msgID == LuaMessageIdToSever.REQ_UNION_TASK_DATA then
  328. UnionMemberTask.sendUnionTaskData(actor)
  329. elseif msgID == LuaMessageIdToSever.REQ_SUBMIT_UNION_TASK then
  330. UnionMemberTask.submitUnionTask(actor, msgData)
  331. elseif msgID == LuaMessageIdToSever.REQ_MONSTER_COUNT_BY_ID then
  332. DuplicateCommon.getmonstercountbyid(actor, msgData)
  333. elseif msgID == LuaMessageIdToSever.REQ_CHALLENGE_BOSS_INFO_BY_ID then
  334. DuplicateCommon.getchallengebossinfobyid(actor, msgData)
  335. elseif msgID == LuaMessageIdToSever.REQ_GOTO_CROSS_MAP then
  336. CrossMap.Enter(actor)
  337. elseif msgID == LuaMessageIdToSever.REQ_SCHEME_INFO then
  338. EquipGem.schemeInfo(actor, msgData)
  339. elseif msgID == LuaMessageIdToSever.REQ_GEM_PUT_ON then
  340. EquipGem.putOnGemOrSlabstone(actor, msgData)
  341. elseif msgID == LuaMessageIdToSever.REQ_GEM_TAKE_OFF then
  342. EquipGem.takeOffGemOrSlabstone(actor, msgData)
  343. elseif msgID == LuaMessageIdToSever.REQ_SCHEME_SWITCH then
  344. EquipGem.schemeSwitch(actor, msgData)
  345. elseif msgID == LuaMessageIdToSever.REQ_OPEN_SERVER_ACT_RANK_ALL_REWARD then
  346. OpenServerAct.ReceivePlayerRankReward(actor, msgData)
  347. elseif msgID == LuaMessageIdToSever.REQ_ACTIVITY_OPENSERVER_INFO then
  348. OpenServerNewAct.SendActivityInfo(actor, msgData)
  349. elseif msgID == LuaMessageIdToSever.REQ_ACTIVITY_OPENSERVER_RECORD then
  350. OpenServerNewAct.SendActivitySubRecord(actor, msgData)
  351. elseif msgID == LuaMessageIdToSever.REQ_ACTIVITY_OPENSERVER_REWARD then
  352. OpenServerNewAct.ReceiveReward(actor, msgData)
  353. elseif msgID == LuaMessageIdToSever.REQ_ACTIVITY_BENEFIT_INFO then
  354. BenefitActivity.SendActivityInfo(actor, msgData)
  355. elseif msgID == LuaMessageIdToSever.REQ_ACTIVITY_BENEFIT_REWARD then
  356. BenefitActivity.ReceiveReward(actor, msgData)
  357. elseif msgID == LuaMessageIdToSever.REQ_KUNDUN_ENTER then
  358. KunDun.EnterKunDun(actor, msgData)
  359. elseif msgID == LuaMessageIdToSever.REQ_GODS_DESCENDED_DATA then
  360. GodsDescended.sendMonsterStateData(actor)
  361. elseif msgID == LuaMessageIdToSever.REQ_WOLF_SOUL_SUMMON then
  362. WolfSoul.ReqSummonWarder(actor, msgData)
  363. elseif msgID == LuaMessageIdToSever.REQ_STALL_POSITION then
  364. Stall.stallPosition(actor, msgData) -- 获取摆摊信息
  365. elseif msgID == LuaMessageIdToSever.REQ_START_STALL then
  366. Stall.startStall(actor, msgData) -- 开始摆摊
  367. elseif msgID == LuaMessageIdToSever.REQ_END_STALL then
  368. Stall.endStall(actor, msgData) -- 结束摆摊
  369. elseif msgID == LuaMessageIdToSever.REQ_STALL_GOODS then
  370. Stall.getStallGoods(actor, msgData) -- 获取摊位商品信息
  371. elseif msgID == LuaMessageIdToSever.REQ_DELETE_BAG_ITEM then
  372. Stall.deleteItem(actor, msgData) -- 减少背包内道具的数量
  373. elseif msgID == LuaMessageIdToSever.REQ_SET_PATROL then
  374. onHook.setOfflineState(actor, msgData) -- 设置离线挂机状态
  375. elseif msgID == LuaMessageIdToSever.REQ_ITEM_RECOVERY then
  376. ItemRecycling.recovery(actor, msgData) -- 装备回收
  377. elseif msgID == LuaMessageIdToSever.REQ_ITEM_EXCHANGE then
  378. ItemExchange.exchange(actor, msgData) -- 装备兑换
  379. elseif msgID == LuaMessageIdToSever.REQ_CANCEL_FSPREVIEW then
  380. FaceShootPreview.ReqCancelTodayPreview(actor, msgData) -- 拍照预告取消今日提醒
  381. elseif msgID == LuaMessageIdToSever.REQ_RECHARGE then
  382. Recharge.request(actor, msgData) -- 充值请求
  383. elseif msgID == LuaMessageIdToSever.REQ_CHANGE_ROLE_NAME then
  384. Player.changeRoleName(actor, msgData) -- 修改角色名字
  385. elseif msgID == LuaMessageIdToSever.REQ_CHANGE_UNION_NAME then
  386. Union.changeUnionName(actor, msgData) -- 修改战盟名字
  387. elseif msgID == LuaMessageIdToSever.REQ_ROLE_IS_FIRST_CHANGE_NAME then
  388. Player.getRoleChangeNameInfo(actor) -- 获取角色是否为首次改名
  389. elseif msgID == LuaMessageIdToSever.REQ_RECHARGE_TRADE_INFO then
  390. Trade.sendRecharge(actor) -- 发送月卡充值信息
  391. elseif msgID == LuaMessageIdToSever.REQ_COMBO_SKILL_UP then
  392. Skill.ComboSkillUp(actor) -- 升级连击技能
  393. elseif msgID == LuaMessageIdToSever.REQ_TRANSFER_CARD_PART_INFO then
  394. TransferCard.ReqGetHoleInfo(actor, msgData) -- 变身卡牌请求部位信息
  395. elseif msgID == LuaMessageIdToSever.REQ_TRANSFER_CARD_UNLOCK then
  396. local part = msgData[1]
  397. local idx = msgData[2]
  398. local type = msgData[3]
  399. TransferCard.ReqUnlockHole(actor, part, idx, type)
  400. elseif msgID == LuaMessageIdToSever.REQ_OTHER_GEM_EQUIP_INFO then
  401. EquipGem.getOtherGemScheme(actor, msgData)
  402. elseif msgID == LuaMessageIdToSever.REQ_RECHARGE_ACTION then
  403. Recharge.requestAction(actor, msgData)
  404. elseif msgID == LuaMessageIdToSever.REQ_ALL_SERVER_FIRST_KILL_INFO then
  405. GoldFirstKill.getFirstKillInfo(actor)
  406. elseif msgID == LuaMessageIdToSever.REQ_RECEIVE_FIRST_KILL_ENVELOPE then
  407. GoldFirstKill.receiveFirstKillAward(actor, msgData)
  408. elseif msgID == LuaMessageIdToSever.REQ_RECEIVE_PERSONAL_FIRST_KILL_AWARD then
  409. GoldFirstKill.SubmitTask(actor, msgData)
  410. elseif msgID == LuaMessageIdToSever.REQ_ANGLE_BENEFIT_INFO then
  411. AngelBenefit.getAllAngleBenefitInfo(actor)
  412. elseif msgID == LuaMessageIdToSever.REQ_RECEIVE_ANGLE_BENEFIT_REWARD then
  413. AngelBenefit.receiveScoreReward(actor, msgData)
  414. elseif msgID == LuaMessageIdToSever.REQ_SUBMIT_ANGLE_BENEFIT_TASK then
  415. AngelBenefit.submitTask(actor, msgData)
  416. elseif msgID == LuaMessageIdToSever.REQ_RECEIVE_LOGIN_REWARD then
  417. SevenLogin.receiveLoginReward(actor, msgData)
  418. elseif msgID == LuaMessageIdToSever.REQ_RECEIVE_RECHARGE_LOGIN_REWARD then
  419. RechargeSevenReceive.receiveLoginReward(actor, msgData)
  420. elseif msgID == LuaMessageIdToSever.REQ_RECEIVE_ANGEL_WEAPON_REWARD then
  421. AngelWeapon.receiveTaskReward(actor, msgData)
  422. elseif msgID == LuaMessageIdToSever.REQ_PERSONAL_LEVEL_REWARD_INFO then
  423. LevelReward.getLevelRewardInfo(actor)
  424. elseif msgID == LuaMessageIdToSever.REQ_RECEIVE_LEVEL_REWARD then
  425. LevelReward.receiveLevelReward(actor, msgData)
  426. elseif msgID == LuaMessageIdToSever.REQ_TRANSFER_CARD_BAG then
  427. TransferCard.ReqGetAllBagCard(actor)
  428. elseif msgID == LuaMessageIdToSever.REQ_TRANSFER_CARD_EXCHANGE then
  429. local cfgId = tonumber(msgData[1])
  430. local count = tonumber(msgData[2])
  431. TransferCard.ReqExchangeCards(actor, cfgId, count)
  432. elseif msgID == LuaMessageIdToSever.REQ_GENERATE_VERIFICATION_CODE then
  433. DailyLotteryDraw.generateVerificationCode(actor, msgData)
  434. elseif msgID == LuaMessageIdToSever.REQ_BIND_PHONE then
  435. DailyLotteryDraw.bindPhone(actor, msgData)
  436. elseif msgID == LuaMessageIdToSever.REQ_LUCK_DRAW then
  437. DailyLotteryDraw.luckDraw(actor)
  438. elseif msgID == LuaMessageIdToSever.REQ_LUCK_DRAW_INFO then
  439. DailyLotteryDraw.sendInfo(actor)
  440. elseif msgID == LuaMessageIdToSever.REQ_TRANSFER_CARD_SYNTHESIS then
  441. TransferCard.ReqSynthesisCard(actor, msgData)
  442. elseif msgID == LuaMessageIdToSever.REQ_TRANSFER_CARD_RECOVER then
  443. TransferCard.ReqRecoveryCard(actor, msgData)
  444. elseif msgID == LuaMessageIdToSever.REQ_TRANSFER_CARD_INLAY then
  445. local part = msgData[1]
  446. local idx = msgData[2]
  447. local id = msgData[3]
  448. TransferCard.ReqInlayCard(actor, part, idx, id)
  449. elseif msgID == LuaMessageIdToSever.REQ_TRANSFER_CARD_PUTOFF then
  450. local part = msgData[1]
  451. local idx = msgData[2]
  452. TransferCard.ReqPutOffCard(actor, part, idx)
  453. elseif msgID == LuaMessageIdToSever.REQ_BUY_TIME_LIMIT_GIFT then
  454. TimeLimitGift.reqBuyTimeLimitGift(actor, msgData)
  455. elseif msgID == LuaMessageIdToSever.REQ_SAVE_EFFECIENCY_RED_DOT then
  456. Efficiency.SaveReDot(actor, msgData)
  457. elseif msgID == LuaMessageIdToSever.REQ_GET_EFFECIENCY_REWARD then
  458. Efficiency.GetReward(actor, msgData)
  459. elseif msgID == LuaMessageIdToSever.REQ_CHECK_EFFECIENCY_ACTIVE then
  460. Efficiency.CheckActive(actor, msgData)
  461. elseif msgID == LuaMessageIdToSever.REQ_SINGLE_CHALLENGE_INFO then
  462. OpenServerCompetition.reqSingleChallengeInfo(actor, msgData)
  463. elseif msgID == LuaMessageIdToSever.REQ_SINGLE_CHALLENGE_AWARD then
  464. OpenServerCompetition.reqSingleChallengeAward(actor, msgData)
  465. elseif msgID == LuaMessageIdToSever.REQ_BUY_DISCOUNTS_GIFT then
  466. OpenServerCompetition.reqBuyDiscountsGift(actor, msgData)
  467. elseif msgID == LuaMessageIdToSever.REQ_TRANSFORMATION then
  468. local group = tonumber(msgData)
  469. if group == nil or group == 0 then
  470. TransferCard.ReqCancelTransfermation(actor)
  471. else
  472. TransferCard.ReqTransformation(actor, group)
  473. end
  474. elseif msgID == LuaMessageIdToSever.REQ_COMPETITION_RANK_INFO then
  475. OpenServerCompetition.sendCompetitionRankInfo(actor, msgData)
  476. elseif msgID == LuaMessageIdToSever.REQ_WINGS_TASK_INFO then
  477. Wings.SendWingsTask(actor)
  478. elseif msgID == LuaMessageIdToSever.REQ_SUBMIT_WINGS_TASK then
  479. Wings.SubmitChapterTask(actor, msgData)
  480. elseif msgID == LuaMessageIdToSever.REQ_RECEIVE_WINGS_CHAPTER_AWARD then
  481. Wings.ReceiveChapterAward(actor)
  482. elseif msgID == LuaMessageIdToSever.REQ_BREAK_ANGEL_EQUIP then
  483. AngelMajorEquipment.breakEquipment(actor, msgData)
  484. elseif msgID == LuaMessageIdToSever.REQ_ANGEL_TALENT then
  485. AngelMajorTalent.getTalentInfo(actor)
  486. elseif msgID == LuaMessageIdToSever.REQ_ADD_ANGEL_TALENT_POINT then
  487. AngelMajorTalent.addTalentPoint(actor, msgData)
  488. elseif msgID == LuaMessageIdToSever.REQ_RESET_ANGEL_TALENT_POINT then
  489. AngelMajorTalent.resetTalentPoint(actor)
  490. elseif msgID == LuaMessageIdToSever.REQ_ACTIVE_ANGEL_TALENT then
  491. AngelMajorTalent.activateTalent(actor, msgData)
  492. elseif msgID == LuaMessageIdToSever.REQ_NPC_CHEST_GOODS_INFO then
  493. NpcChest.sendShopGoodsInfoList(actor, msgData)
  494. elseif msgID == LuaMessageIdToSever.REQ_BUY_NPC_CHEST then
  495. NpcChest.buyGoods(actor, msgData)
  496. elseif msgID == LuaMessageIdToSever.REQ_ANGEL_EQUIP_ATTR then
  497. AngelMajorEquipment.getEquipAttrById(actor, msgData)
  498. elseif msgID == LuaMessageIdToSever.COMBO_TEST_PANEL_INFO then
  499. ComboTest.ReqComboTestPanelInfo(actor)
  500. elseif msgID == LuaMessageIdToSever.COMBO_TEST_REWARD then
  501. ComboTest.rewardByLevel(actor, msgData)
  502. elseif msgID == LuaMessageIdToSever.REQ_SWEEP_THROUGH_DUNGEONS then
  503. DuplicateCommon.sweepThroughDungeons(actor, msgData[1], msgData[2])
  504. elseif msgID == LuaMessageIdToSever.REQ_BIG_SECRET_REALM_PANEL_INFO then
  505. BigSecretRealm.getPanelInfo(actor)
  506. elseif msgID == LuaMessageIdToSever.REQ_BIG_SECRET_REALM_CHANGE_RECEIVE_STATUS then
  507. BigSecretRealm.setReceiveStatus(actor)
  508. elseif msgID == LuaMessageIdToSever.REQ_BIG_SECRET_REALM_KEY_LEVEL_UP then
  509. BigSecretRealm.keyLevelUp(actor, msgData)
  510. elseif msgID == LuaMessageIdToSever.REQ_BIG_SECRET_REALM_RECEIVE_REWARD then
  511. BigSecretRealm.receiveReward(actor, msgData)
  512. elseif msgID == LuaMessageIdToSever.REQ_TRANSFER_WITHIN_MAP then
  513. MapMoveTransfer.transferWithinMap(actor, msgData)
  514. elseif msgID == LuaMessageIdToSever.REQ_SETTING_RECYCLING_TYPE then
  515. ItemRecycling.setItemRecyclingType(actor, msgData)
  516. elseif msgID == LuaMessageIdToSever.REQ_GET_RECYCLING_TYPE then
  517. ItemRecycling.getItemRecyclingType(actor)
  518. elseif msgID == LuaMessageIdToSever.REQ_BIG_SECRET_REALM_SWEEP then
  519. BigSecretRealm.sweep(actor, msgData)
  520. elseif msgID == LuaMessageIdToSever.REQ_SANCTUARY_BOSS_ENTER_MAP then
  521. SanctuaryBoss.enterMap(actor, msgData)
  522. elseif msgID == LuaMessageIdToSever.REQ_CROSS_MAP_TRANSFER_TO_NPC then
  523. CrossMap.Transfer2NPC(actor, msgData)
  524. elseif msgID == LuaMessageIdToSever.REQ_INLAY_ANGEL_GRAIL then
  525. AngelMajorGrail.inlayGrail(actor, msgData)
  526. elseif msgID == LuaMessageIdToSever.REQ_UNLOAD_ANGEL_GRAIL then
  527. AngelMajorGrail.unloadGrail(actor, msgData)
  528. elseif msgID == LuaMessageIdToSever.REQ_GET_EQUIP_ALL_ENTRY_INFO then
  529. AngelMajorGrail.getEquipAllEntryInfo(actor, msgData)
  530. elseif msgID == LuaMessageIdToSever.REQ_STRENGTHEN_ANGEL_GRAIL then
  531. AngelMajorGrail.strengthenGrail(actor, msgData)
  532. elseif msgID == LuaMessageIdToSever.REQ_ANGEL_GRAIL_DECOMPOSE then
  533. AngelMajorGrail.grailDecompose(actor, msgData)
  534. elseif msgID == LuaMessageIdToSever.REQ_USE_SELF_CHOICE_BOX then
  535. UseSelfChoiceBox.use(actor, msgData)
  536. elseif msgID == LuaMessageIdToSever.REQ_OTHER_ANGE_EQUIP_INFO then
  537. AngelMajorEquipment.getPlayerAngelEquipInfo(actor, msgData)
  538. elseif msgID == LuaMessageIdToSever.REQ_OTHER_ANGE_GRAIL_INFO then
  539. AngelMajorGrail.getPlayerAngelGrailInfo(actor, msgData)
  540. elseif msgID == LuaMessageIdToSever.REQ_MONSTER_HUNT_RANK then
  541. MonsterHunt.RankList(actor)
  542. elseif msgID == LuaMessageIdToSever.REQ_SYNTHESIS_ALL_CARD then
  543. local type = tonumber(msgData[1])
  544. local level = tonumber(msgData[2])
  545. TransferCard.ReqSynthesisAll(actor, type, level)
  546. elseif msgID == LuaMessageIdToSever.REQ_BREAKTHROUGH_CARD then
  547. TransferCard.ReqBreakthrough(actor, msgData)
  548. elseif msgID == LuaMessageIdToSever.REQ_BREAKTHROUGH_CARD_ALL then
  549. local type = tonumber(msgData[1])
  550. local quality = tonumber(msgData[2])
  551. TransferCard.ReqBreakthroughAll(actor, type, quality)
  552. elseif msgID == LuaMessageIdToSever.REQ_MONSTER_HUNT_INFO then
  553. MonsterHunt.Info(actor)
  554. elseif msgID == LuaMessageIdToSever.REQ_TRANSFER_CARD_HANG_UP_SETTING then
  555. TransferCard.ReqUpdateTransferSetting(actor, msgData)
  556. elseif msgID == LuaMessageIdToSever.REQ_MAIN_ACTIVE_INFO then
  557. OperationalActivities.openSubActive(actor, msgData)
  558. elseif msgID == LuaMessageIdToSever.REQ_CHANGE_SKIP_ANIMATION then
  559. TurntableRaffle.changeSkipAnimation(actor, msgData)
  560. elseif msgID == LuaMessageIdToSever.REQ_TURNTABLE_RAFFLE_DRAWING then
  561. TurntableRaffle.drawing(actor, msgData)
  562. elseif msgID == LuaMessageIdToSever.REQ_RECEIVE_TURNTABLE_RAFFLE_REWARD then
  563. TurntableRaffle.receiveAccumulateReward(actor, msgData)
  564. elseif msgID == LuaMessageIdToSever.REQ_TURNTABLE_REWARD_COUNT_INFO then
  565. TurntableRaffle.getRewardCountInfo(actor, msgData)
  566. elseif msgID == LuaMessageIdToSever.REQ_WEEK_CHANGE_SKIP_ANIMATION then
  567. WeekTurntableRaffle.changeSkipAnimation(actor, msgData)
  568. elseif msgID == LuaMessageIdToSever.REQ_WEEK_TURNTABLE_RAFFLE_DRAWING then
  569. WeekTurntableRaffle.drawing(actor, msgData)
  570. elseif msgID == LuaMessageIdToSever.REQ_WEEK_RECEIVE_TURNTABLE_RAFFLE_REWARD then
  571. WeekTurntableRaffle.receiveAccumulateReward(actor, msgData)
  572. elseif msgID == LuaMessageIdToSever.REQ_WEEK_TURNTABLE_REWARD_COUNT_INFO then
  573. WeekTurntableRaffle.getRewardCountInfo(actor, msgData)
  574. elseif msgID == LuaMessageIdToSever.REQ_ROLAND_SEIGE_GET_MAIN_PANEL then
  575. RolandSeige.ReqMainPanel(actor)
  576. elseif msgID == LuaMessageIdToSever.REQ_ANGEL_GRAIL_RANKING_INFO then
  577. AngelMajorGrail.getGrailRankingInfo(actor, msgData)
  578. elseif msgID == LuaMessageIdToSever.REQ_WORSHIP_ANGEL_GRAIL_RANKING then
  579. AngelMajorGrail.worshipGrail(actor, msgData)
  580. elseif msgID == LuaMessageIdToSever.REQ_PLAYER_EQUIP_GRAIL_INFO then
  581. AngelMajorGrail.getPlayerAllAngelEquipAndGrail(actor, msgData)
  582. elseif msgID == LuaMessageIdToSever.REQ_REMAINING_ANGE_GRAIL_INFO then
  583. AngelMajorGrail.sendGrailInfo(actor, false)
  584. elseif msgID == LuaMessageIdToSever.REQ_KUN_DUN_AUCTION_BIDDING then
  585. KunDunAuction.PlayerBidding(actor, msgData)
  586. elseif msgID == LuaMessageIdToSever.REQ_UPDATE_ROLE_SETTING then
  587. RoleSetting.updateState(actor, msgData)
  588. elseif msgID == LuaMessageIdToSever.REQ_CUSTOME_TRANSFER then
  589. CustomTransmit.DoTransmit(actor, msgData)
  590. elseif msgID == LuaMessageIdToSever.REQ_TARGET_VIP_LV then
  591. RoleSetting.getTargetVipLv(actor, msgData)
  592. elseif msgID == LuaMessageIdToSever.REQ_CLOSE_DEMON_HERMIT_SKILL then
  593. Skill.closeDemonHermitSkill(actor)
  594. elseif msgID == LuaMessageIdToSever.REQ_CAREER_TRANSFER then
  595. PlayerCareerTransfer.careerTransfer(actor, msgData)
  596. elseif msgID == LuaMessageIdToSever.REQ_WEEKEN_ACTIVE_INFO then
  597. WeekActives.openSubActive(actor, msgData)
  598. elseif msgID == 2011669 or msgID == LuaMessageIdToSever.REQ_SummonChat_TRANSFER_RESPONSE then
  599. -- info("MS =============== >>>>>> QFunction-0 REQ_SummonChat_TRANSFER_RESPONSE: ", msgData)
  600. SummonAndChat.handleTransferResponse(actor, msgData)
  601. elseif msgID == LuaMessageIdToSever.REQ_AG_SD_INFO then
  602. AGAndSD.onLoginEnd(actor)
  603. elseif msgID == LuaMessageIdToSever.LianJi_MsgID then
  604. LianJi.onHandlereQuest(actor, msgID, msgData)
  605. elseif msgID == LuaMessageIdToSever.REQ_ROLE_INFO then
  606. Player.updateLoginInfo(actor)
  607. elseif msgID == LuaMessageIdToSever.REQ_ALL_COUNT_INFO_EXT then
  608. CountManager.sendPlayerAllCountsMsg(actor)
  609. elseif msgID == LuaMessageIdToSever.SERVICE_HORN or msgID == 3001666 then
  610. EquipAndAppear.Horn(actor, msgData)
  611. elseif msgID == LuaMessageIdToSever.TransactionInfo_MsgID then
  612. Transaction.onHandlereQuest(actor, msgID, msgData)
  613. elseif msgID == LuaMessageIdToSever.ItemPick_MsgID then
  614. Hook.pickItem(actor, msgData)
  615. elseif msgID == LuaMessageIdToSever.HookUpdateStatus then
  616. Hook.hookUpdateStatus(actor, msgData)
  617. elseif msgID == LuaMessageIdToSever.Add_Buff_MsgID then
  618. Buffer.onAddBuff(actor, msgData)
  619. elseif msgID == LuaMessageIdToSever.SkillTransfer then
  620. Skill.onTransfers(actor, msgData)
  621. elseif msgID == LuaMessageIdToSever.Team_Invite_Apply_MsgID then
  622. Team.onHandleTeamInviteApplyMsg(actor, msgData)
  623. elseif msgID == LuaMessageIdToSever.REQ_DAY_CARD_EXPERIENCE then
  624. Bag.sendDayCardGift(actor)
  625. elseif msgID == LuaMessageIdToSever.UpdateWear then
  626. EquipAndAppear.UpdateWear(actor)
  627. elseif msgID == LuaMessageIdToSever.REQ_TRANSFER_TO_MAP_WITH_ITEM_NEED then
  628. MapMoveTransfer.transferToMapSelect(actor, msgData)
  629. elseif msgID == LuaMessageIdToSever.REQ_TEAMMATE_POSITION then
  630. Team.GetAllMemberPos(actor)
  631. elseif msgID == LuaMessageIdToSever.REQ_WORLD_BOSS_INFO then
  632. WorldBoss.ReqWorldBossMsg(actor, msgData)
  633. elseif msgID == LuaMessageIdToSever.REQ_UPDATE_TASK_CHECK_STRATEGY then
  634. RoleCount.checkStrategy(actor)
  635. elseif msgID == LuaMessageIdToSever.REQ_WORLD_BOSS_UPDATE_GOODS then
  636. WbAuction.login(actor)
  637. elseif msgID == LuaMessageIdToSever.REQ_WORLD_AUCTION_BIDDING then
  638. WbAuction.PlayerBidding(actor, msgData)
  639. elseif msgID == LuaMessageIdToSever.REQ_EQUIP_FIX then
  640. EquipAndAppear.equipFix(actor, msgData)
  641. elseif msgID == LuaMessageIdToSever.Illustrate_MsgID then
  642. Illustrate.onHandlereQuest(actor, LuaMessageIdToSever.Illustrate_MsgID, msgData)
  643. elseif msgID == LuaMessageIdToSever.REQ_ITEM_FAILURE then
  644. EquipDurability.equipFailure(actor, msgData)
  645. elseif msgID == LuaMessageIdToSever.REQ_BIHU_MsgID then
  646. BiHu.HandleBiHu(actor, msgData)
  647. elseif msgID == LuaMessageIdToSever.REQ_MOUNT_MsgID then
  648. Mount.sendMountInfo(actor, msgData.rid)
  649. elseif msgID == LuaMessageIdToSever.REQ_ACT_FIRST_RECHARGE_INFO then
  650. ActFirstRecharge.getInfo(actor, msgData)
  651. elseif msgID == LuaMessageIdToSever.REQ_ACT_FIRST_RECHARGE_REWARD then
  652. ActFirstRecharge.gainReward(actor, msgData)
  653. else
  654. -- 请放到最后,其余消息在上面追加
  655. error(actor, "收到无法处理的消息", "玩家", actor, "消息ID", msgID, "params", msgData)
  656. end
  657. end
  658. function login(play)
  659. -- local info = getrolelist(play,getbaseinfo(play, "uid"))--local 自定义变量 = 接口事件名称(默认参数【自定义名称】,参数1,参数2...)
  660. -- error(info)--打印返回数据
  661. -- setplayeroutfightmodelvalue(play,91999,{"91999"})
  662. gameDebug.debug(Bag.login, play)
  663. gameDebug.debug(CountManager.login, play)
  664. gameDebug.debug(Friend.login, play)
  665. gameDebug.debug(DailyActivity.login, play)
  666. gameDebug.debug(Activity.LogIn, play)
  667. gameDebug.debug(Mount.sendCurrentRideMount, play)
  668. gameDebug.debug(Mount.sendMountLogo, play)
  669. gameDebug.debug(EquipGuard.login, play)
  670. gameDebug.debug(GoldTask.Login, play)
  671. gameDebug.debug(GoldFirstKill.login, play)
  672. gameDebug.debug(SecretRealm.login, play)
  673. gameDebug.debug(Union.sendLeaderOnlineStateMsg, play)
  674. gameDebug.debug(KingRoad.Login, play)
  675. gameDebug.debug(Wings.Login, play)
  676. gameDebug.debug(PrivilegeMonth.login, play)
  677. gameDebug.debug(Master.login, play)
  678. gameDebug.debug(MonthCard.login, play)
  679. gameDebug.debug(onHook.login, play)
  680. gameDebug.debug(CrossMap.EnterView, play, play)
  681. gameDebug.debug(GodsDescended.sendMonsterStateData, play)
  682. -- gameDebug.debug( EquipAndAppear.playerequipstrength(play,0)
  683. -- gameDebug.debug( Trade.sendRecharge, play)
  684. gameDebug.debug(TaskHandler.sendTaskState, play)
  685. gameDebug.debug(Efficiency.CheckRedDot, play)
  686. gameDebug.debug(PreferentialGift.CheckPreferentialGift, play)
  687. LoginEventListerTable:triggerEvent("0", play)
  688. gameDebug.debug(ExpBoost.login, play)
  689. gameDebug.debug(DailyLotteryDraw.login, play)
  690. gameDebug.debug(AngelBenefit.login, play)
  691. gameDebug.debug(SevenLogin.login, play)
  692. gameDebug.debug(RechargeSevenReceive.login, play)
  693. gameDebug.debug(LevelReward.login, play)
  694. gameDebug.debug(AngelWeapon.login, play)
  695. gameDebug.debug(AngelMajorEquipment.login, play)
  696. gameDebug.debug(AngelMajorTalent.sendActiveTalentInfo, play)
  697. gameDebug.debug(Mount.checkMountTime, play)
  698. gameDebug.debug(ComboTest.login, play)
  699. gameDebug.debug(BigSecretRealm.login, play)
  700. gameDebug.debug(RankScript.updateOnline, play, true)
  701. gameDebug.debug(AngelMajorGrail.sendGrailInfo, play, true)
  702. gameDebug.debug(Player.UpdateFightValue, play)
  703. gameDebug.debug(Trade.login, play)
  704. gameDebug.debug(HpMpRecover.recover, play)
  705. gameDebug.debug(RoleSetting.login, play)
  706. gameDebug.debug(EquipAndAppear.login, play)
  707. gameDebug.debug(FruitScript.toGetAlreadyUsePoints, play)
  708. gameDebug.debug(AGAndSD.onLoginEnd, play)
  709. gameDebug.debug(NewEquipWear.onLoginEnd, play)
  710. gameDebug.debug(EquipDurability.onLoginEnd, play)
  711. gameDebug.debug(EquipRefined.onLoginEnd, play)
  712. gameDebug.debug(LianJi.onLoginEnd, play)
  713. gameDebug.debug(Player.onLoginEnd, play)
  714. gameDebug.debug(Transaction.onLoginEnd, play)
  715. gameDebug.debug(Hook.onLoginEnd, play)
  716. -- gameDebug.debug( OperationalActivities.openActive, play)
  717. gameDebug.debug(ActFirstRecharge.login, play)
  718. gameDebug.debug(ActMonthlyGrow.login, play)
  719. end
  720. function exit(actor)
  721. local time = getbaseinfo("now")
  722. setplaydef(actor, "T$offlinetime", time)
  723. Skill.closeDemonHermitSkill(actor)
  724. Skill.closePet(actor)
  725. NewEquipWear.closePet(actor)
  726. end
  727. function logout(actor)
  728. onHook.logout(actor)
  729. RankScript.updateOnline(actor, false)
  730. gameDebug.debug(Player.UpdateFightValue, actor)
  731. gameDebug.debug(LogManager.RoleLogout, actor)
  732. gameDebug.debug(AGAndSD.onLogout, actor)
  733. gameDebug.debug(NewEquipWear.onLogout, actor)
  734. gameDebug.debug(EquipAndAppear.onLogout, actor)
  735. gameDebug.debug(Skill.closePet, actor)
  736. gameDebug.debug(Skill.closeDemonHermitSkill, actor)
  737. gameDebug.debug(Hook.onLogout, actor)
  738. gameDebug.debug(Stall.endStall, actor)
  739. end
  740. function run(actor)
  741. -- 测试内网,看看能不能更新上去
  742. end
  743. function walk(actor)
  744. end
  745. function jump(actor)
  746. end
  747. function removeskillevent(actor, removeSkillList)
  748. end
  749. function releaseskillafter(actor, skillid, skilllevel, targetlist, finalTargetList, targetHurt, targetTotal)
  750. AGAndSD.onAttackAG(actor, skillid)
  751. Skill.releaseSkillAfter(actor, skillid)
  752. -- sendluamsg(actor, LuaMessageIdToSever.SkillRelease, {
  753. -- skillId = skillid,
  754. -- skillLevel = skilllevel
  755. -- })
  756. end
  757. function releaseskill(actor, skillid, skilllevel, targetlist)
  758. -- --Buffer.OnReleaseSkill(actor,targetlist)
  759. -- end
  760. --
  761. -- function releaseskillafter(actor, skillid, skilllevel, targetlist, finalTargetList, targetHurt, targetTotal)
  762. -- -- targetlist : 伤害目标列表
  763. -- -- finalTargetList: 伤害目标结果列表,包含了未产生伤害的对象,也就是被powersource=0过滤掉的目标
  764. -- -- targetHurt: 总伤害值
  765. -- -- targetTotal: 受到伤害目标的数量,等于size(targetlist)
  766. -- local baseCareer = getbaseinfo(actor, "getbasecareer")
  767. -- if baseCareer == 3 then
  768. -- local needWeapon = ConfigDataManager.getTableValue("cfg_skill_info", "needWeapon", "skillID", skillid,
  769. -- "skillLevel", skilllevel)
  770. -- if string.startsWith(needWeapon, "4") then
  771. -- local isPass = false
  772. -- local needWeapons = string.split(needWeapon, "|")
  773. -- local equipPos = {}
  774. -- local equips = getputonequipinfo(actor)
  775. -- for key, equip in pairs(equips) do
  776. -- local pos = gameequip.pos(equip.equipindex)
  777. -- equipPos[pos] = equip
  778. -- end
  779. -- for i = 2, #needWeapons, 1 do
  780. -- local weaponDatas = string.split(needWeapons[i], "#")
  781. -- local part = tonumber(weaponDatas[1])
  782. -- local weapon = tonumber(weaponDatas[2])
  783. -- local equip = equipPos[part]
  784. -- if equip ~= nil then
  785. -- local equipField = ConfigDataManager.getTableValue("cfg_item", "field", "id", equip.cfgid)
  786. -- local equipPart = ConfigDataManager.getTableValue("cfg_model_charactor", "part", "id", equipField)
  787. -- if tonumber(equipPart) == weapon then
  788. -- isPass = true;
  789. -- break
  790. -- end
  791. -- end
  792. -- end
  793. -- if isPass == false then
  794. -- return false
  795. -- end
  796. -- end
  797. -- end
  798. EquipDurability.updateQuiver(actor)
  799. LianJi.releaseskill(actor, skillid, skilllevel, targetlist)
  800. Skill.releaseSkill(actor, skillid)
  801. end
  802. function triggertaskrefresh(actor, type, param)
  803. -- 统一走lua触发任务刷新接口
  804. TaskHandler.TriggerTaskGoal(actor, type, param)
  805. end
  806. function levelup(actor, level, oldlevel)
  807. LevelUpEventListerTable:triggerEvent("0", actor, level)
  808. gameDebug.debug(LogManager.RoleLevelUp, actor)
  809. RoleAttr.levelup(actor, level, oldlevel)
  810. -- 处理职业解锁
  811. CareerUnlock.unlock(actor, level)
  812. -- 检查王者任务初始化
  813. KingRoad.TryInitKingRoadTask(actor)
  814. Wings.TryInitWingsTask(actor)
  815. Master.levelup(actor, level, oldlevel)
  816. -- Mail.levelUp(actor, level)
  817. OpenServerAct.UpdateRankValue(actor, OpenServerAct.RealTimeRank.ROLE_LEVEL, level)
  818. Buffer.levelUp(actor, level)
  819. Efficiency.CheckRedDot(actor, level)
  820. PreferentialGift.CheckPreferentialGift(actor)
  821. GoldFirstKill.AcceptTask(actor)
  822. AngelBenefit.AcceptTask(actor)
  823. SevenLogin.updateLoginInfo(actor)
  824. BraveTest.refreshRedDot(actor)
  825. RechargeSevenReceive.updateLoginInfo(actor)
  826. Player.onLevelUp(actor)
  827. -- AGAndSD.upLevelCfgId(actor)
  828. end
  829. function taskprogresscomplete(actor, taskId)
  830. Mail.taskComplete(actor, taskId)
  831. Buffer.taskProgressComplete(actor, taskId)
  832. end
  833. function taskcomplete(actor, taskId)
  834. FaceShootPreview.TaskCompleted(actor, taskId)
  835. end
  836. -- @description 玩家活动改变事件
  837. -- @param 玩家对象;活动id;1-开启,0-关闭
  838. -- @return
  839. function activitychange(actor, activityId, action)
  840. Activity.ActivityChange(actor, activityId, action)
  841. GodsDescended.actorActivityChange(actor, activityId, action)
  842. end
  843. -- @description 开启活动,系统执行
  844. -- @param 系统对象,id和mapid均为0;活动id;1-开启,0-关闭
  845. -- @return
  846. function systemactivitychange(system, activityId, action)
  847. if tonumber(activityId) == DuplicateType.MONSTER_ATTACK then
  848. MonAtk.run(activityId, action)
  849. elseif tonumber(activityId) == DuplicateType.MONSTER_ATTACK_GOLD1 then
  850. MonAtk.run(activityId, action)
  851. elseif tonumber(activityId) == DuplicateType.MONSTER_ATTACK_GOLD2 then
  852. MonAtk.run(activityId, action)
  853. elseif tonumber(activityId) == DuplicateType.WAR_ALLIANCE and tonumber(action) == 0 then
  854. WarAlliance.ClearThisTimeGameData()
  855. elseif tonumber(activityId) == DuplicateType.WOLF_SOUL and tonumber(action) == 1 then
  856. WolfSoul.OpenDuplicate(system)
  857. elseif tonumber(activityId) == DuplicateType.GODS_DESCENDED then
  858. GodsDescended.sysActivityChange(activityId, action)
  859. elseif tonumber(activityId) == DuplicateType.KUN_DUN then
  860. KunDun.Run(action)
  861. elseif activityId == DuplicateType.ROLAND_SEIGE and action == 1 then
  862. -- 罗兰峡谷攻城战活动开启
  863. RolandSeige.OpenDuplicate(system)
  864. elseif tonumber(activityId) == DuplicateType.WORLD_BOSS then
  865. WorldBoss.Run(activityId, action)
  866. end
  867. end
  868. -- 怪物进入战斗状态触发
  869. function monsterenterattack(actor, monstercfgid, enemyid)
  870. messagebox(actor, "怪物进入战斗状态触发")
  871. MonAtk.monAtkMonsterEnterAttack(actor, monstercfgid, enemyid)
  872. MonAtk.monAtkMonsterEnterAttack(actor, monstercfgid)
  873. end
  874. -- 怪物脱离战斗状态触发
  875. function monsterleaveattack(actor, monstercfgid)
  876. MonAtk.monAtkMonsterLeaveAttack(actor, monstercfgid)
  877. end
  878. ---击杀玩家事件
  879. ---@param actor any 攻击玩家对象
  880. ---@param diePlayer any 死亡玩家对象
  881. function killplayer(actor, diePlayer)
  882. pk.killplayerpkvaluehandle(actor, diePlayer) -- 击杀玩家PK值处理
  883. -- Friend.enemyaddbefore(diePlayer, actor)
  884. RedFortress.KillPlayer(actor, diePlayer)
  885. UnionTask.killPlayerEvent(actor, diePlayer)
  886. KunDun.KillPlayer(actor, diePlayer)
  887. RolandSeige.KillPlayer(actor, diePlayer)
  888. end
  889. ---玩家被攻击事件
  890. ---@param actor any 玩家对象
  891. ---@param fightParam any 被攻击参数 caster:攻击者对象、target:被攻击者对象、mapid:地图id、skillid:技能id、skilllevel:技能等级、castertype:攻击者类型、targettype:被攻击者类型
  892. function underattack(actor, fightParam, fightResult)
  893. pk.underattackpkvaluehandle(actor, fightParam) -- 被攻击PK值防卫时间处理
  894. EquipGem.setGemRecovery(actor, fightParam)
  895. MonsterScript.OnUnderAttack(actor, fightParam)
  896. -- EquipDurability.beattack(actor, fightParam.target, fightParam.targethurt, fightParam.targettype)
  897. EquipDurability.beattackMark(actor, fightParam.target, fightParam.targethurt, fightParam.targettype)
  898. end
  899. ---击杀怪物事件
  900. ---@param actor any 玩家对象
  901. ---@param monsterId any 怪物唯一ID
  902. ---@param monsterCfgId number 怪物configId
  903. ---@param monsterName string 怪物名称
  904. ---@param pointX number 怪物X坐标
  905. ---@param pointY number 怪物Y坐标
  906. ---@param activityId number 活动id
  907. ---@param monsterLevel number 怪物等级
  908. function killmon(actor, monsterId, monsterCfgId, monsterName, pointX, pointY, activityId, monsterLevel, mongenCfgId)
  909. gameDebug.debug(LogManager.KillMonster, actor, monsterCfgId)
  910. pk.killmonsterpkvaluehandle(actor, monsterCfgId, monsterLevel) -- 击杀怪物PK值处理
  911. UnionTask.killMonsterEvent(actor, monsterCfgId)
  912. -- AG / SD信息
  913. -- AGAndSD.onKillMon(actor, monsterId, monsterCfgId, monsterName, pointX, pointY, activityId, monsterLevel, mongenCfgId)
  914. end
  915. -- 当前地图检查是否可以使用道具(actor, id)
  916. function MapCanuseitem(actor, id)
  917. -- 获取所在地图
  918. -- local mapId = tonumber(getbaseinfo(actor, "mapid"))
  919. -- 需要消耗资源的地图不许使用此道具
  920. -- local items_need = ConfigDataManager.getTableValue("cfg_map_line", "items_need", "id", mapId)
  921. -- if not string.isNullOrEmpty(items_need) then
  922. -- tipinfo(actor, string.format("当前地图禁止使用该道具"))
  923. -- return false
  924. -- end
  925. return true
  926. end
  927. -- 道具使用检测
  928. function useitembefore(actor, data)
  929. if data.type == 1 then
  930. for key, value in pairs(data.items) do
  931. local itemInfo = getbagiteminfo(actor, key, 0)
  932. local canUse = WarFlag.canUseWarFlagItem(actor, itemInfo)
  933. if canUse == false then
  934. return false
  935. end
  936. end
  937. end
  938. for key, value in pairs(data.items) do
  939. local itemInfo = getbagiteminfo(actor, key, 0)
  940. if itemInfo == nil then
  941. elseif itemInfo.cfgid == 30030109 then
  942. local teamid = getbaseinfo(actor, "teamid")
  943. if teamid == nil or teamid == "" or teamid == 0 then
  944. tipinfo(actor, string.format("您不在队伍中"))
  945. return false
  946. end
  947. return MapCanuseitem(actor, itemInfo.cfgid)
  948. elseif itemInfo.cfgid == 30030108 then
  949. local unionid = getbaseinfo(actor, "unionid")
  950. if unionid == nil or unionid == "" or unionid == 0 then
  951. tipinfo(actor, string.format("您不在战盟中"))
  952. return false
  953. end
  954. local unioninfo = getunioninfo(actor, unionid)
  955. if unioninfo.num <= 1 then
  956. tipinfo(actor, string.format("没有可召唤的战盟成员"))
  957. return false
  958. end
  959. return MapCanuseitem(actor, itemInfo.cfgid)
  960. elseif itemInfo.cfgid == 70700026 then -- 免罪符
  961. local pkval = pk.getpkvalue(actor)
  962. if pkval <= 0 then
  963. messagebox(actor, "您的罪恶值为 0,无需消除")
  964. return false
  965. end
  966. local show = pkval - 10 > 0 and pkval - 10 or 0
  967. noticeTip.noticeinfo(actor, 35007, pkval, show)
  968. elseif
  969. itemInfo.cfgid == 40010831 or itemInfo.cfgid == 40010832 or itemInfo.cfgid == 40010833 or
  970. itemInfo.cfgid == 40010834 or
  971. itemInfo.cfgid == 40010835
  972. then
  973. local canUse = FashionBox.canUse(actor, itemInfo.cfgid)
  974. if canUse ~= true then
  975. return false
  976. end
  977. -- elseif itemInfo.cfgid == 50020021 then -- 使用防护药水
  978. -- return AGAndSD.useItem(actor,itemInfo.cfgid,1,1)
  979. end
  980. -- if not MapCanuseitem(actor, itemInfo.cfgid) then
  981. -- return false
  982. -- end
  983. end
  984. end
  985. ---使用道具事件
  986. ---@param actor any 玩家对象
  987. ---@param itemConfigId number 道具configId
  988. ---@param count number 使用数量
  989. function useitemtrigger(actor, itemConfigId, count)
  990. gameDebug.debug(CareerChange.useItemChangeCareer, actor, itemConfigId)
  991. CareerChange.useItemChangeCareer(actor, itemConfigId, count)
  992. EquipAndAppear.addbuffcostitem(actor, itemConfigId, count) -- 使用道具
  993. pk.exonerationcharmpkvaluehnadle(actor, itemConfigId, count) -- 免罪符使用减少PK值处理
  994. -- PrivilegeCardScript.setPrivilegeCardInfos(actor, itemConfigId, count) -- 特权卡使用后处理
  995. FruitScript.handleUseFruit(actor, itemConfigId, count) -- 果实使用后处理
  996. MonthCard.usemonthcard(actor, itemConfigId, count) -- 使用月卡后处理
  997. RandomChest.generateChestItem(actor, itemConfigId, count) -- 随机宝箱生成道具
  998. FashionBox.generateChestItem(actor, itemConfigId, count) -- 时装宝箱生成道具
  999. EquipBossBox.generateChestItem(actor, itemConfigId, count) -- boss宝箱生成道具
  1000. ExpBoost.useExperienceBoostItem(actor, itemConfigId, count) -- 经验加成道具处理
  1001. PrivilegeMonth.usePrivilegeCard(actor, itemConfigId, count) -- 特权卡使用处理
  1002. AngelMajorEquipment.useExperienceBoostItem(actor, itemConfigId, count) -- 大天使经验药水使用处理
  1003. WarFlag.useWarFlagItem(actor, itemConfigId, count) -- 使用旗魂道具
  1004. -- 新增召唤和聊天道具处理
  1005. SummonAndChat.handleSpecialItems(actor, itemConfigId, count)
  1006. LianJi.onUseItem(actor, itemConfigId, count)
  1007. -- 防护药水使用处理
  1008. AGAndSD.useItem(actor, itemConfigId)
  1009. end
  1010. ---玩家转职事件
  1011. ---@param actor any 玩家对象
  1012. ---@param transferCareerNum number 转职次数
  1013. ---@param careerName string 转职名称
  1014. function transfercareer(actor, transferCareerNum, careerName)
  1015. RoleAttr.transferCareer(actor, careerName)
  1016. local roleName = getrolefield(actor, "role.basic.name")
  1017. -- 转职成功发送公告消息
  1018. noticeTip.noticeinfo(actor, StringIdConst.JOB_CHANGE, roleName, transferCareerNum, careerName)
  1019. end
  1020. ---玩家进入视野事件
  1021. ---@param actor any 玩家对象
  1022. ---@param targetPlayer any 进入视野的玩家对象
  1023. function playerenterview(actor, targetPlayer)
  1024. pk.sendenterviewpkvalue(actor, targetPlayer) -- 进入视野发送PK值
  1025. DuplicateCommon.PlayerEnterView(actor, targetPlayer) -- 副本中玩家进入视野
  1026. CrossMap.EnterView(actor, targetPlayer)
  1027. SceneMap.playerEnterView(actor, targetPlayer)
  1028. Skill.playerequipview(actor, targetPlayer)
  1029. TransferCard.PlayerEnterView(actor, targetPlayer)
  1030. EquipAndAppear.playerequipstrength(actor, targetPlayer) -- 玩家进入视野发送装备强化信息
  1031. EquipAndAppear.playerequipview(actor, targetPlayer)
  1032. end
  1033. --- 怪物进入视野事件
  1034. ---@param actor any 玩家对象
  1035. ---@param monsterActor any 怪物对象
  1036. ---@param monsterCfgId number 怪物configId
  1037. function monsterenterview(actor, monsterActor, monsterCfgId)
  1038. MonsterScript.MonsterEnterView(actor, monsterActor, monsterCfgId)
  1039. end
  1040. --- 穿戴装备后触发
  1041. function takeonequip(actor, pos, oldItemId, itemId, itemCfgId)
  1042. gameDebug.debug(LogManager.RolePutOnEquip, actor)
  1043. EquipGuard.putGuardEquip(actor, itemCfgId)
  1044. -- 转移装备属性
  1045. EquipAndAppear.checkCanTransfer(actor, oldItemId, itemId)
  1046. -- EquipMaster.triggerEquipMaster(actor)
  1047. EquipAndAppear.updateluaextattr(actor)
  1048. EquipGem.schemeEffectByBoolean(actor, {pos}, true)
  1049. -- EquipAndAppear.playerequipstrength(actor, 0) --发送玩家装备强化信息
  1050. -- 刷新装备任务进度
  1051. this.equipchangeflushtask(actor, pos, itemId)
  1052. TransferCard.EquipChange(actor)
  1053. OpenServerCompetition.updateSuitStageNum(actor)
  1054. AngelWeapon.updateTaskInfo(actor)
  1055. -- 穿戴大天使装备后操作
  1056. AngelMajorEquipment.afterPutOnAngelEquipment(actor, oldItemId, itemId, itemCfgId)
  1057. EquipDurability.takeonequip(actor, pos, oldItemId, itemId, itemCfgId)
  1058. TwoWeaponsAttrs.updateAttrs(actor, pos)
  1059. LineManager.takeoffequip(actor)
  1060. EquipMaster.updateEquipMaster(actor)
  1061. end
  1062. --- 脱下装备后触发
  1063. function takeoffequip(actor, pos, itemId, itemCfgId)
  1064. EquipGuard.takeOffGuardEquip(actor, itemCfgId)
  1065. -- EquipMaster.triggerEquipMaster(actor)
  1066. EquipAndAppear.updateluaextattr(actor)
  1067. EquipGem.schemeEffectByBoolean(actor, {pos}, false)
  1068. -- EquipAndAppear.playerequipstrength(actor, 0) --发送玩家装备强化信息
  1069. -- 刷新装备任务进度
  1070. this.equipchangeflushtask(actor, pos, itemId)
  1071. TransferCard.EquipChange(actor)
  1072. AngelWeapon.updateTaskInfo(actor)
  1073. -- 脱下大天使装备后操作
  1074. AngelMajorEquipment.afterTakeOffAngelEquipment(actor, itemId, itemCfgId)
  1075. TwoWeaponsAttrs.updateAttrs(actor, pos)
  1076. Equip_QiangHua.takeOffEquip(actor, pos, itemId, itemCfgId)
  1077. -- 地图检测
  1078. LineManager.takeoffequip(actor)
  1079. EquipMaster.updateEquipMaster(actor)
  1080. end
  1081. function weaponchange(actor, oldIndex, newIndex, itemId)
  1082. local res = {
  1083. oldIndex = oldIndex,
  1084. newIndex = newIndex,
  1085. itemId = itemId
  1086. }
  1087. sendluamsg(actor, LuaMessageIdToClient.RES_WEAPON_CHANGE_AUTO, res)
  1088. end
  1089. function this.equipchangeflushtask(actor)
  1090. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.EQUIP_APPEND)
  1091. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.PARTS_STRENGTHEN_LV)
  1092. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.JEWELRY_LV_UP)
  1093. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.EXCELLENCE_ATTR)
  1094. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.EQUIP_EXCELLENCE_ATTR_COUNT)
  1095. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.EQUIP_APPEND_TOTAL_LV)
  1096. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.SPECIFIC_STAGE_EQUIP)
  1097. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.INLAID_GEMSTONES)
  1098. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.TAKE_ON_GRAIL_COUNT)
  1099. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.STRENGTHEN_GRAIL)
  1100. end
  1101. -- 装备生效事件 是否生效 通过参数的布尔值判断
  1102. function equipeffectbyboolean(actor, map, effect)
  1103. -- 获取影响的装备位置
  1104. local effectPos = {}
  1105. for k, v in pairs(map) do
  1106. table.insert(effectPos, gameequip.pos(k))
  1107. end
  1108. EquipGem.schemeEffectByBoolean(actor, effectPos, effect)
  1109. -- sendluamsg(actor, LuaMessageIdToClient.RES_GEM_SCHEME, { ["触发了生效事件"] = map })
  1110. end
  1111. --- 物品变化
  1112. function itemchange(actor, ids, cfgId, oldCount, newCount, change)
  1113. EquipGuard.initGuardEquip(actor, ids, cfgId, oldCount, newCount)
  1114. Master.masterItemChange(actor, ids, cfgId, oldCount, newCount)
  1115. -- 任务进度刷新
  1116. if tonumber(oldCount) < tonumber(newCount) then
  1117. local count = tonumber(newCount) - tonumber(oldCount)
  1118. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.RE_GET_ITEM, {cfgId, count})
  1119. end
  1120. AutoBuyPotionScript.coinChange(actor, cfgId)
  1121. end
  1122. function addmonthcardbefore(actor, cfgId, count)
  1123. if cfgId ~= 30030305 then
  1124. return
  1125. end
  1126. -- 直接加月卡时间
  1127. MonthCard.buymonthcardgoods(actor, cfgId, count)
  1128. end
  1129. -- 怪物进入战斗状态触发
  1130. function monsterenterattack(actor, monstercfgid, enemyid)
  1131. MonAtk.monAtkMonsterEnterAttack(actor, monstercfgid)
  1132. end
  1133. -- 怪物脱离战斗状态触发
  1134. function monsterleaveattack(actor, monstercfgid)
  1135. MonAtk.monAtkMonsterLeaveAttack(actor, monstercfgid)
  1136. end
  1137. -- 不入包的道具获取
  1138. function nobagitemchange(actor, itemList)
  1139. for _, itemInfo in pairs(itemList) do
  1140. EquipAndAppear.titleenterbag(actor, itemInfo.cfgid)
  1141. end
  1142. TransferCard.NotEnterBagItemAdd(actor, itemList)
  1143. end
  1144. -- @description 副本阶段更新
  1145. -- @param 系统id;地图唯一id;副本类型;副本阶段(1-准备 2-战斗 3-结算);下一阶段开始时间戳;配置id(cfg_rep的id)
  1146. -- @return
  1147. function dupstateupdate(system, id, dupType, state, nextStateStartTime, configId)
  1148. if dupType == DuplicateType.DEVIL_SQUARE then
  1149. -- 恶魔广场
  1150. DevilSquare.DevilSquareStateUpdate(system, id, state, nextStateStartTime, configId)
  1151. elseif dupType == DuplicateType.BLOODY_CASTLE then
  1152. -- 血色城堡
  1153. BloodyCastle.BloodyCastleStateUpdate(system, id, state, nextStateStartTime, configId)
  1154. elseif dupType == DuplicateType.BRAVE_TEST then
  1155. -- 勇者试炼
  1156. BraveTest.BraveTestStateUpdate(system, id, state, nextStateStartTime, configId)
  1157. elseif dupType == DuplicateType.RED_FORTRESS then
  1158. -- 赤色要塞
  1159. RedFortress.RedFortressStateUpdate(system, id, state, nextStateStartTime, configId)
  1160. elseif dupType == DuplicateType.WAR_ALLIANCE then
  1161. -- 战盟boss
  1162. WarAlliance.WarAllianceStateUpdate(system, id, state, nextStateStartTime, configId)
  1163. elseif dupType == DuplicateType.PRIVILEGE_BOSS then
  1164. PrivilegeBoss.PrivilegeBossStateUpdate(system, id, state, nextStateStartTime, configId)
  1165. elseif dupType == DuplicateType.WOLF_SOUL then
  1166. WolfSoul.DupStateUpdate(system, id, state, nextStateStartTime, configId)
  1167. elseif dupType == DuplicateType.KUN_DUN then
  1168. KunDun.DupStateUpdate(system, id, state, nextStateStartTime, configId)
  1169. elseif dupType == DuplicateType.COMBO_TEST then
  1170. ComboTest.ComboStateUpdate(system, id, state, nextStateStartTime, configId)
  1171. elseif dupType == DuplicateType.BIG_SECRET_REALM then
  1172. BigSecretRealm.DupStateUpdate(system, id, state, nextStateStartTime, configId)
  1173. elseif dupType == DuplicateType.ROLAND_SEIGE then
  1174. RolandSeige.DupStateUpdate(system, id, state, nextStateStartTime, configId)
  1175. elseif dupType == DuplicateType.ITEM_BOSS then
  1176. ItemBoss.DupStateUpdate(system, id, state, nextStateStartTime, configId)
  1177. elseif dupType == DuplicateType.WORLD_BOSS then
  1178. WorldBoss.DupStateUpdate(system, id, state, nextStateStartTime, configId)
  1179. end
  1180. end
  1181. -- @description 副本秒钟心跳
  1182. -- @param
  1183. -- @return
  1184. function duplicatesecondheart(system)
  1185. local mapId = getbaseinfo(system, "unimapid")
  1186. local dupInfo = getduplicate(mapId)
  1187. if dupInfo == nil then
  1188. return
  1189. end
  1190. local dupType = dupInfo["type"]
  1191. local state = dupInfo["state"]
  1192. local dupConfig = dupInfo["dupcfgid"]
  1193. if dupType == DuplicateType.WOLF_SOUL then
  1194. WolfSoul.SecondHeart(mapId, dupConfig, state)
  1195. elseif dupType == DuplicateType.ROLAND_SEIGE then
  1196. RolandSeige.DupSecondHeart(mapId, dupConfig, state)
  1197. elseif dupType == DuplicateType.KUN_DUN then
  1198. KunDun.DupSecondHeart(mapId, dupConfig, state)
  1199. end
  1200. end
  1201. -- 副本3秒钟心跳
  1202. function duplicate3secondheart(system)
  1203. local mapId = getbaseinfo(system, "unimapid")
  1204. local dupInfo = getduplicate(mapId)
  1205. if dupInfo == nil then
  1206. return
  1207. end
  1208. local dupType = dupInfo["type"]
  1209. local state = dupInfo["state"]
  1210. local dupConfig = dupInfo["dupcfgid"]
  1211. if dupType == DuplicateType.ROLAND_SEIGE then
  1212. RolandSeige.Dup3SecondHeart(mapId, dupConfig, state)
  1213. elseif dupType == DuplicateType.WORLD_BOSS then
  1214. WorldBoss.DupSecondHeart(mapId, dupConfig, state)
  1215. end
  1216. end
  1217. -- 副本5秒钟心跳
  1218. function duplicate5secondheart(system)
  1219. local mapId = getbaseinfo(system, "unimapid")
  1220. local dupInfo = getduplicate(mapId)
  1221. if dupInfo == nil then
  1222. return
  1223. end
  1224. local dupType = dupInfo["type"]
  1225. local state = dupInfo["state"]
  1226. local dupConfig = dupInfo["dupcfgid"]
  1227. if dupType == DuplicateType.RED_FORTRESS then
  1228. RedFortress.Dup5SecondHeart(mapId, dupConfig, state)
  1229. end
  1230. end
  1231. -- @description 怪物死亡掉落经验事件,归属者触发,主要处理怪物经验
  1232. -- @param 归属者;默认掉落经验;怪物配置id;x坐标;y坐标
  1233. -- @return 经验值
  1234. function monsterdieexp(actor, exp, monCfgId, monsterId, x, y)
  1235. local mapId = getbaseinfo(actor, "unimapid")
  1236. SecretRealm.recordMonsterDie(actor, mapId, monCfgId, monsterId)
  1237. local mapInfo = getmapinfobyid(mapId)
  1238. -- 指定地图增加经验倍率
  1239. local map_exp_rate = ConfigDataManager.getTableValue("cfg_map_info", "exprate", "id", mapInfo.cfgid)
  1240. if tonumber(map_exp_rate) > 0 then
  1241. exp = exp * (1 + map_exp_rate / 100)
  1242. end
  1243. local newExp = LineManager.applyExpRate(actor, exp) -- 应用线路经验倍率 2025.08.23 拓展地图线路
  1244. -- info(string.format('MS 经验衰减倍率 线路应用前为:%d 线路应用后为:%d', exp, newExp))
  1245. -- 经验衰减倍率
  1246. local decayRate = MonsterScript.GetExpDecayRate(actor, monCfgId)
  1247. local finalExp = newExp * TripleIncome.GetRate(actor) * decayRate
  1248. local expRate = 0
  1249. -- 判断是不是副本
  1250. if mapInfo["isdup"] == true then
  1251. local dupInfo = getduplicate(mapId)
  1252. local dupType = dupInfo["type"]
  1253. if dupType == DuplicateType.DEVIL_SQUARE then
  1254. DevilSquare.KillMonterInDevilSquare(actor, mapId, finalExp, monCfgId)
  1255. elseif dupType == DuplicateType.BLOODY_CASTLE then
  1256. BloodyCastle.KillMonterInBloodyCastle(actor, mapId, finalExp, monCfgId)
  1257. elseif dupType == DuplicateType.ITEM_BOSS then
  1258. ItemBoss.KillMonterInItemBoss(actor, mapId, finalExp, monCfgId)
  1259. end
  1260. else
  1261. -- 如果不是副本,则加成世界等级
  1262. expRate = Player.calWorldLevelExpRate(actor)
  1263. end
  1264. -- 如果组队 经验分配
  1265. local list = API.GetRangeTeamList(actor, 15)
  1266. if #list > 1 then
  1267. local TeamExp = {}
  1268. local expPre = 0
  1269. -- 配置表加成经验万分比
  1270. local CfgVal = ConfigDataManager.getTableValue("cfg_global", "value", "id", "260002")
  1271. local items = string.split(CfgVal, "|")
  1272. for index, item in pairs(items) do
  1273. local Val = string.split(item, "#")
  1274. if tonumber(Val[1]) == tonumber(#list) then
  1275. expPre = tonumber(Val[2])
  1276. break
  1277. end
  1278. end
  1279. -- 职业加成
  1280. local jobM = {}
  1281. for i = 1, #list do
  1282. local player = list[i]
  1283. local career = getbaseinfo(player, "getbasecareer")
  1284. jobM[career] = true
  1285. end
  1286. if jobM[1] and jobM[2] and jobM[3] then -- 战、法、弓
  1287. expPre = expPre + 3000 -- 加成30%
  1288. end
  1289. -- 向上取整-- 计算每个队员获得的经验值
  1290. finalExp = math.ceil(finalExp * (expPre / 10000 + 1) / #list)
  1291. -- local rid = getbaseinfo(actor, "rid")
  1292. for i = 1, #list do
  1293. local act = list[i]
  1294. -- 世界等级加成百分比 *100
  1295. expRate = Player.calWorldLevelExpRate(act) * 100
  1296. -- 经验药水加成属性万分比
  1297. local attrValue = getplaydef(act, PlayerDefKey.player.EXP_BOOST_ATTR_VALUE) or 0
  1298. -- 装备属性经验加成万分比
  1299. local listEquip = getputonequipinfo(act)
  1300. for _, equip in pairs(listEquip) do
  1301. attrValue = (getequipattrbypos(act, equip.equipindex, 325012) or 0) + attrValue
  1302. end
  1303. -- 坐骑经验加成万分比
  1304. local mountExp = Mount.getAttValue(act, 325012)
  1305. attrValue = mountExp + attrValue
  1306. local retVal = math.ceil(finalExp * (1 + (expRate + attrValue) / 10000))
  1307. addroleexp(act, retVal)
  1308. -- TeamExp[playerRid] = math.ceil(finalExp * (1 + expRate / 100))
  1309. TaskHandler.TriggerTaskGoal(act, TaskTargetType.KILL_MONSTER_TEAM_SHARE, monCfgId)
  1310. end
  1311. return TeamExp
  1312. end
  1313. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.KILL_MONSTER_TEAM_SHARE, monCfgId)
  1314. -- finalExpSelfExt = math.ceil(finalExp * (expRate / 100.0))
  1315. return math.ceil(finalExp * (1 + expRate / 100))
  1316. end
  1317. function getexpafter(actor, exp, fromType)
  1318. if fromType == 2 then
  1319. local mapId = getbaseinfo(actor, "unimapid")
  1320. local dupInfo = getduplicate(mapId)
  1321. if dupInfo ~= nil then
  1322. local dupType = dupInfo["type"]
  1323. if dupType == DuplicateType.DEVIL_SQUARE then
  1324. DevilSquare.AddExp(actor, mapId, exp)
  1325. elseif dupType == DuplicateType.BLOODY_CASTLE then
  1326. BloodyCastle.AddExp(actor, mapId, exp)
  1327. end
  1328. end
  1329. end
  1330. end
  1331. -- @description 玩家进入副本事件
  1332. -- @param 玩家对象;地图唯一id;副本类型;副本阶段(1-准备 2-战斗 3-结算);下一阶段开始时间戳;配置id(cfg_rep的id)
  1333. -- @return
  1334. function afterenterduplicate(actor, mapId, dupType, state, nextStateStartTime, configId)
  1335. if dupType == DuplicateType.DEVIL_SQUARE then
  1336. -- 恶魔广场
  1337. DevilSquare.AfterPlayerEnterDevilSquare(actor, mapId, state, nextStateStartTime, configId)
  1338. elseif dupType == DuplicateType.BLOODY_CASTLE then
  1339. -- 血色城堡
  1340. BloodyCastle.AfterPlayerBloodyCaster(actor, mapId, state, nextStateStartTime, configId)
  1341. elseif dupType == DuplicateType.BRAVE_TEST then
  1342. -- 勇者试炼
  1343. BraveTest.BraveTestEnter(actor, mapId, state, nextStateStartTime, configId)
  1344. elseif dupType == DuplicateType.RED_FORTRESS then
  1345. -- 赤色要塞
  1346. -- 如果是变身状态,取消变身
  1347. local notExpired = TransferCard.CheckTransfermationExpired(actor, false)
  1348. if notExpired then
  1349. TransferCard.ReqCancelTransfermation(actor)
  1350. end
  1351. RedFortress.AfterRedFortressEnter(actor, mapId, state, nextStateStartTime, configId)
  1352. elseif dupType == DuplicateType.WAR_ALLIANCE then
  1353. -- 战盟boss
  1354. WarAlliance.AfterEnterWarAlliance(actor, mapId, state, nextStateStartTime, configId)
  1355. elseif dupType == DuplicateType.PRIVILEGE_BOSS then
  1356. -- 特权BOSS
  1357. PrivilegeBoss.afterEnterPrivilegeBoss(actor, mapId, state, nextStateStartTime, configId)
  1358. elseif dupType == DuplicateType.WOLF_SOUL then
  1359. -- 狼魂要塞
  1360. WolfSoul.AfterEnterWolfSoul(actor, mapId, state, nextStateStartTime, configId)
  1361. elseif dupType == DuplicateType.COMBO_TEST then
  1362. -- 连击试炼
  1363. ComboTest.AfterEnterComboTest(actor, mapId, state, nextStateStartTime, configId)
  1364. elseif dupType == DuplicateType.BIG_SECRET_REALM then
  1365. -- 大秘境副本
  1366. BigSecretRealm.AfterEnterBigSecretRealm(actor, mapId, state, nextStateStartTime, configId)
  1367. elseif dupType == DuplicateType.ROLAND_SEIGE then
  1368. -- 罗兰峡谷攻城战
  1369. RolandSeige.AfterEnterRoland(actor, mapId, state, nextStateStartTime, configId)
  1370. elseif dupType == DuplicateType.KUN_DUN then
  1371. -- 昆顿
  1372. KunDun.AfterEnterKunDun(actor, mapId, state, nextStateStartTime, configId)
  1373. elseif dupType == DuplicateType.ITEM_BOSS then
  1374. -- 道具boss
  1375. ItemBoss.AfterEnterItemBoss(actor, mapId, state, nextStateStartTime, configId)
  1376. elseif dupType == DuplicateType.WORLD_BOSS then
  1377. WorldBoss.afterenterduplicate(actor, mapId, dupType, state, nextStateStartTime, configId)
  1378. end
  1379. -- 进入副本后 刷新战盟任务
  1380. UnionTask.enterDuplicate(actor, configId)
  1381. end
  1382. -- @description 退出副本事件
  1383. -- @param 玩家对象;地图唯一id;副本类型;副本阶段(1-准备 2-战斗 3-结算);下一阶段开始时间戳;配置id(cfg_rep的id)
  1384. -- @return
  1385. function afterquitduplicate(actor, mapId, dupType, state, nextStateStartTime, configId)
  1386. sendluamsg(actor, LuaMessageIdToClient.RES_QUIT_DUPLICATE, configId)
  1387. if dupType == DuplicateType.RED_FORTRESS then
  1388. -- 赤色要塞
  1389. RedFortress.AfterRedFortressQuit(actor, mapId, state, nextStateStartTime, configId)
  1390. elseif dupType == DuplicateType.BRAVE_TEST then
  1391. -- 勇者试炼
  1392. BraveTest.onQuitDup(actor, configId)
  1393. elseif dupType == DuplicateType.ROLAND_SEIGE then
  1394. -- 罗兰攻城战
  1395. RolandSeige.OnQuitDup(actor, mapId, state, nextStateStartTime, configId)
  1396. elseif dupType == DuplicateType.WORLD_BOSS then
  1397. WorldBoss.afterquitduplicate(actor, mapId, dupType, state, nextStateStartTime, configId)
  1398. end
  1399. end
  1400. -- @description 玩家进入地图事件(所有地图,包括普通地图)
  1401. -- @param 玩家对象;上一个地图配置id;当前地图配置id
  1402. -- @return
  1403. function entermap(actor, lastMapCfgId, mapCfgId)
  1404. gameDebug.debug(Player.enterMap, actor)
  1405. gameDebug.debug(RankScript.updateOnline, actor, true)
  1406. gameDebug.debug(TaskHandler.TriggerTaskGoal, actor, TaskTargetType.ENTER_MAP_LINE)
  1407. gameDebug.debug(DevilSquare.EnterAllMapDS, actor, lastMapCfgId, mapCfgId)
  1408. gameDebug.debug(BloodyCastle.EnterAllMapDS, actor, lastMapCfgId, mapCfgId)
  1409. gameDebug.debug(SecretRealm.afterEnterSecretRealm, actor, lastMapCfgId, mapCfgId)
  1410. gameDebug.debug(RedFortress.EnterAllMap, actor, lastMapCfgId, mapCfgId)
  1411. gameDebug.debug(CrossMap.CheckEnterCrossMap, actor, lastMapCfgId, mapCfgId)
  1412. gameDebug.debug(TaskHandler.sendTaskState, actor)
  1413. gameDebug.debug(RoleAttr.enterMap, actor, mapCfgId)
  1414. gameDebug.debug(onHook.enterMap, actor)
  1415. end
  1416. function leavemap(actor, reason)
  1417. gameDebug.debug(HpMpRecover.record, actor)
  1418. end
  1419. -- @description 地图怪物死亡事件,此时怪物还未从副本中移除
  1420. -- @param 系统对象;地图唯一id;击杀者对象;死亡怪物的配置id
  1421. -- @return
  1422. function mapmonsterdie(system, mapId, killer, monCfgId, monActor)
  1423. -- 昆顿怪物死亡
  1424. KunDun.MonsterDie(mapId, killer, monCfgId, monActor)
  1425. -- 减少秘境挑战次数
  1426. SecretRealm.reduceCount(killer, monCfgId, mapId)
  1427. if table.getKey(CountDownMonsterIds, monCfgId) then
  1428. setsysvar(monActor, "G$_monsterDieTime" .. tostring(monCfgId), os.time())
  1429. end
  1430. local mapInfo = getmapinfobyid(mapId)
  1431. if mapInfo["isdup"] == true then
  1432. -- 是副本
  1433. local dupInfo = getduplicate(mapId)
  1434. local dupType = dupInfo["type"]
  1435. if dupType == DuplicateType.DEVIL_SQUARE then
  1436. elseif dupType == DuplicateType.BLOODY_CASTLE then
  1437. BloodyCastle.BloodyCastleOnMonsterDie(mapId, killer, monCfgId)
  1438. elseif dupType == DuplicateType.BRAVE_TEST then
  1439. BraveTest.BraveTestMonsterDie(mapId, killer, monCfgId, monActor)
  1440. elseif dupType == DuplicateType.WAR_ALLIANCE then
  1441. callonserial(killer, "waralliancemonsterdie", mapId, killer, monCfgId)
  1442. elseif dupType == DuplicateType.PRIVILEGE_BOSS then
  1443. PrivilegeBoss.PrivilegeBossMonsterDie(mapId, killer, monCfgId)
  1444. elseif dupType == DuplicateType.COMBO_TEST then
  1445. ComboTest.ComboTestMonsterDie(mapId, killer, monCfgId, monActor)
  1446. elseif dupType == DuplicateType.BIG_SECRET_REALM then
  1447. BigSecretRealm.BigSecretRealmMonsterDie(mapId, killer, monCfgId, monActor)
  1448. elseif dupType == DuplicateType.WORLD_BOSS then
  1449. WorldBoss.OnMonsterDie(mapId, killer, monCfgId, monActor)
  1450. end
  1451. end
  1452. end
  1453. function waralliancemonsterdie(killer, mapId, acotr, monCfgId)
  1454. WarAlliance.OnKillWarAllianceMonster(mapId, acotr, monCfgId)
  1455. end
  1456. -- @description 地图怪物死亡事件,此时怪物已经从副本中移除
  1457. -- @param 系统对象;地图唯一id;击杀者对象;死亡怪物的配置id
  1458. -- @return
  1459. function mapmonsterremove(system, mapId, killer, monCfgId)
  1460. local mapInfo = getmapinfobyid(mapId)
  1461. if mapInfo["isdup"] == true then
  1462. -- 是副本
  1463. local dupInfo = getduplicate(mapId)
  1464. local dupType = dupInfo["type"]
  1465. if dupType == DuplicateType.RED_FORTRESS then
  1466. RedFortress.OnMonsterDie(mapId, killer)
  1467. elseif dupType == DuplicateType.WOLF_SOUL then
  1468. WolfSoul.MapMonsterRemove(mapId, killer, monCfgId)
  1469. elseif dupType == DuplicateType.ROLAND_SEIGE then
  1470. RolandSeige.MapMonsterRemove(mapId, killer, monCfgId)
  1471. end
  1472. end
  1473. end
  1474. -- @description 用药之后触发自动买药
  1475. -- @param 玩家对象
  1476. -- @return
  1477. function autobuydrug(actor)
  1478. -- 触发自动买药
  1479. AutoBuyPotionScript.autoBuyPotions(actor)
  1480. end
  1481. ---跑马灯事件
  1482. ---@param actor any 玩家对象
  1483. ---@param stringId number cfg_string表配置id
  1484. ---@param text string 跑马灯消息文本
  1485. function horselampevent(actor, stringId, ...)
  1486. noticeTip.noticeinfo(actor, stringId, ...)
  1487. end
  1488. -- 物品拾取前触发
  1489. -- function pickupitemfrontex(actor, items)
  1490. -- local pickItems = getplaydef(actor, "@" .. "HOOK_PICK_ITEMS") or {}
  1491. -- if pickItems[items.objectid] then
  1492. -- return nil
  1493. -- end
  1494. -- return {allow=false}
  1495. -- end
  1496. -- function pickupitemfrontex(actor, items)
  1497. -- local allow = MonAtk.pickUpItem(actor, items)
  1498. -- if allow ~= nil then
  1499. -- return allow
  1500. -- end
  1501. -- local allow = Hook.pickUpItem(actor, items)
  1502. -- if allow ~= nil then
  1503. -- return allow
  1504. -- end
  1505. -- end
  1506. function pickupitembefore(actor, items)
  1507. -- 做每天获取金币总量限制
  1508. -- local allow = Player.pickUpItem(actor, items)
  1509. -- if allow ~= nil then
  1510. -- return allow
  1511. -- end
  1512. local allow = Hook.pickUpItem(actor, items)
  1513. if allow ~= nil then
  1514. return Platform.resetPick(actor, items, allow)
  1515. end
  1516. local allow = MonAtk.pickUpItem(actor, items)
  1517. if allow ~= nil then
  1518. return Platform.resetPick(actor, items, allow)
  1519. end
  1520. local allow = Platform.pickUpItem(actor, items)
  1521. if allow ~= nil then
  1522. return allow
  1523. end
  1524. end
  1525. -- 玩家拾取物品后
  1526. function pickupitem(actor, cfgId)
  1527. MonAtk.checkPickItemBroad(actor, cfgId)
  1528. end
  1529. -- 怪物死亡掉落物品
  1530. function monsterdiedropitem(actor, data)
  1531. MonAtk.monsterDieDrop(actor, data)
  1532. MonAtk.monsterDieDropTips(actor, data)
  1533. end
  1534. -- @description 背包变化事件
  1535. -- @param 玩家对象 索引 放入或 取出
  1536. -- @return
  1537. function bagchange(actor, index, state)
  1538. -- 取出物品触发自动买药
  1539. if state == 0 then
  1540. AutoBuyPotionScript.autoBuyPotions(actor)
  1541. end
  1542. end
  1543. -- 玩家死亡
  1544. function playdie(actor, dieInfo, killInfo)
  1545. Pet.ClearPet(actor)
  1546. BraveTest.playerDie(actor)
  1547. ComboTest.playerDie(actor)
  1548. RedFortress.PlayerDie(actor)
  1549. Mail.playerDie(actor, dieInfo, killInfo)
  1550. SecretRealm.playerDie(actor)
  1551. pk.PlayerDie(actor, dieInfo, killInfo)
  1552. end
  1553. ---装备回收事件
  1554. function recovery(actor, data, reward)
  1555. ItemRecycling.recyclingRateReward(actor, reward)
  1556. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.RECOVERY, data)
  1557. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.RECOVERY_GET_APPOINT_ITEM, reward)
  1558. end
  1559. -- 获取经验事件
  1560. function getexp(actor, exp, fromType, expAddRate)
  1561. bubblePointGetExp(actor, exp, fromType, expAddRate)
  1562. end
  1563. function printTable(t, indent)
  1564. indent = indent or 0
  1565. local spaces = string.rep(" ", indent)
  1566. for k, v in pairs(t) do
  1567. if type(v) == "table" then
  1568. print(spaces .. tostring(k) .. ":")
  1569. printTable(v, indent + 4)
  1570. else
  1571. print(spaces .. tostring(k) .. " = " .. tostring(v))
  1572. end
  1573. end
  1574. end
  1575. ---攻击触发,攻击对象掉血之后触发
  1576. function attack(actor, fightData)
  1577. -- messagebox(actor,"玩家攻击")
  1578. -- local caster = fightData["caster"]
  1579. -- local target = fightData["target"]
  1580. -- local mapId = fightData["mapid"]
  1581. -- local skillLevel = fightData["skilllevel"]
  1582. -- local casterType = fightData["castertype"]
  1583. -- local targetType = fightData["targettype"]
  1584. local targetHurt = fightData["targethurt"]
  1585. -- for key, paramMap in pairs(fightData) do
  1586. -- info("fightData key = " .. key )
  1587. -- if key ~= "caster" and key ~= "target" then
  1588. -- info("fightData value = " .. paramMap )
  1589. -- end
  1590. -- end
  1591. -- local caster=fightData["caster"]
  1592. -- printTable(fightData)
  1593. -- local mapCfgId = fightData["mapcfgid"]
  1594. -- local targetCfgId = fightData["targetcfgid"]
  1595. -- Buffer.OnAttack(actor, fightData["target"])
  1596. EquipGem.setSpeedBonus(actor)
  1597. -- EquipGuard.guardHpChange(actor, targetHurt)
  1598. if fightData.castertype == MapObjectType.PLAYER then
  1599. KunDun.Attack(actor, fightData)
  1600. PlayerFight.AttackTrigger(actor, fightData)
  1601. -- 增加大天使装备经验
  1602. AngelMajorEquipment.attack(actor, fightData)
  1603. end
  1604. RolandSeige.Attack(actor, fightData)
  1605. -- EquipDurability.attack(actor, fightData)
  1606. EquipDurability.attackCareer3(actor)
  1607. WorldBoss.Attack(actor, fightData)
  1608. end
  1609. -- @description 玩家复活事件
  1610. -- @param 玩家对象
  1611. -- @return
  1612. function revival(actor, type)
  1613. RedFortress.PlayerRelive(actor)
  1614. PrivilegeBoss.playerRelive(actor)
  1615. WarAlliance.playerRelive(actor, type)
  1616. RolandSeige.PlayerRelive(actor)
  1617. AGAndSD.playerRelive(actor)
  1618. addbuff(actor, 100500401, 1)
  1619. end
  1620. -- @description 不管大退,小退还是断开连接都会执行
  1621. -- @param 玩家对象
  1622. -- @return
  1623. function quit(actor)
  1624. DuplicateCommon.OfflineQuitGame(actor)
  1625. -- Union.sendLeaderOnlineStateMsg(play)
  1626. Chat.onQuitGame(actor)
  1627. end
  1628. -- 创建角色事件
  1629. function creatrole(actor)
  1630. RankScript.addNewRole(actor)
  1631. end
  1632. -- 玩家加入战盟前
  1633. function guildaddmember(actor)
  1634. -- UnionArmbands.onEnterUnion(actor)
  1635. end
  1636. function guildaddmemberafter(actor, union_id)
  1637. UnionArmbands.onEnterUnion(actor)
  1638. end
  1639. -- 玩家退出战盟前
  1640. function guilddelmemberbefore(actor)
  1641. UnionArmbands.onQuitUnion(actor)
  1642. UnionChangeLeader.clearRunForLeaderMember(actor)
  1643. end
  1644. ---通知刷新外置任务目标
  1645. function updateexternaltaskgoal(actor, taskModule, taskId, type, goalId, goalCount, realParam)
  1646. -- jprint("updateexternaltaskgoal", type, goalId, goalCount, realParam)
  1647. local count = TaskGoal.FlushTaskCount(actor, type, goalId, goalCount, realParam)
  1648. if count ~= goalCount then
  1649. onlyupdatetaskgoal(actor, taskModule, taskId, goalId, count)
  1650. end
  1651. end
  1652. -- 交易行预购成功
  1653. function preoredrsuccess(actor, ownId, itemId)
  1654. Trade.changeItemInfo(actor, ownId, itemId)
  1655. end
  1656. -- 充值事件
  1657. function recharge(actor, rechargeData)
  1658. Recharge.OnRecharge(actor, rechargeData)
  1659. end
  1660. -- 1秒心跳
  1661. function rolesecondheart(actor)
  1662. -- 秒级心跳尽量不要加东西
  1663. PassiveSkill.RoleSecondHeart(actor)
  1664. AGAndSD.onRoleseCond(actor)
  1665. end
  1666. -- 3秒心跳
  1667. function role3secondheart(actor)
  1668. TransferCard.CheckTransfermationExpired(actor, true)
  1669. -- 玩家泡点
  1670. SecondHeartBP(actor)
  1671. -- 安全区buff
  1672. Buffer.safetyAreaBuff(actor)
  1673. -- 经验药水过期检测,防止角色退出,时间间隔函数失效
  1674. ExpBoost.expBoostExpireCheck(actor)
  1675. BiHu.onHourCheck(actor)
  1676. end
  1677. -- 5秒心跳
  1678. function role5secondheart(actor)
  1679. -- 角色PK值处理
  1680. pk.SecondHeartPkValue(actor)
  1681. -- 玩家称号过期检查
  1682. EquipAndAppear.checktitleovertime(actor)
  1683. -- 玩家变身戒指过期检查
  1684. EquipAndAppear.checkringovertime(actor)
  1685. end
  1686. -- 10秒心跳
  1687. function role10secondheart(actor)
  1688. -- 检测玩家特权卡过期
  1689. PrivilegeCardScript.checkPrivilegeExpire(actor)
  1690. -- 检测玩家月卡过期
  1691. MonthCard.checkmonthcardtime(actor)
  1692. -- 记录玩家离线挂机的最后时间
  1693. onHook.recordLastTime(actor)
  1694. TimeLimitGift.checkTimeLimitGiftTime(actor)
  1695. end
  1696. -- 分钟心跳
  1697. function roleminuteheart(actor)
  1698. local now = getbaseinfo("nowsec")
  1699. local lastTime = now - 60
  1700. if not TimeUtil.isSameDay(now, lastTime) then
  1701. MonthCard.receivemonthcardthreetime(actor)
  1702. end
  1703. Mount.checkMountTime(actor)
  1704. -- 装备耐久改为60秒扣一次
  1705. EquipDurability.attackCost(actor)
  1706. EquipDurability.underattackCost(actor)
  1707. Illustrate.updateattrs(actor)
  1708. end
  1709. -- 判断当前时间是否是每天的凌晨 主要用于每天凌晨的服务器数据刷新
  1710. local function __isDayZero(seconds)
  1711. local now = TimeUtil.timeToDate(seconds)
  1712. -- 每小时调用一次,所有只需要判定小时就行不需要分钟
  1713. return now.hour == 0
  1714. end
  1715. -- 小时心跳
  1716. function rolehourheart(actor)
  1717. DailyLotteryDraw.flushDailyLotteryDraw(actor)
  1718. local seconds = getbaseinfo("nowsec")
  1719. if __isDayZero(seconds) then
  1720. -- 每天凌晨事件
  1721. MonthCard.limitCount(actor, MonthCard.monthcardtype.DAY)
  1722. ZeroEventListerTable:triggerEvent("0", actor)
  1723. SevenLogin.midNightUpdate(actor)
  1724. AngelWeapon.updateTaskInfo(actor)
  1725. RechargeSevenReceive.midNightUpdate(actor)
  1726. BenefitActivity.midNightUpdate(actor)
  1727. Player.ResetGoldCount(actor)
  1728. MonsterScript.InitDropRates()
  1729. ActMonthlyGrow.midNightUpdate(actor)
  1730. end
  1731. if TimeUtil.isMondayZero(seconds) then
  1732. -- 每周一凌晨事件
  1733. MonthCard.limitCount(actor, MonthCard.monthcardtype.WEEK)
  1734. end
  1735. if TimeUtil.isMonthZero(seconds) then
  1736. -- 每月1号凌晨事件
  1737. MonthCard.limitCount(actor, MonthCard.monthcardtype.MONTH)
  1738. end
  1739. -- 连击试炼增加副本次数
  1740. ComboTest.roleHourHeart(actor)
  1741. end
  1742. --- 活动次数重置后触发
  1743. ---@param actor table 玩家对象
  1744. ---@param activityId number 活动ID
  1745. ---@param count number 重置后次数
  1746. function afteractivitycountreset(actor, activityId, count)
  1747. VipPrivilege.entryCountHandler(actor, activityId)
  1748. end
  1749. -- @description 脚本计算角色最终属性
  1750. -- @param 玩家对象
  1751. -- @return
  1752. function calcplayfinalattr(actor)
  1753. return RoleAttr.CalcPlayFinalAttr(actor)
  1754. end
  1755. -- @description 内置传送拦截事件,做自定义传送
  1756. -- @param 玩家对象 当前x坐标 当前y坐标 原目标x坐标 原目标y坐标
  1757. -- @return 拦截结果 {result= true,reason = "ttt", ignoreNotice = false}
  1758. -- true标识拦截,执行脚本内逻辑,放弃原传送,false 标识放行,执行原传送; reason为拦截原因说明; ignoreNotice为是否忽略向客户端发送拦截提示,默认发送
  1759. function customtotransmit(actor, targetMap, targetLine, currX, currY, x, y, fromMapMove)
  1760. -- info("MS customtotransmit-> ", actor, targetMap, targetLine, currX, currY, x, y, fromMapMove)
  1761. local checkResult, tip = LineManager.CheckCanEnterLineMap(actor, targetMap, targetLine)
  1762. -- info(string.format("MS customtotransmit-> checkResult: %s", checkResult))
  1763. if checkResult ~= nil and checkResult == false then
  1764. -- tipinfo(actor, tip)
  1765. return {result = true, reason = tip}
  1766. end
  1767. return CustomTransmit.CustomToTransmit(actor, targetMap, targetLine, currX, currY, x, y, fromMapMove)
  1768. end
  1769. -- 次事件触发的时候玩家还未进入地图,所以使用actor作为参数的命令还无法使用
  1770. function enterscene(actor, srcMapId, targetMapId)
  1771. local srcMapCfgId, _ = gamemap.parseMapKey(srcMapId)
  1772. local targetMapCfgId, _ = gamemap.parseMapKey(targetMapId)
  1773. -- jprint("玩家进入场景", actor, srcMapCfgId, targetMapCfgId)
  1774. local srcServerType = ConfigDataManager.getTableValue("cfg_map_info", "servertype", "id", srcMapCfgId)
  1775. local targetServerType = ConfigDataManager.getTableValue("cfg_map_info", "servertype", "id", targetMapCfgId)
  1776. -- 从跨服进入本服的时候执行这个
  1777. if srcServerType ~= nil and targetServerType ~= nil and srcServerType ~= targetServerType then
  1778. if tonumber(targetServerType) == 1 then
  1779. local x, y = CustomTransmit.GetPointFromMapMove(targetMapCfgId)
  1780. return {
  1781. x = x,
  1782. y = y
  1783. }
  1784. end
  1785. end
  1786. return nil
  1787. end
  1788. --- 怪物死亡事件(掉落之前触发计算掉落道具)
  1789. ---@param monsterActor table 怪物对象
  1790. ---@param dieParam table 怪物死亡参数
  1791. function monsterdiep(monsterActor, monsterCfgId, killerId, ownerId, maxHurtRid, mapId, mongenCfgId, dieParam)
  1792. -- jprint("怪物死亡", monsterActor, dieParam)
  1793. -- 怪物死亡触发活动、任务等功能数据更新
  1794. MonsterScript.MonsterDieTrigger(monsterActor, dieParam)
  1795. -- 计算怪物掉落道具
  1796. local dropResult = MonsterScript.MonsterDieCulDrop(monsterActor, dieParam)
  1797. return dropResult
  1798. end
  1799. -- 宠物召唤后触发
  1800. function callpetafter(actor, petCfgId, petId)
  1801. Pet.onCall(actor, petCfgId, petId)
  1802. end
  1803. --- 传送后事件
  1804. function aftertransmit(actor)
  1805. onHook.afterTransmit(actor)
  1806. end
  1807. ---物品进背包后触发
  1808. ---@param actor 玩家对象
  1809. ---@param itemId 道具唯一id
  1810. ---@param itemCfgId 道具配置id
  1811. ---@param index 背包索引
  1812. function addbag(actor, itemId, itemCfgId, index)
  1813. EquipAndAppear.ItemAdd(actor, itemId, itemCfgId)
  1814. OpenServerAct.UpdateEquipFirstDropRank(actor, tonumber(itemCfgId))
  1815. -- 大天使装备初始化成长属性
  1816. AngelMajorEquipment.initAngelEquipmentAttr(actor, itemId, itemCfgId)
  1817. -- 大秘境钥匙等级初始化
  1818. BigSecretRealm.initKeyLevel(actor, itemCfgId)
  1819. -- 大天使圣杯初始化
  1820. AngelMajorGrail.initGrailEntry(actor, itemId, itemCfgId)
  1821. EquipRandom.newItmToBag(actor, itemId, itemCfgId)
  1822. end
  1823. --- 战盟创建后触发,初始化战盟数据
  1824. function loadguild(actor)
  1825. UnionTask.onUnionCreate(actor)
  1826. end
  1827. --- 战盟解散后触发,清理战盟数据
  1828. function guildclosebefore(actor)
  1829. UnionTask.onUnionClose(actor)
  1830. end
  1831. function createmap(sys, uniqueMapId)
  1832. local mapCfgId, mapLine = gamemap.parseMapKey(uniqueMapId)
  1833. -- jprint("地图被创建", uniqueMapId, mapCfgId, mapLine)
  1834. GameMapHeart.AddMap(uniqueMapId)
  1835. end
  1836. function destroymap(sys, uniqueMapId)
  1837. local mapCfgId, mapLine = gamemap.parseMapKey(uniqueMapId)
  1838. -- jprint("地图被销毁", uniqueMapId, mapCfgId, mapLine)
  1839. GameMapHeart.RemoveMap(uniqueMapId)
  1840. end
  1841. function attrupdate(actor, mapobjecttype)
  1842. if mapobjecttype == nil then
  1843. mapobjecttype = getbaseinfo(actor, "mapobjecttype")
  1844. end
  1845. if mapobjecttype == MapObjectType.PLAYER then
  1846. local attackSpeedBonus = getattrinfo(actor, "attackSpeedBonus")
  1847. local attackSpeedBonusValue = attackSpeedBonus * 10000
  1848. attackSpeedBonusValue = 10000 + attackSpeedBonusValue
  1849. updateparam(actor, 4, attackSpeedBonusValue)
  1850. elseif mapobjecttype == MapObjectType.MONSTER or mapobjecttype == MapObjectType.PET then
  1851. local monsterMoveSpeed = getattrinfo(actor, "monsterMoveSpeed")
  1852. if monsterMoveSpeed ~= 0 then
  1853. local monInfo = getmonsterinfo(actor)
  1854. if monInfo == nil then
  1855. return
  1856. end
  1857. local monsterId = monInfo["cfgid"]
  1858. local aiId = ConfigDataManager.getTableValue("cfg_monster", "ai", "id", monsterId)
  1859. local strWalkTime = ConfigDataManager.getTableValue("cfg_monster_ai", "walktime", "id", aiId)
  1860. if not string.isNullOrEmpty(strWalkTime) then
  1861. local walkTime = tonumber(strWalkTime)
  1862. -- monsterMoveSpeed 值是负数的
  1863. local newWalkTime = walkTime - walkTime * monsterMoveSpeed
  1864. -- jprint("monster attrupdate", monsterId, aiId, walkTime, newWalkTime)
  1865. setmonsterwalktime(actor, newWalkTime)
  1866. end
  1867. end
  1868. end
  1869. end
  1870. -- 角色删除后触发
  1871. function afterdeleterole(actor)
  1872. RankScript.removeRole(actor)
  1873. UnionChangeLeader.clearRunForLeaderMember(actor)
  1874. end
  1875. -- 地图心跳事件,lua内部触发
  1876. function lua_mapsecondheart(uniMapId, mapId)
  1877. end
  1878. -- 地图3秒心跳事件,lua内部触发
  1879. function lua_map3secondheart(uniMapId, mapId)
  1880. SecretRealm.UpdateHurtTopRank(uniMapId, mapId)
  1881. end
  1882. -- 地图5秒心跳事件,lua内部触发
  1883. function lua_map5secondheart(uniMapId, mapId)
  1884. end
  1885. --- 离线挂机战斗获得经验事件
  1886. ---@param actor 玩家对象
  1887. ---@param exp 经验值
  1888. function getofflineexp(actor, exp)
  1889. onHook.saveOfflineFightExp(actor, exp)
  1890. end
  1891. -- 获取摆摊位置
  1892. function stallmapinfo(actor, stallPosition)
  1893. Stall.sendStallPosition(actor, stallPosition)
  1894. end
  1895. function buffeffect(targetActor, buffCfgId, casterActor, hurtTotal, targetTotal, layers)
  1896. Buffer.buffeffect(targetActor, buffCfgId, layers, casterActor)
  1897. PassiveSkill.BuffEffect(targetActor, casterActor, buffCfgId)
  1898. end
  1899. function bufflose(actor, buffCfgId)
  1900. Buffer.bufflose(actor, buffCfgId)
  1901. end
  1902. --- 商城购买道具后触发
  1903. function buymallgoodsafter(actor, is_success, goods_id, count)
  1904. local SUCCESS_STATE = 1
  1905. -- 触发任务刷新
  1906. if tonumber(is_success) == SUCCESS_STATE then
  1907. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.MALL_BUY_GOODS, goods_id)
  1908. local configShop = ConfigDataManager.getById("cfg_shopMall", goods_id)
  1909. if configShop == nil then
  1910. return
  1911. end
  1912. if configShop.countkey == nil or configShop.countkey == "" or tonumber(configShop.countkey) <= 0 then
  1913. return
  1914. end
  1915. -- info("商城购买道具触发计数:id=" .. goods_id, "count=" .. count)
  1916. CountManager.count(actor, configShop.countkey, count)
  1917. end
  1918. end
  1919. --- 购买NPC商城道具后触发 is_success 是否购买成功,1:成功,0:失败 item_id 和 item_count在购买成功后才会返回
  1920. function buynpcshopgoodsafter(actor, is_success, item_id, item_count)
  1921. if tonumber(is_success) == 1 then
  1922. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.NPC_MALL_BUY_GOODS, item_id)
  1923. end
  1924. end
  1925. --- 分配属性点后触发
  1926. function afterdeployattrpoint(actor)
  1927. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.DEPLOY_ATTR_POINT, true)
  1928. end
  1929. -- 进入地图后初始化怪物
  1930. function initmonster(monster, monsterCfgId)
  1931. MonsterAttribute.Initmonster(monster, monsterCfgId)
  1932. end
  1933. function showgetrewardpanel(actor, items)
  1934. sendluamsg(actor, LuaMessageIdToClient.COMMON_REWARD_PANEL, items)
  1935. end
  1936. -- function setcombovaluebefore(actor, skillCfgId, skillLevel, skill)
  1937. -- return Skill.calculationComboValue(actor, skillCfgId, skillLevel, skill)
  1938. -- end
  1939. -- 内置任务状态改变
  1940. function taskchange(actor, taskId, state, data)
  1941. TaskHandler.onTaskChange(actor, taskId, state)
  1942. ActFirstRecharge.onTaskChange(actor, taskId, state)
  1943. end
  1944. --- 销毁物品触发
  1945. ---@param actor table 玩家对象
  1946. ---@param cfgId number 道具配置id
  1947. ---@param itemId number 道具唯一id
  1948. function destroyitem(actor, cfgId, itemId)
  1949. AngelMajorEquipment.destroyAngelEquip(actor, cfgId, itemId)
  1950. AngelMajorGrail.destroyAngelGrail(actor, cfgId, itemId)
  1951. end
  1952. --- 怪物复活
  1953. function monsterrelive(monster, monsterCfgId)
  1954. SanctuaryBoss.monsterRelive(monster)
  1955. MonsterAttribute.Initmonster(monster, monsterCfgId)
  1956. this.initmonsterTip(monster, monsterCfgId)
  1957. end
  1958. --- 自动回收道具
  1959. function autorecoverybefore(actor)
  1960. return ItemRecycling.autoRecycling(actor)
  1961. end
  1962. -- 玩家设置改变
  1963. function settingchange(actor, type, oldValue, value)
  1964. gameDebug.debug(KunDun.FightModelChange, actor, type, value)
  1965. RolandSeige.RolandSettingChange(actor, tonumber(type), tonumber(value))
  1966. end
  1967. --- 获取跨服玩家变量异步回调
  1968. ---@param actor table 玩家对象
  1969. ---@param varName string 变量名
  1970. ---@param varValue string 变量值
  1971. function getplaydefasyncres(actor, varName, varValue, params)
  1972. -- jprint("获取其他服玩家数据", actor, varName, varValue, params)
  1973. if string.equalsIgnoreCase(varName, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA) then
  1974. AngelMajorEquipment.sendPlayerAngelEquipInfo(actor, varValue, params)
  1975. end
  1976. end
  1977. --- 世界聊天成功触发
  1978. function worldchatsuccess(actor)
  1979. -- jprint("世界聊天发送成功")
  1980. sendluamsg(actor, LuaMessageIdToClient.RES_WORLD_CHAT_SUCCESS, true)
  1981. end
  1982. --- 外置聊天频道触发事件
  1983. function outversionchatevent(actor, param)
  1984. Chat.OutVersionChant(actor, param)
  1985. end
  1986. --- 技能升级事件
  1987. function levelupskillevent(actor, skillInfo)
  1988. info(skillInfo)
  1989. Skill.levelUp(actor, skillInfo)
  1990. end
  1991. function clicknpc(actor, npcid)
  1992. GameEvent.push(EventCfg.onClicknpc, actor, npcid)
  1993. end
  1994. function playerexitview(actor, playerid)
  1995. local playerActor = getactor(playerid)
  1996. local mapobjecttype = getbaseinfo(playerActor, "mapobjecttype")
  1997. if mapobjecttype ~= MapObjectType.PLAYER then
  1998. return
  1999. end
  2000. local ownerId = getbaseinfo(actor, "id")
  2001. sendluamsg(
  2002. actor,
  2003. 10000500,
  2004. {
  2005. playerid = playerid
  2006. }
  2007. )
  2008. sendluamsg(
  2009. playerActor,
  2010. 10000500,
  2011. {
  2012. playerid = ownerId
  2013. }
  2014. )
  2015. end
  2016. -- function beforetakeoncheckequip(actor,bagIndex,equipIndex)
  2017. -- local itemInfo = getbagiteminfo(actor,bagIndex,0)
  2018. -- local itemId = itemInfo.id
  2019. -- messagebox(actor,"itemId="..itemId)
  2020. -- messagebox(actor,"bagIndex="..bagIndex)
  2021. -- if not Equip_QiangHua.checkTakeOnNeed(actor,itemId) then
  2022. -- messagebox(actor,"属性不足,无法穿戴!")
  2023. -- return true
  2024. -- end
  2025. -- return false
  2026. -- -- return true
  2027. -- end
  2028. function filtertakeonequip(actor, msgData)
  2029. local bagIndex = msgData.bagindex
  2030. local itemInfo = getbagiteminfo(actor, bagIndex, 0)
  2031. if itemInfo == nil then
  2032. return
  2033. end
  2034. local itemId = itemInfo.id
  2035. if not Equip_QiangHua.checkTakeOnNeed(actor, itemId) then
  2036. messagebox(actor, "属性不足穿戴失败")
  2037. return false
  2038. end
  2039. local pos = msgData.pos
  2040. local career = getbaseinfo(actor, "getbasecareer")
  2041. local isPart = ConfigDataManager.getTableValue("cfg_character_create", "isPart", "id", career)
  2042. -- 副手装备
  2043. if pos == 2 and (isPart and isPart ~= "") then
  2044. local equipField = ConfigDataManager.getTableValue("cfg_item", "field", "id", itemInfo.cfgid)
  2045. local equipPart = ConfigDataManager.getTableValue("cfg_model_charactor", "part", "id", equipField)
  2046. -- local config = ConfigDataManager.getById("cfg_item", itemId)
  2047. -- local config = ConfigDataManager.getById("cfg_model_charactor", itemId)
  2048. -- if isPart ~= tonumber(config['subtype']) then
  2049. if tonumber(isPart) ~= tonumber(equipPart) then
  2050. messagebox(actor, "条件不符,穿戴失败")
  2051. return false
  2052. end
  2053. end
  2054. return true
  2055. end
  2056. function this.initmonsterTip(actor, monsterId)
  2057. local bossName = ConfigDataManager.getTableValue("cfg_monster", "name", "id", monsterId)
  2058. local bossType = ConfigDataManager.getTableValue("cfg_monster", "type", "id", monsterId)
  2059. local mapId = getbaseinfo(actor, "mapid")
  2060. local mapName = ConfigDataManager.getTableValue("cfg_map_info", "mapname", "id", mapId)
  2061. if tonumber(bossType) == 3 then -- 只有BOSS才通知
  2062. local isworldboss = false
  2063. local unimapid = getbaseinfo(actor, "unimapid")
  2064. local dupInfo = getduplicate(unimapid)
  2065. if dupInfo ~= nil then
  2066. local dupType = dupInfo["type"]
  2067. if dupType == DuplicateType.WORLD_BOSS then
  2068. isworldboss = true
  2069. end
  2070. end
  2071. if isworldboss then
  2072. noticeTip.noticeinfo(actor, 35011, bossName, mapName)
  2073. else
  2074. noticeTip.noticeinfo(actor, StringIdConst.TEXT35005, bossName, mapName)
  2075. end
  2076. end
  2077. end
  2078. -- @description 货币变化事件
  2079. -- 参数说明:actor 玩家对象;cfgId 物品配置id 原来数量 现在数量
  2080. function moneychangex(actor, cfgId, oldCount, newCount)
  2081. -- info("moneychangex-> ", actor, cfgId, oldCount, newCount)
  2082. callonserial(actor, "_savemoneydata", cfgId, newCount)
  2083. end
  2084. -- 保存货币数据
  2085. function _savemoneydata(actor, cfgId, newCount)
  2086. -- info("savemoneydata-> ", actor, cfgId, newCount)
  2087. local uid = getbaseinfo(actor, "uid")
  2088. local mData = getsysvar(actor, "R$MoneyData_" .. uid) or {}
  2089. if mData[cfgId] ~= nil and newCount then
  2090. mData[cfgId] = newCount
  2091. setsysvar(actor, "R$MoneyData_" .. uid, mData)
  2092. end
  2093. end
  2094. -- function t1(actor)
  2095. -- local info = getallmount(actor)
  2096. -- local curRideMountId = getrolefield(actor,"role.rolemount.curridemountid")
  2097. -- jprint("=============",info,curRideMountId)
  2098. -- end
  2099. -- function triggerchat(actor,table)
  2100. -- -- local actor1 = getactor(table.senderid)
  2101. -- -- local name = getbaseinfo(actor1, "rolename")
  2102. -- -- local rid = getbaseinfo(actor1, "rid")
  2103. -- local uid = getbaseinfo(actor, "uid")
  2104. -- local DataTab = {}
  2105. -- local data = string.split(table.content, "#")
  2106. -- if #data >= 2 then
  2107. -- local cmd = data[1]
  2108. -- local itemId = tonumber(data[2])
  2109. -- -- local itemCount = tonumber(data[3]) or 1
  2110. -- if cmd == "additem" then
  2111. -- additemtobag(actor, itemId, 1)
  2112. -- elseif cmd == "in" then
  2113. -- gset(actor, "G@DePots", uid, DataTab)
  2114. -- elseif cmd == "out" then
  2115. -- end
  2116. -- end
  2117. -- end