Action Rust Remover

AGS

DeathSouls Owner
Joined
Oct 29, 2007
Messages
400
Best answers
0
Reaction score
8
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:

The second rusty armor is missing the crown armor, I will update the image later.
 
Last edited:
OP
AGS

AGS

DeathSouls Owner
Joined
Oct 29, 2007
Messages
400
Best answers
0
Reaction score
8
Location
Mexico
Ok, added it to the script, I will update the image later
 

Mummrik

Hey!
Joined
Oct 22, 2007
Messages
680
Best answers
25
Reaction score
108
Location
Sweden
wonder if you can get Golden helmet from the rusty helmets in real tibia and same whit soft boots from the rusty boots
 

Snow

New Member
Joined
Jan 16, 2008
Messages
381
Best answers
0
Reaction score
0
wonder if you can get Golden helmet from the rusty helmets in real tibia and same whit soft boots from the rusty boots
Technically Rusty Boots weren't found yet...
 

Keraxel

Ω Obfuscator Ω
Joined
Feb 2, 2008
Messages
941
Best answers
0
Reaction score
5
Location
Republic of Poland
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:

Cykotitan

Experienced G'
Joined
Nov 4, 2008
Messages
16,894
Best answers
4
Reaction score
817
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)
 

Slain

TrueHavoc.com
Joined
Nov 27, 2008
Messages
2,241
Best answers
0
Reaction score
29
works perfectly, thanks
 

jtzin

New Member
Joined
May 19, 2011
Messages
1
Best answers
0
Reaction score
0
I did a hotkey but I do not know where you put the code,
can you help me?
 
Top