Help please
[12/07/2009 14:07:03] [warning - npcscript::npcscript] cannot load script: Data/npc/scripts/blegs.lua
[12/07/2009 14:07:03] data/npc/scripts/blegs.lua:24: '=' expected near 'fix'
npc
-- based on a sweaty cyclops.lua (no credits since he didn't leave any names)
-- edited by krille09
local keywordhandler = keywordhandler:new()
local npchandler = npchandler:new(keywordhandler)
npcsystem.parseparameters(npchandler)
-- otserv event handling functions start
function oncreatureappear(cid) npchandlerncreatureappear(cid) end
function oncreaturedisappear(cid) npchandlerncreaturedisappear(cid) end
function oncreaturesay(cid, type, msg) npchandlerncreaturesay(cid, type, msg) end
function onthink() npchandlernthink() 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
-- use the real conversation? (true/false)
real = false
if real == true then
trademsg = 'i can fix all the four pieces of the broken amulet into one!'
fourpobamsg = 'do you want me to fix all the four pieces of that broken amulet?'
hasnomsg = 'you need all four piece of the broken amulet to get all, or i can't fix it!'
nomsg = 'i have no time, i\'m a busy man, leave!'
else
trademsg = 'i can fix all the four pieces of the broken amulet into one!'
fourpobamsg = 'do you want me to fix all the four pieces of that broken amulet?'
hasnomsg = 'you need all four piece of the broken amulet to get all, or i can\'t fix it!'
nomsg = 'i have no time, i\'m a busy man, leave!'
end
if msgcontains(msg, 'trade') or msgcontains(msg, 'fix') then
selfsay(trademsg)
elseif msgcontains(msg, 'change') or msgcontains(msg, 'piece') or msgcontains(msg, 'four') then
selfsay(fourpobamsg)
talk_state = 1
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 1 then
if getplayeritemcount(cid,8262) >= 1 then
if getplayeritemcount(cid,8263) >= 1 then
if getplayeritemcount(cid,8264) >= 1 then
if getplayeritemcount(cid,8265) >= 1 then
if doplayertakeitem(cid,8262,1) == 0 then
if doplayertakeitem(cid,8263,1) == 0 then
if doplayertakeitem(cid,8264,1) == 0 then
if doplayertakeitem(cid,8265,1) == 0 then
selfsay('here you are.')
doplayeradditem(cid,8266,1)
end
else
selfsay(hasnomsg)
end
talk_state = 0
------------------------------------------------ confirm no ------------------------------------------------
elseif msgcontains(msg, 'no') and (talk_state == 1) then
selfsay(nomsg)
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())