mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-09 14:04:41 +02:00
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:
parent
4f80023156
commit
00017468cc
129 changed files with 884 additions and 396 deletions
|
@ -1,48 +1,47 @@
|
|||
require("modifiers")
|
||||
require("battleutils")
|
||||
require("utils")
|
||||
|
||||
parryPerDT = 20;
|
||||
delayMsPerDT = 100;
|
||||
|
||||
function onGain(owner, effect)
|
||||
owner.statusEffects.RemoveStatusEffect(223207);
|
||||
function onGain(owner, effect, actionContainer)
|
||||
end
|
||||
|
||||
--Increases parry rating and attack speed for each hit. (Need more info)
|
||||
function onDamageTaken(effect, attacker, defender, action, actionContainer)
|
||||
|
||||
function onDamageTaken(effect, attacker, defender, skill, action, actionContainer)
|
||||
--Assuming 20 parry rating every time you're hit up to 200
|
||||
--Delay is more complicated. Most axes are around 4 seconds, so i'm gonna assume it cuts off a full second at max
|
||||
if (effect.GetExtra() < 10) then
|
||||
effect.SetExtra(effect.GetExtra() + 1);
|
||||
|
||||
attacker.AddMod(modifiersGlobal.Parry, parryPerDT);
|
||||
attacker.SubtractMod(modifiersGlobal.AttackDelay, delayMsPerDT);
|
||||
defender.AddMod(modifiersGlobal.Parry, parryPerDT);
|
||||
defender.SubtractMod(modifiersGlobal.Delay, delayMsPerDT);
|
||||
end
|
||||
end
|
||||
|
||||
--Heals for 50% of damage dealt on crits with a maximum of 20% of max hp
|
||||
--Also only heals for as much hp as you're missing at most
|
||||
function onCrit(effect, attacker, defender, action, actionContainer)
|
||||
local healAmount = math.Clamp(action.amount * 0.50, 0, defender.GetMaxHP() * 0.20);
|
||||
healAmount = math.Clamp(healAmount, 0, defender.GetMaxHP() - defender.GetHP());
|
||||
defender.AddHP(healAmount);
|
||||
function onCrit(effect, attacker, defender, skill, action, actionContainer)
|
||||
local healAmount = math.Clamp(action.amount * 0.50, 0, attacker.GetMaxHP() * 0.20);
|
||||
healAmount = math.Clamp(healAmount, 0, attacker.GetMaxHP() - attacker.GetHP());
|
||||
attacker.AddHP(healAmount);
|
||||
--33012: You recover [healAmount] HP.
|
||||
actionContainer.AddHPAction(owner.actorId, 33008, healAmount);
|
||||
actionContainer.AddHPAbsorbAction(defender.actorId, 33008, healAmount);
|
||||
end;
|
||||
|
||||
--"Effect fades over time"
|
||||
function onTick(owner, effect)
|
||||
--Rampage ticks every 6 seconds
|
||||
function onTick(owner, effect, actionContainer)
|
||||
--Enduring march prevents fading of rampage effect
|
||||
if not owner.statusEffects.HasStatusEffect(223078) and (effect.GetExtra() > 0) then
|
||||
--Going to assume that every 5 seconds a single hits worth of rampage is lost.
|
||||
owner.SubtractMod(modifiersGlobal.Parry, parryPerDT);
|
||||
owner.AddMod(modifiersGlobal.Delay, delayMsPerDT);
|
||||
effect.SetExtra(effect.GetExtra() - 1);
|
||||
end
|
||||
end
|
||||
|
||||
function onLose(owner, effect)
|
||||
function onLose(owner, effect, actionContainer)
|
||||
owner.SubtractMod(modifiersGlobal.Parry, effect.GetExtra() * parryPerDT);
|
||||
owner.AddMod(modifiersGlobal.Delay, effect.GetExtra() * delayMsPerDT);
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue