Tornado cut (wish that should be simple)

clario

OTS based on Heroes III Might and Magic
Joined
Feb 4, 2018
Messages
98
Reaction score
5
SO , hello there and im sorry for the trobule at start , im using tsf 0.4 - 8.6 client and i got that script :

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, CONST_ME_POFF)

local area = createCombatArea(AREA_CIRCLE1X2)
setCombatArea(combat1, area)

function onGetFormulaValues(cid, level, skill, attack, factor)
local skillTotal, levelTotal = skill + attack, level / 5
return -(skillTotal * 0.5 + levelTotal), -(skillTotal * 1.5 + levelTotal)
end

setCombatCallback(combat1, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_POFF)

local area = createCombatArea(AREA_CIRCLE1X2)
setCombatArea(combat2, area)

function spellCallback1(param)
if param.count > 0 or math.random(0, 1) == 1 then
doSendMagicEffect(param.pos, CONST_ME_POFF)
doAreaCombatHealth(param.cid, COMBAT_POFF, param.pos, 0, -20, -20, CONST_ME_BLOCKHIT)
end

if(param.count < 5) then
param.count = param.count + 1
addEvent(spellCallback, math.random(1000, 4000), param)
end
end

function onTargetTile(cid, pos)
local param = {}
param.cid = cid
param.pos = pos
param.count = 0
spellCallback(param)
end

setCombatCallback(combat2, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
return doCombat(cid, combat2, var)
end


But i want to make "wind=POFF" squares after basic dmg (that deals 20 dmg per 1 attack)
so there is a gif whit this spell :


anyway the first poff dont deal dmg....


Really thanks for help (im curious how to do that anyway :D)


GUYS I ALMOST FIXED IT ====1 more! !!

I need a help whit dmg that spell deal because it wont deal dmg :

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_POFF)


local area = createCombatArea(AREA_CIRCLE1X2)
setCombatArea(combat, area)

function onGetFormulaValues(cid, level, skill, attack, factor)
local skillTotal, levelTotal = skill + attack, level / 5
return -(skillTotal * 0.5 + levelTotal), -(skillTotal * 1.5 + levelTotal)
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_POFF)

local area = createCombatArea(AREA_CIRCLE1X2)
setCombatArea(combat2, area)

function spellCallback2(param)
if param.count > 0 or math.random(0, 1) == 1 then
doSendMagicEffect(param.pos, CONST_ME_BLOCKHIT)
doAreaCombatHealth(param.cid, COMBAT_POFF, param.pos, 0, -50, -50, CONST_ME_BLOCKHIT)
end

if(param.count < 5) then
param.count = param.count + 1
addEvent(spellCallback2, math.random(1000, 4000), param)
end
end

function onTargetTile(cid, pos)
local param = {}
param.cid = cid
param.pos = pos
param.count = 0
spellCallback2(param)
end

setCombatCallback(combat2, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
return doCombat(cid, combat2, var)
end
 
Last edited:

Ascuas Funkeln

Rakkedo Game
Joined
Apr 14, 2013
Messages
129
Reaction score
58
Location
Poland
U can use one "onCast" in file,
delete first one and change last to
Code:
function onCastSpell(cid, var)
return doCombat(cid, combat2, var) and doCombat(cid, combat, var)
end
 
Top