QFunction-0.lua 101 KB

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