Thread: Making an item possible to replace its self with a random item when clicked on.

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 Making an item possible to replace its self with a random item when clicked on. 
    !\_\So you thinK/_/!
    Guest
    Hello I'm working on a server and I'm thinking about adding pvp drops but i dont want it to be applied to dying just anywhere because that would ruin the economy of my partner's and my 317 delta. Either that or making an item replace itself with any random item in the item.cfg. I have no idea how to do either, if anybody could provide me with the coding for either one it'd be much appreciated and I will rep++ thank you.
    Reply With Quote  
     

  2. #2  
    Registered Member
    discipl3's Avatar
    Join Date
    Sep 2008
    Posts
    324
    Thanks given
    1
    Thanks received
    5
    Rep Power
    95
    Well, i would say that you need to make a copy of the youdied(); method, lets say you named it youdiedinwildy();.

    Then, inside of the youdiedinwildy() method, you need to add a random item script in item.java. So lets say you wanted a random barrows drop every time you killed someone in the wildy. In item.java you would put:

    Code:
        public static int Barrows[] = {4734,4710,4724,4726,4728,4730,4718,4718,4732,4736,4738,4716,4720,4722,4753,4747,4755,4757,4759,4708,4712,4714,4745,4749,4751,7462,7462,7462,7462,7462,7462,7462,7462,7462,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592};
    
            public static int randomBarrows()
            {
                return Barrows[(int)(Math.random()*Barrows.length)];
            }
    Then, add this into the youdiedinwildy(); method:

    Code:
    createGroundItem(Item.randomBarrows(), absX, absY);

    Now you need to replace the youdied(); method in the player vs player combat with youdiedinwildy();

    Poorly explained, may have errors, but i hope it helps.
    All models i post are made by me. Yay.
    Quote Originally Posted by Koâk View Post
    I WILL RAPE++
    Reply With Quote  
     

  3. #3  
    !\_\So you thinK/_/!
    Guest
    thanks for trying but thats not really what im looking for...im trying to apply it to JUST a certain area like a pk box so the pvp drops are only applied to the space within the pk box
    Reply With Quote  
     

  4. #4  
    Registered Member
    Swarfega's Avatar
    Join Date
    Sep 2007
    Age
    29
    Posts
    873
    Thanks given
    0
    Thanks received
    1
    Rep Power
    373
    Code:
    if(absX >= #### && absY >= #### && absX <= #### && absY <= ####) {
    createGroundItem(Item.randomBarrows(), absX, absY);
    }
    
    
        public static int Barrows[] = {4734,4710,4724,4726,4728,4730,4718,4718,4732,4736,4738,4716,4720,4722,4753,4747,4755,4757,4759,4708,4712,4714,4745,4749,4751,7462,7462,7462,7462,7462,7462,7462,7462,7462,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592};
    
            public static int randomBarrows()
            {
                return Barrows[(int)(Math.random()*Barrows.length)];
            }
    ?
    Reply With Quote  
     

  5. #5  
    !\_\So you thinK/_/!
    Guest
    looks good ill try it but does that mean itll only create the item if someoen dies?
    Reply With Quote  
     

  6. #6  
    !\_\So you thinK/_/!
    Guest
    bump
    Reply With Quote  
     

  7. #7  
    Banned

    Join Date
    Jan 2009
    Age
    31
    Posts
    2,661
    Thanks given
    66
    Thanks received
    207
    Rep Power
    0
    Could try using this?

    its not perfect but itll allow you too keep a good econemy and change ratios easily for drop ability.

    Code:
    public void PvPDropChecks(){
    	int Chance = dropPotential*(misc.random(dropPotential)+1);
    	int Ratio = 10000; //10,000 Being Hardest Ability To Get A Good Item.
    	int SecondRatio = 50; //Raise This Make Rarer Drops Harder
    if(misc.random(Chance) > (misc.random(Ratio)+(SecondRatio*10)))
    	GetRareDrops();
    else if(misc.random(Chance) > (misc.random(Ratio)+(SecondRatio*5)))
    	GetHighDrops();
    else if(misc.random(Chance) > (misc.random(Ratio)+(SecondRatio)))
    	GetMedDrops();
    else if(misc.random(Chance) > misc.random(Ratio))
    	GetLowDrops();
    else 
    	GetTinyDrops();
    }
    Then You Need The Voids For The Item.random part use what Swarfega Posted.
    and add it like this

    Rare = ags , dfs , dfh etc..
    High = obby shield , d[] , barrows , rune g , rune sara ,
    Med = dragon med helm , noted yews , noted magic logs , etc..
    Low = rune helm , rune scim , rune long , addy long etc.
    tiny = cake bronze iron steel mith coins low amount

    Code:
    public void GetRareDrops(){
    PvPITEM1 = Item.RandomRareDrop();
    PvPITEM2 = Item.RandomHighDrop();
    PvPITEM3 = Item.RandomMedDrop();
    PvPITEM4 = Item.RandomLowDrop();
    }
    public void GetHighDrops(){
    PvPITEM1 = Item.RandomHighDrop();
    PvPITEM2 = Item.RandomMedDrop();
    PvPITEM3 = Item.RandomLowDrop();
    PvPITEM4 = Item.RandomTinyDrop();
    }
    public void GetMedDrops(){
    PvPITEM1 = Item.RandomMedDrop();
    PvPITEM2 = Item.RandomLowDrop();
    PvPITEM3 = Item.RandomTinyDrop();
    PvPITEM4 = Item.RandomTinyDrop();
    }
    public void GetLowDrops(){
    PvPITEM1 = Item.RandomLowDrop();
    PvPITEM2 = Item.RandomTinyDrop();
    PvPITEM3 = Item.RandomTinyDrop();
    PvPITEM4 = Item.RandomTinyDrop();
    }
    public void GetTinyDrops(){
    PvPITEM1 = Item.RandomTinyDrop();
    PvPITEM2 = Item.RandomTinyDrop();
    PvPITEM3 = Item.RandomTinyDrop();
    PvPITEM4 = Item.RandomTinyDrop();
    }
    Reply With Quote  
     

  8. #8  
    !\_\So you thinK/_/!
    Guest
    lol im sorry but does this go in client.java?
    Reply With Quote  
     

  9. #9  
    Registered Member

    Join Date
    Jun 2007
    Age
    29
    Posts
    3,003
    Thanks given
    52
    Thanks received
    98
    Rep Power
    3208
    yes it goes in client.java
    Reply With Quote  
     

  10. #10  
    !\_\So you thinK/_/!
    Guest
    would it go with the youdied method?

    edit: i keep getting this error
    Code:
    ========================
    Type C For Compile
    ========================
    Type any other to close
    Option:c
    client.java:3747: illegal start of type
            if(absX >= 3092 && absY >= 3629 && absX <= 3106 && absY <= 3629) {
            ^
    client.java:3747: <identifier> expected
            if(absX >= 3092 && absY >= 3629 && absX <= 3106 && absY <= 3629) {
                   ^
    client.java:3747: ';' expected
            if(absX >= 3092 && absY >= 3629 && absX <= 3106 && absY <= 3629) {
                      ^
    client.java:3747: illegal start of type
            if(absX >= 3092 && absY >= 3629 && absX <= 3106 && absY <= 3629) {
                            ^
    client.java:3747: ';' expected
            if(absX >= 3092 && absY >= 3629 && absX <= 3106 && absY <= 3629) {
                                   ^
    client.java:3747: <identifier> expected
            if(absX >= 3092 && absY >= 3629 && absX <= 3106 && absY <= 3629) {
                                                   ^
    client.java:3747: illegal start of type
            if(absX >= 3092 && absY >= 3629 && absX <= 3106 && absY <= 3629) {
                                                       ^
    client.java:3747: <identifier> expected
            if(absX >= 3092 && absY >= 3629 && absX <= 3106 && absY <= 3629) {
                                                           ^
    client.java:3747: ';' expected
            if(absX >= 3092 && absY >= 3629 && absX <= 3106 && absY <= 3629) {
                                                              ^
    client.java:3747: illegal start of type
            if(absX >= 3092 && absY >= 3629 && absX <= 3106 && absY <= 3629) {
                                                                    ^
    client.java:3747: <identifier> expected
            if(absX >= 3092 && absY >= 3629 && absX <= 3106 && absY <= 3629) {
                                                                      ^
    client.java:3747: ';' expected
            if(absX >= 3092 && absY >= 3629 && absX <= 3106 && absY <= 3629) {
                                                                           ^
    12 errors
    Press any key to continue . . .
    Reply With Quote  
     

Page 1 of 2 12 LastLast

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
  •