Ir para conteúdo

Featured Replies

Postado

Auguem fas pra mim um Npc que cure o player e todos pokemons dele ?

todos server vem isso ? sim mas vem o heal.lua e ele so fica dando esse erro na distro

 

[30/01/2016 20:37:59] [Error - Npc interface] 
[30/01/2016 20:37:59] data/npc/scripts/heal.lua:onCreatureSay
[30/01/2016 20:37:59] Description: 
[30/01/2016 20:37:59] (luaDoItemSetAttribute) Item not found

 

creio que e porq nao cura certos pokes ou seila

tem como fazer para mim ? presisa dos id das pokebola ? ta aki \/\/\/\/\/

--------------------------------------------------------------------------

local ballcatch = {                    --id normal, id da ball shiy
[2394] = {cr = 3, on = 24, off = 23, ball = {11826, 11737}, send = 47, typeee = "normal"},  --alterado v1.9  \/
[2391] = {cr = 6, on = 198, off = 197, ball = {11832, 11740}, send = 48, typeee = "great"},
[2393] = {cr = 10, on = 202, off = 201, ball = {11835, 11743}, send = 46, typeee = "super"},
[2392] = {cr = 15, on = 200, off = 199, ball = {11829, 11746}, send = 49, typeee = "ultra"},
[12617] = {cr = 3, on = 204, off = 203, ball = {10975, 12621}, send = 35, typeee = "saffari"},
}

---------------------------------------------------------------------------

No meu Config.lua Ta assim

 

pokeballs = {
["normal"] = {effect = 188, on = 11826, use = 11827, off = 11828, all = {11826, 11827, 11828}},
["great"] = {effect = 189, on = 11832, use = 11833, off = 11834, all = {11832, 11833, 11834}},
["super"] = {effect = 190, on = 11835, use = 11836, off = 11837, all = {11835, 11836, 11837}},
["ultra"] = {effect = 191, on = 11829, use = 11830, off = 11831, all = {11829, 11830, 11831}},
["saffari"] = {effect = 195, on = 10975, use = 10976, off = 10977, all = {10975, 10976, 10977}},    --alterado v1.9

["shinynormal"] = {effect = 188, on = 11737, use = 11738, off = 11739, all = {11737, 11738, 11739}},
["shinygreat"] = {effect = 189, on = 11740, use = 11741, off = 11742, all = {11740, 11741, 11742}},
["shinysuper"] = {effect = 190, on = 11743, use = 11744, off = 11745, all = {11743, 11744, 11745}},
["shinyultra"] = {effect = 191, on = 11746, use = 11747, off = 11748, all = {11746, 11747, 11748}},
["shinysaffari"] = {effect = 195, on = 12621, use = 12622, off = 12623, all = {12621, 12622, 12623}},   --alterado v1.9
}

 

sera que tenho q tira a parte onde ta

["shinynormal"] = {effect = 188, on = 11737, use = 11738, off = 11739, all = {11737, 11738, 11739}},
["shinygreat"] = {effect = 189, on = 11740, use = 11741, off = 11742, all = {11740, 11741, 11742}},
["shinysuper"] = {effect = 190, on = 11743, use = 11744, off = 11745, all = {11743, 11744, 11745}},
["shinyultra"] = {effect = 191, on = 11746, use = 11747, off = 11748, all = {11746, 11747, 11748}},
["shinysaffari"] = {effect = 195, on = 12621, use = 12622, off = 12623, all = {12621, 12622, 12623}},   --alterado v1.9

 

para parar de da erro ?

 

