mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 18:57:32 +00:00
Apply Neutral Damage from Player Attacks
This commit is contained in:
1 parent
049d0baf5f
commit
4ba1358af2
1 file changed
+11
-2
@@ -130,7 +130,7 @@ public class AttributeAttackUtil {
|
||||
}
|
||||
|
||||
AllocationResult result = allocateMagicDamage(physicalDamage, attackerData.magicData.getMagics());
|
||||
float leftover = result.leftover;
|
||||
float leftover = applyNeutral(result.leftover, attacker);
|
||||
addAttributeMagicDamage(result.allocation, attacker.magicDamage, attacker.magicBoost);
|
||||
|
||||
MagicController magicController = MagicController.getInstance();
|
||||
@@ -158,7 +158,7 @@ public class AttributeAttackUtil {
|
||||
}
|
||||
|
||||
AllocationResult result = allocateMagicDamage(physicalDamage, attackerData.magicData.getMagics());
|
||||
float leftover = result.leftover;
|
||||
float leftover = applyNeutral(result.leftover, attacker);
|
||||
|
||||
addAttributeMagicDamage(result.allocation, attacker.magicDamage, attacker.magicBoost);
|
||||
|
||||
@@ -185,6 +185,15 @@ public class AttributeAttackUtil {
|
||||
return damage;
|
||||
}
|
||||
|
||||
public static float applyNeutral(float leftover, PlayerAttributeTracker tracker){
|
||||
if (ConfigMain.AttributesEnabled) {
|
||||
float neutralDamage = tracker.getAttributeValue(CustomAttributes.NEUTRAL_ATTACK);
|
||||
float neutralBoost = tracker.getAttributeValue(CustomAttributes.NEUTRAL_BOOST);
|
||||
leftover += neutralDamage * (1 + (neutralBoost / 100));
|
||||
}
|
||||
return leftover;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates damage when an NPC attacks a player.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user