1. Hello World,

    is there any plugin which lets high quality metal ore come at the end of the gather-process, to prevent that only hqm get gathered?

    thx in advance
     
  2. I dont really wanted to request a new plugin, I just wanna have an answer of my question, thx for moving..... no nobody will see it again x)
     
  3. It won't go unnoticed, people just don't instantly reply to threads, it can take a few hours, or even a few days until some posts are answered. And to answer your question, I am currently not aware of any plugins allowing you to move the HQM to the end of the gathering process but I do believe it should be able to be achieved with a plugin. I plan on implementing such a feature in one of my upcoming plugin rewrites but because I don't have that much time to work on my plugins I am not really able to say when I will be able to finish this rewrite.
    Maybe someone is willing to create a standalone plugin to do this though.
     
  4. Thanks for your answere. I have been long time here and normally it doesnt take days.

    Then everything what I can do is to wait for it. It has no priority, but its good to have :)
     
  5. I started to think about it but I have a lot of stuff going on. If I ever get free time I will do it.
     
  6. OnDispenserGather hooks in too late to change what is given out.
    Could remove the item from the players inventory and give it back, But theres nothing to "tell" you that you have finished hitting the rock.
    You could wait till the player has collected 500stone from a rock but then if they are hitting multiple rocks and leaving them unfinished it will mess up with other players gathering them to collect the HQM

    EDIT: The hook does trigger BEFORE giving out an item, But how much of Stone/Metal/Sulfur do you give depending on what tool used and have much is left.
    Same as above, How do you check when the rock is emtpy (Nothing left but HQM)?
    Also how much to give (Different weapons/rock give more/less of an item)
     
    Last edited by a moderator: Sep 11, 2016
  7. What I was thinking is:
    When a player harvests HQM it will deny it(meaning change the amount of HQM given to 0) and add the amount to a dictionary of some sort. Then you detect OnEntityDeath - With that you see if the death of that entity was within lets say 10 meters of the player and if so give him back the HQM. Now I can see a few issues with these but they are easily solvable with a few work around.s
     
  8. I played on a server where they had a plugin that did just this so it possible for sure.
     
  9. It is. As DylanSMR said, using OnEntityDeath (with some checks to make sure the node being mined was the one that was included in the function call) you can give the HQM to the player. You would need a bit of magic involved in determining how much to give, but it is doable I'm sure. For example on Gather determining if the player was 'given' the HQM, store that in a variable and change the actual HQM being given to 0. Then on entity death, you get the initiator (attacker) and give them the HQM from the temporarily stored variable. A couple of bugs here and there which can be fixed, such as what if the player switches nodes - you'd have to overwrite the previous variable and similar scenarios...

    But if you have gotten to the last stages, it's down to refining as you have the core mechanics working!
     
  10. This might have been then a very resource (memory/cpu-time) intensive hook, because the whole process which item-type will be gathered is a complete random process.

    HQM lets you feel that its always first gathered, but by truth its only given out always very early because its the less amount of ore besides each other resource types of ore.

    If HQM would be nearly the same amount, it would be gathered like all other ore types:
    Example: sulfur, stone, metal, hqm, sulfur, metal, hwm, stone, sulfur, hqm, etc, ....
    The item order can't be controlled on this way.

    Such functions go always on cost of cpu-times and raise memory consumption as hell. You could use the entity.net.ID to hold the checks accurate, but you would need to check on every hit/gather against an dictionary. On a high-pop-server, i swear, this would become a heavy lag-affair.
    combined with the fact, that there are already hooks called by gather plugins on every hit, thats not want you want to happen on your server only for the effect, that a bit of HQM gets gathered at last hit/on entity death ;)
     
  11. So can you provide a better alternative?
     
  12. Be current state of my investigation, it could be managed with only the same hook, but with an additional dictionary..but it needs not much data, so the chance is given, that it would not lag...