2021-04-27 18:37:05 -03:00
|
|
|
local setting = {
|
|
|
|
|
[16198] = SKILL_SWORD,
|
|
|
|
|
[16199] = SKILL_AXE,
|
|
|
|
|
[16200] = SKILL_CLUB,
|
|
|
|
|
[16201] = SKILL_DISTANCE,
|
2023-09-10 10:17:19 -07:00
|
|
|
[16202] = SKILL_MAGLEVEL,
|
2026-02-19 16:46:12 -03:00
|
|
|
[50296] = SKILL_FIST,
|
2021-04-27 18:37:05 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
local skillTrainer = Action()
|
|
|
|
|
|
|
|
|
|
function skillTrainer.onUse(player, item, fromPosition, target, toPosition, isHotkey)
|
|
|
|
|
local skill = setting[item:getId()]
|
|
|
|
|
if not player:isPremium() then
|
|
|
|
|
player:sendCancelMessage(RETURNVALUE_YOUNEEDPREMIUMACCOUNT)
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if player:isPzLocked() then
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
player:setOfflineTrainingSkill(skill)
|
2022-03-11 12:31:54 -03:00
|
|
|
player:remove(false)
|
2021-04-27 18:37:05 -03:00
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
for index, value in pairs(setting) do
|
|
|
|
|
skillTrainer:id(index)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
skillTrainer:register()
|