• 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 Rusty Legs and Armor.

SEVERAL BUGS!
--If you use it in any object, the object will disappear (Including walls and magic walls, teleports, plants, signs, shields, armors, legs, boots, amulets, backpacks, the same rust remover and the FLOORS, anyway.. ANY OBJECT)
--If you use it in Rusty Legs, the rusty legs will be transformed to an armor.


Hahahaha you've created the best Desintegrate Run... Item xD!
So... fix it...

LOL that's true! this is the rune/item...

TO RULE THEM ALL!
 
Code:
local config = 
{ -- armors
    [9808] = {{1, 400, 2464}, {400, 700, 2465}, {700, 900, 2483}, {900, 1000, 2463}}, -- Common
    [9809] = {{1, 250, 2464}, {250, 400, 2465}, {400, 600, 2483}, {600, 850, 2463}, {850, 950, 2476}, {950, 1000, 8891}}, -- Semi-Rare
    [9810] = {{1, 250, 2465}, {250, 450, 2483}, {450, 600, 2463}, {600, 750, 2476}, {750, 850, 8891}, {850, 930, 2487}, {930, 970, 2466}, {970, 1000, 2472}}, -- Rare

  -- legs
    [9811] = {{1, 400, 2464}, {400, 700, 2465}, {700, 900, 2483}, {900, 1000, 2463}}, -- Common
    [9812] = {{1, 250, 2464}, {250, 400, 2465}, {400, 600, 2483}, {600, 850, 2463}, {850, 950, 2476}, {950, 1000, 8891}}, -- Semi-Rare
    [9813] = {{1, 250, 2465}, {250, 450, 2483}, {450, 600, 2463}, {600, 750, 2476}, {750, 850, 8891}, {850, 930, 2487}, {930, 970, 2466}, {970, 1000, 2472}}, -- Rare
}


function onUse(cid, item, fromPosition, itemEx, toPosition)
local random = math.random(1, 1300)

    for i, v in pairs(config) do
        if(itemEx.itemid == i) then
            for i = 1, table.maxn(v) do
                if(random >= v[i][1] and random < v[i][2]) then
                    items = v[i][3]
            	end
	    end
		if random <= 1000 then
              		doTransformItem(itemEx.uid, items)
      	      		doRemoveItem(item.uid, 1)
    	      		doSendMagicEffect(toPosition, CONST_ME_POFF)
		else

		        doRemoveItem(itemEx.uid)
    	      		doSendMagicEffect(toPosition, CONST_ME_POFF)
      	      	        doRemoveItem(item.uid, 1)
		end
	elseif not(itemEx.itemid == i) or not(itemEx.itemid == v[i][3]) then
	      doPlayerSendCancel(cid, "You can not use this object.")

        end

    end

    return TRUE
end

But you have to change legs itemid, in config :p
 
SEVERAL BUGS!
--If you use it in any object, the object will disappear (Including walls and magic walls, teleports, plants, signs, shields, armors, legs, boots, amulets, backpacks, the same rust remover and the FLOORS, anyway.. ANY OBJECT)
--If you use it in Rusty Legs, the rusty legs will be transformed to an armor.


Hahahaha you've created the best Desintegrate Run... Item xD!
So... fix it...
I fixed it, part of legs you must make be yourself because im too lazy.
PHP:
local rusty = 
{
    [9808] = {{1, 400, 2464}, {400, 700, 2465}, {700, 900, 2483}, {900, 1000, 2463}}, -- Common
    [9809] = {{1, 250, 2464}, {250, 400, 2465}, {400, 600, 2483}, {600, 850, 2463}, {850, 950, 2476}, {950, 1000, 8891}}, -- Semi-Rare
    [9810] = {{1, 250, 2465}, {250, 450, 2483}, {450, 600, 2463}, {600, 750, 2476}, {750, 850, 8891}, {850, 930, 2487}, {930, 970, 2466}, {970, 1000, 2472}}, -- Rare
    [9811] = {{1, 400, 2464}, {400, 700, 2465}, {700, 900, 2483}, {900, 1000, 2463}}, -- Common
    [9812] = {{1, 250, 2464}, {250, 400, 2465}, {400, 600, 2483}, {600, 850, 2463}, {850, 950, 2476}, {950, 1000, 8891}}, -- Semi-Rare
    [9813] = {{1, 250, 2465}, {250, 450, 2483}, {450, 600, 2463}, {600, 750, 2476}, {750, 850, 8891}, {850, 930, 2487}, {930, 970, 2466}, {970, 1000, 2472}}, -- Rare
}

