forked from MagicBane/Server
Stronghold variations
This commit is contained in:
@@ -658,106 +658,4 @@ public class Mine extends AbstractGameObject {
|
||||
|
||||
_playerMemory.removeAll(toRemove);
|
||||
}
|
||||
|
||||
public void StartStronghold(){
|
||||
|
||||
//remove buildings
|
||||
Building tower = BuildingManager.getBuilding(this.buildingID);
|
||||
if(tower == null)
|
||||
return;
|
||||
|
||||
this.isStronghold = true;
|
||||
this.strongholdMobs = new ArrayList<>();
|
||||
this.oldBuildings = new HashMap<>();
|
||||
|
||||
Zone mineZone = ZoneManager.findSmallestZone(tower.loc);
|
||||
for(Building building : mineZone.zoneBuildingSet){
|
||||
oldBuildings.put(building.getObjectUUID(),building.meshUUID);
|
||||
building.setMeshUUID(407650);
|
||||
building.setMeshScale(new Vector3f(0,0,0));
|
||||
InterestManager.setObjectDirty(building);
|
||||
WorldGrid.updateObject(building);
|
||||
}
|
||||
|
||||
//update tower to become stronghold mesh
|
||||
tower.setMeshUUID(423600);
|
||||
tower.setMeshScale(new Vector3f(1,1,1));
|
||||
InterestManager.setObjectDirty(tower);
|
||||
WorldGrid.updateObject(tower);
|
||||
|
||||
//create elite mobs
|
||||
for(int i = 0; i < 10; i++){
|
||||
Mob guard = Mob.createMob(14315, Vector3fImmutable.getRandomPointOnCircle(tower.loc,30),Guild.getErrantGuild(),true,mineZone,null,0, "Elite Guardian",65);
|
||||
if(guard != null){
|
||||
guard.setLevel((short)65);
|
||||
guard.setResists(new Resists("Elite"));
|
||||
guard.healthMax *= 2;
|
||||
guard.setHealth(guard.healthMax);
|
||||
guard.spawnTime = 1000000000;
|
||||
guard.BehaviourType = Enum.MobBehaviourType.Aggro;
|
||||
guard.maxDamageHandOne *= 2;
|
||||
guard.minDamageHandOne *= 2;
|
||||
guard.atrHandOne *= 2;
|
||||
guard.defenseRating *= 2;
|
||||
InterestManager.setObjectDirty(guard);
|
||||
this.strongholdMobs.add(guard);
|
||||
LootManager.GenerateStrongholdLoot(guard,false);
|
||||
}
|
||||
if(guard!= null && guard.level < 60)
|
||||
guard.despawn();
|
||||
}
|
||||
//create stronghold commander
|
||||
Mob commander = Mob.createMob(14293, tower.loc,Guild.getErrantGuild(),true,mineZone,null,0, "Guardian Commander",75);
|
||||
if(commander != null){
|
||||
commander.setLevel((short)75);
|
||||
commander.setResists(new Resists("Elite"));
|
||||
commander.healthMax = 50000;
|
||||
commander.setHealth(commander.healthMax);
|
||||
commander.spawnTime = 1000000000;
|
||||
commander.BehaviourType = Enum.MobBehaviourType.Aggro;
|
||||
commander.maxDamageHandOne = 1500;
|
||||
commander.minDamageHandOne = 3500;
|
||||
commander.atrHandOne = 3500;
|
||||
commander.defenseRating = 3500;
|
||||
commander.mobPowers.put(429413547,40);
|
||||
commander.mobPowers.put(429032838,40);
|
||||
commander.mobPowers.put(57584498,40);
|
||||
InterestManager.setObjectDirty(commander);
|
||||
this.strongholdMobs.add(commander);
|
||||
LootManager.GenerateStrongholdLoot(commander,true);
|
||||
}
|
||||
|
||||
this.setActive(true);
|
||||
tower.setProtectionState(Enum.ProtectionState.PROTECTED);
|
||||
}
|
||||
public void EndStronghold(){
|
||||
|
||||
//restore the buildings
|
||||
Building tower = BuildingManager.getBuilding(this.buildingID);
|
||||
if(tower == null)
|
||||
return;
|
||||
|
||||
this.isStronghold = false;
|
||||
|
||||
//get rid of the mobs
|
||||
for(Mob mob : this.strongholdMobs) {
|
||||
mob.despawn();
|
||||
mob.removeFromCache();
|
||||
}
|
||||
|
||||
//restore the buildings
|
||||
Zone mineZone = ZoneManager.findSmallestZone(tower.loc);
|
||||
for(Building building : mineZone.zoneBuildingSet){
|
||||
if(this.oldBuildings.containsKey(building.getObjectUUID())) {
|
||||
building.setMeshUUID(this.oldBuildings.get(building.getObjectUUID()));
|
||||
building.setMeshScale(new Vector3f(1, 1, 1));
|
||||
}
|
||||
}
|
||||
|
||||
//update tower to become Mine Tower again
|
||||
tower.setMeshUUID(1500100);
|
||||
|
||||
this.setActive(false);
|
||||
tower.setProtectionState(Enum.ProtectionState.NPC);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user