LskTest.lua 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. LSK_Test = {}
  2. LSK_Test.__index = LSK_Test
  3. local this = {}
  4. -- ------------------------------------------------------------- --
  5. -- 测试入口 @lua l_test_main
  6. function l_test_main(actor)
  7. jprint("-------- lua test main function --------")
  8. -- setplayersetting(actor, 1, 13)
  9. -- local fightModel = getbaseinfo(actor, "fightmodel")
  10. -- tipinfo(actor, "fightmodel: " .. fightModel)
  11. --local data = createitemsbymap({ [20310121] = 1 })
  12. --this.debug("createitem:", data)
  13. --
  14. --sendmailbycompleteitems(actor, actor:toString(), "测试邮件001", "这是邮件00001", data)
  15. -- sendmailbycompleteitems(actor, actor:toString(), "测试邮件001", "这是邮件00001")
  16. end
  17. -- ------------------------------------------------------------- --
  18. -- 测试入口 @lua l_test_main1
  19. function l_test_main1(actor)
  20. jprint("-------- lua test main1 function --------")
  21. KunDun.EnterKunDun(actor)
  22. end
  23. -- 测试入口 @lua l_test_main2
  24. function l_test_main2(actor)
  25. jprint("-------- lua test main2 function --------")
  26. KunDun.sendPanelData(actor)
  27. end
  28. -- 测试入口 @lua l_test_main3
  29. function l_test_main3(actor)
  30. jprint("-------- lua test main3 function --------")
  31. quitduplicate(actor)
  32. end
  33. -- 测试入口 @lua l_test_main4
  34. function l_test_main4(actor)
  35. jprint("-------- lua test main4 function --------")
  36. sendmailbyrid(actor:toString(), "这是标题", "这是正文", { [20310111] = 1 })
  37. end
  38. -- ------------------------------------------------------------- --
  39. -- 获取地图信息
  40. -- @lua l_test_map_info
  41. function l_test_map_info(actor)
  42. local mapId = getbaseinfo(actor, "mapid")
  43. local x = getbaseinfo(actor, "x")
  44. local y = getbaseinfo(actor, "y")
  45. jprint("当前地图ID:", mapId, x, y)
  46. end
  47. -- 校验是否可以进入跨服地图
  48. -- @lua l_test_chack_is_can_enter_cross_map 21000
  49. function l_test_chack_is_can_enter_cross_map(actor, map_id)
  50. local ret = CrossMap.canEnter(actor, map_id)
  51. this.jprint("检查是否可以进入跨服地图:", map_id, "result:", ret)
  52. end
  53. -- 初始化圣域BOSS缓存数据
  54. -- @lua l_test_sanctuary_boss_init_cache
  55. function l_test_sanctuary_boss_init_cache()
  56. SanctuaryBoss.initBossState()
  57. end
  58. -- 结算战盟更换盟主
  59. -- @lua l_test_finish_union_change_leader
  60. function l_test_finish_union_change_leader(actor)
  61. UnionChangeLeader.RunForLeader.finishRunforLeaderActor()
  62. end
  63. -- 战盟臂章最大等级缓存
  64. -- @lua l_test_union_armbands_init_cache
  65. function l_test_union_armbands_init_cache()
  66. UnionArmbands.serverStart()
  67. end
  68. -- 发起定点传送
  69. -- @lua l_test_transfer_within_map 210 180
  70. function l_test_transfer_within_map(actor, x, y)
  71. MapMoveTransfer.transferWithinMap(actor, { x, y })
  72. end
  73. -- 充值月卡礼包7001
  74. -- @lua l_test_month_gift_recharge_event 7001 1401
  75. function l_test_month_gift_recharge_event(actor, param, id)
  76. MonthGiftPack.rechargeEvent(actor, { ['parameter'] = param, ['id'] = id })
  77. end
  78. -- 领取月卡每日礼包
  79. -- @lua l_test_month_gift_req_recharge 1401
  80. function l_test_month_gift_req_recharge(actor, id)
  81. MonthGiftPack.reqRechargeAction(actor, _, "reward", { ["id"] = id })
  82. end
  83. -- 昆顿上架道具
  84. -- @lua l_test_kun_dun_auction_system_publish
  85. function l_test_kun_dun_auction_system_publish()
  86. KunDunAuction.Publish()
  87. end
  88. -- 昆顿执行一次定时器
  89. -- @lua l_test_kun_dun_auction_on_timer
  90. function l_test_kun_dun_auction_on_timer()
  91. KunDunAuction.ontimer()
  92. end
  93. -- 昆顿执行竞拍
  94. -- @lua l_test_kun_dun_auction_player_bid 19142921868113925
  95. function l_test_kun_dun_auction_player_bid(actor, goodsId)
  96. local msgData = {['goodsId'] = goodsId, ['type'] = 0}
  97. KunDunAuction.PlayerBidding(actor, msgData)
  98. end
  99. -- ------------------------------------------------------------- --
  100. this.log_open = true
  101. this.log_name = "[LskTest]"
  102. function this.debug(...)
  103. if not this.log_open then
  104. return
  105. end
  106. gameDebug.print(this.log_name, ...)
  107. end
  108. function this.jprint(...)
  109. if not this.log_open then
  110. return
  111. end
  112. if param == nil then
  113. param = "error! 输出内容为空. nil"
  114. end
  115. jprint(this.log_name, ...)
  116. end
  117. function this.info(actor, ...)
  118. info(actor, ...)
  119. this.jprint(...)
  120. end