From bd62cbc13d98a977008f42ea6583a33c99516c6b Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 6 Sep 2012 19:46:25 +0000 Subject: Added @cart as per discussion in tid:70389 (mostly greatly helpful for debugging), after some developer discussion we've decided to make @newmount a permanent command, we however decided to rename it so that if newer mounts are available it doesn't confuse anyone: @mount2. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16749 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/atcommand.c | 50 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 6 deletions(-) (limited to 'src/map') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 4227013f5..cceb3093e 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -8559,8 +8559,8 @@ ACMD_FUNC(charcommands) atcommand_commands_sub(sd, fd, COMMAND_CHARCOMMAND); return 0; } - -ACMD_FUNC(new_mount) { +/* for new mounts */ +ACMD_FUNC(mount2) { clif_displaymessage(sd->fd,msg_txt(1362)); // NOTICE: If you crash with mount your LUA is outdated. if( !(sd->sc.option&OPTION_MOUNTING) ) { @@ -8779,6 +8779,46 @@ ACMD_FUNC(unloadnpcfile) { } return 0; } +ACMD_FUNC(cart) { +#define MC_CART_MDFY(x) \ + sd->status.skill[MC_PUSHCART].id = x?MC_PUSHCART:0; \ + sd->status.skill[MC_PUSHCART].lv = x?1:0; \ + sd->status.skill[MC_PUSHCART].flag = x?1:0; + + int val = atoi(message); + bool need_skill = pc_checkskill(sd, MC_PUSHCART) ? false : true; + + if( !message || !*message || val < 0 || val > MAX_CARTS ) { + sprintf(atcmd_output, msg_txt(1390),command,MAX_CARTS); // Unknown Cart (usage: %s <0-%d>). + clif_displaymessage(fd, atcmd_output); + return -1; + } + + if( val == 0 && !pc_iscarton(sd) ) { + clif_displaymessage(fd, msg_txt(1391)); // You do not possess a cart to be removed + return -1; + } + + if( need_skill ) { + MC_CART_MDFY(1); + } + + if( pc_setcart(sd, val) ) { + if( need_skill ) { + MC_CART_MDFY(0); + } + return -1;/* @cart failed */ + } + + if( need_skill ) { + MC_CART_MDFY(0); + } + + clif_displaymessage(fd, msg_txt(1392)); // Cart Added + + return 0; + #undef MC_CART_MDFY +} /** * Fills the reference of available commands in atcommand DBMap **/ @@ -9032,10 +9072,8 @@ void atcommand_basecommands(void) { ACMD_DEF(addperm), ACMD_DEF2("rmvperm", addperm), ACMD_DEF(unloadnpcfile), - /** - * For Testing Purposes, not going to be here after we're done. - **/ - ACMD_DEF2("newmount", new_mount), + ACMD_DEF(cart), + ACMD_DEF(mount2) }; AtCommandInfo* atcommand; int i; -- cgit v1.2.3-60-g2f50