• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ Arrow Rain

jajo1991

New Member
Joined
Sep 30, 2017
Messages
11
Reaction score
0
Could anyone help me to add to script that function
local combat1 = createCombatObject()
function x(cid, level, maglevel)
min = -(level * 1.1 + maglevel * 1.5) * 5.5
max = -(level * 1.1 + maglevel * 1.6) * 5.5
return min, max
local config = {
lvlReq = 1,
cooldown = 2000,
combatType = COMBAT_PHYSICALDAMAGE,
magicEffect = CONST_ME_HITAREA,
distEffect = 5,
dmg = {min = 100, max = 200},
rounds = 10, -- Amount of rounds
delay = 50, -- Delay between rounds
density = 10, -- How dense the area of effect will be (1 = full area)
}

local area = {
{1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 3, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1}
}
local combat = Combat()
combat:setArea(createCombatArea(area))

function onTargetTile(creature, position)
local fromPos = Position(position.x - 7, position.y - 7, position.z)
if math.random(config.density) == 1 then
fromPos:sendDistanceEffect(position, config.distEffect)
addEvent(function()
local player = Player(creature:getId())
if not player then
return
end
doAreaCombat(player, config.combatType, position, position, -config.dmg.min, -config.dmg.max, config.magicEffect)
end, 400)
end
end
combat:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile")

local spell = Spell(SPELL_INSTANT)
function spell.onCastSpell(creature, variant)
for i = 1, config.rounds do
addEvent(function()
local player = Player(creature:getId())
if not player then
return
end
combat:execute(player, variant)
end, config.delay * (i-1))
end
return true
end

spell:name("Kunai Rain")
spell:words("Kunai Rain")
spell:id(51)
spell:group("attack")
spell:cooldown(config.cooldown)
spell:groupCooldown(config.cooldown)
spell:isAggressive(true)
spell:needTarget(false)
spell:level(config.lvlReq)
spell:needLearn(true)
spell:vocation("TenTen")
spell:register()
 
Back
Top