Ai é um revscript pra tfs 15x
Só converter para o que precisa.
ps: Antes tarde do que nunca né. rs.
Código abaixo
local DIABLO_STORAGE = 19338
local RAIN_DURATION = 10
local RAIN_INTERVAL = 1000
local RAIN_RADIUS = 6
local RAIN_DROPS = 16
local RAIN_MIN_DMG = -900
local RAIN_MAX_DMG = -600
local function diabloRainTick(casterId, ticksLeft)
if ticksLeft <= 0 then return end
local caster = Player(casterId)
if not caster then return end
local pos = caster:getPosition()
-- Dano + efeito de fogo no tile de cada monstro atingido
local spectators = Game.getSpectators(pos, false, false, RAIN_RADIUS, RAIN_RADIUS, RAIN_RADIUS, RAIN_RADIUS)
for _, target in ipairs(spectators) do
if target:isMonster() then
doTargetCombatHealth(caster, target, COMBAT_PHYSICALDAMAGE, RAIN_MIN_DMG, RAIN_MAX_DMG, CONST_ME_FIREATTACK)
end
end
-- Fireballs voando da borda superior para posições aleatórias no chão
for _ = 1, RAIN_DROPS do
local landX = pos.x + math.random(-RAIN_RADIUS, RAIN_RADIUS)
local landY = pos.y + math.random(-RAIN_RADIUS, RAIN_RADIUS)
local fromPos = Position(landX + math.random(-2, 2), pos.y - RAIN_RADIUS, pos.z)
fromPos:sendDistanceEffect(Position(landX, landY, pos.z), CONST_ANI_FIRE)
end
addEvent(diabloRainTick, RAIN_INTERVAL, casterId, ticksLeft - 1)
end
local spell = Spell("instant")
function spell.onCastSpell(creature, variant)
local caster = creature:getPlayer()
if not caster then return false end
local charges = caster:getStorageValue(DIABLO_STORAGE)
if charges <= 0 then
caster:sendCancelMessage("You have no Diablo Rain charges.")
return false
end
caster:setStorageValue(DIABLO_STORAGE, charges - 1)
local remaining = charges - 1
local msg = remaining > 0
and ("Hellfire rains down! Charges remaining: " .. remaining)
or "Hellfire rains down! No charges remaining."
caster:sendTextMessage(MESSAGE_EVENT_ADVANCE, msg)
local pos = caster:getPosition()
for _ = 1, RAIN_DROPS do
local landX = pos.x + math.random(-RAIN_RADIUS, RAIN_RADIUS)
local landY = pos.y + math.random(-RAIN_RADIUS, RAIN_RADIUS)
local fromPos = Position(landX + math.random(-2, 2), pos.y - RAIN_RADIUS, pos.z)
fromPos:sendDistanceEffect(Position(landX, landY, pos.z), CONST_ANI_FIRE)
end
addEvent(diabloRainTick, RAIN_INTERVAL, caster:getId(), RAIN_DURATION)
return true
end
spell:name("Diablo Rain")
spell:words("diablo rain")
spell:group("support")
spell:id(9212)
spell:level(1)
spell:mana(0)
spell:isPremium(false)
spell:isAggressive(true)
spell:isSelfTarget(true)
spell:needLearn(false)
spell:vocation("sorcerer;true", "druid;true", "paladin;true", "knight;true",
"master sorcerer;true", "elder druid;true", "royal paladin;true", "elite knight;true")
spell:register()
Por
Sh0z, · Postado