summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authoramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-08 22:51:52 +0000
committeramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-08 22:51:52 +0000
commit119ff0550b0f4d5e09b9cba41c2f56723c58ca5d (patch)
treeebca2fc69700f81dae4da60c40fc0a6876926635 /src/map/atcommand.c
parent09fadbbae7b2804a09d07c0efffd50caf8efb1c9 (diff)
downloadhercules-119ff0550b0f4d5e09b9cba41c2f56723c58ca5d.tar.gz
hercules-119ff0550b0f4d5e09b9cba41c2f56723c58ca5d.tar.bz2
hercules-119ff0550b0f4d5e09b9cba41c2f56723c58ca5d.tar.xz
hercules-119ff0550b0f4d5e09b9cba41c2f56723c58ca5d.zip
I am bored
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@515 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c98
1 files changed, 98 insertions, 0 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 5b4eafb6a..ddd1d60c4 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -229,6 +229,10 @@ ATCOMMAND_FUNC(refreshonline); // [Valaris]
ATCOMMAND_FUNC(skilltree); // by MouseJstr
+ATCOMMAND_FUNC(marry); // by MouseJstr
+ATCOMMAND_FUNC(divorce); // by MouseJstr
+ATCOMMAND_FUNC(rings); // by MouseJstr
+
/*==========================================
*AtCommandInfo atcommand_info[]構造体の定義
*------------------------------------------
@@ -475,6 +479,9 @@ static AtCommandInfo atcommand_info[] = {
#endif /* TXT_ONLY */
{ AtCommand_SkillTree, "@skilltree", 40, atcommand_skilltree }, // [MouseJstr]
+ { AtCommand_Marry, "@marry", 40, atcommand_marry }, // [MouseJstr]
+ { AtCommand_Divorce, "@divorce", 40, atcommand_divorce }, // [MouseJstr]
+ { AtCommand_Rings, "@rings", 40, atcommand_rings }, // [MouseJstr]
// add new commands before this line
{ AtCommand_Unknown, NULL, 1, NULL }
@@ -7399,6 +7406,97 @@ atcommand_skilltree(const int fd, struct map_session_data* sd,
}
/*==========================================
+ * @marry by [MouseJstr]
+ *
+ * Marry two players
+ *------------------------------------------
+ */
+int
+atcommand_marry(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;
+ char player1[255], player2[255];
+
+ nullpo_retr(-1, sd);
+
+ if (!message || !*message)
+ return -1;
+
+ if (sscanf(message, "%[^,],%[^\r\n]", player1, player2) != 2) {
+ clif_displaymessage(fd, "usage: @marry <player1> <player2>.");
+ return -1;
+ }
+
+ 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;
+ }
+
+ return pc_marriage(pl_sd1, pl_sd2);
+}
+
+/*==========================================
+ * @divorce by [MouseJstr]
+ *
+ * divorce two players
+ *------------------------------------------
+ */
+int
+atcommand_divorce(const int fd, struct map_session_data* sd,
+ const char* command, const char* message)
+{
+ struct map_session_data *pl_sd = NULL;
+
+ nullpo_retr(-1, sd);
+
+ if (!message || !*message)
+ return -1;
+
+ if((pl_sd=map_nick2sd((char *) message)) != NULL)
+ return pc_divorce(pl_sd);
+
+ return 0;
+}
+
+/*==========================================
+ * @rings by [MouseJstr]
+ *
+ * Give two players rings
+ *------------------------------------------
+ */
+int
+atcommand_rings(const int fd, struct map_session_data* sd,
+ const char* command, const char* message)
+{
+ struct item item_tmp;
+ int get_count, flag;
+
+ memset(&item_tmp, 0, sizeof(item_tmp));
+
+ item_tmp.nameid = 2634;
+ item_tmp.identify = 1;
+
+ if ((flag = pc_additem((struct map_session_data*)sd, &item_tmp, 1)))
+ clif_additem((struct map_session_data*)sd, 0, 0, flag);
+
+ item_tmp.nameid = 2635;
+ item_tmp.identify = 1;
+ if ((flag = pc_additem((struct map_session_data*)sd, &item_tmp, get_count)))
+ clif_additem((struct map_session_data*)sd, 0, 0, flag);
+
+ return 0;
+}
+
+/*==========================================
* It is made to rain.
*------------------------------------------
*/