local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 100)
function onGetFormulaValues(cid, level, maglevel)
local min = ((level/5)+(maglevel*6))
local max = ((level/5)+(maglevel*12))
return -min, -max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
area = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 2, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}
local area1 = createCombatArea(area)
setCombatArea(combat, area1)
function onTargetTitle(cid, pos)
local topItem = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = STACKPOS_TOP_CREATURE})
if isCreature(topItem.uid) then
doChangeSpeed(topItem.uid, -getCreatureSpeed(topItem.uid))
setPlayerStorageValue(topItem.uid, 777, 1)
addEvent(setPlayerStorageValue, 5000, topItem.uid, 777, 0)
addEvent(doChangeSpeed, 5000, topItem.uid, getCreatureBaseSpeed(topItem.uid))
end
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTitle")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end