• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Addon NPC

Phoenix Decion

New Member
Joined
Jul 28, 2008
Messages
30
Reaction score
0
Can anyone make only one addon npc??
Exemple: only wizard addoner
With the Rl tibia addon?

I try, and I make this:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)


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

npcHandler:setMessage(MESSAGE_GREET, "What do you want, |PLAYERNAME|?")

function playerBuyAddonNPC(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if (parameters.confirm ~= true) and (parameters.decline ~= true) then
if(getPlayerPremiumDays(cid) == 0) and (parameters.premium == true) then
npcHandler:say('Sorry, but this addon is only for premium players!', cid)
npcHandler:resetNpc()
return true
end
if (getPlayerStorageValue(cid, parameters.storageID) ~= -1) then
npcHandler:say('You already have this addon!', cid)
npcHandler:resetNpc()
return true
end
local itemsTable = parameters.items
local items_list = ''
if table.maxn(itemsTable) > 0 then
for i = 1, table.maxn(itemsTable) do
local item = itemsTable
items_list = items_list .. item[2] .. ' ' .. getItemNameById(item[1])
if i ~= table.maxn(itemsTable) then
items_list = items_list .. ', '
end
end
end
local text = ''
if (parameters.cost > 0) and table.maxn(parameters.items) then
text = items_list .. ' and ' .. parameters.cost .. ' gp'
elseif (parameters.cost > 0) then
text = parameters.cost .. ' gp'
elseif table.maxn(parameters.items) then
text = items_list
end
npcHandler:say('Did you bring me ' .. text .. ' for ' .. keywords[1] .. '?', cid)
return true
elseif (parameters.confirm == true) then
local addonNode = node:getParent()
local addoninfo = addonNode:getParameters()
local items_number = 0
if table.maxn(addoninfo.items) > 0 then
for i = 1, table.maxn(addoninfo.items) do
local item = addoninfo.items
if (getPlayerItemCount(cid,item[1]) >= item[2]) then
items_number = items_number + 1
end
end
end
if(getPlayerMoney(cid) >= addoninfo.cost) and (items_number == table.maxn(addoninfo.items)) then
doPlayerRemoveMoney(cid, addoninfo.cost)
if table.maxn(addoninfo.items) > 0 then
for i = 1, table.maxn(addoninfo.items) do
local item = addoninfo.items
doPlayerRemoveItem(cid,item[1],item[2])
end
end
doPlayerAddOutfit(cid, addoninfo.outfit_male, addoninfo.addon)
doPlayerAddOutfit(cid, addoninfo.outfit_female, addoninfo.addon)
setPlayerStorageValue(cid,addoninfo.storageID,1)
npcHandler:say('Here you are.', cid)
else
npcHandler:say('Good. I accept your sacrifice. You have proven that you are a true follower of Zathroth and do not hesitate to sacrificeworldly goods. Thus, I will reward you with this headgear. !', cid)
end
npcHandler:resetNpc()
return true
elseif (parameters.decline == true) then
npcHandler:say('Not interested? Maybe other addon?', cid)
npcHandler:resetNpc()
return true
end
return false
end

local noNode = KeywordNode:new({'no'}, playerBuyAddonNPC, {decline = true})
local yesNode = KeywordNode:new({'yes'}, playerBuyAddonNPC, {confirm = true})


local outfit_node = keywordHandler:addKeyword({'skull mask'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2536,1}, {2492,1}, {2488,1}, {2123,1}}, outfit_female = 149, outfit_male = 145, addon = 2, storageID = 10023})
outfit_node:addChildKeywordNode(yesNode)
outfit_node:addChildKeywordNode(noNode)
local outfit_node = keywordHandler:addKeyword({'second wizard addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{5922,50}}, outfit_female = 149, outfit_male = 145, addon = 1, storageID = 10022})
outfit_node:addChildKeywordNode(yesNode)
outfit_node:addChildKeywordNode(noNode)

keywordHandler:addKeyword({'outfit'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'This skull shows that you are a true follower of Zathroth and the glorious gods of darkness. Are you willing to prove your loyalty?.'})
keywordHandler:addKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'It will be a hard task which requires many sacrifices. Do you still want to proceed?.'})
keywordHandler:addKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good decision, |PLAYERNAME|. Your first sacrifice will be a medusa shield. Bring it to me and do give it happily.'})
npcHandler:addModule(FocusModule:new())


I want he do this:
You: hi
Lugri: What do you want, player?
You: outfit
Lugri: This skull shows that you are a true follower of Zathroth and the glorious gods of darkness. Are you willing to prove your loyalty?
You: yes
Lugri: It will be a hard task which requires many sacrifices. Do you still want to proceed?
You: yes
Lugri: Good decision, <name>. Your first sacrifice will be a medusa shield. Bring it to me and do give it happily.

