forked from MagicBane/Server
hotzone work
This commit is contained in:
@@ -68,6 +68,8 @@ public class HotzoneManager {
|
|||||||
created.teleport(created.bindLoc);
|
created.teleport(created.bindLoc);
|
||||||
created.BehaviourType = Enum.MobBehaviourType.Aggro;
|
created.BehaviourType = Enum.MobBehaviourType.Aggro;
|
||||||
hotzoneMob = created;
|
hotzoneMob = created;
|
||||||
|
created.setHealth(100000);
|
||||||
|
created.setResists(new Resists("Dropper"));
|
||||||
GenerateHotzoneEpicLoot(created);
|
GenerateHotzoneEpicLoot(created);
|
||||||
ZoneManager.hotZone = newHotzone;
|
ZoneManager.hotZone = newHotzone;
|
||||||
|
|
||||||
@@ -181,6 +183,14 @@ public class HotzoneManager {
|
|||||||
|
|
||||||
public static void ClearHotzone(){
|
public static void ClearHotzone(){
|
||||||
ZoneManager.hotZone = null;
|
ZoneManager.hotZone = null;
|
||||||
|
HotzoneManager.playersPresent.clear();
|
||||||
|
if(hotzoneMob != null){
|
||||||
|
hotzoneMob.killCharacter("Hotzone Over");
|
||||||
|
hotzoneMob.despawn();
|
||||||
|
hotzoneMob.spawnTime = 1000000000;
|
||||||
|
DbManager.MobQueries.DELETE_MOB( hotzoneMob);
|
||||||
|
hotzoneMob = null;
|
||||||
|
}
|
||||||
for(PlayerCharacter player : SessionManager.getAllActivePlayerCharacters()) {
|
for(PlayerCharacter player : SessionManager.getAllActivePlayerCharacters()) {
|
||||||
HotzoneChangeMsg hcm = new HotzoneChangeMsg(Enum.GameObjectType.Zone.ordinal(), 0);
|
HotzoneChangeMsg hcm = new HotzoneChangeMsg(Enum.GameObjectType.Zone.ordinal(), 0);
|
||||||
Dispatch dispatch = Dispatch.borrow(player, hcm);
|
Dispatch dispatch = Dispatch.borrow(player, hcm);
|
||||||
@@ -201,6 +211,20 @@ public class HotzoneManager {
|
|||||||
lastPulseTime = System.currentTimeMillis();
|
lastPulseTime = System.currentTimeMillis();
|
||||||
|
|
||||||
HashSet<AbstractWorldObject> inRange = WorldGrid.getObjectsInRangePartial(ZoneManager.hotZone.getLoc(),ZoneManager.hotZone.getBounds().getHalfExtents().x * 2, MBServerStatics.MASK_PLAYER);
|
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
|
||||||
|
for(Guild nation : HotzoneManager.playersPresent.keySet()){
|
||||||
|
for(PlayerCharacter pc : HotzoneManager.playersPresent.get(nation)){
|
||||||
|
if (!inRange.contains(pc)) {
|
||||||
|
HotzoneManager.playersPresent.get(nation).remove(pc);
|
||||||
|
if(HotzoneManager.playersPresent.get(nation).size() < 1){
|
||||||
|
HotzoneManager.playersPresent.remove(nation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//check status of current players/nation in vicinity
|
||||||
for(AbstractWorldObject awo : inRange){
|
for(AbstractWorldObject awo : inRange){
|
||||||
PlayerCharacter pc = (PlayerCharacter)awo;
|
PlayerCharacter pc = (PlayerCharacter)awo;
|
||||||
Guild nation = pc.guild.getNation();
|
Guild nation = pc.guild.getNation();
|
||||||
|
|||||||
Reference in New Issue
Block a user