mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-08 21:44:35 +02:00
added status effect loading
- todo: populate table (and test this doesnt break everything ever), send charawork and message packets
This commit is contained in:
parent
13af16ec0e
commit
d9d185d7e6
12 changed files with 360 additions and 379 deletions
|
@ -16,6 +16,7 @@ using FFXIVClassic_Map_Server.lua;
|
|||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.actors.area;
|
||||
using System.Threading;
|
||||
using FFXIVClassic_Map_Server.actors.chara.ai;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.lua
|
||||
{
|
||||
|
@ -163,6 +164,33 @@ namespace FFXIVClassic_Map_Server.lua
|
|||
}
|
||||
}
|
||||
|
||||
public static int CallLuaStatusEffectFunction(Character actor, StatusEffect effect, string functionName, params object[] args)
|
||||
{
|
||||
string path = $"./scripts/effects/{effect.GetName()}.lua";
|
||||
|
||||
if (File.Exists(path))
|
||||
{
|
||||
var script = LoadGlobals();
|
||||
|
||||
try
|
||||
{
|
||||
script.DoFile(path);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Program.Log.Error($"LuaEngine.CallLuaStatusEffectFunction [{functionName}] {e.Message}");
|
||||
}
|
||||
DynValue res = new DynValue();
|
||||
|
||||
if (!script.Globals.Get(functionName).IsNil())
|
||||
{
|
||||
res = script.Call(script.Globals.Get(functionName), args);
|
||||
return (int)res.Number;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
private static string GetScriptPath(Actor target)
|
||||
{
|
||||
if (target is Player)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue