From 6ecb3c48d0d3db7906c9e176e0aeb6129debd217 Mon Sep 17 00:00:00 2001 From: WinterSolstice8 <60417494+wintersolstice8@users.noreply.github.com> Date: Wed, 22 Apr 2026 07:55:37 -0600 Subject: [PATCH] [lua] [module] Implement old TP gain as module --- modules/soa/lua/tp_gain.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 modules/soa/lua/tp_gain.lua diff --git a/modules/soa/lua/tp_gain.lua b/modules/soa/lua/tp_gain.lua new file mode 100644 index 00000000000..d5fa1780e0a --- /dev/null +++ b/modules/soa/lua/tp_gain.lua @@ -0,0 +1,30 @@ +----------------------------------- +-- Module: Job Adjustments (Seekers of Adoulin era) +-- Desc: Revert to original TP gain formula shared for mobs and players +-- See: https://wiki.ffo.jp/html/308.html +----------------------------------- +require('modules/module_utils') +----------------------------------- +local m = Module:new('soa_tp_gain') + +-- all entities will use the this formula +-- gainee is unused, in the normal code we need to pull objtype but not here +m:addOverride('xi.combat.tp.calculateTPReturn', function(gainee, delay) + local tpReturn = 0 + + if delay > 530 then + tpReturn = 145 + (delay - 530) * 35 / 470 + elseif delay > 480 then + tpReturn = 130 + (delay - 480) * 15 / 30 + elseif delay > 450 then + tpReturn = 115 + (delay - 450) * 15 / 30 + elseif delay > 180 then + tpReturn = 50 + (delay - 180) * 65 / 270 + else + tpReturn = 50 + (delay - 180) * 15 / 180 + end + + return math.floor(tpReturn) +end) + +return m