Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds UDT_MOBID for getunitdata & setunitdata, which retrieves actual mob id #2382

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions db/constants.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions doc/script_commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions src/map/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/map/script.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ enum script_unit_data_types {
UDT_STATPOINT,
UDT_ROBE,
UDT_BODY2,
UDT_MOBID,
UDT_MAX
};

Expand Down