Initial Stronghold Push
This commit is contained in:
@@ -821,6 +821,10 @@ public class Building extends AbstractWorldObject {
|
||||
return this.meshScale;
|
||||
}
|
||||
|
||||
public void setMeshScale(Vector3f scale) {
|
||||
this.meshScale = scale;
|
||||
}
|
||||
|
||||
public final int getMeshUUID() {
|
||||
return this.meshUUID;
|
||||
}
|
||||
|
||||
@@ -220,16 +220,28 @@ public class ItemBase {
|
||||
AnniverseryGifts.add(971008);
|
||||
AnniverseryGifts.add(971009);
|
||||
AnniverseryGifts.add(971010);
|
||||
//AnniverseryGifts.add(5101000);
|
||||
//AnniverseryGifts.add(5101020);
|
||||
//AnniverseryGifts.add(5101100);
|
||||
//AnniverseryGifts.add(5101120);
|
||||
//AnniverseryGifts.add(5101040);
|
||||
//AnniverseryGifts.add(5101140);
|
||||
//AnniverseryGifts.add(5101060);
|
||||
//AnniverseryGifts.add(5101080);
|
||||
|
||||
AnniverseryGifts.add(5101000);
|
||||
AnniverseryGifts.add(5101020);
|
||||
AnniverseryGifts.add(5101100);
|
||||
AnniverseryGifts.add(5101120);
|
||||
AnniverseryGifts.add(5101040);
|
||||
AnniverseryGifts.add(5101140);
|
||||
AnniverseryGifts.add(5101060);
|
||||
AnniverseryGifts.add(5101080);
|
||||
|
||||
//fate peddler presents
|
||||
AnniverseryGifts.add(971012);
|
||||
AnniverseryGifts.add(971013);
|
||||
AnniverseryGifts.add(971014);
|
||||
AnniverseryGifts.add(971015);
|
||||
AnniverseryGifts.add(971016);
|
||||
AnniverseryGifts.add(971017);
|
||||
AnniverseryGifts.add(971018);
|
||||
AnniverseryGifts.add(971019);
|
||||
AnniverseryGifts.add(971020);
|
||||
AnniverseryGifts.add(971021);
|
||||
AnniverseryGifts.add(971022);
|
||||
AnniverseryGifts.add(971023);
|
||||
}
|
||||
|
||||
public static int getDiscPrice(int uuid) {
|
||||
|
||||
@@ -10,8 +10,11 @@
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.InterestManagement.InterestManager;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.gameManager.*;
|
||||
import engine.math.Vector3f;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.msg.ErrorPopupMsg;
|
||||
import engine.server.MBServerStatics;
|
||||
@@ -58,6 +61,11 @@ public class Mine extends AbstractGameObject {
|
||||
public final HashSet<Integer> _playerMemory = new HashSet<>();
|
||||
public ArrayList<PlayerCharacter> affectedPlayers = new ArrayList<>();
|
||||
|
||||
//stronghold stuff
|
||||
public boolean isStronghold = false;
|
||||
public ArrayList<Mob> strongholdMobs;
|
||||
public HashMap<Integer,Integer> oldBuildings;
|
||||
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
*/
|
||||
@@ -180,9 +188,15 @@ public class Mine extends AbstractGameObject {
|
||||
writer.putInt(mine.getObjectType().ordinal());
|
||||
writer.putInt(mine.getObjectUUID());
|
||||
writer.putInt(mine.getObjectUUID()); //actually a hash of mine
|
||||
writer.putString(mine.mineType.name);
|
||||
if(mine.isStronghold){
|
||||
writer.putString("STRONGHOLD");
|
||||
writer.putString("");
|
||||
}else {
|
||||
writer.putString(mine.mineType.name);
|
||||
writer.putString(mine.capSize + " Man ");
|
||||
}
|
||||
//writer.putString(mine.zoneName + " " + mine.capSize + " Man ");
|
||||
writer.putString(mine.capSize + " Man ");
|
||||
|
||||
writer.putInt(mine.production.hash);
|
||||
writer.putInt(mine.production.baseProduction);
|
||||
writer.putInt(mine.getModifiedProductionAmount()); //TODO calculate range penalty here
|
||||
@@ -637,4 +651,88 @@ 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));
|
||||
}
|
||||
|
||||
//update tower to become stronghold mesh
|
||||
tower.setMeshScale(new Vector3f(2,2,2));
|
||||
tower.setMeshUUID(5001500);
|
||||
|
||||
//create elite mobs
|
||||
for(int i = 0; i < 15; i++){
|
||||
Mob guard = Mob.createMob(14315, Vector3fImmutable.getRandomPointOnCircle(tower.loc,30),Guild.getErrantGuild(),true,mineZone,null,0, "Elite",65);
|
||||
if(guard != null){
|
||||
guard.setResists(new Resists("Elite"));
|
||||
guard.healthMax *= 2;
|
||||
guard.setHealth(guard.healthMax);
|
||||
guard.spawnTime = 1000000000;
|
||||
guard.runAfterLoad();
|
||||
InterestManager.setObjectDirty(guard);
|
||||
this.strongholdMobs.add(guard);
|
||||
LootManager.GenerateStrongholdLoot(guard,false);
|
||||
}
|
||||
}
|
||||
//create stronghold commander
|
||||
Mob commander = Mob.createMob(14315, Vector3fImmutable.getRandomPointOnCircle(tower.loc,30),Guild.getErrantGuild(),true,mineZone,null,0, "Commander",75);
|
||||
if(commander != null){
|
||||
commander.setResists(new Resists("Elite"));
|
||||
commander.healthMax *= 2;
|
||||
commander.setHealth(commander.healthMax);
|
||||
commander.spawnTime = 1000000000;
|
||||
commander.runAfterLoad();
|
||||
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.setMeshScale(new Vector3f(1,1,1));
|
||||
tower.setMeshUUID(1500100);
|
||||
|
||||
this.setActive(false);
|
||||
tower.setProtectionState(Enum.ProtectionState.NPC);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,9 @@ public class Resists {
|
||||
case "Dropper":
|
||||
setDropperResists();
|
||||
break;
|
||||
case "Elite":
|
||||
setEliteResists();
|
||||
break;
|
||||
default:
|
||||
setGenericResists();
|
||||
break;
|
||||
@@ -252,6 +255,24 @@ public class Resists {
|
||||
this.immuneTo.put(DamageType.Siege, true);
|
||||
}
|
||||
|
||||
public final void setEliteResists() {
|
||||
this.immuneToAll = false;
|
||||
this.resists.put(DamageType.Slash, 75f);
|
||||
this.resists.put(DamageType.Crush, 75f);
|
||||
this.resists.put(DamageType.Pierce, 75f);
|
||||
this.resists.put(DamageType.Magic, 75f);
|
||||
this.resists.put(DamageType.Bleed, 75f);
|
||||
this.resists.put(DamageType.Poison, 75f);
|
||||
this.resists.put(DamageType.Mental, 75f);
|
||||
this.resists.put(DamageType.Holy, 75f);
|
||||
this.resists.put(DamageType.Unholy, 75f);
|
||||
this.resists.put(DamageType.Lightning, 75f);
|
||||
this.resists.put(DamageType.Fire, 75f);
|
||||
this.resists.put(DamageType.Cold, 75f);
|
||||
this.resists.put(DamageType.Healing, 0f);
|
||||
this.immuneTo.put(DamageType.Siege, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create generic resists
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user