QFunction-0.lua 98 KB

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