New scripts

New scripts for commands and effects that use the new function
signatures and work with the new statuseffectcontainer
This commit is contained in:
Yogurt 2019-05-29 23:05:40 -07:00
parent 4f80023156
commit 00017468cc
129 changed files with 884 additions and 396 deletions

View File

@ -108,7 +108,7 @@ function onEventStarted(player, actor, triggerName, isTeleport)
randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5); randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5);
rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]); rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]);
--bandaid fix for returning while dead, missing things like weakness and the heal number --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:SetHP(player.GetMaxHP());
player:ChangeState(0); player:ChangeState(0);
player:PlayAnimation(0x01000066); player:PlayAnimation(0x01000066);

View File

@ -12,8 +12,12 @@ end;
function onSkillFinish(caster, target, skill, action, actionContainer) function onSkillFinish(caster, target, skill, action, actionContainer)
--Only the bard gets the Battle Voice effect --Only the bard gets the Battle Voice effect
if caster == target then 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 end
action.DoAction(caster, target, skill, actionContainer); local effect = GetWorldManager():GetStatusEffect(223029);
effect.SetDuration(60);
caster.statusEffects.AddStatusEffect(effect, caster, actionContainer);
end; end;

View File

@ -14,6 +14,18 @@ function onAbilityStart(caster, target, ability)
end; end;
function onSkillFinish(caster, target, skill, action, actionContainer) function onSkillFinish(caster, target, skill, action, 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 --DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);
end
end; end;

View File

@ -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 we have a buff then Blissful Mind removes that buff and restores MP. Otherwise, it adds the Blissful Mind effect
if buff ~= nil then if buff ~= nil then
local amount = buff.GetExtra(); local amount = buff.GetExtra();
local remAction = caster.statusEffects.RemoveStatusEffectForBattleAction(buff, 30329);
caster.AddMP(amount); caster.AddMP(amount);
actionContainer.AddMPAction(caster.actorId, 33007, amount); actionContainer.AddMPAction(caster.actorId, 33007, amount);
actionContainer.AddAction(remAction); caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329);
else 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 --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; local amount = caster.GetHP() * 0.25;
caster.DelHP(amount); caster.DelHP(amount, actionContainer);
skill.statusMagnitude = amount; skill.statusMagnitude = amount;
--DoAction handles rates, buffs, dealing damage --DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);
end end
end; end;

View File

@ -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;

View File

@ -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;

View File

@ -14,5 +14,6 @@ function onAbilityStart(caster, target, ability)
end; end;
function onSkillFinish(caster, target, skill, action, actionContainer) 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; end;

View File

@ -10,6 +10,12 @@ function onAbilityStart(caster, target, ability)
end; end;
function onSkillFinish(caster, target, skill, action, actionContainer) function onSkillFinish(caster, target, skill, action, actionContainer)
local buff = caster.statusEffects.GetStatusEffectById(223227)
if buff ~= nil then
caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329);
else
--DoAction handles rates, buffs, dealing damage --DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);
end
end; end;

View File

@ -17,7 +17,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer)
coverTier = 2; coverTier = 2;
end end
actionContainer.AddAction(caster.statusEffects.AddStatusForBattleAction(223063, coverTier, skill.statusDuration)); caster.statusEffects.AddStatusEffect(223063, coverTier, 0, 15, 0);
--Apply Covered to target --Apply Covered to target
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);

View File

@ -1,18 +1,23 @@
require("global"); require("global");
require("ability"); require("ability");
function onAbilityPrepare(caster, target, ability) function onAbilityPrepare(caster, target, ability)
return 0; return 0;
end; end;
function onAbilityStart(caster, target, ability)
return 0;
end;
function onSkillFinish(caster, target, skill, action, actionContainer) function onSkillFinish(caster, target, skill, action, actionContainer)
--Need a better way to do this --Need a better way to do this
for i = 223212,223217 do for i = 223212,223217 do
local remAction = caster.statusEffects.RemoveStatusEffectForBattleAction(i, 30329) local buff = caster.statusEffects.GetStatusEffectById(i);
if remAction ~= nil then if buff ~= nil then
actionContainer.AddAction(remAction); caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329);
skill.statusTier = 2; skill.statusTier = 2;
break; break;
end end

View File

@ -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;

View File

@ -12,6 +12,6 @@ end;
function onSkillFinish(caster, target, skill, action, actionContainer) 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 --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); action.DoAction(caster, target, skill, actionContainer);
end; end;

View File

@ -20,9 +20,9 @@ function onSkillFinish(caster, target, skill, action, actionContainer)
--223213: Power Surge II --223213: Power Surge II
--223212: Power Surge III --223212: Power Surge III
--No message is sent when PS is removed by Life Surge --No message is sent when PS is removed by Life Surge
caster.statusEffects.RemoveStatusEffect(223212, true); caster.statusEffects.RemoveStatusEffect(223212);
caster.statusEffects.RemoveStatusEffect(223213, true); caster.statusEffects.RemoveStatusEffect(223213);
caster.statusEffects.RemoveStatusEffect(223214, true); caster.statusEffects.RemoveStatusEffect(223214);
--Using this ability moves to the next LS buff --Using this ability moves to the next LS buff
@ -45,7 +45,6 @@ function onSkillFinish(caster, target, skill, action, actionContainer)
end end
if not (removeId == 0) then 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); caster.statusEffects.ReplaceEffect(caster.statusEffects.GetStatusEffectById(removeId), skill.statusId, skill.statusTier, skill.statusMagnitude, skill.statusDuration);
end end
--DoAction handles rates, buffs, dealing damage --DoAction handles rates, buffs, dealing damage

View File

@ -14,11 +14,17 @@ function onAbilityStart(caster, target, ability)
end; end;
function onSkillFinish(caster, target, skill, action, actionContainer) function onSkillFinish(caster, target, skill, action, actionContainer)
--Need a better way to do this caster.statusEffects.RemoveStatusEffect(223215);
actionContainer.AddAction(caster.statusEffects.RemoveStatusEffectForBattleAction(223215)); caster.statusEffects.RemoveStatusEffect(223216);
actionContainer.AddAction(caster.statusEffects.RemoveStatusEffectForBattleAction(223216)); caster.statusEffects.RemoveStatusEffect(223217);
actionContainer.AddAction(caster.statusEffects.RemoveStatusEffectForBattleAction(223217));
--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 --DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);
end
end; end;

View File

@ -12,18 +12,21 @@ end;
function onSkillFinish(caster, target, skill, action, actionContainer) function onSkillFinish(caster, target, skill, action, actionContainer)
--QS gives 300 TP by default. --QS gives 300 TP by default.
skill.statusMagnitude = 300; 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% --27241: Enhanced Quelling Strike: Increases TP gained from QS by 50%
if caster.HasTrait(27241) then if caster.HasTrait(27241) then
skill.statusMagnitude = skill.statusMagnitude * 1.5; skill.statusMagnitude = skill.statusMagnitude * 1.5;
end 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 --DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);
end; end;

View File

@ -6,14 +6,24 @@ function onAbilityPrepare(caster, target, ability)
end; end;
function onAbilityStart(caster, target, ability) function onAbilityStart(caster, target, ability)
ability.statusMagnitude = 100;
--27243: Enhanced Raging Strike: Increases effect of Raging Strike by 50% --27243: Enhanced Raging Strike: Increases effect of Raging Strike by 50%
if caster.HasTrait(27241) then if caster.HasTrait(27241) then
ability.statusTier = 2; ability.statusMagnitude = ability.statusMagnitude * 1.5;
end end
return 0; return 0;
end; end;
function onSkillFinish(caster, target, skill, action, actionContainer) function onSkillFinish(caster, target, skill, action, 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 --DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);
end
end; end;

View File

@ -14,6 +14,18 @@ function onAbilityStart(caster, target, ability)
end; end;
function onSkillFinish(caster, target, skill, action, actionContainer) function onSkillFinish(caster, target, skill, action, 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 --DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);
end
end; end;

View File

@ -12,9 +12,9 @@ end;
function onSkillFinish(caster, target, skill, action, actionContainer) function onSkillFinish(caster, target, skill, action, actionContainer)
--Is this before or after status is gained? --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. --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)); caster.statusEffects.RemoveStatusEffect(228011, actionContainer, 30329);
actionContainer.AddAction(caster.statusEffects.RemoveStatusEffectForBattleAction(228013)); caster.statusEffects.RemoveStatusEffect(228013, actionContainer, 30329);
actionContainer.AddAction(caster.statusEffects.RemoveStatusEffectForBattleAction(228021)); caster.statusEffects.RemoveStatusEffect(228021, actionContainer, 30329);
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);
end; end;

View File

@ -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;

View File

@ -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;

View File

@ -2,7 +2,7 @@ require("global");
properties = { properties = {
permissions = 0, permissions = 0,
parameters = "sssss", parameters = "sss",
description = description =
[[ [[
Adds experience <qty> to player or <targetname>. Adds experience <qty> to player or <targetname>.
@ -11,18 +11,19 @@ Adds experience <qty> to player or <targetname>.
]], ]],
} }
function onTrigger(player, argc, commandId, animationId, textId, effectId, amount) function onTrigger(player, argc, animType, modelAnim, effectId)
local sender = "[battleaction] "; local sender = "[battleaction] ";
if player then local actor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil;
cid = tonumber(commandId) or 0; if player and actor then
aid = tonumber(animationId) or 0; aid = tonumber(animType) or 0
tid = tonumber(textId) or 0; mid = tonumber(modelAnim) or 0
print(effectId) eid = tonumber(effectId) or 0
eid = tonumber(effectId) or 0; local id = bit32.lshift(aid, 24);
amt = tonumber(amount) or 0; id = bit32.bor(id, bit32.lshift(mid, 12));
id = bit32.bor(id, eid)
player:DoBattleActionAnimation(cid, aid, tid, eid, amt); print((tonumber(id)))
player:DoBattleAction(30301, id);
else else
print(sender.."unable to add experience, ensure player name is valid."); print(sender.."unable to add experience, ensure player name is valid.");
end; end;

View File

@ -20,16 +20,22 @@ function onTrigger(player, argc, slot, wId, eId, vId, cId)
vId = tonumber(vId) or 0; vId = tonumber(vId) or 0;
cId = tonumber(cId) or 0; cId = tonumber(cId) or 0;
local actor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil;
if player and actor then
if player and argc > 0 then if player and argc > 0 then
-- player.appearanceIds[5] = player.achievementPoints;
if argc > 2 then if argc > 2 then
player:GraphicChange(slot, wId, eId, vId, cId); actor:GraphicChange(slot, wId, eId, vId, cId);
player:SendMessage(messageID, sender, string.format("Changing appearance on slot %u", slot)); --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 else
player:GraphicChange(slot, wId); actor.appearanceIds[slot] = wId;
end end
player:SendAppearance(); actor:SendAppearance();
else else
player:SendMessage(messageID, sender, "No parameters sent! Usage: "..properties.description); player:SendMessage(messageID, sender, "No parameters sent! Usage: "..properties.description);
end; end;
end;
end; end;

View File

@ -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;

View File

@ -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;

View File

@ -12,7 +12,7 @@ end;
function onSkillFinish(caster, target, skill, action, actionContainer) function onSkillFinish(caster, target, skill, action, actionContainer)
--calculate damage --calculate damage
action.amount = skill.basePotency; action.amount = skill.basePotency;
action.statusMagnitude = 15; skill.statusMagnitude = 15;
--DoAction handles rates, buffs, dealing damage --DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);

View File

@ -12,22 +12,16 @@ end;
--Increased damage and conversion to single target --Increased damage and conversion to single target
function onCombo(caster, target, spell) function onCombo(caster, target, spell)
spell.aoeType = 0; spell.aoeType = 0;
spell.potency = spell.potency * 1.5; spell.basePotency = spell.basePotency * 1.5;
end; end;
function onSkillFinish(caster, target, skill, action, actionContainer) 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 --calculate damage
action.amount = skill.basePotency; action.amount = skill.basePotency;
--DoAction handles rates, buffs, dealing damage --DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);
--Try to apply status effect --Dispels an effect on each target.
action.TryStatus(caster, target, skill, actionContainer, true); target.statusEffects.RemoveStatusEffect(GetRandomEffectByFlag(8), actionContainer, 30336);
end; end;

View File

@ -1,5 +1,6 @@
require("global"); require("global");
require("magic"); require("magic");
require("modifiers");
function onMagicPrepare(caster, target, spell) function onMagicPrepare(caster, target, spell)
return 0; return 0;
@ -14,7 +15,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer)
--2.5 HP per Healing Magic Potency --2.5 HP per Healing Magic Potency
--0.5 HP per MND --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%? --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 --DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);

View File

@ -30,7 +30,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer)
hpPerMND = 0.25; hpPerMND = 0.25;
end 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 --DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);

View File

