diff options
author | codemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-01-11 03:32:32 +0000 |
---|---|---|
committer | codemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-01-11 03:32:32 +0000 |
commit | 2d2b351c74561d820e01cea29d972bc3a8312c1e (patch) | |
tree | 6c800744aed42025d91864ff39eb00483a6e9900 /src/map/atcommand.c | |
parent | b1bdfe1d1d7da8f16991117b9743bce506aea7b5 (diff) | |
download | hercules-2d2b351c74561d820e01cea29d972bc3a8312c1e.tar.gz hercules-2d2b351c74561d820e01cea29d972bc3a8312c1e.tar.bz2 hercules-2d2b351c74561d820e01cea29d972bc3a8312c1e.tar.xz hercules-2d2b351c74561d820e01cea29d972bc3a8312c1e.zip |
* Added a fix to @sound where if you forgot the .wav exention, i'd attempt to play the file without it (it adds the .wav) [Codemaster] [SVN 949]
* Added @disguiseall / @undisguiseall [Codemaster] [SVN 949]
* Added misc. clif.c fixes (jAthena added alot of close(fd)'s, so i added them, too) [Codemaster] [SVN 949]
* Added bug reports - Celest, you might want to check one of those out [Codemaster] [SVN 949]
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@949 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 77 |
1 files changed, 76 insertions, 1 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 97ba82a31..4b245fd0b 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -217,7 +217,7 @@ ACMD_FUNC(readmail); // [Valaris] ACMD_FUNC(sendmail); // [Valaris] ACMD_FUNC(sendprioritymail); // [Valaris] ACMD_FUNC(deletemail); // [Valaris] -ACMD_FUNC(sound); // [Valaris] +//ACMD_FUNC(sound); // [Valaris] ACMD_FUNC(refreshonline); // [Valaris] #endif /* TXT_ONLY */ @@ -248,6 +248,8 @@ ACMD_FUNC(killid2); // by Dino9021 ACMD_FUNC(charkillableid); // by Dino9021 ACMD_FUNC(charkillableid2); // by Dino9021 ACMD_FUNC(sound); +ACMD_FUNC(undisguiseall); +ACMD_FUNC(disguiseall); /*========================================== *AtCommandInfo atcommand_info[]構造体の定義 @@ -518,6 +520,8 @@ static AtCommandInfo atcommand_info[] = { { AtCommand_CharKillableId, "@charkillableid", 40, atcommand_charkillableid }, // [Dino9021] { AtCommand_CharKillableId2, "@charkillableid2", 40, atcommand_charkillableid2 }, // [Dino9021] { AtCommand_Sound, "@sound", 40, atcommand_sound }, + { AtCommand_UndisguiseAll, "@undisguiseall", 99, atcommand_undisguiseall }, + { AtCommand_DisguiseAll, "@disguiseall", 99, atcommand_disguiseall }, // add new commands before this line { AtCommand_Unknown, NULL, 1, NULL } @@ -6453,6 +6457,50 @@ int atcommand_disguise( } /*========================================== + * DisguiseAll + *------------------------------------------ + */ + +int atcommand_disguiseall( + const int fd, struct map_session_data* sd, + const char* command, const char* message) +{ + int mob_id=0, i=0; + struct map_session_data *pl_sd; + nullpo_retr(-1, sd); + + if (!message || !*message) { + clif_displaymessage(fd, "Please, enter a Monster/NPC name/id (usage: @disguiseall <monster_name_or_monster_ID>)."); + return -1; + } + + if ((mob_id = mobdb_searchname(message)) == 0) // check name first (to avoid possible name begining by a number) + mob_id = atoi(message); + + if ((mob_id >= 46 && mob_id <= 125) || (mob_id >= 700 && mob_id <= 718) || // NPC + (mob_id >= 721 && mob_id <= 755) || (mob_id >= 757 && mob_id <= 811) || // NPC + (mob_id >= 813 && mob_id <= 834) || // NPC + (mob_id > 1000 && mob_id < 1582)) { // monsters + for(i=0; i < fd_max; i++) { + if(session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) { + if(pc_isriding(pl_sd)) { // temporary prevention of crash caused by peco + disguise, will look into a better solution [Valaris] + clif_displaymessage(fd, msg_table[227]); // Cannot wear disguise while riding a Peco. + } else { + pl_sd->disguiseflag = 1; // set to override items with disguise script [Valaris] + pl_sd->disguise = mob_id; + pc_setpos(pl_sd, pl_sd->mapname, pl_sd->bl.x, pl_sd->bl.y, 3); + } + } + } + clif_displaymessage(fd, msg_table[122]); // Disguise applied. + } else { + return -1; + } + + return 0; +} + +/*========================================== * @undisguise by [Yor] *------------------------------------------ */ @@ -6475,6 +6523,30 @@ int atcommand_undisguise( } /*========================================== + * UndisguiseAll + *------------------------------------------ + */ +int atcommand_undisguiseall( + const int fd, struct map_session_data* sd, + const char* command, const char* message) +{ + struct map_session_data *pl_sd; + int i; + nullpo_retr(-1, sd); + + for(i=0; i < fd_max; i++) { + if(session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && pl_sd->disguise) { + clif_clearchar(&pl_sd->bl, 9); + pl_sd->disguise = 0; + pc_setpos(pl_sd, pl_sd->mapname, pl_sd->bl.x, pl_sd->bl.y, 3); + } + } + clif_displaymessage(fd, msg_table[124]); // Undisguise applied. + + return 0; +} + +/*========================================== * @broadcast by [Valaris] *------------------------------------------ */ @@ -7579,6 +7651,9 @@ atcommand_sound( if(sscanf(message, "%99[^\n]", sound_file) < 1) return -1; + if(strstr(sound_file, ".wav") == NULL) + strcat(sound_file, ".wav"); + clif_soundeffectall(&sd->bl, sound_file,0); return 0; |