Thread: Just wondering about runecrafting..

Results 1 to 5 of 5
  1. #1 Just wondering about runecrafting.. 
    Registered Member pk3r john's Avatar
    Join Date
    Apr 2009
    Posts
    877
    Thanks given
    16
    Thanks received
    30
    Rep Power
    63
    Im not actually adding RC to my server (infact im not even working on one) but i was wondering how you would make it so that it deletes all the ess in your inventory?

    rep++ for answer
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Sep 2009
    Posts
    3,245
    Thanks given
    195
    Thanks received
    255
    Rep Power
    0
    Loop through all items in the players inventory then check if player has ess if so delete item and add the appropriate rune and amount.
    Reply With Quote  
     

  3. #3  
    Registered Member pk3r john's Avatar
    Join Date
    Apr 2009
    Posts
    877
    Thanks given
    16
    Thanks received
    30
    Rep Power
    63
    Quote Originally Posted by Fresh View Post
    Loop through all items in the players inventory then check if player has ess if so delete item and add the appropriate rune and amount.
    ooh, so if you dont mind could you roughly type out the code?
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Sep 2009
    Posts
    3,245
    Thanks given
    195
    Thanks received
    255
    Rep Power
    0
    Quote Originally Posted by pk3r john View Post
    ooh, so if you dont mind could you roughly type out the code?
    Code:
    			for(int i =0; i <c.playerItems.length; i++) {
    				if(c.getItems().playerHasItem(itemID)) {
    					c.getItems().deleteItem(itemID, amount);
    					c.getItems().addItem(itemID, amount);
    				}
    			}
    That will loop from 0 - the ammount of items in the players inv be it 1 or 27 .length finds that for you. if it finds an itemID (ess) it will deleteItem and it will then addItem the rune. But obviously that doesn't support multiple rune crafting and whatever.
    Reply With Quote  
     

  5. #5  
    Registered Member pk3r john's Avatar
    Join Date
    Apr 2009
    Posts
    877
    Thanks given
    16
    Thanks received
    30
    Rep Power
    63
    Quote Originally Posted by Fresh View Post
    Code:
    			for(int i =0; i <c.playerItems.length; i++) {
    				if(c.getItems().playerHasItem(itemID)) {
    					c.getItems().deleteItem(itemID, amount);
    					c.getItems().addItem(itemID, amount);
    				}
    			}
    That will loop from 0 - the ammount of items in the players inv be it 1 or 27 .length finds that for you. if it finds an itemID (ess) it will deleteItem and it will then addItem the rune. But obviously that doesn't support multiple rune crafting and whatever.
    thanks! Repped
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Just wondering, why does..?
    By Brown in forum Application Development
    Replies: 4
    Last Post: 02-11-2009, 10:51 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •