Target flag and bug fixes

Add new flags for MainTarget's party, which allows for Protect to buff
other parties.

Fixed incorrect script function calls
Fixed bug causing World server to get stuck in a loop
This commit is contained in:
Yogurt
2019-05-29 22:59:24 -07:00
parent 6127ad44cc
commit 4f80023156
7 changed files with 65 additions and 32 deletions

View File

@@ -21,7 +21,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
{
this.startTime = DateTime.Now;
this.skill = Server.GetWorldManager().GetBattleCommand(skillId);
var returnCode = skill.CallLuaFunction(owner, "ability", "onAbilityPrepare", owner, target, skill);
var returnCode = skill.CallLuaFunction(owner, "onAbilityPrepare", owner, target, skill);
this.target = (skill.mainTarget & ValidTarget.SelfOnly) != 0 ? owner : target;
@@ -39,7 +39,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
public override void OnStart()
{
var returnCode = skill.CallLuaFunction(owner, "ability", "onAbilityStart", owner, target, skill);
var returnCode = skill.CallLuaFunction(owner, "onAbilityStart", owner, target, skill);
if (returnCode != 0)
{

View File

@@ -112,8 +112,8 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
attackCommand.range = 5;
attackCommand.rangeHeight = 10;
attackCommand.worldMasterTextId = 0x765D;
attackCommand.mainTarget = (ValidTarget)384;
attackCommand.validTarget = (ValidTarget)384;
attackCommand.mainTarget = (ValidTarget)768;
attackCommand.validTarget = (ValidTarget)17152;
attackCommand.commandType = CommandType.AutoAttack;
attackCommand.numHits = (byte)owner.GetMod(Modifier.HitCount);
attackCommand.basePotency = 100;

View File

@@ -24,7 +24,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
this.startPos = owner.GetPosAsVector3();
this.startTime = DateTime.Now;
this.spell = Server.GetWorldManager().GetBattleCommand(spellId);
var returnCode = spell.CallLuaFunction(owner, "magic", "onMagicPrepare", owner, target, spell);
var returnCode = spell.CallLuaFunction(owner, "onMagicPrepare", owner, target, spell);
//Modify spell based on status effects. Need to do it here because they can modify cast times
List<StatusEffect> effects = owner.statusEffects.GetStatusEffectsByFlag((uint)(StatusEffectFlags.ActivateOnCastStart));
@@ -49,7 +49,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
public override void OnStart()
{
var returnCode = spell.CallLuaFunction(owner, "magic", "onMagicStart", owner, target, spell);
var returnCode = spell.CallLuaFunction(owner, "onMagicStart", owner, target, spell);
if (returnCode != 0)
{
@@ -68,7 +68,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
Player p = (Player)owner;
if (spell.comboStep == 1 || ((p.playerWork.comboNextCommandId[0] == spell.id || p.playerWork.comboNextCommandId[1] == spell.id)))
{
spell.CallLuaFunction(owner, "magic", "onCombo", owner, target, spell);
spell.CallLuaFunction(owner, "onCombo", owner, target, spell);
spell.isCombo = true;
}
}

View File

@@ -22,7 +22,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
this.startTime = DateTime.Now;
this.skill = Server.GetWorldManager().GetBattleCommand(skillId);
var returnCode = skill.CallLuaFunction(owner, "weaponskill", "onSkillPrepare", owner, target, skill);
var returnCode = skill.CallLuaFunction(owner, "onSkillPrepare", owner, target, skill);
this.target = (skill.mainTarget & ValidTarget.SelfOnly) != 0 ? owner : target;
@@ -40,7 +40,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
public override void OnStart()
{
var returnCode = skill.CallLuaFunction(owner, "weaponskill", "onSkillStart", owner, target, skill);
var returnCode = skill.CallLuaFunction(owner, "onSkillStart", owner, target, skill);
if (returnCode != 0)
{
@@ -69,7 +69,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
//If owner is a player and the skill being used is part of the current combo
if (p.playerWork.comboNextCommandId[0] == skill.id || p.playerWork.comboNextCommandId[1] == skill.id)
{
skill.CallLuaFunction(owner, "weaponskill", "onCombo", owner, target, skill);
skill.CallLuaFunction(owner, "onCombo", owner, target, skill);
skill.isCombo = true;
}
//or if this just the start of a combo