From 02450e88409e0920e834b68bd2180df1e97fb107 Mon Sep 17 00:00:00 2001 From: ErikasKontenis Date: Fri, 7 May 2021 22:35:24 +0300 Subject: [PATCH] fix berserker of 7.x formula and lower knight challenge and berserker mana consumption --- data/spells/scripts/spells/berserk.lua | 19 +++++++++---------- data/spells/spells.xml | 4 ++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/data/spells/scripts/spells/berserk.lua b/data/spells/scripts/spells/berserk.lua index ebb0aec..67e46ec 100644 --- a/data/spells/scripts/spells/berserk.lua +++ b/data/spells/scripts/spells/berserk.lua @@ -1,22 +1,21 @@ 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) +function onGetFormulaValues(player, level, maglevel) 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 + + local formula = 4 * level + + local min = (formula * (base - variation)) / 100 + local max = (formula * (base + variation)) / 100 + return -min, -max end -combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") +combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") function onCastSpell(creature, variant) - return combat:execute(creature, variant) + return combat:execute(creature, variant) end \ No newline at end of file diff --git a/data/spells/spells.xml b/data/spells/spells.xml index 048ec47..71c9945 100644 --- a/data/spells/spells.xml +++ b/data/spells/spells.xml @@ -56,10 +56,10 @@ - + - +