• 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 2 scripts for [9.80-9.86] The Forgotten Server v0.2.15 (Mystic Spirit)

Khatulu

the Ancient
Joined
Aug 20, 2007
Messages
22
Reaction score
0
Location
Charlotte, N.C., U.S.A.
I wish I had time to figure it out myself but unfortunately I don't. And as the title states I am not using 0.3/0.4.

I need 2 scripts:

  • A working level tile (4 of them in one room) for 0.2.15
  • A working item tile (also 4 in one room) for 0.2.15
I've found quite a few level tiles but none appear to work for this server and as I said I really REALLY just don't have enough time in the day to try to work it out myself.
The level tiles need to be for 200, 300, 400, 500. Just need them to knock you back off the tile if under those levels. After passing the level tile I need the next tile to check for and remove x item from the player's inventory. Again, if they don't have the required item the tile knocks them back.

I don't really want one tile to do both but if it would be easier it would have to check level first as the required items will be HARD to get.

TIA and Rep++ for any help (Repx9847265928350823752) for the magic script(s) :w00t:
 
movements.xml

XML:
<movevent event="StepIn" itemid="465" script="levelTile.lua"/>
Here is the level tile:

Lua:
local t = {
	[1101] = 20, -- [tile actionId] = level
	[1102] = 50,
}
 
function onStepIn(cid, item, position, fromPosition)
	local k = t[item.actionid]
	if(k and isPlayer(cid)) then
		if(getPlayerLevel(cid) < k) then
			doTeleportThing(cid, fromPosition)
			doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
		end
	end
	return TRUE
end
Item tile:

Lua:
local t = {
	[1100] = {2160, 1}, -- [tile actionId] = {itemId, count}
	[1101] = {2152, 10},
}
 
function onStepIn(cid, item, position, fromPosition)
	local k = t[item.actionid]
	if(k and isPlayer(cid)) then
		if not doPlayerRemoveItem(cid, k[1], k[2] or 1) then
			doTeleportThing(cid, fromPosition)
			doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
		end
	end
	return TRUE
end
J.Dre
 
Last edited:
Will test in a few minutes and let ya know :D. Thanks for the reply btw!
;
;
Well first shot (level tiles) didn't work BUT I may have it wrong in movements.xml. Will have to mess with it more tomorrow after work... :(
Haven't tried the item tiles yet.
 
Last edited:
OK I have today off and have some time to play around some. I couldn't get either to work but admit I am noooooob at movements. I used something a friend put in an old server to base it on but I honestly don't know that his ever worked as I never used, or even tested, the quest he made it for. Here's the lines from the old movements.xml(was actually supposed to be teleport tiles):
Code:
	<movevent event="StepIn" itemid="426" uniqueid="7550" value="dtlevel.lua"/>
	<movevent event="StepOut" itemid="425" uniqueid="7550" value="dtlevel.lua"/>
	<movevent event="StepIn" itemid="426" uniqueid="7560" value="dtlevel.lua"/>
	<movevent event="StepOut" itemid="425" uniqueid="7560" value="dtlevel.lua"/>
	<movevent event="StepIn" itemid="426" uniqueid="7570" value="dtlevel.lua"/>
	<movevent event="StepOut" itemid="425" uniqueid="7570" value="dtlevel.lua"/>
	<movevent event="StepIn" itemid="426" uniqueid="7580" value="dtlevel.lua"/>
	<movevent event="StepOut" itemid="425" uniqueid="7580" value="dtlevel.lua"/>

I would post what I wrote but it's been deleted and really don't remember what I changed other than ids and script name... :(
 
Outstanding! Both working and about to be in-game. Thank you thank you thank you. Rep++ x 13216354543345646453 :D

Learned something new too, hey that's another plus ;)

- - - Updated - - -

Well just now found one glitch. The item tiles take all items when you enter one tile. Should I do the action ids like in the level tile script or... well that's what i did here:
Code:
local t = {
	[1120] = {2646, 1}, -- [tile actionId] = {itemId, count}
	[1130] = {8865, 1},
	[1140] = {5808, 1},
	[1150] = {5943, 1}
}
or do I need to define actionid in movements.xml and just make 4 copies of the script, each with the item needed removed(i.e. 4 xml lines pointing at 4 lua scripts)?

OK also, takes item(s) and bounced you back like you didn't have them. On last checks I had multiples of each item. this time I only had the item for that tile.
 
Last edited:
try
Lua:
local t = {
	[1100] = {2160, 1}, -- [tile actionId] = {itemId, count}
}
 
function onStepIn(cid, item, position, fromPosition)
	local k = t[item.actionid]
	if isPlayer(cid) then
		if not doPlayerRemoveItem(cid, k[1], k[2]) then
			doTeleportThing(cid, fromPosition)
			doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
		end
	end
	return TRUE
end
 
I'll give it a shot but remember, I have 4 itemtiles and the problem lies in each tile takes all required items instead of the one item required for each tile.
I need 4 tiles. Each requiring an item.
 
that script will work just do it like this:
Lua:
local t = {
	[1120] = {2646, 1}, -- [tile actionId] = {itemId, count}
	[1130] = {8865, 1},
	[1140] = {5808, 1},
	[1150] = {5943, 1}
}

function onStepIn(cid, item, position, fromPosition)
	local k = t[item.actionid]
	if isPlayer(cid) then
		if not doPlayerRemoveItem(cid, k[1], k[2]) then
			doTeleportThing(cid, fromPosition)
			doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
		end
	end
	return TRUE
end
used your values
 
Ah, a minor flaw. I've fixed that issue and updated my post above. Enjoy!

@UpInSmoke: You need to check for "k" with this script or it will mess up. Nice try, though.

J.Dre
 
Back
Top