1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-02 00:47:45 +00:00

Merge pull request #624 from collett8192/money_sound_effect

Play the coin sound effect when buying items from shop.
This commit is contained in:
Adam 2020-01-09 12:00:49 +11:00 committed by GitHub
commit cd353eaa0b
3 changed files with 20 additions and 4 deletions

View file

@ -43,7 +43,7 @@ private:
}
player.playGilShop( result.eventId, SCENE_FLAGS, std::bind( &GilShop::shopInteractionCallback, this, std::placeholders::_1, std::placeholders::_2 ) );
player.playGilShop( result.eventId, SCENE_FLAGS, result.param2, std::bind( &GilShop::shopInteractionCallback, this, std::placeholders::_1, std::placeholders::_2 ) );
return;
}
@ -53,7 +53,7 @@ private:
void shopCallback( Entity::Player& player, const Event::SceneResult& result )
{
player.playGilShop( result.eventId, SCENE_FLAGS, std::bind( &GilShop::shopInteractionCallback, this, std::placeholders::_1, std::placeholders::_2 ) );
player.playGilShop( result.eventId, SCENE_FLAGS, 0, std::bind( &GilShop::shopInteractionCallback, this, std::placeholders::_1, std::placeholders::_2 ) );
}
};

View file

@ -67,7 +67,7 @@ namespace Sapphire::Entity
/*! play a subevent */
void playScene( uint32_t eventId, uint32_t scene, uint32_t flags, uint32_t eventParam2, uint32_t eventParam3 );
void playGilShop( uint32_t eventId, uint32_t flags,
void playGilShop( uint32_t eventId, uint32_t flags, uint32_t param1,
Event::EventHandler::SceneReturnCallback eventCallback );
void directorPlayScene( uint32_t eventId, uint32_t scene, uint32_t flags, uint32_t eventParam3,

View file

@ -130,7 +130,7 @@ void Sapphire::Entity::Player::playScene( uint32_t eventId, uint32_t scene,
playScene( eventId, scene, flags, eventParam2, eventParam3, 0, eventCallback );
}
void Sapphire::Entity::Player::playGilShop( uint32_t eventId, uint32_t flags,
void Sapphire::Entity::Player::playGilShop( uint32_t eventId, uint32_t flags, uint32_t param1,
Event::EventHandler::SceneReturnCallback eventCallback )
{
auto pEvent = bootstrapSceneEvent( eventId, flags );
@ -145,6 +145,22 @@ void Sapphire::Entity::Player::playGilShop( uint32_t eventId, uint32_t flags,
openGilShopPacket->data().eventId = eventId;
openGilShopPacket->data().sceneFlags = flags;
openGilShopPacket->data().actorId = getId();
switch( param1 )
{
case 1:
{
openGilShopPacket->data().params[ 0 ] = 0x02;
openGilShopPacket->data().params[ 1 ] = 1;
openGilShopPacket->data().params[ 2 ] = 0x64;
break;
}
case 2:
{
openGilShopPacket->data().params[ 0 ] = 0xA2;
openGilShopPacket->data().params[ 1 ] = 2;
break;
}
}
openGilShopPacket->data().scene = 10;