Combat additions

Added formulas for base EXP gain and chain experience
Added basic scripts for most player abilities and effects
Added stat gains for some abilities
Changed status flags
Fixed bug with player death
Fixed bug where auto attacks didnt work when not locked on
Added traits
This commit is contained in:
yogurt 2018-04-18 16:06:41 -05:00
parent b8d6a943aa
commit c5ce2ec771
239 changed files with 5125 additions and 1237 deletions

View file

@ -0,0 +1,53 @@
require("global");
require("ability");
function onAbilityPrepare(caster, target, ability)
return 0;
end;
function onAbilityStart(caster, target, ability)
--27282: Enhanced Life Surge: Increases effect of Life Surge by 20%
if caster.HasTrait(27282) then
ability.statusTier = 2;
end
return 0;
end;
function onSkillFinish(caster, target, skill, action, actionContainer)
--Need a better way to do this
--223212: Power Surge I
--223213: Power Surge II
--223212: Power Surge III
--No message is sent when PS is removed by Life Surge
caster.statusEffects.RemoveStatusEffect(223212, true);
caster.statusEffects.RemoveStatusEffect(223213, true);
caster.statusEffects.RemoveStatusEffect(223214, true);
--Using this ability moves to the next LS buff
local removeId = 0;
--223215: Life Surge I
--223216: Life Surge II
--223217: Life Surge III
if caster.statusEffects.HasStatusEffect(223215) then
removeId = 223215;
skill.statusId = 223216;
skill.statusTier = 2;
elseif caster.statusEffects.HasStatusEffect(223216) then
removeId = 223216;
skill.statusId = 223217;
skill.statusTier = 3;
elseif caster.statusEffects.HasStatusEffect(223217) then
effect = caster.statusEffects.GetStatusEffectById(223217)
effect.RefreshTime();
skill.statusId = 223217;
end
if not (removeId == 0) then
--caster.statusEffects.RemoveStatusEffect(removeId, true);
caster.statusEffects.ReplaceEffect(caster.statusEffects.GetStatusEffectById(removeId), skill.statusId, skill.statusTier, skill.statusMagnitude, skill.statusDuration);
end
--DoAction handles rates, buffs, dealing damage
action.DoAction(caster, target, skill, actionContainer);
end;