mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-29 07:37:45 +00:00
add aetheryte functionality back
This commit is contained in:
parent
1afefc3d79
commit
f2a7745dcd
2 changed files with 63 additions and 6 deletions
|
@ -19,20 +19,20 @@ public:
|
||||||
{
|
{
|
||||||
if( player.isAetheryteRegistered( eventId & 0xFFFF ) )
|
if( player.isAetheryteRegistered( eventId & 0xFFFF ) )
|
||||||
{
|
{
|
||||||
player.eventPlay( eventId, 2, 0, []( Entity::Player& ply, uint32_t evntId, uint16_t p1, uint16_t p2, uint16_t p3 )
|
player.eventPlay( eventId, 2, 0, []( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
|
||||||
{
|
{
|
||||||
if( p1 == 256 )
|
if( param1 == 256 )
|
||||||
{
|
{
|
||||||
ply.teleport( p2, 2 );
|
player.teleport( param2, 2 );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
player.eventActionStart( eventId, ACTION_ATTUNE, []( Entity::Player& ply, uint32_t evntId, uint64_t additional )
|
player.eventActionStart( eventId, ACTION_ATTUNE, []( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
{
|
{
|
||||||
ply.registerAetheryte( evntId & 0xFFFF );
|
player.registerAetheryte( eventId & 0xFFFF );
|
||||||
ply.eventPlay( evntId, 3, 0, 0, 0 );
|
player.eventPlay( eventId, 3, 0, 0, 0 );
|
||||||
},
|
},
|
||||||
[] ( Entity::Player& ply, uint32_t evntId, uint64_t additional )
|
[] ( Entity::Player& ply, uint32_t evntId, uint64_t additional )
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,12 +1,69 @@
|
||||||
#include "../ScriptObject.h"
|
#include "../ScriptObject.h"
|
||||||
|
|
||||||
|
#define ACTION_ATTUNE 0x13
|
||||||
|
#define ACTION_TELEPORT 0x4
|
||||||
|
|
||||||
|
#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 Aetheryte : public QuestScript
|
class Aetheryte : public QuestScript
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Aetheryte() : QuestScript( "Aetheryte", 0x50000 )
|
Aetheryte() : QuestScript( "Aetheryte", 0x50000 )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
virtual void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId )
|
||||||
|
{
|
||||||
|
if( player.isAetheryteRegistered( eventId & 0xFFFF ) )
|
||||||
|
{
|
||||||
|
player.eventPlay( eventId, 0, 1, []( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
|
||||||
|
{
|
||||||
|
if( param1 == 256 ) // set homepoint
|
||||||
|
{
|
||||||
|
player.setHomepoint( eventId & 0xFFFF );
|
||||||
|
player.sendQuestMessage( eventId, 2, 0xEA, 0, 0 );
|
||||||
|
}
|
||||||
|
else if( param1 == 512 ) // aethernet access
|
||||||
|
{
|
||||||
|
if( param2 == 2 ) // register favored destination
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else if( param2 == 0xC3E1 ) // register free destination
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else if( param2 == 4 )
|
||||||
|
{
|
||||||
|
player.teleport( param3, 2 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player.eventActionStart( eventId, ACTION_ATTUNE, []( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{
|
||||||
|
player.registerAetheryte( eventId & 0xFFFF );
|
||||||
|
|
||||||
|
if( player.isActionLearned( ACTION_TELEPORT ) )
|
||||||
|
{
|
||||||
|
player.sendQuestMessage( eventId, 0, 2, 0, 0 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player.sendQuestMessage( eventId, 0, 1, 1, 0 );
|
||||||
|
player.learnAction( ACTION_TELEPORT );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[] ( Entity::Player& ply, uint32_t evntId, uint64_t additional )
|
||||||
|
{}, 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
EXPORT_SCRIPTOBJECT( Aetheryte )
|
EXPORT_SCRIPTOBJECT( Aetheryte )
|
Loading…
Add table
Reference in a new issue