forked from MagicBane/Server
hotzone work
This commit is contained in:
@@ -21,6 +21,10 @@ public class HotzoneManager {
|
||||
public static Long lastPulseTime = 0L;
|
||||
public static HashMap<Guild, ArrayList<PlayerCharacter>> 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<AbstractWorldObject> inRange = WorldGrid.getObjectsInRangePartial(ZoneManager.hotZone.getLoc(),ZoneManager.hotZone.getBounds().getHalfExtents().x * 2, MBServerStatics.MASK_PLAYER);
|
||||
|
||||
//clear out old players who aren't here anymore
|
||||
|
||||
Reference in New Issue
Block a user