Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: spell upgrade in wheel of destiny #1681

Merged
merged 7 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions data-otservbr-global/scripts/spells/attack/divine_grenade.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions src/creatures/players/wheel/player_wheel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1410,9 +1410,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() {
Expand Down
Loading