Skip to content

Commit

Permalink
Merge pull request #4559 from MowFord/augments_sql
Browse files Browse the repository at this point in the history
Add missing augment modifiers from mini-expansions
  • Loading branch information
zach2good authored Oct 22, 2023
2 parents e8593c4 + f053b35 commit 85f1c2e
Show file tree
Hide file tree
Showing 16 changed files with 43 additions and 19 deletions.
1 change: 1 addition & 0 deletions scripts/actions/abilities/call_beast.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ abilityObject.onAbilityCheck = function(player, target, ability)
return xi.msg.basic.CANT_BE_USED_IN_AREA, 0
end

ability:setRecast(math.max(0, ability:getRecast() - player:getMod(xi.mod.CALL_BEAST_DELAY)))
return 0, 0
end

Expand Down
2 changes: 2 additions & 0 deletions scripts/actions/abilities/dark_shot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ abilityObject.onAbilityCheck = function(player, target, ability)
player:hasItem(xi.item.DARK_CARD, 0) or
player:hasItem(xi.item.TRUMP_CARD, 0)
then
ability:setRecast(math.max(0, ability:getRecast() - player:getMod(xi.mod.QUICK_DRAW_RECAST)))
return 0, 0
else
return 71, 0
Expand Down Expand Up @@ -83,6 +84,7 @@ abilityObject.onUseAbility = function(player, target, ability)

local _ = player:delItem(xi.item.DARK_CARD, 1) or player:delItem(xi.item.TRUMP_CARD, 1)
target:updateClaim(player)

return dispelledEffect
end

Expand Down
1 change: 1 addition & 0 deletions scripts/actions/abilities/earth_shot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ abilityObject.onAbilityCheck = function(player, target, ability)
player:hasItem(xi.item.EARTH_CARD, 0) or
player:hasItem(xi.item.TRUMP_CARD, 0)
then
ability:setRecast(math.max(0, ability:getRecast() - player:getMod(xi.mod.QUICK_DRAW_RECAST)))
return 0, 0
else
return 71, 0
Expand Down
2 changes: 1 addition & 1 deletion scripts/actions/abilities/fire_shot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ abilityObject.onAbilityCheck = function(player, target, ability)
player:hasItem(xi.item.FIRE_CARD, 0) or
player:hasItem(xi.item.TRUMP_CARD, 0)
then
ability:setRecast(math.max(0, ability:getRecast() - player:getMod(xi.mod.QUICK_DRAW_RECAST)))
return 0, 0
else
return 71, 0
Expand Down Expand Up @@ -74,7 +75,6 @@ abilityObject.onUseAbility = function(player, target, ability, action)
end

local _ = player:delItem(xi.item.FIRE_CARD, 1) or player:delItem(xi.item.TRUMP_CARD, 1)

target:updateClaim(player)

return dmg
Expand Down
6 changes: 4 additions & 2 deletions scripts/actions/abilities/healing_waltz.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
local abilityObject = {}

abilityObject.onAbilityCheck = function(player, target, ability)
local waltzCost = 200 - player:getMod(xi.mod.WALTZ_COST) * 10
if target:getHP() == 0 then
return xi.msg.basic.CANNOT_ON_THAT_TARG, 0
elseif player:hasStatusEffect(xi.effect.SABER_DANCE) then
return xi.msg.basic.UNABLE_TO_USE_JA2, 0
elseif player:hasStatusEffect(xi.effect.TRANCE) then
return 0, 0
elseif player:getTP() < 200 then
elseif player:getTP() < waltzCost then
return xi.msg.basic.NOT_ENOUGH_TP, 0
else
--[[ Apply "Waltz Ability Delay" reduction
Expand All @@ -39,9 +40,10 @@ abilityObject.onAbilityCheck = function(player, target, ability)
end

abilityObject.onUseAbility = function(player, target, ability)
local waltzCost = 200 - player:getMod(xi.mod.WALTZ_COST) * 10
-- Only remove TP if the player doesn't have Trance.
if not player:hasStatusEffect(xi.effect.TRANCE) then
player:delTP(200)
player:delTP(waltzCost)
end

local effect = target:healingWaltz()
Expand Down
2 changes: 1 addition & 1 deletion scripts/actions/abilities/ice_shot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ abilityObject.onAbilityCheck = function(player, target, ability)
player:hasItem(xi.item.ICE_CARD, 0) or
player:hasItem(xi.item.TRUMP_CARD, 0)
then
ability:setRecast(math.max(0, ability:getRecast() - player:getMod(xi.mod.QUICK_DRAW_RECAST)))
return 0, 0
else
return 71, 0
Expand Down Expand Up @@ -79,7 +80,6 @@ abilityObject.onUseAbility = function(player, target, ability, action)
end

local _ = player:delItem(xi.item.ICE_CARD, 1) or player:delItem(xi.item.TRUMP_CARD, 1)

target:updateClaim(player)

return dmg
Expand Down
1 change: 1 addition & 0 deletions scripts/actions/abilities/light_shot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ abilityObject.onAbilityCheck = function(player, target, ability)
player:hasItem(xi.item.LIGHT_CARD, 0) or
player:hasItem(xi.item.TRUMP_CARD, 0)
then
ability:setRecast(math.max(0, ability:getRecast() - player:getMod(xi.mod.QUICK_DRAW_RECAST)))
return 0, 0
else
return 71, 0
Expand Down
1 change: 1 addition & 0 deletions scripts/actions/abilities/thunder_shot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ abilityObject.onAbilityCheck = function(player, target, ability)
player:hasItem(xi.item.THUNDER_CARD, 0) or
player:hasItem(xi.item.TRUMP_CARD, 0)
then
ability:setRecast(math.max(0, ability:getRecast() - player:getMod(xi.mod.QUICK_DRAW_RECAST)))
return 0, 0
else
return 71, 0
Expand Down
1 change: 1 addition & 0 deletions scripts/actions/abilities/water_shot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ abilityObject.onAbilityCheck = function(player, target, ability)
player:hasItem(xi.item.WATER_CARD, 0) or
player:hasItem(xi.item.TRUMP_CARD, 0)
then
ability:setRecast(math.max(0, ability:getRecast() - player:getMod(xi.mod.QUICK_DRAW_RECAST)))
return 0, 0
else
return 71, 0
Expand Down
1 change: 1 addition & 0 deletions scripts/actions/abilities/wind_shot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ abilityObject.onAbilityCheck = function(player, target, ability)
player:hasItem(xi.item.WIND_CARD, 0) or
player:hasItem(xi.item.TRUMP_CARD, 0)
then
ability:setRecast(math.max(0, ability:getRecast() - player:getMod(xi.mod.QUICK_DRAW_RECAST)))
return 0, 0
else
return 71, 0
Expand Down
7 changes: 5 additions & 2 deletions scripts/enum/mod.lua
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,10 @@ xi.mod =
STEP_ACCURACY = 403, -- Accuracy bonus for steps
WALTZ_DELAY = 497, -- Waltz Ability Delay modifier (-1 mod is -1 second)
SAMBA_PDURATION = 498, -- Samba percent duration bonus
WALTZ_COST = 139, -- Reduce Waltz cost by 5tp (50 post 1000tp scale)
WIDESCAN = 340,
BARRAGE_ACC = 420,
BARRAGE_COUNT = 138, -- Increases Barrage shots by 1
ENSPELL = 341,
SPIKES = 342,
ENSPELL_DMG = 343,
Expand Down Expand Up @@ -853,6 +855,7 @@ xi.mod =
COVER_DURATION = 967, -- Increases Cover Duration
WYVERN_SUBJOB_TRAITS = 974, -- Adds subjob traits to wyvern
GARDENING_WILT_BONUS = 975, -- Increases the number of Vanadays a plant can survive before it wilts
CALL_BEAST_DELAY = 572, -- Lowers Call Beast recast

WYVERN_BREATH_MACC = 986,
REGEN_BONUS = 989,
Expand Down Expand Up @@ -893,15 +896,15 @@ xi.mod =
GEOMANCY_MP_NO_DEPLETE = 1037, -- Percent chance for Geomancy to cost 0 MP (GEO AF3 Sets)

-- Job Point Gifts
SIC_READY_RECAST = 1052, -- TODO: SIC/Ready recast reduction (seconds)
SIC_READY_RECAST = 1052, -- SIC/Ready recast reduction (seconds)
TRUE_SHOT_EFFECT = 1053, -- TODO: True Shot Ranged Damage increase (percent)
DEAD_AIM_EFFECT = 1054, -- TODO: Dead Aim Critical Damage increase (percent)
THIRD_EYE_BONUS = 1055, -- TODO: Bonus Third Eye Evasions (count)
WYVERN_ATTRIBUTE_DA = 1056, -- Adds an amount of Double Attack to Dragoon each time Wyverns Attributes Increase (percent)
DRAGOON_BREATH_RECAST = 1057, -- Restoring/Smithing Breath Recast Reduction (seconds)
BLUE_JOB_TRAIT_BONUS = 1058, -- TODO: Increases job traits gained from equipped blue magic (percent)
BLUE_MAGIC_EFFECT = 1059, -- TODO: Bonus to Attribute Value of spell (percent)
QUICK_DRAW_RECAST = 1060, -- TODO: Quick Draw Charge Reduction (seconds)
QUICK_DRAW_RECAST = 1060, -- Quick Draw Charge Reduction (seconds)

DIG_BYPASS_FATIGUE = 1074, -- Chocobo digging modifier found in "Blue Race Silks". Modifier works as a direct percent.
BREATH_DMG_DEALT = 1075, -- Breath damage dealt
Expand Down
8 changes: 5 additions & 3 deletions scripts/globals/job_utils/dancer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ end

xi.job_utils.dancer.checkWaltzAbility = function(player, target, ability)
local waltzInfo = waltzAbilities[ability:getID()]
local waltzCost = waltzInfo[1] - player:getMod(xi.mod.WALTZ_COST) * 10

if target:getHP() == 0 then
return xi.msg.basic.CANNOT_ON_THAT_TARG, 0
Expand All @@ -198,7 +199,7 @@ xi.job_utils.dancer.checkWaltzAbility = function(player, target, ability)
ability:setRecast(math.min(ability:getRecast(), 6))

return 0, 0
elseif player:getTP() < waltzInfo[1] then
elseif player:getTP() < waltzCost then
return xi.msg.basic.NOT_ENOUGH_TP, 0
else
local newRecast = ability:getRecast()
Expand Down Expand Up @@ -467,6 +468,7 @@ end
xi.job_utils.dancer.useWaltzAbility = function(player, target, ability, action)
local abilityId = ability:getID()
local waltzInfo = waltzAbilities[abilityId]
local waltzCost = waltzInfo[1] - player:getMod(xi.mod.WALTZ_COST) * 10
local statMultiplier = waltzInfo[2]
local amtCured = 0

Expand All @@ -477,10 +479,10 @@ xi.job_utils.dancer.useWaltzAbility = function(player, target, ability, action)
abilityId == xi.jobAbility.DIVINE_WALTZ_II
then
if player:getID() == target:getID() then
player:delTP(waltzInfo[1])
player:delTP(waltzCost)
end
else
player:delTP(waltzInfo[1])
player:delTP(waltzCost)
end
end

Expand Down
16 changes: 8 additions & 8 deletions sql/augments.sql
Original file line number Diff line number Diff line change
Expand Up @@ -404,10 +404,10 @@ INSERT INTO `augments` VALUES (320,0,357,1,0,0); -- Blood Pact ability delay -1
INSERT INTO `augments` VALUES (321,0,346,1,0,0); -- Avatar perpetuation cost -1
INSERT INTO `augments` VALUES (322,0,455,1,0,0); -- Song spellcasting time -1%
INSERT INTO `augments` VALUES (323,0,519,1,0,0); -- Cure spellcasting time -1%
INSERT INTO `augments` VALUES (324,0,0,0,0,0); -- Call Beast ability delay -1
INSERT INTO `augments` VALUES (325,0,0,0,0,0); -- Quick Draw ability delay -1
INSERT INTO `augments` VALUES (324,0,572,1,0,0); -- Call Beast ability delay -1
INSERT INTO `augments` VALUES (325,0,1060,1,0,0); -- Quick Draw ability delay -1
INSERT INTO `augments` VALUES (326,0,48,1,0,0); -- Weapon Skill Acc.+1
INSERT INTO `augments` VALUES (327,0,0,0,0,0); -- Weapon skill damage+1% (unsure if this is all hits damage or first hit damage, leaving blank until determined)
INSERT INTO `augments` VALUES (327,0,840,1,0,0); -- Weapon skill damage+1% "However, some sources apply to all swings of the weapon skill (like Magian Trials Weapon Skill Damage +n% weapons)" (i.e. this indicates the augment is for all hits)
INSERT INTO `augments` VALUES (328,0,421,1,0,0); -- Crit. hit damage+1%
INSERT INTO `augments` VALUES (329,0,374,1,0,0); -- Cure potency+1%
INSERT INTO `augments` VALUES (330,0,491,1,0,0); -- Waltz potency+1%
Expand All @@ -416,13 +416,13 @@ INSERT INTO `augments` VALUES (332,100,175,1,0,0); -- Sklchn.dmg.+1%
INSERT INTO `augments` VALUES (333,0,944,1,0,0); -- Conserve TP+1
INSERT INTO `augments` VALUES (334,0,487,1,0,0); -- Magic burst dmg.+1%
INSERT INTO `augments` VALUES (335,0,563,1,0,0); -- Mag. crit. hit dmg.+1%
INSERT INTO `augments` VALUES (336,0,0,0,0,0); -- Sic and Ready ability delay -1
INSERT INTO `augments` VALUES (336,0,1052,1,0,0); -- Sic and Ready ability delay -1
INSERT INTO `augments` VALUES (337,0,833,1,0,0); -- Song recast delay -1
INSERT INTO `augments` VALUES (338,0,0,0,0,0); -- Barrage+1 (additional shots,NOT acc)
INSERT INTO `augments` VALUES (338,0,138,1,0,0); -- Barrage+1 (additional shots,NOT acc)
INSERT INTO `augments` VALUES (339,5,540,1,0,0); -- Elemental Siphon+5 (value*5) Use Multiplier field.
INSERT INTO `augments` VALUES (340,0,1076,1,0,0); -- Phantom Roll ability recast -1
INSERT INTO `augments` VALUES (340,0,1076,1,0,0); -- Phantom Roll ability delay -1
INSERT INTO `augments` VALUES (341,0,854,1,0,0); -- Repair potency+1%
INSERT INTO `augments` VALUES (342,0,0,0,0,0); -- Waltz TP cost -1
INSERT INTO `augments` VALUES (342,0,139,1,0,0); -- Waltz TP cost -1
INSERT INTO `augments` VALUES (343,0,315,1,0,0); -- "Drain" and "Aspir" Potency +1

-- 344 to 346 currently unused. Leave at zero. Edit+move or remove this note as new augments get discovered.
Expand Down Expand Up @@ -1114,7 +1114,7 @@ INSERT INTO `augments` VALUES (909,0,0,0,0,0);
INSERT INTO `augments` VALUES (910,0,0,0,0,0);
INSERT INTO `augments` VALUES (911,0,0,0,0,0);
INSERT INTO `augments` VALUES (912,0,0,0,0,0);
INSERT INTO `augments` VALUES (913,0,0,0,0,0);
INSERT INTO `augments` VALUES (913,0,169,6,0,0); -- Movement Speed
INSERT INTO `augments` VALUES (914,0,0,0,0,0);
INSERT INTO `augments` VALUES (915,0,0,0,0,0);
INSERT INTO `augments` VALUES (916,0,0,0,0,0);
Expand Down
4 changes: 4 additions & 0 deletions src/map/entities/charentity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,10 @@ void CCharEntity::OnAbility(CAbilityState& state, action_t& action)
action.recast -= 10; // remove 10 seconds
}
}
else if (PAbility->getID() == ABILITY_READY || PAbility->getID() == ABILITY_SIC)
{
action.recast = static_cast<uint16>(std::max<int16>(0, action.recast - getMod(Mod::SIC_READY_RECAST)));
}

action.id = this->id;
action.actiontype = PAbility->getActionType();
Expand Down
7 changes: 5 additions & 2 deletions src/map/modifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ enum class Mod
CHARM_CHANCE = 391, // extra chance to charm (light+apollo staff ect)
FERAL_HOWL_DURATION = 503, // +20% duration per merit when wearing augmented Monster Jackcoat +2
JUG_LEVEL_RANGE = 564, // Decreases the level range of spawned jug pets. Maxes out at 2.
SIC_READY_RECAST = 1052, // TODO: SIC/Ready recast reduction (seconds)
CALL_BEAST_DELAY = 572, // Lowers Call Beast recast
SIC_READY_RECAST = 1052, // SIC/Ready recast reduction (seconds)

// Bard
MINNE_EFFECT = 433, //
Expand Down Expand Up @@ -483,6 +484,7 @@ enum class Mod
RAPID_SHOT = 359, // Percent chance to proc rapid shot
WIDESCAN = 340, //
BARRAGE_ACC = 420, // Barrage accuracy
BARRAGE_COUNT = 138, // Increases Barrage shots by 1
DOUBLE_SHOT_RATE = 422, // The rate that double shot can proc. Without this, the default is 40%.
VELOCITY_SNAPSHOT_BONUS = 423, // Increases Snapshot whilst Velocity Shot is up.
VELOCITY_RATT_BONUS = 424, // Increases Ranged Attack whilst Velocity Shot is up.
Expand Down Expand Up @@ -557,7 +559,7 @@ enum class Mod
ROLL_RANGE = 528, // Additional range for COR roll abilities.
JOB_BONUS_CHANCE = 542, // Chance to apply job bonus to COR roll without having the job in the party.
TRIPLE_SHOT_RATE = 999, // Percent increase to Triple Shot Rate
QUICK_DRAW_RECAST = 1060, // TODO: Quick Draw Charge Reduction (seconds)
QUICK_DRAW_RECAST = 1060, // Quick Draw Charge Reduction (seconds)

DMG_REFLECT = 316, // Tracks totals
ROLL_ROGUES = 317, // Tracks totals
Expand Down Expand Up @@ -633,6 +635,7 @@ enum class Mod
SAMBA_PDURATION = 498, // Samba percent duration bonus
REVERSE_FLOURISH_EFFECT = 836, // Reverse Flourish effect in tenths of squared term multiplier
MAX_FINISHING_MOVE_BONUS = 988, // Increases the maximum number of finishing moves that may be stored
WALTZ_COST = 139, // Reduce Waltz cost by 5tp (50 post 1000tp scale)
STEP_TP_CONSUMED = 1077, // Modifies the amount of TP consumed when using steps

// Scholar
Expand Down
2 changes: 2 additions & 0 deletions src/map/utils/battleutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4621,6 +4621,8 @@ namespace battleutils
shotCount += 7;
}

shotCount += PChar->getMod(Mod::BARRAGE_COUNT);

// make sure we have enough ammo for all these shots
CItemWeapon* PAmmo = (CItemWeapon*)PChar->getEquip(SLOT_AMMO);

Expand Down

0 comments on commit 85f1c2e

Please sign in to comment.