1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-29 07:37:45 +00:00
sapphire/src/servers/Scripts/common/Aethernet.cpp

51 lines
1.4 KiB
C++
Raw Normal View History

2018-06-18 13:14:11 +00:00
#include <ScriptObject.h>
2018-03-07 08:14:42 +01:00
#include <Actor/Player.h>
#define ACTION_ATTUNE 0x13
#define AetheryteBaseId 0x50000
#define AETHERYTE_MENU_AETHERNET 1
#define AETHERYTE_MENU_HOUSING 2
#define AETHERYTE_MENU_HOME_POINT 3
#define AETHERYTE_MENU_FAVORITE_POINT 4
#define AETHERYTE_MENU_FAVORITE_POINT_SECURITY_TOKEN 5
class Aethernet :
public EventScript
2018-03-07 08:14:42 +01:00
{
public:
Aethernet() :
EventScript( EVENTSCRIPT_AETHERNET_ID )
{
}
2018-03-07 08:14:42 +01:00
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{
if( player.isAetheryteRegistered( eventId & 0xFFFF ) )
{
player.playScene( eventId, 2, 0, []( Entity::Player& player, const Event::SceneResult& result )
2018-03-07 08:14:42 +01:00
{
if( result.param1 == 256 )
{
player.teleport( result.param2, 2 );
}
} );
}
else
{
player.eventActionStart( eventId, ACTION_ATTUNE,
[]( Entity::Player& player, uint32_t eventId, uint64_t additional )
{
player.registerAetheryte( eventId & 0xFFFF );
player.playScene( eventId, 3, 0, 0, 0 );
},
[]( Entity::Player& ply, uint32_t evntId, uint64_t additional )
{
2018-03-07 08:14:42 +01:00
}, 0 );
2018-03-07 08:14:42 +01:00
}
2018-03-07 08:14:42 +01:00
}
2018-03-07 08:14:42 +01:00
};