Não há como amigo, a função addDamageCondition é meio limitada e não existem callbacks para usar com conditions.
Abraços.
Por razurator, 16 de jul. de 2012 em Scripts
Não há como amigo, a função addDamageCondition é meio limitada e não existem callbacks para usar com conditions.
Abraços.
Editado Julho 19 por Oneshot
Não há como amigo, a função addDamageCondition é meio limitada e não existem callbacks para usar com conditions.
Abraços.
Então, mas teria como eu fazer um novo script para essa magia especificando como ela deveria agir?
No caso dizendo a ela quanto de damage, o intervalo entre um e outro e quantos damages.
Isso sim dá para fazer.
local damage = COMBAT_LIFEDRAIN local rounds = 15 local delay = 3 * 1000 local function doCombatCondition(cid, target, type, area, min, max, effect, rounds) if isCreature(target) then doAreaCombatHealth(cid, type, getThingPosition(target), area, min, max, effect) if rounds > 0 then addEvent(doCombatCondition, delay, cid, target, type, area, min, max, effect, (rounds - 1)) end end return true end function onCastSpell(cid, var) local formula_min = getPlayerLevel(cid) local formula_max = getPlayerLevel(cid) * 2.5 + 32 local target = variantToNumber(var) addEvent(doCombatCondition, delay, cid, target, damage, 0, -formula_min, -formula_max, CONST_ME_DRAWBLOOD, rounds) return true end
Tá aí algo que simula mais ou menos uma condição de dano com atraso em segundos e que você pode manipular o dano mínimo e máximo com fórmulas.
Editado Julho 19 por Oneshot
esta pegando bunitinho mas teria como colocar uma distanceEffect para mim
local damage = COMBAT_PHYSICALDAMAGE
local rounds = 15
local delay = 3 * 1000
local function doCombatCondition(cid, target, type, area, min, max, effect, distanceEffect, rounds)
if isCreature(target) then
doAreaCombatHealth(cid, type, getThingPosition(target), area, min, max, effect)
if rounds > 0 then
addEvent(doCombatCondition, delay, cid, target, type, area, min, max, effect, distanceEffect, (rounds - 1))
end
end
return true
end
function onCastSpell(cid, var)
local formula_min = getPlayerLevel(cid) * 0.28
local formula_max = getPlayerLevel(cid) * 0.30
local target = variantToNumber(var)
addEvent(doCombatCondition, delay, cid, target, damage, 0, -formula_min, -formula_max, CONST_ME_HITAREA, CONST_ANI_REDSTAR, rounds)
return true
end
tentei fazer mas acho que fiz cáca psakspaks.
local damage = COMBAT_PHYSICALDAMAGE
local effect = CONST_ME_DRAWBLOOD
local animation = CONST_ANI_REDSTAR
local rounds = 15
local delay = 3 * 1000
local function doCombatCondition(cid, target, type, area, min, max, effect, rounds)
if isCreature(target) then
doAreaCombatHealth((isCreature(cid) and cid or 0), type, getThingPosition(target), area, min, max, effect)
if rounds > 0 then
addEvent(doCombatCondition, delay, cid, target, type, area, min, max, effect, (rounds - 1))
end
end
return true
end
function onCastSpell(cid, var)
local formula_min = getPlayerLevel(cid)
local formula_max = getPlayerLevel(cid) * 2.5 + 32
local target = variantToNumber(var)
if getDistanceBetween(getThingPosition(target), getThingPosition(cid)) < 4 then
doSendDistanceShoot(getThingPosition(cid), getThingPosition(target), animation)
end
addEvent(doCombatCondition, delay, cid, target, damage, 0, -formula_min, -formula_max, CONST_ME_DRAWBLOOD, rounds)
return true
end
Editado Julho 19 por Oneshot
vlw cara!
Só tenho mais uma duvida: Eu vou ter como dar exana kor (dispel) nisso ou terei que fazer um script diferente para ela?
Não sei muito bem o quê a exana kor faz, mas se você fizer uma pequena modificação no script acima:
local damage = COMBAT_PHYSICALDAMAGE
local effect = CONST_ME_DRAWBLOOD
local animation = CONST_ANI_REDSTAR
local rounds = 15
local delay = 3 * 1000
local condition = createConditionObject(CONDITION_BLEEDING)
local function doCombatCondition(cid, target, type, area, min, max, effect, rounds)
if isCreature(target) then
if getCreatureCondition(target, CONDITION_BLEEDING) then
doAreaCombatHealth((isCreature(cid) and cid or 0), type, getThingPosition(target), area, min, max, effect)
if rounds > 0 then
addEvent(doCombatCondition, delay, cid, target, type, area, min, max, effect, (rounds - 1))
end
end
end
return true
end
function onCastSpell(cid, var)
local formula_min = getPlayerLevel(cid)
local formula_max = getPlayerLevel(cid) * 2.5 + 32
local target = variantToNumber(var)
if getDistanceBetween(getThingPosition(target), getThingPosition(cid)) < 4 then
doSendDistanceShoot(getThingPosition(cid), getThingPosition(target), animation)
end
doAddCondition(target, condition)
addEvent(doCombatCondition, delay, cid, target, damage, 0, -formula_min, -formula_max, CONST_ME_DRAWBLOOD, rounds)
return true
end
Esse script acima só dá o dano periódico se o alvo tem a condição Bleeding, caso contrário nada acontece. Caso a tal exana kor seja uma magia de dispel para a condição Bleeding então se encaixa perfeitamente.
Editado Julho 19 por Oneshot
Exatamente cara, exana kor da dispel em condition bleeding se for isso mesmo então minha nova classe está pronta graças a vosso conhecimento.
Muito obrigado, duvida sanada.
info
Grupo: Conde
Registrado: 17/07/11
Posts: 705
Reputação: +108

Tópico movido para a devida área.
info
Grupo: Campones
Registrado: 17/12/07
Posts: 43
Reputação: 0
Olá venho tentando alterar a magia de BLEED para que ela não desfira sempre o mesmo dano mas sim um dano de acordo com o level e o skill.
Por favor, como faço para colocar esse damage no lugar de [-70]
Agradeço deis de já a quem me ajudar.
Dou REP+ se me ajudarem e explicarem como faz
Editado Julho 19 por preier