mirror of
https://github.com/opentibiabr/canary
synced 2026-08-16 06:26:09 -04:00
Rework on exercise weapon with tibia global equal behavior Added config key "maxAllowedOnADummy ", default is "1" Created table for exercise functions and variables Start training with someone already training on that dummy and the message will be sent that someone is already training. If someone is training and connects to the game, that user appears as Exercise Dummy Training . If someone is training, send request to add this player on vip list, that user appears as Exercise Dummy Training. When are training and disconnect from the game, on reconnect, the training stopped.cise Dummy Training When are training and disconnect from the game, on reconnect, the training stopped
17 lines
385 B
Lua
17 lines
385 B
Lua
local logout = CreatureEvent("PlayerLogout")
|
|
|
|
function logout.onLogout(player)
|
|
local playerId = player:getId()
|
|
if nextUseStaminaTime[playerId] then
|
|
nextUseStaminaTime[playerId] = nil
|
|
end
|
|
|
|
if onExerciseTraining[playerId] then
|
|
stopEvent(onExerciseTraining[playerId].event)
|
|
onExerciseTraining[playerId] = nil
|
|
player:setTraining(false)
|
|
end
|
|
return true
|
|
end
|
|
|
|
logout:register()
|