Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c77e7a6190 | |||
| 4fde07969b | |||
| 2bc7662ccf | |||
| ec37634b6a | |||
| b2bd3b7a92 | |||
| 461e4e1c3d | |||
| 0d1d00e2d1 | |||
| ec6825d651 | |||
| cb561c3b6b | |||
| cf0f0cf022 | |||
| f85673e661 | |||
| 84347f8290 | |||
| fd2fe92714 | |||
| 955b94eb08 | |||
| a9aa6e9660 | |||
| afc080074f | |||
| 1039fb1d0b | |||
| a955778eed | |||
| 7717707518 | |||
| 28836a7a4f | |||
| 5511dc7899 | |||
| e5b2247204 | |||
| 0404ca1a94 | |||
| 9ad5f239b0 | |||
| 3db8ee7afd |
@@ -58,6 +58,9 @@ public abstract class dbHandlerBase {
|
|||||||
|
|
||||||
int id = rs.getInt(1);
|
int id = rs.getInt(1);
|
||||||
|
|
||||||
|
if (id == 39052)
|
||||||
|
Logger.info(id);
|
||||||
|
|
||||||
if (DbManager.inCache(localObjectType, id)) {
|
if (DbManager.inCache(localObjectType, id)) {
|
||||||
objectList.add((T) DbManager.getFromCache(localObjectType, id));
|
objectList.add((T) DbManager.getFromCache(localObjectType, id));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class dbPowerHandler extends dbHandlerBase {
|
|||||||
int token = DbManager.hasher.SBStringHash(IDString);
|
int token = DbManager.hasher.SBStringHash(IDString);
|
||||||
|
|
||||||
source = rs.getString("source").replace("-", "").trim();
|
source = rs.getString("source").replace("-", "").trim();
|
||||||
mbEnums.EffectSourceType effectSourceType = mbEnums.EffectSourceType.getEffectSourceType(source);
|
mbEnums.EffectSourceType effectSourceType = mbEnums.EffectSourceType.GetEffectSourceType(source);
|
||||||
|
|
||||||
if (EffectsBase.effectSourceTypeMap.containsKey(token) == false)
|
if (EffectsBase.effectSourceTypeMap.containsKey(token) == false)
|
||||||
EffectsBase.effectSourceTypeMap.put(token, new HashSet<>());
|
EffectsBase.effectSourceTypeMap.put(token, new HashSet<>());
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ import engine.InterestManagement.WorldGrid;
|
|||||||
import engine.db.archive.BaneRecord;
|
import engine.db.archive.BaneRecord;
|
||||||
import engine.db.archive.PvpRecord;
|
import engine.db.archive.PvpRecord;
|
||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.mbEnums.EffectSourceType;
|
|
||||||
import engine.mbEnums.GameObjectType;
|
import engine.mbEnums.GameObjectType;
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
|
import engine.mbEnums.SourceType;
|
||||||
import engine.net.Dispatch;
|
import engine.net.Dispatch;
|
||||||
import engine.net.MessageDispatcher;
|
import engine.net.MessageDispatcher;
|
||||||
import engine.net.client.ClientConnection;
|
import engine.net.client.ClientConnection;
|
||||||
@@ -94,7 +94,7 @@ public enum ChatManager {
|
|||||||
|
|
||||||
PlayerBonuses bonus = pc.getBonuses();
|
PlayerBonuses bonus = pc.getBonuses();
|
||||||
|
|
||||||
if (bonus != null && bonus.getBool(ModType.Silenced, EffectSourceType.None)) {
|
if (bonus != null && bonus.getBool(ModType.Silenced, SourceType.None)) {
|
||||||
ChatManager.chatSayError(pc, SILENCED);
|
ChatManager.chatSayError(pc, SILENCED);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public enum CombatManager {
|
|||||||
case PlayerCharacter:
|
case PlayerCharacter:
|
||||||
case Mob:
|
case Mob:
|
||||||
PlayerBonuses bonuses = ((AbstractCharacter) target).getBonuses();
|
PlayerBonuses bonuses = ((AbstractCharacter) target).getBonuses();
|
||||||
if (bonuses != null && bonuses.getBool(mbEnums.ModType.ImmuneToAttack, mbEnums.EffectSourceType.None))
|
if (bonuses != null && bonuses.getBool(mbEnums.ModType.ImmuneToAttack, mbEnums.SourceType.None))
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case NPC:
|
case NPC:
|
||||||
@@ -143,7 +143,7 @@ public enum CombatManager {
|
|||||||
|
|
||||||
if (weapon != null) {
|
if (weapon != null) {
|
||||||
if (bonus != null)
|
if (bonus != null)
|
||||||
rangeMod += bonus.getFloatPercentAll(mbEnums.ModType.WeaponRange, mbEnums.EffectSourceType.None);
|
rangeMod += bonus.getFloatPercentAll(mbEnums.ModType.WeaponRange, mbEnums.SourceType.None);
|
||||||
|
|
||||||
attackRange += weapon.template.item_weapon_max_range * rangeMod;
|
attackRange += weapon.template.item_weapon_max_range * rangeMod;
|
||||||
}
|
}
|
||||||
@@ -204,11 +204,11 @@ public enum CombatManager {
|
|||||||
|
|
||||||
float wepSpeed = (int) (weapon.template.item_weapon_wepspeed);
|
float wepSpeed = (int) (weapon.template.item_weapon_wepspeed);
|
||||||
|
|
||||||
if (weapon.getBonusPercent(mbEnums.ModType.WeaponSpeed, mbEnums.EffectSourceType.None) != 0f) //add weapon speed bonus
|
if (weapon.getBonusPercent(mbEnums.ModType.WeaponSpeed, mbEnums.SourceType.None) != 0f) //add weapon speed bonus
|
||||||
wepSpeed *= (1 + weapon.getBonus(mbEnums.ModType.WeaponSpeed, mbEnums.EffectSourceType.None));
|
wepSpeed *= (1 + weapon.getBonus(mbEnums.ModType.WeaponSpeed, mbEnums.SourceType.None));
|
||||||
|
|
||||||
if (attacker.getBonuses() != null && attacker.getBonuses().getFloatPercentAll(mbEnums.ModType.AttackDelay, mbEnums.EffectSourceType.None) != 0f) //add effects speed bonus
|
if (attacker.getBonuses() != null && attacker.getBonuses().getFloatPercentAll(mbEnums.ModType.AttackDelay, mbEnums.SourceType.None) != 0f) //add effects speed bonus
|
||||||
wepSpeed *= (1 + attacker.getBonuses().getFloatPercentAll(mbEnums.ModType.AttackDelay, mbEnums.EffectSourceType.None));
|
wepSpeed *= (1 + attacker.getBonuses().getFloatPercentAll(mbEnums.ModType.AttackDelay, mbEnums.SourceType.None));
|
||||||
|
|
||||||
if (wepSpeed < 10)
|
if (wepSpeed < 10)
|
||||||
wepSpeed = 10; //Old was 10, but it can be reached lower with legit buffs,effects.
|
wepSpeed = 10; //Old was 10, but it can be reached lower with legit buffs,effects.
|
||||||
@@ -462,11 +462,12 @@ public enum CombatManager {
|
|||||||
|
|
||||||
if (damage > 0) {
|
if (damage > 0) {
|
||||||
|
|
||||||
if (AbstractCharacter.IsAbstractCharacter(target))
|
if (AbstractCharacter.IsAbstractCharacter(target)) {
|
||||||
((AbstractCharacter) target).modifyHealth(-damage, attacker, true);
|
((AbstractCharacter) target).modifyHealth(-damage, attacker, true);
|
||||||
else
|
((AbstractCharacter) target).cancelOnTakeDamage();
|
||||||
|
}else {
|
||||||
((Building) target).modifyHealth(-damage, attacker);
|
((Building) target).modifyHealth(-damage, attacker);
|
||||||
|
}
|
||||||
int attackAnim = getSwingAnimation(null, null, slot);
|
int attackAnim = getSwingAnimation(null, null, slot);
|
||||||
if (attacker.charItemManager.getEquipped().get(slot) != null) {
|
if (attacker.charItemManager.getEquipped().get(slot) != null) {
|
||||||
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
||||||
@@ -641,7 +642,7 @@ public enum CombatManager {
|
|||||||
float damage;
|
float damage;
|
||||||
float min = 40;
|
float min = 40;
|
||||||
float max = 60;
|
float max = 60;
|
||||||
float dmgMultiplier = 1 + agent.getBonuses().getFloatPercentAll(mbEnums.ModType.MeleeDamageModifier, mbEnums.EffectSourceType.None);
|
float dmgMultiplier = 1 + agent.getBonuses().getFloatPercentAll(mbEnums.ModType.MeleeDamageModifier, mbEnums.SourceType.None);
|
||||||
double minDmg = getMinDmg(min, agent);
|
double minDmg = getMinDmg(min, agent);
|
||||||
double maxDmg = getMaxDmg(max, agent);
|
double maxDmg = getMaxDmg(max, agent);
|
||||||
dmgMultiplier += agent.getLevel() * 0.1f;
|
dmgMultiplier += agent.getLevel() * 0.1f;
|
||||||
|
|||||||
@@ -164,6 +164,15 @@ public enum ConfigManager {
|
|||||||
Logger.info("Compiling regex");
|
Logger.info("Compiling regex");
|
||||||
|
|
||||||
regex.put(MB_LOGIN_FNAME_REGEX, Pattern.compile(MB_LOGIN_FNAME_REGEX.getValue()));
|
regex.put(MB_LOGIN_FNAME_REGEX, Pattern.compile(MB_LOGIN_FNAME_REGEX.getValue()));
|
||||||
|
|
||||||
|
Logger.info("Loading WPAK data");
|
||||||
|
|
||||||
|
// *** Needs powermanager collection
|
||||||
|
// defined before activation.
|
||||||
|
// EffectsParser.parseWpakFile();
|
||||||
|
// PowersParser.parseWpakFile();
|
||||||
|
// PowerActionParser.parseWpakFile();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,8 +49,15 @@ public enum ForgeManager implements Runnable {
|
|||||||
public static final ConcurrentHashMap<NPC, ConcurrentHashMap.KeySetView<WorkOrder, Boolean>> vendorWorkOrderLookup = new ConcurrentHashMap<>();
|
public static final ConcurrentHashMap<NPC, ConcurrentHashMap.KeySetView<WorkOrder, Boolean>> vendorWorkOrderLookup = new ConcurrentHashMap<>();
|
||||||
public static final ConcurrentHashMap<Item, WorkOrder> itemWorkOrderLookup = new ConcurrentHashMap<>();
|
public static final ConcurrentHashMap<Item, WorkOrder> itemWorkOrderLookup = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
@Override
|
public static void start() {
|
||||||
|
|
||||||
|
Thread forgeManager;
|
||||||
|
forgeManager = new Thread(FORGE_MANAGER);
|
||||||
|
forgeManager.setName("Forge Manager");
|
||||||
|
forgeManager.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
WorkOrder workOrder;
|
WorkOrder workOrder;
|
||||||
@@ -112,14 +119,6 @@ public enum ForgeManager implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void start() {
|
|
||||||
|
|
||||||
Thread forgeManager;
|
|
||||||
forgeManager = new Thread(FORGE_MANAGER);
|
|
||||||
forgeManager.setName("Forge Manager");
|
|
||||||
forgeManager.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int submit(WorkOrder workOrder) {
|
public static int submit(WorkOrder workOrder) {
|
||||||
|
|
||||||
// Must have a city to roll anything
|
// Must have a city to roll anything
|
||||||
@@ -265,12 +264,12 @@ public enum ForgeManager implements Runnable {
|
|||||||
|
|
||||||
// Assign a prefix and suffix to this item if random rolled
|
// Assign a prefix and suffix to this item if random rolled
|
||||||
|
|
||||||
if (workOrder.prefixToken == 0)
|
if (workOrder.prefixToken == 0 && workOrder.vendor.getItemModTable().contains((template.modTable)))
|
||||||
forgedItem.prefixToken = calcRandomMod(workOrder.vendor, mbEnums.ItemModType.PREFIX, template.modTable);
|
forgedItem.prefixToken = calcRandomMod(workOrder.vendor, mbEnums.ItemModType.PREFIX, template.modTable);
|
||||||
else
|
else
|
||||||
forgedItem.prefixToken = workOrder.prefixToken;
|
forgedItem.prefixToken = workOrder.prefixToken;
|
||||||
|
|
||||||
if (workOrder.suffixToken == 0)
|
if (workOrder.suffixToken == 0 && workOrder.vendor.getItemModTable().contains((template.modTable)))
|
||||||
forgedItem.suffixToken = calcRandomMod(workOrder.vendor, mbEnums.ItemModType.SUFFIX, template.modTable);
|
forgedItem.suffixToken = calcRandomMod(workOrder.vendor, mbEnums.ItemModType.SUFFIX, template.modTable);
|
||||||
else
|
else
|
||||||
forgedItem.suffixToken = workOrder.suffixToken;
|
forgedItem.suffixToken = workOrder.suffixToken;
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ import engine.math.Vector3f;
|
|||||||
import engine.math.Vector3fImmutable;
|
import engine.math.Vector3fImmutable;
|
||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.mbEnums.DispatchChannel;
|
import engine.mbEnums.DispatchChannel;
|
||||||
import engine.mbEnums.EffectSourceType;
|
|
||||||
import engine.mbEnums.GameObjectType;
|
import engine.mbEnums.GameObjectType;
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
|
import engine.mbEnums.SourceType;
|
||||||
import engine.net.client.ClientConnection;
|
import engine.net.client.ClientConnection;
|
||||||
import engine.net.client.msg.MoveToPointMsg;
|
import engine.net.client.msg.MoveToPointMsg;
|
||||||
import engine.net.client.msg.TeleportToPointMsg;
|
import engine.net.client.msg.TeleportToPointMsg;
|
||||||
@@ -74,7 +74,7 @@ public enum MovementManager {
|
|||||||
toMove.setIsCasting(false);
|
toMove.setIsCasting(false);
|
||||||
toMove.setItemCasting(false);
|
toMove.setItemCasting(false);
|
||||||
|
|
||||||
if (toMove.getBonuses().getBool(ModType.Stunned, EffectSourceType.None) || toMove.getBonuses().getBool(ModType.CannotMove, EffectSourceType.None)) {
|
if (toMove.getBonuses().getBool(ModType.Stunned, SourceType.None) || toMove.getBonuses().getBool(ModType.CannotMove, SourceType.None)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -390,7 +390,7 @@ public enum MovementManager {
|
|||||||
|
|
||||||
//don't move if player is stunned or rooted
|
//don't move if player is stunned or rooted
|
||||||
PlayerBonuses bonus = member.getBonuses();
|
PlayerBonuses bonus = member.getBonuses();
|
||||||
if (bonus.getBool(ModType.Stunned, EffectSourceType.None) || bonus.getBool(ModType.CannotMove, EffectSourceType.None))
|
if (bonus.getBool(ModType.Stunned, SourceType.None) || bonus.getBool(ModType.CannotMove, SourceType.None))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
member.update();
|
member.update();
|
||||||
|
|||||||
@@ -348,8 +348,8 @@ public enum PowersManager {
|
|||||||
|
|
||||||
// verify player is not stunned or prohibited from casting
|
// verify player is not stunned or prohibited from casting
|
||||||
PlayerBonuses bonus = playerCharacter.getBonuses();
|
PlayerBonuses bonus = playerCharacter.getBonuses();
|
||||||
EffectSourceType sourceType = EffectSourceType.getEffectSourceType(pb.getCategory());
|
SourceType sourceType = SourceType.GetSourceType(pb.getCategory());
|
||||||
if (bonus != null && (bonus.getBool(ModType.Stunned, EffectSourceType.None) || bonus.getBool(ModType.CannotCast, EffectSourceType.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 moving make sure spell valid for movement
|
// if moving make sure spell valid for movement
|
||||||
@@ -485,7 +485,7 @@ public enum PowersManager {
|
|||||||
cost = 0;
|
cost = 0;
|
||||||
|
|
||||||
if (bonus != null)
|
if (bonus != null)
|
||||||
cost *= (1 + bonus.getFloatPercentAll(ModType.PowerCost, EffectSourceType.None));
|
cost *= (1 + bonus.getFloatPercentAll(ModType.PowerCost, SourceType.None));
|
||||||
|
|
||||||
if (playerCharacter.getAltitude() > 0)
|
if (playerCharacter.getAltitude() > 0)
|
||||||
cost *= 1.5f;
|
cost *= 1.5f;
|
||||||
@@ -631,8 +631,8 @@ public enum PowersManager {
|
|||||||
// verify player is in correct mode (combat/nonCombat)
|
// verify player is in correct mode (combat/nonCombat)
|
||||||
// verify player is not stunned or prohibited from casting
|
// verify player is not stunned or prohibited from casting
|
||||||
PlayerBonuses bonus = caster.getBonuses();
|
PlayerBonuses bonus = caster.getBonuses();
|
||||||
EffectSourceType sourceType = EffectSourceType.getEffectSourceType(pb.getCategory());
|
SourceType sourceType = SourceType.GetSourceType(pb.getCategory());
|
||||||
if (bonus != null && (bonus.getBool(ModType.Stunned, EffectSourceType.None) || bonus.getBool(ModType.CannotCast, EffectSourceType.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 moving make sure spell valid for movement
|
// if moving make sure spell valid for movement
|
||||||
@@ -792,10 +792,10 @@ public enum PowersManager {
|
|||||||
PlayerBonuses bonus = playerCharacter.getBonuses();
|
PlayerBonuses bonus = playerCharacter.getBonuses();
|
||||||
|
|
||||||
if (bonus != null) {
|
if (bonus != null) {
|
||||||
if (bonus.getBool(ModType.Stunned, EffectSourceType.None))
|
if (bonus.getBool(ModType.Stunned, SourceType.None))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
EffectSourceType sourceType = EffectSourceType.getEffectSourceType(pb.getCategory());
|
SourceType sourceType = SourceType.GetSourceType(pb.getCategory());
|
||||||
if (bonus.getBool(ModType.BlockedPowerType, sourceType)) {
|
if (bonus.getBool(ModType.BlockedPowerType, sourceType)) {
|
||||||
finishRecycleTime(msg.getPowerUsedID(), playerCharacter, true);
|
finishRecycleTime(msg.getPowerUsedID(), playerCharacter, true);
|
||||||
return;
|
return;
|
||||||
@@ -1065,9 +1065,9 @@ public enum PowersManager {
|
|||||||
// verify player is not stunned or power type is blocked
|
// verify player is not stunned or power type is blocked
|
||||||
PlayerBonuses bonus = caster.getBonuses();
|
PlayerBonuses bonus = caster.getBonuses();
|
||||||
if (bonus != null) {
|
if (bonus != null) {
|
||||||
if (bonus.getBool(ModType.Stunned, EffectSourceType.None))
|
if (bonus.getBool(ModType.Stunned, SourceType.None))
|
||||||
return;
|
return;
|
||||||
EffectSourceType sourceType = EffectSourceType.getEffectSourceType(pb.getCategory());
|
SourceType sourceType = SourceType.GetSourceType(pb.getCategory());
|
||||||
if (bonus.getBool(ModType.BlockedPowerType, sourceType))
|
if (bonus.getBool(ModType.BlockedPowerType, sourceType))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1700,7 +1700,7 @@ public enum PowersManager {
|
|||||||
PlayerCharacter pcc = (PlayerCharacter) awo;
|
PlayerCharacter pcc = (PlayerCharacter) awo;
|
||||||
PlayerBonuses bonuses = pcc.getBonuses();
|
PlayerBonuses bonuses = pcc.getBonuses();
|
||||||
|
|
||||||
if (bonuses != null && bonuses.getBool(ModType.ImmuneToPowers, EffectSourceType.None)) {
|
if (bonuses != null && bonuses.getBool(ModType.ImmuneToPowers, SourceType.None)) {
|
||||||
awolist.remove();
|
awolist.remove();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1850,7 +1850,7 @@ public enum PowersManager {
|
|||||||
// Remove players who are in safe mode
|
// Remove players who are in safe mode
|
||||||
PlayerCharacter pcc = (PlayerCharacter) awo;
|
PlayerCharacter pcc = (PlayerCharacter) awo;
|
||||||
PlayerBonuses bonuses = pcc.getBonuses();
|
PlayerBonuses bonuses = pcc.getBonuses();
|
||||||
if (bonuses != null && bonuses.getBool(ModType.ImmuneToPowers, EffectSourceType.None)) {
|
if (bonuses != null && bonuses.getBool(ModType.ImmuneToPowers, SourceType.None)) {
|
||||||
awolist.remove();
|
awolist.remove();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ package engine.jobs;
|
|||||||
|
|
||||||
import engine.gameManager.PowersManager;
|
import engine.gameManager.PowersManager;
|
||||||
import engine.gameManager.SessionManager;
|
import engine.gameManager.SessionManager;
|
||||||
import engine.mbEnums.EffectSourceType;
|
|
||||||
import engine.mbEnums.GameObjectType;
|
import engine.mbEnums.GameObjectType;
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
|
import engine.mbEnums.SourceType;
|
||||||
import engine.objects.AbstractCharacter;
|
import engine.objects.AbstractCharacter;
|
||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.PlayerBonuses;
|
import engine.objects.PlayerBonuses;
|
||||||
@@ -52,7 +52,7 @@ public class ChantJob extends AbstractEffectJob {
|
|||||||
PowersManager.finishEffectTime(this.source, this.target, this.action, this.trains);
|
PowersManager.finishEffectTime(this.source, this.target, this.action, this.trains);
|
||||||
if (AbstractWorldObject.IsAbstractCharacter(source))
|
if (AbstractWorldObject.IsAbstractCharacter(source))
|
||||||
((AbstractCharacter) source).cancelLastChant();
|
((AbstractCharacter) source).cancelLastChant();
|
||||||
} else if (bonuses != null && bonuses.getBool(ModType.Silenced, EffectSourceType.None)) {
|
} else if (bonuses != null && bonuses.getBool(ModType.Silenced, SourceType.None)) {
|
||||||
PowersManager.finishEffectTime(this.source, this.target, this.action, this.trains);
|
PowersManager.finishEffectTime(this.source, this.target, this.action, this.trains);
|
||||||
if (AbstractWorldObject.IsAbstractCharacter(source))
|
if (AbstractWorldObject.IsAbstractCharacter(source))
|
||||||
((AbstractCharacter) source).cancelLastChant();
|
((AbstractCharacter) source).cancelLastChant();
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ package engine.jobs;
|
|||||||
import engine.gameManager.PowersManager;
|
import engine.gameManager.PowersManager;
|
||||||
import engine.job.AbstractScheduleJob;
|
import engine.job.AbstractScheduleJob;
|
||||||
import engine.job.JobContainer;
|
import engine.job.JobContainer;
|
||||||
import engine.mbEnums.EffectSourceType;
|
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
|
import engine.mbEnums.SourceType;
|
||||||
import engine.net.client.msg.ErrorPopupMsg;
|
import engine.net.client.msg.ErrorPopupMsg;
|
||||||
import engine.objects.PlayerCharacter;
|
import engine.objects.PlayerCharacter;
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ public class FinishSummonsJob extends AbstractScheduleJob {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.target.getBonuses() != null && this.target.getBonuses().getBool(ModType.BlockedPowerType, EffectSourceType.Summon)) {
|
if (this.target.getBonuses() != null && this.target.getBonuses().getBool(ModType.BlockedPowerType, SourceType.SUMMON)) {
|
||||||
ErrorPopupMsg.sendErrorMsg(this.target, "You have been blocked from receiving summons!");
|
ErrorPopupMsg.sendErrorMsg(this.target, "You have been blocked from receiving summons!");
|
||||||
ErrorPopupMsg.sendErrorMsg(this.source, "Target is blocked from receiving summons!");
|
ErrorPopupMsg.sendErrorMsg(this.source, "Target is blocked from receiving summons!");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -135,7 +135,8 @@ public class WorkOrder implements Delayed {
|
|||||||
if (!workOrder.vendor.charItemManager.hasRoomInventory(template.item_wt))
|
if (!workOrder.vendor.charItemManager.hasRoomInventory(template.item_wt))
|
||||||
return 30; //30: That person cannot carry that item
|
return 30; //30: That person cannot carry that item
|
||||||
|
|
||||||
if (!workOrder.vendor.getItemModTable().contains((template.modTable)))
|
if ((workOrder.prefixToken != 0 || workOrder.suffixToken != 0) &&
|
||||||
|
!workOrder.vendor.getItemModTable().contains((template.modTable)))
|
||||||
return 59; //59: This hireling does not have this formula
|
return 59; //59: This hireling does not have this formula
|
||||||
|
|
||||||
if (!Warehouse.calcCostOverrun(workOrder).isEmpty())
|
if (!Warehouse.calcCostOverrun(workOrder).isEmpty())
|
||||||
|
|||||||
+267
-4
@@ -841,16 +841,28 @@ public class mbEnums {
|
|||||||
DRAIN;
|
DRAIN;
|
||||||
|
|
||||||
public static DamageType getDamageType(String modName) {
|
public static DamageType getDamageType(String modName) {
|
||||||
|
|
||||||
|
if (modName.isEmpty())
|
||||||
|
return DamageType.NONE;
|
||||||
|
|
||||||
if(modName.toLowerCase().equals("blind"))
|
if(modName.toLowerCase().equals("blind"))
|
||||||
modName = "BLINDNESS";
|
modName = "BLINDNESS";
|
||||||
|
|
||||||
if(modName.toLowerCase().equals("powerblock"))
|
if(modName.toLowerCase().equals("powerblock"))
|
||||||
modName = "POWERINHIBITOR";
|
modName = "POWERINHIBITOR";
|
||||||
|
|
||||||
DamageType damageType;
|
//validity check for not looking up damage type that doesn't exist
|
||||||
if (modName.isEmpty())
|
boolean valid = false;
|
||||||
|
for(DamageType type : DamageType.values()){
|
||||||
|
if(type.name().equals(modName))
|
||||||
|
valid = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!valid)
|
||||||
return DamageType.NONE;
|
return DamageType.NONE;
|
||||||
|
|
||||||
|
DamageType damageType;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
damageType = DamageType.valueOf(modName.replace(",", "").toUpperCase());
|
damageType = DamageType.valueOf(modName.replace(",", "").toUpperCase());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -861,6 +873,176 @@ public class mbEnums {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public enum SourceType {
|
||||||
|
None,
|
||||||
|
Abjuration,
|
||||||
|
Acid,
|
||||||
|
AntiSiege,
|
||||||
|
Archery,
|
||||||
|
Axe,
|
||||||
|
Bardsong,
|
||||||
|
Beastcraft,
|
||||||
|
Benediction,
|
||||||
|
BladeWeaving,
|
||||||
|
Bleeding,
|
||||||
|
Blind,
|
||||||
|
Block,
|
||||||
|
Bloodcraft,
|
||||||
|
Bow,
|
||||||
|
Buff,
|
||||||
|
Channeling,
|
||||||
|
Charm,
|
||||||
|
Cold,
|
||||||
|
COLD,
|
||||||
|
Constitution,
|
||||||
|
Corruption,
|
||||||
|
Crossbow,
|
||||||
|
Crushing,
|
||||||
|
Dagger,
|
||||||
|
DaggerMastery,
|
||||||
|
DeBuff,
|
||||||
|
Dexterity,
|
||||||
|
Disease,
|
||||||
|
Dodge,
|
||||||
|
Dragon,
|
||||||
|
Drain,
|
||||||
|
Earth,
|
||||||
|
Effect,
|
||||||
|
Exorcism,
|
||||||
|
Fear,
|
||||||
|
Fire,
|
||||||
|
FIRE,
|
||||||
|
Fly,
|
||||||
|
Giant,
|
||||||
|
GreatAxeMastery,
|
||||||
|
GreatSwordMastery,
|
||||||
|
Hammer,
|
||||||
|
Heal,
|
||||||
|
Healing,
|
||||||
|
Holy,
|
||||||
|
HOLY,
|
||||||
|
ImmuneToAttack,
|
||||||
|
ImmuneToPowers,
|
||||||
|
Intelligence,
|
||||||
|
Invisible,
|
||||||
|
Lightning,
|
||||||
|
LIGHTNING,
|
||||||
|
Liturgy,
|
||||||
|
Magic,
|
||||||
|
MAGIC,
|
||||||
|
Mental,
|
||||||
|
MENTAL,
|
||||||
|
NatureLore,
|
||||||
|
Necromancy,
|
||||||
|
Parry,
|
||||||
|
Piercing,
|
||||||
|
Poison,
|
||||||
|
POISON,
|
||||||
|
PoleArm,
|
||||||
|
Powerblock,
|
||||||
|
Rat,
|
||||||
|
ResistDeBuff,
|
||||||
|
Restoration,
|
||||||
|
Root,
|
||||||
|
Shadowmastery,
|
||||||
|
Siege,
|
||||||
|
Slashing,
|
||||||
|
Snare,
|
||||||
|
Sorcery,
|
||||||
|
Spear,
|
||||||
|
SpearMastery,
|
||||||
|
Spirit,
|
||||||
|
Staff,
|
||||||
|
Stormcalling,
|
||||||
|
Strength,
|
||||||
|
Stun,
|
||||||
|
Summon,
|
||||||
|
Sword,
|
||||||
|
SwordMastery,
|
||||||
|
Thaumaturgy,
|
||||||
|
Theurgy,
|
||||||
|
Transform,
|
||||||
|
UnarmedCombat,
|
||||||
|
UnarmedCombatMastery,
|
||||||
|
Unholy,
|
||||||
|
UNHOLY,
|
||||||
|
Unknown,
|
||||||
|
Warding,
|
||||||
|
Warlockry,
|
||||||
|
WayoftheGaana,
|
||||||
|
WearArmorHeavy,
|
||||||
|
WearArmorLight,
|
||||||
|
WearArmorMedium,
|
||||||
|
Wereform,
|
||||||
|
Athletics,
|
||||||
|
AxeMastery,
|
||||||
|
Bargaining,
|
||||||
|
BladeMastery,
|
||||||
|
FlameCalling,
|
||||||
|
GreatHammerMastery,
|
||||||
|
HammerMastery,
|
||||||
|
Leadership,
|
||||||
|
PoleArmMastery,
|
||||||
|
Running,
|
||||||
|
StaffMastery,
|
||||||
|
Throwing,
|
||||||
|
Toughness,
|
||||||
|
WayoftheWolf,
|
||||||
|
WayoftheRat,
|
||||||
|
WayoftheBear,
|
||||||
|
Orthanatos,
|
||||||
|
SunDancing,
|
||||||
|
//Power categories.
|
||||||
|
AE,
|
||||||
|
AEDAMAGE,
|
||||||
|
BEHAVIOR,
|
||||||
|
BLESSING,
|
||||||
|
BOONCLASS,
|
||||||
|
BOONRACE,
|
||||||
|
BREAKFLY,
|
||||||
|
BUFF,
|
||||||
|
CHANT,
|
||||||
|
DAMAGE,
|
||||||
|
DEBUFF,
|
||||||
|
DISPEL,
|
||||||
|
FLIGHT,
|
||||||
|
GROUPBUFF,
|
||||||
|
GROUPHEAL,
|
||||||
|
HEAL,
|
||||||
|
INVIS,
|
||||||
|
MOVE,
|
||||||
|
RECALL,
|
||||||
|
SPECIAL,
|
||||||
|
SPIREDISABLE,
|
||||||
|
SPIREPROOFTELEPORT,
|
||||||
|
STANCE,
|
||||||
|
STUN,
|
||||||
|
SUMMON,
|
||||||
|
TELEPORT,
|
||||||
|
THIEF,
|
||||||
|
TRACK,
|
||||||
|
TRANSFORM,
|
||||||
|
VAMPDRAIN,
|
||||||
|
WEAPON,
|
||||||
|
Wizardry;
|
||||||
|
|
||||||
|
public static SourceType GetSourceType(String modName) {
|
||||||
|
SourceType returnMod;
|
||||||
|
if (modName.isEmpty())
|
||||||
|
return SourceType.None;
|
||||||
|
|
||||||
|
try {
|
||||||
|
returnMod = SourceType.valueOf(modName.replace(",", ""));
|
||||||
|
} catch (Exception e) {
|
||||||
|
Logger.error(modName);
|
||||||
|
Logger.error(e);
|
||||||
|
return SourceType.None;
|
||||||
|
}
|
||||||
|
return returnMod;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public enum EffectSourceType {
|
public enum EffectSourceType {
|
||||||
None,
|
None,
|
||||||
AttackSpeedBuff,
|
AttackSpeedBuff,
|
||||||
@@ -920,7 +1102,7 @@ public class mbEnums {
|
|||||||
WereformSPRecBuff,
|
WereformSPRecBuff,
|
||||||
WereformStrBuff;
|
WereformStrBuff;
|
||||||
|
|
||||||
public static EffectSourceType getEffectSourceType(String modName) {
|
public static EffectSourceType GetEffectSourceType(String modName) {
|
||||||
EffectSourceType returnMod;
|
EffectSourceType returnMod;
|
||||||
if (modName.isEmpty())
|
if (modName.isEmpty())
|
||||||
return EffectSourceType.None;
|
return EffectSourceType.None;
|
||||||
@@ -2562,7 +2744,7 @@ public class mbEnums {
|
|||||||
DIAMOND(1580010, 1540225085, -1730704107, 2000, 20),
|
DIAMOND(1580010, 1540225085, -1730704107, 2000, 20),
|
||||||
GALVOR(1580017, -1683992404, -1596311545, 2000, 5),
|
GALVOR(1580017, -1683992404, -1596311545, 2000, 5),
|
||||||
IRON(1580002, -1673518119, 2504297, 2000, 20),
|
IRON(1580002, -1673518119, 2504297, 2000, 20),
|
||||||
LUMBER(1580004, 1628412684, -1603256692, 10000, 100),
|
LUMBER(1580004, -1628412684, -1603256692, 10000, 100),
|
||||||
MANDRAKE(1580007, 1519910613, 1191391799, 1000, 10),
|
MANDRAKE(1580007, 1519910613, 1191391799, 1000, 10),
|
||||||
MITHRIL(1580021, 626743397, -1761257186, 500, 5),
|
MITHRIL(1580021, 626743397, -1761257186, 500, 5),
|
||||||
OAK(1580005, -1653034775, 74767, 3000, 30),
|
OAK(1580005, -1653034775, 74767, 3000, 30),
|
||||||
@@ -2852,5 +3034,86 @@ public class mbEnums {
|
|||||||
PREFIX,
|
PREFIX,
|
||||||
SUFFIX;
|
SUFFIX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum PowerType {
|
||||||
|
None,
|
||||||
|
SPELL,
|
||||||
|
SKILL
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum CostType {
|
||||||
|
NONE,
|
||||||
|
HEALTH,
|
||||||
|
MANA,
|
||||||
|
STAMINA
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum AreaType {
|
||||||
|
NONE,
|
||||||
|
SPHERE,
|
||||||
|
POINTBLANK,
|
||||||
|
LINE,
|
||||||
|
CONE,
|
||||||
|
WALL
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum ExcludeType {
|
||||||
|
NONE,
|
||||||
|
CASTER,
|
||||||
|
GROUP,
|
||||||
|
GUILD,
|
||||||
|
NATION,
|
||||||
|
PLAYERS,
|
||||||
|
ALLBUTGROUP,
|
||||||
|
ALLBUTPETS
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum CastingModeType {
|
||||||
|
NONE,
|
||||||
|
COMBAT,
|
||||||
|
NONCOMBAT,
|
||||||
|
BOTH
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum TargetSelectType {
|
||||||
|
NONE,
|
||||||
|
CLICK,
|
||||||
|
GROUP,
|
||||||
|
GUILD,
|
||||||
|
NEARBYMOBS,
|
||||||
|
NAME
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum CategoryToPowerType {
|
||||||
|
None,
|
||||||
|
GreaterThanOrEqualTo,
|
||||||
|
GreaterThan,
|
||||||
|
Always
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum ModificationType {
|
||||||
|
ADD,
|
||||||
|
MULTIPLY
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum ServerConfig {
|
||||||
|
MBDB_108("AERYNTH", "ARAC", "MOURNING", 300000),
|
||||||
|
MBDB_192("DALGOTH", "ARAC", "GOOK", 300001),
|
||||||
|
MBDB_162("VORGINA", "LORE", "SAEDRON", 300002),
|
||||||
|
MBDB_164("VORGINA", "ARAC", "THURIN", 300002);
|
||||||
|
|
||||||
|
public final String mapType;
|
||||||
|
public final String ruleType;
|
||||||
|
public final String serverName;
|
||||||
|
public final int realmMap;
|
||||||
|
|
||||||
|
ServerConfig(String mapType, String ruleType, String serverName, int realmMap) {
|
||||||
|
|
||||||
|
this.mapType = mapType;
|
||||||
|
this.ruleType = ruleType;
|
||||||
|
this.serverName = serverName;
|
||||||
|
this.realmMap = realmMap;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -938,7 +938,7 @@ public class MobAI {
|
|||||||
if (mob.isSit() && mob.getTimeStamp("HEALTHRECOVERED") < System.currentTimeMillis() + 3000)
|
if (mob.isSit() && mob.getTimeStamp("HEALTHRECOVERED") < System.currentTimeMillis() + 3000)
|
||||||
if (mob.getHealth() < mob.getHealthMax()) {
|
if (mob.getHealth() < mob.getHealthMax()) {
|
||||||
|
|
||||||
float recoveredHealth = mob.getHealthMax() * ((1 + mob.getBonuses().getFloatPercentAll(mbEnums.ModType.HealthRecoverRate, mbEnums.EffectSourceType.None)) * 0.01f);
|
float recoveredHealth = mob.getHealthMax() * ((1 + mob.getBonuses().getFloatPercentAll(mbEnums.ModType.HealthRecoverRate, mbEnums.SourceType.None)) * 0.01f);
|
||||||
mob.setHealth(mob.getHealth() + recoveredHealth);
|
mob.setHealth(mob.getHealth() + recoveredHealth);
|
||||||
mob.getTimestamps().put("HEALTHRECOVERED", System.currentTimeMillis());
|
mob.getTimestamps().put("HEALTHRECOVERED", System.currentTimeMillis());
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ package engine.mobileAI.utilities;
|
|||||||
import engine.gameManager.MovementManager;
|
import engine.gameManager.MovementManager;
|
||||||
import engine.math.Vector3fImmutable;
|
import engine.math.Vector3fImmutable;
|
||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.mbEnums.EffectSourceType;
|
|
||||||
import engine.mbEnums.GameObjectType;
|
import engine.mbEnums.GameObjectType;
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
|
import engine.mbEnums.SourceType;
|
||||||
import engine.mobileAI.Threads.MobAIThread;
|
import engine.mobileAI.Threads.MobAIThread;
|
||||||
import engine.net.client.msg.MoveToPointMsg;
|
import engine.net.client.msg.MoveToPointMsg;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
@@ -169,7 +169,7 @@ public class MovementUtilities {
|
|||||||
if (agent.getMobBase() != null && agent.getMobBase().getFlags().contains(mbEnums.MobFlagType.SENTINEL))
|
if (agent.getMobBase() != null && agent.getMobBase().getFlags().contains(mbEnums.MobFlagType.SENTINEL))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return (agent.isAlive() && !agent.getBonuses().getBool(ModType.Stunned, EffectSourceType.None) && !agent.getBonuses().getBool(ModType.CannotMove, EffectSourceType.None));
|
return (agent.isAlive() && !agent.getBonuses().getBool(ModType.Stunned, 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) {
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ public enum Protocol {
|
|||||||
ITEMPRODUCTION(0x3CCE8E30, ItemProductionMsg.class, ItemProductionMsgHandler.class),
|
ITEMPRODUCTION(0x3CCE8E30, ItemProductionMsg.class, ItemProductionMsgHandler.class),
|
||||||
ITEMTOVAULT(0x3ABE4927, ItemToVaultMsg.class, ItemToVaultMsgHandler.class), // Transfer Item to Vault
|
ITEMTOVAULT(0x3ABE4927, ItemToVaultMsg.class, ItemToVaultMsgHandler.class), // Transfer Item to Vault
|
||||||
ITEMFROMVAULT(0x0119A64D, ItemFromVaultMsg.class, ItemFromVaultMsgHandler.class), // Transfer Item from Vault to Inventory
|
ITEMFROMVAULT(0x0119A64D, ItemFromVaultMsg.class, ItemFromVaultMsgHandler.class), // Transfer Item from Vault to Inventory
|
||||||
JOINFORPROVINCE(0x1FB369CD, AcceptSubInviteMsg.class, AcceptSubInviteHandler.class), //Response to invite to swear?
|
JOINFORPROVINCE(0x1FB369CD, AcceptSubInviteMsg.class, SwearInGuildHandler.class), //Response to invite to swear?
|
||||||
JOINFORSWORN(0xF6A4170F, null, null),
|
JOINFORSWORN(0xF6A4170F, null, null),
|
||||||
JOINGROUP(0x7EC5E636, GroupInviteResponseMsg.class, GroupInviteResponseHandler.class), // Accept Group Invite
|
JOINGROUP(0x7EC5E636, GroupInviteResponseMsg.class, GroupInviteResponseHandler.class), // Accept Group Invite
|
||||||
JOINGUILD(0xF0C5F2FF, AcceptInviteToGuildMsg.class, AcceptInviteToGuildHandler.class), // Accept guild invite
|
JOINGUILD(0xF0C5F2FF, AcceptInviteToGuildMsg.class, AcceptInviteToGuildHandler.class), // Accept guild invite
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public class RecvSummonsMsgHandler extends AbstractClientMsgHandler {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (playerCharacter.getBonuses() != null && playerCharacter.getBonuses().getBool(mbEnums.ModType.BlockedPowerType, mbEnums.EffectSourceType.Summon)) {
|
if (playerCharacter.getBonuses() != null && playerCharacter.getBonuses().getBool(mbEnums.ModType.BlockedPowerType, mbEnums.SourceType.SUMMON)) {
|
||||||
ErrorPopupMsg.sendErrorMsg(playerCharacter, "You have been blocked from receiving summons!");
|
ErrorPopupMsg.sendErrorMsg(playerCharacter, "You have been blocked from receiving summons!");
|
||||||
ErrorPopupMsg.sendErrorMsg(source, "Target is blocked from receiving summons!");
|
ErrorPopupMsg.sendErrorMsg(source, "Target is blocked from receiving summons!");
|
||||||
playerCharacter.removeSummoner(source.getObjectUUID());
|
playerCharacter.removeSummoner(source.getObjectUUID());
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class RepairMsgHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
//account for durability modifications
|
//account for durability modifications
|
||||||
|
|
||||||
float durMod = toRepair.getBonusPercent(mbEnums.ModType.Durability, mbEnums.EffectSourceType.None);
|
float durMod = toRepair.getBonusPercent(mbEnums.ModType.Durability, mbEnums.SourceType.None);
|
||||||
max *= (1 + (durMod * 0.01f));
|
max *= (1 + (durMod * 0.01f));
|
||||||
|
|
||||||
if (dur >= max || dur < 1) {
|
if (dur >= max || dur < 1) {
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ import engine.net.Dispatch;
|
|||||||
import engine.net.client.ClientConnection;
|
import engine.net.client.ClientConnection;
|
||||||
import engine.net.client.msg.ClientNetMsg;
|
import engine.net.client.msg.ClientNetMsg;
|
||||||
import engine.net.client.msg.ErrorPopupMsg;
|
import engine.net.client.msg.ErrorPopupMsg;
|
||||||
|
import engine.net.client.msg.guild.AcceptSubInviteMsg;
|
||||||
import engine.net.client.msg.guild.SendGuildEntryMsg;
|
import engine.net.client.msg.guild.SendGuildEntryMsg;
|
||||||
import engine.net.client.msg.guild.SwearInGuildMsg;
|
|
||||||
import engine.objects.City;
|
import engine.objects.City;
|
||||||
import engine.objects.Guild;
|
import engine.objects.Guild;
|
||||||
import engine.objects.GuildStatusController;
|
import engine.objects.GuildStatusController;
|
||||||
@@ -36,18 +36,18 @@ public class SwearInGuildHandler extends AbstractClientMsgHandler {
|
|||||||
@Override
|
@Override
|
||||||
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) {
|
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) {
|
||||||
PlayerCharacter player;
|
PlayerCharacter player;
|
||||||
SwearInGuildMsg swearInMsg;
|
AcceptSubInviteMsg swearInMsg;
|
||||||
Guild targetGuild;
|
Guild targetGuild;
|
||||||
Guild nation;
|
Guild nation;
|
||||||
Dispatch dispatch;
|
Dispatch dispatch;
|
||||||
|
|
||||||
swearInMsg = (SwearInGuildMsg) baseMsg;
|
swearInMsg = (AcceptSubInviteMsg) baseMsg;
|
||||||
player = SessionManager.getPlayerCharacter(origin);
|
player = SessionManager.getPlayerCharacter(origin);
|
||||||
|
|
||||||
if (player == null)
|
if (player == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
targetGuild = (Guild) DbManager.getObject(GameObjectType.Guild, swearInMsg.getGuildUUID());
|
targetGuild = (Guild) DbManager.getObject(GameObjectType.Guild, swearInMsg.guildUUID());
|
||||||
|
|
||||||
if (targetGuild == null) {
|
if (targetGuild == null) {
|
||||||
ErrorPopupMsg.sendErrorMsg(player, "A Serious error has occured. Please post details for to ensure transaction integrity");
|
ErrorPopupMsg.sendErrorMsg(player, "A Serious error has occured. Please post details for to ensure transaction integrity");
|
||||||
@@ -66,15 +66,6 @@ public class SwearInGuildHandler extends AbstractClientMsgHandler {
|
|||||||
ErrorPopupMsg.sendErrorMsg(player, "Your guild is not a nation!");
|
ErrorPopupMsg.sendErrorMsg(player, "Your guild is not a nation!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!nation.getSubGuildList().contains(targetGuild)) {
|
|
||||||
ErrorPopupMsg.sendErrorMsg(player, "Your do not have such authority!");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Guild.canSwearIn(targetGuild)) {
|
|
||||||
ErrorPopupMsg.sendErrorMsg(player, targetGuild.getGuildState().name() + "cannot be sworn in");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GuildStatusController.isGuildLeader(player.getGuildStatus()) == false) {
|
if (GuildStatusController.isGuildLeader(player.getGuildStatus()) == false) {
|
||||||
ErrorPopupMsg.sendErrorMsg(player, "Your do not have such authority!");
|
ErrorPopupMsg.sendErrorMsg(player, "Your do not have such authority!");
|
||||||
@@ -86,16 +77,8 @@ public class SwearInGuildHandler extends AbstractClientMsgHandler {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (targetGuild.getGuildState()) {
|
if (targetGuild.getGuildState().equals(GuildState.Errant))
|
||||||
case Petitioner:
|
GuildManager.updateAllGuildBinds(targetGuild, nation.getOwnedCity());
|
||||||
GuildManager.updateAllGuildBinds(targetGuild, nation.getOwnedCity());
|
|
||||||
break;
|
|
||||||
case Protectorate:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
//shouldn't get here.
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
//update Guild state.
|
//update Guild state.
|
||||||
targetGuild.setNation(nation);
|
targetGuild.setNation(nation);
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ public class TrackWindowMsgHandler extends AbstractClientMsgHandler {
|
|||||||
else if (awo.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
else if (awo.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
||||||
PlayerBonuses bonus = ((PlayerCharacter) awo).getBonuses();
|
PlayerBonuses bonus = ((PlayerCharacter) awo).getBonuses();
|
||||||
|
|
||||||
if (bonus != null && bonus.getBool(mbEnums.ModType.CannotTrack, mbEnums.EffectSourceType.None))
|
if (bonus != null && bonus.getBool(mbEnums.ModType.CannotTrack, mbEnums.SourceType.None))
|
||||||
it.remove();
|
it.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -527,7 +527,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
boolean canFly = false;
|
boolean canFly = false;
|
||||||
PlayerBonuses bonus = flyer.getBonuses();
|
PlayerBonuses bonus = flyer.getBonuses();
|
||||||
|
|
||||||
if (bonus != null && !bonus.getBool(ModType.NoMod, EffectSourceType.Flight) && bonus.getBool(ModType.Fly, EffectSourceType.None) && flyer.isAlive())
|
if (bonus != null && !bonus.getBool(ModType.NoMod, SourceType.Fly) && bonus.getBool(ModType.Fly, SourceType.None) && flyer.isAlive())
|
||||||
canFly = true;
|
canFly = true;
|
||||||
|
|
||||||
return canFly;
|
return canFly;
|
||||||
@@ -613,10 +613,10 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
|
|
||||||
if (abstractCharacter.bonuses != null) {
|
if (abstractCharacter.bonuses != null) {
|
||||||
// add any bonuses
|
// add any bonuses
|
||||||
defense += (short) abstractCharacter.bonuses.getFloat(ModType.DCV, EffectSourceType.None);
|
defense += (short) abstractCharacter.bonuses.getFloat(ModType.DCV, SourceType.None);
|
||||||
|
|
||||||
// Finally multiply any percent modifiers. DO THIS LAST!
|
// Finally multiply any percent modifiers. DO THIS LAST!
|
||||||
float pos_Bonus = abstractCharacter.bonuses.getFloatPercentPositive(ModType.DCV, EffectSourceType.None);
|
float pos_Bonus = abstractCharacter.bonuses.getFloatPercentPositive(ModType.DCV, SourceType.None);
|
||||||
defense = (short) (defense * (1 + pos_Bonus));
|
defense = (short) (defense * (1 + pos_Bonus));
|
||||||
|
|
||||||
//Lucky rune applies next
|
//Lucky rune applies next
|
||||||
@@ -625,7 +625,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
|
|
||||||
//and negative percent modifiers
|
//and negative percent modifiers
|
||||||
//already done...
|
//already done...
|
||||||
float neg_Bonus = abstractCharacter.bonuses.getFloatPercentNegative(ModType.DCV, EffectSourceType.None);
|
float neg_Bonus = abstractCharacter.bonuses.getFloatPercentNegative(ModType.DCV, SourceType.None);
|
||||||
defense = (short) (defense * (1 + neg_Bonus));
|
defense = (short) (defense * (1 + neg_Bonus));
|
||||||
|
|
||||||
} else
|
} else
|
||||||
@@ -728,7 +728,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
abstractCharacter.rangeHandTwo = weapon.template.item_weapon_max_range * (1 + (abstractCharacter.statStrBase / 600));
|
abstractCharacter.rangeHandTwo = weapon.template.item_weapon_max_range * (1 + (abstractCharacter.statStrBase / 600));
|
||||||
|
|
||||||
if (abstractCharacter.bonuses != null) {
|
if (abstractCharacter.bonuses != null) {
|
||||||
float range_bonus = 1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.WeaponRange, EffectSourceType.None);
|
float range_bonus = 1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.WeaponRange, SourceType.None);
|
||||||
|
|
||||||
if (mainHand)
|
if (mainHand)
|
||||||
abstractCharacter.rangeHandOne *= range_bonus;
|
abstractCharacter.rangeHandOne *= range_bonus;
|
||||||
@@ -772,10 +772,10 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
// add in any bonuses to atr
|
// add in any bonuses to atr
|
||||||
if (abstractCharacter.bonuses != null) {
|
if (abstractCharacter.bonuses != null) {
|
||||||
// Add any base bonuses
|
// Add any base bonuses
|
||||||
atr += abstractCharacter.bonuses.getFloat(ModType.OCV, EffectSourceType.None);
|
atr += abstractCharacter.bonuses.getFloat(ModType.OCV, SourceType.None);
|
||||||
|
|
||||||
// Finally use any multipliers. DO THIS LAST!
|
// Finally use any multipliers. DO THIS LAST!
|
||||||
float pos_Bonus = (1 + abstractCharacter.bonuses.getFloatPercentPositive(ModType.OCV, EffectSourceType.None));
|
float pos_Bonus = (1 + abstractCharacter.bonuses.getFloatPercentPositive(ModType.OCV, SourceType.None));
|
||||||
atr *= pos_Bonus;
|
atr *= pos_Bonus;
|
||||||
|
|
||||||
// next precise
|
// next precise
|
||||||
@@ -783,7 +783,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
// atr *= (1 + ((float) this.bonuses.getShort("rune.Attack") / 100));
|
// atr *= (1 + ((float) this.bonuses.getShort("rune.Attack") / 100));
|
||||||
|
|
||||||
//and negative percent modifiers
|
//and negative percent modifiers
|
||||||
float neg_Bonus = abstractCharacter.bonuses.getFloatPercentNegative(ModType.OCV, EffectSourceType.None);
|
float neg_Bonus = abstractCharacter.bonuses.getFloatPercentNegative(ModType.OCV, SourceType.None);
|
||||||
|
|
||||||
atr *= (1 + neg_Bonus);
|
atr *= (1 + neg_Bonus);
|
||||||
}
|
}
|
||||||
@@ -803,7 +803,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
else
|
else
|
||||||
speed = 20f; //unarmed attack speed
|
speed = 20f; //unarmed attack speed
|
||||||
if (weapon != null)
|
if (weapon != null)
|
||||||
speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.WeaponSpeed, EffectSourceType.None));
|
speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.WeaponSpeed, SourceType.None));
|
||||||
|
|
||||||
PlayerBonuses bonuses = abstractCharacter.bonuses;
|
PlayerBonuses bonuses = abstractCharacter.bonuses;
|
||||||
if (bonuses != null) {
|
if (bonuses != null) {
|
||||||
@@ -823,7 +823,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
speed *= (1 + bonuses.bonusFloats.get(mod));
|
speed *= (1 + bonuses.bonusFloats.get(mod));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.AttackDelay, EffectSourceType.None));
|
//speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.AttackDelay, SourceType.None));
|
||||||
|
|
||||||
if (speed < 10)
|
if (speed < 10)
|
||||||
speed = 10;
|
speed = 10;
|
||||||
@@ -832,22 +832,22 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
if (weapon != null) {
|
if (weapon != null) {
|
||||||
// Add any base bonuses
|
// Add any base bonuses
|
||||||
|
|
||||||
min += weapon.getBonus(ModType.MinDamage, EffectSourceType.None);
|
min += weapon.getBonus(ModType.MinDamage, SourceType.None);
|
||||||
max += weapon.getBonus(ModType.MaxDamage, EffectSourceType.None);
|
max += weapon.getBonus(ModType.MaxDamage, SourceType.None);
|
||||||
|
|
||||||
min += weapon.getBonus(ModType.MeleeDamageModifier, EffectSourceType.None);
|
min += weapon.getBonus(ModType.MeleeDamageModifier, SourceType.None);
|
||||||
max += weapon.getBonus(ModType.MeleeDamageModifier, EffectSourceType.None);
|
max += weapon.getBonus(ModType.MeleeDamageModifier, SourceType.None);
|
||||||
|
|
||||||
// Finally use any multipliers. DO THIS LAST!
|
// Finally use any multipliers. DO THIS LAST!
|
||||||
|
|
||||||
float percentMinDamage = 1;
|
float percentMinDamage = 1;
|
||||||
float percentMaxDamage = 1;
|
float percentMaxDamage = 1;
|
||||||
|
|
||||||
percentMinDamage += weapon.getBonusPercent(ModType.MinDamage, EffectSourceType.None);
|
percentMinDamage += weapon.getBonusPercent(ModType.MinDamage, SourceType.None);
|
||||||
percentMinDamage += weapon.getBonusPercent(ModType.MeleeDamageModifier, EffectSourceType.None);
|
percentMinDamage += weapon.getBonusPercent(ModType.MeleeDamageModifier, SourceType.None);
|
||||||
|
|
||||||
percentMaxDamage += weapon.getBonusPercent(ModType.MaxDamage, EffectSourceType.None);
|
percentMaxDamage += weapon.getBonusPercent(ModType.MaxDamage, SourceType.None);
|
||||||
percentMaxDamage += weapon.getBonusPercent(ModType.MeleeDamageModifier, EffectSourceType.None);
|
percentMaxDamage += weapon.getBonusPercent(ModType.MeleeDamageModifier, SourceType.None);
|
||||||
|
|
||||||
|
|
||||||
min *= percentMinDamage;
|
min *= percentMinDamage;
|
||||||
@@ -884,21 +884,21 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
// add in any bonuses to damage
|
// add in any bonuses to damage
|
||||||
if (abstractCharacter.bonuses != null) {
|
if (abstractCharacter.bonuses != null) {
|
||||||
// Add any base bonuses
|
// Add any base bonuses
|
||||||
minDamage += abstractCharacter.bonuses.getFloat(ModType.MinDamage, EffectSourceType.None);
|
minDamage += abstractCharacter.bonuses.getFloat(ModType.MinDamage, SourceType.None);
|
||||||
maxDamage += abstractCharacter.bonuses.getFloat(ModType.MaxDamage, EffectSourceType.None);
|
maxDamage += abstractCharacter.bonuses.getFloat(ModType.MaxDamage, SourceType.None);
|
||||||
|
|
||||||
minDamage += abstractCharacter.bonuses.getFloat(ModType.MeleeDamageModifier, EffectSourceType.None);
|
minDamage += abstractCharacter.bonuses.getFloat(ModType.MeleeDamageModifier, SourceType.None);
|
||||||
maxDamage += abstractCharacter.bonuses.getFloat(ModType.MeleeDamageModifier, EffectSourceType.None);
|
maxDamage += abstractCharacter.bonuses.getFloat(ModType.MeleeDamageModifier, SourceType.None);
|
||||||
// Finally use any multipliers. DO THIS LAST!
|
// Finally use any multipliers. DO THIS LAST!
|
||||||
|
|
||||||
float percentMinDamage = 1;
|
float percentMinDamage = 1;
|
||||||
float percentMaxDamage = 1;
|
float percentMaxDamage = 1;
|
||||||
|
|
||||||
percentMinDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MinDamage, EffectSourceType.None);
|
percentMinDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MinDamage, SourceType.None);
|
||||||
percentMinDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, EffectSourceType.None);
|
percentMinDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
||||||
|
|
||||||
percentMaxDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MaxDamage, EffectSourceType.None);
|
percentMaxDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MaxDamage, SourceType.None);
|
||||||
percentMaxDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, EffectSourceType.None);
|
percentMaxDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
||||||
|
|
||||||
minDamage *= percentMinDamage;
|
minDamage *= percentMinDamage;
|
||||||
maxDamage *= percentMaxDamage;
|
maxDamage *= percentMaxDamage;
|
||||||
@@ -947,8 +947,8 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
//apply item defense bonuses
|
//apply item defense bonuses
|
||||||
|
|
||||||
if (shield != null) {
|
if (shield != null) {
|
||||||
def += shield.getBonus(ModType.DR, EffectSourceType.None);
|
def += shield.getBonus(ModType.DR, SourceType.None);
|
||||||
def *= (1 + shield.getBonusPercent(ModType.DR, EffectSourceType.None));
|
def *= (1 + shield.getBonusPercent(ModType.DR, SourceType.None));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -991,8 +991,8 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
//apply item defense bonuses
|
//apply item defense bonuses
|
||||||
|
|
||||||
if (armor != null) {
|
if (armor != null) {
|
||||||
def += armor.getBonus(ModType.DR, EffectSourceType.None);
|
def += armor.getBonus(ModType.DR, SourceType.None);
|
||||||
def *= (1 + armor.getBonusPercent(ModType.DR, EffectSourceType.None));
|
def *= (1 + armor.getBonusPercent(ModType.DR, SourceType.None));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (def * (1 + ((int) armorSkill.getModifiedAmount() / 50f)));
|
return (def * (1 + ((int) armorSkill.getModifiedAmount() / 50f)));
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ import engine.gameManager.DispatchManager;
|
|||||||
import engine.gameManager.ZoneManager;
|
import engine.gameManager.ZoneManager;
|
||||||
import engine.math.Vector3fImmutable;
|
import engine.math.Vector3fImmutable;
|
||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.mbEnums.EffectSourceType;
|
|
||||||
import engine.mbEnums.GameObjectType;
|
import engine.mbEnums.GameObjectType;
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
|
import engine.mbEnums.SourceType;
|
||||||
import engine.mobileAI.Threads.MobAIThread;
|
import engine.mobileAI.Threads.MobAIThread;
|
||||||
import engine.net.Dispatch;
|
import engine.net.Dispatch;
|
||||||
import engine.net.client.msg.PetMsg;
|
import engine.net.client.msg.PetMsg;
|
||||||
@@ -141,7 +141,7 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter {
|
|||||||
float ret = MobAIThread.AI_BASE_AGGRO_RANGE;
|
float ret = MobAIThread.AI_BASE_AGGRO_RANGE;
|
||||||
|
|
||||||
if (this.bonuses != null)
|
if (this.bonuses != null)
|
||||||
ret *= (1 + this.bonuses.getFloatPercentAll(ModType.ScanRange, EffectSourceType.None));
|
ret *= (1 + this.bonuses.getFloatPercentAll(ModType.ScanRange, SourceType.None));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -959,7 +959,7 @@ public class Building extends AbstractWorldObject {
|
|||||||
// Altitude of this building is derived from the heightmap engine.
|
// Altitude of this building is derived from the heightmap engine.
|
||||||
|
|
||||||
Vector3fImmutable tempLoc = new Vector3fImmutable(this.statLat + this.parentZone.absX, 0, this.statLon + this.parentZone.absZ);
|
Vector3fImmutable tempLoc = new Vector3fImmutable(this.statLat + this.parentZone.absX, 0, this.statLon + this.parentZone.absZ);
|
||||||
tempLoc = new Vector3fImmutable(tempLoc.x, Terrain.getWorldHeight(tempLoc), tempLoc.z);
|
tempLoc = new Vector3fImmutable(tempLoc.x, Terrain.getWorldHeight(tempLoc) + this.statAlt, tempLoc.z);
|
||||||
this.setLoc(tempLoc);
|
this.setLoc(tempLoc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ package engine.objects;
|
|||||||
|
|
||||||
import engine.gameManager.DbManager;
|
import engine.gameManager.DbManager;
|
||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.mbEnums.EffectSourceType;
|
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
|
import engine.mbEnums.SourceType;
|
||||||
import engine.net.ByteBufferWriter;
|
import engine.net.ByteBufferWriter;
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
@@ -306,12 +306,12 @@ public class CharacterSkill extends AbstractGameObject {
|
|||||||
PlayerBonuses bonus = ac.getBonuses();
|
PlayerBonuses bonus = ac.getBonuses();
|
||||||
if (bonus == null)
|
if (bonus == null)
|
||||||
return atr;
|
return atr;
|
||||||
atr += bonus.getFloat(ModType.OCV, EffectSourceType.None);
|
atr += bonus.getFloat(ModType.OCV, SourceType.None);
|
||||||
float pos_Bonus = bonus.getFloatPercentPositive(ModType.OCV, EffectSourceType.None);
|
float pos_Bonus = bonus.getFloatPercentPositive(ModType.OCV, SourceType.None);
|
||||||
atr *= (1 + pos_Bonus);
|
atr *= (1 + pos_Bonus);
|
||||||
//rUNES will already be applied
|
//rUNES will already be applied
|
||||||
// atr *= (1 + ((float)bonus.getShort("rune.Attack") / 100)); //precise
|
// atr *= (1 + ((float)bonus.getShort("rune.Attack") / 100)); //precise
|
||||||
float neg_Bonus = bonus.getFloatPercentNegative(ModType.OCV, EffectSourceType.None);
|
float neg_Bonus = bonus.getFloatPercentNegative(ModType.OCV, SourceType.None);
|
||||||
atr *= (1 + neg_Bonus);
|
atr *= (1 + neg_Bonus);
|
||||||
return atr;
|
return atr;
|
||||||
}
|
}
|
||||||
@@ -462,7 +462,7 @@ public class CharacterSkill extends AbstractGameObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
float bonus = 0f;
|
float bonus = 0f;
|
||||||
EffectSourceType sourceType = EffectSourceType.getEffectSourceType(sb.getNameNoSpace());
|
SourceType sourceType = SourceType.GetSourceType(sb.getNameNoSpace());
|
||||||
if (pc.getBonuses() != null) {
|
if (pc.getBonuses() != null) {
|
||||||
//Get bonuses from runes
|
//Get bonuses from runes
|
||||||
bonus = pc.getBonuses().getSkillBonus(sb.sourceType);
|
bonus = pc.getBonuses().getSkillBonus(sb.sourceType);
|
||||||
@@ -1103,7 +1103,7 @@ public class CharacterSkill extends AbstractGameObject {
|
|||||||
statMod = 600f;
|
statMod = 600f;
|
||||||
}
|
}
|
||||||
base += CharacterSkill.baseSkillValues[(int) statMod];
|
base += CharacterSkill.baseSkillValues[(int) statMod];
|
||||||
EffectSourceType sourceType = EffectSourceType.getEffectSourceType(this.skillsBase.getNameNoSpace());
|
SourceType sourceType = SourceType.GetSourceType(this.skillsBase.getNameNoSpace());
|
||||||
|
|
||||||
//Get any rune, effect and item bonus
|
//Get any rune, effect and item bonus
|
||||||
|
|
||||||
@@ -1217,7 +1217,7 @@ public class CharacterSkill extends AbstractGameObject {
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
float bonus = 0f;
|
float bonus = 0f;
|
||||||
EffectSourceType sourceType = EffectSourceType.getEffectSourceType(this.skillsBase.getNameNoSpace());
|
SourceType sourceType = SourceType.GetSourceType(this.skillsBase.getNameNoSpace());
|
||||||
if (CharacterSkill.GetOwner(this).getBonuses() != null) {
|
if (CharacterSkill.GetOwner(this).getBonuses() != null) {
|
||||||
//Get bonuses from runes
|
//Get bonuses from runes
|
||||||
bonus = CharacterSkill.GetOwner(this).getBonuses().getSkillBonus(this.skillsBase.sourceType);
|
bonus = CharacterSkill.GetOwner(this).getBonuses().getSkillBonus(this.skillsBase.sourceType);
|
||||||
|
|||||||
@@ -306,8 +306,22 @@ public class City extends AbstractWorldObject {
|
|||||||
if (city.parentZone == null)
|
if (city.parentZone == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
//can't repledge to a guild you're already part of
|
// Can't teleport to something without a tree
|
||||||
|
|
||||||
|
if (city.getTOL() == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// No abandoned cities
|
||||||
|
|
||||||
|
if (city.getTOL().getGuild().isEmptyGuild())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// No destroyed cities
|
||||||
|
|
||||||
|
if (city.getTOL().getRank() == -1)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
//can't repledge to a guild you're already part of
|
||||||
if (repledge && city.getGuild().equals(playerCharacter.guild))
|
if (repledge && city.getGuild().equals(playerCharacter.guild))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
@@ -694,7 +694,7 @@ public class Item extends AbstractWorldObject {
|
|||||||
this.bonuses.clear();
|
this.bonuses.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getBonus(ModType modType, EffectSourceType sourceType) {
|
public float getBonus(ModType modType, SourceType sourceType) {
|
||||||
|
|
||||||
int amount = 0;
|
int amount = 0;
|
||||||
for (AbstractEffectModifier modifier : this.getBonuses().keySet()) {
|
for (AbstractEffectModifier modifier : this.getBonuses().keySet()) {
|
||||||
@@ -707,7 +707,7 @@ public class Item extends AbstractWorldObject {
|
|||||||
return amount;
|
return amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getBonusPercent(ModType modType, EffectSourceType sourceType) {
|
public float getBonusPercent(ModType modType, SourceType sourceType) {
|
||||||
|
|
||||||
int amount = 0;
|
int amount = 0;
|
||||||
for (AbstractEffectModifier modifier : this.getBonuses().keySet()) {
|
for (AbstractEffectModifier modifier : this.getBonuses().keySet()) {
|
||||||
|
|||||||
@@ -220,8 +220,7 @@ public class Mine extends AbstractGameObject {
|
|||||||
// Only inactive mines are returned.
|
// Only inactive mines are returned.
|
||||||
|
|
||||||
for (Mine mine : Mine.mineMap.keySet()) {
|
for (Mine mine : Mine.mineMap.keySet()) {
|
||||||
if (mine.owningGuild.getObjectUUID() == guildID &&
|
if (mine.owningGuild.getObjectUUID() == guildID)
|
||||||
mine.isActive == false)
|
|
||||||
mineList.add(mine);
|
mineList.add(mine);
|
||||||
}
|
}
|
||||||
return mineList;
|
return mineList;
|
||||||
|
|||||||
+18
-18
@@ -708,19 +708,19 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
|||||||
// TODO modify for equipment
|
// TODO modify for equipment
|
||||||
if (this.bonuses != null) {
|
if (this.bonuses != null) {
|
||||||
// modify for effects
|
// modify for effects
|
||||||
strVal += this.bonuses.getFloat(ModType.Attr, EffectSourceType.Strength);
|
strVal += this.bonuses.getFloat(ModType.Attr, SourceType.Strength);
|
||||||
dexVal += this.bonuses.getFloat(ModType.Attr, EffectSourceType.Dexterity);
|
dexVal += this.bonuses.getFloat(ModType.Attr, SourceType.Dexterity);
|
||||||
conVal += this.bonuses.getFloat(ModType.Attr, EffectSourceType.Constitution);
|
conVal += this.bonuses.getFloat(ModType.Attr, SourceType.Constitution);
|
||||||
intVal += this.bonuses.getFloat(ModType.Attr, EffectSourceType.Intelligence);
|
intVal += this.bonuses.getFloat(ModType.Attr, SourceType.Intelligence);
|
||||||
spiVal += this.bonuses.getFloat(ModType.Attr, EffectSourceType.Spirit);
|
spiVal += this.bonuses.getFloat(ModType.Attr, SourceType.Spirit);
|
||||||
|
|
||||||
// apply dex penalty for armor
|
// apply dex penalty for armor
|
||||||
// modify percent amounts. DO THIS LAST!
|
// modify percent amounts. DO THIS LAST!
|
||||||
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.Strength));
|
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Strength));
|
||||||
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.Dexterity));
|
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Dexterity));
|
||||||
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.Constitution));
|
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Constitution));
|
||||||
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.Intelligence));
|
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Intelligence));
|
||||||
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.Spirit));
|
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Spirit));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set current stats
|
// Set current stats
|
||||||
@@ -737,7 +737,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
|||||||
float bonus = 1;
|
float bonus = 1;
|
||||||
if (this.bonuses != null)
|
if (this.bonuses != null)
|
||||||
// get rune and effect bonuses
|
// get rune and effect bonuses
|
||||||
bonus *= (1 + this.bonuses.getFloatPercentAll(ModType.Speed, EffectSourceType.None));
|
bonus *= (1 + this.bonuses.getFloatPercentAll(ModType.Speed, SourceType.None));
|
||||||
|
|
||||||
if (this.isPlayerGuard())
|
if (this.isPlayerGuard())
|
||||||
switch (this.mobBase.getLoadID()) {
|
switch (this.mobBase.getLoadID()) {
|
||||||
@@ -834,7 +834,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
|||||||
if (!this.isMoving())
|
if (!this.isMoving())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (this.isAlive() == false || this.getBonuses().getBool(ModType.Stunned, EffectSourceType.None) || this.getBonuses().getBool(ModType.CannotMove, EffectSourceType.None)) {
|
if (this.isAlive() == false || this.getBonuses().getBool(ModType.Stunned, 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());
|
||||||
@@ -1070,15 +1070,15 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
|||||||
// Apply any bonuses from runes and effects
|
// Apply any bonuses from runes and effects
|
||||||
|
|
||||||
if (this.bonuses != null) {
|
if (this.bonuses != null) {
|
||||||
h += this.bonuses.getFloat(ModType.HealthFull, EffectSourceType.None);
|
h += this.bonuses.getFloat(ModType.HealthFull, SourceType.None);
|
||||||
m += this.bonuses.getFloat(ModType.ManaFull, EffectSourceType.None);
|
m += this.bonuses.getFloat(ModType.ManaFull, SourceType.None);
|
||||||
s += this.bonuses.getFloat(ModType.StaminaFull, EffectSourceType.None);
|
s += this.bonuses.getFloat(ModType.StaminaFull, SourceType.None);
|
||||||
|
|
||||||
//apply effects percent modifiers. DO THIS LAST!
|
//apply effects percent modifiers. DO THIS LAST!
|
||||||
|
|
||||||
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, EffectSourceType.None));
|
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.None));
|
||||||
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, EffectSourceType.None));
|
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.None));
|
||||||
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, EffectSourceType.None));
|
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.None));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set max health, mana and stamina
|
// Set max health, mana and stamina
|
||||||
|
|||||||
@@ -512,29 +512,6 @@ public class NPC extends AbstractCharacter {
|
|||||||
return MinionType.ContractToMinionMap.containsKey(contractID);
|
return MinionType.ContractToMinionMap.containsKey(contractID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean UpdateEquipSetID(NPC npc, int equipSetID) {
|
|
||||||
|
|
||||||
if (!LootManager._bootySetMap.containsKey(equipSetID))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!DbManager.NPCQueries.UPDATE_EQUIPSET(npc, equipSetID))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
npc.equipmentSetID = equipSetID;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean UpdateRaceID(NPC npc, int raceID) {
|
|
||||||
|
|
||||||
if (!DbManager.NPCQueries.UPDATE_MOBBASE(npc, raceID))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
npc.loadID = raceID;
|
|
||||||
npc.mobBase = MobBase.getMobBase(npc.loadID);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static NPCProfits GetNPCProfits(NPC npc) {
|
public static NPCProfits GetNPCProfits(NPC npc) {
|
||||||
return NPCProfits.ProfitCache.get(npc.currentID);
|
return NPCProfits.ProfitCache.get(npc.currentID);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import engine.gameManager.ChatManager;
|
|||||||
import engine.gameManager.ConfigManager;
|
import engine.gameManager.ConfigManager;
|
||||||
import engine.gameManager.PowersManager;
|
import engine.gameManager.PowersManager;
|
||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.mbEnums.EffectSourceType;
|
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
|
import engine.mbEnums.SourceType;
|
||||||
import engine.powers.DamageShield;
|
import engine.powers.DamageShield;
|
||||||
import engine.powers.EffectsBase;
|
import engine.powers.EffectsBase;
|
||||||
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
||||||
@@ -30,9 +30,9 @@ public class PlayerBonuses {
|
|||||||
ConcurrentHashMap<AbstractEffectModifier, Float> bonusFloats = new ConcurrentHashMap<>();
|
ConcurrentHashMap<AbstractEffectModifier, Float> bonusFloats = new ConcurrentHashMap<>();
|
||||||
private ConcurrentHashMap<AbstractEffectModifier, DamageShield> bonusDamageShields = new ConcurrentHashMap<>();
|
private ConcurrentHashMap<AbstractEffectModifier, DamageShield> bonusDamageShields = new ConcurrentHashMap<>();
|
||||||
private ConcurrentHashMap<AbstractEffectModifier, String> bonusStrings = new ConcurrentHashMap<>();
|
private ConcurrentHashMap<AbstractEffectModifier, String> bonusStrings = new ConcurrentHashMap<>();
|
||||||
private ConcurrentHashMap<ModType, HashSet<EffectSourceType>> bonusLists = new ConcurrentHashMap<>();
|
private ConcurrentHashMap<ModType, HashSet<SourceType>> bonusLists = new ConcurrentHashMap<>();
|
||||||
private ConcurrentHashMap<ModType, HashMap<EffectSourceType, Boolean>> bonusBools = new ConcurrentHashMap<>();
|
private ConcurrentHashMap<ModType, HashMap<SourceType, Boolean>> bonusBools = new ConcurrentHashMap<>();
|
||||||
private ConcurrentHashMap<EffectSourceType, Float> skillBonuses = new ConcurrentHashMap<>();
|
private ConcurrentHashMap<SourceType, Float> skillBonuses = new ConcurrentHashMap<>();
|
||||||
private ConcurrentHashMap<ModType, Float> regens = new ConcurrentHashMap<>();
|
private ConcurrentHashMap<ModType, Float> regens = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
//If active == 0 then all gets come from the A list and all puts go to the B list
|
//If active == 0 then all gets come from the A list and all puts go to the B list
|
||||||
@@ -229,7 +229,7 @@ public class PlayerBonuses {
|
|||||||
|
|
||||||
//Update seeInvis if needed
|
//Update seeInvis if needed
|
||||||
|
|
||||||
float seeInvis = this.getFloat(ModType.SeeInvisible, EffectSourceType.None);
|
float seeInvis = this.getFloat(ModType.SeeInvisible, SourceType.None);
|
||||||
if (pc.getSeeInvis() < seeInvis)
|
if (pc.getSeeInvis() < seeInvis)
|
||||||
pc.setSeeInvis((short) seeInvis);
|
pc.setSeeInvis((short) seeInvis);
|
||||||
|
|
||||||
@@ -254,7 +254,7 @@ public class PlayerBonuses {
|
|||||||
this.bonusStrings.remove(mod);
|
this.bonusStrings.remove(mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setList(ModType mod, HashSet<EffectSourceType> val) {
|
public void setList(ModType mod, HashSet<SourceType> val) {
|
||||||
if (!val.equals(null))
|
if (!val.equals(null))
|
||||||
this.bonusLists.put(mod, val);
|
this.bonusLists.put(mod, val);
|
||||||
else
|
else
|
||||||
@@ -281,7 +281,7 @@ public class PlayerBonuses {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean getBool(ModType modType, EffectSourceType sourceType) {
|
public boolean getBool(ModType modType, SourceType sourceType) {
|
||||||
|
|
||||||
if (this.bonusBools.containsKey(modType) == false)
|
if (this.bonusBools.containsKey(modType) == false)
|
||||||
return false;
|
return false;
|
||||||
@@ -293,7 +293,7 @@ public class PlayerBonuses {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getSkillBonus(EffectSourceType sourceType) {
|
public float getSkillBonus(SourceType sourceType) {
|
||||||
|
|
||||||
if (this.skillBonuses.containsKey(sourceType) == false)
|
if (this.skillBonuses.containsKey(sourceType) == false)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -301,7 +301,7 @@ public class PlayerBonuses {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public float getFloat(ModType modType, EffectSourceType sourceType) {
|
public float getFloat(ModType modType, SourceType sourceType) {
|
||||||
float amount = 0;
|
float amount = 0;
|
||||||
for (AbstractEffectModifier mod : this.bonusFloats.keySet()) {
|
for (AbstractEffectModifier mod : this.bonusFloats.keySet()) {
|
||||||
if (mod.getPercentMod() != 0)
|
if (mod.getPercentMod() != 0)
|
||||||
@@ -317,7 +317,7 @@ public class PlayerBonuses {
|
|||||||
return amount;
|
return amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getFloatPercentPositive(ModType modType, EffectSourceType sourceType) {
|
public float getFloatPercentPositive(ModType modType, SourceType sourceType) {
|
||||||
float amount = 0;
|
float amount = 0;
|
||||||
for (AbstractEffectModifier mod : this.bonusFloats.keySet()) {
|
for (AbstractEffectModifier mod : this.bonusFloats.keySet()) {
|
||||||
|
|
||||||
@@ -340,7 +340,7 @@ public class PlayerBonuses {
|
|||||||
return amount;
|
return amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getFloatPercentAll(ModType modType, EffectSourceType sourceType) {
|
public float getFloatPercentAll(ModType modType, SourceType sourceType) {
|
||||||
float amount = 0;
|
float amount = 0;
|
||||||
for (AbstractEffectModifier mod : this.bonusFloats.keySet()) {
|
for (AbstractEffectModifier mod : this.bonusFloats.keySet()) {
|
||||||
|
|
||||||
@@ -365,7 +365,7 @@ public class PlayerBonuses {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public float getFloatPercentNullZero(ModType modType, EffectSourceType sourceType) {
|
public float getFloatPercentNullZero(ModType modType, SourceType sourceType) {
|
||||||
float amount = 0;
|
float amount = 0;
|
||||||
for (AbstractEffectModifier mod : this.bonusFloats.keySet()) {
|
for (AbstractEffectModifier mod : this.bonusFloats.keySet()) {
|
||||||
|
|
||||||
@@ -382,7 +382,7 @@ public class PlayerBonuses {
|
|||||||
return amount;
|
return amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getFloatPercentNegative(ModType modType, EffectSourceType sourceType) {
|
public float getFloatPercentNegative(ModType modType, SourceType sourceType) {
|
||||||
float amount = 0;
|
float amount = 0;
|
||||||
for (AbstractEffectModifier mod : this.bonusFloats.keySet()) {
|
for (AbstractEffectModifier mod : this.bonusFloats.keySet()) {
|
||||||
|
|
||||||
@@ -404,7 +404,7 @@ public class PlayerBonuses {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public HashSet<EffectSourceType> getList(ModType modType) {
|
public HashSet<SourceType> getList(ModType modType) {
|
||||||
if (this.bonusLists.containsKey(modType))
|
if (this.bonusLists.containsKey(modType))
|
||||||
return this.bonusLists.get(modType);
|
return this.bonusLists.get(modType);
|
||||||
else
|
else
|
||||||
@@ -442,7 +442,7 @@ public class PlayerBonuses {
|
|||||||
|
|
||||||
|
|
||||||
for (ModType modType : this.bonusBools.keySet()) {
|
for (ModType modType : this.bonusBools.keySet()) {
|
||||||
for (EffectSourceType sourceType : this.bonusBools.get(modType).keySet()) {
|
for (SourceType sourceType : this.bonusBools.get(modType).keySet()) {
|
||||||
ChatManager.chatSystemInfo(pc, modType.name() + "-" + sourceType.name() + " = " + this.bonusBools.get(modType).get(sourceType));
|
ChatManager.chatSystemInfo(pc, modType.name() + "-" + sourceType.name() + " = " + this.bonusBools.get(modType).get(sourceType));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -452,19 +452,19 @@ public class PlayerBonuses {
|
|||||||
if (modType.equals(ModType.StaminaRecoverRate) || modType.equals(ModType.HealthRecoverRate) || modType.equals(ModType.ManaRecoverRate))
|
if (modType.equals(ModType.StaminaRecoverRate) || modType.equals(ModType.HealthRecoverRate) || modType.equals(ModType.ManaRecoverRate))
|
||||||
ChatManager.chatSystemInfo(pc, modType.name() + " = " + this.getRegen(modType));
|
ChatManager.chatSystemInfo(pc, modType.name() + " = " + this.getRegen(modType));
|
||||||
else
|
else
|
||||||
for (EffectSourceType sourceType : EffectSourceType.values()) {
|
for (SourceType sourceType : SourceType.values()) {
|
||||||
float amount = this.getFloat(modType, sourceType);
|
float amount = this.getFloat(modType, sourceType);
|
||||||
float percentAmount = this.getFloatPercentPositive(modType, sourceType);
|
float percentAmount = this.getFloatPercentPositive(modType, sourceType);
|
||||||
float percentAmountNegative = this.getFloatPercentNegative(modType, sourceType);
|
float percentAmountNegative = this.getFloatPercentNegative(modType, sourceType);
|
||||||
|
|
||||||
if (amount != 0)
|
if (amount != 0)
|
||||||
ChatManager.chatSystemInfo(pc, modType.name() + "-" + (sourceType.equals(EffectSourceType.None) == false ? sourceType.name() : "") + " = " + amount);
|
ChatManager.chatSystemInfo(pc, modType.name() + "-" + (sourceType.equals(SourceType.None) == false ? sourceType.name() : "") + " = " + amount);
|
||||||
|
|
||||||
if (percentAmount != 0)
|
if (percentAmount != 0)
|
||||||
ChatManager.chatSystemInfo(pc, "Percent : " + modType.name() + "-" + (sourceType.equals(EffectSourceType.None) == false ? sourceType.name() : "") + " = " + percentAmount);
|
ChatManager.chatSystemInfo(pc, "Percent : " + modType.name() + "-" + (sourceType.equals(SourceType.None) == false ? sourceType.name() : "") + " = " + percentAmount);
|
||||||
|
|
||||||
if (percentAmountNegative != 0)
|
if (percentAmountNegative != 0)
|
||||||
ChatManager.chatSystemInfo(pc, "Negative Percent : " + modType.name() + "-" + (sourceType.equals(EffectSourceType.None) == false ? sourceType.name() : "") + " = " + percentAmountNegative);
|
ChatManager.chatSystemInfo(pc, "Negative Percent : " + modType.name() + "-" + (sourceType.equals(SourceType.None) == false ? sourceType.name() : "") + " = " + percentAmountNegative);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -472,11 +472,11 @@ public class PlayerBonuses {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setBool(ModType modType, EffectSourceType sourceType, boolean val) {
|
public void setBool(ModType modType, SourceType sourceType, boolean val) {
|
||||||
if (val == true) {
|
if (val == true) {
|
||||||
|
|
||||||
if (this.bonusBools.get(modType) == null) {
|
if (this.bonusBools.get(modType) == null) {
|
||||||
HashMap<EffectSourceType, Boolean> sourceMap = new HashMap<>();
|
HashMap<SourceType, Boolean> sourceMap = new HashMap<>();
|
||||||
this.bonusBools.put(modType, sourceMap);
|
this.bonusBools.put(modType, sourceMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3093,7 +3093,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
|
|
||||||
if (this.bonuses != null)
|
if (this.bonuses != null)
|
||||||
// get rune and effect bonuses
|
// get rune and effect bonuses
|
||||||
bonus += this.bonuses.getFloatPercentNullZero(ModType.Speed, EffectSourceType.None);
|
bonus += this.bonuses.getFloatPercentNullZero(ModType.Speed, SourceType.None);
|
||||||
|
|
||||||
// TODO get equip bonus
|
// TODO get equip bonus
|
||||||
this.update();
|
this.update();
|
||||||
@@ -3597,8 +3597,8 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
//calculateModifiedStats();
|
//calculateModifiedStats();
|
||||||
//update hide and seeInvis levels
|
//update hide and seeInvis levels
|
||||||
if (this.bonuses != null) {
|
if (this.bonuses != null) {
|
||||||
this.hidden = (int) bonuses.getFloat(ModType.Invisible, EffectSourceType.None);
|
this.hidden = (int) bonuses.getFloat(ModType.Invisible, SourceType.None);
|
||||||
this.seeInvis = (int) bonuses.getFloat(ModType.SeeInvisible, EffectSourceType.None);
|
this.seeInvis = (int) bonuses.getFloat(ModType.SeeInvisible, SourceType.None);
|
||||||
} else {
|
} else {
|
||||||
this.hidden = (byte) 0;
|
this.hidden = (byte) 0;
|
||||||
this.seeInvis = (byte) 0;
|
this.seeInvis = (byte) 0;
|
||||||
@@ -3666,21 +3666,21 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
// TODO modify for equipment
|
// TODO modify for equipment
|
||||||
if (this.bonuses != null) {
|
if (this.bonuses != null) {
|
||||||
// modify for effects
|
// modify for effects
|
||||||
strVal += Math.round(this.bonuses.getFloat(ModType.Attr, EffectSourceType.Strength));
|
strVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.Strength));
|
||||||
dexVal += Math.round(this.bonuses.getFloat(ModType.Attr, EffectSourceType.Dexterity));
|
dexVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.Dexterity));
|
||||||
conVal += Math.round(this.bonuses.getFloat(ModType.Attr, EffectSourceType.Constitution));
|
conVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.Constitution));
|
||||||
intVal += Math.round(this.bonuses.getFloat(ModType.Attr, EffectSourceType.Intelligence));
|
intVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.Intelligence));
|
||||||
spiVal += Math.round(this.bonuses.getFloat(ModType.Attr, EffectSourceType.Spirit));
|
spiVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.Spirit));
|
||||||
|
|
||||||
// apply dex penalty for armor
|
// apply dex penalty for armor
|
||||||
dexVal *= this.dexPenalty;
|
dexVal *= this.dexPenalty;
|
||||||
|
|
||||||
// modify percent amounts. DO THIS LAST!
|
// modify percent amounts. DO THIS LAST!
|
||||||
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.Strength));
|
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Strength));
|
||||||
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.Dexterity));
|
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Dexterity));
|
||||||
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.Constitution));
|
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Constitution));
|
||||||
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.Intelligence));
|
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Intelligence));
|
||||||
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.Spirit));
|
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Spirit));
|
||||||
|
|
||||||
} else
|
} else
|
||||||
// apply dex penalty for armor
|
// apply dex penalty for armor
|
||||||
@@ -3776,24 +3776,24 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
wbOff = off.template;
|
wbOff = off.template;
|
||||||
|
|
||||||
//set block if block found
|
//set block if block found
|
||||||
this.bonuses.setBool(ModType.Block, EffectSourceType.None, false);
|
this.bonuses.setBool(ModType.Block, SourceType.None, false);
|
||||||
if (this.baseClass != null && (this.baseClass.getObjectUUID() == 2500 || this.baseClass.getObjectUUID() == 2501))
|
if (this.baseClass != null && (this.baseClass.getObjectUUID() == 2500 || this.baseClass.getObjectUUID() == 2501))
|
||||||
if (off != null && off.template != null && ItemManager.isShield(off))
|
if (off != null && off.template != null && ItemManager.isShield(off))
|
||||||
this.bonuses.setBool(ModType.Block, EffectSourceType.None, true);
|
this.bonuses.setBool(ModType.Block, SourceType.None, true);
|
||||||
|
|
||||||
//set dodge if rogue
|
//set dodge if rogue
|
||||||
if (this.baseClass != null && this.baseClass.getObjectUUID() == 2502)
|
if (this.baseClass != null && this.baseClass.getObjectUUID() == 2502)
|
||||||
this.bonuses.setBool(ModType.Dodge, EffectSourceType.None, true);
|
this.bonuses.setBool(ModType.Dodge, SourceType.None, true);
|
||||||
else
|
else
|
||||||
this.bonuses.setBool(ModType.Dodge, EffectSourceType.None, false);
|
this.bonuses.setBool(ModType.Dodge, SourceType.None, false);
|
||||||
|
|
||||||
//set parry if fighter or thief and no invalid weapon found
|
//set parry if fighter or thief and no invalid weapon found
|
||||||
this.bonuses.setBool(ModType.Parry, EffectSourceType.None, false);
|
this.bonuses.setBool(ModType.Parry, SourceType.None, false);
|
||||||
if ((this.baseClass != null && this.baseClass.getObjectUUID() == 2500)
|
if ((this.baseClass != null && this.baseClass.getObjectUUID() == 2500)
|
||||||
|| (this.promotionClass != null && this.promotionClass.getObjectUUID() == 2520))
|
|| (this.promotionClass != null && this.promotionClass.getObjectUUID() == 2520))
|
||||||
if (wbMain == null || wbMain.item_weapon_max_range < MBServerStatics.RANGED_WEAPON_RANGE)
|
if (wbMain == null || wbMain.item_weapon_max_range < MBServerStatics.RANGED_WEAPON_RANGE)
|
||||||
if (wbOff == null || wbOff.item_weapon_max_range < MBServerStatics.RANGED_WEAPON_RANGE)
|
if (wbOff == null || wbOff.item_weapon_max_range < MBServerStatics.RANGED_WEAPON_RANGE)
|
||||||
this.bonuses.setBool(ModType.Parry, EffectSourceType.None, true);
|
this.bonuses.setBool(ModType.Parry, SourceType.None, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3892,13 +3892,13 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
|
|
||||||
|
|
||||||
//apply effects
|
//apply effects
|
||||||
h += this.bonuses.getFloat(ModType.HealthFull, EffectSourceType.None);
|
h += this.bonuses.getFloat(ModType.HealthFull, SourceType.None);
|
||||||
m += this.bonuses.getFloat(ModType.ManaFull, EffectSourceType.None);
|
m += this.bonuses.getFloat(ModType.ManaFull, SourceType.None);
|
||||||
s += this.bonuses.getFloat(ModType.StaminaFull, EffectSourceType.None);
|
s += this.bonuses.getFloat(ModType.StaminaFull, SourceType.None);
|
||||||
|
|
||||||
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, EffectSourceType.None));
|
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.None));
|
||||||
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, EffectSourceType.None));
|
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.None));
|
||||||
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, EffectSourceType.None));
|
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.None));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3933,11 +3933,11 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
ModType modType = ModType.GetModType(type);
|
ModType modType = ModType.GetModType(type);
|
||||||
|
|
||||||
// must be allowed to use this passive
|
// must be allowed to use this passive
|
||||||
if (!this.bonuses.getBool(modType, EffectSourceType.None))
|
if (!this.bonuses.getBool(modType, SourceType.None))
|
||||||
return 0f;
|
return 0f;
|
||||||
|
|
||||||
// must not be stunned
|
// must not be stunned
|
||||||
if (this.bonuses.getBool(ModType.Stunned, EffectSourceType.None))
|
if (this.bonuses.getBool(ModType.Stunned, SourceType.None))
|
||||||
return 0f;
|
return 0f;
|
||||||
|
|
||||||
// Get base skill amount
|
// Get base skill amount
|
||||||
@@ -3949,7 +3949,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
amount = sk.getModifiedAmount();
|
amount = sk.getModifiedAmount();
|
||||||
|
|
||||||
// Add bonuses
|
// Add bonuses
|
||||||
amount += this.bonuses.getFloat(modType, EffectSourceType.None);
|
amount += this.bonuses.getFloat(modType, SourceType.None);
|
||||||
|
|
||||||
// Add item bonuses and return
|
// Add item bonuses and return
|
||||||
if (type.equals(ModType.Dodge) && !fromCombat)
|
if (type.equals(ModType.Dodge) && !fromCombat)
|
||||||
@@ -4383,7 +4383,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
|
|
||||||
Vector3fImmutable newLoc = this.getMovementLoc();
|
Vector3fImmutable newLoc = this.getMovementLoc();
|
||||||
|
|
||||||
if (this.isAlive() == false || this.getBonuses().getBool(ModType.Stunned, EffectSourceType.None) || this.getBonuses().getBool(ModType.CannotMove, EffectSourceType.None)) {
|
if (this.isAlive() == false || this.getBonuses().getBool(ModType.Stunned, 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(newLoc);
|
this.stopMovement(newLoc);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ package engine.objects;
|
|||||||
import engine.gameManager.ChatManager;
|
import engine.gameManager.ChatManager;
|
||||||
import engine.gameManager.DbManager;
|
import engine.gameManager.DbManager;
|
||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.mbEnums.EffectSourceType;
|
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
|
import engine.mbEnums.SourceType;
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ public class Resists {
|
|||||||
PlayerBonuses bonus = target.getBonuses();
|
PlayerBonuses bonus = target.getBonuses();
|
||||||
|
|
||||||
//see if there is a fortitude
|
//see if there is a fortitude
|
||||||
float damageCap = bonus.getFloatPercentAll(ModType.DamageCap, EffectSourceType.None);
|
float damageCap = bonus.getFloatPercentAll(ModType.DamageCap, SourceType.None);
|
||||||
if (damageCap == 0f || type == mbEnums.DamageType.HEALING)
|
if (damageCap == 0f || type == mbEnums.DamageType.HEALING)
|
||||||
return damage;
|
return damage;
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ public class Resists {
|
|||||||
|
|
||||||
//let's see if valid damagetype to apply it
|
//let's see if valid damagetype to apply it
|
||||||
boolean exclusive;
|
boolean exclusive;
|
||||||
HashSet<EffectSourceType> forts = bonus.getList(ModType.IgnoreDamageCap);
|
HashSet<SourceType> forts = bonus.getList(ModType.IgnoreDamageCap);
|
||||||
if (forts == null) {
|
if (forts == null) {
|
||||||
exclusive = true;
|
exclusive = true;
|
||||||
forts = bonus.getList(ModType.ExclusiveDamageCap);
|
forts = bonus.getList(ModType.ExclusiveDamageCap);
|
||||||
@@ -126,15 +126,15 @@ public class Resists {
|
|||||||
if (forts == null || !isValidDamageCapType(forts, type, exclusive))
|
if (forts == null || !isValidDamageCapType(forts, type, exclusive))
|
||||||
return damage;
|
return damage;
|
||||||
|
|
||||||
float adjustedDamage = bonus.getFloatPercentAll(ModType.AdjustAboveDmgCap, EffectSourceType.None);
|
float adjustedDamage = bonus.getFloatPercentAll(ModType.AdjustAboveDmgCap, SourceType.None);
|
||||||
//Adjust damage down and return new amount
|
//Adjust damage down and return new amount
|
||||||
float aadc = 1 + adjustedDamage;
|
float aadc = 1 + adjustedDamage;
|
||||||
return capFire * aadc;
|
return capFire * aadc;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Test if Damagetype is valid for foritude
|
//Test if Damagetype is valid for foritude
|
||||||
private static boolean isValidDamageCapType(HashSet<EffectSourceType> forts, mbEnums.DamageType damageType, boolean exclusive) {
|
private static boolean isValidDamageCapType(HashSet<SourceType> forts, mbEnums.DamageType damageType, boolean exclusive) {
|
||||||
for (EffectSourceType fort : forts) {
|
for (SourceType fort : forts) {
|
||||||
mbEnums.DamageType dt = mbEnums.DamageType.getDamageType(fort.name());
|
mbEnums.DamageType dt = mbEnums.DamageType.getDamageType(fort.name());
|
||||||
|
|
||||||
if (dt.equals(mbEnums.DamageType.NONE))
|
if (dt.equals(mbEnums.DamageType.NONE))
|
||||||
@@ -327,7 +327,7 @@ public class Resists {
|
|||||||
damage = handleFortitude(target, type, damage);
|
damage = handleFortitude(target, type, damage);
|
||||||
|
|
||||||
//calculate armor piercing
|
//calculate armor piercing
|
||||||
float ap = source.getBonuses().getFloatPercentAll(ModType.ArmorPiercing, EffectSourceType.None);
|
float ap = source.getBonuses().getFloatPercentAll(ModType.ArmorPiercing, SourceType.None);
|
||||||
float damageAfterResists = damage * (1 - (this.getResist(type, trains) * 0.01f) + ap);
|
float damageAfterResists = damage * (1 - (this.getResist(type, trains) * 0.01f) + ap);
|
||||||
|
|
||||||
//check to see if any damage absorbers should cancel
|
//check to see if any damage absorbers should cancel
|
||||||
@@ -346,41 +346,41 @@ public class Resists {
|
|||||||
|
|
||||||
if (rb != null) {
|
if (rb != null) {
|
||||||
// Handle immunities
|
// Handle immunities
|
||||||
if (rb.getBool(ModType.ImmuneTo, EffectSourceType.Stun))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Stun))
|
||||||
this.immuneTo.put(mbEnums.DamageType.STUN, true);
|
this.immuneTo.put(mbEnums.DamageType.STUN, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, EffectSourceType.Blind))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Blind))
|
||||||
this.immuneTo.put(mbEnums.DamageType.BLINDNESS, true);
|
this.immuneTo.put(mbEnums.DamageType.BLINDNESS, true);
|
||||||
if (rb.getBool(ModType.ImmuneToAttack, EffectSourceType.None))
|
if (rb.getBool(ModType.ImmuneToAttack, SourceType.None))
|
||||||
this.immuneTo.put(mbEnums.DamageType.ATTACK, true);
|
this.immuneTo.put(mbEnums.DamageType.ATTACK, true);
|
||||||
if (rb.getBool(ModType.ImmuneToPowers, EffectSourceType.None))
|
if (rb.getBool(ModType.ImmuneToPowers, SourceType.None))
|
||||||
this.immuneTo.put(mbEnums.DamageType.POWERS, true);
|
this.immuneTo.put(mbEnums.DamageType.POWERS, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, EffectSourceType.Powerblock))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Powerblock))
|
||||||
this.immuneTo.put(mbEnums.DamageType.POWERINHIBITOR, true);
|
this.immuneTo.put(mbEnums.DamageType.POWERINHIBITOR, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, EffectSourceType.DeBuff))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.DeBuff))
|
||||||
this.immuneTo.put(mbEnums.DamageType.DEBUFF, true);
|
this.immuneTo.put(mbEnums.DamageType.DEBUFF, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, EffectSourceType.Fear))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Fear))
|
||||||
this.immuneTo.put(mbEnums.DamageType.FEAR, true);
|
this.immuneTo.put(mbEnums.DamageType.FEAR, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, EffectSourceType.Charm))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Charm))
|
||||||
this.immuneTo.put(mbEnums.DamageType.CHARM, true);
|
this.immuneTo.put(mbEnums.DamageType.CHARM, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, EffectSourceType.Root))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Root))
|
||||||
this.immuneTo.put(mbEnums.DamageType.ROOT, true);
|
this.immuneTo.put(mbEnums.DamageType.ROOT, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, EffectSourceType.Snare))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Snare))
|
||||||
this.immuneTo.put(mbEnums.DamageType.SNARE, true);
|
this.immuneTo.put(mbEnums.DamageType.SNARE, true);
|
||||||
|
|
||||||
// Handle resists
|
// Handle resists
|
||||||
slash += rb.getFloat(ModType.Resistance, EffectSourceType.Slashing);
|
slash += rb.getFloat(ModType.Resistance, SourceType.Slashing);
|
||||||
crush += rb.getFloat(ModType.Resistance, EffectSourceType.Crushing);
|
crush += rb.getFloat(ModType.Resistance, SourceType.Crushing);
|
||||||
pierce += rb.getFloat(ModType.Resistance, EffectSourceType.Piercing);
|
pierce += rb.getFloat(ModType.Resistance, SourceType.Piercing);
|
||||||
magic += rb.getFloat(ModType.Resistance, EffectSourceType.Magic);
|
magic += rb.getFloat(ModType.Resistance, SourceType.Magic);
|
||||||
bleed += rb.getFloat(ModType.Resistance, EffectSourceType.Bleeding);
|
bleed += rb.getFloat(ModType.Resistance, SourceType.Bleeding);
|
||||||
poison += rb.getFloat(ModType.Resistance, EffectSourceType.Poison);
|
poison += rb.getFloat(ModType.Resistance, SourceType.Poison);
|
||||||
mental += rb.getFloat(ModType.Resistance, EffectSourceType.Mental);
|
mental += rb.getFloat(ModType.Resistance, SourceType.Mental);
|
||||||
holy += rb.getFloat(ModType.Resistance, EffectSourceType.Holy);
|
holy += rb.getFloat(ModType.Resistance, SourceType.Holy);
|
||||||
unholy += rb.getFloat(ModType.Resistance, EffectSourceType.Unholy);
|
unholy += rb.getFloat(ModType.Resistance, SourceType.Unholy);
|
||||||
lightning += rb.getFloat(ModType.Resistance, EffectSourceType.Lightning);
|
lightning += rb.getFloat(ModType.Resistance, SourceType.Lightning);
|
||||||
fire += rb.getFloat(ModType.Resistance, EffectSourceType.Fire);
|
fire += rb.getFloat(ModType.Resistance, SourceType.Fire);
|
||||||
cold += rb.getFloat(ModType.Resistance, EffectSourceType.Cold);
|
cold += rb.getFloat(ModType.Resistance, SourceType.Cold);
|
||||||
healing += rb.getFloat(ModType.Resistance, EffectSourceType.Heal); // DamageType.Healing.name());
|
healing += rb.getFloat(ModType.Resistance, SourceType.Healing); // DamageType.Healing.name());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
package engine.objects;
|
package engine.objects;
|
||||||
|
|
||||||
import engine.gameManager.DbManager;
|
import engine.gameManager.DbManager;
|
||||||
import engine.mbEnums.EffectSourceType;
|
import engine.mbEnums.SourceType;
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@@ -33,7 +33,7 @@ public class SkillsBase extends AbstractGameObject {
|
|||||||
private final short conMod;
|
private final short conMod;
|
||||||
private final short intMod;
|
private final short intMod;
|
||||||
private final short spiMod;
|
private final short spiMod;
|
||||||
public EffectSourceType sourceType;
|
public SourceType sourceType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* No Table ID Constructor
|
* No Table ID Constructor
|
||||||
@@ -43,7 +43,7 @@ public class SkillsBase extends AbstractGameObject {
|
|||||||
super();
|
super();
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.nameNoSpace = name.replace(" ", "");
|
this.nameNoSpace = name.replace(" ", "");
|
||||||
this.sourceType = EffectSourceType.getEffectSourceType(this.nameNoSpace.replace(",", ""));
|
this.sourceType = SourceType.GetSourceType(this.nameNoSpace.replace(",", ""));
|
||||||
this.description = description;
|
this.description = description;
|
||||||
this.token = token;
|
this.token = token;
|
||||||
this.strMod = strMod;
|
this.strMod = strMod;
|
||||||
@@ -79,7 +79,7 @@ public class SkillsBase extends AbstractGameObject {
|
|||||||
this.name = rs.getString("name");
|
this.name = rs.getString("name");
|
||||||
this.nameNoSpace = name.replace(" ", "");
|
this.nameNoSpace = name.replace(" ", "");
|
||||||
this.description = rs.getString("description");
|
this.description = rs.getString("description");
|
||||||
this.sourceType = EffectSourceType.getEffectSourceType(this.nameNoSpace.replace("-", "").replace("\"", "").replace(",", ""));
|
this.sourceType = SourceType.GetSourceType(this.nameNoSpace.replace("-", "").replace("\"", "").replace(",", ""));
|
||||||
this.token = rs.getInt("token");
|
this.token = rs.getInt("token");
|
||||||
this.strMod = rs.getShort("strMod");
|
this.strMod = rs.getShort("strMod");
|
||||||
this.dexMod = rs.getShort("dexMod");
|
this.dexMod = rs.getShort("dexMod");
|
||||||
|
|||||||
@@ -12,13 +12,10 @@ package engine.powers;
|
|||||||
import engine.gameManager.DbManager;
|
import engine.gameManager.DbManager;
|
||||||
import engine.gameManager.PowersManager;
|
import engine.gameManager.PowersManager;
|
||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.mbEnums.EffectSourceType;
|
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
|
import engine.mbEnums.SourceType;
|
||||||
import engine.mbEnums.StackType;
|
import engine.mbEnums.StackType;
|
||||||
import engine.objects.AbstractCharacter;
|
import engine.objects.*;
|
||||||
import engine.objects.AbstractWorldObject;
|
|
||||||
import engine.objects.PlayerBonuses;
|
|
||||||
import engine.objects.Runegate;
|
|
||||||
import engine.powers.poweractions.AbstractPowerAction;
|
import engine.powers.poweractions.AbstractPowerAction;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
@@ -252,10 +249,10 @@ public class ActionsBase {
|
|||||||
PlayerBonuses bonus = pcTarget.getBonuses();
|
PlayerBonuses bonus = pcTarget.getBonuses();
|
||||||
|
|
||||||
if(vampDrain)
|
if(vampDrain)
|
||||||
return bonus.getBool(ModType.BlockedPowerType, EffectSourceType.VAMPDRAIN);
|
return bonus.getBool(ModType.BlockedPowerType, SourceType.VAMPDRAIN);
|
||||||
|
|
||||||
if ((this.stackType.equals("Flight") && bonus.getBool(ModType.NoMod, EffectSourceType.Fly)) ||
|
if ((this.stackType.equals("Flight") && bonus.getBool(ModType.NoMod, SourceType.Fly)) ||
|
||||||
(this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, EffectSourceType.None))) {
|
(this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, SourceType.None))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
package engine.powers.effectmodifiers;
|
package engine.powers.effectmodifiers;
|
||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.mbEnums.EffectSourceType;
|
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
|
import engine.mbEnums.SourceType;
|
||||||
import engine.objects.AbstractCharacter;
|
import engine.objects.AbstractCharacter;
|
||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
@@ -25,7 +25,7 @@ import java.sql.SQLException;
|
|||||||
public abstract class AbstractEffectModifier {
|
public abstract class AbstractEffectModifier {
|
||||||
|
|
||||||
public float minMod;
|
public float minMod;
|
||||||
public EffectSourceType sourceType;
|
public SourceType sourceType;
|
||||||
public ModType modType;
|
public ModType modType;
|
||||||
protected EffectsBase parent;
|
protected EffectsBase parent;
|
||||||
protected int UUID;
|
protected int UUID;
|
||||||
@@ -46,7 +46,7 @@ public abstract class AbstractEffectModifier {
|
|||||||
this.effectType = rs.getString("modType");
|
this.effectType = rs.getString("modType");
|
||||||
this.modType = ModType.GetModType(this.effectType);
|
this.modType = ModType.GetModType(this.effectType);
|
||||||
this.type = rs.getString("type").replace("\"", "");
|
this.type = rs.getString("type").replace("\"", "");
|
||||||
this.sourceType = EffectSourceType.getEffectSourceType(this.type.replace(" ", "").replace("-", ""));
|
this.sourceType = SourceType.GetSourceType(this.type.replace(" ", "").replace("-", ""));
|
||||||
this.minMod = rs.getFloat("minMod");
|
this.minMod = rs.getFloat("minMod");
|
||||||
this.maxMod = rs.getFloat("maxMod");
|
this.maxMod = rs.getFloat("maxMod");
|
||||||
this.percentMod = rs.getFloat("percentMod");
|
this.percentMod = rs.getFloat("percentMod");
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
package engine.powers.effectmodifiers;
|
package engine.powers.effectmodifiers;
|
||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.mbEnums.EffectSourceType;
|
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
|
import engine.mbEnums.SourceType;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@@ -32,7 +32,7 @@ public class AmbidexterityEffectModifier extends AbstractEffectModifier {
|
|||||||
@Override
|
@Override
|
||||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||||
PlayerBonuses bonus = ac.getBonuses();
|
PlayerBonuses bonus = ac.getBonuses();
|
||||||
bonus.setBool(ModType.Ambidexterity, EffectSourceType.None, true);
|
bonus.setBool(ModType.Ambidexterity, SourceType.None, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
package engine.powers.effectmodifiers;
|
package engine.powers.effectmodifiers;
|
||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.mbEnums.EffectSourceType;
|
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
|
import engine.mbEnums.SourceType;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ public class BlackMantleEffectModifier extends AbstractEffectModifier {
|
|||||||
@Override
|
@Override
|
||||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||||
PlayerBonuses bonus = ac.getBonuses();
|
PlayerBonuses bonus = ac.getBonuses();
|
||||||
EffectSourceType sourceType = EffectSourceType.valueOf(this.type);
|
SourceType sourceType = SourceType.valueOf(this.type);
|
||||||
|
|
||||||
if (sourceType == null) {
|
if (sourceType == null) {
|
||||||
Logger.error("Bad Source Type for " + this.type);
|
Logger.error("Bad Source Type for " + this.type);
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class BlockedPowerTypeEffectModifier extends AbstractEffectModifier {
|
|||||||
ModType toBlock = ModType.None;
|
ModType toBlock = ModType.None;
|
||||||
|
|
||||||
switch (this.sourceType) {
|
switch (this.sourceType) {
|
||||||
case Invisibility:
|
case Invisible:
|
||||||
toBlock = ModType.Invisible;
|
toBlock = ModType.Invisible;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ import engine.gameManager.DispatchManager;
|
|||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.jobs.DamageOverTimeJob;
|
import engine.jobs.DamageOverTimeJob;
|
||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.mbEnums.EffectSourceType;
|
|
||||||
import engine.mbEnums.GameObjectType;
|
import engine.mbEnums.GameObjectType;
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
|
import engine.mbEnums.SourceType;
|
||||||
import engine.net.AbstractNetMsg;
|
import engine.net.AbstractNetMsg;
|
||||||
import engine.net.client.msg.ModifyHealthKillMsg;
|
import engine.net.client.msg.ModifyHealthKillMsg;
|
||||||
import engine.net.client.msg.ModifyHealthMsg;
|
import engine.net.client.msg.ModifyHealthMsg;
|
||||||
@@ -154,7 +154,7 @@ public class HealthEffectModifier extends AbstractEffectModifier {
|
|||||||
|
|
||||||
// Apply any power effect modifiers (such as stances)
|
// Apply any power effect modifiers (such as stances)
|
||||||
if (bonus != null)
|
if (bonus != null)
|
||||||
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, EffectSourceType.None)));
|
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None)));
|
||||||
}
|
}
|
||||||
if (modAmount == 0f)
|
if (modAmount == 0f)
|
||||||
return;
|
return;
|
||||||
@@ -193,7 +193,7 @@ public class HealthEffectModifier extends AbstractEffectModifier {
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
PlayerBonuses bonus = ac.getBonuses();
|
PlayerBonuses bonus = ac.getBonuses();
|
||||||
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, EffectSourceType.Heal) >= trains) {
|
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) {
|
||||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
||||||
mhm.setUnknown03(5); //set target is immune
|
mhm.setUnknown03(5); //set target is immune
|
||||||
DispatchManager.sendToAllInRange(ac, mhm);
|
DispatchManager.sendToAllInRange(ac, mhm);
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import engine.gameManager.DispatchManager;
|
|||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.jobs.DamageOverTimeJob;
|
import engine.jobs.DamageOverTimeJob;
|
||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.mbEnums.EffectSourceType;
|
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
|
import engine.mbEnums.SourceType;
|
||||||
import engine.net.client.msg.ModifyHealthMsg;
|
import engine.net.client.msg.ModifyHealthMsg;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.powers.ActionsBase;
|
import engine.powers.ActionsBase;
|
||||||
@@ -114,7 +114,7 @@ public class ManaEffectModifier extends AbstractEffectModifier {
|
|||||||
|
|
||||||
// Apply any power effect modifiers (such as stances)
|
// Apply any power effect modifiers (such as stances)
|
||||||
if (bonus != null)
|
if (bonus != null)
|
||||||
modAmount *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, EffectSourceType.None));
|
modAmount *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None));
|
||||||
}
|
}
|
||||||
if (modAmount == 0f)
|
if (modAmount == 0f)
|
||||||
return;
|
return;
|
||||||
@@ -142,7 +142,7 @@ public class ManaEffectModifier extends AbstractEffectModifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
PlayerBonuses bonus = ac.getBonuses();
|
PlayerBonuses bonus = ac.getBonuses();
|
||||||
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, EffectSourceType.Heal) >= trains) {
|
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) {
|
||||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
||||||
mhm.setUnknown03(5); //set target is immune
|
mhm.setUnknown03(5); //set target is immune
|
||||||
DispatchManager.sendToAllInRange(ac, mhm);
|
DispatchManager.sendToAllInRange(ac, mhm);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class NoModEffectModifier extends AbstractEffectModifier {
|
|||||||
bonus.setBool(this.modType, this.sourceType, true);
|
bonus.setBool(this.modType, this.sourceType, true);
|
||||||
|
|
||||||
switch (this.sourceType) {
|
switch (this.sourceType) {
|
||||||
case Flight:
|
case Fly:
|
||||||
if (!ac.getObjectType().equals(GameObjectType.PlayerCharacter))
|
if (!ac.getObjectType().equals(GameObjectType.PlayerCharacter))
|
||||||
return;
|
return;
|
||||||
PlayerCharacter flyer = (PlayerCharacter) ac;
|
PlayerCharacter flyer = (PlayerCharacter) ac;
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import engine.gameManager.DispatchManager;
|
|||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.jobs.DamageOverTimeJob;
|
import engine.jobs.DamageOverTimeJob;
|
||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.mbEnums.EffectSourceType;
|
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
|
import engine.mbEnums.SourceType;
|
||||||
import engine.net.client.msg.ModifyHealthMsg;
|
import engine.net.client.msg.ModifyHealthMsg;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.powers.ActionsBase;
|
import engine.powers.ActionsBase;
|
||||||
@@ -112,7 +112,7 @@ public class StaminaEffectModifier extends AbstractEffectModifier {
|
|||||||
|
|
||||||
// Apply any power effect modifiers (such as stances)
|
// Apply any power effect modifiers (such as stances)
|
||||||
if (bonus != null)
|
if (bonus != null)
|
||||||
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, EffectSourceType.None)));
|
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None)));
|
||||||
}
|
}
|
||||||
if (modAmount == 0f)
|
if (modAmount == 0f)
|
||||||
return;
|
return;
|
||||||
@@ -140,7 +140,7 @@ public class StaminaEffectModifier extends AbstractEffectModifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
PlayerBonuses bonus = ac.getBonuses();
|
PlayerBonuses bonus = ac.getBonuses();
|
||||||
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, EffectSourceType.Heal) >= trains) {
|
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) {
|
||||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
||||||
mhm.setUnknown03(5); //set target is immune
|
mhm.setUnknown03(5); //set target is immune
|
||||||
DispatchManager.sendToAllInRange(ac, mhm);
|
DispatchManager.sendToAllInRange(ac, mhm);
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ import engine.jobs.ChantJob;
|
|||||||
import engine.jobs.DeferredPowerJob;
|
import engine.jobs.DeferredPowerJob;
|
||||||
import engine.jobs.FinishEffectTimeJob;
|
import engine.jobs.FinishEffectTimeJob;
|
||||||
import engine.math.Vector3fImmutable;
|
import engine.math.Vector3fImmutable;
|
||||||
import engine.mbEnums.EffectSourceType;
|
|
||||||
import engine.mbEnums.GameObjectType;
|
import engine.mbEnums.GameObjectType;
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
|
import engine.mbEnums.SourceType;
|
||||||
import engine.net.client.msg.chat.ChatSystemMsg;
|
import engine.net.client.msg.chat.ChatSystemMsg;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.powers.ActionsBase;
|
import engine.powers.ActionsBase;
|
||||||
@@ -180,7 +180,7 @@ public class ApplyEffectPowerAction extends AbstractPowerAction {
|
|||||||
if (bonuses == null)
|
if (bonuses == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
boolean noSilence = bonuses.getBool(ModType.Silenced, EffectSourceType.None);
|
boolean noSilence = bonuses.getBool(ModType.Silenced, SourceType.None);
|
||||||
|
|
||||||
if (noSilence)
|
if (noSilence)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class RemoveEffectPowerAction extends AbstractPowerAction {
|
|||||||
public RemoveEffectPowerAction(ResultSet rs) throws SQLException {
|
public RemoveEffectPowerAction(ResultSet rs) throws SQLException {
|
||||||
super(rs);
|
super(rs);
|
||||||
String effectTypeToRemove = rs.getString("effectSourceToRemove").replace("-", "").trim();
|
String effectTypeToRemove = rs.getString("effectSourceToRemove").replace("-", "").trim();
|
||||||
sourceType = EffectSourceType.getEffectSourceType(effectTypeToRemove);
|
sourceType = EffectSourceType.GetEffectSourceType(effectTypeToRemove);
|
||||||
int flags = rs.getInt("flags");
|
int flags = rs.getInt("flags");
|
||||||
this.removeAll = ((flags & 2) != 0) ? true : false;
|
this.removeAll = ((flags & 2) != 0) ? true : false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ import engine.gameManager.PowersManager;
|
|||||||
import engine.gameManager.ZoneManager;
|
import engine.gameManager.ZoneManager;
|
||||||
import engine.math.Vector3fImmutable;
|
import engine.math.Vector3fImmutable;
|
||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.mbEnums.EffectSourceType;
|
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
|
import engine.mbEnums.SourceType;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.powers.ActionsBase;
|
import engine.powers.ActionsBase;
|
||||||
import engine.powers.PowersBase;
|
import engine.powers.PowersBase;
|
||||||
@@ -66,7 +66,7 @@ public class TeleportPowerAction extends AbstractPowerAction {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source.getBonuses().getBool(ModType.BlockedPowerType, EffectSourceType.TELEPORT))
|
if (source.getBonuses().getBool(ModType.BlockedPowerType, SourceType.TELEPORT))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
City city = ZoneManager.getCityAtLocation(targetLoc);
|
City city = ZoneManager.getCityAtLocation(targetLoc);
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ package engine.powers.poweractions;
|
|||||||
import engine.gameManager.DispatchManager;
|
import engine.gameManager.DispatchManager;
|
||||||
import engine.math.Vector3fImmutable;
|
import engine.math.Vector3fImmutable;
|
||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.mbEnums.EffectSourceType;
|
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
|
import engine.mbEnums.SourceType;
|
||||||
import engine.net.AbstractNetMsg;
|
import engine.net.AbstractNetMsg;
|
||||||
import engine.net.client.msg.ModifyHealthKillMsg;
|
import engine.net.client.msg.ModifyHealthKillMsg;
|
||||||
import engine.net.client.msg.ModifyHealthMsg;
|
import engine.net.client.msg.ModifyHealthMsg;
|
||||||
@@ -210,7 +210,7 @@ public class TransferStatPowerAction extends AbstractPowerAction {
|
|||||||
// Apply any power effect modifiers (such as stances)
|
// Apply any power effect modifiers (such as stances)
|
||||||
PlayerBonuses bonus = source.getBonuses();
|
PlayerBonuses bonus = source.getBonuses();
|
||||||
if (bonus != null)
|
if (bonus != null)
|
||||||
damage *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, EffectSourceType.None));
|
damage *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None));
|
||||||
|
|
||||||
//get amount to transfer
|
//get amount to transfer
|
||||||
fromAmount = damage;
|
fromAmount = damage;
|
||||||
@@ -236,7 +236,7 @@ public class TransferStatPowerAction extends AbstractPowerAction {
|
|||||||
AbstractNetMsg mhmFrom = null;
|
AbstractNetMsg mhmFrom = null;
|
||||||
|
|
||||||
//stop if target is immune to drains
|
//stop if target is immune to drains
|
||||||
if (from.getBonuses().getBool(ModType.ImmuneTo, EffectSourceType.Drain)) {
|
if (from.getBonuses().getBool(ModType.ImmuneTo, SourceType.Drain)) {
|
||||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, to, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
ModifyHealthMsg mhm = new ModifyHealthMsg(source, to, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
||||||
mhm.setUnknown03(5); //set target is immune
|
mhm.setUnknown03(5); //set target is immune
|
||||||
DispatchManager.sendToAllInRange(from, mhm);
|
DispatchManager.sendToAllInRange(from, mhm);
|
||||||
|
|||||||
@@ -95,6 +95,12 @@ public class DestroyCityThread implements Runnable {
|
|||||||
if (cityBuilding == null)
|
if (cityBuilding == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// check null bluepritn and log error
|
||||||
|
if (cityBuilding.getBlueprint() == null){
|
||||||
|
Logger.error("Null Blueprint for building ID: " + cityBuilding.getObjectUUID());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Do nothing with the banestone. It will be removed elsewhere
|
// Do nothing with the banestone. It will be removed elsewhere
|
||||||
|
|
||||||
if (cityBuilding.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.BANESTONE))
|
if (cityBuilding.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.BANESTONE))
|
||||||
|
|||||||
@@ -0,0 +1,285 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2024
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
|
package engine.wpak;
|
||||||
|
|
||||||
|
import engine.gameManager.ConfigManager;
|
||||||
|
import engine.mbEnums;
|
||||||
|
import engine.wpak.data.ConditionEntry;
|
||||||
|
import engine.wpak.data.Effect;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public class EffectsParser {
|
||||||
|
|
||||||
|
public static String effectsPath = ConfigManager.DEFAULT_DATA_DIR + "wpak/Effects.cfg";
|
||||||
|
private static final Pattern EFFECT_REGEX = Pattern.compile("(?<=EFFECTBEGIN)(.+?)(?=EFFECTEND)", Pattern.DOTALL);
|
||||||
|
private static final Pattern SOURCE_REGEX = Pattern.compile("(?<=SOURCEBEGIN)(.+?)(?=SOURCEEND)", Pattern.DOTALL);
|
||||||
|
private static final Pattern MODS_REGEX = Pattern.compile("(?<=MODSBEGIN)(.+?)(?=MODSEND)", Pattern.DOTALL);
|
||||||
|
private static final Pattern CONDITIONS_REGEX = Pattern.compile("(?<=CONDITIONBEGIN)(.+?)(?=CONDITIONEND)", Pattern.DOTALL);
|
||||||
|
private static final Pattern STRSPLIT_REGEX = Pattern.compile("([^\"]\\S*|\"[^\"]*\")\\s*"); // Regex ignores spaces within quotes
|
||||||
|
|
||||||
|
public static void parseWpakFile() {
|
||||||
|
|
||||||
|
// Read .wpak file from disk
|
||||||
|
|
||||||
|
byte[] fileData;
|
||||||
|
|
||||||
|
try {
|
||||||
|
fileData = Files.readAllBytes(Paths.get(effectsPath));
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
String fileContents = new String(fileData);
|
||||||
|
|
||||||
|
// Iterate over effect entries from .wpak data
|
||||||
|
|
||||||
|
Matcher matcher = EFFECT_REGEX.matcher(fileContents);
|
||||||
|
|
||||||
|
while (matcher.find()) {
|
||||||
|
try {
|
||||||
|
Effect effect = parseEffectEntry(matcher.group());
|
||||||
|
// WpakPowerManager._effectsLookup.put(effect.effect_id, effect);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Logger.error("EFFECT PARSE FAILED: " + e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Effect parseEffectEntry(String effectData) {
|
||||||
|
|
||||||
|
Effect effect = new Effect();
|
||||||
|
|
||||||
|
// Parse fields that lie outside the other tags
|
||||||
|
|
||||||
|
effect.isItemEffect = effectData.contains("IsItemEffect");
|
||||||
|
effect.isSpireEffect = effectData.contains("IsSpireEffect");
|
||||||
|
effect.ignoreNoMod = effectData.contains("IgnoreNoMod");
|
||||||
|
effect.dontSave = effectData.contains("DontSave");
|
||||||
|
|
||||||
|
// Remove all lines that contain a # and leading/trailing blank lines
|
||||||
|
|
||||||
|
effectData = effectData.replaceAll("(?m)^(\\s*#.*|\\s*)\r?\n?", "");
|
||||||
|
effectData = effectData.trim();
|
||||||
|
|
||||||
|
// Parse effect entry header
|
||||||
|
|
||||||
|
String firstLine;
|
||||||
|
ArrayList<String> effectHeader = new ArrayList<>();
|
||||||
|
|
||||||
|
// Some effects exist without sources/mods or conditions
|
||||||
|
// (ACID "MOB" 0)
|
||||||
|
|
||||||
|
if (effectData.indexOf('\n') > 0)
|
||||||
|
firstLine = effectData.substring(0, effectData.indexOf('\n'));
|
||||||
|
else
|
||||||
|
firstLine = effectData;
|
||||||
|
|
||||||
|
Matcher matcher = STRSPLIT_REGEX.matcher(firstLine);
|
||||||
|
|
||||||
|
while (matcher.find())
|
||||||
|
effectHeader.add(matcher.group().trim());
|
||||||
|
|
||||||
|
effect.effect_id = effectHeader.get(0);
|
||||||
|
effect.effect_name = effectHeader.get(1);
|
||||||
|
effect.effect_name = effect.effect_name.replaceAll("\"", "");
|
||||||
|
|
||||||
|
// Some effect mods have no icon
|
||||||
|
// (SEEINVIS-SHADE "See Invis")
|
||||||
|
|
||||||
|
if (effectHeader.size() == 3)
|
||||||
|
effect.icon = Integer.parseInt(effectHeader.get(2));
|
||||||
|
else
|
||||||
|
effect.icon = 0;
|
||||||
|
|
||||||
|
// Parse source entries
|
||||||
|
|
||||||
|
matcher = SOURCE_REGEX.matcher(effectData);
|
||||||
|
|
||||||
|
while (matcher.find())
|
||||||
|
effect.sources.add(matcher.group().trim());
|
||||||
|
|
||||||
|
// Parse modifier entries
|
||||||
|
|
||||||
|
matcher = MODS_REGEX.matcher(effectData);
|
||||||
|
|
||||||
|
// Iterate effect entries from .wpak config data
|
||||||
|
|
||||||
|
while (matcher.find()) {
|
||||||
|
ModifierEntry modifierEntry = parseModEntry(matcher.group());
|
||||||
|
effect.mods.add(modifierEntry);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse Conditions
|
||||||
|
|
||||||
|
matcher = CONDITIONS_REGEX.matcher(effectData);
|
||||||
|
|
||||||
|
while (matcher.find()) {
|
||||||
|
String[] conditions = matcher.group().trim().split("\n");
|
||||||
|
|
||||||
|
for (String condition : conditions) {
|
||||||
|
List<String> parameters = Arrays.asList(condition.trim().split("\\s+"));
|
||||||
|
Iterator<String> iterator = parameters.iterator();
|
||||||
|
|
||||||
|
ConditionEntry conditionEntry = new ConditionEntry();
|
||||||
|
conditionEntry.condition = iterator.next();
|
||||||
|
conditionEntry.arg = Integer.parseInt(iterator.next());
|
||||||
|
|
||||||
|
if (iterator.hasNext())
|
||||||
|
conditionEntry.curveType = mbEnums.CompoundCurveType.valueOf(iterator.next());
|
||||||
|
|
||||||
|
while (iterator.hasNext())
|
||||||
|
conditionEntry.damageTypes.add(mbEnums.DamageType.valueOf(iterator.next().toUpperCase()));
|
||||||
|
|
||||||
|
effect.conditions.add(conditionEntry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return effect;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ModifierEntry parseModEntry(String modData) {
|
||||||
|
|
||||||
|
ModifierEntry modifierEntry = new ModifierEntry();
|
||||||
|
|
||||||
|
String[] modEntries = modData.trim().split("\n");
|
||||||
|
|
||||||
|
for (String modEntry : modEntries) {
|
||||||
|
|
||||||
|
ArrayList<String> modValues = new ArrayList<>();
|
||||||
|
Matcher matcher = STRSPLIT_REGEX.matcher(modEntry.trim());
|
||||||
|
|
||||||
|
while (matcher.find())
|
||||||
|
modValues.add(matcher.group().trim());
|
||||||
|
|
||||||
|
modifierEntry.type = mbEnums.ModType.valueOf(modValues.get(0).trim());
|
||||||
|
|
||||||
|
switch (modifierEntry.type) {
|
||||||
|
case AnimOverride:
|
||||||
|
modifierEntry.min = Float.parseFloat(modValues.get(1).trim());
|
||||||
|
modifierEntry.max = Float.parseFloat(modValues.get(2).trim());
|
||||||
|
break;
|
||||||
|
case Health:
|
||||||
|
case Mana:
|
||||||
|
case Stamina:
|
||||||
|
modifierEntry.min = Float.parseFloat(modValues.get(1).trim());
|
||||||
|
modifierEntry.max = Float.parseFloat(modValues.get(2).trim());
|
||||||
|
modifierEntry.percentage = Float.parseFloat(modValues.get(3).trim());
|
||||||
|
modifierEntry.value = Float.parseFloat(modValues.get(4).trim()); // Always zero
|
||||||
|
modifierEntry.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(5).trim());
|
||||||
|
modifierEntry.arg1 = modValues.get(6).trim();
|
||||||
|
break;
|
||||||
|
case Attr:
|
||||||
|
case Resistance:
|
||||||
|
case Skill:
|
||||||
|
case HealthRecoverRate:
|
||||||
|
case ManaRecoverRate:
|
||||||
|
case StaminaRecoverRate:
|
||||||
|
case DamageShield:
|
||||||
|
case HealthFull:
|
||||||
|
case ManaFull:
|
||||||
|
case StaminaFull:
|
||||||
|
case Slay:
|
||||||
|
case Fade:
|
||||||
|
case Durability:
|
||||||
|
modifierEntry.min = Float.parseFloat(modValues.get(1).trim());
|
||||||
|
modifierEntry.max = Float.parseFloat(modValues.get(2).trim());
|
||||||
|
modifierEntry.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(3).trim());
|
||||||
|
|
||||||
|
if (modValues.size() > 4)
|
||||||
|
modifierEntry.arg1 = modValues.get(4).trim(); // Some HeathFull entries do not have an argument
|
||||||
|
break;
|
||||||
|
case MeleeDamageModifier:
|
||||||
|
case OCV:
|
||||||
|
case DCV:
|
||||||
|
case AttackDelay:
|
||||||
|
case AdjustAboveDmgCap:
|
||||||
|
case DamageCap:
|
||||||
|
case ArmorPiercing:
|
||||||
|
case Speed:
|
||||||
|
case PowerDamageModifier:
|
||||||
|
case DR:
|
||||||
|
case PassiveDefense:
|
||||||
|
case MaxDamage:
|
||||||
|
case Value:
|
||||||
|
case WeaponSpeed:
|
||||||
|
case MinDamage:
|
||||||
|
case PowerCost:
|
||||||
|
case Block:
|
||||||
|
case Parry:
|
||||||
|
case Dodge:
|
||||||
|
case WeaponRange:
|
||||||
|
case ScanRange:
|
||||||
|
case ScaleHeight:
|
||||||
|
case ScaleWidth:
|
||||||
|
modifierEntry.min = Float.parseFloat(modValues.get(1).trim());
|
||||||
|
modifierEntry.max = Float.parseFloat(modValues.get(2).trim());
|
||||||
|
modifierEntry.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(3).trim());
|
||||||
|
break;
|
||||||
|
case ItemName:
|
||||||
|
case BlockedPowerType:
|
||||||
|
case ImmuneTo:
|
||||||
|
case BlackMantle:
|
||||||
|
modifierEntry.arg1 = modValues.get(1).trim();
|
||||||
|
|
||||||
|
// Some BlockedPowerType entries have only one argument
|
||||||
|
|
||||||
|
if (modValues.size() > 2)
|
||||||
|
modifierEntry.arg2 = modValues.get(2).trim();
|
||||||
|
break;
|
||||||
|
case NoMod:
|
||||||
|
case ConstrainedAmbidexterity:
|
||||||
|
case ProtectionFrom:
|
||||||
|
case ExclusiveDamageCap:
|
||||||
|
case IgnoreDamageCap:
|
||||||
|
modifierEntry.arg1 = modValues.get(1).trim();
|
||||||
|
break;
|
||||||
|
case WeaponProc:
|
||||||
|
modifierEntry.min = Float.parseFloat(modValues.get(1).trim());
|
||||||
|
modifierEntry.arg1 = modValues.get(2).trim();
|
||||||
|
modifierEntry.max = Float.parseFloat(modValues.get(3).trim());
|
||||||
|
break;
|
||||||
|
case BladeTrails: // These tags have no parms or are not parsed
|
||||||
|
case ImmuneToAttack:
|
||||||
|
case ImmuneToPowers:
|
||||||
|
case Ambidexterity:
|
||||||
|
case Silenced:
|
||||||
|
case IgnorePassiveDefense:
|
||||||
|
case Stunned:
|
||||||
|
case PowerCostHealth:
|
||||||
|
case Charmed:
|
||||||
|
case Fly:
|
||||||
|
case CannotMove:
|
||||||
|
case CannotTrack:
|
||||||
|
case CannotAttack:
|
||||||
|
case CannotCast:
|
||||||
|
case SpireBlock:
|
||||||
|
case Invisible:
|
||||||
|
case SeeInvisible:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Logger.error("Unhandled type: " + modifierEntry.type);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return modifierEntry;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,308 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2024
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
|
package engine.wpak;
|
||||||
|
|
||||||
|
import engine.gameManager.ConfigManager;
|
||||||
|
import engine.mbEnums;
|
||||||
|
import engine.wpak.data.Effect;
|
||||||
|
import engine.wpak.data.PowerAction;
|
||||||
|
import engine.wpak.data.StatTransfer;
|
||||||
|
import engine.wpak.data.TrackEntry;
|
||||||
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public class PowerActionParser {
|
||||||
|
private static final Pattern STRSPLIT_REGEX = Pattern.compile("([^\"]\\S*|\"[^\"]*\")\\s*");
|
||||||
|
private static final Pattern POWER_ACTION_REGEX = Pattern.compile("(?<=POWERACTIONBEGIN)(.+?)(?=POWERACTIONEND)", Pattern.DOTALL);
|
||||||
|
private static final String powerActionPath = ConfigManager.DEFAULT_DATA_DIR + "wpak/PowerActions.cfg";
|
||||||
|
|
||||||
|
public static void parseWpakFile() {
|
||||||
|
|
||||||
|
// Read .wpak file from disk
|
||||||
|
|
||||||
|
byte[] fileData;
|
||||||
|
|
||||||
|
try {
|
||||||
|
fileData = Files.readAllBytes(Paths.get(powerActionPath));
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
String fileContents = new String(fileData);
|
||||||
|
|
||||||
|
// Iterate over power entries from .wpak data
|
||||||
|
|
||||||
|
Matcher matcher = POWER_ACTION_REGEX.matcher(fileContents);
|
||||||
|
|
||||||
|
while (matcher.find()) {
|
||||||
|
|
||||||
|
PowerAction powerAction = parsePowerActionEntry(matcher.group().trim());
|
||||||
|
// WpakPowerManager._powerActionLookup.put(Hasher.SBStringHash(powerAction.action_id), powerAction);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static PowerAction parsePowerActionEntry(String powerActionData) {
|
||||||
|
|
||||||
|
PowerAction powerAction = new PowerAction();
|
||||||
|
Effect effect;
|
||||||
|
StatTransfer statTransfer;
|
||||||
|
TrackEntry trackEntry;
|
||||||
|
|
||||||
|
// Remove all lines that contain a # and leading/trailing blank lines
|
||||||
|
|
||||||
|
powerActionData = powerActionData.replaceAll("(?m)^(\\s*#.*|\\s*)\r?\n?", "").trim();
|
||||||
|
|
||||||
|
List<String> lineData = Arrays.asList(powerActionData.split("\n"));
|
||||||
|
|
||||||
|
// Parse effect entry header
|
||||||
|
|
||||||
|
Iterator<String> entryIterator = lineData.iterator();
|
||||||
|
String headerLine = entryIterator.next();
|
||||||
|
List<String> headerData = new ArrayList<>();
|
||||||
|
|
||||||
|
Matcher matcher = STRSPLIT_REGEX.matcher(headerLine.trim());
|
||||||
|
|
||||||
|
while (matcher.find())
|
||||||
|
headerData.add(matcher.group().trim());
|
||||||
|
|
||||||
|
Iterator<String> headerIterator = headerData.iterator();
|
||||||
|
powerAction.action_id = headerIterator.next();
|
||||||
|
powerAction.action_type = mbEnums.PowerActionType.valueOf(headerIterator.next());
|
||||||
|
|
||||||
|
switch (powerAction.action_type) {
|
||||||
|
case RemoveEffect:
|
||||||
|
effect = new Effect();
|
||||||
|
effect.effect_id = headerIterator.next();
|
||||||
|
powerAction.effects.add(effect);
|
||||||
|
break;
|
||||||
|
case CreateMob:
|
||||||
|
powerAction.petRace = Integer.parseInt(headerIterator.next());
|
||||||
|
powerAction.petLevel = Integer.parseInt(headerIterator.next());
|
||||||
|
break;
|
||||||
|
case DamageOverTime:
|
||||||
|
effect = new Effect();
|
||||||
|
effect.effect_id = headerIterator.next();
|
||||||
|
effect.cycleDuration = Integer.parseInt(headerIterator.next());
|
||||||
|
effect.cycleDelay = Integer.parseInt(headerIterator.next());
|
||||||
|
powerAction.effects.add(effect);
|
||||||
|
break;
|
||||||
|
case ApplyEffects:
|
||||||
|
int level = Integer.parseInt(headerIterator.next());
|
||||||
|
|
||||||
|
while (headerIterator.hasNext()) {
|
||||||
|
effect = new Effect();
|
||||||
|
effect.level = level;
|
||||||
|
effect.effect_id = headerIterator.next();
|
||||||
|
powerAction.effects.add(effect);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Transform:
|
||||||
|
case Invis:
|
||||||
|
case ApplyEffect:
|
||||||
|
case DeferredPower:
|
||||||
|
case DirectDamage:
|
||||||
|
case SpireDisable:
|
||||||
|
while (headerIterator.hasNext()) {
|
||||||
|
effect = new Effect();
|
||||||
|
effect.effect_id = headerIterator.next();
|
||||||
|
|
||||||
|
// Some applyEffect entries are naked withot a level
|
||||||
|
|
||||||
|
if (headerData.size() > 3)
|
||||||
|
effect.level = Integer.parseInt(headerIterator.next());
|
||||||
|
|
||||||
|
powerAction.effects.add(effect);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case TransferStat:
|
||||||
|
statTransfer = new StatTransfer();
|
||||||
|
statTransfer.fromStat = mbEnums.CostType.valueOf(headerIterator.next());
|
||||||
|
statTransfer.toStat = mbEnums.CostType.valueOf(headerIterator.next());
|
||||||
|
statTransfer.ramp = Float.parseFloat(headerIterator.next());
|
||||||
|
statTransfer.rampCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
|
||||||
|
statTransfer.efficiency = Float.parseFloat(headerIterator.next());
|
||||||
|
statTransfer.efficiencyCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
|
||||||
|
statTransfer.fromStatBool = Boolean.parseBoolean(headerIterator.next());
|
||||||
|
statTransfer.isDrain = Boolean.parseBoolean(headerIterator.next());
|
||||||
|
powerAction.statTransfer = statTransfer;
|
||||||
|
break;
|
||||||
|
case TransferStatOT:
|
||||||
|
statTransfer = new StatTransfer();
|
||||||
|
statTransfer.fromStat = mbEnums.CostType.valueOf(headerIterator.next());
|
||||||
|
statTransfer.toStat = mbEnums.CostType.valueOf(headerIterator.next());
|
||||||
|
statTransfer.ramp = Float.parseFloat(headerIterator.next());
|
||||||
|
statTransfer.rampCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
|
||||||
|
statTransfer.efficiency = Float.parseFloat(headerIterator.next());
|
||||||
|
statTransfer.efficiencyCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
|
||||||
|
statTransfer.fromStatBool = Boolean.parseBoolean(headerIterator.next());
|
||||||
|
statTransfer.isDrain = Boolean.parseBoolean(headerIterator.next());
|
||||||
|
statTransfer.transfer_action = headerIterator.next();
|
||||||
|
statTransfer.transfer_ticks = Integer.parseInt(headerIterator.next());
|
||||||
|
powerAction.statTransfer = statTransfer;
|
||||||
|
break;
|
||||||
|
case Charm:
|
||||||
|
effect = new Effect();
|
||||||
|
effect.effect_id = headerIterator.next();
|
||||||
|
effect.level = Integer.parseInt(headerIterator.next());
|
||||||
|
effect.type = headerIterator.next();
|
||||||
|
powerAction.effects.add(effect);
|
||||||
|
break;
|
||||||
|
case Block:
|
||||||
|
effect = new Effect();
|
||||||
|
effect.effect_id = headerIterator.next();
|
||||||
|
effect.level = Integer.parseInt(headerIterator.next());
|
||||||
|
powerAction.effects.add(effect);
|
||||||
|
break;
|
||||||
|
case Resurrect:
|
||||||
|
powerAction.levelCap = Integer.parseInt(headerIterator.next());
|
||||||
|
break;
|
||||||
|
case SetItemFlag:
|
||||||
|
powerAction.itemFlag = mbEnums.ItemFlags.valueOf(headerIterator.next());
|
||||||
|
break;
|
||||||
|
case Track:
|
||||||
|
trackEntry = new TrackEntry();
|
||||||
|
trackEntry.action_id = headerIterator.next();
|
||||||
|
trackEntry.trackPlayer = Boolean.parseBoolean(headerIterator.next());
|
||||||
|
trackEntry.trackCorpse = Boolean.parseBoolean(headerIterator.next());
|
||||||
|
trackEntry.filter = mbEnums.MonsterType.valueOf(headerIterator.next());
|
||||||
|
trackEntry.min = Integer.parseInt(headerIterator.next());
|
||||||
|
trackEntry.max = Integer.parseInt(headerIterator.next());
|
||||||
|
powerAction.trackEntry = trackEntry;
|
||||||
|
break;
|
||||||
|
case Teleport:
|
||||||
|
if (headerIterator.hasNext())
|
||||||
|
powerAction.ignoreNoTeleSpire = Boolean.parseBoolean(headerIterator.next());
|
||||||
|
break;
|
||||||
|
case Recall: // No arguments for these tags or not parsed
|
||||||
|
case Summon:
|
||||||
|
case TreeChoke:
|
||||||
|
case SimpleDamage:
|
||||||
|
case MobRecall: // One argument always zero
|
||||||
|
case ClearAggro:
|
||||||
|
case ClearNearbyAggro:
|
||||||
|
case Peek:
|
||||||
|
case ClaimMine:
|
||||||
|
case RunegateTeleport:
|
||||||
|
case Steal:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Logger.error("Unhandled type " + powerAction.action_type + " for Pow4erAction: " + powerAction.action_id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Process key value pairs after header
|
||||||
|
|
||||||
|
while (entryIterator.hasNext()) {
|
||||||
|
String lineValue = entryIterator.next();
|
||||||
|
List<String> lineValues = Arrays.asList(lineValue.split("="));
|
||||||
|
String key = lineValues.get(0).trim();
|
||||||
|
List<String> arguments;
|
||||||
|
|
||||||
|
switch (key) {
|
||||||
|
case "BODYPARTS":
|
||||||
|
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
||||||
|
|
||||||
|
for (String bodyPart : arguments)
|
||||||
|
powerAction.bodyParts.add(Integer.parseInt(bodyPart));
|
||||||
|
break;
|
||||||
|
case "FEMALEBODYPARTS":
|
||||||
|
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
||||||
|
|
||||||
|
for (String bodyPart : arguments)
|
||||||
|
powerAction.femaleBodyParts.add(Integer.parseInt(bodyPart));
|
||||||
|
break;
|
||||||
|
case "SCALEFACTOR":
|
||||||
|
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
||||||
|
|
||||||
|
for (String scaleFactor : arguments)
|
||||||
|
powerAction.scaleFactor.add(Float.parseFloat(scaleFactor));
|
||||||
|
break;
|
||||||
|
case "ISRESISTABLE":
|
||||||
|
powerAction.isResistible = Boolean.parseBoolean(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "ISAGGRESSIVE":
|
||||||
|
powerAction.isAggressive = Boolean.parseBoolean(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "BLADETRAILS":
|
||||||
|
powerAction.bladeTrails = Boolean.parseBoolean(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "SHOULDSHOWWEAPONS":
|
||||||
|
powerAction.shouldShowWeapons = Boolean.parseBoolean(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "SHOULDSHOWARMOR":
|
||||||
|
powerAction.shouldShowArmor = Boolean.parseBoolean(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "APPLYEFFECTBLANK":
|
||||||
|
powerAction.applyEffectBlank = Boolean.parseBoolean(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "WEAROFFEFFECTBLANK":
|
||||||
|
powerAction.wearOffEffectBlank = Boolean.parseBoolean(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "ATTACKANIMS":
|
||||||
|
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
||||||
|
|
||||||
|
for (String animation : arguments)
|
||||||
|
powerAction.attackAnimations.add(Integer.parseInt(animation));
|
||||||
|
break;
|
||||||
|
case "REMOVEALL":
|
||||||
|
powerAction.removeAll = Boolean.parseBoolean(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "EFFECTID":
|
||||||
|
effect = new Effect();
|
||||||
|
effect.effect_id = lineValues.get(1).trim();
|
||||||
|
powerAction.effects.add(effect);
|
||||||
|
break;
|
||||||
|
case "LEVELCAP":
|
||||||
|
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
||||||
|
powerAction.levelCap = Integer.parseInt(arguments.get(0));
|
||||||
|
|
||||||
|
if (arguments.size() > 1) // Not all level caps have a curve
|
||||||
|
powerAction.levelCapCurve = mbEnums.CompoundCurveType.valueOf(arguments.get(1));
|
||||||
|
break;
|
||||||
|
case "CLEARAGGRO":
|
||||||
|
powerAction.clearAggro = Boolean.parseBoolean(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "TARGETBECOMESPET":
|
||||||
|
powerAction.targetBecomesPet = Boolean.parseBoolean(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "DESTROYOLDPET":
|
||||||
|
powerAction.destroyOldPet = Boolean.parseBoolean(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "DAMAGETYPE":
|
||||||
|
powerAction.damageType = mbEnums.DamageType.valueOf(lineValues.get(1).trim().toUpperCase());
|
||||||
|
break;
|
||||||
|
case "ROOTFSMID":
|
||||||
|
powerAction.rootFsmID = mbEnums.MobBehaviourType.valueOf(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "SPLASHDAMAGE":
|
||||||
|
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
||||||
|
powerAction.splashDamageMin = Integer.parseInt(arguments.get(0));
|
||||||
|
powerAction.splashDamageMax = Integer.parseInt(arguments.get(1));
|
||||||
|
break;
|
||||||
|
case "APPLYEFFECTOTHER":
|
||||||
|
case "APPLYEFFECTSELF":
|
||||||
|
case "WEAROFFEFFECTOTHER": // Keys not parsed go here.
|
||||||
|
case "WEAROFFEFFECTSELF":
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Logger.error("Unhandled variable type:" + key + " for powerAction: " + powerAction.action_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return powerAction;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,319 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2024
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
|
package engine.wpak;
|
||||||
|
|
||||||
|
import engine.gameManager.ConfigManager;
|
||||||
|
import engine.mbEnums;
|
||||||
|
import engine.wpak.data.*;
|
||||||
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public class PowersParser {
|
||||||
|
|
||||||
|
private static final Pattern POWER_REGEX = Pattern.compile("(?<=POWERBEGIN)(.+?)(?=POWEREND)", Pattern.DOTALL);
|
||||||
|
private static final Pattern STRSPLIT_REGEX = Pattern.compile("([^\"]\\S*|\"[^\"]*\")\\s*");
|
||||||
|
private static final Pattern CONDITION_REGEX = Pattern.compile("(?<=CONDITIONBEGIN)(.+?)(?=CONDITIONEND)", Pattern.DOTALL);
|
||||||
|
private static final String powersPath = ConfigManager.DEFAULT_DATA_DIR + "wpak/Powers.cfg";
|
||||||
|
|
||||||
|
public static void parseWpakFile() {
|
||||||
|
|
||||||
|
// Read .wpak file from disk
|
||||||
|
|
||||||
|
byte[] fileData;
|
||||||
|
|
||||||
|
try {
|
||||||
|
fileData = Files.readAllBytes(Paths.get(powersPath));
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
String fileContents = new String(fileData);
|
||||||
|
|
||||||
|
// Iterate over power entries from .wpak data
|
||||||
|
|
||||||
|
Matcher matcher = POWER_REGEX.matcher(fileContents);
|
||||||
|
|
||||||
|
while (matcher.find()) {
|
||||||
|
|
||||||
|
Power power = parsePowerEntry(matcher.group().trim());
|
||||||
|
// @TODO WpakPowerManager._powersLookup.put(Hasher.SBStringHash(power.power_id), power);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Power parsePowerEntry(String powerData) {
|
||||||
|
|
||||||
|
Power powerEntry = new Power();
|
||||||
|
StringBuilder conditionBuilder = new StringBuilder();
|
||||||
|
StringBuilder powerBuilder = new StringBuilder();
|
||||||
|
String conditionString;
|
||||||
|
String powerString;
|
||||||
|
java.util.Iterator<String> iterator;
|
||||||
|
java.util.Iterator<String> argumentIterator;
|
||||||
|
int endPos = 0;
|
||||||
|
|
||||||
|
// Separate out any conditions from the power data
|
||||||
|
|
||||||
|
Matcher matcher = CONDITION_REGEX.matcher(powerData);
|
||||||
|
|
||||||
|
while (matcher.find()) {
|
||||||
|
conditionBuilder.append(matcher.group().trim());
|
||||||
|
powerBuilder.append(powerData, endPos, matcher.start());
|
||||||
|
endPos = matcher.end();
|
||||||
|
}
|
||||||
|
|
||||||
|
powerBuilder.append(powerData.substring(endPos));
|
||||||
|
|
||||||
|
// Cleanup dangling tags and lines that contain a # and leading/trailing blank lines
|
||||||
|
|
||||||
|
powerString = powerBuilder.toString().replaceAll("CONDITIONBEGINCONDITIONEND", "")
|
||||||
|
.replaceAll("(?m)^(\\s*#.*|\\s*)\r?\n?", "");
|
||||||
|
conditionString = conditionBuilder.toString().replaceAll("(?m)^(\\s*#.*|\\s*)\r?\n?", "");
|
||||||
|
|
||||||
|
// Parse header line in power data
|
||||||
|
|
||||||
|
List<String> lineData = Arrays.asList(powerString.trim().split("\n"));
|
||||||
|
List<String> powerHeader = new ArrayList<>();
|
||||||
|
|
||||||
|
String headerString = lineData.get(0);
|
||||||
|
headerString = headerString.replace("\n", " ");
|
||||||
|
|
||||||
|
matcher = STRSPLIT_REGEX.matcher(headerString);
|
||||||
|
|
||||||
|
while (matcher.find())
|
||||||
|
powerHeader.add(matcher.group().trim());
|
||||||
|
|
||||||
|
iterator = powerHeader.iterator();
|
||||||
|
|
||||||
|
powerEntry.power_id = iterator.next();
|
||||||
|
powerEntry.power = iterator.next().replaceAll("\"", "");
|
||||||
|
|
||||||
|
PowerEntry power = new PowerEntry();
|
||||||
|
power.power_type = mbEnums.PowerType.valueOf(iterator.next());
|
||||||
|
power.icon = Integer.parseInt(iterator.next());
|
||||||
|
power.focusLine = iterator.next().replaceAll("\"", "");
|
||||||
|
powerEntry.powers.add(power);
|
||||||
|
|
||||||
|
String nextValue = iterator.next();
|
||||||
|
|
||||||
|
// Account for second definition
|
||||||
|
|
||||||
|
if (nextValue.equals("SPELL") || nextValue.equals("SKILL")) {
|
||||||
|
power = new PowerEntry();
|
||||||
|
power.power_type = mbEnums.PowerType.valueOf(nextValue);
|
||||||
|
power.icon = Integer.parseInt(iterator.next());
|
||||||
|
power.focusLine = iterator.next().replaceAll("\"", "");
|
||||||
|
powerEntry.powers.add(power);
|
||||||
|
powerEntry.target_type = mbEnums.PowerTargetType.valueOf(iterator.next());
|
||||||
|
} else
|
||||||
|
powerEntry.target_type = mbEnums.PowerTargetType.valueOf(nextValue);
|
||||||
|
|
||||||
|
powerEntry.range = Integer.parseInt(iterator.next());
|
||||||
|
powerEntry.areaType = mbEnums.AreaType.valueOf(iterator.next());
|
||||||
|
powerEntry.areaRange = Integer.parseInt(iterator.next());
|
||||||
|
powerEntry.excludeType = mbEnums.ExcludeType.valueOf(iterator.next());
|
||||||
|
powerEntry.costType = mbEnums.CostType.valueOf(iterator.next());
|
||||||
|
powerEntry.cost = Float.parseFloat(iterator.next());
|
||||||
|
powerEntry.difficulty = Float.parseFloat(iterator.next());
|
||||||
|
powerEntry.precision = Float.parseFloat(iterator.next());
|
||||||
|
// Cleanup init_time in client data which is 0.35.1 or some such
|
||||||
|
powerEntry.init_time = Float.parseFloat(iterator.next().replaceAll("(\\.0)+$", ""));
|
||||||
|
powerEntry.release_time = Float.parseFloat(iterator.next());
|
||||||
|
powerEntry.recycle_time = Float.parseFloat(iterator.next());
|
||||||
|
powerEntry.hitRollYN = Integer.parseInt(iterator.next());
|
||||||
|
powerEntry.castingMode = mbEnums.CastingModeType.valueOf(iterator.next());
|
||||||
|
powerEntry.initAmin = Integer.parseInt(iterator.next());
|
||||||
|
powerEntry.releaseAnim = Integer.parseInt(iterator.next());
|
||||||
|
powerEntry.targetSelect = mbEnums.TargetSelectType.valueOf(iterator.next());
|
||||||
|
|
||||||
|
// Process key value pairs after header
|
||||||
|
|
||||||
|
iterator = lineData.iterator();
|
||||||
|
iterator.next(); // Ignore header
|
||||||
|
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
|
||||||
|
String lineValue = iterator.next();
|
||||||
|
List<String> lineValues = Arrays.asList(lineValue.split("="));
|
||||||
|
String key = lineValues.get(0).trim();
|
||||||
|
ActionEntry actionEntry;
|
||||||
|
List<String> arguments;
|
||||||
|
Matcher argumentMatcher;
|
||||||
|
|
||||||
|
switch (key) {
|
||||||
|
case "ACTION":
|
||||||
|
actionEntry = new ActionEntry();
|
||||||
|
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
||||||
|
actionEntry.action_id = arguments.get(0);
|
||||||
|
actionEntry.minTrains = Integer.parseInt(arguments.get(1));
|
||||||
|
actionEntry.maxTrains = Integer.parseInt(arguments.get(2));
|
||||||
|
actionEntry.duration = Float.parseFloat(arguments.get(3));
|
||||||
|
actionEntry.curve = mbEnums.CompoundCurveType.valueOf(arguments.get(4));
|
||||||
|
actionEntry.stackingCategory = arguments.get(5);
|
||||||
|
actionEntry.stackingPriority = Integer.parseInt(arguments.get(6));
|
||||||
|
actionEntry.categoryToPower = mbEnums.CategoryToPowerType.valueOf(arguments.get(7));
|
||||||
|
powerEntry.actionEntries.add(actionEntry);
|
||||||
|
break;
|
||||||
|
case "MaxLevel":
|
||||||
|
powerEntry.maxLevel = Integer.parseInt(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "HateValue":
|
||||||
|
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
||||||
|
powerEntry.hateValue = Integer.parseInt(arguments.get(0));
|
||||||
|
|
||||||
|
// Not all entries have a curve. Defaults to DefaultFlat;
|
||||||
|
|
||||||
|
if (arguments.size() > 1)
|
||||||
|
powerEntry.hateCurve = mbEnums.CompoundCurveType.valueOf(arguments.get(1));
|
||||||
|
break;
|
||||||
|
case "LOOPANIMID":
|
||||||
|
powerEntry.loopAnimID = Integer.parseInt(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "GRANTOVERRIDEVAR":
|
||||||
|
powerEntry.grantOverrideVar = lineValues.get(1).trim();
|
||||||
|
break;
|
||||||
|
case "DESCRIPTION":
|
||||||
|
powerEntry.description.add(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "CATEGORY":
|
||||||
|
powerEntry.category = mbEnums.PowerCategoryType.valueOf(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "CURVE":
|
||||||
|
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
||||||
|
powerEntry.curves.put(arguments.get(0), mbEnums.CompoundCurveType.valueOf(arguments.get(1)));
|
||||||
|
break;
|
||||||
|
case "EQPREREQ":
|
||||||
|
argumentMatcher = STRSPLIT_REGEX.matcher(lineValues.get(1).trim());
|
||||||
|
arguments = new ArrayList<>();
|
||||||
|
|
||||||
|
while (argumentMatcher.find())
|
||||||
|
arguments.add(argumentMatcher.group().trim());
|
||||||
|
|
||||||
|
argumentIterator = arguments.iterator();
|
||||||
|
|
||||||
|
while (argumentIterator.hasNext()) {
|
||||||
|
EquipmentPreReq equipmentPreReq = new EquipmentPreReq();
|
||||||
|
equipmentPreReq.slot = mbEnums.EquipSlotType.valueOf(argumentIterator.next());
|
||||||
|
equipmentPreReq.skill = argumentIterator.next().replaceAll("\"", "");
|
||||||
|
|
||||||
|
if (argumentIterator.hasNext())
|
||||||
|
equipmentPreReq.required = Integer.parseInt(argumentIterator.next());
|
||||||
|
else
|
||||||
|
equipmentPreReq.required = 0;
|
||||||
|
|
||||||
|
powerEntry.equipmentPreReq.add(equipmentPreReq);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "CANCASTWHILEMOVING":
|
||||||
|
powerEntry.canCastWhileMoving = Boolean.parseBoolean(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "CANCASTWHILEFLYING":
|
||||||
|
powerEntry.canCastWhileFlying = Boolean.parseBoolean(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "BLADETRAILS":
|
||||||
|
powerEntry.bladeTrails = Boolean.parseBoolean(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "EFFECTPREREQ":
|
||||||
|
Effect effectPreReq = new Effect();
|
||||||
|
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
||||||
|
effectPreReq.effect_id = arguments.get(9);
|
||||||
|
effectPreReq.level = Integer.parseInt(arguments.get(1));
|
||||||
|
effectPreReq.message = arguments.get(2);
|
||||||
|
powerEntry.effectPreReqs.add(effectPreReq);
|
||||||
|
break;
|
||||||
|
case "MONSTERTYPERESTRICTS":
|
||||||
|
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
||||||
|
|
||||||
|
for (String restriction : arguments)
|
||||||
|
powerEntry.monsterRestricts.add(mbEnums.MonsterType.valueOf(restriction.trim()));
|
||||||
|
break;
|
||||||
|
case "MONSTERTYPEPREREQS":
|
||||||
|
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
||||||
|
|
||||||
|
for (String restriction : arguments)
|
||||||
|
powerEntry.monsterPrereqs.add(mbEnums.MonsterType.valueOf(restriction.trim()));
|
||||||
|
break;
|
||||||
|
case "SHOULDCHECKPATH":
|
||||||
|
powerEntry.shouldCheckPath = Boolean.parseBoolean(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "STICKY":
|
||||||
|
powerEntry.sticky = Boolean.parseBoolean(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "PULSEINFO":
|
||||||
|
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
||||||
|
powerEntry.pulseCycle = Integer.parseInt(arguments.get(0));
|
||||||
|
powerEntry.pulseDuration = Integer.parseInt(arguments.get(1));
|
||||||
|
break;
|
||||||
|
case "MAXNUMMOBTARGETS":
|
||||||
|
powerEntry.maxMobTargets = Integer.parseInt(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "MAXNUMPLAYERTARGETS":
|
||||||
|
powerEntry.maxPlayerTargets = Integer.parseInt(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "ISADMINPOWER":
|
||||||
|
powerEntry.isAdminPower = Boolean.parseBoolean(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "ISPROJECTILE":
|
||||||
|
powerEntry.isProjectile = Boolean.parseBoolean(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "CASTERSPULSEPARTICLE":
|
||||||
|
powerEntry.casterPulseParticle = Integer.parseInt(lineValues.get(1).trim());
|
||||||
|
break;
|
||||||
|
case "TARGETEFFECTPREREQS_ORED":
|
||||||
|
Effect preReq = new Effect();
|
||||||
|
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
||||||
|
preReq.effect_id = arguments.get(0);
|
||||||
|
preReq.level = Integer.parseInt(arguments.get(1));
|
||||||
|
powerEntry.targetEffectPrereqs.add(preReq);
|
||||||
|
break;
|
||||||
|
case "SOUNDS": // Values not parsed
|
||||||
|
case "APPLYDAMAGESELF":
|
||||||
|
case "APPLYDAMAGECASTER":
|
||||||
|
case "APPLYDAMAGEOTHER":
|
||||||
|
case "APPLYDAMAGETARGET":
|
||||||
|
case "APPLYEFFECTSELF":
|
||||||
|
case "APPLYEFFECTOTHER":
|
||||||
|
case "APPLYEFFECTCASTER":
|
||||||
|
case "APPLYEFFECTTARGET":
|
||||||
|
case "FIZZLEOTHER":
|
||||||
|
case "FIZZLESELF":
|
||||||
|
case "INITSTRING":
|
||||||
|
case "SUCCESSOTHER":
|
||||||
|
case "SUCCESSSELF":
|
||||||
|
case "WEAROFFEFFECTOTHER":
|
||||||
|
case "WEAROFFEFFECTSELF":
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Logger.error("Unhandled variable type:" + key + " for power: " + powerEntry.power_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse power conditions
|
||||||
|
|
||||||
|
if (conditionString.isEmpty() == false) {
|
||||||
|
|
||||||
|
List<String> conditions = Arrays.asList(conditionString.split("\n"));
|
||||||
|
|
||||||
|
for (String condition : conditions) {
|
||||||
|
List<String> parameters = Arrays.asList(condition.trim().split("\\s+"));
|
||||||
|
powerEntry.conditions.put(parameters.get(0), Float.parseFloat(parameters.get(1)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return powerEntry;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2024
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
|
package engine.wpak.data;
|
||||||
|
|
||||||
|
import engine.mbEnums;
|
||||||
|
|
||||||
|
public class ActionEntry {
|
||||||
|
|
||||||
|
public String action_id;
|
||||||
|
public int minTrains;
|
||||||
|
public int maxTrains;
|
||||||
|
public float duration;
|
||||||
|
public String stackingCategory;
|
||||||
|
public mbEnums.CompoundCurveType curve;
|
||||||
|
public int stackingPriority;
|
||||||
|
public mbEnums.CategoryToPowerType categoryToPower;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2024
|
||||||
|
// www.magicbane.com
|
||||||
|
//
|
||||||
|
package engine.wpak.data;
|
||||||
|
|
||||||
|
import engine.mbEnums;
|
||||||
|
|
||||||
|
import java.util.EnumSet;
|
||||||
|
|
||||||
|
public class ConditionEntry {
|
||||||
|
public String condition;
|
||||||
|
public int arg;
|
||||||
|
public mbEnums.CompoundCurveType curveType;
|
||||||
|
public EnumSet<mbEnums.DamageType> damageTypes = EnumSet.noneOf(mbEnums.DamageType.class);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2024
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
|
package engine.wpak.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public class Effect {
|
||||||
|
public String effect_id;
|
||||||
|
public String effect_name;
|
||||||
|
public int icon;
|
||||||
|
public HashSet<String> sources = new HashSet<>();
|
||||||
|
public ArrayList<ModifierEntry> mods = new ArrayList<>();
|
||||||
|
public ArrayList<ConditionEntry> conditions = new ArrayList<>();
|
||||||
|
|
||||||
|
// Additional variables outside of tags or parsed
|
||||||
|
// elsewhere from Effects.cfg
|
||||||
|
|
||||||
|
public boolean isItemEffect;
|
||||||
|
public boolean isSpireEffect;
|
||||||
|
public boolean ignoreNoMod;
|
||||||
|
public boolean dontSave;
|
||||||
|
|
||||||
|
public String type;
|
||||||
|
public int level;
|
||||||
|
public String message;
|
||||||
|
public int cycleDuration;
|
||||||
|
public int cycleDelay;
|
||||||
|
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o)
|
||||||
|
return true;
|
||||||
|
if (o == null || getClass() != o.getClass())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Effect effect = (Effect) o;
|
||||||
|
return Objects.equals(effect_id, effect.effect_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return effect_id.hashCode(); // Use only the id field for hashCode
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2024
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
|
package engine.wpak.data;
|
||||||
|
|
||||||
|
import engine.mbEnums;
|
||||||
|
|
||||||
|
public class EquipmentPreReq {
|
||||||
|
|
||||||
|
public mbEnums.EquipSlotType slot;
|
||||||
|
public String skill;
|
||||||
|
public int required;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2024
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
|
package engine.wpak.data;
|
||||||
|
|
||||||
|
import engine.mbEnums;
|
||||||
|
|
||||||
|
public class ModifierEntry {
|
||||||
|
public mbEnums.ModType type;
|
||||||
|
public float min;
|
||||||
|
public float max;
|
||||||
|
public float percentage;
|
||||||
|
public float value;
|
||||||
|
public mbEnums.CompoundCurveType compoundCurveType;
|
||||||
|
public String arg1; // ItemName "Masterwork" ""
|
||||||
|
public String arg2; // ItemName "" "of the Defender"
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2024
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
|
package engine.wpak.data;
|
||||||
|
|
||||||
|
import engine.mbEnums;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.EnumSet;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public class Power {
|
||||||
|
public String power_id;
|
||||||
|
public String power;
|
||||||
|
public ArrayList<PowerEntry> powers = new ArrayList<>();
|
||||||
|
public mbEnums.PowerTargetType target_type;
|
||||||
|
public int range;
|
||||||
|
public mbEnums.AreaType areaType;
|
||||||
|
public int areaRange;
|
||||||
|
public mbEnums.ExcludeType excludeType;
|
||||||
|
public mbEnums.CostType costType;
|
||||||
|
public float cost;
|
||||||
|
public float difficulty;
|
||||||
|
public float precision;
|
||||||
|
public float init_time;
|
||||||
|
public float release_time;
|
||||||
|
public float recycle_time;
|
||||||
|
public int hitRollYN;
|
||||||
|
public mbEnums.CastingModeType castingMode;
|
||||||
|
public int initAmin;
|
||||||
|
public int releaseAnim;
|
||||||
|
public mbEnums.TargetSelectType targetSelect;
|
||||||
|
|
||||||
|
// Additional key/value type power entries
|
||||||
|
|
||||||
|
public ArrayList<ActionEntry> actionEntries = new ArrayList<>();
|
||||||
|
public int maxLevel;
|
||||||
|
public int hateValue;
|
||||||
|
public mbEnums.CompoundCurveType hateCurve = mbEnums.CompoundCurveType.DefaultFlat;
|
||||||
|
public int loopAnimID;
|
||||||
|
public String grantOverrideVar;
|
||||||
|
public ArrayList<String> description = new ArrayList<>();
|
||||||
|
public HashMap<String, mbEnums.CompoundCurveType> curves = new HashMap<>();
|
||||||
|
public mbEnums.PowerCategoryType category;
|
||||||
|
public boolean canCastWhileMoving = false;
|
||||||
|
public boolean bladeTrails = false;
|
||||||
|
public ArrayList<Effect> effectPreReqs = new ArrayList<>();
|
||||||
|
public ArrayList<EquipmentPreReq> equipmentPreReq = new ArrayList<>();
|
||||||
|
public EnumSet<mbEnums.MonsterType> monsterRestricts = EnumSet.noneOf(mbEnums.MonsterType.class);
|
||||||
|
public EnumSet<mbEnums.MonsterType> monsterPrereqs = EnumSet.noneOf(mbEnums.MonsterType.class);
|
||||||
|
public boolean shouldCheckPath = false;
|
||||||
|
public boolean sticky = false;
|
||||||
|
public int pulseCycle;
|
||||||
|
public int pulseDuration;
|
||||||
|
public int maxMobTargets;
|
||||||
|
public int maxPlayerTargets;
|
||||||
|
public boolean isAdminPower = false;
|
||||||
|
public int casterPulseParticle;
|
||||||
|
public ArrayList<Effect> targetEffectPrereqs = new ArrayList<>();
|
||||||
|
public boolean canCastWhileFlying = false;
|
||||||
|
public boolean isProjectile = false;
|
||||||
|
public HashMap<String, Float> conditions = new HashMap<>();
|
||||||
|
|
||||||
|
public boolean isSpell() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSkill() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isChant() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o)
|
||||||
|
return true;
|
||||||
|
if (o == null || getClass() != o.getClass())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Power power = (Power) o;
|
||||||
|
return Objects.equals(power_id, power.power_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return power_id.hashCode(); // Use only the id field for hashCode
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2024
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
|
package engine.wpak.data;
|
||||||
|
|
||||||
|
import engine.mbEnums;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public class PowerAction {
|
||||||
|
|
||||||
|
// Header values
|
||||||
|
|
||||||
|
public String action_id;
|
||||||
|
public mbEnums.PowerActionType action_type;
|
||||||
|
public ArrayList<Effect> effects = new ArrayList<>();
|
||||||
|
public int petLevel;
|
||||||
|
public int petRace;
|
||||||
|
public StatTransfer statTransfer;
|
||||||
|
public int levelCap;
|
||||||
|
public mbEnums.CompoundCurveType levelCapCurve;
|
||||||
|
public TrackEntry trackEntry;
|
||||||
|
|
||||||
|
// Additional variables after header go here.
|
||||||
|
|
||||||
|
public ArrayList<Integer> bodyParts = new ArrayList<>();
|
||||||
|
public ArrayList<Integer> femaleBodyParts = new ArrayList<>();
|
||||||
|
public boolean shouldShowWeapons = false;
|
||||||
|
public boolean shouldShowArmor = false;
|
||||||
|
public boolean bladeTrails = false;
|
||||||
|
public boolean isResistible = false;
|
||||||
|
public ArrayList<Float> scaleFactor = new ArrayList<>();
|
||||||
|
public ArrayList<Integer> attackAnimations = new ArrayList<>();
|
||||||
|
public boolean isAggressive;
|
||||||
|
public mbEnums.DamageType damageType;
|
||||||
|
public boolean applyEffectBlank = false;
|
||||||
|
public boolean wearOffEffectBlank = false;
|
||||||
|
public boolean removeAll = false;
|
||||||
|
public boolean clearAggro = false;
|
||||||
|
public boolean targetBecomesPet = false;
|
||||||
|
public boolean destroyOldPet = false;
|
||||||
|
public mbEnums.ItemFlags itemFlag;
|
||||||
|
public mbEnums.MobBehaviourType rootFsmID;
|
||||||
|
public int splashDamageMin;
|
||||||
|
public int splashDamageMax;
|
||||||
|
public boolean ignoreNoTeleSpire = false;
|
||||||
|
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o)
|
||||||
|
return true;
|
||||||
|
if (o == null || getClass() != o.getClass())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
PowerAction powerAction = (PowerAction) o;
|
||||||
|
return Objects.equals(action_id, powerAction.action_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return action_id.hashCode(); // Use only the id field for hashCode
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2024
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
|
package engine.wpak.data;
|
||||||
|
|
||||||
|
import engine.mbEnums;
|
||||||
|
|
||||||
|
public class PowerEntry {
|
||||||
|
public mbEnums.PowerType power_type;
|
||||||
|
public int icon;
|
||||||
|
public String focusLine;
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2024
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
|
package engine.wpak.data;
|
||||||
|
|
||||||
|
import engine.mbEnums;
|
||||||
|
|
||||||
|
public class StatTransfer {
|
||||||
|
public mbEnums.CostType fromStat;
|
||||||
|
public float ramp;
|
||||||
|
public mbEnums.CompoundCurveType rampCurve;
|
||||||
|
public mbEnums.CostType toStat;
|
||||||
|
public float efficiency;
|
||||||
|
public mbEnums.CompoundCurveType efficiencyCurve;
|
||||||
|
public boolean fromStatBool;
|
||||||
|
public boolean isDrain;
|
||||||
|
public String transfer_action;
|
||||||
|
public int transfer_ticks;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2022
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
|
package engine.wpak.data;
|
||||||
|
|
||||||
|
import engine.mbEnums;
|
||||||
|
|
||||||
|
public class TrackEntry {
|
||||||
|
|
||||||
|
public String action_id;
|
||||||
|
public Boolean trackPlayer;
|
||||||
|
public Boolean trackCorpse;
|
||||||
|
public mbEnums.MonsterType filter;
|
||||||
|
public int min;
|
||||||
|
public int max;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user