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:
parent
69d618f1d0
commit
fc0fb276b9
4 changed files with 8 additions and 4 deletions
|
@ -12,7 +12,7 @@
|
|||
class Aethernet : public QuestScript
|
||||
{
|
||||
public:
|
||||
Aethernet() : QuestScript( "Aethernet", 0x50001 )
|
||||
Aethernet() : QuestScript( "Aethernet", EVENTSCRIPT_AETHERNET_ID )
|
||||
{}
|
||||
|
||||
virtual void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId )
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
class Aetheryte : public QuestScript
|
||||
{
|
||||
public:
|
||||
Aetheryte() : QuestScript( "Aetheryte", 0x50000 )
|
||||
Aetheryte() : QuestScript( "Aetheryte", EVENTSCRIPT_AETHERYTE_ID )
|
||||
{}
|
||||
|
||||
virtual void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId )
|
||||
|
|
|
@ -18,6 +18,10 @@ extern "C" EXPORT ScriptObject* getScript() \
|
|||
|
||||
using namespace Core;
|
||||
|
||||
// constant script ids for certain events
|
||||
#define EVENTSCRIPT_AETHERYTE_ID 0x50000
|
||||
#define EVENTSCRIPT_AETHERNET_ID 0x50001
|
||||
|
||||
enum ScriptType
|
||||
{
|
||||
StatusEffect,
|
||||
|
|
|
@ -119,9 +119,9 @@ bool Core::Scripting::ScriptManager::onTalk( Entity::Player& player, uint64_t ac
|
|||
if( eventType == Common::EventType::Aetheryte )
|
||||
{
|
||||
auto aetherInfo = g_exdData.getAetheryteInfo( eventId & 0xFFFF );
|
||||
scriptId = 0x50000;
|
||||
scriptId = EVENTSCRIPT_AETHERYTE_ID;
|
||||
if( !aetherInfo->isAetheryte )
|
||||
scriptId = 0x50001;
|
||||
scriptId = EVENTSCRIPT_AETHERNET_ID;
|
||||
}
|
||||
|
||||
auto script = m_nativeScriptHandler->getQuestScript( scriptId );
|
||||
|
|
Loading…
Add table
Reference in a new issue