Skip to content

Commit

Permalink
Merge pull request #5619 from ampitere/add_prester_latent_effect_func…
Browse files Browse the repository at this point in the history
…tionality

[LUA] Add Prester latent effect functionality
  • Loading branch information
claywar authored May 8, 2024
2 parents 9874774 + 723ed8a commit 52a09f8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
1 change: 1 addition & 0 deletions scripts/enum/item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6171,6 +6171,7 @@ xi.item =
DORJE = 18594,
KEBBIE = 18596,
CATALYST = 18597,
PRESTER = 18598,
RAM_STAFF = 18612,
SAMUDRA = 18618,
SPHARAI_85 = 18637,
Expand Down
23 changes: 18 additions & 5 deletions scripts/globals/combat/physical_utilities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,11 @@ xi.combat.physical.calculateFTP = function(actor, tpFactor)
local scProp1, scProp2, scProp3 = actor:getWSSkillchainProp()
local dayElement = VanadielDayElement() + 1

local neckFtpBonus = 0
local waistFtpBonus = 0
local headFtpBonus = 0
local handsFtpBonus = 0
local neckFtpBonus = 0
local waistFtpBonus = 0
local headFtpBonus = 0
local handsFtpBonus = 0
local weaponFtpBonus = 0

if actor:getObjType() == xi.objType.PC then
-- Calculate Neck fTP bonus.
Expand Down Expand Up @@ -315,10 +316,22 @@ xi.combat.physical.calculateFTP = function(actor, tpFactor)
handsFtpBonus = 0.06
end
end

-- Calculate Weapon fTP bonus.
local weaponItem = actor:getEquipID(xi.slot.MAIN)

if
weaponItem == xi.item.PRESTER and
(wsElementalProperties[scProp1][xi.element.WIND] == 1 or
wsElementalProperties[scProp2][xi.element.WIND] == 1 or
wsElementalProperties[scProp3][xi.element.WIND] == 1)
then
weaponFtpBonus = 0.1
end
end

-- Add all bonuses and return.
fTP = fTP + neckFtpBonus + waistFtpBonus + headFtpBonus + handsFtpBonus
fTP = fTP + neckFtpBonus + waistFtpBonus + headFtpBonus + handsFtpBonus + weaponFtpBonus

return fTP
end
Expand Down
10 changes: 10 additions & 0 deletions scripts/globals/weaponskills.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,7 @@ xi.weaponskills.handleWSGorgetBelt = function(attacker)

local neck = attacker:getEquipID(xi.slot.NECK)
local belt = attacker:getEquipID(xi.slot.WAIST)
local weapon = attacker:getEquipID(xi.slot.MAIN)
local scProp1, scProp2, scProp3 = attacker:getWSSkillchainProp()

for i, v in ipairs(elementalGorget) do
Expand Down Expand Up @@ -1298,6 +1299,15 @@ xi.weaponskills.handleWSGorgetBelt = function(attacker)
accBonus = accBonus + 10
ftpBonus = ftpBonus + 0.1
end

if
weapon == xi.item.PRESTER and
(xi.magicburst.doesElementMatchWeaponskill(xi.element.WIND, scProp1) or
xi.magicburst.doesElementMatchWeaponskill(xi.element.WIND, scProp2) or
xi.magicburst.doesElementMatchWeaponskill(xi.element.WIND, scProp3))
then -- Prester
ftpBonus = ftpBonus + 0.1
end
end

return ftpBonus, accBonus
Expand Down

0 comments on commit 52a09f8

Please sign in to comment.