Skip to content

Commit 8ba2ccf

Browse files
authored
Merge pull request #410 from nicolassanchez02/fix/343-group-rls-loot
2 parents cd46266 + ffe807b commit 8ba2ccf

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • sku.0/sys.server/compiled/game/script/library

sku.0/sys.server/compiled/game/script/library/loot.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2491,6 +2491,14 @@ public static boolean addRareLoot(obj_id target) throws InterruptedException
24912491
// get the attacker who did the most damage.
24922492
obj_id player = getObjIdObjVar(target, xp.VAR_TOP_GROUP);
24932493

2494+
// VAR_TOP_GROUP stores a group object when the top damage dealer is grouped.
2495+
// Pick a random member of that group to receive the RLS chest.
2496+
if (group.isGroupObject(player)) {
2497+
obj_id[] members = utils.getLocalGroupMemberIds(player);
2498+
if (members == null || members.length == 0) return false;
2499+
player = members[rand(0, members.length - 1)];
2500+
}
2501+
24942502
// make sure the attacker is a player.
24952503
if(!isValidId(player) || !isPlayer(player)){
24962504
return false;

0 commit comments

Comments
 (0)