|
|
@ -1638,7 +1638,7 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
this.defenseRating = defense; |
|
|
|
this.defenseRating = defense; |
|
|
|
this.atrHandOne = atr; |
|
|
|
this.atrHandOne = atr; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
}else { |
|
|
|
if (this.charItemManager == null || this.equip == null) { |
|
|
|
if (this.charItemManager == null || this.equip == null) { |
|
|
|
Logger.error("Player " + currentID + " missing skills or equipment"); |
|
|
|
Logger.error("Player " + currentID + " missing skills or equipment"); |
|
|
|
defaultAtrAndDamage(true); |
|
|
|
defaultAtrAndDamage(true); |
|
|
@ -1697,7 +1697,7 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
this.defenseRating = (short) this.mobBase.getDefense(); |
|
|
|
this.defenseRating = (short) this.mobBase.getDefense(); |
|
|
|
} |
|
|
|
} |
|
|
|
// calculate defense for equipment
|
|
|
|
// calculate defense for equipment
|
|
|
|
|
|
|
|
} |
|
|
|
if(this.isDropper || Mob.discDroppers.contains(this)){ |
|
|
|
if(this.isDropper || Mob.discDroppers.contains(this)){ |
|
|
|
this.defenseRating *= 2; |
|
|
|
this.defenseRating *= 2; |
|
|
|
this.atrHandOne *= 2; |
|
|
|
this.atrHandOne *= 2; |
|
|
@ -1842,168 +1842,46 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
|
|
|
|
|
|
|
|
private void calculateAtrDamageForWeapon(MobEquipment weapon, boolean mainHand) { |
|
|
|
private void calculateAtrDamageForWeapon(MobEquipment weapon, boolean mainHand) { |
|
|
|
|
|
|
|
|
|
|
|
int baseStrength = 0; |
|
|
|
if(mainHand){ |
|
|
|
|
|
|
|
int min = (int)this.mobBase.getDamageMin(); |
|
|
|
float skillPercentage, masteryPercentage; |
|
|
|
int max = (int)this.mobBase.getDamageMax(); |
|
|
|
float mastDam; |
|
|
|
int atr = this.mobBase.getAtr(); |
|
|
|
|
|
|
|
if(this.bonuses != null){ |
|
|
|
// make sure weapon exists
|
|
|
|
min *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None); |
|
|
|
|
|
|
|
max *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None); |
|
|
|
boolean noWeapon = false; |
|
|
|
atr *= 1 + this.bonuses.getFloatPercentAll(ModType.OCV,SourceType.None); |
|
|
|
ItemBase wb = null; |
|
|
|
atr += this.bonuses.getFloat(ModType.OCV,SourceType.None); |
|
|
|
|
|
|
|
|
|
|
|
if (weapon == null) |
|
|
|
|
|
|
|
noWeapon = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ItemBase ib = weapon.getItemBase(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ib == null) |
|
|
|
|
|
|
|
noWeapon = true; |
|
|
|
|
|
|
|
else if (ib.getType().equals(ItemType.WEAPON) == false) { |
|
|
|
|
|
|
|
defaultAtrAndDamage(mainHand); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} else |
|
|
|
|
|
|
|
wb = ib; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.minDamageHandOne = min; |
|
|
|
float min, max; |
|
|
|
this.maxDamageHandOne = max; |
|
|
|
float speed; |
|
|
|
this.atrHandOne = atr; |
|
|
|
boolean strBased = false; |
|
|
|
if(weapon == null){ |
|
|
|
|
|
|
|
|
|
|
|
// get skill percentages and min and max damage for weapons
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (noWeapon) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mainHand) |
|
|
|
|
|
|
|
this.rangeHandOne = this.mobBase.getAttackRange(); |
|
|
|
this.rangeHandOne = this.mobBase.getAttackRange(); |
|
|
|
else |
|
|
|
this.speedHandTwo = 20.0f; |
|
|
|
this.rangeHandTwo = -1; // set to do not attack
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
skillPercentage = getModifiedAmount(this.skills.get("Unarmed Combat")); |
|
|
|
|
|
|
|
masteryPercentage = getModifiedAmount(this.skills.get("Unarmed Combat Mastery")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (masteryPercentage == 0f) |
|
|
|
|
|
|
|
mastDam = CharacterSkill.getQuickMastery(this, "Unarmed Combat Mastery"); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
mastDam = masteryPercentage; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO Correct these
|
|
|
|
|
|
|
|
min = this.mobBase.getMinDmg(); |
|
|
|
|
|
|
|
max = this.mobBase.getMaxDmg(); |
|
|
|
|
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
|
|
|
|
this.rangeHandOne = weapon.getItemBase().getRange(); |
|
|
|
if (mainHand) |
|
|
|
this.speedHandTwo = weapon.getItemBase().getSpeed(); |
|
|
|
this.rangeHandOne = weapon.getItemBase().getRange() * (1 + (baseStrength / 600.0f)); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
this.rangeHandTwo = weapon.getItemBase().getRange() * (1 + (baseStrength / 600.0f)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
skillPercentage = getModifiedAmount(this.skills.get(wb.getSkillRequired())); |
|
|
|
|
|
|
|
masteryPercentage = getModifiedAmount(this.skills.get(wb.getMastery())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (masteryPercentage == 0f) |
|
|
|
|
|
|
|
mastDam = 0f; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
mastDam = masteryPercentage; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
min = wb.getMinDamage(); |
|
|
|
|
|
|
|
max = wb.getMaxDamage(); |
|
|
|
|
|
|
|
strBased = wb.isStrBased(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}else{ |
|
|
|
// calculate atr
|
|
|
|
int min = (int)this.mobBase.getDamageMin(); |
|
|
|
float atr = this.mobBase.getAttackRating(); |
|
|
|
int max = (int)this.mobBase.getDamageMax(); |
|
|
|
|
|
|
|
int atr = this.mobBase.getAtr(); |
|
|
|
if (this.statStrCurrent > this.statDexCurrent) |
|
|
|
|
|
|
|
atr += statStrCurrent * .5; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
atr += statDexCurrent * .5; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// add in any bonuses to atr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(this.bonuses != null){ |
|
|
|
if(this.bonuses != null){ |
|
|
|
|
|
|
|
min *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None); |
|
|
|
|
|
|
|
max *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None); |
|
|
|
|
|
|
|
atr *= 1 + this.bonuses.getFloatPercentAll(ModType.OCV,SourceType.None); |
|
|
|
atr += this.bonuses.getFloat(ModType.OCV,SourceType.None); |
|
|
|
atr += this.bonuses.getFloat(ModType.OCV,SourceType.None); |
|
|
|
|
|
|
|
|
|
|
|
// Finally use any multipliers. DO THIS LAST!
|
|
|
|
|
|
|
|
float pos_Bonus = 1 + this.bonuses.getFloatPercentPositive(ModType.OCV, SourceType.None); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
atr *= pos_Bonus; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//and negative percent modifiers
|
|
|
|
|
|
|
|
//TODO DO DEBUFFS AFTER?? wILL TEst when finished
|
|
|
|
|
|
|
|
float neg_Bonus = this.bonuses.getFloatPercentNegative(ModType.OCV, SourceType.None); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
atr *= (1 + neg_Bonus); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
atr = (atr < 1) ? 1 : atr; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// set atr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mainHand) |
|
|
|
|
|
|
|
this.atrHandOne = (short) (atr + 0.5f); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
this.atrHandTwo = (short) (atr + 0.5f); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//calculate speed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (wb != null) |
|
|
|
|
|
|
|
speed = wb.getSpeed(); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
speed = 20f; //unarmed attack speed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.bonuses != null && this.bonuses.getFloat(ModType.AttackDelay, SourceType.None) != 0f) //add effects speed bonus
|
|
|
|
|
|
|
|
speed *= (1 + this.bonuses.getFloatPercentAll(ModType.AttackDelay, SourceType.None)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (speed < 10) |
|
|
|
|
|
|
|
speed = 10; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//add min/max damage bonuses for weapon **REMOVED
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if duel wielding, cut damage by 30%
|
|
|
|
|
|
|
|
// calculate damage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float minDamage; |
|
|
|
|
|
|
|
float maxDamage; |
|
|
|
|
|
|
|
float pri = (strBased) ? (float) this.statStrCurrent : (float) this.statDexCurrent; |
|
|
|
|
|
|
|
float sec = (strBased) ? (float) this.statDexCurrent : (float) this.statStrCurrent; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
minDamage = (float) (min * ((0.0315f * Math.pow(pri, 0.75f)) + (0.042f * Math.pow(sec, 0.75f)) + (0.01f * ((int) skillPercentage + (int) mastDam)))); |
|
|
|
|
|
|
|
maxDamage = (float) (max * ((0.0785f * Math.pow(pri, 0.75f)) + (0.016f * Math.pow(sec, 0.75f)) + (0.0075f * ((int) skillPercentage + (int) mastDam)))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
minDamage = (float) ((int) (minDamage + 0.5f)); //round to nearest decimal
|
|
|
|
|
|
|
|
maxDamage = (float) ((int) (maxDamage + 0.5f)); //round to nearest decimal
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//add Base damage last.
|
|
|
|
|
|
|
|
float minDamageMod = this.mobBase.getDamageMin(); |
|
|
|
|
|
|
|
float maxDamageMod = this.mobBase.getDamageMax(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
minDamage += minDamageMod; |
|
|
|
|
|
|
|
maxDamage += maxDamageMod; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// add in any bonuses to damage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.bonuses != null) { |
|
|
|
|
|
|
|
// Add any base bonuses
|
|
|
|
|
|
|
|
minDamage += this.bonuses.getFloat(ModType.MinDamage, SourceType.None); |
|
|
|
|
|
|
|
maxDamage += this.bonuses.getFloat(ModType.MaxDamage, SourceType.None); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Finally use any multipliers. DO THIS LAST!
|
|
|
|
|
|
|
|
minDamage *= (1 + this.bonuses.getFloatPercentAll(ModType.MinDamage, SourceType.None)); |
|
|
|
|
|
|
|
maxDamage *= (1 + this.bonuses.getFloatPercentAll(ModType.MaxDamage, SourceType.None)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.minDamageHandTwo = min; |
|
|
|
// set damages
|
|
|
|
this.maxDamageHandTwo = max; |
|
|
|
|
|
|
|
this.atrHandTwo = atr; |
|
|
|
if (mainHand) { |
|
|
|
if(weapon == null){ |
|
|
|
this.minDamageHandOne = (short) minDamage; |
|
|
|
this.rangeHandTwo = this.mobBase.getAttackRange(); |
|
|
|
this.maxDamageHandOne = (short) maxDamage; |
|
|
|
this.speedHandTwo = 20.0f; |
|
|
|
this.speedHandOne = 30; |
|
|
|
|
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
this.minDamageHandTwo = (short) minDamage; |
|
|
|
this.rangeHandTwo = weapon.getItemBase().getRange(); |
|
|
|
this.maxDamageHandTwo = (short) maxDamage; |
|
|
|
this.speedHandTwo = weapon.getItemBase().getSpeed(); |
|
|
|
this.speedHandTwo = 30; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|