• TibiaFace

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

    .
    demo menumenu

    Afiliados



    Votar:

    [Aporte] [Aporte] Reward por addon adquirido

    Compartir:

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

    dark

    dark
    Nuevo Miembro
    Nuevo Miembro
    Descripcion escribió:Hola es mi primer aporte y no se muy bien de que trata pero aqui les va, es un sistema que mejora al jugador dependiendo de sus addons en los outffits es decir, si tienes los 3 addons te puede mejorar el skill, la vida etc dependiendo de la vocacion del jugador

    Código:
    OUTFIT_TIERS = {
       [1] = { -- Tier
          [1] = { -- Sorcerer
             {CONDITION_PARAM_STAT_MAXHITPOINTS, 40},
             {CONDITION_PARAM_STAT_MAXMANAPOINTS, 80},
             {CONDITION_PARAM_STAT_MAGICPOINTS, 1},
             {CONDITION_PARAM_SPEED, 10},
          },
          [2] = { -- Druid
             {CONDITION_PARAM_STAT_MAXHITPOINTS, 40},
             {CONDITION_PARAM_STAT_MAXMANAPOINTS, 80},
             {CONDITION_PARAM_STAT_MAGICPOINTS, 1},
             {CONDITION_PARAM_SPEED, 10},
          },
          [3] = { -- Paladin
             {CONDITION_PARAM_STAT_MAXHITPOINTS, 35},
             {CONDITION_PARAM_STAT_MAXMANAPOINTS, 35},
             {CONDITION_PARAM_SKILL_DISTANCE, 1},
             {CONDITION_PARAM_SPEED, 10},
          },
          [4] = { -- Knight
             {CONDITION_PARAM_STAT_MAXHITPOINTS, 80},
             {CONDITION_PARAM_STAT_MAXMANAPOINTS, 35},
             {CONDITION_PARAM_SKILL_CLUB, 1},
             {CONDITION_PARAM_SKILL_SWORD, 1},
             {CONDITION_PARAM_SKILL_AXE, 1},
             {CONDITION_PARAM_SPEED, 10},
          }
       },
       [2] = { -- Tier
          [1] = { -- Sorcerer
             {CONDITION_PARAM_STAT_MAXHITPOINTS, 60},
             {CONDITION_PARAM_STAT_MAXMANAPOINTS, 120},
             {CONDITION_PARAM_STAT_MAGICPOINTS, 2},
             {CONDITION_PARAM_SPEED, 15},
          },
          [2] = { -- Druid
             {CONDITION_PARAM_STAT_MAXHITPOINTS, 60},
             {CONDITION_PARAM_STAT_MAXMANAPOINTS, 120},
             {CONDITION_PARAM_STAT_MAGICPOINTS, 2},
             {CONDITION_PARAM_SPEED, 15},
          },
          [3] = { -- Paladin
             {CONDITION_PARAM_STAT_MAXHITPOINTS, 70},
             {CONDITION_PARAM_STAT_MAXMANAPOINTS, 70},
             {CONDITION_PARAM_SKILL_DISTANCE, 2},
             {CONDITION_PARAM_SPEED, 15},
          },
          [4] = { -- Knight
             {CONDITION_PARAM_STAT_MAXHITPOINTS, 120},
             {CONDITION_PARAM_STAT_MAXMANAPOINTS, 60},
             {CONDITION_PARAM_SKILL_CLUB, 2},
             {CONDITION_PARAM_SKILL_SWORD, 2},
             {CONDITION_PARAM_SKILL_AXE, 2},
             {CONDITION_PARAM_SPEED, 15},
          }
       },
       [3] = { -- Tier
          [1] = { -- Sorcerer
             {CONDITION_PARAM_STAT_MAXHITPOINTS, 80},
             {CONDITION_PARAM_STAT_MAXMANAPOINTS, 160},
             {CONDITION_PARAM_STAT_MAGICPOINTS, 3},
             {CONDITION_PARAM_SPEED, 20},
          },
          [2] = { -- Druid
             {CONDITION_PARAM_STAT_MAXHITPOINTS, 80},
             {CONDITION_PARAM_STAT_MAXMANAPOINTS, 160},
             {CONDITION_PARAM_STAT_MAGICPOINTS, 3},
             {CONDITION_PARAM_SPEED, 20},
          },
          [3] = { -- Paladin
             {CONDITION_PARAM_STAT_MAXHITPOINTS, 105},
             {CONDITION_PARAM_STAT_MAXMANAPOINTS, 105},
             {CONDITION_PARAM_SKILL_DISTANCE, 3},
             {CONDITION_PARAM_SPEED, 20},
          },
          [4] = { -- Knight
             {CONDITION_PARAM_STAT_MAXHITPOINTS, 160},
             {CONDITION_PARAM_STAT_MAXMANAPOINTS, 80},
             {CONDITION_PARAM_SKILL_CLUB, 3},
             {CONDITION_PARAM_SKILL_SWORD, 3},
             {CONDITION_PARAM_SKILL_AXE, 3},
             {CONDITION_PARAM_SPEED, 20},
          }
       },
       [4] = { -- Tier
          [1] = { -- Sorcerer
             {CONDITION_PARAM_STAT_MAXHITPOINTS, 100},
             {CONDITION_PARAM_STAT_MAXMANAPOINTS, 200},
             {CONDITION_PARAM_STAT_MAGICPOINTS, 1},
             {CONDITION_PARAM_SPEED, 25},
          },
          [2] = { -- Druid
             {CONDITION_PARAM_STAT_MAXHITPOINTS, 100},
             {CONDITION_PARAM_STAT_MAXMANAPOINTS, 200},
             {CONDITION_PARAM_STAT_MAGICPOINTS, 1},
             {CONDITION_PARAM_SPEED, 25},
          },
          [3] = { -- Paladin
             {CONDITION_PARAM_STAT_MAXHITPOINTS, 140},
             {CONDITION_PARAM_STAT_MAXMANAPOINTS, 140},
             {CONDITION_PARAM_SKILL_DISTANCE, 4},
             {CONDITION_PARAM_SPEED, 25},
          },
          [4] = { -- Knight
             {CONDITION_PARAM_STAT_MAXHITPOINTS, 200},
             {CONDITION_PARAM_STAT_MAXMANAPOINTS, 100},
             {CONDITION_PARAM_SKILL_CLUB, 4},
             {CONDITION_PARAM_SKILL_SWORD, 4},
             {CONDITION_PARAM_SKILL_AXE, 4},
             {CONDITION_PARAM_SPEED, 25},
          }
       },
    }

    OUTFIT_BONUSES = {
        [1] = {looktypes = {136, 128}, tier = 1}, -- Citizen
        [2] = {looktypes = {137, 129}, tier = 2}, -- Hunter
       [3] = {looktypes = {141, 130}, tier = 4}, -- Mage Male / Summoner Female
       [4] = {looktypes = {139, 131}, tier = 2}, -- Knight
       [5] = {looktypes = {140, 132}, tier = 1}, -- Nobleman
       [6] = {looktypes = {138, 133}, tier = 2}, -- Summoner Male / Mage Female
       [7] = {looktypes = {142, 134}, tier = 2}, -- Warrior
       [8] = {looktypes = {147, 143}, tier = 2}, -- Barbarian
       [9] = {looktypes = {148, 144}, tier = 2}, -- Druid
       [10] = {looktypes = {149, 145}, tier = 2}, -- Wizard
       [11] = {looktypes = {150, 146}, tier = 2}, -- Oriental
       [12] = {looktypes = {155, 151}, tier = 2}, -- Pirate
       [13] = {looktypes = {156, 151}, tier = 2}, -- Assassin
       [14] = {looktypes = {157, 152}, tier = 2}, -- Beggar
       [15] = {looktypes = {158, 153}, tier = 2}, -- Shaman
       [16] = {looktypes = {252, 154}, tier = 1}, -- Norseman
       [17] = {looktypes = {269, 251}, tier = 2}, -- Nightmare
       [18] = {looktypes = {270, 268}, tier = 1}, -- Jester
       [19] = {looktypes = {279, 273}, tier = 2}, -- Brotherhood
       [20] = {looktypes = {288, 278}, tier = 1}, -- Demon Hunter
       
       [21] = {looktypes = {324, 289}, tier = 1},
       [22] = {looktypes = {329, 328}, tier = 1},
       [23] = {looktypes = {336, 335}, tier = 2},
       [24] = {looktypes = {366, 367}, tier = 2},
       [25] = {looktypes = {431, 430}, tier = 2},
       [26] = {looktypes = {433, 432}, tier = 2},
       [27] = {looktypes = {464, 463}, tier = 2},
       [28] = {looktypes = {466, 465}, tier = 2},
       [29] = {looktypes = {471, 472}, tier = 3},
       [30] = {looktypes = {513, 512}, tier = 2},
       [31] = {looktypes = {514, 516}, tier = 2},
       [32] = {looktypes = {542, 541}, tier = 2},
       [33] = {looktypes = {575, 574}, tier = 2},
       [34] = {looktypes = {578, 577}, tier = 2},
       [35] = {looktypes = {618, 610}, tier = 2},
       [36] = {looktypes = {620, 619}, tier = 1},
       [37] = {looktypes = {632, 633}, tier = 3},
       [38] = {looktypes = {635, 634}, tier = 3},
       [39] = {looktypes = {636, 637}, tier = 3},
       [40] = {looktypes = {664, 665}, tier = 3},
       [41] = {looktypes = {666, 667}, tier = 3},
       [42] = {looktypes = {683, 684}, tier = 3},
       [43] = {looktypes = {694, 695}, tier = 3},
       [44] = {looktypes = {696, 697}, tier = 3},
       [45] = {looktypes = {698, 699}, tier = 3},
       [46] = {looktypes = {724, 725}, tier = 3},
       [47] = {looktypes = {732, 733}, tier = 3},
       [48] = {looktypes = {745, 746}, tier = 3},
       [49] = {looktypes = {749, 750}, tier = 3},
       [50] = {looktypes = {759, 760}, tier = 3},
       [51] = {looktypes = {845, 846}, tier = 2},
       [52] = {looktypes = {852, 853}, tier = 3},
       [53] = {looktypes = {874, 873}, tier = 3},
       [54] = {looktypes = {885, 884}, tier = 3},
       [55] = {looktypes = {900, 899}, tier = 3},
       [56] = {looktypes = {909, 908}, tier = 3},
       [57] = {looktypes = {929, 931}, tier = 2},
       [58] = {looktypes = {956, 955}, tier = 3},
       [59] = {looktypes = {958, 957}, tier = 3},
       [60] = {looktypes = {963, 962}, tier = 3},
       [61] = {looktypes = {965, 964}, tier = 3},
       [62] = {looktypes = {967, 966}, tier = 3},
       [63] = {looktypes = {969, 968}, tier = 3},
       [64] = {looktypes = {971, 970}, tier = 3},
       [65] = {looktypes = {973, 972}, tier = 3},
       [66] = {looktypes = {975, 974}, tier = 3},
       [67] = {looktypes = {1020, 1021}, tier = 3},
       [68] = {looktypes = {1024, 1023}, tier = 3},
       [69] = {looktypes = {1043, 1042}, tier = 1},
       [70] = {looktypes = {1050, 1051}, tier = 3},
       [71] = {looktypes = {1057, 1056}, tier = 3},
       [72] = {looktypes = {1070, 1069}, tier = 3},
       [73] = {looktypes = {1095, 1094}, tier = 1},
       [74] = {looktypes = {1103, 1102}, tier = 3},
       [75] = {looktypes = {1128, 1127}, tier = 3},
       [76] = {looktypes = {1147, 1146}, tier = 2},
       [77] = {looktypes = {1162, 1161}, tier = 2},
       [78] = {looktypes = {1174, 1173}, tier = 3},
       [79] = {looktypes = {1187, 1186}, tier = 3},
       [80] = {looktypes = {1203, 1202}, tier = 3},
       [81] = {looktypes = {1205, 1204}, tier = 3},
       [82] = {looktypes = {1207, 1206}, tier = 3},
       [83] = {looktypes = {1211, 1210}, tier = 4},
       [84] = {looktypes = {1244, 1243}, tier = 3},
       [85] = {looktypes = {1246, 1245}, tier = 3},
       [86] = {looktypes = {1252, 1251}, tier = 4},
       [87] = {looktypes = {1271, 1270}, tier = 1},
       [88] = {looktypes = {1280, 1279}, tier = 2},
       [89] = {looktypes = {1283, 1282}, tier = 3},
       [90] = {looktypes = {1289, 1288}, tier = 3},
       [91] = {looktypes = {1293, 1292}, tier = 3},
       [92] = {looktypes = {1323, 1322}, tier = 3},
       [93] = {looktypes = {1332, 1331}, tier = 4},
       [94] = {looktypes = {1339, 1338}, tier = 3},
       [95] = {looktypes = {1372, 1371}, tier = 1},
       [96] = {looktypes = {1383, 1382}, tier = 3},
       [97] = {looktypes = {1385, 1384}, tier = 3}
    }

    local function getBonusOutfitId(outfit)
       for i = 1, #OUTFIT_BONUSES do
          if isInArray(OUTFIT_BONUSES[i].looktypes, outfit) then
                return i
            end
       end
    return false
    end

    function Player.getVocationId(self)
       if isInArray({1, 2, 3, 4}, self:getVocation():getId()) then
          return self:getVocation():getId()
       elseif isInArray({5, 6, 7, 8}, self:getVocation():getId()) then
          return self:getVocation():getId() - 4
       end
    end

    function Player.createBonusCondition(self, outfitId, addon, vocId)
       local bonus = OUTFIT_BONUSES[outfitId]
        local condition = Condition(CONDITION_ATTRIBUTES, CONDITIONID_DEFAULT)
        condition:setParameter(CONDITION_PARAM_TICKS, -1)
        condition:setParameter(CONDITION_PARAM_SUBID, 105)
       
       if (addon == 3) then -- We force the outfit bonus to be only on addons 3 as gunzodus.
          local tierBonus = OUTFIT_TIERS[bonus.tier]
          
          local vocationBonus = tierBonus[vocId]
          for i = 1, #vocationBonus do
             local param = vocationBonus[i][1]
             local value = vocationBonus[i][2]
             
             condition:setParameter(param, value)
          end
       end
       
       self:addCondition(condition)
    end

    function addonbonusCallback(self, outfit)
       self:removeCondition(CONDITION_ATTRIBUTES, CONDITIONID_DEFAULT, 105)
       
       local bonusOutfit = getBonusOutfitId(outfit.lookType)
       if bonusOutfit then
          local addons = 1
          if self:hasOutfit(outfit.lookType, 2) then
             addons = 3
          elseif self:hasOutfit(outfit.lookType, 1) then
             addons = 2
          end
        
          self:createBonusCondition(bonusOutfit, addons, self:getVocationId())
       end
    end
    , si les funciona y gustan pueden añadirme a discord para mandarles la pagina, donde a sus players les va a explicar como funcionan los addons espero les sirva lo compre hace tiempo y ya no lo uso
    Imagen Explicativa escribió:Imagen Explicativa: [Aporte] [Aporte] Reward por addon adquirido Tibiaf10
    Version del Scripts: TFs 0.3.7

    2 participantes

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    gran aporte pero esta en la seccion equivacada asi que lo mudare +1 (y)



    [Aporte] [Aporte] Reward por addon adquirido YNU5B25
    2 participantes
    http://www.tibiaface.com

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