Combat additions

Added formulas for base EXP gain and chain experience
Added basic scripts for most player abilities and effects
Added stat gains for some abilities
Changed status flags
Fixed bug with player death
Fixed bug where auto attacks didnt work when not locked on
Added traits
This commit is contained in:
yogurt 2018-04-18 16:06:41 -05:00
parent b8d6a943aa
commit c5ce2ec771
239 changed files with 5125 additions and 1237 deletions

View file

@ -0,0 +1,21 @@
require("global")
require("modifiers")
require("hiteffect")
require("utils")
--Forces a full block (0 damage taken)
function onPreAction(caster, target, effect, skill, action, actionContainer)
--If action hit from the rear and is a weaponskill ation
action.blockRate = 100.0;
end;
--Heals for the amount of HP blocked, up to a certain point. I don't know what determines the cap but it seems to be 703 at level 50. Unsure if it scales down based on level, dlvl, or if that's an arbitrary cap added.
function onBlock(effect, attacker, defender, action, actionContainer)
--Amount blocked
local absorbAmount = math.Clamp(action.amountMitigated, 0, 703);
--33008: You recover x HP from Aegis Boon
defender.AddHP(absorbAmount);
actionContainer.AddHPAction(defender.actorId, 33008, absorbAmount);
actionContainer.AddAction(defender.statusEffects.RemoveStatusEffectForBattleAction(effect));
end;

View file

@ -0,0 +1,8 @@
--Doesn't do flat damage. 20 on Lv 50 Truffle Hog, 11 on Coincounter, 7 on nael hard, 19 on 52 fachan
function onGain(target, effect)
owner.AddMod(modifiersGlobal.RegenDown, effect.GetMagnitude());
end;
function onLose(target, effect)
owner.AddMod(modifiersGlobal.RegenDown, effect.GetMagnitude());
end;

View file

@ -0,0 +1,13 @@
require("modifiers")
--Antagonize's enmity bonus is x1.5 (works for both abilities and damage dealt). x1.65 when AF is worn.
--Is does this mean it's 1.5* or 2.5*?
function onCommandStart(effect, owner, skill, actionContainer)
local enmityModifier = 1.5
if effect.GetTier() == 2 then
enmityModifier = 1.65;
end
skill.enmityModifier = skill.enmityModifier + enmityModifier;
end

View file

@ -0,0 +1,19 @@
require("modifiers")
require("hiteffect")
require("battleutils")
--Untraited reduces cooldown by 50%
--Traited reduces cooldown by 100%
function onCommandStart(effect, owner, skill, actionContainer)
--27259: Light Shot
if skill.id == 27259 then
skill.numHits = effect.GetMagnitude();
end
end;
function onCommandFinish(effect, owner, skill, actionContainer)
--27259: Light Shot
if skill.id == 27259 then
actionContainer.AddAction(owner.statusEffects.RemoveStatusEffectForBattleAction(effect));
end
end;

View file

@ -0,0 +1,59 @@
require("modifiers");
require("battleutils");
function onGain(owner, effect)
owner.statusEffects.RemoveStatusEffect(223208);
end
--Increases attack power and reduces defense with each successful attack
--Does this include weaponskills?
--Is this on every hit or every succesfull skill useage?
function onHit(effect, attacker, defender, action, actionContainer)
--Trait increases effect by 20%. Does this include the reduced defense,
--does this increase the cap or the rate at which you get AP or both?
if (effect.GetExtra() < 10) then
--This will count how many hits there have been
effect.SetExtra(effect.GetExtra() + 1);
--If you update these make sure to update them in Whirlwind as well
local apPerHit = 20;
local defPerHit = 20;
if effect.GetTier() == 2 then
apPerHit = 24;
end
--Just going to say every hit adds 20 AP up to 200
--Same for defense
--Traited will be 24 up to 240
--assuming defense is static
attacker.AddMod(modifiersGlobal.Attack, apPerHit);
attacker.SubtractMod(modifiersGlobal.Defense, defPerHit);
end
end;
function onDamageTaken(effect, attacker, defender, action, actionContainer)
local apPerHit = 20;
local defPerHit = 20;
if effect.GetTier() == 2 then
apPerHit = 24;
end
defender.SubtractMod(modifiersGlobal.Attack, effect.GetExtra() * apPerHit);
defender.SubtractMod(modifiersGlobal.Defense, effect.GetExtra() * defPerHit);
effect.SetExtra(0);
end
function onLose(owner, effect)
local apPerHit = 20;
local defPerHit = 20;
if effect.GetTier() == 2 then
apPerHit = 24;
end
owner.SubtractMod(modifiersGlobal.Attack, effect.GetExtra() * apPerHit);
owner.SubtractMod(modifiersGlobal.Defense, effect.GetExtra() * defPerHit);
end

View file

@ -0,0 +1,15 @@
require("modifiers")
require("battleutils")
--Forces crit of a single WS action from rear.
function onPreAction(caster, target, effect, skill, action, actionContainer)
--If action hit from the rear and is a weaponskill ation
if (action.param == HitDirection.Rear and action.commandType == CommandType.WeaponSkill) then
--Set action's crit rate to 100%
action.critRate = 100.0;
end
--Remove status and add message
actionsList.AddAction(target.statusEffects.RemoveForBattleAction(effect));
end;

View file

@ -0,0 +1,21 @@
--The amount of time it takes to fully charge varies depending on how much MP it has to restore, meaning its not just a percent every tick
--Based on a few videos it seems like it heals for 0.5% of max MP every second, traited. This is an early guess but it seems correct
--Untraited is less clear. It could be 0.25%, 0.30%, or 0.40%. Guessing it's 0.30
function onTick(owner, effect)
local percentPerSecond = 0.0030;
if effect.GetTier() == 2 then
percentPerSecond = 0.005;
end
print(effect.GetExtra());
local amount = percentPerSecond * owner.GetMaxMP() + 0.25;
effect.SetExtra(effect.GetExtra() + amount);
if effect.GetExtra() >= effect.GetMagnitude() then
--223242: Fully Blissful Mind
owner.statusEffects.ReplaceEffect(effect, 223242, 1, effect.GetMagnitude(), 0xffffffff);
--owner.statusEffects.ReplaceEffect(effect, true);
end
end

View file

@ -0,0 +1,20 @@
require("modifiers")
require("hiteffect")
--Takes 10% of hp rounded down
--Random guess, but increases damage by 10% (12.5% traited)?
function onPreAction(caster, target, effect, skill, action, actionContainer)
local hpToRemove = math.floor(caster.GetHP() * 0.10);
local modifier = 1.10;
if (effect.GetTier() == 2) then
modifier = 1.25;
end
action.amount = action.amount * modifier;
caster.DelHP(hpToRemove);
--Remove status and add message
actionContainer.AddAction(target.statusEffects.RemoveForBattleAction(effect));
end;

View file

@ -0,0 +1,25 @@
require("modifiers");
require("battleutils");
--Absorb HP on next WS or ability
function onHit(effect, attacker, defender, action, actionContainer)
--1.21: Absorb HP amount no longer affected by player VIT rating.
--Bloodbath seems based on both defener and attacker's stats, even after 1.21.
--Miser's Mistriss seems to resist the effect, whereas nael gets absorbed more than 100%
--Garuda resists a small amount
--Unclear what it's based on.
--Possibly magic resist? Slashing resist?
--For now using 1.0 as baseline since that seems to be the average
if action.commandType == CommandType.Weaponskill or action.commandType == CommandType.Ability then
local absorbModifier = 1.0
local absorbAmount = action.amount * absorbModifier;
attacker.AddHP(absorbAmount);
--30332: You absorb hp from target
actionContainer.AddHPAction(defender.actorId, 30332, absorbAmount)
--Bloodbath is lost after absorbing hp
actionContainer.AddAction(defender.statusEffects.RemoveStatusEffectForBattleAction(effect));
end
end;

View file

@ -0,0 +1,18 @@
--This is the comboed version of bloodletter.
--All videos I can find have it dealing 15 damage.
--Damage type is projectile.
--DoT damage is combined and all hits on a single tick. ie a blodletter doing 15 damage and aero doing 11 will combine and tick for 26.
--Bloodletter is apparently impacted by PIE
--http://forum.square-enix.com/ffxiv/threads/35795-STR-DEX-PIE-ATK-Testing/page2
--Chance to land is also impacted by PIE
function onGain(owner, effect)
owner.AddMod(modifiersGlobal.RegenDown, 15);
end
--Additional damage is 570 at level 50
--https://ffxiv.gamerescape.com/w/index.php?title=Bloodletter&oldid=298020
function onLose(owner, effect)
owner.SubtractMod(modifiersGlobal.RegenDown, 15);
owner.DelHP(570);
end

View file

@ -0,0 +1,8 @@
--Bloodletter2 is the uncomboed version of Bloodletter. It doesn't deal any additional damage when it falls off but has the same tick damage
function onGain(owner, effect)
owner.AddMod(modifiersGlobal.RegenDown, 15);
end
function onLose(owner, effect)
owner.SubtractMod(modifiersGlobal.RegenDown, 15);
end