Now you will have to give him the items. Continue talking with him:

You: hi
Lugri: What do you want, player?
You: medusa shield
Lugri: Is it your true wish to sacrifice a medusa shield to Zathroth?
You: yes
Lugri: Good. I accept your sacrifice. The second sacrifice I require from you is a dragon scale mail. Bring it to me and do give it happily.

You: hi
Lugri: What do you want, player?
You: dragon scale mail
Lugri: Is it your true wish to sacrifice a dragon scale mail to Zathroth?
You: yes
Lugri: Good. I accept your sacrifice. The third sacrifice I require from you are crown legs. Bring them to me and do give them happily.

You: hi
Lugri: What do you want, player?
You: crown legs
Lugri: Is it your true wish to sacrifice crown legs to Zathroth?
You: yes
Lugri: Good. I accept your sacrifice. The last sacrifice I require from you is a ring of the sky. Bring it to me and do give it happily.

You:hi
Lugri: What do you want, player?
You: ring of the sky
Lugri: Is it your true wish to sacrifice a ring of the sky to Zathroth?
You: yes
Lugri: Good. I accept your sacrifice. You have proven that you are a true follower of Zathroth and do not hesitate to sacrificeworldly goods. Thus, I will reward you with this headgear.

But when i say yes twice he says this:
23:33 GM Phoenix [500]: outfit
23:33 Lugri: This skull shows that you are a true follower of Zathroth and the glorious gods of darkness. Are you willing to prove yourloyalty?.
23:33 GM Phoenix [500]: yes
23:33 Lugri: It will be a hard task which requires many sacrifices. Do you still want to proceed?.
23:33 GM Phoenix [500]: yes
23:33 Lugri: It will be a hard task which requires many sacrifices. Do you still want to proceed?.


I will rep ++ ^^
 
