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

movements//teleports

NekoMitsu

New Member
Joined
Nov 30, 2009
Messages
8
Reaction score
0
Hi! Any scripter around? I really need to learn how to handle the movements stuff, stepin function and things... But my problem right now are the teleports from inquisition quest.
I Was able to make the teleports that appears after the demon boss dies, however, I need some help with the teleports that go and come from the main room.

At first, the teleports at the main room cant work for the player, only after the person kills the demon boss and come back in the teleport after the respective demon boss, right?

So...
here is what I added in the movements.xml
Code:
  <movement type="StepIn" uniqueid="5210" event="script" value="teleportsback.lua"/> 
  <movement type="StepIn" uniqueid="5211" event="script" value="teleportsback.lua"/> 
  <movement type="StepIn" uniqueid="5212" event="script" value="teleportsback.lua"/> 
  <movement type="StepIn" uniqueid="5213" event="script" value="teleportsback.lua"/> 
  <movement type="StepIn" uniqueid="5214" event="script" value="teleportsback.lua"/> 
  <movement type="StepIn" uniqueid="5215" event="script" value="teleportsgo.lua"/> 
  <movement type="StepIn" uniqueid="5216" event="script" value="teleportsgo.lua"/> 
  <movement type="StepIn" uniqueid="5217" event="script" value="teleportsgo.lua"/> 
  <movement type="StepIn" uniqueid="5218" event="script" value="teleportsgo.lua"/> 
  <movement type="StepIn" uniqueid="5219" event="script" value="teleportsgo.lua"/>

The script in teleportsgo:
Code:
function onStepIn(cid, item, pos)

    if item.uid == 5215 then
		if getPlayerStorageValue(cid,5210) == 1 then
			doTeleportThing(cid,{x=1176, y=1140, z=12})
		else
			doTeleportThing(cid,{x=1067, y=1081, z=14})
		end

    elseif item.uid == 5216 then
		if getPlayerStorageValue(cid,5211) == 1 then
			doTeleportThing(cid,{x=1128, y=1151, z=12})
		else
			doTeleportThing(cid,{x=1069, y=1083, z=14})
		end

    elseif item.uid == 5217 then
		if getPlayerStorageValue(cid,5212) == 1 then
			doTeleportThing(cid,{x=1069, y=1087, z=13})
		else
			doTeleportThing(cid,{x=1069, y=1087, z=14})
		end

    elseif item.uid == 5218 then
		if getPlayerStorageValue(cid,5213) == 1 then
			doTeleportThing(cid,{x=1152, y=1196, z=13})
		else
			doTeleportThing(cid,{x=1067, y=1089, z=14})
		end

    elseif item.uid == 5219 then
		if getPlayerStorageValue(cid,5214) == 1 then
			doTeleportThing(cid,{x=1244, y=1297, z=12})
		else
			doTeleportThing(cid,{x=1062, y=1089, z=14})
		end
    end
    return 1
end

and finally the script for teleportsback:
Code:
function onStepIn(cid, item, pos)

    if item.uid == 5210 then
	setPlayerStorageValue(cid,5210,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14})
       

    elseif item.uid == 5211 then
	setPlayerStorageValue(cid,5211,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14})


    elseif item.uid == 5212 then
	setPlayerStorageValue(cid,5212,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14})


    elseif item.uid == 5213 then
        setPlayerStorageValue(cid,5213,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14})


    elseif item.uid == 5214 then
        setPlayerStorageValue(cid,5214,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14})


    end
    return 1
end

Well... The server simply crashed ¬¬ when I tried to use one of these teleports. Plus, I couldnt find any tutorial about this one, of how to use setstorage in a teleport and things like that.
Can anyone help me out? I saw that other guy has the same problem, but I wanted to post my codes here, for you people can help me ^^

thx in advance
Neko
 
use action ids in the movement.xml? to set them on the teleports?
(I could set the unique Ids in fact, in the map editor xD)
but im trying it now,
hope it works!
 
