2018-01-28 11:16:34 +01:00
|
|
|
#include "../ScriptObject.h"
|
2017-12-12 17:29:31 +11:00
|
|
|
|
|
|
|
#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
|
|
|
|
|
2017-12-13 22:19:00 +11:00
|
|
|
class Aethernet : public EventScript
|
2017-12-12 17:29:31 +11:00
|
|
|
{
|
|
|
|
public:
|
2018-01-19 20:17:49 +11:00
|
|
|
Aethernet() : EventScript( EVENTSCRIPT_AETHERNET_ID )
|
2017-12-12 17:29:31 +11:00
|
|
|
{}
|
|
|
|
|
2017-12-13 22:19:00 +11:00
|
|
|
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
2017-12-12 17:29:31 +11:00
|
|
|
{
|
|
|
|
if( player.isAetheryteRegistered( eventId & 0xFFFF ) )
|
|
|
|
{
|
2017-12-12 18:03:06 +11:00
|
|
|
player.eventPlay( eventId, 2, 0, []( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
|
2017-12-12 17:29:31 +11:00
|
|
|
{
|
2017-12-12 18:03:06 +11:00
|
|
|
if( param1 == 256 )
|
2017-12-12 17:29:31 +11:00
|
|
|
{
|
2017-12-12 18:03:06 +11:00
|
|
|
player.teleport( param2, 2 );
|
2017-12-12 17:29:31 +11:00
|
|
|
}
|
|
|
|
} );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-12-12 18:03:06 +11:00
|
|
|
player.eventActionStart( eventId, ACTION_ATTUNE, []( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
2017-12-12 17:29:31 +11:00
|
|
|
{
|
2017-12-12 18:03:06 +11:00
|
|
|
player.registerAetheryte( eventId & 0xFFFF );
|
|
|
|
player.eventPlay( eventId, 3, 0, 0, 0 );
|
2017-12-12 17:29:31 +11:00
|
|
|
},
|
|
|
|
[] ( Entity::Player& ply, uint32_t evntId, uint64_t additional )
|
|
|
|
{
|
|
|
|
|
|
|
|
}, 0 );
|
|
|
|
|
|
|
|
player.unlock();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2017-12-27 18:47:51 +11:00
|
|
|
};
|