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

Lua NPC problem

Sopelek

New Member
Joined
Jan 4, 2009
Messages
46
Reaction score
0
Hello, I've edited NPC Mission (Author is AVEO). For my own quest, when you talk him mission -> Inquisition quest he give you access to kill ungreez, when you kill him, he takes from you Ungreez Blood, and give access to the second part of inquisition quest and first demonhunter addon, but when you have done second part of inquisition and say rewards, he don't answer anything ;/ I don't know why, i think everything is ok. Can anyone look for it?
Lua:
--------------------------------
------- NPC MISION  1.0 --------
------ by Aveo - Otland.net ----
--------------------------------
 
--------------
--- Config ---
--------------
-- item required to make the quest
local i_required = 10156
-- count of item required to make the quest
local i_required_count = 1
 
-- storage dont touch --
local storage = 11549
local storagei = 11544
local storagef = 11561
local soragerew = 11562
 
-- name of the new quest --
local questname = "inquisition quest"
 
-- NPC Messages --
local npc_message ={
 
"I need Ungreez Blood to complete this mission, procced?",
"You dont have Ungreez Blood to complete this mission.", 
"Thank You for Help me, now you have access to second part of inquisition quest and to first Demonhunter addon",
"You have Already done this {mission} when you finish the second part back to me and say {rewards}.",
"The Mission {"..questname.."} is, really serius, i need your help to complete it, if you help me you can do inquisition quest?",
"You must finish all sales to get rewards.",
"Congratulations for finishing Inquisition quest, now you can go to reward room, and from me you get {second demonhunter addon}"
}
 
-------------------
--- End Confing ---	
-------------------
 
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(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
 
if(msgcontains(msg, 'mission')) then
selfSay(npc_message[5], cid)
setPlayerStorageValue(cid,storage,1)
end
 
if(msgcontains(msg, questname)) then
selfSay(npc_message[1], cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
 
if (getPlayerStorageValue(cid,storagei) > 0) then
selfSay(npc_message[4], cid)
else
 
if(doPlayerRemoveItem(cid,i_required,i_required_count)) then
setPlayerStorageValue(cid,storagei,1)
doPlayerAddOutfit(cid, 288, 1)
doPlayerAddOutfit(cid, 289, 1)
selfSay(npc_message[3], cid)
doSendMagicEffect(getCreaturePosition(cid), 10)
doCreatureSay(cid, "Quest Completed!", TALKTYPE_ORANGE_1)
else
selfSay(npc_message[2], cid)

if(msgcontains(msg, 'rewards')) then
if(getPlayerStorageValue(cid,storagef) > 0) then
selfSay(npc_message[7], cid)
doPlayerAddOutfit(cid, 288, 2)
doPlayerAddOutfit(cid, 289, 2)
setPlayerStorageValue(cid,storagerew,1)
else
selfSay(npc_message[6], cid)
end
end
end
end
return true
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

My lines are
if(msgcontains(msg, 'rewards')) then
if(getPlayerStorageValue(cid,storagef) > 0) then
selfSay(npc_message[7], cid)
doPlayerAddOutfit(cid, 288, 2)
doPlayerAddOutfit(cid, 289, 2)
setPlayerStorageValue(cid,storagerew,1)
else
selfSay(npc_message[6], cid)
 
Storagef which is 11561 must be won in the quest.
Are you sure that you win it when you go to 2nd mission?
 
Yes, but you have ELSE, say 'You must finish all sales to get rewards.' And he isn't talking anything, but I'm sure and i looked in database, and player have storage 11561 ; p
 
Oke i repaired it, if anyone need inquisition npc, take it :
Lua:
--------------------------------
------- NPC MISION  1.0 --------
------ by Aveo - Otland.net ----
--------------------------------
 
--------------
--- Config ---
--------------
-- item required to make the quest
local i_required = 10156
-- count of item required to make the quest
local i_required_count = 1
 
-- storage dont touch --
local storage = 11549
local storagei = 11544
local storagef = 11561
local storagerew = 11562
 
-- name of the new quest --
local questname = "inquisition quest"
 
-- NPC Messages --
local npc_message ={
 
"I need Ungreez Blood to complete this mission, procced?",
"You dont have Ungreez Blood to complete this mission.", 
"Thank You for Help me, now you have access to second part of inquisition quest and to first Demonhunter addon",
"You have Already done this {mission} when you finish the second part back to me and say {rewards}.",
"The Mission {"..questname.."} is, really serius, i need your help to complete it, if you help me you can do inquisition quest?",
"You must finish all sales to get rewards.",
"Congratulations for finishing Inquisition quest, now you can go to reward room, and from me you get {second demonhunter addon}",
"You already made this quest, or don't complete the second mission"
}
 
-------------------
--- End Confing ---	
-------------------
 
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(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
 
if(msgcontains(msg, 'mission')) then
selfSay(npc_message[5], cid)
setPlayerStorageValue(cid,storage,1)
end
 
if(msgcontains(msg, questname)) then
selfSay(npc_message[1], cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
 
if (getPlayerStorageValue(cid,storagei) == 1) then
selfSay(npc_message[4], cid)
else
end

if(getPlayerStorageValue(cid,storagei) < 1) then
if(doPlayerRemoveItem(cid,i_required,i_required_count)) then
setPlayerStorageValue(cid,storagei,1)
doPlayerAddOutfit(cid, 288, 1)
doPlayerAddOutfit(cid, 289, 1)
selfSay(npc_message[3], cid)
doSendMagicEffect(getCreaturePosition(cid), 10)
doCreatureSay(cid, "Quest Completed!", TALKTYPE_ORANGE_1)
else
selfSay(npc_message[2], cid)
end
end

elseif(msgcontains(msg, 'rewards')) then
if(getPlayerStorageValue(cid,storagef) == 1) then
if(getPlayerStorageValue(cid,storagerew) < 1) then
setPlayerStorageValue(cid,storagerew,1)
selfSay(npc_message[7], cid)
doPlayerAddOutfit(cid, 288, 2)
doPlayerAddOutfit(cid, 289, 2)
else
selfSay(npc_message[8], cid)
end
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Back
Top Bottom