More static actors loaded and can be accessed anywhere. Improved lua scripting to allow small talk.

This commit is contained in:
Filip Maj 2016-01-25 01:10:43 -05:00
parent 300748668f
commit 789df97d48
16 changed files with 882 additions and 28 deletions

View file

@ -1,4 +1,5 @@
using FFXIVClassic_Lobby_Server.packets;
using FFXIVClassic_Lobby_Server;
using FFXIVClassic_Lobby_Server.packets;
using FFXIVClassic_Map_Server.Actors;
using FFXIVClassic_Map_Server.dataobjects;
using FFXIVClassic_Map_Server.packets.receive.events;
@ -35,6 +36,7 @@ namespace FFXIVClassic_Map_Server.lua
if (File.Exists(luaPath))
{
Script script = new Script();
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
script.DoFile(luaPath);
DynValue result = script.Call(script.Globals["onInstantiate"], player, target);
List<LuaParam> lparams = LuaUtils.createLuaParamList(result);
@ -51,8 +53,7 @@ namespace FFXIVClassic_Map_Server.lua
}
return null;
}
}
public void doActorOnEventStarted(Player player, Actor target)
{
@ -64,6 +65,7 @@ namespace FFXIVClassic_Map_Server.lua
if (File.Exists(luaPath))
{
Script script = new Script();
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
script.DoFile(luaPath);
DynValue result = script.Call(script.Globals["onEventStarted"], player, target);
}
@ -81,6 +83,7 @@ namespace FFXIVClassic_Map_Server.lua
if (File.Exists(luaPath))
{
Script script = new Script();
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
script.DoFile(luaPath);
DynValue result = script.Call(script.Globals["onEventStarted"], player, target);
}
@ -104,6 +107,7 @@ namespace FFXIVClassic_Map_Server.lua
if (File.Exists(luaPath))
{
Script script = new Script();
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
script.DoFile(luaPath);
DynValue result = script.Call(script.Globals["onEventUpdate"], player, target, eventUpdate.step, eventUpdate.luaParams);
}
@ -121,6 +125,7 @@ namespace FFXIVClassic_Map_Server.lua
if (File.Exists(luaPath))
{
Script script = new Script();
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
script.DoFile(luaPath);
//Have to do this to combine LuaParams