View file

@ -0,0 +1,13 @@
require("modifiers")
require("battleutils")
function onPreAction(caster, target, effect, skill, action, actionContainer)
if skill.commandType == CommandType.Spell then
if action.actionType == ActionType.Heal then
action.amount = action.amount * 0.80;
elseif action.actionType == ActionType.Magic then
action.amount = action.amount * 1.20;
end
end
end;

View file

@ -0,0 +1,13 @@
require("global")
require("modifiers")
require("hiteffect")
require("utils")
function onHit(effect, attacker, defender, action, actionContainer)
local enmity = action.enmity;
action.enmity = 0;
defender.hateContainer.UpdateHate(effect.GetSource(), enmity);
--Does collusion send a message?
actionContainer.AddAction(attacker.statusEffects.RemoveStatusEffectForBattleAction(effect));
end;

View file

@ -0,0 +1,9 @@
require("global")
require("modifiers")
require("hiteffect")
require("utils")
--Restores 25% of damage taken as MP. Does not send a message
function onDamageTaken(effect, attacker, defender, action, actionContainer)
defender.AddMP(0.25 * action.amount);
end;

View file

@ -0,0 +1,16 @@
require("modifiers")
require("battleutils")
--This is the untraited version of decoy.
function onPreAction(caster, target, effect, skill, action, actionContainer)
--Evade single ranged or magic attack
--Traited allows for physical attacks
if skill.isRanged or action.actionType == ActionType.Magic then
--Set action's hit rate to 0
action.hirRate = 0.0;
end
--Remove status and add message
actionsList.AddAction(target.statusEffects.RemoveForBattleAction(effect));
end;

View file

@ -0,0 +1,16 @@
require("modifiers")
require("battleutils")
--This is the traited version of Decoy. It can also evade physical attacks.
function onPreAction(caster, target, effect, skill, action, actionContainer)
--Evade single ranged or magic attack
--Traited allows for physical attacks
if skill.isRanged or action.actionType == ActionType.Magic or action.actionType == ActionType.Physical then
--Set action's hit rate to 0
action.hirRate = 0.0;
end
--Remove status and add message
actionsList.AddAction(target.statusEffects.RemoveForBattleAction(effect));
end;

View file

@ -0,0 +1,7 @@
function onGain(owner, effect)
owner.SubtractMod(modifiersGlobal.Defense, effect.GetMagnitude());
end
function onLose(owner, effect)
owner.AddMod(modifiersGlobal.Defense, effect.GetMagnitude());
end

View file

@ -0,0 +1,16 @@
--Consistent 85HP/tick normal; 113HP/tick with AF pants
function onGain(owner, effect)
local magnitude = 85
--Need a better way to set magnitude when adding effects
if effect.GetTier() == 2 then
magnitude = 113;
end
effect.SetMagnitude(magnitude);
owner.AddMod(modifiersGlobal.Regen, effect.GetMagnitude());
end
function onLose(owner, effect)
owner.SubtractMod(modifiersGlobal.Regen, effect.GetMagnitude());
end

View file

@ -0,0 +1,23 @@
require("modifiers")
require("hiteffect")
--Increases block rate by 100%
function onGain(owner, effect)
owner.AddMod(modifiersGlobal.RawBlockRate, 100);
end
function onLose(owner, effect)
owner.SubtractMod(modifiersGlobal.RawBlockRate, 100);
end
--Applys Divine Regen to party in range when healed by cure or cura
function onBlock(caster, target, effect, skill, action, actionContainer)
-- cure cura
if (skill.id == 27346 or skill.id == 27347) and (caster != owner) then
--For each party member in range, add divine regen
for chara in owner.GetPartyMembersInRange(8) do
local addAction = chara.statusEffects.AddStatusForBattleAction(223264, 2);
actionContainer.AddAction(addAction);
end
end
end;

View file

@ -0,0 +1,23 @@
require("modifiers")
require("battleutils")
--Dread spike completely nullifies a physical action and absorbs how much damage it would have done (when it's powered up)
--I'm going to assume it only absorbs half damage without LS/PS up
--When I say it nullifies an attack, it even gets rid of the message. It's as if the attack didn't happen
--Don't know how this works with multi-hit attacks or even how it works with stoneskin or other buffs that respond to damage
-- I dont really know how this should work...
function onDamageTaken(effect, attacker, defender, action, actionContainer)
if action.actionType == ActionType.Physical then
--maybe this works?
local absorbAmount = action.amount;
action.amount = 0;
action.worldMasterTextId = 0;
attacker.AddHP(absorbAmount);
--30451: You recover [absorbAmount] HP.
actionContainer.AddHPAction(defender.actorId, 30451, absorbAmount)
--Dread Spike is lost after absorbing hp
actionContainer.AddAction(defender.statusEffects.RemoveStatusEffectForBattleAction(effect));
end
end;

View file

@ -0,0 +1,20 @@
require("modifiers")
function onGain(target, effect)
--Traited increases speed by 20%. Assuming that means it actually increases speed instead of simply offsetting the negative speed it has by default
local speedModifier = 0.8;
if effect.GetTier() == 2 then
speedModifier = 1.2;
end
target.SetMod(modifiersGlobal.Speed, target.GetMod(modifiersGlobal.Speed) * speedModifier);
end;
function onLose(target, effect)
local speedModifier = 0.8;
if effect.GetTier() == 2 then
speedModifier = 1.2;
end
target.SetMod(modifiersGlobal.Speed, target.GetMod(modifiersGlobal.Speed) / speedModifier);
end;

View file

@ -1,11 +1,26 @@
require("modifiers");
--15% in ARR, dont know how it worked in 1.0
function onGain(target, effect)
local currEvade = target.GetMod(modifierGlobals.Evasion);
target.SetMod(modifierGlobals.Evasion, currEvade + 15);
target.AddMod(modifiersGlobal.RawEvadeRate, 15);
end;
function onLose(target, effect)
local currEvade = target.GetMod(modifierGlobals.Evasion);
target.SetMod(modifierGlobals.Evasion, currEvade - 15);
target.SubtractMod(modifiersGlobal.RawEvadeRate, 15);
end;
--Returns 25%? of amount dodged as MP
function onEvade(effect, attacker, defender, action, actionContainer)
--25% of amount dodged untraited, 50% traited
local percent = 0.25;
if (effect.GetTier() == 2) then
percent = 0.50;
end
local mpToReturn = percent * action.amountMitigated;
defender.AddMP(math.ceil(mpToReturn));
--33010: You recover x MP from Featherfoot
actionContainer.AddMPAction(defender.actorId, 33010, mpToReturn);
--Featherfoot is lost after evading
actionContainer.AddAction(defender.statusEffects.RemoveStatusEffectForBattleAction(effect));
end;

View file

@ -1,4 +1,8 @@
function onGain(target, effect)
target.statusEffects.RemoveStatusEffect(223209)
target.statusEffects.RemoveStatusEffect(223211)
end;
end;
--Need to do more research on these.
--From what I've seen, they changed the property of the attack to magic and the element to the respective element
--Unsure if it applies to weaponskills or if it's auto attacks only.

View file

@ -0,0 +1,15 @@
require("modifiers")
function onGain(target, effect)
--Parry is .1% per , Random guess but gonna say it gives 20% worth of parry.
target.AddMod(modifiersGlobal.Parry, 200);
end;
function onParry(effect, attacker, defender, action, actionContainer)
--Foresight is lost after parrying
actionContainer.AddAction(defender.statusEffects.RemoveStatusEffectForBattleAction(effect));
end;
function onLose(target, effect)
target.SubtractMod(modifiersGlobal.Parry, 200);
end;

View file

@ -0,0 +1,11 @@
function onGain(owner, effect)
--Using extra because that's what blissful_mind uses
effect.SetExtra(effect.GetMagnitude());
end
function onTick(owner, effect)
print("hi")
end
function onLose(owner, effect)
end

View file

@ -0,0 +1,9 @@
require("modifiers")
function onGain(owner, effect)
owner.AddMod(modifiersGlobal.RegenDown, effect.GetMagnitude());
end
function onLose(owner, effect)
owner.SubtractMod(modifiersGlobal.RegenDown, effect.GetMagnitude());
end

View file

@ -0,0 +1,22 @@
require("modifiers");
--In one capture, hawks eye seemed to give 18.75% additional accuracy (379 to 450)
--The player in this capture was a Dragoon, so this is untraited.
--Traited Hawk's Eye says it increases Accuracy by 50%.
--This could mean traited hawk's eye gives 28.125% (18.75% * 1.5) or it could mean it gives 68.75% (18.75% + 50%)
function onGain(target, effect)
local accuracyMod = 0.1875;
if effect.GetTier() == 2 then
accuracyMod = 0.28125;
end
local amountGained = accuracyMod * target.GetMod(modifiersGlobal.Accuracy);
effect.SetMagnitude(amountGained);
target.AddMod(modifiersGlobal.Accuracy, effect.GetMagnitude());
end;
function onLose(target, effect)
target.SubtractMod(modifiersGlobal.Accuracy, effect.GetMagnitude());
end;

View file

@ -0,0 +1,13 @@
require("modifiers")
function onGain(target, effect)
local speedModifier = 0.5;
target.SetMod(modifiersGlobal.Speed, target.GetMod(modifiersGlobal.Speed) * speedModifier);
end;
function onLose(target, effect)
local speedModifier = 0.5;
target.SetMod(modifiersGlobal.Speed, target.GetMod(modifiersGlobal.Speed) / speedModifier);
end;

View file

@ -0,0 +1,15 @@
require("modifiers")
--Battle Voice grants HP_Boost and it sets max hp to 125% normal amount and heals for the difference between current
--This doesn't seem like the correct way to do this. If max HP changes between gainign and losing wont this break?
function onGain(target, effect)
local newMaxHP = target.GetMaxHP() * 1.25;
local healAmount = newMaxHP - target.GetMaxHP();
target.SetMaxHP(newMaxHP);
target.AddHP(healAmount);
end;
function onLose(target, effect)
target.SetMaxHP(target.GetMaxHP() * 0.75);
end;

View file

@ -0,0 +1,13 @@
require("modifiers")
--will this break with things like slow?
function onGain(target, effect)
local currDelay = target.GetMod(modifiersGlobal.AttackDelay);
target.SetMod(modifiersGlobal.AttackDelay), 0.66 * currDelay);
end;
function onLose(target, effect)
local currDelay = target.GetMod(modifiersGlobal.AttackDelay);
target.SetMod(modifiersGlobal.AttackDelay), 1.50 * currDelay);
end;

View file

@ -1,3 +1,8 @@
function onTick(target, effect)
target.AddTP(100);
end;
--100 TP per tick without AF. 133 TP per tick with AF
function onGain(owner, effect)
owner.AddMod(modifiersGlobal.Regain, effect.GetMagnitude());
end
function onLose(owner, effect)
owner.SubtractMod(modifiersGlobal.Regain, effect.GetMagnitude());
end

View file

@ -0,0 +1,17 @@
require("modifiers")
require("hiteffect")
require("battleutils")
--Untraited reduces cooldown by 50%
--Traited reduces cooldown by 100%
function onCommandStart(effect, owner, skill, actionContainer)
if skill.commandType == CommandType.Weaponskill then
local reduction = 0.5;
if effect.GetTier() == 2 then
reduction = 1.0;
end
skill.recastTimeMs = skill.recastTimeMs - (reduction * skill.recastTimeMs);
end
end;

View file

@ -0,0 +1,21 @@
require("modifiers")
require("hiteffect")
require("battleutils")
--Heals for 30%? of damage dealt on auto attacks.
--Trait: Increases healing by 20%. Is this the base % or the amount after taking the base percent?
--I'm guessing the way it works is that LSI/II/III have 10/20/30% absorb by default and 30/40/50% traited.
--Seems to match what i can find in videos
function onHit(effect, attacker, defender, action, actionContainer)
if action.commandType == CommandType.AutoAttack then
local healPercent = 0.10;
if effect.GetTier() == 2 then
healPercent = 0.30;
end
local amount = math.floor((healPercent * action.amount) + 1);
attacker.AddHP(amount);
actionContainer.AddHPAction(defender.actorId, 30332, amount);
end
end;

View file

@ -0,0 +1,17 @@
require("modifiers")
require("hiteffect")
require("battleutils")
function onHit(effect, attacker, defender, action, actionContainer)
if action.commandType == CommandType.AutoAttack then
local healPercent = 0.20;
if effect.GetTier() == 2 then
healPercent = 0.40;
end
local amount = math.floor((healPercent * action.amount) + 1);
attacker.AddHP(amount);
actionContainer.AddHPAction(defender.actorId, 30332, amount);
end
end;

View file

@ -0,0 +1,21 @@
require("modifiers")
require("hiteffect")
require("battleutils")
--Heals for 30%? of damage dealt on auto attacks.
--Trait: Increases healing by 20%. Is this the base % or the amount after taking the base percent?
--I'm guessing the way it works is that LSI/II/III have 10/20/30% absorb by default and 30/40/50% traited.
--Seems to match what i can find in videos
function onHit(effect, attacker, defender, action, actionContainer)
if action.commandType == CommandType.AutoAttack then
local healPercent = 0.10;
if effect.GetTier() == 2 then
healPercent = 0.30;
end
local amount = math.floor((healPercent * action.amount) + 1);
attacker.AddHP(amount);
actionContainer.AddHPAction(defender.actorId, 30332, amount);
end
end;

View file

@ -0,0 +1,8 @@
--Bloodletter2 is the uncomboed version of Bloodletter. It doesn't deal any additional damage when it falls off but has the same tick damage
function onGain(owner, effect)
owner.SubtractMod(modifiersGlobal.MagicEvasion, effect.GetMagnitude());
end
function onLose(owner, effect)
owner.AddMod(modifiersGlobal.MagicEvasion, effect.GetMagnitude());
end

View file

@ -0,0 +1,12 @@
require("modifiers")
require("battleutils")
--Forces crit on attacks made with axes
function onPreAction(caster, target, effect, skill, action, actionContainer)
--Assuming "attacks made with axes" means skills specific to MRD/WAR
if (skill.job == 3 or skill.job == 17) then
--Set action's crit rate to 100%
action.critRate = 100.0;
end
end;

View file

@ -0,0 +1,26 @@
require("modifiers")
require("hiteffect")
require("battleutils")
--Add 30 raw block rate. No idea how much block it actually gives.
function onGain(owner, effect)
owner.AddMod(modifiersGlobal.RawBlockRate, 30);
end
function onLose(owner, effect)
owner.SubtractMod(modifiersGlobal.RawBlockRate, 30);
end
--Gives 200 TP on block. Traited: Gives 10% of the amount blocked back as MP
function onBlock(effect, attacker, defender, action, actionContainer)
--200 TP on block
defender.AddTP(200);
--If traited, add 10% of damage taken as MP
if(effect.GetTier() == 2) then
local mpToReturn = math.ceil(0.10 * action.amount);
defender.AddMP(math.ceil(mpToReturn));
--33009: You recover x MP from Outmaneuver
actionContainer.AddMPAction(defender.actorId, 33009, mpToReturn);
end
end;

View file

@ -0,0 +1,30 @@
require("modifiers")
require("hiteffect")
require("battleutils")
--https://www.bluegartr.com/threads/107403-Stats-and-how-they-work/page22
function onGain(owner, effect)
owner.AddMod(modifiersGlobal.Attack, 115);
owner.SubtractMod(modifiersGlobal.Defense, 158);
end
function onCommandStart(effect, owner, command, actionContainer)
--if command is a weaponskill or jump
--27266: jump
if command.GetCommandType() == CommandType.Weaponskill or command.id == 27266 then
effect.SetTier(effect.GetTier() + 1);
--Takes 10 weaponskills/jumps to increase level
if effect.GetTier() > 10 then
local action = owner.statusEffects.ReplaceEffect(effect, 223213, 1, 1, 60);
actionContainer.AddAction(action);
else
effect.RefreshTime();
end
end
end
function onLose(owner, effect)
owner.SubtractMod(modifiersGlobal.Attack, 115);
owner.AddMod(modifiersGlobal.Defense, 158);
end

View file

@ -0,0 +1,31 @@
require("modifiers")
require("hiteffect")
require("battleutils")
--https://www.bluegartr.com/threads/107403-Stats-and-how-they-work/page22
function onGain(owner, effect)
owner.AddMod(modifiersGlobal.Attack, 230);
owner.SubtractMod(modifiersGlobal.Defense, 158);
end
function onCommandStart(effect, owner, command, actionContainer)
--if command is a weaponskill or jump
--27266: jump
if command.GetCommandType() == CommandType.Weaponskill or command.id == 27266 then
effect.SetTier(effect.GetTier() + 1);
--Takes 10 weaponskills/jumps to increase level
if effect.GetTier() > 10 then
local action = owner.statusEffects.ReplaceEffect(effect, 223214, 1, 1, 60);
actionContainer.AddAction(action);
else
effect.RefreshTime();
end
end
end
function onLose(owner, effect)
owner.SubtractMod(modifiersGlobal.Attack, 230);
owner.AddMod(modifiersGlobal.Defense, 158);
end

View file

@ -0,0 +1,24 @@
require("modifiers")
require("hiteffect")
require("battleutils")
--https://www.bluegartr.com/threads/107403-Stats-and-how-they-work/page22
function onGain(owner, effect)
owner.AddMod(modifiersGlobal.Attack, 345);
owner.SubtractMod(modifiersGlobal.Defense, 158);
end
function onCommandStart(effect, owner, command, actionContainer)
--if command is a weaponskill or jump
--27266: jump
if command.GetCommandType() == CommandType.Weaponskill or command.id == 27266 then
--At III just refresh the effect
effect.RefreshTime();
end
end
function onLose(owner, effect)
owner.SubtractMod(modifiersGlobal.Attack, 345);
owner.AddMod(modifiersGlobal.Defense, 158);
end

View file

@ -0,0 +1,43 @@
require("modifiers")
function onGain(target, effect)
--Magnitude is caster's Enhancing Magic Potency.
--http://forum.square-enix.com/ffxiv/threads/41900-White-Mage-A-Guide
--5-4-5-4-5-4-5-4-5 repeating points of Enhancing for 1 defense
--4.56 * Enhancing Potency
local defenseBuff = 5-- 4.56 * effect.GetMagnitude();
local magicDefenseBuff = 0;
target.AddMod(modifiersGlobal.Defense, defenseBuff);
--27365: Enhanced Protect: Increases magic defense gained from Protect.
--There is no "magic defense" stat, instead it gives stats to each resist stat.
--if effect.GetTier() >= 2 then
--7-6-7 repeating
--6.67 * Enhancing Potency
magicDefenseBuff = 5--6.67 * effect.GetMagnitude();
for i = modifiersGlobal.ResistFire, modifiersGlobal.ResistWater do
target.AddMod(i, magicDefenseBuff);
end
--end
end;
function onLose(target, effect)
local defenseBuff = 4.56 * effect.GetMagnitude();
local magicDefenseBuff = 0;
target.SubtractMod(modifiersGlobal.Defense, defenseBuff);
--27365: Enhanced Protect: Increases magic defense gained from Protect.
--There is no "magic defense" stat, instead it gives stats to each resist stat.
--if effect.GetTier() >= 2 then
--7-6-7 repeating
--6.67 * Enhancing Potency
magicDefenseBuff = 6.67 * effect.GetMagnitude();
for i = modifiersGlobal.ResistFire, modifiersGlobal.ResistWater do
target.SubtractMod(i, magicDefenseBuff);
end
--end
end;

View file

@ -0,0 +1,17 @@
require("modifiers")
require("hiteffect")
require("battleutils")
--Untraited reduces cooldown by 50%
--Traited reduces cooldown by 100%
function onCommandStart(effect, owner, skill, actionContainer)
--Does this apply to auto attacks?
if skill.commandType == CommandType.Weaponskill or skill.commandType == CommandType.Ability or skill.commandType == CommandType.Magic then
if skill.actionType == ActionType.Physical or skill.actionType == ActionType.Magic then
--No idea what the enmity effect is
skill.enmityModifier = skill.enmityModifier * 0.5;
owner.AddTP(effect.GetMagnitude());
end
end
end;

View file

@ -0,0 +1,13 @@
require("modifiers")
function onGain(target, effect)
local speedModifier = 1.25;
target.SetMod(modifiersGlobal.Speed, target.GetMod(modifiersGlobal.Speed) * speedModifier);
end;
function onLose(target, effect)
local speedModifier = 1.25;
target.SetMod(modifiersGlobal.Speed, target.GetMod(modifiersGlobal.Speed) / speedModifier);
end;

View file

@ -0,0 +1,51 @@
require("global")
require("modifiers")
require("hiteffect")
require("battleutils")
require("utils")
parryPerDT = 20;
delayMsPerDT = 100;
function onGain(owner, effect)
owner.statusEffects.RemoveStatusEffect(223207);
end
--Increases parry rating and attack speed for each hit. (Need more info)
function onDamageTaken(effect, attacker, defender, action, actionContainer)
--Assuming 20 parry rating every time you're hit up to 200
--Delay is more complicated. Most axes are around 4 seconds, so i'm gonna assume it cuts off a full second at max
if (effect.GetExtra() < 10) then
effect.SetExtra(effect.GetExtra() + 1);
attacker.AddMod(modifiersGlobal.Parry, parryPerDT);
attacker.SubtractMod(modifiersGlobal.Delay, delayMsPerDT);
end
end
--Heals for 50% of damage dealt on crits with a maximum of 20% of max hp
--Also only heals for as much hp as you're missing at most
function onCrit(effect, attacker, defender, action, actionContainer)
local healAmount = math.Clamp(action.amount * 0.50, 0, defender.GetMaxHP() * 0.20);
healAmount = math.Clamp(healAmount, 0, defender.GetMaxHP() - defender.GetHP());
defender.AddHP(healAmount);
--33012: You recover [healAmount] HP.
actionContainer.AddHPAction(owner.actorId, 33008, healAmount);
end;
--"Effect fades over time"
function onTick(owner, effect)
--Enduring march prevents fading of rampage effect
if not owner.statusEffects.HasStatusEffect(223078) and (effect.GetExtra() > 0) then
--Going to assume that every 5 seconds a single hits worth of rampage is lost.
attacker.SubtractMod(modifiersGlobal.Parry, parryPerDT);
attacker.AddMod(modifiersGlobal.Delay, delayMsPerDT);
effect.SetExtra(effect.GetExtra() - 1);
end
end
function onLose(owner, effect)
attacker.SubtractMod(modifiersGlobal.Parry, effect.GetExtra() * parryPerDT);
attacker.AddMod(modifiersGlobal.Delay, effect.GetExtra() * delayMsPerDT);
end

View file

@ -0,0 +1,15 @@
require("modifiers")
--Rampart gives 105 defense at level 50.
--Guessing it scales with level. If I had to guess it's either 2.1 * level or (2 * level) + 5.
--I'm going to guess the latter since it always leaves you with a whole number. I could be completely wrong though
--The party_battle_leve has rampart giving 36? defense. It's from an earlier patch so probably useless
function onGain(target, effect)
effect.SetMagnitude(2 * target.GetLevel() + 5);
target.AddMod(modifiersGlobal.Defense, effect.GetMagnitude());
end;
function onLose(target, effect)
target.SubtractMod(modifiersGlobal.Defense, effect.GetMagnitude());
end;

View file

@ -0,0 +1,8 @@
--Regen is modified by Enhancing Magic Potency. Formula here: http://forum.square-enix.com/ffxiv/threads/41900-White-Mage-A-Guide
function onGain(owner, effect)
owner.AddMod(modifiersGlobal.Regen, effect.magnitude);
end
function onLose(owner, effect)
owner.SubtractMod(modifiersGlobal.Regen, effect.magnitude);
end

View file

@ -0,0 +1,29 @@
require("modifiers")
function onGain(target, effect)
--Untraited Sentinel is 30% damage taken down, traited is 50%
local amount = 30;
if effect.GetTier() == 2 then
amount = 50;
end
target.AddMod(modifiersGlobal.DamageTakenDown, amount);
end;
function onLose(target, effect)
local amount = 30;
if effect.GetTier() == 2 then
amount = 50;
end
target.SubtractMod(modifiersGlobal.DamageTakenDown, amount);
end;
--Increases action's enmity by 100 for weaponskills
--http://forum.square-enix.com/ffxiv/threads/47393-Tachi-s-Guide-to-Paladin-%28post-1.22b%29
--Sentinel only works on weaponskills. It's possible that was a bug because the description says actions
function onHit(effect, attacker, defender, action, actionContainer)
if action.commandType == CommandType.WeaponSkill then
action.enmity = action.enmity + 100;
end
end

View file

@ -0,0 +1,26 @@
require("global")
require("utils")
require("modifiers")
require("hiteffect")
require("battleutils")
--todo: calculate actual mitigation value based on Source's enhancing magic. info: http://forum.square-enix.com/ffxiv/threads/40800-Enhancing-Magic
--This should also probably be calculated when the spell is cast so it doesnt overwrite a stronger stoneskin
function onGain(owner, effect)
--Going to assume its 1.34 * Enhancing Potency untraited, 1.96 * Enhancing Potency traited.
local potencyModifier = 1.34;
if effect.tier == 2 then
potencyModifier = 1.96;
end
local amount = potencyModifier * effect.source.GetMod(modifiersGlobal.MagicEnhancePotency);
owner.AddMod(modifiersGlobal.Stoneskin, amount);
end
--Using extra for how much mitigation stoneskin has
function onPostAction(owner, effect, caster, skill, action, actionContainer)
if (owner.GetMod(modifiersGlobal.Stoneskin) <= 0) then
actionContainer.AddAction(owner.statusEffects.RemoveStatusEffectForBattleAction(effect));
end
end;

View file

@ -0,0 +1,17 @@
require("global")
require("modifiers")
require("hiteffect")
require("utils")
--Unclear what the exact damage is but it seems like it's the total amount of damage the attack would have done before parrying
function onDamageTaken(effect, attacker, defender, action, actionContainer)
local amount = action.amount + action.mitigatedAmount;
--Only reflects magical attacks if wearing AF chest
if action.actionType == ActionType.Physical or (action.actionType == ActionType.Magic and effect.GetTier() == 2) then
--30350: Counter! You hit target for x points of damage
--There are counter messages for blocks, can Vengeance be blocked/parried?
attacker.DelHP(amount);
actionContainer.AddHitAction(attacker.actorId, 30350, amount);
end;
end;