A função dessa script é o seguinte: Dependendo do número da vocation a Damade em questão poderá dar 4x, 2x, 1x, 0.5x, 0.25x ou anular o hit em relação a vocation.
Exemplo: A vocation 1 irá receber 2x do hit da damage (COMBAT_FIREDAMAGE).
Obs: Cada palavra de hit terá sua cor relacionada a damage em questão, no caso do (COMBAT_FIREDAMAGE) será em (COLOR_PURPLE).
O problema é:
Quando algum monstro ou player me ataca, aparece o duas vezes a palavra do hit, mas eu queria que aparecesse só um vez em (COLOR_PURPLE), como relacionado na script:
Obs: O dano NÃO DA DUAS VEZES, só a palavra contendo o hit que aparece duas vezes.
Script:
local config = {
combatTable = {
[COMBAT_FIREDAMAGE] = {
AQuatro = {"0"},
BDobro = {"1"},
CNormal = {"0"},
DMetade = {"0"},
EMeio = {"0"},
FNulo = {"0"},
},
},
colors = {
[COMBAT_FIREDAMAGE] = COLOR_PURPLE,
},
}
function onStatsChange(cid, attacker, type, combat, value)
local cTable = config.combatTable[combat]
if cTable and type == STATSCHANGE_HEALTHLOSS then
local a, b, c, d, e, f, check, newValue = cTable.AQuatro, cTable.BDobro, cTable.CNormal, cTable.DMetade, cTable.EMeio, cTable.FNulo, isPlayer(cid) and getPlayerVocation(cid) or getCreatureName(cid), 0
if isInArray(a, check) then
newValue = math.floor(value * 4)
elseif isInArray(b, check) then
newValue = math.floor(value * 2)
elseif isInArray(c, check) then
newValue = math.floor(value * 0)
elseif isInArray(d, check) then
newValue = math.floor(value / 2)
elseif isInArray(e, check) then
newValue = math.floor(value / 4)
elseif isInArray(f, check) then
newValue = math.floor(value - value)
end
if newValue ~= 0 then
doCreatureAddHealth(cid, -newValue)
doSendAnimatedText(getThingPos(cid), newValue, config.colors[combat] or 215)
return false
end
end
return true
end
function onLogin(cid)
registerCreatureEvent(cid, "advantageSystem")
return true
end
info
Grupo: Barão
Registrado: 26/12/11
Posts: 201
Reputação: +18
Char no Tibia: Flaah
A função dessa script é o seguinte: Dependendo do número da vocation a Damade em questão poderá dar 4x, 2x, 1x, 0.5x, 0.25x ou anular o hit em relação a vocation.
Exemplo: A vocation 1 irá receber 2x do hit da damage (COMBAT_FIREDAMAGE).
Obs: Cada palavra de hit terá sua cor relacionada a damage em questão, no caso do (COMBAT_FIREDAMAGE) será em (COLOR_PURPLE).
O problema é:
Quando algum monstro ou player me ataca, aparece o duas vezes a palavra do hit, mas eu queria que aparecesse só um vez em (COLOR_PURPLE), como relacionado na script:
Obs: O dano NÃO DA DUAS VEZES, só a palavra contendo o hit que aparece duas vezes.
Script:
local config = { combatTable = { [COMBAT_FIREDAMAGE] = { AQuatro = {"0"}, BDobro = {"1"}, CNormal = {"0"}, DMetade = {"0"}, EMeio = {"0"}, FNulo = {"0"}, }, }, colors = { [COMBAT_FIREDAMAGE] = COLOR_PURPLE, }, } function onStatsChange(cid, attacker, type, combat, value) local cTable = config.combatTable[combat] if cTable and type == STATSCHANGE_HEALTHLOSS then local a, b, c, d, e, f, check, newValue = cTable.AQuatro, cTable.BDobro, cTable.CNormal, cTable.DMetade, cTable.EMeio, cTable.FNulo, isPlayer(cid) and getPlayerVocation(cid) or getCreatureName(cid), 0 if isInArray(a, check) then newValue = math.floor(value * 4) elseif isInArray(b, check) then newValue = math.floor(value * 2) elseif isInArray(c, check) then newValue = math.floor(value * 0) elseif isInArray(d, check) then newValue = math.floor(value / 2) elseif isInArray(e, check) then newValue = math.floor(value / 4) elseif isInArray(f, check) then newValue = math.floor(value - value) end if newValue ~= 0 then doCreatureAddHealth(cid, -newValue) doSendAnimatedText(getThingPos(cid), newValue, config.colors[combat] or 215) return false end end return true end function onLogin(cid) registerCreatureEvent(cid, "advantageSystem") return true endBem é isso, obg
Editado Outubro 29 por Flaah