Skip to content

Commit

Permalink
fix: offline training messages types and speed
Browse files Browse the repository at this point in the history
  • Loading branch information
omarcopires authored and elsongabriel committed Mar 18, 2024
1 parent 00516b8 commit 11b1213
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions data/scripts/creaturescripts/player/offline_training.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function offlineTraining.onLogin(player)
player:setOfflineTrainingSkill(SKILL_NONE)

if offlineTime < 600 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must be logged out for more than 10 minutes to start offline training.")
player:sendTextMessage(MESSAGE_OFFLINE_TRAINING, "You must be logged out for more than 10 minutes to start offline training.")
return true
end

Expand Down Expand Up @@ -50,13 +50,13 @@ function offlineTraining.onLogin(player)
end

text = string.format("%s.", text)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, text)
player:sendTextMessage(MESSAGE_OFFLINE_TRAINING, text)

local vocation = player:getVocation()
local promotion = vocation:getPromotion()
local topVocation = not promotion and vocation or promotion

local updateSkills = false

if table.contains({ SKILL_CLUB, SKILL_SWORD, SKILL_AXE, SKILL_DISTANCE }, offlineTrainingSkill) then
local modifier = topVocation:getBaseAttackSpeed() / 1000
updateSkills = player:addOfflineTrainingTries(offlineTrainingSkill, (trainingTime / modifier) / (offlineTrainingSkill == SKILL_DISTANCE and 4 or 2))
Expand Down

0 comments on commit 11b1213

Please sign in to comment.