mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-05-24 12:04:28 +02:00
22 lines
803 B
Lua
22 lines
803 B
Lua
local combat = Combat()
|
|
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
|
|
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
|
|
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
|
|
combat:setParameter(COMBAT_PARAM_BLOCKSHIELD, false)
|
|
combat:setParameter(COMBAT_PARAM_USECHARGES, true)
|
|
combat:setArea(createCombatArea(AREA_SQUARE1X1))
|
|
|
|
function onGetFormulaValues(player, skill, attack, fightMode)
|
|
local base = 80
|
|
local variation = 20
|
|
local formula = 3 * player:getMagicLevel() + (2 * player:getLevel())
|
|
local damage = formula * base / 100
|
|
damage = damage * attack / 25
|
|
return -damage - variation, -damage + variation
|
|
end
|
|
|
|
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
|
|
|
|
function onCastSpell(creature, variant)
|
|
return combat:execute(creature, variant)
|
|
end |