@ -11,7 +11,7 @@ end;
function onSkillFinish(caster, target, skill, action, actionContainer) function onSkillFinish(caster, target, skill, action, actionContainer)
--calculate damage --calculate damage
action.amount = skill.basePotency; action.amount = 5000;-- skill.basePotency;
--DoAction handles rates, buffs, dealing damage --DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);

View File

@ -12,6 +12,7 @@ end;
function onSkillFinish(caster, target, skill, action, actionContainer) function onSkillFinish(caster, target, skill, action, actionContainer)
--calculate damage --calculate damage
action.amount = skill.basePotency; action.amount = skill.basePotency;
skill.statusMagnitude = 20;
--DoAction handles rates, buffs, dealing damage --DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);

View File

@ -24,6 +24,6 @@ function onSkillFinish(caster, target, skill, action, actionContainer)
if caster != target then if caster != target then
caster.AddHP(action.amount / 2) caster.AddHP(action.amount / 2)
--33012: You recover [amount] HP. --33012: You recover [amount] HP.
actionContainer.AddHPAction(caster.actorId, 33012, (action.amount / 2)); actionContainer.AddHPAbsorbAction(caster.actorId, 33012, (action.amount / 2));
end end
end; end;

View File

@ -12,7 +12,7 @@ end;
function onSkillFinish(caster, target, skill, action, actionContainer) function onSkillFinish(caster, target, skill, action, actionContainer)
--Actual amount of def/mdef will be calculated in OnGain --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. --27365: Enhanced Protect: Increases magic defense gained from Protect.
if caster.HasTrait(27365) then if caster.HasTrait(27365) then

View File

@ -25,7 +25,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer)
intercept = intercept * 1.25; intercept = intercept * 1.25;
end end
local regenTick = (slope * caster.GetMod(modifiersGlobal.MagicEnhancePotency)) + intercept) + 1; local regenTick = (slope * caster.GetMod(modifiersGlobal.EnhancementMagicPotency)) + intercept + 1;
spell.statusMagnitude = regenTick; spell.statusMagnitude = regenTick;

View File

@ -12,7 +12,7 @@ end;
function onSkillFinish(caster, target, skill, action, actionContainer) function onSkillFinish(caster, target, skill, action, actionContainer)
--calculate damage --calculate damage
action.amount = skill.basePotency; action.amount = skill.basePotency;
action.statusMagnitude = 50; skill.statusMagnitude = 50;
--DoAction handles rates, buffs, dealing damage --DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);

View File

@ -1,5 +1,6 @@
require("global"); require("global");
require("magic"); require("magic");
require("modifiers")
function onMagicPrepare(caster, target, spell) function onMagicPrepare(caster, target, spell)
return 0; return 0;
@ -19,7 +20,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer)
hpPerPoint = 1.96; hpPerPoint = 1.96;
end end
spell.statusMagnitude = hpPerPoint * caster.GetMod(modifiersGlobal.MagicEnhancePotency); skill.statusMagnitude = hpPerPoint * caster.GetMod(modifiersGlobal.EnhancementMagicPotency);
--DoAction handles rates, buffs, dealing damage --DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);

View File

@ -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;

View File

@ -12,10 +12,7 @@ end;
--Dispel --Dispel
--Does dispel have a text id? --Does dispel have a text id?
function onCombo(caster, target, skill) function onCombo(caster, target, skill)
local effects = target.statusEffects.GetStatusEffectsByFlag(16); --lose on dispel return 0;
if effects != nil then
target.statusEffects.RemoveStatusEffect(effects[0]);
end;
end; end;
function onSkillFinish(caster, target, skill, action, actionContainer) function onSkillFinish(caster, target, skill, action, actionContainer)
@ -25,6 +22,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer)
--DoAction handles rates, buffs, dealing damage --DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);
--Try to apply status effect if skill.isCombo then
action.TryStatus(caster, target, skill, actionContainer, true); target.statusEffects.RemoveStatusEffect(GetRandomEffectByFlag(8), actionContainer, 30336);
end
end; end;

View File

@ -1,5 +1,6 @@
require("global"); require("global");
require("weaponskill"); require("weaponskill");
require("utils");
function onSkillPrepare(caster, target, skill) function onSkillPrepare(caster, target, skill)
return 0; return 0;
@ -16,7 +17,7 @@ end;
function onSkillFinish(caster, target, skill, action, actionContainer) function onSkillFinish(caster, target, skill, action, actionContainer)
--calculate ws damage --calculate ws damage
action.amount = skill.basePotency; action.amount = 5000;--skill.basePotency;
--DoAction handles rates, buffs, dealing damage --DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);

View File

@ -21,6 +21,9 @@ function onSkillFinish(caster, target, skill, action, actionContainer)
--DoAction handles rates, buffs, dealing damage --DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);
--Status only seems to apply on the first hit
if(action.ActionLanded() and action.hitNum == 1) then
--Try to apply status effect --Try to apply status effect
action.TryStatus(caster, target, skill, actionContainer, true); action.TryStatus(caster, target, skill, actionContainer, true);
end
end; end;

View File

@ -1,20 +1,16 @@
require("global"); require("global");
require("weaponskill"); require("weaponskill");
require("modifiers")
function onSkillPrepare(caster, target, skill) function onSkillPrepare(caster, target, skill)
return 0; return 0;
end; end;
function onSkillStart(caster, target, skill) function onSkillStart(caster, target, skill)
return 0;
end;
--Increased crit rate
function onCombo(caster, target, skill)
--Get Berserk statuseffect --Get Berserk statuseffect
local berserk = caster.statusEffects.GetStatusEffectById(223160); 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 if berserk != nil then
local apPerHit = 20; local apPerHit = 20;
local defPerHit = 20; local defPerHit = 20;
@ -23,14 +19,20 @@ function onCombo(caster, target, skill)
apPerHit = 24; apPerHit = 24;
end end
attacker.SubtractMod(modifiersGlobal.Attack, apPerHit * berserk.GetExtra()); caster.SubtractMod(modifiersGlobal.Attack, apPerHit * berserk.GetExtra());
attacker.Add(modifiersGlobal.Defense, defPerHit * berserk.GetExtra()); caster.Add(modifiersGlobal.Defense, defPerHit * berserk.GetExtra());
berserk.SetExtra(0); berserk.SetExtra(0);
skill.accuracyModifier = 50;
--This is about 50% crit. Don't know if that's what it gave on retail but seems kind of reasonable
skill.critRateBonus = 300;
end; 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; end;
function onSkillFinish(caster, target, skill, action, actionContainer) function onSkillFinish(caster, target, skill, action, actionContainer)

