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

Action Rust Remover

AGS

DeathSouls Owner
Joined
Oct 29, 2007
Messages
400
Reaction score
10
Location
Mexico
Here's my rust remover's script, I just made it.
Each type of rusty item has 3 different items, common, semi-rare and rare.

So far only armors and legs have been discovered in real tibia, but I added all the rusty items.
PHP:
local breakChance = 60
local rustyItems = {
	[9808] = {2464, 2465, 2483, 2463, 2476}, --common rusty armor
	[9809] = {2464, 2465, 2483, 2463, 2476, 8891, 2487}, --semi-rare rusty armor
	[9810] = {2465, 2463, 2476, 8891, 2487, 2466, 2492, 2472}, --rare rusty armor
	[9811] = {2468, 2648, 2478, 2647, 2477}, --common rusty legs
	[9812] = {2468, 2648, 2478, 2647, 2477, 2488}, --semi-rare rusty legs
	[9813] = {2468, 2648, 2478, 2647, 2477, 2488, 2470}, --rare rusty legs
	[9814] = {2511, 2510, 2530, 2509, 2513, 2515}, --common rusty shield
	[9815] = {2511, 2510, 2530, 2509, 2513, 2515, 2516, 2519}, --semi-rare rusty shield
	[9816] = {2511, 2510, 2530, 2509, 2513, 2515, 2516, 2519, 2520, 2514}, --rare rusty shield 
	[9817] = {2643, 3982, 5462, 7457}, --common rusty boots
	[9818] = {2643, 3982, 5462, 7457, 2195}, --semi-rare rusty boots
	[9819] = {2643, 3982, 5462, 7457, 2195, 2645}, --rare rusty boots
	[9820] = {2458, 2460, 2480, 2481, 2457, 2491}, --common rusty helmet
	[9821] = {2458, 2460, 2480, 2481, 2457, 2491, 2497}, --semi rare rusty helmet
	[9822] = {2458, 2460, 2480, 2481, 2457, 2491, 2497, 2475, 2498} --rare rusty helmet
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if rustyItems[itemEx.itemid] ~= nil then
		if math.random(100) <= breakChance then
			doRemoveItem(itemEx.uid)
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You broke it.")
		else
			local newId = rustyItems[itemEx.itemid][math.random(#rustyItems[itemEx.itemid])]
			doTransformItem(itemEx.uid,newId)
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You removed the rust, revealing a "..getItemNameById(newId))
		end
		doRemoveItem(item.uid,1)
		return TRUE
	end
	return FALSE
end
Code:
<action itemid="9930" script="rustremover.lua"/>

And that's it, Hope you like it.

Here are the possible items:
rustremover.png

The second rusty armor is missing the crown armor, I will update the image later.
 
Last edited:
Ok, added it to the script, I will update the image later
 
wonder if you can get Golden helmet from the rusty helmets in real tibia and same whit soft boots from the rusty boots
 
Rust Remover is stackable so removing this item should be:
PHP:
local breakChance = 60 
local rustyItems = { 
    [9808] = {2464, 2465, 2483, 2463, 2476}, --common rusty armor 
    [9809] = {2464, 2465, 2483, 2463, 2476, 8891, 2487}, --semi-rare rusty armor 
    [9810] = {2464, 2465, 2483, 2463, 2476, 8891, 2487, 2466, 2472}, --rare rusty armor 
    [9811] = {2468, 2648, 2478, 2647, 2477}, --common rusty legs 
    [9812] = {2468, 2648, 2478, 2647, 2477, 2488}, --semi-rare rusty legs 
    [9813] = {2468, 2648, 2478, 2647, 2477, 2488, 2470}, --rare rusty legs 
    [9814] = {2511, 2510, 2530, 2509, 2513, 2515}, --common rusty shield 
    [9815] = {2511, 2510, 2530, 2509, 2513, 2515, 2516, 2519}, --semi-rare rusty shield 
    [9816] = {2511, 2510, 2530, 2509, 2513, 2515, 2516, 2519, 2520, 2514}, --rare rusty shield  
    [9817] = {2643, 3982, 5462, 7457}, --common rusty boots 
    [9818] = {2643, 3982, 5462, 7457, 2195}, --semi-rare rusty boots 
    [9819] = {2643, 3982, 5462, 7457, 2195, 2645}, --rare rusty boots 
    [9820] = {2458, 2460, 2480, 2481, 2457, 2491}, --common rusty helmet 
    [9821] = {2458, 2460, 2480, 2481, 2457, 2491, 2497}, --semi rare rusty helmet 
    [9822] = {2458, 2460, 2480, 2481, 2457, 2491, 2497, 2475, 2498} --rare rusty helmet 
} 
function onUse(cid, item, fromPosition, itemEx, toPosition) 
    if rustyItems[itemEx.itemid] ~= nil then 
        if math.random(100) <= breakChance then 
            doRemoveItem(itemEx.uid) 
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You broke it.") 
        else 
            local newId = rustyItems[itemEx.itemid][math.random(#rustyItems[itemEx.itemid])] 
            doTransformItem(itemEx.uid,newId) 
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You removed the rust, revealing a "..getItemNameById(newId)) 
        end 
		doRemoveItem(item.uid, 1)
        return TRUE 
    end 
    return FALSE 
end
 
Last edited:
Rust Remover is stackable so removing this item should be:
PHP:
	if(item.type > 1) then
		doChangeTypeItem(item.uid, item.type - 1)
	else
		doRemoveItem(item.uid)
	end

Actually, it should be like this:
PHP:
		doRemoveItem(item.uid,1)
 
I did a hotkey but I do not know where you put the code,
can you help me?
 
In which file should I paste this? <action itemid="9930" script="rustremover.lua"/>
 
In which file should I paste this? <action itemid="9930" script="rustremover.lua"/>
data/actions/actions.xml

If you have a newer tfs version (1.4/1.5)
You can use revscripts instead. This script you're looking at is quite old.

This one probably works fine (you might need to edit it abit depending on what version of Tibia you're going for)
 
Last edited:
Back
Top