Auguns de vcs ja aconteceu isso ? ajuda eu :[

 

 

up

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

  • Respostas 6
  • Visualizações 980
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • crie dentro da pasta npc crie um chamado nurse.xml e coloque dentro:   agora crie um arquivo chamado heal.lua dentro de npc/script e coloque isso:  

  • blz xD

Postado
3 horas atrás, elias silva disse:

Auguem fas pra mim um Npc que cure o player e todos pokemons dele ?

todos server vem isso ? sim mas vem o heal.lua e ele so fica dando esse erro na distro

 

[30/01/2016 20:37:59] [Error - Npc interface] 
[30/01/2016 20:37:59] data/npc/scripts/heal.lua:onCreatureSay
[30/01/2016 20:37:59] Description: 
[30/01/2016 20:37:59] (luaDoItemSetAttribute) Item not found

 

creio que e porq nao cura certos pokes ou seila

tem como fazer para mim ? presisa dos id das pokebola ? ta aki \/\/\/\/\/

--------------------------------------------------------------------------

local ballcatch = {                    --id normal, id da ball shiy
[2394] = {cr = 3, on = 24, off = 23, ball = {11826, 11737}, send = 47, typeee = "normal"},  --alterado v1.9  \/
[2391] = {cr = 6, on = 198, off = 197, ball = {11832, 11740}, send = 48, typeee = "great"},
[2393] = {cr = 10, on = 202, off = 201, ball = {11835, 11743}, send = 46, typeee = "super"},
[2392] = {cr = 15, on = 200, off = 199, ball = {11829, 11746}, send = 49, typeee = "ultra"},
[12617] = {cr = 3, on = 204, off = 203, ball = {10975, 12621}, send = 35, typeee = "saffari"},
}

---------------------------------------------------------------------------

No meu Config.lua Ta assim

 

pokeballs = {
["normal"] = {effect = 188, on = 11826, use = 11827, off = 11828, all = {11826, 11827, 11828}},
["great"] = {effect = 189, on = 11832, use = 11833, off = 11834, all = {11832, 11833, 11834}},
["super"] = {effect = 190, on = 11835, use = 11836, off = 11837, all = {11835, 11836, 11837}},
["ultra"] = {effect = 191, on = 11829, use = 11830, off = 11831, all = {11829, 11830, 11831}},
["saffari"] = {effect = 195, on = 10975, use = 10976, off = 10977, all = {10975, 10976, 10977}},    --alterado v1.9

["shinynormal"] = {effect = 188, on = 11737, use = 11738, off = 11739, all = {11737, 11738, 11739}},
["shinygreat"] = {effect = 189, on = 11740, use = 11741, off = 11742, all = {11740, 11741, 11742}},
["shinysuper"] = {effect = 190, on = 11743, use = 11744, off = 11745, all = {11743, 11744, 11745}},
["shinyultra"] = {effect = 191, on = 11746, use = 11747, off = 11748, all = {11746, 11747, 11748}},
["shinysaffari"] = {effect = 195, on = 12621, use = 12622, off = 12623, all = {12621, 12622, 12623}},   --alterado v1.9
}

 

sera que tenho q tira a parte onde ta

["shinynormal"] = {effect = 188, on = 11737, use = 11738, off = 11739, all = {11737, 11738, 11739}},
["shinygreat"] = {effect = 189, on = 11740, use = 11741, off = 11742, all = {11740, 11741, 11742}},
["shinysuper"] = {effect = 190, on = 11743, use = 11744, off = 11745, all = {11743, 11744, 11745}},
["shinyultra"] = {effect = 191, on = 11746, use = 11747, off = 11748, all = {11746, 11747, 11748}},
["shinysaffari"] = {effect = 195, on = 12621, use = 12622, off = 12623, all = {12621, 12622, 12623}},   --alterado v1.9

 

para parar de da erro ?

 

Auguns de vcs ja aconteceu isso ? ajuda eu :[

 

 

up

 

 

 

crie dentro da pasta npc crie um chamado nurse.xml e coloque dentro:

Spoiler

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Nurse Joy" script="heal.lua" walkinterval="350000" floorchange="0" speed="0">
    <health now="150" max="150"/>
    <look type="532" head="91" body="102" legs="83" feet="0"/>
    <parameters>
            <parameter key="message_greet" value="Welcome to the pokemon center! We can {heal} your pokemons here!"/>
            <parameter key="message_farewell" value="Always remember to treat well your pokemons!"/>
            <parameter key="message_idletimeout" value="Have a nice day."/>
            <parameter key="message_walkaway" value="Good bye young trainer!"/>
    </parameters>
</npc>

 

agora crie um arquivo chamado heal.lua dentro de npc/script e coloque isso:

Spoiler

local posis = {   --[storage da city] = {pos da nurse na city},
[897530] = {x = 1053, y = 1046, z = 7},   --saffron                 
[897531] = {x = 1060, y = 900, z = 7},    --cerulean
[897532] = {x = 1204, y = 1042, z = 7},    --lavender
[897533] = {x = 1213, y = 1321, z = 7},    --fuchsia
[897534] = {x = 862, y = 1094, z = 6},    --celadon
[897535] = {x = 705, y = 1086, z = 7},    --viridian
[897536] = {x = 1075, y = 1233, z = 7},    --vermilion
[897537] = {x = 723, y = 847, z = 7},    --pewter
[897538] = {x = 850, y = 1396, z = 7},    --cinnabar
[897539] = {x = 1429, y = 1597, z = 6},    --snow
[897540] = {x = 542, y = 675, z = 7},    --golden
}

function onThingMove(creature, thing, oldpos, oldstackpos)
end

function onCreatureAppear(creature)
end

function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Ate mais treinador!')
focus = 0
talk_start = 0
end
end

function onCreatureTurn(creature)
end

function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end

function onCreatureSay(cid, type, msg)
local msg = string.lower(msg)
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

for a, b in pairs(gobackmsgs) do
    local gm = string.gsub(b.go, "doka!", "")
    local bm = string.gsub(b.back, "doka!", "")
if string.find(string.lower(msg), string.lower(gm)) or string.find(string.lower(msg), string.lower(bm)) then
return true
end
end

if((msgcontains(msg, 'hi') or msgcontains(msg, 'heal') or msgcontains(msg, 'help')) and (getDistanceToCreature(cid) <= 3)) then

     if exhaustion.get(cid, 9211) then
    selfSay('Please wait a few moment before asking me to heal your pokemons again!')
    return true
       end

    if not getTileInfo(getThingPos(cid)).protection and nurseHealsOnlyInPZ then
        selfSay("Please, get inside the pokémon center to heal your pokemons!")
    return true
    end
    
    if getPlayerStorageValue(cid, 52480) >= 1 then
       selfSay("You can't do that while in a Duel!")   --alterado v1.6.1
    return true 
    end
    
    for e, f in pairs(posis) do
        local pos = getThingPos(getNpcCid())
        if isPosEqual(pos, f) then
           if getPlayerStorageValue(cid, e) <= -1 then           --alterado v1.7
              setPlayerStorageValue(cid, e, 1)
           end
        end
    end 

    exhaustion.set(cid, 9211, 5)

    doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
    doCureStatus(cid, "all", true)
    doSendMagicEffect(getThingPos(cid), 14)

    local mypb = getPlayerSlotItem(cid, 8)

    if #getCreatureSummons(cid) >= 1 then

        if not nurseHealsPokemonOut then
            selfSay("Please, return your pokemon to his ball!")
        return true
        end

        local s = getCreatureSummons(cid)[1]
        doCreatureAddHealth(s, getCreatureMaxHealth(s))
        doSendMagicEffect(getThingPos(s), 14)
        doCureStatus(s, "all", false)
        if getPlayerStorageValue(s, 1008) < baseNurseryHappiness then
            setPlayerStorageValue(s, 1008, baseNurseryHappiness)
        end
        if getPlayerStorageValue(s, 1009) > baseNurseryHunger then
            setPlayerStorageValue(s, 1009, baseNurseryHunger)
        end
    else
        if mypb.itemid ~= 0 and isPokeball(mypb.itemid) then  --alterado v1.3
            doItemSetAttribute(mypb.uid, "hp", 1)
            if getItemAttribute(mypb.uid, "hunger") and getItemAttribute(mypb.uid, "hunger") > baseNurseryHunger then
                doItemSetAttribute(mypb.uid, "hunger", baseNurseryHunger)
            end
            for c = 1, 15 do
                local str = "move"..c
                setCD(mypb.uid, str, 0)
            end
            if getItemAttribute(mypb.uid, "happy") and getItemAttribute(mypb.uid, "happy") < baseNurseryHappiness then
                doItemSetAttribute(mypb.uid, "happy", baseNurseryHappiness)
            end
            if getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
                for a, b in pairs (pokeballs) do
                    if isInArray(b.all, mypb.itemid) then
                       doTransformItem(mypb.uid, b.on)
                    end
                end
            end
        end
    end

    local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)

    local balls = getPokeballsInContainer(bp.uid)
    if #balls >= 1 then
       for _, uid in ipairs(balls) do
           doItemSetAttribute(uid, "hp", 1)
           for c = 1, 15 do
               local str = "move"..c
               setCD(uid, str, 0)   
           end
           if getItemAttribute(uid, "hunger") and getItemAttribute(uid, "hunger") > baseNurseryHunger then
              doItemSetAttribute(uid, "hunger", baseNurseryHunger)
           end
           if getItemAttribute(uid, "happy") and getItemAttribute(uid, "happy") < baseNurseryHappiness then
              doItemSetAttribute(uid, "happy", baseNurseryHappiness)
           end
           local this = getThing(uid)
           for a, b in pairs (pokeballs) do
               if isInArray(b.all, this.itemid) then
                  doTransformItem(uid, b.on)
               end
           end
        end
    end
    selfSay('There you go! You and your pokemons are healthy again.')
    if useKpdoDlls then  --alterado v1.7
       doUpdateMoves(cid)
    end
end
end

 

Postado
  • Autor
10 minutes ago, lenardo88 said:

crie dentro da pasta npc crie um chamado nurse.xml e coloque dentro:

  Hide contents

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Nurse Joy" script="heal.lua" walkinterval="350000" floorchange="0" speed="0">
    <health now="150" max="150"/>
    <look type="532" head="91" body="102" legs="83" feet="0"/>
    <parameters>
            <parameter key="message_greet" value="Welcome to the pokemon center! We can {heal} your pokemons here!"/>
            <parameter key="message_farewell" value="Always remember to treat well your pokemons!"/>
            <parameter key="message_idletimeout" value="Have a nice day."/>
            <parameter key="message_walkaway" value="Good bye young trainer!"/>
    </parameters>
</npc>

 

agora crie um arquivo chamado heal.lua dentro de npc/script e coloque isso:

  Hide contents

local posis = {   --[storage da city] = {pos da nurse na city},
[897530] = {x = 1053, y = 1046, z = 7},   --saffron                 
[897531] = {x = 1060, y = 900, z = 7},    --cerulean
[897532] = {x = 1204, y = 1042, z = 7},    --lavender
[897533] = {x = 1213, y = 1321, z = 7},    --fuchsia
[897534] = {x = 862, y = 1094, z = 6},    --celadon
[897535] = {x = 705, y = 1086, z = 7},    --viridian
[897536] = {x = 1075, y = 1233, z = 7},    --vermilion
[897537] = {x = 723, y = 847, z = 7},    --pewter
[897538] = {x = 850, y = 1396, z = 7},    --cinnabar
[897539] = {x = 1429, y = 1597, z = 6},    --snow
[897540] = {x = 542, y = 675, z = 7},    --golden
}

function onThingMove(creature, thing, oldpos, oldstackpos)
end

function onCreatureAppear(creature)
end

function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Ate mais treinador!')
focus = 0
talk_start = 0
end
end

function onCreatureTurn(creature)
end

function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end

function onCreatureSay(cid, type, msg)
local msg = string.lower(msg)
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

for a, b in pairs(gobackmsgs) do
    local gm = string.gsub(b.go, "doka!", "")
    local bm = string.gsub(b.back, "doka!", "")
if string.find(string.lower(msg), string.lower(gm)) or string.find(string.lower(msg), string.lower(bm)) then
return true
end
end

if((msgcontains(msg, 'hi') or msgcontains(msg, 'heal') or msgcontains(msg, 'help')) and (getDistanceToCreature(cid) <= 3)) then

     if exhaustion.get(cid, 9211) then
    selfSay('Please wait a few moment before asking me to heal your pokemons again!')
    return true
       end

    if not getTileInfo(getThingPos(cid)).protection and nurseHealsOnlyInPZ then
        selfSay("Please, get inside the pokémon center to heal your pokemons!")
    return true
    end
    
    if getPlayerStorageValue(cid, 52480) >= 1 then
       selfSay("You can't do that while in a Duel!")   --alterado v1.6.1
    return true 
    end
    
    for e, f in pairs(posis) do
        local pos = getThingPos(getNpcCid())
        if isPosEqual(pos, f) then
           if getPlayerStorageValue(cid, e) <= -1 then           --alterado v1.7
              setPlayerStorageValue(cid, e, 1)
           end
        end
    end 

    exhaustion.set(cid, 9211, 5)

    doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
    doCureStatus(cid, "all", true)
    doSendMagicEffect(getThingPos(cid), 14)

    local mypb = getPlayerSlotItem(cid, 8)

    if #getCreatureSummons(cid) >= 1 then

        if not nurseHealsPokemonOut then
            selfSay("Please, return your pokemon to his ball!")
        return true
        end

        local s = getCreatureSummons(cid)[1]
        doCreatureAddHealth(s, getCreatureMaxHealth(s))
        doSendMagicEffect(getThingPos(s), 14)
        doCureStatus(s, "all", false)
        if getPlayerStorageValue(s, 1008) < baseNurseryHappiness then
            setPlayerStorageValue(s, 1008, baseNurseryHappiness)
        end
        if getPlayerStorageValue(s, 1009) > baseNurseryHunger then
            setPlayerStorageValue(s, 1009, baseNurseryHunger)
        end
    else
        if mypb.itemid ~= 0 and isPokeball(mypb.itemid) then  --alterado v1.3
            doItemSetAttribute(mypb.uid, "hp", 1)
            if getItemAttribute(mypb.uid, "hunger") and getItemAttribute(mypb.uid, "hunger") > baseNurseryHunger then
                doItemSetAttribute(mypb.uid, "hunger", baseNurseryHunger)
            end
            for c = 1, 15 do
                local str = "move"..c
                setCD(mypb.uid, str, 0)
            end
            if getItemAttribute(mypb.uid, "happy") and getItemAttribute(mypb.uid, "happy") < baseNurseryHappiness then
                doItemSetAttribute(mypb.uid, "happy", baseNurseryHappiness)
            end
            if getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
                for a, b in pairs (pokeballs) do
                    if isInArray(b.all, mypb.itemid) then
                       doTransformItem(mypb.uid, b.on)
                    end
                end
            end
        end
    end

    local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)

    local balls = getPokeballsInContainer(bp.uid)
    if #balls >= 1 then
       for _, uid in ipairs(balls) do
           doItemSetAttribute(uid, "hp", 1)
           for c = 1, 15 do
               local str = "move"..c
               setCD(uid, str, 0)   
           end
           if getItemAttribute(uid, "hunger") and getItemAttribute(uid, "hunger") > baseNurseryHunger then
              doItemSetAttribute(uid, "hunger", baseNurseryHunger)
           end
           if getItemAttribute(uid, "happy") and getItemAttribute(uid, "happy") < baseNurseryHappiness then
              doItemSetAttribute(uid, "happy", baseNurseryHappiness)
           end
           local this = getThing(uid)
           for a, b in pairs (pokeballs) do
               if isInArray(b.all, this.itemid) then
                  doTransformItem(uid, b.on)
               end
           end
        end
    end
    selfSay('There you go! You and your pokemons are healthy again.')
    if useKpdoDlls then  --alterado v1.7
       doUpdateMoves(cid)
    end
end
end

 

 

Postado
  • Autor

Não da para mim saber agr mas nao deu nenhum erro na distro nao mas ele da as veses mas para frente de nao der mas do mas rep ainda ^^

se dar erro mas para frente te marco aki Toma ae meu rep + ^^

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