mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-08 21:44:35 +02:00
Non-npc stuff is now also using script system. Wrote new scripts for all sidemenu commands.
This commit is contained in:
parent
4e69022072
commit
51bbf4ae2e
4 changed files with 17 additions and 36 deletions
|
@ -54,9 +54,9 @@ namespace FFXIVClassic_Map_Server.lua
|
|||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void DoActorOnEventStarted(Player player, Actor target, EventStartPacket eventStart)
|
||||
public static Coroutine DoActorOnEventStarted(Player player, Actor target, EventStartPacket eventStart)
|
||||
{
|
||||
string luaPath;
|
||||
|
||||
|
@ -76,24 +76,17 @@ namespace FFXIVClassic_Map_Server.lua
|
|||
Script script = LoadScript(luaPath);
|
||||
|
||||
if (script == null)
|
||||
return;
|
||||
return null;
|
||||
|
||||
//Have to Do this to combine LuaParams
|
||||
List<Object> objects = new List<Object>();
|
||||
objects.Add(player);
|
||||
objects.Add(target);
|
||||
objects.Add(eventStart.triggerName);
|
||||
|
||||
if (eventStart.luaParams != null)
|
||||
objects.AddRange(LuaUtils.CreateLuaParamObjectList(eventStart.luaParams));
|
||||
|
||||
//Run Script
|
||||
if (!script.Globals.Get("onEventStarted").IsNil())
|
||||
script.Call(script.Globals["onEventStarted"], objects.ToArray());
|
||||
return script.CreateCoroutine(script.Globals["onEventStarted"]).Coroutine;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.GetName()));
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue