Skip to content

Commit

Permalink
Change bind to random duration
Browse files Browse the repository at this point in the history
  • Loading branch information
TracentEden committed Aug 30, 2024
1 parent a940864 commit 519ff4d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/globals/spells/enfeebling_spell.lua
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,13 @@ end
xi.spells.enfeebling.calculateDuration = function(caster, target, spellId, spellEffect, skillType)
local duration = pTable[spellId][7] -- Get base duration.

-- BIND spells have a special random duration the follows a normal distribution with mean=30 and std=12
if spellEffect == xi.effect.BIND then
-- Use the Box-Muller transform to change uniform dist sample to the normal dist sample
local z0 = math.sqrt(-2 * math.log(math.random())) * math.cos(2 * math.pi * math.random())
duration = utils.clamp(math.floor(30 + z0 * 12), 1, duration)
end

-- Additions to base duration.
if
spellEffect == xi.effect.BURN or
Expand Down

0 comments on commit 519ff4d

Please sign in to comment.