1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-11 09:42:54 +00:00

Very simple skill templates implemented

Signed-off-by: Rogiel <rogiel@rogiel.com>
This commit is contained in:
2011-06-03 14:58:07 -03:00
parent fe7373ba29
commit 4d6289b12c
8068 changed files with 49586 additions and 8 deletions

View File

@@ -16,6 +16,8 @@
*/
package com.l2jserver.model.world.actor.stat;
import com.l2jserver.model.world.Actor;
/**
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@@ -81,7 +83,11 @@ public enum BaseStats {
2.17, 2.2, 2.22, 2.24, 2.26, 2.29, 2.31, 2.33, 2.35, 2.38, 2.4,
2.43, 2.45, 2.47, 2.5, 2.52, 2.55, 2.58, 2.6, 2.63, 2.65, 2.68);
public double[] bonus;
/**
* Bonus array for the base stat. The key represents the value of the
* attribute.
*/
public final double[] bonus;
BaseStats(double... bonus) {
this.bonus = bonus;
@@ -90,4 +96,26 @@ public enum BaseStats {
public double calculateBonus(int n) {
return bonus[n];
}
public double calculateBonus(Actor actor) {
return calculateBonus(actor.getStats());
}
public double calculateBonus(ActorStats<?> stats) {
switch (this) {
case CON:
return calculateBonus(stats.getConcentration());
case DEX:
return calculateBonus(stats.getDexterity());
case INT:
return calculateBonus(stats.getIntelligence());
case MEN:
return calculateBonus(stats.getMentality());
case STR:
return calculateBonus(stats.getStrength());
case WIT:
return calculateBonus(stats.getWitness());
}
return 0;
}
}