From b71710871ce7feceaa04b8ec2e92dfc1942b2cd3 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 5 Sep 2024 19:57:34 -0500 Subject: [PATCH] track list construction --- src/engine/gameManager/PowersManager.java | 37 +++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/src/engine/gameManager/PowersManager.java b/src/engine/gameManager/PowersManager.java index 0a5af688..e198d15e 100644 --- a/src/engine/gameManager/PowersManager.java +++ b/src/engine/gameManager/PowersManager.java @@ -1545,8 +1545,17 @@ public enum PowersManager { } // create list of characters - HashSet trackChars = RangeBasedAwo.getTrackList( - allTargets, playerCharacter, maxTargets); + HashSet trackChars; + switch(msg.getPowerToken()){ + case 431511776: + case 429578587: + case 429503360: + trackChars = getTrackList(playerCharacter); + break; + default: + trackChars = RangeBasedAwo.getTrackList(allTargets, playerCharacter, maxTargets); + break; + } TrackWindowMsg trackWindowMsg = new TrackWindowMsg(msg); @@ -1559,6 +1568,30 @@ public enum PowersManager { } + public static HashSet getTrackList(PlayerCharacter tracker){ + HashSet list = new HashSet(); + HashSet shortList = WorldGrid.getObjectsInRangePartial(tracker.loc,MBServerStatics.CHARACTER_LOAD_RANGE, MBServerStatics.MASK_PLAYER); + HashSet fullList = WorldGrid.getObjectsInRangePartial(tracker.loc,1408, MBServerStatics.MASK_PLAYER); + ArrayList guildsPresent = new ArrayList<>(); + for(AbstractWorldObject awo : shortList){ + PlayerCharacter pc = (PlayerCharacter)awo; + if(!guildsPresent.contains(pc.guild.getNation())){ + guildsPresent.add(pc.guild.getNation()); + } + } + for(AbstractWorldObject awo : fullList){ + if(awo.equals(tracker)) + continue; + PlayerCharacter pc = (PlayerCharacter)awo; + if(!pc.isAlive()) + continue; + if(guildsPresent.contains(pc.guild.getNation())) + list.add(pc); + } + + return list; + } + private static void sendRecyclePower(int token, ClientConnection origin) { RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(token);