From 803a139e78f2f024333367cce709959b5826290b Mon Sep 17 00:00:00 2001 From: Atemo Date: Sat, 16 Apr 2016 15:55:20 +0200 Subject: [PATCH 1/4] Correct docs and script follow up the refactor of EQI --- doc/script_commands.txt | 42 ++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index c72292ecb5d..37493fdf621 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -2489,27 +2489,27 @@ This function returns the item ID of the item equipped in the equipment slot specified on the invoking character. If nothing is equipped there, it returns -1. Valid equipment slots are: -EQI_HEAD_TOP (1) - Upper Headgear -EQI_ARMOR (2) - Armor (jackets, robes) -EQI_HAND_L (3) - Left hand (weapons, shields) -EQI_HAND_R (4) - Right hand (weapons) -EQI_GARMENT (5) - Garment (mufflers, hoods, manteaus) -EQI_SHOES (6) - Footgear (shoes, boots) -EQI_ACC_L (7) - Accessory 1 -EQI_ACC_R (8) - Accessory 2 -EQI_HEAD_MID (9) - Middle Headgear (masks, glasses) -EQI_HEAD_LOW (10) - Lower Headgear (beards, some masks) -EQI_COSTUME_HEAD_LOW (11) - Lower Costume Headgear -EQI_COSTUME_HEAD_MID (12) - Middle Costume Headgear -EQI_COSTUME_HEAD_TOP (13) - Upper Costume Headgear -EQI_COSTUME_GARMENT (14) - Costume Garment -EQI_AMMO (15) - Arrow/Ammunition -EQI_SHADOW_ARMOR (16) - Shadow Armor -EQI_SHADOW_WEAPON (17) - Shadow Weapon -EQI_SHADOW_SHIELD (18) - Shadow Shield -EQI_SHADOW_SHOES (19) - Shadow Shoes -EQI_SHADOW_ACC_R (20) - Shadow Accessory 2 -EQI_SHADOW_ACC_L (21) - Shadow Accessory 1 +EQI_ACC_L (0) - Accessory 1 +EQI_ACC_R (1) - Accessory 2 +EQI_SHOES (2) - Footgear (shoes, boots) +EQI_GARMENT (3) - Garment (mufflers, hoods, manteaux) +EQI_HEAD_LOW (4) - Lower Headgear (beards, some masks) +EQI_HEAD_MID (5) - Middle Headgear (masks, glasses) +EQI_HEAD_TOP (6) - Upper Headgear +EQI_ARMOR (7) - Armor (jackets, robes) +EQI_HAND_L (8) - Left hand (weapons, shields) +EQI_HAND_R (9) - Right hand (weapons) +EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear +EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear +EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear +EQI_COSTUME_GARMENT (13) - Costume Garment +EQI_AMMO (14) - Arrow/Ammunition +EQI_SHADOW_ARMOR (15) - Shadow Armor +EQI_SHADOW_WEAPON (16) - Shadow Weapon +EQI_SHADOW_SHIELD (17) - Shadow Shield +EQI_SHADOW_SHOES (18) - Shadow Shoes +EQI_SHADOW_ACC_R (19) - Shadow Accessory 2 +EQI_SHADOW_ACC_L (20) - Shadow Accessory 1 Notice that a few items occupy several equipment slots, and if the character is wearing such an item, 'getequipid' will return its ID number for either slot. From 05a1b61beded08b7759b59ef381b4ddbad791abf Mon Sep 17 00:00:00 2001 From: Atemo Date: Sat, 16 Apr 2016 16:45:33 +0200 Subject: [PATCH 2/4] Correct script part --- npc/custom/card_remover.txt | 9 ++++----- npc/custom/item_signer.txt | 8 ++++---- npc/merchants/advanced_refiner.txt | 9 +++++---- npc/quests/seals/mjolnir_seal.txt | 20 +++++++++++--------- npc/quests/thana_quest.txt | 4 ++-- npc/re/jobs/novice/academy.txt | 5 +++-- npc/re/merchants/advanced_refiner.txt | 12 +++++++----- npc/re/merchants/blessed_refiner.txt | 6 +++--- npc/re/merchants/hd_refiner.txt | 12 ++++++------ npc/re/merchants/refine.txt | 14 +++++++------- npc/re/merchants/ticket_refiner.txt | 6 +++--- 11 files changed, 55 insertions(+), 50 deletions(-) diff --git a/npc/custom/card_remover.txt b/npc/custom/card_remover.txt index 54721f3fd27..37b449af07c 100644 --- a/npc/custom/card_remover.txt +++ b/npc/custom/card_remover.txt @@ -31,15 +31,14 @@ prt_in,28,73,4 script Wise Old Woman#eAcustom 78,{ next; setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - set .@menu$,""; + setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for( set .@i,1; .@i <= 10; set .@i,.@i+1 ) { - if( getequipisequiped(.@i) ) - set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]"; - + if( getequipisequiped(.@indizes[.@i]) ) + set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@indizes[.@i]) + "]"; set .@menu$, .@menu$ + ":"; } - set .@part,select(.@menu$); + set .@part, .@indizes[ select(.@menu$) ]; if(!getequipisequiped(.@part)) { mes "[Wise Old Woman]"; mes "Young one... Your not wearing anything there that I can remove cards from."; diff --git a/npc/custom/item_signer.txt b/npc/custom/item_signer.txt index 6bd94dd2749..45350483e16 100644 --- a/npc/custom/item_signer.txt +++ b/npc/custom/item_signer.txt @@ -52,13 +52,13 @@ prt_in,24,61,7 script Perchik 47,{ mes "Show me your items to sign..."; next; setarray .@pos$[1],"Upper Headgear","Armor","Left hand","Right hand","Garment","Footgear","Left Accessory","Right Accessory","Mid Headgear","Lower Headgear"; - set .@menu$,""; + setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for (set .@i,1; .@i<=10; set .@i,.@i+1) { - if (getequipisequiped(.@i)) - set .@menu$, .@menu$+.@pos$[.@i]+" [^0055FF"+getequipname(.@i)+"^000000]"; + if (getequipisequiped(.@indizes[.@i])) + set .@menu$, .@menu$+.@pos$[.@i]+" [^0055FF"+getequipname(.@indizes[.@i])+"^000000]"; set .@menu$, .@menu$+":"; } - set .@part, select(.@menu$); + set .@part, .@indizes[ select(.@menu$) ]; set .@id, getequipid(.@part); set .@ref, getequiprefinerycnt(.@part); mes "[Perchik]"; diff --git a/npc/merchants/advanced_refiner.txt b/npc/merchants/advanced_refiner.txt index b13800932f9..5bac6973e37 100644 --- a/npc/merchants/advanced_refiner.txt +++ b/npc/merchants/advanced_refiner.txt @@ -38,10 +38,11 @@ payon,157,146,6 script Suhnbi#cash 85,{ next; setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - set .@menu$,""; + setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; + for(set .@i,1; .@i<=10; set .@i,.@i+1) { - if (getequipisequiped(.@i)) { - set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]"; + if (getequipisequiped(.@indizes[.@i])) { + set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@indizes[.@i]) + "]"; set .@equipped,1; } set .@menu$, .@menu$ + ":"; @@ -51,7 +52,7 @@ payon,157,146,6 script Suhnbi#cash 85,{ mes "I don't think I can refine any items you have..."; close; } - set .@part, select(.@menu$); + set .@part, .@indizes[ select(.@menu$) ]; if (!getequipisequiped(.@part)) //custom check close; diff --git a/npc/quests/seals/mjolnir_seal.txt b/npc/quests/seals/mjolnir_seal.txt index d249fb4c33e..1d10a06207d 100644 --- a/npc/quests/seals/mjolnir_seal.txt +++ b/npc/quests/seals/mjolnir_seal.txt @@ -1946,13 +1946,14 @@ mjolnir_01,35,136,7 script Dwarf Blacksmith#west 826,{ next; setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - set .@menu$,""; + setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; + for(set .@i,1; .@i <= 10; set .@i,.@i+1) { - if (getequipisequiped(.@i)) - set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]"; + if (getequipisequiped(.@indizes[.@i])) + set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@indizes[.@i]) + "]"; set .@menu$, .@menu$ + ":"; } - set .@part,select(.@menu$); + set .@part, .@indizes[ select(.@menu$) ]; if (getequipisequiped(.@part) == 0) close; @@ -2162,15 +2163,16 @@ mjolnir_01,35,136,7 script Dwarf Blacksmith#west 826,{ mes "Great...!"; mes "Which one should I upgrade first, huh? My heart is pounding with anticipation..."; next; - + setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - set .@menu$,""; + setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; + for(set .@i,1; .@i <= 10; set .@i,.@i+1) { - if (getequipisequiped(.@i)) - set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]"; + if (getequipisequiped(.@indizes[.@i])) + set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@indizes[.@i]) + "]"; set .@menu$, .@menu$ + ":"; } - set .@part,select(.@menu$); + set .@part, .@indizes[ select(.@menu$) ]; if (getequipisequiped(.@part) == 0) close; diff --git a/npc/quests/thana_quest.txt b/npc/quests/thana_quest.txt index 3fadc6c4c85..3d50e2b227d 100644 --- a/npc/quests/thana_quest.txt +++ b/npc/quests/thana_quest.txt @@ -914,8 +914,8 @@ tha_t03,67,70,0 script Rune Device#tt1 111,4,4,{ next; goto L_Key; } - else if (getequipweaponlv(4) == 4) { - mes "^3355FFWith your "+getequipname(4)+" in"; + else if (getequipweaponlv(EQI_HAND_R) == 4) { + mes "^3355FFWith your "+getequipname(EQI_HAND_R)+" in"; mes "hand, you smash the energy"; mes "field with all of your strength. After absorbing the impact, the"; mes "field fizzles out with a soft,"; diff --git a/npc/re/jobs/novice/academy.txt b/npc/re/jobs/novice/academy.txt index 6cbfbbafdad..9807c2d7a85 100644 --- a/npc/re/jobs/novice/academy.txt +++ b/npc/re/jobs/novice/academy.txt @@ -12678,9 +12678,10 @@ izlude_d,153,126,1 duplicate(Refinery Owner Han#iz) Refinery Owner Han#iz_d 4_M_ mes "Select the refining equipment."; next; setarray .@position$[1],"Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; + setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for(set .@i,1; .@i<=10; set .@i,.@i+1) - .@menu$ = .@menu$+(getequipisequiped(.@i)?getequipname(.@i):.@position$[.@i]+" - [Unarmed]")+":"; - .@part = select(.@menu$); + .@menu$ = .@menu$+(getequipisequiped(.@indizes[.@i])?getequipname(.@indizes[.@i]):.@position$[.@i]+" - [Unarmed]")+":"; + .@part = .@indizes[ select(.@menu$) ]; if (!getequipisequiped(.@part)) { mes "[Refining Machine Wagjak]"; mes "^ff0000- Error number 000"+.@part+" -^000000"; diff --git a/npc/re/merchants/advanced_refiner.txt b/npc/re/merchants/advanced_refiner.txt index 482fa6d5703..ff784ed130b 100644 --- a/npc/re/merchants/advanced_refiner.txt +++ b/npc/re/merchants/advanced_refiner.txt @@ -29,11 +29,13 @@ malangdo,221,174,6 script Holink#mal_cash 559,{ mes "My daughter is so proud of me, Holink~"; mes "What should Holink~ refine today?"; next; - setarray .@position$[1],"Head","Body","Left Hand","Right Hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - set .@menu$,""; - for(set .@i,1; .@i<=10; set .@i,.@i+1) - set .@menu$, .@menu$+((getequipisequiped(.@i))?getequipname(.@i):.@position$[.@i]+"-[Empty]")+":"; - set .@part, select(.@menu$); + + setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; + setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; + for (set .@i,1; .@i<=10; set .@i,.@i+1) + set .@menu$, .@menu$ + ((getequipisequiped(.@indizes[.@i]))?getequipname(.@indizes[.@i]):.@position$[.@i] +"-[Empty]")+":"; + set .@part, .@indizes[ select(.@menu$) ]; + if (!getequipisequiped(.@part)) { mes "[Holink]"; switch(.@part) { diff --git a/npc/re/merchants/blessed_refiner.txt b/npc/re/merchants/blessed_refiner.txt index 20b94e89f2a..3beb9ca064b 100644 --- a/npc/re/merchants/blessed_refiner.txt +++ b/npc/re/merchants/blessed_refiner.txt @@ -33,10 +33,10 @@ mes "How about it? Do you want to refine?"; next; setarray .@position$[1],"Head","Body","Left Hand","Right Hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - set .@menu$,""; + setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for(set .@i,1; .@i<=10; set .@i,.@i+1) - set .@menu$, .@menu$+((getequipisequiped(.@i))?getequipname(.@i):.@position$[.@i]+"-[Unequipped]")+":"; - set .@part, select(.@menu$); + set .@menu$, .@menu$+((getequipisequiped(.@indizes[.@i]))?getequipname(.@indizes[.@i]):.@position$[.@i]+"-[Unequipped]")+":"; + set .@part, .@indizes[ select(.@menu$) ]; if (!getequipisequiped(.@part)) { mes "[Blacksmith Dister]"; switch(.@part) { diff --git a/npc/re/merchants/hd_refiner.txt b/npc/re/merchants/hd_refiner.txt index a5da27b2a0f..fc4e20b3613 100644 --- a/npc/re/merchants/hd_refiner.txt +++ b/npc/re/merchants/hd_refiner.txt @@ -33,10 +33,10 @@ mes "So lets kick this into overdrive, what d' ya say? What item do you want to refine?"; next; setarray .@position$[1],"Head","Body","Left Hand","Right Hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - set .@menu$,""; + setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for(set .@i,1; .@i<=10; set .@i,.@i+1) - set .@menu$, .@menu$+((getequipisequiped(.@i))?getequipname(.@i):.@position$[.@i]+"-[Not equipped]")+":"; - set .@part, select(.@menu$); + set .@menu$, .@menu$+((getequipisequiped(.@indizes[.@i]))?getequipname(.@indizes[.@i]):.@position$[.@i]+"-[Not equipped]")+":"; + set .@part, .@indizes[ select(.@menu$) ]; if (!getequipisequiped(.@part)) { mes "[Blacksmith Mighty Hammer]"; switch(.@part) { @@ -166,10 +166,10 @@ lhz_in02,280,19,3 duplicate(MightyHammer) Mighty Hammer#lhz 826 mes "Which equipment do you want to refine?"; next; setarray .@position$[1],"Head","Body","Left Hand","Right Hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - set .@menu$,""; + setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for(set .@i,1; .@i<=10; set .@i,.@i+1) - set .@menu$, .@menu$+((getequipisequiped(.@i))?getequipname(.@i):.@position$[.@i]+"-[Unequipped]")+":"; - set .@part, select(.@menu$); + set .@menu$, .@menu$+((getequipisequiped(.@indizes[.@i]))?getequipname(.@indizes[.@i]):.@position$[.@i]+"-[Unequipped]")+":"; + set .@part, .@indizes[ select(.@menu$) ]; if (!getequipisequiped(.@part)) { mes "[Basta]"; switch(.@part) { diff --git a/npc/re/merchants/refine.txt b/npc/re/merchants/refine.txt index cbe98dc7459..138db35e262 100644 --- a/npc/re/merchants/refine.txt +++ b/npc/re/merchants/refine.txt @@ -58,10 +58,10 @@ function script refinenew { next; setarray .@position$[1],"Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - set .@menu$,""; + setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for(set .@i,1; .@i<=10; set .@i,.@i+1) { - if (getequipisequiped(.@i)) { - set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]"; + if (getequipisequiped(.@indizes[.@i])) { + set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@indizes[.@i]) + "]"; set .@equipped,1; } set .@menu$, .@menu$ + ":"; @@ -71,7 +71,7 @@ function script refinenew { mes "I don't think I can refine any items you have..."; close; } - set .@part, select(.@menu$); + set .@part, .@indizes[ select(.@menu$) ]; if (!getequipisequiped(.@part)) { //custom check mes "["+ .@npc_name$ +"]"; @@ -397,10 +397,10 @@ malangdo,224,172,6 script Clink#mal_normal 544,{ mes "Yes!!! You!! You want to refine?"; next; setarray .@position$[1],"Head","Body","Left Hand","Right Hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - set .@menu$,""; + setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for(set .@i,1; .@i<=10; set .@i,.@i+1) - set .@menu$, .@menu$+((getequipisequiped(.@i))?getequipname(.@i):.@position$[.@i]+"-[Empty]")+":"; - set .@part, select(.@menu$); + set .@menu$, .@menu$+((getequipisequiped(.@indizes[.@i]))?getequipname(.@indizes[.@i]):.@position$[.@i]+"-[Empty]")+":"; + set .@part, .@indizes[ select(.@menu$) ]; if (!getequipisequiped(.@part)) { mes "[Clink]"; switch(.@part) { diff --git a/npc/re/merchants/ticket_refiner.txt b/npc/re/merchants/ticket_refiner.txt index 92738352113..6238c9cb35b 100644 --- a/npc/re/merchants/ticket_refiner.txt +++ b/npc/re/merchants/ticket_refiner.txt @@ -60,10 +60,10 @@ prontera,184,177,6 script Refine Master 851,{ mes "Which equipment would you like to refine?"; next; setarray .@position$[1],"Head upper","Armor","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head middle","Head lower"; - set .@menu$,""; + setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for(set .@i,1; .@i<=10; set .@i,.@i+1) - set .@menu$, .@menu$+((getequipisequiped(.@i))?getequipname(.@i):.@position$[.@i]+"- [Empty]")+":"; - set .@part, select(.@menu$); + set .@menu$, .@menu$+((getequipisequiped(.@indizes[.@i]))?getequipname(.@indizes[.@i]):.@position$[.@i]+"- [Empty]")+":"; + set .@part, .@indizes[ select(.@menu$) ]; if (!getequipisequiped(.@part)) { mes "[Refine Master]"; mes "You have to equip the item you want to refine."; From 7d6be7e21ea831130111de846b81700cfc6c6c1e Mon Sep 17 00:00:00 2001 From: Atemo Date: Mon, 18 Apr 2016 15:50:28 +0200 Subject: [PATCH 3/4] Add F_getpositionname to return the EQI_* name --- npc/custom/card_remover.txt | 12 +++++------- npc/custom/item_signer.txt | 9 ++++----- npc/merchants/advanced_refiner.txt | 10 ++++------ npc/merchants/refine.txt | 12 +++++------- npc/other/Global_Functions.txt | 12 ++++++++++++ npc/quests/seals/mjolnir_seal.txt | 20 ++++++++------------ npc/re/jobs/novice/academy.txt | 7 +++---- npc/re/merchants/advanced_refiner.txt | 7 +++---- npc/re/merchants/blessed_refiner.txt | 7 +++---- npc/re/merchants/hd_refiner.txt | 14 ++++++-------- npc/re/merchants/refine.txt | 16 +++++++--------- npc/re/merchants/ticket_refiner.txt | 6 +++--- 12 files changed, 63 insertions(+), 69 deletions(-) diff --git a/npc/custom/card_remover.txt b/npc/custom/card_remover.txt index 37b449af07c..29bbbff1b43 100644 --- a/npc/custom/card_remover.txt +++ b/npc/custom/card_remover.txt @@ -30,15 +30,13 @@ prt_in,28,73,4 script Wise Old Woman#eAcustom 78,{ mes "Very well. Which item shall I examine for you?"; next; - setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; - for( set .@i,1; .@i <= 10; set .@i,.@i+1 ) - { - if( getequipisequiped(.@indizes[.@i]) ) - set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@indizes[.@i]) + "]"; + setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; + for( set .@i,1; .@i <= 10; set .@i,.@i+1 ) { + if( getequipisequiped(.@indices[.@i]) ) + set .@menu$, .@menu$ + F_getpositionname(.@indices[.@i]) + "-[" + getequipname(.@indices[.@i]) + "]"; set .@menu$, .@menu$ + ":"; } - set .@part, .@indizes[ select(.@menu$) ]; + set .@part, .@indices[ select(.@menu$) ]; if(!getequipisequiped(.@part)) { mes "[Wise Old Woman]"; mes "Young one... Your not wearing anything there that I can remove cards from."; diff --git a/npc/custom/item_signer.txt b/npc/custom/item_signer.txt index 45350483e16..79f1015d54f 100644 --- a/npc/custom/item_signer.txt +++ b/npc/custom/item_signer.txt @@ -51,14 +51,13 @@ prt_in,24,61,7 script Perchik 47,{ mes "[Perchik]"; mes "Show me your items to sign..."; next; - setarray .@pos$[1],"Upper Headgear","Armor","Left hand","Right hand","Garment","Footgear","Left Accessory","Right Accessory","Mid Headgear","Lower Headgear"; - setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; + setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for (set .@i,1; .@i<=10; set .@i,.@i+1) { - if (getequipisequiped(.@indizes[.@i])) - set .@menu$, .@menu$+.@pos$[.@i]+" [^0055FF"+getequipname(.@indizes[.@i])+"^000000]"; + if (getequipisequiped(.@indices[.@i])) + set .@menu$, .@menu$ + F_getpositionname(.@indices[.@i]) +" [^0055FF"+getequipname(.@indices[.@i])+"^000000]"; set .@menu$, .@menu$+":"; } - set .@part, .@indizes[ select(.@menu$) ]; + set .@part, .@indices[ select(.@menu$) ]; set .@id, getequipid(.@part); set .@ref, getequiprefinerycnt(.@part); mes "[Perchik]"; diff --git a/npc/merchants/advanced_refiner.txt b/npc/merchants/advanced_refiner.txt index 5bac6973e37..c3db8eaa06a 100644 --- a/npc/merchants/advanced_refiner.txt +++ b/npc/merchants/advanced_refiner.txt @@ -37,12 +37,10 @@ payon,157,146,6 script Suhnbi#cash 85,{ mes "know what you want to refine."; next; - setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; - + setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for(set .@i,1; .@i<=10; set .@i,.@i+1) { - if (getequipisequiped(.@indizes[.@i])) { - set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@indizes[.@i]) + "]"; + if (getequipisequiped(.@indices[.@i])) { + set .@menu$, .@menu$ + F_getpositionname(.@indices[.@i]) + "-[" + getequipname(.@indices[.@i]) + "]"; set .@equipped,1; } set .@menu$, .@menu$ + ":"; @@ -52,7 +50,7 @@ payon,157,146,6 script Suhnbi#cash 85,{ mes "I don't think I can refine any items you have..."; close; } - set .@part, .@indizes[ select(.@menu$) ]; + set .@part, .@indices[ select(.@menu$) ]; if (!getequipisequiped(.@part)) //custom check close; diff --git a/npc/merchants/refine.txt b/npc/merchants/refine.txt index 1c74f691238..21682d4bca4 100644 --- a/npc/merchants/refine.txt +++ b/npc/merchants/refine.txt @@ -569,12 +569,10 @@ function script refinemain { mes "know what you want me to refine."; next; - setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; - set .@menu$,""; - for(set .@i,1; .@i 8); } + +////////////////////////////////////////////////////////////////////////////////// +// 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) ]; +} diff --git a/npc/quests/seals/mjolnir_seal.txt b/npc/quests/seals/mjolnir_seal.txt index 1d10a06207d..3145e71b98a 100644 --- a/npc/quests/seals/mjolnir_seal.txt +++ b/npc/quests/seals/mjolnir_seal.txt @@ -1945,15 +1945,13 @@ mjolnir_01,35,136,7 script Dwarf Blacksmith#west 826,{ mes "Which one should I upgrade first, huh? My heart is pounding with anticipation..."; next; - setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; - + setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for(set .@i,1; .@i <= 10; set .@i,.@i+1) { - if (getequipisequiped(.@indizes[.@i])) - set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@indizes[.@i]) + "]"; + if (getequipisequiped(.@indices[.@i])) + set .@menu$, .@menu$ + F_getpositionname(.@indices[.@i]) + "-[" + getequipname(.@indices[.@i]) + "]"; set .@menu$, .@menu$ + ":"; } - set .@part, .@indizes[ select(.@menu$) ]; + set .@part, .@indices[ select(.@menu$) ]; if (getequipisequiped(.@part) == 0) close; @@ -2164,15 +2162,13 @@ mjolnir_01,35,136,7 script Dwarf Blacksmith#west 826,{ mes "Which one should I upgrade first, huh? My heart is pounding with anticipation..."; next; - setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; - + setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for(set .@i,1; .@i <= 10; set .@i,.@i+1) { - if (getequipisequiped(.@indizes[.@i])) - set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@indizes[.@i]) + "]"; + if (getequipisequiped(.@indices[.@i])) + set .@menu$, .@menu$ + F_getpositionname(.@indices[.@i]) + "-[" + getequipname(.@indices[.@i]) + "]"; set .@menu$, .@menu$ + ":"; } - set .@part, .@indizes[ select(.@menu$) ]; + set .@part, .@indices[ select(.@menu$) ]; if (getequipisequiped(.@part) == 0) close; diff --git a/npc/re/jobs/novice/academy.txt b/npc/re/jobs/novice/academy.txt index 9807c2d7a85..4ec0016d53a 100644 --- a/npc/re/jobs/novice/academy.txt +++ b/npc/re/jobs/novice/academy.txt @@ -12677,11 +12677,10 @@ izlude_d,153,126,1 duplicate(Refinery Owner Han#iz) Refinery Owner Han#iz_d 4_M_ mes "Checking the user.. Completed."; mes "Select the refining equipment."; next; - setarray .@position$[1],"Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; + setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for(set .@i,1; .@i<=10; set .@i,.@i+1) - .@menu$ = .@menu$+(getequipisequiped(.@indizes[.@i])?getequipname(.@indizes[.@i]):.@position$[.@i]+" - [Unarmed]")+":"; - .@part = .@indizes[ select(.@menu$) ]; + .@menu$ = .@menu$ + ( getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]): F_getpositionname(.@indices[.@i]) +" - [Unarmed]" ) +":"; + .@part = .@indices[ select(.@menu$) ]; if (!getequipisequiped(.@part)) { mes "[Refining Machine Wagjak]"; mes "^ff0000- Error number 000"+.@part+" -^000000"; diff --git a/npc/re/merchants/advanced_refiner.txt b/npc/re/merchants/advanced_refiner.txt index ff784ed130b..a6ce065a17a 100644 --- a/npc/re/merchants/advanced_refiner.txt +++ b/npc/re/merchants/advanced_refiner.txt @@ -30,11 +30,10 @@ malangdo,221,174,6 script Holink#mal_cash 559,{ mes "What should Holink~ refine today?"; next; - setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; + setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for (set .@i,1; .@i<=10; set .@i,.@i+1) - set .@menu$, .@menu$ + ((getequipisequiped(.@indizes[.@i]))?getequipname(.@indizes[.@i]):.@position$[.@i] +"-[Empty]")+":"; - set .@part, .@indizes[ select(.@menu$) ]; + set .@menu$, .@menu$ + ( getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]) : F_getpositionname(.@indices[.@i]) +"-[Empty]" ) +":"; + set .@part, .@indices[ select(.@menu$) ]; if (!getequipisequiped(.@part)) { mes "[Holink]"; diff --git a/npc/re/merchants/blessed_refiner.txt b/npc/re/merchants/blessed_refiner.txt index 3beb9ca064b..33d15be5443 100644 --- a/npc/re/merchants/blessed_refiner.txt +++ b/npc/re/merchants/blessed_refiner.txt @@ -32,11 +32,10 @@ mes "[Blacksmith Dister]"; mes "How about it? Do you want to refine?"; next; - setarray .@position$[1],"Head","Body","Left Hand","Right Hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; + setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for(set .@i,1; .@i<=10; set .@i,.@i+1) - set .@menu$, .@menu$+((getequipisequiped(.@indizes[.@i]))?getequipname(.@indizes[.@i]):.@position$[.@i]+"-[Unequipped]")+":"; - set .@part, .@indizes[ select(.@menu$) ]; + set .@menu$, .@menu$ + ( getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]) : F_getpositionname(.@indices[.@i]) +"-[Unequipped]" ) +":"; + set .@part, .@indices[ select(.@menu$) ]; if (!getequipisequiped(.@part)) { mes "[Blacksmith Dister]"; switch(.@part) { diff --git a/npc/re/merchants/hd_refiner.txt b/npc/re/merchants/hd_refiner.txt index fc4e20b3613..61eaa7d4645 100644 --- a/npc/re/merchants/hd_refiner.txt +++ b/npc/re/merchants/hd_refiner.txt @@ -32,11 +32,10 @@ mes "[Blacksmith Mighty Hammer]"; mes "So lets kick this into overdrive, what d' ya say? What item do you want to refine?"; next; - setarray .@position$[1],"Head","Body","Left Hand","Right Hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; + setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for(set .@i,1; .@i<=10; set .@i,.@i+1) - set .@menu$, .@menu$+((getequipisequiped(.@indizes[.@i]))?getequipname(.@indizes[.@i]):.@position$[.@i]+"-[Not equipped]")+":"; - set .@part, .@indizes[ select(.@menu$) ]; + set .@menu$, .@menu$ + ( getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]) : F_getpositionname(.@indices[.@i]) +"-[Not equipped]" ) +":"; + set .@part, .@indices[ select(.@menu$) ]; if (!getequipisequiped(.@part)) { mes "[Blacksmith Mighty Hammer]"; switch(.@part) { @@ -165,11 +164,10 @@ lhz_in02,280,19,3 duplicate(MightyHammer) Mighty Hammer#lhz 826 mes "[Basta]"; mes "Which equipment do you want to refine?"; next; - setarray .@position$[1],"Head","Body","Left Hand","Right Hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; + setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for(set .@i,1; .@i<=10; set .@i,.@i+1) - set .@menu$, .@menu$+((getequipisequiped(.@indizes[.@i]))?getequipname(.@indizes[.@i]):.@position$[.@i]+"-[Unequipped]")+":"; - set .@part, .@indizes[ select(.@menu$) ]; + set .@menu$, .@menu$ + ( getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]) : F_getpositionname(.@indices[.@i]) +"-[Unequipped]" ) +":"; + set .@part, .@indices[ select(.@menu$) ]; if (!getequipisequiped(.@part)) { mes "[Basta]"; switch(.@part) { diff --git a/npc/re/merchants/refine.txt b/npc/re/merchants/refine.txt index 138db35e262..ad38d5aab1f 100644 --- a/npc/re/merchants/refine.txt +++ b/npc/re/merchants/refine.txt @@ -57,11 +57,10 @@ function script refinenew { mes "What do you want me to refine?"; next; - setarray .@position$[1],"Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; + setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for(set .@i,1; .@i<=10; set .@i,.@i+1) { - if (getequipisequiped(.@indizes[.@i])) { - set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@indizes[.@i]) + "]"; + if (getequipisequiped(.@indices[.@i])) { + set .@menu$, .@menu$ + F_getpositionname(.@indices[.@i]) + "-[" + getequipname(.@indices[.@i]) + "]"; set .@equipped,1; } set .@menu$, .@menu$ + ":"; @@ -71,7 +70,7 @@ function script refinenew { mes "I don't think I can refine any items you have..."; close; } - set .@part, .@indizes[ select(.@menu$) ]; + set .@part, .@indices[ select(.@menu$) ]; if (!getequipisequiped(.@part)) { //custom check mes "["+ .@npc_name$ +"]"; @@ -396,11 +395,10 @@ malangdo,224,172,6 script Clink#mal_normal 544,{ mes "Who do you think I am?"; mes "Yes!!! You!! You want to refine?"; next; - setarray .@position$[1],"Head","Body","Left Hand","Right Hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; - setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; + setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for(set .@i,1; .@i<=10; set .@i,.@i+1) - set .@menu$, .@menu$+((getequipisequiped(.@indizes[.@i]))?getequipname(.@indizes[.@i]):.@position$[.@i]+"-[Empty]")+":"; - set .@part, .@indizes[ select(.@menu$) ]; + set .@menu$, .@menu$ + ( getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]) : F_getpositionname(.@indices[.@i]) +"-[Empty]" ) +":"; + set .@part, .@indices[ select(.@menu$) ]; if (!getequipisequiped(.@part)) { mes "[Clink]"; switch(.@part) { diff --git a/npc/re/merchants/ticket_refiner.txt b/npc/re/merchants/ticket_refiner.txt index 6238c9cb35b..73ea943f7c1 100644 --- a/npc/re/merchants/ticket_refiner.txt +++ b/npc/re/merchants/ticket_refiner.txt @@ -60,10 +60,10 @@ prontera,184,177,6 script Refine Master 851,{ mes "Which equipment would you like to refine?"; next; setarray .@position$[1],"Head upper","Armor","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head middle","Head lower"; - setarray .@indizes[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; + setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for(set .@i,1; .@i<=10; set .@i,.@i+1) - set .@menu$, .@menu$+((getequipisequiped(.@indizes[.@i]))?getequipname(.@indizes[.@i]):.@position$[.@i]+"- [Empty]")+":"; - set .@part, .@indizes[ select(.@menu$) ]; + set .@menu$, .@menu$+((getequipisequiped(.@indices[.@i]))?getequipname(.@indices[.@i]):.@position$[.@i]+"- [Empty]")+":"; + set .@part, .@indices[ select(.@menu$) ]; if (!getequipisequiped(.@part)) { mes "[Refine Master]"; mes "You have to equip the item you want to refine."; From 1a87f90aa9a9c8f40dec41517b6f2d749c73378e Mon Sep 17 00:00:00 2001 From: Atemo Date: Mon, 18 Apr 2016 16:48:54 +0200 Subject: [PATCH 4/4] Structure change of F_getpositionname --- npc/other/Global_Functions.txt | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/npc/other/Global_Functions.txt b/npc/other/Global_Functions.txt index e36b7898aae..e386a4b550c 100644 --- a/npc/other/Global_Functions.txt +++ b/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"; + } }