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
|
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 )
|
||||||
|
|
|
@ -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 )
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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 );
|
||||||
|
|
Loading…
Add table
Reference in a new issue