mawjustin Posted March 30, 2020 Group: Members Topic Count: 48 Topics Per Day: 0.01 Content Count: 124 Reputation: 6 Joined: 09/26/14 Last Seen: August 20, 2024 Share Posted March 30, 2020 Hi guys, may I ask for a script that removes all Random Option of an item in exchange for a certain item? Thanks! Quote Link to comment Share on other sites More sharing options...
1 Emistry Posted April 11, 2020 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2371 Joined: 10/28/11 Last Seen: 12 hours ago Share Posted April 11, 2020 try this. prontera,155,181,5 script Sample 4_F_KAFRA1,{ for (.@eqi = EQI_SHOES; .@eqi < EQI_HAND_R; .@eqi++) { .@equip_id = getequipid(.@eqi); if (.@equip_id > 0) .@menu$ = .@menu$ + getitemname(.@equip_id) + " ["+getitemslots(.@equip_id)+"]"; .@menu$ = .@menu$ + ":"; } mes "Select an equipment."; .@eqi = select(.@menu$) - 1 + EQI_SHOES; mes "Equip: "+getitemname(getequipid(.@eqi)); if (.itemid_size) { mes "Required Items:"; for (.@i = 0; .@i < .itemid_size; .@i++) { mes " -> "+F_InsertComma(.amount[.@i])+"x "+getitemname(.itemid[.@i]); if (countitem(.itemid[.@i]) < .amount[.@i]) .@fail++; } } if (!.@fail) { if (select("Reset Enchantment", "Cancel") == 1) { for (.@i = 0; .@i < .itemid_size; .@i++) delitem .itemid[.@i], .amount[.@i]; .@equip_id = getequipid(.@eqi); .@refine = getequiprefinerycnt(.@eqi); for (.@i = 0; .@i < 4; .@i++) .@card[.@i] = getequipcardid(.@eqi, .@i); delequip .@eqi; getitem2 .@equip_id, 1, 1,.@refine,0,.@card[0],.@card[1],.@card[2],.@card[3]; mes "Done reset enchant."; } } close; OnInit: setarray .itemid, 501, 502; setarray .amount, 1, 2; .itemid_size = getarraysize(.itemid); end; } Quote Link to comment Share on other sites More sharing options...
0 mawjustin Posted April 12, 2020 Group: Members Topic Count: 48 Topics Per Day: 0.01 Content Count: 124 Reputation: 6 Joined: 09/26/14 Last Seen: August 20, 2024 Author Share Posted April 12, 2020 On 4/12/2020 at 6:21 AM, Emistry said: try this. prontera,155,181,5 script Sample 4_F_KAFRA1,{ for (.@eqi = EQI_SHOES; .@eqi < EQI_HAND_R; .@eqi++) { .@equip_id = getequipid(.@eqi); if (.@equip_id > 0) .@menu$ = .@menu$ + getitemname(.@equip_id) + " ["+getitemslots(.@equip_id)+"]"; .@menu$ = .@menu$ + ":"; } mes "Select an equipment."; .@eqi = select(.@menu$) - 1 + EQI_SHOES; mes "Equip: "+getitemname(getequipid(.@eqi)); if (.itemid_size) { mes "Required Items:"; for (.@i = 0; .@i < .itemid_size; .@i++) { mes " -> "+F_InsertComma(.amount[.@i])+"x "+getitemname(.itemid[.@i]); if (countitem(.itemid[.@i]) < .amount[.@i]) .@fail++; } } if (!.@fail) { if (select("Reset Enchantment", "Cancel") == 1) { for (.@i = 0; .@i < .itemid_size; .@i++) delitem .itemid[.@i], .amount[.@i]; .@equip_id = getequipid(.@eqi); .@refine = getequiprefinerycnt(.@eqi); for (.@i = 0; .@i < 4; .@i++) .@card[.@i] = getequipcardid(.@eqi, .@i); delequip .@eqi; getitem2 .@equip_id, 1, 1,.@refine,0,.@card[0],.@card[1],.@card[2],.@card[3]; mes "Done reset enchant."; } } close; OnInit: setarray .itemid, 501, 502; setarray .amount, 1, 2; .itemid_size = getarraysize(.itemid); end; } Thank you! it works! I just did a bit of modification to align with my server. @Emistry sir, I did some changes in your file, how do we implement this? jupe_ele,38,50,5 script Tollere#1 4_F_KAFRA1,{ // // THIS WILL READ ALL THE ITEMS AVAILABLE, INCLUDING SHADOW EQUIPMENT for (.@eqi = EQI_SHOES; .@eqi <= EQI_SHADOW_ACC_L; .@eqi++) { .@equip_id = getequipid(.@eqi); if (.@equip_id > 0) .@menu$ = .@menu$ + getitemname(.@equip_id) + " ["+getitemslots(.@equip_id)+"]"; .@menu$ = .@menu$ + ":"; } mes .npc_n$; mes "Hello Adventurer!"; mes "my name is Tollere "; mes "I specialize in removing ^006600Enchantment^000000 and ^006600Random Option^000000"; mes "using ^FF0000"+getitemname(.itemid)+"^000000."; mes "which process do you need?"; // RESET ENCHANTMENT = REMOVE STONE/ORBS ON CARD SLOT, BUT RETAIN RANDOM OPTION // RANDOM OPTION REMOVAL = REMOVE RANDOM OPTION, BUT RETAIN THE ORBS/STONE ON CARD SLOT if (select("Reset Enchantment","Random Option Removal") == 1) { next; mes "Select an equipment for"; mes "^006600Enchant Removal^000000"; .@eqi = select(.@menu$) - 1 + EQI_SHOES; mes "Equip: "+getitemname(getequipid(.@eqi)); if (.itemid_size) { mes "Required Items:"; for (.@i = 0; .@i < .itemid_size; .@i++) { mes " -> "+F_InsertComma(.amount[.@i])+"x "+getitemname(.itemid[.@i]); if (countitem(.itemid[.@i]) < .amount[.@i]) .@fail++; } } if (!.@fail) { if (select("Reset Enchantment", "Cancel") == 1) { for(.@ii=0;.@ii<(MAX_ITEM_RDM_OPT-0);.@ii++){ .@r_id[.@ii] = getequiprandomoption(.s_all_loc[.@eqi],.@i,ROA_ID); .@r_v[.@ii] = getequiprandomoption(.s_all_loc[.@eqi],.@i,ROA_VALUE); .@r_p[.@ii] = getequiprandomoption(.s_all_loc[.@eqi],.@i,ROA_PARAM); } for (.@i = 0; .@i < .itemid_size; .@i++) delitem .itemid[.@i], .amount[.@i]; .@equip_id = getequipid(.@eqi); .@refine = getequiprefinerycnt(.@eqi); for (.@i = 0; .@i < 4; .@i++) .@card[.@i] = getequipcardid(.@eqi, .@i); delequip .@eqi; //getitem2 .@equip_id, 1, 1,.@refine,0,0,0,0,0; getitem3 .@equip_id, 1, 1, .@refine, 0, 0, 0, 0, 0,.@r_id,.@r_v,.@r_p; getitem .@card[0],1; getitem .@card[1],1; getitem .@card[2],1; getitem .@card[3],1; mes "Done Reset Enchantment."; } } close; } else { next; mes "Select an equipment for"; mes "^006600Random Option Removal^000000"; .@eqi = select(.@menu$) - 1 + EQI_SHOES; mes "Equip: "+getitemname(getequipid(.@eqi)); if (.itemid_size) { mes "Required Items:"; for (.@i = 0; .@i < .itemid_size; .@i++) { mes " -> "+F_InsertComma(.amount[.@i])+"x "+getitemname(.itemid[.@i]); if (countitem(.itemid[.@i]) < .amount[.@i]) .@fail++; } } if (!.@fail) { if (select("Random Option Removal", "Cancel") == 1) { for (.@i = 0; .@i < .itemid_size; .@i++) delitem .itemid[.@i], .amount[.@i]; .@equip_id = getequipid(.@eqi); .@refine = getequiprefinerycnt(.@eqi); for (.@i = 0; .@i < 4; .@i++) .@card[.@i] = getequipcardid(.@eqi, .@i); delequip .@eqi; getitem2 .@equip_id, 1, 1,.@refine,0,.@card[0],.@card[1],.@card[2],.@card[3]; mes "Done Random Option Removal."; } } close; } close; OnInit: .npc_n$ = "[^4B0082 Tollere ^000000]"; // NPC Name. setarray .itemid, 60002; setarray .amount, 1; .itemid_size = getarraysize(.itemid); end; } My goal for this is 1. Reset Enchantment = will remove and put the orbs/stones into the inventory in all card slot of the item, but will retain the Random Option 2. Random Option Removal = will remove the random option, but will retain the orb/stone in card slot. Is there a way to do it like my goal?? Quote Link to comment Share on other sites More sharing options...
0 Ruhn Posted September 2, 2021 Group: Members Topic Count: 26 Topics Per Day: 0.01 Content Count: 72 Reputation: 1 Joined: 04/15/20 Last Seen: Monday at 06:25 PM Share Posted September 2, 2021 On 4/12/2020 at 6:21 AM, Emistry said: try this. prontera,155,181,5 script Sample 4_F_KAFRA1,{ for (.@eqi = EQI_SHOES; .@eqi < EQI_HAND_R; .@eqi++) { .@equip_id = getequipid(.@eqi); if (.@equip_id > 0) .@menu$ = .@menu$ + getitemname(.@equip_id) + " ["+getitemslots(.@equip_id)+"]"; .@menu$ = .@menu$ + ":"; } mes "Select an equipment."; .@eqi = select(.@menu$) - 1 + EQI_SHOES; mes "Equip: "+getitemname(getequipid(.@eqi)); if (.itemid_size) { mes "Required Items:"; for (.@i = 0; .@i < .itemid_size; .@i++) { mes " -> "+F_InsertComma(.amount[.@i])+"x "+getitemname(.itemid[.@i]); if (countitem(.itemid[.@i]) < .amount[.@i]) .@fail++; } } if (!.@fail) { if (select("Reset Enchantment", "Cancel") == 1) { for (.@i = 0; .@i < .itemid_size; .@i++) delitem .itemid[.@i], .amount[.@i]; .@equip_id = getequipid(.@eqi); .@refine = getequiprefinerycnt(.@eqi); for (.@i = 0; .@i < 4; .@i++) .@card[.@i] = getequipcardid(.@eqi, .@i); delequip .@eqi; getitem2 .@equip_id, 1, 1,.@refine,0,.@card[0],.@card[1],.@card[2],.@card[3]; mes "Done reset enchant."; } } close; OnInit: setarray .itemid, 501, 502; setarray .amount, 1, 2; .itemid_size = getarraysize(.itemid); end; } @Emistry how to add check on this to make it not process disenchantment when the item is not enchanted ? also sorry for bringing up old topics Quote Link to comment Share on other sites More sharing options...
Question
mawjustin
Hi guys, may I ask for a script that removes all Random Option of an item in exchange for a certain item? Thanks!
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.