• 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 [8.0+] Snow footsteps fix

zbizu

Legendary OT User
Joined
Nov 22, 2010
Messages
3,323
Solutions
26
Reaction score
2,696
Location
Poland
Footsteps in TFS are far from being like real tibia. It's decay and ids aren't coded as intended.
Here goes my fix, with this code stepping on snow will result same effect as in real tibia(floor ids are now correct and decay is now 10 sec as in rl instead of 30, now footprint appears after stepping out as on real tibia)

First find and replace these ids in items.xml(or write it in mod using override="yes" near every id):
XML:
	<item id="6594" name="snow">
		<attribute key="description" value="Someone must have walked here recently." />
		<attribute key="decayTo" value="670" />
		<attribute key="duration" value="10" />
	</item>
	<item id="6595" name="snow">
		<attribute key="description" value="Someone must have walked here recently." />
		<attribute key="decayTo" value="6580" />
		<attribute key="duration" value="10" />
	</item>
	<item id="6596" name="snow">
		<attribute key="description" value="Someone must have walked here recently." />
		<attribute key="decayTo" value="6581" />
		<attribute key="duration" value="10" />
	</item>
	<item id="6597" name="snow">
		<attribute key="description" value="Someone must have walked here recently." />
		<attribute key="decayTo" value="6582" />
		<attribute key="duration" value="10" />
	</item>
	<item id="6598" name="snow">
		<attribute key="description" value="Someone must have walked here recently." />
		<attribute key="decayTo" value="6583" />
		<attribute key="duration" value="10" />
	</item>
	<item id="6599" name="snow">
		<attribute key="description" value="Someone must have walked here recently." />
		<attribute key="decayTo" value="6584" />
		<attribute key="duration" value="10" />
	</item>
	<item id="6600" name="snow">
		<attribute key="description" value="Someone must have walked here recently." />
		<attribute key="decayTo" value="6585" />
		<attribute key="duration" value="10" />
	</item>
	<item id="6601" name="snow">
		<attribute key="description" value="Someone must have walked here recently." />
		<attribute key="decayTo" value="6586" />
		<attribute key="duration" value="10" />
	</item>
	<item id="6602" name="snow">
		<attribute key="description" value="Someone must have walked here recently." />
		<attribute key="decayTo" value="6587" />
		<attribute key="duration" value="10" />
	</item>
	<item id="6603" name="snow">
		<attribute key="description" value="Someone must have walked here recently." />
		<attribute key="decayTo" value="6588" />
		<attribute key="duration" value="10" />
	</item>
	<item id="6604" name="snow">
		<attribute key="description" value="Someone must have walked here recently." />
		<attribute key="decayTo" value="6589" />
		<attribute key="duration" value="10" />
	</item>
	<item id="6605" name="snow">
		<attribute key="description" value="Someone must have walked here recently." />
		<attribute key="decayTo" value="6590" />
		<attribute key="duration" value="10" />
	</item>
	<item id="6606" name="snow">
		<attribute key="description" value="Someone must have walked here recently." />
		<attribute key="decayTo" value="6591" />
		<attribute key="duration" value="10" />
	</item>
	<item id="6607" name="snow">
		<attribute key="description" value="Someone must have walked here recently." />
		<attribute key="decayTo" value="6592" />
		<attribute key="duration" value="10" />
	</item>
	<item id="6608" name="snow">
		<attribute key="description" value="Someone must have walked here recently." />
		<attribute key="decayTo" value="6593" />
		<attribute key="duration" value="10" />
	</item>

replace in movements.xml(to avoid bug):
XML:
<movevent type="StepIn" itemid="670" event="script" value="snow.lua"/>
<movevent type="StepIn" fromid="6580" toid="6594" event="script" value="snow.lua"/>
to
XML:
	<movevent type="StepOut" itemid="670" event="script" value="snow.lua"/>
	<movevent type="StepOut" fromid="6580" toid="6593" event="script" value="snow.lua"/>

go to movements\scripts\snow.lua and replace its content for:
Lua:
function onStepOut(cid, item, position, fromPosition)
	if (isPlayerGhost(cid)) == false then
		if(item.itemid == 670) then
			doDecayItem(doCreateItem(6594, fromPosition))
		else
			doDecayItem(doCreateItem(item.itemid + 15, fromPosition))
		end
	end
	return true
end

Changes:
12th May 2013, 00:43 fixed memory error in last code(sometimes footstep wasn't sent to the client)
 
Last edited:
Thank you very much for sharing this! Working 100%
 
Back
Top