View File

@ -15,7 +15,7 @@ end;
function onSkillFinish(caster, target, skill, action, actionContainer) function onSkillFinish(caster, target, skill, action, actionContainer)
--calculate ws damage --calculate ws damage
skill.Potency = 100; skill.basePotency = 100;
--DoAction handles rates, buffs, dealing damage --DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer); action.DoAction(caster, target, skill, actionContainer);

View File

@ -1,11 +1,27 @@
require("global"); require("global");
require("weaponskill"); require("weaponskill");
require("modifiers")
function onSkillPrepare(caster, target, skill) function onSkillPrepare(caster, target, skill)
return 0; return 0;
end; end;
--Resets rampage to increase damage
function onSkillStart(caster, target, skill) 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; return 0;
end; end;
@ -15,6 +31,10 @@ function onCombo(caster, target, skill)
end; end;
function onSkillFinish(caster, target, skill, action, actionContainer) function onSkillFinish(caster, target, skill, action, actionContainer)
if target.target == caster then
skill.statusId = 223015
end;
--calculate ws damage --calculate ws damage
action.amount = skill.basePotency; action.amount = skill.basePotency;
@ -23,4 +43,6 @@ function onSkillFinish(caster, target, skill, action, actionContainer)
--Try to apply status effect --Try to apply status effect
action.TryStatus(caster, target, skill, actionContainer, true); action.TryStatus(caster, target, skill, actionContainer, true);
skill.statusId = 0;
end; end;

View File

@ -28,7 +28,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer)
--1.21: Equation used to calculate amount of MP adjusted. --1.21: Equation used to calculate amount of MP adjusted.
--fug --fug
--This might mean max MP isn't involved and the difference was between patches. need to recheck videos --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; local mpToReturn = 0;
if skill.isCombo then if skill.isCombo then
@ -39,6 +39,6 @@ function onSkillFinish(caster, target, skill, action, actionContainer)
caster.AddMP(mpToReturn); caster.AddMP(mpToReturn);
--30452: You recover x MP. --30452: You recover x MP.
actionContainer.AddMPAction(caster.actorId, 30452, mpToReturn); actionContainer.AddMPAbsorbAction(caster.actorId, 30452, mpToReturn);
end end
end; end;

View File

@ -1,5 +1,6 @@
require("global"); require("global");
require("weaponskill"); require("weaponskill");
require("modifiers")
function onSkillPrepare(caster, target, skill) function onSkillPrepare(caster, target, skill)
return 0; return 0;
@ -23,8 +24,8 @@ function onCombo(caster, target, skill)
apPerHit = 24; apPerHit = 24;
end end
attacker.SubtractMod(modifiersGlobal.Attack, apPerHit * berserk.GetExtra()); caster.SubtractMod(modifiersGlobal.Attack, apPerHit * berserk.GetExtra());
attacker.Add(modifiersGlobal.Defense, defPerHit * berserk.GetExtra()); caster.Add(modifiersGlobal.Defense, defPerHit * berserk.GetExtra());
berserk.SetExtra(0); berserk.SetExtra(0);
skill.basePotency = skill.basePotency * 1.5; skill.basePotency = skill.basePotency * 1.5;

View File

@ -3,17 +3,17 @@ require("utils")
--Forces a full block (0 damage taken) --Forces a full block (0 damage taken)
function onPreAction(effect, caster, target, skill, action, actionContainer) 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; action.blockRate = 100.0;
end; 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. --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 --Amount blocked
local absorbAmount = math.Clamp(action.amountMitigated, 0, 703); local absorbAmount = math.Clamp(action.amountMitigated, 0, 703);
--33008: You recover x HP from Aegis Boon --33008: You recover x HP from Aegis Boon
defender.AddHP(absorbAmount); defender.AddHP(absorbAmount);
actionContainer.AddHPAction(defender.actorId, 33008, absorbAmount); actionContainer.AddHPAction(defender.actorId, 33008, absorbAmount);
actionContainer.AddAction(defender.statusEffects.RemoveStatusEffectForBattleAction(effect)); defender.statusEffects.RemoveStatusEffect(effect, actionContainer);
end; end;

View File

@ -1,10 +1,10 @@
require("modifiers") require("modifiers")
--Doesn't do flat damage. 20 on Lv 50 Truffle Hog, 11 on Coincounter, 7 on nael hard, 19 on 52 fachan --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()); owner.AddMod(modifiersGlobal.RegenDown, effect.GetMagnitude());
end; end;
function onLose(owner, effect) function onLose(owner, effect, actionContainer)
owner.AddMod(modifiersGlobal.RegenDown, effect.GetMagnitude()); owner.AddMod(modifiersGlobal.RegenDown, effect.GetMagnitude());
end; end;

View File

@ -1,10 +1,10 @@
require("modifiers") 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 --Only one song per bard can be active, need to figure out a good way to do this
owner.AddMod(modifiersGlobal.Refresh, effect.GetMagnitude()); owner.AddMod(modifiersGlobal.Refresh, effect.GetMagnitude());
end; end;
function onLose(owner, effect) function onLose(owner, effect, actionContainer)
owner.SubtractMod(modifiersGlobal.Refresh, effect.GetMagnitude()); owner.SubtractMod(modifiersGlobal.Refresh, effect.GetMagnitude());
end; end;

View File

@ -8,6 +8,6 @@ end;
function onCommandFinish(effect, owner, skill, actionContainer) function onCommandFinish(effect, owner, skill, actionContainer)
--27259: Light Shot --27259: Light Shot
if skill.id == 27259 then if skill.id == 27259 then
actionContainer.AddAction(owner.statusEffects.RemoveStatusEffectForBattleAction(effect)); defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false);
end end
end; end;

View File

@ -1,3 +1,8 @@
require("modifiers") require("modifiers")
--BV doesn't really do anything i think --BV doesn't really do anything i think
function onGain(owner, effect, actionContainer)
end;
function onLose(owner, effect, actionContainer)
end;

View File

@ -1,13 +1,12 @@
require("modifiers"); require("modifiers");
function onGain(owner, effect) function onGain(owner, effect, actionContainer)
owner.statusEffects.RemoveStatusEffect(223208);
end end
--Increases attack power and reduces defense with each successful attack --Increases attack power and reduces defense with each successful attack
--Does this include weaponskills? --Does this include weaponskills?
--Is this on every hit or every succesfull skill useage? --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, --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? --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
end; end;
function onDamageTaken(effect, attacker, defender, action, actionContainer) function onDamageTaken(effect, attacker, defender, skill, action, actionContainer)
local apPerHit = 20; local apPerHit = 20;
local defPerHit = 20; local defPerHit = 20;
@ -45,7 +44,7 @@ function onDamageTaken(effect, attacker, defender, action, actionContainer)
effect.SetExtra(0); effect.SetExtra(0);
end end
function onLose(owner, effect) function onLose(owner, effect, actionContainer)
local apPerHit = 20; local apPerHit = 20;
local defPerHit = 20; local defPerHit = 20;

View File

@ -1,7 +1,7 @@
require("modifiers"); require("modifiers");
function onGain(target, effect) function onGain(owner, effect, actionContainer)
end; end;
function onLose(target, effect) function onLose(owner, effect, actionContainer)
end; end;

View File

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

View File

@ -4,12 +4,12 @@ require("battleutils")
--Forces crit of a single WS action from rear. --Forces crit of a single WS action from rear.
function onPreAction(effect, caster, target, skill, action, actionContainer) function onPreAction(effect, caster, target, skill, action, actionContainer)
--If action hit from the rear and is a weaponskill ation --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% --Set action's crit rate to 100%
action.critRate = 100.0; action.critRate = 100.0;
end end
--Remove status and add message --Remove status and add message
actionsList.AddAction(target.statusEffects.RemoveForBattleAction(effect)); target.statusEffects.RemoveStatusEffect(effect, actionContainer);
end; end;

View File

@ -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;

View File

@ -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 --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 --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; local percentPerSecond = 0.0030;
if effect.GetTier() == 2 then if effect.GetTier() == 2 then
percentPerSecond = 0.005; percentPerSecond = 0.005;
end end
print(effect.GetExtra());
local amount = percentPerSecond * owner.GetMaxMP() + 0.25; local amount = percentPerSecond * owner.GetMaxMP() + 0.25;
effect.SetExtra(effect.GetExtra() + amount); effect.SetExtra(effect.GetExtra() + amount);
if effect.GetExtra() >= effect.GetMagnitude() then if effect.GetExtra() >= effect.GetMagnitude() then

View File

@ -1,3 +1,3 @@
function onLose(target, effect) function onLose(owner, effect, actionContainer)
target:SetProc(1, false); owner:SetProc(1, false);
end; end;

View File

@ -3,7 +3,7 @@ require("battleUtils")
--Takes 10% of hp rounded down when using a weaponskill --Takes 10% of hp rounded down when using a weaponskill
--Random guess, but increases damage by 10% (12.5% traited)? --Random guess, but increases damage by 10% (12.5% traited)?
function onPreAction(effect, caster, target, skill, action, actionContainer) 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 hpToRemove = math.floor(caster.GetHP() * 0.10);
local modifier = 1.10; local modifier = 1.10;
@ -12,9 +12,9 @@ function onPreAction(effect, caster, target, skill, action, actionContainer)
end end
action.amount = action.amount * modifier; action.amount = action.amount * modifier;
caster.DelHP(hpToRemove); caster.DelHP(hpToRemove, actionContainer);
--Remove status and add message --Remove status and add message
actionContainer.AddAction(target.statusEffects.RemoveForBattleAction(effect)); caster.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, true);
end end
end; end;

View File

@ -1,7 +1,8 @@
require("modifiers"); require("modifiers");
require("battleutils")
--Absorb HP on next WS or ability --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. --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. --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? --Possibly magic resist? Slashing resist?
--For now using 1.0 as baseline since that seems to be the average --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 absorbModifier = 1.0
local absorbAmount = action.amount * absorbModifier; local absorbAmount = action.amount * absorbModifier;
attacker.AddHP(absorbAmount); attacker.AddHP(absorbAmount);
--30332: You absorb hp from target --30332: You absorb hp from target
actionContainer.AddHPAction(defender.actorId, 30332, absorbAmount) actionContainer.AddHPAbsorbAction(defender.actorId, 30332, absorbAmount)
--Bloodbath is lost after absorbing hp --Bloodbath is lost after absorbing hp
actionContainer.AddAction(defender.statusEffects.RemoveStatusEffectForBattleAction(effect)); defender.statusEffects.RemoveStatusEffect(effect,actionContainer, 30331, false);
end end
end; end;

View File

@ -8,13 +8,14 @@ require("modifiers")
--Bloodletter is apparently impacted by PIE --Bloodletter is apparently impacted by PIE
--http://forum.square-enix.com/ffxiv/threads/35795-STR-DEX-PIE-ATK-Testing/page2 --http://forum.square-enix.com/ffxiv/threads/35795-STR-DEX-PIE-ATK-Testing/page2
--Chance to land is also impacted by PIE --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); owner.AddMod(modifiersGlobal.RegenDown, 15);
end end
--Additional damage is 570 at level 50 --Additional damage is 570 at level 50
--https://ffxiv.gamerescape.com/w/index.php?title=Bloodletter&oldid=298020 --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.SubtractMod(modifiersGlobal.RegenDown, 15);
owner.DelHP(570); owner.DelHP(570, actionContainer);
end end

View File

@ -1,10 +1,10 @@
require("modifiers") 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 --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); owner.AddMod(modifiersGlobal.RegenDown, 15);
end end
function onLose(owner, effect) function onLose(owner, effect, actionContainer)
owner.SubtractMod(modifiersGlobal.RegenDown, 15); owner.SubtractMod(modifiersGlobal.RegenDown, 15);
end end

View File

@ -1,12 +1,12 @@
require("modifiers") 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 --Multiples Attack Magic Potency by 1.2 and Healing Magic Potency by 0.8
target.SetMod(modifiersGlobal.MagicAttack, target.GetMod(modifiersGlobal.MagicAttack) * 1.2); owner.MultiplyMod(modifiersGlobal.AttackMagicPotency, 1.2);
target.SetMod(modifiersGlobal.MagicHeal, target.GetMod(modifiersGlobal.MagicHeal) * 0.8); owner.MultiplyMod(modifiersGlobal.HealingMagicPotency, 0.8);
end; end;
function onLose(target, effect) function onLose(owner, effect, actionContainer)
target.SetMod(modifiersGlobal.MagicAttack, target.GetMod(modifiersGlobal.MagicAttack) / 1.2); owner.DivideMod(modifiersGlobal.AttackMagicPotency, 1.2);
target.SetMod(modifiersGlobal.MagicHeal, target.GetMod(modifiersGlobal.MagicHeal) / 0.8); owner.DivideMod(modifiersGlobal.HealingMagicPotency, 0.8);
end; end;

View File

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

View File

