1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-06-10 01:37:46 +00:00

use defines for fixed script ids

This commit is contained in:
GokuWeedLord 2017-12-13 14:05:50 +11:00
parent 69d618f1d0
commit fc0fb276b9
4 changed files with 8 additions and 4 deletions

View file

@ -12,7 +12,7 @@
class Aethernet : public QuestScript class Aethernet : public QuestScript
{ {
public: public:
Aethernet() : QuestScript( "Aethernet", 0x50001 ) Aethernet() : QuestScript( "Aethernet", EVENTSCRIPT_AETHERNET_ID )
{} {}
virtual void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) virtual void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId )

View file

@ -13,7 +13,7 @@
class Aetheryte : public QuestScript class Aetheryte : public QuestScript
{ {
public: public:
Aetheryte() : QuestScript( "Aetheryte", 0x50000 ) Aetheryte() : QuestScript( "Aetheryte", EVENTSCRIPT_AETHERYTE_ID )
{} {}
virtual void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) virtual void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId )

View file

@ -18,6 +18,10 @@ extern "C" EXPORT ScriptObject* getScript() \
using namespace Core; using namespace Core;
// constant script ids for certain events
#define EVENTSCRIPT_AETHERYTE_ID 0x50000
#define EVENTSCRIPT_AETHERNET_ID 0x50001
enum ScriptType enum ScriptType
{ {
StatusEffect, StatusEffect,

View file

@ -119,9 +119,9 @@ bool Core::Scripting::ScriptManager::onTalk( Entity::Player& player, uint64_t ac
if( eventType == Common::EventType::Aetheryte ) if( eventType == Common::EventType::Aetheryte )
{ {
auto aetherInfo = g_exdData.getAetheryteInfo( eventId & 0xFFFF ); auto aetherInfo = g_exdData.getAetheryteInfo( eventId & 0xFFFF );
scriptId = 0x50000; scriptId = EVENTSCRIPT_AETHERYTE_ID;
if( !aetherInfo->isAetheryte ) if( !aetherInfo->isAetheryte )
scriptId = 0x50001; scriptId = EVENTSCRIPT_AETHERNET_ID;
} }
auto script = m_nativeScriptHandler->getQuestScript( scriptId ); auto script = m_nativeScriptHandler->getQuestScript( scriptId );