mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-10 09:22:49 +00:00
Improves javadoc in more than 190 classes
This commit improves and adds missing javadoc to 196 java files. Now more than 98% of the code is documented.
This commit is contained in:
@@ -22,6 +22,9 @@ import com.l2jserver.model.world.Actor;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public enum BaseStats {
|
||||
/**
|
||||
* Strength multipliers
|
||||
*/
|
||||
STR(0.29, 0.3, 0.31, 0.32, 0.34, 0.35, 0.36, 0.37, 0.39, 0.4, 0.42, 0.43,
|
||||
0.45, 0.46, 0.48, 0.5, 0.51, 0.53, 0.55, 0.57, 0.59, 0.61, 0.63,
|
||||
0.66, 0.68, 0.71, 0.73, 0.76, 0.78, 0.81, 0.84, 0.87, 0.9, 0.94,
|
||||
@@ -32,6 +35,9 @@ public enum BaseStats {
|
||||
4.6, 4.77, 4.94, 5.12, 5.3, 5.49, 5.69, 5.89, 6.11, 6.33, 6.55,
|
||||
6.79, 7.03, 7.29, 7.55, 7.82, 8.1, 8.39, 8.7, 9.01, 9.33, 9.67),
|
||||
|
||||
/**
|
||||
* Intelligence multipliers
|
||||
*/
|
||||
INT(0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.61, 0.62, 0.63, 0.64, 0.65, 0.67,
|
||||
0.68, 0.69, 0.71, 0.72, 0.74, 0.75, 0.77, 0.78, 0.8, 0.81, 0.83,
|
||||
0.85, 0.86, 0.88, 0.9, 0.92, 0.94, 0.95, 0.97, 0.99, 1.01, 1.03,
|
||||
@@ -42,6 +48,9 @@ public enum BaseStats {
|
||||
2.52, 2.57, 2.62, 2.67, 2.73, 2.78, 2.84, 2.89, 2.95, 3.01, 3.07,
|
||||
3.13, 3.19, 3.26, 3.32, 3.39, 3.46, 3.53, 3.6, 3.67, 3.74, 3.82),
|
||||
|
||||
/**
|
||||
* Dexterity multipliers
|
||||
*/
|
||||
DEX(0.84, 0.85, 0.86, 0.86, 0.87, 0.88, 0.89, 0.9, 0.9, 0.91, 0.92, 0.93,
|
||||
0.94, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1, 1.01, 1.01, 1.02,
|
||||
1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.1, 1.11, 1.12, 1.13,
|
||||
@@ -52,6 +61,9 @@ public enum BaseStats {
|
||||
1.69, 1.71, 1.72, 1.74, 1.75, 1.77, 1.78, 1.8, 1.82, 1.83, 1.85,
|
||||
1.87, 1.88, 1.9, 1.92, 1.93, 1.95, 1.97, 1.99, 2, 2.02, 2.04),
|
||||
|
||||
/**
|
||||
* Witness multipliers
|
||||
*/
|
||||
WIT(0.39, 0.4, 0.42, 0.44, 0.46, 0.48, 0.51, 0.53, 0.56, 0.58, 0.61, 0.64,
|
||||
0.68, 0.71, 0.75, 0.78, 0.82, 0.86, 0.91, 0.95, 1, 1.05, 1.1, 1.16,
|
||||
1.22, 1.28, 1.34, 1.41, 1.48, 1.55, 1.63, 1.71, 1.8, 1.89, 1.98,
|
||||
@@ -63,6 +75,9 @@ public enum BaseStats {
|
||||
25.03, 26.28, 27.6, 28.98, 30.43, 31.95, 33.55, 35.22, 36.98,
|
||||
38.83, 40.77, 42.81, 44.95, 47.2),
|
||||
|
||||
/**
|
||||
* Concentration multipliers
|
||||
*/
|
||||
CON(0.45, 0.46, 0.47, 0.48, 0.5, 0.51, 0.53, 0.54, 0.56, 0.58, 0.59, 0.61,
|
||||
0.63, 0.65, 0.67, 0.69, 0.71, 0.73, 0.75, 0.77, 0.8, 0.82, 0.85,
|
||||
0.87, 0.9, 0.93, 0.95, 0.98, 1.01, 1.04, 1.07, 1.1, 1.14, 1.17,
|
||||
@@ -73,6 +88,9 @@ public enum BaseStats {
|
||||
4.56, 4.7, 4.84, 4.99, 5.14, 5.29, 5.45, 5.61, 5.78, 5.96, 6.13,
|
||||
6.32, 6.51, 6.7, 6.9, 7.11, 7.33, 7.54, 7.77, 8, 8.24),
|
||||
|
||||
/**
|
||||
* Mentality multipliers
|
||||
*/
|
||||
MEN(1, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.11, 1.12,
|
||||
1.13, 1.14, 1.15, 1.16, 1.17, 1.19, 1.2, 1.21, 1.22, 1.23, 1.25,
|
||||
1.26, 1.27, 1.28, 1.3, 1.31, 1.32, 1.34, 1.35, 1.36, 1.38, 1.39,
|
||||
@@ -89,18 +107,41 @@ public enum BaseStats {
|
||||
*/
|
||||
public final double[] bonus;
|
||||
|
||||
/**
|
||||
* @param bonus
|
||||
* the bonus multipliers
|
||||
*/
|
||||
BaseStats(double... bonus) {
|
||||
this.bonus = bonus;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the bonus
|
||||
*
|
||||
* @param n
|
||||
* the level
|
||||
* @return the bonus for the given level
|
||||
*/
|
||||
public double calculateBonus(int n) {
|
||||
return bonus[n];
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the bonus
|
||||
*
|
||||
* @param actor
|
||||
* the actor
|
||||
* @return the bonus for the given actor
|
||||
*/
|
||||
public double calculateBonus(Actor actor) {
|
||||
return calculateBonus(actor.getStats());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param stats
|
||||
* the actor stats
|
||||
* @return the calculated bonus
|
||||
*/
|
||||
public double calculateBonus(ActorStats<?> stats) {
|
||||
switch (this) {
|
||||
case CON:
|
||||
|
||||
@@ -65,6 +65,13 @@ public class CharacterInventory implements Iterable<Item> {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given paperdoll has is occupied
|
||||
*
|
||||
* @param paperdoll
|
||||
* the paperdoll slot
|
||||
* @return true if has an item
|
||||
*/
|
||||
public boolean has(InventoryPaperdoll paperdoll) {
|
||||
return getItem(paperdoll) != null;
|
||||
}
|
||||
@@ -131,6 +138,10 @@ public class CharacterInventory implements Iterable<Item> {
|
||||
*/
|
||||
public final int id;
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* the slot id
|
||||
*/
|
||||
InventoryPaperdoll(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@@ -137,8 +137,15 @@ public class CharacterShortcutContainer implements Iterable<Shortcut> {
|
||||
return character;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares two shortcut slots
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public static class ShortcutSlotComparator implements Comparator<Shortcut>,
|
||||
Serializable {
|
||||
/**
|
||||
* The Java Serialization API serial
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -260,6 +260,9 @@ public class CharacterStats extends ActorStats<CharacterCalculatorContext> {
|
||||
*/
|
||||
private final L2Character character;
|
||||
|
||||
/**
|
||||
* The character calculator
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private static final CharacterCalculator calculator = new CharacterCalculator();
|
||||
|
||||
@@ -294,6 +297,9 @@ public class CharacterStats extends ActorStats<CharacterCalculatorContext> {
|
||||
return (int) calc(StatType.MAX_LOAD);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setups the default formulas
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private void setup() {
|
||||
calculator.addNoSort(BASE_HP_FORMULA, BASE_MP_FORMULA, BASE_CP_FORMULA);
|
||||
@@ -327,12 +333,21 @@ public class CharacterStats extends ActorStats<CharacterCalculatorContext> {
|
||||
calculator.sort();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the calculator
|
||||
*/
|
||||
public void updateCalculator() {
|
||||
calculator.clear();
|
||||
setup();
|
||||
addItem(InventoryPaperdoll.RIGHT_HAND);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the item formulas to this character calculator
|
||||
*
|
||||
* @param paperdoll
|
||||
* the paperdoll slot
|
||||
*/
|
||||
private void addItem(InventoryPaperdoll paperdoll) {
|
||||
if (!character.getInventory().has(paperdoll))
|
||||
return;
|
||||
|
||||
@@ -27,6 +27,9 @@ import com.l2jserver.util.calculator.Calculator;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterCalculator extends ActorCalculator {
|
||||
/**
|
||||
* @param calculators the calculators
|
||||
*/
|
||||
public CharacterCalculator(
|
||||
Calculator<ActorCalculatorContext, StatType>... calculators) {
|
||||
super(calculators);
|
||||
|
||||
@@ -30,6 +30,10 @@ public class CharacterCalculatorContext extends ActorCalculatorContext {
|
||||
*/
|
||||
public final L2Character character;
|
||||
|
||||
/**
|
||||
* Creates a new context
|
||||
* @param character the character
|
||||
*/
|
||||
public CharacterCalculatorContext(L2Character character) {
|
||||
super(character);
|
||||
this.character = character;
|
||||
|
||||
@@ -30,6 +30,12 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
||||
*/
|
||||
public abstract class CharacterCalculatorFunction extends
|
||||
ActorCalculatorFunction {
|
||||
/**
|
||||
* @param order
|
||||
* the calculation order
|
||||
* @param type
|
||||
* the stat type
|
||||
*/
|
||||
public CharacterCalculatorFunction(int order, StatType type) {
|
||||
super(order, type);
|
||||
}
|
||||
@@ -41,6 +47,17 @@ public abstract class CharacterCalculatorFunction extends
|
||||
value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes the calculated value
|
||||
*
|
||||
* @param c
|
||||
* the character
|
||||
* @param t
|
||||
* the template
|
||||
* @param value
|
||||
* the input value
|
||||
* @return the computed value
|
||||
*/
|
||||
protected abstract double calculate(L2Character c, CharacterTemplate t,
|
||||
double value);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,10 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public abstract class CharacterFormula extends CharacterCalculatorFunction {
|
||||
/**
|
||||
* @param order the calculation order
|
||||
* @param type the stat type
|
||||
*/
|
||||
public CharacterFormula(int order, StatType type) {
|
||||
super(order, type);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class MaximumCPAddCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public MaximumCPAddCalculator() {
|
||||
super(0x100, StatType.MAX_CP);
|
||||
}
|
||||
|
||||
@@ -35,6 +35,9 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class MaximumCPBonusCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public MaximumCPBonusCalculator() {
|
||||
super(0x100, StatType.MAX_CP);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class MaximumHPAddCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public MaximumHPAddCalculator() {
|
||||
super(0x100, StatType.MAX_HP);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class MaximumMPAddCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public MaximumMPAddCalculator() {
|
||||
super(0x100, StatType.MAX_MP);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterBaseAttackAccuracyCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBaseAttackAccuracyCalculator() {
|
||||
super(0x000, StatType.ACCURACY_COMBAT);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterBaseAttackEvasionCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBaseAttackEvasionCalculator() {
|
||||
super(0x000, StatType.EVASION_RATE);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterBaseCPCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBaseCPCalculator() {
|
||||
super(0x000, StatType.MAX_CP);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterBaseConcentrationCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBaseConcentrationCalculator() {
|
||||
super(0x000, StatType.STAT_CON);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterBaseDexterityCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBaseDexterityCalculator() {
|
||||
super(0x000, StatType.STAT_DEX);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterBaseHPCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBaseHPCalculator() {
|
||||
super(0x000, StatType.MAX_HP);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterBaseIntelligenceCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBaseIntelligenceCalculator() {
|
||||
super(0x000, StatType.STAT_INT);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterBaseMPCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBaseMPCalculator() {
|
||||
super(0x000, StatType.MAX_MP);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterBaseMagicalAttackCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBaseMagicalAttackCalculator() {
|
||||
super(0x000, StatType.MAGIC_ATTACK);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterBaseMagicalAttackSpeedCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBaseMagicalAttackSpeedCalculator() {
|
||||
super(0x000, StatType.MAGIC_ATTACK_SPEED);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
*/
|
||||
public class CharacterBaseMagicalCriticalRateCalculator extends
|
||||
CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBaseMagicalCriticalRateCalculator() {
|
||||
super(0x000, StatType.MCRITICAL_RATE);
|
||||
}
|
||||
|
||||
@@ -42,6 +42,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterBaseMagicalDefenseCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBaseMagicalDefenseCalculator() {
|
||||
super(0x000, StatType.MAGIC_DEFENSE);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterBaseMentalityCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBaseMentalityCalculator() {
|
||||
super(0x000, StatType.STAT_MEN);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterBasePhysicalAttackCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBasePhysicalAttackCalculator() {
|
||||
super(0x000, StatType.POWER_ATTACK);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
*/
|
||||
public class CharacterBasePhysicalAttackSpeedCalculator extends
|
||||
CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBasePhysicalAttackSpeedCalculator() {
|
||||
super(0x000, StatType.POWER_ATTACK_SPEED);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
*/
|
||||
public class CharacterBasePhysicalCriticalRateCalculator extends
|
||||
CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBasePhysicalCriticalRateCalculator() {
|
||||
super(0x000, StatType.CRITICAL_RATE);
|
||||
}
|
||||
|
||||
@@ -44,6 +44,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterBasePhysicalDefenseCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBasePhysicalDefenseCalculator() {
|
||||
super(0x000, StatType.POWER_DEFENSE);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterBaseRunSpeedCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBaseRunSpeedCalculator() {
|
||||
super(0x000, StatType.RUN_SPEED);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterBaseStrengthCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBaseStrengthCalculator() {
|
||||
super(0x000, StatType.STAT_STR);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterBaseWalkSpeedCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBaseWalkSpeedCalculator() {
|
||||
super(0x000, StatType.WALK_SPEED);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.character.calculator.CharacterFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterBaseWitnessCalculator extends CharacterFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public CharacterBaseWitnessCalculator() {
|
||||
super(0x000, StatType.STAT_WIT);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ import com.l2jserver.service.game.world.event.TypedWorldListener;
|
||||
*/
|
||||
public abstract class CharacterListener extends
|
||||
TypedWorldListener<CharacterEvent> {
|
||||
/**
|
||||
* Creates a new instance
|
||||
*/
|
||||
public CharacterListener() {
|
||||
super(CharacterEvent.class);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@ import com.l2jserver.service.game.world.event.TypedWorldListener;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public abstract class ClanListener extends TypedWorldListener<ClanEvent> {
|
||||
/**
|
||||
* Creates a new instance
|
||||
*/
|
||||
public ClanListener() {
|
||||
super(ClanEvent.class);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@ import com.l2jserver.service.game.world.event.TypedWorldListener;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public abstract class ItemListener extends TypedWorldListener<ItemEvent> {
|
||||
/**
|
||||
* Creates a new instance
|
||||
*/
|
||||
public ItemListener() {
|
||||
super(ItemEvent.class);
|
||||
}
|
||||
|
||||
@@ -204,6 +204,9 @@ public class NPCStats extends ActorStats<NPCCalculatorContext> {
|
||||
*/
|
||||
private final NPC npc;
|
||||
|
||||
/**
|
||||
* The NPC calculator
|
||||
*/
|
||||
private static final NPCCalculator calculator = new NPCCalculator();
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,6 +23,10 @@ import com.l2jserver.model.world.actor.calculator.ActorCalculator;
|
||||
*
|
||||
*/
|
||||
public class NPCCalculator extends ActorCalculator {
|
||||
/**
|
||||
* @param calculators
|
||||
* the calculators
|
||||
*/
|
||||
public NPCCalculator(NPCCalculator... calculators) {
|
||||
super(calculators);
|
||||
}
|
||||
|
||||
@@ -30,6 +30,10 @@ public class NPCCalculatorContext extends ActorCalculatorContext {
|
||||
*/
|
||||
public final NPC npc;
|
||||
|
||||
/**
|
||||
* Creates a new calculator context
|
||||
* @param npc the {@link NPC}
|
||||
*/
|
||||
public NPCCalculatorContext(NPC npc) {
|
||||
super(npc);
|
||||
this.npc = npc;
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.l2jserver.model.world.npc.calculator;
|
||||
|
||||
import com.l2jserver.model.template.ActorTemplate;
|
||||
import com.l2jserver.model.template.NPCTemplate;
|
||||
import com.l2jserver.model.template.Template;
|
||||
import com.l2jserver.model.world.Actor;
|
||||
import com.l2jserver.model.world.NPC;
|
||||
import com.l2jserver.model.world.actor.calculator.ActorCalculatorFunction;
|
||||
@@ -29,6 +30,14 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public abstract class NPCCalculatorFunction extends ActorCalculatorFunction {
|
||||
/**
|
||||
* Creates a new function
|
||||
*
|
||||
* @param order
|
||||
* the calculation order
|
||||
* @param type
|
||||
* the stat type
|
||||
*/
|
||||
public NPCCalculatorFunction(int order, StatType type) {
|
||||
super(order, type);
|
||||
}
|
||||
@@ -39,5 +48,16 @@ public abstract class NPCCalculatorFunction extends ActorCalculatorFunction {
|
||||
return calculate((NPC) a, (NPCTemplate) actorTemplate, value);
|
||||
}
|
||||
|
||||
protected abstract double calculate(NPC c, NPCTemplate t, double value);
|
||||
/**
|
||||
* Calculates the value
|
||||
*
|
||||
* @param n
|
||||
* the {@link NPC}
|
||||
* @param t
|
||||
* the {@link Template}
|
||||
* @param value
|
||||
* the original value
|
||||
* @return the output value (calculated)
|
||||
*/
|
||||
protected abstract double calculate(NPC n, NPCTemplate t, double value);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,14 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
||||
*
|
||||
*/
|
||||
public abstract class NPCFormula extends NPCCalculatorFunction {
|
||||
/**
|
||||
* Creates a new formula
|
||||
*
|
||||
* @param order
|
||||
* the calculation order
|
||||
* @param type
|
||||
* the stat type
|
||||
*/
|
||||
public NPCFormula(int order, StatType type) {
|
||||
super(order, type);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.npc.calculator.NPCFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPCBaseAttackEvasionCalculator extends NPCFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public NPCBaseAttackEvasionCalculator() {
|
||||
super(0x000, StatType.EVASION_RATE);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.npc.calculator.NPCFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPCBaseConcentrationCalculator extends NPCFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public NPCBaseConcentrationCalculator() {
|
||||
super(0x000, StatType.STAT_CON);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.npc.calculator.NPCFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPCBaseDexterityCalculator extends NPCFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public NPCBaseDexterityCalculator() {
|
||||
super(0x000, StatType.STAT_DEX);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.npc.calculator.NPCFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPCBaseHPCalculator extends NPCFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public NPCBaseHPCalculator() {
|
||||
super(0x000, StatType.MAX_HP);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.npc.calculator.NPCFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPCBaseIntelligenceCalculator extends NPCFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public NPCBaseIntelligenceCalculator() {
|
||||
super(0x000, StatType.STAT_INT);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.npc.calculator.NPCFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPCBaseMPCalculator extends NPCFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public NPCBaseMPCalculator() {
|
||||
super(0x000, StatType.MAX_MP);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,9 @@ import com.l2jserver.model.world.npc.calculator.NPCFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPCBaseMagicalAttackCalculator extends NPCFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public NPCBaseMagicalAttackCalculator() {
|
||||
super(0x000, StatType.MAGIC_ATTACK);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.npc.calculator.NPCFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPCBaseMagicalAttackSpeedCalculator extends NPCFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public NPCBaseMagicalAttackSpeedCalculator() {
|
||||
super(0x000, StatType.MAGIC_ATTACK_SPEED);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,9 @@ import com.l2jserver.model.world.npc.calculator.NPCFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPCBaseMagicalCriticalRateCalculator extends NPCFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public NPCBaseMagicalCriticalRateCalculator() {
|
||||
super(0x000, StatType.MCRITICAL_RATE);
|
||||
}
|
||||
|
||||
@@ -42,6 +42,9 @@ import com.l2jserver.model.world.npc.calculator.NPCFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPCBaseMagicalDefenseCalculator extends NPCFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public NPCBaseMagicalDefenseCalculator() {
|
||||
super(0x000, StatType.MAGIC_DEFENSE);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.npc.calculator.NPCFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPCBaseMentalityCalculator extends NPCFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public NPCBaseMentalityCalculator() {
|
||||
super(0x000, StatType.STAT_MEN);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,9 @@ import com.l2jserver.model.world.npc.calculator.NPCFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPCBasePhysicalAttackCalculator extends NPCFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public NPCBasePhysicalAttackCalculator() {
|
||||
super(0x000, StatType.POWER_ATTACK);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,9 @@ import com.l2jserver.model.world.npc.calculator.NPCFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPCBasePhysicalAttackSpeedCalculator extends NPCFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public NPCBasePhysicalAttackSpeedCalculator() {
|
||||
super(0x000, StatType.POWER_ATTACK_SPEED);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,9 @@ import com.l2jserver.model.world.npc.calculator.NPCFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPCBasePhysicalCriticalRateCalculator extends NPCFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public NPCBasePhysicalCriticalRateCalculator() {
|
||||
super(0x000, StatType.CRITICAL_RATE);
|
||||
}
|
||||
|
||||
@@ -44,6 +44,9 @@ import com.l2jserver.model.world.npc.calculator.NPCFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPCBasePhysicalDefenseCalculator extends NPCFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public NPCBasePhysicalDefenseCalculator() {
|
||||
super(0x000, StatType.POWER_DEFENSE);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,9 @@ import com.l2jserver.model.world.npc.calculator.NPCFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPCBaseRunSpeedCalculator extends NPCFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public NPCBaseRunSpeedCalculator() {
|
||||
super(0x000, StatType.RUN_SPEED);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.npc.calculator.NPCFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPCBaseStrengthCalculator extends NPCFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public NPCBaseStrengthCalculator() {
|
||||
super(0x000, StatType.STAT_STR);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,9 @@ import com.l2jserver.model.world.npc.calculator.NPCFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPCBaseWalkSpeedCalculator extends NPCFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public NPCBaseWalkSpeedCalculator() {
|
||||
super(0x000, StatType.WALK_SPEED);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.npc.calculator.NPCFormula;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPCBaseWitnessCalculator extends NPCFormula {
|
||||
/**
|
||||
* Creates a new instance of this formula
|
||||
*/
|
||||
public NPCBaseWitnessCalculator() {
|
||||
super(0x000, StatType.STAT_WIT);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,9 @@ public class TeleporterController extends BaseNPCController {
|
||||
*/
|
||||
@Inject
|
||||
protected SpawnService spawnService;
|
||||
/**
|
||||
* The teleportation template id provider
|
||||
*/
|
||||
@Inject
|
||||
protected TeleportationTemplateIDProvider teleportationIdProvider;
|
||||
|
||||
|
||||
@@ -25,5 +25,8 @@ import com.l2jserver.service.game.world.event.WorldEvent;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface NPCEvent extends WorldEvent {
|
||||
/**
|
||||
* @return the NPC
|
||||
*/
|
||||
NPC getNPC();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@ import com.l2jserver.service.game.world.event.TypedWorldListener;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public abstract class NPCListener extends TypedWorldListener<NPCEvent> {
|
||||
/**
|
||||
* Creates a new instance
|
||||
*/
|
||||
public NPCListener() {
|
||||
super(NPCEvent.class);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@ import com.l2jserver.service.game.world.event.TypedWorldListener;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public abstract class PlayerListener extends TypedWorldListener<PlayerEvent> {
|
||||
/**
|
||||
* Creates a new instance
|
||||
*/
|
||||
public PlayerListener() {
|
||||
super(PlayerEvent.class);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,13 @@ import com.l2jserver.util.geometry.Point3D;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class PlayerTeleportingEvent implements PlayerEvent {
|
||||
/**
|
||||
* The player object
|
||||
*/
|
||||
private final Player player;
|
||||
/**
|
||||
* The teleportation point
|
||||
*/
|
||||
private final Point3D point;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user