local combat_fire = createCombatObject()
setCombatParam(combat_fire, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat_fire, COMBAT_PARAM_EFFECT, CONST_ME_FIREATTACK)
setCombatFormula(combat_fire, COMBAT_FORMULA_LEVELMAGIC, -5.0, -500, -5.0, -500)
local area1 = createCombatArea( { {1, 1, 1}, {1, 3, 1}, {1, 1, 1} } )
setCombatArea(combat_fire, area1)
local combat_ice = createCombatObject()
setCombatParam(combat_ice, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat_ice, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK)
setCombatFormula(combat_ice, COMBAT_FORMULA_LEVELMAGIC, -5.0, -500, -5.0, -500)
local area2 = createCombatArea( { {1, 1, 1}, {1, 3, 1}, {1, 1, 1} } )
setCombatArea(combat_ice, area2)
local combat_energy = createCombatObject()
setCombatParam(combat_energy, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat_energy, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatFormula(combat_energy, COMBAT_FORMULA_LEVELMAGIC, -5.0, -500, -5.0, -500)
local area3 = createCombatArea( { {1, 1, 1}, {1, 3, 1}, {1, 1, 1} } )
setCombatArea(combat_energy, area3)
local combat_death = createCombatObject()
setCombatParam(combat_death, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat_death, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatFormula(combat_death, COMBAT_FORMULA_LEVELMAGIC, -5.0, -500, -5.0, -500)
local area4 = createCombatArea( { {1, 1, 1}, {1, 3, 1}, {1, 1, 1} } )
setCombatArea(combat_death, area4)
local combat_earth = createCombatObject()
setCombatParam(combat_earth, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
setCombatParam(combat_earth, COMBAT_PARAM_EFFECT, CONST_ME_SMALLPLANTS)
setCombatFormula(combat_earth, COMBAT_FORMULA_LEVELMAGIC, -5.0, -500, -5.0, -500)
local area5 = createCombatArea( { {1, 1, 1}, {1, 3, 1}, {1, 1, 1} } )
setCombatArea(combat_earth, area5)
local combatAll = {combat_fire,combat_ice,combat_energy,combat_death,combat_earth}
function onUseWeapon(cid, var)
local combatUse = combatAll[math.random(1,#combatAll)]
doCombat(cid, combatUse, var)
return true
end