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.
This commit is contained in:
aleos 2023-10-19 09:20:30 -04:00
parent 957814679d
commit c35a262f37
3 changed files with 7 additions and 7 deletions

View File

@ -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 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. default mode is aggressive, assists, can move, can attack.
Flag can be either zero or one currently. If zero, the clone is a normal Flag options:
monster that'll target players, if one, it is considered a summoned monster, 0 - The clone is a normal monster that will target players (default).
and as such, it'll target other monsters. Defaults to zero. 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. The duration specifies how long the clone will live before it is auto-removed.
Specified in seconds, defaults to no limit (zero). Specified in seconds, defaults to no limit (zero).

View File

@ -9086,7 +9086,7 @@ ACMD_FUNC(clone)
y = sd->bl.y; 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. clif_displaymessage(fd, msg_txt(sd,128+flag*2)); // Evil Clone spawned. Clone spawned. Slave clone spawned.
return 0; return 0;
} }

View File

@ -3665,9 +3665,8 @@ int status_calc_pc_sub(map_session_data* sd, uint8 opt)
base_status->speed = pSpeed; 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] // Default clone mode (see mob_db_mode_list doc for more types)
// Give them all modes except these (useful for clones) base_status->mode = MONSTER_TYPE_20;
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));
base_status->size = (sd->class_&JOBL_BABY) ? SZ_SMALL : (((sd->class_&MAPID_BASEMASK) == MAPID_SUMMONER) ? battle_config.summoner_size : SZ_MEDIUM); 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] if (battle_config.character_size && pc_isriding(sd)) { // [Lupus]