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

NPC NPC Mission (experience for mission)

TFS is hardly bugged.
TFS 0.3.6pl1 this case, check quest log with this script and you'll see ;)
Questlog appears empty, at the description "start mission", and when it's over "appears description".
 
TFS is hardly bugged.
TFS 0.3.6pl1 this case, check quest log with this script and you'll see ;)
Questlog appears empty, at the description "start mission", and when it's over "appears description".

Indeed. I noticed that a while ago. Is there a way to fix that? xD Cause I'm using 0.4 and I still have that issue.
 
Arranges it, it worked here speaking their name, type First Quest, Second Quest, but did not follow from first to second. Can you help?
 
Please help me!
I want to do this: The player can only do the SECOND mission, after complete the FIRST mission before.
It liking setting storages value on the script. I dont know how and where can i put the storages. So, please someone helps me!!


Oh.. And I want one more thing: I want to add more then one item to the player give back to the NPC for complete the mission. For example: selfSay('Please bring me 50 necromantic robes and 15 dark rosaries', cid)
And i put if(doPlayerRemoveItem(cid, 12550, 50) (cid, 12555, 15) == TRUE) then -- Removing the two items, but doesnt work, need to do some different thing.
HELP ME! ^^
I Give rep+ :D
 
Last edited:
Please help me!
I want to do this: The player can only do the SECOND mission, after complete the FIRST mission before.
It liking setting storages value on the script. I dont know how and where can i put the storages. So, please someone helps me!!


Oh.. And I want one more thing: I want to add more then one item to the player give back to the NPC for complete the mission. For example: selfSay('Please bring me 50 necromantic robes and 15 dark rosaries', cid)
And i put if(doPlayerRemoveItem(cid, 12550, 50) (cid, 12555, 15) == TRUE) then -- Removing the two items, but doesnt work, need to do some different thing.
HELP ME! ^^
I Give rep+ :D

Well, I don't have time for the first issue, but...
@Issue2, you can't remove two different items with one doPlayerRemoveItem.

Code:
if(doPlayerRemoveItem(cid, 12550, 50) == TRUE and doPlayerRemoveItem(cid, 12555, 15) == TRUE) then
 
[08/12/2010 23:24:58] Lua Script Error: [Npc interface]
[08/12/2010 23:24:58] data/npc/scripts/mission.lua:eek:nCreatureSay

[08/12/2010 23:24:58] data/npc/scripts/mission.lua:13: attempt to call method 'isFocused' (a nil value)
[08/12/2010 23:24:58] stack traceback:
[08/12/2010 23:24:58] data/npc/scripts/mission.lua:13: in function 'callback'
[08/12/2010 23:24:58] ./data/npc/lib/npcsystem/npchandler.lua:299: in function 'onCreatureSay'
[08/12/2010 23:24:58] data/npc/scripts/mission.lua:9: in function <data/npc/scripts/mission.lua:9>
I dont speak english. Help me, please. TFS 0.3. for Tibia 7.6.
 
Your TFS don't have this function because this script is for TFS 0.3.4+ :)
I tested in 0.3.4-0.4! :)

please comment :) if you like this plx rep me :)
 
Is it possible to upgrade from Versions Users TFS 3.0. to version 3.4 +
Or do something that the script run.
Poland - Polish >> English - England
^translate google^
 
NEW VERSION!!

if the script is useful to you, or you think it a good reputation, please for me :D
Click only this:



New version in first post ;)
Bye
 
Kawon, script is working etc. But it looks strange in game..
1. Lower levels earn less experience for doing quests cause it's about lvl% not exp. Better change % to exp .

2. Magic effects. When i complete the mission nothing happens and npc just says "thank You" of course it can be easy changed to "Thank you, i've added 5% to your level" but it's still not the same :D..

I'll rep you if you do this for me xD.
 
DVEagle you must added only this:
Code:
doSendMagicEffect(getPlayerPosition(cid), 27)
                  doSendAnimatedText(getPlayerPosition(cid), "Complete!", TEXTCOLOR_RED)

And change:
Code:
doPlayerAddPercentLevel(cid, x)
to:
Code:
doPlayerAddExperience(cid, x)

Example:
PHP:
     elseif(msgcontains(msg, 'tarantula egg') and talkState[talkUser] == 1 and (getPlayerStorageValue(cid,700) < 1)) then
        if(doPlayerRemoveItem(cid, 11198, 100) == TRUE) then
            setPlayerStorageValue(cid,700,1)
                  doPlayerAddExperience(cid, 5000)
                  doSendMagicEffect(getPlayerPosition(cid), 27)
                  doSendAnimatedText(getPlayerPosition(cid), "Complete!", TEXTCOLOR_RED)
            selfSay('Thank you.', cid)
            talkState[talkUser] = 0
        else
            selfSay('To end mission you need have 100 {tarantula egg}.', cid)
        end


I don't tested but should work :)
 
Here is better version:
PHP:
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 
local config = {
				{item = 11198, count = 100, storage = 700, value = 1, percent_lv = 5}, --tarantula egg
				{item = 11226, count = 150, storage = 701, value = 1, percent_lv = 7}, --strands of medusa hair
				{item = 5882, count = 300, storage = 702, value = 1, percent_lv = 6}, --red dragon scales
				{item = 5920, count = 400, storage = 703, value = 1, percent_lv = 5} --green dragon scales
				}
if(msgcontains(msg, 'quest')) then 
	selfSay('To start this quest tell {mission}', cid) --This is just an example, In this script added 4 mission for you ;) 
end
    if(msgcontains(msg, 'mission')) then 
		for i = 1, #config do
			if getPlayerStorageValue(cid, config[i].storage) == -1 then 
				selfSay('Your mission will be to get '..config[i].count..' {'..getItemNameById(config[i].item)..'}.', cid) 
				talkState[talkUser] = i
			elseif (getPlayerStorageValue(cid,703) == 1) then --zmieniac w zaleznosci od ostatniego storage!! 
				selfSay('You have done all missions.', cid)
				return true
			end 
        --------------------------------------- 
			if msgcontains(msg, getItemNameById(config[i].item)) and talkState[talkUser] == i then 
				if doPlayerRemoveItem(cid, config[i].item, config[i].count) then 
					doPlayerSetStorageValue(cid, config[i].storage, config[i].value) 
					doPlayerAddPercentLevel(cid, config[i].percent_lv)  
					selfSay('Thank you.', cid) 
					return true
				else 
					selfSay('To end mission you need have '..config[i].count..' {'..getItemNameById(config[i].item)..'}.', cid) 
				end
			end
		end
    end 
end     
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) 
npcHandler:addModule(FocusModule:new())
I do not test it.
 
Back
Top