Eu não entendia como instalá-lo, poderia explicar melhor?
Por Peedbew, 29 de jun. de 2016 em Actions e Talkactions
Eu não entendia como instalá-lo, poderia explicar melhor?
info
Grupo: Marquês
Registrado: 26/02/12
Posts: 1.1k
Reputação: +369
Gênero: Masculino
Char no Tibia: Tibjohiand Tito

Em 27/03/2017 at 13:48, Zero Cast disse:
Eu não entendia como instalá-lo, poderia explicar melhor?
Se estiver procurando por tutoriais de scripting, acesse:
Caso queira suporte scripting, acesse:
Faça bom uso da seção! ~ Equipe Xtibia.com
info
Grupo: Campones
Registrado: 29/06/16
Posts: 39
Reputação: +16
Gênero: Masculino
Olá Xtibianos!
Vim trazer este script bem criativo. Ele permite você mudar o elemento da wand/rod que escolher. Siga as instruções para que funcione corretamente.
Créditos:
StrutZ (Otland)
Jano (Otland)
Non Sequitur (Otland)
EXPLICAÇÃO
http://imgur.com/kvBzDh5
REQUISITOS
INFORMAÇÕES
-- Config-- Set wand how the wand deals damageDamageTypeWand = { values = false, -- If this is set to true then it will use the min and max values. If set to false the wand will use the formula -- Damage Values min/max wandMinDam = 20, wandMaxDam = 50, -- Damage Formula formula = { wandMinDam = function(level, maglevel) return -((level / 5) + (maglevel * 1.4) + 8) end, wandMaxDam = function(level, maglevel) return -((level / 5) + (maglevel * 2.2) + 14) end, }}-- Modal window config and storage idlocal config = { storage = 10009, titleMsg = "Change Weapon Damage Type", mainMsg = "Choose a damage type from the list",-- End Config -- Damage Table [1] = {element = "Holy"}, [2] = {element = "Fire"}, [3] = {element = "Death"}, [4] = {element = "Poison"}, [5] = {element = "Energy"}, [6] = {element = "Earth"}, [7] = {element = "Ice"},}INSTALAÇÃO
-- Config -- Set wand how the wand deals damageDamageTypeWand = { values = false, -- If this is set to true then it will use the min and max values. If set to false the wand will use the formula -- Damage Values min/max wandMinDam = 20, wandMaxDam = 50, -- Damage Formula formula = { wandMinDam = function(level, maglevel) return -((level / 5) + (maglevel * 1.4) + 8) end, wandMaxDam = function(level, maglevel) return -((level / 5) + (maglevel * 2.2) + 14) end, }} -- Modal window config and storage idlocal config = { storage = 10009, titleMsg = "Change Weapon Damage Type", mainMsg = "Choose a damage type from the list",-- End Config -- Damage Table [1] = {element = "Holy"}, [2] = {element = "Fire"}, [3] = {element = "Death"}, [4] = {element = "Poison"}, [5] = {element = "Energy"}, [6] = {element = "Earth"}, [7] = {element = "Ice"},} function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey) player:sendDamageWindow(config) return trueenddofile('data/lib/weapon_damage.lua')function Player:sendDamageWindow(config) local function buttonCallback(button, choice) -- Modal window functionallity if button.text == "Confirm" then self:setStorageValue(10009, choice.id) end end -- Modal window design local window = ModalWindow { title = config.titleMsg, -- Title of the modal window message = config.mainMsg, -- The message to be displayed on the modal window } -- Add buttons to the window (Note: if you change the names of these you must change the functions in the modal window functionallity!) window:addButton("Confirm", buttonCallback) window:addButton("Cancel") -- Set what button is pressed when the player presses enter or escape window:setDefaultEnterButton("Confirm") window:setDefaultEscapeButton("Cancel") -- Add choices from the action script for i = 1, #config do local o = config[i].element window:addChoice(o) end -- Send the window to player window:sendToPlayer(self)endRegistre o item em /data/weapons/weapons.xml Adicionando essa linha:
Essa linha é para se você estiver usando wand
Crie um novo documento de texto em /data/weapons/scripts e nomeie para "weapon_damage.lua" e cole:
local DamageTypes = { [1] = {DamageType = COMBAT_HOLYDAMAGE, DamageEffect = CONST_ANI_HOLY}, [2] = {DamageType = COMBAT_FIREDAMAGE, DamageEffect = CONST_ANI_FIRE}, [3] = {DamageType = COMBAT_DEATHDAMAGE, DamageEffect = CONST_ANI_DEATH}, [4] = {DamageType = COMBAT_POISONDAMAGE, DamageEffect = CONST_ANI_POISON}, [5] = {DamageType = COMBAT_ENERGYDAMAGE, DamageEffect = CONST_ANI_ENERGY}, [6] = {DamageType = COMBAT_EARTHDAMAGE, DamageEffect = CONST_ANI_EARTH}, [7] = {DamageType = COMBAT_ICEDAMAGE, DamageEffect = CONST_ANI_ICE}} function onGetFormulaValues(player, level, maglevel) if DamageTypeWand.values == true then min = -(DamageTypeWand.wandMinDam) max = -(DamageTypeWand.wandMaxDam) else min = DamageTypeWand.formula.wandMinDam(level, maglevel) max = DamageTypeWand.formula.wandMaxDam(level, maglevel) end return min, maxend local combat = {}for k, dam_Table in pairs(DamageTypes) do combat[k] = Combat() combat[k]:setParameter(COMBAT_PARAM_BLOCKARMOR, 1) combat[k]:setParameter(COMBAT_PARAM_BLOCKSHIELD, 1) combat[k]:setParameter(COMBAT_PARAM_TYPE, dam_Table.DamageType) combat[k]:setParameter(COMBAT_PARAM_DISTANCEEFFECT, dam_Table.DamageEffect) -- _G Is used to manually define 'onGetFormulaValues' in this loop in doesnt seem to be able to find the function. _G['onGetFormulaValues' .. k] = onGetFormulaValues combat[k]:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues" .. k)end function onUseWeapon(player, var) local value = player:getStorageValue(10009) local combatUse = combat[value] if not combatUse then return true end return combatUse:execute(player, var)end