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

in tile get soul

GuHB

Member
Joined
Dec 14, 2009
Messages
630
Reaction score
9
Location
Brazil
The request is simple.

If the player move on the tile (actionID or uniqueID) starts one count, like, after 5 minutes, get 1 soul point from player.

i'll use it in training tiles.

Thanks!
 
This one have some options like if soul ends, then player will be tped outside, if player dont have enoguth soul, he will not be able to stand on tile.
LUA:
local c = 	{
					storage = 12012,		-- empty storage
					
					remove_time = 0.3,		-- minutes interval of time to remove soul
					
					soul_removed = 50,		--number of soul point resmover every interval of time
					
					teleport = true,		-- i thought this could help you out, if you dont want it just set it to false this tp player to a certain place when his soul finished out.
					
					place = {x=1,y=1,z=1},	-- the place player will be tped to when his soul is out
					
					dont_allow = true		-- This dont allow player to get into training tile if her dont have enough soul
			}
function removeSoul(cid,value)    -- removeing soul
	if getPlayerByNameWildcard(getCreatureName(cid)) ~= nil then
		if getPlayerStorageValue(cid,c.storage) > 0 then
			if getPlayerSoul(cid) > 0  then
				doPlayerAddSoul(cid, - value)
				doPlayerSendTextMessage(cid,27,"Training system : "..c.soul_removed.." soul point removed.")
				addEvent(removeSoul , c.remove_time*60*1000, cid, value)
			else
				if c.teleport == true then
					doTeleportThing(cid,c.place,false)
					doSendMagicEffect(c.place,10)
					doPlayerSendTextMessage(cid,21,"You have been teleported outside training spot as you soul have finished.")
					setPlayerStorageValue(cid,c.storage,-1)
				end
			end
		else
			doPlayerSendTextMessage(cid,27,"You didnt have right storage.")
		end
	
	else
		doPlayerSendTextMessage(cid,27,"Seems your name is not correct ??!!.")
	end
end
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if getPlayerSoul(cid) > c.soul_removed then
		doPlayerSendTextMessage(cid,25,"Training system started, every "..c.remove_time.." minutes "..c.soul_removed.." soul point will be removed from you, untill your soul end and you will be teleported outside.")
		setPlayerStorageValue(cid,c.storage,1)
		addEvent(removeSoul , c.remove_time*60*1000, cid, c.soul_removed)
	elseif c.dont_allow == true and getPlayerSoul(cid) < 1 then
		doTeleportThing(cid,fromPosition,false)
		doSendMagicEffect(fromPosition,2)
		doPlayerSendTextMessage(cid,27,"You can't train while your soul is less than "..c.soul_removed.." points.")
	end
	return true
end


function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if getPlayerStorageValue(cid,c.storage) > 0 then
		setPlayerStorageValue(cid,c.storage,-1)
		doPlayerSendTextMessage(cid,25,"Training system : disactivated.")
	end
	return true
end
 
Last edited:
Back
Top