diff options
author | brianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-08-31 01:44:18 +0000 |
---|---|---|
committer | brianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-08-31 01:44:18 +0000 |
commit | f18a667f920daad8874232929c3f7b4680f33276 (patch) | |
tree | 26d362aa0db6f1959baf4a225a822b4f06493003 /src/map/atcommand.c | |
parent | 54205b1071d55bdd6fef570b6880e3b1970be50d (diff) | |
download | hercules-f18a667f920daad8874232929c3f7b4680f33276.tar.gz hercules-f18a667f920daad8874232929c3f7b4680f33276.tar.bz2 hercules-f18a667f920daad8874232929c3f7b4680f33276.tar.xz hercules-f18a667f920daad8874232929c3f7b4680f33276.zip |
- Fixed @item so it only displays message "Item created" on success.
- Changed @raisemap to also function as "@healmap".
- Changed txt_time() to omit days/hours/seconds if there are none.
- Also applied the 'min_chat_delay' to @main, @pettalk and @homtalk.
- Fixed a warning in skill.c (bugreport:6593)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16722 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 46 |
1 files changed, 33 insertions, 13 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 59222a7d5..f94415607 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -1433,7 +1433,8 @@ ACMD_FUNC(item) } } - clif_displaymessage(fd, msg_txt(18)); // Item created. + if (flag == 0) + clif_displaymessage(fd, msg_txt(18)); // Item created. return 0; } @@ -1504,7 +1505,8 @@ ACMD_FUNC(item2) clif_additem(sd, 0, 0, flag); } - clif_displaymessage(fd, msg_txt(18)); // Item created. + if (flag == 0) + clif_displaymessage(fd, msg_txt(18)); // Item created. } else { clif_displaymessage(fd, msg_txt(19)); // Invalid item ID or name. return -1; @@ -3264,11 +3266,11 @@ ACMD_FUNC(doommap) *------------------------------------------*/ static void atcommand_raise_sub(struct map_session_data* sd) { - if (!status_isdead(&sd->bl)) - return; - - if(!status_revive(&sd->bl, 100, 100)) - return; + if(pc_isdead(sd)) + status_revive(&sd->bl, 100, 100); + else + status_percent_heal(&sd->bl, 100, 100); + clif_skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1); clif_displaymessage(sd->fd, msg_txt(63)); // Mercy has been shown. } @@ -4602,21 +4604,21 @@ char* txt_time(unsigned int duration) minutes = duration / 60; seconds = duration - (60 * minutes); - if (days < 2) + if (days == 1) sprintf(temp, msg_txt(219), days); // %d day - else + else if (days > 1) sprintf(temp, msg_txt(220), days); // %d days - if (hours < 2) + if (hours == 1) sprintf(temp1, msg_txt(221), temp, hours); // %s %d hour - else + else if (hours > 1) sprintf(temp1, msg_txt(222), temp, hours); // %s %d hours if (minutes < 2) sprintf(temp, msg_txt(223), temp1, minutes); // %s %d minute else sprintf(temp, msg_txt(224), temp1, minutes); // %s %d minutes - if (seconds < 2) + if (seconds == 1) sprintf(temp1, msg_txt(225), temp, seconds); // %s and %d second - else + else if (seconds > 1) sprintf(temp1, msg_txt(226), temp, seconds); // %s and %d seconds return temp1; @@ -6326,6 +6328,12 @@ ACMD_FUNC(pettalk) nullpo_retr(-1, sd); + if ( battle_config.min_chat_delay ) { + if( DIFF_TICK(sd->cantalk_tick, gettick()) > 0 ) + return 0; + sd->cantalk_tick = gettick() + battle_config.min_chat_delay; + } + if(!sd->status.pet_id || !(pd=sd->pd)) { clif_displaymessage(fd, msg_txt(184)); @@ -7088,6 +7096,12 @@ ACMD_FUNC(homtalk) nullpo_retr(-1, sd); + if ( battle_config.min_chat_delay ) { + if( DIFF_TICK(sd->cantalk_tick, gettick()) > 0 ) + return 0; + sd->cantalk_tick = gettick() + battle_config.min_chat_delay; + } + if (sd->sc.count && //no "chatting" while muted. (sd->sc.data[SC_BERSERK] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT))) @@ -8084,6 +8098,12 @@ ACMD_FUNC(main) return -1; } + if ( battle_config.min_chat_delay ) { + if( DIFF_TICK(sd->cantalk_tick, gettick()) > 0 ) + return 0; + sd->cantalk_tick = gettick() + battle_config.min_chat_delay; + } + // send the message using inter-server system intif_main_message( sd, message ); } |