Ir para conteúdo

Featured Replies

Postado

Erro que aparece na distro:

 

[Error - Npc interface]

data/npc/scripts/AkatsukiSystem.lua:onCreatureay
Descripition:
data/npc/scripts/AkatsukiSystem.lua:84:in function 'callback'
data/npc/lib/npcsystem/npchandler.lua:390: in function 'onCreaturesay'
data/npc/scripts/AkatsukiSystem.lua:11: in function <data/npc/scripts/AkatsukiSystem.lua:11>

 

Script que eu uso :

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

local level = 600 -- Level preciso pra entra para akatsuki
local itemid = 5943 -- id do coração
local quantidade = 5 -- quantos hearts e preciso
local bonushp = 300000 -- quanto de bonus de life vai ganha
local bonusmp = 30000 -- quanto de bonus de mana vai ganha
local experience = 20 -- Experience rates no caso 2x a experiencia do seu servidor.
local config = {
--[Vocation] = ( Nova Vocation, New Outfit )
[1] = { 339, 907},
[2] = { 14, 877},
[3] = { 29, 879},
[4] = { 44, 881},
[5] = { 219, 885},
[6] = { 279, 887},
[7] = { 59, 889},
[8] = { 89, 893},
[9] = { 104, 895},
[10] = { 116,  897},
[11] = { 433,  899},
[12] = { 234,  901},
[13] = { 354,  905},
[14] = { 374,  911},
[15] = { 404,  915},
[16] = { 309,  917},
[17] = { 294,  919},
[18] = { 324,  921},
[19] = { 144,  923},
[20] = { 159,  925},
[20] = { 129,  927},
[20] = { 174,  929},
[20] = { 204,  935},
[20] = { 389,  941},
[20] = { 264,  943},
[20] = { 189,  945},
[20] = { 264,  943},

}
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, 'akatsuki') then
    if getPlayerVocation(cid) ~= config then
        if getPlayerStorageValue(cid, 89745) == -1 then
            if getPlayerLevel(cid) >= level then
                selfSay('Tem certeza de que quer se juntar a Akatsuki?.', cid)
                talkState[talkUser] = 1
            else
                selfSay('Você nem sabe o nível que é pra entrar na akatsuki, suma da minha frente seu idiota.', cid)
            end
        else
            selfSay('Você já faz parte da Akatsuki!', cid)
        end
    else
        selfSay('Não preciso de você agora!', cid)
    end
end

if talkState[talkUser] == 1 and msgcontains(msg, 'yes') then
    selfSay('Para provar a sua lealdade, você tem que trazer '..quantidade..' {coraçao,say yes}.', cid)
    talkState[talkUser] = 2
end

if talkState[talkUser] == 2 and msgcontains(msg, 'yes') then
    if getPlayerItemCount(cid, 5943) >= 6 then
    local voc = config[getPlayerVocation(cid)]
        doPlayerSetVocation(cid, voc[1])
    local outfit = {lookType = voc[2]}
        doCreatureChangeOutfit(cid, outfit)
        setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+bonushp)
        setCreatureMaxMana(cid, getCreatureMaxMana(cid)+bonusmp)
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
        doPlayerRemoveItem(cid, 5943, 6)
        doCreatureAddMana(cid, getCreatureMaxMana(cid))
        setPlayerStorageValue(cid,89745,6)
        doPlayerSetExperienceRate(cid, experience) 
        selfSay('Parabéns agora você faz parte da Akatsuki.', cid)
        talkState[talkUser] = 0
    else
        selfSay('Não adianta me enganar, você não tem '..quantidade..' corações, vai atrás, e só volte com eles.', cid)
    end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

@UP

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

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 520.1k

Informação Importante

Confirmação de Termo