@ -1,3 +1,6 @@
function onLose(target, effect) function onGain(owner, effect, actionContainer)
target:SetCombos(); end;
function onLose(owner, effect, actionContainer)
owner:SetCombos();
end; end;

View File

@ -1,7 +1,7 @@
require("modifiers") require("modifiers")
--Enahnced Cover: Restores 25% of damage taken as MP. Does not send a message --Enahnced Cover: Restores 25% of damage taken as MP. Does not send a message
function onDamageTaken(effect, attacker, defender, action, actionContainer) function onDamageTaken(effect, attacker, defender, skill, action, actionContainer)
if effect.GetTier() == 2 then if effect.GetTier() == 2 then
defender.AddMP(0.25 * action.amount); defender.AddMP(0.25 * action.amount);
end end

View File

@ -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, --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 --I'm assuming it increases a spell's accuracy modifier instead of giving actual magic accuracy
function onCommandStart(effect, owner, skill, actionContainer) function onCommandStart(effect, owner, skill, actionContainer)
if skill.actionType == ActionType.Magic then if skill.GetActionType() == ActionType.Magic then
--50 is random guess. --50 is random guess.
skill.accuracyModifier = skill.accuracyModifier + 50; skill.accuracyModifier = skill.accuracyModifier + 50;
actionContainer.AddAction(owner.RemoveStatusEffectForBattleAction(effect)); owner.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false);
end end
end end

View File

@ -5,12 +5,13 @@ require("battleutils")
function onPreAction(effect, caster, target, skill, action, actionContainer) function onPreAction(effect, caster, target, skill, action, actionContainer)
--Evade single ranged or magic attack --Evade single ranged or magic attack
--Traited allows for physical attacks --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 --Set action's hit rate to 0
action.hirRate = 0.0; action.hitRate = 0.0;
action.resistRate = 750;
--Remove status and add message --Remove status and add message
actionContainer.AddAction(target.statusEffects.RemoveStatusEffectForBattleAction(effect)); defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false);
end end
end; end;

View File

@ -5,11 +5,12 @@ require("battleutils")
function onPreAction(effect, caster, target, skill, action, actionContainer) function onPreAction(effect, caster, target, skill, action, actionContainer)
--Evade single ranged or magic attack --Evade single ranged or magic attack
--Traited allows for physical attacks --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 --Set action's hit rate to 0
action.hirRate = 0.0; action.hitRate = 0.0;
action.resistRate = 400;
--Remove status and add message --Remove status and add message
actionContainer.AddAction(target.statusEffects.RemoveStatusEffectForBattleAction(effect)); defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false);
end end
end; end;

View File

@ -1,5 +1,5 @@
function onGain(target, effect) function onGain(owner, effect, actionContainer)
end; end;
function onLose(target, effect) function onLose(owner, effect, actionContainer)
end; end;

View File

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

View File

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

View File

@ -1,18 +1,18 @@
require("modifiers") require("modifiers")
--Increases block rate by 100% --Increases block rate by 100%
function onGain(owner, effect) function onGain(owner, effect, actionContainer)
owner.AddMod(modifiersGlobal.RawBlockRate, 100); owner.AddMod(modifiersGlobal.RawBlockRate, 100);
end end
function onLose(owner, effect) function onLose(owner, effect, actionContainer)
owner.SubtractMod(modifiersGlobal.RawBlockRate, 100); owner.SubtractMod(modifiersGlobal.RawBlockRate, 100);
end end
--Applys Divine Regen to party in range when healed by cure or cura --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 -- 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; local regenDuration = 30;
--Apparently heals for 85 without AF, 113 with. Unsure if these can be improved with stats --Apparently heals for 85 without AF, 113 with. Unsure if these can be improved with stats
local magnitude = 85 local magnitude = 85
@ -23,9 +23,8 @@ function onHealed(caster, target, effect, skill, action, actionContainer)
end end
--For each party member in range, add divine regen --For each party member in range, add divine regen
for chara in owner.GetPartyMembersInRange(8) do for chara in target.GetPartyMembersInRange(8) do
local addAction = chara.statusEffects.AddStatusForBattleAction(223264, effect.GetTier(), magnitude, regenDuration); chara.statusEffects.AddStatusEffect(223264, effect.GetTier(), magnitude, regenDuration, actionContainer);
actionContainer.AddAction(addAction);
end end
end end
end; end;

View File

@ -7,8 +7,8 @@ require("battleutils")
--It still shows the enemy's "Enemy used [command]." message but there is no 0 damage dealt message. --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 --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... -- I dont really know how this should work...
function onDamageTaken(effect, attacker, defender, action, actionContainer) function onDamageTaken(effect, attacker, defender, skill, action, actionContainer)
if action.actionType == ActionType.Physical then if skill.GetActionType() == ActionType.Physical then
--maybe this works? --maybe this works?
local absorbPercent = 0.5; local absorbPercent = 0.5;
@ -24,7 +24,6 @@ function onDamageTaken(effect, attacker, defender, action, actionContainer)
--30451: You recover [absorbAmount] HP. --30451: You recover [absorbAmount] HP.
actionContainer.AddHPAction(defender.actorId, 30451, absorbAmount) actionContainer.AddHPAction(defender.actorId, 30451, absorbAmount)
--Dread Spike is lost after absorbing hp --Dread Spike is lost after absorbing hp
actionContainer.AddAction(defender.statusEffects.RemoveStatusEffectForBattleAction(effect)); defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false);
end end
end; end;

View File

@ -1,20 +1,20 @@
require("modifiers") 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 --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; local speedModifier = 0.8;
if effect.GetTier() == 2 then if effect.GetTier() == 2 then
speedModifier = 1.2; speedModifier = 1.2;
end end
target.SetMod(modifiersGlobal.Speed, target.GetMod(modifiersGlobal.Speed) * speedModifier); owner.MultiplyMod(modifiersGlobal.MovementSpeed, speedModifier);
end; end;
function onLose(target, effect) function onLose(owner, effect, actionContainer)
local speedModifier = 0.8; local speedModifier = 0.8;
if effect.GetTier() == 2 then if effect.GetTier() == 2 then
speedModifier = 1.2; speedModifier = 1.2;
end end
target.SetMod(modifiersGlobal.Speed, target.GetMod(modifiersGlobal.Speed) / speedModifier); owner.DivideMod(modifiersGlobal.MovementSpeed, speedModifier);
end; end;

View File

@ -1,3 +1,3 @@
function onLose(target, effect) function onLose(owner, effect, actionContainer)
target:SetProc(0, false); owner:SetProc(0, false);
end; end;

View File

@ -2,7 +2,7 @@ require("modifiers")
require("battleutils") require("battleutils")
--Gradually increases critical rate of spells --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 --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 --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 --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(); skill.bonusCritRate = skill.bonusCritRate + effect.GetMagnitude();
end end
function onCrit(effect, attacker, defender, action, actionContainer) function onCrit(effect, attacker, defender, skill, action, actionContainer)
if action.commandType == CommandType.Spell then if skill.GetCommandType() == CommandType.Spell then
actionContainer.AddAction(attacker.statusEffects.RemoveStatusEffectForBattleAction(effect)); defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false);
end end
end end

View File

@ -0,0 +1,7 @@
require("modifiers")
function onGain(owner, effect, actionContainer)
end;
function onLose(owner, effect, actionContainer)
end;

View File

@ -1,16 +1,16 @@
require("modifiers"); require("modifiers");
--15% in ARR, dont know how it worked in 1.0 --15% in ARR, dont know how it worked in 1.0
function onGain(target, effect) function onGain(owner, effect, actionContainer)
target.AddMod(modifiersGlobal.RawEvadeRate, 15); owner.AddMod(modifiersGlobal.RawEvadeRate, 15);
end; end;
function onLose(target, effect) function onLose(owner, effect, actionContainer)
target.SubtractMod(modifiersGlobal.RawEvadeRate, 15); owner.SubtractMod(modifiersGlobal.RawEvadeRate, 15);
end; end;
--Returns 25%? of amount dodged as MP --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 --25% of amount dodged untraited, 50% traited
local percent = 0.25; local percent = 0.25;
if (effect.GetTier() == 2) then if (effect.GetTier() == 2) then
@ -22,5 +22,5 @@ function onEvade(effect, attacker, defender, action, actionContainer)
--33010: You recover x MP from Featherfoot --33010: You recover x MP from Featherfoot
actionContainer.AddMPAction(defender.actorId, 33010, mpToReturn); actionContainer.AddMPAction(defender.actorId, 33010, mpToReturn);
--Featherfoot is lost after evading --Featherfoot is lost after evading
actionContainer.AddAction(defender.statusEffects.RemoveStatusEffectForBattleAction(effect)); defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false);
end; end;

View File

@ -1,6 +1,4 @@
function onGain(target, effect) function onGain(owner, effect, actionContainer)
target.statusEffects.RemoveStatusEffect(223209)
target.statusEffects.RemoveStatusEffect(223211)
end; end;
--Need to do more research on these. --Need to do more research on these.

View File

@ -1,4 +1,2 @@
function onGain(target, effect) function onGain(owner, effect, actionContainer)
target.statusEffects.RemoveStatusEffect(223210)
target.statusEffects.RemoveStatusEffect(223211)
end; end;

View File

@ -1,4 +1,2 @@
function onGain(target, effect) function onGain(owner, effect, actionContainer)
target.statusEffects.RemoveStatusEffect(223210)
target.statusEffects.RemoveStatusEffect(223209)
end; end;

View File

@ -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

View File

@ -1,15 +1,15 @@
require("modifiers") 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. --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; end;
function onParry(effect, attacker, defender, action, actionContainer) function onParry(effect, attacker, defender, skill, action, actionContainer)
--Foresight is lost after parrying --Foresight is lost after parrying
actionContainer.AddAction(defender.statusEffects.RemoveStatusEffectForBattleAction(effect)); defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false);
end; end;
function onLose(target, effect) function onLose(owner, effect, actionContainer)
target.SubtractMod(modifiersGlobal.Parry, 200); owner.SubtractMod(modifiersGlobal.Parry, 200);
end; end;

View File

@ -1,7 +1,7 @@
function onGain(owner, effect) function onGain(owner, effect, actionContainer)
--Using extra because that's what blissful_mind uses --Using extra because that's what blissful_mind uses
effect.SetExtra(effect.GetMagnitude()); effect.SetExtra(effect.GetMagnitude());
end end
function onLose(owner, effect) function onLose(owner, effect, actionContainer)
end end

View File

@ -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;

View File

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

View File

@ -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;

View File

@ -1,10 +1,10 @@
require("modifiers") require("modifiers")
--Set magnitude to milliseconds that HF will reduce delay by --Set magnitude to milliseconds that HF will reduce delay by
function onGain(target, effect) function onGain(owner, effect, actionContainer)
target.SubtractMod(modifiersGlobal.AttackDelay, effect.GetMagnitude()); owner.SubtractMod(modifiersGlobal.AttackDelay, effect.GetMagnitude());
end; end;
function onLose(target, effect) function onLose(owner, effect, actionContainer)
target.AddMod(modifiersGlobal.AttackDelay, effect.GetMagnitude()); owner.AddMod(modifiersGlobal.AttackDelay, effect.GetMagnitude());
end; end;

View File

@ -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%) --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. --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 --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; local accuracyMod = 0.1875;
if effect.GetTier() == 2 then if effect.GetTier() == 2 then
accuracyMod = 0.28125; accuracyMod = 0.28125;
end end
local amountGained = accuracyMod * target.GetMod(modifiersGlobal.Accuracy); local amountGained = accuracyMod * owner.GetMod(modifiersGlobal.Accuracy);
effect.SetMagnitude(amountGained); effect.SetMagnitude(amountGained);
target.AddMod(modifiersGlobal.Accuracy, effect.GetMagnitude()); owner.AddMod(modifiersGlobal.Accuracy, effect.GetMagnitude());
end; end;
function onLose(target, effect) function onLose(owner, effect, actionContainer)
target.SubtractMod(modifiersGlobal.Accuracy, effect.GetMagnitude()); owner.SubtractMod(modifiersGlobal.Accuracy, effect.GetMagnitude());
end; end;

View File

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

View File

@ -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 --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? --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 newMaxHP = target.GetMaxHP() * 1.25;
local healAmount = newMaxHP - target.GetMaxHP(); local healAmount = newMaxHP - target.GetMaxHP();
target.SetMaxHP(newMaxHP); owner.SetMaxHP(newMaxHP);
target.AddHP(healAmount); owner.AddHP(healAmount);
end; end;
function onLose(target, effect) function onLose(owner, effect, actionContainer)
target.SetMaxHP(target.GetMaxHP() / 1.25); owner.SetMaxHP(owner.GetMaxHP() / 1.25);
end; end;

View File

@ -1,10 +1,10 @@
require("modifiers") require("modifiers")
--Set magnitude to milliseconds that HF will reduce delay by --Set magnitude to milliseconds that HF will reduce delay by
function onGain(target, effect) function onGain(owner, effect, actionContainer)
target.SubtractMod(modifiersGlobal.AttackDelay), effect.GetMagnitude()); owner.SubtractMod(modifiersGlobal.Delay, effect.GetMagnitude());
end; end;
function onLose(target, effect) function onLose(owner, effect, actionContainer)
target.AddMod(modifiersGlobal.AttackDelay), effect.GetMagnitude()); owner.AddMod(modifiersGlobal.Delay, effect.GetMagnitude());
end; end;

View File

@ -1,10 +1,10 @@
require("modifiers") require("modifiers")
--100 TP per tick without AF. 133 TP per tick with AF --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()); owner.AddMod(modifiersGlobal.Regain, effect.GetMagnitude());
end end
function onLose(owner, effect) function onLose(owner, effect, actionContainer)
owner.SubtractMod(modifiersGlobal.Regain, effect.GetMagnitude()); owner.SubtractMod(modifiersGlobal.Regain, effect.GetMagnitude());
end end

View File

@ -3,7 +3,7 @@ require("battleutils")
--Untraited reduces cooldown by 50% --Untraited reduces cooldown by 50%
--Traited reduces cooldown by 100% --Traited reduces cooldown by 100%
function onCommandStart(effect, owner, skill, actionContainer) function onCommandStart(effect, owner, skill, actionContainer)
if skill.commandType == CommandType.Weaponskill then if skill.GetCommandType() == CommandType.Weaponskill then
local reduction = 0.5; local reduction = 0.5;
if effect.GetTier() == 2 then if effect.GetTier() == 2 then

View File

@ -4,8 +4,8 @@ require("battleutils")
--Trait: Increases healing by 20%. Is this the base % or the amount after taking the base percent? --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. --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 --Seems to match what i can find in videos
function onHit(effect, attacker, defender, action, actionContainer) function onHit(effect, attacker, defender, skill, action, actionContainer)
if action.commandType == CommandType.AutoAttack then if skill.GetCommandType() == CommandType.AutoAttack then
local healPercent = 0.10; local healPercent = 0.10;
if effect.GetTier() == 2 then if effect.GetTier() == 2 then
@ -14,6 +14,6 @@ function onHit(effect, attacker, defender, action, actionContainer)
local amount = math.floor((healPercent * action.amount) + 1); local amount = math.floor((healPercent * action.amount) + 1);
attacker.AddHP(amount); attacker.AddHP(amount);
actionContainer.AddHPAction(defender.actorId, 30332, amount); actionContainer.AddHPAbsorbAction(defender.actorId, 30332, amount);
end end
end; end;

View File

@ -1,7 +1,7 @@
require("battleutils") require("battleutils")
function onHit(effect, attacker, defender, action, actionContainer) function onHit(effect, attacker, defender, skill, action, actionContainer)
if action.commandType == CommandType.AutoAttack then if skill.GetCommandType() == CommandType.AutoAttack then
local healPercent = 0.20; local healPercent = 0.20;
if effect.GetTier() == 2 then if effect.GetTier() == 2 then
@ -10,6 +10,6 @@ function onHit(effect, attacker, defender, action, actionContainer)
local amount = math.floor((healPercent * action.amount) + 1); local amount = math.floor((healPercent * action.amount) + 1);
attacker.AddHP(amount); attacker.AddHP(amount);
actionContainer.AddHPAction(defender.actorId, 30332, amount); actionContainer.AddHPAbsorbAction(defender.actorId, 30332, amount);
end end
end; end;

View File

@ -4,16 +4,16 @@ require("battleutils")
--Trait: Increases healing by 20%. Is this the base % or the amount after taking the base percent? --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. --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 --Seems to match what i can find in videos
function onHit(effect, attacker, defender, action, actionContainer) function onHit(effect, attacker, defender, skill, action, actionContainer)
if action.commandType == CommandType.AutoAttack then if skill.GetCommandType() == CommandType.AutoAttack then
local healPercent = 0.10; local healPercent = 0.30;
if effect.GetTier() == 2 then if effect.GetTier() == 2 then
healPercent = 0.30; healPercent = 0.50;
end end
local amount = math.floor((healPercent * action.amount) + 1); local amount = math.floor((healPercent * action.amount) + 1);
attacker.AddHP(amount); attacker.AddHP(amount);
actionContainer.AddHPAction(defender.actorId, 30332, amount); actionContainer.AddHPAbsorbAction(defender.actorId, 30332, amount);
end end
end; end;

View File

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

View File

@ -1,12 +1,12 @@
require("modifiers") 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 --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.Accuracy, effect.GetMagnitude());
owner.AddMod(modifiersGlobal.MagicAccuracy, effect.GetMagnitude()); owner.AddMod(modifiersGlobal.MagicAccuracy, effect.GetMagnitude());
end; end;
function onLose(owner, effect) function onLose(owner, effect, actionContainer)
owner.SubtractMod(modifiersGlobal.Accuracy, effect.GetMagnitude()); owner.SubtractMod(modifiersGlobal.Accuracy, effect.GetMagnitude());
owner.SubtractMod(modifiersGlobal.MagicAccuracy, effect.GetMagnitude()); owner.SubtractMod(modifiersGlobal.MagicAccuracy, effect.GetMagnitude());
end; end;

View File

@ -1,3 +1,3 @@
function onLose(target, effect) function onLose(owner, effect, actionContainer)
target:SetProc(3, false); owner:SetProc(3, false);
end; end;

View File

@ -1,12 +1,12 @@
require("modifiers") require("modifiers")
require("battleutils") require("battleutils")
function onHit(effect, attacker, defender, action, actionContainer) function onHit(effect, attacker, defender, skill, action, actionContainer)
if action.commandType == CommandType.Spell then if skill.GetCommandType() == CommandType.Spell then
--Necrogenesis returns 75% of damage done rounded up(?) as MP. --Necrogenesis returns 75% of damage done rounded up(?) as MP.
local hpToReturn = math.ceil(0.75 * action.amount); local hpToReturn = math.ceil(0.75 * action.amount);
attacker.AddMp(hpToReturn); attacker.AddHP(hpToReturn);
actionContainer.AddHPAction(attacker.actorId, 33012, mpToReturn); actionContainer.AddHPAbsorbAction(defender.actorId, 33012, hpToReturn);
actionContainer.AddAction(attacker.statusEffects.RemoveStatusEffectForBattleAction(effect)); attacker.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false);
end end
end end

Some files were not shown because too many files have changed in this diff Show More