summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-05-12 16:47:12 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-05-12 16:47:12 +0000
commitcd40a623549f42d77c54515360813131e6c9c33d (patch)
tree09afde7308a84efae2982546f73d7231d2e355b0 /src/map/atcommand.c
parent0c5e8296319a3f1396e0208fba16135ac2c7b4b0 (diff)
downloadhercules-cd40a623549f42d77c54515360813131e6c9c33d.tar.gz
hercules-cd40a623549f42d77c54515360813131e6c9c33d.tar.bz2
hercules-cd40a623549f42d77c54515360813131e6c9c33d.tar.xz
hercules-cd40a623549f42d77c54515360813131e6c9c33d.zip
- Rental items now can be stackable items too.
- Added @font command to test kRO fonts. (Client side requires : Langtype 0 / Hex + Fonts Files on the data folder). - Rental now announces with a maximum time to fix a problem with 1 month or more rentals. - Reduced amount of calculations of Flee on map change (only if required). - More security on Rental items. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13761 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c80
1 files changed, 58 insertions, 22 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 61557fd51..9019fd86a 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -8586,6 +8586,42 @@ int atcommand_delitem(const int fd, struct map_session_data* sd, const char* com
return 0;
}
+/*==========================================
+ * Custom Fonts
+ *------------------------------------------*/
+int atcommand_font(const int fd, struct map_session_data *sd, const char *command, const char *message)
+{
+ int font_id;
+ nullpo_retr(-1,sd);
+
+ font_id = atoi(message);
+ if( font_id == 0 )
+ {
+ if( sd->state.user_font )
+ {
+ sd->state.user_font = 0;
+ clif_displaymessage(fd, "Returning to normal font.");
+ clif_font_area(sd);
+ }
+ else
+ {
+ clif_displaymessage(fd, "Use @font <1..9> to change your messages font.");
+ clif_displaymessage(fd, "Use 0 or no parameter to back to normal font.");
+ }
+ }
+ else if( font_id < 0 || font_id > 9 )
+ clif_displaymessage(fd, "Invalid font. Use a Value from 0 to 9.");
+ else if( font_id != sd->state.user_font )
+ {
+ sd->state.user_font = font_id;
+ clif_font_area(sd);
+ clif_displaymessage(fd, "Font changed.");
+ }
+ else
+ clif_displaymessage(fd, "Already using this font.");
+
+ return 0;
+}
/*==========================================
@@ -8890,6 +8926,7 @@ AtCommandInfo atcommand_info[] = {
{ "stats", 40,40, atcommand_stats },
{ "delitem", 60,60, atcommand_delitem },
{ "charcommands", 1,1, atcommand_commands },
+ { "font", 1,1, atcommand_font },
};
@@ -9147,36 +9184,35 @@ int atcommand_commands(const int fd, struct map_session_data* sd, const char* co
clif_displaymessage(fd, msg_txt(273)); // "Commands available:"
- for( i = 0; i < ARRAYLENGTH(atcommand_info); i++ )
- {
- unsigned int slen;
+ for( i = 0; i < ARRAYLENGTH(atcommand_info); i++ )
+ {
+ unsigned int slen;
- if( gm_lvl < atcommand_info[i].level && stristr(command,"commands") )
- continue;
- if( gm_lvl < atcommand_info[i].level2 && stristr(command,"charcommands") )
- continue;
+ if( gm_lvl < atcommand_info[i].level && stristr(command,"commands") )
+ continue;
+ if( gm_lvl < atcommand_info[i].level2 && stristr(command,"charcommands") )
+ continue;
- slen = (unsigned int)strlen(atcommand_info[i].command);
+ slen = (unsigned int)strlen(atcommand_info[i].command);
- // flush the text buffer if this command won't fit into it
- if( slen + cur - line_buff >= CHATBOX_SIZE )
- {
- clif_displaymessage(fd,line_buff);
- cur = line_buff;
- memset(line_buff,' ',CHATBOX_SIZE);
- line_buff[CHATBOX_SIZE-1] = 0;
- }
+ // flush the text buffer if this command won't fit into it
+ if( slen + cur - line_buff >= CHATBOX_SIZE )
+ {
+ clif_displaymessage(fd,line_buff);
+ cur = line_buff;
+ memset(line_buff,' ',CHATBOX_SIZE);
+ line_buff[CHATBOX_SIZE-1] = 0;
+ }
- memcpy(cur,atcommand_info[i].command,slen);
- cur += slen+(10-slen%10);
+ memcpy(cur,atcommand_info[i].command,slen);
+ cur += slen+(10-slen%10);
- count++;
- }
-
+ count++;
+ }
clif_displaymessage(fd,line_buff);
sprintf(atcmd_output, msg_txt(274), count); // "%d commands found."
clif_displaymessage(fd, atcmd_output);
-
+
return 0;
}