Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Ola galera do TK!

 

Bom, tenho um otserver global e o npc Zoltan (addonmage2) nao esta entregando o addon, o player fala :hi : Ferumbras hat e o npc nao pega o hat e nem entrega o addon. Vou deixa a script do npc aqui em baixo, se puderem me ajudar. =)

 

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
 
 
-- Storage IDs --
 
fmage        = 22114    
smage        = 22115
  
newaddon    = 'Ah, right! The Ferumbra\'s Hat! Here you go.'
noitems        = 'You do not have all the required items.'
noitems2    = 'You do not have all the required items or you do not have the outfit, which by the way, is a requirement for this addon.'
already        = 'It seems you already have this addon, don\'t you try to mock me son!'
 
 
function MageSecond(cid, message, keywords, parameters, node)
 
    if(not npcHandler:isFocused(cid)) then
        return false
    end
 
    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,smage)
    if addon == -1 then
       if getPlayerItemCount(cid,5903) >= 1 then
        if doPlayerRemoveItem(cid,5903,1) then
            npcHandler:say('Ah, right! The mage hat! Here you go.')
            doSendMagicEffect(getCreaturePosition(cid), 13)
setPlayerStorageValue(cid,smage,1)
if getPlayerSex(cid) == 1 then 
            doPlayerAddOutfit(cid, 130, 2)
            elseif getPlayerSex(cid) == 0 then 
            doPlayerAddOutfit(cid, 141, 2)
        end    
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end
 
end
----------------------------------------Paradox-------------------------
function creatureSayCallback(cid, type, msg)
if (not npcHandler:isFocused(cid)) then
        return false
    end
 
local queststate = getPlayerStorageValue(cid,6664)
 
if msgcontains(msg, 'yenny the gentle') and queststate == 1 then
npcHandler:say('Ah, Yenny the Gentle was one of the founders of the druid order called Crunors Caress, that has been originated in her hometown Carlin.', cid)
        talk_state = 1
elseif msgcontains(msg, 'crunors caress') and talk_state == 1 then
npcHandler:say('A quite undruidic order of druids they were, as far as we know. I have no more enlightening knowledge about them though.', cid)
setPlayerStorageValue(cid,6665,1)
                talk_state = 2
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 2) then
npcHandler:say('Good Bye. |PLAYERNAME|!', cid)
 
 
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
 
 
node1 = keywordHandler:addKeyword({'mage hat'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To get mage hat you need give me a ferumbras\' hat. Do you have them with you?'})
node1:addChildKeyword({'yes'}, MageSecond, {})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})
 
node2 = keywordHandler:addKeyword({'addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To get mage hat you need give me a ferumbras\' hat. Do you have them with you?'})
node2:addChildKeyword({'yes'}, MageSecond, {})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})
 
 
 
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Postado
  • Diretor

doPlayerAddOutfit(cid, 130, 2)
            elseif getPlayerSex(cid) == 0 then
            doPlayerAddOutfit(cid, 141, 2)

 

veja se lá no outifts.xml está lá tbm ...

 

exemple 

 

<outfit id="1" quest="6665">
<list gender="0" lookType="142" name="Trainer"/>
<list gender="1" lookType="141" name="Trainer"/>
</outfit>

Editado por alexxxxxxx (veja o histórico de edições)

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

Postado
  • Autor

Descobri qual era o problema, tem que fazer primeiro o addon 1 para depois fazer o addon 2, por isso o npc zoltan nao respondia. Erro meu!

Mesmo assim obrigado por responder!

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo