QFunction-0.lua 102 KB

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