• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Action Offline Training for 8.60

Bump


[03/02/2014 23:38:59] [Error - LuaScriptInterface::loadFile] cannot open data/creaturescripts/scripts/offtrain_login.lua: No such file or directory
[03/02/2014 23:38:59] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/offtrain_login.lua)
[03/02/2014 23:38:59] cannot open data/creaturescripts/scripts/offtrain_login.lua: No such file or directory
[03/02/2014 23:38:59] [Error - LuaScriptInterface::loadFile] cannot open data/creaturescripts/scripts/offtrain_logout.lua: No such file or directory
[03/02/2014 23:38:59] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/offtrain_logout.lua)
[03/02/2014 23:38:59] cannot open data/creaturescripts/scripts/offtrain_logout.lua: No such file or directory
 
Solved --// But... when i click on a statue nothing happens! .. even not gettint the cancel message "Sorry, not possible" or "You cannot use that tem"....
bump
 
Solved --// But... when i click on a statue nothing happens! .. even not gettint the cancel message "Sorry, not possible" or "You cannot use that tem"....
bump
same here =(

#FIXED

YOU HAVE TO ADD ACTION ID: 1000 TO THOSE STATUES IN MAP EDITOR!

cool, it works perfectly on tfs 3.7. :p 9.44
 
Last edited:
Don't work for TFS 1.1. 10.77 :(
I get this when I click ingame at any of the statues:
4wztagnm.jpg

How to fix? Any ideas?
It does not even work with Acion ID 1000 on Statues.
 
Last edited:
Don't work for TFS 1.1. 10.77 :(
I get this when I click ingame at any of the statues:
4wztagnm.jpg

How to fix? Any ideas?
It does not even work with Acion ID 1000 on Statues.
TFS 1.1 has this function as default, you only have to place the statues where you want.
 
Hello i do not know if anyone else has posted this, If so please let me know and ill remove it.

EYyVggq.jpg


Data/Actions/Actions.xml
Code:
--Offline Training--
<action itemid="8834" event="script" value="other/offlinetraining.lua"/>
<action itemid="10353" event="script" value="other/offlinetraining.lua"/>
<action itemid="8626" event="script" value="other/offlinetraining.lua"/>
<action itemid="1444" event="script" value="other/offlinetraining.lua"/>
<action itemid="10349" event="script" value="other/offlinetraining.lua"/>

Data/Actions/Scripts/Others/offlinetraining.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if(item.itemid == 1444) then -- sword
     doCreatureSetStorage(cid, 62669, SKILL_SWORD)
   elseif(item.itemid == 10349) then -- axe
     doCreatureSetStorage(cid, 62669, SKILL_AXE)
   elseif(item.itemid == 8834) then -- mlvl
     doCreatureSetStorage(cid, 62669, SKILL__MAGLEVEL)
   elseif(item.itemid == 8626) then -- club
     doCreatureSetStorage(cid, 62669, SKILL_CLUB)
   elseif(item.itemid == 10353) then -- distannce
     doCreatureSetStorage(cid, 62669, SKILL_DISTANCE)
   end
   if item.actionid == 1000 then
   doRemoveCreature(cid)
end
   return true
end

-----------------------------------------------------------------------

Creature Scripts

Data/Creaturescripts/Creaturescripts.xml
Code:
<event type="login" name="offtrain_PlayerLogin" event="script" value="offtrain_login.lua"/>
<event type="logout" name="offtrain_PlayerLogout" event="script" value="offtrain_logout.lua"/>

Data/Creaturescripts/Scripts/offlinetrain_login.lua
Code:
-- 0.4 - offline training - login.lua
function onLogin(cid)
   OfflineTraining_initialize(cid)
   if(OfflineTraining_isTraining(cid)) then
     OfflineTraining_turnOffTraining(cid)
     -- we add skill/mlvl, we select lower value: time that player was offline OR offline training time [bar in game - 9.6]
     OfflineTraining_addTrainedSkills(cid, math.min(OfflineTraining_getTime(cid), OfflineTraining_getOfflineTime(cid)))
     -- we remove offline training time [bar in game - 9.6],
     -- if player was offline longer then his 'offline training time' it will add him time [like on RL tibia]
     -- got '3  hours offline training time', stay logged off for 8 hours, you get skills for 3 hours and on login you got '5 hours offline training time'
     OfflineTraining_setTime(cid, math.abs(OfflineTraining_getTime(cid) - OfflineTraining_getOfflineTime(cid)))
     OfflineTraining_onEndTraining(cid)
   else
     -- offline training time also regenerate when you are offline, but NOT train
     OfflineTraining_setTime(cid, OfflineTraining_getTime(cid) + OfflineTraining_getOfflineTime(cid))
   end
   return true
end

Data/Creaturescripts/Scripts/offlinetrain_logout.lua
Code:
-- 0.4 - offline training - logout.lua
function onLogout(cid)
   if(OfflineTraining_canStartTraining(cid)) then
     OfflineTraining_turnOnTraining(cid)
     OfflineTraining_onStartTraining(cid)
   end
   OfflineTraining_setLogoutTime(cid)
   return true
end

If anything you think is missing please post and post any errors.
can you tell me something? i have 1.2 tfs in 10.98 and i dont have in rme id 18488 with Skill statue? :D how it possible?
 
can you tell me something? i have 1.2 tfs in 10.98 and i dont have in rme id 18488 with Skill statue? :D how it possible?
yes you should have it:
4cFQXiW.png

if you think this is a problem with your tfs, use the support board because this thread has nothing to do with it :D
 
Thank you i I suppose it works on 0.3.6. it logged me out.
but how can i know how many time i spend on off training?
or how many skills i received?
 
Refresh !! TFS 1.5 , 7.72

ERROR CONSOLE
[Error - mysql_real_query] Query: SELECT id, name, account_id, group_id, sex, vocation, experience, level, maglevel, health, healthmax, blessings, mana, manamax, manaspent, soul, lookbody, lookfeet, lookhead, looklegs, looktype, lookaddons, posx, posy, posz, cap, lastlogin, lastlogout, lastip, conditions, skulltime, skull, town_id, balance, offlinetraining_time, offlinetraining_skill, stamina, skill_fist, skill_fist_tries, skill_club, skill_club_tries, skill_sword, skill_sword_tries, skill_axe, skill_axe_tries, skill_dist, skill_dist_tries, skill_shielding, skill_shielding_tries, skill_fishing, skill_fishing_tries, direction FROM players WHERE id = 1
Message: Unknown column 'offlinetraining_time' in 'field list'
[Error - mysql_store_result] Query: SELECT id, name, account_id, group_id, sex, vocation, experience, level, maglevel, health, healthmax, blessings, mana, manamax, manaspent, soul, lookbody, lookfeet, lookhead, looklegs, looktype, lookaddons, posx, posy, posz, cap, lastlogin, lastlogout, lastip, conditions, skulltime, skull, town_id, balance, offlinetraining_time, offlinetraining_skill, stamina, skill_fist, skill_fist_tries, skill_club, skill_club_tries, skill_sword, skill_sword_tries, skill_axe, skill_axe_tries, skill_dist, skill_dist_tries, skill_shielding, skill_shielding_tries, skill_fishing, skill_fishing_tries, direction FROM players WHERE id = 1
Message: Unknown column 'offlinetraining_time' in 'field list'
 

Attachments

Back
Top