local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local Topic, Amount, Price, Type = {}, {}, {}, {}
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, "charach") and (not npcHandler:isFocused(cid)) then
npcHandler:say("Ikem Charach maruk.", cid, TRUE)
npcHandler:addFocus(cid)
Topic[cid] = 0
elseif (not npcHandler:isFocused(cid)) then
npcHandler:say("Buta humak!", cid, TRUE)
elseif msgcontains(msg, "futchi") then
npcHandler:say("Futchi.", cid, TRUE)
npcHandler:releaseFocus(cid)
Topic[cid] = 0
elseif msgcontains(msg, "ikem") and msgcontains(msg, "goshak") then
npcHandler:say("Ikem pashak porak, bata, dora. Ba goshak maruk?", cid)
Topic[cid], Amount[cid], Price[cid], Type[cid] = 0, 0, 0, 0
elseif msgcontains(msg, "goshak") and msgcontains(msg, "porak") then
npcHandler:say("Ikem pashak charcha, burka, burka bata, hakhak. Ba goshak maruk?", cid)
Topic[cid], Amount[cid], Price[cid], Type[cid] = 0, 0, 0, 0
elseif msgcontains(msg, "goshak") and msgcontains(msg, "charcha") then
npcHandler:say("Maruk goshak ta?", cid)
Topic[cid] = 1
Amount[cid] = 1
Price[cid] = 25
Type[cid] = 2385
elseif msgcontains(msg, "goshak") and msgcontains(msg, "burka") and msgcontains(msg, "bata") then
npcHandler:say("Maruk goshak ta?", cid)
Topic[cid] = 1
Amount[cid] = 1
Price[cid] = 85
Type[cid] = 2376
elseif msgcontains(msg, "goshak") and msgcontains(msg, "burka") then
npcHandler:say("Maruk goshak ta?", cid)
Topic[cid] = 1
Amount[cid] = 1
Price[cid] = 30
Type[cid] = 2406
elseif msgcontains(msg, "goshak") and msgcontains(msg, "hakhak") then
npcHandler:say("Maruk goshak ta?", cid)
Topic[cid] = 1
Amount[cid] = 1
Price[cid] = 85
Type[cid] = 2388
elseif msgcontains(msg, "goshak") and msgcontains(msg, "bata") then
npcHandler:say("Ikem pashak aka bora, tulak bora, grofa. Ba goshak maruk?", cid)
Topic[cid], Amount[cid], Price[cid], Type[cid] = 0, 0, 0, 0
elseif msgcontains(msg, "goshak") and msgcontains(msg, "tulak") and msgcontains(msg, "bora") then
npcHandler:say("Maruk goshak ta?", cid)
Topic[cid] = 1
Amount[cid] = 1
Price[cid] = 90
Type[cid] = 2484
elseif msgcontains(msg, "goshak") and msgcontains(msg, "bora") then
npcHandler:say("Maruk goshak ta?", cid)
Topic[cid] = 1
Amount[cid] = 1
Price[cid] = 25
Type[cid] = 2467
elseif msgcontains(msg, "goshak") and msgcontains(msg, "grofa") then
npcHandler:say("Maruk goshak ta?", cid)
Topic[cid] = 1
Amount[cid] = 1
Price[cid] = 60
Type[cid] = 2482
elseif msgcontains(msg, "goshak") and msgcontains(msg, "dora") then
npcHandler:say("Ikem pashak donga. Ba goshak maruk?", cid)
Topic[cid], Amount[cid], Price[cid], Type[cid] = 0, 0, 0, 0
elseif msgcontains(msg, "goshak") and msgcontains(msg, "donga") then
npcHandler:say("Maruk goshak ta?", cid)
Topic[cid] = 1
Amount[cid] = 1
Price[cid] = 65
Type[cid] = 2511
elseif msgcontains(msg, "goshak") and msgcontains(msg, "batuk") then
npcHandler:say("Ahhhh, maruk goshak batuk?", cid)
Topic[cid] = 1
Amount[cid] = 1
Price[cid] = 400
Type[cid] = 2456
elseif msgcontains(msg, "goshak") and msgcontains(msg, "pixo") then
npcHandler:say("Maruk goshak tefar pixo ul batuk?", cid)
Topic[cid] = 1
Amount[cid] = 10
Price[cid] = 30
Type[cid] = 2544
elseif Topic[cid] == 1 then
if msgcontains(msg, "mok") then
if doPlayerRemoveMoney(cid, Price[cid]) then
npcHandler:say("Maruk rambo zambo!", cid)
doPlayerAddItem(cid, Type[cid], Amount[cid])
else
npcHandler:say("Maruk nixda!", cid)
end
else
npcHandler:say("Buta maruk klamuk!", cid)
end
Topic[cid], Amount[cid], Price[cid], Type[cid] = 0, 0, 0, 0
elseif msgcontains(msg, "trade") then
npcHandler:say("Uh?", cid)
Topic[cid], Amount[cid], Price[cid], Type[cid] = 0, 0, 0, 0
end
return true
end
npcHandler:setMessage(MESSAGE_WALKAWAY, "Futchi.")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)