• 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 Magical Orb [TFS 1.0]

Was this helpful?

  • Yes!

    Votes: 2 40.0%
  • No.

    Votes: 3 60.0%

  • Total voters
    5

God Mythera

Veteran OT User
Joined
Aug 11, 2012
Messages
2,048
Solutions
2
Reaction score
256
Location
United States
0lOPKZW.png

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

data/actions/scripts/magicalorb.lua
Code:
local items = {
   [2393] = 21500, -- [fire sword] = PriceOfItem
   [2472] = 110000, -- [fire sword] = PriceOfItem
   [2470] = 45000, -- [fire sword] = PriceOfItem
   [2498] = 35000, -- [fire sword] = PriceOfItem
   [2392] = 5500, -- [fire sword] = PriceOfItem
   [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
   [2476] = 6500, -- [devil helmet] = PriceOfItem
   [2477] = 6500, -- [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
   [2436] = 7500, -- [wyvern fang] = PriceOfItem
   [2486] = 3000, -- [wyvern fang] = PriceOfItem
   [2187] = 5500, -- [wyvern fang] = PriceOfItem
   [7412] = 23000, -- [wyvern fang] = PriceOfItem
   [7413] = 5500, -- [wyvern fang] = PriceOfItem
   [8871] = 8500, -- [wyvern fang] = PriceOfItem
   [2475] = 7000, -- [wyvern fang] = PriceOfItem
   [18412] = 45000, -- [wyvern fang] = PriceOfItem
   [7454] = 3500, -- [wyvern fang] = PriceOfItem
   [7419] = 20000, -- [wyvern fang] = PriceOfItem
   [12646] = 50000, -- [wyvern fang] = PriceOfItem
   [11306] = 18500, -- [wyvern fang] = PriceOfItem
   [2396] = 2000, -- [wyvern fang] = PriceOfItem
   [7391] = 18500, -- [wyvern fang] = PriceOfItem
   [2528] = 9500, -- [wyvern fang] = PriceOfItem
   [7451] = 13500, -- [wyvern fang] = PriceOfItem
   [18390] = 45000, -- [wyvern fang] = PriceOfItem
   [18411] = 45000, -- [wyvern fang] = PriceOfItem
   [18409] = 45000, -- [wyvern fang] = PriceOfItem
   [7407] = 10000, -- [wyvern fang] = PriceOfItem
   [11356] = 15000, -- [wyvern fang] = PriceOfItem
   [11301] = 17500, -- [wyvern fang] = PriceOfItem
   [11303] = 7000, -- [wyvern fang] = PriceOfItem
   [11323] = 1000, -- [wyvern fang] = PriceOfItem
   [8912] = 4700, -- [wyvern fang] = PriceOfItem
   [18453] = 40000, -- [wyvern fang] = PriceOfItem
   [11305] = 12500, -- [wyvern fang] = PriceOfItem
   [2432] = 9000, -- [wyvern fang] = PriceOfItem
   [15490] = 20000, -- [wyvern fang] = PriceOfItem
   [15492] = 20000, -- [wyvern fang] = PriceOfItem
   [15453] = 15000, -- [wyvern fang] = PriceOfItem
   [11368] = 30000, -- [wyvern fang] = PriceOfItem
   [2391] = 2000, -- [wyvern fang] = PriceOfItem
   [2434] = 3500, -- [wyvern fang] = PriceOfItem
   [2497] = 7000, -- [wyvern fang] = PriceOfItem
   [15489] = 17500, -- [wyvern fang] = PriceOfItem
   [15451] = 20000, -- [wyvern fang] = PriceOfItem
   [2171] = 3000, -- [wyvern fang] = PriceOfItem
   [2179] = 11000, -- [wyvern fang] = PriceOfItem
   [8855] = 25000, -- [wyvern fang] = PriceOfItem
   [11304] = 17500, -- [wyvern fang] = PriceOfItem
   [2656] = 12000, -- [wyvern fang] = PriceOfItem
   [11302] = 50000, -- [wyvern fang] = PriceOfItem
   [2514] = 90000, -- [wyvern fang] = PriceOfItem
   [7416] = 45000, -- [wyvern fang] = PriceOfItem
   [15647] = 30000, -- [wyvern fang] = PriceOfItem
   [8902] = 25000, -- [wyvern fang] = PriceOfItem
   [15491] = 35000, -- [wyvern fang] = PriceOfItem
   [2430] = 3500, -- [wyvern fang] = PriceOfItem
   [2515] = 3000, -- [wyvern fang] = PriceOfItem
   [8910] = 5000, -- [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
 
Last edited:
Bump!

I have updated the script with more items to be sold with it, it also sells items not sold to npcs.

Will take the time for the next hour to add names, the item id's and price i correct it is just the names i must add.
 
I did some changes to your script works in TFS 1.2 :p

Code:
function onUse(player, item, fromPosition, itemEx, target, toPosition, isHotkey)
    local tmpItem = items[itemEx.itemid]
    if not tmpItem then
        player:sendCancelMessage("You can't sell this item.")
        return true
    end
   
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have sold your item!')
    player:removeItem(itemEx.itemid, 1)
    player:addMoney(tmpItem)
    player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
    return true
end
 
Good script, judging by the picture, you've tested it?
what picture? ;o and yes i have tested it.
I did some changes to your script works in TFS 1.2 :p

Code:
function onUse(player, item, fromPosition, itemEx, target, toPosition, isHotkey)
    local tmpItem = items[itemEx.itemid]
    if not tmpItem then
        player:sendCancelMessage("You can't sell this item.")
        return true
    end
  
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have sold your item!')
    player:removeItem(itemEx.itemid, 1)
    player:addMoney(tmpItem)
    player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
    return true
end
It already works with tfs 1.2 i am currently using it on tfs 1.2 =)
 
Why are you using then old functions? lawl
Because i didnt create it? xD i only added items to it ;P the other thread only sells one item but in this thread i am adding all items to it but it will take time.

edit: When i get back from fishing i will put the correct item names and will be adding more to the script.

Good script, judging by the picture, you've tested it?
I forgot i had a spoiler ;d yes it was tested and works for tfs 1.0 & 1.2, i am also sure it works with tfs 1.1 :)
 
if we try to sell an item in a monster's body, we get paid and the item stays in the corpse :D
 
Back
Top