Combat fixes

Add actor update flag for hotbar to send hotbar changes all at once.
Add script for equipping all actions for a class/job.

Fix multiple script errors.
Fix multiple status flag errors
Fix battle command db errors
Fix error in spawnnpc and yolo.
This commit is contained in:
Yogurt 2019-06-01 21:21:21 -07:00
parent a92ece58c1
commit 3104478263
20 changed files with 149 additions and 48 deletions

View file

@ -5,6 +5,7 @@ require("battleutils")
--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)
print('dark seal')
if skill.GetActionType() == ActionType.Magic then
--50 is random guess.
skill.accuracyModifier = skill.accuracyModifier + 50;

View file

@ -11,7 +11,7 @@ function onPreAction(effect, caster, target, skill, action, actionContainer)
action.hitRate = 0.0;
action.resistRate = 750;
--Remove status and add message
caster.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false);
defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false);
end
end;

View file

@ -10,7 +10,7 @@ function onPreAction(effect, caster, target, skill, action, actionContainer)
action.hitRate = 0.0;
action.resistRate = 400;
--Remove status and add message
caster.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false);
defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false);
end
end;

View file

@ -3,8 +3,8 @@ require("modifiers")
--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?
function onGain(owner, effect, actionContainer)
local newMaxHP = target.GetMaxHP() * 1.25;
local healAmount = newMaxHP - target.GetMaxHP();
local newMaxHP = owner.GetMaxHP() * 1.25;
local healAmount = newMaxHP - owner.GetMaxHP();
owner.SetMaxHP(newMaxHP);
owner.AddHP(healAmount);

View file

@ -11,5 +11,6 @@ function onCommandStart(effect, owner, skill, actionContainer)
end
skill.recastTimeMs = skill.recastTimeMs - (reduction * skill.recastTimeMs);
owner.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false);
end
end;

View file

@ -2,7 +2,7 @@ require("modifiers")
require("battleutils")
--Forces crit of a single WS action from rear.
function onMagicCast(caster, effect, skill)
function onMagicCast(effect, caster, skill)
skill.mpCost = skill.mpCost / 2;
end;

View file

@ -4,7 +4,7 @@ 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.
--It also increased height of skills
function onMagicCast(caster, effect, skill)
function onMagicCast(effect, caster, skill)
skill.range = skill.range * 1.25;
skill.rangeHeight = skill.rangeHeight * 1.25;
end;

View file

@ -1,8 +1,18 @@
require("modifiers")
require("battleutils")
function onMagicCast(caster, effect, skill)
skill.aoeType = TargetFindAOEType.Circle;
skill.aoeRange = 15;
skill.validTarget = 31
end
--Cure, Cura, Regen, Esuna, Enhancing spells (Hardcoded as Stoneskin and Sanguine since we dont have a good way to check what's an enhancing spell)
supportedSpells = [27346, 27347, 27358, 27357, 27350, 27307]
function onMagicCast(effect, caster, skill)
if supportedSpells[skill.id] then
skill.aoeType = TargetFindAOEType.Circle;
skill.aoeRange = 15;
end
end
function onCommandFinish(effect, owner, skill, actionContainer)
if supportedSpells[skill.id] then
owner.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false);
end
end;