소스 검색

Clean up clone checks
* Default clone monster mode to MONSTER_TYPE_20. This resolves issues with clones receiving more modes than they should resulting in static behavior. See doc/mob_db_mode_list.txt for more types.
* Fixes atcommand clone not sending the correct flag value during the clone spawning process.
* Update documentation.

aleos 1 년 전
부모
커밋
c35a262f37
3개의 변경된 파일7개의 추가작업 그리고 7개의 파일을 삭제
  1. 4 3
      doc/script_commands.txt
  2. 1 1
      src/map/atcommand.cpp
  3. 2 3
      src/map/status.cpp

+ 4 - 3
doc/script_commands.txt

@@ -6836,9 +6836,10 @@ The mode can be specified to determine the behavior of the clone. Its
 values are the same as the ones used for the mode field in the mob_db. The
 default mode is aggressive, assists, can move, can attack.
 
-Flag can be either zero or one currently. If zero, the clone is a normal
-monster that'll target players, if one, it is considered a summoned monster,
-and as such, it'll target other monsters. Defaults to zero.
+Flag options:
+0 - The clone is a normal monster that will target players (default).
+1 - The clone is considered a summoned monster that will target other monsters.
+2 - The clone is a slave and will support the master.
 
 The duration specifies how long the clone will live before it is auto-removed.
 Specified in seconds, defaults to no limit (zero).

+ 1 - 1
src/map/atcommand.cpp

@@ -9086,7 +9086,7 @@ ACMD_FUNC(clone)
 		y = sd->bl.y;
 	}
 
-	if((x = mob_clone_spawn(pl_sd, sd->bl.m, x, y, "", master, MD_NONE, flag?1:0, 0)) > 0) {
+	if((x = mob_clone_spawn(pl_sd, sd->bl.m, x, y, "", master, MD_NONE, flag, 0)) > 0) {
 		clif_displaymessage(fd, msg_txt(sd,128+flag*2));	// Evil Clone spawned. Clone spawned. Slave clone spawned.
 		return 0;
 	}

+ 2 - 3
src/map/status.cpp

@@ -3665,9 +3665,8 @@ int status_calc_pc_sub(map_session_data* sd, uint8 opt)
 		base_status->speed = pSpeed;
 	}
 
-	// !FIXME: Most of these stuff should be calculated once, but how do I fix the memset above to do that? [Skotlex]
-	// Give them all modes except these (useful for clones)
-	base_status->mode = static_cast<e_mode>(MD_MASK&~(MD_STATUSIMMUNE|MD_IGNOREMELEE|MD_IGNOREMAGIC|MD_IGNORERANGED|MD_IGNOREMISC|MD_DETECTOR|MD_ANGRY|MD_TARGETWEAK|MD_NOCAST|MD_NORANDOMWALK));
+	// Default clone mode (see mob_db_mode_list doc for more types)
+	base_status->mode = MONSTER_TYPE_20;
 
 	base_status->size = (sd->class_&JOBL_BABY) ? SZ_SMALL : (((sd->class_&MAPID_BASEMASK) == MAPID_SUMMONER) ? battle_config.summoner_size : SZ_MEDIUM);
 	if (battle_config.character_size && pc_isriding(sd)) { // [Lupus]