mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-02 08:57:44 +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:
commit
cd353eaa0b
3 changed files with 20 additions and 4 deletions
|
@ -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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ private:
|
||||||
|
|
||||||
void shopCallback( Entity::Player& player, const Event::SceneResult& result )
|
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 ) );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ namespace Sapphire::Entity
|
||||||
/*! play a subevent */
|
/*! play a subevent */
|
||||||
void playScene( uint32_t eventId, uint32_t scene, uint32_t flags, uint32_t eventParam2, uint32_t eventParam3 );
|
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 );
|
Event::EventHandler::SceneReturnCallback eventCallback );
|
||||||
|
|
||||||
void directorPlayScene( uint32_t eventId, uint32_t scene, uint32_t flags, uint32_t eventParam3,
|
void directorPlayScene( uint32_t eventId, uint32_t scene, uint32_t flags, uint32_t eventParam3,
|
||||||
|
|
|
@ -130,7 +130,7 @@ void Sapphire::Entity::Player::playScene( uint32_t eventId, uint32_t scene,
|
||||||
playScene( eventId, scene, flags, eventParam2, eventParam3, 0, eventCallback );
|
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 )
|
Event::EventHandler::SceneReturnCallback eventCallback )
|
||||||
{
|
{
|
||||||
auto pEvent = bootstrapSceneEvent( eventId, flags );
|
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().eventId = eventId;
|
||||||
openGilShopPacket->data().sceneFlags = flags;
|
openGilShopPacket->data().sceneFlags = flags;
|
||||||
openGilShopPacket->data().actorId = getId();
|
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;
|
openGilShopPacket->data().scene = 10;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue