Jump to content
  • 0
Helena

getinventorylist fails to pass on card?

Question

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 by Helena

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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 by KirieZ

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.