| 2778 | } |
| 2779 | |
| 2780 | void Creature::fireCreatureSound(CreatureSound sound) |
| 2781 | { |
| 2782 | Tile* posTile = getPositionTile(); |
| 2783 | if(posTile == nullptr) |
| 2784 | return; |
| 2785 | |
| 2786 | std::string soundFamily; |
| 2787 | switch(sound) |
| 2788 | { |
| 2789 | case CreatureSound::Pickup: |
| 2790 | soundFamily = getDefinition()->getSoundFamilyPickup(); |
| 2791 | break; |
| 2792 | case CreatureSound::Drop: |
| 2793 | soundFamily = getDefinition()->getSoundFamilyDrop(); |
| 2794 | break; |
| 2795 | case CreatureSound::Attack: |
| 2796 | soundFamily = getDefinition()->getSoundFamilyAttack(); |
| 2797 | break; |
| 2798 | case CreatureSound::Die: |
| 2799 | soundFamily = getDefinition()->getSoundFamilyDie(); |
| 2800 | break; |
| 2801 | case CreatureSound::Slap: |
| 2802 | soundFamily = getDefinition()->getSoundFamilySlap(); |
| 2803 | break; |
| 2804 | case CreatureSound::Dig: |
| 2805 | soundFamily = "Default/Dig"; |
| 2806 | break; |
| 2807 | default: |
| 2808 | OD_LOG_ERR("Wrong CreatureSound value=" + Helper::toString(static_cast<uint32_t>(sound))); |
| 2809 | return; |
| 2810 | } |
| 2811 | |
| 2812 | std::string soundComplete = "Creatures/" + soundFamily; |
| 2813 | for(Seat* seat : mSeatsWithVisionNotified) |
| 2814 | { |
| 2815 | if(seat->getPlayer() == nullptr) |
| 2816 | continue; |
| 2817 | if(!seat->getPlayer()->getIsHuman()) |
| 2818 | continue; |
| 2819 | |
| 2820 | ServerNotification *serverNotification = new ServerNotification( |
| 2821 | ServerNotificationType::playSpatialSound, seat->getPlayer()); |
| 2822 | serverNotification->mPacket << soundComplete << posTile->getX() << posTile->getY(); |
| 2823 | ODServer::getSingleton().queueServerNotification(serverNotification); |
| 2824 | } |
| 2825 | } |
| 2826 | |
| 2827 | void Creature::itsPayDay() |
| 2828 | { |
no test coverage detected