local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE)
combat:setArea(createCombatArea({
{0, 1, 1, 1, 0},
{1, 1, 1, 1, 1},
{1, 1, 3, 1, 1},
{1, 1, 1, 1, 1},
{0, 1, 1, 1, 0},
}))
function spellCallback(param)
local tile = Tile(Position(param.pos))
local damage = ((tile:getTopCreature():getMaxHealth())*60)/100
if tile then
if tile:getTopCreature() and tile:getTopCreature():isPlayer() then
doTargetCombatHealth(0, tile:getTopCreature(), COMBAT_DROWNDAMAGE, -damage, -damage, CONST_ME_NONE)
end
end
end
function onTargetTile(cid, pos)
local param = {}
param.cid = cid
param.pos = pos
param.count = 0
spellCallback(param)
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
function onCastSpell(creature, var)
return combat:execute(creature, var)
end