This NPC shows a menu list of orbs you have in your inventory from 4700-4862.
I'm having troubles switching from enchant orb range to enchantment orb list as seen below. Instead of using 4700-4862 I intend to just use the IDS 4703, 4723, 30001,505,4800,507.
Any ideas?
setarray .en_orb, 4700, 4862; // Range of IDs selected for enchanting.
Menu of .en_orb
set
[email protected]$, "";
set
[email protected], .en_orb[0];
while((set(
[email protected],
[email protected]+1)-1)<=.en_orb[1])
if(getiteminfo(
[email protected],2)>-1)
if(set(
[email protected],countitem(
[email protected]))) {
set
[email protected]$,
[email protected]$+getitemname(
[email protected])+" x"
[email protected]+":";
set
[email protected],
[email protected]+1; set
[email protected][
[email protected]],
[email protected];
}
Here's the entire script:
prontera,194,188,4 script Enchant 712,{
mes .npc$;
mes "Hello there!";
mes "I can enchant your items,";
mes "for a small fee of "+.pric+"z.";
emotion e_no1,0; next;
if(select("Yes:No")&2) { mes .npc$; mes "Alright, thanks anyways!"; close; }
if(Zeny<.pric) { mes .npc$; mes "I'm sorry you don't have enough Zeny, please come back later."; close; }
mes .npc$;
mes "Which item would you like to enchant?"; next;
while(set(
[email protected],
[email protected]+1)<=.e_len) {
if(getequipid(
[email protected])>-1)
set
[email protected]$,
[email protected]$+.eqp$[
[email protected]]+"- [^0000FF"+getitemname(getequipid(
[email protected]))+"^000000]:";
else set
[email protected]$,
[email protected]$+"^adb4be"+.eqp$[
[email protected]]+"- [Empty]^000000:";
}
select(
[email protected]$);
set
[email protected]_loc, @menu;
set
[email protected]_itm, getequipid(
[email protected]_loc);
if(
[email protected]_itm<0) {
mes .npc$;
mes "Hmm, I don't think you have anything equipped there.";
close;
}
set
[email protected]$, "";
set
[email protected], .en_orb[0];
while((set(
[email protected],
[email protected]+1)-1)<=.en_orb[1])
if(getiteminfo(
[email protected],2)>-1)
if(set(
[email protected],countitem(
[email protected]))) {
set
[email protected]$,
[email protected]$+getitemname(
[email protected])+" x"
[email protected]+":";
set
[email protected],
[email protected]+1; set
[email protected][
[email protected]],
[email protected];
}
if(
[email protected]$=="") {
mes .npc$;
mes "Hmm, you don't seem to have any enchantment orbs.";
close;
}
mes .npc$;
mes "Please, select an enchantment from the menu."; next;
select(
[email protected]$);
set
[email protected],
[email protected][@menu];
set
[email protected]$, ""; set
[email protected], 0;
while((set(
[email protected],
[email protected]+1))<4) {
if(getequipcardid(
[email protected]_loc,
[email protected]))
set
[email protected]$,
[email protected]$+(
[email protected]+1)+.crd_c$[
[email protected]]+" Slot- [^a92435"+getitemname(getequipcardid(
[email protected]_loc,
[email protected]))+"^000000]:";
else set
[email protected]$,
[email protected]$+(
[email protected]+1)+.crd_c$[
[email protected]]+" Slot- [^30ad25Empty^000000]:";
}
setarray
[email protected], getequipcardid(
[email protected]_loc,0), getequipcardid(
[email protected]_loc,1), getequipcardid(
[email protected]_loc,2), getequipcardid(
[email protected]_loc,3);
mes .npc$;
mes "Select a slot."; next;
set
[email protected], select(
[email protected]$);
set
[email protected], getequiprefinerycnt(
[email protected]_loc);
if(getequipcardid(
[email protected]_loc,@menu)) {
mes .npc$;
mes "Would you like me to remove this card?"; next;
if(select("Yes:No")&2) { mes .npc$; mes "Alright, thanks anyways!"; close; }
getitem getequipcardid(
[email protected]_loc,
[email protected]),1;
unequip(
[email protected]_loc);
delitem2
[email protected]_itm, 1, 1,
[email protected], 0,
[email protected][0],
[email protected][1],
[email protected][2],
[email protected][3];
set
[email protected][
[email protected]], 0;
getitem2
[email protected]_itm, 1, 1,
[email protected], 0,
[email protected][0],
[email protected][1],
[email protected][2],
[email protected][3];
}
if(rand(100)>.perc) {
mes .npc$;
mes "I'm sorry but I've failed you!";
misceffect 155; emotion e_sob,0;
set Zeny,Zeny-.pric;
close;
}
set Zeny,Zeny-.pric;
delitem
[email protected],1;
delitem2
[email protected]_itm, 1, 1,
[email protected], 0,
[email protected][0],
[email protected][1],
[email protected][2],
[email protected][3];
set
[email protected][
[email protected]],
[email protected];
getitem2
[email protected]_itm, 1, 1,
[email protected], 0,
[email protected][0],
[email protected][1],
[email protected][2],
[email protected][3];
misceffect .efet;
emotion e_no1,0;
mes .npc$;
mes "All done!";
equip
[email protected]_itm;
close;
//NPC Constants
OnInit:
//=-=-=-=-=-=-=Configuration=-=-=-=-=-=-=
set .npc$ , "[^0000FFEnchant Expert^000000]"; // NPC Name
set .pric , 1000000; // Price
set .efet , 154; // Effect Number
set .perc , rand(50,80); // Percent
setarray .crd_c$, "st", "nd", "rd", "th"; // Count
setarray .en_orb, 4700, 4862; // Range of IDs selected for enchanting.
setarray .eqp$ , "Upper Headgear", "Armor", "Left Hand", "Right Hand", "Garment",
"Shoes", "Accessory1", "Accessory2", "Mid Headgear", "Low Headgear";
set .e_len , getarraysize(.eqp$);
//=-=-=-=-=-=-=-=-Skorm-=-=-=-=-=-=-=-=-=
}