瀏覽代碼

Deprecated strmobinfo and improved getmonsterinfo (#9153)

crazyarashi 2 月之前
父節點
當前提交
57e0e18c08

+ 28 - 44
doc/script_commands.txt

@@ -3713,32 +3713,34 @@ It will return -1 if there is no such monster (or the type value is invalid),
 or "null" if you requested the monster's name.
 
 Valid types are:
-	MOB_NAME - monster's japanese name, if there is no such monster "null" is returned
-	MOB_LV - monster's level
-	MOB_MAXHP - monster's maximum hp
-	MOB_BASEEXP - monster's base experience
-	MOB_JOBEXP - monster's job experience
-	MOB_ATK1 - monster's atk
-	MOB_ATK2 - monster's atk2
-	MOB_DEF - monster's def
-	MOB_MDEF - monster's mdef
-	MOB_RES - monster's res
-	MOB_MRES - monster's mres
-	MOB_STR - monster's str
-	MOB_AGI - monster's agi
-	MOB_VIT - monster's vit
-	MOB_INT - monster's int
-	MOB_DEX - monster's dex
-	MOB_LUK - monster's luk
-	MOB_RANGE - monster's range
-	MOB_RANGE2 - monster's range2
-	MOB_RANGE3 - monster's range3
-	MOB_SIZE - monster's size
-	MOB_RACE - monster's race
-	MOB_ELEMENT - monster's element(doesn't return the element level, only the element ID)
-	MOB_MODE - monster's mode
-	MOB_MVPEXP - monster's mvp experience
-	MOB_ID - monster's ID
+	MOB_NAME          - monster's japanese name
+	MOB_LV            - monster's level
+	MOB_MAXHP         - monster's maximum hp
+	MOB_BASEEXP       - monster's base experience
+	MOB_JOBEXP        - monster's job experience
+	MOB_ATKMIN        - monster's minimum atk
+	MOB_ATKMAX        - monster's maximum atk
+	MOB_DEF           - monster's def
+	MOB_MDEF          - monster's mdef
+	MOB_RES           - monster's res
+	MOB_MRES          - monster's mres
+	MOB_STR           - monster's str
+	MOB_AGI           - monster's agi
+	MOB_VIT           - monster's vit
+	MOB_INT           - monster's int
+	MOB_DEX           - monster's dex
+	MOB_LUK           - monster's luk
+	MOB_SPEED         - monster's speed
+	MOB_ATKRANGE      - monster's attack range
+	MOB_SKILLRANGE    - monster's skill cast range
+	MOB_CHASERANGE    - monster's chase range
+	MOB_SIZE          - monster's size
+	MOB_RACE          - monster's race
+	MOB_ELEMENT       - monster's element
+	MOB_ELEMENTLV     - monster's element level
+	MOB_MODE          - monster's mode
+	MOB_MVPEXP        - monster's mvp experience
+	MOB_ID            - monster's ID
 
 For more details, see the sample in 'doc/sample/getmonsterinfo.txt'.
 
@@ -6910,24 +6912,6 @@ command, simply use 1 for type. Any other number won't be recognized.
 
 ---------------------------------------
 
-*strmobinfo(<type>,<monster id>);
-
-This function will return information about a monster record in the database, as
-per 'db/(pre-)re/mob_db.yml'. Type is the kind of information returned. Valid types are:
-It will return 0 if there is no such monster (or the type value is invalid),
-or an empty string if you requested the monster's name.
-
- 1 - 'english name' field in the database, a string.
- 2 - 'japanese name' field in the database, a string.
-     All other returned values are numbers:
- 3 - Level.
- 4 - Maximum HP.
- 5 - Maximum SP.
- 6 - Experience reward.
- 7 - Job experience reward.
-
----------------------------------------
-
 *mobcount("<map name>","<event label>")
 
 This function will count all the monsters on the specified map that have a given

+ 2 - 2
npc/custom/events/disguise.txt

@@ -208,12 +208,12 @@ iDisguise:
 		if (compare(","+.BlackList$+"," , ","+.Monster+",")) goto iDisguise;
 		if (.Monster==.LastMonster) goto iDisguise;
 		set .LastMonster,.Monster;
-		set $MonsterName$,getmonsterinfo(.Monster,0);
+		set $MonsterName$,getmonsterinfo(.Monster, MOB_NAME);
 	}
 	if (.Rule==2) {
 		set .Winner,0;
 		set .Monster,rand(49);
-		set $MonsterName$,getmonsterinfo(.MVP[.Monster],0);
+		set $MonsterName$,getmonsterinfo(.MVP[.Monster], MOB_NAME);
 	}
 	deletepset 1;
 	defpattern 1,"([^:]+):.\\s*"+$MonsterName$+".*", "iCorrect";

+ 8 - 8
npc/custom/quests/hunting_missions.txt

@@ -164,10 +164,10 @@ Mission_Status:
 	deletearray .@j[0], getarraysize(.@j);
 	for (.@i = 0; .@i < .Quests; .@i++) {
 		.@j[.@i] = getd("Mission" + .@i);
-		.@j[.Quests] = .@j[.Quests] + strmobinfo(3,.@j[.@i]);
-		.@j[.Quests+1] = .@j[.Quests+1] + (strmobinfo(6,.@j[.@i]) / (getbattleflag("base_exp_rate") / 100) * .Modifier[0]);
-		.@j[.Quests+2] = .@j[.Quests+2] + (strmobinfo(7,.@j[.@i]) / (getbattleflag("job_exp_rate") / 100) * .Modifier[1]);
-		mes " > "+Chk(getd("Mission"+.@i+"_"),#Mission_Count) + strmobinfo(1,.@j[.@i]) + " (" + getd("Mission"+.@i+"_") + "/" + #Mission_Count + ")^000000";
+		.@j[.Quests] = .@j[.Quests] + getmonsterinfo(.@j[.@i], MOB_LV);
+		.@j[.Quests+1] = .@j[.Quests+1] + (getmonsterinfo(.@j[.@i], MOB_BASEEXP) / (getbattleflag("base_exp_rate") / 100) * .Modifier[0]);
+		.@j[.Quests+2] = .@j[.Quests+2] + (getmonsterinfo(.@j[.@i], MOB_JOBEXP) / (getbattleflag("job_exp_rate") / 100) * .Modifier[1]);
+		mes " > "+Chk(getd("Mission"+.@i+"_"),#Mission_Count) + getmonsterinfo(.@j[.@i], MOB_NAME) + " (" + getd("Mission"+.@i+"_") + "/" + #Mission_Count + ")^000000";
 	}
 
 	// Reward formulas:
@@ -268,10 +268,10 @@ OnNPCKillEvent:
 	if (!getcharid(1) || !.Party) {
 		if (!#Mission_Count || !Mission0) end;
 		for (.@i = 0; .@i < .Quests; .@i++) {
-			if (strmobinfo(1,killedrid) == strmobinfo(1,getd("Mission" + .@i))) {
+			if (getmonsterinfo(killedrid, MOB_NAME) == getmonsterinfo(getd("Mission" + .@i), MOB_NAME)) {
 				if (getd("Mission" + .@i + "_") < #Mission_Count) {
 					dispbottom "[Hunting Mission] Killed " + (set(getd("Mission" + .@i + "_"),getd("Mission" + .@i + "_") + 1)) +
-					           " of " + #Mission_Count + " " + strmobinfo(1,killedrid) + ".";
+					           " of " + #Mission_Count + " " + getmonsterinfo(killedrid, MOB_NAME) + ".";
 					end;
 				}
 			}
@@ -293,10 +293,10 @@ OnNPCKillEvent:
 						for (.@j = 0; .@j < .Quests; .@j++) {
 							.@my_mob_id = getvar( getd("Mission"+.@j),$@partymembercid[.@i] );
 							.@my_count = getvar( getd("Mission"+.@j+"_"), $@partymembercid[.@i] );
-							if (strmobinfo(1,.@mob) == strmobinfo(1,.@my_mob_id)) {
+							if (getmonsterinfo(.@mob, MOB_NAME) == getmonsterinfo(.@my_mob_id, MOB_NAME)) {
 								if (.@my_count < .@Mission_Count) {
 									setd "Mission"+.@j+"_", (.@my_count+1), $@partymembercid[.@i];
-									dispbottom "[Hunting Mission] Killed " + (.@my_count+1) + " of " + .@Mission_Count + " " + strmobinfo(1,.@mob) + ".", 0x777777, $@partymembercid[.@i];
+									dispbottom "[Hunting Mission] Killed " + (.@my_count+1) + " of " + .@Mission_Count + " " + getmonsterinfo(.@mob, MOB_NAME) + ".", 0x777777, $@partymembercid[.@i];
 									break;
 								}
 							}

+ 1 - 1
npc/custom/quests/kahohorn.txt

@@ -32,7 +32,7 @@ geffen,115,107,5	script	Lord Kaho's Servant	61,{
 	next;
 	mes .@n$;
 	for(set .@i,0; .@i<10; set .@i,.@i+1)
-		mes "1x ^0055FF"+getitemname(.@Items[.@i])+"^000000 (from "+strmobinfo(1,.@Drops[.@i])+")";
+		mes "1x ^0055FF"+getitemname(.@Items[.@i])+"^000000 (from "+getmonsterinfo(.@Drops[.@i], MOB_NAME)+")";
 	next;
 	mes .@n$;
 	mes "We're not done yet, sweetie...";

+ 4 - 4
npc/custom/quests/questboard.txt

@@ -52,7 +52,7 @@ prontera,129,215,5	script	Questboard	4_BOARD3,{
 		set .@size, getarraysize(getd("."+ currentquest$ + "_huntingmob"));
 		for( set .@j, 0; .@j < .@size; set .@j,.@j+2){
 			set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@j)+"]");
-			mes "^FF0000"+strmobinfo(1,getd("."+currentquest$+"_huntingmob["+.@j+"]"))+" - "+getd(currentquest$+"_"+.@currentmob+"_"+(.@j+1)+"_killcount")+"/"+getd("."+currentquest$+"_huntingmob["+(.@j+1)+"]")+" ea.^000000";
+			mes "^FF0000"+getmonsterinfo(getd("."+currentquest$+"_huntingmob["+.@j+"]"), MOB_NAME)+" - "+getd(currentquest$+"_"+.@currentmob+"_"+(.@j+1)+"_killcount")+"/"+getd("."+currentquest$+"_huntingmob["+(.@j+1)+"]")+" ea.^000000";
 		}
 		mes "--------------------------------";
 		mes "[Reward]";
@@ -163,7 +163,7 @@ prontera,129,215,5	script	Questboard	4_BOARD3,{
 		mes "--------------------------------";
 		set .@size, getarraysize(getd("."+ .@selection + "_huntingmob"));
 		for( set .@j, 0; .@j < .@size; set .@j,.@j+2){
-			mes "^FF0000"+strmobinfo(1,getd("."+.@selection+"_huntingmob["+.@j+"]"))+" - "+getd("."+.@selection+"_huntingmob["+(.@j+1)+"]")+" ea.^000000";
+			mes "^FF0000"+getmonsterinfo(getd("."+.@selection+"_huntingmob["+.@j+"]"), MOB_NAME)+" - "+getd("."+.@selection+"_huntingmob["+(.@j+1)+"]")+" ea.^000000";
 		}
 		mes "--------------------------------";
 		mes "[Reward]";
@@ -264,7 +264,7 @@ OnNPCKillEvent:
 			set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@i-1)+"]");
 			if(getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")<getd("."+currentquest$+"_huntingmob["+.@i+"]")){
 				setd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount", getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")+1);
-				dispbottom getd("."+currentquest$+"_huntingname$")+": ["+strmobinfo(1,.@currentmob)+"] ("+ getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")+"/"+getd("."+currentquest$+"_huntingmob["+.@i+"]")+")";
+				dispbottom getd("."+currentquest$+"_huntingname$")+": ["+getmonsterinfo(.@currentmob, MOB_NAME)+"] ("+ getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")+"/"+getd("."+currentquest$+"_huntingmob["+.@i+"]")+")";
 			}
 			if(getcharid(1) != 0 && .party_support == true){
 				getmapxy(.@map1$,.@x1,.@y1);
@@ -282,7 +282,7 @@ OnNPCKillEvent:
 								if(.@kill_amt<.@kill_goal)
 								{
 									setd(.@currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount", .@kill_amt+1, $@partymembercid[.@j]);
-									dispbottom getd("."+.@currentquest$+"_huntingname$")+": ["+strmobinfo(1,.@currentmob)+"] ("+(.@kill_amt+1)+"/"+.@kill_goal+")", 0xB6FF00, $@partymembercid[.@j];
+									dispbottom getd("."+.@currentquest$+"_huntingname$")+": ["+getmonsterinfo(.@currentmob, MOB_NAME)+"] ("+(.@kill_amt+1)+"/"+.@kill_goal+")", 0xB6FF00, $@partymembercid[.@j];
 								}
 							}
 						}

+ 2 - 2
npc/guild/agit_main.txt

@@ -811,7 +811,7 @@ OnRecvCastle:
 			if (.@guardiantype[.@UseGID] == 1) { set .@type,1287; }
 			else if (.@guardiantype[.@UseGID] == 2) { set .@type,1285; }
 			else { set .@type,1286; }
-			guardian strnpcinfo(2),.@guardianposx[.@UseGID],.@guardianposy[.@UseGID],strmobinfo(2,.@type),.@type,"Guardian#"+strnpcinfo(2)+"::OnGuardianDied",.@UseGID;
+			guardian strnpcinfo(2),.@guardianposx[.@UseGID],.@guardianposy[.@UseGID],getmonsterinfo(.@type, MOB_NAME),.@type,"Guardian#"+strnpcinfo(2)+"::OnGuardianDied",.@UseGID;
 			mes "["+strnpcinfo(1)+"]";
 			mes "We completed the summoning of the Guardian. Our defenses are now increased with it in place.";
 			close;
@@ -1115,7 +1115,7 @@ OnSpawnGuardians:
 		else if (.@guardiantype[.@i] == 2) { set .@type,1285; }
 		else { set .@type,1286; }
 		if (GetCastleData(strnpcinfo(2),.@UseGID)) {
-			guardian strnpcinfo(2),.@guardianposx[.@i],.@guardianposy[.@i],strmobinfo(2,.@type),.@type,"Guardian#"+strnpcinfo(2)+"::OnGuardianDied",.@i;
+			guardian strnpcinfo(2),.@guardianposx[.@i],.@guardianposy[.@i],getmonsterinfo(.@type, MOB_NAME),.@type,"Guardian#"+strnpcinfo(2)+"::OnGuardianDied",.@i;
 		}
 	}
 	end;

+ 1 - 1
npc/other/arena/arena_room.txt

@@ -686,7 +686,7 @@ prt_are_in,98,14,3	script	Givu#arena	728,{
 			else if ($@arena_picture_id == 7777)
 				mes "Would you like to take a picture with a Valkyrie?";
 			else
-				mes "Would you like to take a picture with a "+getmonsterinfo($@arena_picture_id,0)+"?";
+				mes "Would you like to take a picture with a "+getmonsterinfo($@arena_picture_id, MOB_NAME)+"?";
 			next;
 			switch(select("Yes:No")) {
 			case 1:

+ 2 - 2
npc/pre-re/mobs/dungeons/lhz_dun.txt

@@ -281,7 +281,7 @@ OnSummon:
 	case 6: set .@x,175;	set .@y,137;	break;
 	}
 	set .@mob,rand(1646,1651);
-	monster "lhz_dun03",.@x,.@y,strmobinfo(1,.@mob),.@mob,1,"summon_boss_lt::OnLhzMvPDead";
+	monster "lhz_dun03",.@x,.@y,getmonsterinfo(.@mob, MOB_NAME),.@mob,1,"summon_boss_lt::OnLhzMvPDead";
 
 	// Select Coordinates to summon a random 99 on
 	switch(rand(1,6)) {
@@ -293,7 +293,7 @@ OnSummon:
 	case 6: set .@x2,139;	set .@y2,259;	break;
 	}
 	set .@mob2,rand(1640,1645);
-	monster "lhz_dun03",.@x2,.@y2,strmobinfo(1,.@mob2),.@mob2,1,"summon_boss_lt::OnMy99Dead";
+	monster "lhz_dun03",.@x2,.@y2,getmonsterinfo(.@mob2, MOB_NAME),.@mob2,1,"summon_boss_lt::OnMy99Dead";
 	end;
 
 OnLhzMvPDead:

+ 4 - 4
npc/re/mobs/dungeons/lhz_dun.txt

@@ -85,7 +85,7 @@ OnInit:
 		case 6:  set .@x,175;  set .@y,137;  break;
 	}
 	set .@mob,rand(1646,1651);
-	monster "lhz_dun03",.@x,.@y,strmobinfo(1,.@mob),.@mob,1,strnpcinfo(3)+"::OnMyMVPDead";
+	monster "lhz_dun03",.@x,.@y,getmonsterinfo(.@mob, MOB_NAME),.@mob,1,strnpcinfo(3)+"::OnMyMVPDead";
 
 	// Select Coordinates to summon a random 99 on
 	switch(rand(1,6)) {
@@ -97,7 +97,7 @@ OnInit:
 		case 6:  set .@x2,139;  set .@y2,259;  break;
 	}
 	set .@mob2,rand(1640,1645);
-	monster "lhz_dun03",.@x2,.@y2,strmobinfo(1,.@mob2),.@mob2,1,strnpcinfo(3)+"::OnMy99Dead";
+	monster "lhz_dun03",.@x2,.@y2,getmonsterinfo(.@mob2, MOB_NAME),.@mob2,1,strnpcinfo(3)+"::OnMy99Dead";
 	end;
 
 OnMyMVPDead:
@@ -141,7 +141,7 @@ OnInit:
 		case 7:  set .@x,149;  set .@y,151;  break;
 	}
 	set .@mob,rand(2235,2241);
-	monster "lhz_dun04",.@x,.@y,strmobinfo(1,.@mob),.@mob,1,strnpcinfo(3)+"::OnLhzMvPDead";
+	monster "lhz_dun04",.@x,.@y,getmonsterinfo(.@mob, MOB_NAME),.@mob,1,strnpcinfo(3)+"::OnLhzMvPDead";
 
 	// Select Coordinates to summon a random 99 on
 	switch(rand(1,7)) {
@@ -154,7 +154,7 @@ OnInit:
 		case 7:  set .@x2,149;  set .@y2,151;  break;
 	}
 	set .@mob2,rand(2228,2234);
-	monster "lhz_dun04",.@x2,.@y2,strmobinfo(1,.@mob2),.@mob2,1,strnpcinfo(3)+"::OnMy99Dead";
+	monster "lhz_dun04",.@x2,.@y2,getmonsterinfo(.@mob2, MOB_NAME),.@mob2,1,strnpcinfo(3)+"::OnMy99Dead";
 	end;
 
 OnLhzMvPDead:

+ 1 - 1
npc/re/quests/cupet.txt

@@ -215,7 +215,7 @@ function	script	cute_pet_manager	{
 		mes "[Cute Pet Manager]";
 		mes "You have chosen " + getitemname(.@tame_id) + ".";
 		mes "You can use it for taming";
-		mes "^FF0000" + strmobinfo(1,.@mob_id) + "^000000 monsters.";
+		mes "^FF0000" + getmonsterinfo(.@mob_id, MOB_NAME) + "^000000 monsters.";
 		next;
 		mes "[Cute Pet Manager]";
 		mes "Bring ^FF0000" + .@hunt_amount + " " + getitemname(.@hunt_id) + "^000000" + (.@hunt_id2 ? ", ^FF0000" + .@hunt_amount2 + " " + getitemname(.@hunt_id2) : "") + " ^000000 and ^FF00001 Dolly Capsule^000000";

+ 38 - 30
src/map/script.cpp

@@ -18694,44 +18694,52 @@ BUILDIN_FUNC(getmonsterinfo)
 			mob = mob_db.find(mob_id);
 		}
 	}
