#include "stdafx.h" #include "LuaEngine.h" #include "../shared/RWLock.h" #include "User.h" #include "Npc.h" // define global functions to be called from Lua (e.g. myrand()) DEFINE_LUA_FUNCTION_TABLE(g_globalFunctions, MAKE_LUA_FUNCTION(CheckPercent) MAKE_LUA_FUNCTION(HowmuchItem) MAKE_LUA_FUNCTION(ShowMap) MAKE_LUA_FUNCTION(CheckNation) MAKE_LUA_FUNCTION(CheckClass) MAKE_LUA_FUNCTION(CheckLevel) MAKE_LUA_FUNCTION(CheckSkillPoint) MAKE_LUA_FUNCTION(SaveEvent) MAKE_LUA_FUNCTION(CheckExchange) MAKE_LUA_FUNCTION(RunExchange) MAKE_LUA_FUNCTION(RunSelectExchange) MAKE_LUA_FUNCTION(SearchQuest) MAKE_LUA_FUNCTION(NpcMsg) MAKE_LUA_FUNCTION(ShowEffect) MAKE_LUA_FUNCTION(ShowNpcEffect) MAKE_LUA_FUNCTION(ExistMonsterQuestSub) MAKE_LUA_FUNCTION(CountMonsterQuestSub) MAKE_LUA_FUNCTION(CountMonsterQuestMain) MAKE_LUA_FUNCTION(PromoteKnight) MAKE_LUA_FUNCTION(CheckClanGrade) MAKE_LUA_FUNCTION(CheckClanPoint) MAKE_LUA_FUNCTION(CheckLoyalty)
#include "stdafx.h" #include "LuaEngine.h" #include "../shared/RWLock.h" #include "User.h" #include "Npc.h" // define global functions to be called from Lua (e.g. myrand()) #if !defined(USE_ORIGINAL_QUESTS) DEFINE_LUA_FUNCTION_TABLE(g_globalFunctions, MAKE_LUA_FUNCTION(CheckPercent) ); #else DEFINE_LUA_FUNCTION_TABLE(g_globalFunctions, MAKE_LUA_FUNCTION(CheckPercent) MAKE_LUA_FUNCTION(HowmuchItem) MAKE_LUA_FUNCTION(ShowMap) MAKE_LUA_FUNCTION(CheckNation) MAKE_LUA_FUNCTION(CheckClass) MAKE_LUA_FUNCTION(CheckLevel) MAKE_LUA_FUNCTION(CheckSkillPoint) MAKE_LUA_FUNCTION(SaveEvent) MAKE_LUA_FUNCTION(CheckExchange) MAKE_LUA_FUNCTION(RunExchange) MAKE_LUA_FUNCTION(SearchQuest) MAKE_LUA_FUNCTION(NpcMsg) MAKE_LUA_FUNCTION(ShowEffect) MAKE_LUA_FUNCTION(ShowNpcEffect) MAKE_LUA_FUNCTION(ExistMonsterQuestSub) MAKE_LUA_FUNCTION(PromoteKnight) MAKE_LUA_FUNCTION(CheckClanGrade)
#include "stdafx.h" #include "LuaEngine.h" #include "../shared/RWLock.h" #include "User.h" #include "Npc.h" // define global functions to be called from Lua (e.g. myrand()) DEFINE_LUA_FUNCTION_TABLE(g_globalFunctions, MAKE_LUA_FUNCTION(CheckPercent) MAKE_LUA_FUNCTION(HowmuchItem) MAKE_LUA_FUNCTION(ShowMap) MAKE_LUA_FUNCTION(CheckNation) MAKE_LUA_FUNCTION(CheckClass) MAKE_LUA_FUNCTION(CheckLevel) MAKE_LUA_FUNCTION(CheckSkillPoint) MAKE_LUA_FUNCTION(SaveEvent) MAKE_LUA_FUNCTION(CheckExchange) MAKE_LUA_FUNCTION(RunExchange) MAKE_LUA_FUNCTION(SearchQuest) MAKE_LUA_FUNCTION(NpcMsg) MAKE_LUA_FUNCTION(SelectMsg) MAKE_LUA_FUNCTION(CastSkill) ); CLuaEngine::CLuaEngine() : m_lock(new RWLock()) { } CLuaScript::CLuaScript() : m_luaState(nullptr), m_lock(new FastMutex()) {