• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

NPC Mission NPC 1.0 (With Configuration)

What is this??

12:55] [Error - LuaScriptInterface::loadFile] data/npc/scripts/questmaker.lua:72: '<eof>' expected near 'end'
[01/02/2012 10:12:55] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/questmaker.lua
[01/02/2012 10:12:55] data/npc/scripts/questmaker.lua:72: '<eof>' expected near 'end'

how i fix this?
:D
 
Is the original script from the post.
Srry bad english.
i done every think he said..
 
--------------------------------
------- NPC MISION 2.0 --------
------ by Acubens - Otland.net -
--------------------------------


local first = {
-- Place true if you want to use the system of a gift for experience, false if you want to use items
useExpReward = false,
-- The experience that will get the player at the end of the mission
experience = 500000,
-- Id of the item that will be asking for the NPC to complete the mission
item = 5877,
-- Count of the item required
item_count = 50,
-- id of the gift that going to obtain the player at finish the mission
reward = 2160,
-- count of the gift item
reward_count = 1,
-- storage
storage = 60307,
-- name of the quest
questname = "dragon leather Quest"
}

local npc_message ={

-- Procced - message
"I need some item to complete this mission, procced?",
-- if you dont have items - message
"You dont have any items to this mission.",
-- thanks - message
"Thank You for Help me, {take it}.",
-- already done - message
"You have already done this mision.",
-- ready to go - message
"The Mission {"..first.questname.."} is, really serius, i need your help to complete it, if you help me then i will give some items to you..",
-- congratulations - message
"Congratulations, you have finished the "..first.questname..""

}


if(msgcontains(msg, 'mission')) then
selfSay(npc_message[5], cid)
end

