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

Need NPC Fast

kamiloO

New Member
Joined
May 23, 2008
Messages
19
Reaction score
0
I need a npc who takes from me 1000 cc and softs boots . Then give me pair of firewalker boots , Pleas Fast , i wanna update my serwer and only 1 npc behind me to do it .
 
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)     npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                         npcHandler:onThink() end
-- OTServ event handling functions end

function creatureSayCallback(cid, type, msg)
    -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
    if(npcHandler.focus ~= cid) then
        return false
    end

        if msgcontains(msg, 'specialised') or msgcontains(msg, 'recover') then
            selfSay('Yes, my fathers was a great blacksmith. When i was just a child he taught me how to mend boots. Did you bring me some boots? Which ones?')
        elseif msgcontains(msg, 'fire walker boots') then
            selfSay('give me sb and 100cc')
            talk_state = 1
			
        elseif msgcontains(msg, 'yes') and talk_state == 1 then
            if getPlayerItemCount(cid,6132) >= 1 and getPlayerItemCount(cid,2160) >= 100 then
                if doPlayerTakeItem(cid,6530,1) == 0 and doPlayerTakeItem(cid,2160,50) == 0 then
					selfSay('Wear them well my friend.')
                    doPlayerAddItem(cid,[COLOR="Red"]PUTIDOFBOOTSHERE[/COLOR],1)
                end
            else
                selfSay('Well that is to bad.')
            end
			

	    elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 2) then
            selfSay('I may starve because of you!')
            talk_state = 0
        end
		
    -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

try that. next time ask in support and requests. untested
 
Last edited:
Back
Top