Ver código fonte

Structure change of F_getpositionname

Atemo 9 anos atrás
pai
commit
1a87f90aa9
1 arquivos alterados com 25 adições e 5 exclusões
  1. 25 5
      npc/other/Global_Functions.txt

+ 25 - 5
npc/other/Global_Functions.txt

@@ -614,9 +614,29 @@ function	script	F_CanChangeJob	{
 // Return the position name of the EQI_* equipment slot.
 //////////////////////////////////////////////////////////////////////////////////
 function	script	F_getpositionname	{
-	setarray .@position$[0],
-		"Accessory 1", "Accessory 2", "Shoes", "Robe", "Head 3", "Head 2", "Head", "Body", "Left hand", "Right hand",
-		"Upper Costume Headgear", "Middle Costume Headgear", "Lower Costume Headgear", "Costume Garment", "Arrow/Ammunition", 
-		"Shadow Armor", "Shadow Weapon", "Shadow Shield", "Shadow Shoes", "Shadow Accessory 2", "Shadow Accessory 1";
-	return .@position$[ getarg(0) ];
+	switch( getarg(0,999) ) {
+		case EQI_ACC_L:		return "Accessory 1";
+		case EQI_ACC_R:		return "Accessory 2";
+		case EQI_SHOES:		return "Shoes";
+		case EQI_GARMENT:	return "Robe";
+		case EQI_HEAD_LOW:	return "Head 3";
+		case EQI_HEAD_MID:	return "Head 2";
+		case EQI_HEAD_TOP:	return "Head";
+		case EQI_ARMOR:		return "Body";
+		case EQI_HAND_L:	return "Left hand";
+		case EQI_HAND_R:	return "Right hand";
+		case EQI_COSTUME_HEAD_TOP:	return "Upper Costume Headgear";
+		case EQI_COSTUME_HEAD_MID:	return "Middle Costume Headgear";
+		case EQI_COSTUME_HEAD_LOW:	return "Lower Costume Headgear";
+		case EQI_COSTUME_GARMENT:	return "Costume Garment";
+		case EQI_AMMO:			return "Arrow/Ammunition";
+		case EQI_SHADOW_ARMOR:	return "Shadow Armor";
+		case EQI_SHADOW_WEAPON:	return "Shadow Weapon";
+		case EQI_SHADOW_SHIELD:	return "Shadow Shield";
+		case EQI_SHADOW_SHOES:	return "Shadow Shoes";
+		case EQI_SHADOW_ACC_R:	return "Shadow Accessory 2";
+		case EQI_SHADOW_ACC_L:	return "Shadow Accessory 1";
+		default:
+			return "Unknown";
+	}
 }