From e1d401552a0ab8a44a25b6d211fabc591f7db512 Mon Sep 17 00:00:00 2001 From: Sebastian Nobbelin Date: Sun, 1 Oct 2023 21:30:09 +0200 Subject: [PATCH 1/3] fix: divine grenade multiplier and cd --- .../scripts/spells/attack/divine_grenade.lua | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/data-otservbr-global/scripts/spells/attack/divine_grenade.lua b/data-otservbr-global/scripts/spells/attack/divine_grenade.lua index 44c012484d0..f0e410651ce 100644 --- a/data-otservbr-global/scripts/spells/attack/divine_grenade.lua +++ b/data-otservbr-global/scripts/spells/attack/divine_grenade.lua @@ -5,15 +5,14 @@ combatGrenade:setArea(createCombatArea(AREA_CIRCLE2X2)) function onGetFormulaValues(player, level, maglevel) local min = (level / 5) + (maglevel * 4) local max = (level / 5) + (maglevel * 6) - local multiplier = 1.0 local grade = player:upgradeSpellsWOD("Divine Grenade") - if grade >= WHEEL_GRADE_MAX then - multiplier = 2.0 - elseif grade >= WHEEL_GRADE_UPGRADED then - multiplier = 1.6 - elseif grade >= WHEEL_GRADE_REGULAR then - multiplier = 1.3 + + local multiplier = 1.0 + if grade ~= WHEEL_GRADE_NONE then + local multiplierByGrade = {1.3, 1.6, 2.0} + multiplier = multiplierByGrade[grade] end + min = min * multiplier max = max * multiplier return -min, -max @@ -69,14 +68,8 @@ function spell.onCastSpell(creature, var) return false end - local cooldown = 0 - if grade >= WHEEL_GRADE_MAX then - cooldown = 14 - elseif grade >= WHEEL_GRADE_UPGRADED then - cooldown = 20 - elseif grade >= WHEEL_GRADE_REGULAR then - cooldown = 26 - end + local cooldownByGrade= {26, 20, 14} + local cooldown = cooldownByGrade[grade] var.instantName = "Divine Grenade Cast" if combatCast:execute(creature, var) then From be551f70186550832ca8613f07b4c4b0309c53a6 Mon Sep 17 00:00:00 2001 From: Sebastian Nobbelin Date: Thu, 5 Oct 2023 22:00:35 +0200 Subject: [PATCH 2/3] fix: spell upgrade not added --- src/creatures/players/wheel/player_wheel.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/creatures/players/wheel/player_wheel.cpp b/src/creatures/players/wheel/player_wheel.cpp index dc7d0ee77f6..925a28adefc 100644 --- a/src/creatures/players/wheel/player_wheel.cpp +++ b/src/creatures/players/wheel/player_wheel.cpp @@ -1399,9 +1399,7 @@ void PlayerWheel::loadDedicationAndConvictionPerks() { } void PlayerWheel::addSpellToVector(const std::string &spellName) { - if (std::ranges::find(m_playerBonusData.spells.begin(), m_playerBonusData.spells.end(), spellName) == m_playerBonusData.spells.end()) { - m_playerBonusData.spells.emplace_back(spellName); - } + m_playerBonusData.spells.emplace_back(spellName); } void PlayerWheel::loadRevelationPerks() { From 9e2fd43f7e4bcb4da9c11189a599d8da05f94b5f Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 18 Oct 2023 06:49:31 +0000 Subject: [PATCH 3/3] Lua code format - (Stylua) --- data-otservbr-global/scripts/spells/attack/divine_grenade.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data-otservbr-global/scripts/spells/attack/divine_grenade.lua b/data-otservbr-global/scripts/spells/attack/divine_grenade.lua index f0e410651ce..a2112af4c85 100644 --- a/data-otservbr-global/scripts/spells/attack/divine_grenade.lua +++ b/data-otservbr-global/scripts/spells/attack/divine_grenade.lua @@ -9,7 +9,7 @@ function onGetFormulaValues(player, level, maglevel) local multiplier = 1.0 if grade ~= WHEEL_GRADE_NONE then - local multiplierByGrade = {1.3, 1.6, 2.0} + local multiplierByGrade = { 1.3, 1.6, 2.0 } multiplier = multiplierByGrade[grade] end @@ -68,7 +68,7 @@ function spell.onCastSpell(creature, var) return false end - local cooldownByGrade= {26, 20, 14} + local cooldownByGrade = { 26, 20, 14 } local cooldown = cooldownByGrade[grade] var.instantName = "Divine Grenade Cast"