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

Soft boots

Ok Here Is A Soft Boots Refiller NPC
data\npc
Code:
<npc name="Roy" script="data/npc/scripts/soft boots.lua" autowalk="25" floorchange="0" access="5" level="1" maglevel="1">
	<health now="150" max="150"/>
        <look type="151" head="114" body="1" legs="1" feet="76" addons="1" corpse="2212"/>
	<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I can repair your worn soft boots." />
		
	</parameters>
</npc>
data\npc\scripts
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, 'job') then
            selfSay('I\'m a soft boots repairer.')
        elseif msgcontains(msg, 'repair') or msgcontains(msg, 'worn soft boots') then
            selfSay('Do you want me to repair your soft boots for 100 platinum coins?')
            talk_state = 1
        

	elseif msgcontains(msg, 'yes') and talk_state == 1 then
            if getPlayerItemCount(cid,6530) >= 1 and getPlayerItemCount(cid,2152) >= 100 then
                if doPlayerTakeItem(cid,6530,1) and doPlayerTakeItem(cid,2152,100) == 0 then
                selfSay('Here you are.')
                    doPlayerAddItem(cid,2640,1)

                end
            else
                selfSay('Sorry, you don\'t have the item.')
            end
          

        elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
            selfSay('Then keep them dirty.')
            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())

REMEBER TO REP IF I HELPED
 
Back
Top