Thread: Forcing a player to pickup item in ruse,

Results 1 to 8 of 8
  1. #1 Forcing a player to pickup item in ruse, 
    Registered Member
    Join Date
    Aug 2016
    Posts
    150
    Thanks given
    63
    Thanks received
    14
    Rep Power
    22
    I'm struggling to figure out how I would call out if a player receives a drop from a NPC or player and then force them to automatically loot the item.
    the code that has gotten my eye is,

    Code:
    			 GroundItemManager.pickupGroundItem(c, new Item(itemId), new Position(c.getCombatBuilder().getVictim().getPosition().getX(), c.getCombatBuilder().getVictim().getPosition().getY(), c.getPosition().getZ()));
    but I'm struggling to figure out what to call the "ItemId" aka the drop on the ground.
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #2  
    Registered Member
    Dexter Morgan's Avatar
    Join Date
    Nov 2008
    Age
    14
    Posts
    4,356
    Thanks given
    1,001
    Thanks received
    694
    Rep Power
    2968
    Perhaps you should add it into the inventory instead of dropping it.

    For a player that seems okay, what you need to do is loop through the equipment and inventory items

    Code:
    Player victim = c.getCombatBuilder().getVictim();
    for(Item equip : victim.getEquipment()) {
    GroundItemManager.pickupGroundItem(c, equip, victim.getPosition());
    }
    for(Item equip : victim.getInventory()) {
    GroundItemManager.pickupGroundItem(c, equip, victim.getPosition());
    }
    [Only registered and activated users can see links. ]
    Quote Originally Posted by UberNation View Post
    Did you update the quantum network sockets to match the polarity of the wilderness counter levels in the Boolean that divides the wilderness level by zero?
    Reply With Quote  
     

  3. #3  
    Registered Member
    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,706
    Thanks given
    170
    Thanks received
    285
    Discord
    Arch337#1337
    Rep Power
    631
    Well how is the automatic loot going to work like? Is it going to bank your item or add them to your inventory?
    Also how should you toggle it on and off? What is it going to do if you got full inventory?
    These are the question you need to tell yourself and answer. After you done answer, you can start coding it.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  4. #4  
    Im an albatraoz
    Nand0's Avatar
    Join Date
    Feb 2010
    Age
    27
    Posts
    774
    Thanks given
    165
    Thanks received
    109
    Rep Power
    71
    Quote Originally Posted by zenomh View Post
    I'm struggling to figure out how I would call out if a player receives a drop from a NPC or player and then force them to automatically loot the item.
    the code that has gotten my eye is,

    Code:
    GroundItemManager.pickupGroundItem(c, new Item(itemId), new Position(c.getCombatBuilder().getVictim().getPosition().getX(), c.getCombatBuilder().getVictim().getPosition().getY(), c.getPosition().getZ()));
    but I'm struggling to figure out what to call the "ItemId" aka the drop on the ground.
    For npcs:
    In NPCDrops

    replace :
    Code:
    GroundItemManager.spawnGroundItem(toGive, new GroundItem(item, pos, toGive.getUsername(), false, 150, goGlobal, 200));
    with :

    Code:
    toGive.getInventory().add(item.getId(), item.getAmount());
    Just tested it and it works

    Reply With Quote  
     

  5. Thankful user:


  6. #5  
    Registered Member
    Join Date
    Aug 2016
    Posts
    150
    Thanks given
    63
    Thanks received
    14
    Rep Power
    22
    Quote Originally Posted by Nand0 View Post
    For npcs:
    In NPCDrops

    replace :
    Code:
    GroundItemManager.spawnGroundItem(toGive, new GroundItem(item, pos, toGive.getUsername(), false, 150, goGlobal, 200));
    with :

    Code:
    toGive.getInventory().add(item.getId(), item.getAmount());
    Just tested it and it works

    Cheers fam, but I'm wondering how would I go about calling the drop, that the player gets, and then walks upon it before adding to inventory, but thanks for the clearification
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. #6  
    Im an albatraoz
    Nand0's Avatar
    Join Date
    Feb 2010
    Age
    27
    Posts
    774
    Thanks given
    165
    Thanks received
    109
    Rep Power
    71
    Quote Originally Posted by zenomh View Post
    Cheers fam, but I'm wondering how would I go about calling the drop, that the player gets, and then walks upon it before adding to inventory, but thanks for the clearification
    Probally using MovementQueue and GroundItemManager not 100% sure
    Reply With Quote  
     

  8. Thankful user:


  9. #7  
    Registered Member
    Join Date
    Aug 2016
    Posts
    150
    Thanks given
    63
    Thanks received
    14
    Rep Power
    22
    Yeah thought so Nando, just got back from work tired as shit, trying to figure this out, how would I go about calling and checking for a exact drop, sorry if i'm asking complicated, tired

    Quote Originally Posted by arch337 View Post
    Well how is the automatic loot going to work like? Is it going to bank your item or add them to your inventory?
    Also how should you toggle it on and off? What is it going to do if you got full inventory?
    These are the question you need to tell yourself and answer. After you done answer, you can start coding it.
    I already got a way for the code to execute, how it should be toggled and when it shouldn't, I'm just struggling to figure out how I would go about calling for the item that has been dropped in another class, so it will check if the player receives that drop, and from there pick up the drop
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  10. #8  
    Registered Member
    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,706
    Thanks given
    170
    Thanks received
    285
    Discord
    Arch337#1337
    Rep Power
    631
    Quote Originally Posted by zenomh View Post
    Yeah thought so Nando, just got back from work tired as shit, trying to figure this out, how would I go about calling and checking for a exact drop, sorry if i'm asking complicated, tired



    I already got a way for the code to execute, how it should be toggled and when it shouldn't, I'm just struggling to figure out how I would go about calling for the item that has been dropped in another class, so it will check if the player receives that drop, and from there pick up the drop
    You didn't really answer much. I am just going to assume it is about adding it to your inventory and you got it to work like above.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    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. How to add items in [Ruse Base]
    By joechris in forum Help
    Replies: 4
    Last Post: 07-20-2016, 05:09 PM
  2. Replies: 1
    Last Post: 07-08-2016, 06:05 PM
  3. [req] a way to loose items in wild[req]
    By Rowan112 in forum Requests
    Replies: 2
    Last Post: 05-24-2009, 03:48 AM
  4. ip ban and how to offer items in trade
    By Jonatino in forum Requests
    Replies: 10
    Last Post: 01-10-2009, 08:21 PM
  5. Replies: 19
    Last Post: 03-12-2008, 06:54 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
  •