2017-12-10 01:52:03 +11:00
|
|
|
#ifndef NATIVE_SCRIPT_H
|
|
|
|
#define NATIVE_SCRIPT_H
|
|
|
|
|
|
|
|
#include <unordered_map>
|
|
|
|
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
#include <boost/make_shared.hpp>
|
|
|
|
#include <boost/filesystem.hpp>
|
|
|
|
|
|
|
|
#include <Server_Common/Crypt/md5.h>
|
|
|
|
|
2017-12-10 15:31:48 +11:00
|
|
|
#include "ScriptLoader.h"
|
2017-12-10 01:52:03 +11:00
|
|
|
|
|
|
|
namespace Core {
|
|
|
|
namespace Scripting {
|
|
|
|
|
|
|
|
class NativeScript
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
std::unordered_map< uint32_t, StatusEffectScript* > m_statusEffectScripts;
|
2017-12-10 15:31:48 +11:00
|
|
|
std::unordered_map< uint32_t, ActionScript* > m_actionScripts;
|
2017-12-10 01:52:03 +11:00
|
|
|
std::unordered_map< uint32_t, QuestScript* > m_questScripts;
|
|
|
|
std::unordered_map< uint32_t, BattleNpcScript* > m_battleNpcScripts;
|
|
|
|
std::unordered_map< uint32_t, ZoneScript* > m_zoneScripts;
|
|
|
|
|
2017-12-10 15:31:48 +11:00
|
|
|
ScriptLoader m_loader;
|
|
|
|
|
2017-12-10 01:52:03 +11:00
|
|
|
public:
|
|
|
|
NativeScript( );
|
|
|
|
|
|
|
|
StatusEffectScript* getStatusEffectScript( uint32_t statusId );
|
2017-12-10 15:31:48 +11:00
|
|
|
ActionScript* getAbilityScript( uint32_t abilityId );
|
2017-12-10 01:52:03 +11:00
|
|
|
QuestScript* getQuestScript( uint32_t questId );
|
|
|
|
BattleNpcScript* getBattleNpcScript( uint32_t npcId );
|
|
|
|
ZoneScript* getZoneScript( uint32_t zoneId );
|
|
|
|
|
|
|
|
void removeStatusEffectScript( uint32_t statusId );
|
|
|
|
void removeAbilityScript( uint32_t abilityId );
|
|
|
|
void removeQuestScript( uint32_t questId );
|
|
|
|
void removeBattleNpcScript( uint32_t npcId );
|
|
|
|
|
|
|
|
|
2017-12-12 01:45:24 +11:00
|
|
|
bool loadScript( std::string );
|
|
|
|
bool unloadScript( std::string );
|
2017-12-10 01:52:03 +11:00
|
|
|
void clearAllScripts();
|
2017-12-10 23:51:06 +11:00
|
|
|
|
|
|
|
const std::string getModuleExtension();
|
2017-12-12 01:45:24 +11:00
|
|
|
|
2017-12-10 01:52:03 +11:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boost::shared_ptr< NativeScript > create_script_engine( );
|
|
|
|
} }
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|