Thread: Issues with assigning items to killer on player death

Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1 Issues with assigning items to killer on player death 
    Registered Member
    Jeekusama's Avatar
    Join Date
    Jan 2017
    Posts
    455
    Thanks given
    249
    Thanks received
    221
    Rep Power
    323
    This issue has been fixed!

    For those with the same problem using the Vencillio base, go into your Player class and remove the variable that is commented out.

    Player class
    Code:
    	@Override
    	public void reset() {
    		following.updateWaypoint();
    		appearanceUpdateRequired = false;
    		chatUpdateRequired = false;
    		resetMovementQueue = false;
    		needsPlacement = false;
    		getMovementHandler().resetMoveDirections();
    		getUpdateFlags().setUpdateRequired(false);
    		getUpdateFlags().reset();
    		//getCombat().getDamageTracker().clear();
    	}
    Basically what is happening is upon death, the variables of the player resets which also resets the entity (killer) from being recognised, hence not sending the drop to that player.

    Hope that has helped.

    Thank you to:
    Kris
    arch337
    Falconpunch
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Feb 2010
    Posts
    19
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    So the Entity 'killer' in playerDrops is not getting assigned, right?
    Reply With Quote  
     

  3. #3  
    Registered Member
    Jeekusama's Avatar
    Join Date
    Jan 2017
    Posts
    455
    Thanks given
    249
    Thanks received
    221
    Rep Power
    323
    Quote Originally Posted by halflive9 View Post
    So the Entity 'killer' in playerDrops is not getting assigned, right?
    Wrong, the killer is declared but the drops still are not being assigned to the entity itself.

    The code:
    Code:
    player.getCombat().getDamageTracker().getKiller()
    Calculates the damage dealt from a specific entity, and returns if the entity has dealt the highest damage. Which is what I don't understand, it works for NPC drops, but isn't assigning it to other players.

    The addDamage declaration is also within the right spots upon initiating a hit and setting the hits damage which is found within the Combat class.
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Feb 2010
    Posts
    19
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Quote Originally Posted by Jeekusama View Post
    Wrong, the killer is declared but the drops still are not being assigned to the entity itself.

    The code:
    Code:
    player.getCombat().getDamageTracker().getKiller()
    Calculates the damage dealt from a specific entity, and returns if the entity has dealt the highest damage. Which is what I don't understand, it works for NPC drops, but isn't assigning it to other players.

    The addDamage declaration is also within the right spots upon initiating a hit and setting the hits damage which is found within the Combat class.
    By assigning I mean that the Entity killer gets the value for example "John". Or is not getting a value at all? That's what I understand of what you are trying to tell me, correct me if I'm wrong. I'm trying to get a gasp of where the problem might be.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Jeekusama's Avatar
    Join Date
    Jan 2017
    Posts
    455
    Thanks given
    249
    Thanks received
    221
    Rep Power
    323
    Quote Originally Posted by halflive9 View Post
    By assigning I mean that the Entity killer gets the value for example "John". Or is not getting a value at all? That's what I understand of what you are trying to tell me, correct me if I'm wrong. I'm trying to get a gasp of where the problem might be.
    So basically, for some reason, I had it debug the entity 'killer' and it returned null even after assigning it with the getKiller() method.

    Meaning it isn't recognising the killer who has slain the player. So I am trying to figure out why it isn't assigning the entity to as the killer in order for the killer to receive the drop.
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Feb 2010
    Posts
    19
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Quote Originally Posted by Jeekusama View Post
    So basically, for some reason, I had it debug the entity 'killer' and it returned null even after assigning it with the getKiller() method.

    Meaning it isn't recognising the killer who has slain the player. So I am trying to figure out why it isn't assigning the entity to as the killer in order for the killer to receive the drop.
    Alright. That was my bet so probably when that's fixed it will drop for both players. Let me know if you figure it out.
    Reply With Quote  
     

  7. #7  
    Registered Member

    Join Date
    Feb 2011
    Posts
    1,143
    Thanks given
    545
    Thanks received
    108
    Rep Power
    87
    Upon reviewing playerdrops, it seems you have emblems. If those are working, you could in theory, just make a method to add coins on the ground based on their armor.

    Something like int CashForUntradeables(item id, int cashAmt)
    And make it just return a total amount of cash on the ground for the killer. Id do more if I wasn't on my phone

    Reply With Quote  
     

  8. Thankful user:


  9. #8  
    Registered Member
    Jeekusama's Avatar
    Join Date
    Jan 2017
    Posts
    455
    Thanks given
    249
    Thanks received
    221
    Rep Power
    323
    Quote Originally Posted by Falconpunch View Post
    Upon reviewing playerdrops, it seems you have emblems. If those are working, you could in theory, just make a method to add coins on the ground based on their armor.

    Something like int CashForUntradeables(item id, int cashAmt)
    And make it just return a total amount of cash on the ground for the killer. Id do more if I wasn't on my phone
    This is regarding the whole drops themselves. I am not talking about making the untradable turn into cash, I'm trying to get the entity killer to receive the loot pile when killing a player rather it just being assigned to null.


    Sent from my iPhone using Tapatalk
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  10. #9  
    Contributor
    Kris's Avatar
    Join Date
    Jun 2016
    Age
    23
    Posts
    3,536
    Thanks given
    703
    Thanks received
    2,322
    Discord
    View profile
    Rep Power
    5000
    Debug the add damage method. I've got a feeling like it's getting added to the map but it gets reset by another method shortly after -> resulting in a null overall. Put simple out prints around it and see if it gets added properly n shit.

    Edit: Also, make sure the reset() method in player doesn't get ran before the drop is being thrown. From what I understand the person who dies will have the reset() method ran which clears their damage-taken map -> After this the drop gets thrown. Correct me if I'm wrong there.
    Reply With Quote  
     

  11. Thankful user:


  12. #10  
    Registered Member
    Jeekusama's Avatar
    Join Date
    Jan 2017
    Posts
    455
    Thanks given
    249
    Thanks received
    221
    Rep Power
    323
    Quote Originally Posted by Kris View Post
    Debug the add damage method. I've got a feeling like it's getting added to the map but it gets reset by another method shortly after -> resulting in a null overall. Put simple out prints around it and see if it gets added properly n shit.

    Edit: Also, make sure the reset() method in player doesn't get ran before the drop is being thrown. From what I understand the person who dies will have the reset() method ran which clears their damage-taken map -> After this the drop gets thrown. Correct me if I'm wrong there.
    I debugged the damage map to see if it is adding the damage and found it is
    So I've done that, basically I am thinking it has to be reset before the player dies, there is no way otherwise.
    Maybe it is to do with the combat timer.... I will have a look and re-debug everything soon I am just getting home now.
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    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. Replies: 3
    Last Post: 11-15-2012, 03:59 AM
  2. Help with getting items to not work in wild
    By bigerman123 in forum Help
    Replies: 2
    Last Post: 03-14-2012, 07:49 AM
  3. Replies: 5
    Last Post: 04-02-2010, 02:23 AM
  4. an issue with this item
    By Mr Reece in forum Help
    Replies: 2
    Last Post: 11-27-2009, 05:32 AM
  5. How to get your desktop items to lock on Vista.
    By Hooligan in forum Software
    Replies: 5
    Last Post: 05-21-2008, 07:30 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
  •