+	
+	int32 type = script_getnum(st, 3);
 
 	if (mob == nullptr) {
 		//ShowError("buildin_getmonsterinfo: Wrong Monster ID: %i\n", mob_id);
-		if (script_getnum(st, 3) == MOB_NAME) // requested the name
+		if ( type == MOB_NAME ) // requested the name
 			script_pushconststr(st, "null");
 		else
 			script_pushint(st, -1);
 		return SCRIPT_CMD_SUCCESS;
 	}
 
-	switch ( script_getnum(st, 3) ) {
-		case MOB_NAME:		script_pushstrcopy(st,mob->jname.c_str()); break;
-		case MOB_LV:		script_pushint(st,mob->lv); break;
-		case MOB_MAXHP:		script_pushint(st,mob->status.max_hp); break;
-		case MOB_BASEEXP:	script_pushint(st,mob->base_exp); break;
-		case MOB_JOBEXP:	script_pushint(st,mob->job_exp); break;
-		case MOB_ATK1:		script_pushint(st,mob->status.rhw.atk); break;
-		case MOB_ATK2:		script_pushint(st,mob->status.rhw.atk2); break;
-		case MOB_DEF:		script_pushint(st,mob->status.def); break;
-		case MOB_MDEF:		script_pushint(st,mob->status.mdef); break;
-		case MOB_RES:		script_pushint(st, mob->status.res); break;
-		case MOB_MRES:		script_pushint(st, mob->status.mres); break;
-		case MOB_STR:		script_pushint(st,mob->status.str); break;
-		case MOB_AGI:		script_pushint(st,mob->status.agi); break;
-		case MOB_VIT:		script_pushint(st,mob->status.vit); break;
-		case MOB_INT:		script_pushint(st,mob->status.int_); break;
-		case MOB_DEX:		script_pushint(st,mob->status.dex); break;
-		case MOB_LUK:		script_pushint(st,mob->status.luk); break;
-		case MOB_RANGE:		script_pushint(st,mob->status.rhw.range); break;
-		case MOB_RANGE2:	script_pushint(st,mob->range2); break;
-		case MOB_RANGE3:	script_pushint(st,mob->range3); break;
-		case MOB_SIZE:		script_pushint(st,mob->status.size); break;
-		case MOB_RACE:		script_pushint(st,mob->status.race); break;
-		case MOB_ELEMENT:	script_pushint(st,mob->status.def_ele); break;
-		case MOB_MODE:		script_pushint(st,mob->status.mode); break;
-		case MOB_MVPEXP:	script_pushint(st,mob->mexp); break;
-		case MOB_ID:		script_pushint(st,mob->id); break;
-		default: script_pushint(st,-1); //wrong Index
+	switch ( type ) {
+		case MOB_NAME:       script_pushstrcopy(st, mob->jname.c_str()); break;
+		case MOB_LV:         script_pushint(st, mob->lv); break;
+		case MOB_MAXHP:      script_pushint(st, mob->status.max_hp); break;
+		case MOB_MAXSP:      script_pushint(st, mob->status.max_sp); break;
+		case MOB_BASEEXP:    script_pushint(st, mob->base_exp); break;
+		case MOB_JOBEXP:     script_pushint(st, mob->job_exp); break;
+		case MOB_ATKMIN:     script_pushint(st, mob->status.rhw.atk); break;
+		case MOB_ATKMAX:     script_pushint(st, mob->status.rhw.atk2); break;
+		case MOB_DEF:        script_pushint(st, mob->status.def); break;
+		case MOB_MDEF:       script_pushint(st, mob->status.mdef); break;
+		case MOB_RES:        script_pushint(st, mob->status.res); break;
+		case MOB_MRES:       script_pushint(st, mob->status.mres); break;
+		case MOB_STR:        script_pushint(st, mob->status.str); break;
+		case MOB_AGI:        script_pushint(st, mob->status.agi); break;
+		case MOB_VIT:        script_pushint(st, mob->status.vit); break;
+		case MOB_INT:        script_pushint(st, mob->status.int_); break;
+		case MOB_DEX:        script_pushint(st, mob->status.dex); break;
+		case MOB_LUK:        script_pushint(st, mob->status.luk); break;
+		case MOB_SPEED:      script_pushint(st, mob->status.speed); break;
+		case MOB_ATKRANGE:   script_pushint(st, mob->status.rhw.range); break;
+		case MOB_SKILLRANGE: script_pushint(st, mob->range2); break;
+		case MOB_CHASERANGE: script_pushint(st, mob->range3); break;
+		case MOB_SIZE:	     script_pushint(st, mob->status.size); break;
+		case MOB_RACE:	     script_pushint(st, mob->status.race); break;
+		case MOB_ELEMENT:    script_pushint(st, mob->status.def_ele); break;
+		case MOB_ELEMENTLV:  script_pushint(st, mob->status.ele_lv); break;
+		case MOB_MODE:       script_pushint(st, mob->status.mode); break;
+		case MOB_MVPEXP:     script_pushint(st, mob->mexp); break;
+		case MOB_ID:         script_pushint(st, mob->id); break;
+		default:
+			ShowError( "buildin_getmonsterinfo: Invalid getmonsterinfo type '%d'.\n", type );
+			st->state = END;
+			return SCRIPT_CMD_FAILURE;
 	}
 	return SCRIPT_CMD_SUCCESS;
 }