if(msgcontains(msg, first.questname)) then
selfSay(npc_message[1], cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if (getPlayerStorageValue(cid,first.storage) > 0) then
selfSay(npc_message[4], cid)
else
if(doPlayerRemoveItem(cid,first.item,first.item_count)) then
setPlayerStorageValue(cid,first.storage,1)
if(useExpReward) then
doPlayerAddExperience(cid,first.experience)
else
doPlayerAddItem(cid,first.reward,first.reward_count)
end
selfSay(npc_message[3], cid)
doSendMagicEffect(getCreaturePosition(cid), 10)
doCreatureSay(cid, npc_message[6], TALKTYPE_ORANGE_1)
else
selfSay(npc_message[2], cid)
end
end
return true
end

end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
PHP:
--------------------------------
------- NPC MISION 2.0 --------
------ by Acubens - Otland.net -
--------------------------------


local first = {
-- Place true if you want to use the system of a gift for experience, false if you want to use items
useExpReward = false,
-- The experience that will get the player at the end of the mission
experience = 500000,
-- Id of the item that will be asking for the NPC to complete the mission
item = 5877, 
-- Count of the item required
item_count = 50, 
-- id of the gift that going to obtain the player at finish the mission 
reward = 2160,
-- count of the gift item
reward_count = 1, 
-- storage
storage = 60307, 
-- name of the quest
questname = "dragon leather Quest"
}

local npc_message ={

-- Procced - message
"I need some item to complete this mission, procced?",
-- if you dont have items - message
"You dont have any items to this mission.", 
-- thanks - message
"Thank You for Help me, {take it}.",
-- already done - message
"You have already done this mision.",
-- ready to go - message
"The Mission {"..first.questname.."} is, really serius, i need your help to complete it, if you help me then i will give some items to you..",
-- congratulations - message
"Congratulations, you have finished the "..first.questname..""

}


if(msgcontains(msg, 'mission')) then
selfSay(npc_message[5], cid)
end

if(msgcontains(msg, first.questname)) then
selfSay(npc_message[1], cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if (getPlayerStorageValue(cid,first.storage) > 0) then
selfSay(npc_message[4], cid)
else
if(doPlayerRemoveItem(cid,first.item,first.item_co unt)) then
setPlayerStorageValue(cid,first.storage,1)
if(useExpReward) then
doPlayerAddExperience(cid,first.experience)
else
doPlayerAddItem(cid,first.reward,first.reward_coun t)
end
selfSay(npc_message[3], cid)
doSendMagicEffect(getCreaturePosition(cid), 10)
doCreatureSay(cid, npc_message[6], TALKTYPE_ORANGE_1)
else
selfSay(npc_message[2], cid)
end
end
return true

end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Should work now ^^
If not, post the error message and I'll fix it
 
I really like the script, thank you a lot.
Is it also possible for the NPC to accept more then one ID, to complete the mission? So you need id 2334 OR id 3423
 
Test this remember edit
Lua:
item_count {1,1} -- the first 1 is the count of the first item and the second 1 if the count of the second item
Lua:
 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
 
 
 
--------------------------------
------- NPC MISION  2.0 --------
------ by Acubens - Otland.net -
--------------------------------
 
 
local first = {
-- Place true if you want to use the system of a gift for experience, false if you want to use items
useExpReward = false,
-- The experience that will get the player at the end of the mission
experience = 5000,
-- Id of the item that will be asking for the NPC to complete the mission
item = {2334,3423}, 
-- Count of the item required
item_count = {1,1},  
-- id of the gift that going to obtain the player at finish the mission 
reward = 2160,
-- count of the gift item
reward_count = 1, 
-- storage
storage = 60307, 
-- name of the quest
questname = "Acubens Quest"
}
 
local npc_message ={
 
-- Procced - message
"I need some item to complete this mission, procced?",
-- if you dont have items - message
"You dont have any items to this mission.", 
-- thanks - message
"Thank You for Help me, {take it}.",
-- already done - message
"You have already done this mision.",
-- ready to go - message
"The Mission {"..first.questname.."} is, really serius, i need your help to complete it, if you help me then i will  give some items to you..",
-- congratulations - message
"Congratulations, you have finished the "..first.questname..""
 
}
 
 
if(msgcontains(msg, 'mission')) then
selfSay(npc_message[5], cid)
end
 
if(msgcontains(msg, first.questname)) then
	selfSay(npc_message[1], cid)
	talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
	if (getPlayerStorageValue(cid,first.storage) > 0) then
		selfSay(npc_message[4], cid)
	else
		if(doPlayerRemoveItem(cid,first.item,first[1].item_count[1]) and doPlayerRemoveItem(cid,first.item[2],first.item_count[2])) then
			setPlayerStorageValue(cid,first.storage,1)
			if(useExpReward) then
				doPlayerAddExperience(cid,first.experience)
			else
				doPlayerAddItem(cid,first.reward,first.reward_count)
			end
			selfSay(npc_message[3], cid)
			doSendMagicEffect(getCreaturePosition(cid), 10)
			doCreatureSay(cid, npc_message[6], TALKTYPE_ORANGE_1)
		else
			selfSay(npc_message[2], cid)
		end
	end
return true
end
 
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Fucking awesome NPC! Love the idea <3

There was acrually a guy requesting something like this, he said It was a quest from WoW, where you had to bring a head of a creature or something :)

- Royal Inferno
 
Fucking awesome NPC! Love the idea <3

There was acrually a guy requesting something like this, he said It was a quest from WoW, where you had to bring a head of a creature or something :)

- Royal Inferno
 
[26/07/2012 01:04:17] [C]: in function '__index'
[26/07/2012 01:04:17] data/npc/scripts/nightsabre.lua:71: in function 'callback'
[26/07/2012 01:04:17] data/npc/lib/npcsystem/npchandler.lua:390: in function 'onCreatureSay'
[26/07/2012 01:04:17] data/npc/scripts/nightsabre.lua:7: in function <data/npc/scripts/nightsabre.lua:7>


Why? :/
 
This would be awesome if you added more missions to the file... Maybe add a simple storage and use it as a count to check the quest that he is involved too and you could add to kill some monsters and also bring a few items.

I think it doesn't need to be so hard to code.
 
Using "true" for exp as reward but it's not giving EXP, only the items. Then I keep "true" there for exp and make it

Code:
-- id of the gift that going to obtain the player at finish the mission
reward = 0,
-- count of the gift item
reward_count = 0,

Still doesnt give exp
 
Back
Top