- Added #cash and #points to add cash/kafra points to a character.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12267 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
43425e88de
commit
818e336076
@ -97,6 +97,10 @@ size: 50
|
||||
alive: 60
|
||||
revive: 60
|
||||
|
||||
// Add or removes cash/kafra points to a character
|
||||
cash: 60
|
||||
points: 60
|
||||
|
||||
// Give a player all the skills available to him/her
|
||||
allskill: 60
|
||||
allskills: 60
|
||||
|
@ -906,6 +906,54 @@ int charcommand_zeny(const int fd, struct map_session_data* sd, const char* comm
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
* #cash or #points <amount> <charname>
|
||||
*------------------------------------------*/
|
||||
int charcommand_cash(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||
{
|
||||
struct map_session_data *pl_sd;
|
||||
char character[NAME_LENGTH];
|
||||
int value = 0;
|
||||
nullpo_retr(-1, sd);
|
||||
|
||||
memset(character, '\0', sizeof(character));
|
||||
|
||||
if( !message || !*message || sscanf(message, "%d %23[^\n]", &value, character) < 2 || value == 0 )
|
||||
{
|
||||
clif_displaymessage(fd, "Please, enter a number and a player name (usage: #cash|#points <points> <name>).");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if( (pl_sd = map_nick2sd(character)) != NULL )
|
||||
{
|
||||
if( !strcmpi(command+1,"cash") )
|
||||
{
|
||||
if( value > 0 )
|
||||
pc_getcash(pl_sd, value, 0);
|
||||
else
|
||||
pc_paycash(pl_sd, value, 0);
|
||||
|
||||
clif_displaymessage(fd, "Character's Cash Points changed!.");
|
||||
}
|
||||
else
|
||||
{ // @points
|
||||
if( value > 0 )
|
||||
pc_getcash(pl_sd, 0, value);
|
||||
else
|
||||
pc_paycash(pl_sd, value, value);
|
||||
|
||||
clif_displaymessage(fd, "Character's Kafra Points changed!.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
clif_displaymessage(fd, msg_txt(3)); // Character not found.
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
* #fakename <char name> <fake name>
|
||||
*------------------------------------------*/
|
||||
@ -3739,6 +3787,8 @@ CharCommandInfo charcommand_info[] = {
|
||||
{ "homfriendly", 60, charcommand_homfriendly },
|
||||
{ "homhungry", 60, charcommand_homhungry },
|
||||
{ "hominfo", 40, charcommand_hominfo },
|
||||
{ "cash", 60, charcommand_cash },
|
||||
{ "points", 60, charcommand_cash },
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user