• TibiaFace

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

    .
    demo menumenu

    Afiliados



    Votar:

    [Sistema] Sistema Ayuda

    Compartir:

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

    1Bình chọn [Sistema] Sistema Ayuda Vie Jul 15, 2016 10:38 pm

    Invitado

    Anonymous
    Invitado
    Sistema de PvP reduction Y sistema para mejorar SET.

    Les dejare unos ejemplos para que puedan entender y puedan ayudarme ok.


    esta es una amor que modifique:

    <item id="21700" article="a" name="probe legs">
    <attribute key="weight" value="1500" />
    <attribute key="armor" value="16" />
    <attribute key="slotType" value="legs" />
    <attribute key="absorbPercentAll" value="6" />
    <attribute key="suppressFire" value="1" />
    </item>



    estos legs de prueba les coloque un script asi:

    local legs = CONST_SLOT_LEGS

    local addpercent = 2
    local defaulpercent = 105
    local conditions = nil

    conditions = Condition(CONDITION_ATTRIBUTES)
    conditions:setParameter(CONDITION_PARAM_TICKS, -1)
    conditions:setParameter(CONDITION_PARAM_STAT_MAXHEALTHPERCENT, defaulpercent + addpercent)
    conditions:setParameter(CONDITION_PARAM_STAT_MAXMANAPERCENT, defaulpercent + addpercent)
    conditions:setParameter(CONDITION_PARAM_BUFF, false)
    conditions:setParameter(CONDITION_PARAM_SUBID, 51)
    end

    function onEquip(player, item, slot)

    if slot == legs then

    doAddCondition(player, conditions)
    end

    return true
    end

    function onDeEquip(player, item, slot)
    doRemoveCondition(player, CONDITION_ATTRIBUTES, 51)
    return true
    end

    Y luego la registre en moveevents.xml asi:

    <movevent event="Equip" itemid="21700" slot="legs" script="prueba/probe legs.lua" function="onEquipItem" />

    <movevent event="DeEquip" itemid="21700" slot="legs" script="prueba/probe legs.lua" function="onDeEquipItem" />

    Pero ahora viene lo interesante y misterioso:

    funciona lo que esta dentro del script muy bien, da el hp y la mp, pero ya no funciona el <attribute key="absorbPercentAll" value="6" /> y creo que tampoco <attribute key="armor" value="16" /> ni nada, solo el nombre y eso no se ni por que pero bueno. por favor ayudenme con este problema. algunas dudas me dicen, y el hp y mp que da el legs es variable osea depende del level te dara mas % puse ese script de ejemplo. vale quien responde para entonces decirles mi otra duda del Pvp.

    2Bình chọn Re: [Sistema] Sistema Ayuda Vie Jul 15, 2016 11:17 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    lo que has hecho es que no funcione la funcion interna la suprimiste colocando un script independiente al item



    [Sistema] Sistema Ayuda YNU5B25
    http://www.tibiaface.com

    3Bình chọn Bueno Vie Jul 15, 2016 11:20 pm

    Invitado

    Anonymous
    Invitado
    Bueno osea que nada mas tiene que ser la funcion de item.xml y la del script no se podra usar o inversa. pero se podra agregar al script las mismas funciones de attributos de item.xml ??? Ayudame porfis bebe.

    4Bình chọn teste Vie Jul 15, 2016 11:32 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    no hay manera de colocarlo al script el atribute


    podrias utilizar esta spells
    que esta en un mods

    Código:
    <?xml version="1.0" encoding="UTF-8"?>
    <mod name="Protector" version="1.1" author="Summ" contact="" enabled="yes">

       <config name="pro_config"><![CDATA[
          config = {
             lvl = 0,
             mlvl = 0,
             mana = 0,
             duration = 10,
             storage = 60400,
             exhausted = 4,
             storage_exhau = 60401,
             blockheal = 0,
             showtext = 1
             }
       ]]></config>

          <event type="login" name="ProLog" event="script"><![CDATA[
          function onLogin(cid)
             registerCreatureEvent(cid,"protector")
             registerCreatureEvent(cid,"protectorr")
             return true
          end
          ]]></event>
       
          <event type="combat" name="protector" event="script"><![CDATA[
             domodlib('pro_config')
             function onCombat(cid,target)
                if isPlayer(target) == TRUE then
                   if os.time() <= getPlayerStorageValue(target, config.storage) then
                      if config.showtext == 1 then
                         doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You cannot hurt "..getPlayerName(target)..", because he is protected.")
                         doPlayerSendTextMessage(target,MESSAGE_INFO_DESCR,""..getPlayerName(cid).." tried to attack you, but you are protected.")
                      end
                      doSendMagicEffect(getPlayerPosition(target),49)
                      return false
                   end
                end
             return TRUE
             end
          ]]></event>

          <event type="statschange" name="protectorr" event="script"><![CDATA[
             domodlib('pro_config')
             function onStatsChange(cid, attacker, type, combat, value)
                if not(combat == 128 and config.blockheal == 0) then
                   if os.time() <= getPlayerStorageValue(cid, config.storage) then
                      if config.showtext == 1 then
                         doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You could not be healed because you are protected.")
                      end
                      doSendMagicEffect(getPlayerPosition(cid),49)
                      return false
                   end
                end
                return true
             end
          ]]></event>

       <talkaction words="protector" event="script"><![CDATA[
          domodlib('pro_config')
          function onSay(cid, words, param, channel)
          if getPlayerLevel(cid) < config.lvl then
             doPlayerSendCancel(cid,"Your level is too low.")
             doSendMagicEffect(getPlayerPosition(cid),2)
             return true
          end
          if getPlayerMagLevel(cid) < config.mlvl then
             doPlayerSendCancel(cid,"Your magic level is too low.")
             doSendMagicEffect(getPlayerPosition(cid),2)
             return true
          end
          if getCreatureMana(cid) < config.mana then
             doPlayerSendCancel(cid,"You do not have enough mana.")
             doSendMagicEffect(getPlayerPosition(cid),2)
             return true
          end
          if os.time() <= getPlayerStorageValue(cid,config.storage_exhau) and not(getPlayerStorageValue(cid,config.storage_exhau) < 5) then
             doPlayerSendCancel(cid,"You can use this spell only once in "..config.exhausted.." seconds.")
             doSendMagicEffect(getPlayerPosition(cid),2)
             return true
          else
             setPlayerStorageValue(cid,config.storage,(os.time()+config.duration))
             setPlayerStorageValue(cid,config.storage_exhau,(os.time()+config.exhausted))
             doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You are protected for "..config.duration.." seconds now.")
             doSendMagicEffect(getPlayerPosition(cid),49)
             doPlayerAddSpentMana(cid,config.mana)
          end
          return false
          end
       ]]></talkaction>
       

    </mod>

    http://www.tibiaface.com

    5Bình chọn Re: [Sistema] Sistema Ayuda Vie Jul 15, 2016 11:35 pm

    Invitado

    Anonymous
    Invitado
    y que dices sobre dejar los attributos normalmente en Item.XML
    y con un globalevent que detecte si el item esta puesto le di ciertas condiciones verdad ? seria la manera mas facil, por que usted me dijo una ves que no hay funciones para agregarle mas proteccionAll o maxHP% verdad mayita bello ?

    6Bình chọn Re: [Sistema] Sistema Ayuda Vie Jul 15, 2016 11:38 pm

    Invitado

    Anonymous
    Invitado
    Esa spell que pusiste hay que hace ? mas o menos, sirve para 10.90 ?

    7Bình chọn Re: [Sistema] Sistema Ayuda Vie Jul 15, 2016 11:44 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    Sarah Wesker escribió:Esa spell que pusiste hay que hace ? mas o menos, sirve para 10.90 ?

    no sirve para 10.90 solo es para tfs 0.3.7/0.4..0



    [Sistema] Sistema Ayuda YNU5B25
    http://www.tibiaface.com

    8Bình chọn Re: [Sistema] Sistema Ayuda Vie Jul 15, 2016 11:45 pm

    Invitado

    Anonymous
    Invitado
    Okay Fin Del Tema. Gracias de todos modos. Wink

    Contenido patrocinado


    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).