• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    Mision npc que libera puerta y sqm

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    1Cảnh báo Mision npc que libera puerta y sqm Vie Mayo 31, 2013 3:35 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    bueno aqui les va encontre este script por la internet y me gusto ya que yo uso un similar. aqui les va.

    Código:
    <?xml version="1.0" encoding="UTF-8"?>
    <npc name="manu" script="data/npc/scripts/mision.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="143" head="0" body="114" legs="71" feet="114" addons="3"/>
    <parameters>
            <parameter key="message_greet" value="Bienvenido |PLAYERNAME|.digame ..{mision}"/>
            <parameter key="message_farewell" value="Hasta pronto |PLAYERNAME|."/>
        </parameters>
    </npc>

    crean un npc cualquiera le dan copiar a cualquier npc ojo en la carpeta npc.



    luego se van a scrips y copian cualquier archivo y los remplasan por esto, pero le ponen nombre mision.lua
    y pegan esto dentro.


    Código:

    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 talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
    if(msgcontains(msg, 'quest')) then
    selfSay('Hi newbie, I can do you help? if you need food equipment say {trade}, too you need complete a {mission}!.', cid)
    end
    ---------------------------------------------------------
    if(msgcontains(msg, 'mission')) then
    selfSay('well, go and bring me a {small diamond}', cid)
    talkState[talkUser] = 1
    elseif(msgcontains(msg, 'small diamond') and talkState[talkUser] == 1) then
    if (getPlayerStorageValue(cid,5500) > 0) then
    selfSay('sorry buddy, I have no more missions for you!!.', cid)
    else
    if(doPlayerRemoveItem(cid, 2145, 1) == TRUE) then
    setPlayerStorageValue(cid,5500,1)
    doPlayerAddItem(cid, 2152, 70)
    doPlayerAddExperience(cid, 61000)
    selfSay('Excellent work!', cid)
    selfSay('accept these exp points as my way of thanks!', cid)
    else
    selfSay('sorry, you need a {small diamond}. you can loot this item from the monster under temple', cid)
    end
    end
    return true
    end
    ---------------------------------------------------------
    end
    npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
    npcHandler:addModule(FocusModule:new())


    bueno si queremos crear un puerta que funsione con el storange de la mision solo hay que añadir esto ena ction.


    Código:
    function onUse(cid, item, frompos, item2, topos)
    if (getPlayerStorageValue(cid,5500) > 0) then
                pos = getPlayerPosition(cid)
                if pos.x == topos.x then
                  if pos.y < topos.y then
                      pos.y = topos.y + 1
                  else
                      pos.y = topos.y - 1
                  end
                elseif pos.y == topos.y then
                      if pos.x < topos.x then
                          pos.x = topos.x + 1
                      else
                          pos.x = topos.x - 1
                      end
                else
                    doPlayerSendTextMessage(cid,22,"you need stand front of the door!.")
                return true
                end
                doTeleportThing(cid,pos)
                doSendMagicEffect(topos,12)
            else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "you dont have access in this area")
            end
            return true
    end




    para el sqm esto


    Código:
    function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if (getPlayerStorageValue(cid,5500) > 0) then
    doSendMagicEffect(position, 12)
    else
    doTeleportThing(cid, fromPosition)
    doPlayerSendCancel(cid, "you no have complete the missions!")
    doSendMagicEffect(position, 2)
    doSendMagicEffect(fromPosition, 2)
    return true
    end
    end





    Mision npc que libera puerta y sqm YNU5B25
    +2
    Psycho
    [Admin] God Maya
    6 participantes
    http://www.tibiaface.com

    2Cảnh báo Re: Mision npc que libera puerta y sqm Vie Mayo 31, 2013 11:19 pm

    Psycho

    Psycho
    Moderador
    Moderador
    Se ve bueno el scrpt



    AFC By Psycho & DMOT Server
    [Tienes que estar registrado y conectado para ver este vínculo]
    +2
    Psycho
    [Admin] God Maya
    6 participantes
    http://digidarkss.com

    3Cảnh báo Re: Mision npc que libera puerta y sqm Sáb Jun 01, 2013 7:57 pm

    "♣Marre♣™"

    Mision npc que libera puerta y sqm 462-68
    Miembro
    Miembro
    Esta Bueno el Scripft pero talves que lo use en mii ot ;D

    +2
    Psycho
    [Admin] God Maya
    6 participantes

    4Cảnh báo Re: Mision npc que libera puerta y sqm Sáb Ago 02, 2014 3:32 pm

    Krapula

    Krapula
    Miembro
    Miembro
    Sip, pero me funciona para Versiones Viejas? Very Happy jajajaja Very Happy esa es mi pregunta mas comun

    +2
    Psycho
    [Admin] God Maya
    6 participantes
    https://www.facebook.com

    5Cảnh báo Ayuda ^^ Jue Oct 08, 2015 1:42 am

    Mathalluz

    Mathalluz
    Nuevo Miembro
    Nuevo Miembro
    Donde añadimos esto ?


    function onUse(cid, item, frompos, item2, topos)
    if (getPlayerStorageValue(cid,5500) > 0) then
    pos = getPlayerPosition(cid)
    if pos.x == topos.x then
    if pos.y < topos.y then
    pos.y = topos.y + 1
    else
    pos.y = topos.y - 1
    end
    elseif pos.y == topos.y then
    if pos.x < topos.x then
    pos.x = topos.x + 1
    else
    pos.x = topos.x - 1
    end
    else
    doPlayerSendTextMessage(cid,22,"you need stand front of the door!.")
    return true
    end
    doTeleportThing(cid,pos)
    doSendMagicEffect(topos,12)
    else
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "you dont have access in this area")
    end
    return true
    end
    - See more at: [Tienes que estar registrado y conectado para ver este vínculo]

    +2
    Psycho
    [Admin] God Maya
    6 participantes

    6Cảnh báo Re: Mision npc que libera puerta y sqm Jue Oct 08, 2015 1:45 am

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    Mathalluz escribió:Donde añadimos esto ?


    function onUse(cid, item, frompos, item2, topos)
    if (getPlayerStorageValue(cid,5500) > 0) then
               pos = getPlayerPosition(cid)
               if pos.x == topos.x then
                 if pos.y < topos.y then
                     pos.y = topos.y + 1
                 else
                     pos.y = topos.y - 1
                 end
               elseif pos.y == topos.y then
                     if pos.x < topos.x then
                         pos.x = topos.x + 1
                     else
                         pos.x = topos.x - 1
                     end
               else
                   doPlayerSendTextMessage(cid,22,"you need stand front of the door!.")
               return true
               end
               doTeleportThing(cid,pos)
               doSendMagicEffect(topos,12)
           else
           doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "you dont have access in this area")
           end
           return true
    end
    - See more at: [Tienes que estar registrado y conectado para ver este vínculo]


    en la carpeta actions/scripts


    obvio que tendras que colocarle un unique id a la puerta



    Mision npc que libera puerta y sqm YNU5B25
    +2
    Psycho
    [Admin] God Maya
    6 participantes
    http://www.tibiaface.com

    7Cảnh báo Re: Mision npc que libera puerta y sqm Miér Mayo 17, 2017 1:36 pm

    Invitado

    Anonymous
    Invitado
    funciona para 7.6?

    +2
    Psycho
    [Admin] God Maya
    6 participantes

    8Cảnh báo Re: Mision npc que libera puerta y sqm Miér Mayo 17, 2017 2:07 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    Patricio Corleone escribió:funciona para 7.6?

    si funciona i trabajas con tfs 04.0 o otx



    Mision npc que libera puerta y sqm YNU5B25
    +2
    Psycho
    [Admin] God Maya
    6 participantes
    http://www.tibiaface.com

    9Cảnh báo Re: Mision npc que libera puerta y sqm Vie Jul 10, 2020 12:16 am

    joe123

    joe123
    Miembro
    Miembro
    function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if (getPlayerStorageValue(cid,5500) > 0) then
    doSendMagicEffect(position, 12)
    else
    doTeleportThing(cid, fromPosition)
    doPlayerSendCancel(cid, "you no have complete the missions!")
    doSendMagicEffect(position, 2)
    doSendMagicEffect(fromPosition, 2)
    return true
    end
    end


    donde se agrega eso y donde se pone el unique id para que funcione?

    +2
    Psycho
    [Admin] God Maya
    6 participantes

    Contenido patrocinado


    +2
    Psycho
    [Admin] God Maya
    6 participantes

    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).