diff options
author | veider <veider@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-03-28 21:25:11 +0000 |
---|---|---|
committer | veider <veider@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-03-28 21:25:11 +0000 |
commit | cb44aff61ed172eb338535078d772090b124d465 (patch) | |
tree | 68efd87328d3c019577d968833a44b588270c28b /src/map/atcommand.c | |
parent | 00fb4a56f6ae894e84cdd62faf6bf596a097e0e0 (diff) | |
download | hercules-cb44aff61ed172eb338535078d772090b124d465.tar.gz hercules-cb44aff61ed172eb338535078d772090b124d465.tar.bz2 hercules-cb44aff61ed172eb338535078d772090b124d465.tar.xz hercules-cb44aff61ed172eb338535078d772090b124d465.zip |
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1316 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index bc11123b9..55a08873c 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -260,6 +260,7 @@ ACMD_FUNC(undisguiseall); ACMD_FUNC(disguiseall); ACMD_FUNC(changelook); ACMD_FUNC(mobinfo); //by Lupus +ACMD_FUNC(adopt); // by Veider /*========================================== *AtCommandInfo atcommand_info[]構造体の定義 @@ -541,6 +542,8 @@ static AtCommandInfo atcommand_info[] = { { AtCommand_MobInfo, "@mobinfo", 1, atcommand_mobinfo }, // [Lupus] { AtCommand_MobInfo, "@monsterinfo", 1, atcommand_mobinfo }, // [Lupus] { AtCommand_MobInfo, "@mi", 1, atcommand_mobinfo }, // [Lupus] + { AtCommand_Adopt, "@adopt", 40, atcommand_adopt }, // [Veider] + // add new commands before this line { AtCommand_Unknown, NULL, 1, NULL } }; @@ -9069,3 +9072,62 @@ int atcommand_mobinfo( return 0; } + +/*========================================== + * @adopt by [Veider] + * + * adopt a novice + *------------------------------------------ + */ +int +atcommand_adopt(const int fd, struct map_session_data* sd, +const char* command, const char* message) +{ + struct map_session_data *pl_sd1 = NULL; + struct map_session_data *pl_sd2 = NULL; + struct map_session_data *pl_sd3 = NULL; + char player1[255], player2[255], player3[255]; + + nullpo_retr(-1, sd); + + if (!message || !*message) + return -1; + + if (sscanf(message, "%[^,],%[^,],%[^\r\n]", player1, player2, player3) != 3) { + clif_displaymessage(fd, "usage: @adopt <player1> <player2> <player3>."); + return -1; + } + + printf("Adopting: --%s--%s--%s--\n",player1,player2,player3); + + if((pl_sd1=map_nick2sd((char *) player1)) == NULL) { + sprintf(player2, "Cannot find player %s online", player1); + clif_displaymessage(fd, player2); + return -1; + } + + if((pl_sd2=map_nick2sd((char *) player2)) == NULL) { + sprintf(player1, "Cannot find player %s online", player2); + clif_displaymessage(fd, player1); + return -1; + } + + if((pl_sd3=map_nick2sd((char *) player3)) == NULL) { + sprintf(player1, "Cannot find player %s online", player3); + clif_displaymessage(fd, player1); + return -1; + } + + if((pl_sd1->status.base_level < 70) || (pl_sd2->status.base_level < 70)){ + clif_displaymessage(fd, "They are too young to be parents!"); + return -1; + } + + if (pc_adoption(pl_sd1, pl_sd2, pl_sd3) == 0) { + clif_displaymessage(fd, "They are family.. wish them luck"); + return 0; + } + else + return -1; +} + |