Browse Source

epic encounter after clearing a stronghold

lakebane-strongholds
FatBoy-DOTC 4 months ago
parent
commit
83877e5107
  1. 15
      src/engine/gameManager/LootManager.java
  2. 57
      src/engine/gameManager/StrongholdManager.java
  3. 2
      src/engine/objects/Mine.java
  4. 21
      src/engine/objects/Mob.java

15
src/engine/gameManager/LootManager.java

@ -667,13 +667,15 @@ public enum LootManager { @@ -667,13 +667,15 @@ public enum LootManager {
}
}
public static void GenerateStrongholdLoot(Mob mob, boolean commander) {
public static void GenerateStrongholdLoot(Mob mob, boolean commander, boolean epic) {
mob.getCharItemManager().clearInventory();
int multiplier = 1;
if (commander)
multiplier = 2;
if(epic)
multiplier = 10;
int high = 125000;
int low = 50000;
@ -708,9 +710,17 @@ public enum LootManager { @@ -708,9 +710,17 @@ public enum LootManager {
}
//special commander drop chances
if (commander) {
if (commander)
GenerateCommanderLoot(mob);
//special epic drop chances
if (epic) {
GenerateCommanderLoot(mob);
GenerateCommanderLoot(mob);
}
}
public static void GenerateCommanderLoot(Mob mob){
//present chance
if (ThreadLocalRandom.current().nextInt(100) < 25)
DropPresent(mob);
@ -755,5 +765,4 @@ public enum LootManager { @@ -755,5 +765,4 @@ public enum LootManager {
}
}
}
}
}

57
src/engine/gameManager/StrongholdManager.java

@ -74,7 +74,7 @@ public class StrongholdManager { @@ -74,7 +74,7 @@ public class StrongholdManager {
guard.spawnTime = 1000000000;
guard.BehaviourType = Enum.MobBehaviourType.Aggro;
mine.strongholdMobs.add(guard);
LootManager.GenerateStrongholdLoot(guard,false);
LootManager.GenerateStrongholdLoot(guard,false,false);
guard.healthMax = 12500;
guard.setHealth(guard.healthMax);
guard.maxDamageHandOne = 1550;
@ -84,6 +84,7 @@ public class StrongholdManager { @@ -84,6 +84,7 @@ public class StrongholdManager {
guard.setFirstName("Elite Guardian");
InterestManager.setObjectDirty(guard);
guard.StrongholdGuardian = true;
guard.stronghold = mine;
}
}
//create stronghold commander
@ -106,7 +107,7 @@ public class StrongholdManager { @@ -106,7 +107,7 @@ public class StrongholdManager {
commander.mobPowers.put(429413547,40); // grasp of thurin
commander.StrongholdCommander = true;
mine.strongholdMobs.add(commander);
LootManager.GenerateStrongholdLoot(commander,true);
LootManager.GenerateStrongholdLoot(commander,true, false);
commander.healthMax = 50000;
commander.setHealth(commander.healthMax);
commander.maxDamageHandOne = 3500;
@ -115,6 +116,7 @@ public class StrongholdManager { @@ -115,6 +116,7 @@ public class StrongholdManager {
commander.defenseRating = 3500;
commander.setFirstName("Guardian Commander");
InterestManager.setObjectDirty(commander);
commander.stronghold = mine;
}
mine.setActive(true);
@ -250,4 +252,55 @@ public class StrongholdManager { @@ -250,4 +252,55 @@ public class StrongholdManager {
}
return 0;
}
public static void CheckToEndStronghold(Mine mine) {
if (!mine.isStronghold)
return;
boolean stillAlive = false;
for (Mob mob : mine.strongholdMobs)
if (mob.isAlive())
stillAlive = true;
if (!stillAlive) {
// Epic encounter
Building tower = BuildingManager.getBuilding(mine.getBuildingID());
if (tower == null)
return;
Zone mineZone = ZoneManager.findSmallestZone(tower.loc);
Vector3fImmutable loc = tower.loc;
MobBase commanderBase = MobBase.getMobBase(getStrongholdCommanderID(tower.meshUUID));
Mob commander = Mob.createMob(commanderBase.getLoadID(), loc, Guild.getErrantGuild(), true, mineZone, null, 0, commanderBase.getFirstName(), 75);
if (commander != null) {
commander.parentZone = mine.getParentZone();
commander.bindLoc = loc;
commander.setLoc(loc);
commander.equipmentSetID = getStrongholdMobEquipSetID(commander.getMobBaseID());
commander.runAfterLoad();
commander.setLevel((short) 75);
commander.setResists(new Resists("Elite"));
commander.spawnTime = 1000000000;
commander.BehaviourType = Enum.MobBehaviourType.Aggro;
commander.mobPowers.clear();
commander.mobPowers.put(563107033, 40); //grounding shot
commander.mobPowers.put(429032838, 40); // gravechill
commander.mobPowers.put(429413547, 40); // grasp of thurin
mine.strongholdMobs.add(commander);
LootManager.GenerateStrongholdLoot(commander, true, false);
commander.healthMax = 250000;
commander.setHealth(commander.healthMax);
commander.maxDamageHandOne = 5000;
commander.minDamageHandOne = 2500;
commander.atrHandOne = 5000;
commander.defenseRating = 3500;
commander.setFirstName("Epic Commander");
InterestManager.setObjectDirty(commander);
commander.stronghold = mine;
commander.StrongholdEpic = true;
}
}
}
}

2
src/engine/objects/Mine.java

@ -66,6 +66,8 @@ public class Mine extends AbstractGameObject { @@ -66,6 +66,8 @@ public class Mine extends AbstractGameObject {
public ArrayList<Mob> strongholdMobs;
public HashMap<Integer,Integer> oldBuildings;
public Mob epicEncounter = null;
/**
* ResultSet Constructor
*/

21
src/engine/objects/Mob.java

@ -105,6 +105,10 @@ public class Mob extends AbstractIntelligenceAgent { @@ -105,6 +105,10 @@ public class Mob extends AbstractIntelligenceAgent {
public boolean StrongholdGuardian = false;
public Mine stronghold = null;
public boolean StrongholdEpic = false;
/**
* No Id Constructor
@ -1291,8 +1295,12 @@ public class Mob extends AbstractIntelligenceAgent { @@ -1291,8 +1295,12 @@ public class Mob extends AbstractIntelligenceAgent {
Dispatch dispatch;
try {
if(this.StrongholdGuardian || this.StrongholdCommander)
if(this.StrongholdGuardian || this.StrongholdCommander) {
ChatManager.chatSystemChannel(this.parentZone.getName() + "'s Stronghold Is Under Attack!");
StrongholdManager.CheckToEndStronghold(this.stronghold);
}
if(this.StrongholdEpic)
StrongholdManager.EndStronghold(this.stronghold);
//resync corpses
//this.setLoc(this.getMovementLoc());
if (this.isSiege) {
@ -1482,7 +1490,7 @@ public class Mob extends AbstractIntelligenceAgent { @@ -1482,7 +1490,7 @@ public class Mob extends AbstractIntelligenceAgent {
} catch (Exception e) {
Logger.error(e.getMessage());
}
if(this.StrongholdCommander || this.StrongholdGuardian){
if(this.StrongholdCommander || this.StrongholdGuardian || this.StrongholdEpic){
this.setResists(new Resists("Elite"));
return;
}
@ -1496,6 +1504,9 @@ public class Mob extends AbstractIntelligenceAgent { @@ -1496,6 +1504,9 @@ public class Mob extends AbstractIntelligenceAgent {
} else if(this.StrongholdGuardian){
this.healthMax = 12500;
return;
} else if(this.StrongholdEpic){
this.healthMax = 250000;
return;
}
float h;
@ -1567,6 +1578,12 @@ public class Mob extends AbstractIntelligenceAgent { @@ -1567,6 +1578,12 @@ public class Mob extends AbstractIntelligenceAgent {
this.atrHandOne = 1800;
this.defenseRating = 2200;
return;
} else if(this.StrongholdEpic){
this.maxDamageHandOne = 5000;
this.minDamageHandOne = 2500;
this.atrHandOne = 5000;
this.defenseRating = 3500;
return;
}
if (this.charItemManager == null || this.equip == null) {
Logger.error("Player " + currentID + " missing skills or equipment");

Loading…
Cancel
Save