Auto target self on skills whose main target can only be self.

This commit is contained in:
Yogurt 2019-05-29 19:51:51 -07:00
parent 289e4dc24b
commit 706a9fa721
3 changed files with 7 additions and 2 deletions

View File

@ -23,8 +23,9 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
this.skill = Server.GetWorldManager().GetBattleCommand(skillId); this.skill = Server.GetWorldManager().GetBattleCommand(skillId);
var returnCode = lua.LuaEngine.CallLuaBattleCommandFunction(owner, skill, "ability", "onAbilityPrepare", owner, target, skill); var returnCode = lua.LuaEngine.CallLuaBattleCommandFunction(owner, skill, "ability", "onAbilityPrepare", owner, target, skill);
this.target = target != null ? target : owner; this.target = (skill.mainTarget & ValidTarget.SelfOnly) != 0 ? owner : target;
errorResult = new CommandResult(owner.actorId, 32553, 0);
if (returnCode == 0) if (returnCode == 0)
{ {
OnStart(); OnStart();

View File

@ -34,8 +34,9 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
foreach (var effect in effects) foreach (var effect in effects)
lua.LuaEngine.CallLuaStatusEffectFunction(owner, effect, "onMagicCast", owner, effect, spell); lua.LuaEngine.CallLuaStatusEffectFunction(owner, effect, "onMagicCast", owner, effect, spell);
this.target = target != null ? target : owner; this.target = (spell.mainTarget & ValidTarget.SelfOnly) != 0 ? owner : target;
errorResult = new CommandResult(owner.actorId, 32553, 0);
if (returnCode == 0 && owner.CanUse(this.target, spell, errorResult)) if (returnCode == 0 && owner.CanUse(this.target, spell, errorResult))
{ {
OnStart(); OnStart();

View File

@ -24,6 +24,9 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
this.skill = Server.GetWorldManager().GetBattleCommand(skillId); this.skill = Server.GetWorldManager().GetBattleCommand(skillId);
var returnCode = lua.LuaEngine.CallLuaBattleCommandFunction(owner, skill, "weaponskill", "onSkillPrepare", owner, target, skill); var returnCode = lua.LuaEngine.CallLuaBattleCommandFunction(owner, skill, "weaponskill", "onSkillPrepare", owner, target, skill);
this.target = (skill.mainTarget & ValidTarget.SelfOnly) != 0 ? owner : target;
errorResult = new CommandResult(owner.actorId, 32553, 0);
if (returnCode == 0 && owner.CanUse(this.target, skill, errorResult)) if (returnCode == 0 && owner.CanUse(this.target, skill, errorResult))
{ {
OnStart(); OnStart();