From f3696dc2929f77ee0389700940142396469ec855 Mon Sep 17 00:00:00 2001 From: EyesOfAHawk Date: Thu, 21 Feb 2019 13:05:20 +1300 Subject: [PATCH] Adds UDT_MOBID for getunitdata & setunitdata, which retrieves actual mob id. --- db/constants.conf | 1 + doc/script_commands.txt | 6 ++++-- src/map/script.c | 3 +++ src/map/script.h | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/db/constants.conf b/db/constants.conf index 598bc89c4e2..24ae6cf0c00 100644 --- a/db/constants.conf +++ b/db/constants.conf @@ -3901,6 +3901,7 @@ constants_db: { UDT_STATADD: 54 UDT_ROBE: 55 UDT_BODY2: 56 + UDT_MOBID: 57 comment__: "HatEffect Constants" HAT_EF_BLOSSOM_FLUTTERING: 1 diff --git a/doc/script_commands.txt b/doc/script_commands.txt index db851128f59..6f353715eba 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -10055,7 +10055,8 @@ Applicable Data Types (available as constants) - UDT_AI: Unit AI Type (see doc/constants.md for Unit AI Types) UDT_SCOPTION: Status Options. (see doc/constants.md for Unit Option Types) UDT_SEX: Gender of the unit. (see doc/constants.md for Genders) - UDT_CLASS: Class of the unit. (Monster ID) (int) + UDT_CLASS: Class of the unit. (Sprite ID for Monsters) (int) + UDT_MOBID: Monster ID. (int) UDT_HAIRSTYLE: Hair Style ID. (int) UDT_HAIRCOLOR: Hair Color ID. (int) UDT_HEADBOTTOM: Headgear Bottom Sprite ID. (int) @@ -10120,7 +10121,8 @@ Applicable Data types (available as constants) - UDT_AI: Unit AI Type (see doc/constants.md for Unit AI Types) UDT_SCOPTION: Status Options. (see doc/constants.md for Unit Option Types) UDT_SEX: Gender of the unit. (see doc/constants.md for Genders) - UDT_CLASS: Class of the unit. (Monster ID) (int) + UDT_CLASS: Class of the unit. (Sprite ID for Monsters) (int) + UDT_MOBID: Monster ID. (int) UDT_HAIRSTYLE: Hair Style ID. (int) UDT_HAIRCOLOR: Hair Color ID. (int) UDT_HEADBOTTOM: Headgear Bottom Sprite ID. (int) diff --git a/src/map/script.c b/src/map/script.c index 7578fcdcc9a..e84a71e023c 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -18746,6 +18746,7 @@ static BUILDIN(setunitdata) case UDT_SP: case UDT_MAXSP: case UDT_CLASS: + case UDT_MOBID: case UDT_HEADBOTTOM: case UDT_HEADMIDDLE: case UDT_HEADTOP: @@ -18921,6 +18922,7 @@ static BUILDIN(setunitdata) md->vd->sex = (char) val; break; case UDT_CLASS: + case UDT_MOBID: mob->class_change(md, val); break; case UDT_HAIRSTYLE: @@ -19862,6 +19864,7 @@ static BUILDIN(getunitdata) case UDT_AMOTION: script_pushint(st, md->status.amotion); break; case UDT_ADELAY: script_pushint(st, md->status.adelay); break; case UDT_DMOTION: script_pushint(st, md->status.dmotion); break; + case UDT_MOBID: script_pushint(st, md->class_); break; default: ShowWarning("buildin_getunitdata: Invalid data type '%s' for Mob unit.\n", udtype); script_pushint(st, 0); diff --git a/src/map/script.h b/src/map/script.h index 549ad32841f..f395598f016 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -431,6 +431,7 @@ enum script_unit_data_types { UDT_STATPOINT, UDT_ROBE, UDT_BODY2, + UDT_MOBID, UDT_MAX };