function removeAndEffect(item, itemEx, effectType)
    doRemoveItem(item.uid, 1)
    doRemoveItem(itemEx.uid, 1)
    doSendMagicEffect(getThingPos(item.uid), effectType)
    return TRUE
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local random = math.random(1, 1300)
    if(isInArray({9808, 9809, 9810, 9811, 9812, 9813}, itemEx.itemid) ~= TRUE) then
        doPlayerSendCancel(cid, "Sorry, not possible.")
        return TRUE
    end
    if(random > 1000) then
        removeAndEffect(item, itemEx, CONST_ME_BLOCKHIT)
        return TRUE
    end
    for i, v in pairs(rusty) do
        if(itemEx.itemid == i) then
            for i = 1, table.maxn(v) do
                if(random >= v[i][1] and random < v[i][2]) then
                    items = doCreateItemEx(v[i][3])
                end
            end
            doPlayerAddItemEx(cid, items)
            removeAndEffect(item, itemEx, CONST_ME_POFF)            
        end
    end
    return TRUE
end
 
I fixed it, part of legs you must make be yourself because im too lazy.
PHP:
local rusty = 
{
    [9808] = {{1, 400, 2464}, {400, 700, 2465}, {700, 900, 2483}, {900, 1000, 2463}}, -- Common
    [9809] = {{1, 250, 2464}, {250, 400, 2465}, {400, 600, 2483}, {600, 850, 2463}, {850, 950, 2476}, {950, 1000, 8891}}, -- Semi-Rare
    [9810] = {{1, 250, 2465}, {250, 450, 2483}, {450, 600, 2463}, {600, 750, 2476}, {750, 850, 8891}, {850, 930, 2487}, {930, 970, 2466}, {970, 1000, 2472}}, -- Rare
    [9811] = {{1, 400, 2464}, {400, 700, 2465}, {700, 900, 2483}, {900, 1000, 2463}}, -- Common
    [9812] = {{1, 250, 2464}, {250, 400, 2465}, {400, 600, 2483}, {600, 850, 2463}, {850, 950, 2476}, {950, 1000, 8891}}, -- Semi-Rare
    [9813] = {{1, 250, 2465}, {250, 450, 2483}, {450, 600, 2463}, {600, 750, 2476}, {750, 850, 8891}, {850, 930, 2487}, {930, 970, 2466}, {970, 1000, 2472}}, -- Rare
}

function removeAndEffect(item, itemEx, effectType)
    doRemoveItem(item.uid, 1)
    doRemoveItem(itemEx.uid, 1)
    doSendMagicEffect(getThingPos(item.uid), effectType)
    return TRUE
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local random = math.random(1, 1300)
    if(isInArray({9808, 9809, 9810, 9811, 9812, 9813}, itemEx.itemid) ~= TRUE) then
        doPlayerSendCancel(cid, "Sorry, not possible.")
        return TRUE
    end
    if(random > 1000) then
        removeAndEffect(item, itemEx, CONST_ME_BLOCKHIT)
        return TRUE
    end
    for i, v in pairs(rusty) do
        if(itemEx.itemid == i) then
            for i = 1, table.maxn(v) do
                if(random >= v[i][1] and random < v[i][2]) then
                    items = doCreateItemEx(v[i][3])
                end
            end
            doPlayerAddItemEx(cid, items)
            removeAndEffect(item, itemEx, CONST_ME_POFF)            
        end
    end
    return TRUE
end

You didnt fix you bug with 'desintegrate' effect :p

Code:
    if(random > 1000) then
        removeAndEffect(item, itemEx, CONST_ME_BLOCKHIT)
        return TRUE
    end

This part you should place under 'for' function, beacouse script will remove every itemEx when randon number is higher than 1000 =]

there is also shield, boots and helmet

So you can just add this shield's and whatever you want, into the table and you're done =]
 
It should work on tfs 0.2, but this version has not, this items ids, I quess :p

@ I mean both of them. :p
 
Last edited:
Back
Top