use action ids in the movement.xml? to set them on the teleports?
(I could set the unique Ids in fact, in the map editor xD)
but im trying it now,
hope it works!
Yeah, and you need to set the actionid when creating a new teleport (after killing the boss)
 
ok, now entering the teleports are not crashing the server, all with actionids properly =]
But! Something must be wrong.. The teleports are still working for new players without doing the quest.. Is there anything wrong with the teleportsgo? I dunno much about the getstorage and stuff, and couldnt find help =\
I only need this teleports working, then I my map will be complete =]
 
so.. for the movement.xml we have:
Code:
	<!-- Inquisition -->
	<movement type="StepIn" actionid="5210" event="script" value="teleportsback.lua" /> 
	<movement type="StepIn" actionid="5211" event="script" value="teleportsback.lua" /> 
	<movement type="StepIn" actionid="5212" event="script" value="teleportsback.lua" /> 
	<movement type="StepIn" actionid="5213" event="script" value="teleportsback.lua" /> 
	<movement type="StepIn" actionid="5214" event="script" value="teleportsback.lua" /> 
	<movement type="StepIn" actionid="5215" event="script" value="teleportsgo.lua" /> 
	<movement type="StepIn" actionid="5216" event="script" value="teleportsgo.lua" /> 
	<movement type="StepIn" actionid="5217" event="script" value="teleportsgo.lua" /> 
	<movement type="StepIn" actionid="5218" event="script" value="teleportsgo.lua" /> 
	<movement type="StepIn" actionid="5219" event="script" value="teleportsgo.lua" />

Then the teleports back (the one who give your storage value in order to be able to use the go teleporters.)
Code:
function onStepIn(cid, item, pos)

    if item.uid == 5210 then
	setPlayerStorageValue(cid,5210,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14})
       

    elseif item.uid == 5211 then
	setPlayerStorageValue(cid,5211,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14})


    elseif item.uid == 5212 then
	setPlayerStorageValue(cid,5212,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14})


    elseif item.uid == 5213 then
        setPlayerStorageValue(cid,5213,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14})


    elseif item.uid == 5214 then
        setPlayerStorageValue(cid,5214,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14})


    end
    return 1
end

and finally, the go teleporters:
Code:
function onStepIn(cid, item, pos)

    if item.uid == 5215 then
		if getPlayerStorageValue(cid,5210) == 5 then
			doTeleportThing(cid,{x=1176, y=1140, z=12})
		else
			doTeleportThing(cid,{x=1067, y=1081, z=14})
		end

    elseif item.uid == 5216 then
		if getPlayerStorageValue(cid,5211) == 5 then
			doTeleportThing(cid,{x=1128, y=1151, z=12})
		else
			doTeleportThing(cid,{x=1069, y=1083, z=14})
		end

    elseif item.uid == 5217 then
		if getPlayerStorageValue(cid,5212) == 1 then
			doTeleportThing(cid,{x=1069, y=1087, z=13})
		else
			doTeleportThing(cid,{x=1069, y=1087, z=14})
		end

    elseif item.uid == 5218 then
		if getPlayerStorageValue(cid,5213) == 1 then
			doTeleportThing(cid,{x=1152, y=1196, z=13})
		else
			doTeleportThing(cid,{x=1067, y=1089, z=14})
		end

    elseif item.uid == 5219 then
		if getPlayerStorageValue(cid,5214) == 1 then
			doTeleportThing(cid,{x=1244, y=1297, z=12})
		else
			doTeleportThing(cid,{x=1062, y=1089, z=14})
		end
    end
    return 1
end

Hope you can fix this ^^x
 
Last edited:
Code:
function onStepIn(cid, item, position, fromPosition)
return
	item.actionid >= 5210 and
	item.actionid <= 5214 and

	setPlayerStorageValue(cid, item.uid, 1) and
	doTeleportThing(cid, {x=1064, y=1085, z=14}) and
	doSendMagicEffect({x=1064, y=1085, z=14}, CONST_ME_TELEPORT)
end
Code:
local t = {
--	[aid_] = {storage_req, pos_onSucceed, pos_onFail}
	[5215] = {5, {x=1176, y=1140, z=12}, {x=1067, y=1081, z=14}},
	[5216] = {5, {x=1128, y=1151, z=12}, {x=1069, y=1083, z=14}},
	[5217] = {1, {x=1069, y=1087, z=13}, {x=1069, y=1087, z=14}},
	[5218] = {1, {x=1152, y=1196, z=13}, {x=1067, y=1089, z=14}},
	[5219] = {1, {x=1244, y=1297, z=12}, {x=1062, y=1089, z=14}}
}
function onStepIn(cid, item, position, fromPosition)
	local pos = getPlayerStorageValue(cid, item.actionid - 5) >= t[item.actionid][1] and t[item.actionid][2] or t[item.actionid][3]
	return doTeleportThing(cid, pos), doSendMagicEffect(pos, CONST_ME_TELEPORT)
end
 
Hi again! Well... These two codes didnt work. Now It restarted to crash the server when I used all the teleportsback and the 3 first teleports go.
I thought that the script for the back ones was ok (not that Im expert at this xD) but the teleportsgo script I didnt understand some parts. Why the 3 first storagereq are 5 and the others are 1? Is this a mistake? XD and also, I didnt understand the line of the getstorage.

Anyway... The 4 and 5 teleportsgo worked, however, it bugged later, cuz it teleported the character and created another one in the teleportfalse position. and then the server crashed =P
 
It's your fault for doing something wrong, the scripts should work and not crash the server, altough your storagevalue setup is very messy and confusing, and doesn't make any sense.
 
You dont need to get angry, Im asking for help, not mocking you o.o
And yes, the probability that I did something wrong is 99% cuz I dont handle these stuff.

anyway, the teleports back enters the function and first line is return. This isnt right, is it?
and yes, the storages values are messy, the required should be all 1.
I fixed that up.

so:
Code:
function onStepIn(cid, item, position, fromPosition)
	item.actionid >= 5210 and
	item.actionid <= 5214 and

	setPlayerStorageValue(cid, item.uid, 1) and
	doTeleportThing(cid, {x=1064, y=1085, z=14}) and
	doSendMagicEffect({x=1064, y=1085, z=14}, CONST_ME_TELEPORT)
end

Removed the return.

the teleportsgo:
Code:
local t = {
--	[aid_] = {storage_req, pos_onSucceed, pos_onFail}
	[5215] = {1, {x=1176, y=1140, z=12}, {x=1067, y=1081, z=14}},
	[5216] = {1, {x=1128, y=1151, z=12}, {x=1069, y=1083, z=14}},
	[5217] = {1, {x=1069, y=1087, z=13}, {x=1069, y=1087, z=14}},
	[5218] = {1, {x=1152, y=1196, z=13}, {x=1067, y=1089, z=14}},
	[5219] = {1, {x=1244, y=1297, z=12}, {x=1062, y=1089, z=14}}
}
function onStepIn(cid, item, position, fromPosition)
	local pos = getPlayerStorageValue(cid, item.actionid - 5)
	if getPlayerStorageValue(cid,item.actionid - 5) == 1 then
		doTeleportThing(cid, pos_onSucced), doSendMagicEffect(pos, CONST_ME_TELEPORT)
	else if
		doTeleportThing(cid, pos_onFail), doSendMagicEffect(pos, CONST_ME_TELEPORT)
	end
end

all storage required are valued 1. and I separated the 2 cases of teleport (if the storage value is ok teleport to the room, else teleport fail).
probably here you have to correct my many mistakes
thx
 
By removing return you only screwed it up further. I've put return there for a reason, and it's same as:
Code:
function onStepIn(cid, item, position, fromPosition)
	return item.actionid >= 5210 and item.actionid <= 5214 and setPlayerStorageValue(cid, item.uid, 1) and doTeleportThing(cid, {x=1064, y=1085, z=14}) and doSendMagicEffect({x=1064, y=1085, z=14}, CONST_ME_TELEPORT)
