Radian Posted September 23, 2019 Posted September 23, 2019 Hey guys, can i request this kind of script? I am having issue on how to start on it. How it works, is If player got the item from any of the list, he/she can select to switch it 1:1 from the same list. list example: setarray .item_list, 32037,32031,32326,32035,32034,32032,32033,32036,32325,32324; I was hoping if possible to make 3 different list for it. Thank you so much. Quote
0 Radian Posted September 24, 2019 Author Posted September 24, 2019 Anyone got an idea how the method works? I'll work on the rest. thank you Quote
0 crazyarashi Posted September 24, 2019 Posted September 24, 2019 - script item_swap -1,{ for(.@i = 0; .@i < .size; .@i++){ .@menu$ += "List " + (.@i+1) + ":"; } mes "Select a list."; next; .@s = select(.@menu$) - 1; explode(.@item$,.item_list$[.@s],","); for(.@i = 0; .@i < getarraysize(.@item$); .@i++){ .@id = atoi(.@item$[.@i]); .@item[.@i] = .@id; if(countitem(.@id)){ .@temp[getarraysize(.@temp)] = .@id; .@data$ += getitemname(.@id) + ":"; } else { continue; } } mes "Select the item you want to swap."; next; .@s = select(.@data$) - 1; .@swap_id = .@temp[.@s]; .@index = inarray(.@item,.@swap_id); for(.@i = 0; .@i < getarraysize(.@item); .@i++){ if(.@i == .@index) continue; .@swap[getarraysize(.@swap)] = .@item[.@i]; .@swap$ += getitemname(.@item[.@i]) + ":"; } mes "select the item you want to swap into."; next; .@s = select(.@swap$) - 1; delitem .@swap_id,1; getitem .@swap[.@s],1; end; OnInit: setarray .item_list$,"501,502,503,504,505","506,507,508,509,510"; .size = getarraysize(.item_list$); end; } Haven't tested this but pretty sure it will work.. 1 Quote
0 Radian Posted September 25, 2019 Author Posted September 25, 2019 2 hours ago, crazyarashi said: - script item_swap -1,{ for(.@i = 0; .@i < .size; .@i++){ .@menu$ += "List " + (.@i+1) + ":"; } mes "Select a list."; next; .@s = select(.@menu$) - 1; explode(.@item$,.item_list$[.@s],","); for(.@i = 0; .@i < getarraysize(.@item$); .@i++){ .@id = atoi(.@item$[.@i]); .@item[.@i] = .@id; if(countitem(.@id)){ .@temp[getarraysize(.@temp)] = .@id; .@data$ += getitemname(.@id) + ":"; } else { continue; } } mes "Select the item you want to swap."; next; .@s = select(.@data$) - 1; .@swap_id = .@temp[.@s]; .@index = inarray(.@item,.@swap_id); for(.@i = 0; .@i < getarraysize(.@item); .@i++){ if(.@i == .@index) continue; .@swap[getarraysize(.@swap)] = .@item[.@i]; .@swap$ += getitemname(.@item[.@i]) + ":"; } mes "select the item you want to swap into."; next; .@s = select(.@swap$) - 1; delitem .@swap_id,1; getitem .@swap[.@s],1; end; OnInit: setarray .item_list$,"501,502,503,504,505","506,507,508,509,510"; .size = getarraysize(.item_list$); end; } Haven't tested this but pretty sure it will work.. Thank you so much, Working perfectly! Quote
0 Ukiram Posted September 25, 2019 Posted September 25, 2019 Hi, @Radian how this works? Thanks? Is this commandable? like @swap to swap the equipment? can you explain hehe Quote
0 Radian Posted September 25, 2019 Author Posted September 25, 2019 On 9/25/2019 at 8:32 AM, DevMarikuLabsan said: Hi, @Radian how this works? Thanks? Is this commandable? like @swap to swap the equipment? can you explain hehe No. It's an npc that allow players to switch from Headgear1 to Headgear2, Headgear3 or Headgear4 @crazyarashi Hi, Where do i need to change if i want to keep the refine + cards of the old headgear into the new headgear? Quote
Question
Radian
Hey guys, can i request this kind of script? I am having issue on how to start on it.
How it works, is
Thank you so much.
5 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.