forked from MagicBane/Server
Compare commits
50 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a10c8c9aa5 | |||
| cdf3e4db8a | |||
| b53133655c | |||
| f07974f673 | |||
| 0d5cef1652 | |||
| 04203c092a | |||
| 78feee482b | |||
| 8c35844e08 | |||
| 0fbb43e021 | |||
| 145449f26d | |||
| feef6263b4 | |||
| 6c622c377f | |||
| 8943121336 | |||
| 70cb469190 | |||
| a42f307a70 | |||
| 2a3ae6eaec | |||
| 9e4b596aa1 | |||
| aa1fe792a3 | |||
| 79919121a8 | |||
| 80ccfff635 | |||
| 381139af35 | |||
| e79da63556 | |||
| 533565e37e | |||
| da0510d2bc | |||
| 1f732a8ca9 | |||
| 0d24789a93 | |||
| 35427cfb4a | |||
| 695a78b1e2 | |||
| 9f6710ccb9 | |||
| fff1e80f61 | |||
| 141af19daa | |||
| 630748541f | |||
| d32818f351 | |||
| d6f94bd0e7 | |||
| db6a4e471d | |||
| a24c611bac | |||
| 3926160ab1 | |||
| 4a7013de61 | |||
| 56564f1c3b | |||
| 8a3e39e97d | |||
| 5224c79441 | |||
| ede016a93d | |||
| cc1825dec9 | |||
| d257ce50cf | |||
| 5b246211e1 | |||
| 33c923b0de | |||
| 02d524663a | |||
| 5bd85addb7 | |||
| 40bae67443 | |||
| 1cf1d731c4 |
@@ -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<>());
|
||||||
|
|||||||
@@ -136,6 +136,12 @@ public class dbWarehouseHandler extends dbHandlerBase {
|
|||||||
int cityUID = rs.getInt("cityUUID");
|
int cityUID = rs.getInt("cityUUID");
|
||||||
JSONObject jsonObject = new JSONObject(rs.getString("warehouse"));
|
JSONObject jsonObject = new JSONObject(rs.getString("warehouse"));
|
||||||
City city = City.getCity(cityUID);
|
City city = City.getCity(cityUID);
|
||||||
|
|
||||||
|
if (city == null) {
|
||||||
|
Logger.error("No city " + cityUID + " for warehouse");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
city.warehouse = new Warehouse(jsonObject);
|
city.warehouse = new Warehouse(jsonObject);
|
||||||
city.warehouse.city = city;
|
city.warehouse.city = city;
|
||||||
|
|
||||||
|
|||||||
@@ -104,68 +104,68 @@ public enum BuildingManager {
|
|||||||
if (building == null)
|
if (building == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
//cannot access destroyed buildings
|
||||||
if (building.getRank() == -1)
|
if (building.getRank() == -1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (IsOwner(building, player))
|
//admin characters can always access buildings
|
||||||
return true;
|
|
||||||
|
|
||||||
//individual friend.
|
|
||||||
|
|
||||||
if (building.getFriends() != null && building.getFriends().get(player.getObjectUUID()) != null)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
//Admins can access stuff
|
|
||||||
|
|
||||||
if (player.isCSR())
|
if (player.isCSR())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
//Guild stuff
|
//owner can always access their own building
|
||||||
|
|
||||||
if (building.getGuild().isGuildLeader(player.getObjectUUID()))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if (building.getFriends().get(player.getGuild().getObjectUUID()) != null && building.getFriends().get(player.getGuild().getObjectUUID()).friendType == 8)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if (building.getFriends().get(player.getGuild().getObjectUUID()) != null && building.getFriends().get(player.getGuild().getObjectUUID()).friendType == 9 && GuildStatusController.isInnerCouncil(player.getGuildStatus()))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if (Guild.sameGuild(building.getGuild(), player.getGuild()) && GuildStatusController.isInnerCouncil(player.getGuildStatus()))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return Guild.sameGuild(building.getGuild(), player.getGuild()) && GuildStatusController.isGuildLeader(player.getGuildStatus());
|
|
||||||
|
|
||||||
//TODO test friends list once added
|
|
||||||
//does not meet above criteria. Cannot access.
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean playerCanManageNotFriends(PlayerCharacter player, Building building) {
|
|
||||||
|
|
||||||
//Player Can only Control Building if player is in Same Guild as Building and is higher rank than IC.
|
|
||||||
|
|
||||||
if (player == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (building == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (building.getRank() == -1)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (IsOwner(building, player))
|
if (IsOwner(building, player))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
//Somehow guild leader check fails? lets check if Player is true Guild GL.
|
//check for default IC access if building belongs to same guild
|
||||||
if (building.getGuild() != null && building.getGuild().isGuildLeader(player.getObjectUUID()))
|
if(player.guild.equals(building.getGuild())) {
|
||||||
|
if (building.getBlueprint() != null && building.getBlueprint().getBuildingGroup() != null) {
|
||||||
|
switch (building.getBlueprint().getBuildingGroup()) {
|
||||||
|
case TOL:
|
||||||
|
case BARRACK:
|
||||||
|
case SPIRE:
|
||||||
|
case SHRINE:
|
||||||
|
case BANESTONE:
|
||||||
|
case MINE:
|
||||||
|
case WAREHOUSE:
|
||||||
|
case BULWARK:
|
||||||
|
case SIEGETENT:
|
||||||
|
if (GuildStatusController.isInnerCouncil(player.getGuildStatus()))
|
||||||
|
return true;
|
||||||
|
if (GuildStatusController.isGuildLeader(player.getGuildStatus()))
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//check against friends list entries if any present
|
||||||
|
if (building.getFriends() != null) {
|
||||||
|
|
||||||
|
//check individuals
|
||||||
|
if (building.getFriends().get(player.getObjectUUID()) != null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!GuildStatusController.isGuildLeader(player.getGuildStatus()) && !GuildStatusController.isInnerCouncil(player.getGuildStatus()))
|
if (building.getFriends().get(player.guild.objectUUID) != null) {
|
||||||
return false;
|
|
||||||
|
|
||||||
return false;
|
//check friend type for guild related access
|
||||||
|
switch (building.getFriends().get(player.guild.objectUUID).friendType) {
|
||||||
|
case 8: //full member
|
||||||
|
if (GuildStatusController.isFullMember(player.getGuildStatus()))
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
case 9: //Inner Council
|
||||||
|
if (GuildStatusController.isInnerCouncil(player.getGuildStatus()))
|
||||||
|
return true;
|
||||||
|
if (GuildStatusController.isGuildLeader(player.getGuildStatus()))
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//did not meet access grant criteria, deny access
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static synchronized boolean lootBuilding(PlayerCharacter player, Building building) {
|
public static synchronized boolean lootBuilding(PlayerCharacter player, Building building) {
|
||||||
|
|
||||||
@@ -463,29 +463,19 @@ public enum BuildingManager {
|
|||||||
return GuildStatusController.isGuildLeader(player.getGuildStatus()) || GuildStatusController.isInnerCouncil(player.getGuildStatus());
|
return GuildStatusController.isGuildLeader(player.getGuildStatus()) || GuildStatusController.isInnerCouncil(player.getGuildStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int GetAvailableGold(Building building) {
|
|
||||||
|
|
||||||
if (building.getStrongboxValue() == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (building.getStrongboxValue() < building.reserve)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return building.getStrongboxValue() - building.reserve;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean IsPlayerHostile(Building building, PlayerCharacter player) {
|
public static boolean IsPlayerHostile(Building building, PlayerCharacter player) {
|
||||||
|
|
||||||
//Nation Members and Guild members are not hostile.
|
|
||||||
// if (building.getGuild() != null){
|
|
||||||
// if (pc.getGuild() != null)
|
|
||||||
// if (building.getGuild().getObjectUUID() == pc.getGuildUUID()
|
|
||||||
// || pc.getGuild().getNation().getObjectUUID() == building.getGuild().getNation().getObjectUUID())
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
if (Guild.sameNationExcludeErrant(building.getGuild(), player.getGuild()))
|
if (Guild.sameNationExcludeErrant(building.getGuild(), player.getGuild()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if(building.enforceKOS) {
|
||||||
|
if (building.getCity() != null) {
|
||||||
|
Building TOL = building.getCity().getTOL();
|
||||||
|
if (TOL != null) {
|
||||||
|
building = TOL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!building.reverseKOS) {
|
if (!building.reverseKOS) {
|
||||||
|
|
||||||
Condemned condemn = building.getCondemned().get(player.getObjectUUID());
|
Condemned condemn = building.getCondemned().get(player.getObjectUUID());
|
||||||
|
|||||||
@@ -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, SourceType.None)) {
|
if (bonus != null && bonus.getBool(ModType.Silenced, EffectSourceType.None)) {
|
||||||
ChatManager.chatSayError(pc, SILENCED);
|
ChatManager.chatSayError(pc, SILENCED);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import engine.net.client.msg.UpdateStateMsg;
|
|||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.powers.DamageShield;
|
import engine.powers.DamageShield;
|
||||||
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
||||||
|
import engine.powers.effectmodifiers.WeaponProcEffectModifier;
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
@@ -66,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.SourceType.None))
|
if (bonuses != null && bonuses.getBool(mbEnums.ModType.ImmuneToAttack, mbEnums.EffectSourceType.None))
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case NPC:
|
case NPC:
|
||||||
@@ -142,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.SourceType.None);
|
rangeMod += bonus.getFloatPercentAll(mbEnums.ModType.WeaponRange, mbEnums.EffectSourceType.None);
|
||||||
|
|
||||||
attackRange += weapon.template.item_weapon_max_range * rangeMod;
|
attackRange += weapon.template.item_weapon_max_range * rangeMod;
|
||||||
}
|
}
|
||||||
@@ -168,12 +169,12 @@ public enum CombatManager {
|
|||||||
switch (target.getObjectType()) {
|
switch (target.getObjectType()) {
|
||||||
case PlayerCharacter:
|
case PlayerCharacter:
|
||||||
attackRange += ((PlayerCharacter) target).getCharacterHeight() * 0.5f;
|
attackRange += ((PlayerCharacter) target).getCharacterHeight() * 0.5f;
|
||||||
if (distanceSquared < attackRange * attackRange)
|
if (distanceSquared <= attackRange * attackRange)
|
||||||
inRange = true;
|
inRange = true;
|
||||||
break;
|
break;
|
||||||
case Mob:
|
case Mob:
|
||||||
attackRange += ((AbstractCharacter) target).calcHitBox();
|
attackRange += ((AbstractCharacter) target).calcHitBox();
|
||||||
if (distanceSquared < attackRange * attackRange)
|
if (distanceSquared <= attackRange * attackRange)
|
||||||
inRange = true;
|
inRange = true;
|
||||||
break;
|
break;
|
||||||
case Building:
|
case Building:
|
||||||
@@ -201,18 +202,18 @@ public enum CombatManager {
|
|||||||
|
|
||||||
if (weapon != null) {
|
if (weapon != null) {
|
||||||
|
|
||||||
int wepSpeed = (int) (weapon.template.item_weapon_wepspeed);
|
float wepSpeed = (int) (weapon.template.item_weapon_wepspeed);
|
||||||
|
|
||||||
if (weapon.getBonusPercent(mbEnums.ModType.WeaponSpeed, mbEnums.SourceType.None) != 0f) //add weapon speed bonus
|
if (weapon.getBonusPercent(mbEnums.ModType.WeaponSpeed, mbEnums.EffectSourceType.None) != 0f) //add weapon speed bonus
|
||||||
wepSpeed *= (1 + weapon.getBonus(mbEnums.ModType.WeaponSpeed, mbEnums.SourceType.None));
|
wepSpeed *= (1 + weapon.getBonus(mbEnums.ModType.WeaponSpeed, mbEnums.EffectSourceType.None));
|
||||||
|
|
||||||
if (attacker.getBonuses() != null && attacker.getBonuses().getFloatPercentAll(mbEnums.ModType.AttackDelay, mbEnums.SourceType.None) != 0f) //add effects speed bonus
|
if (attacker.getBonuses() != null && attacker.getBonuses().getFloatPercentAll(mbEnums.ModType.AttackDelay, mbEnums.EffectSourceType.None) != 0f) //add effects speed bonus
|
||||||
wepSpeed *= (1 + attacker.getBonuses().getFloatPercentAll(mbEnums.ModType.AttackDelay, mbEnums.SourceType.None));
|
wepSpeed *= (1 + attacker.getBonuses().getFloatPercentAll(mbEnums.ModType.AttackDelay, mbEnums.EffectSourceType.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.
|
||||||
|
|
||||||
delay = wepSpeed * 100L;
|
delay = (long)wepSpeed * 100L;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob))
|
if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob))
|
||||||
@@ -220,6 +221,16 @@ public enum CombatManager {
|
|||||||
|
|
||||||
if (inRange) {
|
if (inRange) {
|
||||||
|
|
||||||
|
if(attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)){
|
||||||
|
if(!attacker.getTimestamps().contains(slot.name()+"Attack")){
|
||||||
|
attacker.getTimestamps().put(slot.name()+"Attack", System.currentTimeMillis() - 1000);
|
||||||
|
} else if(System.currentTimeMillis() < attacker.getTimestamps().get(slot.name()+"Attack") + delay){
|
||||||
|
setAutoAttackJob(attacker,slot,delay);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//handle retaliate
|
//handle retaliate
|
||||||
if (AbstractCharacter.IsAbstractCharacter(target)) {
|
if (AbstractCharacter.IsAbstractCharacter(target)) {
|
||||||
if (((AbstractCharacter) target).combatTarget == null || !((AbstractCharacter) target).combatTarget.isAlive()) {
|
if (((AbstractCharacter) target).combatTarget == null || !((AbstractCharacter) target).combatTarget.isAlive()) {
|
||||||
@@ -356,6 +367,9 @@ public enum CombatManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//check for proccing
|
||||||
|
checkForProc(attacker,target,weapon);
|
||||||
|
|
||||||
//calculate the base damage
|
//calculate the base damage
|
||||||
int damage = ThreadLocalRandom.current().nextInt(min, max + 1);
|
int damage = ThreadLocalRandom.current().nextInt(min, max + 1);
|
||||||
if (damage == 0) {
|
if (damage == 0) {
|
||||||
@@ -627,7 +641,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.SourceType.None);
|
float dmgMultiplier = 1 + agent.getBonuses().getFloatPercentAll(mbEnums.ModType.MeleeDamageModifier, mbEnums.EffectSourceType.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;
|
||||||
@@ -651,4 +665,20 @@ public enum CombatManager {
|
|||||||
int masteryLevel = 0;
|
int masteryLevel = 0;
|
||||||
return max * (pow(0.0124 * primary + 0.118 * (primary - 0.75), 0.5) + pow(0.0022 * secondary + 0.028 * (secondary - 0.75), 0.5) + 0.0075 * (focusLevel + masteryLevel));
|
return max * (pow(0.0124 * primary + 0.118 * (primary - 0.75), 0.5) + pow(0.0022 * secondary + 0.028 * (secondary - 0.75), 0.5) + 0.0075 * (focusLevel + masteryLevel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void checkForProc(AbstractCharacter attacker, AbstractWorldObject target, Item weapon){
|
||||||
|
|
||||||
|
if(weapon == null) // cant proc without a weapon
|
||||||
|
return;
|
||||||
|
|
||||||
|
for(Effect eff : weapon.effects.values()){
|
||||||
|
for(AbstractEffectModifier mod : eff.getEffectsBase().getModifiers()){
|
||||||
|
if(mod.modType.equals(mbEnums.ModType.WeaponProc))
|
||||||
|
if(ThreadLocalRandom.current().nextInt(0,101) < 6)
|
||||||
|
((WeaponProcEffectModifier)mod).applyProc(attacker,target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,7 @@ public enum ItemManager {
|
|||||||
if (characterSkill == null)
|
if (characterSkill == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (characterSkill.getModifiedAmountBeforeMods() > required_value)
|
if (characterSkill.getModifiedAmountBeforeMods() >= required_value)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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, SourceType.None) || toMove.getBonuses().getBool(ModType.CannotMove, SourceType.None)) {
|
if (toMove.getBonuses().getBool(ModType.Stunned, EffectSourceType.None) || toMove.getBonuses().getBool(ModType.CannotMove, EffectSourceType.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, SourceType.None) || bonus.getBool(ModType.CannotMove, SourceType.None))
|
if (bonus.getBool(ModType.Stunned, EffectSourceType.None) || bonus.getBool(ModType.CannotMove, EffectSourceType.None))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
member.update();
|
member.update();
|
||||||
|
|||||||
@@ -176,14 +176,31 @@ public enum PowersManager {
|
|||||||
PowersBase pb = PowersManager.powersBaseByToken.get(msg.getPowerUsedID());
|
PowersBase pb = PowersManager.powersBaseByToken.get(msg.getPowerUsedID());
|
||||||
PlayerCharacter caster = origin.getPlayerCharacter();
|
PlayerCharacter caster = origin.getPlayerCharacter();
|
||||||
PlayerCharacter target = PlayerCharacter.getFromCache(msg.getTargetID());
|
PlayerCharacter target = PlayerCharacter.getFromCache(msg.getTargetID());
|
||||||
if (pb != null && pb.isHarmful == false) {
|
if (pb != null && pb.enforceLore()) {
|
||||||
//if (caster.guild.equals(Guild.getErrantGuild()))
|
//if (caster.guild.equals(Guild.getErrantGuild()))
|
||||||
// return;
|
// return;
|
||||||
|
|
||||||
if (target != null && caster.guild.getGuildType().equals(target.guild.getGuildType()) == false && target.getObjectType().equals(GameObjectType.Building) == false)
|
if (target != null && caster.guild.getGuildType().equals(target.guild.getGuildType()) == false && target.getObjectType().equals(GameObjectType.Building) == false) {
|
||||||
|
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(msg.getPowerUsedID());
|
||||||
|
Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), recyclePowerMsg);
|
||||||
|
DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
|
||||||
|
|
||||||
|
// Send Fail to cast message
|
||||||
|
PlayerCharacter pc = SessionManager
|
||||||
|
.getPlayerCharacter(origin);
|
||||||
|
|
||||||
|
if (pc != null) {
|
||||||
|
sendPowerMsg(pc, 2, msg);
|
||||||
|
if (pc.isCasting()) {
|
||||||
|
pc.update();
|
||||||
|
}
|
||||||
|
|
||||||
|
pc.setIsCasting(false);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (usePowerA(msg, origin, sendCastToSelf)) {
|
if (usePowerA(msg, origin, sendCastToSelf)) {
|
||||||
// Cast failed for some reason, reset timer
|
// Cast failed for some reason, reset timer
|
||||||
@@ -331,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();
|
||||||
SourceType sourceType = SourceType.GetSourceType(pb.getCategory());
|
EffectSourceType sourceType = EffectSourceType.getEffectSourceType(pb.getCategory());
|
||||||
if (bonus != null && (bonus.getBool(ModType.Stunned, SourceType.None) || bonus.getBool(ModType.CannotCast, SourceType.None) || bonus.getBool(ModType.BlockedPowerType, sourceType)))
|
if (bonus != null && (bonus.getBool(ModType.Stunned, EffectSourceType.None) || bonus.getBool(ModType.CannotCast, EffectSourceType.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
|
||||||
@@ -468,7 +485,7 @@ public enum PowersManager {
|
|||||||
cost = 0;
|
cost = 0;
|
||||||
|
|
||||||
if (bonus != null)
|
if (bonus != null)
|
||||||
cost *= (1 + bonus.getFloatPercentAll(ModType.PowerCost, SourceType.None));
|
cost *= (1 + bonus.getFloatPercentAll(ModType.PowerCost, EffectSourceType.None));
|
||||||
|
|
||||||
if (playerCharacter.getAltitude() > 0)
|
if (playerCharacter.getAltitude() > 0)
|
||||||
cost *= 1.5f;
|
cost *= 1.5f;
|
||||||
@@ -614,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();
|
||||||
SourceType sourceType = SourceType.GetSourceType(pb.getCategory());
|
EffectSourceType sourceType = EffectSourceType.getEffectSourceType(pb.getCategory());
|
||||||
if (bonus != null && (bonus.getBool(ModType.Stunned, SourceType.None) || bonus.getBool(ModType.CannotCast, SourceType.None) || bonus.getBool(ModType.BlockedPowerType, sourceType)))
|
if (bonus != null && (bonus.getBool(ModType.Stunned, EffectSourceType.None) || bonus.getBool(ModType.CannotCast, EffectSourceType.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
|
||||||
@@ -775,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, SourceType.None))
|
if (bonus.getBool(ModType.Stunned, EffectSourceType.None))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SourceType sourceType = SourceType.GetSourceType(pb.getCategory());
|
EffectSourceType sourceType = EffectSourceType.getEffectSourceType(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;
|
||||||
@@ -908,10 +925,6 @@ public enum PowersManager {
|
|||||||
if (pb.isHarmful())
|
if (pb.isHarmful())
|
||||||
mobTarget.handleDirectAggro(playerCharacter);
|
mobTarget.handleDirectAggro(playerCharacter);
|
||||||
}
|
}
|
||||||
//Power is aiding a target, handle aggro if combat target is a Mob.
|
|
||||||
if (!pb.isHarmful() && target.getObjectType() == GameObjectType.PlayerCharacter) {
|
|
||||||
PlayerCharacter pcTarget = (PlayerCharacter) target;
|
|
||||||
}
|
|
||||||
|
|
||||||
// update target of used power timer
|
// update target of used power timer
|
||||||
|
|
||||||
@@ -933,8 +946,7 @@ public enum PowersManager {
|
|||||||
continue;
|
continue;
|
||||||
// If something blocks the action, then stop
|
// If something blocks the action, then stop
|
||||||
|
|
||||||
if (ab.blocked(target, pb, trains)) {
|
if (ab.blocked(target,pb.vampDrain)) {
|
||||||
|
|
||||||
PowersManager.sendEffectMsg(playerCharacter, 5, ab, pb);
|
PowersManager.sendEffectMsg(playerCharacter, 5, ab, pb);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1053,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, SourceType.None))
|
if (bonus.getBool(ModType.Stunned, EffectSourceType.None))
|
||||||
return;
|
return;
|
||||||
SourceType sourceType = SourceType.GetSourceType(pb.getCategory());
|
EffectSourceType sourceType = EffectSourceType.getEffectSourceType(pb.getCategory());
|
||||||
if (bonus.getBool(ModType.BlockedPowerType, sourceType))
|
if (bonus.getBool(ModType.BlockedPowerType, sourceType))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1109,7 +1121,7 @@ public enum PowersManager {
|
|||||||
continue;
|
continue;
|
||||||
// If something blocks the action, then stop
|
// If something blocks the action, then stop
|
||||||
|
|
||||||
if (ab.blocked(target, pb, trains))
|
if (ab.blocked(target,pb.vampDrain))
|
||||||
continue;
|
continue;
|
||||||
// TODO handle overwrite stack order here
|
// TODO handle overwrite stack order here
|
||||||
String stackType = ab.getStackType();
|
String stackType = ab.getStackType();
|
||||||
@@ -1423,7 +1435,7 @@ public enum PowersManager {
|
|||||||
if (trains < ab.getMinTrains() || trains > ab.getMaxTrains())
|
if (trains < ab.getMinTrains() || trains > ab.getMaxTrains())
|
||||||
continue;
|
continue;
|
||||||
// If something blocks the action, then stop
|
// If something blocks the action, then stop
|
||||||
if (ab.blocked(target, pb, trains))
|
if (ab.blocked(target,pb.vampDrain))
|
||||||
// sendPowerMsg(pc, 5, msg);
|
// sendPowerMsg(pc, 5, msg);
|
||||||
continue;
|
continue;
|
||||||
// TODO handle overwrite stack order here
|
// TODO handle overwrite stack order here
|
||||||
@@ -1688,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, SourceType.None)) {
|
if (bonuses != null && bonuses.getBool(ModType.ImmuneToPowers, EffectSourceType.None)) {
|
||||||
awolist.remove();
|
awolist.remove();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1838,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, SourceType.None)) {
|
if (bonuses != null && bonuses.getBool(ModType.ImmuneToPowers, EffectSourceType.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, SourceType.None)) {
|
} else if (bonuses != null && bonuses.getBool(ModType.Silenced, EffectSourceType.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, SourceType.SUMMON)) {
|
if (this.target.getBonuses() != null && this.target.getBonuses().getBool(ModType.BlockedPowerType, EffectSourceType.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;
|
||||||
|
|||||||
+12
-174
@@ -831,16 +831,22 @@ public class mbEnums {
|
|||||||
SPIRES,
|
SPIRES,
|
||||||
SNARE,
|
SNARE,
|
||||||
STUN,
|
STUN,
|
||||||
BLIND,
|
BLINDNESS,
|
||||||
ROOT,
|
ROOT,
|
||||||
FEAR,
|
FEAR,
|
||||||
CHARM,
|
CHARM,
|
||||||
POWERBLOCK,
|
POWERINHIBITOR,
|
||||||
DEBUFF,
|
DEBUFF,
|
||||||
STEAL,
|
STEAL,
|
||||||
DRAIN;
|
DRAIN;
|
||||||
|
|
||||||
public static DamageType getDamageType(String modName) {
|
public static DamageType getDamageType(String modName) {
|
||||||
|
if(modName.toLowerCase().equals("blind"))
|
||||||
|
modName = "BLINDNESS";
|
||||||
|
|
||||||
|
if(modName.toLowerCase().equals("powerblock"))
|
||||||
|
modName = "POWERINHIBITOR";
|
||||||
|
|
||||||
DamageType damageType;
|
DamageType damageType;
|
||||||
if (modName.isEmpty())
|
if (modName.isEmpty())
|
||||||
return DamageType.NONE;
|
return DamageType.NONE;
|
||||||
@@ -855,176 +861,6 @@ 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,
|
||||||
@@ -1084,7 +920,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;
|
||||||
@@ -2721,7 +2557,7 @@ public class mbEnums {
|
|||||||
ANTIMONY(1580014, 1256147265, 452320058, 1000, 10),
|
ANTIMONY(1580014, 1256147265, 452320058, 1000, 10),
|
||||||
AZOTH(1580012, -1205326951, 78329697, 2000, 20),
|
AZOTH(1580012, -1205326951, 78329697, 2000, 20),
|
||||||
BLOODSTONE(1580020, -1912381716, -1569826353, 500, 5),
|
BLOODSTONE(1580020, -1912381716, -1569826353, 500, 5),
|
||||||
BRONZEWOOD(1580006, -519681813, 1334770447, 500, 10),
|
BRONZEWOOD(1580006, -519681813, 1334770447, 1000, 30),
|
||||||
COAL(1580008, -1672872311, 2559427, 3000, 30),
|
COAL(1580008, -1672872311, 2559427, 3000, 30),
|
||||||
DIAMOND(1580010, 1540225085, -1730704107, 2000, 20),
|
DIAMOND(1580010, 1540225085, -1730704107, 2000, 20),
|
||||||
GALVOR(1580017, -1683992404, -1596311545, 2000, 5),
|
GALVOR(1580017, -1683992404, -1596311545, 2000, 5),
|
||||||
@@ -2741,6 +2577,7 @@ public class mbEnums {
|
|||||||
|
|
||||||
public static HashMap<Integer, ResourceType> templateLookup = new HashMap<>();
|
public static HashMap<Integer, ResourceType> templateLookup = new HashMap<>();
|
||||||
public static HashMap<Integer, ResourceType> templateHashLookup = new HashMap<>();
|
public static HashMap<Integer, ResourceType> templateHashLookup = new HashMap<>();
|
||||||
|
public static HashMap<Integer, ResourceType> resourceHashLookup = new HashMap<>();
|
||||||
public int templateID;
|
public int templateID;
|
||||||
public ItemTemplate template;
|
public ItemTemplate template;
|
||||||
public int resourceHash;
|
public int resourceHash;
|
||||||
@@ -2762,6 +2599,7 @@ public class mbEnums {
|
|||||||
for (ResourceType resourceType : ResourceType.values()) {
|
for (ResourceType resourceType : ResourceType.values()) {
|
||||||
templateLookup.put(resourceType.templateID, resourceType);
|
templateLookup.put(resourceType.templateID, resourceType);
|
||||||
templateHashLookup.put(resourceType.templateHash, resourceType);
|
templateHashLookup.put(resourceType.templateHash, resourceType);
|
||||||
|
resourceHashLookup.put(resourceType.resourceHash, resourceType);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.SourceType.None)) * 0.01f);
|
float recoveredHealth = mob.getHealthMax() * ((1 + mob.getBonuses().getFloatPercentAll(mbEnums.ModType.HealthRecoverRate, mbEnums.EffectSourceType.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, SourceType.None) && !agent.getBonuses().getBool(ModType.CannotMove, SourceType.None));
|
return (agent.isAlive() && !agent.getBonuses().getBool(ModType.Stunned, EffectSourceType.None) && !agent.getBonuses().getBool(ModType.CannotMove, EffectSourceType.None));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Vector3fImmutable randomPatrolLocation(Mob agent, Vector3fImmutable center, float radius) {
|
public static Vector3fImmutable randomPatrolLocation(Mob agent, Vector3fImmutable center, float radius) {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class ArcMineChangeProductionMsgHandler extends AbstractClientMsgHandler
|
|||||||
|
|
||||||
//make sure valid resource
|
//make sure valid resource
|
||||||
|
|
||||||
mbEnums.ResourceType resource = mbEnums.ResourceType.templateHashLookup.get(changeProductionMsg.getResourceHash());
|
mbEnums.ResourceType resource = mbEnums.ResourceType.resourceHashLookup.get(changeProductionMsg.getResourceHash());
|
||||||
|
|
||||||
if (resource == null)
|
if (resource == null)
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
|
|||||||
if (building.getGuild().isEmptyGuild())
|
if (building.getGuild().isEmptyGuild())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!ManageCityAssetMsgHandler.playerCanManageNotFriends(sourcePlayer, building))
|
if (!BuildingManager.playerCanManage(sourcePlayer, building))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
|
|||||||
(building == null) || playerZone == null || playerCity == null)
|
(building == null) || playerZone == null || playerCity == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!ManageCityAssetMsgHandler.playerCanManageNotFriends(sourcePlayer, building))
|
if (!BuildingManager.playerCanManage(sourcePlayer, building))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
boolean open = (msg.getMessageType() == OPEN_CITY);
|
boolean open = (msg.getMessageType() == OPEN_CITY);
|
||||||
|
|||||||
@@ -102,6 +102,9 @@ public class InviteToSubHandler extends AbstractClientMsgHandler {
|
|||||||
//source guild is limited to 7 subs
|
//source guild is limited to 7 subs
|
||||||
//TODO this should be based on TOL rank
|
//TODO this should be based on TOL rank
|
||||||
|
|
||||||
|
//cannot be subbed into a nation if you already have your own sub guilds
|
||||||
|
if(targetGuild.getSubGuildList() != null && targetGuild.getSubGuildList().size() > 0)
|
||||||
|
return true;
|
||||||
|
|
||||||
if (!sourceGuild.canSubAGuild(targetGuild)) {
|
if (!sourceGuild.canSubAGuild(targetGuild)) {
|
||||||
sendChat(source, "This Guild can't be subbed.");
|
sendChat(source, "This Guild can't be subbed.");
|
||||||
|
|||||||
@@ -28,30 +28,6 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean playerCanManageNotFriends(PlayerCharacter player, Building building) {
|
|
||||||
|
|
||||||
//Player Can only Control Building if player is in Same Guild as Building and is higher rank than IC.
|
|
||||||
|
|
||||||
if (player == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (building.getRank() == -1)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (BuildingManager.IsOwner(building, player))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if (GuildStatusController.isGuildLeader(player.getGuildStatus()) == false && GuildStatusController.isInnerCouncil(player.getGuildStatus()) == false)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
//Somehow guild leader check fails above? lets check if Player is true Guild GL.
|
|
||||||
if (building.getGuild() != null && building.getGuild().isGuildLeader(player.getObjectUUID()))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return Guild.sameGuild(building.getGuild(), player.getGuild());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) {
|
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) {
|
||||||
|
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler {
|
|||||||
City targetCity = null;
|
City targetCity = null;
|
||||||
|
|
||||||
if (isTeleport)
|
if (isTeleport)
|
||||||
cities = City.getCitiesToTeleportTo(player);
|
cities = City.getCitiesToTeleportTo(player, false);
|
||||||
else
|
else
|
||||||
cities = City.getCitiesToRepledgeTo(player);
|
cities = City.getCitiesToRepledgeTo(player);
|
||||||
for (City city : cities) {
|
for (City city : cities) {
|
||||||
|
|||||||
@@ -264,8 +264,9 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
|
|||||||
player.cancelOnSpell();
|
player.cancelOnSpell();
|
||||||
break;
|
break;
|
||||||
case RUNE:
|
case RUNE:
|
||||||
ApplyRuneMsg.applyRune(uuid, origin, player);
|
if(ApplyRuneMsg.applyRune(uuid, origin, player)) {
|
||||||
itemMan.consume(item);
|
itemMan.consume(item);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default: //shouldn't be here, consume item
|
default: //shouldn't be here, consume item
|
||||||
dispatch = Dispatch.borrow(player, msg);
|
dispatch = Dispatch.borrow(player, msg);
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
|
|||||||
if (building == null)
|
if (building == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ManageCityAssetMsgHandler.playerCanManageNotFriends(player, building) == false)
|
if (BuildingManager.playerCanManage(player, building) == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (orderNpcMsg.getPatrolSize() >= 20)
|
if (orderNpcMsg.getPatrolSize() >= 20)
|
||||||
@@ -411,7 +411,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
|
|||||||
case 2:
|
case 2:
|
||||||
player = SessionManager.getPlayerCharacter(origin);
|
player = SessionManager.getPlayerCharacter(origin);
|
||||||
|
|
||||||
if (ManageCityAssetMsgHandler.playerCanManageNotFriends(player, building) == false)
|
if (BuildingManager.playerCanManage(player, building) == false)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (building.getHirelings().containsKey(npc) == false)
|
if (building.getHirelings().containsKey(npc) == false)
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class PetAttackMsgHandler extends AbstractClientMsgHandler {
|
|||||||
pet.setCombatTarget(PlayerCharacter.getPlayerCharacter(msg.getTargetID()));
|
pet.setCombatTarget(PlayerCharacter.getPlayerCharacter(msg.getTargetID()));
|
||||||
|
|
||||||
switch (msg.getTargetType()) {
|
switch (msg.getTargetType()) {
|
||||||
case 53: //player character
|
case 52: //player character
|
||||||
pet.setCombatTarget(PlayerCharacter.getPlayerCharacter(msg.getTargetID()));
|
pet.setCombatTarget(PlayerCharacter.getPlayerCharacter(msg.getTargetID()));
|
||||||
break;
|
break;
|
||||||
case 37://mob
|
case 37://mob
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public class RecvSummonsMsgHandler extends AbstractClientMsgHandler {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (playerCharacter.getBonuses() != null && playerCharacter.getBonuses().getBool(mbEnums.ModType.BlockedPowerType, mbEnums.SourceType.SUMMON)) {
|
if (playerCharacter.getBonuses() != null && playerCharacter.getBonuses().getBool(mbEnums.ModType.BlockedPowerType, mbEnums.EffectSourceType.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.SourceType.None);
|
float durMod = toRepair.getBonusPercent(mbEnums.ModType.Durability, mbEnums.EffectSourceType.None);
|
||||||
max *= (1 + (durMod * 0.01f));
|
max *= (1 + (durMod * 0.01f));
|
||||||
|
|
||||||
if (dur >= max || dur < 1) {
|
if (dur >= max || dur < 1) {
|
||||||
|
|||||||
@@ -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.SourceType.None))
|
if (bonus != null && bonus.getBool(mbEnums.ModType.CannotTrack, mbEnums.EffectSourceType.None))
|
||||||
it.remove();
|
it.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class TransferGoldToFromBuildingMsgHandler extends AbstractClientMsgHandl
|
|||||||
|
|
||||||
if (msg.getDirection() == 2) {
|
if (msg.getDirection() == 2) {
|
||||||
|
|
||||||
if (!ManageCityAssetMsgHandler.playerCanManageNotFriends(player, building))
|
if (!BuildingManager.playerCanManage(player, building))
|
||||||
return true;
|
return true;
|
||||||
if (building.setReserve(msg.getUnknown01(), player)) {
|
if (building.setReserve(msg.getUnknown01(), player)) {
|
||||||
dispatch = Dispatch.borrow(player, msg);
|
dispatch = Dispatch.borrow(player, msg);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class SendOwnPlayerMsg extends ClientNetMsg {
|
|||||||
@Override
|
@Override
|
||||||
protected int getPowerOfTwoBufferSize() {
|
protected int getPowerOfTwoBufferSize() {
|
||||||
//Larger size for historically larger opcodes
|
//Larger size for historically larger opcodes
|
||||||
return (17); // 2^17 == 131,072
|
return (18); // 2^17 == 131,072
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -73,10 +73,8 @@ public class TeleportRepledgeListMsg extends ClientNetMsg {
|
|||||||
|
|
||||||
public void configure() {
|
public void configure() {
|
||||||
|
|
||||||
if (isTeleport)
|
cities = City.getCitiesToTeleportTo(player, !isTeleport);
|
||||||
cities = City.getCitiesToTeleportTo(player);
|
|
||||||
else
|
|
||||||
cities = City.getCitiesToRepledgeTo(player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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, SourceType.Fly) && bonus.getBool(ModType.Fly, SourceType.None) && flyer.isAlive())
|
if (bonus != null && !bonus.getBool(ModType.NoMod, EffectSourceType.Flight) && bonus.getBool(ModType.Fly, EffectSourceType.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, SourceType.None);
|
defense += (short) abstractCharacter.bonuses.getFloat(ModType.DCV, EffectSourceType.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, SourceType.None);
|
float pos_Bonus = abstractCharacter.bonuses.getFloatPercentPositive(ModType.DCV, EffectSourceType.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, SourceType.None);
|
float neg_Bonus = abstractCharacter.bonuses.getFloatPercentNegative(ModType.DCV, EffectSourceType.None);
|
||||||
defense = (short) (defense * (1 + neg_Bonus));
|
defense = (short) (defense * (1 + neg_Bonus));
|
||||||
|
|
||||||
} else
|
} else
|
||||||
@@ -656,13 +656,13 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
AssignDamageAtrForPlayers(abstractCharacter, equipped.get(EquipSlotType.LHELD), false, equipped.get(EquipSlotType.LHELD));
|
AssignDamageAtrForPlayers(abstractCharacter, equipped.get(EquipSlotType.LHELD), false, equipped.get(EquipSlotType.LHELD));
|
||||||
if (abstractCharacter.getObjectType().equals(GameObjectType.Mob)) {
|
if (abstractCharacter.getObjectType().equals(GameObjectType.Mob)) {
|
||||||
Mob mob = (Mob) abstractCharacter;
|
Mob mob = (Mob) abstractCharacter;
|
||||||
abstractCharacter.minDamageHandOne += (int) mob.mobBase.getDamageMin();
|
abstractCharacter.minDamageHandOne = (int) mob.mobBase.getDamageMin();
|
||||||
abstractCharacter.minDamageHandTwo += (int) mob.mobBase.getDamageMin();
|
abstractCharacter.minDamageHandTwo = (int) mob.mobBase.getDamageMin();
|
||||||
abstractCharacter.maxDamageHandOne += (int) mob.mobBase.getDamageMax();
|
abstractCharacter.maxDamageHandOne = (int) mob.mobBase.getDamageMax();
|
||||||
abstractCharacter.maxDamageHandTwo += (int) mob.mobBase.getDamageMax();
|
abstractCharacter.maxDamageHandTwo = (int) mob.mobBase.getDamageMax();
|
||||||
abstractCharacter.atrHandOne += mob.mobBase.getAttackRating();
|
abstractCharacter.atrHandOne = mob.mobBase.getAttackRating();
|
||||||
abstractCharacter.atrHandTwo += mob.mobBase.getAttackRating();
|
abstractCharacter.atrHandTwo = mob.mobBase.getAttackRating();
|
||||||
abstractCharacter.defenseRating += mob.mobBase.getDefenseRating();
|
abstractCharacter.defenseRating = mob.mobBase.getDefenseRating();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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, SourceType.None);
|
float range_bonus = 1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.WeaponRange, EffectSourceType.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, SourceType.None);
|
atr += abstractCharacter.bonuses.getFloat(ModType.OCV, EffectSourceType.None);
|
||||||
|
|
||||||
// Finally use any multipliers. DO THIS LAST!
|
// Finally use any multipliers. DO THIS LAST!
|
||||||
float pos_Bonus = (1 + abstractCharacter.bonuses.getFloatPercentPositive(ModType.OCV, SourceType.None));
|
float pos_Bonus = (1 + abstractCharacter.bonuses.getFloatPercentPositive(ModType.OCV, EffectSourceType.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, SourceType.None);
|
float neg_Bonus = abstractCharacter.bonuses.getFloatPercentNegative(ModType.OCV, EffectSourceType.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, SourceType.None));
|
speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.WeaponSpeed, EffectSourceType.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, SourceType.None));
|
//speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.AttackDelay, EffectSourceType.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, SourceType.None);
|
min += weapon.getBonus(ModType.MinDamage, EffectSourceType.None);
|
||||||
max += weapon.getBonus(ModType.MaxDamage, SourceType.None);
|
max += weapon.getBonus(ModType.MaxDamage, EffectSourceType.None);
|
||||||
|
|
||||||
min += weapon.getBonus(ModType.MeleeDamageModifier, SourceType.None);
|
min += weapon.getBonus(ModType.MeleeDamageModifier, EffectSourceType.None);
|
||||||
max += weapon.getBonus(ModType.MeleeDamageModifier, SourceType.None);
|
max += weapon.getBonus(ModType.MeleeDamageModifier, EffectSourceType.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, SourceType.None);
|
percentMinDamage += weapon.getBonusPercent(ModType.MinDamage, EffectSourceType.None);
|
||||||
percentMinDamage += weapon.getBonusPercent(ModType.MeleeDamageModifier, SourceType.None);
|
percentMinDamage += weapon.getBonusPercent(ModType.MeleeDamageModifier, EffectSourceType.None);
|
||||||
|
|
||||||
percentMaxDamage += weapon.getBonusPercent(ModType.MaxDamage, SourceType.None);
|
percentMaxDamage += weapon.getBonusPercent(ModType.MaxDamage, EffectSourceType.None);
|
||||||
percentMaxDamage += weapon.getBonusPercent(ModType.MeleeDamageModifier, SourceType.None);
|
percentMaxDamage += weapon.getBonusPercent(ModType.MeleeDamageModifier, EffectSourceType.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, SourceType.None);
|
minDamage += abstractCharacter.bonuses.getFloat(ModType.MinDamage, EffectSourceType.None);
|
||||||
maxDamage += abstractCharacter.bonuses.getFloat(ModType.MaxDamage, SourceType.None);
|
maxDamage += abstractCharacter.bonuses.getFloat(ModType.MaxDamage, EffectSourceType.None);
|
||||||
|
|
||||||
minDamage += abstractCharacter.bonuses.getFloat(ModType.MeleeDamageModifier, SourceType.None);
|
minDamage += abstractCharacter.bonuses.getFloat(ModType.MeleeDamageModifier, EffectSourceType.None);
|
||||||
maxDamage += abstractCharacter.bonuses.getFloat(ModType.MeleeDamageModifier, SourceType.None);
|
maxDamage += abstractCharacter.bonuses.getFloat(ModType.MeleeDamageModifier, EffectSourceType.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, SourceType.None);
|
percentMinDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MinDamage, EffectSourceType.None);
|
||||||
percentMinDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
percentMinDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, EffectSourceType.None);
|
||||||
|
|
||||||
percentMaxDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MaxDamage, SourceType.None);
|
percentMaxDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MaxDamage, EffectSourceType.None);
|
||||||
percentMaxDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
percentMaxDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, EffectSourceType.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, SourceType.None);
|
def += shield.getBonus(ModType.DR, EffectSourceType.None);
|
||||||
def *= (1 + shield.getBonusPercent(ModType.DR, SourceType.None));
|
def *= (1 + shield.getBonusPercent(ModType.DR, EffectSourceType.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, SourceType.None);
|
def += armor.getBonus(ModType.DR, EffectSourceType.None);
|
||||||
def *= (1 + armor.getBonusPercent(ModType.DR, SourceType.None));
|
def *= (1 + armor.getBonusPercent(ModType.DR, EffectSourceType.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, SourceType.None));
|
ret *= (1 + this.bonuses.getFloatPercentAll(ModType.ScanRange, EffectSourceType.None));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,6 +163,11 @@ public class Building extends AbstractWorldObject {
|
|||||||
if (upgradeTimeStamp != null)
|
if (upgradeTimeStamp != null)
|
||||||
this.upgradeDateTime = LocalDateTime.ofInstant(upgradeTimeStamp.toInstant(), ZoneId.systemDefault());
|
this.upgradeDateTime = LocalDateTime.ofInstant(upgradeTimeStamp.toInstant(), ZoneId.systemDefault());
|
||||||
|
|
||||||
|
if(rs.getInt("enforceKOS") == 0)
|
||||||
|
this.enforceKOS = false;
|
||||||
|
else
|
||||||
|
this.enforceKOS = true;
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.error("Failed for object " + this.blueprintUUID + ' ' + this.getObjectUUID() + e);
|
Logger.error("Failed for object " + this.blueprintUUID + ' ' + this.getObjectUUID() + e);
|
||||||
}
|
}
|
||||||
@@ -1447,7 +1452,7 @@ public class Building extends AbstractWorldObject {
|
|||||||
|
|
||||||
public synchronized boolean setReserve(int amount, PlayerCharacter player) {
|
public synchronized boolean setReserve(int amount, PlayerCharacter player) {
|
||||||
|
|
||||||
if (!BuildingManager.playerCanManageNotFriends(player, this))
|
if (!BuildingManager.playerCanManage(player, this))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (amount < 0)
|
if (amount < 0)
|
||||||
|
|||||||
@@ -1400,6 +1400,7 @@ public class CharacterItemManager {
|
|||||||
|
|
||||||
if (!ItemManager.validForSkills(item, pc.getSkills())) {
|
if (!ItemManager.validForSkills(item, pc.getSkills())) {
|
||||||
this.forceToInventory(slot, item, pc, initialized);
|
this.forceToInventory(slot, item, pc, initialized);
|
||||||
|
this.equipped.remove(slot);
|
||||||
pc.applyBonuses();
|
pc.applyBonuses();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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, SourceType.None);
|
atr += bonus.getFloat(ModType.OCV, EffectSourceType.None);
|
||||||
float pos_Bonus = bonus.getFloatPercentPositive(ModType.OCV, SourceType.None);
|
float pos_Bonus = bonus.getFloatPercentPositive(ModType.OCV, EffectSourceType.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, SourceType.None);
|
float neg_Bonus = bonus.getFloatPercentNegative(ModType.OCV, EffectSourceType.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;
|
||||||
SourceType sourceType = SourceType.GetSourceType(sb.getNameNoSpace());
|
EffectSourceType sourceType = EffectSourceType.getEffectSourceType(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];
|
||||||
SourceType sourceType = SourceType.GetSourceType(this.skillsBase.getNameNoSpace());
|
EffectSourceType sourceType = EffectSourceType.getEffectSourceType(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;
|
||||||
SourceType sourceType = SourceType.GetSourceType(this.skillsBase.getNameNoSpace());
|
EffectSourceType sourceType = EffectSourceType.getEffectSourceType(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);
|
||||||
|
|||||||
+103
-112
@@ -120,9 +120,7 @@ public class City extends AbstractWorldObject {
|
|||||||
this.treeOfLifeID = rs.getInt("treeOfLifeUUID");
|
this.treeOfLifeID = rs.getInt("treeOfLifeUUID");
|
||||||
this.bindX = rs.getFloat("bindX");
|
this.bindX = rs.getFloat("bindX");
|
||||||
this.bindZ = rs.getFloat("bindZ");
|
this.bindZ = rs.getFloat("bindZ");
|
||||||
this.bindLoc = new Vector3fImmutable(this.location.getX() + this.bindX,
|
this.bindLoc = new Vector3fImmutable(this.location.getX() + this.bindX, this.location.getY(), this.location.getZ() + this.bindZ);
|
||||||
this.location.getY(),
|
|
||||||
this.location.getZ() + this.bindZ);
|
|
||||||
this.radiusType = rs.getInt("radiusType");
|
this.radiusType = rs.getInt("radiusType");
|
||||||
|
|
||||||
float bindradiustemp = rs.getFloat("bindRadius");
|
float bindradiustemp = rs.getFloat("bindRadius");
|
||||||
@@ -288,106 +286,119 @@ public class City extends AbstractWorldObject {
|
|||||||
return city.getBindLoc();
|
return city.getBindLoc();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ArrayList<City> getCitiesToTeleportTo(PlayerCharacter pc) {
|
public static ArrayList<City> getCitiesToTeleportTo(PlayerCharacter playerCharacter, boolean repledge) {
|
||||||
|
|
||||||
ArrayList<City> cities = new ArrayList<>();
|
ArrayList<City> cities = new ArrayList<>();
|
||||||
|
|
||||||
if (pc == null)
|
if (playerCharacter == null)
|
||||||
return cities;
|
return cities;
|
||||||
|
|
||||||
ConcurrentHashMap<Integer, AbstractGameObject> worldCities = DbManager.getMap(mbEnums.GameObjectType.City);
|
ConcurrentHashMap<Integer, AbstractGameObject> worldCities = DbManager.getMap(mbEnums.GameObjectType.City);
|
||||||
|
|
||||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
|
||||||
//handle compiling of cities able to be teleported to for lore rule-set
|
//handle compiling of cities able to be teleported to for lore rule-set
|
||||||
for (AbstractGameObject ago : worldCities.values()) {
|
|
||||||
City city = (City) ago;
|
|
||||||
if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
|
|
||||||
continue; // cannot teleport to perdition or bastion
|
|
||||||
if (city.isNpc == 1 && city.getGuild().charter.equals(pc.guild.charter)) {
|
|
||||||
cities.add(city); // anyone of the same charter can teleport to a safehold of that charter
|
|
||||||
continue;
|
|
||||||
} else if (city.isNoobIsle == 1 && pc.level <= 20) {
|
|
||||||
cities.add(city); // everyone can go to noob island if they are under level 20
|
|
||||||
continue;
|
|
||||||
} else if (city.cityName.equals("Khan'Ov Srekel")) {
|
|
||||||
cities.add(city); //everyone anytime can teleport to khan
|
|
||||||
continue;
|
|
||||||
} else if (city.isOpen() && city.getTOL().rank > 4 && city.getGuild().charter.equals(pc.guild.charter))
|
|
||||||
if (!city.getTOL().reverseKOS) {
|
|
||||||
cities.add(city);//can teleport to any open ToL that shares charter
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
if (city.getTOL().getCondemned().contains(pc.objectUUID) && city.getTOL().getCondemned().get(pc.objectUUID).active) {
|
|
||||||
cities.add(city);//this player is allowed for the reverse KOS
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (city.getTOL().getCondemned().contains(pc.guildUUID) && city.getTOL().getCondemned().get(pc.guildUUID).active) {
|
|
||||||
cities.add(city);//this guild is allowed for the reverse KOS
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (city.getTOL().getCondemned().contains(pc.guild.getNation().getObjectUUID()) && city.getTOL().getCondemned().get(pc.guild.getNation().getObjectUUID()).active) {
|
|
||||||
cities.add(city);//this nation is allowed for the reverse KOS
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (city.getGuild().getNation().equals(pc.guild.getNation())) {
|
|
||||||
cities.add(city);//can always teleport inside your own nation
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
|
|
||||||
Guild pcG = pc.getGuild();
|
|
||||||
//add npc cities
|
|
||||||
|
|
||||||
for (AbstractGameObject ago : worldCities.values()) {
|
for (AbstractGameObject ago : worldCities.values()) {
|
||||||
|
|
||||||
if (ago.getObjectType().equals(GameObjectType.City)) {
|
|
||||||
City city = (City) ago;
|
City city = (City) ago;
|
||||||
|
|
||||||
if (city.noTeleport)
|
// Filter Player cities
|
||||||
|
|
||||||
|
if (city.parentZone == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (city.parentZone != null && city.parentZone.guild_zone) {
|
//can't repledge to a guild you're already part of
|
||||||
|
|
||||||
if (pc.getAccount().status.equals(AccountStatus.ADMIN)) {
|
if (repledge && city.getGuild().equals(playerCharacter.guild))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (city.parentZone.guild_zone) {
|
||||||
|
|
||||||
|
//players can all port and repledge inside their own nation
|
||||||
|
|
||||||
|
if(city.getGuild().getNation().equals(playerCharacter.guild.getNation())){
|
||||||
cities.add(city);
|
cities.add(city);
|
||||||
} else
|
continue;
|
||||||
//list Player cities
|
}
|
||||||
|
|
||||||
//open city, just list
|
if (city.isOpen() && city.getTOL().rank > 4) {
|
||||||
|
|
||||||
if (city.open && city.getTOL() != null && city.getTOL().getRank() > 4) {
|
// Filter Lore cities
|
||||||
|
|
||||||
if (!BuildingManager.IsPlayerHostile(city.getTOL(), pc)) {
|
|
||||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
||||||
if (city.getGuild().getGuildType().equals(pc.guild.getGuildType())) {
|
|
||||||
|
if (repledge) {
|
||||||
|
if (!city.getGuild().charter.canJoin(playerCharacter))
|
||||||
|
continue;
|
||||||
|
} else if (!city.getGuild().charter.equals(playerCharacter.guild.charter))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Integer playerUUID = playerCharacter.objectUUID;
|
||||||
|
Integer guildUUID = playerCharacter.guildUUID;
|
||||||
|
Integer nationUUID = playerCharacter.guild.getNation().getObjectUUID();
|
||||||
|
boolean allowed = false;
|
||||||
|
|
||||||
|
if (city.getTOL().reverseKOS) {
|
||||||
|
|
||||||
|
//reverse KOS, specific values are allowed
|
||||||
|
|
||||||
|
if ((city.getTOL().getCondemned().containsKey(playerUUID) && city.getTOL().getCondemned().get(playerUUID).active) ||
|
||||||
|
(city.getTOL().getCondemned().containsKey(guildUUID) && city.getTOL().getCondemned().get(guildUUID).active) ||
|
||||||
|
(city.getTOL().getCondemned().containsKey(nationUUID) && city.getTOL().getCondemned().get(nationUUID).active))
|
||||||
|
allowed = true;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
//not reverse KOS, everyone is allowed by default
|
||||||
|
|
||||||
|
allowed = true;
|
||||||
|
|
||||||
|
//specific values are not allowed
|
||||||
|
|
||||||
|
if ((city.getTOL().getCondemned().containsKey(playerUUID) && city.getTOL().getCondemned().get(playerUUID).active) ||
|
||||||
|
(city.getTOL().getCondemned().containsKey(guildUUID) && city.getTOL().getCondemned().get(guildUUID).active) ||
|
||||||
|
(city.getTOL().getCondemned().containsKey(nationUUID) && city.getTOL().getCondemned().get(nationUUID).active))
|
||||||
|
allowed = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (allowed)
|
||||||
cities.add(city);
|
cities.add(city);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cities.add(city); //verify nation or guild is same
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (Guild.sameNationExcludeErrant(city.getGuild(), pcG))
|
|
||||||
cities.add(city);
|
|
||||||
|
|
||||||
|
// Filter NPC cities
|
||||||
|
|
||||||
} else if (city.isNpc == 1) {
|
|
||||||
|
|
||||||
//list NPC cities
|
|
||||||
|
|
||||||
Guild g = city.getGuild();
|
|
||||||
if (g == null) {
|
|
||||||
if (city.isNpc == 1)
|
|
||||||
if (city.isNoobIsle == 1) {
|
if (city.isNoobIsle == 1) {
|
||||||
if (pc.getLevel() < 21)
|
|
||||||
cities.add(city); //verify nation or guild is same
|
|
||||||
} else if (pc.getLevel() > 9)
|
|
||||||
cities.add(city); //verify nation or guild is same
|
|
||||||
|
|
||||||
} else if (pc.getLevel() >= g.getTeleportMin() && pc.getLevel() <= g.getTeleportMax())
|
if (playerCharacter.level < 20)
|
||||||
cities.add(city); //verify nation or guild is same
|
cities.add(city); // everyone can go to noob island if they are under level 20
|
||||||
|
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Players cannot teleport to perdition or bastion
|
||||||
|
|
||||||
|
if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// These cities are available for anyone off noob island
|
||||||
|
|
||||||
|
if (playerCharacter.level >= 20 && (city.cityName.equals("Sea Dog's Rest") || city.cityName.equals("Khan'Ov Srekel") || city.cityName.equals("City of Khar Th'Sekt"))) {
|
||||||
|
cities.add(city);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add Lore cities
|
||||||
|
|
||||||
|
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
||||||
|
|
||||||
|
if (repledge) {
|
||||||
|
if (city.getGuild().charter.canJoin(playerCharacter))
|
||||||
|
cities.add(city);
|
||||||
|
} else if (city.getGuild().charter.equals(playerCharacter.guild.charter))
|
||||||
|
cities.add(city);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return cities;
|
return cities;
|
||||||
@@ -586,7 +597,7 @@ public class City extends AbstractWorldObject {
|
|||||||
if (this.siegesWithstood == siegesWithstood)
|
if (this.siegesWithstood == siegesWithstood)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (DbManager.CityQueries.updateSiegesWithstood(this, siegesWithstood) == true)
|
if (DbManager.CityQueries.updateSiegesWithstood(this, siegesWithstood))
|
||||||
this.siegesWithstood = siegesWithstood;
|
this.siegesWithstood = siegesWithstood;
|
||||||
else
|
else
|
||||||
Logger.error("Error when writing to database for cityUUID: " + this.getObjectUUID());
|
Logger.error("Error when writing to database for cityUUID: " + this.getObjectUUID());
|
||||||
@@ -640,20 +651,13 @@ public class City extends AbstractWorldObject {
|
|||||||
public Guild getGuild() {
|
public Guild getGuild() {
|
||||||
|
|
||||||
if (this.getTOL() == null)
|
if (this.getTOL() == null)
|
||||||
return null;
|
return Guild.getErrantGuild();
|
||||||
|
|
||||||
if (this.isNpc == 1) {
|
|
||||||
|
|
||||||
if (this.getTOL().getOwner() == null)
|
if (this.getTOL().getOwner() == null)
|
||||||
return null;
|
return Guild.getErrantGuild();
|
||||||
return this.getTOL().getOwner().getGuild();
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if (this.getTOL().getOwner() == null)
|
|
||||||
return null;
|
|
||||||
return this.getTOL().getOwner().getGuild();
|
return this.getTOL().getOwner().getGuild();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public boolean openCity(boolean open) {
|
public boolean openCity(boolean open) {
|
||||||
|
|
||||||
@@ -731,7 +735,7 @@ public class City extends AbstractWorldObject {
|
|||||||
|
|
||||||
for (AbstractCharacter npc : getTOL().getHirelings().keySet()) {
|
for (AbstractCharacter npc : getTOL().getHirelings().keySet()) {
|
||||||
if (npc.getObjectType() == GameObjectType.NPC)
|
if (npc.getObjectType() == GameObjectType.NPC)
|
||||||
if (((NPC) npc).getContract().isRuneMaster() == true)
|
if (((NPC) npc).getContract().isRuneMaster())
|
||||||
outNPC = (NPC) npc;
|
outNPC = (NPC) npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -764,16 +768,13 @@ public class City extends AbstractWorldObject {
|
|||||||
// Set location for this city
|
// Set location for this city
|
||||||
|
|
||||||
this.location = new Vector3fImmutable(this.parentZone.absX, this.parentZone.absY, this.parentZone.absZ);
|
this.location = new Vector3fImmutable(this.parentZone.absX, this.parentZone.absY, this.parentZone.absZ);
|
||||||
this.bindLoc = new Vector3fImmutable(this.location.x + this.bindX,
|
this.bindLoc = new Vector3fImmutable(this.location.x + this.bindX, this.location.y, this.location.z + this.bindZ);
|
||||||
this.location.y,
|
|
||||||
this.location.z + this.bindZ);
|
|
||||||
|
|
||||||
// set city bounds
|
// set city bounds
|
||||||
|
|
||||||
Bounds cityBounds = Bounds.borrow();
|
Bounds cityBounds = Bounds.borrow();
|
||||||
cityBounds.setBounds(new Vector2f(this.location.x + 64, this.location.z + 64), // location x and z are offset by 64 from the center of the city.
|
cityBounds.setBounds(new Vector2f(this.location.x + 64, this.location.z + 64), // location x and z are offset by 64 from the center of the city.
|
||||||
new Vector2f(mbEnums.CityBoundsType.GRID.halfExtents, mbEnums.CityBoundsType.GRID.halfExtents),
|
new Vector2f(mbEnums.CityBoundsType.GRID.halfExtents, mbEnums.CityBoundsType.GRID.halfExtents), 0.0f);
|
||||||
0.0f);
|
|
||||||
this.setBounds(cityBounds);
|
this.setBounds(cityBounds);
|
||||||
|
|
||||||
// Sanity check; no tol
|
// Sanity check; no tol
|
||||||
@@ -781,8 +782,7 @@ public class City extends AbstractWorldObject {
|
|||||||
if (BuildingManager.getBuilding(this.treeOfLifeID) == null)
|
if (BuildingManager.getBuilding(this.treeOfLifeID) == null)
|
||||||
Logger.info("City UID " + this.getObjectUUID() + " Failed to Load Tree of Life with ID " + this.treeOfLifeID);
|
Logger.info("City UID " + this.getObjectUUID() + " Failed to Load Tree of Life with ID " + this.treeOfLifeID);
|
||||||
|
|
||||||
if ((ConfigManager.serverType.equals(ServerType.WORLDSERVER))
|
if ((ConfigManager.serverType.equals(ServerType.WORLDSERVER)) && (this.isNpc == (byte) 0)) {
|
||||||
&& (this.isNpc == (byte) 0)) {
|
|
||||||
|
|
||||||
this.realm = RealmMap.getRealmAtLocation(this.getLoc());
|
this.realm = RealmMap.getRealmAtLocation(this.getLoc());
|
||||||
|
|
||||||
@@ -802,8 +802,7 @@ public class City extends AbstractWorldObject {
|
|||||||
if (this.getGuild().getGuildState() == GuildState.Nation)
|
if (this.getGuild().getGuildState() == GuildState.Nation)
|
||||||
for (Guild sub : this.getGuild().getSubGuildList()) {
|
for (Guild sub : this.getGuild().getSubGuildList()) {
|
||||||
|
|
||||||
if ((sub.getGuildState() == GuildState.Protectorate) ||
|
if ((sub.getGuildState() == GuildState.Protectorate) || (sub.getGuildState() == GuildState.Province)) {
|
||||||
(sub.getGuildState() == GuildState.Province)) {
|
|
||||||
this.isCapital = 1;
|
this.isCapital = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -828,7 +827,7 @@ public class City extends AbstractWorldObject {
|
|||||||
|
|
||||||
this.setHash();
|
this.setHash();
|
||||||
|
|
||||||
if (DataWarehouse.recordExists(mbEnums.DataRecordType.CITY, this.getObjectUUID()) == false) {
|
if (!DataWarehouse.recordExists(DataRecordType.CITY, this.getObjectUUID())) {
|
||||||
CityRecord cityRecord = CityRecord.borrow(this, mbEnums.RecordEventType.CREATE);
|
CityRecord cityRecord = CityRecord.borrow(this, mbEnums.RecordEventType.CREATE);
|
||||||
DataWarehouse.pushToWarehouse(cityRecord);
|
DataWarehouse.pushToWarehouse(cityRecord);
|
||||||
}
|
}
|
||||||
@@ -853,9 +852,7 @@ public class City extends AbstractWorldObject {
|
|||||||
|
|
||||||
for (Building building : this.parentZone.zoneBuildingSet) {
|
for (Building building : this.parentZone.zoneBuildingSet) {
|
||||||
|
|
||||||
if (building.getBlueprint() != null &&
|
if (building.getBlueprint() != null && building.getBlueprint().getBuildingGroup() != BuildingGroup.BANESTONE && building.getBlueprint().getBuildingGroup() != BuildingGroup.TOL) {
|
||||||
building.getBlueprint().getBuildingGroup() != BuildingGroup.BANESTONE &&
|
|
||||||
building.getBlueprint().getBuildingGroup() != BuildingGroup.TOL) {
|
|
||||||
|
|
||||||
building.healthMax += (building.healthMax * Realm.getRealmHealthMod(this));
|
building.healthMax += (building.healthMax * Realm.getRealmHealthMod(this));
|
||||||
|
|
||||||
@@ -937,7 +934,7 @@ public class City extends AbstractWorldObject {
|
|||||||
|
|
||||||
// Reapply effect with timeout?
|
// Reapply effect with timeout?
|
||||||
|
|
||||||
if (refreshEffect == true)
|
if (refreshEffect)
|
||||||
player.addCityEffect(Integer.toString(effectBase.getUUID()), effectBase, rank, MBServerStatics.FOURTYFIVE_SECONDS, false, this);
|
player.addCityEffect(Integer.toString(effectBase.getUUID()), effectBase, rank, MBServerStatics.FOURTYFIVE_SECONDS, false, this);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1193,19 +1190,17 @@ public class City extends AbstractWorldObject {
|
|||||||
// All protection contracts are void upon transfer of a city
|
// All protection contracts are void upon transfer of a city
|
||||||
//Dont forget to not Flip protection on Banestones and siege Equipment... Noob.
|
//Dont forget to not Flip protection on Banestones and siege Equipment... Noob.
|
||||||
|
|
||||||
if (cityBuilding.getBlueprint() != null && !cityBuilding.getBlueprint().isSiegeEquip()
|
if (cityBuilding.getBlueprint() != null && !cityBuilding.getBlueprint().isSiegeEquip() && cityBuilding.getBlueprint().getBuildingGroup() != BuildingGroup.BANESTONE)
|
||||||
&& cityBuilding.getBlueprint().getBuildingGroup() != BuildingGroup.BANESTONE)
|
|
||||||
cityBuilding.setProtectionState(ProtectionState.NONE);
|
cityBuilding.setProtectionState(ProtectionState.NONE);
|
||||||
|
|
||||||
// Transfer ownership of valid city assets
|
// Transfer ownership of valid city assets
|
||||||
// these assets are autoprotected.
|
// these assets are autoprotected.
|
||||||
|
|
||||||
if ((cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.TOL)
|
if ((cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.TOL) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SPIRE) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.BARRACK) || (cityBuilding.getBlueprint().isWallPiece()) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SHRINE)) {
|
||||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SPIRE)
|
PlayerCharacter guildLeader = PlayerCharacter.getPlayerCharacter(sourcePlayer.guild.getGuildLeaderUUID());
|
||||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.BARRACK)
|
if(guildLeader != null)
|
||||||
|| (cityBuilding.getBlueprint().isWallPiece())
|
cityBuilding.claim(guildLeader);
|
||||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SHRINE)) {
|
else
|
||||||
|
|
||||||
cityBuilding.claim(sourcePlayer);
|
cityBuilding.claim(sourcePlayer);
|
||||||
cityBuilding.setProtectionState(ProtectionState.PROTECTED);
|
cityBuilding.setProtectionState(ProtectionState.PROTECTED);
|
||||||
}
|
}
|
||||||
@@ -1213,6 +1208,7 @@ public class City extends AbstractWorldObject {
|
|||||||
|
|
||||||
this.setForceRename(true);
|
this.setForceRename(true);
|
||||||
|
|
||||||
|
|
||||||
// Reset city timer for map update
|
// Reset city timer for map update
|
||||||
|
|
||||||
City.lastCityUpdate = System.currentTimeMillis();
|
City.lastCityUpdate = System.currentTimeMillis();
|
||||||
@@ -1245,12 +1241,7 @@ public class City extends AbstractWorldObject {
|
|||||||
// Transfer ownership of valid city assets
|
// Transfer ownership of valid city assets
|
||||||
// these assets are autoprotected.
|
// these assets are autoprotected.
|
||||||
|
|
||||||
if ((cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.TOL)
|
if ((cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.TOL) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SPIRE) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.BARRACK) || (cityBuilding.getBlueprint().isWallPiece()) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SHRINE)) {
|
||||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SPIRE)
|
|
||||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.BARRACK)
|
|
||||||
|| (cityBuilding.getBlueprint().isWallPiece())
|
|
||||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SHRINE)
|
|
||||||
) {
|
|
||||||
|
|
||||||
cityBuilding.claim(sourcePlayer);
|
cityBuilding.claim(sourcePlayer);
|
||||||
cityBuilding.setProtectionState(ProtectionState.PROTECTED);
|
cityBuilding.setProtectionState(ProtectionState.PROTECTED);
|
||||||
|
|||||||
@@ -193,12 +193,16 @@ public class Guild extends AbstractWorldObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean sameNationExcludeErrant(Guild a, Guild b) {
|
public static boolean sameNationExcludeErrant(Guild a, Guild b) {
|
||||||
|
|
||||||
if (a == null || b == null)
|
if (a == null || b == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (a.getObjectUUID() == b.getObjectUUID())
|
if (a.getObjectUUID() == b.getObjectUUID())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (a.nation == null || b.nation == null)
|
if (a.nation == null || b.nation == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return a.nation.getObjectUUID() == b.nation.getObjectUUID() && !a.nation.isEmptyGuild();
|
return a.nation.getObjectUUID() == b.nation.getObjectUUID() && !a.nation.isEmptyGuild();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -694,7 +694,7 @@ public class Item extends AbstractWorldObject {
|
|||||||
this.bonuses.clear();
|
this.bonuses.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getBonus(ModType modType, SourceType sourceType) {
|
public float getBonus(ModType modType, EffectSourceType 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, SourceType sourceType) {
|
public float getBonusPercent(ModType modType, EffectSourceType sourceType) {
|
||||||
|
|
||||||
int amount = 0;
|
int amount = 0;
|
||||||
for (AbstractEffectModifier modifier : this.getBonuses().keySet()) {
|
for (AbstractEffectModifier modifier : this.getBonuses().keySet()) {
|
||||||
|
|||||||
+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, SourceType.Strength);
|
strVal += this.bonuses.getFloat(ModType.Attr, EffectSourceType.Strength);
|
||||||
dexVal += this.bonuses.getFloat(ModType.Attr, SourceType.Dexterity);
|
dexVal += this.bonuses.getFloat(ModType.Attr, EffectSourceType.Dexterity);
|
||||||
conVal += this.bonuses.getFloat(ModType.Attr, SourceType.Constitution);
|
conVal += this.bonuses.getFloat(ModType.Attr, EffectSourceType.Constitution);
|
||||||
intVal += this.bonuses.getFloat(ModType.Attr, SourceType.Intelligence);
|
intVal += this.bonuses.getFloat(ModType.Attr, EffectSourceType.Intelligence);
|
||||||
spiVal += this.bonuses.getFloat(ModType.Attr, SourceType.Spirit);
|
spiVal += this.bonuses.getFloat(ModType.Attr, EffectSourceType.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, SourceType.Strength));
|
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.Strength));
|
||||||
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Dexterity));
|
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.Dexterity));
|
||||||
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Constitution));
|
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.Constitution));
|
||||||
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Intelligence));
|
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.Intelligence));
|
||||||
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Spirit));
|
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.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, SourceType.None));
|
bonus *= (1 + this.bonuses.getFloatPercentAll(ModType.Speed, EffectSourceType.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, SourceType.None) || this.getBonuses().getBool(ModType.CannotMove, SourceType.None)) {
|
if (this.isAlive() == false || this.getBonuses().getBool(ModType.Stunned, EffectSourceType.None) || this.getBonuses().getBool(ModType.CannotMove, EffectSourceType.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, SourceType.None);
|
h += this.bonuses.getFloat(ModType.HealthFull, EffectSourceType.None);
|
||||||
m += this.bonuses.getFloat(ModType.ManaFull, SourceType.None);
|
m += this.bonuses.getFloat(ModType.ManaFull, EffectSourceType.None);
|
||||||
s += this.bonuses.getFloat(ModType.StaminaFull, SourceType.None);
|
s += this.bonuses.getFloat(ModType.StaminaFull, EffectSourceType.None);
|
||||||
|
|
||||||
//apply effects percent modifiers. DO THIS LAST!
|
//apply effects percent modifiers. DO THIS LAST!
|
||||||
|
|
||||||
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.None));
|
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, EffectSourceType.None));
|
||||||
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.None));
|
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, EffectSourceType.None));
|
||||||
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.None));
|
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, EffectSourceType.None));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set max health, mana and stamina
|
// Set max health, mana and stamina
|
||||||
|
|||||||
@@ -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<SourceType>> bonusLists = new ConcurrentHashMap<>();
|
private ConcurrentHashMap<ModType, HashSet<EffectSourceType>> bonusLists = new ConcurrentHashMap<>();
|
||||||
private ConcurrentHashMap<ModType, HashMap<SourceType, Boolean>> bonusBools = new ConcurrentHashMap<>();
|
private ConcurrentHashMap<ModType, HashMap<EffectSourceType, Boolean>> bonusBools = new ConcurrentHashMap<>();
|
||||||
private ConcurrentHashMap<SourceType, Float> skillBonuses = new ConcurrentHashMap<>();
|
private ConcurrentHashMap<EffectSourceType, 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, SourceType.None);
|
float seeInvis = this.getFloat(ModType.SeeInvisible, EffectSourceType.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<SourceType> val) {
|
public void setList(ModType mod, HashSet<EffectSourceType> 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, SourceType sourceType) {
|
public boolean getBool(ModType modType, EffectSourceType 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(SourceType sourceType) {
|
public float getSkillBonus(EffectSourceType 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, SourceType sourceType) {
|
public float getFloat(ModType modType, EffectSourceType 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, SourceType sourceType) {
|
public float getFloatPercentPositive(ModType modType, EffectSourceType 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, SourceType sourceType) {
|
public float getFloatPercentAll(ModType modType, EffectSourceType 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, SourceType sourceType) {
|
public float getFloatPercentNullZero(ModType modType, EffectSourceType 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, SourceType sourceType) {
|
public float getFloatPercentNegative(ModType modType, EffectSourceType 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<SourceType> getList(ModType modType) {
|
public HashSet<EffectSourceType> 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 (SourceType sourceType : this.bonusBools.get(modType).keySet()) {
|
for (EffectSourceType 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 (SourceType sourceType : SourceType.values()) {
|
for (EffectSourceType sourceType : EffectSourceType.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(SourceType.None) == false ? sourceType.name() : "") + " = " + amount);
|
ChatManager.chatSystemInfo(pc, modType.name() + "-" + (sourceType.equals(EffectSourceType.None) == false ? sourceType.name() : "") + " = " + amount);
|
||||||
|
|
||||||
if (percentAmount != 0)
|
if (percentAmount != 0)
|
||||||
ChatManager.chatSystemInfo(pc, "Percent : " + modType.name() + "-" + (sourceType.equals(SourceType.None) == false ? sourceType.name() : "") + " = " + percentAmount);
|
ChatManager.chatSystemInfo(pc, "Percent : " + modType.name() + "-" + (sourceType.equals(EffectSourceType.None) == false ? sourceType.name() : "") + " = " + percentAmount);
|
||||||
|
|
||||||
if (percentAmountNegative != 0)
|
if (percentAmountNegative != 0)
|
||||||
ChatManager.chatSystemInfo(pc, "Negative Percent : " + modType.name() + "-" + (sourceType.equals(SourceType.None) == false ? sourceType.name() : "") + " = " + percentAmountNegative);
|
ChatManager.chatSystemInfo(pc, "Negative Percent : " + modType.name() + "-" + (sourceType.equals(EffectSourceType.None) == false ? sourceType.name() : "") + " = " + percentAmountNegative);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -472,11 +472,11 @@ public class PlayerBonuses {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setBool(ModType modType, SourceType sourceType, boolean val) {
|
public void setBool(ModType modType, EffectSourceType sourceType, boolean val) {
|
||||||
if (val == true) {
|
if (val == true) {
|
||||||
|
|
||||||
if (this.bonusBools.get(modType) == null) {
|
if (this.bonusBools.get(modType) == null) {
|
||||||
HashMap<SourceType, Boolean> sourceMap = new HashMap<>();
|
HashMap<EffectSourceType, 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, SourceType.None);
|
bonus += this.bonuses.getFloatPercentNullZero(ModType.Speed, EffectSourceType.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, SourceType.None);
|
this.hidden = (int) bonuses.getFloat(ModType.Invisible, EffectSourceType.None);
|
||||||
this.seeInvis = (int) bonuses.getFloat(ModType.SeeInvisible, SourceType.None);
|
this.seeInvis = (int) bonuses.getFloat(ModType.SeeInvisible, EffectSourceType.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, SourceType.Strength));
|
strVal += Math.round(this.bonuses.getFloat(ModType.Attr, EffectSourceType.Strength));
|
||||||
dexVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.Dexterity));
|
dexVal += Math.round(this.bonuses.getFloat(ModType.Attr, EffectSourceType.Dexterity));
|
||||||
conVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.Constitution));
|
conVal += Math.round(this.bonuses.getFloat(ModType.Attr, EffectSourceType.Constitution));
|
||||||
intVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.Intelligence));
|
intVal += Math.round(this.bonuses.getFloat(ModType.Attr, EffectSourceType.Intelligence));
|
||||||
spiVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.Spirit));
|
spiVal += Math.round(this.bonuses.getFloat(ModType.Attr, EffectSourceType.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, SourceType.Strength));
|
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.Strength));
|
||||||
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Dexterity));
|
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.Dexterity));
|
||||||
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Constitution));
|
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.Constitution));
|
||||||
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Intelligence));
|
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.Intelligence));
|
||||||
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Spirit));
|
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, EffectSourceType.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, SourceType.None, false);
|
this.bonuses.setBool(ModType.Block, EffectSourceType.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, SourceType.None, true);
|
this.bonuses.setBool(ModType.Block, EffectSourceType.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, SourceType.None, true);
|
this.bonuses.setBool(ModType.Dodge, EffectSourceType.None, true);
|
||||||
else
|
else
|
||||||
this.bonuses.setBool(ModType.Dodge, SourceType.None, false);
|
this.bonuses.setBool(ModType.Dodge, EffectSourceType.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, SourceType.None, false);
|
this.bonuses.setBool(ModType.Parry, EffectSourceType.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, SourceType.None, true);
|
this.bonuses.setBool(ModType.Parry, EffectSourceType.None, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3892,13 +3892,13 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
|
|
||||||
|
|
||||||
//apply effects
|
//apply effects
|
||||||
h += this.bonuses.getFloat(ModType.HealthFull, SourceType.None);
|
h += this.bonuses.getFloat(ModType.HealthFull, EffectSourceType.None);
|
||||||
m += this.bonuses.getFloat(ModType.ManaFull, SourceType.None);
|
m += this.bonuses.getFloat(ModType.ManaFull, EffectSourceType.None);
|
||||||
s += this.bonuses.getFloat(ModType.StaminaFull, SourceType.None);
|
s += this.bonuses.getFloat(ModType.StaminaFull, EffectSourceType.None);
|
||||||
|
|
||||||
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.None));
|
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, EffectSourceType.None));
|
||||||
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.None));
|
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, EffectSourceType.None));
|
||||||
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.None));
|
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, EffectSourceType.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, SourceType.None))
|
if (!this.bonuses.getBool(modType, EffectSourceType.None))
|
||||||
return 0f;
|
return 0f;
|
||||||
|
|
||||||
// must not be stunned
|
// must not be stunned
|
||||||
if (this.bonuses.getBool(ModType.Stunned, SourceType.None))
|
if (this.bonuses.getBool(ModType.Stunned, EffectSourceType.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, SourceType.None);
|
amount += this.bonuses.getFloat(modType, EffectSourceType.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, SourceType.None) || this.getBonuses().getBool(ModType.CannotMove, SourceType.None)) {
|
if (this.isAlive() == false || this.getBonuses().getBool(ModType.Stunned, EffectSourceType.None) || this.getBonuses().getBool(ModType.CannotMove, EffectSourceType.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, SourceType.None);
|
float damageCap = bonus.getFloatPercentAll(ModType.DamageCap, EffectSourceType.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<SourceType> forts = bonus.getList(ModType.IgnoreDamageCap);
|
HashSet<EffectSourceType> 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, SourceType.None);
|
float adjustedDamage = bonus.getFloatPercentAll(ModType.AdjustAboveDmgCap, EffectSourceType.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<SourceType> forts, mbEnums.DamageType damageType, boolean exclusive) {
|
private static boolean isValidDamageCapType(HashSet<EffectSourceType> forts, mbEnums.DamageType damageType, boolean exclusive) {
|
||||||
for (SourceType fort : forts) {
|
for (EffectSourceType 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, SourceType.None);
|
float ap = source.getBonuses().getFloatPercentAll(ModType.ArmorPiercing, EffectSourceType.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, SourceType.Stun))
|
if (rb.getBool(ModType.ImmuneTo, EffectSourceType.Stun))
|
||||||
this.immuneTo.put(mbEnums.DamageType.STUN, true);
|
this.immuneTo.put(mbEnums.DamageType.STUN, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Blind))
|
if (rb.getBool(ModType.ImmuneTo, EffectSourceType.Blind))
|
||||||
this.immuneTo.put(mbEnums.DamageType.BLIND, true);
|
this.immuneTo.put(mbEnums.DamageType.BLINDNESS, true);
|
||||||
if (rb.getBool(ModType.ImmuneToAttack, SourceType.None))
|
if (rb.getBool(ModType.ImmuneToAttack, EffectSourceType.None))
|
||||||
this.immuneTo.put(mbEnums.DamageType.ATTACK, true);
|
this.immuneTo.put(mbEnums.DamageType.ATTACK, true);
|
||||||
if (rb.getBool(ModType.ImmuneToPowers, SourceType.None))
|
if (rb.getBool(ModType.ImmuneToPowers, EffectSourceType.None))
|
||||||
this.immuneTo.put(mbEnums.DamageType.POWERS, true);
|
this.immuneTo.put(mbEnums.DamageType.POWERS, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Powerblock))
|
if (rb.getBool(ModType.ImmuneTo, EffectSourceType.Powerblock))
|
||||||
this.immuneTo.put(mbEnums.DamageType.POWERBLOCK, true);
|
this.immuneTo.put(mbEnums.DamageType.POWERINHIBITOR, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.DeBuff))
|
if (rb.getBool(ModType.ImmuneTo, EffectSourceType.DeBuff))
|
||||||
this.immuneTo.put(mbEnums.DamageType.DEBUFF, true);
|
this.immuneTo.put(mbEnums.DamageType.DEBUFF, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Fear))
|
if (rb.getBool(ModType.ImmuneTo, EffectSourceType.Fear))
|
||||||
this.immuneTo.put(mbEnums.DamageType.FEAR, true);
|
this.immuneTo.put(mbEnums.DamageType.FEAR, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Charm))
|
if (rb.getBool(ModType.ImmuneTo, EffectSourceType.Charm))
|
||||||
this.immuneTo.put(mbEnums.DamageType.CHARM, true);
|
this.immuneTo.put(mbEnums.DamageType.CHARM, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Root))
|
if (rb.getBool(ModType.ImmuneTo, EffectSourceType.Root))
|
||||||
this.immuneTo.put(mbEnums.DamageType.ROOT, true);
|
this.immuneTo.put(mbEnums.DamageType.ROOT, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Snare))
|
if (rb.getBool(ModType.ImmuneTo, EffectSourceType.Snare))
|
||||||
this.immuneTo.put(mbEnums.DamageType.SNARE, true);
|
this.immuneTo.put(mbEnums.DamageType.SNARE, true);
|
||||||
|
|
||||||
// Handle resists
|
// Handle resists
|
||||||
slash += rb.getFloat(ModType.Resistance, SourceType.Slashing);
|
slash += rb.getFloat(ModType.Resistance, EffectSourceType.Slashing);
|
||||||
crush += rb.getFloat(ModType.Resistance, SourceType.Crushing);
|
crush += rb.getFloat(ModType.Resistance, EffectSourceType.Crushing);
|
||||||
pierce += rb.getFloat(ModType.Resistance, SourceType.Piercing);
|
pierce += rb.getFloat(ModType.Resistance, EffectSourceType.Piercing);
|
||||||
magic += rb.getFloat(ModType.Resistance, SourceType.Magic);
|
magic += rb.getFloat(ModType.Resistance, EffectSourceType.Magic);
|
||||||
bleed += rb.getFloat(ModType.Resistance, SourceType.Bleeding);
|
bleed += rb.getFloat(ModType.Resistance, EffectSourceType.Bleeding);
|
||||||
poison += rb.getFloat(ModType.Resistance, SourceType.Poison);
|
poison += rb.getFloat(ModType.Resistance, EffectSourceType.Poison);
|
||||||
mental += rb.getFloat(ModType.Resistance, SourceType.Mental);
|
mental += rb.getFloat(ModType.Resistance, EffectSourceType.Mental);
|
||||||
holy += rb.getFloat(ModType.Resistance, SourceType.Holy);
|
holy += rb.getFloat(ModType.Resistance, EffectSourceType.Holy);
|
||||||
unholy += rb.getFloat(ModType.Resistance, SourceType.Unholy);
|
unholy += rb.getFloat(ModType.Resistance, EffectSourceType.Unholy);
|
||||||
lightning += rb.getFloat(ModType.Resistance, SourceType.Lightning);
|
lightning += rb.getFloat(ModType.Resistance, EffectSourceType.Lightning);
|
||||||
fire += rb.getFloat(ModType.Resistance, SourceType.Fire);
|
fire += rb.getFloat(ModType.Resistance, EffectSourceType.Fire);
|
||||||
cold += rb.getFloat(ModType.Resistance, SourceType.Cold);
|
cold += rb.getFloat(ModType.Resistance, EffectSourceType.Cold);
|
||||||
healing += rb.getFloat(ModType.Resistance, SourceType.Healing); // DamageType.Healing.name());
|
healing += rb.getFloat(ModType.Resistance, EffectSourceType.Heal); // DamageType.Healing.name());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
package engine.objects;
|
package engine.objects;
|
||||||
|
|
||||||
import engine.gameManager.DbManager;
|
import engine.gameManager.DbManager;
|
||||||
import engine.mbEnums.SourceType;
|
import engine.mbEnums.EffectSourceType;
|
||||||
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 SourceType sourceType;
|
public EffectSourceType 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 = SourceType.GetSourceType(this.nameNoSpace.replace(",", ""));
|
this.sourceType = EffectSourceType.getEffectSourceType(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 = SourceType.GetSourceType(this.nameNoSpace.replace("-", "").replace("\"", "").replace(",", ""));
|
this.sourceType = EffectSourceType.getEffectSourceType(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");
|
||||||
|
|||||||
@@ -429,7 +429,7 @@ public class Warehouse {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (addToInventory)
|
if (addToInventory)
|
||||||
if (!itemMan.hasRoomInventory(template.item_wt * amount)) {
|
if (!itemMan.hasRoomInventory(template.item_wt)) {
|
||||||
ChatManager.chatSystemInfo(playerCharacter, "You can not carry any more of that item.");
|
ChatManager.chatSystemInfo(playerCharacter, "You can not carry any more of that item.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,9 @@ 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.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.AbstractCharacter;
|
||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
@@ -244,32 +245,23 @@ public class ActionsBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Add blocked types here
|
//Add blocked types here
|
||||||
public boolean blocked(AbstractWorldObject awo, PowersBase pb, int trains) {
|
public boolean blocked(AbstractWorldObject awo, boolean vampDrain) {
|
||||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
//Check for immunities
|
||||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
if (AbstractCharacter.IsAbstractCharacter(awo)){
|
||||||
PlayerBonuses bonus = ac.getBonuses();
|
AbstractCharacter pcTarget = (AbstractCharacter) awo;
|
||||||
if (bonus == null)
|
PlayerBonuses bonus = pcTarget.getBonuses();
|
||||||
return false;
|
|
||||||
|
|
||||||
//TODO make this more efficient then testing strings
|
if(vampDrain)
|
||||||
if (this.stackType.equals("Stun") && bonus.getBool(ModType.ImmuneTo, SourceType.STUN))
|
return bonus.getBool(ModType.BlockedPowerType, EffectSourceType.VAMPDRAIN);
|
||||||
return true; //Currently stun immune. Skip stun
|
|
||||||
else if (this.stackType.equals("Snare") && bonus.getBool(ModType.ImmuneTo, SourceType.Snare))
|
if ((this.stackType.equals("Flight") && bonus.getBool(ModType.NoMod, EffectSourceType.Fly)) ||
|
||||||
return true; //Currently snare immune. Skip snare
|
(this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, EffectSourceType.None))) {
|
||||||
else if (this.stackType.equals("Blindness") && bonus.getBool(ModType.ImmuneTo, SourceType.Blind))
|
|
||||||
return true; //Currently blind immune. Skip blind
|
|
||||||
else if (this.stackType.equals("PowerInhibitor") && bonus.getBool(ModType.ImmuneTo, SourceType.Powerblock))
|
|
||||||
return true; //Currently power block immune. Skip power block
|
|
||||||
else if (this.stackType.equals("Root") && bonus.getBool(ModType.ImmuneTo, SourceType.Root))
|
|
||||||
return true;
|
return true;
|
||||||
// else if (pb.isHeal() && (bonus.getByte("immuneTo.Heal")) >= trains)
|
}
|
||||||
// return true; //Currently shadowmantled. Skip heals
|
|
||||||
else if (this.stackType.equals("Flight") && bonus.getBool(ModType.NoMod, SourceType.Fly))
|
mbEnums.DamageType damageType = mbEnums.DamageType.getDamageType(this.stackType.toUpperCase());
|
||||||
return true;
|
return pcTarget.getResists().immuneTo(damageType);
|
||||||
else if (this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, SourceType.None))
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return pb.vampDrain() && bonus.getBool(ModType.BlockedPowerType, SourceType.VAMPDRAIN);
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -633,4 +633,8 @@ public class PowersBase {
|
|||||||
return description;
|
return description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean enforceLore(){
|
||||||
|
return this.powerCategory.equals(PowerCategoryType.SUMMON) || this.powerCategory.equals(PowerCategoryType.HEAL)|| this.powerCategory.equals(PowerCategoryType.BUFF);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 SourceType sourceType;
|
public EffectSourceType 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 = SourceType.GetSourceType(this.type.replace(" ", "").replace("-", ""));
|
this.sourceType = EffectSourceType.getEffectSourceType(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, SourceType.None, true);
|
bonus.setBool(ModType.Ambidexterity, EffectSourceType.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();
|
||||||
SourceType sourceType = SourceType.valueOf(this.type);
|
EffectSourceType sourceType = EffectSourceType.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 Invisible:
|
case Invisibility:
|
||||||
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, SourceType.None)));
|
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, EffectSourceType.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, SourceType.Heal) >= trains) {
|
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, EffectSourceType.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, SourceType.None));
|
modAmount *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, EffectSourceType.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, SourceType.Heal) >= trains) {
|
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, EffectSourceType.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 Fly:
|
case Flight:
|
||||||
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, SourceType.None)));
|
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, EffectSourceType.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, SourceType.Heal) >= trains) {
|
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, EffectSourceType.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, SourceType.None);
|
boolean noSilence = bonuses.getBool(ModType.Silenced, EffectSourceType.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, SourceType.TELEPORT))
|
if (source.getBonuses().getBool(ModType.BlockedPowerType, EffectSourceType.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, SourceType.None));
|
damage *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, EffectSourceType.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, SourceType.Drain)) {
|
if (from.getBonuses().getBool(ModType.ImmuneTo, EffectSourceType.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);
|
||||||
|
|||||||
@@ -125,6 +125,13 @@ public class DestroyCityThread implements Runnable {
|
|||||||
|
|
||||||
cityBuilding.setProtectionState(mbEnums.ProtectionState.NONE);
|
cityBuilding.setProtectionState(mbEnums.ProtectionState.NONE);
|
||||||
|
|
||||||
|
// Remove warehouse entry if one exists.
|
||||||
|
|
||||||
|
if (cityBuilding.getBlueprint().getBuildingGroup() == mbEnums.BuildingGroup.WAREHOUSE) {
|
||||||
|
DbManager.WarehouseQueries.DELETE_WAREHOUSE(city.warehouse);
|
||||||
|
city.warehouse = null;
|
||||||
|
}
|
||||||
|
|
||||||
// Destroy all remaining city assets
|
// Destroy all remaining city assets
|
||||||
|
|
||||||
if ((cityBuilding.getBlueprint().getBuildingGroup() == mbEnums.BuildingGroup.BARRACK)
|
if ((cityBuilding.getBlueprint().getBuildingGroup() == mbEnums.BuildingGroup.BARRACK)
|
||||||
|
|||||||
Reference in New Issue
Block a user