renamed ability to battlecommand

- moved spells to scripts/commands/
- added aoe range field to battle_commands.sql
- changed AttackState to use character's onAttack
This commit is contained in:
Tahir Akhlaq 2017-08-28 04:45:20 +01:00
parent 6f5a480cbd
commit 6c74222b68
23 changed files with 658 additions and 335 deletions

View file

@ -191,12 +191,16 @@ namespace FFXIVClassic_Map_Server.lua
return (int)res.Number;
}
}
else
{
Program.Log.Error($"LuaEngine.CallLuaStatusEffectFunction [{effect.GetName()}] Unable to find script {path}");
}
return -1;
}
public static int CallLuaAbilityFunction(Character actor, Ability ability, string folder, string functionName, params object[] args)
public static int CallLuaBattleCommandFunction(Character actor, BattleCommand command, string folder, string functionName, params object[] args)
{
string path = $"./scripts/{folder}/{ability.name}.lua";
string path = $"./scripts/commands/{folder}/{command.name}.lua";
if (File.Exists(path))
{
@ -208,7 +212,7 @@ namespace FFXIVClassic_Map_Server.lua
}
catch (Exception e)
{
Program.Log.Error($"LuaEngine.CallLuaSpellFunction [{functionName}] {e.Message}");
Program.Log.Error($"LuaEngine.CallLuaBattleCommandFunction [{functionName}] {e.Message}");
}
DynValue res = new DynValue();
@ -219,6 +223,10 @@ namespace FFXIVClassic_Map_Server.lua
return (int)res.Number;
}
}
else
{
Program.Log.Error($"LuaEngine.CallLuaBattleCommandFunction [{command.name}] Unable to find script {path}");
}
return -1;
}