Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b944847b8a | |||
| cdf6465f60 |
@@ -24,3 +24,5 @@
|
|||||||
hs_err_pid*
|
hs_err_pid*
|
||||||
replay_pid*
|
replay_pid*
|
||||||
|
|
||||||
|
*.code-workspace
|
||||||
|
|
||||||
|
|||||||
@@ -1196,6 +1196,7 @@ public class Enum {
|
|||||||
Durability,
|
Durability,
|
||||||
ExclusiveDamageCap,
|
ExclusiveDamageCap,
|
||||||
Fade,
|
Fade,
|
||||||
|
Fear,
|
||||||
Fly,
|
Fly,
|
||||||
Health,
|
Health,
|
||||||
HealthFull,
|
HealthFull,
|
||||||
|
|||||||
@@ -280,6 +280,9 @@ public class dbEffectsBaseHandler extends dbHandlerBase {
|
|||||||
case Stunned:
|
case Stunned:
|
||||||
abstractEffectModifier = new StunnedEffectModifier(rs);
|
abstractEffectModifier = new StunnedEffectModifier(rs);
|
||||||
break;
|
break;
|
||||||
|
case Fear:
|
||||||
|
abstractEffectModifier = new FearEffectModifier(rs);
|
||||||
|
break;
|
||||||
case Value:
|
case Value:
|
||||||
abstractEffectModifier = new ValueEffectModifier(rs);
|
abstractEffectModifier = new ValueEffectModifier(rs);
|
||||||
if (effectBase != null) {
|
if (effectBase != null) {
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
package engine.devcmd.cmds;
|
|
||||||
|
|
||||||
import engine.devcmd.AbstractDevCmd;
|
|
||||||
import engine.gameManager.PowersManager;
|
|
||||||
import engine.gameManager.ZoneManager;
|
|
||||||
import engine.objects.*;
|
|
||||||
|
|
||||||
public class SetCampLevelCmd extends AbstractDevCmd {
|
|
||||||
public SetCampLevelCmd() { super("setcamplevel"); }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void _doCmd(PlayerCharacter pcSender, String[] args, AbstractGameObject target) {
|
|
||||||
|
|
||||||
if (args.length > 1)
|
|
||||||
{
|
|
||||||
this.sendUsage(pcSender);
|
|
||||||
}
|
|
||||||
|
|
||||||
int targetLevel = 0;
|
|
||||||
if (args.length == 1) {
|
|
||||||
try {
|
|
||||||
targetLevel = Integer.parseInt(args[0]);
|
|
||||||
} catch (NumberFormatException nfe) {
|
|
||||||
throwbackError(pcSender, "Argument MUST be integer. Received: " + args[0]);
|
|
||||||
} catch (Exception e) {
|
|
||||||
throwbackError(pcSender, "Unknown command parsing provided camp level: " + args[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((target instanceof Mob))
|
|
||||||
{
|
|
||||||
// Get the camp that owns the targeted Mob
|
|
||||||
Zone campZone = ((Mob) target).parentZone;
|
|
||||||
|
|
||||||
// Make sure that the zone we're targeting is valid for action
|
|
||||||
if (campZone == null ||
|
|
||||||
campZone.zoneMobSet.isEmpty() ||
|
|
||||||
campZone.isPlayerCity()) {
|
|
||||||
throwbackError(pcSender, "Current zone must own mobs, and NOT be a city.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
campZone.setCampLvl(targetLevel);
|
|
||||||
}
|
|
||||||
else if (target instanceof PlayerCharacter)
|
|
||||||
{
|
|
||||||
PlayerCharacter pc = (PlayerCharacter)target;
|
|
||||||
PowersManager.applyPower(pc, pc, pc.getLoc(), "CMP-001", targetLevel, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String _getUsageString() {
|
|
||||||
return "Sets the level of the currently occupied camp to the desired level";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String _getHelpString() {
|
|
||||||
return "'./setcamplevel levelNum'";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -433,6 +433,11 @@ public enum CombatManager {
|
|||||||
if (bonus != null && bonus.getBool(ModType.Stunned, SourceType.None))
|
if (bonus != null && bonus.getBool(ModType.Stunned, SourceType.None))
|
||||||
attackFailure = true;
|
attackFailure = true;
|
||||||
|
|
||||||
|
//see if attacker is feared. If so, stop here
|
||||||
|
|
||||||
|
if (bonus != null && bonus.getBool(ModType.Fear, SourceType.None))
|
||||||
|
attackFailure = true;
|
||||||
|
|
||||||
//Get Range of weapon
|
//Get Range of weapon
|
||||||
|
|
||||||
float range;
|
float range;
|
||||||
|
|||||||
@@ -143,7 +143,6 @@ public enum DevCmdManager {
|
|||||||
DevCmdManager.registerDevCmd(new ApplyBonusCmd());
|
DevCmdManager.registerDevCmd(new ApplyBonusCmd());
|
||||||
DevCmdManager.registerDevCmd(new AuditFailedItemsCmd());
|
DevCmdManager.registerDevCmd(new AuditFailedItemsCmd());
|
||||||
DevCmdManager.registerDevCmd(new SlotTestCmd());
|
DevCmdManager.registerDevCmd(new SlotTestCmd());
|
||||||
DevCmdManager.registerDevCmd(new SetCampLevelCmd());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import engine.net.DispatchMessage;
|
|||||||
import engine.net.client.msg.ErrorPopupMsg;
|
import engine.net.client.msg.ErrorPopupMsg;
|
||||||
import engine.net.client.msg.chat.ChatSystemMsg;
|
import engine.net.client.msg.chat.ChatSystemMsg;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.util.ZoneLevel;
|
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -101,16 +100,6 @@ public enum LootManager {
|
|||||||
boolean hotzoneWasRan = false;
|
boolean hotzoneWasRan = false;
|
||||||
float dropRate = 1.0f;
|
float dropRate = 1.0f;
|
||||||
|
|
||||||
if (mob.getSafeZone() == false)
|
|
||||||
dropRate = LootManager.NORMAL_DROP_RATE;
|
|
||||||
|
|
||||||
if (inHotzone == true)
|
|
||||||
dropRate = LootManager.HOTZONE_DROP_RATE;
|
|
||||||
|
|
||||||
// Adjust for camp scaling
|
|
||||||
Zone camp = mob.getParentZone();
|
|
||||||
dropRate = dropRate * ZoneLevel.getLootDropModifier(camp);
|
|
||||||
|
|
||||||
// Iterate all entries in this bootySet and process accordingly
|
// Iterate all entries in this bootySet and process accordingly
|
||||||
|
|
||||||
for (BootySetEntry bse : entries) {
|
for (BootySetEntry bse : entries) {
|
||||||
@@ -120,6 +109,12 @@ public enum LootManager {
|
|||||||
break;
|
break;
|
||||||
case "LOOT":
|
case "LOOT":
|
||||||
|
|
||||||
|
if (mob.getSafeZone() == false)
|
||||||
|
dropRate = LootManager.NORMAL_DROP_RATE;
|
||||||
|
|
||||||
|
if (inHotzone == true)
|
||||||
|
dropRate = LootManager.HOTZONE_DROP_RATE;
|
||||||
|
|
||||||
if (ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate))
|
if (ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate))
|
||||||
GenerateLootDrop(mob, bse.genTable, false); //generate normal loot drop
|
GenerateLootDrop(mob, bse.genTable, false); //generate normal loot drop
|
||||||
|
|
||||||
@@ -201,9 +196,6 @@ public enum LootManager {
|
|||||||
Logger.error("Failed to GenerateSuffix for item: " + outItem.getName());
|
Logger.error("Failed to GenerateSuffix for item: " + outItem.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We don't want to bother with identifying gear
|
|
||||||
outItem.setIsID(true);
|
|
||||||
return outItem;
|
return outItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -314,9 +306,6 @@ public enum LootManager {
|
|||||||
else
|
else
|
||||||
gold = (int) (gold * NORMAL_GOLD_RATE);
|
gold = (int) (gold * NORMAL_GOLD_RATE);
|
||||||
|
|
||||||
Zone camp = mob.getParentZone();
|
|
||||||
gold = (int) (gold * ZoneLevel.getGoldDropModifier(camp));
|
|
||||||
|
|
||||||
if (gold > 0) {
|
if (gold > 0) {
|
||||||
MobLoot goldAmount = new MobLoot(mob, gold);
|
MobLoot goldAmount = new MobLoot(mob, gold);
|
||||||
mob.getCharItemManager().addItemToInventory(goldAmount);
|
mob.getCharItemManager().addItemToInventory(goldAmount);
|
||||||
|
|||||||
@@ -79,6 +79,11 @@ public enum MovementManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Will this prevent movement at all or only player input for movement?
|
||||||
|
if (toMove.getBonuses().getBool(ModType.Fear, SourceType.None)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (msg.getEndLat() > MBServerStatics.MAX_WORLD_WIDTH)
|
if (msg.getEndLat() > MBServerStatics.MAX_WORLD_WIDTH)
|
||||||
msg.setEndLat((float) MBServerStatics.MAX_WORLD_WIDTH);
|
msg.setEndLat((float) MBServerStatics.MAX_WORLD_WIDTH);
|
||||||
|
|
||||||
@@ -408,6 +413,10 @@ public enum MovementManager {
|
|||||||
if (bonus.getBool(ModType.Stunned, SourceType.None) || bonus.getBool(ModType.CannotMove, SourceType.None))
|
if (bonus.getBool(ModType.Stunned, SourceType.None) || bonus.getBool(ModType.CannotMove, SourceType.None))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
//don't move if player is feared
|
||||||
|
if (bonus.getBool(ModType.Fear, SourceType.None))
|
||||||
|
continue;
|
||||||
|
|
||||||
member.update();
|
member.update();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -313,6 +313,9 @@ public enum PowersManager {
|
|||||||
if (bonus != null && (bonus.getBool(ModType.Stunned, SourceType.None) || bonus.getBool(ModType.CannotCast, SourceType.None) || bonus.getBool(ModType.BlockedPowerType, sourceType)))
|
if (bonus != null && (bonus.getBool(ModType.Stunned, SourceType.None) || bonus.getBool(ModType.CannotCast, SourceType.None) || bonus.getBool(ModType.BlockedPowerType, sourceType)))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if (bonus != null && bonus.getBool(ModType.Fear, SourceType.None))
|
||||||
|
return true;
|
||||||
|
|
||||||
// if moving make sure spell valid for movement
|
// if moving make sure spell valid for movement
|
||||||
Vector3fImmutable endLoc = playerCharacter.getEndLoc();
|
Vector3fImmutable endLoc = playerCharacter.getEndLoc();
|
||||||
|
|
||||||
@@ -596,6 +599,9 @@ public enum PowersManager {
|
|||||||
if (bonus != null && (bonus.getBool(ModType.Stunned, SourceType.None) || bonus.getBool(ModType.CannotCast, SourceType.None) || bonus.getBool(ModType.BlockedPowerType, sourceType)))
|
if (bonus != null && (bonus.getBool(ModType.Stunned, SourceType.None) || bonus.getBool(ModType.CannotCast, SourceType.None) || bonus.getBool(ModType.BlockedPowerType, sourceType)))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if (bonus != null && bonus.getBool(ModType.Fear, SourceType.None))
|
||||||
|
return true;
|
||||||
|
|
||||||
// if moving make sure spell valid for movement
|
// if moving make sure spell valid for movement
|
||||||
// if flying, make sure spell valid for flying.
|
// if flying, make sure spell valid for flying.
|
||||||
// if (pc.getAltitude() > 0)
|
// if (pc.getAltitude() > 0)
|
||||||
@@ -761,6 +767,11 @@ public enum PowersManager {
|
|||||||
finishRecycleTime(msg.getPowerUsedID(), playerCharacter, true);
|
finishRecycleTime(msg.getPowerUsedID(), playerCharacter, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bonus.getBool(ModType.Fear, SourceType.None)) {
|
||||||
|
finishRecycleTime(msg.getPowerUsedID(), playerCharacter, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// get target loc
|
// get target loc
|
||||||
@@ -1042,6 +1053,9 @@ public enum PowersManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bonus != null && bonus.getBool(ModType.Fear, SourceType.None))
|
||||||
|
return;
|
||||||
|
|
||||||
msg.setNumTrains(9999);
|
msg.setNumTrains(9999);
|
||||||
msg.setUnknown04(2);
|
msg.setUnknown04(2);
|
||||||
DispatchMessage.sendToAllInRange(caster, msg);
|
DispatchMessage.sendToAllInRange(caster, msg);
|
||||||
@@ -2565,6 +2579,10 @@ public enum PowersManager {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void cancelOnFear(AbstractCharacter ac) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private static PowersBase getLastPower(AbstractCharacter ac) {
|
private static PowersBase getLastPower(AbstractCharacter ac) {
|
||||||
if (ac == null)
|
if (ac == null)
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package engine.jobs;
|
||||||
|
|
||||||
|
import engine.job.AbstractJob;
|
||||||
|
import engine.objects.AbstractCharacter;
|
||||||
|
import engine.math.Vector3fImmutable;
|
||||||
|
import engine.server.MBServerStatics;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class FearWanderJob extends AbstractJob {
|
||||||
|
private final AbstractCharacter target;
|
||||||
|
private final Random rand = new Random();
|
||||||
|
|
||||||
|
public FearWanderJob(AbstractCharacter target) {
|
||||||
|
super();
|
||||||
|
this.target = target;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doJob() {
|
||||||
|
// Only wander if still feared
|
||||||
|
if (target == null || !target.getBonuses().getBool(engine.Enum.ModType.Fear, engine.Enum.SourceType.None))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Pick a random direction and distance
|
||||||
|
float angle = rand.nextFloat() * (float)Math.PI * 2f;
|
||||||
|
float distance = 5f + rand.nextFloat() * 10f; // 5-15 units
|
||||||
|
|
||||||
|
Vector3fImmutable current = target.getLoc();
|
||||||
|
float newX = current.x + (float)Math.cos(angle) * distance;
|
||||||
|
float newZ = current.z + (float)Math.sin(angle) * distance;
|
||||||
|
|
||||||
|
// Clamp to world bounds if needed
|
||||||
|
newX = (float) Math.max(0, Math.min(newX, MBServerStatics.MAX_WORLD_WIDTH));
|
||||||
|
newZ = (float) Math.max(0, Math.min(newZ, MBServerStatics.MAX_WORLD_HEIGHT));
|
||||||
|
|
||||||
|
Vector3fImmutable dest = new Vector3fImmutable(newX, current.y, newZ);
|
||||||
|
|
||||||
|
// Issue movement (implement setEndLoc or similar in your AbstractCharacter)
|
||||||
|
target.setEndLoc(dest);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,7 +11,6 @@ package engine.mobileAI.Threads;
|
|||||||
import engine.gameManager.ZoneManager;
|
import engine.gameManager.ZoneManager;
|
||||||
import engine.objects.Mob;
|
import engine.objects.Mob;
|
||||||
import engine.objects.Zone;
|
import engine.objects.Zone;
|
||||||
import engine.util.ZoneLevel;
|
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,6 +25,7 @@ import org.pmw.tinylog.Logger;
|
|||||||
|
|
||||||
public class MobRespawnThread implements Runnable {
|
public class MobRespawnThread implements Runnable {
|
||||||
|
|
||||||
|
|
||||||
public MobRespawnThread() {
|
public MobRespawnThread() {
|
||||||
Logger.info(" MobRespawnThread thread has started!");
|
Logger.info(" MobRespawnThread thread has started!");
|
||||||
|
|
||||||
@@ -34,85 +34,23 @@ public class MobRespawnThread implements Runnable {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
long startTime = System.currentTimeMillis();
|
|
||||||
long rollingKeepFraction = (Zone.rollingAvgMobsAliveDepth - 1) / Zone.rollingAvgMobsAliveDepth;
|
|
||||||
long rollingAddFraction = 1 / Zone.rollingAvgMobsAliveDepth;
|
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
for (Zone zone : ZoneManager.getAllZones()) {
|
for (Zone zone : ZoneManager.getAllZones()) {
|
||||||
|
|
||||||
/*
|
if (zone.respawnQue.isEmpty() == false && zone.lastRespawn + 100 < System.currentTimeMillis()) {
|
||||||
if (zone.respawnQue.size() > ZoneLevel.queueLengthToLevelUp) {
|
|
||||||
zone.setCampLvl(zone.getCamplvl() + 1);
|
|
||||||
}
|
|
||||||
else if (zone.respawnQue.isEmpty() &&
|
|
||||||
(zone.lastRespawn + ZoneLevel.msToLevelDown < System.currentTimeMillis()) &&
|
|
||||||
zone.getCamplvl() > 0) {
|
|
||||||
zone.setCampLvl(zone.getCamplvl() - 1);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
int aliveCount = 0;
|
Mob respawner = zone.respawnQue.iterator().next();
|
||||||
int deadCount = 0;
|
|
||||||
for (Mob mob : zone.zoneMobSet) {
|
|
||||||
if (mob.isAlive()) {
|
|
||||||
aliveCount = aliveCount + 1;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
deadCount = deadCount + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
zone.rollingAvgMobsAlive =
|
|
||||||
((zone.rollingAvgMobsAlive * (Zone.rollingAvgMobsAliveDepth - 1) + aliveCount) / Zone.rollingAvgMobsAliveDepth);
|
|
||||||
|
|
||||||
/*
|
|
||||||
if (startTime + ZoneLevel.msDelayToCampLevel < System.currentTimeMillis()) {
|
|
||||||
if (aliveCount > Math.floor(zone.zoneMobSet.size() / 2.0)) {
|
|
||||||
if (zone.levelUpTimer == 0) {
|
|
||||||
zone.levelUpTimer = System.currentTimeMillis();
|
|
||||||
} else if (zone.levelUpTimer + ZoneLevel.msTolevelUp < System.currentTimeMillis()) {
|
|
||||||
zone.setCampLvl(zone.getCampLvl() + 1);
|
|
||||||
|
|
||||||
zone.levelUpTimer = 0;
|
|
||||||
}
|
|
||||||
} else if (aliveCount == 0) {
|
|
||||||
|
|
||||||
if (zone.levelDownTimer == 0) {
|
|
||||||
zone.levelDownTimer = System.currentTimeMillis();
|
|
||||||
} else if (zone.levelDownTimer + ZoneLevel.msToLevelDown < System.currentTimeMillis()) {
|
|
||||||
if (zone.getCampLvl() > 0) {
|
|
||||||
zone.setCampLvl(zone.getCampLvl() + 1);
|
|
||||||
|
|
||||||
zone.levelDownTimer = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
zone.levelUpTimer = 0;
|
|
||||||
zone.levelDownTimer = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------------------------------------
|
|
||||||
// Manage mob respawn
|
|
||||||
// --------------------------------------------------------------------------------------------------------------------
|
|
||||||
if (!Zone.respawnQue.isEmpty() && Zone.lastRespawn + 100 < System.currentTimeMillis()) {
|
|
||||||
|
|
||||||
Mob respawner = Zone.respawnQue.iterator().next();
|
|
||||||
|
|
||||||
if (respawner == null)
|
if (respawner == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
respawner.respawn();
|
respawner.respawn();
|
||||||
Zone.respawnQue.remove(respawner);
|
zone.respawnQue.remove(respawner);
|
||||||
Zone.lastRespawn = System.currentTimeMillis();
|
zone.lastRespawn = System.currentTimeMillis();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.error(e);
|
Logger.error(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ public class CombatUtilities {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean canSwing(Mob agent) {
|
public static boolean canSwing(Mob agent) {
|
||||||
return (agent.isAlive() && !agent.getBonuses().getBool(ModType.Stunned, SourceType.None));
|
return (agent.isAlive() && !agent.getBonuses().getBool(ModType.Stunned, SourceType.None) && !agent.getBonuses().getBool(ModType.Fear, SourceType.None));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void swingIsMiss(Mob agent, AbstractWorldObject target, int animation) {
|
public static void swingIsMiss(Mob agent, AbstractWorldObject target, int animation) {
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ public class MovementUtilities {
|
|||||||
if (agent.getMobBase() != null && Enum.MobFlagType.SENTINEL.elementOf(agent.getMobBase().getFlags()))
|
if (agent.getMobBase() != null && Enum.MobFlagType.SENTINEL.elementOf(agent.getMobBase().getFlags()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return (agent.isAlive() && !agent.getBonuses().getBool(ModType.Stunned, SourceType.None) && !agent.getBonuses().getBool(ModType.CannotMove, SourceType.None));
|
return (agent.isAlive() && !agent.getBonuses().getBool(ModType.Stunned, SourceType.None) && !agent.getBonuses().getBool(ModType.Fear, SourceType.None) && !agent.getBonuses().getBool(ModType.CannotMove, SourceType.None));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Vector3fImmutable randomPatrolLocation(Mob agent, Vector3fImmutable center, float radius) {
|
public static Vector3fImmutable randomPatrolLocation(Mob agent, Vector3fImmutable center, float radius) {
|
||||||
|
|||||||
@@ -1653,6 +1653,30 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
PowersManager.cancelOnStun(this);
|
PowersManager.cancelOnStun(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final void cancelOnFear() {
|
||||||
|
boolean changed = false;
|
||||||
|
for (String s : this.effects.keySet()) {
|
||||||
|
Effect eff = this.effects.get(s);
|
||||||
|
if (eff == null)
|
||||||
|
continue;
|
||||||
|
if (eff.cancelOnFear() && eff.cancel()) {
|
||||||
|
eff.cancelJob();
|
||||||
|
this.effects.remove(s);
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
JobContainer wanderJob = this.getTimers().get("FearWander");
|
||||||
|
if (wanderJob != null) {
|
||||||
|
wanderJob.cancelJob();
|
||||||
|
this.getTimers().remove("FearWander");
|
||||||
|
}
|
||||||
|
if (changed) {
|
||||||
|
applyBonuses();
|
||||||
|
}
|
||||||
|
PowersManager.cancelOnFear(this);
|
||||||
|
}
|
||||||
|
|
||||||
//Call to apply any new effects to player
|
//Call to apply any new effects to player
|
||||||
public synchronized void applyBonuses() {
|
public synchronized void applyBonuses() {
|
||||||
PlayerCharacter player;
|
PlayerCharacter player;
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ public class Effect {
|
|||||||
private boolean cancelOnTerritoryClaim;
|
private boolean cancelOnTerritoryClaim;
|
||||||
private boolean cancelOnUnEquip;
|
private boolean cancelOnUnEquip;
|
||||||
private boolean cancelOnStun;
|
private boolean cancelOnStun;
|
||||||
|
private boolean cancelOnFear;
|
||||||
private boolean bakedInStat = false;
|
private boolean bakedInStat = false;
|
||||||
private boolean isStatic = false;
|
private boolean isStatic = false;
|
||||||
private int effectSourceType = 0;
|
private int effectSourceType = 0;
|
||||||
@@ -80,6 +81,7 @@ public class Effect {
|
|||||||
this.cancelOnTerritoryClaim = false;
|
this.cancelOnTerritoryClaim = false;
|
||||||
this.cancelOnUnEquip = false;
|
this.cancelOnUnEquip = false;
|
||||||
this.cancelOnStun = false;
|
this.cancelOnStun = false;
|
||||||
|
this.cancelOnFear = false;
|
||||||
this.eb = eb;
|
this.eb = eb;
|
||||||
this.trains = trains;
|
this.trains = trains;
|
||||||
}
|
}
|
||||||
@@ -99,6 +101,7 @@ public class Effect {
|
|||||||
this.cancelOnTerritoryClaim = false;
|
this.cancelOnTerritoryClaim = false;
|
||||||
this.cancelOnUnEquip = false;
|
this.cancelOnUnEquip = false;
|
||||||
this.cancelOnStun = false;
|
this.cancelOnStun = false;
|
||||||
|
this.cancelOnFear = false;
|
||||||
this.eb = eb;
|
this.eb = eb;
|
||||||
this.trains = trains;
|
this.trains = trains;
|
||||||
this.isStatic = isStatic;
|
this.isStatic = isStatic;
|
||||||
@@ -581,6 +584,12 @@ public class Effect {
|
|||||||
return this.cancelOnStun;
|
return this.cancelOnStun;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean cancelOnFear() {
|
||||||
|
if (this.eb == null)
|
||||||
|
return true;
|
||||||
|
return this.cancelOnFear;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean cancelOnTakeDamage() {
|
public boolean cancelOnTakeDamage() {
|
||||||
if (this.eb == null)
|
if (this.eb == null)
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -290,9 +290,7 @@ public class Mine extends AbstractGameObject {
|
|||||||
if (treeRank < 1)
|
if (treeRank < 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// We check the limit against only the player guild right now
|
if (guildUnderMineLimit(playerGuild.getNation(), treeRank) == false) {
|
||||||
// each guild (even within a nation) is limited by the nation tree
|
|
||||||
if (guildUnderMineLimit(playerGuild, treeRank) == false) {
|
|
||||||
ErrorPopupMsg.sendErrorMsg(playerCharacter, "Your nation cannot support another mine.");
|
ErrorPopupMsg.sendErrorMsg(playerCharacter, "Your nation cannot support another mine.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -306,11 +304,10 @@ public class Mine extends AbstractGameObject {
|
|||||||
|
|
||||||
mineCnt += Mine.getMinesForGuild(playerGuild.getObjectUUID()).size();
|
mineCnt += Mine.getMinesForGuild(playerGuild.getObjectUUID()).size();
|
||||||
|
|
||||||
// Only count mines for a specific guild
|
for (Guild guild : playerGuild.getSubGuildList())
|
||||||
//for (Guild guild : playerGuild.getSubGuildList())
|
mineCnt += Mine.getMinesForGuild(guild.getObjectUUID()).size();
|
||||||
// mineCnt += Mine.getMinesForGuild(guild.getObjectUUID()).size();
|
|
||||||
|
|
||||||
return mineCnt <= (tolRank * 2);
|
return mineCnt <= tolRank;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean changeProductionType(Resource resource) {
|
public boolean changeProductionType(Resource resource) {
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import engine.net.client.msg.PlaceAssetMsg;
|
|||||||
import engine.powers.EffectsBase;
|
import engine.powers.EffectsBase;
|
||||||
import engine.powers.MobPowerEntry;
|
import engine.powers.MobPowerEntry;
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
import engine.util.ZoneLevel;
|
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
@@ -102,8 +101,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
private DateTime upgradeDateTime = null;
|
private DateTime upgradeDateTime = null;
|
||||||
private boolean lootSync = false;
|
private boolean lootSync = false;
|
||||||
|
|
||||||
private String originalFirstName;
|
|
||||||
private String originalLastName;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* No Id Constructor
|
* No Id Constructor
|
||||||
@@ -132,9 +129,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
this.lastName = "the " + contract.getName();
|
this.lastName = "the " + contract.getName();
|
||||||
}
|
}
|
||||||
clearStatic();
|
clearStatic();
|
||||||
|
|
||||||
originalFirstName = this.firstName;
|
|
||||||
originalLastName = this.lastName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -156,9 +150,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
this.building = building;
|
this.building = building;
|
||||||
initializeMob(false, false, false);
|
initializeMob(false, false, false);
|
||||||
clearStatic();
|
clearStatic();
|
||||||
|
|
||||||
originalFirstName = this.firstName;
|
|
||||||
originalLastName = this.lastName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -175,9 +166,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
this.BehaviourType = Enum.MobBehaviourType.Pet1;
|
this.BehaviourType = Enum.MobBehaviourType.Pet1;
|
||||||
initializeMob(true, false, false);
|
initializeMob(true, false, false);
|
||||||
clearStatic();
|
clearStatic();
|
||||||
|
|
||||||
originalFirstName = this.firstName;
|
|
||||||
originalLastName = this.lastName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//SIEGE CONSTRUCTOR
|
//SIEGE CONSTRUCTOR
|
||||||
@@ -192,9 +180,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
this.equip = new HashMap<>();
|
this.equip = new HashMap<>();
|
||||||
initializeMob(false, true, isPlayerGuard);
|
initializeMob(false, true, isPlayerGuard);
|
||||||
clearStatic();
|
clearStatic();
|
||||||
|
|
||||||
originalFirstName = this.firstName;
|
|
||||||
originalLastName = this.lastName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -303,8 +288,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
Logger.error("Mobile:" + this.dbID + ": " + e);
|
Logger.error("Mobile:" + this.dbID + ": " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
originalFirstName = this.firstName;
|
|
||||||
originalLastName = this.lastName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void serializeMobForClientMsgOtherPlayer(Mob mob, ByteBufferWriter writer) throws SerializationException {
|
public static void serializeMobForClientMsgOtherPlayer(Mob mob, ByteBufferWriter writer) throws SerializationException {
|
||||||
@@ -1266,7 +1249,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
if (!this.isMoving())
|
if (!this.isMoving())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (this.isAlive() == false || this.getBonuses().getBool(ModType.Stunned, SourceType.None) || this.getBonuses().getBool(ModType.CannotMove, SourceType.None)) {
|
if (this.isAlive() == false || this.getBonuses().getBool(ModType.Stunned, SourceType.None) || this.getBonuses().getBool(ModType.Fear, SourceType.None) || this.getBonuses().getBool(ModType.CannotMove, SourceType.None)) {
|
||||||
//Target is stunned or rooted. Don't move
|
//Target is stunned or rooted. Don't move
|
||||||
|
|
||||||
this.stopMovement(this.getMovementLoc());
|
this.stopMovement(this.getMovementLoc());
|
||||||
@@ -1399,12 +1382,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
|
|
||||||
NPCManager.applyRuneSetEffects(this);
|
NPCManager.applyRuneSetEffects(this);
|
||||||
|
|
||||||
// Set Name based on parent zone level
|
|
||||||
Zone camp = this.getParentZone();
|
|
||||||
this.lastName = this.originalLastName + ZoneLevel.getNameSuffix(camp);
|
|
||||||
|
|
||||||
//PowersManager.applyPower(this, this, this.getLoc(), "CMP-001", camp.getCamplvl(), false);
|
|
||||||
|
|
||||||
this.recalculateStats();
|
this.recalculateStats();
|
||||||
this.setHealth(this.healthMax);
|
this.setHealth(this.healthMax);
|
||||||
|
|
||||||
@@ -1518,10 +1495,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.None));
|
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.None));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modify max health based on camp level - bad, we need to use effects for this
|
|
||||||
Zone camp = this.getParentZone();
|
|
||||||
h = h * ZoneLevel.getMaxHealthPctModifier(camp);
|
|
||||||
|
|
||||||
// Set max health, mana and stamina
|
// Set max health, mana and stamina
|
||||||
|
|
||||||
if (h > 0)
|
if (h > 0)
|
||||||
@@ -1622,11 +1595,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
Logger.error("Error: missing bonuses");
|
Logger.error("Error: missing bonuses");
|
||||||
|
|
||||||
defense = (defense < 1) ? 1 : defense;
|
defense = (defense < 1) ? 1 : defense;
|
||||||
|
|
||||||
// Modify defense for camp level - bad, we need to use effects for this
|
|
||||||
Zone camp = this.getParentZone();
|
|
||||||
defense = defense * ZoneLevel.getDefPctModifier(camp);
|
|
||||||
|
|
||||||
this.defenseRating = (short) (defense + 0.5f);
|
this.defenseRating = (short) (defense + 0.5f);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.info("Mobbase ID " + this.getMobBaseID() + " returned an error. Setting to Default Defense." + e.getMessage());
|
Logger.info("Mobbase ID " + this.getMobBaseID() + " returned an error. Setting to Default Defense." + e.getMessage());
|
||||||
@@ -1828,10 +1796,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
atr *= (1 + neg_Bonus);
|
atr *= (1 + neg_Bonus);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modify atr for camp level - bad, we need to use effects for this
|
|
||||||
Zone camp = this.getParentZone();
|
|
||||||
atr = atr * ZoneLevel.getAtrPctModifier(camp);
|
|
||||||
|
|
||||||
atr = (atr < 1) ? 1 : atr;
|
atr = (atr < 1) ? 1 : atr;
|
||||||
|
|
||||||
// set atr
|
// set atr
|
||||||
|
|||||||
@@ -4407,6 +4407,10 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
if (this.bonuses.getBool(ModType.Stunned, SourceType.None))
|
if (this.bonuses.getBool(ModType.Stunned, SourceType.None))
|
||||||
return 0f;
|
return 0f;
|
||||||
|
|
||||||
|
if (this.bonuses.getBool(
|
||||||
|
ModType.Fear, SourceType.None))
|
||||||
|
return 0f;
|
||||||
|
|
||||||
// Get base skill amount
|
// Get base skill amount
|
||||||
CharacterSkill sk = this.skills.get(type);
|
CharacterSkill sk = this.skills.get(type);
|
||||||
float amount;
|
float amount;
|
||||||
@@ -4437,6 +4441,10 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
if (this.bonuses.getBool(ModType.Stunned, SourceType.None))
|
if (this.bonuses.getBool(ModType.Stunned, SourceType.None))
|
||||||
return 0f;
|
return 0f;
|
||||||
|
|
||||||
|
if (this.bonuses.getBool(ModType.Fear, SourceType.None))
|
||||||
|
return 0f;
|
||||||
|
|
||||||
|
|
||||||
// Get base skill amount
|
// Get base skill amount
|
||||||
CharacterSkill sk = this.skills.get(sourceType.name());
|
CharacterSkill sk = this.skills.get(sourceType.name());
|
||||||
float amount;
|
float amount;
|
||||||
@@ -4897,6 +4905,12 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
this.region = AbstractWorldObject.GetRegionByWorldObject(this);
|
this.region = AbstractWorldObject.GetRegionByWorldObject(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (this.isAlive() == false || this.getBonuses().getBool(ModType.Fear, SourceType.None)) {
|
||||||
|
//Target is feared. Don't move
|
||||||
|
this.stopMovement(newLoc);
|
||||||
|
this.region = AbstractWorldObject.GetRegionByWorldObject(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (newLoc.equals(this.getEndLoc())) {
|
if (newLoc.equals(this.getEndLoc())) {
|
||||||
this.stopMovement(newLoc);
|
this.stopMovement(newLoc);
|
||||||
this.region = AbstractWorldObject.GetRegionByWorldObject(this);
|
this.region = AbstractWorldObject.GetRegionByWorldObject(this);
|
||||||
|
|||||||
@@ -18,10 +18,7 @@ import engine.math.Bounds;
|
|||||||
import engine.math.Vector2f;
|
import engine.math.Vector2f;
|
||||||
import engine.math.Vector3fImmutable;
|
import engine.math.Vector3fImmutable;
|
||||||
import engine.net.ByteBufferWriter;
|
import engine.net.ByteBufferWriter;
|
||||||
import engine.net.DispatchMessage;
|
|
||||||
import engine.net.client.msg.chat.ChatSystemMsg;
|
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
import engine.util.ZoneLevel;
|
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@@ -64,13 +61,6 @@ public class Zone extends AbstractGameObject {
|
|||||||
//public static ArrayList<Mob> respawnQue = new ArrayList<>();
|
//public static ArrayList<Mob> respawnQue = new ArrayList<>();
|
||||||
public static final Set<Mob> respawnQue = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
public static final Set<Mob> respawnQue = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
||||||
public static long lastRespawn = 0;
|
public static long lastRespawn = 0;
|
||||||
|
|
||||||
private int campLvl = 0;
|
|
||||||
public long levelUpTimer = 0;
|
|
||||||
public long levelDownTimer = 0;
|
|
||||||
public int rollingAvgMobsAlive = 0;
|
|
||||||
public static final int rollingAvgMobsAliveDepth = 100;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ResultSet Constructor
|
* ResultSet Constructor
|
||||||
*/
|
*/
|
||||||
@@ -110,33 +100,8 @@ public class Zone extends AbstractGameObject {
|
|||||||
|
|
||||||
if (hash == null)
|
if (hash == null)
|
||||||
setHash();
|
setHash();
|
||||||
}
|
|
||||||
|
|
||||||
public void setCampLvl(int level)
|
|
||||||
{
|
|
||||||
this.campLvl = level;
|
|
||||||
|
|
||||||
if (this.campLvl > ZoneLevel.campMaxLvl)
|
|
||||||
{
|
|
||||||
this.campLvl = ZoneLevel.campMaxLvl;
|
|
||||||
}
|
|
||||||
else if (this.campLvl < 0)
|
|
||||||
{
|
|
||||||
this.campLvl = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//if (this.campLvl > ZoneLevel.campLvlAnnounceThreshold)
|
|
||||||
{
|
|
||||||
ChatSystemMsg chatMsg = new ChatSystemMsg(null, this.getName() + " has reached camp level " + this.campLvl + "! Will anyone contest?!");
|
|
||||||
chatMsg.setMessageType(2);
|
|
||||||
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID());
|
|
||||||
DispatchMessage.dispatchMsgToAll(chatMsg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCampLvl()
|
|
||||||
{
|
|
||||||
return this.campLvl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void serializeForClientMsg(Zone zone, ByteBufferWriter writer) {
|
public static void serializeForClientMsg(Zone zone, ByteBufferWriter writer) {
|
||||||
|
|||||||
@@ -247,6 +247,8 @@ public class ActionsBase {
|
|||||||
//TODO make this more efficient then testing strings
|
//TODO make this more efficient then testing strings
|
||||||
if (this.stackType.equals("Stun") && bonus.getBool(ModType.ImmuneTo, SourceType.Stun))
|
if (this.stackType.equals("Stun") && bonus.getBool(ModType.ImmuneTo, SourceType.Stun))
|
||||||
return true; //Currently stun immune. Skip stun
|
return true; //Currently stun immune. Skip stun
|
||||||
|
else if (this.stackType.equals("Fear") && bonus.getBool(ModType.ImmuneTo, SourceType.Fear))
|
||||||
|
return true; //Currently fear immune. Skip fear
|
||||||
else if (this.stackType.equals("Snare") && bonus.getBool(ModType.ImmuneTo, SourceType.Snare))
|
else if (this.stackType.equals("Snare") && bonus.getBool(ModType.ImmuneTo, SourceType.Snare))
|
||||||
return true; //Currently snare immune. Skip snare
|
return true; //Currently snare immune. Skip snare
|
||||||
else if (this.stackType.equals("Blindness") && bonus.getBool(ModType.ImmuneTo, SourceType.Blind))
|
else if (this.stackType.equals("Blindness") && bonus.getBool(ModType.ImmuneTo, SourceType.Blind))
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2022
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
|
|
||||||
|
package engine.powers.effectmodifiers;
|
||||||
|
|
||||||
|
import engine.Enum.GameObjectType;
|
||||||
|
import engine.Enum.ModType;
|
||||||
|
import engine.Enum.SourceType;
|
||||||
|
import engine.jobs.FearWanderJob;
|
||||||
|
import engine.job.JobContainer;
|
||||||
|
import engine.job.JobScheduler;
|
||||||
|
import engine.jobs.AbstractEffectJob;
|
||||||
|
import engine.objects.*;
|
||||||
|
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class FearEffectModifier extends AbstractEffectModifier {
|
||||||
|
|
||||||
|
public FearEffectModifier(ResultSet rs) throws SQLException {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
// Optional: custom logic when fear is applied
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||||
|
PlayerBonuses bonus = ac.getBonuses();
|
||||||
|
|
||||||
|
bonus.setBool(this.modType, this.sourceType, true);
|
||||||
|
ac.cancelOnFear();
|
||||||
|
ac.setIsCasting(false);
|
||||||
|
ac.stopMovement(ac.getLoc());
|
||||||
|
|
||||||
|
// Schedule the wander job if not already scheduled
|
||||||
|
if (ac.getTimers().get("FearWander") == null) {
|
||||||
|
JobContainer wanderJob = JobScheduler.getInstance().scheduleJob(
|
||||||
|
new FearWanderJob(ac), 2000
|
||||||
|
);
|
||||||
|
|
||||||
|
ac.getTimers().put("FearWander", wanderJob);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void applyBonus(Item item, int trains) {}
|
||||||
|
@Override
|
||||||
|
public void applyBonus(Building building, int trains) {}
|
||||||
|
}
|
||||||
@@ -288,7 +288,6 @@ public class WorldServer {
|
|||||||
|
|
||||||
private boolean init() {
|
private boolean init() {
|
||||||
|
|
||||||
Logger.info("Server Code: [NovaTest] Branch");
|
|
||||||
Logger.info("MAGICBANE SERVER GREETING:");
|
Logger.info("MAGICBANE SERVER GREETING:");
|
||||||
Logger.info(ConfigManager.MB_WORLD_GREETING.getValue());
|
Logger.info(ConfigManager.MB_WORLD_GREETING.getValue());
|
||||||
|
|
||||||
|
|||||||
@@ -1,84 +0,0 @@
|
|||||||
package engine.util;
|
|
||||||
|
|
||||||
import engine.objects.Zone;
|
|
||||||
|
|
||||||
public class ZoneLevel {
|
|
||||||
|
|
||||||
private static final float healthPctPerLevel = (float)0.2;
|
|
||||||
private static final float atrPctPerLevel = (float)0.2;
|
|
||||||
private static final float defPctPerLevel = (float)0.2;
|
|
||||||
private static final float lootPctPerLevel = (float)0.1;
|
|
||||||
private static final float goldPctPerLevel = (float)0.2;
|
|
||||||
|
|
||||||
public static final int campLvlAnnounceThreshold = 5;
|
|
||||||
public static final int campMaxLvl = 10;
|
|
||||||
|
|
||||||
public static final int queueLengthToLevelUp = 5;
|
|
||||||
public static final int msToLevelDown = 60 * 1000;
|
|
||||||
public static final int msTolevelUp = 60 * 1000;
|
|
||||||
public static final long msDelayToCampLevel = 60 * 1000;
|
|
||||||
|
|
||||||
private static final String[] nameMap =
|
|
||||||
{
|
|
||||||
"",
|
|
||||||
" I",
|
|
||||||
" II",
|
|
||||||
" III",
|
|
||||||
" IV",
|
|
||||||
" V",
|
|
||||||
" VI",
|
|
||||||
" VII",
|
|
||||||
" VIII",
|
|
||||||
" IX",
|
|
||||||
" X"
|
|
||||||
};
|
|
||||||
|
|
||||||
public static String getNameSuffix(Zone zone)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
return nameMap[zone.getCampLvl()];
|
|
||||||
}
|
|
||||||
catch (Exception ignored)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static float getMaxHealthPctModifier(Zone zone)
|
|
||||||
{
|
|
||||||
return getGenericModifier(zone, healthPctPerLevel);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static float getAtrPctModifier(Zone zone)
|
|
||||||
{
|
|
||||||
return getGenericModifier(zone, atrPctPerLevel);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static float getDefPctModifier(Zone zone)
|
|
||||||
{
|
|
||||||
return getGenericModifier(zone, defPctPerLevel);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static float getLootDropModifier(Zone zone)
|
|
||||||
{
|
|
||||||
return getGenericModifier(zone, lootPctPerLevel);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static float getGoldDropModifier(Zone zone)
|
|
||||||
{
|
|
||||||
return getGenericModifier(zone, goldPctPerLevel);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static float getGenericModifier(Zone zone, float modifierPerLevel)
|
|
||||||
{
|
|
||||||
float modifier = (float)1.0;
|
|
||||||
|
|
||||||
if (zone != null)
|
|
||||||
{
|
|
||||||
modifier += zone.getCampLvl() * modifierPerLevel;
|
|
||||||
}
|
|
||||||
|
|
||||||
return modifier;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -128,12 +128,10 @@ public class HourlyJobThread implements Runnable {
|
|||||||
if (mine.isActive == false)
|
if (mine.isActive == false)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Logger.info(mine.getZoneName() + "'s Mine is now Closing");
|
|
||||||
|
|
||||||
Building mineBuilding = BuildingManager.getBuildingFromCache(mine.getBuildingID());
|
Building mineBuilding = BuildingManager.getBuildingFromCache(mine.getBuildingID());
|
||||||
|
|
||||||
if (mineBuilding == null) {
|
if (mineBuilding == null) {
|
||||||
Logger.info("Null mine building for Mine " + mine.getObjectUUID() + " Building " + mine.getBuildingID());
|
Logger.debug("Null mine building for Mine " + mine.getObjectUUID() + " Building " + mine.getBuildingID());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,8 +139,6 @@ public class HourlyJobThread implements Runnable {
|
|||||||
// We can early exit here.
|
// We can early exit here.
|
||||||
|
|
||||||
if (mineBuilding.getRank() > 0) {
|
if (mineBuilding.getRank() > 0) {
|
||||||
Logger.info("Mine still standing when closing window. Mine Object UUID: " + mine.getObjectUUID() + " Building Id: " + mine.getBuildingID());
|
|
||||||
|
|
||||||
mine.setActive(false);
|
mine.setActive(false);
|
||||||
mine.lastClaimer = null;
|
mine.lastClaimer = null;
|
||||||
return true;
|
return true;
|
||||||
@@ -153,8 +149,6 @@ public class HourlyJobThread implements Runnable {
|
|||||||
// and keep the window open.
|
// and keep the window open.
|
||||||
|
|
||||||
if (!Mine.validateClaimer(mine.lastClaimer)) {
|
if (!Mine.validateClaimer(mine.lastClaimer)) {
|
||||||
Logger.info("Mine has no valid claimer when closing window. Mine Object UUID: " + mine.getObjectUUID() + " Building Id: " + mine.getBuildingID());
|
|
||||||
|
|
||||||
mine.lastClaimer = null;
|
mine.lastClaimer = null;
|
||||||
mine.updateGuildOwner(null);
|
mine.updateGuildOwner(null);
|
||||||
mine.setActive(true);
|
mine.setActive(true);
|
||||||
@@ -163,8 +157,6 @@ public class HourlyJobThread implements Runnable {
|
|||||||
|
|
||||||
//Update ownership to map
|
//Update ownership to map
|
||||||
|
|
||||||
Logger.info("Mine ownership changing when closing window. Mine Object UUID: " + mine.getObjectUUID() + " Building Id: " + mine.getBuildingID() + " new owning guild: " + mine.getOwningGuild().getObjectUUID());
|
|
||||||
|
|
||||||
mine.guildName = mine.getOwningGuild().getName();
|
mine.guildName = mine.getOwningGuild().getName();
|
||||||
mine.guildTag = mine.getOwningGuild().getGuildTag();
|
mine.guildTag = mine.getOwningGuild().getGuildTag();
|
||||||
Guild nation = mine.getOwningGuild().getNation();
|
Guild nation = mine.getOwningGuild().getNation();
|
||||||
|
|||||||
Reference in New Issue
Block a user