• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

MoveEvent [RELEASE] Firewalker Boots

Zoriath

New Member
Joined
Mar 26, 2008
Messages
1,496
Reaction score
4
First of all, we'll start off changing the item properties. So go to data/items/items.xml and search for "firewalker boots", you will go to itemid 9932.

Just remove <attribute key="absorbPercentFire" value="90"/> from both itemid 9932 as from 9933.

Okay, now go to itemid 1487 and remove <attribute key="damage" value="20"/>.

Then just go to the next itemid (1488) and remove <attribute key="damage" value="10"/>.

If you've done that, jump to itemid 1492 and remove <attribute key="damage" value="20"/>, just as you did twice before.

Go to the next itemid again, 1493 and remove <attribute key="damage" value="10"/>.


Now we've done that, open up data/movements/movements.xml.
Add this (doesn't really matter where you add it):
PHP:
	<!-- Firewalker Boots -->
	<movevent type="StepIn" fromid="1487" toid="1488" event="script" value="firewalker.lua"/>
	<movevent type="StepIn" fromid="1492" toid="1493" event="script" value="firewalker.lua"/>
	<movevent type="StepIn" fromid="1500" toid="1501" event="script" value="firewalker.lua"/>

Then make a file called firewalker.lua in data/movements/scripts/.

Add this in that file:
Lua:
function onStepIn(cid, item, position, fromPosition)
	if(getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == 9932 or getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == 9933) then
		if(item.itemid == 1487 or item.itemid == 1492 or item.itemid == 1500) then
			doCreatureAddHealth(cid, -2, TRUE)
		elseif(item.itemid == 1488 or item.itemid == 1493 or item.itemid == 1501) then
			doCreatureAddHealth(cid, -1, TRUE)
		end
	elseif(item.itemid == 1487 or item.itemid == 1492 or item.itemid == 1500) then
		doCreatureAddHealth(cid, -20, TRUE)
	elseif(item.itemid == 1488 or item.itemid == 1493 or item.itemid == 1501) then
		doCreatureAddHealth(cid, -10, TRUE)
	end	
end

Then you're done! Congratulations ;)


Kind Regards,

Zoriath
 
Shorter (Not tested)

Lua:
function onStepIn(cid, item, position, fromPosition)

local boots = {9932, 9933}

local fields = 
{
	{1487, 1492, 1500},
	{1488, 1493, 1501}
}
        if isInArray(boots, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
                if isInArray(fields[1], item.itemid) then
                        doCreatureAddHealth(cid, -2, TRUE)
                elseif isInArray(fields[2], item.itemid) then
                        doCreatureAddHealth(cid, -1, TRUE)
                end
        elseif isInArray(fields[1], item.itemid) then
                doCreatureAddHealth(cid, -20, TRUE)
        elseif isInArray(fields[2], item.itemid) then
                doCreatureAddHealth(cid, -10, TRUE)
        end    
end
 
Shorter (Not tested)

Lua:
function onStepIn(cid, item, position, fromPosition)

local boots = {9932, 9933}

local fields = 
{
	{1487, 1492, 1500},
	{1488, 1493, 1501}
}
        if isInArray(boots, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
                if isInArray(fields[1], item.itemid) then
                        doCreatureAddHealth(cid, -2, TRUE)
                elseif isInArray(fields[2], item.itemid) then
                        doCreatureAddHealth(cid, -1, TRUE)
                end
        elseif isInArray(fields[1], item.itemid) then
                doCreatureAddHealth(cid, -20, TRUE)
        elseif isInArray(fields[2], item.itemid) then
                doCreatureAddHealth(cid, -10, TRUE)
        end    
end

Isn't shorter, compare the bytes, and you'll see that mine has 662 bytes and yours has 727 bytes. I know, yours got a nicer overview, but who needs that? This script is supposed to do one thing, protect 90% from fire fields, you don't need to add fields or something, or add any id of the boots. Plus that even if you wanted to add fields in your script, you still have to add another if later on, so doesn't make any sense.

Thanks a lot dude.

You're welcome.
 
Thanks alot, im adding this to favourites so i can add them to my server. Thanks alot..

++++rep
 
Isn't shorter, compare the bytes, and you'll see that mine has 662 bytes and yours has 727 bytes. I know, yours got a nicer overview, but who needs that? This script is supposed to do one thing, protect 90% from fire fields, you don't need to add fields or something, or add any id of the boots. Plus that even if you wanted to add fields in your script, you still have to add another if later on, so doesn't make any sense.

.!.
 

Haha, this guy got pwnd.


@EDIT:
Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	local biggerFields = {1487, 1492, 1500}
	if (getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == 9932) then
		doCreatureAddHealth(cid, -(isInArray(biggerFields, item.itemid) == TRUE and 2 or 1))
	else
		doCreatureAddHealth(cid, -(isInArray(biggerFields, item.itemid) == TRUE and 20 or 10))
	end
	return true
end

And btw. 400 bytes...
 
Last edited:
Haha, this guy got pwnd.


@EDIT:
Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	local biggerFields = {1487, 1492, 1500}
	if (getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == 9932) then
		doCreatureAddHealth(cid, -(isInArray(biggerFields, item.itemid) == TRUE and 2 or 1))
	else
		doCreatureAddHealth(cid, -(isInArray(biggerFields, item.itemid) == TRUE and 20 or 10))
	end
	return true
end

And btw. 400 bytes...
Nice one.. :p Hadn't done Lua for a long time before this script though, was busy doing PHP:p..
And for you darkhaos, don't take what I said as an offense please :p, it's just some constructive critisism, that the most complicated code doesn't have to be shorter than a simple one;)
 
Last edited:
Too bad it contains a irritating bug. When you step into a fire field without boots you will lose HP but it won't show as damage above the character, only in Server Log. Anyone know how to fix?

;*
 
What if someone is using manashield? It will still take HP, not MP.
Also, you should use doTragetCombatHealth/Mana.

TANKS FOR ATENTIUN!
 
And it spams the server log with this

Code:
[26/10/2009 16:53:25] Lua Script Error: [MoveEvents Interface] 
[26/10/2009 16:53:25] data/movements/scripts/firewalker.lua:onStepIn

[26/10/2009 16:53:25] luaGetPlayerSlotItem(). Player not found
 
I found this script here the other day

Movement: Firewalker Boots | Forums | Tibia Help - Simplify your Tibia life

So ur that guy on tibiahelp.com as well then?

thanks btw

Nope, he probably copied it from me <_<

And it spams the server log with this

Code:
[26/10/2009 16:53:25] Lua Script Error: [MoveEvents Interface] 
[26/10/2009 16:53:25] data/movements/scripts/firewalker.lua:onStepIn

[26/10/2009 16:53:25] luaGetPlayerSlotItem(). Player not found

Weird, for me it worked :eek:
 
Last edited:
Nope, he probably copied it from me <_<



Weird, for me it worked :eek:

I put in everything fine, but it doesn't show the fire damage and lags up server when people WITHOUT boots walks on firefields.
 
Back
Top