attacks = {{param = "energy", theFunction = false, offensive = 1, needLevel = 20, self = 0, needMag = 10, manaSpent = 60, exhausted = 1, range = 6, combatType = COMBAT_ENERGYDAMAGE, combatAni = CONST_ME_ENERGYAREA, area = 2,
formula = {maxb = 0.4, maxa = 30, minb = 0.5, mina = 0},
},
{param = "exori", theFunction = false, offensive = 1, needLevel = 40, self = 0, needMag = 5, manaSpent = 145, exhausted = 1, range = 0, combatType = COMBAT_PHYSICALDAMAGE, combatAni = CONST_ME_HITAREA, area = 2,
formula = {maxb = 0.6, maxa = 30, minb = 1.2, mina = 0},
},
{param = "fireball", theFunction = false, offensive = 1, needLevel = 50, self = 0, needMag = 15, manaSpent = 100, exhausted = 1, range = 3, combatType = COMBAT_FIREDAMAGE, combatAni = CONST_ME_FIREAREA, area = 6,
formula = {maxb = 0.6, maxa = 30, minb = 1.2, mina = 0}
},
{param = "mini energy", theFunction = false, offensive = 1, needLevel = 0, self = 0, needMag = 0, manaSpent = 20, exhausted = 1, range = 1, combatType = COMBAT_ENERGYDAMAGE, combatAni = CONST_ME_ENERGYAREA, area = 1,
formula = {maxb = 0.13, maxa = 0, minb = 0.262, mina = 0}
},
{param = "health", theFunction = false, offensive = -1, needLevel = 10, self = 1, needMag = 0, manaSpent = 100, exhausted = 2, range = 0, combatType = COMBAT_HEALING, combatAni = CONST_ME_MAGIC_BLUE, area = 1,
formula = {maxb = 0.4, maxa = 20, minb = 0.7, mina = 0}
},
{param = "paralize", needLevel = 1, needMag = 0, manaSpent = 300, exhausted = 2,
theFunction = function (parameters)
daPet = getPlayerStorageValue(parameters.cid, storages.petUid)
if getCreatureTarget(daPet) ~= 0 then
doAddCondition(getCreatureTarget(parameters.cid), 4)
end
end
},
{param = "speed", needLevel = 10, needMag = 4, manaSpent = 60, exhausted = 2,
theFunction = function (parameters)
doAddCondition(getPlayerStorageValue(parameters.cid, storages.petUid), 11)
end
},
{param = "double fire", needLevel = 1, needMag = 0, manaSpent = 100, exhausted = 2,
theFunction = function (parameters)
local attackCreature = getPlayerStorageValue(parameters.cid, storages.petUid)
if getCreatureTarget(getPlayerStorageValue(parameters.cid, storages.petUid)) ~= 0 then
attackCreature = getCreatureTarget(getPlayerStorageValue(parameters.cid, storages.petUid))
end
local myAttack = formulaAttack(getPlayerLevel(parameters.cid), getPlayerStorageValue(parameters.cid, storages.petMag), 0.7, 0, 1.0, 0)
function doAreaCombatHealthEx(params)
local randoms = {[1] = math.random(-2, 2),
[2] = math.random(-2, 2)
}
local posa = getCreaturePosition(attackCreature)
doAreaCombatHealth(getPlayerStorageValue(parameters.cid, storages.petUid), COMBAT_FIREDAMAGE, {x = posa.x + randoms[1], y = posa.y + randoms[2], z = posa.z}, 1, -params.myAttack.minD, -params.myAttack.maxD, CONST_ME_FIREAREA)
doSendDistanceShoot(getCreaturePosition(getPlayerStorageValue(parameters.cid, storages.petUid)), {x = posa.x + randoms[1], y = posa.y + randoms[2], z = posa.z}, CONST_ANI_FIRE)
end
doAreaCombatHealthEx({cid = parameters.cid, target = getCreaturePosition(attackCreature), myAttack = myAttack})
for i = 1, 7 do
addEvent(doAreaCombatHealthEx, 200*i, {cid = parameters.cid, target = getCreaturePosition(attackCreature), myAttack = myAttack})
end
end
}
}