mob baseline stats
This commit is contained in:
@@ -139,6 +139,8 @@ public enum CombatManager {
|
|||||||
//calculate hit chance based off ATR and DEF
|
//calculate hit chance based off ATR and DEF
|
||||||
|
|
||||||
int hitChance;
|
int hitChance;
|
||||||
|
if(def == 0)
|
||||||
|
def = 1;
|
||||||
float dif = atr / def;
|
float dif = atr / def;
|
||||||
|
|
||||||
if (dif <= 0.8f)
|
if (dif <= 0.8f)
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ public class MobAI {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
CombatManager.combatCycle(mob,mob.combatTarget);
|
CombatManager.combatCycle(mob,mob.combatTarget);
|
||||||
|
mob.lastAttackTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target.getPet() != null)
|
if (target.getPet() != null)
|
||||||
|
|||||||
@@ -597,34 +597,8 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public static void AssignDefenseValue(AbstractCharacter abstractCharacter){
|
||||||
* @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;
|
|
||||||
}
|
|
||||||
ConcurrentHashMap<EquipSlotType, Item> equipped = abstractCharacter.charItemManager.getEquipped();
|
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"))
|
if (abstractCharacter.effects != null && abstractCharacter.effects.containsKey("DeathShroud"))
|
||||||
abstractCharacter.defenseRating = (short) 0;
|
abstractCharacter.defenseRating = (short) 0;
|
||||||
else {
|
else {
|
||||||
@@ -664,11 +638,39 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
abstractCharacter.defenseRating = (short) (defense + 0.5f);
|
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
|
* @ 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
|
// make sure weapon exists
|
||||||
boolean noWeapon = false;
|
boolean noWeapon = false;
|
||||||
@@ -719,6 +721,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
// TODO Correct these
|
// TODO Correct these
|
||||||
min = 1;
|
min = 1;
|
||||||
max = 3;
|
max = 3;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (mainHand)
|
if (mainHand)
|
||||||
abstractCharacter.rangeHandOne = weapon.template.item_weapon_max_range * (1 + (abstractCharacter.statStrBase / 600));
|
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];
|
max = damages[1];
|
||||||
|
|
||||||
strBased = weaponTemplate.item_primary_attr.equals(AttributeType.Strength);
|
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"))
|
if (abstractCharacter.effects != null && abstractCharacter.effects.containsKey("DeathShroud"))
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
|||||||
public AbstractWorldObject fearedObject = null;
|
public AbstractWorldObject fearedObject = null;
|
||||||
protected int dbID; //the database ID
|
protected int dbID; //the database ID
|
||||||
private int currentID;
|
private int currentID;
|
||||||
private long lastAttackTime = 0;
|
public long lastAttackTime = 0;
|
||||||
private int lastMobPowerToken = 0;
|
private int lastMobPowerToken = 0;
|
||||||
private DeferredPowerJob weaponPower;
|
private DeferredPowerJob weaponPower;
|
||||||
private DateTime upgradeDateTime = null;
|
private DateTime upgradeDateTime = null;
|
||||||
@@ -1045,7 +1045,6 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
|||||||
NPCManager.setDamageAndSpeedForGuard(this);
|
NPCManager.setDamageAndSpeedForGuard(this);
|
||||||
NPCManager.applyGuardStanceModifiers(this);
|
NPCManager.applyGuardStanceModifiers(this);
|
||||||
} else {
|
} else {
|
||||||
AbstractCharacter.calculateAtrDamageForWeapon(this, this.charItemManager.equipped.get(EquipSlotType.RHELD), true, this.charItemManager.equipped.get(EquipSlotType.LHELD));
|
|
||||||
AbstractCharacter.calculateAtrDefenseDamage(this);
|
AbstractCharacter.calculateAtrDefenseDamage(this);
|
||||||
calculateMaxHealthManaStamina();
|
calculateMaxHealthManaStamina();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user