2016-01-16 01:26:33 -05:00
-----------------------------------
2021-04-01 15:10:15 -04:00
-- xi.effect.BOOST
2016-01-16 01:26:33 -05:00
-----------------------------------
2024-08-24 21:26:29 -04:00
---@type TEffect
2022-10-06 17:22:04 +03:00
local effectObject = { }
2016-01-16 01:26:33 -05:00
2022-10-06 17:22:04 +03:00
effectObject.onEffectGain = function ( target , effect )
2025-10-04 19:47:33 -06:00
-- There are at least two forms of boost
-- Normal boost (attp)
-- Fantod boost (base weapon damage)
-- subPower of 1 == Fantod base damage boost
if effect : getSubPower ( ) == 1 and target : isMob ( ) then -- TODO: what happens if a player steals this boost? It has been observed that Yovra boost does nothing on retail but unknown if that is a bug or not.
local baseDamage = target : getWeaponDmg ( )
local power = math.max ( 0 , ( baseDamage * effect : getPower ( ) / 100 ) - baseDamage )
-- if effect power is 400 (Fantod), add enough damage to quadruple it.
-- 100 * 4.0 = 400, but we need to subtract baseDamage because that is inherent to the mob
-- TODO: if the mob already has xi.mod.MAIN_DMG_RATING from another buff, this could compound
-- Those buffs are extremely rare (only Fantod?) and we may need another accessor to get the true base dmg without mods/mobmods
effect : addMod ( xi.mod . MAIN_DMG_RATING , power )
else
effect : addMod ( xi.mod . ATTP , effect : getPower ( ) )
end
2018-08-07 19:36:44 -04:00
end
2016-01-16 01:26:33 -05:00
2022-10-06 17:22:04 +03:00
effectObject.onEffectTick = function ( target , effect )
2018-08-07 19:36:44 -04:00
end
2016-01-16 01:26:33 -05:00
2022-10-06 17:22:04 +03:00
effectObject.onEffectLose = function ( target , effect )
2020-03-19 18:41:42 -07:00
end
2021-01-07 03:22:42 -05:00
2022-10-06 17:22:04 +03:00
return effectObject