diff --git a/data/scripts/commands/TeleportCommand.lua b/data/scripts/commands/TeleportCommand.lua index b3a1b310..6d6a4497 100644 --- a/data/scripts/commands/TeleportCommand.lua +++ b/data/scripts/commands/TeleportCommand.lua @@ -108,7 +108,7 @@ function onEventStarted(player, actor, triggerName, isTeleport) randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5); rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]); --bandaid fix for returning while dead, missing things like weakness and the heal number - if (player:GetHP() == 0) then + if (player:IsDead()) then player:SetHP(player.GetMaxHP()); player:ChangeState(0); player:PlayAnimation(0x01000066); diff --git a/data/scripts/commands/ability/battle_voice.lua b/data/scripts/commands/ability/battle_voice.lua index cecc4d45..9cc183b2 100644 --- a/data/scripts/commands/ability/battle_voice.lua +++ b/data/scripts/commands/ability/battle_voice.lua @@ -12,8 +12,12 @@ 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)); + local effect = GetWorldManager():GetStatusEffect(223253); + effect.SetDuration(30); + caster.statusEffects.AddStatusEffect(effect, caster, actionContainer); end - action.DoAction(caster, target, skill, actionContainer); + local effect = GetWorldManager():GetStatusEffect(223029); + effect.SetDuration(60); + caster.statusEffects.AddStatusEffect(effect, caster, actionContainer); end; \ No newline at end of file diff --git a/data/scripts/commands/ability/berserk.lua b/data/scripts/commands/ability/berserk.lua index 5163866b..227bb1a1 100644 --- a/data/scripts/commands/ability/berserk.lua +++ b/data/scripts/commands/ability/berserk.lua @@ -14,6 +14,18 @@ function onAbilityStart(caster, target, ability) end; function onSkillFinish(caster, target, skill, action, actionContainer) - --DoAction handles rates, buffs, dealing damage - action.DoAction(caster, target, skill, actionContainer); + --223207: Berserk + --223208: Rampage + --Remove Rampage effect. I'm assuming no message is sent like LNC surges + caster.statusEffects.RemoveStatusEffect(223208); + + --If caster has berserk already, remove it and send a message. + local buff = caster.statusEffects.GetStatusEffectById(223207) + + if buff ~= nil then + caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329); + else + --DoAction handles rates, buffs, dealing damage + action.DoAction(caster, target, skill, actionContainer); + end 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 7af11cf1..7c60d12e 100644 --- a/data/scripts/commands/ability/blissful_mind.lua +++ b/data/scripts/commands/ability/blissful_mind.lua @@ -22,22 +22,18 @@ function onSkillFinish(caster, target, skill, action, actionContainer) --If we have a buff then Blissful Mind removes that buff and restores MP. Otherwise, it adds the Blissful Mind effect if buff ~= nil then local amount = buff.GetExtra(); - local remAction = caster.statusEffects.RemoveStatusEffectForBattleAction(buff, 30329); - caster.AddMP(amount); actionContainer.AddMPAction(caster.actorId, 33007, amount); - actionContainer.AddAction(remAction); + caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329); 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 local amount = caster.GetHP() * 0.25; - caster.DelHP(amount); + caster.DelHP(amount, actionContainer); skill.statusMagnitude = amount; --DoAction handles rates, buffs, dealing damage action.DoAction(caster, target, skill, actionContainer); - end - end; \ No newline at end of file diff --git a/data/scripts/commands/ability/breath_of_the_dragon.lua b/data/scripts/commands/ability/breath_of_the_dragon.lua new file mode 100644 index 00000000..85f185b6 --- /dev/null +++ b/data/scripts/commands/ability/breath_of_the_dragon.lua @@ -0,0 +1,17 @@ +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) + action.amount = skill.basePotency; + + --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/breath_of_the_ram.lua b/data/scripts/commands/ability/breath_of_the_ram.lua new file mode 100644 index 00000000..85f185b6 --- /dev/null +++ b/data/scripts/commands/ability/breath_of_the_ram.lua @@ -0,0 +1,17 @@ +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) + action.amount = skill.basePotency; + + --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/chameleon.lua b/data/scripts/commands/ability/chameleon.lua index 92e6c1a5..d5897025 100644 --- a/data/scripts/commands/ability/chameleon.lua +++ b/data/scripts/commands/ability/chameleon.lua @@ -14,5 +14,6 @@ function onAbilityStart(caster, target, ability) end; function onSkillFinish(caster, target, skill, action, actionContainer) - target.hateContainer.UpdateHate(caster, -840); + --Need a way to get all targets with hate for player + --target.hateContainer.UpdateHate(caster, -840); end; \ No newline at end of file diff --git a/data/scripts/commands/ability/cleric_stance.lua b/data/scripts/commands/ability/cleric_stance.lua index 0cae6d8d..7750a78c 100644 --- a/data/scripts/commands/ability/cleric_stance.lua +++ b/data/scripts/commands/ability/cleric_stance.lua @@ -10,6 +10,12 @@ function onAbilityStart(caster, target, ability) end; function onSkillFinish(caster, target, skill, action, actionContainer) - --DoAction handles rates, buffs, dealing damage - action.DoAction(caster, target, skill, actionContainer); + local buff = caster.statusEffects.GetStatusEffectById(223227) + + if buff ~= nil then + caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329); + else + --DoAction handles rates, buffs, dealing damage + action.DoAction(caster, target, skill, actionContainer); + end end; \ No newline at end of file diff --git a/data/scripts/commands/ability/cover.lua b/data/scripts/commands/ability/cover.lua index 0f4be40a..4ac09ab9 100644 --- a/data/scripts/commands/ability/cover.lua +++ b/data/scripts/commands/ability/cover.lua @@ -17,7 +17,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer) coverTier = 2; end - actionContainer.AddAction(caster.statusEffects.AddStatusForBattleAction(223063, coverTier, skill.statusDuration)); + caster.statusEffects.AddStatusEffect(223063, coverTier, 0, 15, 0); --Apply Covered to target action.DoAction(caster, target, skill, actionContainer); diff --git a/data/scripts/commands/ability/dread_spike.lua b/data/scripts/commands/ability/dread_spike.lua index c17ac693..4755a296 100644 --- a/data/scripts/commands/ability/dread_spike.lua +++ b/data/scripts/commands/ability/dread_spike.lua @@ -1,18 +1,23 @@ 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) --Need a better way to do this for i = 223212,223217 do - local remAction = caster.statusEffects.RemoveStatusEffectForBattleAction(i, 30329) + local buff = caster.statusEffects.GetStatusEffectById(i); - if remAction ~= nil then - actionContainer.AddAction(remAction); + if buff ~= nil then + caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329); skill.statusTier = 2; break; end diff --git a/data/scripts/commands/ability/fists_of_wind.lua b/data/scripts/commands/ability/fists_of_wind.lua new file mode 100644 index 00000000..84ac5ce7 --- /dev/null +++ b/data/scripts/commands/ability/fists_of_wind.lua @@ -0,0 +1,19 @@ +require("global"); +require("ability"); + +function onAbilityPrepare(caster, target, ability) + return 0; +end; + +function onAbilityStart(caster, target, ability) + --27124: Enhanced Fists of Fire + if caster.HasTrait(27124) then + ability.statusTier = 2; + end + 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/hundred_fists.lua b/data/scripts/commands/ability/hundred_fists.lua index 716534d7..15355468 100644 --- a/data/scripts/commands/ability/hundred_fists.lua +++ b/data/scripts/commands/ability/hundred_fists.lua @@ -12,6 +12,6 @@ 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); + skill.statusMagnitude = 0.33 * caster.GetMod(modifiersGlobal.Delay); action.DoAction(caster, target, skill, actionContainer); end; \ No newline at end of file diff --git a/data/scripts/commands/ability/life_surge.lua b/data/scripts/commands/ability/life_surge.lua index 06f165fd..49500d7a 100644 --- a/data/scripts/commands/ability/life_surge.lua +++ b/data/scripts/commands/ability/life_surge.lua @@ -20,9 +20,9 @@ function onSkillFinish(caster, target, skill, action, actionContainer) --223213: Power Surge II --223212: Power Surge III --No message is sent when PS is removed by Life Surge - caster.statusEffects.RemoveStatusEffect(223212, true); - caster.statusEffects.RemoveStatusEffect(223213, true); - caster.statusEffects.RemoveStatusEffect(223214, true); + caster.statusEffects.RemoveStatusEffect(223212); + caster.statusEffects.RemoveStatusEffect(223213); + caster.statusEffects.RemoveStatusEffect(223214); --Using this ability moves to the next LS buff @@ -45,7 +45,6 @@ function onSkillFinish(caster, target, skill, action, actionContainer) end if not (removeId == 0) then - --caster.statusEffects.RemoveStatusEffect(removeId, true); caster.statusEffects.ReplaceEffect(caster.statusEffects.GetStatusEffectById(removeId), skill.statusId, skill.statusTier, skill.statusMagnitude, skill.statusDuration); end --DoAction handles rates, buffs, dealing damage diff --git a/data/scripts/commands/ability/power_surge.lua b/data/scripts/commands/ability/power_surge.lua index 54976f89..f8695889 100644 --- a/data/scripts/commands/ability/power_surge.lua +++ b/data/scripts/commands/ability/power_surge.lua @@ -14,11 +14,17 @@ function onAbilityStart(caster, target, ability) end; function onSkillFinish(caster, target, skill, action, actionContainer) - --Need a better way to do this - actionContainer.AddAction(caster.statusEffects.RemoveStatusEffectForBattleAction(223215)); - actionContainer.AddAction(caster.statusEffects.RemoveStatusEffectForBattleAction(223216)); - actionContainer.AddAction(caster.statusEffects.RemoveStatusEffectForBattleAction(223217)); + caster.statusEffects.RemoveStatusEffect(223215); + caster.statusEffects.RemoveStatusEffect(223216); + caster.statusEffects.RemoveStatusEffect(223217); - --DoAction handles rates, buffs, dealing damage - action.DoAction(caster, target, skill, actionContainer); + --If caster has any of the power surge effects + local buff = caster.statusEffects.GetStatusEffectById(223212) or caster.statusEffects.GetStatusEffectById(223213) or caster.statusEffects.GetStatusEffectById(223214); + + if buff ~= nil then + caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329); + else + --DoAction handles rates, buffs, dealing damage + action.DoAction(caster, target, skill, actionContainer); + end end; \ No newline at end of file diff --git a/data/scripts/commands/ability/quelling_strike.lua b/data/scripts/commands/ability/quelling_strike.lua index 35c507a4..f9cff85f 100644 --- a/data/scripts/commands/ability/quelling_strike.lua +++ b/data/scripts/commands/ability/quelling_strike.lua @@ -12,18 +12,21 @@ end; function onSkillFinish(caster, target, skill, action, actionContainer) --QS gives 300 TP by default. skill.statusMagnitude = 300; - --I'm assuming that with raging strikes, that increases to 500. - --and traited that increases again to 750 (or 450 without RS) - if caster.statusEffects.HasStatusEffect(223221) then - actionContainer.AddAction(caster.statusEffects.RemoveStatusEffectForBattleAction(223221)); - skill.statusMagnitude = 500; - end --27241: Enhanced Quelling Strike: Increases TP gained from QS by 50% if caster.HasTrait(27241) then skill.statusMagnitude = skill.statusMagnitude * 1.5; end + --When raging strikes is active, Quelling Strikes removes it and immediately restores 100 TP for each tier ofr Raging Strikes. + local buff = caster.statusEffects.GetStatusEffectById(223221) + + if buff ~= nil then + skill.tpCost = -100 * (buff.GetTier() - 1); + --QS doesn't send a message + caster.statusEffects.RemoveStatusEffect(buff); + 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/ability/raging_strike.lua b/data/scripts/commands/ability/raging_strike.lua index 5e265f08..3027518d 100644 --- a/data/scripts/commands/ability/raging_strike.lua +++ b/data/scripts/commands/ability/raging_strike.lua @@ -6,14 +6,24 @@ function onAbilityPrepare(caster, target, ability) end; function onAbilityStart(caster, target, ability) + ability.statusMagnitude = 100; --27243: Enhanced Raging Strike: Increases effect of Raging Strike by 50% if caster.HasTrait(27241) then - ability.statusTier = 2; + ability.statusMagnitude = ability.statusMagnitude * 1.5; end return 0; end; function onSkillFinish(caster, target, skill, action, actionContainer) - --DoAction handles rates, buffs, dealing damage - action.DoAction(caster, target, skill, actionContainer); + --If caster has raging strike, remove it and send message, otherwise apply it. + local buff = caster.statusEffects.GetStatusEffectById(223221) + + if buff ~= nil then + --30329: Your Raging Strike removes your Raging Strike effect. + local remAction = caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329); + actionContainer.AddAction(remAction); + else + --DoAction handles rates, buffs, dealing damage + action.DoAction(caster, target, skill, actionContainer); + end end; \ No newline at end of file diff --git a/data/scripts/commands/ability/rampage.lua b/data/scripts/commands/ability/rampage.lua index 49c9bd60..7b0307de 100644 --- a/data/scripts/commands/ability/rampage.lua +++ b/data/scripts/commands/ability/rampage.lua @@ -14,6 +14,18 @@ function onAbilityStart(caster, target, ability) end; function onSkillFinish(caster, target, skill, action, actionContainer) - --DoAction handles rates, buffs, dealing damage - action.DoAction(caster, target, skill, actionContainer); + --223207: Berserk + --223208: Rampage + --Remove Berserk effect. I'm assuming no message is sent like LNC surges + caster.statusEffects.RemoveStatusEffect(223207); + + --If caster has rampage already, remove it and send a message. + local buff = caster.statusEffects.GetStatusEffectById(223208) + + if buff ~= nil then + caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329); + else + --DoAction handles rates, buffs, dealing damage + action.DoAction(caster, target, skill, actionContainer); + end end; \ No newline at end of file diff --git a/data/scripts/commands/ability/tempered_will.lua b/data/scripts/commands/ability/tempered_will.lua index f024acaf..1c0c4bc3 100644 --- a/data/scripts/commands/ability/tempered_will.lua +++ b/data/scripts/commands/ability/tempered_will.lua @@ -12,9 +12,9 @@ end; function onSkillFinish(caster, target, skill, action, actionContainer) --Is this before or after status is gained? --Will probably need to switch to a flag for this because it might include more than just these 3 effects. - actionContainer.AddAction(caster.statusEffects.RemoveStatusEffectForBattleAction(228011)); - actionContainer.AddAction(caster.statusEffects.RemoveStatusEffectForBattleAction(228013)); - actionContainer.AddAction(caster.statusEffects.RemoveStatusEffectForBattleAction(228021)); + caster.statusEffects.RemoveStatusEffect(228011, actionContainer, 30329); + caster.statusEffects.RemoveStatusEffect(228013, actionContainer, 30329); + caster.statusEffects.RemoveStatusEffect(228021, actionContainer, 30329); action.DoAction(caster, target, skill, actionContainer); end; \ No newline at end of file diff --git a/data/scripts/commands/ability/voice_of_the_dragon.lua b/data/scripts/commands/ability/voice_of_the_dragon.lua new file mode 100644 index 00000000..85f185b6 --- /dev/null +++ b/data/scripts/commands/ability/voice_of_the_dragon.lua @@ -0,0 +1,17 @@ +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) + action.amount = skill.basePotency; + + --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/autoattack/default.lua b/data/scripts/commands/autoattack/default.lua new file mode 100644 index 00000000..29ac2f8b --- /dev/null +++ b/data/scripts/commands/autoattack/default.lua @@ -0,0 +1,17 @@ +require("global"); + +function onSkillPrepare(caster, target, skill) + return 0; +end; + +function onSkillStart(caster, target, skill) + return 0; +end; + +function onSkillFinish(caster, target, skill, action, actionContainer) + --calculate ws damage + action.amount = skill.basePotency; + + --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/gm/ba.lua b/data/scripts/commands/gm/ba.lua index 43354441..c716b61b 100644 --- a/data/scripts/commands/gm/ba.lua +++ b/data/scripts/commands/gm/ba.lua @@ -2,7 +2,7 @@ require("global"); properties = { permissions = 0, - parameters = "sssss", + parameters = "sss", description = [[ Adds experience to player or . @@ -11,18 +11,19 @@ Adds experience to player or . ]], } -function onTrigger(player, argc, commandId, animationId, textId, effectId, amount) +function onTrigger(player, argc, animType, modelAnim, effectId) local sender = "[battleaction] "; - if player then - cid = tonumber(commandId) or 0; - aid = tonumber(animationId) or 0; - tid = tonumber(textId) or 0; - print(effectId) - eid = tonumber(effectId) or 0; - amt = tonumber(amount) or 0; - - player:DoBattleActionAnimation(cid, aid, tid, eid, amt); + local actor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil; + if player and actor then + aid = tonumber(animType) or 0 + mid = tonumber(modelAnim) or 0 + eid = tonumber(effectId) or 0 + local id = bit32.lshift(aid, 24); + id = bit32.bor(id, bit32.lshift(mid, 12)); + id = bit32.bor(id, eid) + print((tonumber(id))) + player:DoBattleAction(30301, id); else print(sender.."unable to add experience, ensure player name is valid."); end; diff --git a/data/scripts/commands/gm/graphic.lua b/data/scripts/commands/gm/graphic.lua index d2c0e7fe..0c45c317 100644 --- a/data/scripts/commands/gm/graphic.lua +++ b/data/scripts/commands/gm/graphic.lua @@ -20,16 +20,22 @@ function onTrigger(player, argc, slot, wId, eId, vId, cId) vId = tonumber(vId) or 0; cId = tonumber(cId) or 0; - if player and argc > 0 then - if argc > 2 then - player:GraphicChange(slot, wId, eId, vId, cId); - player:SendMessage(messageID, sender, string.format("Changing appearance on slot %u", slot)); + local actor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil; + if player and actor then + if player and argc > 0 then + + -- player.appearanceIds[5] = player.achievementPoints; + if argc > 2 then + actor:GraphicChange(slot, wId, eId, vId, cId); + --player.achievementPoints = player.achievementPoints + 1; + actor:SendMessage(messageID, sender, string.format("Changing appearance on slot %u", slot)); + actor:SendMessage(messageID, sender, string.format("points %u", player.appearanceIds[5])); + else + actor.appearanceIds[slot] = wId; + end + actor:SendAppearance(); else - player:GraphicChange(slot, wId); - end - player:SendAppearance(); - else - player:SendMessage(messageID, sender, "No parameters sent! Usage: "..properties.description); + player:SendMessage(messageID, sender, "No parameters sent! Usage: "..properties.description); + end; end; - end; \ No newline at end of file diff --git a/data/scripts/commands/gm/spawnnpc.lua b/data/scripts/commands/gm/spawnnpc.lua new file mode 100644 index 00000000..2d73afe8 --- /dev/null +++ b/data/scripts/commands/gm/spawnnpc.lua @@ -0,0 +1,135 @@ +require("global"); +require("modifiers"); +properties = { + permissions = 0, + parameters = "sss", + description = +[[ +yolo +]], +} + +local modelIds = +{ + ["titan"] = 2107401, + ["ifrit"] = 2107302, + ["ifrithotair"] = 2207310, + ["nail"] = 2207307, + ["garuda"] = 2209501, + ["garudahelper"] = 2209516, + ["plume"] = 2209502, + ["monolith"] = 2209506, + ["mog"] = 2210408, + ["nael"] = 2210902, + ["meteor"] = 2210903, + ["cactuar"] = 2200905, + ["morbol"] = 2201002, + ["drake"] = 2202209, + ["ogre"] = 2202502, + ["treant"] = 2202801, + ["couerl"] = 2203203, + ["wyvern"] = 2203801, + ["clouddragon"] = 2208101, + ["golem"] = 2208901, + ["atomos"] = 2111002, + ["chimera"] = 2308701, + ["salamander"] = 2201302, + ["ahriman"] = 2201704, + ["rat"] = 9111275, + ["bat"] = 2104113, + ["chigoe"] = 2105613, + ["hedgemole"] = 2105709, + ["gnat"] = 2200604, + ["bird"] = 2201208, + ["puk"] = 2200112, + ["angler"] = 2204507, + ["snurble"] = 2204403, + ["lemur"] = 2200505, + ["doe"] = 2200303, + ["hippogryph"] = 2200405, + ["trap"] = 2202710, + ["goat"] = 2102312, + ["dodo"] = 9111263, + ["imp"] = 2202607, + ["spriggan"] = 2290036, + ["cyclops"] = 2210701, + ["raptor"] = 2200205, + ["wolf"] = 2201429, + ["fungus"] = 2205907, + ["basilisk"] = 2200708, + ["bomb"] = 2201611, + ["jellyfish"] = 2105415, + ["slug"] = 2104205, + ["coblyn"] = 2202103, + ["ghost"] = 2204317, + ["crab"] = 2107613, + ["yarzon"] = 2205520, + ["elemental"] = 2105104, + ["boar"] = 2201505, + ["kobold"] = 2206629, + ["sylph"] = 2206702, + ["ixal"] = 2206434, + ["amaljaa"] = 2206502, + ["qiqirn"] = 2206304, + ["apkallu"] = 2202902, + ["goobbue"] = 2103301, + ["garlean"] = 2207005, + ["flan"] = 2103404, + ["swarm"] = 2105304, + ["goblin"] = 2210301, + ["buffalo"] = 2200802, + ["skeleton"] = 2201902, + ["zombie"] = 2201807, + ["toad"] = 2203107, + ["wisp"] = 2209903, + ["juggernaut"] = 6000243, + ["mammet"] = 6000246, + ["lantern"] = 1200329, + ["helper"] = 2310605, + ["diremite"] = 2101108, + ["gong"] = 1200050, +} + +function onTrigger(player, argc, name, width, height, blockCount) + local messageID = MESSAGE_TYPE_SYSTEM_ERROR; + local sender = "spawnnpc"; + + if player and (modelIds[name] != nil) then + print("t") + local pos = player:GetPos(); + local x = tonumber(pos[0]); + local y = tonumber(pos[1]); + local z = tonumber(pos[2]); + local rot = tonumber(pos[3]); + local zone = pos[4]; + local w = tonumber(width) or 0; + + local h = tonumber(height) or 0; + local blocks = tonumber(blockCount) or 0; + for b = 0, blocks do + for i = 0, w do + for j = 0, h do + local actor = player.GetZone().SpawnActor(2104001, 'ass', x + (i * 1), y, z + (j * 1), rot, 0, 0, true); + actor.ChangeNpcAppearance(modelIds[name]); + actor.SetMaxHP(5000); + actor.SetHP(5000); + actor.SetMod(modifiersGlobal.HasShield, 1); + actor.SetMod(modifiersGlobal.AttackRange, 3); + actor.SetMod(modifiersGlobal.Speed, 5); + actor.SetMobMod(mobModifiersGlobal.Roams, 1); + actor.SetMobMod(mobModifiersGlobal.RoamDelay, 3); + actor.moveState = 3; + end; + end; + + x = x + 500 + end; + return; + elseif player and (modelIds[name] == nil) then + player:SendMessage(messageID, sender, "That name isn't valid"); + else + print("I don't even know how you managed this") + end + + return; +end; \ No newline at end of file diff --git a/data/scripts/commands/gm/vdragon.lua b/data/scripts/commands/gm/vdragon.lua new file mode 100644 index 00000000..52cade43 --- /dev/null +++ b/data/scripts/commands/gm/vdragon.lua @@ -0,0 +1,24 @@ +require("global"); +require("utils"); + +properties = { + permissions = 0, + parameters = "sssss", + description = +[[ +Angle stuff! +!anglestuff +]], +} + +function onTrigger(player, argc) + local sender = "[battleaction] "; + + if player and player.currentTarget then + local actor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil; + actor.Ability(23459, actor.actorId); + + else + print(sender.."unable to add experience, ensure player name is valid."); + end; +end; \ No newline at end of file diff --git a/data/scripts/commands/magic/aero.lua b/data/scripts/commands/magic/aero.lua index 3deb8462..96f979b4 100644 --- a/data/scripts/commands/magic/aero.lua +++ b/data/scripts/commands/magic/aero.lua @@ -12,7 +12,7 @@ end; function onSkillFinish(caster, target, skill, action, actionContainer) --calculate damage action.amount = skill.basePotency; - action.statusMagnitude = 15; + skill.statusMagnitude = 15; --DoAction handles rates, buffs, dealing damage action.DoAction(caster, target, skill, actionContainer); diff --git a/data/scripts/commands/magic/aerora.lua b/data/scripts/commands/magic/aerora.lua index d8e01c53..e07bcfd1 100644 --- a/data/scripts/commands/magic/aerora.lua +++ b/data/scripts/commands/magic/aerora.lua @@ -12,22 +12,16 @@ end; --Increased damage and conversion to single target function onCombo(caster, target, spell) spell.aoeType = 0; - spell.potency = spell.potency * 1.5; + spell.basePotency = spell.basePotency * 1.5; end; function onSkillFinish(caster, target, skill, action, actionContainer) - --Dispels an effect on each target. - local effects = target.statusEffects.GetStatusEffectsByFlag2(16); --lose on dispel - if effects != nil then - target.statusEffects.RemoveStatusEffect(effects[0]); - end; - --calculate damage action.amount = skill.basePotency; --DoAction handles rates, buffs, dealing damage action.DoAction(caster, target, skill, actionContainer); - --Try to apply status effect - action.TryStatus(caster, target, skill, actionContainer, true); + --Dispels an effect on each target. + target.statusEffects.RemoveStatusEffect(GetRandomEffectByFlag(8), actionContainer, 30336); end; \ No newline at end of file diff --git a/data/scripts/commands/magic/cura.lua b/data/scripts/commands/magic/cura.lua index 6713dadc..c07686a4 100644 --- a/data/scripts/commands/magic/cura.lua +++ b/data/scripts/commands/magic/cura.lua @@ -1,5 +1,6 @@ require("global"); require("magic"); +require("modifiers"); function onMagicPrepare(caster, target, spell) return 0; @@ -14,7 +15,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer) --2.5 HP per Healing Magic Potency --0.5 HP per MND --this is WITH WHM AF chest, don't know formula without AF. AF seems to increase healing by 7-10%? - action.amount = 2.5 * caster.GetMod(modifiersGlobal.MagicHeal) + 0.5 * (caster.GetMod(modifiersGlobal.Mind)); + action.amount = 2.5 * caster.GetMod(modifiersGlobal.HealingMagicPotency) + 0.5 * (caster.GetMod(modifiersGlobal.Mind)); --DoAction handles rates, buffs, dealing damage action.DoAction(caster, target, skill, actionContainer); diff --git a/data/scripts/commands/magic/cure.lua b/data/scripts/commands/magic/cure.lua index cafa30a2..78b86ff6 100644 --- a/data/scripts/commands/magic/cure.lua +++ b/data/scripts/commands/magic/cure.lua @@ -30,7 +30,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer) hpPerMND = 0.25; end - action.amount = hpPerHMP * caster.GetMod(modifiersGlobal.MagicHeal) + hpPerMND * (caster.GetMod(modifiersGlobal.Mind)); + action.amount = hpPerHMP * caster.GetMod(modifiersGlobal.HealingMagicPotency) + hpPerMND * (caster.GetMod(modifiersGlobal.Mind)); --DoAction handles rates, buffs, dealing damage action.DoAction(caster, target, skill, actionContainer); diff --git a/data/scripts/commands/magic/fire.lua b/data/scripts/commands/magic/fire.lua index cb88bda7..ad185e22 100644 --- a/data/scripts/commands/magic/fire.lua +++ b/data/scripts/commands/magic/fire.lua @@ -11,7 +11,7 @@ end; function onSkillFinish(caster, target, skill, action, actionContainer) --calculate damage - action.amount = skill.basePotency; + action.amount = 5000;-- skill.basePotency; --DoAction handles rates, buffs, dealing damage action.DoAction(caster, target, skill, actionContainer); diff --git a/data/scripts/commands/magic/flare.lua b/data/scripts/commands/magic/flare.lua index 6fbe1c9b..fd75684f 100644 --- a/data/scripts/commands/magic/flare.lua +++ b/data/scripts/commands/magic/flare.lua @@ -12,6 +12,7 @@ end; function onSkillFinish(caster, target, skill, action, actionContainer) --calculate damage action.amount = skill.basePotency; + skill.statusMagnitude = 20; --DoAction handles rates, buffs, dealing damage action.DoAction(caster, target, skill, actionContainer); diff --git a/data/scripts/commands/magic/holy_succor.lua b/data/scripts/commands/magic/holy_succor.lua index 4ce6c182..b10a7c56 100644 --- a/data/scripts/commands/magic/holy_succor.lua +++ b/data/scripts/commands/magic/holy_succor.lua @@ -24,6 +24,6 @@ function onSkillFinish(caster, target, skill, action, actionContainer) if caster != target then caster.AddHP(action.amount / 2) --33012: You recover [amount] HP. - actionContainer.AddHPAction(caster.actorId, 33012, (action.amount / 2)); + actionContainer.AddHPAbsorbAction(caster.actorId, 33012, (action.amount / 2)); end end; \ No newline at end of file diff --git a/data/scripts/commands/magic/protect.lua b/data/scripts/commands/magic/protect.lua index 454e030a..f00ffa35 100644 --- a/data/scripts/commands/magic/protect.lua +++ b/data/scripts/commands/magic/protect.lua @@ -12,7 +12,7 @@ end; function onSkillFinish(caster, target, skill, action, actionContainer) --Actual amount of def/mdef will be calculated in OnGain - skill.statusMagnitude = caster.GetMod(modifiersGlobal.MagicEnhancePotency); + skill.statusMagnitude = caster.GetMod(modifiersGlobal.EnhancementMagicPotency); --27365: Enhanced Protect: Increases magic defense gained from Protect. if caster.HasTrait(27365) then diff --git a/data/scripts/commands/magic/regen.lua b/data/scripts/commands/magic/regen.lua index db4bc502..66159400 100644 --- a/data/scripts/commands/magic/regen.lua +++ b/data/scripts/commands/magic/regen.lua @@ -25,7 +25,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer) intercept = intercept * 1.25; end - local regenTick = (slope * caster.GetMod(modifiersGlobal.MagicEnhancePotency)) + intercept) + 1; + local regenTick = (slope * caster.GetMod(modifiersGlobal.EnhancementMagicPotency)) + intercept + 1; spell.statusMagnitude = regenTick; diff --git a/data/scripts/commands/magic/stone.lua b/data/scripts/commands/magic/stone.lua index 728384d3..99bf6ec0 100644 --- a/data/scripts/commands/magic/stone.lua +++ b/data/scripts/commands/magic/stone.lua @@ -12,7 +12,7 @@ end; function onSkillFinish(caster, target, skill, action, actionContainer) --calculate damage action.amount = skill.basePotency; - action.statusMagnitude = 50; + skill.statusMagnitude = 50; --DoAction handles rates, buffs, dealing damage action.DoAction(caster, target, skill, actionContainer); diff --git a/data/scripts/commands/magic/stoneskin.lua b/data/scripts/commands/magic/stoneskin.lua index c49b190a..6a3c6010 100644 --- a/data/scripts/commands/magic/stoneskin.lua +++ b/data/scripts/commands/magic/stoneskin.lua @@ -1,5 +1,6 @@ require("global"); require("magic"); +require("modifiers") function onMagicPrepare(caster, target, spell) return 0; @@ -19,7 +20,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer) hpPerPoint = 1.96; end - spell.statusMagnitude = hpPerPoint * caster.GetMod(modifiersGlobal.MagicEnhancePotency); + skill.statusMagnitude = hpPerPoint * caster.GetMod(modifiersGlobal.EnhancementMagicPotency); --DoAction handles rates, buffs, dealing damage action.DoAction(caster, target, skill, actionContainer); diff --git a/data/scripts/commands/magic/swiftsong.lua b/data/scripts/commands/magic/swiftsong.lua new file mode 100644 index 00000000..5ca9cd04 --- /dev/null +++ b/data/scripts/commands/magic/swiftsong.lua @@ -0,0 +1,35 @@ +require("global"); +require("magic"); + +function onMagicPrepare(caster, target, skill) + return 0; +end; + +function onMagicStart(caster, target, skill) + return 0; +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 paeon = target.statusEffects.GetStatusEffectById(223255); + local ballad = target.statusEffects.GetStatusEffectById(223254); + local minuet = target.statusEffects.GetStatusEffectById(223256); + if paeon and paeon.GetSource() == caster then + oldSong = paeon; + 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/weaponskill/demolish.lua b/data/scripts/commands/weaponskill/demolish.lua index 733e9e4d..3bdd6712 100644 --- a/data/scripts/commands/weaponskill/demolish.lua +++ b/data/scripts/commands/weaponskill/demolish.lua @@ -12,10 +12,7 @@ end; --Dispel --Does dispel have a text id? function onCombo(caster, target, skill) - local effects = target.statusEffects.GetStatusEffectsByFlag(16); --lose on dispel - if effects != nil then - target.statusEffects.RemoveStatusEffect(effects[0]); - end; + return 0; end; function onSkillFinish(caster, target, skill, action, actionContainer) @@ -25,6 +22,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer) --DoAction handles rates, buffs, dealing damage action.DoAction(caster, target, skill, actionContainer); - --Try to apply status effect - action.TryStatus(caster, target, skill, actionContainer, true); + if skill.isCombo then + target.statusEffects.RemoveStatusEffect(GetRandomEffectByFlag(8), actionContainer, 30336); + end end; \ No newline at end of file diff --git a/data/scripts/commands/weaponskill/doom_spike.lua b/data/scripts/commands/weaponskill/doom_spike.lua index e40f0057..09f8b0d6 100644 --- a/data/scripts/commands/weaponskill/doom_spike.lua +++ b/data/scripts/commands/weaponskill/doom_spike.lua @@ -1,5 +1,6 @@ require("global"); require("weaponskill"); +require("utils"); function onSkillPrepare(caster, target, skill) return 0; @@ -16,7 +17,7 @@ end; function onSkillFinish(caster, target, skill, action, actionContainer) --calculate ws damage - action.amount = skill.basePotency; + action.amount = 5000;--skill.basePotency; --DoAction handles rates, buffs, dealing damage action.DoAction(caster, target, skill, actionContainer); diff --git a/data/scripts/commands/weaponskill/dragon_kick.lua b/data/scripts/commands/weaponskill/dragon_kick.lua index 115ab485..3e4fcb29 100644 --- a/data/scripts/commands/weaponskill/dragon_kick.lua +++ b/data/scripts/commands/weaponskill/dragon_kick.lua @@ -21,6 +21,9 @@ function onSkillFinish(caster, target, skill, action, actionContainer) --DoAction handles rates, buffs, dealing damage action.DoAction(caster, target, skill, actionContainer); - --Try to apply status effect - action.TryStatus(caster, target, skill, actionContainer, true); + --Status only seems to apply on the first hit + if(action.ActionLanded() and action.hitNum == 1) then + --Try to apply status effect + action.TryStatus(caster, target, skill, actionContainer, true); + end end; \ No newline at end of file diff --git a/data/scripts/commands/weaponskill/godsbane.lua b/data/scripts/commands/weaponskill/godsbane.lua index d47129ac..8a8a3673 100644 --- a/data/scripts/commands/weaponskill/godsbane.lua +++ b/data/scripts/commands/weaponskill/godsbane.lua @@ -1,20 +1,16 @@ require("global"); require("weaponskill"); +require("modifiers") function onSkillPrepare(caster, target, skill) return 0; end; function onSkillStart(caster, target, skill) - return 0; -end; - ---Increased crit rate -function onCombo(caster, target, skill) --Get Berserk statuseffect local berserk = caster.statusEffects.GetStatusEffectById(223160); - --if it isn't nil, remove the AP and Defense mods and reset extra to 0, increase potency + --if it isn't nil, remove the AP and Defense mods and reset extra to 0, increase accuracy if berserk != nil then local apPerHit = 20; local defPerHit = 20; @@ -23,14 +19,20 @@ function onCombo(caster, target, skill) apPerHit = 24; end - attacker.SubtractMod(modifiersGlobal.Attack, apPerHit * berserk.GetExtra()); - attacker.Add(modifiersGlobal.Defense, defPerHit * berserk.GetExtra()); + caster.SubtractMod(modifiersGlobal.Attack, apPerHit * berserk.GetExtra()); + caster.Add(modifiersGlobal.Defense, defPerHit * berserk.GetExtra()); berserk.SetExtra(0); - - --This is about 50% crit. Don't know if that's what it gave on retail but seems kind of reasonable - skill.critRateBonus = 300; + skill.accuracyModifier = 50; end; + + return 0; +end; + +--Increased crit rate +function onCombo(caster, target, skill) + --This is about 25% crit. Don't know if that's what it gave on retail but seems kind of reasonable + skill.critRateBonus = 200; end; function onSkillFinish(caster, target, skill, action, actionContainer) diff --git a/data/scripts/commands/weaponskill/maim.lua b/data/scripts/commands/weaponskill/maim.lua index 861e4315..5901282d 100644 --- a/data/scripts/commands/weaponskill/maim.lua +++ b/data/scripts/commands/weaponskill/maim.lua @@ -15,7 +15,7 @@ end; function onSkillFinish(caster, target, skill, action, actionContainer) --calculate ws damage - skill.Potency = 100; + skill.basePotency = 100; --DoAction handles rates, buffs, dealing damage action.DoAction(caster, target, skill, actionContainer); diff --git a/data/scripts/commands/weaponskill/steel_cyclone.lua b/data/scripts/commands/weaponskill/steel_cyclone.lua index 4f1314cd..579f7df0 100644 --- a/data/scripts/commands/weaponskill/steel_cyclone.lua +++ b/data/scripts/commands/weaponskill/steel_cyclone.lua @@ -1,11 +1,27 @@ require("global"); require("weaponskill"); +require("modifiers") function onSkillPrepare(caster, target, skill) return 0; end; +--Resets rampage to increase damage function onSkillStart(caster, target, skill) + --Get Rampage statuseffect + local rampage = caster.statusEffects.GetStatusEffectById(223208); + + --if it isn't nil, remove the AP and Defense mods and reset extra to 0, increase potency + if rampage != nil then + local parryPerDT = 20; + local delayMsPerDT = 100; + + caster.SubtractMod(modifiersGlobal.Parry, parryPerDT * rampage.GetExtra()); + caster.AddMod(modifiersGlobal.Delay, delayMsPerDT * rampage.GetExtra()); + + rampage.SetExtra(0); + skill.basePotency = skill.basePotency * 1.5; + end; return 0; end; @@ -15,6 +31,10 @@ function onCombo(caster, target, skill) end; function onSkillFinish(caster, target, skill, action, actionContainer) + if target.target == caster then + skill.statusId = 223015 + end; + --calculate ws damage action.amount = skill.basePotency; @@ -23,4 +43,6 @@ function onSkillFinish(caster, target, skill, action, actionContainer) --Try to apply status effect action.TryStatus(caster, target, skill, actionContainer, true); + + skill.statusId = 0; end; \ No newline at end of file diff --git a/data/scripts/commands/weaponskill/sucker_punch.lua b/data/scripts/commands/weaponskill/sucker_punch.lua index 5f188546..b408a139 100644 --- a/data/scripts/commands/weaponskill/sucker_punch.lua +++ b/data/scripts/commands/weaponskill/sucker_punch.lua @@ -28,7 +28,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer) --1.21: Equation used to calculate amount of MP adjusted. --fug --This might mean max MP isn't involved and the difference was between patches. need to recheck videos - if action.GetHitType() > HitType.Evade and (action.param == HitDirection.Right or action.param == HitDirection.Left) then + if action.ActionLanded() and (action.param == HitDirection.Right or action.param == HitDirection.Left) then local mpToReturn = 0; if skill.isCombo then @@ -39,6 +39,6 @@ function onSkillFinish(caster, target, skill, action, actionContainer) caster.AddMP(mpToReturn); --30452: You recover x MP. - actionContainer.AddMPAction(caster.actorId, 30452, mpToReturn); + actionContainer.AddMPAbsorbAction(caster.actorId, 30452, mpToReturn); end end; \ No newline at end of file diff --git a/data/scripts/commands/weaponskill/whirlwind.lua b/data/scripts/commands/weaponskill/whirlwind.lua index 26b7a7e1..3a78263f 100644 --- a/data/scripts/commands/weaponskill/whirlwind.lua +++ b/data/scripts/commands/weaponskill/whirlwind.lua @@ -1,5 +1,6 @@ require("global"); require("weaponskill"); +require("modifiers") function onSkillPrepare(caster, target, skill) return 0; @@ -23,8 +24,8 @@ function onCombo(caster, target, skill) apPerHit = 24; end - attacker.SubtractMod(modifiersGlobal.Attack, apPerHit * berserk.GetExtra()); - attacker.Add(modifiersGlobal.Defense, defPerHit * berserk.GetExtra()); + caster.SubtractMod(modifiersGlobal.Attack, apPerHit * berserk.GetExtra()); + caster.Add(modifiersGlobal.Defense, defPerHit * berserk.GetExtra()); berserk.SetExtra(0); skill.basePotency = skill.basePotency * 1.5; diff --git a/data/scripts/effects/aegis_boon.lua b/data/scripts/effects/aegis_boon.lua index 2f909fd1..72286396 100644 --- a/data/scripts/effects/aegis_boon.lua +++ b/data/scripts/effects/aegis_boon.lua @@ -3,17 +3,17 @@ require("utils") --Forces a full block (0 damage taken) function onPreAction(effect, caster, target, skill, action, actionContainer) - --If action hit from the rear and is a weaponskill ation + --Can aegis boon block rear attacks or non-physical attacks? 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) +function onBlock(effect, attacker, defender, skill, 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)); + defender.statusEffects.RemoveStatusEffect(effect, actionContainer); end; \ No newline at end of file diff --git a/data/scripts/effects/aero.lua b/data/scripts/effects/aero.lua index 53a413c4..5e647f12 100644 --- a/data/scripts/effects/aero.lua +++ b/data/scripts/effects/aero.lua @@ -1,10 +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(owner, effect) +function onGain(owner, effect, actionContainer) owner.AddMod(modifiersGlobal.RegenDown, effect.GetMagnitude()); end; -function onLose(owner, effect) +function onLose(owner, effect, actionContainer) 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 index e64f5751..9df99bf5 100644 --- a/data/scripts/effects/ballad_of_magi.lua +++ b/data/scripts/effects/ballad_of_magi.lua @@ -1,10 +1,10 @@ require("modifiers") -function onGain(owner, effect) +function onGain(owner, effect, actionContainer) --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) +function onLose(owner, effect, actionContainer) 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 59c097da..d1ab844f 100644 --- a/data/scripts/effects/barrage.lua +++ b/data/scripts/effects/barrage.lua @@ -8,6 +8,6 @@ end; function onCommandFinish(effect, owner, skill, actionContainer) --27259: Light Shot if skill.id == 27259 then - actionContainer.AddAction(owner.statusEffects.RemoveStatusEffectForBattleAction(effect)); + defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false); end end; \ No newline at end of file diff --git a/data/scripts/effects/battle_voice.lua b/data/scripts/effects/battle_voice.lua index 4cbc19ff..8c2f1e56 100644 --- a/data/scripts/effects/battle_voice.lua +++ b/data/scripts/effects/battle_voice.lua @@ -1,3 +1,8 @@ require("modifiers") ---BV doesn't really do anything i think \ No newline at end of file +--BV doesn't really do anything i think +function onGain(owner, effect, actionContainer) +end; + +function onLose(owner, effect, actionContainer) +end; \ No newline at end of file diff --git a/data/scripts/effects/berserk2.lua b/data/scripts/effects/berserk2.lua index 0a7d37ec..0481c1de 100644 --- a/data/scripts/effects/berserk2.lua +++ b/data/scripts/effects/berserk2.lua @@ -1,13 +1,12 @@ require("modifiers"); -function onGain(owner, effect) - owner.statusEffects.RemoveStatusEffect(223208); +function onGain(owner, effect, actionContainer) 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) +function onHit(effect, attacker, defender, skill, 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? @@ -32,7 +31,7 @@ function onHit(effect, attacker, defender, action, actionContainer) end end; -function onDamageTaken(effect, attacker, defender, action, actionContainer) +function onDamageTaken(effect, attacker, defender, skill, action, actionContainer) local apPerHit = 20; local defPerHit = 20; @@ -45,7 +44,7 @@ function onDamageTaken(effect, attacker, defender, action, actionContainer) effect.SetExtra(0); end -function onLose(owner, effect) +function onLose(owner, effect, actionContainer) local apPerHit = 20; local defPerHit = 20; diff --git a/data/scripts/effects/bind.lua b/data/scripts/effects/bind.lua index 2ef3b0f4..c57b0582 100644 --- a/data/scripts/effects/bind.lua +++ b/data/scripts/effects/bind.lua @@ -1,7 +1,7 @@ require("modifiers"); -function onGain(target, effect) +function onGain(owner, effect, actionContainer) end; -function onLose(target, effect) +function onLose(owner, effect, actionContainer) end; \ No newline at end of file diff --git a/data/scripts/effects/blind.lua b/data/scripts/effects/blind.lua index 59e06fbd..2dec4f7d 100644 --- a/data/scripts/effects/blind.lua +++ b/data/scripts/effects/blind.lua @@ -1,9 +1,9 @@ require("modifiers") -function onGain(owner, effect) +function onGain(owner, effect, actionContainer) owner.SubtractMod(modifiersGlobal.Accuracy, effect.GetMagnitude()); end; -function onLose(owner, effect) +function onLose(owner, effect, actionContainer) 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 27590af4..0e0e30d5 100644 --- a/data/scripts/effects/blindside.lua +++ b/data/scripts/effects/blindside.lua @@ -4,12 +4,12 @@ require("battleutils") --Forces crit of a single WS action from rear. 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 + if (action.param == HitDirection.Rear and skill.GetCommandType() == 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)); + target.statusEffects.RemoveStatusEffect(effect, actionContainer); end; diff --git a/data/scripts/effects/blindside2.lua b/data/scripts/effects/blindside2.lua new file mode 100644 index 00000000..6b5c3452 --- /dev/null +++ b/data/scripts/effects/blindside2.lua @@ -0,0 +1,17 @@ +require("modifiers") +require("battleutils") + +--Forces crit of a single WS action from rear. +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 skill.GetCommandType() == CommandType.WeaponSkill) then + --Set action's crit rate to 100% + action.critRate = 100.0; + end + + --Figure out INT bonus for tier 2 + + --Remove status and add message + target.statusEffects.RemoveStatusEffect(effect, actionContainer); +end; + diff --git a/data/scripts/effects/blissful_mind.lua b/data/scripts/effects/blissful_mind.lua index 1c12cfff..9ff217e1 100644 --- a/data/scripts/effects/blissful_mind.lua +++ b/data/scripts/effects/blissful_mind.lua @@ -2,15 +2,13 @@ --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) +function onTick(owner, effect, actionContainer) 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 diff --git a/data/scripts/effects/block_proc.lua b/data/scripts/effects/block_proc.lua index 1f6d7161..eb71402a 100644 --- a/data/scripts/effects/block_proc.lua +++ b/data/scripts/effects/block_proc.lua @@ -1,3 +1,3 @@ -function onLose(target, effect) - target:SetProc(1, false); +function onLose(owner, effect, actionContainer) + owner:SetProc(1, false); end; \ No newline at end of file diff --git a/data/scripts/effects/blood_for_blood.lua b/data/scripts/effects/blood_for_blood.lua index b63c88bd..d1fa7d55 100644 --- a/data/scripts/effects/blood_for_blood.lua +++ b/data/scripts/effects/blood_for_blood.lua @@ -3,7 +3,7 @@ require("battleUtils") --Takes 10% of hp rounded down when using a weaponskill --Random guess, but increases damage by 10% (12.5% traited)? function onPreAction(effect, caster, target, skill, action, actionContainer) - if skill.commandType == CommandType.Weaponskill then + if skill.GetCommandType() == CommandType.Weaponskill then local hpToRemove = math.floor(caster.GetHP() * 0.10); local modifier = 1.10; @@ -12,9 +12,9 @@ function onPreAction(effect, caster, target, skill, action, actionContainer) end action.amount = action.amount * modifier; - caster.DelHP(hpToRemove); + caster.DelHP(hpToRemove, actionContainer); - --Remove status and add message - actionContainer.AddAction(target.statusEffects.RemoveForBattleAction(effect)); + --Remove status and add message + caster.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, true); end end; \ No newline at end of file diff --git a/data/scripts/effects/bloodbath.lua b/data/scripts/effects/bloodbath.lua index b74d099e..cd6775d6 100644 --- a/data/scripts/effects/bloodbath.lua +++ b/data/scripts/effects/bloodbath.lua @@ -1,7 +1,8 @@ require("modifiers"); +require("battleutils") --Absorb HP on next WS or ability -function onHit(effect, attacker, defender, action, actionContainer) +function onHit(effect, attacker, defender, skill, 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. @@ -11,14 +12,14 @@ function onHit(effect, attacker, defender, action, actionContainer) --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 + if skill.GetCommandType() == CommandType.Weaponskill or skill.GetCommandType() == 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) + actionContainer.AddHPAbsorbAction(defender.actorId, 30332, absorbAmount) --Bloodbath is lost after absorbing hp - actionContainer.AddAction(defender.statusEffects.RemoveStatusEffectForBattleAction(effect)); + defender.statusEffects.RemoveStatusEffect(effect,actionContainer, 30331, false); end end; \ No newline at end of file diff --git a/data/scripts/effects/bloodletter.lua b/data/scripts/effects/bloodletter.lua index 2a4b0129..5a0401e3 100644 --- a/data/scripts/effects/bloodletter.lua +++ b/data/scripts/effects/bloodletter.lua @@ -8,13 +8,14 @@ require("modifiers") --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) +--This is because PIE increases Enfeebling Magic Potency which impacts additional effect damage and land rates +function onGain(owner, effect, actionContainer) 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) +function onLose(owner, effect, actionContainer) owner.SubtractMod(modifiersGlobal.RegenDown, 15); - owner.DelHP(570); + owner.DelHP(570, actionContainer); end diff --git a/data/scripts/effects/bloodletter2.lua b/data/scripts/effects/bloodletter2.lua index 01449669..70c48e7a 100644 --- a/data/scripts/effects/bloodletter2.lua +++ b/data/scripts/effects/bloodletter2.lua @@ -1,10 +1,10 @@ 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) +function onGain(owner, effect, actionContainer) owner.AddMod(modifiersGlobal.RegenDown, 15); end -function onLose(owner, effect) +function onLose(owner, effect, actionContainer) owner.SubtractMod(modifiersGlobal.RegenDown, 15); end diff --git a/data/scripts/effects/cleric_stance.lua b/data/scripts/effects/cleric_stance.lua index 2bb252d8..6617758f 100644 --- a/data/scripts/effects/cleric_stance.lua +++ b/data/scripts/effects/cleric_stance.lua @@ -1,12 +1,12 @@ require("modifiers") -function onGain(target, effect) +function onGain(owner, effect, actionContainer) --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); + owner.MultiplyMod(modifiersGlobal.AttackMagicPotency, 1.2); + owner.MultiplyMod(modifiersGlobal.HealingMagicPotency, 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); +function onLose(owner, effect, actionContainer) + owner.DivideMod(modifiersGlobal.AttackMagicPotency, 1.2); + owner.DivideMod(modifiersGlobal.HealingMagicPotency, 0.8); end; \ No newline at end of file diff --git a/data/scripts/effects/collusion.lua b/data/scripts/effects/collusion.lua index 7f015f81..e700e6df 100644 --- a/data/scripts/effects/collusion.lua +++ b/data/scripts/effects/collusion.lua @@ -1,10 +1,10 @@ require("modifiers") -function onHit(effect, attacker, defender, action, actionContainer) +function onHit(effect, attacker, defender, skill, 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)); + defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false); end; \ No newline at end of file diff --git a/data/scripts/effects/combo.lua b/data/scripts/effects/combo.lua index 44503843..5ff9a4fc 100644 --- a/data/scripts/effects/combo.lua +++ b/data/scripts/effects/combo.lua @@ -1,3 +1,6 @@ -function onLose(target, effect) - target:SetCombos(); +function onGain(owner, effect, actionContainer) +end; + +function onLose(owner, effect, actionContainer) + owner:SetCombos(); end; \ No newline at end of file diff --git a/data/scripts/effects/cover.lua b/data/scripts/effects/cover.lua index b63b5e5c..89f31cc4 100644 --- a/data/scripts/effects/cover.lua +++ b/data/scripts/effects/cover.lua @@ -1,7 +1,7 @@ require("modifiers") --Enahnced Cover: Restores 25% of damage taken as MP. Does not send a message -function onDamageTaken(effect, attacker, defender, action, actionContainer) +function onDamageTaken(effect, attacker, defender, skill, action, actionContainer) if effect.GetTier() == 2 then defender.AddMP(0.25 * action.amount); end diff --git a/data/scripts/effects/dark_seal2.lua b/data/scripts/effects/dark_seal2.lua index 61cf1a1e..f0e7ecc6 100644 --- a/data/scripts/effects/dark_seal2.lua +++ b/data/scripts/effects/dark_seal2.lua @@ -5,9 +5,9 @@ require("battleutils") --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 + if skill.GetActionType() == ActionType.Magic then --50 is random guess. skill.accuracyModifier = skill.accuracyModifier + 50; - actionContainer.AddAction(owner.RemoveStatusEffectForBattleAction(effect)); + owner.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false); end end \ No newline at end of file diff --git a/data/scripts/effects/decoy.lua b/data/scripts/effects/decoy.lua index e5a6e860..f2ed8729 100644 --- a/data/scripts/effects/decoy.lua +++ b/data/scripts/effects/decoy.lua @@ -5,12 +5,13 @@ require("battleutils") function onPreAction(effect, caster, target, skill, action, actionContainer) --Evade single ranged or magic attack --Traited allows for physical attacks - if target.allegiance != caster.allegiance and (skill.isRanged or action.actionType == ActionType.Magic) then + if target.allegiance != caster.allegiance and (skill.isRanged or skill.GetActionType() == ActionType.Magic) then + --Unsure if decoy forces a miss/resist or if this is the one case where the evade hittype is used --Set action's hit rate to 0 - action.hirRate = 0.0; - + action.hitRate = 0.0; + action.resistRate = 750; --Remove status and add message - actionContainer.AddAction(target.statusEffects.RemoveStatusEffectForBattleAction(effect)); + defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false); end end; \ No newline at end of file diff --git a/data/scripts/effects/decoy2.lua b/data/scripts/effects/decoy2.lua index bac5a365..f962798d 100644 --- a/data/scripts/effects/decoy2.lua +++ b/data/scripts/effects/decoy2.lua @@ -5,11 +5,12 @@ require("battleutils") function onPreAction(effect, caster, target, skill, action, actionContainer) --Evade single ranged or magic attack --Traited allows for physical attacks - if target.allegiance != caster.allegiance and (skill.isRanged or action.actionType == ActionType.Magic or action.actionType == ActionType.Physical) then + if target.allegiance != caster.allegiance and (skill.isRanged or skill.GetActionType() == ActionType.Magic or skill.GetActionType() == ActionType.Physical) then --Set action's hit rate to 0 - action.hirRate = 0.0; + action.hitRate = 0.0; + action.resistRate = 400; --Remove status and add message - actionContainer.AddAction(target.statusEffects.RemoveStatusEffectForBattleAction(effect)); + defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false); end end; \ No newline at end of file diff --git a/data/scripts/effects/default.lua b/data/scripts/effects/default.lua index b74871e4..d9f217a4 100644 --- a/data/scripts/effects/default.lua +++ b/data/scripts/effects/default.lua @@ -1,5 +1,5 @@ -function onGain(target, effect) +function onGain(owner, effect, actionContainer) end; -function onLose(target, effect) +function onLose(owner, effect, actionContainer) end; \ No newline at end of file diff --git a/data/scripts/effects/defense_down.lua b/data/scripts/effects/defense_down.lua index 19b20cc9..f8e0305a 100644 --- a/data/scripts/effects/defense_down.lua +++ b/data/scripts/effects/defense_down.lua @@ -1,9 +1,9 @@ require("modifiers") -function onGain(owner, effect) +function onGain(owner, effect, actionContainer) owner.SubtractMod(modifiersGlobal.Defense, effect.GetMagnitude()); end -function onLose(owner, effect) +function onLose(owner, effect, actionContainer) owner.AddMod(modifiersGlobal.Defense, effect.GetMagnitude()); end diff --git a/data/scripts/effects/divine_regen.lua b/data/scripts/effects/divine_regen.lua index f137f72a..f9795399 100644 --- a/data/scripts/effects/divine_regen.lua +++ b/data/scripts/effects/divine_regen.lua @@ -1,9 +1,9 @@ require("modifiers") -function onGain(owner, effect) +function onGain(owner, effect, actionContainer) owner.AddMod(modifiersGlobal.Regen, effect.GetMagnitude()); end -function onLose(owner, effect) +function onLose(owner, effect, actionContainer) owner.SubtractMod(modifiersGlobal.Regen, effect.GetMagnitude()); end diff --git a/data/scripts/effects/divine_veil.lua b/data/scripts/effects/divine_veil.lua index b81fb802..fab3b76f 100644 --- a/data/scripts/effects/divine_veil.lua +++ b/data/scripts/effects/divine_veil.lua @@ -1,18 +1,18 @@ require("modifiers") --Increases block rate by 100% -function onGain(owner, effect) +function onGain(owner, effect, actionContainer) owner.AddMod(modifiersGlobal.RawBlockRate, 100); end -function onLose(owner, effect) +function onLose(owner, effect, actionContainer) owner.SubtractMod(modifiersGlobal.RawBlockRate, 100); end --Applys Divine Regen to party in range when healed by cure or cura -function onHealed(caster, target, effect, skill, action, actionContainer) +function onHealed(effect, caster, target, skill, action, actionContainer) -- cure cura - if (skill.id == 27346 or skill.id == 27347) and (caster != owner) then + if (skill.id == 27346 or skill.id == 27347) and (caster != target) then local regenDuration = 30; --Apparently heals for 85 without AF, 113 with. Unsure if these can be improved with stats local magnitude = 85 @@ -23,9 +23,8 @@ function onHealed(caster, target, effect, skill, action, actionContainer) end --For each party member in range, add divine regen - for chara in owner.GetPartyMembersInRange(8) do - local addAction = chara.statusEffects.AddStatusForBattleAction(223264, effect.GetTier(), magnitude, regenDuration); - actionContainer.AddAction(addAction); + for chara in target.GetPartyMembersInRange(8) do + chara.statusEffects.AddStatusEffect(223264, effect.GetTier(), magnitude, regenDuration, actionContainer); end end end; \ No newline at end of file diff --git a/data/scripts/effects/dread_spike.lua b/data/scripts/effects/dread_spike.lua index e5677cd1..83592924 100644 --- a/data/scripts/effects/dread_spike.lua +++ b/data/scripts/effects/dread_spike.lua @@ -7,8 +7,8 @@ require("battleutils") --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 +function onDamageTaken(effect, attacker, defender, skill, action, actionContainer) + if skill.GetActionType() == ActionType.Physical then --maybe this works? local absorbPercent = 0.5; @@ -24,7 +24,6 @@ function onDamageTaken(effect, attacker, defender, action, actionContainer) --30451: You recover [absorbAmount] HP. actionContainer.AddHPAction(defender.actorId, 30451, absorbAmount) --Dread Spike is lost after absorbing hp - actionContainer.AddAction(defender.statusEffects.RemoveStatusEffectForBattleAction(effect)); + defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false); end -end; - +end; \ No newline at end of file diff --git a/data/scripts/effects/enduring_march.lua b/data/scripts/effects/enduring_march.lua index 32aaa489..4bc44e98 100644 --- a/data/scripts/effects/enduring_march.lua +++ b/data/scripts/effects/enduring_march.lua @@ -1,20 +1,20 @@ require("modifiers") -function onGain(target, effect) +function onGain(owner, effect, actionContainer) --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); + owner.MultiplyMod(modifiersGlobal.MovementSpeed, speedModifier); end; -function onLose(target, effect) +function onLose(owner, effect, actionContainer) local speedModifier = 0.8; if effect.GetTier() == 2 then speedModifier = 1.2; end - target.SetMod(modifiersGlobal.Speed, target.GetMod(modifiersGlobal.Speed) / speedModifier); + owner.DivideMod(modifiersGlobal.MovementSpeed, speedModifier); end; \ No newline at end of file diff --git a/data/scripts/effects/evade_proc.lua b/data/scripts/effects/evade_proc.lua index 5e6a46e2..d9b162e4 100644 --- a/data/scripts/effects/evade_proc.lua +++ b/data/scripts/effects/evade_proc.lua @@ -1,3 +1,3 @@ -function onLose(target, effect) - target:SetProc(0, false); +function onLose(owner, effect, actionContainer) + owner:SetProc(0, false); end; \ No newline at end of file diff --git a/data/scripts/effects/excruciate.lua b/data/scripts/effects/excruciate.lua index 59e3e499..9123623d 100644 --- a/data/scripts/effects/excruciate.lua +++ b/data/scripts/effects/excruciate.lua @@ -2,7 +2,7 @@ require("modifiers") require("battleutils") --Gradually increases critical rate of spells -function onTick(owner, effect) +function onTick(owner, effect, actionContainer) --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 @@ -23,8 +23,8 @@ 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)); +function onCrit(effect, attacker, defender, skill, action, actionContainer) + if skill.GetCommandType() == CommandType.Spell then + defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false); end end \ No newline at end of file diff --git a/data/scripts/effects/expchain.lua b/data/scripts/effects/expchain.lua new file mode 100644 index 00000000..a9cd5f56 --- /dev/null +++ b/data/scripts/effects/expchain.lua @@ -0,0 +1,7 @@ +require("modifiers") + +function onGain(owner, effect, actionContainer) +end; + +function onLose(owner, effect, actionContainer) +end; \ No newline at end of file diff --git a/data/scripts/effects/featherfoot.lua b/data/scripts/effects/featherfoot.lua index 13f635c3..97cd67c0 100644 --- a/data/scripts/effects/featherfoot.lua +++ b/data/scripts/effects/featherfoot.lua @@ -1,16 +1,16 @@ require("modifiers"); --15% in ARR, dont know how it worked in 1.0 -function onGain(target, effect) - target.AddMod(modifiersGlobal.RawEvadeRate, 15); +function onGain(owner, effect, actionContainer) + owner.AddMod(modifiersGlobal.RawEvadeRate, 15); end; -function onLose(target, effect) - target.SubtractMod(modifiersGlobal.RawEvadeRate, 15); +function onLose(owner, effect, actionContainer) + owner.SubtractMod(modifiersGlobal.RawEvadeRate, 15); end; --Returns 25%? of amount dodged as MP -function onEvade(effect, attacker, defender, action, actionContainer) +function onEvade(effect, attacker, defender, skill, action, actionContainer) --25% of amount dodged untraited, 50% traited local percent = 0.25; if (effect.GetTier() == 2) then @@ -22,5 +22,5 @@ function onEvade(effect, attacker, defender, action, actionContainer) --33010: You recover x MP from Featherfoot actionContainer.AddMPAction(defender.actorId, 33010, mpToReturn); --Featherfoot is lost after evading - actionContainer.AddAction(defender.statusEffects.RemoveStatusEffectForBattleAction(effect)); + defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false); end; \ No newline at end of file diff --git a/data/scripts/effects/fists_of_earth.lua b/data/scripts/effects/fists_of_earth.lua index d9ce7955..749dd2b3 100644 --- a/data/scripts/effects/fists_of_earth.lua +++ b/data/scripts/effects/fists_of_earth.lua @@ -1,6 +1,4 @@ -function onGain(target, effect) - target.statusEffects.RemoveStatusEffect(223209) - target.statusEffects.RemoveStatusEffect(223211) +function onGain(owner, effect, actionContainer) end; --Need to do more research on these. diff --git a/data/scripts/effects/fists_of_fire.lua b/data/scripts/effects/fists_of_fire.lua index 36442318..f4176486 100644 --- a/data/scripts/effects/fists_of_fire.lua +++ b/data/scripts/effects/fists_of_fire.lua @@ -1,4 +1,2 @@ -function onGain(target, effect) - target.statusEffects.RemoveStatusEffect(223210) - target.statusEffects.RemoveStatusEffect(223211) +function onGain(owner, effect, actionContainer) end; \ No newline at end of file diff --git a/data/scripts/effects/fists_of_wind.lua b/data/scripts/effects/fists_of_wind.lua index 06eaf213..f4176486 100644 --- a/data/scripts/effects/fists_of_wind.lua +++ b/data/scripts/effects/fists_of_wind.lua @@ -1,4 +1,2 @@ -function onGain(target, effect) - target.statusEffects.RemoveStatusEffect(223210) - target.statusEffects.RemoveStatusEffect(223209) +function onGain(owner, effect, actionContainer) end; \ No newline at end of file diff --git a/data/scripts/effects/flare2.lua b/data/scripts/effects/flare2.lua new file mode 100644 index 00000000..db26b1d0 --- /dev/null +++ b/data/scripts/effects/flare2.lua @@ -0,0 +1,9 @@ +require("modifiers") + +function onGain(owner, effect, actionContainer) + owner.AddMod(modifiersGlobal.RegenDown, effect.GetMagnitude()); +end + +function onLose(owner, effect, actionContainer) + owner.SubtractMod(modifiersGlobal.RegenDown, effect.GetMagnitude()); +end diff --git a/data/scripts/effects/foresight.lua b/data/scripts/effects/foresight.lua index 2ffcde2f..9c4497f5 100644 --- a/data/scripts/effects/foresight.lua +++ b/data/scripts/effects/foresight.lua @@ -1,15 +1,15 @@ require("modifiers") -function onGain(target, effect) +function onGain(owner, effect, actionContainer) --Parry is .1% per , Random guess but gonna say it gives 20% worth of parry. - target.AddMod(modifiersGlobal.Parry, 200); + owner.AddMod(modifiersGlobal.Parry, 200); end; -function onParry(effect, attacker, defender, action, actionContainer) +function onParry(effect, attacker, defender, skill, action, actionContainer) --Foresight is lost after parrying - actionContainer.AddAction(defender.statusEffects.RemoveStatusEffectForBattleAction(effect)); + defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false); end; -function onLose(target, effect) - target.SubtractMod(modifiersGlobal.Parry, 200); +function onLose(owner, effect, actionContainer) + owner.SubtractMod(modifiersGlobal.Parry, 200); 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 bbd1b7ef..9bc11a7a 100644 --- a/data/scripts/effects/fully_blissful_mind.lua +++ b/data/scripts/effects/fully_blissful_mind.lua @@ -1,7 +1,7 @@ -function onGain(owner, effect) +function onGain(owner, effect, actionContainer) --Using extra because that's what blissful_mind uses effect.SetExtra(effect.GetMagnitude()); end -function onLose(owner, effect) +function onLose(owner, effect, actionContainer) end diff --git a/data/scripts/effects/glare.lua b/data/scripts/effects/glare.lua new file mode 100644 index 00000000..2dec4f7d --- /dev/null +++ b/data/scripts/effects/glare.lua @@ -0,0 +1,9 @@ +require("modifiers") + +function onGain(owner, effect, actionContainer) + owner.SubtractMod(modifiersGlobal.Accuracy, effect.GetMagnitude()); +end; + +function onLose(owner, effect, actionContainer) + owner.AddMod(modifiersGlobal.Accuracy, effect.GetMagnitude()); +end; \ No newline at end of file diff --git a/data/scripts/effects/goring_blade.lua b/data/scripts/effects/goring_blade.lua index c1f8d794..db26b1d0 100644 --- a/data/scripts/effects/goring_blade.lua +++ b/data/scripts/effects/goring_blade.lua @@ -1,9 +1,9 @@ require("modifiers") -function onGain(owner, effect) +function onGain(owner, effect, actionContainer) owner.AddMod(modifiersGlobal.RegenDown, effect.GetMagnitude()); end -function onLose(owner, effect) +function onLose(owner, effect, actionContainer) owner.SubtractMod(modifiersGlobal.RegenDown, effect.GetMagnitude()); end diff --git a/data/scripts/effects/hallowed_ground.lua b/data/scripts/effects/hallowed_ground.lua new file mode 100644 index 00000000..210ee3d0 --- /dev/null +++ b/data/scripts/effects/hallowed_ground.lua @@ -0,0 +1,9 @@ +require("modifiers") + +function onGain(owner, effect, actionContainer) + owner.AddMod(modifiersGlobal.DamageTakenDown, 100); +end; + +function onLose(owner, effect, actionContainer) + owner.SubtractMod(modifiersGlobal.DamageTakenDown, 100); +end; \ No newline at end of file diff --git a/data/scripts/effects/haste.lua b/data/scripts/effects/haste.lua index 328f0f90..f90126c4 100644 --- a/data/scripts/effects/haste.lua +++ b/data/scripts/effects/haste.lua @@ -1,10 +1,10 @@ require("modifiers") --Set magnitude to milliseconds that HF will reduce delay by -function onGain(target, effect) - target.SubtractMod(modifiersGlobal.AttackDelay, effect.GetMagnitude()); +function onGain(owner, effect, actionContainer) + owner.SubtractMod(modifiersGlobal.AttackDelay, effect.GetMagnitude()); end; -function onLose(target, effect) - target.AddMod(modifiersGlobal.AttackDelay, effect.GetMagnitude()); +function onLose(owner, effect, actionContainer) + owner.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 a62f2b9a..f0e4079a 100644 --- a/data/scripts/effects/hawks_eye.lua +++ b/data/scripts/effects/hawks_eye.lua @@ -6,19 +6,19 @@ require("modifiers"); --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) +function onGain(owner, effect, actionContainer) local accuracyMod = 0.1875; if effect.GetTier() == 2 then accuracyMod = 0.28125; end - local amountGained = accuracyMod * target.GetMod(modifiersGlobal.Accuracy); + local amountGained = accuracyMod * owner.GetMod(modifiersGlobal.Accuracy); effect.SetMagnitude(amountGained); - target.AddMod(modifiersGlobal.Accuracy, effect.GetMagnitude()); + owner.AddMod(modifiersGlobal.Accuracy, effect.GetMagnitude()); end; -function onLose(target, effect) +function onLose(owner, effect, actionContainer) - target.SubtractMod(modifiersGlobal.Accuracy, effect.GetMagnitude()); + owner.SubtractMod(modifiersGlobal.Accuracy, effect.GetMagnitude()); end; \ No newline at end of file diff --git a/data/scripts/effects/heavy.lua b/data/scripts/effects/heavy.lua index e49f8813..0e59ab1d 100644 --- a/data/scripts/effects/heavy.lua +++ b/data/scripts/effects/heavy.lua @@ -1,13 +1,13 @@ require("modifiers") -function onGain(target, effect) - local speedModifier = 0.5; +function onGain(owner, effect, actionContainer) + local speedModifier = 0.8; - target.SetMod(modifiersGlobal.Speed, target.GetMod(modifiersGlobal.Speed) * speedModifier); + owner.MultiplyMod(modifiersGlobal.MovementSpeed, speedModifier); end; -function onLose(target, effect) - local speedModifier = 0.5; +function onLose(owner, effect, actionContainer) + local speedModifier = 0.8; - target.SetMod(modifiersGlobal.Speed, target.GetMod(modifiersGlobal.Speed) / speedModifier); + owner.DivideMod(modifiersGlobal.MovementSpeed, speedModifier); end; \ No newline at end of file diff --git a/data/scripts/effects/hp_boost.lua b/data/scripts/effects/hp_boost.lua index d3c93575..70d097e2 100644 --- a/data/scripts/effects/hp_boost.lua +++ b/data/scripts/effects/hp_boost.lua @@ -2,14 +2,14 @@ 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) +function onGain(owner, effect, actionContainer) local newMaxHP = target.GetMaxHP() * 1.25; local healAmount = newMaxHP - target.GetMaxHP(); - target.SetMaxHP(newMaxHP); - target.AddHP(healAmount); + owner.SetMaxHP(newMaxHP); + owner.AddHP(healAmount); end; -function onLose(target, effect) - target.SetMaxHP(target.GetMaxHP() / 1.25); +function onLose(owner, effect, actionContainer) + owner.SetMaxHP(owner.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 28b32b7b..7c6d4475 100644 --- a/data/scripts/effects/hundred_fists.lua +++ b/data/scripts/effects/hundred_fists.lua @@ -1,10 +1,10 @@ require("modifiers") --Set magnitude to milliseconds that HF will reduce delay by -function onGain(target, effect) - target.SubtractMod(modifiersGlobal.AttackDelay), effect.GetMagnitude()); +function onGain(owner, effect, actionContainer) + owner.SubtractMod(modifiersGlobal.Delay, effect.GetMagnitude()); end; -function onLose(target, effect) - target.AddMod(modifiersGlobal.AttackDelay), effect.GetMagnitude()); +function onLose(owner, effect, actionContainer) + owner.AddMod(modifiersGlobal.Delay, effect.GetMagnitude()); end; \ No newline at end of file diff --git a/data/scripts/effects/invigorate.lua b/data/scripts/effects/invigorate.lua index a4aac14c..4524940f 100644 --- a/data/scripts/effects/invigorate.lua +++ b/data/scripts/effects/invigorate.lua @@ -1,10 +1,10 @@ require("modifiers") --100 TP per tick without AF. 133 TP per tick with AF -function onGain(owner, effect) +function onGain(owner, effect, actionContainer) owner.AddMod(modifiersGlobal.Regain, effect.GetMagnitude()); end -function onLose(owner, effect) +function onLose(owner, effect, actionContainer) owner.SubtractMod(modifiersGlobal.Regain, effect.GetMagnitude()); end diff --git a/data/scripts/effects/keen_flurry.lua b/data/scripts/effects/keen_flurry.lua index d80ea770..aee7dcbf 100644 --- a/data/scripts/effects/keen_flurry.lua +++ b/data/scripts/effects/keen_flurry.lua @@ -3,7 +3,7 @@ require("battleutils") --Untraited reduces cooldown by 50% --Traited reduces cooldown by 100% function onCommandStart(effect, owner, skill, actionContainer) - if skill.commandType == CommandType.Weaponskill then + if skill.GetCommandType() == CommandType.Weaponskill then local reduction = 0.5; if effect.GetTier() == 2 then diff --git a/data/scripts/effects/life_surge_I.lua b/data/scripts/effects/life_surge_I.lua index 3f3a5ab5..864fff62 100644 --- a/data/scripts/effects/life_surge_I.lua +++ b/data/scripts/effects/life_surge_I.lua @@ -4,8 +4,8 @@ require("battleutils") --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 +function onHit(effect, attacker, defender, skill, action, actionContainer) + if skill.GetCommandType() == CommandType.AutoAttack then local healPercent = 0.10; if effect.GetTier() == 2 then @@ -14,6 +14,6 @@ function onHit(effect, attacker, defender, action, actionContainer) local amount = math.floor((healPercent * action.amount) + 1); attacker.AddHP(amount); - actionContainer.AddHPAction(defender.actorId, 30332, amount); + actionContainer.AddHPAbsorbAction(defender.actorId, 30332, amount); end end; \ No newline at end of file diff --git a/data/scripts/effects/life_surge_II.lua b/data/scripts/effects/life_surge_II.lua index 3b74a94e..944dcafb 100644 --- a/data/scripts/effects/life_surge_II.lua +++ b/data/scripts/effects/life_surge_II.lua @@ -1,7 +1,7 @@ require("battleutils") -function onHit(effect, attacker, defender, action, actionContainer) - if action.commandType == CommandType.AutoAttack then +function onHit(effect, attacker, defender, skill, action, actionContainer) + if skill.GetCommandType() == CommandType.AutoAttack then local healPercent = 0.20; if effect.GetTier() == 2 then @@ -10,6 +10,6 @@ function onHit(effect, attacker, defender, action, actionContainer) local amount = math.floor((healPercent * action.amount) + 1); attacker.AddHP(amount); - actionContainer.AddHPAction(defender.actorId, 30332, amount); + actionContainer.AddHPAbsorbAction(defender.actorId, 30332, amount); end end; \ No newline at end of file diff --git a/data/scripts/effects/life_surge_III.lua b/data/scripts/effects/life_surge_III.lua index 3f3a5ab5..9307829f 100644 --- a/data/scripts/effects/life_surge_III.lua +++ b/data/scripts/effects/life_surge_III.lua @@ -4,16 +4,16 @@ require("battleutils") --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; +function onHit(effect, attacker, defender, skill, action, actionContainer) + if skill.GetCommandType() == CommandType.AutoAttack then + local healPercent = 0.30; if effect.GetTier() == 2 then - healPercent = 0.30; + healPercent = 0.50; end local amount = math.floor((healPercent * action.amount) + 1); attacker.AddHP(amount); - actionContainer.AddHPAction(defender.actorId, 30332, amount); + actionContainer.AddHPAbsorbAction(defender.actorId, 30332, amount); end end; \ No newline at end of file diff --git a/data/scripts/effects/magic_evasion_down.lua b/data/scripts/effects/magic_evasion_down.lua index 2afa58ba..0bc153a0 100644 --- a/data/scripts/effects/magic_evasion_down.lua +++ b/data/scripts/effects/magic_evasion_down.lua @@ -1,9 +1,9 @@ require("modifiers") -function onGain(owner, effect) +function onGain(owner, effect, actionContainer) owner.SubtractMod(modifiersGlobal.MagicEvasion, effect.GetMagnitude()); end -function onLose(owner, effect) +function onLose(owner, effect, actionContainer) owner.AddMod(modifiersGlobal.MagicEvasion, effect.GetMagnitude()); end diff --git a/data/scripts/effects/minuet_of_rigor.lua b/data/scripts/effects/minuet_of_rigor.lua index 87919522..da4a20d0 100644 --- a/data/scripts/effects/minuet_of_rigor.lua +++ b/data/scripts/effects/minuet_of_rigor.lua @@ -1,12 +1,12 @@ require("modifiers") -function onGain(owner, effect) +function onGain(owner, effect, actionContainer) --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) +function onLose(owner, effect, actionContainer) 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/miss_proc.lua b/data/scripts/effects/miss_proc.lua index 2983289a..daf71a9f 100644 --- a/data/scripts/effects/miss_proc.lua +++ b/data/scripts/effects/miss_proc.lua @@ -1,3 +1,3 @@ -function onLose(target, effect) - target:SetProc(3, false); +function onLose(owner, effect, actionContainer) + owner:SetProc(3, false); end; \ No newline at end of file diff --git a/data/scripts/effects/necrogenesis.lua b/data/scripts/effects/necrogenesis.lua index e340f958..76c281e7 100644 --- a/data/scripts/effects/necrogenesis.lua +++ b/data/scripts/effects/necrogenesis.lua @@ -1,12 +1,12 @@ require("modifiers") require("battleutils") -function onHit(effect, attacker, defender, action, actionContainer) - if action.commandType == CommandType.Spell then +function onHit(effect, attacker, defender, skill, action, actionContainer) + if skill.GetCommandType() == 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)); + attacker.AddHP(hpToReturn); + actionContainer.AddHPAbsorbAction(defender.actorId, 33012, hpToReturn); + attacker.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false); end end \ No newline at end of file diff --git a/data/scripts/effects/outmaneuver2.lua b/data/scripts/effects/outmaneuver2.lua index f54e864e..e44f58be 100644 --- a/data/scripts/effects/outmaneuver2.lua +++ b/data/scripts/effects/outmaneuver2.lua @@ -1,16 +1,16 @@ require("modifiers") --Add 30 raw block rate. No idea how much block it actually gives. -function onGain(owner, effect) +function onGain(owner, effect, actionContainer) owner.AddMod(modifiersGlobal.RawBlockRate, 30); end -function onLose(owner, effect) +function onLose(owner, effect, actionContainer) 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) +function onBlock(effect, attacker, defender, skill, action, actionContainer) --200 TP on block defender.AddTP(200); diff --git a/data/scripts/effects/paeon_of_war.lua b/data/scripts/effects/paeon_of_war.lua index ec50abf6..55868d91 100644 --- a/data/scripts/effects/paeon_of_war.lua +++ b/data/scripts/effects/paeon_of_war.lua @@ -1,10 +1,10 @@ require("modifiers") -function onGain(owner, effect) +function onGain(owner, effect, actionContainer) --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) +function onLose(owner, effect, actionContainer) owner.SubtractMod(modifiersGlobal.Regain, effect.GetMagnitude()); end; \ No newline at end of file diff --git a/data/scripts/effects/parry_proc.lua b/data/scripts/effects/parry_proc.lua index 97e6911a..e2887d6f 100644 --- a/data/scripts/effects/parry_proc.lua +++ b/data/scripts/effects/parry_proc.lua @@ -1,3 +1,3 @@ -function onLose(target, effect) - target:SetProc(2, false); +function onLose(owner, effect, actionContainer) + owner:SetProc(2, false); end; \ No newline at end of file diff --git a/data/scripts/effects/parsimony.lua b/data/scripts/effects/parsimony.lua index cb3ea325..e1871941 100644 --- a/data/scripts/effects/parsimony.lua +++ b/data/scripts/effects/parsimony.lua @@ -6,12 +6,19 @@ 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)); +--Having two identical functions seems weird. also don't know if parsimony still activates if resisted or evaded? +function onHit(effect, attacker, defender, skill, action, actionContainer) + if skill.GetCommandType() == CommandType.Spell then + local percent = 0.10; + + if effect.GetTier() == 2 then + percent = 0.35; + end + + --Parsimony returns 10% (35 traited) of damage done rounded up as MP. + local mpToReturn = math.ceil(percent * action.amount); + attacker.AddMP(mpToReturn); + actionContainer.AddMPAbsorbAction(0, 33007, mpToReturn); + defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false); end end \ No newline at end of file diff --git a/data/scripts/effects/poison.lua b/data/scripts/effects/poison.lua index 34f9ca6c..db26b1d0 100644 --- a/data/scripts/effects/poison.lua +++ b/data/scripts/effects/poison.lua @@ -1,7 +1,9 @@ -function onGain(owner, effect) +require("modifiers") + +function onGain(owner, effect, actionContainer) owner.AddMod(modifiersGlobal.RegenDown, effect.GetMagnitude()); end -function onLose(owner, effect) +function onLose(owner, effect, actionContainer) 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 ccef5719..10c7be0d 100644 --- a/data/scripts/effects/power_surge_I.lua +++ b/data/scripts/effects/power_surge_I.lua @@ -2,9 +2,23 @@ require("modifiers") 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); + +--Base amount of attack gained is 105, which is multiplied by 1.1 if traited. This is why it gives 231 Attack at level 2 +--Unsure why defense is a weird number +function onGain(owner, effect, actionContainer) + local attackGained = 315; + local defenseLost = 158; + + --Enhanced Power Surge: Increases effect of Power Surge by 10% (assuming this doesn't lower defense further) + if owner.HasTrait(27281) then + attackGained = attackGained * 1.1; + end + + effect.SetMagnitude(attackGained); + effect.SetExtra(defenseLost); + + owner.AddMod(modifiersGlobal.Attack, effect.GetMagnitude()); + owner.SubtractMod(modifiersGlobal.Defense, effect.GetExtra()); end function onCommandStart(effect, owner, command, actionContainer) @@ -14,7 +28,7 @@ function onCommandStart(effect, owner, command, actionContainer) effect.SetTier(effect.GetTier() + 1); --Takes 10 weaponskills/jumps to increase level - if effect.GetTier() > 10 then + if effect.GetTier() > 1 then local action = owner.statusEffects.ReplaceEffect(effect, 223213, 1, 1, 60); actionContainer.AddAction(action); else @@ -23,7 +37,7 @@ function onCommandStart(effect, owner, command, actionContainer) end end -function onLose(owner, effect) - owner.SubtractMod(modifiersGlobal.Attack, 115); - owner.AddMod(modifiersGlobal.Defense, 158); +function onLose(owner, effect, actionContainer) + owner.SubtractMod(modifiersGlobal.Attack, effect.GetMagnitude()); + owner.AddMod(modifiersGlobal.Defense, effect.GetExtra()); end \ No newline at end of file diff --git a/data/scripts/effects/power_surge_II.lua b/data/scripts/effects/power_surge_II.lua index dc87d18f..b2bfe34c 100644 --- a/data/scripts/effects/power_surge_II.lua +++ b/data/scripts/effects/power_surge_II.lua @@ -2,9 +2,20 @@ require("modifiers") 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); +function onGain(owner, effect, actionContainer) + local attackGained = 210; + local defenseLost = 158; + + --Enhanced Power Surge: Increases effect of Power Surge by 10% (assuming this doesn't lower defense further) + if owner.HasTrait(27281) then + attackGained = attackGained * 1.1; + end + + effect.SetMagnitude(attackGained); + effect.SetExtra(defenseLost); + + owner.AddMod(modifiersGlobal.Attack, effect.GetMagnitude()); + owner.SubtractMod(modifiersGlobal.Defense, effect.GetExtra()); end function onCommandStart(effect, owner, command, actionContainer) @@ -23,8 +34,7 @@ function onCommandStart(effect, owner, command, actionContainer) end end -function onLose(owner, effect) - owner.SubtractMod(modifiersGlobal.Attack, 230); - owner.AddMod(modifiersGlobal.Defense, 158); -end - +function onLose(owner, effect, actionContainer) + owner.SubtractMod(modifiersGlobal.Attack, effect.GetMagnitude()); + owner.AddMod(modifiersGlobal.Defense, effect.GetExtra()); +end \ No newline at end of file diff --git a/data/scripts/effects/power_surge_III.lua b/data/scripts/effects/power_surge_III.lua index 5d9e46c8..ccb3d1dd 100644 --- a/data/scripts/effects/power_surge_III.lua +++ b/data/scripts/effects/power_surge_III.lua @@ -2,9 +2,20 @@ require("modifiers") 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); +function onGain(owner, effect, actionContainer) + local attackGained = 315; + local defenseLost = 158; + + --Enhanced Power Surge: Increases effect of Power Surge by 10% (assuming this doesn't lower defense further) + if owner.HasTrait(27281) then + attackGained = attackGained * 1.1; + end + + effect.SetMagnitude(attackGained); + effect.SetExtra(defenseLost); + + owner.AddMod(modifiersGlobal.Attack, effect.GetMagnitude()); + owner.SubtractMod(modifiersGlobal.Defense, effect.GetExtra()); end function onCommandStart(effect, owner, command, actionContainer) @@ -16,8 +27,7 @@ function onCommandStart(effect, owner, command, actionContainer) end end -function onLose(owner, effect) - owner.SubtractMod(modifiersGlobal.Attack, 345); - owner.AddMod(modifiersGlobal.Defense, 158); -end - +function onLose(owner, effect, actionContainer) + owner.SubtractMod(modifiersGlobal.Attack, effect.GetMagnitude()); + owner.AddMod(modifiersGlobal.Defense, effect.GetExtra()); +end \ No newline at end of file diff --git a/data/scripts/effects/protect.lua b/data/scripts/effects/protect.lua index 2a30e14b..56f4dd9a 100644 --- a/data/scripts/effects/protect.lua +++ b/data/scripts/effects/protect.lua @@ -1,18 +1,18 @@ require("modifiers") -function onGain(target, effect) +function onGain(owner, effect, actionContainer) --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 = 4.56 * effect.GetMagnitude(); - target.AddMod(modifiersGlobal.Defense, defenseBuff); + owner.AddMod(modifiersGlobal.Defense, defenseBuff); end; -function onLose(target, effect) +function onLose(owner, effect, actionContainer) local defenseBuff = 4.56 * effect.GetMagnitude(); - target.SubtractMod(modifiersGlobal.Defense, defenseBuff); + owner.SubtractMod(modifiersGlobal.Defense, defenseBuff); end; diff --git a/data/scripts/effects/protect2.lua b/data/scripts/effects/protect2.lua index 0065e980..167a9bc6 100644 --- a/data/scripts/effects/protect2.lua +++ b/data/scripts/effects/protect2.lua @@ -1,6 +1,6 @@ require("modifiers") -function onGain(target, effect) +function onGain(owner, effect, actionContainer) --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 @@ -8,29 +8,29 @@ function onGain(target, effect) local defenseBuff = 4.56 * effect.GetMagnitude(); local magicDefenseBuff = 0; - target.AddMod(modifiersGlobal.Defense, defenseBuff); + owner.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. magicDefenseBuff = 6.67 * effect.GetMagnitude(); - for i = modifiersGlobal.ResistFire, modifiersGlobal.ResistWater do - target.AddMod(i, magicDefenseBuff); + for i = modifiersGlobal.FireResistance, modifiersGlobal.WaterResistance do + owner.AddMod(i, magicDefenseBuff); end end; -function onLose(target, effect) +function onLose(owner, effect, actionContainer) local defenseBuff = 4.56 * effect.GetMagnitude(); local magicDefenseBuff = 0; - target.SubtractMod(modifiersGlobal.Defense, defenseBuff); + owner.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. magicDefenseBuff = 6.67 * effect.GetMagnitude(); - for i = modifiersGlobal.ResistFire, modifiersGlobal.ResistWater do - target.SubtractMod(i, magicDefenseBuff); + for i = modifiersGlobal.FireResistance, modifiersGlobal.WaterResistance do + owner.SubtractMod(i, magicDefenseBuff); end end; diff --git a/data/scripts/effects/quelling_strike.lua b/data/scripts/effects/quelling_strike.lua index 347b8e1a..41600277 100644 --- a/data/scripts/effects/quelling_strike.lua +++ b/data/scripts/effects/quelling_strike.lua @@ -5,12 +5,10 @@ require("battleutils") --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()); + if skill.GetCommandType() == CommandType.Weaponskill or skill.GetCommandType() == CommandType.Ability or skill.GetCommandType() == CommandType.Magic then + if skill.GetActionType() == ActionType.Physical or skill.GetActionType() == ActionType.Magic then + skill.enmityModifier = skill.enmityModifier * 0.8; + skill.tpCost = skill.tpCost - effect.GetMagnitude(); end end end; \ No newline at end of file diff --git a/data/scripts/effects/quick.lua b/data/scripts/effects/quick.lua index 65861376..b3c7ff3e 100644 --- a/data/scripts/effects/quick.lua +++ b/data/scripts/effects/quick.lua @@ -1,13 +1,13 @@ require("modifiers") -function onGain(target, effect) +function onGain(owner, effect, actionContainer) local speedModifier = 1.25; - target.SetMod(modifiersGlobal.Speed, target.GetMod(modifiersGlobal.Speed) * speedModifier); + owner.MultiplyMod(modifiersGlobal.MovementSpeed, speedModifier); end; -function onLose(target, effect) +function onLose(owner, effect, actionContainer) local speedModifier = 1.25; - target.SetMod(modifiersGlobal.Speed, target.GetMod(modifiersGlobal.Speed) / speedModifier); + owner.DivideMod(modifiersGlobal.MovementSpeed, speedModifier); end; \ No newline at end of file diff --git a/data/scripts/effects/raging_strike2.lua b/data/scripts/effects/raging_strike2.lua index 02577285..4f1a4c7d 100644 --- a/data/scripts/effects/raging_strike2.lua +++ b/data/scripts/effects/raging_strike2.lua @@ -1,13 +1,7 @@ require("modifiers") require("battleutils") - -function onCommandStart(effect, attacker, command, actionContainer) - --Random guess - command.enmityModifier += 0.25; -end - -function onHit(effect, attacker, defender, action, actionContainer) +function onHit(effect, attacker, defender, skill, action, actionContainer) if skill.id == 27259 then --Effect stacks up to 3 times if effect.GetTier() < 3 then @@ -16,8 +10,8 @@ function onHit(effect, attacker, defender, action, actionContainer) end end -function onMiss(effect, attacker, defender, action, actionContainer) +function onMiss(effect, attacker, defender, skill, action, actionContainer) if skill.id == 27259 then - effect.SetTier(0); + end end \ No newline at end of file diff --git a/data/scripts/effects/rampage2.lua b/data/scripts/effects/rampage2.lua index 7474d612..169b65e7 100644 --- a/data/scripts/effects/rampage2.lua +++ b/data/scripts/effects/rampage2.lua @@ -1,48 +1,47 @@ require("modifiers") +require("battleutils") require("utils") parryPerDT = 20; delayMsPerDT = 100; -function onGain(owner, effect) - owner.statusEffects.RemoveStatusEffect(223207); +function onGain(owner, effect, actionContainer) end --Increases parry rating and attack speed for each hit. (Need more info) -function onDamageTaken(effect, attacker, defender, action, actionContainer) - +function onDamageTaken(effect, attacker, defender, skill, 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.AttackDelay, delayMsPerDT); + defender.AddMod(modifiersGlobal.Parry, parryPerDT); + defender.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); +function onCrit(effect, attacker, defender, skill, action, actionContainer) + local healAmount = math.Clamp(action.amount * 0.50, 0, attacker.GetMaxHP() * 0.20); + healAmount = math.Clamp(healAmount, 0, attacker.GetMaxHP() - attacker.GetHP()); + attacker.AddHP(healAmount); --33012: You recover [healAmount] HP. - actionContainer.AddHPAction(owner.actorId, 33008, healAmount); + actionContainer.AddHPAbsorbAction(defender.actorId, 33008, healAmount); end; --"Effect fades over time" -function onTick(owner, effect) +--Rampage ticks every 6 seconds +function onTick(owner, effect, actionContainer) --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. owner.SubtractMod(modifiersGlobal.Parry, parryPerDT); owner.AddMod(modifiersGlobal.Delay, delayMsPerDT); effect.SetExtra(effect.GetExtra() - 1); end end -function onLose(owner, effect) +function onLose(owner, effect, actionContainer) owner.SubtractMod(modifiersGlobal.Parry, effect.GetExtra() * parryPerDT); owner.AddMod(modifiersGlobal.Delay, effect.GetExtra() * delayMsPerDT); end \ No newline at end of file diff --git a/data/scripts/effects/rampart.lua b/data/scripts/effects/rampart.lua index 6602e09a..d6476278 100644 --- a/data/scripts/effects/rampart.lua +++ b/data/scripts/effects/rampart.lua @@ -4,12 +4,12 @@ require("modifiers") --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); +function onGain(owner, effect, actionContainer) + effect.SetMagnitude(2 * owner.GetLevel() + 5); - target.AddMod(modifiersGlobal.Defense, effect.GetMagnitude()); + owner.AddMod(modifiersGlobal.Defense, effect.GetMagnitude()); end; -function onLose(target, effect) - target.SubtractMod(modifiersGlobal.Defense, effect.GetMagnitude()); +function onLose(owner, effect, actionContainer) + owner.SubtractMod(modifiersGlobal.Defense, effect.GetMagnitude()); end; \ No newline at end of file diff --git a/data/scripts/effects/refresh.lua b/data/scripts/effects/refresh.lua index b5d53fdc..8524d7bf 100644 --- a/data/scripts/effects/refresh.lua +++ b/data/scripts/effects/refresh.lua @@ -1,7 +1,9 @@ -function onGain(owner, effect) +require("modifiers") + +function onGain(owner, effect, actionContainer) owner.AddMod(modifiersGlobal.Refresh, effect.GetMagnitude()); end -function onLose(owner, effect) +function onLose(owner, effect, actionContainer) owner.SubtractMod(modifiersGlobal.Refresh, effect.GetMagnitude()); end diff --git a/data/scripts/effects/regain.lua b/data/scripts/effects/regain.lua index cec064eb..9c3aeabf 100644 --- a/data/scripts/effects/regain.lua +++ b/data/scripts/effects/regain.lua @@ -1,7 +1,9 @@ -function onGain(owner, effect) +require("modifiers") + +function onGain(owner, effect, actionContainer) owner.AddMod(modifiersGlobal.Regain, effect.GetMagnitude()); end -function onLose(owner, effect) +function onLose(owner, effect, actionContainer) owner.SubtractMod(modifiersGlobal.Regain, effect.GetMagnitude()); end diff --git a/data/scripts/effects/regen.lua b/data/scripts/effects/regen.lua index e63ed6d9..45157ea7 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) +function onGain(owner, effect, actionContainer) owner.AddMod(modifiersGlobal.Regen, effect.GetMagnitude()); end -function onLose(owner, effect) +function onLose(owner, effect, actionContainer) owner.SubtractMod(modifiersGlobal.Regen, effect.GetMagnitude()); end diff --git a/data/scripts/effects/resonance2.lua b/data/scripts/effects/resonance2.lua index 34b3748a..05922a76 100644 --- a/data/scripts/effects/resonance2.lua +++ b/data/scripts/effects/resonance2.lua @@ -3,13 +3,15 @@ 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) +--It also increased height of skills +function onMagicCast(caster, effect, skill) skill.range = skill.range * 1.25; + skill.rangeHeight = skill.rangeHeight * 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)); + if skill.GetCommandType() == CommandType.Spell then + owner.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false); end end \ No newline at end of file diff --git a/data/scripts/effects/sacred_prism.lua b/data/scripts/effects/sacred_prism.lua new file mode 100644 index 00000000..3e28632f --- /dev/null +++ b/data/scripts/effects/sacred_prism.lua @@ -0,0 +1,8 @@ +require("modifiers") +require("battleutils") + +function onMagicCast(caster, effect, skill) + skill.aoeType = TargetFindAOEType.Circle; + skill.aoeRange = 15; + skill.validTarget = 31 +end \ No newline at end of file diff --git a/data/scripts/effects/sanguine_rite2.lua b/data/scripts/effects/sanguine_rite2.lua index 969284ae..87820d59 100644 --- a/data/scripts/effects/sanguine_rite2.lua +++ b/data/scripts/effects/sanguine_rite2.lua @@ -1,8 +1,8 @@ require("modifiers") --Sanguine Rite restores 30% of damage taken as MP -function onDamageTaken(effect, attacker, defender, action, actionContainer) +function onDamageTaken(effect, attacker, defender, skill, action, actionContainer) local mpToRestore = action.amount * 0.30; defender.AddMP(mpToRestore); - actionContainer.AddMPAction(defender, 33011, mpToRestore); + actionContainer.AddMPAction(defender.actorId, 33011, mpToRestore); end \ No newline at end of file diff --git a/data/scripts/effects/sanguine_rite3.lua b/data/scripts/effects/sanguine_rite3.lua index e702d0b2..329dac74 100644 --- a/data/scripts/effects/sanguine_rite3.lua +++ b/data/scripts/effects/sanguine_rite3.lua @@ -1,22 +1,22 @@ require("modifiers") -function onGain(target, effect) +function onGain(owner, effect, actionContainer) --Traited Sanguine Rite reduces damage taken by 25%. --The icon in game says it's 50%, but it's lying local amount = 25; - target.AddMod(modifiersGlobal.DamageTakenDown, amount); + owner.AddMod(modifiersGlobal.DamageTakenDown, amount); end; -function onLose(target, effect) +function onLose(owner, effect, actionContainer) local amount = 25; - target.SubtractMod(modifiersGlobal.DamageTakenDown, amount); + owner.SubtractMod(modifiersGlobal.DamageTakenDown, amount); end; --Sanguine Rite restores 30% of damage taken as MP -function onDamageTaken(effect, attacker, defender, action, actionContainer) +function onDamageTaken(effect, attacker, defender, skill, action, actionContainer) local mpToRestore = action.amount * 0.30; defender.AddMP(mpToRestore); - actionContainer.AddMPAction(defender, 33011, mpToRestore); + actionContainer.AddMPAction(defender.actorId, 33011, mpToRestore); end \ No newline at end of file diff --git a/data/scripts/effects/sentinel.lua b/data/scripts/effects/sentinel.lua index 6ca3b4a1..637a10fc 100644 --- a/data/scripts/effects/sentinel.lua +++ b/data/scripts/effects/sentinel.lua @@ -1,30 +1,30 @@ require("modifiers") require("battleutils") -function onGain(target, effect) +function onGain(owner, effect, actionContainer) --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); + owner.AddMod(modifiersGlobal.DamageTakenDown, amount); end; -function onLose(target, effect) +function onLose(owner, effect, actionContainer) local amount = 30; if effect.GetTier() == 2 then amount = 50; end - target.SubtractMod(modifiersGlobal.DamageTakenDown, amount); + owner.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 +function onHit(effect, attacker, defender, skill, action, actionContainer) + if skill.GetCommandType() == CommandType.WeaponSkill then action.enmity = action.enmity + 100; end end \ No newline at end of file diff --git a/data/scripts/effects/spinning_heel.lua b/data/scripts/effects/spinning_heel.lua index d8531b82..d226be7f 100644 --- a/data/scripts/effects/spinning_heel.lua +++ b/data/scripts/effects/spinning_heel.lua @@ -1,10 +1,10 @@ require("modifiers") -function onGain(target, effect) - target.SetMod(modifiersGlobal.HitCount, 3); +function onGain(owner, effect, actionContainer) + owner.SetMod(modifiersGlobal.HitCount, 3); end; -function onLose(target, effect) - target.SetMod(modifiersGlobal.HitCount, 2); +function onLose(owner, effect, actionContainer) + owner.SetMod(modifiersGlobal.HitCount, 2); end; diff --git a/data/scripts/effects/stoneskin.lua b/data/scripts/effects/stoneskin.lua index 9905d3fc..d717285b 100644 --- a/data/scripts/effects/stoneskin.lua +++ b/data/scripts/effects/stoneskin.lua @@ -1,13 +1,18 @@ require("modifiers") -function onGain(owner, effect) +function onGain(owner, effect, actionContainer) owner.AddMod(modifiersGlobal.Stoneskin, effect.GetMagnitude()); end +--This is wrong, need to think of a good way of keeping track of how much stoneskin is left when it falls off. +function onLose(owner, effect, actionContainer) + owner.SetMod(modifiersGlobal.Stoneskin, 0); +end + --Using extra for how much mitigation stoneskin has -function onPostAction(caster, target, effect, skill, action, actionContainer) - if (owner.GetMod(modifiersGlobal.Stoneskin) <= 0) then - actionContainer.AddAction(owner.statusEffects.RemoveStatusEffectForBattleAction(effect)); +function onDamageTaken(effect, attacker, defender, skill, action, actionContainer) + if (defender.GetMod(modifiersGlobal.Stoneskin) <= 0) then + defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false); end end; \ No newline at end of file diff --git a/data/scripts/effects/swiftsong.lua b/data/scripts/effects/swiftsong.lua new file mode 100644 index 00000000..b3c7ff3e --- /dev/null +++ b/data/scripts/effects/swiftsong.lua @@ -0,0 +1,13 @@ +require("modifiers") + +function onGain(owner, effect, actionContainer) + local speedModifier = 1.25; + + owner.MultiplyMod(modifiersGlobal.MovementSpeed, speedModifier); +end; + +function onLose(owner, effect, actionContainer) + local speedModifier = 1.25; + + owner.DivideMod(modifiersGlobal.MovementSpeed, speedModifier); +end; \ No newline at end of file diff --git a/data/scripts/effects/tempered_will.lua b/data/scripts/effects/tempered_will.lua index 4cef7878..d55c99c8 100644 --- a/data/scripts/effects/tempered_will.lua +++ b/data/scripts/effects/tempered_will.lua @@ -1,7 +1,9 @@ -function onGain(owner, effect) +require("modifiers") + +function onGain(owner, effect, actionContainer) owner.AddMod(modifiersGlobal.KnockbackImmune, 1); end -function onLose(owner, effect) +function onLose(owner, effect, actionContainer) 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 index 435c4842..e5707afe 100644 --- a/data/scripts/effects/tp_bleed.lua +++ b/data/scripts/effects/tp_bleed.lua @@ -1,7 +1,9 @@ -function onGain(owner, effect) +require("modifiers") + +function onGain(owner, effect, actionContainer) owner.SubtractMod(modifiersGlobal.Regain, effect.GetMagnitude()); end -function onLose(owner, effect) +function onLose(owner, effect, actionContainer) owner.AddMod(modifiersGlobal.Regain, effect.GetMagnitude()); end diff --git a/data/scripts/effects/vengeance.lua b/data/scripts/effects/vengeance.lua index 5c5379c4..6fbcc795 100644 --- a/data/scripts/effects/vengeance.lua +++ b/data/scripts/effects/vengeance.lua @@ -1,15 +1,15 @@ require("modifiers") 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) - local amount = action.amount + action.mitigatedAmount; +--Unclear what the exact damage is but it seems like it's the total amount of damage the attack would have done before parrying + 1 +function onDamageTaken(effect, attacker, defender, skill, action, actionContainer) + local amount = action.amount + action.amountMitigated + 1; --Only reflects magical attacks if wearing AF chest - if action.actionType == ActionType.Physical or (action.actionType == ActionType.Magic and effect.GetTier() == 2) then + if skill.GetActionType() == ActionType.Physical or (skill.GetActionType() == 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); + attacker.DelHP(amount, actionContainer); actionContainer.AddHitAction(attacker.actorId, 30350, amount); end; end; \ No newline at end of file