Browse Source

epic encounter after clearing a stronghold

lakebane-strongholds
FatBoy-DOTC 5 months ago
parent
commit
83877e5107
  1. 79
      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

79
src/engine/gameManager/LootManager.java

@ -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(); mob.getCharItemManager().clearInventory();
int multiplier = 1; int multiplier = 1;
if (commander) if (commander)
multiplier = 2; multiplier = 2;
if(epic)
multiplier = 10;
int high = 125000; int high = 125000;
int low = 50000; int low = 50000;
@ -708,51 +710,58 @@ public enum LootManager {
} }
//special commander drop chances //special commander drop chances
if (commander) { if (commander)
GenerateCommanderLoot(mob);
//special epic drop chances
if (epic) {
GenerateCommanderLoot(mob);
GenerateCommanderLoot(mob);
}
}
//present chance public static void GenerateCommanderLoot(Mob mob){
if (ThreadLocalRandom.current().nextInt(100) < 25) //present chance
DropPresent(mob); if (ThreadLocalRandom.current().nextInt(100) < 25)
DropPresent(mob);
//present chance //present chance
if (ThreadLocalRandom.current().nextInt(100) < 25) if (ThreadLocalRandom.current().nextInt(100) < 25)
DropPresent(mob); DropPresent(mob);
//chance for glass //chance for glass
if (ThreadLocalRandom.current().nextInt(100) < 75) { if (ThreadLocalRandom.current().nextInt(100) < 75) {
int glassID = rollRandomItem(126); int glassID = rollRandomItem(126);
ItemBase glassItem = ItemBase.getItemBase(glassID); ItemBase glassItem = ItemBase.getItemBase(glassID);
if (glassItem != null) { if (glassItem != null) {
MobLoot toAdd2 = new MobLoot(mob, glassItem, true); MobLoot toAdd2 = new MobLoot(mob, glassItem, true);
if (toAdd2 != null) if (toAdd2 != null)
mob.getCharItemManager().addItemToInventory(toAdd2); mob.getCharItemManager().addItemToInventory(toAdd2);
}
} }
}
//chance for disc //chance for disc
if (ThreadLocalRandom.current().nextInt(100) < 75) { if (ThreadLocalRandom.current().nextInt(100) < 75) {
int discID = rollRandomItem(3202); int discID = rollRandomItem(3202);
ItemBase discItem = ItemBase.getItemBase(discID); ItemBase discItem = ItemBase.getItemBase(discID);
if (discItem != null) { if (discItem != null) {
MobLoot toAdd3 = new MobLoot(mob, discItem, true); MobLoot toAdd3 = new MobLoot(mob, discItem, true);
if (toAdd3 != null) if (toAdd3 != null)
mob.getCharItemManager().addItemToInventory(toAdd3); mob.getCharItemManager().addItemToInventory(toAdd3);
}
} }
}
//chance for stat rune //chance for stat rune
if (ThreadLocalRandom.current().nextInt(100) < 75) { if (ThreadLocalRandom.current().nextInt(100) < 75) {
int runeID = rollRandomItem(3201); int runeID = rollRandomItem(3201);
ItemBase runeItem = ItemBase.getItemBase(runeID); ItemBase runeItem = ItemBase.getItemBase(runeID);
if (runeItem != null) { if (runeItem != null) {
MobLoot toAdd4 = new MobLoot(mob, runeItem, true); MobLoot toAdd4 = new MobLoot(mob, runeItem, true);
if (toAdd4 != null) if (toAdd4 != null)
mob.getCharItemManager().addItemToInventory(toAdd4); mob.getCharItemManager().addItemToInventory(toAdd4);
}
} }
} }
} }

57
src/engine/gameManager/StrongholdManager.java

@ -74,7 +74,7 @@ public class StrongholdManager {
guard.spawnTime = 1000000000; guard.spawnTime = 1000000000;
guard.BehaviourType = Enum.MobBehaviourType.Aggro; guard.BehaviourType = Enum.MobBehaviourType.Aggro;
mine.strongholdMobs.add(guard); mine.strongholdMobs.add(guard);
LootManager.GenerateStrongholdLoot(guard,false); LootManager.GenerateStrongholdLoot(guard,false,false);
guard.healthMax = 12500; guard.healthMax = 12500;
guard.setHealth(guard.healthMax); guard.setHealth(guard.healthMax);
guard.maxDamageHandOne = 1550; guard.maxDamageHandOne = 1550;
@ -84,6 +84,7 @@ public class StrongholdManager {
guard.setFirstName("Elite Guardian"); guard.setFirstName("Elite Guardian");
InterestManager.setObjectDirty(guard); InterestManager.setObjectDirty(guard);
guard.StrongholdGuardian = true; guard.StrongholdGuardian = true;
guard.stronghold = mine;
} }
} }
//create stronghold commander //create stronghold commander
@ -106,7 +107,7 @@ public class StrongholdManager {
commander.mobPowers.put(429413547,40); // grasp of thurin commander.mobPowers.put(429413547,40); // grasp of thurin
commander.StrongholdCommander = true; commander.StrongholdCommander = true;
mine.strongholdMobs.add(commander); mine.strongholdMobs.add(commander);
LootManager.GenerateStrongholdLoot(commander,true); LootManager.GenerateStrongholdLoot(commander,true, false);
commander.healthMax = 50000; commander.healthMax = 50000;
commander.setHealth(commander.healthMax); commander.setHealth(commander.healthMax);
commander.maxDamageHandOne = 3500; commander.maxDamageHandOne = 3500;
@ -115,6 +116,7 @@ public class StrongholdManager {
commander.defenseRating = 3500; commander.defenseRating = 3500;
commander.setFirstName("Guardian Commander"); commander.setFirstName("Guardian Commander");
InterestManager.setObjectDirty(commander); InterestManager.setObjectDirty(commander);
commander.stronghold = mine;
} }
mine.setActive(true); mine.setActive(true);
@ -250,4 +252,55 @@ public class StrongholdManager {
} }
return 0; 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 {
public ArrayList<Mob> strongholdMobs; public ArrayList<Mob> strongholdMobs;
public HashMap<Integer,Integer> oldBuildings; public HashMap<Integer,Integer> oldBuildings;
public Mob epicEncounter = null;
/** /**
* ResultSet Constructor * ResultSet Constructor
*/ */

21
src/engine/objects/Mob.java

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

Loading…
Cancel
Save