Last edited:
Assassin (Outfit)
Code:
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 storage = 30031
  local getstorage = getPlayerStorageValue(cid, storage)
  local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid


  if msgcontains(msg, 'sober') and getstorage < 0 then
    npcHandler:say("I wish there was like a potion which makes you sober in an instant. Dwarven rings wear off so fast. <hicks>", cid)
    talkState[talkUser] = 0

  elseif msgcontains(msg, 'potion') and getstorage < 0 then
    npcHandler:say("It's so hard to know the exact time when to stop drinking. <hicks> C-could you help me to brew such a potion?", cid)
    talkState[talkUser] = 1

  elseif msgcontains(msg, '30 beholder eyes') and getstorage == 2 then
    npcHandler:say("Have you really managed to bring me 30 beholder eyes? <hicks>", cid)
    talkState[talkUser] = 1

  elseif msgcontains(msg, '10 red dragon scales') and getstorage == 3 then
    npcHandler:say("D-did you get all of the 10 red dragon scales? <hicks>", cid)
    talkState[talkUser] = 1

  elseif msgcontains(msg, '30 lizard scales') and getstorage == 4 then
    npcHandler:say("Ah, are those - <hicks> - the 30 lizard scales?", cid)
    talkState[talkUser] = 1

  elseif msgcontains(msg, '20 fish fin') and getstorage == 5 then
    npcHandler:say("Eww, is that disgusting smell coming from the 20 fish fins? <burps>", cid)
    talkState[talkUser] = 1

  elseif msgcontains(msg, '20 vampire dust') and getstorage == 6 then
    npcHandler:say("Have you collected 20 ounces of vampire d-dust? <hicks>", cid)
    talkState[talkUser] = 1

  elseif msgcontains(msg, '10 demon dust') and getstorage == 7 then
    npcHandler:say("Have you slain enough d-demons to gather 10 ounces of demon dust? <hicks>", cid)
    talkState[talkUser] = 1

  elseif msgcontains(msg, 'warriors sweat') and getstorage == 8 then
    npcHandler:say("This s-smells even worse than the fish fins. Is that warrior's sweat?", cid)
    talkState[talkUser] = 1

  elseif msgcontains(msg, 'secret') and getstorage == 9 then
    npcHandler:say("Right. <hicks> Since you helped me to b-brew that potion and thus ensured the high quality of my work <hicks>, I'll give you my old assassin costume. It lacks the head part, but it's almost like new. Don't pretend to be me though, 'kay?", cid)
    setPlayerStorageValue(cid, 30041, 1)
    talkState[talkUser] = 1

  elseif msgcontains(msg, 'yes') then
    if talkState[talkUser] == 1 then
      if getstorage < 0 then
        npcHandler:say("You are a true buddy. I promise I will t-try to avoid killing you even if someone asks me to.", cid)
        npcHandler:say("Listen, I have this old formula from my grandma. <hicks> It says... 30 beholder eyes... 10 red dragon scales. ...", cid)
        npcHandler:say("Then 30 lizard scales... 20 fish fins - ew, this sounds disgusting, I wonder if this is really a potion or rather a cleaning agent. ...", cid)
        npcHandler:say("Add 20 ounces of vampire dust, 10 ounces of demon dust and mix well with one flask of warrior's sweat. <hicks> ...", cid)
        npcHandler:say("Okayyy, this is a lot... we'll take this step by step. <hicks> Will you help me gathering 30 beholder eyes?", cid)
        setPlayerStorageValue(cid, 30031, 1)
        talkState[talkUser] = 1
      end

      if getstorage == 1 then
        npcHandler:say("G-good. Go get them, I'll have a beer in the meantime.", cid)
        setPlayerStorageValue(cid, 30031, 2)
        talkState[talkUser] = 0
      end

      if getstorage == 2 then
        if doPlayerRemoveItem(cid, 5898, 30) == TRUE then
          npcHandler:say("Aw-awsome! <hicks> Squishy! Now, please bring me 10 red dragon scales.", cid)
          setPlayerStorageValue(cid, 30031, 3)
          talkState[talkUser] = 0
        else
          npcHandler:say("T-this is n-not enough.", cid)
        end
      end

      if getstorage == 3 then
        if doPlayerRemoveItem(cid, 5882, 10) == TRUE then
          npcHandler:say("G-good work, ... wha-what's your name again? <hicks> Anyway... come back with 30 lizard scales.", cid)
          setPlayerStorageValue(cid, 30031, 4)
          talkState[talkUser] = 0
        else
          npcHandler:say("T-this is n-not enough.", cid)
        end
      end

      if getstorage == 4 then
        if doPlayerRemoveItem(cid, 5881, 30) == TRUE then
          npcHandler:say("This potion will become p-pretty scaly. I'm not sure yet if I want to d-drink that. I think the 20 fish fins which come next won't really improve it. <hicks>", cid)
          setPlayerStorageValue(cid, 30031, 5)
          talkState[talkUser] = 0
        else
          npcHandler:say("T-this is n-not enough.", cid)
        end
      end

      if getstorage == 5 then
        if doPlayerRemoveItem(cid, 5895, 20) == TRUE then
          npcHandler:say("Alrrrrrrright! Thanks for the f-fish. Get me the 20 ounces of vampire dust now. I'll have another b-beer.", cid)
          setPlayerStorageValue(cid, 30031, 6)
          talkState[talkUser] = 0
        else
          npcHandler:say("T-this is n-not enough.", cid)
        end
      end

      if getstorage == 6 then
        if doPlayerRemoveItem(cid, 5905, 20) == TRUE then
          npcHandler:say("Tha-thank you. Trolls are good for something a-after all. Bring me the 10 ounces of demon dust now. <hicks>", cid)
          setPlayerStorageValue(cid, 30031, 7)
          talkState[talkUser] = 0
        else
          npcHandler:say("T-this is n-not enough.", cid)
        end
      end

      if getstorage == 7 then
        if doPlayerRemoveItem(cid, 5906, 10) == TRUE then
          npcHandler:say("G-great. You're a reeeal k-killer like me, eh? I think I'll g-give you something fun when the potion is complete. But first, b-bring me warrior's sweat.", cid)
          setPlayerStorageValue(cid, 30031, 8)
          talkState[talkUser] = 0
        else
          npcHandler:say("T-this is n-not enough.", cid)
        end
      end

      if getstorage == 8 then
        if doPlayerRemoveItem(cid, 5885, 1) == TRUE then
          npcHandler:say("Yahaha! Here we g-go. I'll just take a small sip - <gulp>. Okay, this is disgusting, but it seems to work. I'll teach you something fun, remind me to tell you a secret sometime.", cid)
          setPlayerStorageValue(cid, 30031, 9)
          talkState[talkUser] = 0
        else
          npcHandler:say("T-this is n-not right.", cid)
        end
      end
    end
  elseif(msgcontains(msg, 'no') and talkState[talkUser] == 1) then
    npcHandler:say("Hope to see you soon.", cid)
    talkState[talkUser] = 0
  end
  return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

If you use this (Outfit Queqt, not addons), then add this in data/xml/outfits.xml:
Code:
~[COLOR="Red"]name="Assassin" premium="[/COLOR][COLOR="Blue"]?[/COLOR][COLOR="Red"]" [U]quest="30041"[/U]/>[/COLOR]


Addon 1
Code:
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 storage = 10023
  local getstorage = getPlayerStorageValue(cid, storage)
  local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid


  if msgcontains(msg, 'addon') and getstorage < 0 then
    npcHandler:say("Vescu gave you an assassin outfit? Haha. Noticed it lacks the head piece? You look a bit silly. Want my old head piece?", cid)
    talkState[talkUser] = 1


  elseif msgcontains(msg, '50 pieces of blue cloth') and getstorage == 1 then
    npcHandler:say("Brought the 50 pieces of blue cloth?", cid)
    talkState[talkUser] = 1
    
  elseif msgcontains(msg, '50 pieces of green cloth') and getstorage == 2 then
    npcHandler:say("Brought the 50 pieces of green cloth?", cid)
    talkState[talkUser] = 1

  elseif msgcontains(msg, '50 pieces of red cloth') and getstorage == 3 then
    npcHandler:say("Brought the 50 pieces of red cloth?", cid)
    talkState[talkUser] = 1
    
  elseif msgcontains(msg, '50 pieces of brown cloth') and getstorage == 4 then
    npcHandler:say("Brought the 50 pieces of brown cloth?", cid)
    talkState[talkUser] = 1
    
  elseif msgcontains(msg, '50 pieces of yellow cloth') and getstorage == 5 then
    npcHandler:say("Brought the 50 pieces of yellow cloth?", cid)
    talkState[talkUser] = 1

  elseif msgcontains(msg, '50 pieces of white cloth') and getstorage == 6 then
    npcHandler:say("Brought the 50 pieces of white cloth?", cid)
    talkState[talkUser] = 1
    
  elseif msgcontains(msg, '10 spools of yarn') and getstorage == 7 then
    npcHandler:say("Brought the 10 spools of yarn?", cid)
    talkState[talkUser] = 1


  elseif msgcontains(msg, 'yes') then
    if talkState[talkUser] == 1 then
      if getstorage < 0 then
        npcHandler:say("Thought so. Could use some help anyway. Listen, I need stuff. Someone gave me a strange assignment - sneak into Thais castle at night and shroud it with cloth without anyone noticing it. ...", cid)
        npcHandler:say("I wonder why anyone would want to shroud a castle, but as long as long as the guy pays, no problem, I'll do the sneaking part. Need a lot of cloth though. ...", cid)
        npcHandler:say("Gonna make it colourful. Bring me 50 pieces of blue cloth, 50 pieces of green cloth, 50 pieces of red cloth, 50 pieces of brown cloth, 50 pieces of yellow cloth and 50 pieces of white cloth. ...", cid)
        npcHandler:say("Besides, gonna need 10 spools of yarn. Understood?", cid)
        talkState[talkUser] = 2
      end

      if getstorage == 1 then
        if doPlayerRemoveItem(cid, 5912, 50) == TRUE then
          npcHandler:say("Good. Get me 50 pieces of green cloth now.", cid)
          setPlayerStorageValue(cid, storage, 2)
          talkState[talkUser] = 0
        else
          npcHandler:say("This is not 50!", cid)
        end

      if getstorage == 2 then
        if doPlayerRemoveItem(cid, 5910, 50) == TRUE then
          npcHandler:say("Good. Get me 50 pieces of red cloth now.", cid)
          setPlayerStorageValue(cid, storage, 3)
          talkState[talkUser] = 0
        else
          npcHandler:say("This is not 50!", cid)
        end

      if getstorage == 3 then
        if doPlayerRemoveItem(cid, 5911, 50) == TRUE then
          npcHandler:say("Good. Get me 50 pieces of brown cloth now.", cid)
          setPlayerStorageValue(cid, storage, 4)
          talkState[talkUser] = 0
        else
          npcHandler:say("This is not 50!", cid)
        end

      if getstorage == 4 then
        if doPlayerRemoveItem(cid, 5913, 50) == TRUE then
          npcHandler:say("Good. Get me 50 pieces of yellow cloth now.", cid)
          setPlayerStorageValue(cid, storage, 5)
          talkState[talkUser] = 0
        else
          npcHandler:say("This is not 50!", cid)
        end

      if getstorage == 5 then
        if doPlayerRemoveItem(cid, 5914, 50) == TRUE then
          npcHandler:say("Good. Get me 50 pieces of white cloth now.", cid)
          setPlayerStorageValue(cid, storage, 6)
          talkState[talkUser] = 0
        else
          npcHandler:say("This is not 50!", cid)
        end

      if getstorage == 6 then
        if doPlayerRemoveItem(cid, 5909, 50) == TRUE then
          npcHandler:say("Good. Get me 10 spools of yarn now.", cid)
          setPlayerStorageValue(cid, storage, 7)
          talkState[talkUser] = 0
        else
          npcHandler:say("This is not 10!", cid)
        end

      if getstorage == 7 then
        if doPlayerRemoveItem(cid, 5886, 10) == TRUE then
          npcHandler:say("Thanks. That's it, you're done. Good job, player. I keep my promise. Here's my old assassin head piece.", cid)
          if getPlayerSex(cid) == 0 then
            doPlayerAddOutfit(cid, 156, 1)
            setPlayerStorageValue(cid, storage, 8)
          elseif getPlayerSex(cid) == 1 then
            doPlayerAddOutfit(cid, 152, 1)
            setPlayerStorageValue(cid, storage, 8)
          end
          talkState[talkUser] = 0
        else
          npcHandler:say("This is not 50!", cid)
        end

      end

    elseif talkState[talkUser] == 2 then
      if getstorage < 0 then
        npcHandler:say("Good. Start with the blue cloth. I'll wait.", cid)
        setPlayerStorageValue(cid, storage, 1)
        talkState[talkUser] = 1
      end
    end
  elseif(msgcontains(msg, 'no') and talkState[talkUser] == 1) then
    npcHandler:say("Hope to see you soon.", cid)
    talkState[talkUser] = 0
  end
  return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Addon 2

Code:
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 storage = 10024
  local getstorage = getPlayerStorageValue(cid, storage)
  local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid


  if msgcontains(msg, 'addon') and getstorage < 0 then
    if getPlayerStorageValue(cid, 10023) == 8 then
      npcHandler:say("You managed to deceive Erayo? Impressive. Well, I guess, since you have come that far, I might as well give you a task too, eh?", cid)
      talkState[talkUser] = 1
    else
      npcHandler:say("I cant help you with that, mabye you should seek up Erayo.", cid)
      talkState[talkUser] = 0
    end

  elseif msgcontains(msg, 'behemoth claw') or msgcontains(msg, 'nose ring') or msgcontains(msg, 'items') and getstorage == 1 then
    if getPlayerItemCount(cid, 5930) == 1 then
      if getPlayerItemCount(cid, 5804) == 1 then
        if doPlayerRemoveItem(cid, 5930, 1) == TRUE and doPlayerRemoveItem(cid, 5404, 1) == TRUE then
          npcHandler:say("I see you brought my stuff. Good. I'll keep my promise: Here's katana in return.", cid)
          talkState[talkUser] = 0
          if getPlayerSex(cid) == 0 then
            doPlayerAddOutfit(cid, 156, 2)
            setPlayerStorageValue(cid, storage, 8)
          elseif getPlayerSex(cid) == 1 then
            doPlayerAddOutfit(cid, 152, 2)
            setPlayerStorageValue(cid, storage, 8)
          end
        end
      else
        npcHandler:say("You don't have any nose ring!", cid)
      end
    else
      npcHandler:say("You don't have any behemoth claw!", cid)
    end

  elseif msgcontains(msg, 'yes') then
    if talkState[talkUser] == 1 then
        npcHandler:say("Okay, listen up. I don't have a list of stupid objects, I just want two things. A behemoth claw and a nose ring. Got that?", cid)
        talkState[talkUser] = 2
      end
    elseif talkState[talkUser] == 2 then
      if getstorage < 0 then
        npcHandler:say("Good. Come back when you have BOTH. Should be clear where to get a behemoth claw from. There's a horned fox who wears a nose ring. Good luck.", cid)
        setPlayerStorageValue(cid, storage, 1)
        talkState[talkUser] = 1
      end
    end
  elseif(msgcontains(msg, 'no') and talkState[talkUser] == 1) then
    npcHandler:say("Hope to see you soon.", cid)
    talkState[talkUser] = 0
  end
  return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())


Feel free to REP++ me!
 
Last edited:
Man, I was testing here but is not working :S

00:09 Vescu: Welcome, Mirko Crocop! I have been expecting you.
00:09 Mirko Crocop [174]: sober
00:10 Mirko Crocop [174]: outfit
00:10 Mirko Crocop [174]: addon

None error is returning :S

I use Tfs cryingdamson2-gui 8.40

Help plz
 
I'll check addon 1/2
PS. What error do you get/what do you say to npc?


Phoenix, tried to say "potion"?
You have to say potion b4 he responds, this was my first "advanced" npc, and you can easily edit him if you know how to.
 
It must be something wrong with your server, i use tfs 0.3.4, and the npc works. The npc should work with all 0.3 servers.
 
Back
Top