Browse Source

I am bored

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@515 54d463be-8e91-2dee-dedb-b68131a5f0ec
amber 20 years ago
parent
commit
0e2dc649d9
5 changed files with 111 additions and 0 deletions
  1. 1 0
      Changelog.txt
  2. 5 0
      conf-tmpl/atcommand_athena.conf
  3. 4 0
      conf-tmpl/help.txt
  4. 98 0
      src/map/atcommand.c
  5. 3 0
      src/map/atcommand.h

+ 1 - 0
Changelog.txt

@@ -1,5 +1,6 @@
 Date	Added
 12/8
+        * Added @marry, @divorce, and @rings [MouseJstr]
         * fixed @revive [MouseJstr]
         * Added option to turn off login server logging [celest]
         * Moved char server starting logging to after we've read the configuration

+ 5 - 0
conf-tmpl/atcommand_athena.conf

@@ -287,6 +287,11 @@ useskill: 40
 // What skills are required to get this skill
 skilltree: 40
 
+// Marriage skills
+marry: 40
+divorce: 40
+rings: 40
+
 // make another player killable
 charkillable: 40
 

+ 4 - 0
conf-tmpl/help.txt

@@ -101,6 +101,10 @@
  40:  Archer                 146 = Auto Berserk         151 = Take Stone     155 = Crazy Uproar/Loud Voice
  40:  147 = Arrow Creation   Acolyte                    152 = Stone Throw    Magician
  40:  148 = Charge Arrows    156 = Holy Light                                157 = Energy Coat
+ 40: @skilltree <
+ 40: @marry <player1> <player2> - marry two players
+ 40: @divorce <player>  - divorces the two players
+ 40: @rings - gives you the two wedding rings
  60: @addwarp <map name> <x coord> <y coord>
  40: 
  40:--- MONSTERS CMD ---

+ 98 - 0
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 }
@@ -7398,6 +7405,97 @@ atcommand_skilltree(const int fd, struct map_session_data* sd,
   return 0;
 }
 
+/*==========================================
+ * @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.
  *------------------------------------------

+ 3 - 0
src/map/atcommand.h

@@ -212,6 +212,9 @@ enum AtCommandType {
 	// SQL-only commands end
 #endif
 	AtCommand_SkillTree, // by MouseJstr
+	AtCommand_Marry, // by MouseJstr
+	AtCommand_Divorce, // by MouseJstr
+	AtCommand_Rings, // by MouseJstr
 	
 	// end
 	AtCommand_Unknown,