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

GlobalEvent Training System best option.

TriamerA

The Mystic One.
Joined
Nov 16, 2008
Messages
1,256
Reaction score
16
Location
Poland
This is my training system which I was using at tidia.pl
How does it work? It just takes x soul points per x seconds from x player when he is standing at special tile.
It looks like that:
68849132.jpg


56902420.jpg


So player has 100 soul points, every x seconds he is losing 1 soul points, when he's soul points will go less than 6 or 7 he will be kicked out and he won't be able to enter again untill he will get some soul points.

Globalevent:
Code:
	<globalevent name="check" interval="45" event="script" value="check.lua"/>
Interval-> each 45 seconds player will lose soul point.


check.lua
Code:
  function onThink(pid, interval)
local t = {x=31879, y=32438, z=6} 
        for _, pid in ipairs(getPlayersOnline()) do
                if getPlayerStorageValue(pid,23331) == 1 then
				
                        if getPlayerSoul(pid) > 5 then
                                doPlayerAddSoul(pid, -1)
                        else
                             setPlayerStorageValue(pid, 23331, -1)
					doTeleportThing(pid, t)
				doCreatureSay(pid, "You have no enought Soul Points to Train. Come back with more than 6 Soul Points.", TALKTYPE_ORANGE_1)							 
                        end
                end

        end
return true
end

Change local t, change the position where player should be kicked if he has not enough soul points to train.


Paste into movements:
Code:
	<movevent type="StepIn" actionid="19755" event="script" value="storagereset.lua"/>
	<movevent type="StepOut" actionid="19755" event="script" value="storagereset.lua"/>
	<movevent type="StepIn" actionid="19756" event="script" value="soulgate.lua"/>

Make storagereset.lua

Code:
function onStepIn(cid, item, pos)



    if (item.actionid == 19755) then
if (getPlayerStorageValue(cid, 23331) == -1) then
	setPlayerStorageValue(cid, 23331, 1)
	doCreatureSay(cid, "Training Started. Every 60 seconds you will loose 1 Soul Point.", TALKTYPE_ORANGE_1)		

end
end


    return TRUE
end  

function onStepOut(cid, item, pos)



    if (item.actionid == 19755) then
if (getPlayerStorageValue(cid, 23331) == 1) then
	setPlayerStorageValue(cid, 23331, -1)
end
end



    return TRUE
end


and Make soulgate.lua

Code:
function onStepIn(cid, item, position, fromPosition)
	if getPlayerSoul(cid) < 6 then
		doTeleportThing(cid, fromPosition, true)
		doCreatureSay(cid, "You have no enought Soul Points, go hunt to get them.", TALKTYPE_ORANGE_1)	
	end
	return true
end

Now actionids

As you can see on the image, the place where im standing to attack the monk should be with actionid: 19755

The square right from me should be with actionid: 19756


I think its good option to don't let players bot 24/7 at trainers.
 
Nice idea and thanks for releasing, but my training system is better..
 
Well for most OTs this will be enough.
And no I won't release mine.
 
Help please

[Error - LuaScript Interface::loadFile] data/movenents/scripts/storagereset.lua>
data/movements/scripts/storagereset.lua:17: 'end' expected near '<eof>'
[Warning - Event::loadScript] Cannot load script <data/movenents/scripts/storagereset.lua>
data/movements/scripts/storagereset.lua:17: 'end' expected near '<eof>'
 
Help please

[Error - LuaScript Interface::loadFile] data/movenents/scripts/storagereset.lua>
data/movements/scripts/storagereset.lua:17: 'end' expected near '<eof>'
[Warning - Event::loadScript] Cannot load script <data/movenents/scripts/storagereset.lua>
data/movements/scripts/storagereset.lua:17: 'end' expected near '<eof>'

Erase End in file.
 
Back
Top