local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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
function creatureSayCallback(cid, type, msg)
if msgcontains(msg, 'hello') then
if getCreatureStorage(cid, 17001) == 1 then
selfSay('Hmm... ??.')
doCreatureSetStorage(cid, 17001, 2)
else
selfSay('o.o' .. getCreatureStorage(cid, 17001))
talk_state = 0
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
-- made by elf
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == 10281 then
if(isInArray({getPlayerStorageValue(cid,10274), getPlayerStorageValue(cid,10275), getPlayerStorageValue(cid,10276), getPlayerStorageValue(cid,10277), getPlayerStorageValue(cid,10278), getPlayerStorageValue(cid,10279), getPlayerStorageValue(cid,10280)}, -1) == TRUE) then
doPlayerSendTextMessage(cid, 22, "The door seems to be sealed against unwanted intruders.")
else
doPlayerSendTextMessage(cid, 22, ".")
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
end
return TRUE
end
return FALSE
end
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Max" script="data/npc/scripts/key.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="133" head="20" body="39" legs="45" feet="7" addons="0"/>
<parameters>
<parameter key="message_greet" value="Welcome |PLAYERNAME| !, To enter you'll have to give me food for the {key}. I also have some tools if you need!" />
<parameter key="module_shop" value="1"/>
<parameter key="shop_buyable" value="fishing rod,2580,150;Mechanical Fishing Rod,10223,500;worm,3976,1"/>
</parameters>
</npc>
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Max" script="data/npc/scripts/key.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="133" head="20" body="39" legs="45" feet="7" addons="0"/>
<parameters>
<parameter key="module_shop" value="1"/>
<parameter key="message_greet" value="Hello |PLAYERNAME|. To enter you'll have to give me food for the {key } I also have some tools if you need!"/>
<parameter key="shop_buyable" value="fishing rod,2580,150;Mechanical Fishing Rod,10223,500;worm,3976,1"/>
</parameters>
</npc>