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

Firewalker just like rl?

Tofflarn

New Member
Joined
Mar 22, 2008
Messages
360
Reaction score
1
Location
Sweden
Hello otlanders ;)

Right now im sitting with a confusing script. I need some help. I wan't the real firewalker boots quest for my server.

This is how im thinking.

Player use pick on steam which have ID 9341.
The player get a storage id. (So the quest can't be done several times by same player. If a player have done the quest he should be refused to enter the tp that is crated)
a teleport is created with a action id, pos, and createpos.
A event is created so the pick can't be used on the steam for 15 min.

The players enter the teleport and the teleport that just was created should disappear.

When the player killed the boss he will be directly teleported to the reward room.


This is what i got now.

elseif itemEx.itemid == 9341 and itemEx.actionid == 56414 then
setPlayerStorageValue(cid,22222,1)
doCreateTeleport(1387, {x=32560, y=31403, z=15}, {x=32552, y=31376, z=15})
else
return false
end


I would be very grateful if somone helped me with this..

Yours Tofflarn
 
Well it can't be illegal to release a own made script? Im sure you can, seen your other scripts so i don't think it would be a problem. Would be awesome if you could give it a try :)
 
hehe, I guess I learned to script correct, so you will probably just rewrite it to return style xD

going to eat something now and then I can start
 
maybe some function that I dont know, but it looks like globalstorage+storage+simple onKill or onDeath(I preffer first one, dont know why)
and I'll make empty tp with position set in movement because it still needs movement to be executed so...

Ah, I found one problem: dont remember how to get time in lua...(hmm, already found way to make it witout comparing times)
 
maybe some function that I dont know, but it looks like globalstorage+storage+simple onKill or onDeath(I preffer first one, dont know why)
and I'll make empty tp with position set in movement because it still needs movement to be executed so...

Ah, I found one problem: dont remember how to get time in lua...(hmm, already found way to make it witout comparing times)
You shoudn't compare time because there is no delay in Real Tibia.
Also, it's better to use getCreaturesInRange instead of global storage.
 
I wanted to use globalstorage for A event is created so the pick can't be used on the steam for 15 min.
but its right: its better to just check if anyone is in boss room(decision belongs to Tofflarn)
@!down: will bug if player dies in room
checking area is better
 
Last edited:
Make it like:
when entering set globalstorageid 10000,1
when leaving set globalstorageid 10000,0

When trying to use the pick on the steam check if globalstorageid 10000 = 0, else give an error/cancel.
 
pick
Code:
local config =
{
	tpid = ,
	tppos = ,
	tpaid = ,
	steamid = ,
	steamaid = ,
	roomcenter = {x=, y=, z=},
	radius = ,
	text = "" ---text shown when player wants to use steam when someone is in room
}

local function check()
	local spec = getSpectators(config.roomcenter, config.radius, config.radius)
	 for i=1, #spec do
		if isPlayer(spec[i])	return false
		end
	end
return true


function onUse(cid, item, fromPosition, itemEx, toPosition)
	if((itemEx.uid <= 65535 or itemEx.actionid > 0) and isInArray({354, 355}, itemEx.itemid)) then
		doTransformItem(itemEx.uid, 392)
		doDecayItem(itemEx.uid)
		doSendMagicEffect(toPosition, CONST_ME_POFF)
		return true
	end
	if(itemEx.itemid == 7200) then
		doTransformItem(itemEx.uid, 7236)
		doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
		return true
	end
	if itemEx.itemid == config.steamid and itemEx.actionid == config.steamaid  then
		if check()	
			
			local tp = doCreateItem(config.tpid, config.tppos)
			doItemSetAttribute('aid', config.tpaid)
		else
			doCreatureSay(cid, config.text, "19")
		end
		return true
	end

	return false
end
portal stepin
Code:
local config =
{
	storage = ,
	text = "" ---text shown when player wants to enter room if he finished quest already(add storage in quest chest ok?)
	pos = {x=, y=, z=},
	roomcenter = {x=, y=, z=},
	radius = ,
	bossname="",
	bosspos ={x=, y=, z=}
}

function onStepIn(cid, item, pos, fromPos)
	if getPlayerStorageValue(cid, config.storage)~=1 then
		local spec = getSpectators(config.roomcenter, config.radius, config.radius)
			for i=1, #spec do
				if isMonster(spec[i])and getCreatureName(spec[i])== bossname then doRemoveThing(spec[i].uid) end
			end
		end
		doTeleportThing(cid.uid, config.pos)
		doSummonCreature(config.bossname, config.bosspos)
		doRemoveThing(item.uid)
	else
		doTeleportThing(cid.uid, fromPos)
		doCreatureSay(cid, config.text, "19")
	end
end
bosskill
Code:
local config =
{
	bossname="",
	rewardroompos={x=, y=, z=}
}

function onKill(cid, target, lastHit)
    if getCreatureName(target)== config.bossname then
		doTeleportThing(cid.uid, config.rewardroompos)
	end
	return TRUE
end
(yeah, should be done in mod to make only one config instead of declaring the same thing many times, but I suck at mods xD)
 
Last edited:
aff, in pascal its <> in php(and c++?) != and in lua ~=, awesome, why these guys cannot at least it unified?
edited(it was in 1 place I guess?)
 
Back
Top