• logo_cipsoft
    Nowe serwery zostały otwarte 19 Lut 2025:
    Noctalia (Open PvP) Ignitera (Open PvP) us_logo Xybra (Open PvP)

Creaturescripts Teleport Scroll

Status
Zamknięty.

Frigo

Active User
Dołączył
Maj 25, 2008
Posty
109
Liczba reakcji
6
Witam,
Chcia?bym podzieli? si? z wami skryptem jaki znalaz?em na .
Skrypt zosta? stworzony przez: J.Dre, Sonik, Fallen oraz Shinmaru.
Testowany na 0.3.6 (8.54)
Dzia?anie:
Po klikni?ciu na pergamin wyskoczy nam lista lokalizacji do kt?rych mo?emy si? teleportowa?.
Wybieramy kt?r?kolwiek, gdy naci?niemy OK zostaniemy przeniesieni do uprzednio wybranego przez nas miejsca.
Zmiana lokalizacji poprzez pergamin mo?liwa jest raz na 30 sekund.
f0c9wz.jpg

W data/creaturescripts tworzymy plik o nazwie teleportpaper.lua i wklejamy do niego nast?puj?cy kod:
Kod:
local t = {
	["Temple"] = {pos = {x = 3000, y = 2098, z = 7}, storage = 1337, time = 30},	
	["Teleports"] = {pos = {x = 2815, y = 2025, z = 7}, storage = 1338, time = 30},
	["Addons"] = {pos = {x = 1266, y = 880, z = 7}, storage = 1339, time = 30},
	["Addon Bosses"] = {pos = {x = 1127, y = 907,z = 6}, storage = 1340, time = 30},
	["Trainers"] = {pos = {x = 2877, y = 2005, z = 7}, storage = 1341, time = 30},
	["Donation Quest"] = {pos = {x = 3160, y = 1572, z = 7}, storage = 1342, time = 30},
	["Shops"] = {pos = {x = 2940, y = 2075, z = 7}, storage = 1343, time = 30},
	["Sailors Quarter"] = {pos = {x = 3010, y = 2192, z = 6}, storage = 1344, time = 30}
}
function onTextEdit(cid, item, newText)
	if item.itemid == 1949 then
		if isPlayerPzLocked(cid) then
			doCreatureSay(cid, "You are in a battle!", TALKTYPE_MONSTER)
			return false
		end	
		if isInArray({'locations', 'places', 'place'}, newText) then
			local i = ''
			for text, x in pairs(t) do
				i = i .. "\n[" .. text .. "]"
			end
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Current Teleportation Locations: " .. i)
		else
			local p = t[newText]
			if not p then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Invalid location")
				return false
			end
			local st = p.storage
			if getCreatureStorage(cid, st) > os.time() then
				doCreatureSay(cid, "You must wait another " .. getCreatureStorage(cid, st) - os.time() .. ' second' .. (getCreatureStorage(cid, st) - os.time() == 1 and "" or "s") .. " to travel there again.", TALKTYPE_MONSTER)
				return true
			end
			local ti = p.time
			local pos = p.pos
			doTeleportThing(cid, pos, true)
			doSendMagicEffect(pos, CONST_ME_TELEPORT)
			doCreatureSetStorage(cid, st, os.time() + ti)
			doCreatureSay(cid, "You have been teleported!", TALKTYPE_MONSTER)
		end
	end
	return true
end
Nast?pnie edytujemy plik creaturescripts.xml i dodajemy linijk?:
Kod:
<event type="textedit" name="teleportpaper" event="script" value="[B]teleportpaper.lua[/B]"/>
W Login.lua dodajemy:
Kod:
registerCreatureEvent(cid, "teleportpaper"
Mam nadziej?, ?e komu? si? przyda. :)
 
Odp: Teleport Scroll

Dzieki wielkie repp+

Chocia? mysle ze wstawienie tego na OTSa zrobi sie orszabundzkie i dla kasy.
 
Status
Zamknięty.
Do góry