Helena 0 Posted January 15, 2017 (edited) Hi Hercules, Does anyone know what I've done wrong here? It transfers over the refine rate perfectly, but it doesn't transfer over the card (should be the card that's compounded in the bone helm). The getitem2 just deletes it. Does anyone know why? Thanks a lot! next; getinventorylist; for(set .@i,0; .@i < @inventorylist_count; set .@i,.@i+1){ if ( @inventorylist_id[ .@i ] == 5162 ) // Slotted bone helm .@refine$[ getarraysize( .@refine$ ) ] = @inventorylist_refine[ .@i ]; .@card1$[ getarraysize( .@card1$ ) ] = @inventorylist_card1[ .@i ]; } getitem2 5162,1,1,.@refine$,0,.@card1$,0,0,0; Edited January 15, 2017 by Helena Quote Share this post Link to post Share on other sites
0 KirieZ 88 Posted January 15, 2017 Shouldn't this if have a { } ? for(set .@i,0; .@i < @inventorylist_count; set .@i,.@i+1) { if ( @inventorylist_id[ .@i ] == 5162 ) { // Slotted bone helm .@refine$[ getarraysize( .@refine$ ) ] = @inventorylist_refine[ .@i ]; .@card1$[ getarraysize( .@card1$ ) ] = @inventorylist_card1[ .@i ]; } } the way it's, .@card1 is being set in every iteration, not only in the bone helm one. And you're using .@refine$ and .@card1$ as arrays inside the for and at getitem you're not, maybe you forgot something there? Hope this helps Quote Share this post Link to post Share on other sites
0 Helena 0 Posted January 15, 2017 Hi KirieZ, I'm not sure what you mean with that I'm not using arrays in getitem2. I did put .@card1$ and .@refine$ in the getitem2, should that not take care of it? Thank you in advance. Quote Share this post Link to post Share on other sites
0 KirieZ 88 Posted January 15, 2017 (edited) I mean, in your for loop, you have these two lines: .@refine$[ getarraysize( .@refine$ ) ] = @inventorylist_refine[ .@i ]; .@card1$[ getarraysize( .@card1$ ) ] = @inventorylist_card1[ .@i ]; note that you're using [ ] so .@refine$ and .@card1$ are arrays, then, on getitem2, you're doing: getitem2 5162,1,1,.@refine$,0,.@card1$,0,0,0; so you're passing arrays ( .@refine$ and .@card1$ ) in an parameter that expects a value. As far as I know getitem2 doesn't accept arrays as parameter. If you want to create multiple items (as it seems so), you should do a for loop with getitem2, like that: for (.@i = 0; .@i < getarraysize(.@card1$); .@i++) { getitem2 5162,1,1,.@refine$[.@i],0,.@card1$[.@i],0,0,0; } or you can do everyting in one loop (maybe it was what you're trying to do?) next; getinventorylist; for(set .@i,0; .@i < @inventorylist_count; set .@i,.@i+1){ if ( @inventorylist_id[ .@i ] == 5162 ) { // Slotted bone helm .@refine$ = @inventorylist_refine[ .@i ]; .@card1$ = @inventorylist_card1[ .@i ]; getitem2 5162,1,1,.@refine$,0,.@card1$,0,0,0; } } (note that in this case I've replace [getarraysize(.@refine$)] by just .@refine$) Edited January 15, 2017 by KirieZ Quote Share this post Link to post Share on other sites
Hi Hercules,
Does anyone know what I've done wrong here?
It transfers over the refine rate perfectly, but it doesn't transfer over the card (should be the card that's compounded in the bone helm). The getitem2 just deletes it. Does anyone know why?
Thanks a lot!
Share this post
Link to post
Share on other sites