Thread: clue's working.. help for reppage and cos you love me ;)

Results 1 to 10 of 10
  1. #1 clue's working.. help for reppage and cos you love me ;) 
    Community Veteran


    Join Date
    Nov 2006
    Posts
    531
    Thanks given
    6
    Thanks received
    21
    Rep Power
    489
    Hi well I'm desperately trying to get clue scrolls to give random items.
    i've so far put this in item.java

    public static final int[] clueItems = { 15082, 15083, 15084, 15085, 15336 };

    and have no idea where to go from there lol so any help is really appreciated thx

    base is devo 2.7
    Reply With Quote  
     

  2. #2  
    Community Veteran


    Join Date
    Nov 2006
    Posts
    531
    Thanks given
    6
    Thanks received
    21
    Rep Power
    489
    please someone I really need these
    Reply With Quote  
     

  3. #3  
    Registered Member
    Swarfega's Avatar
    Join Date
    Sep 2007
    Age
    29
    Posts
    873
    Thanks given
    0
    Thanks received
    1
    Rep Power
    373
    Code:
    addItem(randomclueItems, 1);
    ?
    Reply With Quote  
     

  4. #4  
    Community Veteran


    Join Date
    Nov 2006
    Posts
    531
    Thanks given
    6
    Thanks received
    21
    Rep Power
    489
    Quote Originally Posted by Swarfega View Post
    Code:
    addItem(randomclueItems, 1);
    ?

    is that it?
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Jul 2008
    Posts
    1,043
    Thanks given
    209
    Thanks received
    46
    Rep Power
    0
    Quote Originally Posted by Swarfega View Post
    Code:
    addItem(randomclueItems, 1);
    ?
    What the hell are you saying?

    Quote Originally Posted by I Blake I View Post
    Hi well I'm desperately trying to get clue scrolls to give random items.
    i've so far put this in item.java

    public static final int[] clueItems = { 15082, 15083, 15084, 15085, 15336 };

    and have no idea where to go from there lol so any help is really appreciated thx

    base is devo 2.7
    make a function:

    Code:
    public static int yournamehere() {
       return yourarraywithitems[(int) (Math.random()*yourarraywithitems.length)];
    }
    that's it, now I won't spoon feed you so have to know how to call it.
    Reply With Quote  
     

  6. #6  
    Registered Member
    Swarfega's Avatar
    Join Date
    Sep 2007
    Age
    29
    Posts
    873
    Thanks given
    0
    Thanks received
    1
    Rep Power
    373
    Quote Originally Posted by View Post
    What the hell are you saying?



    make a function:

    Code:
    public static int yournamehere() {
       return yourarraywithitems[(int) (Math.random()*yourarraywithitems.length)];
    }
    that's it, now I won't spoon feed you so have to know how to call it.

    Saying exactly what you just did. Since he said he added it in item class, I would assume he had the knowledge of making a randomitem int aswell, and then calling it using addItem to give the player an Item upon completing the clue scroll.
    Reply With Quote  
     

  7. #7  
    Banned

    Join Date
    Jul 2008
    Posts
    1,043
    Thanks given
    209
    Thanks received
    46
    Rep Power
    0
    Quote Originally Posted by Swarfega View Post
    Saying exactly what you just did. Since he said he added it in item class, I would assume he had the knowledge of making a randomitem int aswell, and then calling it using addItem to give the player an Item upon completing the clue scroll.
    ok sorry.
    Reply With Quote  
     

  8. #8  
    Community Veteran


    Join Date
    Nov 2006
    Posts
    531
    Thanks given
    6
    Thanks received
    21
    Rep Power
    489
    Quote Originally Posted by View Post
    What the hell are you saying?



    make a function:

    Code:
    public static int yournamehere() {
       return yourarraywithitems[(int) (Math.random()*yourarraywithitems.length)];
    }
    that's it, now I won't spoon feed you so have to know how to call it.

    FUCK its annoying me i dont get it but i wanna learn it.. anyone fancy "spoonfeeding" it so i can actually learn how to do this? it'd open alot of doors for me.. will pay a rs acc if i have to..
    Reply With Quote  
     

  9. #9  
    Community Veteran


    Join Date
    Nov 2006
    Posts
    531
    Thanks given
    6
    Thanks received
    21
    Rep Power
    489
    Please?....
    Reply With Quote  
     

  10. #10  
    Registered Member
    Swarfega's Avatar
    Join Date
    Sep 2007
    Age
    29
    Posts
    873
    Thanks given
    0
    Thanks received
    1
    Rep Power
    373
    Add this to Item Class:

    Code:
    public static final int[] clueItems = { 15082, 15083, 15084, 15085, 15336 };
    
    public static int randomclueItems() {
       return clueItems[(int) (Math.random()*clueItems.length)];
    }
    Add this where ever you want to add a clueitem

    Code:
    addItem(Item.randomclueItem(), 1);
    Example:

    Code:
    if(command.startsWith("cluetest")) {
    addItem(Item.randomclueItem(), 1);
    }
    Now please READ and learn. All you need is there.
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •