Browse Source

add spawn

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@741 54d463be-8e91-2dee-dedb-b68131a5f0ec
amber 20 years ago
parent
commit
4f7dffcb72
3 changed files with 27 additions and 6 deletions
  1. 23 1
      src/map/atcommand.c
  2. 1 4
      src/map/atcommand.h
  3. 3 1
      src/map/map.c

+ 23 - 1
src/map/atcommand.c

@@ -226,6 +226,7 @@ ACMD_FUNC(divorce); // by MouseJstr
 ACMD_FUNC(rings); // by MouseJstr
 ACMD_FUNC(rings); // by MouseJstr
 
 
 ACMD_FUNC(grind); // by MouseJstr
 ACMD_FUNC(grind); // by MouseJstr
+ACMD_FUNC(grind2); // by MouseJstr
 
 
 ACMD_FUNC(jumptoid); // by Dino9021
 ACMD_FUNC(jumptoid); // by Dino9021
 ACMD_FUNC(jumptoid2); // by Dino9021
 ACMD_FUNC(jumptoid2); // by Dino9021
@@ -482,7 +483,8 @@ static AtCommandInfo atcommand_info[] = {
 	{ AtCommand_Marry,		"@marry",	40, atcommand_marry }, // [MouseJstr]
 	{ AtCommand_Marry,		"@marry",	40, atcommand_marry }, // [MouseJstr]
 	{ AtCommand_Divorce,		"@divorce",	40, atcommand_divorce }, // [MouseJstr]
 	{ AtCommand_Divorce,		"@divorce",	40, atcommand_divorce }, // [MouseJstr]
 	{ AtCommand_Rings,		"@rings",	40, atcommand_rings }, // [MouseJstr]
 	{ AtCommand_Rings,		"@rings",	40, atcommand_rings }, // [MouseJstr]
-	{ AtCommand_Grind,		"@grind",	40, atcommand_grind }, // [MouseJstr]
+	{ AtCommand_Grind,		"@grind",	99, atcommand_grind }, // [MouseJstr]
+	{ AtCommand_Grind2,		"@grind2",	99, atcommand_grind2 }, // [MouseJstr]
 
 
 	{ AtCommand_JumpToId,       "@jumptoid",  20, atcommand_jumptoid }, // [Dino9021]
 	{ AtCommand_JumpToId,       "@jumptoid",  20, atcommand_jumptoid }, // [Dino9021]
 	{ AtCommand_JumpToId,       "@warptoid",  20, atcommand_jumptoid }, // [Dino9021]
 	{ AtCommand_JumpToId,       "@warptoid",  20, atcommand_jumptoid }, // [Dino9021]
@@ -7316,6 +7318,26 @@ atcommand_grind(const int fd, struct map_session_data* sd,
 	return 0;
 	return 0;
 }
 }
 
 
+/*==========================================
+ * @grind2 by [MouseJstr]
+ *------------------------------------------
+ */
+int
+atcommand_grind2(const int fd, struct map_session_data* sd,
+	const char* command, const char* message)
+{
+	int i, x, y, id;
+
+	for (i =  1000; i <2000; i++) {
+		x = sd->bl.x + (rand() % 10 - 5);
+		y = sd->bl.y + (rand() % 10 - 5);
+		id = mob_once_spawn(sd, "this", x, y, "--ja--", i, 1, "");
+	}
+
+	return 0;
+}
+
+
 /*==========================================
 /*==========================================
  * It is made to rain.
  * It is made to rain.
  *------------------------------------------
  *------------------------------------------

+ 1 - 4
src/map/atcommand.h

@@ -120,11 +120,7 @@ enum AtCommandType {
 	AtCommand_ReloadItemDB,
 	AtCommand_ReloadItemDB,
 	AtCommand_ReloadMobDB,
 	AtCommand_ReloadMobDB,
 	AtCommand_ReloadSkillDB,
 	AtCommand_ReloadSkillDB,
-#ifndef TXT_ONLY
-	AtCommand_Rehash,
-#else /* TXT_ONLY */
 	AtCommand_ReloadScript,
 	AtCommand_ReloadScript,
-#endif /* TXT_ONLY */
 	AtCommand_ReloadGMDB,
 	AtCommand_ReloadGMDB,
 	AtCommand_MapInfo,
 	AtCommand_MapInfo,
 	AtCommand_Dye,
 	AtCommand_Dye,
@@ -217,6 +213,7 @@ enum AtCommandType {
 	AtCommand_Divorce, // by MouseJstr
 	AtCommand_Divorce, // by MouseJstr
 	AtCommand_Rings, // by MouseJstr
 	AtCommand_Rings, // by MouseJstr
 	AtCommand_Grind, // by MouseJstr
 	AtCommand_Grind, // by MouseJstr
+	AtCommand_Grind2, // by MouseJstr
 
 
 	AtCommand_JumpToId, // by Dino9021
 	AtCommand_JumpToId, // by Dino9021
 	AtCommand_JumpToId2, // by Dino9021
 	AtCommand_JumpToId2, // by Dino9021

+ 3 - 1
src/map/map.c

@@ -1040,8 +1040,10 @@ int map_quit(struct map_session_data *sd) {
 		sd->alive_timer = 0;
 		sd->alive_timer = 0;
 	}
 	}
 
 
-	if( sd->npc_stackbuf && sd->npc_stackbuf != NULL)
+	if( sd->npc_stackbuf && sd->npc_stackbuf != NULL) {
 		free( sd->npc_stackbuf );
 		free( sd->npc_stackbuf );
+		sd->npc_stackbuf = NULL;
+	}
 
 
 	map_delblock(&sd->bl);
 	map_delblock(&sd->bl);