[CUSTOM SHARE] Global Drop Event System

Trance

Heir
Customer
QA Engineer
Hello,

A few days ago, I wanted to create an individual XML file for all in-game drops, with the ability to reload it anytime using an admin command, without affecting the NPCs during live server operations. The drops.xml file contains all drops and follows the same syntax as the drops for regular NPCs, making it easy to copy and paste. I also implemented party drops and most-hated loot distribution—the only thing missing was calculating the total hated by the entire party.

However, I've decided NOT to use or further develop it because it may require extensive testing, which I dislike and don’t have enough time to waste.
If you're wondering about the shift + click action to view the drops, you can also make the game read the data directly from the XML file.

Cool stuff:
  • Sharded Data Storage: Data is split into smaller parts, making it quicker to access and reducing conflicts when multiple tasks work at the same time.
  • Concurrent Data Structures: ConcurrentHashMap allows safe, simultaneous access to data, preventing slowdowns by avoiding full data locks.
  • Lazy Loading and Caching: The drop data is loaded only when needed and then reused, avoiding repeated file reads and improving performance when managing many NPCs.
Download:
Enjoy!
 
Last edited:
This may be more useful for getMostHatedInRange - not tested:

private Player getMostHatedInRange(MonsterInstance monster, int range)
{
if (monster == null)
return null;

Creature mostHated = monster.getAggroList().getMostHated();
if (mostHated instanceof Player && monster.isInRange(mostHated, range))
{
Player player = (Player) mostHated;
if (player.isOnline() && !player.isDead())
return player;
}
return null;
}
 
Back
Top