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

Solved Helmet of the Ancient

Gabriel Tibiano

New Member
Joined
Nov 21, 2009
Messages
420
Reaction score
4
Can anyone simplify this script to me?

When a person enters the teleport with the item of the Pharaoh, is teleported to a secret room and receives a piece of the helmet, otherwise goes to the beginning of the tomb.

LUA:
function onStepIn(cid, item, pos, fromPosition)
local config = {
secretroom = {x=611, y=608, z=12},
begin = {x=611, y=608, z=12},
}

local p = pharaoitem[item.itemid]
local pharaoitem = {
[1] = {pharaoitem = 2348, helmetthing = 2335},
[2] = {pharaoitem = 2348, helmetthing = 2336},
[3] = {pharaoitem = 2348, helmetthing = 2337},
[4] = {pharaoitem = 2348, helmetthing = 2338},
[5] = {pharaoitem = 2348, helmetthing = 2340},
[6] = {pharaoitem = 2348, helmetthing = 2339},
}

if isPlayer(cid) then
		if getPlayerItemCount(cid, t.pharaoitem) >= 1 then
			doSendMagicEffect(fromPosition,2)
				doSendMagicEffect(config.secretroom,10)
					doTeleportThing(cid, config.secretroom)
				doPlayerRemoveItem(cid, t.pharaoitem, 1)
			doPlayerAddItem(cid, t.helmetthing, 1)
		else
			doTeleportThing(cid, config.begin)
				doSendMagicEffect(config.begin,10)
			doSendMagicEffect(fromPosition,2)
		end
	end
end
 
Last edited:
actually they should get the item from the sarcophagus, not by entering the teleport
LUA:
local t = {
--unique id, item, secret room, beginning
	[uid] = {2348, {x=1, y=1, z=1}, {x=1, y=1, z=1}},
	[uid] = {2349, {x=1, y=1, z=1}, {x=1, y=1, z=1}},
	[uid] = {2350, {x=1, y=1, z=1}, {x=1, y=1, z=1}},
	[uid] = {2351, {x=1, y=1, z=1}, {x=1, y=1, z=1}},
	[uid] = {2352, {x=1, y=1, z=1}, {x=1, y=1, z=1}},
	[uid] = {2353, {x=1, y=1, z=1}, {x=1, y=1, z=1}},
	[uid] = {2354, {x=1, y=1, z=1}, {x=1, y=1, z=1}}
}

function onStepIn(cid, item, position, fromPosition)
	if isPlayer(cid) then
		local p = t[item.uid]
		if doPlayerRemoveItem(cid, p[1], 1) then
			doTeleportThing(cid, p[2])
			doSendMagicEffect(p[2], CONST_ME_TELEPORT)
		else
			doTeleportThing(cid, p[3])
			doSendMagicEffect(p[3], CONST_ME_TELEPORT)
		end
		doSendMagicEffect(position, CONST_ME_TELEPORT)
	end
end
 
Last edited:
Old thread bump?!!? Need help with this script not sure why it's not working I've looked at it and as far as I understand it should work?

Here is the error I'm getting and I've changed nothing but the x,y,z locations.
Code:
[1/10/2012 22:0:29] [Error - MoveEvents Interface] 
[1/10/2012 22:0:29] data/movements/scripts/helmet_of_the_ancients/helmet_of_the_ancients_boss_tps.lua
[1/10/2012 22:0:29] Description: 
[1/10/2012 22:0:29] ..._of_the_ancients/helmet_of_the_ancients_boss_tps.lua:3: table index is nil
[1/10/2012 22:0:29] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/helmet_of_the_ancients/helmet_of_the_ancients_boss_tps.lua)

I'll post my script too.. I don't think only having tried setting up one of the tps should cause this error, if it is the problem I would feel stupid.

LUA:
local t = {
--unique id, item, secret room, beginning
    [uid] = {2348, {x=33195, y=33002, z=14}, {x=33178, y=33014, z=14}}, -- peninsula tomb
    [uid] = {2349, {x=1, y=1, z=1}, {x=1, y=1, z=1}},
    [uid] = {2350, {x=1, y=1, z=1}, {x=1, y=1, z=1}},
    [uid] = {2351, {x=1, y=1, z=1}, {x=1, y=1, z=1}},
    [uid] = {2352, {x=1, y=1, z=1}, {x=1, y=1, z=1}},
    [uid] = {2353, {x=1, y=1, z=1}, {x=1, y=1, z=1}},
    [uid] = {2354, {x=1, y=1, z=1}, {x=1, y=1, z=1}}
}
 
function onStepIn(cid, item, position, fromPosition)
    if isPlayer(cid) then
        local p = t[item.uid]
        if doPlayerRemoveItem(cid, p[1], 1) then
            doTeleportThing(cid, p[2])
            doSendMagicEffect(p[2], CONST_ME_TELEPORT)
        else
            doTeleportThing(cid, p[3])
            doSendMagicEffect(p[3], CONST_ME_TELEPORT)
        end
        doSendMagicEffect(position, CONST_ME_TELEPORT)
    end
end

Help with this would be much obliged... Thanks!

~Justin

p.s. Using tfs 0.4.3777 8.6 server
 
Back
Top