Karolek8999
New User
- Joined
- May 31, 2008
- Messages
- 9
- Reaction score
- 0
otoz mam pewien problem na otsie mam rl system np mowisz hi>trade i pokazuje ci sie okienko dzialaja sami prawie ci npc ktorzy maja to okienko trade
a np NPC Joseph od soft bootsow mi nie dziala (blad nie pokazuje sie w silniku nie wiem na 100% czego to wina)
LUA
XML
a np NPC Joseph od soft bootsow mi nie dziala (blad nie pokazuje sie w silniku nie wiem na 100% czego to wina)
LUA
PHP:
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
POMOCY:o
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, 'boots') then
selfSay('I can refill your worn soft boots for 100 platinum coins.')
elseif msgcontains(msg, 'soft boots') or msgcontains(msg, 'worn soft boots') or msgcontains(msg, 'soft boot') or msgcontains(msg, 'worn soft boot') then
selfSay('Would you like to refill your worn 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 are your refilled soft boots.')
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('Ok than.')
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())
PHP:
<npc name="Joseph" script="data/npc/scripts/softboots.lua" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="134" head="114" body="102" legs="95" feet="72" addons="1" corpse="2212"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. My job is to refill soft boots." />
</parameters>
</npc>