From f57f3007168793d67494272905170b08b5f6e60c Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 19 Mar 2025 19:25:05 -0500 Subject: [PATCH] hotzone work --- src/engine/gameManager/HotzoneManager.java | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/engine/gameManager/HotzoneManager.java b/src/engine/gameManager/HotzoneManager.java index 69f78611..57aeaf1c 100644 --- a/src/engine/gameManager/HotzoneManager.java +++ b/src/engine/gameManager/HotzoneManager.java @@ -21,6 +21,10 @@ public class HotzoneManager { public static Long lastPulseTime = 0L; public static HashMap> playersPresent; public static Mob hotzoneMob = null; + public static boolean three_quarter_health = false; + public static boolean half_health = false; + public static boolean quarter_health = false; + public static long lastAnnounce = 0L; public static void SelectRandomHotzone(){ if(hotzoneMob != null){ hotzoneMob.killCharacter("Hotzone Over"); @@ -78,6 +82,9 @@ public class HotzoneManager { Dispatch dispatch = Dispatch.borrow(player, hcm); DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); } + three_quarter_health = false; + half_health = false; + quarter_health = false; } public static void GenerateHotzoneEpicLoot(Mob mob) { @@ -210,6 +217,46 @@ public class HotzoneManager { lastPulseTime = System.currentTimeMillis(); + //handle world announcements for HZ boss + if(hotzoneMob != null){ + float health = hotzoneMob.getHealth(); + if(health < 75000 && health > 50000 && !three_quarter_health){ + //mob at 50%-75% health + three_quarter_health = true; + String name = hotzoneMob.getName(); + ChatSystemMsg chatMsg = new ChatSystemMsg(null, name + " In The Hotzone Is At 75% Health"); + chatMsg.setMessageType(10); + chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); + DispatchMessage.dispatchMsgToAll(chatMsg); + }else if(health < 50000 && health > 25000 && !half_health){ + //mob ta 25%-50% health + half_health = true; + String name = hotzoneMob.getName(); + ChatSystemMsg chatMsg = new ChatSystemMsg(null, name + " In The Hotzone Is At 50% Health"); + chatMsg.setMessageType(10); + chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); + DispatchMessage.dispatchMsgToAll(chatMsg); + }else if(health < 25000 && !quarter_health){ + //mob under 25% health + quarter_health = true; + String name = hotzoneMob.getName(); + ChatSystemMsg chatMsg = new ChatSystemMsg(null, name + " In The Hotzone Is At 25% Health"); + chatMsg.setMessageType(10); + chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); + DispatchMessage.dispatchMsgToAll(chatMsg); + }else if (health > 75000){ + //mob at 75% - 100% health + if(lastAnnounce + MBServerStatics.FIVE_MINUTES < System.currentTimeMillis()){ + lastAnnounce = System.currentTimeMillis(); + String name = hotzoneMob.getName(); + ChatSystemMsg chatMsg = new ChatSystemMsg(null, name + " In The Hotzone Is Still Alive"); + chatMsg.setMessageType(10); + chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); + DispatchMessage.dispatchMsgToAll(chatMsg); + } + } + } + HashSet inRange = WorldGrid.getObjectsInRangePartial(ZoneManager.hotZone.getLoc(),ZoneManager.hotZone.getBounds().getHalfExtents().x * 2, MBServerStatics.MASK_PLAYER); //clear out old players who aren't here anymore