@@ -28027,7 +28035,7 @@ struct script_function buildin_func[] = {
 	BUILDIN_DEF(playBGMall,"s?????"),
 	BUILDIN_DEF(soundeffect,"si"),
 	BUILDIN_DEF(soundeffectall,"si?????"),	// SoundEffectAll [Codemaster]
-	BUILDIN_DEF(strmobinfo,"ii"),	// display mob data [Valaris]
+	BUILDIN_DEF2_DEPRECATED(strmobinfo, "getmonsterinfo", "ii", "2025-03-11"),
 	BUILDIN_DEF(guardian,"siisi??"),	// summon guardians
 	BUILDIN_DEF(guardianinfo,"sii"),	// display guardian data [Valaris]
 	BUILDIN_DEF(petskillbonus,"iiii"), // [Valaris]

+ 10 - 7
src/map/script.hpp

@@ -356,14 +356,15 @@ enum script_parse_options {
 	SCRIPT_RETURN_EMPTY_SCRIPT = 0x4// returns the script object instead of nullptr for empty scripts
 };
 
-enum monsterinfo_types {
-	MOB_NAME = 0,
+enum e_monsterinfo_types : uint8 {
+	MOB_NAME = 1,
 	MOB_LV,
 	MOB_MAXHP,
+	MOB_MAXSP,
 	MOB_BASEEXP,
 	MOB_JOBEXP,
-	MOB_ATK1,
-	MOB_ATK2,
+	MOB_ATKMIN,
+	MOB_ATKMAX,
 	MOB_DEF,
 	MOB_MDEF,
 	MOB_RES,
@@ -374,12 +375,14 @@ enum monsterinfo_types {
 	MOB_INT,
 	MOB_DEX,
 	MOB_LUK,
-	MOB_RANGE,
-	MOB_RANGE2,
-	MOB_RANGE3,
+	MOB_SPEED,
+	MOB_ATKRANGE,
+	MOB_SKILLRANGE,
+	MOB_CHASERANGE,
 	MOB_SIZE,
 	MOB_RACE,
 	MOB_ELEMENT,
+	MOB_ELEMENTLV,
 	MOB_MODE,
 	MOB_MVPEXP,
 	MOB_ID,

+ 15 - 5
src/map/script_constants.hpp

@@ -3776,10 +3776,11 @@
 	export_constant(MOB_NAME);
 	export_constant(MOB_LV);
 	export_constant(MOB_MAXHP);
+	export_constant(MOB_MAXSP);
 	export_constant(MOB_BASEEXP);
 	export_constant(MOB_JOBEXP);
-	export_constant(MOB_ATK1);
-	export_constant(MOB_ATK2);
+	export_constant(MOB_ATKMIN);
+	export_constant(MOB_ATKMAX);
 	export_constant(MOB_DEF);
 	export_constant(MOB_MDEF);
 	export_constant(MOB_RES);
@@ -3790,16 +3791,25 @@
 	export_constant(MOB_INT);
 	export_constant(MOB_DEX);
 	export_constant(MOB_LUK);
-	export_constant(MOB_RANGE);
-	export_constant(MOB_RANGE2);
-	export_constant(MOB_RANGE3);
+	export_constant(MOB_SPEED);
+	export_constant(MOB_ATKRANGE);
+	export_constant(MOB_SKILLRANGE);
+	export_constant(MOB_CHASERANGE);
 	export_constant(MOB_SIZE);
 	export_constant(MOB_RACE);
 	export_constant(MOB_ELEMENT);
+	export_constant(MOB_ELEMENTLV);
 	export_constant(MOB_MODE);
 	export_constant(MOB_MVPEXP);
 	export_constant(MOB_ID);
 
+	// Renamed monsterinfo types - 2025-03-11
+	export_deprecated_constant2("MOB_ATK1",MOB_ATKMIN); 
+	export_deprecated_constant2("MOB_ATK2",MOB_ATKMAX);
+	export_deprecated_constant2("MOB_RANGE",MOB_ATKRANGE);
+	export_deprecated_constant2("MOB_RANGE2",MOB_SKILLRANGE);
+	export_deprecated_constant2("MOB_RANGE3",MOB_CHASERANGE);
+
 	/* petinfo types */
 	export_constant(PETINFO_ID);
 	export_constant(PETINFO_CLASS);