We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
玩家在线期间,会定时获得经验。 获得经验的数量和等级无关,从始至终获得经验的速度都一样。
16625400 / (100*3600)
46 * 5
https://github.com/najoast/eluna_scripts/blob/master/src/online_give_xp.lua
The text was updated successfully, but these errors were encountered:
lua链接失效了。
Sorry, something went wrong.
--[[ * 设计:https://github.com/najoast/qzms_forum/issues/1 * 作者:全栈君 * B站: 全栈游戏开发 https://space.bilibili.com/389407601 * 时间:2023-5-30 17:02:52 ]] local playerId2EventId = {} local function RemoveEvent(player) local eventId = playerId2EventId[player:GetGUIDLow()] if eventId then -- print("移除事件ID", eventId) player:RemoveEventById(eventId) playerId2EventId[player:GetGUIDLow()] = nil end end local function OnTimer(event, delay, repeats, player) if player:GetLevel() >= 80 then RemoveEvent(player) return end player:GiveXP(230) -- print(string.format("玩家 %s 获得了 230 点经验", player:GetName())) end --- @param player Player local function OnPlayerLogin(event, player) -- print(string.format("玩家 %s 上线了,等级 %d, GUIDLow %d", player:GetName(), player:GetLevel(), player:GetGUIDLow())) if player:GetLevel() >= 80 then return end local eventId = player:RegisterEvent(OnTimer, 5000, 0) -- print("注册事件ID", eventId) playerId2EventId[player:GetGUIDLow()] = eventId end local function OnPlayerLogout(event, player) -- print(string.format("玩家 %s 下线了,等级 %d, GUIDLow %d", player:GetName(), player:GetLevel(), player:GetGUIDLow())) RemoveEvent(player) end -- LOGIN RegisterPlayerEvent(3, OnPlayerLogin) RegisterPlayerEvent(4, OnPlayerLogout)
No branches or pull requests
功能概述
玩家在线期间,会定时获得经验。
获得经验的数量和等级无关,从始至终获得经验的速度都一样。
设计目的
数值
16625400 / (100*3600)
= 46 点46 * 5
= 230代码
https://github.com/najoast/eluna_scripts/blob/master/src/online_give_xp.lua
The text was updated successfully, but these errors were encountered: