From c442dc9ecd6f4ad580b48b84e9c4fbcea1c92749 Mon Sep 17 00:00:00 2001 From: yogurt Date: Mon, 25 Jun 2018 23:36:18 -0500 Subject: [PATCH] Script fixes and new effects. Cleaned up unneeded requires in some scripts Fixed Second Wind Added new effect scripts Added bard song scripts that mostly work --- data/scripts/commands/RaiseMagic.lua | 5 ++ .../scripts/commands/ability/battle_voice.lua | 19 +++++++ .../commands/ability/blissful_mind.lua | 2 +- data/scripts/commands/ability/cover.lua | 3 +- .../commands/ability/hundred_fists.lua | 17 +++++++ data/scripts/commands/ability/resonance.lua | 15 ++++++ data/scripts/commands/ability/second_wind.lua | 8 ++- .../scripts/commands/magic/ballad_of_magi.lua | 49 +++++++++++++++++-- .../commands/magic/minuet_of_rigor.lua | 47 ++++++++++++++++-- data/scripts/commands/magic/paeon_of_war.lua | 45 +++++++++++++++-- data/scripts/commands/magic/raise.lua | 6 +-- data/scripts/effects/aegis_boon.lua | 4 +- data/scripts/effects/aero.lua | 6 ++- data/scripts/effects/ballad_of_magi.lua | 10 ++++ data/scripts/effects/barrage.lua | 6 --- data/scripts/effects/battle_voice.lua | 3 ++ data/scripts/effects/berserk2.lua | 1 - data/scripts/effects/bind.lua | 4 -- data/scripts/effects/blind.lua | 9 ++++ data/scripts/effects/blindside.lua | 2 +- data/scripts/effects/blood_for_blood.lua | 32 ++++++------ data/scripts/effects/bloodbath.lua | 1 - data/scripts/effects/bloodletter.lua | 2 + data/scripts/effects/bloodletter2.lua | 2 + data/scripts/effects/cleric_stance.lua | 17 +++---- data/scripts/effects/collusion.lua | 3 -- data/scripts/effects/cover.lua | 9 ++-- data/scripts/effects/covered.lua | 15 ++++++ data/scripts/effects/dark_seal2.lua | 13 +++++ data/scripts/effects/decoy.lua | 10 ++-- data/scripts/effects/decoy2.lua | 9 ++-- data/scripts/effects/default.lua | 3 ++ data/scripts/effects/defense_down.lua | 2 + data/scripts/effects/divine_regen.lua | 11 +---- data/scripts/effects/divine_veil.lua | 14 ++++-- data/scripts/effects/dread_spike.lua | 13 +++-- data/scripts/effects/excruciate.lua | 30 ++++++++++++ data/scripts/effects/fully_blissful_mind.lua | 4 -- data/scripts/effects/haste.lua | 10 ++++ data/scripts/effects/hawks_eye.lua | 2 + data/scripts/effects/hp_boost.lua | 2 +- data/scripts/effects/hundred_fists.lua | 11 ++--- data/scripts/effects/invigorate.lua | 2 + data/scripts/effects/keen_flurry.lua | 2 - data/scripts/effects/life_surge_I.lua | 2 - data/scripts/effects/life_surge_II.lua | 2 - data/scripts/effects/life_surge_III.lua | 2 - data/scripts/effects/magic_evasion_down.lua | 3 +- data/scripts/effects/mighty_strikes.lua | 5 +- data/scripts/effects/minuet_of_rigor.lua | 12 +++++ data/scripts/effects/necrogenesis.lua | 12 +++++ data/scripts/effects/outmaneuver2.lua | 2 - data/scripts/effects/paeon_of_war.lua | 10 ++++ data/scripts/effects/parsimony.lua | 17 +++++++ data/scripts/effects/poison.lua | 7 +++ data/scripts/effects/power_surge_I.lua | 1 - data/scripts/effects/power_surge_II.lua | 1 - data/scripts/effects/power_surge_III.lua | 1 - data/scripts/effects/protect2.lua | 27 ++++------ data/scripts/effects/quelling_strike.lua | 1 - data/scripts/effects/rampage2.lua | 3 -- data/scripts/effects/refresh.lua | 7 +++ data/scripts/effects/regain.lua | 7 +++ data/scripts/effects/regen.lua | 4 +- data/scripts/effects/resonance2.lua | 15 ++++++ data/scripts/effects/sentinel.lua | 1 + data/scripts/effects/stoneskin.lua | 6 +-- data/scripts/effects/tempered_will.lua | 7 +++ data/scripts/effects/tp_bleed.lua | 7 +++ data/scripts/effects/vengeance.lua | 4 +- sql/server_battle_traits.sql | 32 ++++++------ sql/server_statuseffects.sql | 17 ++++++- 72 files changed, 524 insertions(+), 171 deletions(-) create mode 100644 data/scripts/commands/RaiseMagic.lua create mode 100644 data/scripts/commands/ability/battle_voice.lua create mode 100644 data/scripts/commands/ability/hundred_fists.lua create mode 100644 data/scripts/commands/ability/resonance.lua create mode 100644 data/scripts/effects/ballad_of_magi.lua create mode 100644 data/scripts/effects/battle_voice.lua create mode 100644 data/scripts/effects/blind.lua create mode 100644 data/scripts/effects/covered.lua create mode 100644 data/scripts/effects/dark_seal2.lua create mode 100644 data/scripts/effects/excruciate.lua create mode 100644 data/scripts/effects/haste.lua create mode 100644 data/scripts/effects/minuet_of_rigor.lua create mode 100644 data/scripts/effects/necrogenesis.lua create mode 100644 data/scripts/effects/paeon_of_war.lua create mode 100644 data/scripts/effects/parsimony.lua create mode 100644 data/scripts/effects/poison.lua create mode 100644 data/scripts/effects/refresh.lua create mode 100644 data/scripts/effects/regain.lua create mode 100644 data/scripts/effects/resonance2.lua create mode 100644 data/scripts/effects/tempered_will.lua create mode 100644 data/scripts/effects/tp_bleed.lua diff --git a/data/scripts/commands/RaiseMagic.lua b/data/scripts/commands/RaiseMagic.lua new file mode 100644 index 00000000..a349c17a --- /dev/null +++ b/data/scripts/commands/RaiseMagic.lua @@ -0,0 +1,5 @@ +function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) + player.Cast(command.actorId, targetActor); + + player:endEvent(); +end \ No newline at end of file diff --git a/data/scripts/commands/ability/battle_voice.lua b/data/scripts/commands/ability/battle_voice.lua new file mode 100644 index 00000000..cecc4d45 --- /dev/null +++ b/data/scripts/commands/ability/battle_voice.lua @@ -0,0 +1,19 @@ +require("global"); +require("ability"); + +function onAbilityPrepare(caster, target, ability) + return 0; +end; + +function onAbilityStart(caster, target, ability) + return 0; +end; + +function onSkillFinish(caster, target, skill, action, actionContainer) + --Only the bard gets the Battle Voice effect + if caster == target then + actionContainer.AddAction(caster.statusEffects.AddStatusForBattleAction(223253, 1, 0, 30)); + end + + action.DoAction(caster, target, skill, actionContainer); +end; \ No newline at end of file diff --git a/data/scripts/commands/ability/blissful_mind.lua b/data/scripts/commands/ability/blissful_mind.lua index b38a8b2b..7af11cf1 100644 --- a/data/scripts/commands/ability/blissful_mind.lua +++ b/data/scripts/commands/ability/blissful_mind.lua @@ -26,7 +26,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer) caster.AddMP(amount); - actionContainer.AddMPAction(caster.actorId, 30321, amount); + actionContainer.AddMPAction(caster.actorId, 33007, amount); actionContainer.AddAction(remAction); else --Blissful mind takes 25% of CURRENT HP and begins storing MP up to that point, at which point the buff changes to indicate its full diff --git a/data/scripts/commands/ability/cover.lua b/data/scripts/commands/ability/cover.lua index 5bba25bd..84d3f121 100644 --- a/data/scripts/commands/ability/cover.lua +++ b/data/scripts/commands/ability/cover.lua @@ -17,7 +17,8 @@ function onSkillFinish(caster, target, skill, action, actionContainer) coverTier = 2; end - actionContainer.AddAction(caster.statusEffects.AddStatusForBattleAction(223063, coverTier)); + actionContainer.AddAction(caster.statusEffects.AddStatusForBattleAction(223063, coverTier, skill.statusDuration)); + --Apply Covered to target action.DoAction(caster, target, skill, actionContainer); end; \ No newline at end of file diff --git a/data/scripts/commands/ability/hundred_fists.lua b/data/scripts/commands/ability/hundred_fists.lua new file mode 100644 index 00000000..716534d7 --- /dev/null +++ b/data/scripts/commands/ability/hundred_fists.lua @@ -0,0 +1,17 @@ +require("global"); +require("ability"); +require("modifiers"); + +function onAbilityPrepare(caster, target, ability) + return 0; +end; + +function onAbilityStart(caster, target, ability) + return 0; +end; + +function onSkillFinish(caster, target, skill, action, actionContainer) + --Take off 1/3 of attack delay. Not sure if this is the exact amount HF reduces by + action.statusMagnitude = 0.33 * caster.GetMod(modifiersGlobal.AttackDelay); + action.DoAction(caster, target, skill, actionContainer); +end; \ No newline at end of file diff --git a/data/scripts/commands/ability/resonance.lua b/data/scripts/commands/ability/resonance.lua new file mode 100644 index 00000000..0cae6d8d --- /dev/null +++ b/data/scripts/commands/ability/resonance.lua @@ -0,0 +1,15 @@ +require("global"); +require("ability"); + +function onAbilityPrepare(caster, target, ability) + return 0; +end; + +function onAbilityStart(caster, target, ability) + return 0; +end; + +function onSkillFinish(caster, target, skill, action, actionContainer) + --DoAction handles rates, buffs, dealing damage + action.DoAction(caster, target, skill, actionContainer); +end; \ No newline at end of file diff --git a/data/scripts/commands/ability/second_wind.lua b/data/scripts/commands/ability/second_wind.lua index 3be2eab7..7bbd4986 100644 --- a/data/scripts/commands/ability/second_wind.lua +++ b/data/scripts/commands/ability/second_wind.lua @@ -1,5 +1,6 @@ require("global"); require("modifiers"); +require("utils") --require("ability"); function onAbilityPrepare(caster, target, ability) @@ -20,9 +21,11 @@ end; -- An additional random integer (580 at level 50. +/- 3%) function onSkillFinish(caster, target, skill, action, actionContainer) --Base amount seems to be 0.215x^2 - 0.35x + 60 + --^ this isn't totally correct local amount = (0.215 * math.pow(caster.GetLevel(), 2)) - (0.35 * caster.GetLevel()) + 60; - --Heals can vary by up to 3% - amount = math.Clamp(amount * (0.97 + (math.rand() * 3.0)), 0, 9999); + + --Heals can vary by up to 3.5% + amount = math.Clamp(amount * (0.965 + (math.random() * 0.07)), 0, 9999); --PGL gets an INT bonus for Second Wind if caster.GetClass() == 2 then @@ -34,6 +37,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer) amount = amount * 1.25; end; + action.amount = amount; --DoAction handles rates, buffs, dealing damage action.DoAction(caster, target, skill, actionContainer); end; \ No newline at end of file diff --git a/data/scripts/commands/magic/ballad_of_magi.lua b/data/scripts/commands/magic/ballad_of_magi.lua index 8f1a2003..7c508477 100644 --- a/data/scripts/commands/magic/ballad_of_magi.lua +++ b/data/scripts/commands/magic/ballad_of_magi.lua @@ -1,15 +1,58 @@ require("global"); require("magic"); -function onMagicPrepare(caster, target, spell) +function onMagicPrepare(caster, target, skill) return 0; end; -function onMagicStart(caster, target, spell) - return 0; +function onMagicStart(caster, target, skill) + --Ballad gives 20 MP a tick at 50 + --BV gives 40 MP per tick + --Formula seems to be 0.8 * level - 20, not sure why BV gives 71 at 50 then + local mpPerTick = (0.8 * caster.GetLevel()) - 20; + + --8032705: Choral Shirt: Enhances Ballad of Magi + --With Choral Shirt, Ballad gives 26 mp a tick. It could be a flat 6 or multiply by 1.3 + --Because minuet seemed like a normal addition I'm assuming this is too + local shirt = caster.GetEquipment().GetItemAtSlot(10); + if shirt and shirt.itemId == 8032705 then + mpPerTick = mpPerTick + 6; + end + + --223253: Battle Voice + --Battle Voice doubles effect of songs + if caster.statusEffects.HasStatusEffect(223253) then + mpPerTick = mpPerTick * 2; + --Set status tier so we can check it later when BV falls off + skill.statusTier = 2; + end + + skill.statusMagnitude = mpPerTick; end; function onSkillFinish(caster, target, skill, action, actionContainer) + --223224: Swiftsong + --223255: Paeon of War + --223256: Minuet of Rigor + -- + local oldSong; + local swiftSong = target.statusEffects.GetStatusEffectById(223224); + local paeon = target.statusEffects.GetStatusEffectById(223255); + local minuet = target.statusEffects.GetStatusEffectById(223256); + if swiftSong and swiftSong.GetSource() == caster then + oldSong = swiftSong; + elseif paeon and paeon.GetSource() == caster then + oldSong = paeon; + elseif minuet and minuet.GetSource() == caster then + oldSong = minuet; + elseif ballad and ballad.GetSource() == caster then + oldSong = ballad; + end + + if oldSong then + target.statusEffects.RemoveStatusEffect(oldSong); + end + --DoAction handles rates, buffs, dealing damage action.DoAction(caster, target, skill, actionContainer); end; \ No newline at end of file diff --git a/data/scripts/commands/magic/minuet_of_rigor.lua b/data/scripts/commands/magic/minuet_of_rigor.lua index 8f1a2003..bcb5723a 100644 --- a/data/scripts/commands/magic/minuet_of_rigor.lua +++ b/data/scripts/commands/magic/minuet_of_rigor.lua @@ -1,15 +1,56 @@ require("global"); require("magic"); -function onMagicPrepare(caster, target, spell) +function onMagicPrepare(caster, target, skill) return 0; end; -function onMagicStart(caster, target, spell) - return 0; +function onMagicStart(caster, target, skill) + --Miuet gives 35 ACC/MACC by default at level 50. Minuet does scale with level + --BV apparetnly gives 71 ACc/MACC + --Formula seems to be level - 15, not sure why BV gives 71 at 50 then + local acc = caster.GetLevel() - 15; + + --8071405: Choral Ringbands: Enhances Minuet of Rigor + --With Choral Tights, Minuet gives 60 ACC/MACC at 50. Unsure what it is at lower levels (ie if it's a flat added 25 MP or a multiplier) + --Assuming it's a flat 25 because that makes more sense than multiplying by 1.714 + local gloves = caster.GetEquipment().GetItemAtSlot(13); + if gloves and gloves.itemId == 8071405 then + acc = acc + 25; + end + + --223253: Battle Voice + --Battle Voice doubles effect of songs + if caster.statusEffects.HasStatusEffect(223253) then + acc = acc * 2; + --Set status tier so we can check it later when BV falls off + skill.statusTier = 2; + end + + skill.statusMagnitude = acc; end; function onSkillFinish(caster, target, skill, action, actionContainer) + --223224: Swiftsong + --223254: Ballad Of Magi + --223255: Paeon of War + --If target has one of these effects that was from this caster, remove it + local oldSong; + local swiftSong = target.statusEffects.GetStatusEffectById(223224); + local ballad = target.statusEffects.GetStatusEffectById(223254); + local paeon = target.statusEffects.GetStatusEffectById(223255); + if swiftSong and swiftSong.GetSource() == caster then + oldSong = swiftSong; + elseif ballad and ballad.GetSource() == caster then + oldSong = ballad; + elseif paeon and paeon.GetSource() == caster then + oldSong = paeon; + end + + if oldSong then + target.statusEffects.RemoveStatusEffect(oldSong); + end + --DoAction handles rates, buffs, dealing damage action.DoAction(caster, target, skill, actionContainer); end; \ No newline at end of file diff --git a/data/scripts/commands/magic/paeon_of_war.lua b/data/scripts/commands/magic/paeon_of_war.lua index 8f1a2003..932a9767 100644 --- a/data/scripts/commands/magic/paeon_of_war.lua +++ b/data/scripts/commands/magic/paeon_of_war.lua @@ -1,15 +1,54 @@ require("global"); require("magic"); -function onMagicPrepare(caster, target, spell) +function onMagicPrepare(caster, target, skill) return 0; end; -function onMagicStart(caster, target, spell) - return 0; +function onMagicStart(caster, target, skill) + --Restores 50 TP/tick normally. With Choral Tights it's 60 TP. With Battle voice it's 100, 120 with Coral Tights. + --Battle voice is handled in the Battle Voice script + --Paeon does not scale with level + local tpPerTick = 50; + + --8051405: Choral Tights: Enhances Paeon Of War + local pants = caster.GetEquipment().GetItemAtSlot(12); + if pants and pants.itemId == 8051405 then + tpPerTick = 60; + end + + --223253: Battle Voice + --Battle Voice doubles effect of songs + if caster.statusEffects.HasStatusEffect(223253) then + tpPerTick = tpPerTick * 2; + --Set status tier so we can check it later when BV falls off + skill.statusTier = 2; + end + + skill.statusMagnitude = tpPerTick; end; function onSkillFinish(caster, target, skill, action, actionContainer) + --223224: Swiftsong + --223254: Ballad Of Magi + --223256: Minuet of Rigor + --If target has one of these effects that was from this caster, remove it + local oldSong; + local swiftSong = target.statusEffects.GetStatusEffectById(223224); + local ballad = target.statusEffects.GetStatusEffectById(223254); + local minuet = target.statusEffects.GetStatusEffectById(223256); + if swiftSong and swiftSong.GetSource() == caster then + oldSong = swiftSong; + elseif ballad and ballad.GetSource() == caster then + oldSong = ballad; + elseif minuet and minuet.GetSource() == caster then + oldSong = minuet; + end + + if oldSong then + target.statusEffects.RemoveStatusEffect(oldSong); + end + --DoAction handles rates, buffs, dealing damage action.DoAction(caster, target, skill, actionContainer); end; \ No newline at end of file diff --git a/data/scripts/commands/magic/raise.lua b/data/scripts/commands/magic/raise.lua index ef5b8ad1..ea794ea8 100644 --- a/data/scripts/commands/magic/raise.lua +++ b/data/scripts/commands/magic/raise.lua @@ -8,11 +8,11 @@ end; function onMagicStart(caster, target, spell) --27363: Enhanced Raise: No longer inflicts weakness. if caster.HasTrait(27363) then - ability.statusTier = 2; + ability.statusId = 0; end return 0; end; + +--Not sure how raise works yet. function onSkillFinish(caster, target, skill, action, actionContainer) - --DoAction handles rates, buffs, dealing damage - action.DoAction(caster, target, skill, actionContainer); end; \ No newline at end of file diff --git a/data/scripts/effects/aegis_boon.lua b/data/scripts/effects/aegis_boon.lua index a710e113..2f909fd1 100644 --- a/data/scripts/effects/aegis_boon.lua +++ b/data/scripts/effects/aegis_boon.lua @@ -1,10 +1,8 @@ -require("global") require("modifiers") -require("hiteffect") require("utils") --Forces a full block (0 damage taken) -function onPreAction(caster, target, effect, skill, action, actionContainer) +function onPreAction(effect, caster, target, skill, action, actionContainer) --If action hit from the rear and is a weaponskill ation action.blockRate = 100.0; end; diff --git a/data/scripts/effects/aero.lua b/data/scripts/effects/aero.lua index d6e012ee..53a413c4 100644 --- a/data/scripts/effects/aero.lua +++ b/data/scripts/effects/aero.lua @@ -1,8 +1,10 @@ +require("modifiers") + --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) +function onGain(owner, effect) owner.AddMod(modifiersGlobal.RegenDown, effect.GetMagnitude()); end; -function onLose(target, effect) +function onLose(owner, effect) owner.AddMod(modifiersGlobal.RegenDown, effect.GetMagnitude()); end; \ No newline at end of file diff --git a/data/scripts/effects/ballad_of_magi.lua b/data/scripts/effects/ballad_of_magi.lua new file mode 100644 index 00000000..e64f5751 --- /dev/null +++ b/data/scripts/effects/ballad_of_magi.lua @@ -0,0 +1,10 @@ +require("modifiers") + +function onGain(owner, effect) + --Only one song per bard can be active, need to figure out a good way to do this + owner.AddMod(modifiersGlobal.Refresh, effect.GetMagnitude()); +end; + +function onLose(owner, effect) + owner.SubtractMod(modifiersGlobal.Refresh, effect.GetMagnitude()); +end; \ No newline at end of file diff --git a/data/scripts/effects/barrage.lua b/data/scripts/effects/barrage.lua index 3273cc49..59c097da 100644 --- a/data/scripts/effects/barrage.lua +++ b/data/scripts/effects/barrage.lua @@ -1,9 +1,3 @@ -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 diff --git a/data/scripts/effects/battle_voice.lua b/data/scripts/effects/battle_voice.lua new file mode 100644 index 00000000..4cbc19ff --- /dev/null +++ b/data/scripts/effects/battle_voice.lua @@ -0,0 +1,3 @@ +require("modifiers") + +--BV doesn't really do anything i think \ No newline at end of file diff --git a/data/scripts/effects/berserk2.lua b/data/scripts/effects/berserk2.lua index fc6b9193..0a7d37ec 100644 --- a/data/scripts/effects/berserk2.lua +++ b/data/scripts/effects/berserk2.lua @@ -1,5 +1,4 @@ require("modifiers"); -require("battleutils"); function onGain(owner, effect) owner.statusEffects.RemoveStatusEffect(223208); diff --git a/data/scripts/effects/bind.lua b/data/scripts/effects/bind.lua index fa322f97..2ef3b0f4 100644 --- a/data/scripts/effects/bind.lua +++ b/data/scripts/effects/bind.lua @@ -1,11 +1,7 @@ require("modifiers"); function onGain(target, effect) - local currEvade = target.GetMod(modifierGlobals.Evasion); - target.SetMod(modifierGlobals.Evasion, currEvade + 15); end; function onLose(target, effect) - local currEvade = target.GetMod(modifierGlobals.Evasion); - target.SetMod(modifierGlobals.Evasion, currEvade - 15); end; \ No newline at end of file diff --git a/data/scripts/effects/blind.lua b/data/scripts/effects/blind.lua new file mode 100644 index 00000000..277e3746 --- /dev/null +++ b/data/scripts/effects/blind.lua @@ -0,0 +1,9 @@ +require("modifiers") + +function onGain(owner, effect) + owner.AddMod(modifiersGlobal.Accuracy, effect.GetMagnitude()); +end; + +function onLose(owner, effect) + owner.AddMod(modifiersGlobal.Accuracy, effect.GetMagnitude()); +end; \ No newline at end of file diff --git a/data/scripts/effects/blindside.lua b/data/scripts/effects/blindside.lua index a88a63fe..27590af4 100644 --- a/data/scripts/effects/blindside.lua +++ b/data/scripts/effects/blindside.lua @@ -2,7 +2,7 @@ require("modifiers") require("battleutils") --Forces crit of a single WS action from rear. -function onPreAction(caster, target, effect, skill, action, actionContainer) +function onPreAction(effect, caster, target, 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% diff --git a/data/scripts/effects/blood_for_blood.lua b/data/scripts/effects/blood_for_blood.lua index e9b8f0fb..b63c88bd 100644 --- a/data/scripts/effects/blood_for_blood.lua +++ b/data/scripts/effects/blood_for_blood.lua @@ -1,20 +1,20 @@ -require("modifiers") -require("hiteffect") +require("battleUtils") ---Takes 10% of hp rounded down +--Takes 10% of hp rounded down when using a weaponskill --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; +function onPreAction(effect, caster, target, skill, action, actionContainer) + if skill.commandType == CommandType.Weaponskill then + local hpToRemove = math.floor(caster.GetHP() * 0.10); + local modifier = 1.10; - if (effect.GetTier() == 2) then - modifier = 1.25; + if effect.GetTier() == 2 then + modifier = 1.125; + end + + action.amount = action.amount * modifier; + caster.DelHP(hpToRemove); + + --Remove status and add message + actionContainer.AddAction(target.statusEffects.RemoveForBattleAction(effect)); end - - action.amount = action.amount * modifier; - caster.DelHP(hpToRemove); - - --Remove status and add message - actionContainer.AddAction(target.statusEffects.RemoveForBattleAction(effect)); -end; - +end; \ No newline at end of file diff --git a/data/scripts/effects/bloodbath.lua b/data/scripts/effects/bloodbath.lua index 2e6ea6a9..b74d099e 100644 --- a/data/scripts/effects/bloodbath.lua +++ b/data/scripts/effects/bloodbath.lua @@ -1,5 +1,4 @@ require("modifiers"); -require("battleutils"); --Absorb HP on next WS or ability function onHit(effect, attacker, defender, action, actionContainer) diff --git a/data/scripts/effects/bloodletter.lua b/data/scripts/effects/bloodletter.lua index 487041de..2a4b0129 100644 --- a/data/scripts/effects/bloodletter.lua +++ b/data/scripts/effects/bloodletter.lua @@ -1,3 +1,5 @@ +require("modifiers") + --This is the comboed version of bloodletter. --All videos I can find have it dealing 15 damage. --Damage type is projectile. diff --git a/data/scripts/effects/bloodletter2.lua b/data/scripts/effects/bloodletter2.lua index 0ed394e0..01449669 100644 --- a/data/scripts/effects/bloodletter2.lua +++ b/data/scripts/effects/bloodletter2.lua @@ -1,3 +1,5 @@ +require("modifiers") + --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); diff --git a/data/scripts/effects/cleric_stance.lua b/data/scripts/effects/cleric_stance.lua index 061d13e4..2bb252d8 100644 --- a/data/scripts/effects/cleric_stance.lua +++ b/data/scripts/effects/cleric_stance.lua @@ -1,13 +1,12 @@ 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 +function onGain(target, effect) + --Multiples Attack Magic Potency by 1.2 and Healing Magic Potency by 0.8 + target.SetMod(modifiersGlobal.MagicAttack, target.GetMod(modifiersGlobal.MagicAttack) * 1.2); + target.SetMod(modifiersGlobal.MagicHeal, target.GetMod(modifiersGlobal.MagicHeal) * 0.8); end; +function onLose(target, effect) + target.SetMod(modifiersGlobal.MagicAttack, target.GetMod(modifiersGlobal.MagicAttack) / 1.2); + target.SetMod(modifiersGlobal.MagicHeal, target.GetMod(modifiersGlobal.MagicHeal) / 0.8); +end; \ No newline at end of file diff --git a/data/scripts/effects/collusion.lua b/data/scripts/effects/collusion.lua index ae1d34de..7f015f81 100644 --- a/data/scripts/effects/collusion.lua +++ b/data/scripts/effects/collusion.lua @@ -1,7 +1,4 @@ -require("global") require("modifiers") -require("hiteffect") -require("utils") function onHit(effect, attacker, defender, action, actionContainer) local enmity = action.enmity; diff --git a/data/scripts/effects/cover.lua b/data/scripts/effects/cover.lua index 590583a6..b63b5e5c 100644 --- a/data/scripts/effects/cover.lua +++ b/data/scripts/effects/cover.lua @@ -1,9 +1,8 @@ -require("global") require("modifiers") -require("hiteffect") -require("utils") ---Restores 25% of damage taken as MP. Does not send a message +--Enahnced Cover: 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); + if effect.GetTier() == 2 then + defender.AddMP(0.25 * action.amount); + end end; \ No newline at end of file diff --git a/data/scripts/effects/covered.lua b/data/scripts/effects/covered.lua new file mode 100644 index 00000000..129ba9a3 --- /dev/null +++ b/data/scripts/effects/covered.lua @@ -0,0 +1,15 @@ +require("battleUtils") + +--If person who cast cover is within 8y, change the action's target to them +--Not sure what attacks are valid. It only says "melee attacks", unsure if that includes weaponskills and abilities or just auto attacks +--Right now this will probably be really buggy, since Covered is not necessarily the first effect that will activate on the target + +--Really need to do more research on this, figure out how it interacts with multi-hit attacks, aoe attacks (if those count as melee ever?), etc. +--If it redirects the whole attack instead of a single hit, we might need a new that activates while iterating over targets. +function onPreAction(effect, caster, target, skill, action, actionContainer) + if not skill.isRanged then + if effect.GetSource().IsAlive() and getDistanceBetweenActors(effect.GetSource(), target) <= 8 then + target = effect.GetSource(); + end + end +end; \ No newline at end of file diff --git a/data/scripts/effects/dark_seal2.lua b/data/scripts/effects/dark_seal2.lua new file mode 100644 index 00000000..61cf1a1e --- /dev/null +++ b/data/scripts/effects/dark_seal2.lua @@ -0,0 +1,13 @@ +require("modifiers") +require("battleutils") + +--Increases accuracy of next cast. +--There isn't really any information on this, but due to the fact it falls off BEFORE the target is hit, +--I'm assuming it increases a spell's accuracy modifier instead of giving actual magic accuracy +function onCommandStart(effect, owner, skill, actionContainer) + if skill.actionType == ActionType.Magic then + --50 is random guess. + skill.accuracyModifier = skill.accuracyModifier + 50; + actionContainer.AddAction(owner.RemoveStatusEffectForBattleAction(effect)); + end +end \ No newline at end of file diff --git a/data/scripts/effects/decoy.lua b/data/scripts/effects/decoy.lua index 284d13d3..e5a6e860 100644 --- a/data/scripts/effects/decoy.lua +++ b/data/scripts/effects/decoy.lua @@ -2,15 +2,15 @@ require("modifiers") require("battleutils") --This is the untraited version of decoy. - -function onPreAction(caster, target, effect, skill, action, actionContainer) +function onPreAction(effect, caster, target, skill, action, actionContainer) --Evade single ranged or magic attack --Traited allows for physical attacks - if skill.isRanged or action.actionType == ActionType.Magic then + if target.allegiance != caster.allegiance and (skill.isRanged or action.actionType == ActionType.Magic) then --Set action's hit rate to 0 action.hirRate = 0.0; + + --Remove status and add message + actionContainer.AddAction(target.statusEffects.RemoveStatusEffectForBattleAction(effect)); end - --Remove status and add message - actionsList.AddAction(target.statusEffects.RemoveForBattleAction(effect)); end; \ No newline at end of file diff --git a/data/scripts/effects/decoy2.lua b/data/scripts/effects/decoy2.lua index d6cbf909..bac5a365 100644 --- a/data/scripts/effects/decoy2.lua +++ b/data/scripts/effects/decoy2.lua @@ -2,15 +2,14 @@ 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) +function onPreAction(effect, caster, target, 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 + if target.allegiance != caster.allegiance and (skill.isRanged or action.actionType == ActionType.Magic or action.actionType == ActionType.Physical) then --Set action's hit rate to 0 action.hirRate = 0.0; + --Remove status and add message + actionContainer.AddAction(target.statusEffects.RemoveStatusEffectForBattleAction(effect)); end - --Remove status and add message - actionsList.AddAction(target.statusEffects.RemoveForBattleAction(effect)); end; \ No newline at end of file diff --git a/data/scripts/effects/default.lua b/data/scripts/effects/default.lua index 8337c090..b74871e4 100644 --- a/data/scripts/effects/default.lua +++ b/data/scripts/effects/default.lua @@ -1,2 +1,5 @@ +function onGain(target, effect) +end; + function onLose(target, effect) end; \ No newline at end of file diff --git a/data/scripts/effects/defense_down.lua b/data/scripts/effects/defense_down.lua index 28de72b9..19b20cc9 100644 --- a/data/scripts/effects/defense_down.lua +++ b/data/scripts/effects/defense_down.lua @@ -1,3 +1,5 @@ +require("modifiers") + function onGain(owner, effect) owner.SubtractMod(modifiersGlobal.Defense, effect.GetMagnitude()); end diff --git a/data/scripts/effects/divine_regen.lua b/data/scripts/effects/divine_regen.lua index 0d29706c..f137f72a 100644 --- a/data/scripts/effects/divine_regen.lua +++ b/data/scripts/effects/divine_regen.lua @@ -1,13 +1,6 @@ ---Consistent 85HP/tick normal; 113HP/tick with AF pants +require("modifiers") + 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 diff --git a/data/scripts/effects/divine_veil.lua b/data/scripts/effects/divine_veil.lua index edd08034..b81fb802 100644 --- a/data/scripts/effects/divine_veil.lua +++ b/data/scripts/effects/divine_veil.lua @@ -1,5 +1,4 @@ require("modifiers") -require("hiteffect") --Increases block rate by 100% function onGain(owner, effect) @@ -11,12 +10,21 @@ function onLose(owner, effect) end --Applys Divine Regen to party in range when healed by cure or cura -function onBlock(caster, target, effect, skill, action, actionContainer) +function onHealed(caster, target, effect, skill, action, actionContainer) -- cure cura if (skill.id == 27346 or skill.id == 27347) and (caster != owner) then + local regenDuration = 30; + --Apparently heals for 85 without AF, 113 with. Unsure if these can be improved with stats + local magnitude = 85 + + --Need a better way to set magnitude when adding effects + if effect.GetTier() == 2 then + magnitude = 113; + end + --For each party member in range, add divine regen for chara in owner.GetPartyMembersInRange(8) do - local addAction = chara.statusEffects.AddStatusForBattleAction(223264, 2); + local addAction = chara.statusEffects.AddStatusForBattleAction(223264, effect.GetTier(), magnitude, regenDuration); actionContainer.AddAction(addAction); end end diff --git a/data/scripts/effects/dread_spike.lua b/data/scripts/effects/dread_spike.lua index 94888302..e5677cd1 100644 --- a/data/scripts/effects/dread_spike.lua +++ b/data/scripts/effects/dread_spike.lua @@ -3,17 +3,24 @@ 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 +--When I say it nullifies an attack, it even gets rid of the message. It's as if the damage action didn't happen. +--It still shows the enemy's "Enemy used [command]." message but there is no 0 damage dealt message. --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; + local absorbPercent = 0.5; + + if effect.GetTier() == 2 then + absorbPercent = 1; + end + + local absorbAmount = action.amount * absorbPercent; action.amount = 0; action.worldMasterTextId = 0; - attacker.AddHP(absorbAmount); + defender.AddHP(absorbAmount); --30451: You recover [absorbAmount] HP. actionContainer.AddHPAction(defender.actorId, 30451, absorbAmount) --Dread Spike is lost after absorbing hp diff --git a/data/scripts/effects/excruciate.lua b/data/scripts/effects/excruciate.lua new file mode 100644 index 00000000..59e3e499 --- /dev/null +++ b/data/scripts/effects/excruciate.lua @@ -0,0 +1,30 @@ +require("modifiers") +require("battleutils") + +--Gradually increases critical rate of spells +function onTick(owner, effect) + --No clue how fast the crit rate increases or how often it ticks + --Only clue I have to go on is that the strategy seemed to be to use it + --before or after fire/thunder and you'd usually get a crit at firaga/thundaga + --Random guess, going to assume it's 25 crit rating every 3s, 50 crit rating traited + --That's 4% and 8% every 3 seconds of actual crit + local ratePerTick = 25; + + if effect.GetTier() == 2 then + ratePerTick = 50; + end + + effect.SetMagnitude(effect.GetMagnitude() + ratePerTick); +end + +--Excruciate seems to have an effect on all hits of aoe spells, so it's changing the crit bonus of the skill itself +--rather than on a hit by hit basis +function onCommandStart(effect, owner, skill, actionContainer) + skill.bonusCritRate = skill.bonusCritRate + effect.GetMagnitude(); +end + +function onCrit(effect, attacker, defender, action, actionContainer) + if action.commandType == CommandType.Spell then + actionContainer.AddAction(attacker.statusEffects.RemoveStatusEffectForBattleAction(effect)); + end +end \ No newline at end of file diff --git a/data/scripts/effects/fully_blissful_mind.lua b/data/scripts/effects/fully_blissful_mind.lua index 678c10e5..bbd1b7ef 100644 --- a/data/scripts/effects/fully_blissful_mind.lua +++ b/data/scripts/effects/fully_blissful_mind.lua @@ -3,9 +3,5 @@ function onGain(owner, effect) effect.SetExtra(effect.GetMagnitude()); end -function onTick(owner, effect) - print("hi") -end - function onLose(owner, effect) end diff --git a/data/scripts/effects/haste.lua b/data/scripts/effects/haste.lua new file mode 100644 index 00000000..328f0f90 --- /dev/null +++ b/data/scripts/effects/haste.lua @@ -0,0 +1,10 @@ +require("modifiers") + +--Set magnitude to milliseconds that HF will reduce delay by +function onGain(target, effect) + target.SubtractMod(modifiersGlobal.AttackDelay, effect.GetMagnitude()); +end; + +function onLose(target, effect) + target.AddMod(modifiersGlobal.AttackDelay, effect.GetMagnitude()); +end; \ No newline at end of file diff --git a/data/scripts/effects/hawks_eye.lua b/data/scripts/effects/hawks_eye.lua index 99876524..a62f2b9a 100644 --- a/data/scripts/effects/hawks_eye.lua +++ b/data/scripts/effects/hawks_eye.lua @@ -4,6 +4,8 @@ require("modifiers"); --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%) +--It's also possible that Hawk's Eye gives 15 + 15% accuracy untraited, which would give 450.85, which would be rounded down. +--In that case, traited hawks eye could be 15 + 22.5% or 22.5 + 22.5% or (15 + 15%) * 1.5 function onGain(target, effect) local accuracyMod = 0.1875; diff --git a/data/scripts/effects/hp_boost.lua b/data/scripts/effects/hp_boost.lua index ca20c3b1..d3c93575 100644 --- a/data/scripts/effects/hp_boost.lua +++ b/data/scripts/effects/hp_boost.lua @@ -11,5 +11,5 @@ function onGain(target, effect) end; function onLose(target, effect) - target.SetMaxHP(target.GetMaxHP() * 0.75); + target.SetMaxHP(target.GetMaxHP() / 1.25); end; \ No newline at end of file diff --git a/data/scripts/effects/hundred_fists.lua b/data/scripts/effects/hundred_fists.lua index 3622161b..28b32b7b 100644 --- a/data/scripts/effects/hundred_fists.lua +++ b/data/scripts/effects/hundred_fists.lua @@ -1,13 +1,10 @@ require("modifiers") ---will this break with things like slow? +--Set magnitude to milliseconds that HF will reduce delay by function onGain(target, effect) - local currDelay = target.GetMod(modifiersGlobal.AttackDelay); - target.SetMod(modifiersGlobal.AttackDelay), 0.66 * currDelay); + target.SubtractMod(modifiersGlobal.AttackDelay), effect.GetMagnitude()); end; function onLose(target, effect) - local currDelay = target.GetMod(modifiersGlobal.AttackDelay); - target.SetMod(modifiersGlobal.AttackDelay), 1.50 * currDelay); -end; - + target.AddMod(modifiersGlobal.AttackDelay), effect.GetMagnitude()); +end; \ No newline at end of file diff --git a/data/scripts/effects/invigorate.lua b/data/scripts/effects/invigorate.lua index 8502c5f0..a4aac14c 100644 --- a/data/scripts/effects/invigorate.lua +++ b/data/scripts/effects/invigorate.lua @@ -1,3 +1,5 @@ +require("modifiers") + --100 TP per tick without AF. 133 TP per tick with AF function onGain(owner, effect) owner.AddMod(modifiersGlobal.Regain, effect.GetMagnitude()); diff --git a/data/scripts/effects/keen_flurry.lua b/data/scripts/effects/keen_flurry.lua index b9ff8042..d80ea770 100644 --- a/data/scripts/effects/keen_flurry.lua +++ b/data/scripts/effects/keen_flurry.lua @@ -1,5 +1,3 @@ -require("modifiers") -require("hiteffect") require("battleutils") --Untraited reduces cooldown by 50% diff --git a/data/scripts/effects/life_surge_I.lua b/data/scripts/effects/life_surge_I.lua index f99655ea..3f3a5ab5 100644 --- a/data/scripts/effects/life_surge_I.lua +++ b/data/scripts/effects/life_surge_I.lua @@ -1,5 +1,3 @@ -require("modifiers") -require("hiteffect") require("battleutils") --Heals for 30%? of damage dealt on auto attacks. diff --git a/data/scripts/effects/life_surge_II.lua b/data/scripts/effects/life_surge_II.lua index 22f69cb2..3b74a94e 100644 --- a/data/scripts/effects/life_surge_II.lua +++ b/data/scripts/effects/life_surge_II.lua @@ -1,5 +1,3 @@ -require("modifiers") -require("hiteffect") require("battleutils") function onHit(effect, attacker, defender, action, actionContainer) diff --git a/data/scripts/effects/life_surge_III.lua b/data/scripts/effects/life_surge_III.lua index f99655ea..3f3a5ab5 100644 --- a/data/scripts/effects/life_surge_III.lua +++ b/data/scripts/effects/life_surge_III.lua @@ -1,5 +1,3 @@ -require("modifiers") -require("hiteffect") require("battleutils") --Heals for 30%? of damage dealt on auto attacks. diff --git a/data/scripts/effects/magic_evasion_down.lua b/data/scripts/effects/magic_evasion_down.lua index d043c8a5..2afa58ba 100644 --- a/data/scripts/effects/magic_evasion_down.lua +++ b/data/scripts/effects/magic_evasion_down.lua @@ -1,4 +1,5 @@ ---Bloodletter2 is the uncomboed version of Bloodletter. It doesn't deal any additional damage when it falls off but has the same tick damage +require("modifiers") + function onGain(owner, effect) owner.SubtractMod(modifiersGlobal.MagicEvasion, effect.GetMagnitude()); end diff --git a/data/scripts/effects/mighty_strikes.lua b/data/scripts/effects/mighty_strikes.lua index 4253d792..5778c3d9 100644 --- a/data/scripts/effects/mighty_strikes.lua +++ b/data/scripts/effects/mighty_strikes.lua @@ -1,8 +1,5 @@ -require("modifiers") -require("battleutils") - --Forces crit on attacks made with axes -function onPreAction(caster, target, effect, skill, action, actionContainer) +function onPreAction(effect, caster, target, 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% diff --git a/data/scripts/effects/minuet_of_rigor.lua b/data/scripts/effects/minuet_of_rigor.lua new file mode 100644 index 00000000..87919522 --- /dev/null +++ b/data/scripts/effects/minuet_of_rigor.lua @@ -0,0 +1,12 @@ +require("modifiers") + +function onGain(owner, effect) + --Only one song per bard can be active, need to figure out a good way to do this + owner.AddMod(modifiersGlobal.Accuracy, effect.GetMagnitude()); + owner.AddMod(modifiersGlobal.MagicAccuracy, effect.GetMagnitude()); +end; + +function onLose(owner, effect) + owner.SubtractMod(modifiersGlobal.Accuracy, effect.GetMagnitude()); + owner.SubtractMod(modifiersGlobal.MagicAccuracy, effect.GetMagnitude()); +end; \ No newline at end of file diff --git a/data/scripts/effects/necrogenesis.lua b/data/scripts/effects/necrogenesis.lua new file mode 100644 index 00000000..e340f958 --- /dev/null +++ b/data/scripts/effects/necrogenesis.lua @@ -0,0 +1,12 @@ +require("modifiers") +require("battleutils") + +function onHit(effect, attacker, defender, action, actionContainer) + if action.commandType == CommandType.Spell then + --Necrogenesis returns 75% of damage done rounded up(?) as MP. + local hpToReturn = math.ceil(0.75 * action.amount); + attacker.AddMp(hpToReturn); + actionContainer.AddHPAction(attacker.actorId, 33012, mpToReturn); + actionContainer.AddAction(attacker.statusEffects.RemoveStatusEffectForBattleAction(effect)); + end +end \ No newline at end of file diff --git a/data/scripts/effects/outmaneuver2.lua b/data/scripts/effects/outmaneuver2.lua index 6d5fffbe..f54e864e 100644 --- a/data/scripts/effects/outmaneuver2.lua +++ b/data/scripts/effects/outmaneuver2.lua @@ -1,6 +1,4 @@ require("modifiers") -require("hiteffect") -require("battleutils") --Add 30 raw block rate. No idea how much block it actually gives. function onGain(owner, effect) diff --git a/data/scripts/effects/paeon_of_war.lua b/data/scripts/effects/paeon_of_war.lua new file mode 100644 index 00000000..ec50abf6 --- /dev/null +++ b/data/scripts/effects/paeon_of_war.lua @@ -0,0 +1,10 @@ +require("modifiers") + +function onGain(owner, effect) + --Only one song per bard can be active, need to figure out a good way to do this + owner.AddMod(modifiersGlobal.Regain, effect.GetMagnitude()); +end; + +function onLose(owner, effect) + owner.SubtractMod(modifiersGlobal.Regain, effect.GetMagnitude()); +end; \ No newline at end of file diff --git a/data/scripts/effects/parsimony.lua b/data/scripts/effects/parsimony.lua new file mode 100644 index 00000000..cb3ea325 --- /dev/null +++ b/data/scripts/effects/parsimony.lua @@ -0,0 +1,17 @@ +require("modifiers") +require("battleutils") + +--Forces crit of a single WS action from rear. +function onMagicCast(caster, effect, skill) + skill.mpCost = skill.mpCost / 2; +end; + +function onHit(effect, attacker, defender, action, actionContainer) + if action.commandType == CommandType.Spell then + --Parsimony returns 35% of damage done rounded up as MP. + local mpToReturn = math.ceil(0.35 * action.amount); + attacker.AddMp(mpToReturn); + actionContainer.AddMPAction(attacker.actorId, 33007, mpToReturn); + actionContainer.AddAction(attacker.statusEffects.RemoveStatusEffectForBattleAction(effect)); + end +end \ No newline at end of file diff --git a/data/scripts/effects/poison.lua b/data/scripts/effects/poison.lua new file mode 100644 index 00000000..34f9ca6c --- /dev/null +++ b/data/scripts/effects/poison.lua @@ -0,0 +1,7 @@ +function onGain(owner, effect) + owner.AddMod(modifiersGlobal.RegenDown, effect.GetMagnitude()); +end + +function onLose(owner, effect) + owner.SubtractMod(modifiersGlobal.RegenDown, effect.GetMagnitude()); +end diff --git a/data/scripts/effects/power_surge_I.lua b/data/scripts/effects/power_surge_I.lua index ba0fe70e..ccef5719 100644 --- a/data/scripts/effects/power_surge_I.lua +++ b/data/scripts/effects/power_surge_I.lua @@ -1,5 +1,4 @@ require("modifiers") -require("hiteffect") require("battleutils") --https://www.bluegartr.com/threads/107403-Stats-and-how-they-work/page22 diff --git a/data/scripts/effects/power_surge_II.lua b/data/scripts/effects/power_surge_II.lua index 56e4daf0..dc87d18f 100644 --- a/data/scripts/effects/power_surge_II.lua +++ b/data/scripts/effects/power_surge_II.lua @@ -1,5 +1,4 @@ require("modifiers") -require("hiteffect") require("battleutils") --https://www.bluegartr.com/threads/107403-Stats-and-how-they-work/page22 diff --git a/data/scripts/effects/power_surge_III.lua b/data/scripts/effects/power_surge_III.lua index 8eb171e4..5d9e46c8 100644 --- a/data/scripts/effects/power_surge_III.lua +++ b/data/scripts/effects/power_surge_III.lua @@ -1,5 +1,4 @@ require("modifiers") -require("hiteffect") require("battleutils") --https://www.bluegartr.com/threads/107403-Stats-and-how-they-work/page22 diff --git a/data/scripts/effects/protect2.lua b/data/scripts/effects/protect2.lua index 21c40a56..0065e980 100644 --- a/data/scripts/effects/protect2.lua +++ b/data/scripts/effects/protect2.lua @@ -5,21 +5,18 @@ function onGain(target, effect) --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 defenseBuff = 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 + magicDefenseBuff = 6.67 * effect.GetMagnitude(); + for i = modifiersGlobal.ResistFire, modifiersGlobal.ResistWater do + target.AddMod(i, magicDefenseBuff); + end + end; @@ -31,13 +28,9 @@ function onLose(target, effect) --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 + magicDefenseBuff = 6.67 * effect.GetMagnitude(); + for i = modifiersGlobal.ResistFire, modifiersGlobal.ResistWater do + target.SubtractMod(i, magicDefenseBuff); + end end; diff --git a/data/scripts/effects/quelling_strike.lua b/data/scripts/effects/quelling_strike.lua index 9fb7f027..347b8e1a 100644 --- a/data/scripts/effects/quelling_strike.lua +++ b/data/scripts/effects/quelling_strike.lua @@ -1,5 +1,4 @@ require("modifiers") -require("hiteffect") require("battleutils") --Untraited reduces cooldown by 50% diff --git a/data/scripts/effects/rampage2.lua b/data/scripts/effects/rampage2.lua index b79598b8..80e7895a 100644 --- a/data/scripts/effects/rampage2.lua +++ b/data/scripts/effects/rampage2.lua @@ -1,7 +1,4 @@ -require("global") require("modifiers") -require("hiteffect") -require("battleutils") require("utils") parryPerDT = 20; diff --git a/data/scripts/effects/refresh.lua b/data/scripts/effects/refresh.lua new file mode 100644 index 00000000..b5d53fdc --- /dev/null +++ b/data/scripts/effects/refresh.lua @@ -0,0 +1,7 @@ +function onGain(owner, effect) + owner.AddMod(modifiersGlobal.Refresh, effect.GetMagnitude()); +end + +function onLose(owner, effect) + owner.SubtractMod(modifiersGlobal.Refresh, effect.GetMagnitude()); +end diff --git a/data/scripts/effects/regain.lua b/data/scripts/effects/regain.lua new file mode 100644 index 00000000..cec064eb --- /dev/null +++ b/data/scripts/effects/regain.lua @@ -0,0 +1,7 @@ +function onGain(owner, effect) + owner.AddMod(modifiersGlobal.Regain, effect.GetMagnitude()); +end + +function onLose(owner, effect) + owner.SubtractMod(modifiersGlobal.Regain, effect.GetMagnitude()); +end diff --git a/data/scripts/effects/regen.lua b/data/scripts/effects/regen.lua index ccb4f606..e63ed6d9 100644 --- a/data/scripts/effects/regen.lua +++ b/data/scripts/effects/regen.lua @@ -1,8 +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); + owner.AddMod(modifiersGlobal.Regen, effect.GetMagnitude()); end function onLose(owner, effect) - owner.SubtractMod(modifiersGlobal.Regen, effect.magnitude); + owner.SubtractMod(modifiersGlobal.Regen, effect.GetMagnitude()); end diff --git a/data/scripts/effects/resonance2.lua b/data/scripts/effects/resonance2.lua new file mode 100644 index 00000000..34b3748a --- /dev/null +++ b/data/scripts/effects/resonance2.lua @@ -0,0 +1,15 @@ +require("modifiers") +require("battleutils") + +--Increases range of a single spell, no clue by how much, 25% is a random guess +--It isn't clear if it has an effect on the aoe portion of skills or just the normal range, i've seen people on the OF say both. +function onMagicStart(caster, effect, skill) + skill.range = skill.range * 1.25; +end; + +--The effect falls off after the skill is finished, meaning if you start a cast and cancel, it shouldn't fall off. +function onCommandFinish(effect, owner, skill, actionContainer) + if action.commandType == CommandType.Spell then + actionContainer.AddAction(owner.statusEffects.RemoveStatusEffectForBattleAction(effect)); + end +end \ No newline at end of file diff --git a/data/scripts/effects/sentinel.lua b/data/scripts/effects/sentinel.lua index d913a34f..6ca3b4a1 100644 --- a/data/scripts/effects/sentinel.lua +++ b/data/scripts/effects/sentinel.lua @@ -1,4 +1,5 @@ require("modifiers") +require("battleutils") function onGain(target, effect) --Untraited Sentinel is 30% damage taken down, traited is 50% diff --git a/data/scripts/effects/stoneskin.lua b/data/scripts/effects/stoneskin.lua index c50127a8..9905d3fc 100644 --- a/data/scripts/effects/stoneskin.lua +++ b/data/scripts/effects/stoneskin.lua @@ -1,8 +1,4 @@ -require("global") -require("utils") require("modifiers") -require("hiteffect") -require("battleutils") function onGain(owner, effect) @@ -10,7 +6,7 @@ function onGain(owner, effect) end --Using extra for how much mitigation stoneskin has -function onPostAction(owner, effect, caster, skill, action, actionContainer) +function onPostAction(caster, target, effect, skill, action, actionContainer) if (owner.GetMod(modifiersGlobal.Stoneskin) <= 0) then actionContainer.AddAction(owner.statusEffects.RemoveStatusEffectForBattleAction(effect)); end diff --git a/data/scripts/effects/tempered_will.lua b/data/scripts/effects/tempered_will.lua new file mode 100644 index 00000000..4cef7878 --- /dev/null +++ b/data/scripts/effects/tempered_will.lua @@ -0,0 +1,7 @@ +function onGain(owner, effect) + owner.AddMod(modifiersGlobal.KnockbackImmune, 1); +end + +function onLose(owner, effect) + owner.SubtractMod(modifiersGlobal.KnockbackImmune, 1); +end \ No newline at end of file diff --git a/data/scripts/effects/tp_bleed.lua b/data/scripts/effects/tp_bleed.lua new file mode 100644 index 00000000..435c4842 --- /dev/null +++ b/data/scripts/effects/tp_bleed.lua @@ -0,0 +1,7 @@ +function onGain(owner, effect) + owner.SubtractMod(modifiersGlobal.Regain, effect.GetMagnitude()); +end + +function onLose(owner, effect) + owner.AddMod(modifiersGlobal.Regain, effect.GetMagnitude()); +end diff --git a/data/scripts/effects/vengeance.lua b/data/scripts/effects/vengeance.lua index bbd919bb..5c5379c4 100644 --- a/data/scripts/effects/vengeance.lua +++ b/data/scripts/effects/vengeance.lua @@ -1,7 +1,5 @@ -require("global") require("modifiers") -require("hiteffect") -require("utils") +require("battleutils") --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) diff --git a/sql/server_battle_traits.sql b/sql/server_battle_traits.sql index 2c3d7d9d..89d7930f 100644 --- a/sql/server_battle_traits.sql +++ b/sql/server_battle_traits.sql @@ -46,30 +46,30 @@ INSERT INTO `server_battle_traits` VALUES (27241,'enhanced_quelling_strike',7,32 INSERT INTO `server_battle_traits` VALUES (27243,'enhanced_raging_strike',7,36,0,0); INSERT INTO `server_battle_traits` VALUES (27244,'enhanced_decoy',7,16,0,0); INSERT INTO `server_battle_traits` VALUES (27245,'swift_chameleon',7,48,0,0); -INSERT INTO `server_battle_traits` VALUES (27246,'enhanced_physical_crit_accuracy',7,40,65,10); -INSERT INTO `server_battle_traits` VALUES (27247,'enhanced_physical_crit_evasion',7,20,66,10); +INSERT INTO `server_battle_traits` VALUES (27246,'enhanced_physical_crit_accuracy',7,40,64,10); +INSERT INTO `server_battle_traits` VALUES (27247,'enhanced_physical_crit_evasion',7,20,65,10); INSERT INTO `server_battle_traits` VALUES (27248,'enhanced_physical_evasion',7,12,16,8); -INSERT INTO `server_battle_traits` VALUES (27249,'enhanced_physical_accuracy',7,8,16,8); -INSERT INTO `server_battle_traits` VALUES (27250,'enhanced_physical_accuracy_ii',7,24,16,10); +INSERT INTO `server_battle_traits` VALUES (27249,'enhanced_physical_accuracy',7,8,15,8); +INSERT INTO `server_battle_traits` VALUES (27250,'enhanced_physical_accuracy_ii',7,24,15,10); INSERT INTO `server_battle_traits` VALUES (27120,'enhanced_second_wind',2,20,0,0); INSERT INTO `server_battle_traits` VALUES (27121,'enhanced_blindside',2,24,0,0); INSERT INTO `server_battle_traits` VALUES (27122,'swift_taunt',2,48,0,0); INSERT INTO `server_battle_traits` VALUES (27123,'enhanced_featherfoot',2,28,0,0); INSERT INTO `server_battle_traits` VALUES (27124,'enhanced_fists_of_fire',2,44,0,0); INSERT INTO `server_battle_traits` VALUES (27125,'enhanced_fists_of_earth',2,36,0,0); -INSERT INTO `server_battle_traits` VALUES (27126,'enhanced_physical_accuracy',2,16,16,8); +INSERT INTO `server_battle_traits` VALUES (27126,'enhanced_physical_accuracy',2,16,15,8); INSERT INTO `server_battle_traits` VALUES (27127,'enhanced_physical_attack',2,8,17,8); INSERT INTO `server_battle_traits` VALUES (27128,'enhanced_physical_attack_ii',2,40,17,10); INSERT INTO `server_battle_traits` VALUES (27129,'enhanced_evasion',2,12,16,8); -INSERT INTO `server_battle_traits` VALUES (27130,'enhanced_physical_crit_damage',2,32,67,10); +INSERT INTO `server_battle_traits` VALUES (27130,'enhanced_physical_crit_damage',2,32,66,10); INSERT INTO `server_battle_traits` VALUES (27160,'enhanced_sentinel',3,36,0,0); INSERT INTO `server_battle_traits` VALUES (27161,'enhanced_flash',3,28,0,0); INSERT INTO `server_battle_traits` VALUES (27162,'enhanced_flash_ii',3,48,0,0); INSERT INTO `server_battle_traits` VALUES (27163,'enhanced_rampart',3,12,0,0); INSERT INTO `server_battle_traits` VALUES (27164,'swift_aegis_boon',3,20,0,0); INSERT INTO `server_battle_traits` VALUES (27165,'enhanced_outmaneuver',3,44,0,0); -INSERT INTO `server_battle_traits` VALUES (27167,'enhanced_block_rate',3,16,52,10); -INSERT INTO `server_battle_traits` VALUES (27166,'enhanced_physical_crit_resilience',3,32,68,10); +INSERT INTO `server_battle_traits` VALUES (27167,'enhanced_block_rate',3,16,51,10); +INSERT INTO `server_battle_traits` VALUES (27166,'enhanced_physical_crit_resilience',3,32,67,10); INSERT INTO `server_battle_traits` VALUES (27168,'enhanced_physical_defense',3,8,18,10); INSERT INTO `server_battle_traits` VALUES (27169,'enhanced_physical_defense_ii',3,24,18,10); INSERT INTO `server_battle_traits` VALUES (27170,'enhanced_physical_defense_iii',3,40,18,12); @@ -79,8 +79,8 @@ INSERT INTO `server_battle_traits` VALUES (27202,'swift_bloodbath',4,16,0,0); INSERT INTO `server_battle_traits` VALUES (27203,'enhanced_enduring_march',4,48,0,0); INSERT INTO `server_battle_traits` VALUES (27204,'enhanced_rampage',4,44,0,0); INSERT INTO `server_battle_traits` VALUES (27205,'enhanced_berserk',4,36,0,0); -INSERT INTO `server_battle_traits` VALUES (27206,'enhanced_physical_crit_evasion',4,32,66,10); -INSERT INTO `server_battle_traits` VALUES (27207,'enhanced_parry',4,24,69,8); +INSERT INTO `server_battle_traits` VALUES (27206,'enhanced_physical_crit_evasion',4,32,65,10); +INSERT INTO `server_battle_traits` VALUES (27207,'enhanced_parry',4,24,68,8); INSERT INTO `server_battle_traits` VALUES (27208,'enhanced_physical_defense',4,12,18,8); INSERT INTO `server_battle_traits` VALUES (27209,'enhanced_physical_defense_ii',4,40,18,10); INSERT INTO `server_battle_traits` VALUES (27210,'enhanced_physical_attack_power',4,8,17,8); @@ -90,8 +90,8 @@ INSERT INTO `server_battle_traits` VALUES (27282,'enhanced_life_surge',8,32,0,0) INSERT INTO `server_battle_traits` VALUES (27283,'enhanced_blood_for_blood',8,48,0,0); INSERT INTO `server_battle_traits` VALUES (27284,'swift_blood_for_blood',8,16,0,0); INSERT INTO `server_battle_traits` VALUES (27285,'enhanced_keen_flurry',8,36,0,0); -INSERT INTO `server_battle_traits` VALUES (27286,'store_tp',8,12,64,50); -INSERT INTO `server_battle_traits` VALUES (27287,'enhanced_physical_crit_accuracy',8,24,65,10); +INSERT INTO `server_battle_traits` VALUES (27286,'store_tp',8,12,63,50); +INSERT INTO `server_battle_traits` VALUES (27287,'enhanced_physical_crit_accuracy',8,24,64,10); INSERT INTO `server_battle_traits` VALUES (27288,'enhanced_physical_attack_power',8,8,17,8); INSERT INTO `server_battle_traits` VALUES (27289,'enhanced_physical_attack_power_ii',8,20,17,10); INSERT INTO `server_battle_traits` VALUES (27290,'enhanced_physical_attack_power_iii',8,40,17,10); @@ -104,8 +104,8 @@ INSERT INTO `server_battle_traits` VALUES (27325,'enhanced_enfeebling_magic',22, INSERT INTO `server_battle_traits` VALUES (27326,'enhanced_enfeebling_magic_ii',22,28,26,10); INSERT INTO `server_battle_traits` VALUES (27327,'enhanced_magic_potency',22,8,23,8); INSERT INTO `server_battle_traits` VALUES (27328,'enhanced_magic_potency_ii',22,28,23,10); -INSERT INTO `server_battle_traits` VALUES (27329,'enhanced_magic_crit_potency',22,40,70,10); -INSERT INTO `server_battle_traits` VALUES (27330,'auto-refresh',22,20,45,3); +INSERT INTO `server_battle_traits` VALUES (27329,'enhanced_magic_crit_potency',22,40,69,10); +INSERT INTO `server_battle_traits` VALUES (27330,'auto-refresh',22,20,44,3); INSERT INTO `server_battle_traits` VALUES (27360,'swift_sacred_prism',23,40,0,0); INSERT INTO `server_battle_traits` VALUES (27361,'swift_shroud_of_saints',23,44,0,0); INSERT INTO `server_battle_traits` VALUES (27362,'enhanced_blissful_mind',23,32,0,0); @@ -116,7 +116,7 @@ INSERT INTO `server_battle_traits` VALUES (27366,'greater_enhancing_magic',23,12 INSERT INTO `server_battle_traits` VALUES (27367,'greater_healing',23,8,24,8); INSERT INTO `server_battle_traits` VALUES (27368,'greater_healing_ii',23,18,24,10); INSERT INTO `server_battle_traits` VALUES (27369,'enhanced_magic_accuracy',23,16,27,8); -INSERT INTO `server_battle_traits` VALUES (27370,'auto-refresh',23,20,45,3); +INSERT INTO `server_battle_traits` VALUES (27370,'auto-refresh',23,20,44,3); /*!40000 ALTER TABLE `server_battle_traits` ENABLE KEYS */; UNLOCK TABLES; commit; @@ -130,4 +130,4 @@ commit; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-04-18 14:44:11 +-- Dump completed on 2018-06-25 23:30:47 diff --git a/sql/server_statuseffects.sql b/sql/server_statuseffects.sql index 9ee44936..03c7b3c7 100644 --- a/sql/server_statuseffects.sql +++ b/sql/server_statuseffects.sql @@ -76,9 +76,12 @@ INSERT INTO `server_statuseffects` VALUES (223129,'protect',18,2,0); INSERT INTO `server_statuseffects` VALUES (223133,'stoneskin',16402,1,0); INSERT INTO `server_statuseffects` VALUES (223173,'covered',42,2,0); INSERT INTO `server_statuseffects` VALUES (223180,'regen',18,2,0); +INSERT INTO `server_statuseffects` VALUES (223181,'refresh',18,2,0); +INSERT INTO `server_statuseffects` VALUES (223182,'regain',18,2,0); +INSERT INTO `server_statuseffects` VALUES (223183,'tp_bleed',42,2,0); INSERT INTO `server_statuseffects` VALUES (223205,'combo',42,2,0); INSERT INTO `server_statuseffects` VALUES (223206,'goring_blade',42,2,0); -INSERT INTO `server_statuseffects` VALUES (223207,'berserk2',1074806818,1,3000); +INSERT INTO `server_statuseffects` VALUES (223207,'berserk2',1074806818,1,0); INSERT INTO `server_statuseffects` VALUES (223208,'rampage2',1075855394,1,5000); INSERT INTO `server_statuseffects` VALUES (223209,'fists_of_fire',1073742882,2,0); INSERT INTO `server_statuseffects` VALUES (223210,'fists_of_earth',1073742882,2,0); @@ -90,10 +93,16 @@ INSERT INTO `server_statuseffects` VALUES (223215,'life_surge_I',1048626,2,0); INSERT INTO `server_statuseffects` VALUES (223216,'life_surge_II',1048626,2,0); INSERT INTO `server_statuseffects` VALUES (223217,'life_surge_III',1048626,2,0); INSERT INTO `server_statuseffects` VALUES (223218,'dread_spike',16418,2,0); +INSERT INTO `server_statuseffects` VALUES (223219,'blood_for_blood',8210,2,0); INSERT INTO `server_statuseffects` VALUES (223220,'barrage',3090,2,0); INSERT INTO `server_statuseffects` VALUES (223221,'raging_strike2',1074855970,1,0); INSERT INTO `server_statuseffects` VALUES (223227,'cleric_stance',8226,1,0); INSERT INTO `server_statuseffects` VALUES (223228,'blissful_mind',1073741858,1,1000); +INSERT INTO `server_statuseffects` VALUES (223229,'dark_seal2',1042,2,0); +INSERT INTO `server_statuseffects` VALUES (223230,'resonance2',2578,1,0); +INSERT INTO `server_statuseffects` VALUES (223231,'excruciate',2098194,2,3000); +INSERT INTO `server_statuseffects` VALUES (223232,'necrogenesis',1048594,1,0); +INSERT INTO `server_statuseffects` VALUES (223233,'parsimony',1049106,1,0); INSERT INTO `server_statuseffects` VALUES (223234,'sanguine_rite2',16402,1,0); INSERT INTO `server_statuseffects` VALUES (223236,'outmaneuver2',524338,2,0); INSERT INTO `server_statuseffects` VALUES (223237,'blindside2',8226,1,0); @@ -107,6 +116,10 @@ INSERT INTO `server_statuseffects` VALUES (223245,'spinning_heel',18,1,0); INSERT INTO `server_statuseffects` VALUES (223248,'divine_veil',36914,2,0); INSERT INTO `server_statuseffects` VALUES (223250,'vengeance',16418,1,5000); INSERT INTO `server_statuseffects` VALUES (223251,'antagonize',1048626,2,0); +INSERT INTO `server_statuseffects` VALUES (223253,'battle_voice',18,2,0); +INSERT INTO `server_statuseffects` VALUES (223254,'ballad_of_magi',18,2,0); +INSERT INTO `server_statuseffects` VALUES (223255,'paeon_of_war',18,2,0); +INSERT INTO `server_statuseffects` VALUES (223256,'minuet_of_rigor',18,2,0); INSERT INTO `server_statuseffects` VALUES (223264,'divine_regen',18,2,0); INSERT INTO `server_statuseffects` VALUES (228021,'heavy',42,2,0); INSERT INTO `server_statuseffects` VALUES (253003,'evade_proc',34,1,0); @@ -127,4 +140,4 @@ commit; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-05-27 17:59:13 +-- Dump completed on 2018-06-25 23:30:50