summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorcodemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-09 23:08:31 +0000
committercodemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-09 23:08:31 +0000
commitac2c5e7b2d74728563371ed204d84369ba743ac6 (patch)
treeca45490464ad49ed7baa5c4d6dfae1c47ab96bf9 /src/map/atcommand.c
parent1e105f9c7dc51778b43fc11444372f9f68af620a (diff)
downloadhercules-ac2c5e7b2d74728563371ed204d84369ba743ac6.tar.gz
hercules-ac2c5e7b2d74728563371ed204d84369ba743ac6.tar.bz2
hercules-ac2c5e7b2d74728563371ed204d84369ba743ac6.tar.xz
hercules-ac2c5e7b2d74728563371ed204d84369ba743ac6.zip
* Added the @sound command and the NPC command of soundeffectall - works just like soundeffect, but plays for everyone in the area [Codemaster] [SVN 942]
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@942 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 7a40bb4ed..97ba82a31 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -247,6 +247,7 @@ ACMD_FUNC(killid); // by Dino9021
ACMD_FUNC(killid2); // by Dino9021
ACMD_FUNC(charkillableid); // by Dino9021
ACMD_FUNC(charkillableid2); // by Dino9021
+ACMD_FUNC(sound);
/*==========================================
*AtCommandInfo atcommand_info[]構造体の定義
@@ -516,6 +517,7 @@ static AtCommandInfo atcommand_info[] = {
{ AtCommand_KillId2, "@killid2", 60, atcommand_killid2 }, // [Dino9021]
{ AtCommand_CharKillableId, "@charkillableid", 40, atcommand_charkillableid }, // [Dino9021]
{ AtCommand_CharKillableId2, "@charkillableid2", 40, atcommand_charkillableid2 }, // [Dino9021]
+ { AtCommand_Sound, "@sound", 40, atcommand_sound },
// add new commands before this line
{ AtCommand_Unknown, NULL, 1, NULL }
@@ -7557,6 +7559,31 @@ atcommand_clearweather(
return 0;
}
+/*===============================================================
+ * Sound Command - plays a sound for everyone! [Codemaster]
+ *---------------------------------------------------------------
+ */
+int
+atcommand_sound(
+ const int fd, struct map_session_data *sd,
+ const char *command, const char *message)
+{
+ char sound_file[100];
+
+ if(!message || !*message || sscanf(message, "%99[^\n]", sound_file) < 1) {
+ clif_displaymessage(fd, "Please, enter a sound filename. (usage: @sound <filename>)");
+ return -1;
+ }
+
+ memset(sound_file, '\0', sizeof(sound_file));
+ if(sscanf(message, "%99[^\n]", sound_file) < 1)
+ return -1;
+
+ clif_soundeffectall(&sd->bl, sound_file,0);
+
+ return 0;
+}
+
/*==========================================
* MOB Search
*------------------------------------------