Thread: [PI] Digging reward!

Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1 [PI] Digging reward! 
    Registered Member
    Join Date
    Jul 2012
    Posts
    361
    Thanks given
    185
    Thanks received
    9
    Rep Power
    25
    Alright, i need some help.

    Base: InsidiaxV2(no flaming please)

    what i need: If you have item "2677" and you dig, here (X,Y), and you receive a... reward, like 14484

    also, what class file i would put it in and such, thanks.


    In case you still don't understand here: if has item 2677(clue scroll), and digs in (1000,2000) with a spade, he receive a reward code for the reward: 4151.

    Thanks, help as soon as possible
    Reply With Quote  
     

  2. #2  
    Donator


    Join Date
    Sep 2011
    Posts
    2,730
    Thanks given
    1,150
    Thanks received
    907
    Rep Power
    668
    Gonna type this out right now, let's see.

    In ClickItem

    Code:
    case 952:
    	if (c.getItems().playerHasItem(2677, 1) && c.absX == 1000 && c.absY == 2000)) {
    		c.getItems().deleteItem(2677, 1);
    		c.getItems().addItem(14484, 1);
    		c.sendMessage("You dig and find a pair of dragon claws!");
    	} else {
    		c.sendMessage("You did but find nothing.");
    	}
    break;
    Not tested, but something along those lines should work.

    EDIT: Some explanation now that I posted.

    Code:
    if (c.getItems().playerHasItem(2677, 1) && c.absX == 1000 && c.absY == 2000)) {
    This checks that the player has the item 2677 in their inventory, and is sitting on the exact coordinate 1000, 2000. If they do have 2677, and are on 1000, 2000, they will receive dragon claws and their clue scroll will disappear.

    Otherwise, you won't find anything.

    c.getItems().playerHasItem(2677, 1) = Checks if has clue scroll


    c.absX == 1000 = Checks if player is on the 1,000th x coordinate


    c.absY == 2000 = Checks if player ison the 1,000th y coordinate


    c.getItems().deleteItem(2677, 1); = Deletes the first 2677 it finds in your inventory.


    c.getItems().addItem(14484, 1); = Adds a pair of dragon claws


    c.sendMessage("You dig and find a pair of dragon claws!"); = Sends message of success


    } else {
    c.sendMessage("You did but find nothing.");
    }
    = You either didn't have a clue scroll, weren't on the 1,000th x coordinate, or weren't on the 2,000th y coordinate.

    Very easy stuff.
    Reply With Quote  
     

  3. Thankful users:


  4. #3  
    need java lessons
    Eclipse's Avatar
    Join Date
    Aug 2012
    Posts
    4,436
    Thanks given
    686
    Thanks received
    898
    Rep Power
    490
    Should just make a class if you're doing multiple of these.

    Quote Originally Posted by jerryrocks317 View Post
    i am 14 and have my own laptop im on almost 24/7 currently creating rsps lol so please get off my thread lol
    Reply With Quote  
     

  5. Thankful users:


  6. #4  
    Registered Member
    Join Date
    Jul 2012
    Posts
    361
    Thanks given
    185
    Thanks received
    9
    Rep Power
    25
    Thanks for the reply, will be testing it in a minute, and another thing, what if i want to add another cord like, 1000(x) and 2000gives dragon claws, and 1200(x) and 2500 gives armadyl god sword?
    Reply With Quote  
     

  7. #5  
    Registered Member
    Join Date
    Jul 2012
    Posts
    361
    Thanks given
    185
    Thanks received
    9
    Rep Power
    25
    Quote Originally Posted by Ninth Legion View Post
    Should just make a class if you're doing multiple of these.
    How would i expand the case 952 for another cord? And what exactly do you mean making a class for this?
    Reply With Quote  
     

  8. #6  
    Registered Member
    Join Date
    Jul 2012
    Posts
    361
    Thanks given
    185
    Thanks received
    9
    Rep Power
    25
    Code:
    	if (itemId == 952) {
    			} else if(c.inArea(3553, 3301, 3561, 3294)) {
    				c.teleTimer = 3;
    				c.newLocation = 1;
    			} else if(c.inArea(3550, 3287, 3557, 3278)) {
    				c.teleTimer = 3;
    				c.newLocation = 2;
    			} else if(c.inArea(3561, 3292, 3568, 3285)) {
    				c.teleTimer = 3;
    				c.newLocation = 3;
    			} else if(c.inArea(3570, 3302, 3579, 3293)) {
    				c.teleTimer = 3;
    				c.newLocation = 4;
    			} else if(c.inArea(3571, 3285, 3582, 3278)) {
    				c.teleTimer = 3;
    				c.newLocation = 5;
    			} else if(c.inArea(3562, 3279, 3569, 3273)) {
    				c.teleTimer = 3;
    				c.newLocation = 6;
    			} else if(c.inArea(2986, 3370, 3013, 3388)) {
    				c.teleTimer = 3;
    				c.newLocation = 7;
    			}
    I have this code in my clickitem.java how would i add your code to it?
    Reply With Quote  
     

  9. #7  
    Registered Member
    Join Date
    Jul 2012
    Posts
    361
    Thanks given
    185
    Thanks received
    9
    Rep Power
    25
    Quote Originally Posted by Lystuya View Post
    Gonna type this out right now, let's see.

    In ClickItem

    Code:
    case 952:
    	if (c.getItems().playerHasItem(2677, 1) && c.absX == 1000 && c.absY == 2000)) {
    		c.getItems().deleteItem(2677, 1);
    		c.getItems().addItem(14484, 1);
    		c.sendMessage("You dig and find a pair of dragon claws!");
    	} else {
    		c.sendMessage("You did but find nothing.");
    	}
    break;
    Not tested, but something along those lines should work.

    EDIT: Some explanation now that I posted.

    Code:
    if (c.getItems().playerHasItem(2677, 1) && c.absX == 1000 && c.absY == 2000)) {
    This checks that the player has the item 2677 in their inventory, and is sitting on the exact coordinate 1000, 2000. If they do have 2677, and are on 1000, 2000, they will receive dragon claws and their clue scroll will disappear.

    Otherwise, you won't find anything.

    c.getItems().playerHasItem(2677, 1) = Checks if has clue scroll


    c.absX == 1000 = Checks if player is on the 1,000th x coordinate


    c.absY == 2000 = Checks if player ison the 1,000th y coordinate


    c.getItems().deleteItem(2677, 1); = Deletes the first 2677 it finds in your inventory.


    c.getItems().addItem(14484, 1); = Adds a pair of dragon claws


    c.sendMessage("You dig and find a pair of dragon claws!"); = Sends message of success


    } else {
    c.sendMessage("You did but find nothing.");
    }
    = You either didn't have a clue scroll, weren't on the 1,000th x coordinate, or weren't on the 2,000th y coordinate.

    Very easy stuff.
    tried it and your code just gave me some errors :/
    Reply With Quote  
     

  10. #8  
    Registered Member
    Join Date
    Jul 2012
    Posts
    361
    Thanks given
    185
    Thanks received
    9
    Rep Power
    25
    Still getting error with this, does anyone have a different way of implementing this?
    Reply With Quote  
     

  11. #9  
    need java lessons
    Eclipse's Avatar
    Join Date
    Aug 2012
    Posts
    4,436
    Thanks given
    686
    Thanks received
    898
    Rep Power
    490
    Code:
    	if (itemId == 952) {
    if (c.getItems().playerHasItem(2677, 1) && c.absX == 1000 && c.absY == 2000)) {
    c.getItems().addItem(14484, 1);
    			} else if(c.inArea(3553, 3301, 3561, 3294)) {
    				c.teleTimer = 3;
    				c.newLocation = 1;
    			} else if(c.inArea(3550, 3287, 3557, 3278)) {
    				c.teleTimer = 3;
    				c.newLocation = 2;
    			} else if(c.inArea(3561, 3292, 3568, 3285)) {
    				c.teleTimer = 3;
    				c.newLocation = 3;
    			} else if(c.inArea(3570, 3302, 3579, 3293)) {
    				c.teleTimer = 3;
    				c.newLocation = 4;
    			} else if(c.inArea(3571, 3285, 3582, 3278)) {
    				c.teleTimer = 3;
    				c.newLocation = 5;
    			} else if(c.inArea(3562, 3279, 3569, 3273)) {
    				c.teleTimer = 3;
    				c.newLocation = 6;
    			} else if(c.inArea(2986, 3370, 3013, 3388)) {
    				c.teleTimer = 3;
    				c.newLocation = 7;
    			}

    Quote Originally Posted by jerryrocks317 View Post
    i am 14 and have my own laptop im on almost 24/7 currently creating rsps lol so please get off my thread lol
    Reply With Quote  
     

  12. Thankful user:


  13. #10  
    Registered Member
    Join Date
    Jul 2012
    Posts
    361
    Thanks given
    185
    Thanks received
    9
    Rep Power
    25
    Quote Originally Posted by Ninth Legion View Post
    Code:
    	if (itemId == 952) {
    if (c.getItems().playerHasItem(2677, 1) && c.absX == 1000 && c.absY == 2000)) {
    c.getItems().addItem(14484, 1);
    			} else if(c.inArea(3553, 3301, 3561, 3294)) {
    				c.teleTimer = 3;
    				c.newLocation = 1;
    			} else if(c.inArea(3550, 3287, 3557, 3278)) {
    				c.teleTimer = 3;
    				c.newLocation = 2;
    			} else if(c.inArea(3561, 3292, 3568, 3285)) {
    				c.teleTimer = 3;
    				c.newLocation = 3;
    			} else if(c.inArea(3570, 3302, 3579, 3293)) {
    				c.teleTimer = 3;
    				c.newLocation = 4;
    			} else if(c.inArea(3571, 3285, 3582, 3278)) {
    				c.teleTimer = 3;
    				c.newLocation = 5;
    			} else if(c.inArea(3562, 3279, 3569, 3273)) {
    				c.teleTimer = 3;
    				c.newLocation = 6;
    			} else if(c.inArea(2986, 3370, 3013, 3388)) {
    				c.teleTimer = 3;
    				c.newLocation = 7;
    			}
    also how would i make it start the digging animation, and i don't know the animations id, and thanks for the reply.
    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

Similar Threads

  1. barrows without digging (PI)
    By Boolean in forum Tutorials
    Replies: 17
    Last Post: 10-20-2011, 08:24 AM
  2. Digging through and..
    By Shauny in forum Chat
    Replies: 6
    Last Post: 07-29-2009, 11:15 PM
  3. Digging?
    By myK- in forum Help
    Replies: 26
    Last Post: 07-20-2009, 01:53 AM
  4. Digging (handled)
    By Mrquarterx in forum Configuration
    Replies: 13
    Last Post: 01-05-2009, 11:22 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •