Script fixes and new effects.

Cleaned up unneeded requires in some scripts
Fixed Second Wind
Added new effect scripts
Added bard song scripts that mostly work
This commit is contained in:
yogurt 2018-06-25 23:36:18 -05:00
parent ace4dfe58f
commit c442dc9ecd
72 changed files with 524 additions and 171 deletions

View file

@ -0,0 +1,5 @@
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Cast(command.actorId, targetActor);
player:endEvent();
end

View file

@ -0,0 +1,19 @@
require("global");
require("ability");
function onAbilityPrepare(caster, target, ability)
return 0;
end;
function onAbilityStart(caster, target, ability)
return 0;
end;
function onSkillFinish(caster, target, skill, action, actionContainer)
--Only the bard gets the Battle Voice effect
if caster == target then
actionContainer.AddAction(caster.statusEffects.AddStatusForBattleAction(223253, 1, 0, 30));
end
action.DoAction(caster, target, skill, actionContainer);
end;

View file

@ -26,7 +26,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer)
caster.AddMP(amount);
actionContainer.AddMPAction(caster.actorId, 30321, amount);
actionContainer.AddMPAction(caster.actorId, 33007, amount);
actionContainer.AddAction(remAction);
else
--Blissful mind takes 25% of CURRENT HP and begins storing MP up to that point, at which point the buff changes to indicate its full

View file

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

View file

@ -0,0 +1,17 @@
require("global");
require("ability");
require("modifiers");
function onAbilityPrepare(caster, target, ability)
return 0;
end;
function onAbilityStart(caster, target, ability)
return 0;
end;
function onSkillFinish(caster, target, skill, action, actionContainer)
--Take off 1/3 of attack delay. Not sure if this is the exact amount HF reduces by
action.statusMagnitude = 0.33 * caster.GetMod(modifiersGlobal.AttackDelay);
action.DoAction(caster, target, skill, actionContainer);
end;

View file

@ -0,0 +1,15 @@
require("global");
require("ability");
function onAbilityPrepare(caster, target, ability)
return 0;
end;
function onAbilityStart(caster, target, ability)
return 0;
end;
function onSkillFinish(caster, target, skill, action, actionContainer)
--DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer);
end;

View file

@ -1,5 +1,6 @@
require("global");
require("modifiers");
require("utils")
--require("ability");
function onAbilityPrepare(caster, target, ability)
@ -20,9 +21,11 @@ end;
-- An additional random integer (580 at level 50. +/- 3%)
function onSkillFinish(caster, target, skill, action, actionContainer)
--Base amount seems to be 0.215x^2 - 0.35x + 60
--^ this isn't totally correct
local amount = (0.215 * math.pow(caster.GetLevel(), 2)) - (0.35 * caster.GetLevel()) + 60;
--Heals can vary by up to 3%
amount = math.Clamp(amount * (0.97 + (math.rand() * 3.0)), 0, 9999);
--Heals can vary by up to 3.5%
amount = math.Clamp(amount * (0.965 + (math.random() * 0.07)), 0, 9999);
--PGL gets an INT bonus for Second Wind
if caster.GetClass() == 2 then
@ -34,6 +37,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer)
amount = amount * 1.25;
end;
action.amount = amount;
--DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer);
end;

View file

@ -1,15 +1,58 @@
require("global");
require("magic");
function onMagicPrepare(caster, target, spell)
function onMagicPrepare(caster, target, skill)
return 0;
end;
function onMagicStart(caster, target, spell)
return 0;
function onMagicStart(caster, target, skill)
--Ballad gives 20 MP a tick at 50
--BV gives 40 MP per tick
--Formula seems to be 0.8 * level - 20, not sure why BV gives 71 at 50 then
local mpPerTick = (0.8 * caster.GetLevel()) - 20;
--8032705: Choral Shirt: Enhances Ballad of Magi
--With Choral Shirt, Ballad gives 26 mp a tick. It could be a flat 6 or multiply by 1.3
--Because minuet seemed like a normal addition I'm assuming this is too
local shirt = caster.GetEquipment().GetItemAtSlot(10);
if shirt and shirt.itemId == 8032705 then
mpPerTick = mpPerTick + 6;
end
--223253: Battle Voice
--Battle Voice doubles effect of songs
if caster.statusEffects.HasStatusEffect(223253) then
mpPerTick = mpPerTick * 2;
--Set status tier so we can check it later when BV falls off
skill.statusTier = 2;
end
skill.statusMagnitude = mpPerTick;
end;
function onSkillFinish(caster, target, skill, action, actionContainer)
--223224: Swiftsong
--223255: Paeon of War
--223256: Minuet of Rigor
--
local oldSong;
local swiftSong = target.statusEffects.GetStatusEffectById(223224);
local paeon = target.statusEffects.GetStatusEffectById(223255);
local minuet = target.statusEffects.GetStatusEffectById(223256);
if swiftSong and swiftSong.GetSource() == caster then
oldSong = swiftSong;
elseif paeon and paeon.GetSource() == caster then
oldSong = paeon;
elseif minuet and minuet.GetSource() == caster then
oldSong = minuet;
elseif ballad and ballad.GetSource() == caster then
oldSong = ballad;
end
if oldSong then
target.statusEffects.RemoveStatusEffect(oldSong);
end
--DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer);
end;

