mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 06:47:45 +00:00
commit
df0f5a26d1
3 changed files with 43 additions and 0 deletions
42
src/servers/Scripts/common/aethernet/HousingAethernet.cpp
Normal file
42
src/servers/Scripts/common/aethernet/HousingAethernet.cpp
Normal file
|
@ -0,0 +1,42 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Actor/Player.h>
|
||||
|
||||
#include <Framework.h>
|
||||
#include <Exd/ExdDataGenerated.h>
|
||||
#include <Zone/Zone.h>
|
||||
|
||||
using namespace Core;
|
||||
|
||||
class HousingAethernet :
|
||||
public Sapphire::ScriptAPI::EventScript
|
||||
{
|
||||
public:
|
||||
HousingAethernet() :
|
||||
Sapphire::ScriptAPI::EventScript( 0x001E0000 )
|
||||
{
|
||||
}
|
||||
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
player.playScene( eventId, 0, HIDE_HOTBAR | NO_DEFAULT_CAMERA, [this, eventId]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
auto pExdData = getFramework()->get< Core::Data::ExdDataGenerated >();
|
||||
if( !pExdData )
|
||||
return;
|
||||
|
||||
auto housingAethernetIds = pExdData->getHousingAethernetIdList();
|
||||
auto terrritoryTypeId = player.getCurrentZone()->getTerritoryTypeId();
|
||||
|
||||
// param2 is the index starting from 0 inside housingaethernet.exd, but the ID column starts at 0x001E0000........ wtf
|
||||
auto pHousingAethernet = pExdData->get< Core::Data::HousingAethernet >( getId() + result.param2 );
|
||||
if( !pHousingAethernet )
|
||||
return;
|
||||
|
||||
// check we're teleporting to the same territorytype
|
||||
if( player.getCurrentZone()->getTerritoryTypeId() != pHousingAethernet->territoryType )
|
||||
return;
|
||||
|
||||
player.sendDebug( "got level entry: " + std::to_string( pHousingAethernet->level ) );
|
||||
} );
|
||||
}
|
||||
};
|
|
@ -69,6 +69,7 @@ namespace Core::Event
|
|||
Story = 0x001A,
|
||||
SpecialShop = 0x001B,
|
||||
BahamutGuide = 0x001C,
|
||||
HousingAethernet = 0x001E,
|
||||
FcTalk = 0x001F,
|
||||
ICDirector = 0x8003,
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue