mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-08 21:44:35 +02:00
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:
parent
ace4dfe58f
commit
c442dc9ecd
72 changed files with 524 additions and 171 deletions
|
@ -1,10 +1,8 @@
|
|||
require("global")
|
||||
require("modifiers")
|
||||
require("hiteffect")
|
||||
require("utils")
|
||||
|
||||
--Forces a full block (0 damage taken)
|
||||
function onPreAction(caster, target, effect, skill, action, actionContainer)
|
||||
function onPreAction(effect, caster, target, skill, action, actionContainer)
|
||||
--If action hit from the rear and is a weaponskill ation
|
||||
action.blockRate = 100.0;
|
||||
end;
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
require("modifiers")
|
||||
|
||||
--Doesn't do flat damage. 20 on Lv 50 Truffle Hog, 11 on Coincounter, 7 on nael hard, 19 on 52 fachan
|
||||
function onGain(target, effect)
|
||||
function onGain(owner, effect)
|
||||
owner.AddMod(modifiersGlobal.RegenDown, effect.GetMagnitude());
|
||||
end;
|
||||
|
||||
function onLose(target, effect)
|
||||
function onLose(owner, effect)
|
||||
owner.AddMod(modifiersGlobal.RegenDown, effect.GetMagnitude());
|
||||
end;
|
10
data/scripts/effects/ballad_of_magi.lua
Normal file
10
data/scripts/effects/ballad_of_magi.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
require("modifiers")
|
||||
|
||||
function onGain(owner, effect)
|
||||
--Only one song per bard can be active, need to figure out a good way to do this
|
||||
owner.AddMod(modifiersGlobal.Refresh, effect.GetMagnitude());
|
||||
end;
|
||||
|
||||
function onLose(owner, effect)
|
||||
owner.SubtractMod(modifiersGlobal.Refresh, effect.GetMagnitude());
|
||||
end;
|
|
@ -1,9 +1,3 @@
|
|||
require("modifiers")
|
||||
require("hiteffect")
|
||||
require("battleutils")
|
||||
|
||||
--Untraited reduces cooldown by 50%
|
||||
--Traited reduces cooldown by 100%
|
||||
function onCommandStart(effect, owner, skill, actionContainer)
|
||||
--27259: Light Shot
|
||||
if skill.id == 27259 then
|
||||
|
|
3
data/scripts/effects/battle_voice.lua
Normal file
3
data/scripts/effects/battle_voice.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
require("modifiers")
|
||||
|
||||
--BV doesn't really do anything i think
|
|
@ -1,5 +1,4 @@
|
|||
require("modifiers");
|
||||
require("battleutils");
|
||||
|
||||
function onGain(owner, effect)
|
||||
owner.statusEffects.RemoveStatusEffect(223208);
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
require("modifiers");
|
||||
|
||||
function onGain(target, effect)
|
||||
local currEvade = target.GetMod(modifierGlobals.Evasion);
|
||||
target.SetMod(modifierGlobals.Evasion, currEvade + 15);
|
||||
end;
|
||||
|
||||
function onLose(target, effect)
|
||||
local currEvade = target.GetMod(modifierGlobals.Evasion);
|
||||
target.SetMod(modifierGlobals.Evasion, currEvade - 15);
|
||||
end;
|
9
data/scripts/effects/blind.lua
Normal file
9
data/scripts/effects/blind.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
require("modifiers")
|
||||
|
||||
function onGain(owner, effect)
|
||||
owner.AddMod(modifiersGlobal.Accuracy, effect.GetMagnitude());
|
||||
end;
|
||||
|
||||
function onLose(owner, effect)
|
||||
owner.AddMod(modifiersGlobal.Accuracy, effect.GetMagnitude());
|
||||
end;
|
|
@ -2,7 +2,7 @@ require("modifiers")
|
|||
require("battleutils")
|
||||
|
||||
--Forces crit of a single WS action from rear.
|
||||
function onPreAction(caster, target, effect, skill, action, actionContainer)
|
||||
function onPreAction(effect, caster, target, skill, action, actionContainer)
|
||||
--If action hit from the rear and is a weaponskill ation
|
||||
if (action.param == HitDirection.Rear and action.commandType == CommandType.WeaponSkill) then
|
||||
--Set action's crit rate to 100%
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
require("modifiers")
|
||||
require("hiteffect")
|
||||
require("battleUtils")
|
||||
|
||||
--Takes 10% of hp rounded down
|
||||
--Takes 10% of hp rounded down when using a weaponskill
|
||||
--Random guess, but increases damage by 10% (12.5% traited)?
|
||||
function onPreAction(caster, target, effect, skill, action, actionContainer)
|
||||
local hpToRemove = math.floor(caster.GetHP() * 0.10);
|
||||
local modifier = 1.10;
|
||||
function onPreAction(effect, caster, target, skill, action, actionContainer)
|
||||
if skill.commandType == CommandType.Weaponskill then
|
||||
local hpToRemove = math.floor(caster.GetHP() * 0.10);
|
||||
local modifier = 1.10;
|
||||
|
||||
if (effect.GetTier() == 2) then
|
||||
modifier = 1.25;
|
||||
if effect.GetTier() == 2 then
|
||||
modifier = 1.125;
|
||||
end
|
||||
|
||||
action.amount = action.amount * modifier;
|
||||
caster.DelHP(hpToRemove);
|
||||
|
||||
--Remove status and add message
|
||||
actionContainer.AddAction(target.statusEffects.RemoveForBattleAction(effect));
|
||||
end
|
||||
|
||||
action.amount = action.amount * modifier;
|
||||
caster.DelHP(hpToRemove);
|
||||
|
||||
--Remove status and add message
|
||||
actionContainer.AddAction(target.statusEffects.RemoveForBattleAction(effect));
|
||||
end;
|
||||
|
||||
end;
|
|
@ -1,5 +1,4 @@
|
|||
require("modifiers");
|
||||
require("battleutils");
|
||||
|
||||
--Absorb HP on next WS or ability
|
||||
function onHit(effect, attacker, defender, action, actionContainer)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require("modifiers")
|
||||
|
||||
--This is the comboed version of bloodletter.
|
||||
--All videos I can find have it dealing 15 damage.
|
||||
--Damage type is projectile.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require("modifiers")
|
||||
|
||||
--Bloodletter2 is the uncomboed version of Bloodletter. It doesn't deal any additional damage when it falls off but has the same tick damage
|
||||
function onGain(owner, effect)
|
||||
owner.AddMod(modifiersGlobal.RegenDown, 15);
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
require("modifiers")
|
||||
require("battleutils")
|
||||
|
||||
function onPreAction(caster, target, effect, skill, action, actionContainer)
|
||||
if skill.commandType == CommandType.Spell then
|
||||
if action.actionType == ActionType.Heal then
|
||||
action.amount = action.amount * 0.80;
|
||||
elseif action.actionType == ActionType.Magic then
|
||||
action.amount = action.amount * 1.20;
|
||||
end
|
||||
end
|
||||
function onGain(target, effect)
|
||||
--Multiples Attack Magic Potency by 1.2 and Healing Magic Potency by 0.8
|
||||
target.SetMod(modifiersGlobal.MagicAttack, target.GetMod(modifiersGlobal.MagicAttack) * 1.2);
|
||||
target.SetMod(modifiersGlobal.MagicHeal, target.GetMod(modifiersGlobal.MagicHeal) * 0.8);
|
||||
end;
|
||||
|
||||
function onLose(target, effect)
|
||||
target.SetMod(modifiersGlobal.MagicAttack, target.GetMod(modifiersGlobal.MagicAttack) / 1.2);
|
||||
target.SetMod(modifiersGlobal.MagicHeal, target.GetMod(modifiersGlobal.MagicHeal) / 0.8);
|
||||
end;
|
|
@ -1,7 +1,4 @@
|
|||
require("global")
|
||||
require("modifiers")
|
||||
require("hiteffect")
|
||||
require("utils")
|
||||
|
||||
function onHit(effect, attacker, defender, action, actionContainer)
|
||||
local enmity = action.enmity;
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
require("global")
|
||||
require("modifiers")
|
||||
require("hiteffect")
|
||||
require("utils")
|
||||
|
||||
--Restores 25% of damage taken as MP. Does not send a message
|
||||
--Enahnced Cover: Restores 25% of damage taken as MP. Does not send a message
|
||||
function onDamageTaken(effect, attacker, defender, action, actionContainer)
|
||||
defender.AddMP(0.25 * action.amount);
|
||||
if effect.GetTier() == 2 then
|
||||
defender.AddMP(0.25 * action.amount);
|
||||
end
|
||||
end;
|
15
data/scripts/effects/covered.lua
Normal file
15
data/scripts/effects/covered.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
require("battleUtils")
|
||||
|
||||
--If person who cast cover is within 8y, change the action's target to them
|
||||
--Not sure what attacks are valid. It only says "melee attacks", unsure if that includes weaponskills and abilities or just auto attacks
|
||||
--Right now this will probably be really buggy, since Covered is not necessarily the first effect that will activate on the target
|
||||
|
||||
--Really need to do more research on this, figure out how it interacts with multi-hit attacks, aoe attacks (if those count as melee ever?), etc.
|
||||
--If it redirects the whole attack instead of a single hit, we might need a new that activates while iterating over targets.
|
||||
function onPreAction(effect, caster, target, skill, action, actionContainer)
|
||||
if not skill.isRanged then
|
||||
if effect.GetSource().IsAlive() and getDistanceBetweenActors(effect.GetSource(), target) <= 8 then
|
||||
target = effect.GetSource();
|
||||
end
|
||||
end
|
||||
end;
|
13
data/scripts/effects/dark_seal2.lua
Normal file
13
data/scripts/effects/dark_seal2.lua
Normal file
|
@ -0,0 +1,13 @@
|
|||
require("modifiers")
|
||||
require("battleutils")
|
||||
|
||||
--Increases accuracy of next cast.
|
||||
--There isn't really any information on this, but due to the fact it falls off BEFORE the target is hit,
|
||||
--I'm assuming it increases a spell's accuracy modifier instead of giving actual magic accuracy
|
||||
function onCommandStart(effect, owner, skill, actionContainer)
|
||||
if skill.actionType == ActionType.Magic then
|
||||
--50 is random guess.
|
||||
skill.accuracyModifier = skill.accuracyModifier + 50;
|
||||
actionContainer.AddAction(owner.RemoveStatusEffectForBattleAction(effect));
|
||||
end
|
||||
end
|
|
@ -2,15 +2,15 @@ require("modifiers")
|
|||
require("battleutils")
|
||||
|
||||
--This is the untraited version of decoy.
|
||||
|
||||
function onPreAction(caster, target, effect, skill, action, actionContainer)
|
||||
function onPreAction(effect, caster, target, skill, action, actionContainer)
|
||||
--Evade single ranged or magic attack
|
||||
--Traited allows for physical attacks
|
||||
if skill.isRanged or action.actionType == ActionType.Magic then
|
||||
if target.allegiance != caster.allegiance and (skill.isRanged or action.actionType == ActionType.Magic) then
|
||||
--Set action's hit rate to 0
|
||||
action.hirRate = 0.0;
|
||||
|
||||
--Remove status and add message
|
||||
actionContainer.AddAction(target.statusEffects.RemoveStatusEffectForBattleAction(effect));
|
||||
end
|
||||
|
||||
--Remove status and add message
|
||||
actionsList.AddAction(target.statusEffects.RemoveForBattleAction(effect));
|
||||
end;
|
|
@ -2,15 +2,14 @@ require("modifiers")
|
|||
require("battleutils")
|
||||
|
||||
--This is the traited version of Decoy. It can also evade physical attacks.
|
||||
|
||||
function onPreAction(caster, target, effect, skill, action, actionContainer)
|
||||
function onPreAction(effect, caster, target, skill, action, actionContainer)
|
||||
--Evade single ranged or magic attack
|
||||
--Traited allows for physical attacks
|
||||
if skill.isRanged or action.actionType == ActionType.Magic or action.actionType == ActionType.Physical then
|
||||
if target.allegiance != caster.allegiance and (skill.isRanged or action.actionType == ActionType.Magic or action.actionType == ActionType.Physical) then
|
||||
--Set action's hit rate to 0
|
||||
action.hirRate = 0.0;
|
||||
--Remove status and add message
|
||||
actionContainer.AddAction(target.statusEffects.RemoveStatusEffectForBattleAction(effect));
|
||||
end
|
||||
|
||||
--Remove status and add message
|
||||
actionsList.AddAction(target.statusEffects.RemoveForBattleAction(effect));
|
||||
end;
|
|
@ -1,2 +1,5 @@
|
|||
function onGain(target, effect)
|
||||
end;
|
||||
|
||||
function onLose(target, effect)
|
||||
end;
|
|
@ -1,3 +1,5 @@
|
|||
require("modifiers")
|
||||
|
||||
function onGain(owner, effect)
|
||||
owner.SubtractMod(modifiersGlobal.Defense, effect.GetMagnitude());
|
||||
end
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
--Consistent 85HP/tick normal; 113HP/tick with AF pants
|
||||
require("modifiers")
|
||||
|
||||
function onGain(owner, effect)
|
||||
local magnitude = 85
|
||||
|
||||
--Need a better way to set magnitude when adding effects
|
||||
if effect.GetTier() == 2 then
|
||||
magnitude = 113;
|
||||
end
|
||||
effect.SetMagnitude(magnitude);
|
||||
|
||||
owner.AddMod(modifiersGlobal.Regen, effect.GetMagnitude());
|
||||
end
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
require("modifiers")
|
||||
require("hiteffect")
|
||||
|
||||
--Increases block rate by 100%
|
||||
function onGain(owner, effect)
|
||||
|
@ -11,12 +10,21 @@ function onLose(owner, effect)
|
|||
end
|
||||
|
||||
--Applys Divine Regen to party in range when healed by cure or cura
|
||||
function onBlock(caster, target, effect, skill, action, actionContainer)
|
||||
function onHealed(caster, target, effect, skill, action, actionContainer)
|
||||
-- cure cura
|
||||
if (skill.id == 27346 or skill.id == 27347) and (caster != owner) then
|
||||
local regenDuration = 30;
|
||||
--Apparently heals for 85 without AF, 113 with. Unsure if these can be improved with stats
|
||||
local magnitude = 85
|
||||
|
||||
--Need a better way to set magnitude when adding effects
|
||||
if effect.GetTier() == 2 then
|
||||
magnitude = 113;
|
||||
end
|
||||
|
||||
--For each party member in range, add divine regen
|
||||
for chara in owner.GetPartyMembersInRange(8) do
|
||||
local addAction = chara.statusEffects.AddStatusForBattleAction(223264, 2);
|
||||
local addAction = chara.statusEffects.AddStatusForBattleAction(223264, effect.GetTier(), magnitude, regenDuration);
|
||||
actionContainer.AddAction(addAction);
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,17 +3,24 @@ require("battleutils")
|
|||
|
||||
--Dread spike completely nullifies a physical action and absorbs how much damage it would have done (when it's powered up)
|
||||
--I'm going to assume it only absorbs half damage without LS/PS up
|
||||
--When I say it nullifies an attack, it even gets rid of the message. It's as if the attack didn't happen
|
||||
--When I say it nullifies an attack, it even gets rid of the message. It's as if the damage action didn't happen.
|
||||
--It still shows the enemy's "Enemy used [command]." message but there is no 0 damage dealt message.
|
||||
--Don't know how this works with multi-hit attacks or even how it works with stoneskin or other buffs that respond to damage
|
||||
-- I dont really know how this should work...
|
||||
function onDamageTaken(effect, attacker, defender, action, actionContainer)
|
||||
if action.actionType == ActionType.Physical then
|
||||
--maybe this works?
|
||||
local absorbAmount = action.amount;
|
||||
local absorbPercent = 0.5;
|
||||
|
||||
if effect.GetTier() == 2 then
|
||||
absorbPercent = 1;
|
||||
end
|
||||
|
||||
local absorbAmount = action.amount * absorbPercent;
|
||||
action.amount = 0;
|
||||
action.worldMasterTextId = 0;
|
||||
|
||||
attacker.AddHP(absorbAmount);
|
||||
defender.AddHP(absorbAmount);
|
||||
--30451: You recover [absorbAmount] HP.
|
||||
actionContainer.AddHPAction(defender.actorId, 30451, absorbAmount)
|
||||
--Dread Spike is lost after absorbing hp
|
||||
|
|
30
data/scripts/effects/excruciate.lua
Normal file
30
data/scripts/effects/excruciate.lua
Normal file
|
@ -0,0 +1,30 @@
|
|||
require("modifiers")
|
||||
require("battleutils")
|
||||
|
||||
--Gradually increases critical rate of spells
|
||||
function onTick(owner, effect)
|
||||
--No clue how fast the crit rate increases or how often it ticks
|
||||
--Only clue I have to go on is that the strategy seemed to be to use it
|
||||
--before or after fire/thunder and you'd usually get a crit at firaga/thundaga
|
||||
--Random guess, going to assume it's 25 crit rating every 3s, 50 crit rating traited
|
||||
--That's 4% and 8% every 3 seconds of actual crit
|
||||
local ratePerTick = 25;
|
||||
|
||||
if effect.GetTier() == 2 then
|
||||
ratePerTick = 50;
|
||||
end
|
||||
|
||||
effect.SetMagnitude(effect.GetMagnitude() + ratePerTick);
|
||||
end
|
||||
|
||||
--Excruciate seems to have an effect on all hits of aoe spells, so it's changing the crit bonus of the skill itself
|
||||
--rather than on a hit by hit basis
|
||||
function onCommandStart(effect, owner, skill, actionContainer)
|
||||
skill.bonusCritRate = skill.bonusCritRate + effect.GetMagnitude();
|
||||
end
|
||||
|
||||
function onCrit(effect, attacker, defender, action, actionContainer)
|
||||
if action.commandType == CommandType.Spell then
|
||||
actionContainer.AddAction(attacker.statusEffects.RemoveStatusEffectForBattleAction(effect));
|
||||
end
|
||||
end
|
|
@ -3,9 +3,5 @@ function onGain(owner, effect)
|
|||
effect.SetExtra(effect.GetMagnitude());
|
||||
end
|
||||
|
||||
function onTick(owner, effect)
|
||||
print("hi")
|
||||
end
|
||||
|
||||
function onLose(owner, effect)
|
||||
end
|
||||
|
|
10
data/scripts/effects/haste.lua
Normal file
10
data/scripts/effects/haste.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
require("modifiers")
|
||||
|
||||
--Set magnitude to milliseconds that HF will reduce delay by
|
||||
function onGain(target, effect)
|
||||
target.SubtractMod(modifiersGlobal.AttackDelay, effect.GetMagnitude());
|
||||
end;
|
||||
|
||||
function onLose(target, effect)
|
||||
target.AddMod(modifiersGlobal.AttackDelay, effect.GetMagnitude());
|
||||
end;
|
|
@ -4,6 +4,8 @@ require("modifiers");
|
|||
--The player in this capture was a Dragoon, so this is untraited.
|
||||
--Traited Hawk's Eye says it increases Accuracy by 50%.
|
||||
--This could mean traited hawk's eye gives 28.125% (18.75% * 1.5) or it could mean it gives 68.75% (18.75% + 50%)
|
||||
--It's also possible that Hawk's Eye gives 15 + 15% accuracy untraited, which would give 450.85, which would be rounded down.
|
||||
--In that case, traited hawks eye could be 15 + 22.5% or 22.5 + 22.5% or (15 + 15%) * 1.5
|
||||
function onGain(target, effect)
|
||||
local accuracyMod = 0.1875;
|
||||
|
||||
|
|
|
@ -11,5 +11,5 @@ function onGain(target, effect)
|
|||
end;
|
||||
|
||||
function onLose(target, effect)
|
||||
target.SetMaxHP(target.GetMaxHP() * 0.75);
|
||||
target.SetMaxHP(target.GetMaxHP() / 1.25);
|
||||
end;
|
|
@ -1,13 +1,10 @@
|
|||
require("modifiers")
|
||||
|
||||
--will this break with things like slow?
|
||||
--Set magnitude to milliseconds that HF will reduce delay by
|
||||
function onGain(target, effect)
|
||||
local currDelay = target.GetMod(modifiersGlobal.AttackDelay);
|
||||
target.SetMod(modifiersGlobal.AttackDelay), 0.66 * currDelay);
|
||||
target.SubtractMod(modifiersGlobal.AttackDelay), effect.GetMagnitude());
|
||||
end;
|
||||
|
||||
function onLose(target, effect)
|
||||
local currDelay = target.GetMod(modifiersGlobal.AttackDelay);
|
||||
target.SetMod(modifiersGlobal.AttackDelay), 1.50 * currDelay);
|
||||
end;
|
||||
|
||||
target.AddMod(modifiersGlobal.AttackDelay), effect.GetMagnitude());
|
||||
end;
|
|
@ -1,3 +1,5 @@
|
|||
require("modifiers")
|
||||
|
||||
--100 TP per tick without AF. 133 TP per tick with AF
|
||||
function onGain(owner, effect)
|
||||
owner.AddMod(modifiersGlobal.Regain, effect.GetMagnitude());
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
require("modifiers")
|
||||
require("hiteffect")
|
||||
require("battleutils")
|
||||
|
||||
--Untraited reduces cooldown by 50%
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
require("modifiers")
|
||||
require("hiteffect")
|
||||
require("battleutils")
|
||||
|
||||
--Heals for 30%? of damage dealt on auto attacks.
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
require("modifiers")
|
||||
require("hiteffect")
|
||||
require("battleutils")
|
||||
|
||||
function onHit(effect, attacker, defender, action, actionContainer)
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
require("modifiers")
|
||||
require("hiteffect")
|
||||
require("battleutils")
|
||||
|
||||
--Heals for 30%? of damage dealt on auto attacks.
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
--Bloodletter2 is the uncomboed version of Bloodletter. It doesn't deal any additional damage when it falls off but has the same tick damage
|
||||
require("modifiers")
|
||||
|
||||
function onGain(owner, effect)
|
||||
owner.SubtractMod(modifiersGlobal.MagicEvasion, effect.GetMagnitude());
|
||||
end
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
require("modifiers")
|
||||
require("battleutils")
|
||||
|
||||
--Forces crit on attacks made with axes
|
||||
function onPreAction(caster, target, effect, skill, action, actionContainer)
|
||||
function onPreAction(effect, caster, target, skill, action, actionContainer)
|
||||
--Assuming "attacks made with axes" means skills specific to MRD/WAR
|
||||
if (skill.job == 3 or skill.job == 17) then
|
||||
--Set action's crit rate to 100%
|
||||
|
|
12
data/scripts/effects/minuet_of_rigor.lua
Normal file
12
data/scripts/effects/minuet_of_rigor.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
require("modifiers")
|
||||
|
||||
function onGain(owner, effect)
|
||||
--Only one song per bard can be active, need to figure out a good way to do this
|
||||
owner.AddMod(modifiersGlobal.Accuracy, effect.GetMagnitude());
|
||||
owner.AddMod(modifiersGlobal.MagicAccuracy, effect.GetMagnitude());
|
||||
end;
|
||||
|
||||
function onLose(owner, effect)
|
||||
owner.SubtractMod(modifiersGlobal.Accuracy, effect.GetMagnitude());
|
||||
owner.SubtractMod(modifiersGlobal.MagicAccuracy, effect.GetMagnitude());
|
||||
end;
|
12
data/scripts/effects/necrogenesis.lua
Normal file
12
data/scripts/effects/necrogenesis.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
require("modifiers")
|
||||
require("battleutils")
|
||||
|
||||
function onHit(effect, attacker, defender, action, actionContainer)
|
||||
if action.commandType == CommandType.Spell then
|
||||
--Necrogenesis returns 75% of damage done rounded up(?) as MP.
|
||||
local hpToReturn = math.ceil(0.75 * action.amount);
|
||||
attacker.AddMp(hpToReturn);
|
||||
actionContainer.AddHPAction(attacker.actorId, 33012, mpToReturn);
|
||||
actionContainer.AddAction(attacker.statusEffects.RemoveStatusEffectForBattleAction(effect));
|
||||
end
|
||||
end
|
|
@ -1,6 +1,4 @@
|
|||
require("modifiers")
|
||||
require("hiteffect")
|
||||
require("battleutils")
|
||||
|
||||
--Add 30 raw block rate. No idea how much block it actually gives.
|
||||
function onGain(owner, effect)
|
||||
|
|
10
data/scripts/effects/paeon_of_war.lua
Normal file
10
data/scripts/effects/paeon_of_war.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
require("modifiers")
|
||||
|
||||
function onGain(owner, effect)
|
||||
--Only one song per bard can be active, need to figure out a good way to do this
|
||||
owner.AddMod(modifiersGlobal.Regain, effect.GetMagnitude());
|
||||
end;
|
||||
|
||||
function onLose(owner, effect)
|
||||
owner.SubtractMod(modifiersGlobal.Regain, effect.GetMagnitude());
|
||||
end;
|
17
data/scripts/effects/parsimony.lua
Normal file
17
data/scripts/effects/parsimony.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
require("modifiers")
|
||||
require("battleutils")
|
||||
|
||||
--Forces crit of a single WS action from rear.
|
||||
function onMagicCast(caster, effect, skill)
|
||||
skill.mpCost = skill.mpCost / 2;
|
||||
end;
|
||||
|
||||
function onHit(effect, attacker, defender, action, actionContainer)
|
||||
if action.commandType == CommandType.Spell then
|
||||
--Parsimony returns 35% of damage done rounded up as MP.
|
||||
local mpToReturn = math.ceil(0.35 * action.amount);
|
||||
attacker.AddMp(mpToReturn);
|
||||
actionContainer.AddMPAction(attacker.actorId, 33007, mpToReturn);
|
||||
actionContainer.AddAction(attacker.statusEffects.RemoveStatusEffectForBattleAction(effect));
|
||||
end
|
||||
end
|
7
data/scripts/effects/poison.lua
Normal file
7
data/scripts/effects/poison.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
function onGain(owner, effect)
|
||||
owner.AddMod(modifiersGlobal.RegenDown, effect.GetMagnitude());
|
||||
end
|
||||
|
||||
function onLose(owner, effect)
|
||||
owner.SubtractMod(modifiersGlobal.RegenDown, effect.GetMagnitude());
|
||||
end
|
|
@ -1,5 +1,4 @@
|
|||
require("modifiers")
|
||||
require("hiteffect")
|
||||
require("battleutils")
|
||||
|
||||
--https://www.bluegartr.com/threads/107403-Stats-and-how-they-work/page22
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
require("modifiers")
|
||||
require("hiteffect")
|
||||
require("battleutils")
|
||||
|
||||
--https://www.bluegartr.com/threads/107403-Stats-and-how-they-work/page22
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
require("modifiers")
|
||||
require("hiteffect")
|
||||
require("battleutils")
|
||||
|
||||
--https://www.bluegartr.com/threads/107403-Stats-and-how-they-work/page22
|
||||
|
|
|
@ -5,21 +5,18 @@ function onGain(target, effect)
|
|||
--http://forum.square-enix.com/ffxiv/threads/41900-White-Mage-A-Guide
|
||||
--5-4-5-4-5-4-5-4-5 repeating points of Enhancing for 1 defense
|
||||
--4.56 * Enhancing Potency
|
||||
local defenseBuff = 5-- 4.56 * effect.GetMagnitude();
|
||||
local defenseBuff = 4.56 * effect.GetMagnitude();
|
||||
local magicDefenseBuff = 0;
|
||||
|
||||
target.AddMod(modifiersGlobal.Defense, defenseBuff);
|
||||
|
||||
--27365: Enhanced Protect: Increases magic defense gained from Protect.
|
||||
--There is no "magic defense" stat, instead it gives stats to each resist stat.
|
||||
--if effect.GetTier() >= 2 then
|
||||
--7-6-7 repeating
|
||||
--6.67 * Enhancing Potency
|
||||
magicDefenseBuff = 5--6.67 * effect.GetMagnitude();
|
||||
for i = modifiersGlobal.ResistFire, modifiersGlobal.ResistWater do
|
||||
target.AddMod(i, magicDefenseBuff);
|
||||
end
|
||||
--end
|
||||
magicDefenseBuff = 6.67 * effect.GetMagnitude();
|
||||
for i = modifiersGlobal.ResistFire, modifiersGlobal.ResistWater do
|
||||
target.AddMod(i, magicDefenseBuff);
|
||||
end
|
||||
|
||||
|
||||
end;
|
||||
|
||||
|
@ -31,13 +28,9 @@ function onLose(target, effect)
|
|||
|
||||
--27365: Enhanced Protect: Increases magic defense gained from Protect.
|
||||
--There is no "magic defense" stat, instead it gives stats to each resist stat.
|
||||
--if effect.GetTier() >= 2 then
|
||||
--7-6-7 repeating
|
||||
--6.67 * Enhancing Potency
|
||||
magicDefenseBuff = 6.67 * effect.GetMagnitude();
|
||||
for i = modifiersGlobal.ResistFire, modifiersGlobal.ResistWater do
|
||||
target.SubtractMod(i, magicDefenseBuff);
|
||||
end
|
||||
--end
|
||||
magicDefenseBuff = 6.67 * effect.GetMagnitude();
|
||||
for i = modifiersGlobal.ResistFire, modifiersGlobal.ResistWater do
|
||||
target.SubtractMod(i, magicDefenseBuff);
|
||||
end
|
||||
end;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
require("modifiers")
|
||||
require("hiteffect")
|
||||
require("battleutils")
|
||||
|
||||
--Untraited reduces cooldown by 50%
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
require("global")
|
||||
require("modifiers")
|
||||
require("hiteffect")
|
||||
require("battleutils")
|
||||
require("utils")
|
||||
|
||||
parryPerDT = 20;
|
||||
|
|
7
data/scripts/effects/refresh.lua
Normal file
7
data/scripts/effects/refresh.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
function onGain(owner, effect)
|
||||
owner.AddMod(modifiersGlobal.Refresh, effect.GetMagnitude());
|
||||
end
|
||||
|
||||
function onLose(owner, effect)
|
||||
owner.SubtractMod(modifiersGlobal.Refresh, effect.GetMagnitude());
|
||||
end
|
7
data/scripts/effects/regain.lua
Normal file
7
data/scripts/effects/regain.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
function onGain(owner, effect)
|
||||
owner.AddMod(modifiersGlobal.Regain, effect.GetMagnitude());
|
||||
end
|
||||
|
||||
function onLose(owner, effect)
|
||||
owner.SubtractMod(modifiersGlobal.Regain, effect.GetMagnitude());
|
||||
end
|
|
@ -1,8 +1,8 @@
|
|||
--Regen is modified by Enhancing Magic Potency. Formula here: http://forum.square-enix.com/ffxiv/threads/41900-White-Mage-A-Guide
|
||||
function onGain(owner, effect)
|
||||
owner.AddMod(modifiersGlobal.Regen, effect.magnitude);
|
||||
owner.AddMod(modifiersGlobal.Regen, effect.GetMagnitude());
|
||||
end
|
||||
|
||||
function onLose(owner, effect)
|
||||
owner.SubtractMod(modifiersGlobal.Regen, effect.magnitude);
|
||||
owner.SubtractMod(modifiersGlobal.Regen, effect.GetMagnitude());
|
||||
end
|
||||
|
|
15
data/scripts/effects/resonance2.lua
Normal file
15
data/scripts/effects/resonance2.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
require("modifiers")
|
||||
require("battleutils")
|
||||
|
||||
--Increases range of a single spell, no clue by how much, 25% is a random guess
|
||||
--It isn't clear if it has an effect on the aoe portion of skills or just the normal range, i've seen people on the OF say both.
|
||||
function onMagicStart(caster, effect, skill)
|
||||
skill.range = skill.range * 1.25;
|
||||
end;
|
||||
|
||||
--The effect falls off after the skill is finished, meaning if you start a cast and cancel, it shouldn't fall off.
|
||||
function onCommandFinish(effect, owner, skill, actionContainer)
|
||||
if action.commandType == CommandType.Spell then
|
||||
actionContainer.AddAction(owner.statusEffects.RemoveStatusEffectForBattleAction(effect));
|
||||
end
|
||||
end
|
|
@ -1,4 +1,5 @@
|
|||
require("modifiers")
|
||||
require("battleutils")
|
||||
|
||||
function onGain(target, effect)
|
||||
--Untraited Sentinel is 30% damage taken down, traited is 50%
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
require("global")
|
||||
require("utils")
|
||||
require("modifiers")
|
||||
require("hiteffect")
|
||||
require("battleutils")
|
||||
|
||||
function onGain(owner, effect)
|
||||
|
||||
|
@ -10,7 +6,7 @@ function onGain(owner, effect)
|
|||
end
|
||||
|
||||
--Using extra for how much mitigation stoneskin has
|
||||
function onPostAction(owner, effect, caster, skill, action, actionContainer)
|
||||
function onPostAction(caster, target, effect, skill, action, actionContainer)
|
||||
if (owner.GetMod(modifiersGlobal.Stoneskin) <= 0) then
|
||||
actionContainer.AddAction(owner.statusEffects.RemoveStatusEffectForBattleAction(effect));
|
||||
end
|
||||
|
|
7
data/scripts/effects/tempered_will.lua
Normal file
7
data/scripts/effects/tempered_will.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
function onGain(owner, effect)
|
||||
owner.AddMod(modifiersGlobal.KnockbackImmune, 1);
|
||||
end
|
||||
|
||||
function onLose(owner, effect)
|
||||
owner.SubtractMod(modifiersGlobal.KnockbackImmune, 1);
|
||||
end
|
7
data/scripts/effects/tp_bleed.lua
Normal file
7
data/scripts/effects/tp_bleed.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
function onGain(owner, effect)
|
||||
owner.SubtractMod(modifiersGlobal.Regain, effect.GetMagnitude());
|
||||
end
|
||||
|
||||
function onLose(owner, effect)
|
||||
owner.AddMod(modifiersGlobal.Regain, effect.GetMagnitude());
|
||||
end
|
|
@ -1,7 +1,5 @@
|
|||
require("global")
|
||||
require("modifiers")
|
||||
require("hiteffect")
|
||||
require("utils")
|
||||
require("battleutils")
|
||||
|
||||
--Unclear what the exact damage is but it seems like it's the total amount of damage the attack would have done before parrying
|
||||
function onDamageTaken(effect, attacker, defender, action, actionContainer)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue