THIRD AFTER ROLLBACK: contract and rune and glass drop rates adjusted properly

This commit is contained in:
2024-06-02 16:24:55 -05:00
parent bf69045b0b
commit 885b612bd6
2 changed files with 461 additions and 384 deletions
+99 -109
View File
@@ -12,7 +12,6 @@ package engine.objects;
import ch.claude_martin.enumbitset.EnumBitSet;
import engine.Enum;
import engine.Enum.*;
import engine.InterestManagement.RealmMap;
import engine.InterestManagement.WorldGrid;
import engine.exception.SerializationException;
import engine.gameManager.*;
@@ -26,7 +25,6 @@ import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.msg.PetMsg;
import engine.net.client.msg.PlaceAssetMsg;
import engine.net.client.msg.chat.ChatSystemMsg;
import engine.powers.MobPowerEntry;
import engine.server.MBServerStatics;
import org.joda.time.DateTime;
@@ -38,6 +36,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import static engine.gameManager.NPCManager._runeSetMap;
@@ -87,6 +86,9 @@ public class Mob extends AbstractIntelligenceAgent {
public boolean dropper = false;
public int contractCounter = 0;
public int runeCounter = 0;
// New Mobile constructor. Fill in the blanks and then call
// PERSIST.
public Mob() {
@@ -96,6 +98,7 @@ public class Mob extends AbstractIntelligenceAgent {
this.bindLoc = Vector3fImmutable.ZERO;
this.gridObjectType = GridObjectType.DYNAMIC;
this.agentType = AIAgentType.MOBILE;
setResistsForMob(this);
}
@@ -164,6 +167,13 @@ public class Mob extends AbstractIntelligenceAgent {
this.currentID = this.dbID;
this.agentType = AIAgentType.MOBILE;
//this.setResists(Resists.getResists(rs.getInt("mob_spawnType")));
setResistsForMob(this);
this.contractCounter = ThreadLocalRandom.current().nextInt(250);
this.runeCounter = ThreadLocalRandom.current().nextInt(250);
} catch (Exception e) {
Logger.error(e + " " + this.dbID);
}
@@ -172,77 +182,78 @@ public class Mob extends AbstractIntelligenceAgent {
public static void setResistsForMob(Mob mob){
Resists resists = new Resists("Generic");
Zone parentMacro = null;
for(Zone zone : ZoneManager.getAllZonesIn(mob.loc)){
if(zone.isMacroZone() == false)
continue;
parentMacro = zone;
}
if(parentMacro != null) {
switch (parentMacro.getName()) {
//ice generics
case "Ymur's Crown":
case "Kralgaar Holm":
case "Ecklund Wilds":
case "Aurrochs Skrae":
resists.addResists(Resists.getResists(28));
break;
//Desert Generics
case "Leth'khalivar Desert":
case "Kharsoom":
case "Vale of Nar Addad":
case "The Blood Sands":
resists.addResists(Resists.getResists(2));
break;
//Swamp Generics
case "Thollok Marsh":
case "The Black Bog":
case "Sevaath Mere":
resists.addResists(Resists.getResists(8));
break;
//Oblivion Generics
case "Plain of Ashes":
case "Bone Marches":
case "The Doomplain":
case "Greensward Pyre":
resists.addResists(Resists.getResists(4));
break;
//Maelstrom Generics
case "Pandemonium":
case "Western Battleground":
resists.addResists(Resists.getResists(32));
break;
}
}
if(MobBase.mobbase_race_types.size() == 0){
DbManager.MobBaseQueries.LOAD_ALL_MOBBASE_RACES();
}
String raceType = MobBase.mobbase_race_types.get(mob.getMobBaseID());
if(raceType != null) {
switch (raceType) {
int mobbaseID = mob.getMobBaseID();
if(mobbaseID != 0) {
switch (MobBase.mobbase_race_types.get(mobbaseID)) {
case "Aelfborn":
case "NPC":
case "Rat":
case "Reptile":
case "Grave":
case "Human":
case "Goblin":
case "CSR":
case "Construct":
case "Celestial":
case "Animal":
case "All":
case "SiegeEngineer":
int realmID = RealmMap.getRealmIDAtLocation(mob.bindLoc);
Realm realm = Realm.getRealm(realmID);
if (realm != null) {
switch (realm.getRealmName()) {
//ice generics
case "Hethlund":
case "Hregenlund":
case "Ecklund":
case "Kralgaard":
resists.addResists(Resists.getResists(28));
break;
//Desert Generics
case "Letharuun":
case "Adduram":
case "Neshraa":
resists.addResists(Resists.getResists(2));
break;
//Swamp Generics
case "Aeglund":
case "Thollmar":
resists.addResists(Resists.getResists(8));
break;
//Oblivion Generics
case "Oblivion":
case "Vandernoch":
resists.addResists(Resists.getResists(4));
break;
//Maelstrom Generics
case "Maelstrom":
resists.addResists(Resists.getResists(32));
break;
case "Valkos":
case "Ulward":
resists.addResists(Resists.getResists(5));
}
}
break;
case "Reptile":
case "Dragon":
resists.addResists(Resists.getResists(10));
break;
case "Goblin":
resists.addResists(Resists.getResists(9));
resists.addResists(new Resists("Generic"));
break;
case "Aracoix":
resists.addResists(Resists.getResists(22));
break;
case "Rat":
case "Troll":
resists.addResists(Resists.getResists(33));
break;
case "Centaur":
resists.addResists(Resists.getResists(24));
break;
case "Dragon":
resists.addResists(Resists.getResists(10));
break;
case "Dwarf":
resists.addResists(Resists.getResists(25));
break;
@@ -284,6 +295,9 @@ public class Mob extends AbstractIntelligenceAgent {
case "Siege":
resists.addResists(Resists.getResists(38));
break;
case "Troll":
resists.addResists(Resists.getResists(33));
break;
case "Undead":
resists.addResists(Resists.getResists(27));
break;
@@ -1010,7 +1024,7 @@ public class Mob extends AbstractIntelligenceAgent {
//Next upda
}
this.setLoc(newLoc);
setLoc(newLoc);
this.region = AbstractWorldObject.GetRegionByWorldObject(this);
//Next update will be end Loc, lets stop him here.
@@ -1185,17 +1199,6 @@ public class Mob extends AbstractIntelligenceAgent {
return;
LootManager.GenerateMobLoot(this);
if(this.dropper){
for(Item item : this.charItemManager.getInventory()) {
ItemBase ib = item.getItemBase();
if(ib.isDiscRune()) {
ChatSystemMsg chatMsg = new ChatSystemMsg(null, this.getName() + " in " + this.getParentZone().getName() + " has found the " + ib.getName() + ". Are you tough enough to take it?");
chatMsg.setMessageType(10);
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID());
DispatchMessage.dispatchMsgToAll(chatMsg);
}
}
}
}
@Override
@@ -1711,10 +1714,7 @@ public class Mob extends AbstractIntelligenceAgent {
this.behaviourType = MobBehaviourType.GuardCaptain;
this.spawnTime = 60 * 15;
this.isPlayerGuard = true;
if(this.building != null && ZoneManager.getCityAtLocation(this.building.getLoc()) != null)
this.guardedCity = ZoneManager.getCityAtLocation(this.building.getLoc());
else
this.guardedCity = null;
this.guardedCity = ZoneManager.getCityAtLocation(this.building.getLoc());
}
// Load AI for wall archers
@@ -1771,8 +1771,8 @@ public class Mob extends AbstractIntelligenceAgent {
//TODO set these correctly later
this.rangeHandOne = this.mobBase.getAttackRange();
this.rangeHandTwo = -1;
this.minDamageHandOne = (int) this.mobBase.getMinDmg();
this.maxDamageHandOne = (int) this.mobBase.getMaxDmg();
this.minDamageHandOne = (int)this.mobBase.getMinDmg();
this.maxDamageHandOne = (int)this.mobBase.getMaxDmg();
this.minDamageHandTwo = 0;
this.maxDamageHandTwo = 0;
this.atrHandOne = this.mobBase.getAtr();
@@ -1852,10 +1852,10 @@ public class Mob extends AbstractIntelligenceAgent {
try {
NPCManager.applyRuneSetEffects(this);
recalculateStats();
if (this.mobBase.getLevel() > 80) {
if (this.getMobBaseID() == 14319) {//ithriana
if(this.mobBase.getLevel() > 80){
if(this.getMobBaseID() == 14319){//ithriana
this.healthMax = 5400000;
} else {
} else{
this.healthMax = 1500000;
}
}
@@ -1879,51 +1879,41 @@ public class Mob extends AbstractIntelligenceAgent {
Logger.error(e.getMessage());
}
if (this.behaviourType.equals(MobBehaviourType.HamletGuard) && this.getMobBaseID() == 14104) {//guards
if(this.behaviourType.equals(MobBehaviourType.HamletGuard) && this.getMobBaseID() == 14104) {//guards
this.behaviourType = MobBehaviourType.Aggro;
}
for (MobEquipment equipped : this.equip.values()) {
if (equipped.getItemBase().isVorg() && this.getMobBaseID() != 14062 && this.getMobBaseID() != 14163) {
for(MobEquipment equipped: this.equip.values()){
if(equipped.getItemBase().isVorg() && this.getMobBaseID() != 14062 && this.getMobBaseID() != 14163){
this.dropper = true;
}
}
for (Item item : this.charItemManager.getInventory()) {
if (item.getItemBase().isDiscRune() && this.level < 75) {
for(Item item : this.charItemManager.getInventory()){
if(item.getItemBase().isDiscRune() && this.level < 75){
this.dropper = true;
}
}
switch (this.getObjectUUID()) {
case 40551://ithrianna
this.mobResists = Resists.getResists(14);
break;
case 11297: // mordoth
this.mobResists = Resists.getResists(16);
break;
case 19842://vranaxxas
this.mobResists = Resists.getResists(37);
break;
case 6407://draug tovald
this.mobResists = Resists.getResists(15);
break;
case 30959://shuggroth mael
this.mobResists = Resists.getResists(17);
break;
default:
if (this.dropper) {
this.level = 65;
this.atrHandOne *= 2;
this.atrHandTwo *= 2;
this.defenseRating *= 2;
this.maxDamageHandOne *= 2;
this.maxDamageHandTwo *= 2;
this.minDamageHandOne *= 2;
this.minDamageHandTwo *= 2;
this.mobResists = new Resists("Dropper");
}// else {
//setResistsForMob(this);
//}
if(this.dropper){
this.level = 65;
this.atrHandOne *= 2;
this.atrHandTwo *= 2;
this.defenseRating *= 2;
this.maxDamageHandOne *= 2;
this.maxDamageHandTwo *= 2;
this.minDamageHandOne *= 2;
this.minDamageHandTwo *= 2;
}
//for(Item loot : this.charItemManager.getInventory()){
// if(loot.getItemBase().isDiscRune() && this.level < 80){
// if(this.firstSpawn) {
// this.killCharacter("first spawn");
// this.firstSpawn = false;
// if(this.despawned == false)
// this.despawn();
// }
// }
//}
}
@Override