• 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!

Training without Training monks

Status
Not open for further replies.

Adiko

GetOnMyHorse
Joined
Apr 25, 2009
Messages
177
Reaction score
0
Location
Poland \ Wodzisław
Like in topic. I need script for tile. You walk on some tile an then showing messenge "Train will start in 30 sec". After that you start train and all skills are adding like in normal training

Sry 4 my bad english
 
Basically he wants Collapsors training method. I agree, this would be an awesome script to have for my server. So if someone could post a script and where to put it I would rep++
 
Lol, it was on the forum but i can't find it too, maybe someone deleted it?
but maybe it's this?
http://otland.net/f81/mining-v3-inkl-miningskill-talkaction-field-decay-more-5518/


#EDIT
OMFG, it was this: http://otland.net/f81/a-23567/ but autor of the topic deleted it...

No longer will you need training monks on your server generating nothing but lag.

I present to you the square trainer as seen on collapser.no-ip.org

This has been tested on tfs 0.3b3, this should work on any tfs version.

This script has been written entirely by me, and works very well, can be easily configured to your needs.

How it works?
The player steps onto a specific square a storage value is then assigned to the player a count down starts, to prevent stacking of skills, once the timer hits 0 the player is given a number of tries (1) times your skill rate every 4 secs to fist, sword, axe, club, distance and shielding, this works indefinetly or until the player steps off the tile.

When the player steps off the tile the storage value is removed, if the player logs out the storage value is removed, if the player logs in on the square they are again assigned the storage value and the timer starts over yet again.

I was going to use this on my server, but im working on a totally different type of game, but still using the the tibia client and its sprites, so i won't be needing it.

Hope you enjoy using it on your servers :)

save this in
data\movements\scripts\sqtrainer.lua
Code:
-- Square Skill Trainer made by Arthur aka artofwork
-- This script will train all of a players skills indefintely
-- It has a small configuration setup where you can set the number of tries per skill
-- The time internveral in between each skill try added
-- A storage value to help prevent abuse
-- This is truely my first script, it comes without support since lua is new to me
-- You can assign any tile you wish to this script that a player can walk on with action id 900


-- Config --
local storage = 18010 -- Storage value for the player when he steps on and off the tile

local skilltries = 1 -- Number of tries per skill
local t = 4 * 1000 -- Set the time before try is added to skills

