• 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 [TFS 0.3.6-0.4] Item Seller v1.0

God Mythera

Veteran OT User
Joined
Aug 11, 2012
Messages
2,048
Solutions
2
Reaction score
256
Location
United States
Hello and im here to release a script that i edited, the script already exists but im adding 100% items sellable in this script! So here we go...

actions/actions.xml
Code:
<action itemid="9737" script="magicalorb.lua"/>

The item i am using looks like this:
latest


actions/scripts/magicalorb.lua
Code:
local items = {
   [2195] = 35000, -- [boots of haste] = PriceOfItem
   [2136] = 35000, -- [demonbone amulet] = PriceOfItem
   [2487] = 14500, -- [crown armor] = PriceOfItem
   [2519] = 10300, -- [crown shield] = PriceOfItem
   [2491] = 3500, -- [crown helmet] = PriceOfItem
   [2488] = 14500, -- [crown legs] = PriceOfItem
   [2492] = 45000, -- [dragon scale mail] = PriceOfItem
   [7897] = 13000, -- [glacier robe] = PriceOfItem
   [2466] = 23500, -- [golden armor] = PriceOfItem
   [8873] = 5500, -- [hibicus robe] = PriceOfItem
   [3968] = 2000, -- [leopard armor] = PriceOfItem
   [7898] = 13500, -- [lightning robe] = PriceOfItem
   [7899] = 14000, -- [magma robe] = PriceOfItem
   [7463] = 8000, -- [mammoth fur cape] = PriceOfItem
   [8891] = 18000, -- [paladin armor] = PriceOfItem
   [6095] = 1500, -- [pirate shirt] = PriceOfItem
   [8889] = 22000, -- [skullcracker armor] = PriceOfItem
   [7884] = 14500, -- [terra mantle] = PriceOfItem
   [7896] = 13500, -- [glacier kilt] = PriceOfItem
   [7895] = 13500, -- [lightning legs] = PriceOfItem
   [7894] = 13500, -- [magma legs] = PriceOfItem
   [7464] = 1350, -- [mammoth fur shorts] = PriceOfItem
   [5918] = 600, -- [pirate knee breeches] = PriceOfItem
   [7885] = 13500, -- [terra legs] = PriceOfItem
   [2541] = 260, -- [bone shield] = PriceOfItem
   [2535] = 8000, -- [castle shield] = PriceOfItem
   [2521] = 1100, -- [dark shield] = PriceOfItem
   [2520] = 33000, -- [demon shield] = PriceOfItem
   [2536] = 1250, -- [medusa shield] = PriceOfItem
   [7460] = 2500, -- [norse shield] = PriceOfItem
   [2540] = 3500, -- [scarab shield] = PriceOfItem
   [6131] = 350, -- [tortoise shield] = PriceOfItem
   [3972] = 10500, -- [beholder helmet] = PriceOfItem
   [2462] = 1700, -- [devil helmet] = PriceOfItem
   [7902] = 3300, -- [glacier mask] = PriceOfItem
   [7461] = 600, -- [krimhorn helmet] = PriceOfItem
   [7901] = 3500, -- [lightning headband] = PriceOfItem
   [7900] = 3500, -- [magma monocle] = PriceOfItem
   [6096] = 1700, -- [pirate hat] = PriceOfItem
   [7462] = 1000, -- [devil helmet] = PriceOfItem
   [5741] = 45000, -- [skull helmet] = PriceOfItem
   [7903] = 3500, -- [terra hood] = PriceOfItem
   [3982] = 2000, -- [crocodile boots] = PriceOfItem
   [7457] = 3000, -- [fur boots] = PriceOfItem
   [7892] = 3500, -- [glacier shoes] = PriceOfItem
   [7893] = 3500, -- [lightning boots] = PriceOfItem
   [7891] = 3500, -- [magma boots] = PriceOfItem
   [2641] = 3000, -- [patched boots] = PriceOfItem
   [5462] = 4500, -- [pirate boots] = PriceOfItem
   [2645] = 33000, -- [steel boots] = PriceOfItem
   [7886] = 3500, -- [terra boots] = PriceOfItem
   [7414] = 23500, -- [abyss hammer] = PriceOfItem
   [7426] = 1100, -- [amber staff] = PriceOfItem
   [7404] = 23000, -- [assassin dagger] = PriceOfItem
   [3962] = 2500, -- [beastslayer axe] = PriceOfItem
   [7403] = 45000, -- [berserker] = PriceOfItem
   [7379] = 2500, -- [brutetamer's staff ] = PriceOfItem
   [7427] = 12000, -- [chaos mace] = PriceOfItem
   [7415] = 33500, -- [cranial basher] = PriceOfItem
   [7449] = 1100, -- [crystal sword] = PriceOfItem
   [2439] = 450, -- [daramanian mace] = PriceOfItem
   [2440] = 2200, -- [daramanian axe] = PriceOfItem
   [7382] = 41000, -- [demonrage sword] = PriceOfItem
   [7387] = 4500, -- [diamond sceptre] = PriceOfItem
   [7402] = 18000, -- [dragon slayer] = PriceOfItem
   [7430] = 5500, -- [dragonbone staff] = PriceOfItem
   [7409] = 13500, -- [imaginary staff] = PriceOfItem
   [2438] = 11500, -- [epee] = PriceOfItem
   [7432] = 2200, -- [furry club] = PriceOfItem
   [2427] = 14500, -- [guardian halberd] = PriceOfItem
   [2444] = 33500, -- [hammer of wrath] = PriceOfItem
   [2452] = 56500, -- [heavy mace] = PriceOfItem
   [2442] = 300, -- [heavy machete] = PriceOfItem
   [7389] = 33500, -- [heroic axe] = PriceOfItem
   [7422] = 30000, -- [jade hammer] = PriceOfItem
   [7424] = 8000, -- [lunar staff] = PriceOfItem
   [7381] = 800, -- [mammoth whopper] = PriceOfItem
   [7386] = 15500, -- [mercenary sword] = PriceOfItem
   [7384] = 33500, -- [mystic blade] = PriceOfItem
   [2426] = 3000, -- [naginata] = PriceOfItem
   [7418] = 40000, -- [nightmare blade] = PriceOfItem
   [7456] = 13000, -- [noble axe] = PriceOfItem
   [7383] = 30000, -- [relic sword] = PriceOfItem
   [6553] = 50000, -- [ruthless axe] = PriceOfItem
   [7437] = 10000, -- [sapphire hammer] = PriceOfItem
   [2402] = 1200, -- [silver dagger] = PriceOfItem
   [7452] = 8000, -- [spiked squelcher] = PriceOfItem
   [7425] = 1000, -- [taurus mace] = PriceOfItem
   [7388] = 33500, -- [vile axe] = PriceOfItem
   [2454] = 15500, -- [war axe] = PriceOfItem
   [7408] = 2500, -- [wyvern fang] = PriceOfItem
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

     local x = items[itemEx.itemid]
     if x then
         doRemoveItem(itemEx.uid, 1)
         doPlayerAddMoney(cid, x)
         local info = getItemRWInfo(itemEx.itemid)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have sold your item!")
        doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_YELLOW)
     else
         doPlayerSendCancel(cid, "You can't sell this item.")
         doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
     end
     return true
end

If any items are missing or any item is misspelled reply to this thread ^^

Credit: Unknown (if you know who created it pm me and i will tag that person)
 
It's possible to sell all loots of the item click?
Example: after click on the mpa selling all counts the player having in bps
 
It's possible to sell all loots of the item click?
Example: after click on the mpa selling all counts the player having in bps
Lua:
local items = {
    [2537] = {value = 4800},
    [2377] = {value = 480},
    [2663] = {value = 600},
    [2472] = {value = 90000},
    [2475] = {value = 7200},
    [2519] = {value = 8000},
    [2497] = {value = 6000},
    [2523] = {value = 180000},
    [2494] = {value = 108000},
    [2400] = {value = 144000},
    [2491] = {value = 2500},
    [2421] = {value = 108000},
    [2646] = {value = 240000},
    [2477] = {value = 5000},
    [2656] = {value = 10000},
    [2498] = {value = 30000},
    [2647] = {value = 600},
    [2534] = {value = 15000},
    [7402] = {value = 15000},
    [2466] = {value = 20000},
    [2465] = {value = 240},
    [2408] = {value = 120000},
    [2518] = {value = 1800},
    [2500] = {value = 3000},
    [2470] = {value = 30000},
    [2645] = {value = 30000},
    [2434] = {value = 2000},
    [2463] = {value = 480},
    [2536] = {value = 9000},
    [2387] = {value = 240},
    [2396] = {value = 1000},
    [2381] = {value = 450},
    [2528] = {value = 8000},
    [2409] = {value = 1800},
    [2414] = {value = 9000},
    [2427] = {value = 11000},
    [2407] = {value = 7200},
    [2383] = {value = 960},
    [2392] = {value = 4000},
    [2488] = {value = 12000},
    [2525] = {value = 250},
    [2423] = {value = 1000},
    [2462] = {value = 4800},
    [2520] = {value = 30000},
    [2390] = {value = 180000},
    [2417] = {value = 500},
    [2436] = {value = 6000},
    [5741] = {value = 40000},
    [2378] = {value = 500},
    [2487] = {value = 12000},
    [2476] = {value = 5000},
    [8891] = {value = 15000},
    [2195] = {value = 30000},
    [2391] = {value = 7200},
    [8889] = {value = 18000},
    [2432] = {value = 8000},
    [2431] = {value = 108000},
    [2492] = {value = 40000},
    [2515] = {value = 2000},
    [2430] = {value = 2000},
    [2393] = {value = 17000},
    [7419] = {value = 10000},
    [2522] = {value = 120000},
    [2514] = {value = 50000},
    [7418] = {value = 35000}
}

 function onUse(cid, item, frompos, itemEx, topos)
    if (itemEx.itemid == item.itemid) then
        local str = ""
        for i, k in pairs(items) do
            str = str ..getItemNameById(i):gsub("%a", string.upper, 1).. ": ".. k.value .. "\n"
        end
        doShowTextDialog(cid, 6533, "Item Name: Price\n-----------------------------\n".. str)
        return true
    end

    local i = items[itemEx.itemid]
    local l = getPlayerItemCount(cid, itemEx.itemid)
    
    if (i) then
        doPlayerRemoveItem(cid, itemEx.itemid, l)
        doPlayerAddMoney(cid, i.value * l)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você vendeu ".. l .." ".. getItemNameById(itemEx.itemid) .." por ".. i.value * l .." gold coins.")
        doSendMagicEffect(frompos, CONST_ME_MAGIC_RED)
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Não foi possível vender esse item, use a spellwand nela mesma para ver a lista de items disponíveis.")
        doSendMagicEffect(frompos, CONST_ME_POFF)
    end
    return true
end
 
Back
Top