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

Making NPC sell items for other then gold.

Dekoalaa

New Member
Joined
Feb 7, 2017
Messages
12
Reaction score
0
Is it possible to change an npc to sell an item for another item?

Lets say the npc sells ropes, and i got a torch would this be possible to make the npc sell me the rope in exchange for the torch?
 
you can do it with talkstates, and buy it just by talking with the npc by saying keywords
but if you want to do it in trade window it requires a source edit to change gold to something else
 
Not sure if you can do that over the trade window, but should be possible with dialogues.
Here is an old script snippet I did on TFS 0.4:
Lua:
if getPlayerStorageValue(cid,1234) == 1 then
    if(getPlayerItemCount(cid, 3976) >= 30) then
        doPlayerRemoveItem(cid, 3976, 30)
        doPlayerAddItem(cid, 2148,10)
        setPlayerStorageValue(cid,1234,2)
        selfSay('Thanks, you are truly one trustworthy player! I will make sure to tell about your good deeds to other merchants! If you want, keep delivering worms to me, and I have a {special bonus} for you!', cid)  
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have gained 10 golden coins.')
    else  
        selfSay('Huh? This was not the deal, please come back with 30 worms!')
    end  
else
    if(getPlayerItemCount(cid, 3976) >= 30) then
        doPlayerRemoveItem(cid, 3976, 30)
        doPlayerAddItem(cid, 2148,10)
        setPlayerStorageValue(cid,1234,(getPlayerStorageValue(cid,1234)+1))
        selfSay('Thank you! As always, here are your 10 gold coins!', cid)  
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have gained 10 golden coins.')
    else  
        selfSay('You can get worms from NPCs in twinpass trading camp. Feel free to come back anytime and deliver {30 worms} to me, and you will be paid 10 gold coins! Hey! If you deliver 30 worms to me 5 times, I have a {special bonus} for you!', cid)
    end  
end
 
Back
Top