Ir para conteúdo

Featured Replies

Postado

NPC que cura.

 

crie dentro da pasta NPC crie um chamado Curandeira.xml

 

coloque dentro.

Citar

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Curandeira" script="Cura.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="Aqui nós podemos {curar} você e seu amigos! "/>
            <parameter key="message_farewell" value="Lembre-se sempre de tratar bem de seu ferimentos!"
            <parameter key="message_idletimeout" value="Have a nice day."/>
            <parameter key="message_walkaway" value="Adeus Jovem!"/>
    </parameters>
</npc>

agora crie um arquivo chamado Cura.lua dentro de npc/script

 

bote isso dentro.

 

Citar

local posis = {   --[storage da city] = {pos da Curandeira na city},
[897530] = {x = 1053, y = 1046, z = 7},   --local 1       
[897531] = {x = 1060, y = 900, z = 7},    --local 2
[897532] = {x = 1204, y = 1042, z = 7},    --local 3
[897533] = {x = 1213, y = 1321, z = 7},    --local 4
[897534] = {x = 862, y = 1094, z = 6},    --lecal 5 
[897535] = {x = 705, y = 1086, z = 7},    --local 6 
[897536] = {x = 1075, y = 1233, z = 7},    --local 7
[897537] = {x = 723, y = 847, z = 7},    --local 8
[897538] = {x = 850, y = 1396, z = 7},    --local 9 
[897539] = {x = 1429, y = 1597, z = 6},    --local 10
[897540] = {x = 542, y = 675, z = 7},    --local 11
}

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

function onCreatureAppear(creature)
end

function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('até mas jovem!')
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('Por favor espere um tempo antes de pedi para lhe curar novamente!')
    return true
       end

    if not getTileInfo(getThingPos(cid)).protection and nurseHealsOnlyInPZ then
        selfSay("Porfavor vá até  a curandeira!")
    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, ?

    if #getCreatureSummons(cid) >= 1 then

        if not nurseHealsPokemonOut then
            selfSay("nada!")
        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('Você está saudáveis novamente.')
    if useKpdoDlls then  --alterado v1.7
       doUpdateMoves(cid)
    end
end
end

 testa, esse  se  der algum erro fala, pois tentei fazer uma adaptação.

 

 

ajudei REP++

 

 

 

 

 

 

 

 

 

 

 

 

 

 

teleporte.

 

Vá em Npc e adicione  Teleportador.xml

 

bote isso dentro.

Citar

<?xml version="1.0" encoding="UTF-8"?>

 
<npc name="Teleportador" script="boat_mystic.lua" access="1" walkinterval="0" floorchange="0">
  <look type="664" head="114" body="119" legs="114" feet="114"/>
<parameters>
      <parameter key="module_travel" value="1"/>
<parameter key="message_greet" value="Blz |PLAYERNAME|. Quer ir para 000000?"/>                            <-- bote o nome do lugar.
        <parameter key="travel_destinations" value="000000,1053,1053,7,2000000"/>    <--bote o nome  do lugar  e a  coordenada
</parameters>
</npc>

 

Creditos

Citar

AnnaFeeh: NPC Cacau        <----- acredito que o criado do script

 

Eu --> Yusuke Urameshi

 

Pokejap      <--- de quem eu peguei

 

 

Editado por Yusuke Urameshi (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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo