Files
Server/src/engine/powers/PowersBase.java
T
MagicBotandClaude Opus 5.5 ac72d2c8d2 Build powers, cast prereqs and power fail conditions from Powers.cfg
PowersBase(PowerTemplate, id) and PowerPrereq template constructors;
PowersManager.loadPowers fills both maps on the world and login servers
(ids 1..1465 in file order, identical to the DB IDs). The 3.10 target
type exceptions and applyClientTargetTypes are gone; the dead
BLEED-DOT-10.5-RANGE token override is removed (the power is
BLEED-DOT-10.5-RANGED and its DB token is already its hash).

Parity (JSON-Refactor-Plan/scripts/p48.py, every column): 1465/1465 ids,
tokens = SBStringHash(id), flags 1465/1465, prereqs 720/720 rows, fail
conditions 103/105 powers. Absent MAXNUM*TARGETS stay 7 (patch notes).

Value changes (cfg wins, user 2026-10-26):
- target types HLR-025 PC->CORPSE, HNT-023 PC->SELF, RNG-033 GROUP->SELF
- HNT-023 SPELL->SKILL, target select CLICK->NONE
- cast time RNG-033 3->0.2, ROG-002 10->12, WIZ-067 6->7
- WIZ-067 release 1->0, init ramp 0->-0.13; SCT-004 cost ramp 0.5->0
- recycle ALF-001 300->180, FGM-002/003 600->900
- WLR-018 category HEAL->none
- BRD-016, PRS-031 lose the power CastSpell fail condition
- 4 name typos and 167 descriptions from the cfg; 2 effect prereq
  messages (SAB-001, SAP-004) untruncated (unread)
- canCastWhileFlying true by default (client ctor; no live reader)
- category BOON-CLASS/BOON-RACE -> BOONCLASS/BOONRACE: GetSourceType now
  resolves them instead of logging an error (no effect blocks them)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 09:57:46 -04:00

848 lines
29 KiB
Java

// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2026
// https://www.magicbane.com
package engine.powers;
import engine.mbEnums.AreaType;
import engine.mbEnums.CastingModeType;
import engine.mbEnums.CostType;
import engine.mbEnums.ExcludeType;
import engine.mbEnums.MonsterType;
import engine.mbEnums.PowerCategoryType;
import engine.mbEnums.PowerTargetType;
import engine.mbEnums.PowerType;
import engine.mbEnums.TargetSelectType;
import engine.parsers.cache.CacheParserUtil;
import engine.parsers.objects.wpak.CurveRamp;
import engine.parsers.objects.wpak.EffectTemplate;
import engine.parsers.objects.wpak.PowerTemplate;
import engine.util.Hasher;
import org.pmw.tinylog.Logger;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.EnumSet;
public class PowersBase {
// Patch notes: "The Fury's persistent AEs now hit 10 targets instead of 7"; the client ctor leaves these unset
private static final int DEFAULT_MAX_TARGETS = 7;
public final EnumSet<MonsterType> monsterTypeRestrictions = EnumSet.noneOf(MonsterType.class);
public final ArrayList<ActionsBase> actions = new ArrayList<>();
public final ArrayList<PowerPrereq> effectPrereqs = new ArrayList<>();
public final ArrayList<PowerPrereq> targetEffectPrereqs = new ArrayList<>();
public final ArrayList<PowerPrereq> equipPrereqs = new ArrayList<>();
public int UUID;
public String name;
public int token;
public String IDString;
public String category;
public int skillID;
public float range;
public float cost;
public float costRamp;
public float castTime;
public float castTimeRamp;
public float cooldown;
public float recycleTime;
public float recycleRamp;
public int maxTrains;
public float hateValue;
public float hateRamp;
public String monsterTypePrereq; // target limited to these types
public String skillName;
public float weaponRange = 15f;
// aoe related
public boolean isAOE = true;
public boolean useCone = false;
public boolean usePointBlank = false;
public boolean useSphere = false;
public float radius;
public byte groupReq; // who the spell won't hit
public int maxNumMobTargets;
public int maxNumPlayerTargets;
// chant related
public float chantDuration;
public int chantIterations;
// valid target types from targetType field
public boolean targetPlayer = false;
public boolean targetMob = false;
public boolean targetPet = false;
public boolean targetSelf = false;
public boolean targetWeapon = false;
public boolean targetCorpse = false;
public boolean targetBuilding = false;
public boolean targetGroup = false;
public boolean targetGuildLeader = false;
public boolean targetJewelry = false;
public boolean targetArmor = false;
public boolean targetItem = false;
// flags
public boolean isCasterFriendly = false; // from groupReq
public boolean isGroupFriendly = false; // from groupReq
public boolean isGroupOnly = false; // from groupReq
public boolean mustHitPets = false; // from groupReq
public boolean isNationFriendly = false; // from groupReq
public boolean targetFromLastTarget = false; // from unknown06
public boolean targetFromSelf = false; // from unknown06
public boolean targetFromName = false; // from unknown06
public boolean targetFromNearbyMobs = false; // from unknown06
public boolean useHealth = false; // from costType
public boolean useMana = false; // from costType
public boolean useStamina = false; // from costType
public boolean isSpell = true; // from skillOrSpell field
public boolean allowedInCombat = false; // from combat field
public boolean allowedOutOfCombat = false; // from combat field
public boolean regularPlayerCanCast = false; // from grantOverrideVar
public boolean hateRampAdd = true; // 1 bit flag
public boolean costRampAdd = true; // 2 bit flag
public boolean recycleRampAdd = true; // 4 bit flag
public boolean initRampAdd = true; // 8 bit flag
public boolean canCastWhileMoving = false; // 16 bit flag
public boolean canCastWhileFlying = false; // 32 bit flag
public boolean isChant = false; // 64 bit flag
public boolean losCheck = false; // 128 bit flag
public boolean sticky = false; // 256 bit flag
public boolean isAdminPower = false; // 512 bit flag
public boolean requiresHitRoll = false; // 1024 bit flag
public boolean isWeaponPower = false; // from category
public boolean isHeal = false; //from category
public boolean isTrack = false; //from category
public boolean isHarmful = true;
public boolean vampDrain = false;
public boolean cancelOnCastSpell = false;
public boolean cancelOnTakeDamage = false;
public PowerTargetType targetType;
public PowerCategoryType powerCategory;
public String description;
/**
* No Table ID Constructor
*/
public PowersBase() {
}
/**
* ResultSet Constructor
*/
public PowersBase(ResultSet rs) throws SQLException {
this.UUID = rs.getInt("ID");
this.name = rs.getString("name").trim();
this.token = rs.getInt("token");
this.skillName = rs.getString("skillName").trim();
this.IDString = rs.getString("IDString").trim();
this.isSpell = (rs.getString("skillOrSpell").equals("SPELL")) ? true : false;
this.skillID = rs.getInt("skillID");
this.range = rs.getFloat("range");
this.description = (rs.getString("description")).trim().replace("\r\n ", "");
String ct = rs.getString("costType").trim();
if (ct.equals("HEALTH"))
this.useHealth = true;
else if (ct.equals("MANA"))
this.useMana = true;
else if (ct.equals("STAMINA"))
this.useStamina = true;
this.setTargetType(rs.getString("targetType").trim());
String cat = rs.getString("category").trim();
this.category = cat;
if (cat.isEmpty())
this.powerCategory = PowerCategoryType.NONE;
else
this.powerCategory = PowerCategoryType.valueOf(cat.replace("-", ""));
if (cat.equals("WEAPON")) {
this.isWeaponPower = true;
this.isHarmful = false;
if (this.skillName.equals("Bow") || this.skillName.equals("Crossbow") || this.skillName.equals("Archery"))
this.weaponRange = 1000f;
else if (this.skillName.equals("Throwing"))
this.weaponRange = 60f;
else
this.weaponRange = 15f;
} else if (cat.equals("HEAL") || cat.equals("GROUPHEAL")) {
this.isHeal = true;
this.isHarmful = false;
} else if (cat.equals("TRACK")) {
this.isTrack = true;
this.isHarmful = false;
} else if (cat.equals("AE") || cat.equals("AEDAMAGE") ||
cat.equals("BREAKFLY") ||
cat.equals("DAMAGE") || cat.equals("DEBUFF") ||
cat.equals("MOVE") || cat.equals("SPECIAL") ||
cat.equals("SPIREDISABLE"))
this.isHarmful = true;
else if (cat.equals("CHANT")) {
this.isHarmful = ct.equals("MOBILE") || ct.equals("PC") || ct.equals("PCMOBILE");
} else if (cat.equals("DISPEL")) {
//TODO this needs broken down better later
this.isHarmful = false;
} else if (cat.isEmpty()) {
if (ct.equals("MOBILE") || ct.equals("PCMOBILE"))
this.isHarmful = true;
else if (ct.equals("PC")) {
this.isHarmful = this.token != 429607195 && this.token != 429425915;
} else
this.isHarmful = false;
} else
this.isHarmful = false;
if (cat.equals("VAMPDRAIN")) {
this.vampDrain = true;
this.isHarmful = true;
}
this.cost = rs.getFloat("cost");
this.costRamp = rs.getFloat("costRamp");
this.castTime = rs.getFloat("castTime");
this.castTimeRamp = rs.getFloat("initRamp");
this.cooldown = rs.getFloat("cooldown");
this.recycleTime = rs.getFloat("recycleTime");
this.recycleRamp = rs.getFloat("recycleRamp");
this.maxTrains = rs.getInt("maxTrains");
this.hateValue = rs.getFloat("hateValue");
this.hateRamp = rs.getFloat("hateRamp");
ct = rs.getString("unknown06").trim();
if (this.targetSelf) {
} else if (ct.equals("CLICK"))
if (!this.targetGroup)
this.targetFromLastTarget = true;
else if (ct.equals("NAME"))
this.targetFromName = true;
else if (ct.equals("NEARBYMOBS"))
this.targetFromNearbyMobs = true;
this.monsterTypePrereq = rs.getString("monsterTypePrereqs").trim();
ct = rs.getString("radiusType").trim();
if (ct.equals("CONE"))
this.useCone = true;
else if (ct.equals("POINTBLANK"))
this.usePointBlank = true;
else if (ct.equals("SPHERE"))
this.useSphere = true;
else
this.isAOE = false;
this.radius = rs.getFloat("radius");
ct = rs.getString("groupReq").trim();
if (ct.equals("CASTER"))
this.isCasterFriendly = true;
else if (ct.equals("GROUP")) {
this.isGroupFriendly = true;
this.isCasterFriendly = true;
} else if (ct.equals("ALLBUTGROUP"))
this.isGroupOnly = true;
else if (ct.equals("ALLBUTPETS"))
this.mustHitPets = true;
else if (ct.equals("NATION")) {
this.isNationFriendly = true;
this.isCasterFriendly = true;
}
this.maxNumMobTargets = rs.getInt("maxNumMobTargets");
this.maxNumPlayerTargets = rs.getInt("maxNumPlayerTargets");
this.chantDuration = rs.getFloat("chantDuration");
this.chantIterations = rs.getInt("chantIterations");
ct = rs.getString("combat").trim();
if (ct.equals("COMBAT"))
this.allowedInCombat = true;
else if (ct.equals("NONCOMBAT"))
this.allowedOutOfCombat = true;
else if (ct.equals("BOTH")) {
this.allowedInCombat = true;
this.allowedOutOfCombat = true;
}
ct = rs.getString("grantOverideVar").trim();
if (ct.equals("PGOV_PLAYER"))
this.regularPlayerCanCast = true;
int flags = rs.getInt("flags");
if ((flags & 1) == 0)
this.hateRampAdd = false;
if ((flags & 2) == 0)
this.costRampAdd = false;
if ((flags & 4) == 0)
this.recycleRampAdd = false;
if ((flags & 8) == 0)
this.initRampAdd = false;
if ((flags & 16) != 0)
this.canCastWhileMoving = true;
if ((flags & 32) != 0)
this.canCastWhileFlying = true;
if ((flags & 64) != 0)
this.isChant = true;
if ((flags & 128) != 0)
this.losCheck = true;
if ((flags & 256) != 0)
this.sticky = true;
if ((flags & 512) != 0)
this.isAdminPower = true;
if ((flags & 1024) != 0)
this.requiresHitRoll = true;
ct = rs.getString("monsterTypeRestrict1").trim();
if (!ct.isEmpty())
this.monsterTypeRestrictions.add(CacheParserUtil.readEnum(MonsterType.class, ct, this.UUID, "monsterTypeRestrict1"));
ct = rs.getString("monsterTypeRestrict2").trim();
if (!ct.isEmpty())
this.monsterTypeRestrictions.add(CacheParserUtil.readEnum(MonsterType.class, ct, this.UUID, "monsterTypeRestrict2"));
ct = rs.getString("monsterTypeRestrict3").trim();
if (!ct.isEmpty())
this.monsterTypeRestrictions.add(CacheParserUtil.readEnum(MonsterType.class, ct, this.UUID, "monsterTypeRestrict3"));
}
public PowersBase(PowerTemplate powerTemplate, int id) {
CurveRamp hateRamp;
CurveRamp costRamp;
CurveRamp recycleRamp;
CurveRamp initRamp;
this.UUID = id;
this.IDString = powerTemplate.power_id;
hateRamp = rampOf(powerTemplate.hatevalue_curve, "HATEVALUE");
costRamp = rampOf(powerTemplate.curves.get("COSTAMT"), "COSTAMT");
recycleRamp = rampOf(powerTemplate.curves.get("RECYCLETIME"), "RECYCLETIME");
initRamp = rampOf(powerTemplate.curves.get("INITTIME"), "INITTIME");
this.name = powerTemplate.power_name;
this.token = Hasher.SBStringHash(this.IDString);
this.isSpell = powerTemplate.power_type == PowerType.SPELL;
this.skillID = powerTemplate.icon_number; // the DB skillID column held the icon number; unread
this.skillName = powerTemplate.focus;
this.range = powerTemplate.range;
this.description = String.join(" ", powerTemplate.descriptions);
this.useHealth = powerTemplate.cost_type == CostType.HEALTH;
this.useMana = powerTemplate.cost_type == CostType.MANA;
this.useStamina = powerTemplate.cost_type == CostType.STAMINA;
this.setTargetType(powerTemplate.target_type.name());
this.setCategory(powerTemplate.category);
this.cost = powerTemplate.cost_amt;
this.costRamp = costRamp.ramp;
this.costRampAdd = costRamp.useAdd;
this.castTime = powerTemplate.init_time;
this.castTimeRamp = initRamp.ramp;
this.initRampAdd = initRamp.useAdd;
this.cooldown = powerTemplate.release_time;
this.recycleTime = powerTemplate.recycle_time;
this.recycleRamp = recycleRamp.ramp;
this.recycleRampAdd = recycleRamp.useAdd;
this.maxTrains = powerTemplate.maxlevel;
this.hateValue = powerTemplate.hatevalue;
this.hateRamp = hateRamp.ramp;
this.hateRampAdd = hateRamp.useAdd;
// Only CLICK sets a source: the old loader's NAME and NEARBYMOBS branches were unreachable
this.targetFromLastTarget = !this.targetSelf && !this.targetGroup
&& powerTemplate.target_sel == TargetSelectType.CLICK;
this.monsterTypePrereq = powerTemplate.monstertypeprereqs.isEmpty() ? "" : powerTemplate.monstertypeprereqs.get(0).name();
this.monsterTypeRestrictions.addAll(powerTemplate.monstertyperestricts);
this.isAOE = powerTemplate.area_type == AreaType.CONE || powerTemplate.area_type == AreaType.POINTBLANK
|| powerTemplate.area_type == AreaType.SPHERE;
this.useCone = powerTemplate.area_type == AreaType.CONE;
this.usePointBlank = powerTemplate.area_type == AreaType.POINTBLANK;
this.useSphere = powerTemplate.area_type == AreaType.SPHERE;
this.radius = powerTemplate.area_range;
this.setExcludeType(powerTemplate.exclude_type);
this.maxNumMobTargets = (powerTemplate.maxnummobtargets == 0) ? DEFAULT_MAX_TARGETS : powerTemplate.maxnummobtargets;
this.maxNumPlayerTargets = (powerTemplate.maxnumplayertargets == 0) ? DEFAULT_MAX_TARGETS : powerTemplate.maxnumplayertargets;
this.chantDuration = powerTemplate.pulseinfo_duration;
this.chantIterations = powerTemplate.pulseinfo_iterations;
this.isChant = powerTemplate.pulseinfo_iterations > 0;
this.allowedInCombat = powerTemplate.casting_mode == CastingModeType.COMBAT || powerTemplate.casting_mode == CastingModeType.BOTH;
this.allowedOutOfCombat = powerTemplate.casting_mode == CastingModeType.NONCOMBAT || powerTemplate.casting_mode == CastingModeType.BOTH;
this.regularPlayerCanCast = "PGOV_PLAYER".equals(powerTemplate.grantoverridevar);
this.canCastWhileMoving = powerTemplate.cancastwhilemoving;
this.canCastWhileFlying = powerTemplate.cancastwhileflying;
this.losCheck = powerTemplate.shouldcheckpath;
this.sticky = powerTemplate.sticky;
this.isAdminPower = powerTemplate.isadminpower;
this.requiresHitRoll = powerTemplate.hit_roll_yn;
for (PowerTemplate.EffectPrereq effectPrereq : powerTemplate.effectprereqs)
this.effectPrereqs.add(new PowerPrereq(effectPrereq));
for (PowerTemplate.EquipPrereq equipPrereq : powerTemplate.eqprereqs)
this.equipPrereqs.add(new PowerPrereq(equipPrereq));
for (PowerTemplate.EffectPrereq targetPrereq : powerTemplate.targeteffectprereqs_anded)
this.targetEffectPrereqs.add(new PowerPrereq(targetPrereq, true));
for (PowerTemplate.EffectPrereq targetPrereq : powerTemplate.targeteffectprereqs_ored)
this.targetEffectPrereqs.add(new PowerPrereq(targetPrereq, false));
for (EffectTemplate.ConditionEntry condition : powerTemplate.conditions)
switch (condition.condition) {
case CastSpell:
this.cancelOnCastSpell = true;
break;
case TakeDamage:
this.cancelOnTakeDamage = true;
break;
}
}
private CurveRamp rampOf(String curveName, String field) {
CurveRamp curveRamp;
if (curveName == null)
return CurveRamp.NONE;
curveRamp = CurveRamp.fromCurve(curveName);
if (curveRamp == null) {
Logger.warn("Power " + this.IDString + " " + field + " curve " + curveName + " has no ramp form");
return CurveRamp.NONE;
}
return curveRamp;
}
// CHANT and uncategorised powers are never harmful: the old loader tested the cost type against target type names
private void setCategory(PowerCategoryType categoryType) {
this.powerCategory = (categoryType == null) ? PowerCategoryType.NONE : categoryType;
this.category = (categoryType == null) ? "" : categoryType.name();
switch (this.powerCategory) {
case WEAPON:
this.isWeaponPower = true;
this.isHarmful = false;
if (this.skillName.equals("Bow") || this.skillName.equals("Crossbow") || this.skillName.equals("Archery"))
this.weaponRange = 1000f;
else if (this.skillName.equals("Throwing"))
this.weaponRange = 60f;
else
this.weaponRange = 15f;
break;
case HEAL:
case GROUPHEAL:
this.isHeal = true;
this.isHarmful = false;
break;
case TRACK:
this.isTrack = true;
this.isHarmful = false;
break;
case AE:
case AEDAMAGE:
case BREAKFLY:
case DAMAGE:
case DEBUFF:
case MOVE:
case SPECIAL:
case SPIREDISABLE:
this.isHarmful = true;
break;
case VAMPDRAIN:
this.vampDrain = true;
this.isHarmful = true;
break;
default:
this.isHarmful = false;
}
}
private void setExcludeType(ExcludeType excludeType) {
switch (excludeType) {
case CASTER:
this.isCasterFriendly = true;
break;
case GROUP:
this.isGroupFriendly = true;
this.isCasterFriendly = true;
break;
case ALLBUTGROUP:
this.isGroupOnly = true;
break;
case ALLBUTPETS:
this.mustHitPets = true;
break;
case NATION:
this.isNationFriendly = true;
this.isCasterFriendly = true;
break;
}
}
public void setTargetType(String targetType) {
this.targetPlayer = false;
this.targetMob = false;
this.targetPet = false;
this.targetSelf = false;
this.targetWeapon = false;
this.targetCorpse = false;
this.targetBuilding = false;
this.targetGroup = false;
this.targetGuildLeader = false;
this.targetJewelry = false;
this.targetArmor = false;
this.targetItem = false;
if (targetType.equals("BUILDING"))
this.targetBuilding = true;
else if (targetType.equals("CORPSE"))
this.targetCorpse = true;
else if (targetType.equals("GROUP"))
this.targetGroup = true;
else if (targetType.equals("GUILDLEADER"))
this.targetGuildLeader = true;
else if (targetType.equals("MOBILE")) {
this.targetMob = true;
this.targetPet = true; // sure on this one?
} else if (targetType.equals("PC"))
this.targetPlayer = true;
else if (targetType.equals("SELF"))
this.targetSelf = true;
else if (targetType.equals("PET"))
this.targetPet = true;
else if (targetType.equals("ARMOR"))
this.targetArmor = true;
else if (targetType.equals("WEAPON"))
this.targetWeapon = true;
else if (targetType.equals("JEWELRY"))
this.targetJewelry = true;
else if (targetType.equals("ITEM")) {
this.targetItem = true;
this.targetJewelry = true;
this.targetArmor = true;
this.targetWeapon = true;
} else if (targetType.equals("ARMORWEAPONJEWELRY")) {
this.targetArmor = true;
this.targetWeapon = true;
this.targetJewelry = true;
} else if (targetType.equals("PCMOBILE")) {
this.targetPlayer = true;
this.targetMob = true;
this.targetPet = true; // sure on this one?
} else if (targetType.equals("WEAPONARMOR")) {
this.targetWeapon = true;
this.targetArmor = true;
} else {
Logger.info("Missed " + targetType + " targetType");
}
}
public String getName() {
return this.name;
}
public int getMaxTrains() {
return this.maxTrains;
}
public int getUUID() {
return this.UUID;
}
public String getIDString() {
return this.IDString;
}
public int getToken() {
return this.token;
}
public int getCastTime(int trains) { // returns cast time in ms
if (this.initRampAdd)
return (int) ((this.castTime + (this.castTimeRamp * trains)) * 1000);
else
return (int) ((this.castTime * (1 + (this.castTimeRamp * trains))) * 1000);
}
public int getRecycleTime(int trains) { // returns cast time in ms
if (this.recycleRampAdd)
return (int) (((this.recycleTime + (this.recycleRamp * trains)) * 1000) + getCastTime(trains));
else
return (int) (((this.recycleTime * (1 + (this.recycleRamp * trains))) * 1000) + getCastTime(trains));
}
// public ArrayList<FailCondition> getConditions() {
// return this.conditions;
// }
public ArrayList<PowerPrereq> getEffectPrereqs() {
return this.effectPrereqs;
}
public ArrayList<PowerPrereq> getTargetEffectPrereqs() {
return this.targetEffectPrereqs;
}
public ArrayList<PowerPrereq> getEquipPrereqs() {
return this.equipPrereqs;
}
public ArrayList<ActionsBase> getActions() {
return this.actions;
}
public boolean usePointBlank() {
return this.usePointBlank;
}
public float getRadius() {
return this.radius;
}
public int getMaxNumMobTargets() {
return this.maxNumMobTargets;
}
public int getMaxNumPlayerTargets() {
return this.maxNumPlayerTargets;
}
public boolean cancelOnCastSpell() {
return this.cancelOnCastSpell;
}
public boolean cancelOnTakeDamage() {
return this.cancelOnTakeDamage;
}
public boolean allowedInCombat() {
return this.allowedInCombat;
}
public boolean allowedOutOfCombat() {
return this.allowedOutOfCombat;
}
public boolean isCasterFriendly() {
return this.isCasterFriendly;
}
public boolean isGroupFriendly() {
return this.isGroupFriendly;
}
public boolean isNationFriendly() {
return this.isNationFriendly;
}
public boolean isGroupOnly() {
return this.isGroupOnly;
}
public boolean mustHitPets() {
return this.mustHitPets;
}
public boolean targetFromLastTarget() {
return this.targetFromLastTarget;
}
public boolean targetFromSelf() {
return this.targetFromSelf;
}
public boolean targetFromName() {
return this.targetFromName;
}
public boolean targetFromNearbyMobs() {
return this.targetFromNearbyMobs;
}
public float getRange() {
return this.range;
}
public boolean requiresHitRoll() {
return this.requiresHitRoll;
}
public boolean regularPlayerCanCast() {
return this.regularPlayerCanCast;
}
public boolean isSpell() {
return this.isSpell;
}
public boolean isHarmful() {
return this.isHarmful;
}
public boolean targetPlayer() {
return this.targetPlayer;
}
public boolean targetMob() {
return this.targetMob;
}
public boolean targetPet() {
return this.targetPet;
}
public boolean targetSelf() {
return this.targetSelf;
}
public boolean targetCorpse() {
return this.targetCorpse;
}
public boolean targetBuilding() {
return this.targetBuilding;
}
public boolean targetGroup() {
return this.targetGroup;
}
public boolean targetGuildLeader() {
return this.targetGuildLeader;
}
public boolean targetJewelry() {
return this.targetJewelry;
}
public boolean targetArmor() {
return this.targetArmor;
}
public boolean targetWeapon() {
return this.targetWeapon;
}
public boolean targetItem() {
return this.targetItem;
}
public long getCooldown() {
return (long) (this.cooldown * 1000); // return
// in ms
}
public boolean useHealth() {
return this.useHealth;
}
public boolean useMana() {
return this.useMana;
}
public boolean useStamina() {
return this.useStamina;
}
public float getCost(int trains) {
if (this.costRampAdd)
return this.cost + (this.costRamp * trains);
else
return this.cost * (1 + (this.costRamp * trains));
}
public float getHateValue() {
return this.hateValue;
}
public float getHateRamp() {
return this.hateRamp;
}
public float getHateValue(int trains) {
return this.hateValue + (this.hateRamp * trains);
}
public boolean canCastWhileMoving() {
return this.canCastWhileMoving;
}
public boolean canCastWhileFlying() {
return this.canCastWhileFlying;
}
public boolean isAOE() {
return isAOE;
}
public boolean isChant() {
return isChant;
}
public int getChantIterations() {
return chantIterations;
}
public float getChantDuration() {
return chantDuration;
}
public boolean isWeaponPower() {
return isWeaponPower;
}
public boolean isHeal() {
return isHeal;
}
public boolean isTrack() {
return isTrack;
}
public boolean vampDrain() {
return vampDrain;
}
public void setCancelOnCastSpell(boolean value) {
this.cancelOnCastSpell = value;
}
public void setCancelOnTakeDamage(boolean value) {
this.cancelOnTakeDamage = value;
}
public String getSkillName() {
return this.skillName;
}
public String getMonsterTypePrereq() {
return this.monsterTypePrereq;
}
public String getCategory() {
return this.category;
}
public float getWeaponRange() {
return this.weaponRange;
}
public PowerCategoryType getPowerCategoryType() {
return this.powerCategory;
}
public String getDescription() {
return description;
}
public boolean enforceLore(){
return this.powerCategory.equals(PowerCategoryType.SUMMON) || this.powerCategory.equals(PowerCategoryType.HEAL)|| this.powerCategory.equals(PowerCategoryType.BUFF);
}
}