• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction [MOD] Temple to Temple Teleport [v1.0]

Northnorial

Member
Joined
May 30, 2009
Messages
742
Reaction score
5
Location
Germany
Credits:

Cykotitan

(Most is done by Cykotitan, but I've edited the script a lot.)

The script is useful for War Servers, seen on Warots.net.pl
(It's not 100% the same than it is on Warots.net.pl)

Tested and working on TFS 0.3.6pl1

Configuration:

Adding towns and the delay, like that:
(Add the towns with the TownID)
PHP:
	<config name="config"><![CDATA[
		validTowns = {1,2}
		time = 3
	]]></config>

How does it work?

You have to be in a temple of the towns added in the config. Now you can cast !t 1, !t 2, etc.

Script TempleTP.xml
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="TempleTP" enabled="yes">
	<config name="config"><![CDATA[
		validTowns = {1,2}
		time = 3
	]]></config>
	<talkaction words="!t" event="buffer"><![CDATA[
		domodlib('config')
		local param = tonumber(param)
		local storage = 55755
		
		function doTP()
		if getTileInfo(getThingPos(cid)).protection and param and isInArray(validTowns, param) then
			doTeleportThing(cid, getTownTemplePosition(param))
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have been sent to " .. getTownName(param) .. ".")
			doSendMagicEffect(getTownTemplePosition(param), CONST_ME_TELEPORT)
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have to stay in the temple.")
		end
		end
		
		if getTileInfo(getThingPos(cid)).protection and param and isInArray(validTowns, param) and (os.time() - getPlayerStorageValue(cid, storage) > time*1) then
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You will be sent to " .. getTownName(param) .. " in " .. time .. " seconds.")
			doSendMagicEffect(getThingPos(cid), CONST_ME_WATERSPLASH)
			setPlayerStorageValue(cid, storage, os.time())
			addEvent(doTP, time*1000, cid)
		end
		return true
	]]></talkaction>
</mod>


Please report bugs in this thread!
 
Last edited:
even if cykotitan did it, the guy "North~" or w/e posted it, so credits goes to him for posting (took time ofc) and cyko for the script. xdxdxd
 
Would be good if you fixed names instead of numbers :p !t thais, !t edron. (example).
 
So bad replies lol! I just thought about releasing it, cuz many guys could need it for their War Servers, as I also do.
 
Would be good if you fixed names instead of numbers :p !t thais, !t edron. (example).
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="TempleTP" enabled="yes">
	<config name="config"><![CDATA[
		validTowns = {1,2}
		time = 3
		storage = 55755
	]]></config>
	<talkaction words="!t" event="script"><![CDATA[
		domodlib('config')

		local function doTP(cid, pos, townname)
			if  getTileInfo(getThingPos(cid)).protection then
				doTeleportThing(cid, pos)
				doSendMagicEffect(pos, CONST_ME_TELEPORT)
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have been sent to " .. townname .. ".")	
			else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have to stay in the temple.")
			end
		end

		function onSay(cid, words, param, channel)
			if param ~= '' and getTileInfo(getThingPos(cid)).protection and isInArray(validTowns, getTownId(param)) and (os.time() - getPlayerStorageValue(cid, storage) >= time) then
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You will be sent to " .. param:lower():gsub("^%l", string.upper) .. " in " .. time .. " second" .. (tostring(time):sub(-1) == "1" and "" or "s") .. ".")
				doSendMagicEffect(getThingPos(cid), CONST_ME_WATERSPLASH)
				setPlayerStorageValue(cid, storage, os.time())
				addEvent(doTP, time*1000, cid, getTownTemplePosition(getTownId(param)), param:lower():gsub("^%l", string.upper))
			end
			return true
		end
	]]></talkaction>
</mod>
 
Back
Top