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

[NEED HELP] New Training System to TFS 0.3.5

Bulet

Knight of Apocalypse
Joined
Jul 12, 2009
Messages
183
Reaction score
9
Location
Brazil
trainhallv.jpg


If any one can help me thats mine idea.:

1.: Player will click on statue id 9949 and will be teleported to x,y-3,z to Target and x,y-2,z to Pally target always that and statue will change to statue id 9948 and when another player click on him he will say "There is a player coaching here, search training room empty" dont use profession on script because mages can enter on training hall too, with rod or wand to train magic level.

2.: On room a lever will send him out in front the statue who him enter on Target room y+3 and on Pally Target room y+2

3.: When he get out or by lever or by kicked the statue back to original position "Statue id 9949" maybe script step in and step out to check if have player on x spot ....

If any one can help me i will give to him totaly credits on mine ot by that system and trainner npc name in honour him and more reputation points

Tanks a lot
Your Bulet
 
Last edited:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local position = {x = toPosition.x, y = toPosition.y, z = toPosition.z}
	if (isPaladin(cid)) then
		position.y = position.y + 2
	else
		position.y = position.y + 3
	end

	if (isPlayer(getTopCreature(position).uid)) then
		doPlayerSendCancel(cid, "Go another room.")
		return true
	end

	doTransformItem(item.uid, item.itemid - 1)

	doSendMagicEffect(fromPosition, CONST_ME_POFF)
	doTeleportThing(cid, position)
	doSendMagicEffect(position, CONST_ME_TELEPORT)
	return true
end

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local position = {x = toPosition.x, y = toPosition.y, z = toPosition.z}
	if (isPaladin(cid)) then
		position.y = position.y - 2
	else
		position.y = position.y - 3
	end

	local statue = getTileItemById(position, 9948)
	if (statue.uid ~= nil) then
		doTransformItem(statue.uid, statue.itemid + 1)
	end

	doSendMagicEffect(fromPosition, CONST_ME_POFF)
	doTeleportThing(cid, position)
	doSendMagicEffect(position, CONST_ME_TELEPORT)
	return true
end

I hope you are able to install it (i mean .xml entries). If it's not working (console errors) post result here, if any errors and it does not work properly - try changing positions. (y - 3 etc.).
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local position = {x = toPosition.x, y = toPosition.y, z = toPosition.z}
	if (isPaladin(cid)) then
		position.y = position.y + 2
	else
		position.y = position.y + 3
	end

	if (isPlayer(getTopCreature(position).uid)) then
		doPlayerSendCancel(cid, "Go another room.")
		return true
	end

	doTransformItem(item.uid, item.itemid - 1)

	doSendMagicEffect(fromPosition, CONST_ME_POFF)
	doTeleportThing(cid, position)
	doSendMagicEffect(position, CONST_ME_TELEPORT)
	return true
end

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local position = {x = toPosition.x, y = toPosition.y, z = toPosition.z}
	if (isPaladin(cid)) then
		position.y = position.y - 2
	else
		position.y = position.y - 3
	end

	local statue = getTileItemById(position, 9948)
	if (statue.uid ~= nil) then
		doTransformItem(statue.uid, statue.itemid + 1)
	end

	doSendMagicEffect(fromPosition, CONST_ME_POFF)
	doTeleportThing(cid, position)
	doSendMagicEffect(position, CONST_ME_TELEPORT)
	return true
end

I hope you are able to install it (i mean .xml entries). If it's not working (console errors) post result here, if any errors and it does not work properly - try changing positions. (y - 3 etc.).

OK i will try make it now im on mine house will make the scripts and put to work to test that
Yeah working but need add scripts and change few things thats is good to begining you can help me more plx ?
Because when player is kicked from train statue need back to normal status
Im think to put a lever same the depot and use movements to make that to step in and stepout what do you think Chojrak ?
 
Last edited:
The second script will transform back statue. Just add lever inside room and link it to this script.
 
The second script will transform back statue. Just add lever inside room and link it to this script.

Yeah but if gm logout player or pull him the statue will stay 9948 and if another player use statue him will chage to 9949, sorry mine bad english but you undestand me, what can i say ?
And the script cant send statue back to normal is because we need make 4 scripts statuetarget and levertarget target and statueptarget and leverptarget because mages and kninas can enter on pally room and when they exit statue cant change
 
Last edited:
Back
Top