|
|
|
@@ -597,34 +597,8 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param abstractCharacter
|
|
|
|
|
* @ Calculates Atr (both hands) Defense, and Damage for pc
|
|
|
|
|
*/
|
|
|
|
|
public static void calculateAtrDefenseDamage(AbstractCharacter abstractCharacter) {
|
|
|
|
|
if (abstractCharacter.charItemManager == null || abstractCharacter.charItemManager.getEquipped() == null || abstractCharacter.skills == null) {
|
|
|
|
|
Logger.error("Player " + abstractCharacter.getObjectUUID() + " missing skills or equipment");
|
|
|
|
|
defaultAtrAndDamage(abstractCharacter, true);
|
|
|
|
|
defaultAtrAndDamage(abstractCharacter, false);
|
|
|
|
|
abstractCharacter.defenseRating = 0;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
public static void AssignDefenseValue(AbstractCharacter abstractCharacter){
|
|
|
|
|
ConcurrentHashMap<EquipSlotType, Item> equipped = abstractCharacter.charItemManager.getEquipped();
|
|
|
|
|
|
|
|
|
|
// // Reset passives
|
|
|
|
|
// if (this.bonuses != null) {
|
|
|
|
|
// this.bonuses.setBool("Block", false);
|
|
|
|
|
// this.bonuses.setBool("Parry", false);
|
|
|
|
|
// if (this.baseClass != null && this.baseClass.getUUID() == 2502)
|
|
|
|
|
// this.bonuses.setBool("Dodge", true);
|
|
|
|
|
// else
|
|
|
|
|
// this.bonuses.setBool("Dodge", false);
|
|
|
|
|
// }
|
|
|
|
|
// calculate atr and damage for each hand
|
|
|
|
|
calculateAtrDamageForWeapon(abstractCharacter, equipped.get(EquipSlotType.RHELD), true, equipped.get(EquipSlotType.RHELD));
|
|
|
|
|
calculateAtrDamageForWeapon(abstractCharacter, equipped.get(EquipSlotType.LHELD), false, equipped.get(EquipSlotType.LHELD));
|
|
|
|
|
|
|
|
|
|
// No Defense while in DeathShroud
|
|
|
|
|
if (abstractCharacter.effects != null && abstractCharacter.effects.containsKey("DeathShroud"))
|
|
|
|
|
abstractCharacter.defenseRating = (short) 0;
|
|
|
|
|
else {
|
|
|
|
@@ -664,11 +638,39 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|
|
|
|
abstractCharacter.defenseRating = (short) (defense + 0.5f);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* @param abstractCharacter
|
|
|
|
|
* @ Calculates Atr (both hands) Defense, and Damage for pc
|
|
|
|
|
*/
|
|
|
|
|
public static void calculateAtrDefenseDamage(AbstractCharacter abstractCharacter) {
|
|
|
|
|
if (abstractCharacter.charItemManager == null || abstractCharacter.charItemManager.getEquipped() == null || abstractCharacter.skills == null) {
|
|
|
|
|
Logger.error("Player " + abstractCharacter.getObjectUUID() + " missing skills or equipment");
|
|
|
|
|
defaultAtrAndDamage(abstractCharacter, true);
|
|
|
|
|
defaultAtrAndDamage(abstractCharacter, false);
|
|
|
|
|
abstractCharacter.defenseRating = 0;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
AssignDefenseValue(abstractCharacter);
|
|
|
|
|
// calculate atr and damage for each hand
|
|
|
|
|
ConcurrentHashMap<EquipSlotType, Item> equipped = abstractCharacter.charItemManager.getEquipped();
|
|
|
|
|
AssignDamageAtrForPlayers(abstractCharacter, equipped.get(EquipSlotType.RHELD), true, equipped.get(EquipSlotType.RHELD));
|
|
|
|
|
AssignDamageAtrForPlayers(abstractCharacter, equipped.get(EquipSlotType.LHELD), false, equipped.get(EquipSlotType.LHELD));
|
|
|
|
|
if(abstractCharacter.getObjectType().equals(GameObjectType.Mob)){
|
|
|
|
|
Mob mob = (Mob) abstractCharacter;
|
|
|
|
|
abstractCharacter.minDamageHandOne += (int)mob.mobBase.getDamageMin();
|
|
|
|
|
abstractCharacter.minDamageHandTwo += (int)mob.mobBase.getDamageMin();
|
|
|
|
|
abstractCharacter.maxDamageHandOne += (int)mob.mobBase.getDamageMax();
|
|
|
|
|
abstractCharacter.maxDamageHandTwo += (int)mob.mobBase.getDamageMax();
|
|
|
|
|
abstractCharacter.atrHandOne += mob.mobBase.getAttackRating();
|
|
|
|
|
abstractCharacter.atrHandTwo += mob.mobBase.getAttackRating();
|
|
|
|
|
abstractCharacter.defenseRating += mob.mobBase.getDefenseRating();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ Calculates Atr, and Damage for each weapon
|
|
|
|
|
*/
|
|
|
|
|
public static void calculateAtrDamageForWeapon(AbstractCharacter abstractCharacter, Item weapon, boolean mainHand, Item otherHand) {
|
|
|
|
|
public static void AssignDamageAtrForPlayers(AbstractCharacter abstractCharacter, Item weapon, boolean mainHand, Item otherHand) {
|
|
|
|
|
|
|
|
|
|
// make sure weapon exists
|
|
|
|
|
boolean noWeapon = false;
|
|
|
|
@@ -719,6 +721,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|
|
|
|
// TODO Correct these
|
|
|
|
|
min = 1;
|
|
|
|
|
max = 3;
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
if (mainHand)
|
|
|
|
|
abstractCharacter.rangeHandOne = weapon.template.item_weapon_max_range * (1 + (abstractCharacter.statStrBase / 600));
|
|
|
|
@@ -749,18 +752,6 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|
|
|
|
max = damages[1];
|
|
|
|
|
|
|
|
|
|
strBased = weaponTemplate.item_primary_attr.equals(AttributeType.Strength);
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Add parry bonus for weapon and allow parry if needed
|
|
|
|
|
|
|
|
|
|
// // Only Fighters and Thieves can Parry
|
|
|
|
|
// if ((this.baseClass != null && this.baseClass.getUUID() == 2500)
|
|
|
|
|
// || (this.promotionClass != null && this.promotionClass.getUUID() == 2520)) {
|
|
|
|
|
// if (wbMain == null || wbMain.getRange() < MBServerStatics.RANGED_WEAPON_RANGE)
|
|
|
|
|
// if (wbOff == null || wbOff.getRange() < MBServerStatics.RANGED_WEAPON_RANGE)
|
|
|
|
|
// this.bonuses.setBool("Parry", true);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (abstractCharacter.effects != null && abstractCharacter.effects.containsKey("DeathShroud"))
|
|
|
|
|