Significant Stronghold of Security immersion improvements

Added the command ::jingle to play music jingles by id
This commit is contained in:
Zerken
2023-03-08 03:28:10 +00:00
committed by Ryan
parent ff18f69dd0
commit 55c619bf87
5 changed files with 142 additions and 53 deletions
@@ -1,12 +1,11 @@
package core.game.system.command.sets
import core.game.node.entity.player.link.music.MusicEntry
import core.game.system.command.Privilege
import core.net.packet.PacketRepository
import core.net.packet.context.MusicContext
import core.net.packet.out.MusicPacket
import core.plugin.Initializable
import core.game.system.command.Command
import core.game.system.command.Privilege
@Initializable
class MusicCommandSet : CommandSet(Privilege.STANDARD){
@@ -26,6 +25,20 @@ class MusicCommandSet : CommandSet(Privilege.STANDARD){
player.musicPlayer.play(MusicEntry.forId(id!!))
notify(player,"Now playing song $id")
}
/**
* Command that lets you play a specific jingle
*/
define("playjingle"){player,args ->
if(args.size < 2){
reject(player,"Usage: ::playjingle jingleID")
}
val id = args[1].toIntOrNull()
if(id == null){
reject(player,"Please use a valid integer for the jingle id.")
}
PacketRepository.send(MusicPacket::class.java, MusicContext(player, id!!, true))
notify(player,"Now playing jingle $id")
}
/**
* Command that lets you play a song via the ID instead of the song name