summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-02-29 00:05:45 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-02-29 00:05:45 +0000
commit98bc5a50c724236000263526a0539caeb11a3200 (patch)
tree789284c63cfae64eb896c2b838d5da9ff57480bb /src/map/atcommand.c
parent96c726976d259ff9a56be04f67bcd46cf3a5b4fc (diff)
downloadhercules-98bc5a50c724236000263526a0539caeb11a3200.tar.gz
hercules-98bc5a50c724236000263526a0539caeb11a3200.tar.bz2
hercules-98bc5a50c724236000263526a0539caeb11a3200.tar.xz
hercules-98bc5a50c724236000263526a0539caeb11a3200.zip
- Added @cash and @points command to manage your cash/kafra points.
- Optimized code. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12266 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 5c3fb80a3..f2947372b 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -7966,6 +7966,37 @@ int atcommand_reject(const int fd, struct map_session_data* sd, const char* comm
}
/*===================================
+ * Cash Points
+ *-----------------------------------*/
+int atcommand_cash(const int fd, struct map_session_data* sd, const char* command, const char* message)
+{
+ int value;
+ nullpo_retr(-1, sd);
+
+ if( !message || !*message || (value = atoi(message)) == 0 ) {
+ clif_displaymessage(fd, "Please, enter an amount.");
+ return -1;
+ }
+
+ if( !strcmpi(command+1,"cash") )
+ {
+ if( value > 0 )
+ pc_getcash(sd, value, 0);
+ else
+ pc_paycash(sd, value, 0);
+ }
+ else
+ { // @points
+ if( value > 0 )
+ pc_getcash(sd, 0, value);
+ else
+ pc_paycash(sd, value, value);
+ }
+
+ return 0;
+}
+
+/*===================================
* Away message (@away, @aw) [LuzZza]
*-----------------------------------*/
int atcommand_away(const int fd, struct map_session_data* sd, const char* command, const char* message)
@@ -8481,6 +8512,8 @@ AtCommandInfo atcommand_info[] = {
{ "mail", 1, atcommand_mail },
{ "noks", 0, atcommand_ksprotection },
{ "allowks", 6, atcommand_allowks },
+ { "cash", 60, atcommand_cash },
+ { "points", 60, atcommand_cash },
};