Nubaza
LUA Scripter
Hello otLand.net!
I'm chavoz and i'm presenting a script... well, the title say all
This script is for the players, with the command !tp or another, the player can teleport to configurable places or his house... Also u can configure the cash needed and the time of exhaustion (in seconds)!
Is really easy configurable, well, let's see it:
Add this tag to talkactions.xml:
Later create a LUA file called tpAllCitys.lua, put this inside:
Easy Configuration:
Well, to edit the places u can see the cities of your server in the Remeres Map Editor, press Ctrl+T and it will show you all the towns of your server and the TOwn ID...
To add 1+ place u can add this:
Credits:
chavoz (me) 70%
brun123 (xtibia.com) 30% (he created the base script for a pokemon server)
I'm chavoz and i'm presenting a script... well, the title say all
This script is for the players, with the command !tp or another, the player can teleport to configurable places or his house... Also u can configure the cash needed and the time of exhaustion (in seconds)!
Is really easy configurable, well, let's see it:
Add this tag to talkactions.xml:
Code:
<talkaction words="!tp" event="script" value="tpAllCitys.lua"/>
Later create a LUA file called tpAllCitys.lua, put this inside:
Lua:
-- script made by chavoz --
----- otLand.net -----
local cash = 10000 -- u can modify the prize (actual 1cc)
local cdtele = 900 -- the seconds of cooldown (900=15min)
local etele = 9499 -- isn't necessary to change
local config = {
premium = false, -- if is needed be premium to use this teleport (true or false)
battle = true -- if is needed be without battle to use (true or false)
}
local places = {
[1] = {name = "Enigma", id = 1},
[2] = {name = "Infernium", id = 2},
[3] = {name = "Desert", id = 3},
[4] = {name = "Ice", id = 4},
[5] = {name = "Thais", id = 5},
}
function onSay(cid, words, param)
if exhaustion.get(cid, etele) and exhaustion.get(cid, etele) > 0 then
tempo = (exhaustion.get(cid, etele)) / 60
min = math.floor(tempo)
doPlayerSendTextMessage(cid,27,"You have to wait more "..min.." minutes.")
return true
end
if config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then
doPlayerSendTextMessage(cid,27,"You can't teleport with fight.")
return true
end
if (param == '') then
local str = ""
str = str .. "Existent places: \n\nHouse\n"
for a = 1, #places do
str = str..""..places[a].name.."\n"
end
doShowTextDialog(cid, 2333, str)
return true
end
local lastppos = getThingPos(cid)
local telepos = {}
local myplace = ""
local townid = 0
if string.lower(param) == "house" then
if not getHouseByPlayerGUID(getPlayerGUID(cid)) then
doPlayerSendTextMessage(cid,27, "You don't own a house.")
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
return true
end
telepos = getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid)))
myplace = "house"
effect = CONST_ME_TELEPORT
else
effect = CONST_ME_TELEPORT
for x = 1, #places do
if string.find(string.lower(places[x].name), string.lower(param)) then
townid = places[x].id
myplace = places[x].name
end
end
if myplace == "" then
doPlayerSendTextMessage(cid,27,"Sorry, this place don't exist.")
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
return true
end
end
if myplace ~= "" and townid > 0 then
telepos = getTownTemplePosition(townid)
end
if doPlayerRemoveMoney(cid, cash) == TRUE then
doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
doTeleportThing(cid, telepos, false)
local pos2 = getClosestFreeTile(cid, getPosByDir(getThingPos(cid), SOUTH))
doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
doCreatureSay(cid, "Teleport to "..myplace.."!", TALKTYPE_MONSTER)
doPlayerSendTextMessage(cid,27,"You have teleported to "..myplace.." for "..cash.." gps!")
doPlayerSendTextMessage(cid,27,"To use again wait "..cdtele.." seconds.")
doCreatureSetLookDir(cid, SOUTH)
exhaustion.set(cid, etele, cdtele)
else
doPlayerSendTextMessage(cid,27,"You haven't enough money ("..cash.." gps)!")
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
return true
end
Easy Configuration:
Lua:
-- script made by chavoz --
----- otLand.net -----
local cash = 10000 -- u can modify the prize (actual 1cc)
local cdtele = 900 -- the seconds of cooldown (900=15min)
local etele = 9499 -- isn't necessary to change
local config = {
premium = false, -- if is needed be premium to use this teleport (true or false)
battle = true -- if is needed be without battle to use (true or false)
}
local places = {
[1] = {name = "Enigma", id = 1},
[2] = {name = "Infernium", id = 2},
[3] = {name = "Desert", id = 3},
[4] = {name = "Ice", id = 4},
[5] = {name = "Thais", id = 5},
}
To add 1+ place u can add this:
Code:
[6] = {name = "Your town name", id = TOWN ID},
Credits:
chavoz (me) 70%
brun123 (xtibia.com) 30% (he created the base script for a pokemon server)
Last edited: