From 8de51cb8ea7e73b9be49999903f82881f5f692ea Mon Sep 17 00:00:00 2001 From: ErikasKontenis Date: Mon, 12 Oct 2020 22:30:45 +0300 Subject: [PATCH] introduce poison wave similar to energy wave --- data/spells/scripts/spells/poison wave.lua | 21 +++++++++++++++++++++ data/spells/spells.xml | 4 ++++ 2 files changed, 25 insertions(+) create mode 100644 data/spells/scripts/spells/poison wave.lua diff --git a/data/spells/scripts/spells/poison wave.lua b/data/spells/scripts/spells/poison wave.lua new file mode 100644 index 0000000..b2893d5 --- /dev/null +++ b/data/spells/scripts/spells/poison wave.lua @@ -0,0 +1,21 @@ +local combat = Combat() +combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE) +combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GREEN_RINGS) +combat:setArea(createCombatArea(AREA_SQUAREWAVE5)) + +function onGetFormulaValues(player, level, maglevel) + local base = 150 + local variation = 50 + + local formula = 3 * maglevel + (2 * level) + + local min = (formula * (base - variation)) / 100 + local max = (formula * (base + variation)) / 100 + return -min, -max +end + +combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") + +function onCastSpell(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 94f0d4b..699a351 100644 --- a/data/spells/spells.xml +++ b/data/spells/spells.xml @@ -45,6 +45,10 @@ + + + +