Browse Source

mobbase effects

lakebane
FatBoy-DOTC 10 hours ago
parent
commit
4fe4835c29
  1. 1
      src/engine/objects/Mob.java
  2. 21
      src/engine/objects/MobBase.java

1
src/engine/objects/Mob.java

@ -2117,6 +2117,7 @@ public class Mob extends AbstractIntelligenceAgent {
try { try {
NPCManager.applyRuneSetEffects(this); NPCManager.applyRuneSetEffects(this);
MobBase.applyMobbaseEffects(this);
recalculateStats(); recalculateStats();
this.setHealth(this.healthMax); this.setHealth(this.healthMax);

21
src/engine/objects/MobBase.java

@ -13,8 +13,11 @@ import ch.claude_martin.enumbitset.EnumBitSet;
import engine.Enum; import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.LootManager; import engine.gameManager.LootManager;
import engine.gameManager.PowersManager;
import engine.loot.BootySetEntry; import engine.loot.BootySetEntry;
import engine.powers.EffectsBase;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
import org.pmw.tinylog.Logger;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
@ -54,6 +57,8 @@ public class MobBase extends AbstractGameObject {
private float walkCombat = 0; private float walkCombat = 0;
private float runCombat = 0; private float runCombat = 0;
public ArrayList<MobBaseEffects> mobbaseEffects;
/** /**
* ResultSet Constructor * ResultSet Constructor
*/ */
@ -108,6 +113,7 @@ public class MobBase extends AbstractGameObject {
this.mobBaseStats = DbManager.MobBaseQueries.LOAD_STATS(this.loadID); this.mobBaseStats = DbManager.MobBaseQueries.LOAD_STATS(this.loadID);
DbManager.MobBaseQueries.LOAD_ALL_MOBBASE_SPEEDS(this); DbManager.MobBaseQueries.LOAD_ALL_MOBBASE_SPEEDS(this);
this.mobbaseEffects = DbManager.MobBaseQueries.GET_RUNEBASE_EFFECTS(this.getObjectUUID());
} }
@ -301,4 +307,19 @@ public class MobBase extends AbstractGameObject {
return runCombat; return runCombat;
} }
public static void applyMobbaseEffects(Mob mob){
for(MobBaseEffects mbe : mob.mobBase.mobbaseEffects){
if(mob.level == mbe.getReqLvl()){
try {
//PowersManager.applyPower(mob, mob, mob.loc, mbe.getToken(), mbe.getRank(), false);
EffectsBase effectsBase = PowersManager.getEffectByToken(mbe.getToken());
if(effectsBase != null)
mob.addEffectNoTimer(Integer.toString(effectsBase.getUUID()), effectsBase, mbe.getRank(), true);
}catch(Exception e){
Logger.error("NULL POWER FOR MOB: " + mob.getObjectUUID() + ", POWER TOKEN: " + mbe.getToken());
}
}
}
}
} }

Loading…
Cancel
Save