-------------------------------------------------------------------------
function trainerthree(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
doPlayerSendTextMessage(p.cid,22,"Your training session will begin in 30 seconds")
addEvent(trainertwo, 10 * 1000, p)
end
end
return FALSE
end
function trainertwo(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
doPlayerSendTextMessage(p.cid,22,"Your training session will begin in 20 seconds")
addEvent(trainerone, 10 * 1000, p)
end
end
return FALSE
end
function trainerone(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
doPlayerSendTextMessage(p.cid,22,"Your training session will begin in 10 seconds")
addEvent(readyToTrain, 10 * 1000, p)
end
end
return FALSE
end



function readyToTrain(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
doPlayerSendTextMessage(p.cid,22,"Your training session will now begin")
addEvent(trainMeA, t, p)
end
end
return FALSE
end


function trainMeA(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then

for a = 1, t do
if(a == t) then
doPlayerAddSkillTry(p.cid, SKILL_FIST, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_SWORD, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_CLUB, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_AXE, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_DISTANCE, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_SHIELD, skilltries)
end
end
end
addEvent(trainMeB, t, p)
end
return FALSE
end

function trainMeB(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
for b = 1, t do
if(b == t) then
doPlayerAddSkillTry(p.cid, SKILL_FIST, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_CLUB, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_SWORD, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_AXE, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_DISTANCE, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_SHIELD, skilltries)

end
end
end
addEvent(trainMeA, t, p)
end
return FALSE
end



function onStepIn(cid, item)
local p = {cid = cid, item = item, pos = pos}
setPlayerStorageValue(p.cid, 18010, 1)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
addEvent(trainerthree, 1 * 1000, p)
end
end
return FALSE
end


function onStepOut(cid, item)
getPlayerStorageValue(cid, 18010)
setPlayerStorageValue(cid, 18010, 0)
doPlayerSendTextMessage(cid,22,"Your training session has now ended")
end


place this in movements.xml

Code:
<movevent event="StepIn" actionid="900" script="sqtrainer.lua"/>
<movevent event="StepOut" actionid="900" script="sqtrainer.lua"/>
 
Thank you very much! I have another request. Can someone add that every fourth secod will be added 20% of mana and when mana gets full he will use spell that use whole mana.

Sry for my bad english ;/
 
No longer will you need training monks on your server generating nothing but lag.

I present to you the square trainer as seen on collapser.no-ip.org

This has been tested on tfs 0.3b3, this should work on any tfs version.

This script has been written entirely by me, and works very well, can be easily configured to your needs.

How it works?
The player steps onto a specific square a storage value is then assigned to the player a count down starts, to prevent stacking of skills, once the timer hits 0 the player is given a number of tries (1) times your skill rate every 4 secs to fist, sword, axe, club, distance and shielding, this works indefinetly or until the player steps off the tile.

When the player steps off the tile the storage value is removed, if the player logs out the storage value is removed, if the player logs in on the square they are again assigned the storage value and the timer starts over yet again.

I was going to use this on my server, but im working on a totally different type of game, but still using the the tibia client and its sprites, so i won't be needing it.

Hope you enjoy using it on your servers :)

save this in
data\movements\scripts\sqtrainer.lua
Code:
-- Square Skill Trainer made by Arthur aka artofwork
-- This script will train all of a players skills indefintely
-- It has a small configuration setup where you can set the number of tries per skill
-- The time internveral in between each skill try added
-- A storage value to help prevent abuse
-- This is truely my first script, it comes without support since lua is new to me
-- You can assign any tile you wish to this script that a player can walk on with action id 900


-- Config --
local storage = 18010 -- Storage value for the player when he steps on and off the tile

local skilltries = 1 -- Number of tries per skill
local t = 4 * 1000 -- Set the time before try is added to skills

-------------------------------------------------------------------------
function trainerthree(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
doPlayerSendTextMessage(p.cid,22,"Your training session will begin in 30 seconds")
addEvent(trainertwo, 10 * 1000, p)
end
end
return FALSE
end
function trainertwo(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
doPlayerSendTextMessage(p.cid,22,"Your training session will begin in 20 seconds")
addEvent(trainerone, 10 * 1000, p)
end
end
return FALSE
end
function trainerone(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
doPlayerSendTextMessage(p.cid,22,"Your training session will begin in 10 seconds")
addEvent(readyToTrain, 10 * 1000, p)
end
end
return FALSE
end



function readyToTrain(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
doPlayerSendTextMessage(p.cid,22,"Your training session will now begin")
addEvent(trainMeA, t, p)
end
end
return FALSE
end


function trainMeA(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then

for a = 1, t do
if(a == t) then
doPlayerAddSkillTry(p.cid, SKILL_FIST, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_SWORD, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_CLUB, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_AXE, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_DISTANCE, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_SHIELD, skilltries)
end
end
end
addEvent(trainMeB, t, p)
end
return FALSE
end

function trainMeB(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
for b = 1, t do
if(b == t) then
doPlayerAddSkillTry(p.cid, SKILL_FIST, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_CLUB, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_SWORD, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_AXE, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_DISTANCE, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_SHIELD, skilltries)

end
end
end
addEvent(trainMeA, t, p)
end
return FALSE
end



function onStepIn(cid, item)
local p = {cid = cid, item = item, pos = pos}
setPlayerStorageValue(p.cid, 18010, 1)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
addEvent(trainerthree, 1 * 1000, p)
end
end
return FALSE
end


function onStepOut(cid, item)
getPlayerStorageValue(cid, 18010)
setPlayerStorageValue(cid, 18010, 0)
doPlayerSendTextMessage(cid,22,"Your training session has now ended")
end


place this in movements.xml

Code:
<movevent event="StepIn" actionid="900" script="sqtrainer.lua"/>
<movevent event="StepOut" actionid="900" script="sqtrainer.lua"/>

For some reason this doesnt work for me.
I added a sqr to have action ID of 900.
Any help? ;o
 
No longer will you need training monks on your server generating nothing but lag.

I present to you the square trainer as seen on collapser.no-ip.org

This has been tested on tfs 0.3b3, this should work on any tfs version.

This script has been written entirely by me, and works very well, can be easily configured to your needs.

How it works?
The player steps onto a specific square a storage value is then assigned to the player a count down starts, to prevent stacking of skills, once the timer hits 0 the player is given a number of tries (1) times your skill rate every 4 secs to fist, sword, axe, club, distance and shielding, this works indefinetly or until the player steps off the tile.

When the player steps off the tile the storage value is removed, if the player logs out the storage value is removed, if the player logs in on the square they are again assigned the storage value and the timer starts over yet again.

I was going to use this on my server, but im working on a totally different type of game, but still using the the tibia client and its sprites, so i won't be needing it.

Hope you enjoy using it on your servers :)

save this in
data\movements\scripts\sqtrainer.lua
Code:
-- Square Skill Trainer made by Arthur aka artofwork
-- This script will train all of a players skills indefintely
-- It has a small configuration setup where you can set the number of tries per skill
-- The time internveral in between each skill try added
-- A storage value to help prevent abuse
-- This is truely my first script, it comes without support since lua is new to me
-- You can assign any tile you wish to this script that a player can walk on with action id 900


-- Config --
local storage = 18010 -- Storage value for the player when he steps on and off the tile

local skilltries = 1 -- Number of tries per skill
local t = 4 * 1000 -- Set the time before try is added to skills

-------------------------------------------------------------------------
function trainerthree(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
doPlayerSendTextMessage(p.cid,22,"Your training session will begin in 30 seconds")
addEvent(trainertwo, 10 * 1000, p)
end
end
return FALSE
end
function trainertwo(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
doPlayerSendTextMessage(p.cid,22,"Your training session will begin in 20 seconds")
addEvent(trainerone, 10 * 1000, p)
end
end
return FALSE
end
function trainerone(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
doPlayerSendTextMessage(p.cid,22,"Your training session will begin in 10 seconds")
addEvent(readyToTrain, 10 * 1000, p)
end
end
return FALSE
end



function readyToTrain(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
doPlayerSendTextMessage(p.cid,22,"Your training session will now begin")
addEvent(trainMeA, t, p)
end
end
return FALSE
end


function trainMeA(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then

for a = 1, t do
if(a == t) then
doPlayerAddSkillTry(p.cid, SKILL_FIST, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_SWORD, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_CLUB, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_AXE, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_DISTANCE, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_SHIELD, skilltries)
end
end
end
addEvent(trainMeB, t, p)
end
return FALSE
end

function trainMeB(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
for b = 1, t do
if(b == t) then
doPlayerAddSkillTry(p.cid, SKILL_FIST, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_CLUB, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_SWORD, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_AXE, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_DISTANCE, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_SHIELD, skilltries)

end
end
end
addEvent(trainMeA, t, p)
end
return FALSE
end



function onStepIn(cid, item)
local p = {cid = cid, item = item, pos = pos}
setPlayerStorageValue(p.cid, 18010, 1)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
addEvent(trainerthree, 1 * 1000, p)
end
end
return FALSE
end


function onStepOut(cid, item)
getPlayerStorageValue(cid, 18010)
setPlayerStorageValue(cid, 18010, 0)
doPlayerSendTextMessage(cid,22,"Your training session has now ended")
end


place this in movements.xml

Code:
<movevent event="StepIn" actionid="900" script="sqtrainer.lua"/>
<movevent event="StepOut" actionid="900" script="sqtrainer.lua"/>


I have problem with that script. Look at this:

PHP:
http://www.youtube.com/watch?v=deRvZ5dAElE
 
Here... with mana training
still need a function to remove mana, i dont know :/

PHP:
-- Config --
local storage = 18010 -- Storage value for the player when he steps on and off the tile

local skilltries = 10 -- Number of tries per skill
local t = 2 * 1000 -- Set the time before try is added to skills

-------------------------------------------------------------------------
function toTrain(p)
	if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
		if p.item.actionid == 900 then
			doPlayerSendTextMessage(p.cid,22,"Your training session will now begin")
			addEvent(trainMe, t, p)
		end
	end
	return FALSE
end
function trainMe(p)
	if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
		if p.item.actionid == 900 then
			for a = 1, t do
				if(a == t) then
					doPlayerAddSkillTry(p.cid, SKILL_FIST, skilltries)
					doPlayerAddSkillTry(p.cid, SKILL_SWORD, skilltries)
					doPlayerAddSkillTry(p.cid, SKILL_CLUB, skilltries)
					doPlayerAddSkillTry(p.cid, SKILL_AXE, skilltries)
					doPlayerAddSkillTry(p.cid, SKILL_DISTANCE, skilltries)
					doPlayerAddSkillTry(p.cid, SKILL_SHIELD, skilltries)
					doPlayerAddSpentMana(p.cid, getPlayerMana(p.cid))
				end
			end
		end
		addEvent(trainMe, t, p)
	end
	return FALSE
end
function onStepIn(cid, item, pos)
	local p = {cid = cid, item = item, pos = pos}
	setPlayerStorageValue(p.cid, 18010, 1)
	if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
		if p.item.actionid == 900 then
			addEvent(toTrain, 1 * 1000, p)
		end
	end
	return FALSE
end
function onStepOut(cid, item)
	getPlayerStorageValue(cid, 18010)
	setPlayerStorageValue(cid, 18010, 0)
	doPlayerSendTextMessage(cid,22,"Your training session has now ended")
end
 
Well instead of giving 30 mp, give them 100% mp by doing...
Lua:
doCreatureAddMana(p.cid, getCreatureMaxMana(p.cid))
 
but i want to know if this script makes you gain 30 mana points every 2 seconds and then use a
spell spent 100% of your mana???


PHP:
doPlayerAddSpentMana(p.cid, getPlayerMana(p.cid))
This ill add your current mana value to spent mana
no need spells
 
Ok its work but the magic level gets too fast, could be reduced please? why not make a script to get 30 mana at sec and when u have full mana make a spell spend 100% of mana to raise more balanced
 
Last edited:
Status
Not open for further replies.
Back
Top