QFunction-0_1.lua 98 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212
  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. else
  635. -- 请放到最后,其余消息在上面追加
  636. error(actor, "收到无法处理的消息", "玩家", actor, "消息ID", msgID, "params", msgData)
  637. end
  638. end
  639. function login(play)
  640. -- local info = getrolelist(play,getbaseinfo(play, "uid"))--local 自定义变量 = 接口事件名称(默认参数【自定义名称】,参数1,参数2...)
  641. -- error(info)--打印返回数据
  642. gameDebug.debug(CountManager.login, play)
  643. gameDebug.debug(Friend.login, play)
  644. gameDebug.debug(DailyActivity.login, play)
  645. gameDebug.debug(Activity.LogIn, play)
  646. gameDebug.debug(Mount.sendCurrentRideMount, play)
  647. gameDebug.debug(Mount.sendMountLogo, play)
  648. gameDebug.debug(EquipGuard.login, play)
  649. gameDebug.debug(GoldTask.Login, play)
  650. gameDebug.debug(GoldFirstKill.login, play)
  651. gameDebug.debug(SecretRealm.login, play)
  652. gameDebug.debug(Union.sendLeaderOnlineStateMsg, play)
  653. gameDebug.debug(KingRoad.Login, play)
  654. gameDebug.debug(Wings.Login, play)
  655. gameDebug.debug(PrivilegeMonth.login, play)
  656. gameDebug.debug(Master.login, play)
  657. gameDebug.debug(MonthCard.login, play)
  658. gameDebug.debug(onHook.login, play)
  659. gameDebug.debug(CrossMap.EnterView, play, play)
  660. gameDebug.debug(GodsDescended.sendMonsterStateData, play)
  661. -- gameDebug.debug( EquipAndAppear.playerequipstrength(play,0)
  662. -- gameDebug.debug( Trade.sendRecharge, play)
  663. gameDebug.debug(TaskHandler.sendTaskState, play)
  664. gameDebug.debug(Efficiency.CheckRedDot, play)
  665. gameDebug.debug(PreferentialGift.CheckPreferentialGift, play)
  666. LoginEventListerTable:triggerEvent("0", play)
  667. gameDebug.debug(ExpBoost.login, play)
  668. gameDebug.debug(DailyLotteryDraw.login, play)
  669. gameDebug.debug(AngelBenefit.login, play)
  670. gameDebug.debug(SevenLogin.login, play)
  671. gameDebug.debug(RechargeSevenReceive.login, play)
  672. gameDebug.debug(LevelReward.login, play)
  673. gameDebug.debug(AngelWeapon.login, play)
  674. gameDebug.debug(AngelMajorEquipment.login, play)
  675. gameDebug.debug(AngelMajorTalent.sendActiveTalentInfo, play)
  676. gameDebug.debug(Mount.checkMountTime, play)
  677. gameDebug.debug(ComboTest.login, play)
  678. gameDebug.debug(BigSecretRealm.login, play)
  679. gameDebug.debug(RankScript.updateOnline, play, true)
  680. gameDebug.debug(AngelMajorGrail.sendGrailInfo, play, true)
  681. gameDebug.debug(Player.UpdateFightValue, play)
  682. gameDebug.debug(Trade.login, play)
  683. gameDebug.debug(HpMpRecover.recover, play)
  684. gameDebug.debug(RoleSetting.login, play)
  685. gameDebug.debug(EquipAndAppear.login, play)
  686. gameDebug.debug(FruitScript.toGetAlreadyUsePoints, play)
  687. gameDebug.debug(AGAndSD.onLoginEnd, play)
  688. gameDebug.debug(NewEquipWear.onLoginEnd, play)
  689. gameDebug.debug(EquipDurability.onLoginEnd, play)
  690. gameDebug.debug(EquipRefined.onLoginEnd, play)
  691. gameDebug.debug(LianJi.onLoginEnd, play)
  692. gameDebug.debug(Player.onLoginEnd, play)
  693. gameDebug.debug(Transaction.onLoginEnd, play)
  694. -- gameDebug.debug( OperationalActivities.openActive, play)
  695. end
  696. function exit(actor)
  697. local time = getbaseinfo("now")
  698. setplaydef(actor, "T$offlinetime", time)
  699. Skill.closeDemonHermitSkill(actor)
  700. Skill.closePet(actor)
  701. NewEquipWear.closePet(actor)
  702. end
  703. function logout(actor)
  704. onHook.logout(actor)
  705. RankScript.updateOnline(actor, false)
  706. gameDebug.debug(Player.UpdateFightValue, actor)
  707. gameDebug.debug(LogManager.RoleLogout, actor)
  708. gameDebug.debug(AGAndSD.onLogout, actor)
  709. gameDebug.debug(NewEquipWear.onLogout, actor)
  710. gameDebug.debug(EquipAndAppear.onLogout, actor)
  711. gameDebug.debug(Skill.closePet, actor)
  712. gameDebug.debug(Skill.closeDemonHermitSkill, actor)
  713. end
  714. function run(actor)
  715. -- 测试内网,看看能不能更新上去
  716. end
  717. function walk(actor)
  718. end
  719. function jump(actor)
  720. end
  721. function removeskillevent(actor, removeSkillList)
  722. end
  723. function releaseskillafter(actor, skillid, skilllevel, targetlist, finalTargetList, targetHurt, targetTotal)
  724. AGAndSD.onAttackAG(actor, skillid);
  725. Skill.releaseSkillAfter(actor, skillid);
  726. -- sendluamsg(actor, LuaMessageIdToSever.SkillRelease, {
  727. -- skillId = skillid,
  728. -- skillLevel = skilllevel
  729. -- })
  730. end
  731. function releaseskill(actor, skillid, skilllevel, targetlist)
  732. -- --Buffer.OnReleaseSkill(actor,targetlist)
  733. -- end
  734. --
  735. -- function releaseskillafter(actor, skillid, skilllevel, targetlist, finalTargetList, targetHurt, targetTotal)
  736. -- -- targetlist : 伤害目标列表
  737. -- -- finalTargetList: 伤害目标结果列表,包含了未产生伤害的对象,也就是被powersource=0过滤掉的目标
  738. -- -- targetHurt: 总伤害值
  739. -- -- targetTotal: 受到伤害目标的数量,等于size(targetlist)
  740. -- local baseCareer = getbaseinfo(actor, "getbasecareer")
  741. -- if baseCareer == 3 then
  742. -- local needWeapon = ConfigDataManager.getTableValue("cfg_skill_info", "needWeapon", "skillID", skillid,
  743. -- "skillLevel", skilllevel)
  744. -- if string.startsWith(needWeapon, "4") then
  745. -- local isPass = false
  746. -- local needWeapons = string.split(needWeapon, "|")
  747. -- local equipPos = {}
  748. -- local equips = getputonequipinfo(actor)
  749. -- for key, equip in pairs(equips) do
  750. -- local pos = gameequip.pos(equip.equipindex)
  751. -- equipPos[pos] = equip
  752. -- end
  753. -- for i = 2, #needWeapons, 1 do
  754. -- local weaponDatas = string.split(needWeapons[i], "#")
  755. -- local part = tonumber(weaponDatas[1])
  756. -- local weapon = tonumber(weaponDatas[2])
  757. -- local equip = equipPos[part]
  758. -- if equip ~= nil then
  759. -- local equipField = ConfigDataManager.getTableValue("cfg_item", "field", "id", equip.cfgid)
  760. -- local equipPart = ConfigDataManager.getTableValue("cfg_model_charactor", "part", "id", equipField)
  761. -- if tonumber(equipPart) == weapon then
  762. -- isPass = true;
  763. -- break
  764. -- end
  765. -- end
  766. -- end
  767. -- if isPass == false then
  768. -- return false
  769. -- end
  770. -- end
  771. -- end
  772. EquipDurability.updateQuiver(actor)
  773. LianJi.releaseskill(actor, skillid, skilllevel, targetlist)
  774. Skill.releaseSkill(actor, skillid)
  775. end
  776. function triggertaskrefresh(actor, type, param)
  777. -- 统一走lua触发任务刷新接口
  778. TaskHandler.TriggerTaskGoal(actor, type, param)
  779. end
  780. function levelup(actor, level, oldlevel)
  781. LevelUpEventListerTable:triggerEvent("0", actor, level)
  782. gameDebug.debug(LogManager.RoleLevelUp, actor)
  783. RoleAttr.levelup(actor, level, oldlevel)
  784. -- 处理职业解锁
  785. CareerUnlock.unlock(actor, level)
  786. -- 检查王者任务初始化
  787. KingRoad.TryInitKingRoadTask(actor)
  788. Wings.TryInitWingsTask(actor)
  789. Master.levelup(actor, level, oldlevel)
  790. -- Mail.levelUp(actor, level)
  791. OpenServerAct.UpdateRankValue(actor, OpenServerAct.RealTimeRank.ROLE_LEVEL, level)
  792. Buffer.levelUp(actor, level)
  793. Efficiency.CheckRedDot(actor, level)
  794. PreferentialGift.CheckPreferentialGift(actor)
  795. GoldFirstKill.AcceptTask(actor)
  796. AngelBenefit.AcceptTask(actor)
  797. SevenLogin.updateLoginInfo(actor)
  798. BraveTest.refreshRedDot(actor)
  799. RechargeSevenReceive.updateLoginInfo(actor)
  800. Player.onLevelUp(actor)
  801. -- AGAndSD.upLevelCfgId(actor)
  802. end
  803. function taskprogresscomplete(actor, taskId)
  804. Mail.taskComplete(actor, taskId)
  805. Buffer.taskProgressComplete(actor, taskId)
  806. end
  807. function taskcomplete(actor, taskId)
  808. FaceShootPreview.TaskCompleted(actor, taskId)
  809. end
  810. -- @description 玩家活动改变事件
  811. -- @param 玩家对象;活动id;1-开启,0-关闭
  812. -- @return
  813. function activitychange(actor, activityId, action)
  814. Activity.ActivityChange(actor, activityId, action)
  815. GodsDescended.actorActivityChange(actor, activityId, action)
  816. end
  817. -- @description 开启活动,系统执行
  818. -- @param 系统对象,id和mapid均为0;活动id;1-开启,0-关闭
  819. -- @return
  820. function systemactivitychange(system, activityId, action)
  821. if tonumber(activityId) == DuplicateType.MONSTER_ATTACK then
  822. MonAtk.run(activityId, action)
  823. elseif tonumber(activityId) == DuplicateType.MONSTER_ATTACK_GOLD1 then
  824. MonAtk.run(activityId, action)
  825. elseif tonumber(activityId) == DuplicateType.MONSTER_ATTACK_GOLD2 then
  826. MonAtk.run(activityId, action)
  827. elseif tonumber(activityId) == DuplicateType.WAR_ALLIANCE and tonumber(action) == 0 then
  828. WarAlliance.ClearThisTimeGameData()
  829. elseif tonumber(activityId) == DuplicateType.WOLF_SOUL and tonumber(action) == 1 then
  830. WolfSoul.OpenDuplicate(system)
  831. elseif tonumber(activityId) == DuplicateType.GODS_DESCENDED then
  832. GodsDescended.sysActivityChange(activityId, action)
  833. elseif tonumber(activityId) == DuplicateType.KUN_DUN then
  834. KunDun.Run(action)
  835. elseif activityId == DuplicateType.ROLAND_SEIGE and action == 1 then
  836. -- 罗兰峡谷攻城战活动开启
  837. RolandSeige.OpenDuplicate(system)
  838. elseif tonumber(activityId) == DuplicateType.WORLD_BOSS then
  839. WorldBoss.Run(action)
  840. end
  841. end
  842. -- 怪物进入战斗状态触发
  843. function monsterenterattack(actor, monstercfgid, enemyid)
  844. messagebox(actor, "怪物进入战斗状态触发")
  845. MonAtk.monAtkMonsterEnterAttack(actor, monstercfgid, enemyid)
  846. MonAtk.monAtkMonsterEnterAttack(actor, monstercfgid)
  847. end
  848. -- 怪物脱离战斗状态触发
  849. function monsterleaveattack(actor, monstercfgid)
  850. MonAtk.monAtkMonsterLeaveAttack(actor, monstercfgid)
  851. end
  852. ---击杀玩家事件
  853. ---@param actor any 攻击玩家对象
  854. ---@param diePlayer any 死亡玩家对象
  855. function killplayer(actor, diePlayer)
  856. pk.killplayerpkvaluehandle(actor, diePlayer) -- 击杀玩家PK值处理
  857. -- Friend.enemyaddbefore(diePlayer, actor)
  858. RedFortress.KillPlayer(actor, diePlayer)
  859. UnionTask.killPlayerEvent(actor, diePlayer)
  860. KunDun.KillPlayer(actor, diePlayer)
  861. RolandSeige.KillPlayer(actor, diePlayer)
  862. end
  863. ---玩家被攻击事件
  864. ---@param actor any 玩家对象
  865. ---@param fightParam any 被攻击参数 caster:攻击者对象、target:被攻击者对象、mapid:地图id、skillid:技能id、skilllevel:技能等级、castertype:攻击者类型、targettype:被攻击者类型
  866. function underattack(actor, fightParam, fightResult)
  867. pk.underattackpkvaluehandle(actor, fightParam) -- 被攻击PK值防卫时间处理
  868. EquipGem.setGemRecovery(actor, fightParam)
  869. MonsterScript.OnUnderAttack(actor, fightParam)
  870. -- EquipDurability.beattack(actor, fightParam.target, fightParam.targethurt, fightParam.targettype)
  871. EquipDurability.beattackMark(actor, fightParam.target, fightParam.targethurt, fightParam.targettype)
  872. end
  873. ---击杀怪物事件
  874. ---@param actor any 玩家对象
  875. ---@param monsterId any 怪物唯一ID
  876. ---@param monsterCfgId number 怪物configId
  877. ---@param monsterName string 怪物名称
  878. ---@param pointX number 怪物X坐标
  879. ---@param pointY number 怪物Y坐标
  880. ---@param activityId number 活动id
  881. ---@param monsterLevel number 怪物等级
  882. function killmon(actor, monsterId, monsterCfgId, monsterName, pointX, pointY, activityId, monsterLevel, mongenCfgId)
  883. gameDebug.debug(LogManager.KillMonster, actor, monsterCfgId)
  884. pk.killmonsterpkvaluehandle(actor, monsterCfgId, monsterLevel) -- 击杀怪物PK值处理
  885. UnionTask.killMonsterEvent(actor, monsterCfgId)
  886. -- AG / SD信息
  887. -- AGAndSD.onKillMon(actor, monsterId, monsterCfgId, monsterName, pointX, pointY, activityId, monsterLevel, mongenCfgId)
  888. end
  889. -- 当前地图检查是否可以使用道具(actor, id)
  890. function MapCanuseitem(actor, id)
  891. -- 获取所在地图
  892. -- local mapId = tonumber(getbaseinfo(actor, "mapid"))
  893. -- 需要消耗资源的地图不许使用此道具
  894. -- local items_need = ConfigDataManager.getTableValue("cfg_map_line", "items_need", "id", mapId)
  895. -- if not string.isNullOrEmpty(items_need) then
  896. -- tipinfo(actor, string.format("当前地图禁止使用该道具"))
  897. -- return false
  898. -- end
  899. return true
  900. end
  901. -- 道具使用检测
  902. function useitembefore(actor, data)
  903. if data.type == 1 then
  904. for key, value in pairs(data.items) do
  905. local itemInfo = getbagiteminfo(actor, key, 0)
  906. local canUse = WarFlag.canUseWarFlagItem(actor, itemInfo)
  907. if canUse == false then
  908. return false
  909. end
  910. end
  911. end
  912. for key, value in pairs(data.items) do
  913. local itemInfo = getbagiteminfo(actor, key, 0)
  914. if itemInfo == nil then
  915. elseif itemInfo.cfgid == 30030109 then
  916. local teamid = getbaseinfo(actor, "teamid")
  917. if teamid == nil or teamid == "" or teamid == 0 then
  918. tipinfo(actor, string.format("您不在队伍中"))
  919. return false
  920. end
  921. return MapCanuseitem(actor, itemInfo.cfgid)
  922. elseif itemInfo.cfgid == 30030108 then
  923. local unionid = getbaseinfo(actor, "unionid")
  924. if unionid == nil or unionid == "" or unionid == 0 then
  925. tipinfo(actor, string.format("您不在战盟中"))
  926. return false
  927. end
  928. local unioninfo = getunioninfo(actor, unionid)
  929. if unioninfo.num <= 1 then
  930. tipinfo(actor, string.format("没有可召唤的战盟成员"))
  931. return false
  932. end
  933. return MapCanuseitem(actor, itemInfo.cfgid)
  934. elseif itemInfo.cfgid == 70700026 then -- 免罪符
  935. local pkval = pk.getpkvalue(actor)
  936. if pkval <= 0 then
  937. messagebox(actor, "您的罪恶值为 0,无需消除")
  938. return false
  939. end
  940. local show = pkval - 10 > 0 and pkval - 10 or 0
  941. noticeTip.noticeinfo(actor, 35007, pkval, show)
  942. -- elseif itemInfo.cfgid == 50020021 then -- 使用防护药水
  943. -- return AGAndSD.useItem(actor,itemInfo.cfgid,1,1)
  944. end
  945. -- if not MapCanuseitem(actor, itemInfo.cfgid) then
  946. -- return false
  947. -- end
  948. end
  949. end
  950. ---使用道具事件
  951. ---@param actor any 玩家对象
  952. ---@param itemConfigId number 道具configId
  953. ---@param count number 使用数量
  954. function useitemtrigger(actor, itemConfigId, count)
  955. gameDebug.debug(CareerChange.useItemChangeCareer, actor, itemConfigId)
  956. CareerChange.useItemChangeCareer(actor, itemConfigId, count)
  957. EquipAndAppear.addbuffcostitem(actor, itemConfigId, count) -- 使用道具
  958. pk.exonerationcharmpkvaluehnadle(actor, itemConfigId, count) -- 免罪符使用减少PK值处理
  959. -- PrivilegeCardScript.setPrivilegeCardInfos(actor, itemConfigId, count) -- 特权卡使用后处理
  960. FruitScript.handleUseFruit(actor, itemConfigId, count) -- 果实使用后处理
  961. MonthCard.usemonthcard(actor, itemConfigId, count) -- 使用月卡后处理
  962. RandomChest.generateChestItem(actor, itemConfigId, count) -- 随机宝箱生成道具
  963. FashionBox.generateChestItem(actor, itemConfigId, count) -- 时装宝箱生成道具
  964. ExpBoost.useExperienceBoostItem(actor, itemConfigId, count) -- 经验加成道具处理
  965. PrivilegeMonth.usePrivilegeCard(actor, itemConfigId, count) -- 特权卡使用处理
  966. AngelMajorEquipment.useExperienceBoostItem(actor, itemConfigId, count) -- 大天使经验药水使用处理
  967. WarFlag.useWarFlagItem(actor, itemConfigId, count) -- 使用旗魂道具
  968. -- 新增召唤和聊天道具处理
  969. SummonAndChat.handleSpecialItems(actor, itemConfigId, count)
  970. LianJi.onUseItem(actor, itemConfigId, count)
  971. -- 防护药水使用处理
  972. AGAndSD.useItem(actor, itemConfigId)
  973. end
  974. ---玩家转职事件
  975. ---@param actor any 玩家对象
  976. ---@param transferCareerNum number 转职次数
  977. ---@param careerName string 转职名称
  978. function transfercareer(actor, transferCareerNum, careerName)
  979. RoleAttr.transferCareer(actor, careerName)
  980. local roleName = getrolefield(actor, "role.basic.name")
  981. -- 转职成功发送公告消息
  982. noticeTip.noticeinfo(actor, StringIdConst.JOB_CHANGE, roleName, transferCareerNum, careerName)
  983. end
  984. ---玩家进入视野事件
  985. ---@param actor any 玩家对象
  986. ---@param targetPlayer any 进入视野的玩家对象
  987. function playerenterview(actor, targetPlayer)
  988. pk.sendenterviewpkvalue(actor, targetPlayer) -- 进入视野发送PK值
  989. DuplicateCommon.PlayerEnterView(actor, targetPlayer) -- 副本中玩家进入视野
  990. CrossMap.EnterView(actor, targetPlayer)
  991. SceneMap.playerEnterView(actor, targetPlayer)
  992. Skill.playerequipview(actor, targetPlayer)
  993. TransferCard.PlayerEnterView(actor, targetPlayer)
  994. EquipAndAppear.playerequipstrength(actor, targetPlayer) -- 玩家进入视野发送装备强化信息
  995. EquipAndAppear.playerequipview(actor, targetPlayer)
  996. end
  997. --- 怪物进入视野事件
  998. ---@param actor any 玩家对象
  999. ---@param monsterActor any 怪物对象
  1000. ---@param monsterCfgId number 怪物configId
  1001. function monsterenterview(actor, monsterActor, monsterCfgId)
  1002. MonsterScript.MonsterEnterView(actor, monsterActor, monsterCfgId)
  1003. end
  1004. --- 穿戴装备后触发
  1005. function takeonequip(actor, pos, oldItemId, itemId, itemCfgId)
  1006. gameDebug.debug(LogManager.RolePutOnEquip, actor)
  1007. EquipGuard.putGuardEquip(actor, itemCfgId)
  1008. -- 转移装备属性
  1009. EquipAndAppear.checkCanTransfer(actor, oldItemId, itemId)
  1010. -- EquipMaster.triggerEquipMaster(actor)
  1011. EquipAndAppear.updateluaextattr(actor)
  1012. EquipGem.schemeEffectByBoolean(actor, {pos}, true)
  1013. -- EquipAndAppear.playerequipstrength(actor, 0) --发送玩家装备强化信息
  1014. -- 刷新装备任务进度
  1015. this.equipchangeflushtask(actor, pos, itemId)
  1016. TransferCard.EquipChange(actor)
  1017. OpenServerCompetition.updateSuitStageNum(actor)
  1018. AngelWeapon.updateTaskInfo(actor)
  1019. -- 穿戴大天使装备后操作
  1020. AngelMajorEquipment.afterPutOnAngelEquipment(actor, oldItemId, itemId, itemCfgId)
  1021. EquipDurability.takeonequip(actor, pos, oldItemId, itemId, itemCfgId)
  1022. TwoWeaponsAttrs.updateAttrs(actor, pos)
  1023. LineManager.takeoffequip(actor)
  1024. EquipMaster.updateEquipMaster(actor)
  1025. end
  1026. --- 脱下装备后触发
  1027. function takeoffequip(actor, pos, itemId, itemCfgId)
  1028. EquipGuard.takeOffGuardEquip(actor, itemCfgId)
  1029. -- EquipMaster.triggerEquipMaster(actor)
  1030. EquipAndAppear.updateluaextattr(actor)
  1031. EquipGem.schemeEffectByBoolean(actor, {pos}, false)
  1032. -- EquipAndAppear.playerequipstrength(actor, 0) --发送玩家装备强化信息
  1033. -- 刷新装备任务进度
  1034. this.equipchangeflushtask(actor, pos, itemId)
  1035. TransferCard.EquipChange(actor)
  1036. AngelWeapon.updateTaskInfo(actor)
  1037. -- 脱下大天使装备后操作
  1038. AngelMajorEquipment.afterTakeOffAngelEquipment(actor, itemId, itemCfgId)
  1039. TwoWeaponsAttrs.updateAttrs(actor, pos)
  1040. Equip_QiangHua.takeOffEquip(actor, pos, itemId, itemCfgId)
  1041. -- 地图检测
  1042. LineManager.takeoffequip(actor)
  1043. EquipMaster.updateEquipMaster(actor)
  1044. end
  1045. function weaponchange(actor, oldIndex, newIndex, itemId)
  1046. local res = {
  1047. oldIndex = oldIndex,
  1048. newIndex = newIndex,
  1049. itemId = itemId
  1050. }
  1051. sendluamsg(actor, LuaMessageIdToClient.RES_WEAPON_CHANGE_AUTO, res)
  1052. end
  1053. function this.equipchangeflushtask(actor)
  1054. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.EQUIP_APPEND)
  1055. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.PARTS_STRENGTHEN_LV)
  1056. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.JEWELRY_LV_UP)
  1057. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.EXCELLENCE_ATTR)
  1058. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.EQUIP_EXCELLENCE_ATTR_COUNT)
  1059. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.EQUIP_APPEND_TOTAL_LV)
  1060. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.SPECIFIC_STAGE_EQUIP)
  1061. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.INLAID_GEMSTONES)
  1062. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.TAKE_ON_GRAIL_COUNT)
  1063. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.STRENGTHEN_GRAIL)
  1064. end
  1065. -- 装备生效事件 是否生效 通过参数的布尔值判断
  1066. function equipeffectbyboolean(actor, map, effect)
  1067. -- 获取影响的装备位置
  1068. local effectPos = {}
  1069. for k, v in pairs(map) do
  1070. table.insert(effectPos, gameequip.pos(k))
  1071. end
  1072. EquipGem.schemeEffectByBoolean(actor, effectPos, effect)
  1073. -- sendluamsg(actor, LuaMessageIdToClient.RES_GEM_SCHEME, { ["触发了生效事件"] = map })
  1074. end
  1075. --- 物品变化
  1076. function itemchange(actor, ids, cfgId, oldCount, newCount, change)
  1077. EquipGuard.initGuardEquip(actor, ids, cfgId, oldCount, newCount)
  1078. Master.masterItemChange(actor, ids, cfgId, oldCount, newCount)
  1079. -- 任务进度刷新
  1080. if tonumber(oldCount) < tonumber(newCount) then
  1081. local count = tonumber(newCount) - tonumber(oldCount)
  1082. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.RE_GET_ITEM, {cfgId, count})
  1083. end
  1084. AutoBuyPotionScript.coinChange(actor, cfgId)
  1085. end
  1086. function addmonthcardbefore(actor, cfgId, count)
  1087. if cfgId ~= 30030305 then
  1088. return
  1089. end
  1090. -- 直接加月卡时间
  1091. MonthCard.buymonthcardgoods(actor, cfgId, count)
  1092. end
  1093. -- 怪物进入战斗状态触发
  1094. function monsterenterattack(actor, monstercfgid, enemyid)
  1095. MonAtk.monAtkMonsterEnterAttack(actor, monstercfgid)
  1096. end
  1097. -- 怪物脱离战斗状态触发
  1098. function monsterleaveattack(actor, monstercfgid)
  1099. MonAtk.monAtkMonsterLeaveAttack(actor, monstercfgid)
  1100. end
  1101. -- 不入包的道具获取
  1102. function nobagitemchange(actor, itemList)
  1103. for _, itemInfo in pairs(itemList) do
  1104. EquipAndAppear.titleenterbag(actor, itemInfo.cfgid)
  1105. end
  1106. TransferCard.NotEnterBagItemAdd(actor, itemList)
  1107. end
  1108. -- @description 副本阶段更新
  1109. -- @param 系统id;地图唯一id;副本类型;副本阶段(1-准备 2-战斗 3-结算);下一阶段开始时间戳;配置id(cfg_rep的id)
  1110. -- @return
  1111. function dupstateupdate(system, id, dupType, state, nextStateStartTime, configId)
  1112. if dupType == DuplicateType.DEVIL_SQUARE then
  1113. -- 恶魔广场
  1114. DevilSquare.DevilSquareStateUpdate(system, id, state, nextStateStartTime, configId)
  1115. elseif dupType == DuplicateType.BLOODY_CASTLE then
  1116. -- 血色城堡
  1117. BloodyCastle.BloodyCastleStateUpdate(system, id, state, nextStateStartTime, configId)
  1118. elseif dupType == DuplicateType.BRAVE_TEST then
  1119. -- 勇者试炼
  1120. BraveTest.BraveTestStateUpdate(system, id, state, nextStateStartTime, configId)
  1121. elseif dupType == DuplicateType.RED_FORTRESS then
  1122. -- 赤色要塞
  1123. RedFortress.RedFortressStateUpdate(system, id, state, nextStateStartTime, configId)
  1124. elseif dupType == DuplicateType.WAR_ALLIANCE then
  1125. -- 战盟boss
  1126. WarAlliance.WarAllianceStateUpdate(system, id, state, nextStateStartTime, configId)
  1127. elseif dupType == DuplicateType.PRIVILEGE_BOSS then
  1128. PrivilegeBoss.PrivilegeBossStateUpdate(system, id, state, nextStateStartTime, configId)
  1129. elseif dupType == DuplicateType.WOLF_SOUL then
  1130. WolfSoul.DupStateUpdate(system, id, state, nextStateStartTime, configId)
  1131. elseif dupType == DuplicateType.KUN_DUN then
  1132. KunDun.DupStateUpdate(system, id, state, nextStateStartTime, configId)
  1133. elseif dupType == DuplicateType.COMBO_TEST then
  1134. ComboTest.ComboStateUpdate(system, id, state, nextStateStartTime, configId)
  1135. elseif dupType == DuplicateType.BIG_SECRET_REALM then
  1136. BigSecretRealm.DupStateUpdate(system, id, state, nextStateStartTime, configId)
  1137. elseif dupType == DuplicateType.ROLAND_SEIGE then
  1138. RolandSeige.DupStateUpdate(system, id, state, nextStateStartTime, configId)
  1139. elseif dupType == DuplicateType.ITEM_BOSS then
  1140. ItemBoss.DupStateUpdate(system, id, state, nextStateStartTime, configId)
  1141. elseif dupType == DuplicateType.WORLD_BOSS then
  1142. WorldBoss.DupStateUpdate(system, id, state, nextStateStartTime, configId)
  1143. end
  1144. end
  1145. -- @description 副本秒钟心跳
  1146. -- @param
  1147. -- @return
  1148. function duplicatesecondheart(system)
  1149. local mapId = getbaseinfo(system, "unimapid")
  1150. local dupInfo = getduplicate(mapId)
  1151. if dupInfo == nil then
  1152. return
  1153. end
  1154. local dupType = dupInfo["type"]
  1155. local state = dupInfo["state"]
  1156. local dupConfig = dupInfo["dupcfgid"]
  1157. if dupType == DuplicateType.WOLF_SOUL then
  1158. WolfSoul.SecondHeart(mapId, dupConfig, state)
  1159. elseif dupType == DuplicateType.ROLAND_SEIGE then
  1160. RolandSeige.DupSecondHeart(mapId, dupConfig, state)
  1161. elseif dupType == DuplicateType.KUN_DUN then
  1162. KunDun.DupSecondHeart(mapId, dupConfig, state)
  1163. end
  1164. end
  1165. -- 副本3秒钟心跳
  1166. function duplicate3secondheart(system)
  1167. local mapId = getbaseinfo(system, "unimapid")
  1168. local dupInfo = getduplicate(mapId)
  1169. if dupInfo == nil then
  1170. return
  1171. end
  1172. local dupType = dupInfo["type"]
  1173. local state = dupInfo["state"]
  1174. local dupConfig = dupInfo["dupcfgid"]
  1175. if dupType == DuplicateType.ROLAND_SEIGE then
  1176. RolandSeige.Dup3SecondHeart(mapId, dupConfig, state)
  1177. elseif dupType == DuplicateType.WORLD_BOSS then
  1178. WorldBoss.DupSecondHeart(mapId, dupConfig, state)
  1179. end
  1180. end
  1181. -- 副本5秒钟心跳
  1182. function duplicate5secondheart(system)
  1183. local mapId = getbaseinfo(system, "unimapid")
  1184. local dupInfo = getduplicate(mapId)
  1185. if dupInfo == nil then
  1186. return
  1187. end
  1188. local dupType = dupInfo["type"]
  1189. local state = dupInfo["state"]
  1190. local dupConfig = dupInfo["dupcfgid"]
  1191. if dupType == DuplicateType.RED_FORTRESS then
  1192. RedFortress.Dup5SecondHeart(mapId, dupConfig, state)
  1193. end
  1194. end
  1195. -- @description 怪物死亡掉落经验事件,归属者触发,主要处理怪物经验
  1196. -- @param 归属者;默认掉落经验;怪物配置id;x坐标;y坐标
  1197. -- @return 经验值
  1198. function monsterdieexp(actor, exp, monCfgId, monsterId, x, y)
  1199. local mapId = getbaseinfo(actor, "unimapid")
  1200. SecretRealm.recordMonsterDie(actor, mapId, monCfgId, monsterId)
  1201. local mapInfo = getmapinfobyid(mapId)
  1202. -- 指定地图增加经验倍率
  1203. local map_exp_rate = ConfigDataManager.getTableValue("cfg_map_info", "exprate", "id", mapInfo.cfgid)
  1204. if tonumber(map_exp_rate) > 0 then
  1205. exp = exp * (1 + map_exp_rate / 100)
  1206. end
  1207. local newExp = LineManager.applyExpRate(actor, exp) -- 应用线路经验倍率 2025.08.23 拓展地图线路
  1208. -- info(string.format('MS 经验衰减倍率 线路应用前为:%d 线路应用后为:%d', exp, newExp))
  1209. -- 经验衰减倍率
  1210. local decayRate = MonsterScript.GetExpDecayRate(actor, monCfgId)
  1211. local finalExp = newExp * TripleIncome.GetRate(actor) * decayRate
  1212. local expRate = 0
  1213. -- 判断是不是副本
  1214. if mapInfo["isdup"] == true then
  1215. local dupInfo = getduplicate(mapId)
  1216. local dupType = dupInfo["type"]
  1217. if dupType == DuplicateType.DEVIL_SQUARE then
  1218. DevilSquare.KillMonterInDevilSquare(actor, mapId, finalExp, monCfgId)
  1219. elseif dupType == DuplicateType.BLOODY_CASTLE then
  1220. BloodyCastle.KillMonterInBloodyCastle(actor, mapId, finalExp, monCfgId)
  1221. elseif dupType == DuplicateType.ITEM_BOSS then
  1222. ItemBoss.KillMonterInItemBoss(actor, mapId, finalExp, monCfgId)
  1223. end
  1224. else
  1225. -- 如果不是副本,则加成世界等级
  1226. expRate = Player.calWorldLevelExpRate(actor)
  1227. end
  1228. -- 如果组队 经验分配
  1229. local list = API.GetRangeTeamList(actor, 15)
  1230. if #list > 1 then
  1231. local TeamExp = {}
  1232. local expPre = 0
  1233. -- 配置表加成经验万分比
  1234. local CfgVal = ConfigDataManager.getTableValue("cfg_global", "value", "id", "260002")
  1235. local items = string.split(CfgVal, "|")
  1236. for index, item in pairs(items) do
  1237. local Val = string.split(item, "#")
  1238. if tonumber(Val[1]) == tonumber(#list) then
  1239. expPre = tonumber(Val[2])
  1240. break
  1241. end
  1242. end
  1243. -- 职业加成
  1244. local jobM = {}
  1245. for i = 1, #list do
  1246. local player = list[i]
  1247. local career = getbaseinfo(player, "getbasecareer")
  1248. jobM[career] = true
  1249. end
  1250. if jobM[1] and jobM[2] and jobM[3] then -- 战、法、弓
  1251. expPre = expPre + 3000 -- 加成30%
  1252. end
  1253. -- 向上取整-- 计算每个队员获得的经验值
  1254. finalExp = math.ceil(finalExp * (expPre / 10000 + 1) / #list)
  1255. -- local rid = getbaseinfo(actor, "rid")
  1256. for i = 1, #list do
  1257. local act = list[i]
  1258. -- 世界等级加成百分比 *100
  1259. expRate = Player.calWorldLevelExpRate(act) * 100
  1260. -- 经验药水加成属性万分比
  1261. local attrValue = getplaydef(act, PlayerDefKey.player.EXP_BOOST_ATTR_VALUE) or 0
  1262. local retVal = math.ceil(finalExp * (1 + (expRate + attrValue) / 10000))
  1263. addroleexp(act, retVal)
  1264. -- TeamExp[playerRid] = math.ceil(finalExp * (1 + expRate / 100))
  1265. TaskHandler.TriggerTaskGoal(act, TaskTargetType.KILL_MONSTER_TEAM_SHARE, monCfgId)
  1266. end
  1267. return TeamExp
  1268. end
  1269. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.KILL_MONSTER_TEAM_SHARE, monCfgId)
  1270. -- finalExpSelfExt = math.ceil(finalExp * (expRate / 100.0))
  1271. return math.ceil(finalExp * (1 + expRate / 100))
  1272. end
  1273. function getexpafter(actor, exp, fromType)
  1274. if fromType == 2 then
  1275. local mapId = getbaseinfo(actor, "unimapid")
  1276. local dupInfo = getduplicate(mapId)
  1277. if dupInfo ~= nil then
  1278. local dupType = dupInfo["type"]
  1279. if dupType == DuplicateType.DEVIL_SQUARE then
  1280. DevilSquare.AddExp(actor, mapId, exp)
  1281. elseif dupType == DuplicateType.BLOODY_CASTLE then
  1282. BloodyCastle.AddExp(actor, mapId, exp)
  1283. end
  1284. end
  1285. end
  1286. end
  1287. -- @description 玩家进入副本事件
  1288. -- @param 玩家对象;地图唯一id;副本类型;副本阶段(1-准备 2-战斗 3-结算);下一阶段开始时间戳;配置id(cfg_rep的id)
  1289. -- @return
  1290. function afterenterduplicate(actor, mapId, dupType, state, nextStateStartTime, configId)
  1291. if dupType == DuplicateType.DEVIL_SQUARE then
  1292. -- 恶魔广场
  1293. DevilSquare.AfterPlayerEnterDevilSquare(actor, mapId, state, nextStateStartTime, configId)
  1294. elseif dupType == DuplicateType.BLOODY_CASTLE then
  1295. -- 血色城堡
  1296. BloodyCastle.AfterPlayerBloodyCaster(actor, mapId, state, nextStateStartTime, configId)
  1297. elseif dupType == DuplicateType.BRAVE_TEST then
  1298. -- 勇者试炼
  1299. BraveTest.BraveTestEnter(actor, mapId, state, nextStateStartTime, configId)
  1300. elseif dupType == DuplicateType.RED_FORTRESS then
  1301. -- 赤色要塞
  1302. -- 如果是变身状态,取消变身
  1303. local notExpired = TransferCard.CheckTransfermationExpired(actor, false)
  1304. if notExpired then
  1305. TransferCard.ReqCancelTransfermation(actor)
  1306. end
  1307. RedFortress.AfterRedFortressEnter(actor, mapId, state, nextStateStartTime, configId)
  1308. elseif dupType == DuplicateType.WAR_ALLIANCE then
  1309. -- 战盟boss
  1310. WarAlliance.AfterEnterWarAlliance(actor, mapId, state, nextStateStartTime, configId)
  1311. elseif dupType == DuplicateType.PRIVILEGE_BOSS then
  1312. -- 特权BOSS
  1313. PrivilegeBoss.afterEnterPrivilegeBoss(actor, mapId, state, nextStateStartTime, configId)
  1314. elseif dupType == DuplicateType.WOLF_SOUL then
  1315. -- 狼魂要塞
  1316. WolfSoul.AfterEnterWolfSoul(actor, mapId, state, nextStateStartTime, configId)
  1317. elseif dupType == DuplicateType.COMBO_TEST then
  1318. -- 连击试炼
  1319. ComboTest.AfterEnterComboTest(actor, mapId, state, nextStateStartTime, configId)
  1320. elseif dupType == DuplicateType.BIG_SECRET_REALM then
  1321. -- 大秘境副本
  1322. BigSecretRealm.AfterEnterBigSecretRealm(actor, mapId, state, nextStateStartTime, configId)
  1323. elseif dupType == DuplicateType.ROLAND_SEIGE then
  1324. -- 罗兰峡谷攻城战
  1325. RolandSeige.AfterEnterRoland(actor, mapId, state, nextStateStartTime, configId)
  1326. elseif dupType == DuplicateType.KUN_DUN then
  1327. -- 昆顿
  1328. KunDun.AfterEnterKunDun(actor, mapId, state, nextStateStartTime, configId)
  1329. elseif dupType == DuplicateType.ITEM_BOSS then
  1330. -- 道具boss
  1331. ItemBoss.AfterEnterItemBoss(actor, mapId, state, nextStateStartTime, configId)
  1332. elseif dupType == DuplicateType.WORLD_BOSS then
  1333. WorldBoss.afterenterduplicate(actor, mapId, dupType, state, nextStateStartTime, configId)
  1334. end
  1335. -- 进入副本后 刷新战盟任务
  1336. UnionTask.enterDuplicate(actor, configId)
  1337. end
  1338. -- @description 退出副本事件
  1339. -- @param 玩家对象;地图唯一id;副本类型;副本阶段(1-准备 2-战斗 3-结算);下一阶段开始时间戳;配置id(cfg_rep的id)
  1340. -- @return
  1341. function afterquitduplicate(actor, mapId, dupType, state, nextStateStartTime, configId)
  1342. sendluamsg(actor, LuaMessageIdToClient.RES_QUIT_DUPLICATE, configId)
  1343. if dupType == DuplicateType.RED_FORTRESS then
  1344. -- 赤色要塞
  1345. RedFortress.AfterRedFortressQuit(actor, mapId, state, nextStateStartTime, configId)
  1346. elseif dupType == DuplicateType.BRAVE_TEST then
  1347. -- 勇者试炼
  1348. BraveTest.onQuitDup(actor, configId)
  1349. elseif dupType == DuplicateType.ROLAND_SEIGE then
  1350. -- 罗兰攻城战
  1351. RolandSeige.OnQuitDup(actor, mapId, state, nextStateStartTime, configId)
  1352. end
  1353. end
  1354. -- @description 玩家进入地图事件(所有地图,包括普通地图)
  1355. -- @param 玩家对象;上一个地图配置id;当前地图配置id
  1356. -- @return
  1357. function entermap(actor, lastMapCfgId, mapCfgId)
  1358. gameDebug.debug(Player.enterMap, actor)
  1359. gameDebug.debug(RankScript.updateOnline, actor, true)
  1360. gameDebug.debug(TaskHandler.TriggerTaskGoal, actor, TaskTargetType.ENTER_MAP_LINE)
  1361. gameDebug.debug(DevilSquare.EnterAllMapDS, actor, lastMapCfgId, mapCfgId)
  1362. gameDebug.debug(BloodyCastle.EnterAllMapDS, actor, lastMapCfgId, mapCfgId)
  1363. gameDebug.debug(SecretRealm.afterEnterSecretRealm, actor, lastMapCfgId, mapCfgId)
  1364. gameDebug.debug(RedFortress.EnterAllMap, actor, lastMapCfgId, mapCfgId)
  1365. gameDebug.debug(CrossMap.CheckEnterCrossMap, actor, lastMapCfgId, mapCfgId)
  1366. gameDebug.debug(TaskHandler.sendTaskState, actor)
  1367. gameDebug.debug(RoleAttr.enterMap, actor, mapCfgId)
  1368. gameDebug.debug(onHook.enterMap, actor)
  1369. end
  1370. function leavemap(actor, reason)
  1371. gameDebug.debug(HpMpRecover.record, actor)
  1372. end
  1373. -- @description 地图怪物死亡事件,此时怪物还未从副本中移除
  1374. -- @param 系统对象;地图唯一id;击杀者对象;死亡怪物的配置id
  1375. -- @return
  1376. function mapmonsterdie(system, mapId, killer, monCfgId, monActor)
  1377. -- 昆顿怪物死亡
  1378. KunDun.MonsterDie(mapId, killer, monCfgId, monActor)
  1379. -- 减少秘境挑战次数
  1380. SecretRealm.reduceCount(killer, monCfgId, mapId)
  1381. if table.getKey(CountDownMonsterIds, monCfgId) then
  1382. setsysvar(monActor, "G$_monsterDieTime" .. tostring(monCfgId), os.time())
  1383. end
  1384. local mapInfo = getmapinfobyid(mapId)
  1385. if mapInfo["isdup"] == true then
  1386. -- 是副本
  1387. local dupInfo = getduplicate(mapId)
  1388. local dupType = dupInfo["type"]
  1389. if dupType == DuplicateType.DEVIL_SQUARE then
  1390. elseif dupType == DuplicateType.BLOODY_CASTLE then
  1391. BloodyCastle.BloodyCastleOnMonsterDie(mapId, killer, monCfgId)
  1392. elseif dupType == DuplicateType.BRAVE_TEST then
  1393. BraveTest.BraveTestMonsterDie(mapId, killer, monCfgId, monActor)
  1394. elseif dupType == DuplicateType.WAR_ALLIANCE then
  1395. callonserial(killer, "waralliancemonsterdie", mapId, killer, monCfgId)
  1396. elseif dupType == DuplicateType.PRIVILEGE_BOSS then
  1397. PrivilegeBoss.PrivilegeBossMonsterDie(mapId, killer, monCfgId)
  1398. elseif dupType == DuplicateType.COMBO_TEST then
  1399. ComboTest.ComboTestMonsterDie(mapId, killer, monCfgId, monActor)
  1400. elseif dupType == DuplicateType.BIG_SECRET_REALM then
  1401. BigSecretRealm.BigSecretRealmMonsterDie(mapId, killer, monCfgId, monActor)
  1402. end
  1403. end
  1404. end
  1405. function waralliancemonsterdie(killer, mapId, acotr, monCfgId)
  1406. WarAlliance.OnKillWarAllianceMonster(mapId, acotr, monCfgId)
  1407. end
  1408. -- @description 地图怪物死亡事件,此时怪物已经从副本中移除
  1409. -- @param 系统对象;地图唯一id;击杀者对象;死亡怪物的配置id
  1410. -- @return
  1411. function mapmonsterremove(system, mapId, killer, monCfgId)
  1412. local mapInfo = getmapinfobyid(mapId)
  1413. if mapInfo["isdup"] == true then
  1414. -- 是副本
  1415. local dupInfo = getduplicate(mapId)
  1416. local dupType = dupInfo["type"]
  1417. if dupType == DuplicateType.RED_FORTRESS then
  1418. RedFortress.OnMonsterDie(mapId, killer)
  1419. elseif dupType == DuplicateType.WOLF_SOUL then
  1420. WolfSoul.MapMonsterRemove(mapId, killer, monCfgId)
  1421. elseif dupType == DuplicateType.ROLAND_SEIGE then
  1422. RolandSeige.MapMonsterRemove(mapId, killer, monCfgId)
  1423. elseif dupType == DuplicateType.WORLD_BOSS then
  1424. WorldBoss.OnMonsterDie( mapId, killer, monCfgId)
  1425. end
  1426. end
  1427. end
  1428. -- @description 用药之后触发自动买药
  1429. -- @param 玩家对象
  1430. -- @return
  1431. function autobuydrug(actor)
  1432. -- 触发自动买药
  1433. AutoBuyPotionScript.autoBuyPotions(actor)
  1434. end
  1435. ---跑马灯事件
  1436. ---@param actor any 玩家对象
  1437. ---@param stringId number cfg_string表配置id
  1438. ---@param text string 跑马灯消息文本
  1439. function horselampevent(actor, stringId, ...)
  1440. noticeTip.noticeinfo(actor, stringId, ...)
  1441. end
  1442. -- 物品拾取前触发
  1443. -- function pickupitemfrontex(actor, items)
  1444. -- local pickItems = getplaydef(actor, "@" .. "HOOK_PICK_ITEMS") or {}
  1445. -- if pickItems[items.objectid] then
  1446. -- return nil
  1447. -- end
  1448. -- return {allow=false}
  1449. -- end
  1450. -- function pickupitemfrontex(actor, items)
  1451. -- local allow = MonAtk.pickUpItem(actor, items)
  1452. -- if allow ~= nil then
  1453. -- return allow
  1454. -- end
  1455. -- local allow = Hook.pickUpItem(actor, items)
  1456. -- if allow ~= nil then
  1457. -- return allow
  1458. -- end
  1459. -- end
  1460. function pickupitembefore(actor, items)
  1461. -- 做每天获取金币总量限制
  1462. -- for _, item in pairs(items) do
  1463. -- local itemId = item["id"]
  1464. -- if item["id"] == 10010001 then
  1465. -- local enough, left_num = Player.GoldCountEnough(0)
  1466. -- if enough then
  1467. -- item["id"] = left_num
  1468. -- else
  1469. -- item["id"] = nil
  1470. -- end
  1471. -- break
  1472. -- end
  1473. -- end
  1474. local allow = MonAtk.pickUpItem(actor, items)
  1475. if allow ~= nil then
  1476. return allow
  1477. end
  1478. local allow = Hook.pickUpItem(actor, items)
  1479. if allow ~= nil then
  1480. return allow
  1481. end
  1482. end
  1483. -- 玩家拾取物品后
  1484. function pickupitem(actor, cfgId)
  1485. MonAtk.checkPickItemBroad(actor, cfgId)
  1486. end
  1487. -- 怪物死亡掉落物品
  1488. function monsterdiedropitem(actor, data)
  1489. MonAtk.monsterDieDrop(actor, data)
  1490. end
  1491. -- @description 背包变化事件
  1492. -- @param 玩家对象 索引 放入或 取出
  1493. -- @return
  1494. function bagchange(actor, index, state)
  1495. -- 取出物品触发自动买药
  1496. if state == 0 then
  1497. AutoBuyPotionScript.autoBuyPotions(actor)
  1498. end
  1499. end
  1500. -- 玩家死亡
  1501. function playdie(actor, dieInfo, killInfo)
  1502. Pet.ClearPet(actor)
  1503. BraveTest.playerDie(actor)
  1504. ComboTest.playerDie(actor)
  1505. RedFortress.PlayerDie(actor)
  1506. Mail.playerDie(actor, dieInfo, killInfo)
  1507. SecretRealm.playerDie(actor)
  1508. pk.PlayerDie(actor, dieInfo, killInfo)
  1509. end
  1510. ---装备回收事件
  1511. function recovery(actor, data, reward)
  1512. ItemRecycling.recyclingRateReward(actor, reward)
  1513. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.RECOVERY, data)
  1514. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.RECOVERY_GET_APPOINT_ITEM, reward)
  1515. end
  1516. -- 获取经验事件
  1517. function getexp(actor, exp, fromType, expAddRate)
  1518. bubblePointGetExp(actor, exp, fromType, expAddRate)
  1519. end
  1520. function printTable(t, indent)
  1521. indent = indent or 0
  1522. local spaces = string.rep(" ", indent)
  1523. for k, v in pairs(t) do
  1524. if type(v) == "table" then
  1525. print(spaces .. tostring(k) .. ":")
  1526. printTable(v, indent + 4)
  1527. else
  1528. print(spaces .. tostring(k) .. " = " .. tostring(v))
  1529. end
  1530. end
  1531. end
  1532. ---攻击触发,攻击对象掉血之后触发
  1533. function attack(actor, fightData)
  1534. -- messagebox(actor,"玩家攻击")
  1535. -- local caster = fightData["caster"]
  1536. -- local target = fightData["target"]
  1537. -- local mapId = fightData["mapid"]
  1538. -- local skillLevel = fightData["skilllevel"]
  1539. -- local casterType = fightData["castertype"]
  1540. -- local targetType = fightData["targettype"]
  1541. local targetHurt = fightData["targethurt"]
  1542. -- for key, paramMap in pairs(fightData) do
  1543. -- info("fightData key = " .. key )
  1544. -- if key ~= "caster" and key ~= "target" then
  1545. -- info("fightData value = " .. paramMap )
  1546. -- end
  1547. -- end
  1548. -- local caster=fightData["caster"]
  1549. -- printTable(fightData)
  1550. -- local mapCfgId = fightData["mapcfgid"]
  1551. -- local targetCfgId = fightData["targetcfgid"]
  1552. -- Buffer.OnAttack(actor, fightData["target"])
  1553. EquipGem.setSpeedBonus(actor)
  1554. -- EquipGuard.guardHpChange(actor, targetHurt)
  1555. if fightData.castertype == MapObjectType.PLAYER then
  1556. KunDun.Attack(actor, fightData)
  1557. PlayerFight.AttackTrigger(actor, fightData)
  1558. -- 增加大天使装备经验
  1559. AngelMajorEquipment.attack(actor, fightData)
  1560. end
  1561. RolandSeige.Attack(actor, fightData)
  1562. -- EquipDurability.attack(actor, fightData)
  1563. EquipDurability.attackCareer3(actor)
  1564. WorldBoss.Attack(actor, fightData)
  1565. end
  1566. -- @description 玩家复活事件
  1567. -- @param 玩家对象
  1568. -- @return
  1569. function revival(actor, type)
  1570. RedFortress.PlayerRelive(actor)
  1571. PrivilegeBoss.playerRelive(actor)
  1572. WarAlliance.playerRelive(actor, type)
  1573. RolandSeige.PlayerRelive(actor)
  1574. AGAndSD.playerRelive(actor)
  1575. end
  1576. -- @description 不管大退,小退还是断开连接都会执行
  1577. -- @param 玩家对象
  1578. -- @return
  1579. function quit(actor)
  1580. DuplicateCommon.OfflineQuitGame(actor)
  1581. -- Union.sendLeaderOnlineStateMsg(play)
  1582. Chat.onQuitGame(actor)
  1583. end
  1584. -- 创建角色事件
  1585. function creatrole(actor)
  1586. RankScript.addNewRole(actor)
  1587. end
  1588. -- 玩家加入战盟前
  1589. function guildaddmember(actor)
  1590. -- UnionArmbands.onEnterUnion(actor)
  1591. end
  1592. function guildaddmemberafter(actor, union_id)
  1593. UnionArmbands.onEnterUnion(actor)
  1594. end
  1595. -- 玩家退出战盟前
  1596. function guilddelmemberbefore(actor)
  1597. UnionArmbands.onQuitUnion(actor)
  1598. UnionChangeLeader.clearRunForLeaderMember(actor)
  1599. end
  1600. ---通知刷新外置任务目标
  1601. function updateexternaltaskgoal(actor, taskModule, taskId, type, goalId, goalCount, realParam)
  1602. -- jprint("updateexternaltaskgoal", type, goalId, goalCount, realParam)
  1603. local count = TaskGoal.FlushTaskCount(actor, type, goalId, goalCount, realParam)
  1604. if count ~= goalCount then
  1605. onlyupdatetaskgoal(actor, taskModule, taskId, goalId, count)
  1606. end
  1607. end
  1608. -- 交易行预购成功
  1609. function preoredrsuccess(actor, ownId, itemId)
  1610. Trade.changeItemInfo(actor, ownId, itemId)
  1611. end
  1612. -- 充值事件
  1613. function recharge(actor, rechargeData)
  1614. Recharge.OnRecharge(actor, rechargeData)
  1615. end
  1616. -- 1秒心跳
  1617. function rolesecondheart(actor)
  1618. -- 秒级心跳尽量不要加东西
  1619. PassiveSkill.RoleSecondHeart(actor)
  1620. AGAndSD.onRoleseCond(actor)
  1621. end
  1622. -- 3秒心跳
  1623. function role3secondheart(actor)
  1624. TransferCard.CheckTransfermationExpired(actor, true)
  1625. -- 玩家泡点
  1626. SecondHeartBP(actor)
  1627. -- 安全区buff
  1628. Buffer.safetyAreaBuff(actor)
  1629. -- 经验药水过期检测,防止角色退出,时间间隔函数失效
  1630. ExpBoost.expBoostExpireCheck(actor)
  1631. end
  1632. -- 5秒心跳
  1633. function role5secondheart(actor)
  1634. -- 角色PK值处理
  1635. pk.SecondHeartPkValue(actor)
  1636. -- 玩家称号过期检查
  1637. EquipAndAppear.checktitleovertime(actor)
  1638. -- 玩家变身戒指过期检查
  1639. EquipAndAppear.checkringovertime(actor)
  1640. end
  1641. -- 10秒心跳
  1642. function role10secondheart(actor)
  1643. -- 检测玩家特权卡过期
  1644. PrivilegeCardScript.checkPrivilegeExpire(actor)
  1645. -- 检测玩家月卡过期
  1646. MonthCard.checkmonthcardtime(actor)
  1647. -- 记录玩家离线挂机的最后时间
  1648. onHook.recordLastTime(actor)
  1649. TimeLimitGift.checkTimeLimitGiftTime(actor)
  1650. end
  1651. -- 分钟心跳
  1652. function roleminuteheart(actor)
  1653. local now = getbaseinfo("nowsec")
  1654. local lastTime = now - 60
  1655. if not TimeUtil.isSameDay(now, lastTime) then
  1656. MonthCard.receivemonthcardthreetime(actor)
  1657. end
  1658. Mount.checkMountTime(actor)
  1659. -- 装备耐久改为60秒扣一次
  1660. EquipDurability.attackCost(actor)
  1661. EquipDurability.underattackCost(actor)
  1662. end
  1663. -- 判断当前时间是否是每天的凌晨 主要用于每天凌晨的服务器数据刷新
  1664. local function __isDayZero(seconds)
  1665. local now = TimeUtil.timeToDate(seconds)
  1666. -- 每小时调用一次,所有只需要判定小时就行不需要分钟
  1667. return now.hour == 0
  1668. end
  1669. -- 小时心跳
  1670. function rolehourheart(actor)
  1671. DailyLotteryDraw.flushDailyLotteryDraw(actor)
  1672. local seconds = getbaseinfo("nowsec")
  1673. if __isDayZero(seconds) then
  1674. -- 每天凌晨事件
  1675. MonthCard.limitCount(actor, MonthCard.monthcardtype.DAY)
  1676. ZeroEventListerTable:triggerEvent("0", actor)
  1677. SevenLogin.midNightUpdate(actor)
  1678. AngelWeapon.updateTaskInfo(actor)
  1679. RechargeSevenReceive.midNightUpdate(actor)
  1680. end
  1681. if TimeUtil.isMondayZero(seconds) then
  1682. -- 每周一凌晨事件
  1683. MonthCard.limitCount(actor, MonthCard.monthcardtype.WEEK)
  1684. end
  1685. if TimeUtil.isMonthZero(seconds) then
  1686. -- 每月1号凌晨事件
  1687. MonthCard.limitCount(actor, MonthCard.monthcardtype.MONTH)
  1688. end
  1689. -- 连击试炼增加副本次数
  1690. ComboTest.roleHourHeart(actor)
  1691. end
  1692. --- 活动次数重置后触发
  1693. ---@param actor table 玩家对象
  1694. ---@param activityId number 活动ID
  1695. ---@param count number 重置后次数
  1696. function afteractivitycountreset(actor, activityId, count)
  1697. VipPrivilege.entryCountHandler(actor, activityId)
  1698. end
  1699. -- @description 脚本计算角色最终属性
  1700. -- @param 玩家对象
  1701. -- @return
  1702. function calcplayfinalattr(actor)
  1703. return RoleAttr.CalcPlayFinalAttr(actor)
  1704. end
  1705. -- @description 内置传送拦截事件,做自定义传送
  1706. -- @param 玩家对象 当前x坐标 当前y坐标 原目标x坐标 原目标y坐标
  1707. -- @return 拦截结果 {result= true,reason = "ttt", ignoreNotice = false}
  1708. -- true标识拦截,执行脚本内逻辑,放弃原传送,false 标识放行,执行原传送; reason为拦截原因说明; ignoreNotice为是否忽略向客户端发送拦截提示,默认发送
  1709. function customtotransmit(actor, targetMap, targetLine, currX, currY, x, y, fromMapMove)
  1710. -- info("MS customtotransmit-> ", actor, targetMap, targetLine, currX, currY, x, y, fromMapMove)
  1711. local checkResult, tip = LineManager.CheckCanEnterLineMap(actor, targetMap, targetLine)
  1712. -- info(string.format("MS customtotransmit-> checkResult: %s", checkResult))
  1713. if checkResult ~= nil and checkResult == false then
  1714. -- tipinfo(actor, tip)
  1715. return {result = true, reason = tip}
  1716. end
  1717. return CustomTransmit.CustomToTransmit(actor, targetMap, targetLine, currX, currY, x, y, fromMapMove)
  1718. end
  1719. -- 次事件触发的时候玩家还未进入地图,所以使用actor作为参数的命令还无法使用
  1720. function enterscene(actor, srcMapId, targetMapId)
  1721. local srcMapCfgId, _ = gamemap.parseMapKey(srcMapId)
  1722. local targetMapCfgId, _ = gamemap.parseMapKey(targetMapId)
  1723. -- jprint("玩家进入场景", actor, srcMapCfgId, targetMapCfgId)
  1724. local srcServerType = ConfigDataManager.getTableValue("cfg_map_info", "servertype", "id", srcMapCfgId)
  1725. local targetServerType = ConfigDataManager.getTableValue("cfg_map_info", "servertype", "id", targetMapCfgId)
  1726. -- 从跨服进入本服的时候执行这个
  1727. if srcServerType ~= nil and targetServerType ~= nil and srcServerType ~= targetServerType then
  1728. if tonumber(targetServerType) == 1 then
  1729. local x, y = CustomTransmit.GetPointFromMapMove(targetMapCfgId)
  1730. return {
  1731. x = x,
  1732. y = y
  1733. }
  1734. end
  1735. end
  1736. return nil
  1737. end
  1738. --- 怪物死亡事件(掉落之前触发计算掉落道具)
  1739. ---@param monsterActor table 怪物对象
  1740. ---@param dieParam table 怪物死亡参数
  1741. function monsterdiep(monsterActor, monsterCfgId, killerId, ownerId, maxHurtRid, mapId, mongenCfgId, dieParam)
  1742. -- jprint("怪物死亡", monsterActor, dieParam)
  1743. -- 怪物死亡触发活动、任务等功能数据更新
  1744. MonsterScript.MonsterDieTrigger(monsterActor, dieParam)
  1745. -- 计算怪物掉落道具
  1746. local dropResult = MonsterScript.MonsterDieCulDrop(monsterActor, dieParam)
  1747. return dropResult
  1748. end
  1749. -- 宠物召唤后触发
  1750. function callpetafter(actor, petCfgId, petId)
  1751. Pet.onCall(actor, petCfgId, petId)
  1752. end
  1753. --- 传送后事件
  1754. function aftertransmit(actor)
  1755. onHook.afterTransmit(actor)
  1756. end
  1757. ---物品进背包后触发
  1758. ---@param actor 玩家对象
  1759. ---@param itemId 道具唯一id
  1760. ---@param itemCfgId 道具配置id
  1761. ---@param index 背包索引
  1762. function addbag(actor, itemId, itemCfgId, index)
  1763. EquipAndAppear.ItemAdd(actor, itemId, itemCfgId)
  1764. OpenServerAct.UpdateEquipFirstDropRank(actor, tonumber(itemCfgId))
  1765. -- 大天使装备初始化成长属性
  1766. AngelMajorEquipment.initAngelEquipmentAttr(actor, itemId, itemCfgId)
  1767. -- 大秘境钥匙等级初始化
  1768. BigSecretRealm.initKeyLevel(actor, itemCfgId)
  1769. -- 大天使圣杯初始化
  1770. AngelMajorGrail.initGrailEntry(actor, itemId, itemCfgId)
  1771. EquipRandom.newItmToBag(actor, itemId, itemCfgId)
  1772. end
  1773. --- 战盟创建后触发,初始化战盟数据
  1774. function loadguild(actor)
  1775. UnionTask.onUnionCreate(actor)
  1776. end
  1777. --- 战盟解散后触发,清理战盟数据
  1778. function guildclosebefore(actor)
  1779. UnionTask.onUnionClose(actor)
  1780. end
  1781. function createmap(sys, uniqueMapId)
  1782. local mapCfgId, mapLine = gamemap.parseMapKey(uniqueMapId)
  1783. -- jprint("地图被创建", uniqueMapId, mapCfgId, mapLine)
  1784. GameMapHeart.AddMap(uniqueMapId)
  1785. end
  1786. function destroymap(sys, uniqueMapId)
  1787. local mapCfgId, mapLine = gamemap.parseMapKey(uniqueMapId)
  1788. -- jprint("地图被销毁", uniqueMapId, mapCfgId, mapLine)
  1789. GameMapHeart.RemoveMap(uniqueMapId)
  1790. end
  1791. function attrupdate(actor, mapobjecttype)
  1792. if mapobjecttype == nil then
  1793. mapobjecttype = getbaseinfo(actor, "mapobjecttype")
  1794. end
  1795. if mapobjecttype == MapObjectType.PLAYER then
  1796. local attackSpeedBonus = getattrinfo(actor, "attackSpeedBonus")
  1797. local attackSpeedBonusValue = attackSpeedBonus * 10000
  1798. attackSpeedBonusValue = 10000 + attackSpeedBonusValue
  1799. updateparam(actor, 4, attackSpeedBonusValue)
  1800. elseif mapobjecttype == MapObjectType.MONSTER or mapobjecttype == MapObjectType.PET then
  1801. local monsterMoveSpeed = getattrinfo(actor, "monsterMoveSpeed")
  1802. if monsterMoveSpeed ~= 0 then
  1803. local monInfo = getmonsterinfo(actor)
  1804. if monInfo == nil then
  1805. return
  1806. end
  1807. local monsterId = monInfo["cfgid"]
  1808. local aiId = ConfigDataManager.getTableValue("cfg_monster", "ai", "id", monsterId)
  1809. local strWalkTime = ConfigDataManager.getTableValue("cfg_monster_ai", "walktime", "id", aiId)
  1810. if not string.isNullOrEmpty(strWalkTime) then
  1811. local walkTime = tonumber(strWalkTime)
  1812. -- monsterMoveSpeed 值是负数的
  1813. local newWalkTime = walkTime - walkTime * monsterMoveSpeed
  1814. -- jprint("monster attrupdate", monsterId, aiId, walkTime, newWalkTime)
  1815. setmonsterwalktime(actor, newWalkTime)
  1816. end
  1817. end
  1818. end
  1819. end
  1820. -- 角色删除后触发
  1821. function afterdeleterole(actor)
  1822. RankScript.removeRole(actor)
  1823. UnionChangeLeader.clearRunForLeaderMember(actor)
  1824. end
  1825. -- 地图心跳事件,lua内部触发
  1826. function lua_mapsecondheart(uniMapId, mapId)
  1827. end
  1828. -- 地图3秒心跳事件,lua内部触发
  1829. function lua_map3secondheart(uniMapId, mapId)
  1830. SecretRealm.UpdateHurtTopRank(uniMapId, mapId)
  1831. end
  1832. -- 地图5秒心跳事件,lua内部触发
  1833. function lua_map5secondheart(uniMapId, mapId)
  1834. end
  1835. --- 离线挂机战斗获得经验事件
  1836. ---@param actor 玩家对象
  1837. ---@param exp 经验值
  1838. function getofflineexp(actor, exp)
  1839. onHook.saveOfflineFightExp(actor, exp)
  1840. end
  1841. -- 获取摆摊位置
  1842. function stallmapinfo(actor, stallPosition)
  1843. Stall.sendStallPosition(actor, stallPosition)
  1844. end
  1845. function buffeffect(targetActor, buffCfgId, casterActor, hurtTotal, targetTotal, layers)
  1846. Buffer.buffeffect(targetActor, buffCfgId, layers, casterActor)
  1847. PassiveSkill.BuffEffect(targetActor, casterActor, buffCfgId)
  1848. end
  1849. function bufflose(actor, buffCfgId)
  1850. Buffer.bufflose(actor, buffCfgId)
  1851. end
  1852. --- 商城购买道具后触发
  1853. function buymallgoodsafter(actor, is_success, goods_id, count)
  1854. local SUCCESS_STATE = 1
  1855. -- 触发任务刷新
  1856. if tonumber(is_success) == SUCCESS_STATE then
  1857. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.MALL_BUY_GOODS, goods_id)
  1858. local configShop = ConfigDataManager.getById("cfg_shopMall", goods_id)
  1859. if configShop == nil then
  1860. return
  1861. end
  1862. if configShop.countkey == nil or configShop.countkey == "" or tonumber(configShop.countkey) <= 0 then
  1863. return
  1864. end
  1865. -- info("商城购买道具触发计数:id=" .. goods_id, "count=" .. count)
  1866. CountManager.count(actor, configShop.countkey, count)
  1867. end
  1868. end
  1869. --- 购买NPC商城道具后触发 is_success 是否购买成功,1:成功,0:失败 item_id 和 item_count在购买成功后才会返回
  1870. function buynpcshopgoodsafter(actor, is_success, item_id, item_count)
  1871. if tonumber(is_success) == 1 then
  1872. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.NPC_MALL_BUY_GOODS, item_id)
  1873. end
  1874. end
  1875. --- 分配属性点后触发
  1876. function afterdeployattrpoint(actor)
  1877. TaskHandler.TriggerTaskGoal(actor, TaskTargetType.DEPLOY_ATTR_POINT, true)
  1878. end
  1879. -- 进入地图后初始化怪物
  1880. function initmonster(monster, monsterCfgId)
  1881. MonsterAttribute.Initmonster(monster, monsterCfgId)
  1882. end
  1883. function showgetrewardpanel(actor, items)
  1884. sendluamsg(actor, LuaMessageIdToClient.COMMON_REWARD_PANEL, items)
  1885. end
  1886. -- function setcombovaluebefore(actor, skillCfgId, skillLevel, skill)
  1887. -- return Skill.calculationComboValue(actor, skillCfgId, skillLevel, skill)
  1888. -- end
  1889. -- 内置任务状态改变
  1890. function taskchange(actor, taskId, state, data)
  1891. TaskHandler.onTaskChange(actor, taskId, state)
  1892. end
  1893. --- 销毁物品触发
  1894. ---@param actor table 玩家对象
  1895. ---@param cfgId number 道具配置id
  1896. ---@param itemId number 道具唯一id
  1897. function destroyitem(actor, cfgId, itemId)
  1898. AngelMajorEquipment.destroyAngelEquip(actor, cfgId, itemId)
  1899. AngelMajorGrail.destroyAngelGrail(actor, cfgId, itemId)
  1900. end
  1901. --- 怪物复活
  1902. function monsterrelive(monster, monsterCfgId)
  1903. SanctuaryBoss.monsterRelive(monster)
  1904. MonsterAttribute.Initmonster(monster, monsterCfgId)
  1905. initmonsterTip(monster, monsterCfgId)
  1906. end
  1907. --- 自动回收道具
  1908. function autorecoverybefore(actor)
  1909. return ItemRecycling.autoRecycling(actor)
  1910. end
  1911. -- 玩家设置改变
  1912. function settingchange(actor, type, oldValue, value)
  1913. gameDebug.debug(KunDun.FightModelChange, actor, type, value)
  1914. RolandSeige.RolandSettingChange(actor, tonumber(type), tonumber(value))
  1915. end
  1916. --- 获取跨服玩家变量异步回调
  1917. ---@param actor table 玩家对象
  1918. ---@param varName string 变量名
  1919. ---@param varValue string 变量值
  1920. function getplaydefasyncres(actor, varName, varValue, params)
  1921. -- jprint("获取其他服玩家数据", actor, varName, varValue, params)
  1922. if string.equalsIgnoreCase(varName, PlayerDefKey.angel.ANGEL_EQUIPMENT_ATTR_DATA) then
  1923. AngelMajorEquipment.sendPlayerAngelEquipInfo(actor, varValue, params)
  1924. end
  1925. end
  1926. --- 世界聊天成功触发
  1927. function worldchatsuccess(actor)
  1928. -- jprint("世界聊天发送成功")
  1929. sendluamsg(actor, LuaMessageIdToClient.RES_WORLD_CHAT_SUCCESS, true)
  1930. end
  1931. --- 外置聊天频道触发事件
  1932. function outversionchatevent(actor, param)
  1933. Chat.OutVersionChant(actor, param)
  1934. end
  1935. --- 技能升级事件
  1936. function levelupskillevent(actor, skillInfo)
  1937. info(skillInfo)
  1938. Skill.levelUp(actor, skillInfo)
  1939. end
  1940. function clicknpc(actor, npcid)
  1941. GameEvent.push(EventCfg.onClicknpc, actor, npcid)
  1942. end
  1943. function playerexitview(actor, playerid)
  1944. local playerActor = getactor(playerid)
  1945. local mapobjecttype = getbaseinfo(playerActor, "mapobjecttype")
  1946. if mapobjecttype ~= MapObjectType.PLAYER then
  1947. return
  1948. end
  1949. local ownerId = getbaseinfo(actor, "id")
  1950. sendluamsg(actor, 10000500, {
  1951. playerid = playerid
  1952. })
  1953. sendluamsg(playerActor, 10000500, {
  1954. playerid = ownerId
  1955. })
  1956. end
  1957. -- function beforetakeoncheckequip(actor,bagIndex,equipIndex)
  1958. -- local itemInfo = getbagiteminfo(actor,bagIndex,0)
  1959. -- local itemId = itemInfo.id
  1960. -- messagebox(actor,"itemId="..itemId)
  1961. -- messagebox(actor,"bagIndex="..bagIndex)
  1962. -- if not Equip_QiangHua.checkTakeOnNeed(actor,itemId) then
  1963. -- messagebox(actor,"属性不足,无法穿戴!")
  1964. -- return true
  1965. -- end
  1966. -- return false
  1967. -- -- return true
  1968. -- end
  1969. function filtertakeonequip(actor, msgData)
  1970. local bagIndex = msgData.bagindex
  1971. local itemInfo = getbagiteminfo(actor, bagIndex, 0)
  1972. if itemInfo == nil then
  1973. return
  1974. end
  1975. local itemId = itemInfo.id
  1976. if not Equip_QiangHua.checkTakeOnNeed(actor, itemId) then
  1977. messagebox(actor, "属性不足穿戴失败")
  1978. return false
  1979. end
  1980. local pos = msgData.pos
  1981. local career = getbaseinfo(actor, "getbasecareer")
  1982. local isPart = ConfigDataManager.getTableValue("cfg_character_create", "isPart", "id", career)
  1983. -- 副手装备
  1984. if pos == 2 and (isPart and isPart ~= '') then
  1985. local equipField = ConfigDataManager.getTableValue("cfg_item", "field", "id", itemInfo.cfgid)
  1986. local equipPart = ConfigDataManager.getTableValue("cfg_model_charactor", "part", "id", equipField)
  1987. -- local config = ConfigDataManager.getById("cfg_item", itemId)
  1988. -- local config = ConfigDataManager.getById("cfg_model_charactor", itemId)
  1989. -- if isPart ~= tonumber(config['subtype']) then
  1990. if tonumber(isPart) ~= tonumber(equipPart) then
  1991. messagebox(actor, "条件不符,穿戴失败")
  1992. return false
  1993. end
  1994. end
  1995. return true
  1996. end
  1997. function initmonsterTip(actor, monsterId)
  1998. local bossName = ConfigDataManager.getTableValue("cfg_monster", "name", "id", monsterId)
  1999. local bossType = ConfigDataManager.getTableValue("cfg_monster", "type", "id", monsterId)
  2000. local mapId = getbaseinfo(actor, "mapid")
  2001. local mapName = ConfigDataManager.getTableValue("cfg_map_info", "mapname", "id", mapId)
  2002. if tonumber(bossType) == 3 then -- 只有BOSS才通知
  2003. noticeTip.noticeinfo(actor, StringIdConst.TEXT35005, bossName, mapName)
  2004. end
  2005. end
  2006. -- @description 货币变化事件
  2007. -- 参数说明:actor 玩家对象;cfgId 物品配置id 原来数量 现在数量
  2008. function moneychangex(actor,cfgId,oldCount,newCount)
  2009. -- info("moneychangex-> ", actor, cfgId, oldCount, newCount)
  2010. callonserial(actor,"_savemoneydata",cfgId,newCount)
  2011. end
  2012. -- 保存货币数据
  2013. function _savemoneydata(actor,cfgId,newCount)
  2014. -- info("savemoneydata-> ", actor, cfgId, newCount)
  2015. local uid = getbaseinfo(actor, "uid")
  2016. local mData = getsysvar(actor, "R$MoneyData_"..uid) or {}
  2017. if mData[cfgId] ~= nil and newCount then
  2018. mData[cfgId] = newCount
  2019. setsysvar(actor, "R$MoneyData_"..uid, mData)
  2020. end
  2021. end
  2022. -- function triggerchat(actor,table)
  2023. -- -- local actor1 = getactor(table.senderid)
  2024. -- -- local name = getbaseinfo(actor1, "rolename")
  2025. -- -- local rid = getbaseinfo(actor1, "rid")
  2026. -- local uid = getbaseinfo(actor, "uid")
  2027. -- local DataTab = {}
  2028. -- local data = string.split(table.content, "#")
  2029. -- if #data >= 2 then
  2030. -- local cmd = data[1]
  2031. -- local itemId = tonumber(data[2])
  2032. -- -- local itemCount = tonumber(data[3]) or 1
  2033. -- if cmd == "additem" then
  2034. -- additemtobag(actor, itemId, 1)
  2035. -- elseif cmd == "in" then
  2036. -- gset(actor, "G@DePots", uid, DataTab)
  2037. -- elseif cmd == "out" then
  2038. -- end
  2039. -- end
  2040. -- end