end
Code:
local t = {
	[5215] = {{x=1176, y=1140, z=12}, {x=1067, y=1081, z=14}},
	[5216] = {{x=1128, y=1151, z=12}, {x=1069, y=1083, z=14}},
	[5217] = {{x=1069, y=1087, z=13}, {x=1069, y=1087, z=14}},
	[5218] = {{x=1152, y=1196, z=13}, {x=1067, y=1089, z=14}},
	[5219] = {{x=1244, y=1297, z=12}, {x=1062, y=1089, z=14}}
}
function onStepIn(cid, item, position, fromPosition)
	local pos = getPlayerStorageValue(cid, item.actionid - 5) > 0 and t[item.actionid][1] or t[item.actionid][2]
	return doTeleportThing(cid, pos), doSendMagicEffect(pos, CONST_ME_TELEPORT)
end
 
well. I managed myself here, using mistic flames and uniquesIds.

teleports in main room:
Code:
function onStepIn(cid, item, pos)

    if item.uid == 5900 then
        if getPlayerStorageValue(cid,5900) == -1 then
		doTeleportThing(cid,{x=1067, y=1081, z=14})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_MORTAREA)
            	doCreatureSay(cid, "You haven't passed Ushuriel's seal yet.", TALKTYPE_ORANGE_1)
        else
		doTeleportThing(cid,{x=1176, y=1140, z=12})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)
        end
    elseif item.uid == 5901 then
        if getPlayerStorageValue(cid,5901) == -1 then
		doTeleportThing(cid,{x=1069, y=1082, z=14})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_MORTAREA)
            	doCreatureSay(cid, "You haven't passed Zugurosh's seal yet.", TALKTYPE_ORANGE_1)
        else
		doTeleportThing(cid,{x=1128, y=1151, z=12})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)
        end
    elseif item.uid == 5902 then
        if getPlayerStorageValue(cid,5902) == -1 then
		doTeleportThing(cid,{x=1069, y=1087, z=14})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_MORTAREA)
            	doCreatureSay(cid, "You haven't passed Madareth's seal yet.", TALKTYPE_ORANGE_1)
        else
		doTeleportThing(cid,{x=1046, y=1205, z=13})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)
        end
    elseif item.uid == 5903 then
        if getPlayerStorageValue(cid,5903) == -1 then
		doTeleportThing(cid,{x=1067, y=1089, z=14})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_MORTAREA)
            	doCreatureSay(cid, "You haven't passed the Brother's seal yet.", TALKTYPE_ORANGE_1)
        else
		doTeleportThing(cid,{x=1152, y=1196, z=13})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)
        end
    elseif item.uid == 5904 then
        if getPlayerStorageValue(cid,5904) == -1 then
		doTeleportThing(cid,{x=1062, y=1089, z=14})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_MORTAREA)
            	doCreatureSay(cid, "You haven't passed Annihilon's seal yet.", TALKTYPE_ORANGE_1)
        else
		doTeleportThing(cid,{x=1244, y=1297, z=12})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)
        end
    end
    return 1
end

teleports after entering teleports in boss wards:
Code:
function onStepIn(cid, item, pos)

    if item.uid == 5905 then
        setPlayerStorageValue(cid,5900,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14})
	doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)

    elseif item.uid == 5906 then
        setPlayerStorageValue(cid,5901,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14})
	doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)

    elseif item.uid == 5907 then
        setPlayerStorageValue(cid,5902,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14})
	doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)

    elseif item.uid == 5908 then
        setPlayerStorageValue(cid,5903,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14}) 
	doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)

    elseif item.uid == 5909 then
        setPlayerStorageValue(cid,5904,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14})
	doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)

    end
    return 1
end

And I didnt understand why your scripts could crash my server if I only pasted then and so. Maybe something in the map edition?
 
Back
Top