View file

@ -1,15 +1,56 @@
require("global");
require("magic");
function onMagicPrepare(caster, target, spell)
function onMagicPrepare(caster, target, skill)
return 0;
end;
function onMagicStart(caster, target, spell)
return 0;
function onMagicStart(caster, target, skill)
--Miuet gives 35 ACC/MACC by default at level 50. Minuet does scale with level
--BV apparetnly gives 71 ACc/MACC
--Formula seems to be level - 15, not sure why BV gives 71 at 50 then
local acc = caster.GetLevel() - 15;
--8071405: Choral Ringbands: Enhances Minuet of Rigor
--With Choral Tights, Minuet gives 60 ACC/MACC at 50. Unsure what it is at lower levels (ie if it's a flat added 25 MP or a multiplier)
--Assuming it's a flat 25 because that makes more sense than multiplying by 1.714
local gloves = caster.GetEquipment().GetItemAtSlot(13);
if gloves and gloves.itemId == 8071405 then
acc = acc + 25;
end
--223253: Battle Voice
--Battle Voice doubles effect of songs
if caster.statusEffects.HasStatusEffect(223253) then
acc = acc * 2;
--Set status tier so we can check it later when BV falls off
skill.statusTier = 2;
end
skill.statusMagnitude = acc;
end;
function onSkillFinish(caster, target, skill, action, actionContainer)
--223224: Swiftsong
--223254: Ballad Of Magi
--223255: Paeon of War
--If target has one of these effects that was from this caster, remove it
local oldSong;
local swiftSong = target.statusEffects.GetStatusEffectById(223224);
local ballad = target.statusEffects.GetStatusEffectById(223254);
local paeon = target.statusEffects.GetStatusEffectById(223255);
if swiftSong and swiftSong.GetSource() == caster then
oldSong = swiftSong;
elseif ballad and ballad.GetSource() == caster then
oldSong = ballad;
elseif paeon and paeon.GetSource() == caster then
oldSong = paeon;
end
if oldSong then
target.statusEffects.RemoveStatusEffect(oldSong);
end
--DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer);
end;

View file

@ -1,15 +1,54 @@
require("global");
require("magic");
function onMagicPrepare(caster, target, spell)
function onMagicPrepare(caster, target, skill)
return 0;
end;
function onMagicStart(caster, target, spell)
return 0;
function onMagicStart(caster, target, skill)
--Restores 50 TP/tick normally. With Choral Tights it's 60 TP. With Battle voice it's 100, 120 with Coral Tights.
--Battle voice is handled in the Battle Voice script
--Paeon does not scale with level
local tpPerTick = 50;
--8051405: Choral Tights: Enhances Paeon Of War
local pants = caster.GetEquipment().GetItemAtSlot(12);
if pants and pants.itemId == 8051405 then
tpPerTick = 60;
end
--223253: Battle Voice
--Battle Voice doubles effect of songs
if caster.statusEffects.HasStatusEffect(223253) then
tpPerTick = tpPerTick * 2;
--Set status tier so we can check it later when BV falls off
skill.statusTier = 2;
end
skill.statusMagnitude = tpPerTick;
end;
function onSkillFinish(caster, target, skill, action, actionContainer)
--223224: Swiftsong
--223254: Ballad Of Magi
--223256: Minuet of Rigor
--If target has one of these effects that was from this caster, remove it
local oldSong;
local swiftSong = target.statusEffects.GetStatusEffectById(223224);
local ballad = target.statusEffects.GetStatusEffectById(223254);
local minuet = target.statusEffects.GetStatusEffectById(223256);
if swiftSong and swiftSong.GetSource() == caster then
oldSong = swiftSong;
elseif ballad and ballad.GetSource() == caster then
oldSong = ballad;
elseif minuet and minuet.GetSource() == caster then
oldSong = minuet;
end
if oldSong then
target.statusEffects.RemoveStatusEffect(oldSong);
end
--DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer);
end;

View file

@ -8,11 +8,11 @@ end;
function onMagicStart(caster, target, spell)
--27363: Enhanced Raise: No longer inflicts weakness.
if caster.HasTrait(27363) then
ability.statusTier = 2;
ability.statusId = 0;
end
return 0;
end;
--Not sure how raise works yet.
function onSkillFinish(caster, target, skill, action, actionContainer)
--DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer);
end;