diff --git a/.classpath b/.classpath index 52f62db63..03fe4b83b 100644 --- a/.classpath +++ b/.classpath @@ -4,7 +4,7 @@ - + diff --git a/config/template-compiled.xml b/config/template-compiled.xml new file mode 100644 index 000000000..ac8de09d0 --- /dev/null +++ b/config/template-compiled.xml @@ -0,0 +1,24 @@ + + + + + + + com.l2jserver.service.game.scripting.impl.compiled.PrecompiledScriptCompiler + \ No newline at end of file diff --git a/config/template.properties b/config/template.properties new file mode 100644 index 000000000..7b36a0cd3 --- /dev/null +++ b/config/template.properties @@ -0,0 +1 @@ +#template.descriptor = config/template-compiled.xml \ No newline at end of file diff --git a/data/contexts.xsd b/data/contexts.xsd index 3ab1ff159..3cd932007 100644 --- a/data/contexts.xsd +++ b/data/contexts.xsd @@ -30,6 +30,7 @@ + diff --git a/data/script/template/script/template/actor/character/AbyssWalkerTemplate.java b/data/script/template/script/template/actor/character/AbyssWalkerTemplate.java index bae26c63b..73551ae56 100644 --- a/data/script/template/script/template/actor/character/AbyssWalkerTemplate.java +++ b/data/script/template/script/template/actor/character/AbyssWalkerTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class AbyssWalkerTemplate extends AssassinTemplate { @Inject public AbyssWalkerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ABYSS_WALKER.id), - CharacterClass.ABYSS_WALKER, Point.fromXYZ(28377, 10916, -4224)); + super(provider.createID(CharacterClass.ABYSS_WALKER.id), CharacterClass.ABYSS_WALKER, Point.fromXYZ(28377, 10916, -4224)); + + this.hpBase = 1096.000; + this.hpAdd = 49.400; + this.hpMultiplier = 0.37; + this.mpBase = 359.100; + this.mpAdd = 19.500; + this.mpMultiplier = 0.14; + this.cpBase = 602.800; + this.cpAdd = 27.170; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 25; attributes.strength = 41; @@ -45,15 +56,16 @@ public class AbyssWalkerTemplate extends AssassinTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 69000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected AbyssWalkerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/AdventurerTemplate.java b/data/script/template/script/template/actor/character/AdventurerTemplate.java index 04781d822..a524dbd5b 100644 --- a/data/script/template/script/template/actor/character/AdventurerTemplate.java +++ b/data/script/template/script/template/actor/character/AdventurerTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class AdventurerTemplate extends TreasureHunterTemplate { @Inject public AdventurerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ADVENTURER.id), - CharacterClass.ADVENTURER, Point.fromXYZ(-71338, 258271, -3104)); + super(provider.createID(CharacterClass.ADVENTURER.id), CharacterClass.ADVENTURER, Point.fromXYZ(-71338, 258271, -3104)); + + this.hpBase = 2623.700; + this.hpAdd = 53.120; + this.hpMultiplier = 0.37; + this.mpBase = 1155.600; + this.mpAdd = 24.900; + this.mpMultiplier = 0.14; + this.cpBase = 1443.035; + this.cpAdd = 29.216; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 21; attributes.strength = 40; @@ -45,15 +56,16 @@ public class AdventurerTemplate extends TreasureHunterTemplate { attributes.criticalChance = 44; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 81900; attributes.craft = false; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 23.0; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 23.5; } - + protected AdventurerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ArbalesterTemplate.java b/data/script/template/script/template/actor/character/ArbalesterTemplate.java index 1ed9f158b..7953aacf7 100644 --- a/data/script/template/script/template/actor/character/ArbalesterTemplate.java +++ b/data/script/template/script/template/actor/character/ArbalesterTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ArbalesterTemplate extends WarderTemplate { @Inject public ArbalesterTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ARBALESTER.id), - CharacterClass.ARBALESTER, Point.fromXYZ(-125533, 38114, 1142)); + super(provider.createID(CharacterClass.ARBALESTER.id), CharacterClass.ARBALESTER, Point.fromXYZ(-125533, 38114, 1142)); + + this.hpBase = 1139.740; + this.hpAdd = 57.200; + this.hpMultiplier = 0.37; + this.mpBase = 487.030; + this.mpAdd = 19.500; + this.mpMultiplier = 0.14; + this.cpBase = 569.870; + this.cpAdd = 28.600; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 28; attributes.strength = 39; @@ -45,15 +56,16 @@ public class ArbalesterTemplate extends WarderTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 8.0; this.maleCollisionHeight = 22.6; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 22.6; } - + protected ArbalesterTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ArcanaLordTemplate.java b/data/script/template/script/template/actor/character/ArcanaLordTemplate.java index 489baeba6..242276f81 100644 --- a/data/script/template/script/template/actor/character/ArcanaLordTemplate.java +++ b/data/script/template/script/template/actor/character/ArcanaLordTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ArcanaLordTemplate extends WarlockTemplate { @Inject public ArcanaLordTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ARCANA_LORD.id), - CharacterClass.ARCANA_LORD, Point - .fromXYZ(-90890, 248027, -3570)); + super(provider.createID(CharacterClass.ARCANA_LORD.id), CharacterClass.ARCANA_LORD, Point.fromXYZ(-90890, 248027, -3570)); + + this.hpBase = 3039.300; + this.hpAdd = 63.080; + this.hpMultiplier = 0.37; + this.mpBase = 1540.800; + this.mpAdd = 33.200; + this.mpMultiplier = 0.14; + this.cpBase = 1823.500; + this.cpAdd = 37.850; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 41; attributes.strength = 22; @@ -46,15 +56,16 @@ public class ArcanaLordTemplate extends WarlockTemplate { attributes.criticalChance = 40; attributes.evasionChance = 28; attributes.runSpeed = 120; + attributes.walkSpeed = 120; attributes.maxWeigth = 62500; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 22.8; this.femaleCollisionRadius = 6.5; this.femaleCollisionHeight = 22.5; } - + protected ArcanaLordTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ArchmageTemplate.java b/data/script/template/script/template/actor/character/ArchmageTemplate.java index 1a43c9846..a7dae1b73 100644 --- a/data/script/template/script/template/actor/character/ArchmageTemplate.java +++ b/data/script/template/script/template/actor/character/ArchmageTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ArchmageTemplate extends SorcerorTemplate { @Inject public ArchmageTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ARCHMAGE.id), - CharacterClass.ARCHMAGE, Point.fromXYZ(-90890, 248027, -3570)); + super(provider.createID(CharacterClass.ARCHMAGE.id), CharacterClass.ARCHMAGE, Point.fromXYZ(-90890, 248027, -3570)); + + this.hpBase = 2880.000; + this.hpAdd = 58.100; + this.hpMultiplier = 0.37; + this.mpBase = 1540.800; + this.mpAdd = 33.200; + this.mpMultiplier = 0.14; + this.cpBase = 1728.000; + this.cpAdd = 29.050; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 41; attributes.strength = 22; @@ -45,15 +56,16 @@ public class ArchmageTemplate extends SorcerorTemplate { attributes.criticalChance = 40; attributes.evasionChance = 28; attributes.runSpeed = 120; + attributes.walkSpeed = 120; attributes.maxWeigth = 62500; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 22.8; this.femaleCollisionRadius = 6.5; this.femaleCollisionHeight = 22.5; } - + protected ArchmageTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ArtisanTemplate.java b/data/script/template/script/template/actor/character/ArtisanTemplate.java index 613417bdb..b479278e8 100644 --- a/data/script/template/script/template/actor/character/ArtisanTemplate.java +++ b/data/script/template/script/template/actor/character/ArtisanTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ArtisanTemplate extends DwarvenFighterTemplate { @Inject public ArtisanTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ARTISAN.id), - CharacterClass.ARTISAN, Point.fromXYZ(108512, -174026, -400)); + super(provider.createID(CharacterClass.ARTISAN.id), CharacterClass.ARTISAN, Point.fromXYZ(108512, -174026, -400)); + + this.hpBase = 346.000; + this.hpAdd = 32.900; + this.hpMultiplier = 0.37; + this.mpBase = 144.000; + this.mpAdd = 9.800; + this.mpMultiplier = 0.14; + this.cpBase = 276.800; + this.cpAdd = 26.300; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 20; attributes.strength = 39; @@ -45,15 +56,16 @@ public class ArtisanTemplate extends DwarvenFighterTemplate { attributes.criticalChance = 43; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 83000; attributes.craft = true; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 18.0; this.femaleCollisionRadius = 5.0; this.femaleCollisionHeight = 19.0; } - + protected ArtisanTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/AssassinTemplate.java b/data/script/template/script/template/actor/character/AssassinTemplate.java index f17884725..394036e39 100644 --- a/data/script/template/script/template/actor/character/AssassinTemplate.java +++ b/data/script/template/script/template/actor/character/AssassinTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class AssassinTemplate extends DarkFighterTemplate { @Inject public AssassinTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ASSASSIN.id), - CharacterClass.ASSASSIN, Point.fromXYZ(28377, 10916, -4224)); + super(provider.createID(CharacterClass.ASSASSIN.id), CharacterClass.ASSASSIN, Point.fromXYZ(28377, 10916, -4224)); + + this.hpBase = 379.000; + this.hpAdd = 33.000; + this.hpMultiplier = 0.37; + this.mpBase = 144.000; + this.mpAdd = 9.900; + this.mpMultiplier = 0.14; + this.cpBase = 185.100; + this.cpAdd = 15.800; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 25; attributes.strength = 41; @@ -45,15 +56,16 @@ public class AssassinTemplate extends DarkFighterTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 69000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected AssassinTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/BersekerTemplate.java b/data/script/template/script/template/actor/character/BersekerTemplate.java index 5c9bcc5e9..e511c1230 100644 --- a/data/script/template/script/template/actor/character/BersekerTemplate.java +++ b/data/script/template/script/template/actor/character/BersekerTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class BersekerTemplate extends TrooperTemplate { @Inject public BersekerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.BERSEKER.id), - CharacterClass.BERSEKER, Point.fromXYZ(-125533, 38114, 1142)); + super(provider.createID(CharacterClass.BERSEKER.id), CharacterClass.BERSEKER, Point.fromXYZ(-125533, 38114, 1142)); + + this.hpBase = 1178.810; + this.hpAdd = 57.200; + this.hpMultiplier = 0.37; + this.mpBase = 370.110; + this.mpAdd = 19.500; + this.mpMultiplier = 0.14; + this.cpBase = 589.405; + this.cpAdd = 28.600; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 29; attributes.strength = 41; @@ -45,15 +56,16 @@ public class BersekerTemplate extends TrooperTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 8.0; this.maleCollisionHeight = 25.2; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 22.6; } - + protected BersekerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/BishopTemplate.java b/data/script/template/script/template/actor/character/BishopTemplate.java index 7a7533e48..5f58a1f54 100644 --- a/data/script/template/script/template/actor/character/BishopTemplate.java +++ b/data/script/template/script/template/actor/character/BishopTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class BishopTemplate extends ClericTemplate { @Inject public BishopTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.BISHOP.id), - CharacterClass.BISHOP, Point.fromXYZ(-90890, 248027, -3570)); + super(provider.createID(CharacterClass.BISHOP.id), CharacterClass.BISHOP, Point.fromXYZ(-90890, 248027, -3570)); + + this.hpBase = 1164.900; + this.hpAdd = 49.400; + this.hpMultiplier = 0.37; + this.mpBase = 478.800; + this.mpAdd = 26.000; + this.mpMultiplier = 0.14; + this.cpBase = 1048.410; + this.cpAdd = 44.460; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 41; attributes.strength = 22; @@ -45,15 +56,16 @@ public class BishopTemplate extends ClericTemplate { attributes.criticalChance = 40; attributes.evasionChance = 28; attributes.runSpeed = 120; + attributes.walkSpeed = 120; attributes.maxWeigth = 62500; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 22.8; this.femaleCollisionRadius = 6.5; this.femaleCollisionHeight = 22.5; } - + protected BishopTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/BladedancerTemplate.java b/data/script/template/script/template/actor/character/BladedancerTemplate.java index 7115d67cd..2a890d716 100644 --- a/data/script/template/script/template/actor/character/BladedancerTemplate.java +++ b/data/script/template/script/template/actor/character/BladedancerTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class BladedancerTemplate extends PalusKnightTemplate { @Inject public BladedancerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.BLADEDANCER.id), - CharacterClass.BLADEDANCER, Point.fromXYZ(28377, 10916, -4224)); + super(provider.createID(CharacterClass.BLADEDANCER.id), CharacterClass.BLADEDANCER, Point.fromXYZ(28377, 10916, -4224)); + + this.hpBase = 1143.800; + this.hpAdd = 58.500; + this.hpMultiplier = 0.37; + this.mpBase = 359.100; + this.mpAdd = 19.500; + this.mpMultiplier = 0.14; + this.cpBase = 571.900; + this.cpAdd = 29.250; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 25; attributes.strength = 41; @@ -45,15 +56,16 @@ public class BladedancerTemplate extends PalusKnightTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 69000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected BladedancerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/BountyHunterTemplate.java b/data/script/template/script/template/actor/character/BountyHunterTemplate.java index 2404d3f52..9deb47f06 100644 --- a/data/script/template/script/template/actor/character/BountyHunterTemplate.java +++ b/data/script/template/script/template/actor/character/BountyHunterTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class BountyHunterTemplate extends ScavengerTemplate { @Inject public BountyHunterTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.BOUNTY_HUNTER.id), - CharacterClass.BOUNTY_HUNTER, Point.fromXYZ(108512, -174026, - -400)); + super(provider.createID(CharacterClass.BOUNTY_HUNTER.id), CharacterClass.BOUNTY_HUNTER, Point.fromXYZ(108512, -174026, -400)); + + this.hpBase = 1110.800; + this.hpAdd = 57.100; + this.hpMultiplier = 0.37; + this.mpBase = 359.100; + this.mpAdd = 19.400; + this.mpMultiplier = 0.14; + this.cpBase = 777.500; + this.cpAdd = 39.940; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 20; attributes.strength = 39; @@ -46,15 +56,16 @@ public class BountyHunterTemplate extends ScavengerTemplate { attributes.criticalChance = 43; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 83000; attributes.craft = true; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 18.0; this.femaleCollisionRadius = 5.0; this.femaleCollisionHeight = 19.0; } - + protected BountyHunterTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/CardinalTemplate.java b/data/script/template/script/template/actor/character/CardinalTemplate.java index d7732394e..dcc6726e0 100644 --- a/data/script/template/script/template/actor/character/CardinalTemplate.java +++ b/data/script/template/script/template/actor/character/CardinalTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class CardinalTemplate extends BishopTemplate { @Inject public CardinalTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.CARDINAL.id), - CharacterClass.CARDINAL, Point.fromXYZ(-90890, 248027, -3570)); + super(provider.createID(CharacterClass.CARDINAL.id), CharacterClass.CARDINAL, Point.fromXYZ(-90890, 248027, -3570)); + + this.hpBase = 3182.700; + this.hpAdd = 63.080; + this.hpMultiplier = 0.37; + this.mpBase = 1540.800; + this.mpAdd = 33.200; + this.mpMultiplier = 0.14; + this.cpBase = 2864.430; + this.cpAdd = 56.772; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 41; attributes.strength = 22; @@ -45,15 +56,16 @@ public class CardinalTemplate extends BishopTemplate { attributes.criticalChance = 40; attributes.evasionChance = 28; attributes.runSpeed = 120; + attributes.walkSpeed = 120; attributes.maxWeigth = 62500; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 22.8; this.femaleCollisionRadius = 6.5; this.femaleCollisionHeight = 22.5; } - + protected CardinalTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ClericTemplate.java b/data/script/template/script/template/actor/character/ClericTemplate.java index f7b785380..120553804 100644 --- a/data/script/template/script/template/actor/character/ClericTemplate.java +++ b/data/script/template/script/template/actor/character/ClericTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ClericTemplate extends HumanMysticTemplate { @Inject public ClericTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.CLERIC.id), - CharacterClass.CLERIC, Point.fromXYZ(-90890, 248027, -3570)); + super(provider.createID(CharacterClass.CLERIC.id), CharacterClass.CLERIC, Point.fromXYZ(-90890, 248027, -3570)); + + this.hpBase = 424.000; + this.hpAdd = 34.200; + this.hpMultiplier = 0.37; + this.mpBase = 192.000; + this.mpAdd = 13.300; + this.mpMultiplier = 0.14; + this.cpBase = 212.000; + this.cpAdd = 17.150; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 41; attributes.strength = 22; @@ -45,15 +56,16 @@ public class ClericTemplate extends HumanMysticTemplate { attributes.criticalChance = 40; attributes.evasionChance = 28; attributes.runSpeed = 120; + attributes.walkSpeed = 120; attributes.maxWeigth = 62500; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 22.8; this.femaleCollisionRadius = 6.5; this.femaleCollisionHeight = 22.5; } - + protected ClericTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/DarkAvengerTemplate.java b/data/script/template/script/template/actor/character/DarkAvengerTemplate.java index 9047b081b..6587ddc6e 100644 --- a/data/script/template/script/template/actor/character/DarkAvengerTemplate.java +++ b/data/script/template/script/template/actor/character/DarkAvengerTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class DarkAvengerTemplate extends KnightTemplate { @Inject public DarkAvengerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.DARK_AVENGER.id), - CharacterClass.DARK_AVENGER, Point.fromXYZ(-71338, 258271, - -3104)); + super(provider.createID(CharacterClass.DARK_AVENGER.id), CharacterClass.DARK_AVENGER, Point.fromXYZ(-71338, 258271, -3104)); + + this.hpBase = 972.300; + this.hpAdd = 46.800; + this.hpMultiplier = 0.37; + this.mpBase = 359.100; + this.mpAdd = 19.500; + this.mpMultiplier = 0.14; + this.cpBase = 583.300; + this.cpAdd = 28.080; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 21; attributes.strength = 40; @@ -46,15 +56,16 @@ public class DarkAvengerTemplate extends KnightTemplate { attributes.criticalChance = 44; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 81900; attributes.craft = false; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 23.0; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 23.5; } - + protected DarkAvengerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/DarkFighterTemplate.java b/data/script/template/script/template/actor/character/DarkFighterTemplate.java index c6607931f..46eaa8bbc 100644 --- a/data/script/template/script/template/actor/character/DarkFighterTemplate.java +++ b/data/script/template/script/template/actor/character/DarkFighterTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class DarkFighterTemplate extends AbstractDarkElfCharacterTemplate { @Inject public DarkFighterTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.DARK_FIGHTER.id), - CharacterClass.DARK_FIGHTER, Point.fromXYZ(28377, 10916, -4224)); + super(provider.createID(CharacterClass.DARK_FIGHTER.id), CharacterClass.DARK_FIGHTER, Point.fromXYZ(28377, 10916, -4224)); + + this.hpBase = 94.000; + this.hpAdd = 13.650; + this.hpMultiplier = 0.37; + this.mpBase = 30.000; + this.mpAdd = 5.460; + this.mpMultiplier = 0.14; + this.cpBase = 37.600; + this.cpAdd = 3.800; + this.cpMultiplier = 0.22; + this.minimumLevel = 1; + // ATTRIBUTES attributes.intelligence = 25; attributes.strength = 41; @@ -45,15 +56,16 @@ public class DarkFighterTemplate extends AbstractDarkElfCharacterTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 69000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected DarkFighterTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/DarkMysticTemplate.java b/data/script/template/script/template/actor/character/DarkMysticTemplate.java index cc7766b4c..4f76ac25d 100644 --- a/data/script/template/script/template/actor/character/DarkMysticTemplate.java +++ b/data/script/template/script/template/actor/character/DarkMysticTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class DarkMysticTemplate extends AbstractDarkElfCharacterTemplate { @Inject public DarkMysticTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.DARK_MYSTIC.id), - CharacterClass.DARK_MYSTIC, Point.fromXYZ(28295, 11063, -4224)); + super(provider.createID(CharacterClass.DARK_MYSTIC.id), CharacterClass.DARK_MYSTIC, Point.fromXYZ(28295, 11063, -4224)); + + this.hpBase = 106.000; + this.hpAdd = 15.570; + this.hpMultiplier = 0.37; + this.mpBase = 40.000; + this.mpAdd = 7.380; + this.mpMultiplier = 0.14; + this.cpBase = 53.000; + this.cpAdd = 7.840; + this.cpMultiplier = 0.22; + this.minimumLevel = 1; + // ATTRIBUTES attributes.intelligence = 44; attributes.strength = 23; @@ -45,15 +56,16 @@ public class DarkMysticTemplate extends AbstractDarkElfCharacterTemplate { attributes.criticalChance = 41; attributes.evasionChance = 29; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 61000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected DarkMysticTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/DarkWizardTemplate.java b/data/script/template/script/template/actor/character/DarkWizardTemplate.java index 8e582b332..c42cf1878 100644 --- a/data/script/template/script/template/actor/character/DarkWizardTemplate.java +++ b/data/script/template/script/template/actor/character/DarkWizardTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class DarkWizardTemplate extends DarkMysticTemplate { @Inject public DarkWizardTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.DARK_WIZARD.id), - CharacterClass.DARK_WIZARD, Point.fromXYZ(28295, 11063, -4224)); + super(provider.createID(CharacterClass.DARK_WIZARD.id), CharacterClass.DARK_WIZARD, Point.fromXYZ(28295, 11063, -4224)); + + this.hpBase = 429.000; + this.hpAdd = 29.800; + this.hpMultiplier = 0.37; + this.mpBase = 192.000; + this.mpAdd = 13.300; + this.mpMultiplier = 0.14; + this.cpBase = 214.500; + this.cpAdd = 14.950; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 44; attributes.strength = 23; @@ -45,15 +56,16 @@ public class DarkWizardTemplate extends DarkMysticTemplate { attributes.criticalChance = 41; attributes.evasionChance = 29; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 61000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected DarkWizardTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/DestroyerTemplate.java b/data/script/template/script/template/actor/character/DestroyerTemplate.java index 17b8be920..4c6959285 100644 --- a/data/script/template/script/template/actor/character/DestroyerTemplate.java +++ b/data/script/template/script/template/actor/character/DestroyerTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class DestroyerTemplate extends OrcRaiderTemplate { @Inject public DestroyerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.DESTROYER.id), - CharacterClass.DESTROYER, Point.fromXYZ(-56693, -113610, -690)); + super(provider.createID(CharacterClass.DESTROYER.id), CharacterClass.DESTROYER, Point.fromXYZ(-56693, -113610, -690)); + + this.hpBase = 1110.800; + this.hpAdd = 57.100; + this.hpMultiplier = 0.37; + this.mpBase = 359.100; + this.mpAdd = 19.400; + this.mpMultiplier = 0.14; + this.cpBase = 777.500; + this.cpAdd = 39.940; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 18; attributes.strength = 40; @@ -45,15 +56,16 @@ public class DestroyerTemplate extends OrcRaiderTemplate { attributes.criticalChance = 42; attributes.evasionChance = 31; attributes.runSpeed = 117; + attributes.walkSpeed = 117; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 11.0; this.maleCollisionHeight = 28.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 27.0; } - + protected DestroyerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/DominatorTemplate.java b/data/script/template/script/template/actor/character/DominatorTemplate.java index e10a2159c..cdb00543a 100644 --- a/data/script/template/script/template/actor/character/DominatorTemplate.java +++ b/data/script/template/script/template/actor/character/DominatorTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class DominatorTemplate extends OverlordTemplate { @Inject public DominatorTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.DOMINATOR.id), - CharacterClass.DOMINATOR, Point.fromXYZ(-56682, -113730, -690)); + super(provider.createID(CharacterClass.DOMINATOR.id), CharacterClass.DOMINATOR, Point.fromXYZ(-56682, -113730, -690)); + + this.hpBase = 3359.900; + this.hpAdd = 67.960; + this.hpMultiplier = 0.37; + this.mpBase = 1540.800; + this.mpAdd = 33.100; + this.mpMultiplier = 0.14; + this.cpBase = 3037.300; + this.cpAdd = 54.350; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 31; attributes.strength = 27; @@ -45,15 +56,16 @@ public class DominatorTemplate extends OverlordTemplate { attributes.criticalChance = 41; attributes.evasionChance = 30; attributes.runSpeed = 121; + attributes.walkSpeed = 121; attributes.maxWeigth = 68000; attributes.craft = false; - + this.maleCollisionRadius = 7.0; this.maleCollisionHeight = 27.5; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 25.5; } - + protected DominatorTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/DoombringerTemplate.java b/data/script/template/script/template/actor/character/DoombringerTemplate.java index 465771407..e57236066 100644 --- a/data/script/template/script/template/actor/character/DoombringerTemplate.java +++ b/data/script/template/script/template/actor/character/DoombringerTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class DoombringerTemplate extends BersekerTemplate { @Inject public DoombringerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.DOOMBRINGER.id), - CharacterClass.DOOMBRINGER, Point.fromXYZ(-125533, 38114, 1142)); + super(provider.createID(CharacterClass.DOOMBRINGER.id), CharacterClass.DOOMBRINGER, Point.fromXYZ(-125533, 38114, 1142)); + + this.hpBase = 3515.210; + this.hpAdd = 73.040; + this.hpMultiplier = 0.37; + this.mpBase = 1166.610; + this.mpAdd = 24.900; + this.mpMultiplier = 0.14; + this.cpBase = 1757.605; + this.cpAdd = 36.520; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 29; attributes.strength = 41; @@ -45,15 +56,16 @@ public class DoombringerTemplate extends BersekerTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 8.0; this.maleCollisionHeight = 25.2; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 22.6; } - + protected DoombringerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/DoomcryerTemplate.java b/data/script/template/script/template/actor/character/DoomcryerTemplate.java index 49ef1ea1c..faf914fdf 100644 --- a/data/script/template/script/template/actor/character/DoomcryerTemplate.java +++ b/data/script/template/script/template/actor/character/DoomcryerTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class DoomcryerTemplate extends WarcryerTemplate { @Inject public DoomcryerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.DOOMCRYER.id), - CharacterClass.DOOMCRYER, Point.fromXYZ(-56682, -113730, -690)); + super(provider.createID(CharacterClass.DOOMCRYER.id), CharacterClass.DOOMCRYER, Point.fromXYZ(-56682, -113730, -690)); + + this.hpBase = 3359.900; + this.hpAdd = 67.960; + this.hpMultiplier = 0.37; + this.mpBase = 1540.800; + this.mpAdd = 33.100; + this.mpMultiplier = 0.14; + this.cpBase = 1679.900; + this.cpAdd = 33.930; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 31; attributes.strength = 27; @@ -45,15 +56,16 @@ public class DoomcryerTemplate extends WarcryerTemplate { attributes.criticalChance = 41; attributes.evasionChance = 30; attributes.runSpeed = 121; + attributes.walkSpeed = 121; attributes.maxWeigth = 68000; attributes.craft = false; - + this.maleCollisionRadius = 7.0; this.maleCollisionHeight = 27.5; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 25.5; } - + protected DoomcryerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/DreadnoughtTemplate.java b/data/script/template/script/template/actor/character/DreadnoughtTemplate.java index eef86fac6..b4d2fde81 100644 --- a/data/script/template/script/template/actor/character/DreadnoughtTemplate.java +++ b/data/script/template/script/template/actor/character/DreadnoughtTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class DreadnoughtTemplate extends WarlordTemplate { @Inject public DreadnoughtTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.DREADNOUGHT.id), - CharacterClass.DREADNOUGHT, Point - .fromXYZ(-71338, 258271, -3104)); + super(provider.createID(CharacterClass.DREADNOUGHT.id), CharacterClass.DREADNOUGHT, Point.fromXYZ(-71338, 258271, -3104)); + + this.hpBase = 3274.200; + this.hpAdd = 69.720; + this.hpMultiplier = 0.37; + this.mpBase = 1155.600; + this.mpAdd = 24.900; + this.mpMultiplier = 0.14; + this.cpBase = 2619.300; + this.cpAdd = 55.780; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 21; attributes.strength = 40; @@ -46,15 +56,16 @@ public class DreadnoughtTemplate extends WarlordTemplate { attributes.criticalChance = 44; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 81900; attributes.craft = false; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 23.0; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 23.5; } - + protected DreadnoughtTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/DuelistTemplate.java b/data/script/template/script/template/actor/character/DuelistTemplate.java index 871eb5aad..ef515ad8e 100644 --- a/data/script/template/script/template/actor/character/DuelistTemplate.java +++ b/data/script/template/script/template/actor/character/DuelistTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class DuelistTemplate extends GladiatorTemplate { @Inject public DuelistTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.DUELIST.id), - CharacterClass.DUELIST, Point.fromXYZ(-71338, 258271, -3104)); + super(provider.createID(CharacterClass.DUELIST.id), CharacterClass.DUELIST, Point.fromXYZ(-71338, 258271, -3104)); + + this.hpBase = 3061.800; + this.hpAdd = 63.080; + this.hpMultiplier = 0.37; + this.mpBase = 1155.600; + this.mpAdd = 24.900; + this.mpMultiplier = 0.14; + this.cpBase = 2755.600; + this.cpAdd = 56.770; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 21; attributes.strength = 40; @@ -45,15 +56,16 @@ public class DuelistTemplate extends GladiatorTemplate { attributes.criticalChance = 44; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 81900; attributes.craft = false; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 23.0; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 23.5; } - + protected DuelistTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/DwarvenFighterTemplate.java b/data/script/template/script/template/actor/character/DwarvenFighterTemplate.java index 9aa1e6de6..767b2fe02 100644 --- a/data/script/template/script/template/actor/character/DwarvenFighterTemplate.java +++ b/data/script/template/script/template/actor/character/DwarvenFighterTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class DwarvenFighterTemplate extends AbstractDwarfCharacterTemplate { @Inject public DwarvenFighterTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.DWARVEN_FIGHTER.id), - CharacterClass.DWARVEN_FIGHTER, Point.fromXYZ(108512, -174026, - -400)); + super(provider.createID(CharacterClass.DWARVEN_FIGHTER.id), CharacterClass.DWARVEN_FIGHTER, Point.fromXYZ(108512, -174026, -400)); + + this.hpBase = 80.000; + this.hpAdd = 12.640; + this.hpMultiplier = 0.37; + this.mpBase = 30.000; + this.mpAdd = 5.360; + this.mpMultiplier = 0.14; + this.cpBase = 56.000; + this.cpAdd = 8.820; + this.cpMultiplier = 0.22; + this.minimumLevel = 1; + // ATTRIBUTES attributes.intelligence = 20; attributes.strength = 39; @@ -46,15 +56,16 @@ public class DwarvenFighterTemplate extends AbstractDwarfCharacterTemplate { attributes.criticalChance = 43; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 83000; attributes.craft = true; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 18.0; this.femaleCollisionRadius = 5.0; this.femaleCollisionHeight = 19.0; } - + protected DwarvenFighterTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ElderTemplate.java b/data/script/template/script/template/actor/character/ElderTemplate.java index 081aa7aac..67c48688e 100644 --- a/data/script/template/script/template/actor/character/ElderTemplate.java +++ b/data/script/template/script/template/actor/character/ElderTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ElderTemplate extends OracleTemplate { @Inject public ElderTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ELDER.id), CharacterClass.ELDER, - Point.fromXYZ(46182, 41198, -3440)); + super(provider.createID(CharacterClass.ELDER.id), CharacterClass.ELDER, Point.fromXYZ(46182, 41198, -3440)); + + this.hpBase = 1191.800; + this.hpAdd = 54.600; + this.hpMultiplier = 0.37; + this.mpBase = 478.800; + this.mpAdd = 26.000; + this.mpMultiplier = 0.14; + this.cpBase = 1072.620; + this.cpAdd = 49.140; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 37; attributes.strength = 21; @@ -45,15 +56,16 @@ public class ElderTemplate extends OracleTemplate { attributes.criticalChance = 41; attributes.evasionChance = 30; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 62400; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected ElderTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ElementalMasterTemplate.java b/data/script/template/script/template/actor/character/ElementalMasterTemplate.java index e14792499..e512a0540 100644 --- a/data/script/template/script/template/actor/character/ElementalMasterTemplate.java +++ b/data/script/template/script/template/actor/character/ElementalMasterTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ElementalMasterTemplate extends ElementalSummonerTemplate { @Inject public ElementalMasterTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ELEMENTAL_MASTER.id), - CharacterClass.ELEMENTAL_MASTER, Point.fromXYZ(46182, 41198, - -3440)); + super(provider.createID(CharacterClass.ELEMENTAL_MASTER.id), CharacterClass.ELEMENTAL_MASTER, Point.fromXYZ(46182, 41198, -3440)); + + this.hpBase = 3119.300; + this.hpAdd = 64.740; + this.hpMultiplier = 0.37; + this.mpBase = 1540.800; + this.mpAdd = 33.200; + this.mpMultiplier = 0.14; + this.cpBase = 1871.500; + this.cpAdd = 38.840; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 37; attributes.strength = 21; @@ -46,15 +56,16 @@ public class ElementalMasterTemplate extends ElementalSummonerTemplate { attributes.criticalChance = 41; attributes.evasionChance = 30; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 62400; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected ElementalMasterTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ElementalSummonerTemplate.java b/data/script/template/script/template/actor/character/ElementalSummonerTemplate.java index 0a4f9dbe6..48330a7e8 100644 --- a/data/script/template/script/template/actor/character/ElementalSummonerTemplate.java +++ b/data/script/template/script/template/actor/character/ElementalSummonerTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ElementalSummonerTemplate extends ElvenWizardTemplate { @Inject public ElementalSummonerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ELEMENTAL_SUMMONER.id), - CharacterClass.ELEMENTAL_SUMMONER, Point.fromXYZ(46182, 41198, - -3440)); + super(provider.createID(CharacterClass.ELEMENTAL_SUMMONER.id), CharacterClass.ELEMENTAL_SUMMONER, Point.fromXYZ(46182, 41198, -3440)); + + this.hpBase = 1048.400; + this.hpAdd = 50.800; + this.hpMultiplier = 0.37; + this.mpBase = 478.800; + this.mpAdd = 26.100; + this.mpMultiplier = 0.14; + this.cpBase = 629.000; + this.cpAdd = 30.520; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 37; attributes.strength = 21; @@ -46,15 +56,16 @@ public class ElementalSummonerTemplate extends ElvenWizardTemplate { attributes.criticalChance = 41; attributes.evasionChance = 30; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 62400; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected ElementalSummonerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ElvenFighterTemplate.java b/data/script/template/script/template/actor/character/ElvenFighterTemplate.java index fae9ec082..2c10fc37e 100644 --- a/data/script/template/script/template/actor/character/ElvenFighterTemplate.java +++ b/data/script/template/script/template/actor/character/ElvenFighterTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ElvenFighterTemplate extends AbstractElfCharacterTemplate { @Inject public ElvenFighterTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ELVEN_FIGHTER.id), - CharacterClass.ELVEN_FIGHTER, Point - .fromXYZ(45978, 41196, -3440)); + super(provider.createID(CharacterClass.ELVEN_FIGHTER.id), CharacterClass.ELVEN_FIGHTER, Point.fromXYZ(45978, 41196, -3440)); + + this.hpBase = 89.000; + this.hpAdd = 12.740; + this.hpMultiplier = 0.37; + this.mpBase = 30.000; + this.mpAdd = 5.460; + this.mpMultiplier = 0.14; + this.cpBase = 36.100; + this.cpAdd = 3.380; + this.cpMultiplier = 0.22; + this.minimumLevel = 1; + // ATTRIBUTES attributes.intelligence = 23; attributes.strength = 36; @@ -46,15 +56,16 @@ public class ElvenFighterTemplate extends AbstractElfCharacterTemplate { attributes.criticalChance = 46; attributes.evasionChance = 36; attributes.runSpeed = 125; + attributes.walkSpeed = 125; attributes.maxWeigth = 73000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected ElvenFighterTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ElvenKnightTemplate.java b/data/script/template/script/template/actor/character/ElvenKnightTemplate.java index 6ee54ae8b..0be9c7c4b 100644 --- a/data/script/template/script/template/actor/character/ElvenKnightTemplate.java +++ b/data/script/template/script/template/actor/character/ElvenKnightTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ElvenKnightTemplate extends ElvenFighterTemplate { @Inject public ElvenKnightTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ELVEN_KNIGHT.id), - CharacterClass.ELVEN_KNIGHT, Point.fromXYZ(45978, 41196, -3440)); + super(provider.createID(CharacterClass.ELVEN_KNIGHT.id), CharacterClass.ELVEN_KNIGHT, Point.fromXYZ(45978, 41196, -3440)); + + this.hpBase = 355.000; + this.hpAdd = 33.000; + this.hpMultiplier = 0.37; + this.mpBase = 144.000; + this.mpAdd = 9.900; + this.mpMultiplier = 0.14; + this.cpBase = 177.500; + this.cpAdd = 16.500; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 23; attributes.strength = 36; @@ -45,15 +56,16 @@ public class ElvenKnightTemplate extends ElvenFighterTemplate { attributes.criticalChance = 46; attributes.evasionChance = 36; attributes.runSpeed = 125; + attributes.walkSpeed = 125; attributes.maxWeigth = 73000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected ElvenKnightTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ElvenMysticTemplate.java b/data/script/template/script/template/actor/character/ElvenMysticTemplate.java index 4c079b429..2669e357d 100644 --- a/data/script/template/script/template/actor/character/ElvenMysticTemplate.java +++ b/data/script/template/script/template/actor/character/ElvenMysticTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ElvenMysticTemplate extends AbstractElfCharacterTemplate { @Inject public ElvenMysticTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ELVEN_MYSTIC.id), - CharacterClass.ELVEN_MYSTIC, Point.fromXYZ(46182, 41198, -3440)); + super(provider.createID(CharacterClass.ELVEN_MYSTIC.id), CharacterClass.ELVEN_MYSTIC, Point.fromXYZ(46182, 41198, -3440)); + + this.hpBase = 104.000; + this.hpAdd = 15.570; + this.hpMultiplier = 0.37; + this.mpBase = 40.000; + this.mpAdd = 7.380; + this.mpMultiplier = 0.14; + this.cpBase = 52.000; + this.cpAdd = 7.840; + this.cpMultiplier = 0.22; + this.minimumLevel = 1; + // ATTRIBUTES attributes.intelligence = 37; attributes.strength = 21; @@ -45,15 +56,16 @@ public class ElvenMysticTemplate extends AbstractElfCharacterTemplate { attributes.criticalChance = 41; attributes.evasionChance = 30; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 62400; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected ElvenMysticTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ElvenScoutTemplate.java b/data/script/template/script/template/actor/character/ElvenScoutTemplate.java index c0eaa5b56..fb6b4bc52 100644 --- a/data/script/template/script/template/actor/character/ElvenScoutTemplate.java +++ b/data/script/template/script/template/actor/character/ElvenScoutTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ElvenScoutTemplate extends ElvenFighterTemplate { @Inject public ElvenScoutTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ELVEN_SCOUT.id), - CharacterClass.ELVEN_SCOUT, Point.fromXYZ(45978, 41196, -3440)); + super(provider.createID(CharacterClass.ELVEN_SCOUT.id), CharacterClass.ELVEN_SCOUT, Point.fromXYZ(45978, 41196, -3440)); + + this.hpBase = 355.000; + this.hpAdd = 30.800; + this.hpMultiplier = 0.37; + this.mpBase = 144.000; + this.mpAdd = 9.900; + this.mpMultiplier = 0.14; + this.cpBase = 177.500; + this.cpAdd = 14.400; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 23; attributes.strength = 36; @@ -45,15 +56,16 @@ public class ElvenScoutTemplate extends ElvenFighterTemplate { attributes.criticalChance = 46; attributes.evasionChance = 36; attributes.runSpeed = 125; + attributes.walkSpeed = 125; attributes.maxWeigth = 73000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected ElvenScoutTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ElvenWizardTemplate.java b/data/script/template/script/template/actor/character/ElvenWizardTemplate.java index 59b1f296a..456279217 100644 --- a/data/script/template/script/template/actor/character/ElvenWizardTemplate.java +++ b/data/script/template/script/template/actor/character/ElvenWizardTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ElvenWizardTemplate extends ElvenMysticTemplate { @Inject public ElvenWizardTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ELVEN_WIZARD.id), - CharacterClass.ELVEN_WIZARD, Point.fromXYZ(46182, 41198, -3440)); + super(provider.createID(CharacterClass.ELVEN_WIZARD.id), CharacterClass.ELVEN_WIZARD, Point.fromXYZ(46182, 41198, -3440)); + + this.hpBase = 427.000; + this.hpAdd = 28.700; + this.hpMultiplier = 0.37; + this.mpBase = 192.000; + this.mpAdd = 13.300; + this.mpMultiplier = 0.14; + this.cpBase = 213.500; + this.cpAdd = 14.400; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 37; attributes.strength = 21; @@ -45,15 +56,16 @@ public class ElvenWizardTemplate extends ElvenMysticTemplate { attributes.criticalChance = 41; attributes.evasionChance = 30; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 62400; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected ElvenWizardTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/EvaSaintTemplate.java b/data/script/template/script/template/actor/character/EvaSaintTemplate.java index 87a8aeaff..0c90ed24b 100644 --- a/data/script/template/script/template/actor/character/EvaSaintTemplate.java +++ b/data/script/template/script/template/actor/character/EvaSaintTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class EvaSaintTemplate extends ElderTemplate { @Inject public EvaSaintTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.EVA_SAINT.id), - CharacterClass.EVA_SAINT, Point.fromXYZ(46182, 41198, -3440)); + super(provider.createID(CharacterClass.EVA_SAINT.id), CharacterClass.EVA_SAINT, Point.fromXYZ(46182, 41198, -3440)); + + this.hpBase = 3422.000; + this.hpAdd = 69.720; + this.hpMultiplier = 0.37; + this.mpBase = 1540.800; + this.mpAdd = 33.200; + this.mpMultiplier = 0.14; + this.cpBase = 3079.800; + this.cpAdd = 62.748; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 37; attributes.strength = 21; @@ -45,15 +56,16 @@ public class EvaSaintTemplate extends ElderTemplate { attributes.criticalChance = 41; attributes.evasionChance = 30; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 62400; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected EvaSaintTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/EvaTemplarTemplate.java b/data/script/template/script/template/actor/character/EvaTemplarTemplate.java index dca0d65ca..82946e8db 100644 --- a/data/script/template/script/template/actor/character/EvaTemplarTemplate.java +++ b/data/script/template/script/template/actor/character/EvaTemplarTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class EvaTemplarTemplate extends TempleKnightTemplate { @Inject public EvaTemplarTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.EVA_TEMPLAR.id), - CharacterClass.EVA_TEMPLAR, Point.fromXYZ(45978, 41196, -3440)); + super(provider.createID(CharacterClass.EVA_TEMPLAR.id), CharacterClass.EVA_TEMPLAR, Point.fromXYZ(45978, 41196, -3440)); + + this.hpBase = 3196.000; + this.hpAdd = 66.400; + this.hpMultiplier = 0.37; + this.mpBase = 1155.600; + this.mpAdd = 24.900; + this.mpMultiplier = 0.14; + this.cpBase = 1917.600; + this.cpAdd = 39.840; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 23; attributes.strength = 36; @@ -45,15 +56,16 @@ public class EvaTemplarTemplate extends TempleKnightTemplate { attributes.criticalChance = 46; attributes.evasionChance = 36; attributes.runSpeed = 125; + attributes.walkSpeed = 125; attributes.maxWeigth = 73000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected EvaTemplarTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/FemaleSoldierTemplate.java b/data/script/template/script/template/actor/character/FemaleSoldierTemplate.java index d909c7296..f920173ac 100644 --- a/data/script/template/script/template/actor/character/FemaleSoldierTemplate.java +++ b/data/script/template/script/template/actor/character/FemaleSoldierTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class FemaleSoldierTemplate extends AbstractKamaelCharacterTemplate { @Inject public FemaleSoldierTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.FEMALE_SOLDIER.id), - CharacterClass.FEMALE_SOLDIER, Point.fromXYZ(-125517, 38267, - 1176)); + super(provider.createID(CharacterClass.FEMALE_SOLDIER.id), CharacterClass.FEMALE_SOLDIER, Point.fromXYZ(-125517, 38267, 1176)); + + this.hpBase = 97.000; + this.hpAdd = 16.380; + this.hpMultiplier = 0.37; + this.mpBase = 40.000; + this.mpAdd = 7.280; + this.mpMultiplier = 0.14; + this.cpBase = 48.500; + this.cpAdd = 8.190; + this.cpMultiplier = 0.22; + this.minimumLevel = 1; + // ATTRIBUTES attributes.intelligence = 28; attributes.strength = 39; @@ -46,15 +56,16 @@ public class FemaleSoldierTemplate extends AbstractKamaelCharacterTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 8.0; this.maleCollisionHeight = 22.6; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 22.6; } - + protected FemaleSoldierTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/FemaleSoulbreakerTemplate.java b/data/script/template/script/template/actor/character/FemaleSoulbreakerTemplate.java index 32f5fa499..45eb0cfd6 100644 --- a/data/script/template/script/template/actor/character/FemaleSoulbreakerTemplate.java +++ b/data/script/template/script/template/actor/character/FemaleSoulbreakerTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class FemaleSoulbreakerTemplate extends WarderTemplate { @Inject public FemaleSoulbreakerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.FEMALE_SOULBREAKER.id), - CharacterClass.FEMALE_SOULBREAKER, Point.fromXYZ(-125533, - 38114, 1142)); + super(provider.createID(CharacterClass.FEMALE_SOULBREAKER.id), CharacterClass.FEMALE_SOULBREAKER, Point.fromXYZ(-125533, 38114, 1142)); + + this.hpBase = 1134.580; + this.hpAdd = 52.000; + this.hpMultiplier = 0.37; + this.mpBase = 493.480; + this.mpAdd = 26.000; + this.mpMultiplier = 0.14; + this.cpBase = 567.290; + this.cpAdd = 26.000; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 28; attributes.strength = 39; @@ -46,15 +56,16 @@ public class FemaleSoulbreakerTemplate extends WarderTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 8.0; this.maleCollisionHeight = 22.6; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 22.6; } - + protected FemaleSoulbreakerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/FemaleSouldhoundTemplate.java b/data/script/template/script/template/actor/character/FemaleSouldhoundTemplate.java index 059d103df..68afa6d3e 100644 --- a/data/script/template/script/template/actor/character/FemaleSouldhoundTemplate.java +++ b/data/script/template/script/template/actor/character/FemaleSouldhoundTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class FemaleSouldhoundTemplate extends FemaleSoulbreakerTemplate { @Inject public FemaleSouldhoundTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.FEMALE_SOULDHOUND.id), - CharacterClass.FEMALE_SOULDHOUND, Point.fromXYZ(-125533, 38114, - 1142)); + super(provider.createID(CharacterClass.FEMALE_SOULDHOUND.id), CharacterClass.FEMALE_SOULDHOUND, Point.fromXYZ(-125533, 38114, 1142)); + + this.hpBase = 3258.580; + this.hpAdd = 66.400; + this.hpMultiplier = 0.37; + this.mpBase = 1555.480; + this.mpAdd = 33.200; + this.mpMultiplier = 0.14; + this.cpBase = 1629.290; + this.cpAdd = 33.200; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 28; attributes.strength = 39; @@ -46,15 +56,16 @@ public class FemaleSouldhoundTemplate extends FemaleSoulbreakerTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 8.0; this.maleCollisionHeight = 22.6; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 22.6; } - + protected FemaleSouldhoundTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/FortuneSeekerTemplate.java b/data/script/template/script/template/actor/character/FortuneSeekerTemplate.java index 703da2bb9..d7541330c 100644 --- a/data/script/template/script/template/actor/character/FortuneSeekerTemplate.java +++ b/data/script/template/script/template/actor/character/FortuneSeekerTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class FortuneSeekerTemplate extends BountyHunterTemplate { @Inject public FortuneSeekerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.FORTUNE_SEEKER.id), - CharacterClass.FORTUNE_SEEKER, Point.fromXYZ(108512, -174026, - -400)); + super(provider.createID(CharacterClass.FORTUNE_SEEKER.id), CharacterClass.FORTUNE_SEEKER, Point.fromXYZ(108512, -174026, -400)); + + this.hpBase = 3447.200; + this.hpAdd = 72.940; + this.hpMultiplier = 0.37; + this.mpBase = 1155.600; + this.mpAdd = 24.800; + this.mpMultiplier = 0.14; + this.cpBase = 2413.000; + this.cpAdd = 51.030; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 20; attributes.strength = 39; @@ -46,15 +56,16 @@ public class FortuneSeekerTemplate extends BountyHunterTemplate { attributes.criticalChance = 43; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 83000; attributes.craft = true; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 18.0; this.femaleCollisionRadius = 5.0; this.femaleCollisionHeight = 19.0; } - + protected FortuneSeekerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/GhostHunterTemplate.java b/data/script/template/script/template/actor/character/GhostHunterTemplate.java index 8a6c36bed..6758ecbe6 100644 --- a/data/script/template/script/template/actor/character/GhostHunterTemplate.java +++ b/data/script/template/script/template/actor/character/GhostHunterTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class GhostHunterTemplate extends AbyssWalkerTemplate { @Inject public GhostHunterTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.GHOST_HUNTER.id), - CharacterClass.GHOST_HUNTER, Point.fromXYZ(28377, 10916, -4224)); + super(provider.createID(CharacterClass.GHOST_HUNTER.id), CharacterClass.GHOST_HUNTER, Point.fromXYZ(28377, 10916, -4224)); + + this.hpBase = 3113.800; + this.hpAdd = 63.080; + this.hpMultiplier = 0.37; + this.mpBase = 1155.600; + this.mpAdd = 24.900; + this.mpMultiplier = 0.14; + this.cpBase = 1712.590; + this.cpAdd = 34.694; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 25; attributes.strength = 41; @@ -45,15 +56,16 @@ public class GhostHunterTemplate extends AbyssWalkerTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 69000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected GhostHunterTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/GhostSentinelTemplate.java b/data/script/template/script/template/actor/character/GhostSentinelTemplate.java index 9894af4e5..bb57c19df 100644 --- a/data/script/template/script/template/actor/character/GhostSentinelTemplate.java +++ b/data/script/template/script/template/actor/character/GhostSentinelTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class GhostSentinelTemplate extends PhantomRangerTemplate { @Inject public GhostSentinelTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.GHOST_SENTINEL.id), - CharacterClass.GHOST_SENTINEL, Point.fromXYZ(28377, 10916, - -4224)); + super(provider.createID(CharacterClass.GHOST_SENTINEL.id), CharacterClass.GHOST_SENTINEL, Point.fromXYZ(28377, 10916, -4224)); + + this.hpBase = 3220.000; + this.hpAdd = 66.400; + this.hpMultiplier = 0.37; + this.mpBase = 1155.600; + this.mpAdd = 24.900; + this.mpMultiplier = 0.14; + this.cpBase = 1610.000; + this.cpAdd = 33.200; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 25; attributes.strength = 41; @@ -46,15 +56,16 @@ public class GhostSentinelTemplate extends PhantomRangerTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 69000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected GhostSentinelTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/GladiatorTemplate.java b/data/script/template/script/template/actor/character/GladiatorTemplate.java index 4c4812a82..db4ea9716 100644 --- a/data/script/template/script/template/actor/character/GladiatorTemplate.java +++ b/data/script/template/script/template/actor/character/GladiatorTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class GladiatorTemplate extends WarriorTemplate { @Inject public GladiatorTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.GLADIATOR.id), - CharacterClass.GLADIATOR, Point.fromXYZ(-71338, 258271, -3104)); + super(provider.createID(CharacterClass.GLADIATOR.id), CharacterClass.GLADIATOR, Point.fromXYZ(-71338, 258271, -3104)); + + this.hpBase = 1044.000; + this.hpAdd = 49.400; + this.hpMultiplier = 0.37; + this.mpBase = 359.100; + this.mpAdd = 19.500; + this.mpMultiplier = 0.14; + this.cpBase = 939.600; + this.cpAdd = 44.460; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 21; attributes.strength = 40; @@ -45,15 +56,16 @@ public class GladiatorTemplate extends WarriorTemplate { attributes.criticalChance = 44; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 81900; attributes.craft = false; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 23.0; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 23.5; } - + protected GladiatorTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/GrandKhauatariTemplate.java b/data/script/template/script/template/actor/character/GrandKhauatariTemplate.java index 6eeb2840c..abdc0bb0a 100644 --- a/data/script/template/script/template/actor/character/GrandKhauatariTemplate.java +++ b/data/script/template/script/template/actor/character/GrandKhauatariTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class GrandKhauatariTemplate extends TyrantTemplate { @Inject public GrandKhauatariTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.GRAND_KHAUATARI.id), - CharacterClass.GRAND_KHAUATARI, Point.fromXYZ(-56693, -113610, - -690)); + super(provider.createID(CharacterClass.GRAND_KHAUATARI.id), CharacterClass.GRAND_KHAUATARI, Point.fromXYZ(-56693, -113610, -690)); + + this.hpBase = 3293.200; + this.hpAdd = 69.620; + this.hpMultiplier = 0.37; + this.mpBase = 1155.600; + this.mpAdd = 24.800; + this.mpMultiplier = 0.14; + this.cpBase = 1646.600; + this.cpAdd = 34.760; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 18; attributes.strength = 40; @@ -46,15 +56,16 @@ public class GrandKhauatariTemplate extends TyrantTemplate { attributes.criticalChance = 42; attributes.evasionChance = 31; attributes.runSpeed = 117; + attributes.walkSpeed = 117; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 11.0; this.maleCollisionHeight = 28.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 27.0; } - + protected GrandKhauatariTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/HawkeyeTemplate.java b/data/script/template/script/template/actor/character/HawkeyeTemplate.java index fd9200a8b..d51c9b8f1 100644 --- a/data/script/template/script/template/actor/character/HawkeyeTemplate.java +++ b/data/script/template/script/template/actor/character/HawkeyeTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class HawkeyeTemplate extends RogueTemplate { @Inject public HawkeyeTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.HAWKEYE.id), - CharacterClass.HAWKEYE, Point.fromXYZ(-71338, 258271, -3104)); + super(provider.createID(CharacterClass.HAWKEYE.id), CharacterClass.HAWKEYE, Point.fromXYZ(-71338, 258271, -3104)); + + this.hpBase = 924.500; + this.hpAdd = 44.200; + this.hpMultiplier = 0.37; + this.mpBase = 359.100; + this.mpAdd = 19.500; + this.mpMultiplier = 0.14; + this.cpBase = 647.100; + this.cpAdd = 30.940; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 21; attributes.strength = 40; @@ -45,15 +56,16 @@ public class HawkeyeTemplate extends RogueTemplate { attributes.criticalChance = 44; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 81900; attributes.craft = false; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 23.0; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 23.5; } - + protected HawkeyeTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/HellKnightTemplate.java b/data/script/template/script/template/actor/character/HellKnightTemplate.java index 89f56332b..e8d9fec5f 100644 --- a/data/script/template/script/template/actor/character/HellKnightTemplate.java +++ b/data/script/template/script/template/actor/character/HellKnightTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class HellKnightTemplate extends DarkAvengerTemplate { @Inject public HellKnightTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.HELL_KNIGHT.id), - CharacterClass.HELL_KNIGHT, Point - .fromXYZ(-71338, 258271, -3104)); + super(provider.createID(CharacterClass.HELL_KNIGHT.id), CharacterClass.HELL_KNIGHT, Point.fromXYZ(-71338, 258271, -3104)); + + this.hpBase = 2883.900; + this.hpAdd = 59.760; + this.hpMultiplier = 0.37; + this.mpBase = 1155.600; + this.mpAdd = 24.900; + this.mpMultiplier = 0.14; + this.cpBase = 1730.300; + this.cpAdd = 35.860; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 21; attributes.strength = 40; @@ -46,15 +56,16 @@ public class HellKnightTemplate extends DarkAvengerTemplate { attributes.criticalChance = 44; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 81900; attributes.craft = false; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 23.0; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 23.5; } - + protected HellKnightTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/HierophantTemplate.java b/data/script/template/script/template/actor/character/HierophantTemplate.java index c2e88b382..b8e6f402f 100644 --- a/data/script/template/script/template/actor/character/HierophantTemplate.java +++ b/data/script/template/script/template/actor/character/HierophantTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class HierophantTemplate extends ProphetTemplate { @Inject public HierophantTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.HIEROPHANT.id), - CharacterClass.HIEROPHANT, Point.fromXYZ(-90890, 248027, -3570)); + super(provider.createID(CharacterClass.HIEROPHANT.id), CharacterClass.HIEROPHANT, Point.fromXYZ(-90890, 248027, -3570)); + + this.hpBase = 3342.000; + this.hpAdd = 68.060; + this.hpMultiplier = 0.37; + this.mpBase = 1540.800; + this.mpAdd = 33.200; + this.mpMultiplier = 0.14; + this.cpBase = 1671.000; + this.cpAdd = 34.030; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 41; attributes.strength = 22; @@ -45,15 +56,16 @@ public class HierophantTemplate extends ProphetTemplate { attributes.criticalChance = 40; attributes.evasionChance = 28; attributes.runSpeed = 120; + attributes.walkSpeed = 120; attributes.maxWeigth = 62500; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 22.8; this.femaleCollisionRadius = 6.5; this.femaleCollisionHeight = 22.5; } - + protected HierophantTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/HumanFighterTemplate.java b/data/script/template/script/template/actor/character/HumanFighterTemplate.java index f5216eae1..82ba993e5 100644 --- a/data/script/template/script/template/actor/character/HumanFighterTemplate.java +++ b/data/script/template/script/template/actor/character/HumanFighterTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class HumanFighterTemplate extends AbstractHumanCharacterTemplate { @Inject public HumanFighterTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.HUMAN_FIGHTER.id), - CharacterClass.HUMAN_FIGHTER, Point.fromXYZ(-71338, 258271, - -3104)); + super(provider.createID(CharacterClass.HUMAN_FIGHTER.id), CharacterClass.HUMAN_FIGHTER, Point.fromXYZ(-71338, 258271, -3104)); + + this.hpBase = 80.000; + this.hpAdd = 11.830; + this.hpMultiplier = 0.37; + this.mpBase = 30.000; + this.mpAdd = 5.460; + this.mpMultiplier = 0.14; + this.cpBase = 32.000; + this.cpAdd = 3.010; + this.cpMultiplier = 0.22; + this.minimumLevel = 1; + // ATTRIBUTES attributes.intelligence = 21; attributes.strength = 40; @@ -46,15 +56,16 @@ public class HumanFighterTemplate extends AbstractHumanCharacterTemplate { attributes.criticalChance = 44; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 81900; attributes.craft = false; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 23.0; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 23.5; } - + protected HumanFighterTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/HumanMysticTemplate.java b/data/script/template/script/template/actor/character/HumanMysticTemplate.java index 454d58b39..0d5d5172c 100644 --- a/data/script/template/script/template/actor/character/HumanMysticTemplate.java +++ b/data/script/template/script/template/actor/character/HumanMysticTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class HumanMysticTemplate extends AbstractHumanCharacterTemplate { @Inject public HumanMysticTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.HUMAN_MYSTIC.id), - CharacterClass.HUMAN_MYSTIC, Point.fromXYZ(-90890, 248027, - -3570)); + super(provider.createID(CharacterClass.HUMAN_MYSTIC.id), CharacterClass.HUMAN_MYSTIC, Point.fromXYZ(-90890, 248027, -3570)); + + this.hpBase = 101.000; + this.hpAdd = 15.570; + this.hpMultiplier = 0.37; + this.mpBase = 40.000; + this.mpAdd = 7.380; + this.mpMultiplier = 0.14; + this.cpBase = 50.500; + this.cpAdd = 7.840; + this.cpMultiplier = 0.22; + this.minimumLevel = 1; + // ATTRIBUTES attributes.intelligence = 41; attributes.strength = 22; @@ -46,15 +56,16 @@ public class HumanMysticTemplate extends AbstractHumanCharacterTemplate { attributes.criticalChance = 40; attributes.evasionChance = 28; attributes.runSpeed = 120; + attributes.walkSpeed = 120; attributes.maxWeigth = 62500; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 22.8; this.femaleCollisionRadius = 6.5; this.femaleCollisionHeight = 22.5; } - + protected HumanMysticTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/InspectorTemplate.java b/data/script/template/script/template/actor/character/InspectorTemplate.java index ff81ee354..9a7802c2f 100644 --- a/data/script/template/script/template/actor/character/InspectorTemplate.java +++ b/data/script/template/script/template/actor/character/InspectorTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class InspectorTemplate extends WarderTemplate { @Inject public InspectorTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.INSPECTOR.id), - CharacterClass.INSPECTOR, Point.fromXYZ(-125533, 38114, 1142)); + super(provider.createID(CharacterClass.INSPECTOR.id), CharacterClass.INSPECTOR, Point.fromXYZ(-125533, 38114, 1142)); + + this.hpBase = 1135.870; + this.hpAdd = 53.300; + this.hpMultiplier = 0.37; + this.mpBase = 493.480; + this.mpAdd = 26.000; + this.mpMultiplier = 0.14; + this.cpBase = 567.935; + this.cpAdd = 26.650; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 28; attributes.strength = 39; @@ -45,15 +56,16 @@ public class InspectorTemplate extends WarderTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 8.0; this.maleCollisionHeight = 25.2; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 22.6; } - + protected InspectorTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/JudicatorTemplate.java b/data/script/template/script/template/actor/character/JudicatorTemplate.java index 4ba077caa..fc83ea7b4 100644 --- a/data/script/template/script/template/actor/character/JudicatorTemplate.java +++ b/data/script/template/script/template/actor/character/JudicatorTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class JudicatorTemplate extends InspectorTemplate { @Inject public JudicatorTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.JUDICATOR.id), - CharacterClass.JUDICATOR, Point.fromXYZ(-125533, 38114, 1142)); + super(provider.createID(CharacterClass.JUDICATOR.id), CharacterClass.JUDICATOR, Point.fromXYZ(-125533, 38114, 1142)); + + this.hpBase = 3312.970; + this.hpAdd = 68.060; + this.hpMultiplier = 0.37; + this.mpBase = 1555.480; + this.mpAdd = 33.200; + this.mpMultiplier = 0.14; + this.cpBase = 1656.485; + this.cpAdd = 34.030; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 28; attributes.strength = 39; @@ -45,15 +56,16 @@ public class JudicatorTemplate extends InspectorTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 8.0; this.maleCollisionHeight = 25.2; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 22.6; } - + protected JudicatorTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/KnightTemplate.java b/data/script/template/script/template/actor/character/KnightTemplate.java index 607c474f0..a4d083889 100644 --- a/data/script/template/script/template/actor/character/KnightTemplate.java +++ b/data/script/template/script/template/actor/character/KnightTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class KnightTemplate extends HumanFighterTemplate { @Inject public KnightTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.KNIGHT.id), - CharacterClass.KNIGHT, Point.fromXYZ(-71338, 258271, -3104)); + super(provider.createID(CharacterClass.KNIGHT.id), CharacterClass.KNIGHT, Point.fromXYZ(-71338, 258271, -3104)); + + this.hpBase = 327.000; + this.hpAdd = 29.700; + this.hpMultiplier = 0.37; + this.mpBase = 144.000; + this.mpAdd = 9.900; + this.mpMultiplier = 0.14; + this.cpBase = 196.200; + this.cpAdd = 17.820; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 21; attributes.strength = 40; @@ -45,15 +56,16 @@ public class KnightTemplate extends HumanFighterTemplate { attributes.criticalChance = 44; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 81900; attributes.craft = false; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 23.0; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 23.5; } - + protected KnightTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/MaestroTemplate.java b/data/script/template/script/template/actor/character/MaestroTemplate.java index 4b6d07246..abba121e8 100644 --- a/data/script/template/script/template/actor/character/MaestroTemplate.java +++ b/data/script/template/script/template/actor/character/MaestroTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class MaestroTemplate extends WarsmithTemplate { @Inject public MaestroTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.MAESTRO.id), - CharacterClass.MAESTRO, Point.fromXYZ(108512, -174026, -400)); + super(provider.createID(CharacterClass.MAESTRO.id), CharacterClass.MAESTRO, Point.fromXYZ(108512, -174026, -400)); + + this.hpBase = 3293.200; + this.hpAdd = 69.620; + this.hpMultiplier = 0.37; + this.mpBase = 1155.600; + this.mpAdd = 24.800; + this.mpMultiplier = 0.14; + this.cpBase = 2634.500; + this.cpAdd = 55.680; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 20; attributes.strength = 39; @@ -45,15 +56,16 @@ public class MaestroTemplate extends WarsmithTemplate { attributes.criticalChance = 43; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 83000; attributes.craft = true; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 18.0; this.femaleCollisionRadius = 5.0; this.femaleCollisionHeight = 19.0; } - + protected MaestroTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/MaleSoldierTemplate.java b/data/script/template/script/template/actor/character/MaleSoldierTemplate.java index 2985d0bbb..519556126 100644 --- a/data/script/template/script/template/actor/character/MaleSoldierTemplate.java +++ b/data/script/template/script/template/actor/character/MaleSoldierTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class MaleSoldierTemplate extends AbstractKamaelCharacterTemplate { @Inject public MaleSoldierTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.MALE_SOLDIER.id), - CharacterClass.MALE_SOLDIER, Point - .fromXYZ(-125464, 37776, 1176)); + super(provider.createID(CharacterClass.MALE_SOLDIER.id), CharacterClass.MALE_SOLDIER, Point.fromXYZ(-125464, 37776, 1176)); + + this.hpBase = 95.000; + this.hpAdd = 13.650; + this.hpMultiplier = 0.37; + this.mpBase = 30.000; + this.mpAdd = 5.460; + this.mpMultiplier = 0.14; + this.cpBase = 47.500; + this.cpAdd = 6.825; + this.cpMultiplier = 0.22; + this.minimumLevel = 1; + // ATTRIBUTES attributes.intelligence = 29; attributes.strength = 41; @@ -46,15 +56,16 @@ public class MaleSoldierTemplate extends AbstractKamaelCharacterTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 8.0; this.maleCollisionHeight = 25.2; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 22.6; } - + protected MaleSoldierTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/MaleSoulbreakerTemplate.java b/data/script/template/script/template/actor/character/MaleSoulbreakerTemplate.java index ea4a7600d..5f28a458d 100644 --- a/data/script/template/script/template/actor/character/MaleSoulbreakerTemplate.java +++ b/data/script/template/script/template/actor/character/MaleSoulbreakerTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class MaleSoulbreakerTemplate extends TrooperTemplate { @Inject public MaleSoulbreakerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.MALE_SOULBREAKER.id), - CharacterClass.MALE_SOULBREAKER, Point.fromXYZ(-125533, 38114, - 1142)); + super(provider.createID(CharacterClass.MALE_SOULBREAKER.id), CharacterClass.MALE_SOULBREAKER, Point.fromXYZ(-125533, 38114, 1142)); + + this.hpBase = 1173.650; + this.hpAdd = 52.000; + this.hpMultiplier = 0.37; + this.mpBase = 376.560; + this.mpAdd = 26.000; + this.mpMultiplier = 0.14; + this.cpBase = 586.825; + this.cpAdd = 26.000; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 29; attributes.strength = 41; @@ -46,15 +56,16 @@ public class MaleSoulbreakerTemplate extends TrooperTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 8.0; this.maleCollisionHeight = 25.2; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 22.6; } - + protected MaleSoulbreakerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/MaleSouldhoundTemplate.java b/data/script/template/script/template/actor/character/MaleSouldhoundTemplate.java index 5d0a87922..45b25e76e 100644 --- a/data/script/template/script/template/actor/character/MaleSouldhoundTemplate.java +++ b/data/script/template/script/template/actor/character/MaleSouldhoundTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class MaleSouldhoundTemplate extends MaleSoulbreakerTemplate { @Inject public MaleSouldhoundTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.MALE_SOULDHOUND.id), - CharacterClass.MALE_SOULDHOUND, Point.fromXYZ(-125533, 38114, - 1142)); + super(provider.createID(CharacterClass.MALE_SOULDHOUND.id), CharacterClass.MALE_SOULDHOUND, Point.fromXYZ(-125533, 38114, 1142)); + + this.hpBase = 3297.650; + this.hpAdd = 66.400; + this.hpMultiplier = 0.37; + this.mpBase = 1438.560; + this.mpAdd = 33.200; + this.mpMultiplier = 0.14; + this.cpBase = 1648.825; + this.cpAdd = 33.200; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 29; attributes.strength = 41; @@ -46,15 +56,16 @@ public class MaleSouldhoundTemplate extends MaleSoulbreakerTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 8.0; this.maleCollisionHeight = 25.2; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 22.6; } - + protected MaleSouldhoundTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/MoonlightSentinelTemplate.java b/data/script/template/script/template/actor/character/MoonlightSentinelTemplate.java index 3e92c7275..e33955970 100644 --- a/data/script/template/script/template/actor/character/MoonlightSentinelTemplate.java +++ b/data/script/template/script/template/actor/character/MoonlightSentinelTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class MoonlightSentinelTemplate extends SilverRangerTemplate { @Inject public MoonlightSentinelTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.MOONLIGHT_SENTINEL.id), - CharacterClass.MOONLIGHT_SENTINEL, Point.fromXYZ(45978, 41196, - -3440)); + super(provider.createID(CharacterClass.MOONLIGHT_SENTINEL.id), CharacterClass.MOONLIGHT_SENTINEL, Point.fromXYZ(45978, 41196, -3440)); + + this.hpBase = 3042.000; + this.hpAdd = 63.080; + this.hpMultiplier = 0.37; + this.mpBase = 1155.600; + this.mpAdd = 24.900; + this.mpMultiplier = 0.14; + this.cpBase = 1521.000; + this.cpAdd = 31.540; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 23; attributes.strength = 36; @@ -46,15 +56,16 @@ public class MoonlightSentinelTemplate extends SilverRangerTemplate { attributes.criticalChance = 46; attributes.evasionChance = 36; attributes.runSpeed = 125; + attributes.walkSpeed = 125; attributes.maxWeigth = 73000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected MoonlightSentinelTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/MysticMuseTemplate.java b/data/script/template/script/template/actor/character/MysticMuseTemplate.java index 328b4b208..cb5a38fe2 100644 --- a/data/script/template/script/template/actor/character/MysticMuseTemplate.java +++ b/data/script/template/script/template/actor/character/MysticMuseTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class MysticMuseTemplate extends SpellsingerTemplate { @Inject public MysticMuseTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.MYSTIC_MUSE.id), - CharacterClass.MYSTIC_MUSE, Point.fromXYZ(46182, 41198, -3440)); + super(provider.createID(CharacterClass.MYSTIC_MUSE.id), CharacterClass.MYSTIC_MUSE, Point.fromXYZ(46182, 41198, -3440)); + + this.hpBase = 3013.100; + this.hpAdd = 61.420; + this.hpMultiplier = 0.37; + this.mpBase = 1540.800; + this.mpAdd = 33.200; + this.mpMultiplier = 0.14; + this.cpBase = 1807.800; + this.cpAdd = 30.710; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 37; attributes.strength = 21; @@ -45,15 +56,16 @@ public class MysticMuseTemplate extends SpellsingerTemplate { attributes.criticalChance = 41; attributes.evasionChance = 30; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 62400; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected MysticMuseTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/NecromancerTemplate.java b/data/script/template/script/template/actor/character/NecromancerTemplate.java index 60858062c..96c18841c 100644 --- a/data/script/template/script/template/actor/character/NecromancerTemplate.java +++ b/data/script/template/script/template/actor/character/NecromancerTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class NecromancerTemplate extends WizardTemplate { @Inject public NecromancerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.NECROMANCER.id), - CharacterClass.NECROMANCER, Point - .fromXYZ(-90890, 248027, -3570)); + super(provider.createID(CharacterClass.NECROMANCER.id), CharacterClass.NECROMANCER, Point.fromXYZ(-90890, 248027, -3570)); + + this.hpBase = 1021.500; + this.hpAdd = 45.600; + this.hpMultiplier = 0.37; + this.mpBase = 478.800; + this.mpAdd = 26.100; + this.mpMultiplier = 0.14; + this.cpBase = 510.700; + this.cpAdd = 22.850; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 41; attributes.strength = 22; @@ -46,15 +56,16 @@ public class NecromancerTemplate extends WizardTemplate { attributes.criticalChance = 40; attributes.evasionChance = 28; attributes.runSpeed = 120; + attributes.walkSpeed = 120; attributes.maxWeigth = 62500; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 22.8; this.femaleCollisionRadius = 6.5; this.femaleCollisionHeight = 22.5; } - + protected NecromancerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/OracleTemplate.java b/data/script/template/script/template/actor/character/OracleTemplate.java index a8675f9c5..5a40d26d4 100644 --- a/data/script/template/script/template/actor/character/OracleTemplate.java +++ b/data/script/template/script/template/actor/character/OracleTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class OracleTemplate extends ElvenMysticTemplate { @Inject public OracleTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ORACLE.id), - CharacterClass.ORACLE, Point.fromXYZ(46182, 41198, -3440)); + super(provider.createID(CharacterClass.ORACLE.id), CharacterClass.ORACLE, Point.fromXYZ(46182, 41198, -3440)); + + this.hpBase = 427.000; + this.hpAdd = 35.300; + this.hpMultiplier = 0.37; + this.mpBase = 192.000; + this.mpAdd = 13.300; + this.mpMultiplier = 0.14; + this.cpBase = 213.500; + this.cpAdd = 17.700; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 37; attributes.strength = 21; @@ -45,15 +56,16 @@ public class OracleTemplate extends ElvenMysticTemplate { attributes.criticalChance = 41; attributes.evasionChance = 30; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 62400; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected OracleTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/OrcFighterTemplate.java b/data/script/template/script/template/actor/character/OrcFighterTemplate.java index ee1ed9211..1a2812155 100644 --- a/data/script/template/script/template/actor/character/OrcFighterTemplate.java +++ b/data/script/template/script/template/actor/character/OrcFighterTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class OrcFighterTemplate extends AbstractOrcCharacterTemplate { @Inject public OrcFighterTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ORC_FIGHTER.id), - CharacterClass.ORC_FIGHTER, Point - .fromXYZ(-56693, -113610, -690)); + super(provider.createID(CharacterClass.ORC_FIGHTER.id), CharacterClass.ORC_FIGHTER, Point.fromXYZ(-56693, -113610, -690)); + + this.hpBase = 80.000; + this.hpAdd = 12.640; + this.hpMultiplier = 0.37; + this.mpBase = 30.000; + this.mpAdd = 5.360; + this.mpMultiplier = 0.14; + this.cpBase = 40.000; + this.cpAdd = 6.270; + this.cpMultiplier = 0.22; + this.minimumLevel = 1; + // ATTRIBUTES attributes.intelligence = 18; attributes.strength = 40; @@ -46,15 +56,16 @@ public class OrcFighterTemplate extends AbstractOrcCharacterTemplate { attributes.criticalChance = 42; attributes.evasionChance = 31; attributes.runSpeed = 117; + attributes.walkSpeed = 117; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 11.0; this.maleCollisionHeight = 28.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 27.0; } - + protected OrcFighterTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/OrcMonkTemplate.java b/data/script/template/script/template/actor/character/OrcMonkTemplate.java index d2fd15699..597dc41eb 100644 --- a/data/script/template/script/template/actor/character/OrcMonkTemplate.java +++ b/data/script/template/script/template/actor/character/OrcMonkTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class OrcMonkTemplate extends OrcFighterTemplate { @Inject public OrcMonkTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ORC_MONK.id), - CharacterClass.ORC_MONK, Point.fromXYZ(-56682, -113610, -690)); + super(provider.createID(CharacterClass.ORC_MONK.id), CharacterClass.ORC_MONK, Point.fromXYZ(-56682, -113610, -690)); + + this.hpBase = 346.000; + this.hpAdd = 32.900; + this.hpMultiplier = 0.37; + this.mpBase = 144.000; + this.mpAdd = 9.800; + this.mpMultiplier = 0.14; + this.cpBase = 173.000; + this.cpAdd = 16.400; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 18; attributes.strength = 40; @@ -45,15 +56,16 @@ public class OrcMonkTemplate extends OrcFighterTemplate { attributes.criticalChance = 42; attributes.evasionChance = 31; attributes.runSpeed = 117; + attributes.walkSpeed = 117; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 11.0; this.maleCollisionHeight = 28.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 27.0; } - + protected OrcMonkTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/OrcMysticTemplate.java b/data/script/template/script/template/actor/character/OrcMysticTemplate.java index 4571b46ed..e047a3e2f 100644 --- a/data/script/template/script/template/actor/character/OrcMysticTemplate.java +++ b/data/script/template/script/template/actor/character/OrcMysticTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class OrcMysticTemplate extends AbstractOrcCharacterTemplate { @Inject public OrcMysticTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ORC_MYSTIC.id), - CharacterClass.ORC_MYSTIC, Point.fromXYZ(-56682, -113730, -690)); + super(provider.createID(CharacterClass.ORC_MYSTIC.id), CharacterClass.ORC_MYSTIC, Point.fromXYZ(-56682, -113730, -690)); + + this.hpBase = 95.000; + this.hpAdd = 15.470; + this.hpMultiplier = 0.37; + this.mpBase = 40.000; + this.mpAdd = 7.280; + this.mpMultiplier = 0.14; + this.cpBase = 47.500; + this.cpAdd = 7.740; + this.cpMultiplier = 0.22; + this.minimumLevel = 1; + // ATTRIBUTES attributes.intelligence = 31; attributes.strength = 27; @@ -45,15 +56,16 @@ public class OrcMysticTemplate extends AbstractOrcCharacterTemplate { attributes.criticalChance = 41; attributes.evasionChance = 30; attributes.runSpeed = 121; + attributes.walkSpeed = 121; attributes.maxWeigth = 68000; attributes.craft = false; - + this.maleCollisionRadius = 7.0; this.maleCollisionHeight = 27.5; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 25.5; } - + protected OrcMysticTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/OrcRaiderTemplate.java b/data/script/template/script/template/actor/character/OrcRaiderTemplate.java index 42dcd80ef..875fa6370 100644 --- a/data/script/template/script/template/actor/character/OrcRaiderTemplate.java +++ b/data/script/template/script/template/actor/character/OrcRaiderTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class OrcRaiderTemplate extends OrcFighterTemplate { @Inject public OrcRaiderTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ORC_RAIDER.id), - CharacterClass.ORC_RAIDER, Point.fromXYZ(-56693, -113610, -690)); + super(provider.createID(CharacterClass.ORC_RAIDER.id), CharacterClass.ORC_RAIDER, Point.fromXYZ(-56693, -113610, -690)); + + this.hpBase = 346.000; + this.hpAdd = 35.100; + this.hpMultiplier = 0.37; + this.mpBase = 144.000; + this.mpAdd = 9.800; + this.mpMultiplier = 0.14; + this.cpBase = 242.200; + this.cpAdd = 24.540; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 18; attributes.strength = 40; @@ -45,15 +56,16 @@ public class OrcRaiderTemplate extends OrcFighterTemplate { attributes.criticalChance = 42; attributes.evasionChance = 31; attributes.runSpeed = 117; + attributes.walkSpeed = 117; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 11.0; this.maleCollisionHeight = 28.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 27.0; } - + protected OrcRaiderTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/OrcShamanTemplate.java b/data/script/template/script/template/actor/character/OrcShamanTemplate.java index 9bbfc4997..9ccc63255 100644 --- a/data/script/template/script/template/actor/character/OrcShamanTemplate.java +++ b/data/script/template/script/template/actor/character/OrcShamanTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class OrcShamanTemplate extends OrcMysticTemplate { @Inject public OrcShamanTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ORC_SHAMAN.id), - CharacterClass.ORC_SHAMAN, Point.fromXYZ(-56682, -113730, -690)); + super(provider.createID(CharacterClass.ORC_SHAMAN.id), CharacterClass.ORC_SHAMAN, Point.fromXYZ(-56682, -113730, -690)); + + this.hpBase = 418.000; + this.hpAdd = 35.200; + this.hpMultiplier = 0.37; + this.mpBase = 192.000; + this.mpAdd = 13.200; + this.mpMultiplier = 0.14; + this.cpBase = 209.000; + this.cpAdd = 17.600; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 31; attributes.strength = 27; @@ -45,15 +56,16 @@ public class OrcShamanTemplate extends OrcMysticTemplate { attributes.criticalChance = 41; attributes.evasionChance = 30; attributes.runSpeed = 121; + attributes.walkSpeed = 121; attributes.maxWeigth = 68000; attributes.craft = false; - + this.maleCollisionRadius = 7.0; this.maleCollisionHeight = 27.5; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 25.5; } - + protected OrcShamanTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/OverlordTemplate.java b/data/script/template/script/template/actor/character/OverlordTemplate.java index 0cb3f67e4..1915e1159 100644 --- a/data/script/template/script/template/actor/character/OverlordTemplate.java +++ b/data/script/template/script/template/actor/character/OverlordTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class OverlordTemplate extends OrcShamanTemplate { @Inject public OverlordTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.OVERLORD.id), - CharacterClass.OVERLORD, Point.fromXYZ(-56682, -113730, -690)); + super(provider.createID(CharacterClass.OVERLORD.id), CharacterClass.OVERLORD, Point.fromXYZ(-56682, -113730, -690)); + + this.hpBase = 1182.800; + this.hpAdd = 53.300; + this.hpMultiplier = 0.37; + this.mpBase = 478.800; + this.mpAdd = 26.000; + this.mpMultiplier = 0.14; + this.cpBase = 1069.200; + this.cpAdd = 42.640; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 31; attributes.strength = 27; @@ -45,15 +56,16 @@ public class OverlordTemplate extends OrcShamanTemplate { attributes.criticalChance = 41; attributes.evasionChance = 30; attributes.runSpeed = 121; + attributes.walkSpeed = 121; attributes.maxWeigth = 68000; attributes.craft = false; - + this.maleCollisionRadius = 7.0; this.maleCollisionHeight = 27.5; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 25.5; } - + protected OverlordTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/PaladinTemplate.java b/data/script/template/script/template/actor/character/PaladinTemplate.java index 6a1bcd48d..415e78fd3 100644 --- a/data/script/template/script/template/actor/character/PaladinTemplate.java +++ b/data/script/template/script/template/actor/character/PaladinTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class PaladinTemplate extends KnightTemplate { @Inject public PaladinTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.PALADIN.id), - CharacterClass.PALADIN, Point.fromXYZ(-71338, 258271, -3104)); + super(provider.createID(CharacterClass.PALADIN.id), CharacterClass.PALADIN, Point.fromXYZ(-71338, 258271, -3104)); + + this.hpBase = 972.300; + this.hpAdd = 46.800; + this.hpMultiplier = 0.37; + this.mpBase = 359.100; + this.mpAdd = 19.500; + this.mpMultiplier = 0.14; + this.cpBase = 583.300; + this.cpAdd = 28.080; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 21; attributes.strength = 40; @@ -45,15 +56,16 @@ public class PaladinTemplate extends KnightTemplate { attributes.criticalChance = 44; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 81900; attributes.craft = false; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 23.0; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 23.5; } - + protected PaladinTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/PalusKnightTemplate.java b/data/script/template/script/template/actor/character/PalusKnightTemplate.java index 6ba541209..43d46d8ec 100644 --- a/data/script/template/script/template/actor/character/PalusKnightTemplate.java +++ b/data/script/template/script/template/actor/character/PalusKnightTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class PalusKnightTemplate extends DarkFighterTemplate { @Inject public PalusKnightTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.PALUS_KNIGHT.id), - CharacterClass.PALUS_KNIGHT, Point.fromXYZ(28377, 10916, -4224)); + super(provider.createID(CharacterClass.PALUS_KNIGHT.id), CharacterClass.PALUS_KNIGHT, Point.fromXYZ(28377, 10916, -4224)); + + this.hpBase = 379.000; + this.hpAdd = 35.200; + this.hpMultiplier = 0.37; + this.mpBase = 144.000; + this.mpAdd = 9.900; + this.mpMultiplier = 0.14; + this.cpBase = 189.500; + this.cpAdd = 17.600; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 25; attributes.strength = 41; @@ -45,15 +56,16 @@ public class PalusKnightTemplate extends DarkFighterTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 69000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected PalusKnightTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/PhantomRangerTemplate.java b/data/script/template/script/template/actor/character/PhantomRangerTemplate.java index 88a481bd2..443ba2a9e 100644 --- a/data/script/template/script/template/actor/character/PhantomRangerTemplate.java +++ b/data/script/template/script/template/actor/character/PhantomRangerTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class PhantomRangerTemplate extends AssassinTemplate { @Inject public PhantomRangerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.PHANTOM_RANGER.id), - CharacterClass.PHANTOM_RANGER, Point.fromXYZ(28377, 10916, - -4224)); + super(provider.createID(CharacterClass.PHANTOM_RANGER.id), CharacterClass.PHANTOM_RANGER, Point.fromXYZ(28377, 10916, -4224)); + + this.hpBase = 1096.000; + this.hpAdd = 52.000; + this.hpMultiplier = 0.37; + this.mpBase = 359.100; + this.mpAdd = 19.500; + this.mpMultiplier = 0.14; + this.cpBase = 548.000; + this.cpAdd = 26.000; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 25; attributes.strength = 41; @@ -46,15 +56,16 @@ public class PhantomRangerTemplate extends AssassinTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 69000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected PhantomRangerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/PhantomSummonerTemplate.java b/data/script/template/script/template/actor/character/PhantomSummonerTemplate.java index 0cf942a9c..5c85634f6 100644 --- a/data/script/template/script/template/actor/character/PhantomSummonerTemplate.java +++ b/data/script/template/script/template/actor/character/PhantomSummonerTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class PhantomSummonerTemplate extends DarkWizardTemplate { @Inject public PhantomSummonerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.PHANTOM_SUMMONER.id), - CharacterClass.PHANTOM_SUMMONER, Point.fromXYZ(28295, 11063, - -4224)); + super(provider.createID(CharacterClass.PHANTOM_SUMMONER.id), CharacterClass.PHANTOM_SUMMONER, Point.fromXYZ(28295, 11063, -4224)); + + this.hpBase = 1074.300; + this.hpAdd = 52.100; + this.hpMultiplier = 0.37; + this.mpBase = 478.800; + this.mpAdd = 26.100; + this.mpMultiplier = 0.14; + this.cpBase = 644.500; + this.cpAdd = 31.300; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 44; attributes.strength = 23; @@ -46,15 +56,16 @@ public class PhantomSummonerTemplate extends DarkWizardTemplate { attributes.criticalChance = 41; attributes.evasionChance = 29; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 61000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected PhantomSummonerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/PhoenixKnightTemplate.java b/data/script/template/script/template/actor/character/PhoenixKnightTemplate.java index 594d5b8f5..3897dfe3f 100644 --- a/data/script/template/script/template/actor/character/PhoenixKnightTemplate.java +++ b/data/script/template/script/template/actor/character/PhoenixKnightTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class PhoenixKnightTemplate extends PaladinTemplate { @Inject public PhoenixKnightTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.PHOENIX_KNIGHT.id), - CharacterClass.PHOENIX_KNIGHT, Point.fromXYZ(-71338, 258271, - -3104)); + super(provider.createID(CharacterClass.PHOENIX_KNIGHT.id), CharacterClass.PHOENIX_KNIGHT, Point.fromXYZ(-71338, 258271, -3104)); + + this.hpBase = 2883.900; + this.hpAdd = 59.760; + this.hpMultiplier = 0.37; + this.mpBase = 1155.600; + this.mpAdd = 24.900; + this.mpMultiplier = 0.14; + this.cpBase = 1730.300; + this.cpAdd = 35.860; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 21; attributes.strength = 40; @@ -46,15 +56,16 @@ public class PhoenixKnightTemplate extends PaladinTemplate { attributes.criticalChance = 44; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 81900; attributes.craft = false; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 23.0; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 23.5; } - + protected PhoenixKnightTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/PlainsWalkerTemplate.java b/data/script/template/script/template/actor/character/PlainsWalkerTemplate.java index 14fcd045a..5ac6fadc1 100644 --- a/data/script/template/script/template/actor/character/PlainsWalkerTemplate.java +++ b/data/script/template/script/template/actor/character/PlainsWalkerTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class PlainsWalkerTemplate extends ElvenScoutTemplate { @Inject public PlainsWalkerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.PLAINS_WALKER.id), - CharacterClass.PLAINS_WALKER, Point - .fromXYZ(45978, 41196, -3440)); + super(provider.createID(CharacterClass.PLAINS_WALKER.id), CharacterClass.PLAINS_WALKER, Point.fromXYZ(45978, 41196, -3440)); + + this.hpBase = 1024.200; + this.hpAdd = 46.800; + this.hpMultiplier = 0.37; + this.mpBase = 359.100; + this.mpAdd = 19.500; + this.mpMultiplier = 0.14; + this.cpBase = 563.310; + this.cpAdd = 25.740; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 23; attributes.strength = 36; @@ -46,15 +56,16 @@ public class PlainsWalkerTemplate extends ElvenScoutTemplate { attributes.criticalChance = 46; attributes.evasionChance = 36; attributes.runSpeed = 125; + attributes.walkSpeed = 125; attributes.maxWeigth = 73000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected PlainsWalkerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ProphetTemplate.java b/data/script/template/script/template/actor/character/ProphetTemplate.java index 1f4b5a4cb..c14daf507 100644 --- a/data/script/template/script/template/actor/character/ProphetTemplate.java +++ b/data/script/template/script/template/actor/character/ProphetTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ProphetTemplate extends ClericTemplate { @Inject public ProphetTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.PROPHET.id), - CharacterClass.PROPHET, Point.fromXYZ(-90890, 248027, -3570)); + super(provider.createID(CharacterClass.PROPHET.id), CharacterClass.PROPHET, Point.fromXYZ(-90890, 248027, -3570)); + + this.hpBase = 1164.900; + this.hpAdd = 53.400; + this.hpMultiplier = 0.37; + this.mpBase = 478.800; + this.mpAdd = 26.100; + this.mpMultiplier = 0.14; + this.cpBase = 582.400; + this.cpAdd = 26.750; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 41; attributes.strength = 22; @@ -45,15 +56,16 @@ public class ProphetTemplate extends ClericTemplate { attributes.criticalChance = 40; attributes.evasionChance = 28; attributes.runSpeed = 120; + attributes.walkSpeed = 120; attributes.maxWeigth = 62500; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 22.8; this.femaleCollisionRadius = 6.5; this.femaleCollisionHeight = 22.5; } - + protected ProphetTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/RogueTemplate.java b/data/script/template/script/template/actor/character/RogueTemplate.java index 9a052a17f..3e562529c 100644 --- a/data/script/template/script/template/actor/character/RogueTemplate.java +++ b/data/script/template/script/template/actor/character/RogueTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class RogueTemplate extends HumanFighterTemplate { @Inject public RogueTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.ROGUE.id), CharacterClass.ROGUE, - Point.fromXYZ(-71338, 258271, -3104)); + super(provider.createID(CharacterClass.ROGUE.id), CharacterClass.ROGUE, Point.fromXYZ(-71338, 258271, -3104)); + + this.hpBase = 327.000; + this.hpAdd = 27.500; + this.hpMultiplier = 0.37; + this.mpBase = 144.000; + this.mpAdd = 9.900; + this.mpMultiplier = 0.14; + this.cpBase = 163.000; + this.cpAdd = 12.650; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 21; attributes.strength = 40; @@ -45,15 +56,16 @@ public class RogueTemplate extends HumanFighterTemplate { attributes.criticalChance = 44; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 81900; attributes.craft = false; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 23.0; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 23.5; } - + protected RogueTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/SagittariusTemplate.java b/data/script/template/script/template/actor/character/SagittariusTemplate.java index 9aa6354c4..7a425d4df 100644 --- a/data/script/template/script/template/actor/character/SagittariusTemplate.java +++ b/data/script/template/script/template/actor/character/SagittariusTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class SagittariusTemplate extends HawkeyeTemplate { @Inject public SagittariusTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.SAGITTARIUS.id), - CharacterClass.SAGITTARIUS, Point - .fromXYZ(-71338, 258271, -3104)); + super(provider.createID(CharacterClass.SAGITTARIUS.id), CharacterClass.SAGITTARIUS, Point.fromXYZ(-71338, 258271, -3104)); + + this.hpBase = 2729.900; + this.hpAdd = 56.440; + this.hpMultiplier = 0.37; + this.mpBase = 1155.600; + this.mpAdd = 24.900; + this.mpMultiplier = 0.14; + this.cpBase = 1910.900; + this.cpAdd = 39.510; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 21; attributes.strength = 40; @@ -46,15 +56,16 @@ public class SagittariusTemplate extends HawkeyeTemplate { attributes.criticalChance = 44; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 81900; attributes.craft = false; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 23.0; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 23.5; } - + protected SagittariusTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ScavengerTemplate.java b/data/script/template/script/template/actor/character/ScavengerTemplate.java index 3bdfe424c..d678c55f4 100644 --- a/data/script/template/script/template/actor/character/ScavengerTemplate.java +++ b/data/script/template/script/template/actor/character/ScavengerTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ScavengerTemplate extends DwarvenFighterTemplate { @Inject public ScavengerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.SCAVENGER.id), - CharacterClass.SCAVENGER, Point.fromXYZ(108512, -174026, -400)); + super(provider.createID(CharacterClass.SCAVENGER.id), CharacterClass.SCAVENGER, Point.fromXYZ(108512, -174026, -400)); + + this.hpBase = 346.000; + this.hpAdd = 35.100; + this.hpMultiplier = 0.37; + this.mpBase = 144.000; + this.mpAdd = 9.800; + this.mpMultiplier = 0.14; + this.cpBase = 242.200; + this.cpAdd = 24.540; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 20; attributes.strength = 39; @@ -45,15 +56,16 @@ public class ScavengerTemplate extends DwarvenFighterTemplate { attributes.criticalChance = 43; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 83000; attributes.craft = true; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 18.0; this.femaleCollisionRadius = 5.0; this.femaleCollisionHeight = 19.0; } - + protected ScavengerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ShillieanSaintTemplate.java b/data/script/template/script/template/actor/character/ShillieanSaintTemplate.java index a63cbce22..71e2e79b1 100644 --- a/data/script/template/script/template/actor/character/ShillieanSaintTemplate.java +++ b/data/script/template/script/template/actor/character/ShillieanSaintTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ShillieanSaintTemplate extends ShillienElderTemplate { @Inject public ShillieanSaintTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.SHILLIEAN_SAINT.id), - CharacterClass.SHILLIEAN_SAINT, Point.fromXYZ(28295, 11063, - -4224)); + super(provider.createID(CharacterClass.SHILLIEAN_SAINT.id), CharacterClass.SHILLIEAN_SAINT, Point.fromXYZ(28295, 11063, -4224)); + + this.hpBase = 3447.900; + this.hpAdd = 69.720; + this.hpMultiplier = 0.37; + this.mpBase = 1540.800; + this.mpAdd = 33.200; + this.mpMultiplier = 0.14; + this.cpBase = 3103.110; + this.cpAdd = 62.748; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 44; attributes.strength = 23; @@ -46,15 +56,16 @@ public class ShillieanSaintTemplate extends ShillienElderTemplate { attributes.criticalChance = 41; attributes.evasionChance = 29; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 61000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected ShillieanSaintTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ShillienElderTemplate.java b/data/script/template/script/template/actor/character/ShillienElderTemplate.java index e8ad6a441..34458059f 100644 --- a/data/script/template/script/template/actor/character/ShillienElderTemplate.java +++ b/data/script/template/script/template/actor/character/ShillienElderTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ShillienElderTemplate extends ShillienOracleTemplate { @Inject public ShillienElderTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.SHILLIEN_ELDER.id), - CharacterClass.SHILLIEN_ELDER, Point.fromXYZ(28295, 11063, - -4224)); + super(provider.createID(CharacterClass.SHILLIEN_ELDER.id), CharacterClass.SHILLIEN_ELDER, Point.fromXYZ(28295, 11063, -4224)); + + this.hpBase = 1217.700; + this.hpAdd = 54.600; + this.hpMultiplier = 0.37; + this.mpBase = 478.800; + this.mpAdd = 26.000; + this.mpMultiplier = 0.14; + this.cpBase = 1095.930; + this.cpAdd = 49.140; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 44; attributes.strength = 23; @@ -46,15 +56,16 @@ public class ShillienElderTemplate extends ShillienOracleTemplate { attributes.criticalChance = 41; attributes.evasionChance = 29; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 61000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected ShillienElderTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ShillienKnightTemplate.java b/data/script/template/script/template/actor/character/ShillienKnightTemplate.java index e4653dffd..2c211c409 100644 --- a/data/script/template/script/template/actor/character/ShillienKnightTemplate.java +++ b/data/script/template/script/template/actor/character/ShillienKnightTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ShillienKnightTemplate extends PalusKnightTemplate { @Inject public ShillienKnightTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.SHILLIEN_KNIGHT.id), - CharacterClass.SHILLIEN_KNIGHT, Point.fromXYZ(28377, 10916, - -4224)); + super(provider.createID(CharacterClass.SHILLIEN_KNIGHT.id), CharacterClass.SHILLIEN_KNIGHT, Point.fromXYZ(28377, 10916, -4224)); + + this.hpBase = 1143.800; + this.hpAdd = 54.600; + this.hpMultiplier = 0.37; + this.mpBase = 359.100; + this.mpAdd = 19.500; + this.mpMultiplier = 0.14; + this.cpBase = 686.200; + this.cpAdd = 32.760; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 25; attributes.strength = 41; @@ -46,15 +56,16 @@ public class ShillienKnightTemplate extends PalusKnightTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 69000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected ShillienKnightTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ShillienOracleTemplate.java b/data/script/template/script/template/actor/character/ShillienOracleTemplate.java index 5527e57ec..2e7af5b9d 100644 --- a/data/script/template/script/template/actor/character/ShillienOracleTemplate.java +++ b/data/script/template/script/template/actor/character/ShillienOracleTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ShillienOracleTemplate extends DarkMysticTemplate { @Inject public ShillienOracleTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.SHILLIEN_ORACLE.id), - CharacterClass.SHILLIEN_ORACLE, Point.fromXYZ(28295, 11063, - -4224)); + super(provider.createID(CharacterClass.SHILLIEN_ORACLE.id), CharacterClass.SHILLIEN_ORACLE, Point.fromXYZ(28295, 11063, -4224)); + + this.hpBase = 429.000; + this.hpAdd = 36.400; + this.hpMultiplier = 0.37; + this.mpBase = 192.000; + this.mpAdd = 13.300; + this.mpMultiplier = 0.14; + this.cpBase = 214.500; + this.cpAdd = 18.250; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 44; attributes.strength = 23; @@ -46,15 +56,16 @@ public class ShillienOracleTemplate extends DarkMysticTemplate { attributes.criticalChance = 41; attributes.evasionChance = 29; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 61000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected ShillienOracleTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/ShillienTemplarTemplate.java b/data/script/template/script/template/actor/character/ShillienTemplarTemplate.java index 41bc06651..c16a7a441 100644 --- a/data/script/template/script/template/actor/character/ShillienTemplarTemplate.java +++ b/data/script/template/script/template/actor/character/ShillienTemplarTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class ShillienTemplarTemplate extends ShillienKnightTemplate { @Inject public ShillienTemplarTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.SHILLIEN_TEMPLAR.id), - CharacterClass.SHILLIEN_TEMPLAR, Point.fromXYZ(28377, 10916, - -4224)); + super(provider.createID(CharacterClass.SHILLIEN_TEMPLAR.id), CharacterClass.SHILLIEN_TEMPLAR, Point.fromXYZ(28377, 10916, -4224)); + + this.hpBase = 3374.000; + this.hpAdd = 69.720; + this.hpMultiplier = 0.37; + this.mpBase = 1155.600; + this.mpAdd = 24.900; + this.mpMultiplier = 0.14; + this.cpBase = 2024.400; + this.cpAdd = 41.830; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 25; attributes.strength = 41; @@ -46,15 +56,16 @@ public class ShillienTemplarTemplate extends ShillienKnightTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 69000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected ShillienTemplarTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/SilverRangerTemplate.java b/data/script/template/script/template/actor/character/SilverRangerTemplate.java index 2054ee2f3..898f65a83 100644 --- a/data/script/template/script/template/actor/character/SilverRangerTemplate.java +++ b/data/script/template/script/template/actor/character/SilverRangerTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class SilverRangerTemplate extends ElvenScoutTemplate { @Inject public SilverRangerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.SILVER_RANGER.id), - CharacterClass.SILVER_RANGER, Point - .fromXYZ(45978, 41196, -3440)); + super(provider.createID(CharacterClass.SILVER_RANGER.id), CharacterClass.SILVER_RANGER, Point.fromXYZ(45978, 41196, -3440)); + + this.hpBase = 1024.200; + this.hpAdd = 49.400; + this.hpMultiplier = 0.37; + this.mpBase = 359.100; + this.mpAdd = 19.500; + this.mpMultiplier = 0.14; + this.cpBase = 512.100; + this.cpAdd = 24.700; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 23; attributes.strength = 36; @@ -46,15 +56,16 @@ public class SilverRangerTemplate extends ElvenScoutTemplate { attributes.criticalChance = 46; attributes.evasionChance = 36; attributes.runSpeed = 125; + attributes.walkSpeed = 125; attributes.maxWeigth = 73000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected SilverRangerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/SorcerorTemplate.java b/data/script/template/script/template/actor/character/SorcerorTemplate.java index 9dae43daf..00bb980fc 100644 --- a/data/script/template/script/template/actor/character/SorcerorTemplate.java +++ b/data/script/template/script/template/actor/character/SorcerorTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class SorcerorTemplate extends WizardTemplate { @Inject public SorcerorTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.SORCEROR.id), - CharacterClass.SORCEROR, Point.fromXYZ(-90890, 248027, -3570)); + super(provider.createID(CharacterClass.SORCEROR.id), CharacterClass.SORCEROR, Point.fromXYZ(-90890, 248027, -3570)); + + this.hpBase = 1021.500; + this.hpAdd = 45.600; + this.hpMultiplier = 0.37; + this.mpBase = 478.800; + this.mpAdd = 26.100; + this.mpMultiplier = 0.14; + this.cpBase = 612.800; + this.cpAdd = 22.850; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 41; attributes.strength = 22; @@ -45,15 +56,16 @@ public class SorcerorTemplate extends WizardTemplate { attributes.criticalChance = 40; attributes.evasionChance = 28; attributes.runSpeed = 120; + attributes.walkSpeed = 120; attributes.maxWeigth = 62500; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 22.8; this.femaleCollisionRadius = 6.5; this.femaleCollisionHeight = 22.5; } - + protected SorcerorTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/SoultakerTemplate.java b/data/script/template/script/template/actor/character/SoultakerTemplate.java index 7e8f2a940..65cec348c 100644 --- a/data/script/template/script/template/actor/character/SoultakerTemplate.java +++ b/data/script/template/script/template/actor/character/SoultakerTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class SoultakerTemplate extends NecromancerTemplate { @Inject public SoultakerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.SOULTAKER.id), - CharacterClass.SOULTAKER, Point.fromXYZ(-90890, 248027, -3570)); + super(provider.createID(CharacterClass.SOULTAKER.id), CharacterClass.SOULTAKER, Point.fromXYZ(-90890, 248027, -3570)); + + this.hpBase = 2880.000; + this.hpAdd = 58.100; + this.hpMultiplier = 0.37; + this.mpBase = 1540.800; + this.mpAdd = 33.200; + this.mpMultiplier = 0.14; + this.cpBase = 1440.000; + this.cpAdd = 29.050; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 41; attributes.strength = 22; @@ -45,15 +56,16 @@ public class SoultakerTemplate extends NecromancerTemplate { attributes.criticalChance = 40; attributes.evasionChance = 28; attributes.runSpeed = 120; + attributes.walkSpeed = 120; attributes.maxWeigth = 62500; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 22.8; this.femaleCollisionRadius = 6.5; this.femaleCollisionHeight = 22.5; } - + protected SoultakerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/SpectralMasterTemplate.java b/data/script/template/script/template/actor/character/SpectralMasterTemplate.java index 974c43f43..8d0e9114c 100644 --- a/data/script/template/script/template/actor/character/SpectralMasterTemplate.java +++ b/data/script/template/script/template/actor/character/SpectralMasterTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class SpectralMasterTemplate extends PhantomSummonerTemplate { @Inject public SpectralMasterTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.SPECTRAL_MASTER.id), - CharacterClass.SPECTRAL_MASTER, Point.fromXYZ(28295, 11063, - -4224)); + super(provider.createID(CharacterClass.SPECTRAL_MASTER.id), CharacterClass.SPECTRAL_MASTER, Point.fromXYZ(28295, 11063, -4224)); + + this.hpBase = 3198.300; + this.hpAdd = 66.400; + this.hpMultiplier = 0.37; + this.mpBase = 1540.800; + this.mpAdd = 33.200; + this.mpMultiplier = 0.14; + this.cpBase = 1918.900; + this.cpAdd = 39.840; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 44; attributes.strength = 23; @@ -46,15 +56,16 @@ public class SpectralMasterTemplate extends PhantomSummonerTemplate { attributes.criticalChance = 41; attributes.evasionChance = 29; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 61000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected SpectralMasterTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/SpectraldancerTemplate.java b/data/script/template/script/template/actor/character/SpectraldancerTemplate.java index 2114a2a6c..6cd9366c3 100644 --- a/data/script/template/script/template/actor/character/SpectraldancerTemplate.java +++ b/data/script/template/script/template/actor/character/SpectraldancerTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class SpectraldancerTemplate extends BladedancerTemplate { @Inject public SpectraldancerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.spectralDancer.id), - CharacterClass.spectralDancer, Point.fromXYZ(28377, 10916, - -4224)); + super(provider.createID(CharacterClass.spectralDancer.id), CharacterClass.spectralDancer, Point.fromXYZ(28377, 10916, -4224)); + + this.hpBase = 3533.300; + this.hpAdd = 74.700; + this.hpMultiplier = 0.37; + this.mpBase = 1155.600; + this.mpAdd = 24.900; + this.mpMultiplier = 0.14; + this.cpBase = 1766.600; + this.cpAdd = 37.350; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 25; attributes.strength = 41; @@ -46,15 +56,16 @@ public class SpectraldancerTemplate extends BladedancerTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 69000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected SpectraldancerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/SpellhowlerTemplate.java b/data/script/template/script/template/actor/character/SpellhowlerTemplate.java index 6adb3237c..fcb43efd1 100644 --- a/data/script/template/script/template/actor/character/SpellhowlerTemplate.java +++ b/data/script/template/script/template/actor/character/SpellhowlerTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class SpellhowlerTemplate extends DarkWizardTemplate { @Inject public SpellhowlerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.SPELLHOWLER.id), - CharacterClass.SPELLHOWLER, Point.fromXYZ(28295, 11063, -4224)); + super(provider.createID(CharacterClass.SPELLHOWLER.id), CharacterClass.SPELLHOWLER, Point.fromXYZ(28295, 11063, -4224)); + + this.hpBase = 1074.300; + this.hpAdd = 48.200; + this.hpMultiplier = 0.37; + this.mpBase = 478.800; + this.mpAdd = 26.100; + this.mpMultiplier = 0.14; + this.cpBase = 644.500; + this.cpAdd = 24.150; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 44; attributes.strength = 23; @@ -45,15 +56,16 @@ public class SpellhowlerTemplate extends DarkWizardTemplate { attributes.criticalChance = 41; attributes.evasionChance = 29; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 61000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected SpellhowlerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/SpellsingerTemplate.java b/data/script/template/script/template/actor/character/SpellsingerTemplate.java index 36eb583ac..2a4012f2a 100644 --- a/data/script/template/script/template/actor/character/SpellsingerTemplate.java +++ b/data/script/template/script/template/actor/character/SpellsingerTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class SpellsingerTemplate extends ElvenWizardTemplate { @Inject public SpellsingerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.SPELLSINGER.id), - CharacterClass.SPELLSINGER, Point.fromXYZ(46182, 41198, -3440)); + super(provider.createID(CharacterClass.SPELLSINGER.id), CharacterClass.SPELLSINGER, Point.fromXYZ(46182, 41198, -3440)); + + this.hpBase = 1048.400; + this.hpAdd = 48.200; + this.hpMultiplier = 0.37; + this.mpBase = 478.800; + this.mpAdd = 26.100; + this.mpMultiplier = 0.14; + this.cpBase = 629.000; + this.cpAdd = 24.150; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 37; attributes.strength = 21; @@ -45,15 +56,16 @@ public class SpellsingerTemplate extends ElvenWizardTemplate { attributes.criticalChance = 41; attributes.evasionChance = 30; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 62400; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected SpellsingerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/StormScreamerTemplate.java b/data/script/template/script/template/actor/character/StormScreamerTemplate.java index 77f0cb996..f280399ce 100644 --- a/data/script/template/script/template/actor/character/StormScreamerTemplate.java +++ b/data/script/template/script/template/actor/character/StormScreamerTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class StormScreamerTemplate extends SpellhowlerTemplate { @Inject public StormScreamerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.STORM_SCREAMER.id), - CharacterClass.STORM_SCREAMER, Point.fromXYZ(28295, 11063, - -4224)); + super(provider.createID(CharacterClass.STORM_SCREAMER.id), CharacterClass.STORM_SCREAMER, Point.fromXYZ(28295, 11063, -4224)); + + this.hpBase = 3039.000; + this.hpAdd = 61.420; + this.hpMultiplier = 0.37; + this.mpBase = 1540.800; + this.mpAdd = 33.200; + this.mpMultiplier = 0.14; + this.cpBase = 1823.400; + this.cpAdd = 30.710; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 44; attributes.strength = 23; @@ -46,15 +56,16 @@ public class StormScreamerTemplate extends SpellhowlerTemplate { attributes.criticalChance = 41; attributes.evasionChance = 29; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 61000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 23.5; } - + protected StormScreamerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/SwordMuseTemplate.java b/data/script/template/script/template/actor/character/SwordMuseTemplate.java index e1fe9e869..c86d6abe3 100644 --- a/data/script/template/script/template/actor/character/SwordMuseTemplate.java +++ b/data/script/template/script/template/actor/character/SwordMuseTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class SwordMuseTemplate extends SwordSingerTemplate { @Inject public SwordMuseTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.SWORD_MUSE.id), - CharacterClass.SWORD_MUSE, Point.fromXYZ(45978, 41196, -3440)); + super(provider.createID(CharacterClass.SWORD_MUSE.id), CharacterClass.SWORD_MUSE, Point.fromXYZ(45978, 41196, -3440)); + + this.hpBase = 3302.200; + this.hpAdd = 69.720; + this.hpMultiplier = 0.37; + this.mpBase = 1155.600; + this.mpAdd = 24.900; + this.mpMultiplier = 0.14; + this.cpBase = 1651.100; + this.cpAdd = 34.860; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 23; attributes.strength = 36; @@ -45,15 +56,16 @@ public class SwordMuseTemplate extends SwordSingerTemplate { attributes.criticalChance = 46; attributes.evasionChance = 36; attributes.runSpeed = 125; + attributes.walkSpeed = 125; attributes.maxWeigth = 73000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected SwordMuseTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/SwordSingerTemplate.java b/data/script/template/script/template/actor/character/SwordSingerTemplate.java index 5e18d9b74..4e3340f95 100644 --- a/data/script/template/script/template/actor/character/SwordSingerTemplate.java +++ b/data/script/template/script/template/actor/character/SwordSingerTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class SwordSingerTemplate extends ElvenKnightTemplate { @Inject public SwordSingerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.SWORD_SINGER.id), - CharacterClass.SWORD_SINGER, Point.fromXYZ(45978, 41196, -3440)); + super(provider.createID(CharacterClass.SWORD_SINGER.id), CharacterClass.SWORD_SINGER, Point.fromXYZ(45978, 41196, -3440)); + + this.hpBase = 1072.000; + this.hpAdd = 54.600; + this.hpMultiplier = 0.37; + this.mpBase = 359.100; + this.mpAdd = 19.500; + this.mpMultiplier = 0.14; + this.cpBase = 536.000; + this.cpAdd = 27.300; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 23; attributes.strength = 36; @@ -45,15 +56,16 @@ public class SwordSingerTemplate extends ElvenKnightTemplate { attributes.criticalChance = 46; attributes.evasionChance = 36; attributes.runSpeed = 125; + attributes.walkSpeed = 125; attributes.maxWeigth = 73000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected SwordSingerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/TempleKnightTemplate.java b/data/script/template/script/template/actor/character/TempleKnightTemplate.java index f8952f116..609ca869d 100644 --- a/data/script/template/script/template/actor/character/TempleKnightTemplate.java +++ b/data/script/template/script/template/actor/character/TempleKnightTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class TempleKnightTemplate extends ElvenKnightTemplate { @Inject public TempleKnightTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.TEMPLE_KNIGHT.id), - CharacterClass.TEMPLE_KNIGHT, Point - .fromXYZ(45978, 41196, -3440)); + super(provider.createID(CharacterClass.TEMPLE_KNIGHT.id), CharacterClass.TEMPLE_KNIGHT, Point.fromXYZ(45978, 41196, -3440)); + + this.hpBase = 1072.000; + this.hpAdd = 52.000; + this.hpMultiplier = 0.37; + this.mpBase = 359.100; + this.mpAdd = 19.500; + this.mpMultiplier = 0.14; + this.cpBase = 643.200; + this.cpAdd = 31.200; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 23; attributes.strength = 36; @@ -46,15 +56,16 @@ public class TempleKnightTemplate extends ElvenKnightTemplate { attributes.criticalChance = 46; attributes.evasionChance = 36; attributes.runSpeed = 125; + attributes.walkSpeed = 125; attributes.maxWeigth = 73000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected TempleKnightTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/TitanTemplate.java b/data/script/template/script/template/actor/character/TitanTemplate.java index 1935667c2..d188a1d61 100644 --- a/data/script/template/script/template/actor/character/TitanTemplate.java +++ b/data/script/template/script/template/actor/character/TitanTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class TitanTemplate extends DestroyerTemplate { @Inject public TitanTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.TITAN.id), CharacterClass.TITAN, - Point.fromXYZ(-56693, -113610, -690)); + super(provider.createID(CharacterClass.TITAN.id), CharacterClass.TITAN, Point.fromXYZ(-56693, -113610, -690)); + + this.hpBase = 3447.200; + this.hpAdd = 72.940; + this.hpMultiplier = 0.37; + this.mpBase = 1155.600; + this.mpAdd = 24.800; + this.mpMultiplier = 0.14; + this.cpBase = 2413.000; + this.cpAdd = 51.030; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 18; attributes.strength = 40; @@ -45,15 +56,16 @@ public class TitanTemplate extends DestroyerTemplate { attributes.criticalChance = 42; attributes.evasionChance = 31; attributes.runSpeed = 117; + attributes.walkSpeed = 117; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 11.0; this.maleCollisionHeight = 28.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 27.0; } - + protected TitanTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/TreasureHunterTemplate.java b/data/script/template/script/template/actor/character/TreasureHunterTemplate.java index e94e2d302..56cda83ea 100644 --- a/data/script/template/script/template/actor/character/TreasureHunterTemplate.java +++ b/data/script/template/script/template/actor/character/TreasureHunterTemplate.java @@ -26,9 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class TreasureHunterTemplate extends RogueTemplate { @Inject public TreasureHunterTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.TREASURE_HUNTER.id), - CharacterClass.TREASURE_HUNTER, Point.fromXYZ(-71338, 258271, - -3104)); + super(provider.createID(CharacterClass.TREASURE_HUNTER.id), CharacterClass.TREASURE_HUNTER, Point.fromXYZ(-71338, 258271, -3104)); + + this.hpBase = 924.500; + this.hpAdd = 41.600; + this.hpMultiplier = 0.37; + this.mpBase = 359.100; + this.mpAdd = 19.500; + this.mpMultiplier = 0.14; + this.cpBase = 508.475; + this.cpAdd = 22.880; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 21; attributes.strength = 40; @@ -46,15 +56,16 @@ public class TreasureHunterTemplate extends RogueTemplate { attributes.criticalChance = 44; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 81900; attributes.craft = false; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 23.0; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 23.5; } - + protected TreasureHunterTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/TricksterTemplate.java b/data/script/template/script/template/actor/character/TricksterTemplate.java index c65c7bcab..3eb8933eb 100644 --- a/data/script/template/script/template/actor/character/TricksterTemplate.java +++ b/data/script/template/script/template/actor/character/TricksterTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class TricksterTemplate extends ArbalesterTemplate { @Inject public TricksterTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.TRICKSTER.id), - CharacterClass.TRICKSTER, Point.fromXYZ(-125533, 38114, 1142)); + super(provider.createID(CharacterClass.TRICKSTER.id), CharacterClass.TRICKSTER, Point.fromXYZ(-125533, 38114, 1142)); + + this.hpBase = 3476.140; + this.hpAdd = 73.040; + this.hpMultiplier = 0.37; + this.mpBase = 1283.530; + this.mpAdd = 24.900; + this.mpMultiplier = 0.14; + this.cpBase = 1738.070; + this.cpAdd = 36.520; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 28; attributes.strength = 39; @@ -45,15 +56,16 @@ public class TricksterTemplate extends ArbalesterTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 8.0; this.maleCollisionHeight = 22.6; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 22.6; } - + protected TricksterTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/TrooperTemplate.java b/data/script/template/script/template/actor/character/TrooperTemplate.java index 649d5153a..42cf7a8e8 100644 --- a/data/script/template/script/template/actor/character/TrooperTemplate.java +++ b/data/script/template/script/template/actor/character/TrooperTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class TrooperTemplate extends MaleSoldierTemplate { @Inject public TrooperTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.TROOPER.id), - CharacterClass.TROOPER, Point.fromXYZ(-125533, 38114, 1142)); + super(provider.createID(CharacterClass.TROOPER.id), CharacterClass.TROOPER, Point.fromXYZ(-125533, 38114, 1142)); + + this.hpBase = 398.530; + this.hpAdd = 35.200; + this.hpMultiplier = 0.37; + this.mpBase = 147.270; + this.mpAdd = 9.900; + this.mpMultiplier = 0.14; + this.cpBase = 199.265; + this.cpAdd = 17.600; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 29; attributes.strength = 41; @@ -45,15 +56,16 @@ public class TrooperTemplate extends MaleSoldierTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 8.0; this.maleCollisionHeight = 25.2; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 22.6; } - + protected TrooperTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/TyrantTemplate.java b/data/script/template/script/template/actor/character/TyrantTemplate.java index a7639a345..a1deb2a20 100644 --- a/data/script/template/script/template/actor/character/TyrantTemplate.java +++ b/data/script/template/script/template/actor/character/TyrantTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class TyrantTemplate extends OrcRaiderTemplate { @Inject public TyrantTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.TYRANT.id), - CharacterClass.TYRANT, Point.fromXYZ(-56693, -113610, -690)); + super(provider.createID(CharacterClass.TYRANT.id), CharacterClass.TYRANT, Point.fromXYZ(-56693, -113610, -690)); + + this.hpBase = 1063.000; + this.hpAdd = 54.500; + this.hpMultiplier = 0.37; + this.mpBase = 359.100; + this.mpAdd = 19.400; + this.mpMultiplier = 0.14; + this.cpBase = 531.500; + this.cpAdd = 27.200; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 18; attributes.strength = 40; @@ -45,15 +56,16 @@ public class TyrantTemplate extends OrcRaiderTemplate { attributes.criticalChance = 42; attributes.evasionChance = 31; attributes.runSpeed = 117; + attributes.walkSpeed = 117; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 11.0; this.maleCollisionHeight = 28.0; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 27.0; } - + protected TyrantTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/WarcryerTemplate.java b/data/script/template/script/template/actor/character/WarcryerTemplate.java index b9d35c02d..d677f570b 100644 --- a/data/script/template/script/template/actor/character/WarcryerTemplate.java +++ b/data/script/template/script/template/actor/character/WarcryerTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class WarcryerTemplate extends OrcShamanTemplate { @Inject public WarcryerTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.WARCRYER.id), - CharacterClass.WARCRYER, Point.fromXYZ(-56682, -113730, -690)); + super(provider.createID(CharacterClass.WARCRYER.id), CharacterClass.WARCRYER, Point.fromXYZ(-56682, -113730, -690)); + + this.hpBase = 1182.800; + this.hpAdd = 53.300; + this.hpMultiplier = 0.37; + this.mpBase = 478.800; + this.mpAdd = 26.000; + this.mpMultiplier = 0.14; + this.cpBase = 591.400; + this.cpAdd = 26.650; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 31; attributes.strength = 27; @@ -45,15 +56,16 @@ public class WarcryerTemplate extends OrcShamanTemplate { attributes.criticalChance = 41; attributes.evasionChance = 30; attributes.runSpeed = 121; + attributes.walkSpeed = 121; attributes.maxWeigth = 68000; attributes.craft = false; - + this.maleCollisionRadius = 7.0; this.maleCollisionHeight = 27.5; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 25.5; } - + protected WarcryerTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/WarderTemplate.java b/data/script/template/script/template/actor/character/WarderTemplate.java index e33735c0b..d4fa046f5 100644 --- a/data/script/template/script/template/actor/character/WarderTemplate.java +++ b/data/script/template/script/template/actor/character/WarderTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class WarderTemplate extends FemaleSoldierTemplate { @Inject public WarderTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.WARDER.id), - CharacterClass.WARDER, Point.fromXYZ(-125533, 38114, 1142)); + super(provider.createID(CharacterClass.WARDER.id), CharacterClass.WARDER, Point.fromXYZ(-125533, 38114, 1142)); + + this.hpBase = 449.900; + this.hpAdd = 30.800; + this.hpMultiplier = 0.37; + this.mpBase = 196.360; + this.mpAdd = 13.200; + this.mpMultiplier = 0.14; + this.cpBase = 224.950; + this.cpAdd = 15.400; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 28; attributes.strength = 39; @@ -45,15 +56,16 @@ public class WarderTemplate extends FemaleSoldierTemplate { attributes.criticalChance = 45; attributes.evasionChance = 35; attributes.runSpeed = 122; + attributes.walkSpeed = 122; attributes.maxWeigth = 87000; attributes.craft = false; - + this.maleCollisionRadius = 8.0; this.maleCollisionHeight = 22.6; this.femaleCollisionRadius = 7.0; this.femaleCollisionHeight = 22.6; } - + protected WarderTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/WarlockTemplate.java b/data/script/template/script/template/actor/character/WarlockTemplate.java index 4cc021273..3df7613a0 100644 --- a/data/script/template/script/template/actor/character/WarlockTemplate.java +++ b/data/script/template/script/template/actor/character/WarlockTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class WarlockTemplate extends WizardTemplate { @Inject public WarlockTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.WARLOCK.id), - CharacterClass.WARLOCK, Point.fromXYZ(-90890, 248027, -3570)); + super(provider.createID(CharacterClass.WARLOCK.id), CharacterClass.WARLOCK, Point.fromXYZ(-90890, 248027, -3570)); + + this.hpBase = 1021.500; + this.hpAdd = 49.500; + this.hpMultiplier = 0.37; + this.mpBase = 478.800; + this.mpAdd = 26.100; + this.mpMultiplier = 0.14; + this.cpBase = 612.900; + this.cpAdd = 29.740; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 41; attributes.strength = 22; @@ -45,15 +56,16 @@ public class WarlockTemplate extends WizardTemplate { attributes.criticalChance = 40; attributes.evasionChance = 28; attributes.runSpeed = 120; + attributes.walkSpeed = 120; attributes.maxWeigth = 62500; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 22.8; this.femaleCollisionRadius = 6.5; this.femaleCollisionHeight = 22.5; } - + protected WarlockTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/WarlordTemplate.java b/data/script/template/script/template/actor/character/WarlordTemplate.java index d3d1f1d33..385b7db6e 100644 --- a/data/script/template/script/template/actor/character/WarlordTemplate.java +++ b/data/script/template/script/template/actor/character/WarlordTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class WarlordTemplate extends WarriorTemplate { @Inject public WarlordTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.WARLORD.id), - CharacterClass.WARLORD, Point.fromXYZ(-71338, 258271, -3104)); + super(provider.createID(CharacterClass.WARLORD.id), CharacterClass.WARLORD, Point.fromXYZ(-71338, 258271, -3104)); + + this.hpBase = 1044.000; + this.hpAdd = 54.600; + this.hpMultiplier = 0.37; + this.mpBase = 359.100; + this.mpAdd = 19.500; + this.mpMultiplier = 0.14; + this.cpBase = 835.200; + this.cpAdd = 43.680; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 21; attributes.strength = 40; @@ -45,15 +56,16 @@ public class WarlordTemplate extends WarriorTemplate { attributes.criticalChance = 44; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 81900; attributes.craft = false; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 23.0; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 23.5; } - + protected WarlordTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/WarriorTemplate.java b/data/script/template/script/template/actor/character/WarriorTemplate.java index b9bb68d3e..d94ce818b 100644 --- a/data/script/template/script/template/actor/character/WarriorTemplate.java +++ b/data/script/template/script/template/actor/character/WarriorTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class WarriorTemplate extends HumanFighterTemplate { @Inject public WarriorTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.WARRIOR.id), - CharacterClass.WARRIOR, Point.fromXYZ(-71338, 258271, -3104)); + super(provider.createID(CharacterClass.WARRIOR.id), CharacterClass.WARRIOR, Point.fromXYZ(-71338, 258271, -3104)); + + this.hpBase = 327.000; + this.hpAdd = 33.000; + this.hpMultiplier = 0.37; + this.mpBase = 144.000; + this.mpAdd = 9.900; + this.mpMultiplier = 0.14; + this.cpBase = 261.600; + this.cpAdd = 26.400; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 21; attributes.strength = 40; @@ -45,15 +56,16 @@ public class WarriorTemplate extends HumanFighterTemplate { attributes.criticalChance = 44; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 81900; attributes.craft = false; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 23.0; this.femaleCollisionRadius = 8.0; this.femaleCollisionHeight = 23.5; } - + protected WarriorTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/WarsmithTemplate.java b/data/script/template/script/template/actor/character/WarsmithTemplate.java index 684998af8..10604f5b4 100644 --- a/data/script/template/script/template/actor/character/WarsmithTemplate.java +++ b/data/script/template/script/template/actor/character/WarsmithTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class WarsmithTemplate extends ArtisanTemplate { @Inject public WarsmithTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.WARSMITH.id), - CharacterClass.WARSMITH, Point.fromXYZ(108512, -174026, -400)); + super(provider.createID(CharacterClass.WARSMITH.id), CharacterClass.WARSMITH, Point.fromXYZ(108512, -174026, -400)); + + this.hpBase = 1063.000; + this.hpAdd = 54.500; + this.hpMultiplier = 0.37; + this.mpBase = 359.100; + this.mpAdd = 19.400; + this.mpMultiplier = 0.14; + this.cpBase = 850.400; + this.cpAdd = 43.580; + this.cpMultiplier = 0.22; + this.minimumLevel = 40; + // ATTRIBUTES attributes.intelligence = 20; attributes.strength = 39; @@ -45,15 +56,16 @@ public class WarsmithTemplate extends ArtisanTemplate { attributes.criticalChance = 43; attributes.evasionChance = 33; attributes.runSpeed = 115; + attributes.walkSpeed = 115; attributes.maxWeigth = 83000; attributes.craft = true; - + this.maleCollisionRadius = 9.0; this.maleCollisionHeight = 18.0; this.femaleCollisionRadius = 5.0; this.femaleCollisionHeight = 19.0; } - + protected WarsmithTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/WindRiderTemplate.java b/data/script/template/script/template/actor/character/WindRiderTemplate.java index dca5883f7..d7d3a6cf8 100644 --- a/data/script/template/script/template/actor/character/WindRiderTemplate.java +++ b/data/script/template/script/template/actor/character/WindRiderTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class WindRiderTemplate extends PlainsWalkerTemplate { @Inject public WindRiderTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.WIND_RIDER.id), - CharacterClass.WIND_RIDER, Point.fromXYZ(45978, 41196, -3440)); + super(provider.createID(CharacterClass.WIND_RIDER.id), CharacterClass.WIND_RIDER, Point.fromXYZ(45978, 41196, -3440)); + + this.hpBase = 2935.800; + this.hpAdd = 59.760; + this.hpMultiplier = 0.37; + this.mpBase = 1155.600; + this.mpAdd = 24.900; + this.mpMultiplier = 0.14; + this.cpBase = 1614.690; + this.cpAdd = 32.868; + this.cpMultiplier = 0.22; + this.minimumLevel = 76; + // ATTRIBUTES attributes.intelligence = 23; attributes.strength = 36; @@ -45,15 +56,16 @@ public class WindRiderTemplate extends PlainsWalkerTemplate { attributes.criticalChance = 46; attributes.evasionChance = 36; attributes.runSpeed = 125; + attributes.walkSpeed = 125; attributes.maxWeigth = 73000; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 24.0; this.femaleCollisionRadius = 7.5; this.femaleCollisionHeight = 23.0; } - + protected WindRiderTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/actor/character/WizardTemplate.java b/data/script/template/script/template/actor/character/WizardTemplate.java index 3433002dc..2f16c3b8d 100644 --- a/data/script/template/script/template/actor/character/WizardTemplate.java +++ b/data/script/template/script/template/actor/character/WizardTemplate.java @@ -26,8 +26,19 @@ import com.l2jserver.util.dimensional.Point; public class WizardTemplate extends HumanMysticTemplate { @Inject public WizardTemplate(CharacterTemplateIDProvider provider) { - super(provider.createID(CharacterClass.WIZARD.id), - CharacterClass.WIZARD, Point.fromXYZ(-90890, 248027, -3570)); + super(provider.createID(CharacterClass.WIZARD.id), CharacterClass.WIZARD, Point.fromXYZ(-90890, 248027, -3570)); + + this.hpBase = 424.000; + this.hpAdd = 27.600; + this.hpMultiplier = 0.37; + this.mpBase = 192.000; + this.mpAdd = 13.300; + this.mpMultiplier = 0.14; + this.cpBase = 212.000; + this.cpAdd = 13.850; + this.cpMultiplier = 0.22; + this.minimumLevel = 20; + // ATTRIBUTES attributes.intelligence = 41; attributes.strength = 22; @@ -45,15 +56,16 @@ public class WizardTemplate extends HumanMysticTemplate { attributes.criticalChance = 40; attributes.evasionChance = 28; attributes.runSpeed = 120; + attributes.walkSpeed = 120; attributes.maxWeigth = 62500; attributes.craft = false; - + this.maleCollisionRadius = 7.5; this.maleCollisionHeight = 22.8; this.femaleCollisionRadius = 6.5; this.femaleCollisionHeight = 22.5; } - + protected WizardTemplate(CharacterTemplateID id, CharacterClass characterClass, Point spawnLocation) { super(id, characterClass, spawnLocation); diff --git a/data/script/template/script/template/item/weapon/LongSwordTemplate.java b/data/script/template/script/template/item/weapon/LongSwordTemplate.java index c87dc79f4..656fab48f 100644 --- a/data/script/template/script/template/item/weapon/LongSwordTemplate.java +++ b/data/script/template/script/template/item/weapon/LongSwordTemplate.java @@ -16,13 +16,9 @@ */ package script.template.item.weapon; -import static com.l2jserver.model.template.item.WeaponTemplate.WeaponAttributeType.MAGICAL_ATTACK; -import static com.l2jserver.model.template.item.WeaponTemplate.WeaponAttributeType.PHYSICAL_ATTACK; -import static com.l2jserver.model.template.item.WeaponTemplate.WeaponAttributeType.PHYSICAL_ATTACK_SPEED; -import static com.l2jserver.model.template.item.WeaponTemplate.WeaponAttributeType.R_CRITICAL; - import com.google.inject.Inject; import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider; +import com.l2jserver.model.world.actor.stat.Stats.StatType; import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll; public class LongSwordTemplate extends AbstractNoGradeWeaponTemplate { @@ -34,10 +30,10 @@ public class LongSwordTemplate extends AbstractNoGradeWeaponTemplate { ItemMaterial.STEEL, InventoryPaperdoll.RIGHT_HAND, WeaponType.SWORD); - attribute.set(PHYSICAL_ATTACK, 0x80, 24); - attribute.set(MAGICAL_ATTACK, 0x80, 17); - attribute.set(R_CRITICAL, 0x80, 8); - attribute.set(PHYSICAL_ATTACK_SPEED, 0x80, 379); + stats.set(StatType.POWER_ATTACK, 0x80, 24); + stats.set(StatType.MAGIC_ATTACK, 0x80, 17); + stats.set(StatType.CRITICAL_RATE, 0x80, 8); + stats.set(StatType.POWER_ATTACK_SPEED, 0x80, 379); this.randomDamage = 10; this.attackRange = 40; diff --git a/data/script/template/script/template/item/weapon/ShortSwordTemplate.java b/data/script/template/script/template/item/weapon/ShortSwordTemplate.java index 21e0c0827..9239062c7 100644 --- a/data/script/template/script/template/item/weapon/ShortSwordTemplate.java +++ b/data/script/template/script/template/item/weapon/ShortSwordTemplate.java @@ -16,13 +16,9 @@ */ package script.template.item.weapon; -import static com.l2jserver.model.template.item.WeaponTemplate.WeaponAttributeType.MAGICAL_ATTACK; -import static com.l2jserver.model.template.item.WeaponTemplate.WeaponAttributeType.PHYSICAL_ATTACK; -import static com.l2jserver.model.template.item.WeaponTemplate.WeaponAttributeType.PHYSICAL_ATTACK_SPEED; -import static com.l2jserver.model.template.item.WeaponTemplate.WeaponAttributeType.R_CRITICAL; - import com.google.inject.Inject; import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider; +import com.l2jserver.model.world.actor.stat.Stats.StatType; import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll; public class ShortSwordTemplate extends AbstractNoGradeWeaponTemplate { @@ -34,10 +30,10 @@ public class ShortSwordTemplate extends AbstractNoGradeWeaponTemplate { ItemMaterial.STEEL, InventoryPaperdoll.RIGHT_HAND, WeaponType.SWORD); - attribute.set(PHYSICAL_ATTACK, 0x08, 8); - attribute.set(MAGICAL_ATTACK, 0x08, 6); - attribute.set(R_CRITICAL, 0x08, 8); - attribute.set(PHYSICAL_ATTACK_SPEED, 0x08, 379); + stats.set(StatType.POWER_ATTACK, 0x08, 8); + stats.set(StatType.MAGIC_ATTACK, 0x08, 6); + stats.set(StatType.CRITICAL_RATE, 0x08, 8); + stats.set(StatType.POWER_ATTACK_SPEED, 0x08, 379); this.type = WeaponType.SWORD; this.paperdoll = InventoryPaperdoll.RIGHT_HAND; diff --git a/data/script/template/template.xml b/data/script/template/template.xml index da257b7b7..8d8ff22d9 100644 --- a/data/script/template/template.xml +++ b/data/script/template/template.xml @@ -20,4 +20,5 @@ + \ No newline at end of file diff --git a/dist/sql/character.sql b/dist/sql/character.sql index 09122b06a..c5f07747a 100644 --- a/dist/sql/character.sql +++ b/dist/sql/character.sql @@ -9,6 +9,9 @@ CREATE TABLE IF NOT EXISTS `character` ( `level` int(3) NOT NULL, `experience` int(15) NOT NULL, `sp` int(15) NOT NULL, + `hp` double NOT NULL, + `mp` double NOT NULL, + `cp` double NOT NULL, `point_x` int(10) NOT NULL, `point_y` int(10) NOT NULL, `point_z` int(10) NOT NULL, @@ -21,7 +24,6 @@ CREATE TABLE IF NOT EXISTS `character` ( KEY `name` (`name`), KEY `clan_id` (`clan_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -- -- Temporary sample data -- diff --git a/src/dao/com/l2jserver/db/dao/CharacterDAO.java b/src/dao/com/l2jserver/db/dao/CharacterDAO.java index 8b4194887..889c8efcb 100644 --- a/src/dao/com/l2jserver/db/dao/CharacterDAO.java +++ b/src/dao/com/l2jserver/db/dao/CharacterDAO.java @@ -19,12 +19,10 @@ package com.l2jserver.db.dao; import java.util.List; import com.l2jserver.model.id.AccountID; -import com.l2jserver.model.id.ID; import com.l2jserver.model.id.object.CharacterID; import com.l2jserver.model.world.Clan; import com.l2jserver.model.world.L2Character; import com.l2jserver.service.cache.Cacheable; -import com.l2jserver.service.cache.IgnoreCaching; import com.l2jserver.service.database.DataAccessObject; /** @@ -61,12 +59,4 @@ public interface CharacterDAO extends * characters. */ List selectByAccount(AccountID account); - - /** - * Loads an List of all {@link ID}s in the database - * - * @return the list containing all ids - */ - @IgnoreCaching - List listIDs(); } diff --git a/src/dao/com/l2jserver/db/dao/ClanDAO.java b/src/dao/com/l2jserver/db/dao/ClanDAO.java index a6d77d20b..e71cad41b 100644 --- a/src/dao/com/l2jserver/db/dao/ClanDAO.java +++ b/src/dao/com/l2jserver/db/dao/ClanDAO.java @@ -16,13 +16,9 @@ */ package com.l2jserver.db.dao; -import java.util.List; - -import com.l2jserver.model.id.ID; import com.l2jserver.model.id.object.ClanID; import com.l2jserver.model.world.Clan; import com.l2jserver.service.cache.Cacheable; -import com.l2jserver.service.cache.IgnoreCaching; import com.l2jserver.service.database.DataAccessObject; /** @@ -31,11 +27,4 @@ import com.l2jserver.service.database.DataAccessObject; * @author Rogiel */ public interface ClanDAO extends DataAccessObject, Cacheable { - /** - * Loads an List of all {@link ID}s in the database - * - * @return the list containing all ids - */ - @IgnoreCaching - List listIDs(); } diff --git a/src/dao/com/l2jserver/db/dao/ItemDAO.java b/src/dao/com/l2jserver/db/dao/ItemDAO.java index 264f4194c..0f3a6437f 100644 --- a/src/dao/com/l2jserver/db/dao/ItemDAO.java +++ b/src/dao/com/l2jserver/db/dao/ItemDAO.java @@ -16,14 +16,10 @@ */ package com.l2jserver.db.dao; -import java.util.List; - -import com.l2jserver.model.id.ID; import com.l2jserver.model.id.object.ItemID; import com.l2jserver.model.world.Item; import com.l2jserver.model.world.L2Character; import com.l2jserver.service.cache.Cacheable; -import com.l2jserver.service.cache.IgnoreCaching; import com.l2jserver.service.database.DataAccessObject; /** @@ -41,12 +37,4 @@ public interface ItemDAO extends DataAccessObject, Cacheable { * @return amount of items loaded */ int loadInventory(L2Character character); - - /** - * Loads an List of all {@link ID}s in the database - * - * @return the list containing all ids - */ - @IgnoreCaching - List listIDs(); } diff --git a/src/dao/com/l2jserver/db/dao/NPCDAO.java b/src/dao/com/l2jserver/db/dao/NPCDAO.java index a4449436b..f663f691f 100644 --- a/src/dao/com/l2jserver/db/dao/NPCDAO.java +++ b/src/dao/com/l2jserver/db/dao/NPCDAO.java @@ -18,12 +18,10 @@ package com.l2jserver.db.dao; import java.util.List; -import com.l2jserver.model.id.ID; import com.l2jserver.model.id.object.NPCID; import com.l2jserver.model.id.template.NPCTemplateID; import com.l2jserver.model.world.NPC; import com.l2jserver.service.cache.Cacheable; -import com.l2jserver.service.cache.IgnoreCaching; import com.l2jserver.service.database.DataAccessObject; /** @@ -47,12 +45,4 @@ public interface NPCDAO extends DataAccessObject, Cacheable { * @return the found NPC. Null if does not exists. */ List selectByTemplate(NPCTemplateID templateID); - - /** - * Loads an List of all {@link ID}s in the database - * - * @return the list containing all ids - */ - @IgnoreCaching - List listIDs(); } diff --git a/src/dao/com/l2jserver/db/dao/PetDAO.java b/src/dao/com/l2jserver/db/dao/PetDAO.java index 0085aac20..87b9d52b2 100644 --- a/src/dao/com/l2jserver/db/dao/PetDAO.java +++ b/src/dao/com/l2jserver/db/dao/PetDAO.java @@ -16,13 +16,9 @@ */ package com.l2jserver.db.dao; -import java.util.List; - -import com.l2jserver.model.id.ID; import com.l2jserver.model.id.object.PetID; import com.l2jserver.model.world.Pet; import com.l2jserver.service.cache.Cacheable; -import com.l2jserver.service.cache.IgnoreCaching; import com.l2jserver.service.database.DataAccessObject; /** @@ -31,11 +27,4 @@ import com.l2jserver.service.database.DataAccessObject; * @author Rogiel */ public interface PetDAO extends DataAccessObject, Cacheable { - /** - * Loads an List of all {@link ID}s in the database - * - * @return the list containing all ids - */ - @IgnoreCaching - List listIDs(); } diff --git a/src/dao/mysql5/com/l2jserver/db/dao/mysql5/AbstractMySQL5DAO.java b/src/dao/mysql5/com/l2jserver/db/dao/mysql5/AbstractMySQL5DAO.java index 27c7fd22c..519a573d4 100644 --- a/src/dao/mysql5/com/l2jserver/db/dao/mysql5/AbstractMySQL5DAO.java +++ b/src/dao/mysql5/com/l2jserver/db/dao/mysql5/AbstractMySQL5DAO.java @@ -30,9 +30,11 @@ import com.l2jserver.service.database.MySQLDatabaseService; * * @param * the object for the DAO + * @param + * the object ID type */ -public abstract class AbstractMySQL5DAO, I extends ID> extends - AbstractDAO { +public abstract class AbstractMySQL5DAO, I extends ID> + extends AbstractDAO { /** * The MySQL Database Service */ diff --git a/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5CharacterDAO.java b/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5CharacterDAO.java index 53f729a6a..ce29f12c5 100644 --- a/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5CharacterDAO.java +++ b/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5CharacterDAO.java @@ -92,6 +92,10 @@ public class MySQL5CharacterDAO extends public static final String EXPERIENCE = "experience"; public static final String SP = "sp"; + public static final String HP = "hp"; + public static final String MP = "mp"; + public static final String CP = "cp"; + public static final String POINT_X = "point_x"; public static final String POINT_Y = "point_y"; public static final String POINT_Z = "point_z"; @@ -113,16 +117,21 @@ public class MySQL5CharacterDAO extends this.clanIdFactory = clanIdFactory; } + /** + * The mapper for {@link CharacterID} + */ + private final Mapper idMapper = new Mapper() { + @Override + public CharacterID map(ResultSet rs) throws SQLException { + return idFactory.createID(rs.getInt(CHAR_ID)); + } + }; + /** * The {@link Mapper} for {@link L2Character} */ private final Mapper mapper = new CachedMapper( - database) { - @Override - protected CharacterID createID(ResultSet rs) throws SQLException { - return idFactory.createID(rs.getInt(CHAR_ID)); - } - + database, idMapper) { @Override protected L2Character map(CharacterID id, ResultSet rs) throws SQLException { @@ -148,8 +157,12 @@ public class MySQL5CharacterDAO extends character.setSex(ActorSex.valueOf(rs.getString(SEX))); character.setLevel(rs.getInt(LEVEL)); - // TODO load experience - // TODO load sp + character.setExperience(rs.getLong(EXPERIENCE)); + character.setSP(rs.getInt(SP)); + + character.setHP(rs.getDouble(HP)); + character.setMP(rs.getDouble(MP)); + character.setCP(rs.getDouble(CP)); character.setPoint(Point.fromXYZA(rs.getInt(POINT_X), rs.getInt(POINT_Y), rs.getInt(POINT_Z), @@ -169,16 +182,6 @@ public class MySQL5CharacterDAO extends } }; - /** - * The mapper for {@link CharacterID} - */ - private final Mapper idMapper = new Mapper() { - @Override - public CharacterID map(ResultSet rs) throws SQLException { - return idFactory.createID(rs.getInt(CHAR_ID)); - } - }; - @Override public L2Character select(final CharacterID id) { return database.query(new SelectSingleQuery() { @@ -265,7 +268,7 @@ public class MySQL5CharacterDAO extends } @Override - public List listIDs() { + public List selectIDs() { return database.query(new SelectListQuery() { @Override protected String query() { @@ -287,11 +290,12 @@ public class MySQL5CharacterDAO extends return "INSERT INTO `" + TABLE + "` (`" + CHAR_ID + "`,`" + ACCOUNT_ID + "`,`" + CLAN_ID + "`,`" + NAME + "`,`" + RACE + "`,`" + CLASS + "`,`" + SEX + "`,`" + LEVEL - + "`,`" + POINT_X + "`,`" + POINT_Y + "`,`" + POINT_Z - + "`,`" + POINT_ANGLE + "`,`" + APPEARANCE_HAIR_STYLE - + "`,`" + APPEARANCE_HAIR_COLOR + "`,`" - + APPEARANCE_FACE - + "`) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + + "`,`" + EXPERIENCE + "`,`" + SP + "`,`" + HP + "`,`" + + MP + "`,`" + CP + "`,`" + POINT_X + "`,`" + POINT_Y + + "`,`" + POINT_Z + "`,`" + POINT_ANGLE + "`,`" + + APPEARANCE_HAIR_STYLE + "`,`" + APPEARANCE_HAIR_COLOR + + "`,`" + APPEARANCE_FACE + + "`) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; } @Override @@ -315,8 +319,12 @@ public class MySQL5CharacterDAO extends st.setString(i++, character.getSex().name()); st.setInt(i++, character.getLevel()); - // TODO save experience - // TODO save sp + st.setLong(i++, character.getExperience()); + st.setInt(i++, character.getSP()); + + st.setDouble(i++, character.getHP()); + st.setDouble(i++, character.getMP()); + st.setDouble(i++, character.getCP()); st.setInt(i++, character.getPoint().getX()); st.setInt(i++, character.getPoint().getY()); @@ -339,9 +347,11 @@ public class MySQL5CharacterDAO extends return "UPDATE `" + TABLE + "` SET " + ACCOUNT_ID + "` = ?,`" + CLAN_ID + "` = ?,`" + NAME + "` = ?,`" + RACE + "` = ?,`" + CLASS + "` = ?,`" + SEX + "` = ?,`" - + LEVEL + "` = ?,`" + POINT_X + "` = ?,`" + POINT_Y - + "` = ?,`" + POINT_Z + "` = ?,`" + POINT_ANGLE - + "` = ?,`" + APPEARANCE_HAIR_STYLE + "` = ?,`" + + LEVEL + "` = ?,`" + EXPERIENCE + "` = ?,`" + SP + + "` = ?,`" + HP + "` = ?,`" + MP + "` = ?,`" + CP + + "` = ?,`" + POINT_X + "` = ?,`" + POINT_Y + "` = ?,`" + + POINT_Z + "` = ?,`" + POINT_ANGLE + "` = ?,`" + + APPEARANCE_HAIR_STYLE + "` = ?,`" + APPEARANCE_HAIR_COLOR + "` = ?,`" + APPEARANCE_FACE + "` = ? WHERE `" + CHAR_ID + "` = ?"; } @@ -367,9 +377,14 @@ public class MySQL5CharacterDAO extends st.setString(i++, character.getSex().name()); st.setInt(i++, character.getLevel()); - // TODO save experience - // TODO save sp + st.setLong(i++, character.getExperience()); + st.setInt(i++, character.getSP()); + st.setDouble(i++, character.getHP()); + st.setDouble(i++, character.getMP()); + st.setDouble(i++, character.getCP()); + + // position st.setInt(i++, character.getPoint().getX()); st.setInt(i++, character.getPoint().getY()); st.setInt(i++, character.getPoint().getZ()); diff --git a/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5CharacterFriendDAO.java b/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5CharacterFriendDAO.java index 847b42eac..294219a49 100644 --- a/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5CharacterFriendDAO.java +++ b/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5CharacterFriendDAO.java @@ -31,6 +31,7 @@ import com.l2jserver.model.id.provider.FriendIDProvider; import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.character.CharacterFriendList; import com.l2jserver.service.database.DatabaseService; +import com.l2jserver.service.database.MySQLDatabaseService.CachedMapper; import com.l2jserver.service.database.MySQLDatabaseService.InsertUpdateQuery; import com.l2jserver.service.database.MySQLDatabaseService.Mapper; import com.l2jserver.service.database.MySQLDatabaseService.SelectListQuery; @@ -72,17 +73,28 @@ public class MySQL5CharacterFriendDAO extends } /** - * The {@link Mapper} for {@link CharacterID} + * The {@link Mapper} for {@link FriendID} */ - private final Mapper mapper = new Mapper() { + private final Mapper idMapper = new Mapper() { @Override - public CharacterFriend map(ResultSet rs) throws SQLException { + public FriendID map(ResultSet rs) throws SQLException { final CharacterID characterId = charIdProvider.createID(rs .getInt(CHAR_ID)); final CharacterID friendId = charIdProvider.createID(rs .getInt(CHAR_ID_FRIEND)); - return new CharacterFriend(idProvider.createID(characterId, - friendId)); + return idProvider.createID(characterId, friendId); + } + }; + + /** + * The {@link Mapper} for {@link CharacterFriend} + */ + private final Mapper mapper = new CachedMapper( + database, idMapper) { + @Override + protected CharacterFriend map(FriendID id, ResultSet rs) + throws SQLException { + return new CharacterFriend(id); } }; @@ -132,6 +144,21 @@ public class MySQL5CharacterFriendDAO extends character.getFriendList().load(list); } + @Override + public List selectIDs() { + return database.query(new SelectListQuery() { + @Override + protected String query() { + return "SELECT * FROM `" + TABLE + "`"; + } + + @Override + protected Mapper mapper() { + return idMapper; + } + }); + } + @Override public boolean insert(CharacterFriend friend) { return database.query(new InsertUpdateQuery(friend) { @@ -152,8 +179,8 @@ public class MySQL5CharacterFriendDAO extends @Override public boolean update(CharacterFriend friend) { - // is not possible update friends, because it is only a ID and IDs are - // immutable + // it is not possible update friend objects, because they are only a ID + // pair and IDs are immutable return false; } diff --git a/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5ClanDAO.java b/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5ClanDAO.java index 133ae41c8..5458012e2 100644 --- a/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5ClanDAO.java +++ b/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5ClanDAO.java @@ -68,23 +68,6 @@ public class MySQL5ClanDAO extends AbstractMySQL5DAO implements this.charIdFactory = idFactory; } - /** - * The {@link Mapper} for {@link Clan} - */ - private final Mapper mapper = new CachedMapper(database) { - @Override - protected ClanID createID(ResultSet rs) throws SQLException { - return idFactory.createID(rs.getInt(CLAN_ID)); - } - - @Override - protected Clan map(ClanID id, ResultSet rs) throws SQLException { - final Clan clan = new Clan(); - clan.setID(id); - return clan; - } - }; - /** * The {@link Mapper} for {@link ClanID} */ @@ -95,6 +78,19 @@ public class MySQL5ClanDAO extends AbstractMySQL5DAO implements } }; + /** + * The {@link Mapper} for {@link Clan} + */ + private final Mapper mapper = new CachedMapper( + database, idMapper) { + @Override + protected Clan map(ClanID id, ResultSet rs) throws SQLException { + final Clan clan = new Clan(); + clan.setID(id); + return clan; + } + }; + @Override public Clan select(final ClanID id) { return database.query(new SelectSingleQuery() { @@ -117,7 +113,7 @@ public class MySQL5ClanDAO extends AbstractMySQL5DAO implements } @Override - public List listIDs() { + public List selectIDs() { return database.query(new SelectListQuery() { @Override protected String query() { diff --git a/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5ItemDAO.java b/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5ItemDAO.java index 7cecfc7f4..2f53288b0 100644 --- a/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5ItemDAO.java +++ b/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5ItemDAO.java @@ -91,14 +91,20 @@ public class MySQL5ItemDAO extends AbstractMySQL5DAO implements } /** - * The {@link Mapper} instance + * The {@link Mapper} for {@link ItemID} */ - private final Mapper mapper = new CachedMapper(database) { + private final Mapper idMapper = new Mapper() { @Override - protected ItemID createID(ResultSet rs) throws SQLException { + public ItemID map(ResultSet rs) throws SQLException { return idFactory.createID(rs.getInt(ITEM_ID)); } + }; + /** + * The {@link Mapper} instance + */ + private final Mapper mapper = new CachedMapper( + database, idMapper) { @Override public Item map(ItemID id, ResultSet rs) throws SQLException { final ItemTemplateID templateId = templateIdFactory.createID(rs @@ -127,16 +133,6 @@ public class MySQL5ItemDAO extends AbstractMySQL5DAO implements } }; - /** - * The {@link Mapper} for {@link ItemID} - */ - private final Mapper idMapper = new Mapper() { - @Override - public ItemID map(ResultSet rs) throws SQLException { - return idFactory.createID(rs.getInt(ITEM_ID)); - } - }; - @Override public Item select(final ItemID id) { return database.query(new SelectSingleQuery() { @@ -183,7 +179,7 @@ public class MySQL5ItemDAO extends AbstractMySQL5DAO implements } @Override - public List listIDs() { + public List selectIDs() { return database.query(new SelectListQuery() { @Override protected String query() { diff --git a/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5NPCDAO.java b/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5NPCDAO.java index cf8399c7d..6e3ad86b1 100644 --- a/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5NPCDAO.java +++ b/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5NPCDAO.java @@ -28,7 +28,6 @@ import com.google.inject.Inject; import com.l2jserver.db.dao.CharacterDAO; import com.l2jserver.db.dao.NPCDAO; import com.l2jserver.model.id.object.NPCID; -import com.l2jserver.model.id.object.allocator.IDAllocator; import com.l2jserver.model.id.object.provider.NPCIDProvider; import com.l2jserver.model.id.template.NPCTemplateID; import com.l2jserver.model.id.template.provider.NPCTemplateIDProvider; @@ -83,16 +82,22 @@ public class MySQL5NPCDAO extends AbstractMySQL5DAO implements } /** - * The {@link Mapper} for {@link NPC} + * The {@link Mapper} for {@link NPCID} */ - private final Mapper mapper = new CachedMapper(database) { + private final Mapper idMapper = new Mapper() { @Override - protected NPCID createID(ResultSet rs) throws SQLException { - if (rs.getInt(NPC_ID) < IDAllocator.FIRST_ID) - return idProvider.createID(); + public NPCID map(ResultSet rs) throws SQLException { + if (rs.getString(NPC_ID) == null) + return null; return idProvider.createID(rs.getInt(NPC_ID)); } + }; + /** + * The {@link Mapper} for {@link NPC} + */ + private final Mapper mapper = new CachedMapper(database, + idMapper) { @Override protected NPC map(NPCID id, ResultSet rs) throws SQLException { NPCTemplateID templateId = templateIdProvider.createID(rs @@ -115,18 +120,6 @@ public class MySQL5NPCDAO extends AbstractMySQL5DAO implements } }; - /** - * The {@link Mapper} for {@link NPCID} - */ - private final Mapper idMapper = new Mapper() { - @Override - public NPCID map(ResultSet rs) throws SQLException { - if (rs.getString(NPC_ID) == null) - return null; - return idProvider.createID(rs.getInt(NPC_ID)); - } - }; - @Override public NPC select(final NPCID id) { return database.query(new SelectSingleQuery() { @@ -185,7 +178,7 @@ public class MySQL5NPCDAO extends AbstractMySQL5DAO implements } @Override - public List listIDs() { + public List selectIDs() { return database.query(new SelectListQuery() { @Override protected String query() { diff --git a/src/main/java/com/l2jserver/game/net/packet/server/CharacterInformationBroadcastPacket.java b/src/main/java/com/l2jserver/game/net/packet/server/CharacterInformationBroadcastPacket.java index 30091b985..f964233a8 100644 --- a/src/main/java/com/l2jserver/game/net/packet/server/CharacterInformationBroadcastPacket.java +++ b/src/main/java/com/l2jserver/game/net/packet/server/CharacterInformationBroadcastPacket.java @@ -138,21 +138,22 @@ public class CharacterInformationBroadcastPacket extends AbstractServerPacket { // end of t1 new h's buffer.writeInt(0x00); // pvp flag - buffer.writeInt(0x00); // karma + buffer.writeInt(character.getKarma()); // karma - buffer.writeInt(character.getAttributes().getCastSpeed()); - buffer.writeInt(character.getAttributes().getAttackSpeed()); + buffer.writeInt(character.getStats().getMagicalAttackSpeed()); + buffer.writeInt(character.getStats().getPhysicalAttackSpeed()); buffer.writeInt(0x00); // unk - buffer.writeInt((int) character.getAttributes().getRunSpeed()); - buffer.writeInt((int) character.getAttributes().getRunSpeed()); - buffer.writeInt((int) character.getAttributes().getRunSpeed()); - buffer.writeInt((int) character.getAttributes().getRunSpeed()); - buffer.writeInt((int) character.getAttributes().getRunSpeed()); - buffer.writeInt((int) character.getAttributes().getRunSpeed()); - buffer.writeInt((int) character.getAttributes().getRunSpeed()); - buffer.writeInt((int) character.getAttributes().getRunSpeed()); + // FIXME half of those are walk speed + buffer.writeInt((int) character.getStats().getRunSpeed()); + buffer.writeInt((int) character.getStats().getRunSpeed()); + buffer.writeInt((int) character.getStats().getRunSpeed()); + buffer.writeInt((int) character.getStats().getRunSpeed()); + buffer.writeInt((int) character.getStats().getRunSpeed()); + buffer.writeInt((int) character.getStats().getRunSpeed()); + buffer.writeInt((int) character.getStats().getRunSpeed()); + buffer.writeInt((int) character.getStats().getRunSpeed()); buffer.writeDouble(0x01); // move speed multiplier buffer.writeDouble(0x01); // attack speed multiplier @@ -171,7 +172,7 @@ public class CharacterInformationBroadcastPacket extends AbstractServerPacket { buffer.writeInt(character.getAppearance().getHairColor().option); buffer.writeInt(character.getAppearance().getFace().option); - BufferUtils.writeString(buffer, "TODO"); // TODO title + BufferUtils.writeString(buffer, character.getTitle()); // dont send those 4 if using cursed weapon buffer.writeInt(0); // clan id @@ -182,11 +183,12 @@ public class CharacterInformationBroadcastPacket extends AbstractServerPacket { buffer.writeByte(0x01); // sitting buffer.writeByte((character.getMoveType() == CharacterMoveType.RUN ? 0x01 : 0x00)); - buffer.writeByte(0x00); // is in combat + buffer.writeByte((character.isAttacking() ? 0x01 : 0x00)); // is in + // combat buffer.writeByte(0x00); // alike dead - buffer.writeByte(0x00); // invisible = 1 visible =0 + buffer.writeByte((character.getAppearance().isVisible() ? 0x00 : 0x01)); // 1-on Strider, 2-on Wyvern, // 3-on Great Wolf, 0-no mount @@ -233,7 +235,6 @@ public class CharacterInformationBroadcastPacket extends AbstractServerPacket { buffer.writeInt(character.getAppearance().getTitleColor().toInteger()); buffer.writeInt(0x00); // cursed weapon id - buffer.writeInt(0x00); // clan reputation // T1 diff --git a/src/main/java/com/l2jserver/game/net/packet/server/CharacterInformationPacket.java b/src/main/java/com/l2jserver/game/net/packet/server/CharacterInformationPacket.java index 0b10100c1..5d67404fa 100644 --- a/src/main/java/com/l2jserver/game/net/packet/server/CharacterInformationPacket.java +++ b/src/main/java/com/l2jserver/game/net/packet/server/CharacterInformationPacket.java @@ -46,9 +46,9 @@ import org.jboss.netty.buffer.ChannelBuffer; import com.l2jserver.game.net.Lineage2Connection; import com.l2jserver.game.net.packet.AbstractServerPacket; +import com.l2jserver.model.world.Actor.ActorSex; import com.l2jserver.model.world.Item; import com.l2jserver.model.world.L2Character; -import com.l2jserver.model.world.Actor.ActorSex; import com.l2jserver.model.world.actor.ActorExperience; import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll; import com.l2jserver.util.BufferUtils; @@ -89,17 +89,17 @@ public class CharacterInformationPacket extends AbstractServerPacket { buffer.writeInt(character.getLevel()); buffer.writeLong(ActorExperience.LEVEL_1.experience); - buffer.writeInt(character.getAttributes().getStrength()); - buffer.writeInt(character.getAttributes().getDexterity()); - buffer.writeInt(character.getAttributes().getConcentration()); - buffer.writeInt(character.getAttributes().getIntelligence()); - buffer.writeInt(character.getAttributes().getWitness()); - buffer.writeInt(character.getAttributes().getMentality()); - buffer.writeInt(200); // max hp - buffer.writeInt(character.getHP()); // cur hp - buffer.writeInt(200); // max mp - buffer.writeInt((int) 200); // cur mp - buffer.writeInt(0); // sp + buffer.writeInt(character.getStats().getStrength()); + buffer.writeInt(character.getStats().getDexterity()); + buffer.writeInt(character.getStats().getConcentration()); + buffer.writeInt(character.getStats().getIntelligence()); + buffer.writeInt(character.getStats().getWitness()); + buffer.writeInt(character.getStats().getMentality()); + buffer.writeInt(character.getStats().getMaxHP()); // max hp + buffer.writeInt((int) character.getHP()); // cur hp + buffer.writeInt(character.getStats().getMaxMP()); // max mp + buffer.writeInt((int) character.getMP()); // cur mp + buffer.writeInt(character.getSP()); // sp buffer.writeInt(0); // load buffer.writeInt(character.getAttributes().getMaxWeigth()); // max load @@ -189,26 +189,26 @@ public class CharacterInformationPacket extends AbstractServerPacket { buffer.writeInt(0x00); // (max?) talismans count buffer.writeInt(0x00); // cloak sratus - buffer.writeInt((int) character.getAttributes().getPhysicalAttack()); - buffer.writeInt(character.getAttributes().getAttackSpeed()); - buffer.writeInt((int) character.getAttributes().getPhysicalDefense()); + buffer.writeInt(character.getStats().getPhysicalAttack()); + buffer.writeInt(character.getStats().getPhysicalAttackSpeed()); + buffer.writeInt(character.getStats().getPhysicalDefense()); - buffer.writeInt(character.getAttributes().getEvasionChance()); // evasion - buffer.writeInt(character.getAttributes().getAccuracy()); - buffer.writeInt(character.getAttributes().getCriticalChance()); + buffer.writeInt(character.getStats().getEvasionRate()); // evasion + buffer.writeInt(character.getStats().getAccuracy()); + buffer.writeInt(character.getStats().getPhysicalCriticalRate()); - buffer.writeInt((int) character.getAttributes().getMagicalAttack()); - buffer.writeInt(character.getAttributes().getCastSpeed()); - buffer.writeInt(character.getAttributes().getAttackSpeed()); - buffer.writeInt((int) character.getAttributes().getMagicalDefense()); + buffer.writeInt(character.getStats().getMagicalAttack()); + buffer.writeInt(character.getStats().getMagicalAttackSpeed()); + buffer.writeInt(character.getStats().getPhysicalAttackSpeed()); + buffer.writeInt(character.getStats().getMagicalDefense()); buffer.writeInt(0x00); // 0-non-pvp 1-pvp = violett name - buffer.writeInt(0x00); // karma + buffer.writeInt(character.getKarma()); // karma - buffer.writeInt((int) character.getAttributes().getRunSpeed()); - buffer.writeInt((int) character.getAttributes().getWalkSpeed()); - buffer.writeInt((int) character.getAttributes().getRunSpeed()); - buffer.writeInt((int) character.getAttributes().getWalkSpeed()); + buffer.writeInt((int) character.getStats().getRunSpeed()); + buffer.writeInt((int) character.getStats().getWalkSpeed()); + buffer.writeInt((int) character.getStats().getRunSpeed()); + buffer.writeInt((int) character.getStats().getWalkSpeed()); buffer.writeInt(0); // unk buffer.writeInt(0); // unk buffer.writeInt(0); // fly speed -only if flying @@ -243,8 +243,7 @@ public class CharacterInformationPacket extends AbstractServerPacket { buffer.writeInt(character.getAppearance().getFace().option); buffer.writeInt(0x01); // is gm - String title = "Testing"; // title - BufferUtils.writeString(buffer, title); + BufferUtils.writeString(buffer, character.getTitle()); buffer.writeInt((character.getClanID() != null ? character.getClanID() .getID() : 0x00)); // clanid @@ -258,8 +257,8 @@ public class CharacterInformationPacket extends AbstractServerPacket { buffer.writeByte(0x00); // mount type buffer.writeByte(0x00); // private store type buffer.writeByte(0x00); // dwarven craft - buffer.writeInt(0x00); // pk kills - buffer.writeInt(0x00); // pvp kills + buffer.writeInt(character.getPkKills()); // pk kills + buffer.writeInt(character.getPvpKills()); // pvp kills buffer.writeShort(0x00); // cubics size // short:cubicsid[cubicssize] @@ -279,8 +278,8 @@ public class CharacterInformationPacket extends AbstractServerPacket { buffer.writeInt(character.getCharacterClass().id); buffer.writeInt(0x00); // special effects? circles around player... - buffer.writeInt(200); // max cp - buffer.writeInt(200); // cur cp + buffer.writeInt(character.getStats().getMaxCP()); + buffer.writeInt((int) character.getCP()); // cur cp buffer.writeByte(0x00); // is mount or is airshilhelp = 0; otherwise // enchant effect (minimum 127) diff --git a/src/main/java/com/l2jserver/game/net/packet/server/CharacterSelectionListPacket.java b/src/main/java/com/l2jserver/game/net/packet/server/CharacterSelectionListPacket.java index 59267ed08..22c6d60cd 100644 --- a/src/main/java/com/l2jserver/game/net/packet/server/CharacterSelectionListPacket.java +++ b/src/main/java/com/l2jserver/game/net/packet/server/CharacterSelectionListPacket.java @@ -128,16 +128,16 @@ public class CharacterSelectionListPacket extends AbstractServerPacket { buffer.writeInt(character.getPoint().getY()); // y buffer.writeInt(character.getPoint().getZ()); // z - buffer.writeDouble(20); // hp cur - buffer.writeDouble(20); // mp cur + buffer.writeDouble(character.getHP()); // hp cur + buffer.writeDouble(character.getMP()); // mp cur - buffer.writeInt(320); // sp - buffer.writeLong(4640); // exp - buffer.writeInt(5); // level + buffer.writeInt(character.getSP()); // sp + buffer.writeLong(character.getExperience()); // exp + buffer.writeInt(character.getLevel()); // level - buffer.writeInt(0x00); // karma - buffer.writeInt(0x00); // pk - buffer.writeInt(0x00); // pvp + buffer.writeInt(character.getKarma()); // karma + buffer.writeInt(character.getPkKills()); // pk + buffer.writeInt(character.getPvpKills()); // pvp for (int n = 0; n < 7; n++) { buffer.writeInt(0x00); // unk @@ -184,8 +184,8 @@ public class CharacterSelectionListPacket extends AbstractServerPacket { // face buffer.writeInt(character.getAppearance().getFace().option); - buffer.writeDouble(30); // hp max - buffer.writeDouble(30); // mp max + buffer.writeDouble(character.getStats().getMaxHP()); // hp max + buffer.writeDouble(character.getStats().getMaxMP()); // mp max buffer.writeInt(0x0); // seconds left before delete buffer.writeInt(character.getCharacterClass().id); // class diff --git a/src/main/java/com/l2jserver/game/net/packet/server/ServerObjectPacket.java b/src/main/java/com/l2jserver/game/net/packet/server/ServerObjectPacket.java index 10c707819..c1d08ab53 100644 --- a/src/main/java/com/l2jserver/game/net/packet/server/ServerObjectPacket.java +++ b/src/main/java/com/l2jserver/game/net/packet/server/ServerObjectPacket.java @@ -59,7 +59,7 @@ public class ServerObjectPacket extends AbstractServerPacket { buffer.writeDouble(template.getAttackSpeedMultiplier()); buffer.writeDouble(template.getCollisionRadius()); // coll radius buffer.writeDouble(template.getCollisionHeight()); // coll height - buffer.writeInt((template.isAttackable() ? npc.getHP() : 0x00)); + buffer.writeInt((int) (template.isAttackable() ? npc.getHP() : 0x00)); buffer.writeInt((int) (template.isAttackable() ? template.getMaxHP() : 0x00)); buffer.writeInt(0x01); // object type diff --git a/src/main/java/com/l2jserver/model/id/compound/AbstractCompoundID.java b/src/main/java/com/l2jserver/model/id/compound/AbstractCompoundID.java index 772db8c05..ef55e5e87 100644 --- a/src/main/java/com/l2jserver/model/id/compound/AbstractCompoundID.java +++ b/src/main/java/com/l2jserver/model/id/compound/AbstractCompoundID.java @@ -19,8 +19,9 @@ package com.l2jserver.model.id.compound; import com.l2jserver.model.id.ID; /** - * @author Rogiel + * The compound {@link ID} is composed of two IDs. * + * @author Rogiel */ public class AbstractCompoundID extends ID> { /** @@ -33,8 +34,12 @@ public class AbstractCompoundID extends ID> { private final T2 id2; /** + * Creates a new compound ID + * * @param id1 + * the first id * @param id2 + * the second id */ protected AbstractCompoundID(T1 id1, T2 id2) { super(null); diff --git a/src/main/java/com/l2jserver/model/template/ActorTemplate.java b/src/main/java/com/l2jserver/model/template/ActorTemplate.java index 6b67a591e..3bb559dc7 100644 --- a/src/main/java/com/l2jserver/model/template/ActorTemplate.java +++ b/src/main/java/com/l2jserver/model/template/ActorTemplate.java @@ -22,6 +22,7 @@ import org.slf4j.LoggerFactory; import com.l2jserver.model.id.template.ActorTemplateID; import com.l2jserver.model.world.Actor; import com.l2jserver.model.world.actor.ActorAttributes; +import com.l2jserver.model.world.actor.stat.Stats; /** * Template for {@link Actor} @@ -72,6 +73,8 @@ public abstract class ActorTemplate extends } protected abstract T createInstance(); + + public abstract Stats getTemplateStat(); /** * @return the baseAttributes @@ -488,5 +491,4 @@ public abstract class ActorTemplate extends return craft; } } - } \ No newline at end of file diff --git a/src/main/java/com/l2jserver/model/template/CharacterTemplate.java b/src/main/java/com/l2jserver/model/template/CharacterTemplate.java index 36a93aa2a..00113aed5 100644 --- a/src/main/java/com/l2jserver/model/template/CharacterTemplate.java +++ b/src/main/java/com/l2jserver/model/template/CharacterTemplate.java @@ -19,6 +19,7 @@ package com.l2jserver.model.template; import com.l2jserver.model.id.template.CharacterTemplateID; import com.l2jserver.model.world.Actor.ActorRace; import com.l2jserver.model.world.L2Character; +import com.l2jserver.model.world.actor.stat.Stats; import com.l2jserver.model.world.character.CharacterClass; import com.l2jserver.util.dimensional.Point; @@ -37,6 +38,20 @@ public abstract class CharacterTemplate extends ActorTemplate { */ protected final Point spawnLocation; + protected double hpBase; + protected double hpAdd; + protected double hpMultiplier; + + protected double mpBase; + protected double mpAdd; + protected double mpMultiplier; + + protected double cpBase; + protected double cpAdd; + protected double cpMultiplier; + + protected int minimumLevel; + protected Integer attackDamage = null; protected AttackType attackType; @@ -70,7 +85,7 @@ public abstract class CharacterTemplate extends ActorTemplate { @Override public L2Character createInstance() { - final L2Character character = new L2Character(this.getID(), attributes); + final L2Character character = new L2Character(this.getID()); character.setRace(getRace()); character.setCharacterClass(characterClass); @@ -79,6 +94,11 @@ public abstract class CharacterTemplate extends ActorTemplate { return character; } + @Override + public Stats getTemplateStat() { + return null; + } + /** * @return the race */ @@ -100,6 +120,90 @@ public abstract class CharacterTemplate extends ActorTemplate { return spawnLocation; } + /** + * @return the hpBase + */ + public double getHpBase() { + return hpBase; + } + + /** + * @return the hpAdd + */ + public double getHpAdd() { + return hpAdd; + } + + /** + * @return the hpMultiplier + */ + public double getHpMultiplier() { + return hpMultiplier; + } + + /** + * @return the mpBase + */ + public double getMpBase() { + return mpBase; + } + + /** + * @return the mpAdd + */ + public double getMpAdd() { + return mpAdd; + } + + /** + * @return the mpMultiplier + */ + public double getMpMultiplier() { + return mpMultiplier; + } + + /** + * @return the cpBase + */ + public double getCpBase() { + return cpBase; + } + + /** + * @return the cpAdd + */ + public double getCpAdd() { + return cpAdd; + } + + /** + * @return the cpMultiplier + */ + public double getCpMultiplier() { + return cpMultiplier; + } + + /** + * @return the minimumLevel + */ + public int getMinimumLevel() { + return minimumLevel; + } + + /** + * @return the attackDamage + */ + public Integer getAttackDamage() { + return attackDamage; + } + + /** + * @return the attackType + */ + public AttackType getAttackType() { + return attackType; + } + /** * @return the male collision radius */ diff --git a/src/main/java/com/l2jserver/model/template/NPCTemplate.java b/src/main/java/com/l2jserver/model/template/NPCTemplate.java index 5f6766792..3bd19d93b 100644 --- a/src/main/java/com/l2jserver/model/template/NPCTemplate.java +++ b/src/main/java/com/l2jserver/model/template/NPCTemplate.java @@ -28,6 +28,7 @@ import com.l2jserver.model.world.Actor; import com.l2jserver.model.world.Actor.ActorSex; import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.NPC; +import com.l2jserver.model.world.actor.stat.Stats; import com.l2jserver.service.game.character.CannotSetTargetServiceException; import com.l2jserver.service.game.character.CharacterService; import com.l2jserver.service.network.NetworkService; @@ -57,6 +58,8 @@ public abstract class NPCTemplate extends ActorTemplate implements */ @Inject protected ItemTemplateIDProvider itemTemplateIdProvider; + + protected Stats stats; /** * The NPC name @@ -118,7 +121,7 @@ public abstract class NPCTemplate extends ActorTemplate implements /** * The NPC sp */ - protected long sp; + protected int sp; /** * The NPC agressive state @@ -228,11 +231,20 @@ public abstract class NPCTemplate extends ActorTemplate implements public void receiveAttack(NPC npc, Calculator calculator, Actor attacker) { // TODO add attributes to calculator! } + @Override public NPC createInstance() { return new NPC(this.getID()); } + + @Override + public Stats getTemplateStat() { + + + + return null; + } /** * @return the name @@ -328,7 +340,7 @@ public abstract class NPCTemplate extends ActorTemplate implements /** * @return the sp */ - public long getSp() { + public int getSp() { return sp; } diff --git a/src/main/java/com/l2jserver/model/template/item/WeaponTemplate.java b/src/main/java/com/l2jserver/model/template/item/WeaponTemplate.java index 84ef53f85..3b17ae900 100644 --- a/src/main/java/com/l2jserver/model/template/item/WeaponTemplate.java +++ b/src/main/java/com/l2jserver/model/template/item/WeaponTemplate.java @@ -16,21 +16,14 @@ */ package com.l2jserver.model.template.item; -import java.util.Map; -import java.util.Map.Entry; import com.l2jserver.model.id.template.ItemTemplateID; import com.l2jserver.model.template.ItemTemplate; import com.l2jserver.model.world.Item; +import com.l2jserver.model.world.actor.stat.Stats; +import com.l2jserver.model.world.actor.stat.Stats.StatType; import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll; import com.l2jserver.util.calculator.Calculator; -import com.l2jserver.util.calculator.DivisionFunction; -import com.l2jserver.util.calculator.Function; -import com.l2jserver.util.calculator.MultiplicationFunction; -import com.l2jserver.util.calculator.SetFunction; -import com.l2jserver.util.calculator.SubtractFunction; -import com.l2jserver.util.calculator.SumFunction; -import com.l2jserver.util.factory.CollectionFactory; /** * Template for Weapon {@link Item} @@ -59,7 +52,7 @@ public abstract class WeaponTemplate extends ItemTemplate { /** * The weapon's attributes */ - protected final WeaponAttribute attribute = new WeaponAttribute(); + protected final Stats stats = new Stats(); /** * This weapon random damage @@ -130,145 +123,8 @@ public abstract class WeaponTemplate extends ItemTemplate { * @param calc * the calculator */ - public void calculator(WeaponAttributeType type, Calculator calc) { - attribute.calculator(type, calc); - } - - /** - * Attribute types for weapons - * - * @author Rogiel - */ - public enum WeaponAttributeType { - PHYSICAL_ATTACK, MAGICAL_ATTACK, R_CRITICAL, PHYSICAL_ATTACK_SPEED; - } - - /** - * This class handles the Weapon attributes an can add operations to the - * calculator - * - * @author Rogiel - */ - public class WeaponAttribute { - private final Map>> operations = CollectionFactory - .newMap(); - - /** - * Sets the result of an calculator - * - * @param type - * the attribute type - * @param order - * the calculation order - * @param value - * the value to set - */ - public void set(WeaponAttributeType type, int order, double value) { - getMap(type).put(order, new SetFunction(value)); - } - - /** - * Adds value to the result of an calculator - * - * @param type - * the attribute type - * @param order - * the calculation order - * @param value - * the value to be summed - */ - public void add(WeaponAttributeType type, int order, double value) { - getMap(type).put(order, new SumFunction(value)); - } - - /** - * Subtracts value from the result of an calculator - * - * @param type - * the attribute type - * @param order - * the calculation order - * @param value - * the value to be subtracted - */ - public void sub(WeaponAttributeType type, int order, double value) { - getMap(type).put(order, new SubtractFunction(value)); - } - - /** - * Multiply value the result of an calculator - * - * @param type - * the attribute type - * @param order - * the calculation order - * @param value - * the value to be multiplied - */ - public void mult(WeaponAttributeType type, int order, double value) { - getMap(type).put(order, new MultiplicationFunction(value)); - } - - /** - * Divides by value the result of an calculator - * - * @param type - * the attribute type - * @param order - * the calculation order - * @param value - * the value to be divided by - */ - public void div(WeaponAttributeType type, int order, double value) { - getMap(type).put(order, new DivisionFunction(value)); - } - - /** - * Performs an enchant operation. Note that this is not implemented yet! - * - * @param type - * the attribute type - * @param order - * the calculation order - * @param value - * TODO - */ - public void enchant(WeaponAttributeType type, int order, double value) { - // TODO enchant operation for weapon - } - - /** - * Returns the Order-Operation map for type - * - * @param type - * the type - * @return the order-operation map - */ - private Map> getMap(WeaponAttributeType type) { - Map> map = operations.get(type); - if (map == null) { - map = CollectionFactory.newMap(); - operations.put(type, map); - } - return map; - } - - /** - * Creates the calculator object for this weapon - * - * @param type - * the type - * @param calculator - * the calculator - */ - private void calculator(WeaponAttributeType type, Calculator calculator) { - final Map> operations = this.operations - .get(type); - for (final Entry> entry : operations - .entrySet()) { - calculator.add(entry.getKey(), entry.getValue()); - } - } + public void calculator(StatType type, Calculator calc) { + stats.calculator(type, calc); } /** @@ -409,7 +265,7 @@ public abstract class WeaponTemplate extends ItemTemplate { /** * @return the attribute */ - public WeaponAttribute getAttribute() { - return attribute; + public Stats getAttribute() { + return stats; } } diff --git a/src/main/java/com/l2jserver/model/world/Actor.java b/src/main/java/com/l2jserver/model/world/Actor.java index bb3e26b85..1c6bb1c37 100644 --- a/src/main/java/com/l2jserver/model/world/Actor.java +++ b/src/main/java/com/l2jserver/model/world/Actor.java @@ -105,11 +105,21 @@ public abstract class Actor extends PositionableObject { /** * The actor HP */ - protected int hp; + protected double HP; /** * The actor MP */ - protected int mp; + protected double MP; + + /** + * The actor experience points + */ + protected long experience; + /** + * The actor sp points + */ + protected int sp; + /** * The currently effects active on the actor */ @@ -119,33 +129,10 @@ public abstract class Actor extends PositionableObject { */ protected final ActorSkillContainer skills = new ActorSkillContainer(this); - public Actor(ActorTemplateID templateID) { + protected Actor(ActorTemplateID templateID) { this.templateID = templateID; } - public int getHP() { - return hp; - } - - public void setHP(int hp) { - this.hp = hp; - } - - /** - * @return the mp - */ - public int getMP() { - return mp; - } - - /** - * @param mp - * the mp to set - */ - public void setMP(int mp) { - this.mp = mp; - } - /** * @return the race */ @@ -176,14 +163,81 @@ public abstract class Actor extends PositionableObject { this.sex = sex; } + /** + * @return the level + */ public int getLevel() { return level; } + /** + * @param level + * the level to set + */ public void setLevel(int level) { this.level = level; } + /** + * @return the hP + */ + public double getHP() { + return HP; + } + + /** + * @param hP + * the hP to set + */ + public void setHP(double hP) { + HP = hP; + } + + /** + * @return the mP + */ + public double getMP() { + return MP; + } + + /** + * @param mP + * the mP to set + */ + public void setMP(double mP) { + MP = mP; + } + + /** + * @return the experience + */ + public long getExperience() { + return experience; + } + + /** + * @param experience + * the experience to set + */ + public void setExperience(long experience) { + this.experience = experience; + } + + /** + * @return the sp + */ + public int getSP() { + return sp; + } + + /** + * @param sp + * the sp to set + */ + public void setSP(int sp) { + this.sp = sp; + } + /** * @return the active effects on this actor */ diff --git a/src/main/java/com/l2jserver/model/world/L2Character.java b/src/main/java/com/l2jserver/model/world/L2Character.java index 78e7d9999..6dbb476fc 100644 --- a/src/main/java/com/l2jserver/model/world/L2Character.java +++ b/src/main/java/com/l2jserver/model/world/L2Character.java @@ -32,6 +32,7 @@ import com.l2jserver.model.world.character.CharacterClass; import com.l2jserver.model.world.character.CharacterFriendList; import com.l2jserver.model.world.character.CharacterInventory; import com.l2jserver.model.world.character.CharacterShortcutContainer; +import com.l2jserver.model.world.character.CharacterStats; import com.l2jserver.util.dimensional.Point; /** @@ -83,10 +84,20 @@ public class L2Character extends Player { * The character name */ private String name; + /** + * The character title. Can be null. + */ + private String title; /** * The class of the character */ private CharacterClass characterClass; + + /** + * The character CP + */ + private double CP; + /** * The character's status */ @@ -96,6 +107,24 @@ public class L2Character extends Player { */ private Date lastAccess; + /** + * The character stat + */ + private final CharacterStats stats = new CharacterStats(this); + + /** + * The character karma points + */ + private int karma; + /** + * The character PK kills + */ + private int pkKills; + /** + * The character PVP kills + */ + private int pvpKills; + // //////////////////////////////////// // / RUNTIME // //////////////////////////////////// @@ -136,7 +165,26 @@ public class L2Character extends Player { * @author Rogiel */ public enum CharacterState { - TELEPORTING, CASTING, ATTACKING, MOVING; + /** + * This state indicates the character is being teleported + */ + TELEPORTING, + /** + * This state indicates the character is casting a skill + */ + CASTING, + /** + * This state indicates the character is attacking + */ + ATTACKING, + /** + * This state indicates the character is moving + */ + MOVING, + /** + * This state indicates the character is dead + */ + DEAD; } /** @@ -150,10 +198,9 @@ public class L2Character extends Player { * @param baseAttributes * the base attribute for this character */ - public L2Character(CharacterTemplateID templateID, - CharacterTemplate.ActorBaseAttributes baseAttributes) { + public L2Character(CharacterTemplateID templateID) { super(templateID); - this.baseAttributes = baseAttributes; + this.baseAttributes = templateID.getTemplate().getBaseAttributes(); this.attributes = new CharacterCalculatedAttributes(this); } @@ -235,6 +282,21 @@ public class L2Character extends Player { this.name = name; } + /** + * @return the title + */ + public String getTitle() { + return title; + } + + /** + * @param title + * the title to set + */ + public void setTitle(String title) { + this.title = title; + } + /** * @return the characterClass */ @@ -250,6 +312,21 @@ public class L2Character extends Player { this.characterClass = characterClass; } + /** + * @return the character CP + */ + public double getCP() { + return CP; + } + + /** + * @param CP + * the character CP to set + */ + public void setCP(double CP) { + this.CP = CP; + } + /** * @return the online */ @@ -280,6 +357,58 @@ public class L2Character extends Player { this.lastAccess = lastAccess; } + /** + * @return the stats + */ + public CharacterStats getStats() { + return stats; + } + + /** + * @return the character karma points + */ + public int getKarma() { + return karma; + } + + /** + * @param karma + * the character karma points to set + */ + public void setKarma(int karma) { + this.karma = karma; + } + + /** + * @return the character PK kills + */ + public int getPkKills() { + return pkKills; + } + + /** + * @param pkKills + * the character PK kills to set + */ + public void setPkKills(int pkKills) { + this.pkKills = pkKills; + } + + /** + * @return the character PVP kills + */ + public int getPvpKills() { + return pvpKills; + } + + /** + * @param pvpKills + * the character PVP kills to set + */ + public void setPvpKills(int pvpKills) { + this.pvpKills = pvpKills; + } + /** * @return the moveType */ @@ -348,6 +477,34 @@ public class L2Character extends Player { return state == CharacterState.MOVING; } + /** + * @return true if character is dead + */ + public boolean isDead() { + return state == CharacterState.DEAD; + } + + /** + * @return true if character is casting + */ + public boolean isCasting() { + return state == CharacterState.CASTING; + } + + /** + * @return true if character is attacking + */ + public boolean isAttacking() { + return state == CharacterState.ATTACKING; + } + + /** + * @return true if character is alive + */ + public boolean isAlive() { + return !isDead(); + } + /** * @return the targetLocation */ diff --git a/src/main/java/com/l2jserver/model/world/NPC.java b/src/main/java/com/l2jserver/model/world/NPC.java index 265e90c28..232270e6f 100644 --- a/src/main/java/com/l2jserver/model/world/NPC.java +++ b/src/main/java/com/l2jserver/model/world/NPC.java @@ -30,11 +30,6 @@ import com.l2jserver.service.game.ai.AIScript; * @author Rogiel */ public class NPC extends Actor { - public int oldId; - public int tpl; - - - /** * Creates a new instance * @@ -45,6 +40,62 @@ public class NPC extends Actor { super(templateID); } + @Override + public ActorSex getSex() { + return this.getTemplate().getSex(); + } + + @Override + public void setSex(ActorSex sex) { + throw new UnsupportedOperationException(); + } + + @Override + public int getLevel() { + return this.getTemplate().getLevel(); + } + + @Override + public void setLevel(int level) { + throw new UnsupportedOperationException(); + } + + public double getMaxHP() { + return this.getTemplate().getMaxHP(); + } + + public void setMaxHP(double maxHP) { + throw new UnsupportedOperationException(); + } + + public double getMaxMP() { + return this.getTemplate().getMaxHP(); + } + + public void setMaxMP(double maxMP) { + throw new UnsupportedOperationException(); + } + + @Override + public long getExperience() { + return this.getTemplate().getExperience(); + } + + @Override + public void setExperience(long experience) { + throw new UnsupportedOperationException(); + } + + @Override + public int getSP() { + return this.getTemplate().getSp(); + } + + @Override + public void setSP(int sp) { + throw new UnsupportedOperationException(); + } + /** * @return the NPC template ID */ diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/ActorCalculator.java b/src/main/java/com/l2jserver/model/world/actor/calculator/ActorCalculator.java new file mode 100644 index 000000000..5a0006a2d --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/ActorCalculator.java @@ -0,0 +1,34 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.actor.calculator; + +import com.l2jserver.model.world.Actor; + +/** + * @author Rogiel + */ +public class ActorCalculator { + private final Actor actor; + + public ActorCalculator(Actor actor) { + this.actor = actor; + } + + public double calculateMaxHP() { + return 0; + } +} diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/ActorCalculatorContext.java b/src/main/java/com/l2jserver/model/world/actor/calculator/ActorCalculatorContext.java new file mode 100644 index 000000000..bd4807d5b --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/ActorCalculatorContext.java @@ -0,0 +1,35 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.actor.calculator; + +import com.l2jserver.model.world.Actor; +import com.l2jserver.util.calculator.CalculatorContext; + +/** + * @author Rogiel + * + */ +public class ActorCalculatorContext extends CalculatorContext { + /** + * The character instance + */ + public final Actor actor; + + public ActorCalculatorContext(Actor actor) { + this.actor = actor; + } +} diff --git a/src/main/java/com/l2jserver/model/world/actor/stat/BaseStats.java b/src/main/java/com/l2jserver/model/world/actor/stat/BaseStats.java new file mode 100644 index 000000000..ba014cac4 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/actor/stat/BaseStats.java @@ -0,0 +1,93 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.actor.stat; + +/** + * @author Rogiel + */ +public enum BaseStats { + 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, + 0.97, 1.01, 1.04, 1.08, 1.12, 1.16, 1.2, 1.24, 1.29, 1.33, 1.38, + 1.43, 1.48, 1.54, 1.59, 1.65, 1.71, 1.77, 1.83, 1.9, 1.97, 2.04, + 2.11, 2.19, 2.27, 2.35, 2.43, 2.52, 2.61, 2.71, 2.8, 2.91, 3.01, + 3.12, 3.23, 3.35, 3.47, 3.59, 3.72, 3.86, 3.99, 4.14, 4.29, 4.44, + 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), + + 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, + 1.05, 1.07, 1.1, 1.12, 1.14, 1.16, 1.19, 1.21, 1.23, 1.26, 1.28, + 1.31, 1.34, 1.36, 1.39, 1.42, 1.45, 1.47, 1.5, 1.53, 1.57, 1.6, + 1.63, 1.66, 1.69, 1.73, 1.76, 1.8, 1.83, 1.87, 1.91, 1.95, 1.99, + 2.02, 2.07, 2.11, 2.15, 2.19, 2.24, 2.28, 2.33, 2.37, 2.42, 2.47, + 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), + + 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, + 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.2, 1.21, 1.22, 1.24, 1.25, + 1.26, 1.27, 1.28, 1.29, 1.3, 1.32, 1.33, 1.34, 1.35, 1.36, 1.38, + 1.39, 1.4, 1.41, 1.43, 1.44, 1.45, 1.47, 1.48, 1.49, 1.51, 1.52, + 1.53, 1.55, 1.56, 1.57, 1.59, 1.6, 1.62, 1.63, 1.65, 1.66, 1.68, + 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), + + 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, + 2.08, 2.18, 2.29, 2.41, 2.53, 2.65, 2.79, 2.93, 3.07, 3.23, 3.39, + 3.56, 3.73, 3.92, 4.12, 4.32, 4.54, 4.76, 5, 5.25, 5.52, 5.79, + 6.08, 6.39, 6.7, 7.04, 7.39, 7.76, 8.15, 8.56, 8.99, 9.43, 9.91, + 10.4, 10.92, 11.47, 12.04, 12.64, 13.27, 13.94, 14.64, 15.37, + 16.14, 16.94, 17.79, 18.68, 19.61, 20.59, 21.62, 22.7, 23.84, + 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), + + 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, + 1.21, 1.24, 1.28, 1.32, 1.36, 1.4, 1.44, 1.48, 1.53, 1.58, 1.62, + 1.67, 1.72, 1.77, 1.83, 1.88, 1.94, 2, 2.06, 2.12, 2.18, 2.25, + 2.31, 2.38, 2.45, 2.53, 2.6, 2.68, 2.76, 2.84, 2.93, 3.02, 3.11, + 3.2, 3.3, 3.4, 3.5, 3.6, 3.71, 3.82, 3.94, 4.06, 4.18, 4.3, 4.43, + 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), + + 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, + 1.4, 1.42, 1.43, 1.45, 1.46, 1.48, 1.49, 1.5, 1.52, 1.53, 1.55, + 1.57, 1.58, 1.6, 1.61, 1.63, 1.65, 1.66, 1.68, 1.7, 1.71, 1.73, + 1.75, 1.76, 1.78, 1.8, 1.82, 1.84, 1.85, 1.87, 1.89, 1.91, 1.93, + 1.95, 1.97, 1.99, 2.01, 2.03, 2.05, 2.07, 2.09, 2.11, 2.13, 2.15, + 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; + + BaseStats(double... bonus) { + this.bonus = bonus; + } + + public double calculateBonus(int n) { + return bonus[n]; + } +} diff --git a/src/main/java/com/l2jserver/model/world/actor/stat/Stats.java b/src/main/java/com/l2jserver/model/world/actor/stat/Stats.java new file mode 100644 index 000000000..34ca157bd --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/actor/stat/Stats.java @@ -0,0 +1,264 @@ +package com.l2jserver.model.world.actor.stat; + +import java.util.List; +import java.util.Map; + +import com.l2jserver.util.calculator.Calculator; +import com.l2jserver.util.calculator.CalculatorContext; +import com.l2jserver.util.calculator.DivisionFunction; +import com.l2jserver.util.calculator.Function; +import com.l2jserver.util.calculator.MultiplicationFunction; +import com.l2jserver.util.calculator.SetFunction; +import com.l2jserver.util.calculator.SubtractFunction; +import com.l2jserver.util.calculator.SumFunction; +import com.l2jserver.util.factory.CollectionFactory; + +/** + * This class handles the stats an can add operations to the calculator + * + * @author Rogiel + */ +public class Stats { + /** + * Attribute types for weapons + * + * @author Rogiel + */ + public enum StatType { + MAX_HP, MAX_MP, MAX_CP, REGENERATE_HP_RATE, REGENERATE_CP_RATE, REGENERATE_MP_RATE, RECHARGE_MP_RATE, HEAL_EFFECTIVNESS, HEAL_PROFICIENCY, HEAL_STATIC_BONUS, + + // Atk & Def + POWER_DEFENSE, MAGIC_DEFENSE, POWER_ATTACK, MAGIC_ATTACK, PHYSICAL_SKILL_POWER, POWER_ATTACK_SPEED, MAGIC_ATTACK_SPEED, // how + // fast + // a + // spell + // is + // casted + MAGIC_REUSE_RATE, // how fast spells becomes ready to reuse + SHIELD_DEFENCE, CRITICAL_DAMAGE, CRITICAL_DAMAGE_ADD, // this is another + // type for + // special + // critical + // damage mods - + // vicious + // stance, crit + // power and + // crit damage + // SA + // it was totally bad since now... + MAGIC_CRIT_DMG, + + PVP_PHYSICAL_DMG, PVP_MAGICAL_DMG, PVP_PHYS_SKILL_DMG, + + PVP_PHYSICAL_DEF, PVP_MAGICAL_DEF, PVP_PHYS_SKILL_DEF, + + PVE_PHYSICAL_DMG, PVE_PHYS_SKILL_DMG, PVE_BOW_DMG, PVE_BOW_SKILL_DMG, PVE_MAGICAL_DMG, + + // Atk & Def rates + EVASION_RATE, P_SKILL_EVASION, CRIT_DAMAGE_EVASION, SHIELD_RATE, CRITICAL_RATE, BLOW_RATE, LETHAL_RATE, MCRITICAL_RATE, EXPSP_RATE, ATTACK_CANCEL, + + // Accuracy and range + ACCURACY_COMBAT, POWER_ATTACK_RANGE, MAGIC_ATTACK_RANGE, POWER_ATTACK_ANGLE, ATTACK_COUNT_MAX, + // Run speed, + // walk & escape speed are calculated proportionally, + // magic speed is a buff + RUN_SPEED, WALK_SPEED, + + // + // Player-only stats + // + STAT_STR, STAT_CON, STAT_DEX, STAT_INT, STAT_WIT, STAT_MEN, + + // + // Special stats, share one slot in Calculator + // + + // stats of various abilities + BREATH, FALL, LIMIT_HP, // non-displayed hp limit + // + AGGRESSION, // locks a mob on tank caster + BLEED, // by daggers, like poison + POISON, // by magic, hp dmg over time + STUN, // disable move/ATTACK for a period of time + ROOT, // disable movement, but not ATTACK + MOVEMENT, // slowdown movement, debuff + CONFUSION, // mob changes target, opposite to aggression/hate + SLEEP, // sleep until attacked + VALAKAS, VALAKAS_RES, + // + AGGRESSION_VULN, BLEED_VULN, POISON_VULN, STUN_VULN, PARALYZE_VULN, ROOT_VULN, SLEEP_VULN, CONFUSION_VULN, MOVEMENT_VULN, FIRE_RES, WIND_RES, WATER_RES, EARTH_RES, HOLY_RES, DARK_RES, + // Skills Power + FIRE_POWER, WATER_POWER, WIND_POWER, EARTH_POWER, HOLY_POWER, DARK_POWER, CANCEL_VULN, // Resistance + // for + // cancel + // type + // skills + DERANGEMENT_VULN, DEBUFF_VULN, BUFF_VULN, CRIT_VULN, // Resistence to + // Crit DMG in + // percent. + CRIT_ADD_VULN, // Resistence to Crit DMG in value . + MAGIC_DAMAGE_VULN, MAGIC_SUCCESS_RES, MAGIC_FAILURE_RATE, + + AGGRESSION_PROF, BLEED_PROF, POISON_PROF, STUN_PROF, PARALYZE_PROF, ROOT_PROF, SLEEP_PROF, CONFUSION_PROF, PROF, CANCEL_PROF, DERANGEMENT_PROF, DEBUFF_PROF, CRIT_PROF, + + NONE_WPN_VULN, // Shields!!! + SWORD_WPN_VULN, BLUNT_WPN_VULN, DAGGER_WPN_VULN, BOW_WPN_VULN, CROSSBOW_WPN_VULN, POLE_WPN_VULN, ETC_WPN_VULN, FIST_WPN_VULN, DUAL_WPN_VULN, DUALFIST_WPN_VULN, BIGSWORD_WPN_VULN, BIGBLUNT_WPN_VULN, DUALDAGGER_WPN_VULN, RAPIER_WPN_VULN, ANCIENT_WPN_VULN, PET_WPN_VULN, + + REFLECT_DAMAGE_PERCENT, REFLECT_SKILL_MAGIC, REFLECT_SKILL_PHYSIC, VENGEANCE_SKILL_MAGIC_DAMAGE, VENGEANCE_SKILL_PHYSICAL_DAMAGE, ABSORB_DAMAGE_PERCENT, TRANSFER_DAMAGE_PERCENT, ABSORB_MANA_DAMAGE_PERCENT, + + MAX_LOAD, WEIGHT_LIMIT, + + PATK_PLANTS, PATK_INSECTS, PATK_ANIMALS, PATK_MONSTERS, PATK_DRAGONS, PATK_GIANTS, PATK_MCREATURES, + + PDEF_PLANTS, PDEF_INSECTS, PDEF_ANIMALS, PDEF_MONSTERS, PDEF_DRAGONS, PDEF_GIANTS, PDEF_MCREATURES, + + ATK_REUSE, P_REUSE, + + // ExSkill :) + INV_LIM, WH_LIM, FREIGHT_LIM, P_SELL_LIM, P_BUY_LIM, REC_D_LIM, REC_C_LIM, + + // C4 Stats + PHYSICAL_MP_CONSUME_RATE, MAGICAL_MP_CONSUME_RATE, DANCE_MP_CONSUME_RATE, BOW_MP_CONSUME_RATE, HP_CONSUME_RATE, MP_CONSUME, SOULSHOT_COUNT, + + // T1 stats + transformId, TALISMAN_SLOTS, CLOAK_SLOT, + + // Shield Stats + SHIELD_DEFENCE_ANGLE, + + // Skill mastery + SKILL_MASTERY, + + // vitality + VITALITY_CONSUME_RATE; + + // PHYSICAL_ATTACK, MAGICAL_ATTACK, CRITICAL_RATE, + // PHYSICAL_ATTACK_SPEED; + } + + private final Map>> operations = CollectionFactory + .newMap(); + + /** + * Sets the result of an calculator + * + * @param type + * the attribute type + * @param order + * the calculation order + * @param value + * the value to set + */ + public void set(Stats.StatType type, int order, double value) { + func(type, new SetFunction(order, value)); + } + + /** + * Adds value to the result of an calculator + * + * @param type + * the attribute type + * @param order + * the calculation order + * @param value + * the value to be summed + */ + public void add(Stats.StatType type, int order, double value) { + func(type, new SumFunction(order, value)); + } + + /** + * Subtracts value from the result of an calculator + * + * @param type + * the attribute type + * @param order + * the calculation order + * @param value + * the value to be subtracted + */ + public void sub(Stats.StatType type, int order, double value) { + func(type, new SubtractFunction(order, value)); + } + + /** + * Multiply value the result of an calculator + * + * @param type + * the attribute type + * @param order + * the calculation order + * @param value + * the value to be multiplied + */ + public void mult(Stats.StatType type, int order, double value) { + func(type, new MultiplicationFunction(order, value)); + } + + /** + * Divides by value the result of an calculator + * + * @param type + * the attribute type + * @param order + * the calculation order + * @param value + * the value to be divided by + */ + public void div(Stats.StatType type, int order, double value) { + func(type, new DivisionFunction(order, value)); + } + + /** + * Performs an enchant operation. Note that this is not implemented yet! + * + * @param type + * the attribute type + * @param order + * the calculation order + * @param value + * TODO + */ + public void enchant(Stats.StatType type, int order, double value) { + // TODO enchant operation for weapon + } + + public void func(StatType type, Function function) { + getMap(type).add(function); + } + + /** + * Returns the Order-Operation map for type + * + * @param type + * the type + * @return the order-operation map + */ + private List> getMap(Stats.StatType type) { + List> list = operations.get(type); + if (list == null) { + list = CollectionFactory.newList(); + operations.put(type, list); + } + return list; + } + + /** + * Creates the calculator object for this weapon + * + * @param type + * the type + * @param calculator + * the calculator + */ + public void calculator(Stats.StatType type, + Calculator calculator) { + final List> operations = this.operations + .get(type); + if (operations == null || operations.size() == 0) + return; + for (final Function func : operations) { + calculator.add(func); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/l2jserver/model/world/character/CharacterAppearance.java b/src/main/java/com/l2jserver/model/world/character/CharacterAppearance.java index fa9426eec..f686f7cb6 100644 --- a/src/main/java/com/l2jserver/model/world/character/CharacterAppearance.java +++ b/src/main/java/com/l2jserver/model/world/character/CharacterAppearance.java @@ -157,6 +157,10 @@ public class CharacterAppearance { * This is not persisted! */ private RGBColor titleColor = RGBColor.fromInteger(0xFFFF77); + /** + * The visibility status + */ + private boolean visible; public CharacterAppearance(L2Character character) { this.character = character; @@ -267,6 +271,21 @@ public class CharacterAppearance { this.titleColor = titleColor; } + /** + * @return the visibility state + */ + public boolean isVisible() { + return visible; + } + + /** + * @param visible + * the visibility state to set + */ + public void setVisible(boolean visible) { + this.visible = visible; + } + /** * @return the character */ diff --git a/src/main/java/com/l2jserver/model/world/character/CharacterClass.java b/src/main/java/com/l2jserver/model/world/character/CharacterClass.java index dd34ea0c0..cb75212b3 100644 --- a/src/main/java/com/l2jserver/model/world/character/CharacterClass.java +++ b/src/main/java/com/l2jserver/model/world/character/CharacterClass.java @@ -31,22 +31,19 @@ public enum CharacterClass { HUMAN_FIGHTER), GLADIATOR(0x02, WARRIOR), WARLORD(0x03, WARRIOR), KNIGHT( 0x04, HUMAN_FIGHTER), PALADIN(0x05, KNIGHT), DARK_AVENGER(0x06, KNIGHT), ROGUE(0x07, HUMAN_FIGHTER), TREASURE_HUNTER(0x08, ROGUE), HAWKEYE( - 0x09, ROGUE), - // 3rd classes - DUELIST(0x58, GLADIATOR), DREADNOUGHT(0x59, WARLORD), PHOENIX_KNIGHT(0x5a, - PALADIN), HELL_KNIGHT(0x5b, DARK_AVENGER), SAGITTARIUS(0x5c, + 0x09, ROGUE), DUELIST(0x58, GLADIATOR), DREADNOUGHT(0x59, WARLORD), PHOENIX_KNIGHT( + 0x5a, PALADIN), HELL_KNIGHT(0x5b, DARK_AVENGER), SAGITTARIUS(0x5c, HAWKEYE), ADVENTURER(0x5d, TREASURE_HUNTER), /** * Human mystic */ - HUMAN_MYSTIC(0x0a, ClassType.MYSTIC, ActorRace.HUMAN), WIZARD(0x0b, HUMAN_MYSTIC), SORCEROR( - 0x0c, WIZARD), NECROMANCER(0x0d, WIZARD), WARLOCK(0x0e, true, - WIZARD), CLERIC(0x0f, ClassType.PRIEST, HUMAN_MYSTIC), BISHOP(0x10, - CLERIC), PROPHET(0x11, CLERIC), - // 3rd classes - ARCHMAGE(0x5e, SORCEROR), SOULTAKER(0x5f, NECROMANCER), ARCANA_LORD(0x60, - WARLOCK), CARDINAL(0x61, BISHOP), HIEROPHANT(0x62, PROPHET), + HUMAN_MYSTIC(0x0a, ClassType.MYSTIC, ActorRace.HUMAN), WIZARD(0x0b, + HUMAN_MYSTIC), SORCEROR(0x0c, WIZARD), NECROMANCER(0x0d, WIZARD), WARLOCK( + 0x0e, true, WIZARD), CLERIC(0x0f, ClassType.PRIEST, HUMAN_MYSTIC), BISHOP( + 0x10, CLERIC), PROPHET(0x11, CLERIC), ARCHMAGE(0x5e, SORCEROR), SOULTAKER( + 0x5f, NECROMANCER), ARCANA_LORD(0x60, WARLOCK), CARDINAL(0x61, + BISHOP), HIEROPHANT(0x62, PROPHET), /** * Elven fighter @@ -54,9 +51,8 @@ public enum CharacterClass { ELVEN_FIGHTER(0x12, ClassType.FIGHTER, ActorRace.ELF), ELVEN_KNIGHT(0x13, ELVEN_FIGHTER), TEMPLE_KNIGHT(0x14, ELVEN_KNIGHT), SWORD_SINGER( 0x15, ELVEN_KNIGHT), ELVEN_SCOUT(0x16, ELVEN_FIGHTER), PLAINS_WALKER( - 0x17, ELVEN_SCOUT), SILVER_RANGER(0x18, ELVEN_SCOUT), - // 3rd classes - EVA_TEMPLAR(0x63, TEMPLE_KNIGHT), SWORD_MUSE(0x64, SWORD_SINGER), WIND_RIDER( + 0x17, ELVEN_SCOUT), SILVER_RANGER(0x18, ELVEN_SCOUT), EVA_TEMPLAR( + 0x63, TEMPLE_KNIGHT), SWORD_MUSE(0x64, SWORD_SINGER), WIND_RIDER( 0x65, PLAINS_WALKER), MOONLIGHT_SENTINEL(0x66, SILVER_RANGER), /** * Elven mystic @@ -64,20 +60,17 @@ public enum CharacterClass { ELVEN_MYSTIC(0x19, ClassType.MYSTIC, ActorRace.ELF), ELVEN_WIZARD(0x1a, ELVEN_MYSTIC), SPELLSINGER(0x1b, ELVEN_WIZARD), ELEMENTAL_SUMMONER( 0x1c, true, ELVEN_WIZARD), ORACLE(0x1d, ClassType.PRIEST, - ELVEN_MYSTIC), ELDER(0x1e, ORACLE), - // 3rd classes - MYSTIC_MUSE(0x67, SPELLSINGER), ELEMENTAL_MASTER(0x68, ELEMENTAL_SUMMONER), EVA_SAINT( - 0x69, ELDER), + ELVEN_MYSTIC), ELDER(0x1e, ORACLE), MYSTIC_MUSE(0x67, SPELLSINGER), ELEMENTAL_MASTER( + 0x68, ELEMENTAL_SUMMONER), EVA_SAINT(0x69, ELDER), /** * Dark elf fighter */ - DARK_FIGHTER(0x1f, ClassType.FIGHTER, ActorRace.DARK_ELF), PALUS_KNIGHT(0x20, - DARK_FIGHTER), SHILLIEN_KNIGHT(0x21, PALUS_KNIGHT), BLADEDANCER( + DARK_FIGHTER(0x1f, ClassType.FIGHTER, ActorRace.DARK_ELF), PALUS_KNIGHT( + 0x20, DARK_FIGHTER), SHILLIEN_KNIGHT(0x21, PALUS_KNIGHT), BLADEDANCER( 0x22, PALUS_KNIGHT), ASSASSIN(0x23, DARK_FIGHTER), ABYSS_WALKER( - 0x24, ASSASSIN), PHANTOM_RANGER(0x25, ASSASSIN), - // 3rd classes - SHILLIEN_TEMPLAR(0x6a, SHILLIEN_KNIGHT), spectralDancer(0x6b, BLADEDANCER), GHOST_HUNTER( + 0x24, ASSASSIN), PHANTOM_RANGER(0x25, ASSASSIN), SHILLIEN_TEMPLAR( + 0x6a, SHILLIEN_KNIGHT), spectralDancer(0x6b, BLADEDANCER), GHOST_HUNTER( 0x6c, ABYSS_WALKER), GHOST_SENTINEL(0x6d, PHANTOM_RANGER), /** @@ -86,9 +79,8 @@ public enum CharacterClass { DARK_MYSTIC(0x26, ClassType.MYSTIC, ActorRace.DARK_ELF), DARK_WIZARD(0x27, DARK_MYSTIC), SPELLHOWLER(0x28, DARK_WIZARD), PHANTOM_SUMMONER( 0x29, true, DARK_WIZARD), SHILLIEN_ORACLE(0x2a, ClassType.PRIEST, - DARK_MYSTIC), SHILLIEN_ELDER(0x2b, SHILLIEN_ORACLE), - // 3rd classes - STORM_SCREAMER(0x6e, SPELLHOWLER), SPECTRAL_MASTER(0x6f, PHANTOM_SUMMONER), SHILLIEAN_SAINT( + DARK_MYSTIC), SHILLIEN_ELDER(0x2b, SHILLIEN_ORACLE), STORM_SCREAMER( + 0x6e, SPELLHOWLER), SPECTRAL_MASTER(0x6f, PHANTOM_SUMMONER), SHILLIEAN_SAINT( 0x70, SHILLIEN_ELDER), /** @@ -96,26 +88,24 @@ public enum CharacterClass { */ ORC_FIGHTER(0x2c, ClassType.FIGHTER, ActorRace.ORC), ORC_RAIDER(0x2d, ORC_FIGHTER), DESTROYER(0x2e, ORC_RAIDER), ORC_MONK(0x2f, - ORC_FIGHTER), TYRANT(0x30, ORC_RAIDER), - // 3rd classes - TITAN(0x71, DESTROYER), GRAND_KHAUATARI(0x72, TYRANT), + ORC_FIGHTER), TYRANT(0x30, ORC_RAIDER), TITAN(0x71, DESTROYER), GRAND_KHAUATARI( + 0x72, TYRANT), /** * Orc mystic */ - ORC_MYSTIC(0x31, ClassType.MYSTIC, ActorRace.ORC), ORC_SHAMAN(0x32, ORC_MYSTIC), OVERLORD( - 0x33, ORC_SHAMAN), WARCRYER(0x34, ORC_SHAMAN), - // 3rd classes - DOMINATOR(0x73, OVERLORD), DOOMCRYER(0x74, WARCRYER), + ORC_MYSTIC(0x31, ClassType.FIGHTER, ActorRace.ORC), ORC_SHAMAN(0x32, + ClassType.MYSTIC, ORC_MYSTIC), OVERLORD(0x33, ORC_SHAMAN), WARCRYER( + 0x34, ORC_SHAMAN), DOMINATOR(0x73, OVERLORD), DOOMCRYER(0x74, + WARCRYER), /** * Dwarf fighter */ DWARVEN_FIGHTER(0x35, ClassType.FIGHTER, ActorRace.DWARF), SCAVENGER(0x36, DWARVEN_FIGHTER), BOUNTY_HUNTER(0x37, SCAVENGER), ARTISAN(0x38, - DWARVEN_FIGHTER), WARSMITH(0x39, ARTISAN), - // 3rd classes - FORTUNE_SEEKER(0x75, BOUNTY_HUNTER), MAESTRO(0x76, WARSMITH), + DWARVEN_FIGHTER), WARSMITH(0x39, ARTISAN), FORTUNE_SEEKER(0x75, + BOUNTY_HUNTER), MAESTRO(0x76, WARSMITH), /** * Kamael male soldier @@ -194,8 +184,8 @@ public enum CharacterClass { * @param parent * the parent */ - private CharacterClass(int id, ClassType type, boolean summoner, ActorRace race, - CharacterClass parent) { + private CharacterClass(int id, ClassType type, boolean summoner, + ActorRace race, CharacterClass parent) { this.id = id; this.type = type; this.summoner = summoner; diff --git a/src/main/java/com/l2jserver/model/world/character/CharacterInventory.java b/src/main/java/com/l2jserver/model/world/character/CharacterInventory.java index e34b4805b..d5cbd88cf 100644 --- a/src/main/java/com/l2jserver/model/world/character/CharacterInventory.java +++ b/src/main/java/com/l2jserver/model/world/character/CharacterInventory.java @@ -65,6 +65,10 @@ public class CharacterInventory implements Iterable { return null; } + public boolean has(InventoryPaperdoll paperdoll) { + return getItem(paperdoll) != null; + } + /** * This method will add new items to the inventory. This is normally called * from the DAO object. diff --git a/src/main/java/com/l2jserver/model/world/character/CharacterShortcutContainer.java b/src/main/java/com/l2jserver/model/world/character/CharacterShortcutContainer.java index 31cfc9d7b..5607d6053 100644 --- a/src/main/java/com/l2jserver/model/world/character/CharacterShortcutContainer.java +++ b/src/main/java/com/l2jserver/model/world/character/CharacterShortcutContainer.java @@ -17,6 +17,8 @@ package com.l2jserver.model.world.character; import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; import java.util.Iterator; import java.util.List; @@ -57,6 +59,7 @@ public class CharacterShortcutContainer implements Iterable { */ public void register(Shortcut shortcut) { shortcuts.add(shortcut); + Collections.sort(shortcuts, new ShortcutSlotComparator()); } /** @@ -67,6 +70,7 @@ public class CharacterShortcutContainer implements Iterable { */ public void unregister(Shortcut shortcut) { shortcuts.remove(shortcut); + Collections.sort(shortcuts, new ShortcutSlotComparator()); } /** @@ -90,6 +94,8 @@ public class CharacterShortcutContainer implements Iterable { shortcut1.setPage(shortcut2.getPage()); shortcut2.setSlot(slot1); shortcut2.setPage(page1); + + Collections.sort(shortcuts, new ShortcutSlotComparator()); } /** @@ -115,6 +121,7 @@ public class CharacterShortcutContainer implements Iterable { */ public void load(Collection shortcuts) { this.shortcuts.addAll(shortcuts); + Collections.sort(this.shortcuts, new ShortcutSlotComparator()); } @Override @@ -128,4 +135,12 @@ public class CharacterShortcutContainer implements Iterable { public L2Character getCharacter() { return character; } + + public static class ShortcutSlotComparator implements Comparator { + @Override + public int compare(Shortcut o1, Shortcut o2) { + return ((o1.getPage() * o1.getSlot()) - (o2.getPage() * o2 + .getSlot())); + } + } } diff --git a/src/main/java/com/l2jserver/model/world/character/CharacterStats.java b/src/main/java/com/l2jserver/model/world/character/CharacterStats.java new file mode 100644 index 000000000..0d82d6a90 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/CharacterStats.java @@ -0,0 +1,230 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character; + +import com.l2jserver.model.world.L2Character; +import com.l2jserver.model.world.actor.stat.Stats.StatType; +import com.l2jserver.model.world.character.calculator.BaseAttackAccuracyCalculator; +import com.l2jserver.model.world.character.calculator.BaseAttackEvasionCalculator; +import com.l2jserver.model.world.character.calculator.BaseCPCalculator; +import com.l2jserver.model.world.character.calculator.BaseConcentrationCalculator; +import com.l2jserver.model.world.character.calculator.BaseDexterityCalculator; +import com.l2jserver.model.world.character.calculator.BaseHPCalculator; +import com.l2jserver.model.world.character.calculator.BaseIntelligenceCalculator; +import com.l2jserver.model.world.character.calculator.BaseMPCalculator; +import com.l2jserver.model.world.character.calculator.BaseMagicalAttackCalculator; +import com.l2jserver.model.world.character.calculator.BaseMagicalAttackSpeedCalculator; +import com.l2jserver.model.world.character.calculator.BaseMagicalCriticalRateCalculator; +import com.l2jserver.model.world.character.calculator.BaseMagicalDefenseCalculator; +import com.l2jserver.model.world.character.calculator.BaseMentalityCalculator; +import com.l2jserver.model.world.character.calculator.BasePhysicalAttackCalculator; +import com.l2jserver.model.world.character.calculator.BasePhysicalAttackSpeedCalculator; +import com.l2jserver.model.world.character.calculator.BasePhysicalCriticalRateCalculator; +import com.l2jserver.model.world.character.calculator.BasePhysicalDefenseCalculator; +import com.l2jserver.model.world.character.calculator.BaseRunSpeedCalculator; +import com.l2jserver.model.world.character.calculator.BaseStrengthCalculator; +import com.l2jserver.model.world.character.calculator.BaseWalkSpeedCalculator; +import com.l2jserver.model.world.character.calculator.BaseWitnessCalculator; +import com.l2jserver.model.world.character.calculator.CharacterCalculator; +import com.l2jserver.model.world.character.calculator.CharacterCalculatorContext; +import com.l2jserver.util.calculator.Calculator; + +/** + * @author Rogiel + * + */ +public class CharacterStats { + private static final CharacterCalculator BASE_HP_CALCULATOR = new BaseHPCalculator(); + private static final CharacterCalculator BASE_MP_CALCULATOR = new BaseMPCalculator(); + private static final CharacterCalculator BASE_CP_CALCULATOR = new BaseCPCalculator(); + + private static final CharacterCalculator BASE_INT_CALCULATOR = new BaseIntelligenceCalculator(); + private static final CharacterCalculator BASE_STR_CALCULATOR = new BaseStrengthCalculator(); + private static final CharacterCalculator BASE_CON_CALCULATOR = new BaseConcentrationCalculator(); + private static final CharacterCalculator BASE_MEN_CALCULATOR = new BaseMentalityCalculator(); + private static final CharacterCalculator BASE_DEX_CALCULATOR = new BaseDexterityCalculator(); + private static final CharacterCalculator BASE_WIT_CALCULATOR = new BaseWitnessCalculator(); + + private static final CharacterCalculator BASE_RUN_SPEED_CALCULATOR = new BaseRunSpeedCalculator(); + private static final CharacterCalculator BASE_WALK_SPEED_CALCULATOR = new BaseWalkSpeedCalculator(); + + private static final CharacterCalculator BASE_PHYSICAL_ATTACK_CALCULATOR = new BasePhysicalAttackCalculator(); + private static final CharacterCalculator BASE_PHYSICAL_ATTACK_SPEED_CALCULATOR = new BasePhysicalAttackSpeedCalculator(); + private static final CharacterCalculator BASE_PHYSICAL_CRITICAL_RATE_CALCULATOR = new BasePhysicalCriticalRateCalculator(); + private static final CharacterCalculator BASE_PHYSICAL_DEFENSE_CALCULATOR = new BasePhysicalDefenseCalculator(); + + private static final CharacterCalculator BASE_MAGICAL_ATTACK_CALCULATOR = new BaseMagicalAttackCalculator(); + private static final CharacterCalculator BASE_MAGICAL_ATTACK_SPEED_CALCULATOR = new BaseMagicalAttackSpeedCalculator(); + private static final CharacterCalculator BASE_MAGICAL_CRITICAL_RATE_CALCULATOR = new BaseMagicalCriticalRateCalculator(); + private static final CharacterCalculator BASE_MAGICAL_DEFENSE_CALCULATOR = new BaseMagicalDefenseCalculator(); + + private static final CharacterCalculator BASE_ATTACK_ACCURACY_CALCULATOR = new BaseAttackAccuracyCalculator(); + private static final CharacterCalculator BASE_ATTACK_EVASION_CALCULATOR = new BaseAttackEvasionCalculator(); + + private final L2Character character; + @SuppressWarnings("unchecked") + private final Calculator[] calculators = new Calculator[StatType + .values().length]; + + public CharacterStats(L2Character character) { + this.character = character; + for (int i = 0; i < calculators.length; i++) { + calculators[i] = new Calculator(); + } + + // bind default functions + getCalculator(StatType.MAX_HP).importFunctions(BASE_HP_CALCULATOR); + getCalculator(StatType.MAX_MP).importFunctions(BASE_MP_CALCULATOR); + getCalculator(StatType.MAX_CP).importFunctions(BASE_CP_CALCULATOR); + + getCalculator(StatType.STAT_INT).importFunctions(BASE_INT_CALCULATOR); + getCalculator(StatType.STAT_STR).importFunctions(BASE_STR_CALCULATOR); + getCalculator(StatType.STAT_CON).importFunctions(BASE_CON_CALCULATOR); + getCalculator(StatType.STAT_MEN).importFunctions(BASE_MEN_CALCULATOR); + getCalculator(StatType.STAT_DEX).importFunctions(BASE_DEX_CALCULATOR); + getCalculator(StatType.STAT_WIT).importFunctions(BASE_WIT_CALCULATOR); + + getCalculator(StatType.RUN_SPEED).importFunctions( + BASE_RUN_SPEED_CALCULATOR); + getCalculator(StatType.WALK_SPEED).importFunctions( + BASE_WALK_SPEED_CALCULATOR); + + getCalculator(StatType.POWER_ATTACK).importFunctions( + BASE_PHYSICAL_ATTACK_CALCULATOR); + getCalculator(StatType.POWER_ATTACK_SPEED).importFunctions( + BASE_PHYSICAL_ATTACK_SPEED_CALCULATOR); + getCalculator(StatType.CRITICAL_RATE).importFunctions( + BASE_PHYSICAL_CRITICAL_RATE_CALCULATOR); + getCalculator(StatType.POWER_DEFENSE).importFunctions( + BASE_PHYSICAL_DEFENSE_CALCULATOR); + + getCalculator(StatType.MAGIC_ATTACK).importFunctions( + BASE_MAGICAL_ATTACK_CALCULATOR); + getCalculator(StatType.MAGIC_ATTACK_SPEED).importFunctions( + BASE_MAGICAL_ATTACK_SPEED_CALCULATOR); + getCalculator(StatType.MCRITICAL_RATE).importFunctions( + BASE_MAGICAL_CRITICAL_RATE_CALCULATOR); + getCalculator(StatType.MAGIC_DEFENSE).importFunctions( + BASE_MAGICAL_DEFENSE_CALCULATOR); + + getCalculator(StatType.ACCURACY_COMBAT).importFunctions( + BASE_ATTACK_ACCURACY_CALCULATOR); + getCalculator(StatType.EVASION_RATE).importFunctions( + BASE_ATTACK_EVASION_CALCULATOR); + + // TODO henna stats calculators + } + + public int getMaxHP() { + return (int) calc(StatType.MAX_HP); + } + + public int getMaxMP() { + return (int) calc(StatType.MAX_MP); + } + + public int getMaxCP() { + return (int) calc(StatType.MAX_CP); + } + + public int getIntelligence() { + return (int) calc(StatType.STAT_INT); + } + + public int getStrength() { + return (int) calc(StatType.STAT_STR); + } + + public int getConcentration() { + return (int) calc(StatType.STAT_CON); + } + + public int getMentality() { + return (int) calc(StatType.STAT_MEN); + } + + public int getDexterity() { + return (int) calc(StatType.STAT_DEX); + } + + public int getWitness() { + return (int) calc(StatType.STAT_WIT); + } + + public int getRunSpeed() { + return (int) calc(StatType.RUN_SPEED); + } + + public int getWalkSpeed() { + return (int) calc(StatType.WALK_SPEED); + } + + public int getPhysicalAttack() { + return (int) calc(StatType.POWER_ATTACK); + } + + public int getPhysicalAttackSpeed() { + return (int) calc(StatType.POWER_ATTACK_SPEED); + } + + public int getPhysicalCriticalRate() { + return (int) calc(StatType.CRITICAL_RATE); + } + + public int getPhysicalDefense() { + return (int) calc(StatType.POWER_DEFENSE); + } + + public int getMagicalAttack() { + return (int) calc(StatType.MAGIC_ATTACK); + } + + public int getMagicalAttackSpeed() { + return (int) calc(StatType.MAGIC_ATTACK_SPEED); + } + + public int getMagicalCriticalRate() { + return (int) calc(StatType.MCRITICAL_RATE); + } + + public int getMagicalDefense() { + return (int) calc(StatType.MAGIC_DEFENSE); + } + + public int getAccuracy() { + return (int) calc(StatType.ACCURACY_COMBAT); + } + + public int getEvasionRate() { + return (int) calc(StatType.EVASION_RATE); + } + + // public void add(StatType type, Calculator calculator) { + // getCalculator(type).importFunctions(calculator); + // } + + protected Calculator getCalculator(StatType type) { + return calculators[type.ordinal()]; + } + + public double calc(StatType type) { + final CharacterCalculatorContext ctx = new CharacterCalculatorContext( + character); + getCalculator(type).calculate(ctx); + return ctx.result; + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BaseAttackAccuracyCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BaseAttackAccuracyCalculator.java new file mode 100644 index 000000000..d5633ddc8 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BaseAttackAccuracyCalculator.java @@ -0,0 +1,51 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import org.apache.commons.math.util.FastMath; + +import com.l2jserver.model.world.L2Character; +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + * + */ +public class BaseAttackAccuracyCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BaseAttackAccuracyCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getAccuracy(); + } + }, new AbstractFunction(0x100) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + final L2Character c = ctx.character; + final int level = c.getLevel(); + + ctx.result += FastMath.sqrt(c.getStats().getDexterity()) * 6; + ctx.result += level; + if (level > 77) + ctx.result += (level - 77) + 1; + if (level > 69) + ctx.result += (level - 69); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BaseAttackEvasionCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BaseAttackEvasionCalculator.java new file mode 100644 index 000000000..66704ddee --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BaseAttackEvasionCalculator.java @@ -0,0 +1,51 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import org.apache.commons.math.util.FastMath; + +import com.l2jserver.model.world.L2Character; +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + * + */ +public class BaseAttackEvasionCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BaseAttackEvasionCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getEvasionChance(); + } + }, new AbstractFunction(0x100) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + final L2Character c = ctx.character; + final int level = c.getLevel(); + + ctx.result += FastMath.sqrt(c.getStats().getDexterity()) * 6; + ctx.result += level; + if (level > 77) + ctx.result += (level - 77) + 1; + if (level > 69) + ctx.result += (level - 69); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BaseCPCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BaseCPCalculator.java new file mode 100644 index 000000000..69c8d2791 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BaseCPCalculator.java @@ -0,0 +1,55 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import com.l2jserver.model.template.CharacterTemplate; +import com.l2jserver.model.world.actor.stat.BaseStats; +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + * + */ +public class BaseCPCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BaseCPCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getCpBase(); + } + }, new AbstractFunction(0x100) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + final CharacterTemplate template = ctx.character.getTemplate(); + + int lvl = ctx.character.getLevel() - template.getMinimumLevel(); + double mod = template.getCpMultiplier() * lvl; + double max = (template.getCpAdd() + mod) * lvl; + double min = (template.getCpAdd() * lvl) + mod; + + ctx.result += (max + min) / 2; + } + }, new AbstractFunction(0x200) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result *= BaseStats.CON.calculateBonus(ctx.character + .getStats().getConcentration()); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BaseConcentrationCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BaseConcentrationCalculator.java new file mode 100644 index 000000000..9ccd364d5 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BaseConcentrationCalculator.java @@ -0,0 +1,34 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + */ +public class BaseConcentrationCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BaseConcentrationCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getConcentration(); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BaseDexterityCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BaseDexterityCalculator.java new file mode 100644 index 000000000..65ac25281 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BaseDexterityCalculator.java @@ -0,0 +1,35 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + */ +public class BaseDexterityCalculator extends +CharacterCalculator { + @SuppressWarnings("unchecked") + public BaseDexterityCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getDextry(); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BaseHPCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BaseHPCalculator.java new file mode 100644 index 000000000..ce4f50f11 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BaseHPCalculator.java @@ -0,0 +1,55 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import com.l2jserver.model.template.CharacterTemplate; +import com.l2jserver.model.world.actor.stat.BaseStats; +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + * + */ +public class BaseHPCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BaseHPCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getHpBase(); + } + }, new AbstractFunction(0x100) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + final CharacterTemplate template = ctx.character.getTemplate(); + + int lvl = ctx.character.getLevel() - template.getMinimumLevel(); + double mod = template.getHpMultiplier() * lvl; + double max = (template.getHpAdd() + mod) * lvl; + double min = (template.getHpAdd() * lvl) + mod; + + ctx.result += (max + min) / 2; + } + }, new AbstractFunction(0x200) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result *= BaseStats.CON.calculateBonus(ctx.character + .getStats().getConcentration()); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BaseIntelligenceCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BaseIntelligenceCalculator.java new file mode 100644 index 000000000..4af37514a --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BaseIntelligenceCalculator.java @@ -0,0 +1,34 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + */ +public class BaseIntelligenceCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BaseIntelligenceCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getIntelligence(); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BaseMPCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BaseMPCalculator.java new file mode 100644 index 000000000..694f301f2 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BaseMPCalculator.java @@ -0,0 +1,55 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import com.l2jserver.model.template.CharacterTemplate; +import com.l2jserver.model.world.actor.stat.BaseStats; +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + * + */ +public class BaseMPCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BaseMPCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getMpBase(); + } + }, new AbstractFunction(0x100) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + final CharacterTemplate template = ctx.character.getTemplate(); + + int lvl = ctx.character.getLevel() - template.getMinimumLevel(); + double mod = template.getMpMultiplier() * lvl; + double max = (template.getMpAdd() + mod) * lvl; + double min = (template.getMpAdd() * lvl) + mod; + + ctx.result += (max + min) / 2; + } + }, new AbstractFunction(0x200) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result *= BaseStats.MEN.calculateBonus(ctx.character + .getStats().getMentality()); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BaseMagicalAttackCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BaseMagicalAttackCalculator.java new file mode 100644 index 000000000..9641a67b0 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BaseMagicalAttackCalculator.java @@ -0,0 +1,46 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import com.l2jserver.model.world.L2Character; +import com.l2jserver.model.world.actor.stat.BaseStats; +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + * + */ +public class BaseMagicalAttackCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BaseMagicalAttackCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getMagicalAttack(); + } + }, new AbstractFunction(0x200) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + final L2Character c = ctx.character; + ctx.result *= Math + .pow(((100.0 - 11 + c.getLevel()) / 100.0), 2) + * Math.pow(BaseStats.INT.calculateBonus(c.getStats() + .getIntelligence()), 2); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BaseMagicalAttackSpeedCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BaseMagicalAttackSpeedCalculator.java new file mode 100644 index 000000000..b4d55ce0b --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BaseMagicalAttackSpeedCalculator.java @@ -0,0 +1,42 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import com.l2jserver.model.world.actor.stat.BaseStats; +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + * + */ +public class BaseMagicalAttackSpeedCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BaseMagicalAttackSpeedCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getCastSpeed(); + } + }, new AbstractFunction(0x200) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result *= BaseStats.WIT.calculateBonus(ctx.character + .getStats().getWitness()); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BaseMagicalCriticalRateCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BaseMagicalCriticalRateCalculator.java new file mode 100644 index 000000000..ea218b344 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BaseMagicalCriticalRateCalculator.java @@ -0,0 +1,46 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import com.l2jserver.model.world.L2Character; +import com.l2jserver.model.world.actor.stat.BaseStats; +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + */ +public class BaseMagicalCriticalRateCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BaseMagicalCriticalRateCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + // XXX is the same as physical???? + ctx.result = ctx.character.getTemplate().getCriticalChance(); + } + }, new AbstractFunction(0x300) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + final L2Character c = ctx.character; + + // TODO only apply if using a weapon + ctx.result *= BaseStats.WIT.calculateBonus(c.getStats() + .getWitness()); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BaseMagicalDefenseCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BaseMagicalDefenseCalculator.java new file mode 100644 index 000000000..b49085bd4 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BaseMagicalDefenseCalculator.java @@ -0,0 +1,64 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import static com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll.LEFT_EAR; +import static com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll.LEFT_FINGER; +import static com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll.NECK; +import static com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll.RIGHT_EAR; +import static com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll.RIGHT_FINGER; + +import com.l2jserver.model.world.L2Character; +import com.l2jserver.model.world.actor.stat.BaseStats; +import com.l2jserver.model.world.character.CharacterInventory; +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + */ +public class BaseMagicalDefenseCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BaseMagicalDefenseCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getMagicalDefense(); + } + }, new AbstractFunction(0x200) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + final L2Character c = ctx.character; + final CharacterInventory inv = c.getInventory(); + + if (inv.has(LEFT_FINGER)) + ctx.result -= 5; + if (inv.has(RIGHT_FINGER)) + ctx.result -= 5; + if (inv.has(LEFT_EAR)) + ctx.result -= 9; + if (inv.has(RIGHT_EAR)) + ctx.result -= 9; + if (inv.has(NECK)) + ctx.result -= 13; + + ctx.result *= BaseStats.MEN.calculateBonus(c.getStats() + .getMentality()) + * ((100.0 - 11 + c.getLevel()) / 100.0); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BaseMentalityCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BaseMentalityCalculator.java new file mode 100644 index 000000000..87077db85 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BaseMentalityCalculator.java @@ -0,0 +1,34 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + */ +public class BaseMentalityCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BaseMentalityCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getMentality(); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BasePhysicalAttackCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BasePhysicalAttackCalculator.java new file mode 100644 index 000000000..d8b28133e --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BasePhysicalAttackCalculator.java @@ -0,0 +1,44 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import com.l2jserver.model.world.L2Character; +import com.l2jserver.model.world.actor.stat.BaseStats; +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + * + */ +public class BasePhysicalAttackCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BasePhysicalAttackCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getPhysicalAttack(); + } + }, new AbstractFunction(0x100) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + final L2Character c = ctx.character; + ctx.result *= BaseStats.STR.calculateBonus(c.getStats() + .getStrength()) * ((100.0 - 11 + c.getLevel()) / 100.0); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BasePhysicalAttackSpeedCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BasePhysicalAttackSpeedCalculator.java new file mode 100644 index 000000000..345e25074 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BasePhysicalAttackSpeedCalculator.java @@ -0,0 +1,42 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import com.l2jserver.model.world.actor.stat.BaseStats; +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + * + */ +public class BasePhysicalAttackSpeedCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BasePhysicalAttackSpeedCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getAttackSpeed(); + } + }, new AbstractFunction(0x200) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result *= BaseStats.DEX.calculateBonus(ctx.character + .getStats().getDexterity()); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BasePhysicalCriticalRateCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BasePhysicalCriticalRateCalculator.java new file mode 100644 index 000000000..b7001057a --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BasePhysicalCriticalRateCalculator.java @@ -0,0 +1,47 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import com.l2jserver.model.world.L2Character; +import com.l2jserver.model.world.actor.stat.BaseStats; +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + */ +public class BasePhysicalCriticalRateCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BasePhysicalCriticalRateCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getCriticalChance(); + } + }, new AbstractFunction(0x090) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + final L2Character c = ctx.character; + + ctx.result *= BaseStats.DEX.calculateBonus(c.getStats() + .getDexterity()); + ctx.result *= 10; + + // TODO l2j uses another variable here, must check why + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BasePhysicalDefenseCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BasePhysicalDefenseCalculator.java new file mode 100644 index 000000000..007f29ce4 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BasePhysicalDefenseCalculator.java @@ -0,0 +1,69 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import static com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll.CHEST; +import static com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll.FEET; +import static com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll.GLOVES; +import static com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll.HEAD; +import static com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll.LEGS; + +import com.l2jserver.model.world.Item; +import com.l2jserver.model.world.L2Character; +import com.l2jserver.model.world.character.CharacterClass; +import com.l2jserver.model.world.character.CharacterClass.ClassType; +import com.l2jserver.model.world.character.CharacterInventory; +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + */ +public class BasePhysicalDefenseCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BasePhysicalDefenseCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getPhysicalDefense(); + } + }, new AbstractFunction(0x200) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + final L2Character c = ctx.character; + final CharacterInventory inv = c.getInventory(); + + // orc mystics are a special case + boolean hasMagePDef = (c.getCharacterClass().type == ClassType.MYSTIC || c + .getCharacterClass() == CharacterClass.ORC_MYSTIC); + + if (inv.has(HEAD)) + ctx.result -= 12; + final Item chest = inv.getItem(CHEST); + if (chest != null) + ctx.result -= hasMagePDef ? 15 : 31; + if (inv.has(LEGS)) + // FIXME full armor also applies here + ctx.result -= hasMagePDef ? 8 : 18; + if (inv.has(GLOVES)) + ctx.result -= 8; + if (inv.has(FEET)) + ctx.result -= 7; + ctx.result *= ((100.0 - 11 + c.getLevel()) / 100.0); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BaseRunSpeedCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BaseRunSpeedCalculator.java new file mode 100644 index 000000000..f68d78914 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BaseRunSpeedCalculator.java @@ -0,0 +1,42 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import com.l2jserver.model.world.actor.stat.BaseStats; +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + * + */ +public class BaseRunSpeedCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BaseRunSpeedCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getRunSpeed(); + } + }, new AbstractFunction(0x300) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result *= BaseStats.DEX.calculateBonus(ctx.character + .getStats().getDexterity()); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BaseStrengthCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BaseStrengthCalculator.java new file mode 100644 index 000000000..d2b2c9ca7 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BaseStrengthCalculator.java @@ -0,0 +1,34 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + */ +public class BaseStrengthCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BaseStrengthCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getStrength(); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BaseWalkSpeedCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BaseWalkSpeedCalculator.java new file mode 100644 index 000000000..450f67d99 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BaseWalkSpeedCalculator.java @@ -0,0 +1,42 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import com.l2jserver.model.world.actor.stat.BaseStats; +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + * + */ +public class BaseWalkSpeedCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BaseWalkSpeedCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getWalkSpeed(); + } + }, new AbstractFunction(0x300) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result *= BaseStats.DEX.calculateBonus(ctx.character + .getStats().getDexterity()); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/BaseWitnessCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/BaseWitnessCalculator.java new file mode 100644 index 000000000..0a4ff49d4 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/BaseWitnessCalculator.java @@ -0,0 +1,34 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import com.l2jserver.util.calculator.AbstractFunction; + +/** + * @author Rogiel + */ +public class BaseWitnessCalculator extends CharacterCalculator { + @SuppressWarnings("unchecked") + public BaseWitnessCalculator() { + super(new AbstractFunction(0x000) { + @Override + public void calculate(CharacterCalculatorContext ctx) { + ctx.result = ctx.character.getTemplate().getMentality(); + } + }); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/CharacterCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/CharacterCalculator.java new file mode 100644 index 000000000..e5cb8cdb4 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/CharacterCalculator.java @@ -0,0 +1,31 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import com.l2jserver.util.calculator.Calculator; +import com.l2jserver.util.calculator.Function; + +/** + * @author Rogiel + * + */ +public class CharacterCalculator extends Calculator { + public CharacterCalculator( + Function... functions) { + super(functions); + } +} diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/CharacterCalculatorContext.java b/src/main/java/com/l2jserver/model/world/character/calculator/CharacterCalculatorContext.java new file mode 100644 index 000000000..946fc56c6 --- /dev/null +++ b/src/main/java/com/l2jserver/model/world/character/calculator/CharacterCalculatorContext.java @@ -0,0 +1,36 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.world.character.calculator; + +import com.l2jserver.model.world.L2Character; +import com.l2jserver.model.world.actor.calculator.ActorCalculatorContext; + +/** + * @author Rogiel + * + */ +public class CharacterCalculatorContext extends ActorCalculatorContext { + /** + * The character instance + */ + public final L2Character character; + + public CharacterCalculatorContext(L2Character character) { + super(character); + this.character = character; + } +} diff --git a/src/main/java/com/l2jserver/service/ServiceModule.java b/src/main/java/com/l2jserver/service/ServiceModule.java index f43514a97..358ed5d9f 100644 --- a/src/main/java/com/l2jserver/service/ServiceModule.java +++ b/src/main/java/com/l2jserver/service/ServiceModule.java @@ -36,7 +36,7 @@ import com.l2jserver.service.game.npc.NPCServiceImpl; import com.l2jserver.service.game.pathing.MapperPathingService; import com.l2jserver.service.game.pathing.PathingService; import com.l2jserver.service.game.scripting.ScriptingService; -import com.l2jserver.service.game.scripting.PreCompiledScriptingService; +import com.l2jserver.service.game.scripting.ScriptingServiceImpl; import com.l2jserver.service.game.spawn.SpawnService; import com.l2jserver.service.game.spawn.SpawnServiceImpl; import com.l2jserver.service.game.template.ScriptTemplateService; @@ -78,7 +78,7 @@ public class ServiceModule extends AbstractModule { .in(Scopes.SINGLETON); bind(NetworkService.class).to(NettyNetworkService.class).in( Scopes.SINGLETON); - bind(ScriptingService.class).to(PreCompiledScriptingService.class).in( + bind(ScriptingService.class).to(ScriptingServiceImpl.class).in( Scopes.SINGLETON); bind(TemplateService.class).to(ScriptTemplateService.class).in( Scopes.SINGLETON); diff --git a/src/main/java/com/l2jserver/service/database/AbstractDAO.java b/src/main/java/com/l2jserver/service/database/AbstractDAO.java index f87e10f7b..6dbf0efd6 100644 --- a/src/main/java/com/l2jserver/service/database/AbstractDAO.java +++ b/src/main/java/com/l2jserver/service/database/AbstractDAO.java @@ -16,17 +16,23 @@ */ package com.l2jserver.service.database; +import java.util.Iterator; + import com.google.inject.Inject; import com.l2jserver.model.Model; import com.l2jserver.model.id.ID; /** * Abstract DAO implementations. Store an instance of {@link DatabaseService}. + * Default {@link Iterator} implementation in this class supports + * {@link Iterator#remove()} and will delete the row from the database. * * @author Rogiel * * @param * the dao object type + * @param + * the object id type */ public abstract class AbstractDAO, I extends ID> implements DataAccessObject { @@ -53,6 +59,39 @@ public abstract class AbstractDAO, I extends ID> return false; } + @Override + public Iterator iterator() { + return new Iterator() { + /** + * The Iterator that will return the ID objects + */ + private final Iterator iterator = AbstractDAO.this.selectIDs() + .iterator(); + /** + * The last used ID (will be used to remove the last element) + */ + private I lastID; + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public T next() { + lastID = iterator.next(); + if (lastID == null) + return null; + return select(lastID); + } + + @Override + public void remove() { + AbstractDAO.this.delete(select(lastID)); + } + }; + } + /** * @return the database service */ diff --git a/src/main/java/com/l2jserver/service/database/DataAccessObject.java b/src/main/java/com/l2jserver/service/database/DataAccessObject.java index dee8cf012..b49ce3afa 100644 --- a/src/main/java/com/l2jserver/service/database/DataAccessObject.java +++ b/src/main/java/com/l2jserver/service/database/DataAccessObject.java @@ -16,23 +16,32 @@ */ package com.l2jserver.service.database; +import java.util.Iterator; +import java.util.List; + import com.l2jserver.model.Model; import com.l2jserver.model.id.ID; import com.l2jserver.service.cache.IgnoreCaching; /** - * The DAO interface + * The Data Access Object interface used used to retrieve, save and remove + * objects from the database. The underlying storage engine can be an plain text + * file, SQL Database or an serialized version of the object. This layer will + * abstract the translation of the data and ease the transition from one engine + * to another. *

- * TODO make DAO an {@link Iterable}. So if we want to select all objects we can - * do like this:

- * for(final Object o : daoInstance) {
- * 	...
- * }
- * 
+ * Every DAO is also an {@link Iterable}. If you wish you can iterate through + * all objects in the database very abstractly. But please note that the default + * {@link Iterator} implementation in {@link AbstractDAO} will load all the + * {@link ID} objects and for every call {@link Iterator#next()}, a new database + * query will be made requesting the given object. In a large dataset, this + * could be a huge performance issue. DAO implementations are encouraged to + * override the iterator implementation with a more specific implementation. * * @author Rogiel */ -public interface DataAccessObject, I extends ID> { +public interface DataAccessObject, I extends ID> extends + Iterable { /** * Load the instance represented by id from the database * @@ -41,6 +50,14 @@ public interface DataAccessObject, I extends ID> { */ O select(I id); + /** + * Loads an List of all {@link ID}s in the database + * + * @return the list containing all {@link ID} objects + */ + @IgnoreCaching + List selectIDs(); + /** * Save the instance to the database. If a new database entry was created * returns true. diff --git a/src/main/java/com/l2jserver/service/database/MySQLDatabaseService.java b/src/main/java/com/l2jserver/service/database/MySQLDatabaseService.java index e5559b3d5..587720b4c 100644 --- a/src/main/java/com/l2jserver/service/database/MySQLDatabaseService.java +++ b/src/main/java/com/l2jserver/service/database/MySQLDatabaseService.java @@ -41,9 +41,10 @@ import org.slf4j.LoggerFactory; import com.google.common.base.Preconditions; import com.google.inject.Inject; -import com.l2jserver.model.id.ObjectID; +import com.l2jserver.model.Model; +import com.l2jserver.model.Model.ObjectState; +import com.l2jserver.model.id.ID; import com.l2jserver.model.id.object.allocator.IDAllocator; -import com.l2jserver.model.world.WorldObject; import com.l2jserver.service.AbstractService; import com.l2jserver.service.AbstractService.Depends; import com.l2jserver.service.ServiceStartException; @@ -268,6 +269,11 @@ public class MySQLDatabaseService extends AbstractService implements final PreparedStatement st = conn.prepareStatement(query()); this.parametize(st, object); rows += st.executeUpdate(); + + // update object state + if (object instanceof Model) + ((Model) object).setObjectState(ObjectState.STORED); + final Mapper mapper = keyMapper(object); if (mapper == null) continue; @@ -330,8 +336,11 @@ public class MySQLDatabaseService extends AbstractService implements final ResultSet rs = st.getResultSet(); while (rs.next()) { final T obj = mapper().map(rs); - if (obj != null) - list.add(obj); + if (obj == null) + continue; + if (obj instanceof Model) + ((Model) obj).setObjectState(ObjectState.STORED); + list.add(obj); } return list; } @@ -385,7 +394,10 @@ public class MySQLDatabaseService extends AbstractService implements st.execute(); final ResultSet rs = st.getResultSet(); while (rs.next()) { - return mapper().map(rs); + final T object = mapper().map(rs); + if (object instanceof Model) + ((Model) object).setObjectState(ObjectState.STORED); + return object; } return null; } @@ -456,27 +468,30 @@ public class MySQLDatabaseService extends AbstractService implements * @param * the id type */ - public abstract static class CachedMapper> + public abstract static class CachedMapper, I extends ID> implements Mapper { /** * The database service instance */ private final MySQLDatabaseService database; + private final Mapper idMapper; + /** * Creates a new instance * * @param database * the database service */ - public CachedMapper(MySQLDatabaseService database) { + public CachedMapper(MySQLDatabaseService database, Mapper idMapper) { this.database = database; + this.idMapper = idMapper; } @Override @SuppressWarnings("unchecked") public final T map(ResultSet rs) throws SQLException { - final I id = createID(rs); + final I id = idMapper.map(rs); Preconditions.checkNotNull(id, "id"); if (database.hasCachedObject(id)) @@ -488,16 +503,6 @@ public class MySQLDatabaseService extends AbstractService implements return object; } - /** - * Creates an ID for an object - * - * @param rs - * the jdbc result set - * @return the id - * @throws SQLException - */ - protected abstract I createID(ResultSet rs) throws SQLException; - /** * Maps an uncached object. Once mapping is complete, it will be added * to the cache. diff --git a/src/main/java/com/l2jserver/service/game/scripting/ScriptClassLoader.java b/src/main/java/com/l2jserver/service/game/scripting/ScriptClassLoader.java index d14cdbd29..30a7aa91e 100644 --- a/src/main/java/com/l2jserver/service/game/scripting/ScriptClassLoader.java +++ b/src/main/java/com/l2jserver/service/game/scripting/ScriptClassLoader.java @@ -31,7 +31,6 @@ import java.util.Set; * @author Rogiel */ public abstract class ScriptClassLoader extends URLClassLoader { - /** * Just for compatibility with {@link URLClassLoader} * diff --git a/src/main/java/com/l2jserver/service/game/scripting/ScriptCompiler.java b/src/main/java/com/l2jserver/service/game/scripting/ScriptCompiler.java index 4bfda891b..ff48d49ad 100644 --- a/src/main/java/com/l2jserver/service/game/scripting/ScriptCompiler.java +++ b/src/main/java/com/l2jserver/service/game/scripting/ScriptCompiler.java @@ -43,7 +43,7 @@ public interface ScriptCompiler { * @param files * list of jar files */ - void setLibraires(Iterable files); + void setLibraries(Iterable files); /** * Compiles single class that is represented as string @@ -51,10 +51,10 @@ public interface ScriptCompiler { * @param className * class name * @param sourceCode - * class sourse code + * class source code * @return {@link CompilationResult} */ - CompilationResult compile(String className, String sourceCode); + CompilationResult compile(String className, byte[] sourceCode); /** * Compiles classes that are represented as strings @@ -67,7 +67,7 @@ public interface ScriptCompiler { * @throws IllegalArgumentException * if number of class names != number of sources */ - CompilationResult compile(String[] className, String[] sourceCode) + CompilationResult compile(String[] className, byte[][] sourceCode) throws IllegalArgumentException; /** @@ -80,7 +80,7 @@ public interface ScriptCompiler { CompilationResult compile(Iterable compilationUnits); /** - * Returns array of supported file types. This files will be threated as + * Returns array of supported file types. This files will be treated as * source files. * * @return array of supported file types. diff --git a/src/main/java/com/l2jserver/service/game/scripting/PreCompiledScriptingService.java b/src/main/java/com/l2jserver/service/game/scripting/ScriptingServiceImpl.java similarity index 96% rename from src/main/java/com/l2jserver/service/game/scripting/PreCompiledScriptingService.java rename to src/main/java/com/l2jserver/service/game/scripting/ScriptingServiceImpl.java index 60188fc9f..8b709b752 100644 --- a/src/main/java/com/l2jserver/service/game/scripting/PreCompiledScriptingService.java +++ b/src/main/java/com/l2jserver/service/game/scripting/ScriptingServiceImpl.java @@ -48,13 +48,13 @@ import com.l2jserver.util.factory.CollectionFactory; * @author Rogiel */ @Depends(LoggingService.class) -public class PreCompiledScriptingService extends AbstractService implements +public class ScriptingServiceImpl extends AbstractService implements ScriptingService { /** * Logger for script context */ private static final Logger log = LoggerFactory - .getLogger(PreCompiledScriptingService.class); + .getLogger(ScriptingServiceImpl.class); private final Injector injector; @@ -64,7 +64,7 @@ public class PreCompiledScriptingService extends AbstractService implements private final Set contexts = CollectionFactory.newSet(); @Inject - public PreCompiledScriptingService(Injector injector) { + public ScriptingServiceImpl(Injector injector) { this.injector = injector; } diff --git a/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/BinaryClass.java b/src/main/java/com/l2jserver/service/game/scripting/impl/BinaryClass.java similarity index 88% rename from src/main/java/com/l2jserver/service/game/scripting/impl/javacc/BinaryClass.java rename to src/main/java/com/l2jserver/service/game/scripting/impl/BinaryClass.java index 7bc0d90e2..d882e893b 100644 --- a/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/BinaryClass.java +++ b/src/main/java/com/l2jserver/service/game/scripting/impl/BinaryClass.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with l2jserver. If not, see . */ -package com.l2jserver.service.game.scripting.impl.javacc; +package com.l2jserver.service.game.scripting.impl; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -58,10 +58,25 @@ public class BinaryClass implements JavaFileObject { * @param name * class name */ - protected BinaryClass(String name) { + public BinaryClass(String name) { this.name = name; } + /** + * Constructor that accepts class name as parameter + * + * @param name + * class name + */ + public BinaryClass(String name, byte[] data) { + this.name = name; + try { + this.baos.write(data); + } catch (IOException e) { + throw new RuntimeException("Cannor write class data", e); + } + } + /** * Throws {@link UnsupportedOperationException} * diff --git a/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/ErrorListener.java b/src/main/java/com/l2jserver/service/game/scripting/impl/ErrorListener.java similarity index 91% rename from src/main/java/com/l2jserver/service/game/scripting/impl/javacc/ErrorListener.java rename to src/main/java/com/l2jserver/service/game/scripting/impl/ErrorListener.java index b837ca064..85a4ea507 100644 --- a/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/ErrorListener.java +++ b/src/main/java/com/l2jserver/service/game/scripting/impl/ErrorListener.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with l2jserver. If not, see . */ -package com.l2jserver.service.game.scripting.impl.javacc; +package com.l2jserver.service.game.scripting.impl; import java.util.Locale; @@ -26,7 +26,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * This class is simple compiler error listener that forwards errors to log4j + * This class is simple compiler error listener that forwards errors to slf4j * logger * * @author Rogiel @@ -40,7 +40,7 @@ public class ErrorListener implements DiagnosticListener { .getLogger(ErrorListener.class); /** - * Reports compilation errors to log4j + * Reports compilation errors to slf4j * * @param diagnostic * compiler errors diff --git a/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/JavaSourceFromString.java b/src/main/java/com/l2jserver/service/game/scripting/impl/JavaSourceFromByteArray.java similarity index 67% rename from src/main/java/com/l2jserver/service/game/scripting/impl/javacc/JavaSourceFromString.java rename to src/main/java/com/l2jserver/service/game/scripting/impl/JavaSourceFromByteArray.java index b7fbcce6f..033316a60 100644 --- a/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/JavaSourceFromString.java +++ b/src/main/java/com/l2jserver/service/game/scripting/impl/JavaSourceFromByteArray.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with l2jserver. If not, see . */ -package com.l2jserver.service.game.scripting.impl.javacc; +package com.l2jserver.service.game.scripting.impl; import java.net.URI; @@ -26,11 +26,11 @@ import javax.tools.SimpleJavaFileObject; * * @author Rogiel */ -public class JavaSourceFromString extends SimpleJavaFileObject { +public class JavaSourceFromByteArray extends SimpleJavaFileObject { /** * Source code of the class */ - private final String code; + private final byte[] code; /** * Creates new object that contains sources of java class @@ -40,13 +40,28 @@ public class JavaSourceFromString extends SimpleJavaFileObject { * @param code * source code of class */ - public JavaSourceFromString(String className, String code) { + public JavaSourceFromByteArray(String className, byte[] code) { super(URI.create("string:///" + className.replace('.', '/') + JavaFileObject.Kind.SOURCE.extension), JavaFileObject.Kind.SOURCE); this.code = code; } + /** + * Creates new object that contains sources of java class + * + * @param className + * class name of class + * @param code + * source code of class + */ + public JavaSourceFromByteArray(String className, byte[] code, + JavaFileObject.Kind kind) { + super(URI.create("string:///" + className.replace('.', '/') + + JavaFileObject.Kind.SOURCE.extension), kind); + this.code = code; + } + /** * Returns class source code * @@ -56,6 +71,6 @@ public class JavaSourceFromString extends SimpleJavaFileObject { */ @Override public CharSequence getCharContent(boolean ignoreEncodingErrors) { - return code; + return new String(code); } } diff --git a/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/JavaSourceFromFile.java b/src/main/java/com/l2jserver/service/game/scripting/impl/JavaSourceFromFile.java similarity index 93% rename from src/main/java/com/l2jserver/service/game/scripting/impl/javacc/JavaSourceFromFile.java rename to src/main/java/com/l2jserver/service/game/scripting/impl/JavaSourceFromFile.java index e6e962e39..01103e410 100644 --- a/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/JavaSourceFromFile.java +++ b/src/main/java/com/l2jserver/service/game/scripting/impl/JavaSourceFromFile.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with l2jserver. If not, see . */ -package com.l2jserver.service.game.scripting.impl.javacc; +package com.l2jserver.service.game.scripting.impl; import java.io.File; import java.io.IOException; @@ -30,7 +30,6 @@ import org.apache.commons.io.FileUtils; * @author Rogiel */ public class JavaSourceFromFile extends SimpleJavaFileObject { - /** * Construct a JavaFileObject of the given kind and with the given File. * diff --git a/src/main/java/com/l2jserver/service/game/scripting/impl/ScriptContextImpl.java b/src/main/java/com/l2jserver/service/game/scripting/impl/ScriptContextImpl.java index 24053f3df..74fa2b238 100644 --- a/src/main/java/com/l2jserver/service/game/scripting/impl/ScriptContextImpl.java +++ b/src/main/java/com/l2jserver/service/game/scripting/impl/ScriptContextImpl.java @@ -143,7 +143,7 @@ public class ScriptContextImpl implements ScriptContext { .getCompilationResult().getClassLoader()); } - scriptCompiler.setLibraires(libraries); + scriptCompiler.setLibraries(libraries); compilationResult = scriptCompiler.compile(files); getClassListener().postLoad(compilationResult.getCompiledClasses()); diff --git a/src/main/java/com/l2jserver/service/game/scripting/impl/compiled/PrecompiledScriptClassLoader.java b/src/main/java/com/l2jserver/service/game/scripting/impl/compiled/PrecompiledScriptClassLoader.java new file mode 100644 index 000000000..13df5b5cd --- /dev/null +++ b/src/main/java/com/l2jserver/service/game/scripting/impl/compiled/PrecompiledScriptClassLoader.java @@ -0,0 +1,137 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.service.game.scripting.impl.compiled; + +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.util.Collections; +import java.util.Map; +import java.util.Set; + +import org.apache.commons.io.FileUtils; + +import com.l2jserver.service.game.scripting.ScriptClassLoader; +import com.l2jserver.util.factory.CollectionFactory; + +/** + * This classloader is used to load script classes.
+ *
+ * Due to JavaCompiler limitations we have to keep list of available classes + * here. + * + * @author Rogiel + */ +public class PrecompiledScriptClassLoader extends ScriptClassLoader { + /** + * Map of all loaded classes + */ + private final Map> classes = CollectionFactory.newMap(); + + /** + * Creates new ScriptClassLoader with given ClassFileManger + */ + PrecompiledScriptClassLoader(final File root) { + super(new URL[] {}); + } + + /** + * Creates new ScriptClassLoader with given ClassFileManger and another + * classLoader as parent + * + * @param parent + * parent classLoader + */ + PrecompiledScriptClassLoader(ClassLoader parent) { + super(new URL[] {}, parent); + } + + /** + * AddsLibrary jar + * + * @param file + * jar file to add + * @throws IOException + */ + @Override + public void addLibrary(File file) throws IOException { + } + + /** + * Loads class from library, parent or compiled + * + * @param name + * class to load + * @param file + * the class file + * @return loaded class + * @throws ClassNotFoundException + * if class not found + * @throws IOException + */ + public Class loadClass(File file) throws ClassNotFoundException, + IOException { + byte[] b = FileUtils.readFileToByteArray(file); + Class c = super.defineClass(null, b, 0, b.length); + classes.put(c.getName(), c); + return c; + } + + @Override + public synchronized Class loadClass(String name, boolean resolve) + throws ClassNotFoundException { + final File file = new File("target/templates"); + final File classFile = new File(file, name.replaceAll("\\.", "/") + + ".class"); + System.out.println(name + " -> " + classFile); + if (!classFile.exists()) { + System.out.println("super"); + return super.loadClass(name, resolve); + } else if (classes.containsKey(name)) { + return classes.get(name); + } else { + try { + byte[] b = FileUtils.readFileToByteArray(classFile); + System.out.println("Defining..."); + Class c = super.defineClass(null, b, 0, b.length); + classes.put(c.getName(), c); + System.out.println(c.getName()); + + return c; + } catch (IOException e) { + e.printStackTrace(); + return null; + } + } + } + + /** + * {@inheritDoc} + */ + @Override + public Set getLibraryClasses() { + return Collections.emptySet(); + } + + /** + * {@inheritDoc} + */ + @Override + public Set getCompiledClasses() { + return Collections.unmodifiableSet(classes.keySet()); + } +} diff --git a/src/main/java/com/l2jserver/service/game/scripting/impl/compiled/PrecompiledScriptCompiler.java b/src/main/java/com/l2jserver/service/game/scripting/impl/compiled/PrecompiledScriptCompiler.java new file mode 100644 index 000000000..a705058ed --- /dev/null +++ b/src/main/java/com/l2jserver/service/game/scripting/impl/compiled/PrecompiledScriptCompiler.java @@ -0,0 +1,93 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.service.game.scripting.impl.compiled; + +import java.io.File; +import java.io.IOException; +import java.util.List; + +import com.l2jserver.service.game.scripting.CompilationResult; +import com.l2jserver.service.game.scripting.ScriptClassLoader; +import com.l2jserver.service.game.scripting.ScriptCompiler; +import com.l2jserver.util.factory.CollectionFactory; + +/** + * Wrapper for JavaCompiler api + * + * @author Rogiel + */ +public class PrecompiledScriptCompiler implements ScriptCompiler { + /** + * Parent classloader that has to be used for this compiler + */ + protected ScriptClassLoader parentClassLoader; + + public PrecompiledScriptCompiler() { + } + + @Override + public void setParentClassLoader(ScriptClassLoader classLoader) { + parentClassLoader = classLoader; + } + + @Override + public void setLibraries(Iterable files) { + // do nothing + } + + @Override + public CompilationResult compile(String className, byte[] sourceCode) { + throw new UnsupportedOperationException( + "This compiler cannot compile from source"); + } + + @Override + public CompilationResult compile(String[] className, byte[][] sourceCode) + throws IllegalArgumentException { + throw new UnsupportedOperationException( + "This compiler cannot compile from source"); + } + + @Override + public CompilationResult compile(Iterable compilationUnits) { + final PrecompiledScriptClassLoader cl = new PrecompiledScriptClassLoader( + this.getClass().getClassLoader()); + final List> classes = CollectionFactory.newList(); + for (final File file : compilationUnits) { + try { + classes.add(cl.loadClass(file)); + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + return new CompilationResult(classes.toArray(new Class[classes + .size()]), cl); + } + + /** + * Only class files are supported by this compiler + * + * @return "class"; + */ + @Override + public String[] getSupportedFileTypes() { + return new String[] { "class" }; + } +} diff --git a/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/ClassFileManager.java b/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/ClassFileManager.java index eb3f69d3c..571b31e01 100644 --- a/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/ClassFileManager.java +++ b/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/ClassFileManager.java @@ -34,6 +34,7 @@ import javax.tools.JavaFileObject.Kind; import javax.tools.StandardLocation; import com.l2jserver.service.game.scripting.ScriptClassLoader; +import com.l2jserver.service.game.scripting.impl.BinaryClass; import com.l2jserver.util.factory.CollectionFactory; /** diff --git a/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/ScriptClassLoaderImpl.java b/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/ScriptClassLoaderImpl.java index baaee9090..93c382706 100644 --- a/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/ScriptClassLoaderImpl.java +++ b/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/ScriptClassLoaderImpl.java @@ -35,6 +35,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.l2jserver.service.game.scripting.ScriptClassLoader; +import com.l2jserver.service.game.scripting.impl.BinaryClass; import com.l2jserver.util.ClassUtils; import com.l2jserver.util.factory.CollectionFactory; diff --git a/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/ScriptCompilerImpl.java b/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/ScriptCompilerImpl.java index 30092bf07..21c3629e3 100644 --- a/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/ScriptCompilerImpl.java +++ b/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/ScriptCompilerImpl.java @@ -33,6 +33,9 @@ import org.slf4j.LoggerFactory; import com.l2jserver.service.game.scripting.CompilationResult; import com.l2jserver.service.game.scripting.ScriptClassLoader; import com.l2jserver.service.game.scripting.ScriptCompiler; +import com.l2jserver.service.game.scripting.impl.ErrorListener; +import com.l2jserver.service.game.scripting.impl.JavaSourceFromByteArray; +import com.l2jserver.service.game.scripting.impl.JavaSourceFromFile; import com.l2jserver.util.factory.CollectionFactory; /** @@ -41,7 +44,6 @@ import com.l2jserver.util.factory.CollectionFactory; * @author Rogiel */ public class ScriptCompilerImpl implements ScriptCompiler { - /** * Logger for this class */ @@ -99,7 +101,7 @@ public class ScriptCompilerImpl implements ScriptCompiler { * list of jar files */ @Override - public void setLibraires(Iterable files) { + public void setLibraries(Iterable files) { libraries = files; } @@ -115,8 +117,8 @@ public class ScriptCompilerImpl implements ScriptCompiler { * if compilation failed with errros */ @Override - public CompilationResult compile(String className, String sourceCode) { - return compile(new String[] { className }, new String[] { sourceCode }); + public CompilationResult compile(String className, byte[] sourceCode) { + return compile(new String[] { className }, new byte[][] { sourceCode }); } /** @@ -134,7 +136,7 @@ public class ScriptCompilerImpl implements ScriptCompiler { * if compilation failed with errros */ @Override - public CompilationResult compile(String[] classNames, String[] sourceCode) + public CompilationResult compile(String[] classNames, byte[][] sourceCode) throws IllegalArgumentException { if (classNames.length != sourceCode.length) { @@ -145,7 +147,7 @@ public class ScriptCompilerImpl implements ScriptCompiler { List compilationUnits = CollectionFactory.newList(); for (int i = 0; i < classNames.length; i++) { - JavaFileObject compilationUnit = new JavaSourceFromString( + JavaFileObject compilationUnit = new JavaSourceFromByteArray( classNames[i], sourceCode[i]); compilationUnits.add(compilationUnit); } @@ -212,7 +214,7 @@ public class ScriptCompilerImpl implements ScriptCompiler { } /** - * Reolves list of classes by their names + * Resolves list of classes by their names * * @param classNames * names of the classes diff --git a/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/VirtualClassURLConnection.java b/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/VirtualClassURLConnection.java index 3b1787a3a..2b50fe402 100644 --- a/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/VirtualClassURLConnection.java +++ b/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/VirtualClassURLConnection.java @@ -22,6 +22,8 @@ import java.io.InputStream; import java.net.URL; import java.net.URLConnection; +import com.l2jserver.service.game.scripting.impl.BinaryClass; + /** * This class represents URL Connection that is used to "connect" to scripts * binary data that was loaded by specified {@link ScriptCompilerImpl}.
diff --git a/src/main/java/com/l2jserver/service/game/world/CachedWorldIDService.java b/src/main/java/com/l2jserver/service/game/world/CachedWorldIDService.java index 182a3e03a..b5530f788 100644 --- a/src/main/java/com/l2jserver/service/game/world/CachedWorldIDService.java +++ b/src/main/java/com/l2jserver/service/game/world/CachedWorldIDService.java @@ -82,7 +82,8 @@ public class CachedWorldIDService extends AbstractService implements @Inject public CachedWorldIDService(CacheService cacheService, - IDAllocator allocator, CharacterDAO characterDao, ItemDAO itemDao, NPCDAO npcDao) { + IDAllocator allocator, CharacterDAO characterDao, ItemDAO itemDao, + NPCDAO npcDao) { this.cacheService = cacheService; this.allocator = allocator; this.characterDao = characterDao; @@ -103,9 +104,9 @@ public class CachedWorldIDService extends AbstractService implements @Override public void load() { - load(characterDao.listIDs()); - load(itemDao.listIDs()); - //load(npcDao.listIDs()); + load(characterDao.selectIDs()); + load(itemDao.selectIDs()); + load(npcDao.selectIDs()); loaded = true; } diff --git a/src/main/java/com/l2jserver/util/calculator/AbstractFunction.java b/src/main/java/com/l2jserver/util/calculator/AbstractFunction.java new file mode 100644 index 000000000..72d66dcfa --- /dev/null +++ b/src/main/java/com/l2jserver/util/calculator/AbstractFunction.java @@ -0,0 +1,36 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.util.calculator; + +/** + * @author Rogiel + * + */ +public abstract class AbstractFunction implements + Function { + private final int order; + + public AbstractFunction(int order) { + this.order = order; + } + + @Override + public int order() { + return order; + } + +} diff --git a/src/main/java/com/l2jserver/util/calculator/Calculator.java b/src/main/java/com/l2jserver/util/calculator/Calculator.java index 357cad207..e8b6b5296 100644 --- a/src/main/java/com/l2jserver/util/calculator/Calculator.java +++ b/src/main/java/com/l2jserver/util/calculator/Calculator.java @@ -16,8 +16,8 @@ */ package com.l2jserver.util.calculator; -import java.util.Arrays; import java.util.Collections; +import java.util.Comparator; import java.util.List; import com.l2jserver.util.factory.CollectionFactory; @@ -28,18 +28,19 @@ import com.l2jserver.util.factory.CollectionFactory; * * @author Rogiel */ -public class Calculator implements Function { +public class Calculator extends + AbstractFunction { /** * List of operations in this calculator */ - private final List functions = CollectionFactory - .newList(); + private final List> functions = CollectionFactory.newList(); /** * Creates a new empty calculator. Functions can be add using * {@link #add(int, Function)}. */ public Calculator() { + super(0x00); } /** @@ -49,9 +50,10 @@ public class Calculator implements Function { * @param functions * the calculator functions */ - public Calculator(Function... functions) { - for (int i = 0; i < functions.length; i++) { - this.functions.add(new FunctionContainer(i, functions[i])); + public Calculator(Function... functions) { + super(0x00); + for (final Function func : functions) { + this.functions.add(func); } } @@ -66,14 +68,14 @@ public class Calculator implements Function { * @param function * the operation */ - public void add(int order, Function function) { - functions.add(new FunctionContainer(order, function)); - Collections.sort(functions); + public void add(Function function) { + functions.add(function); + Collections.sort(functions, FunctionOrderComparator.SHARED_INSTANCE); } /** - * Imports all functions in the given calculator. This is useful to - * preserve right calculation ordering but changes to original + * Imports all functions from the given calculator. This is useful + * to preserve right calculation ordering but changes to original * calculator will no reflect in this one. *

* This method will heuristically search for nested calculators. @@ -81,101 +83,48 @@ public class Calculator implements Function { * @param calculator * the calculator */ - public void importFunctions(Calculator calculator) { - for (final FunctionContainer container : calculator.functions) { - if (container.function instanceof Calculator) { - importFunctions((Calculator) container.function); + public void importFunctions(Calculator calculator) { + for (final Function function : calculator.functions) { + if (function instanceof Calculator) { + importFunctions((Calculator) function); } else { - functions.add(container); + functions.add(function); } } } /** - * Computes the result and output it. Input value is 0. + * Removes all imported functions from the given calculator. + *

+ * This method will heuristically search for nested calculators. * - * @return the computed value - * @see #calculate(Double) + * @param calculator + * the calculator */ - public double calculate() { - return calculate(0.00); + public void removeFunctions(Calculator calculator) { + for (final Function function : calculator.functions) { + if (function instanceof Calculator) { + removeFunctions((Calculator) function); + } else { + functions.remove(function); + } + } } @Override - public Double calculate(Double input) { - double result = input; - for (final FunctionContainer container : functions) { - result = container.function.calculate(result); + public void calculate(T ctx) { + for (final Function function : functions) { + function.calculate(ctx); } - return result; } - /** - *

-- Internal use only --

Container used to sort calculator - * functions. This class implements {@link Comparable} and can be used to - * sort lists using {@link Collections#sort(List)} or - * {@link Arrays#sort(Object[])}. - * - * @author Rogiel - */ - private static class FunctionContainer implements - Comparable { - /** - * The execution order - */ - protected final int order; - /** - * The function object - */ - protected final Function function; - - /** - * Creates a new instance - * - * @param order - * the execution order - * @param function - * the function - */ - public FunctionContainer(int order, Function function) { - this.order = order; - this.function = function; - } + public static class FunctionOrderComparator implements + Comparator> { + public static final FunctionOrderComparator SHARED_INSTANCE = new FunctionOrderComparator(); @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result - + ((function == null) ? 0 : function.hashCode()); - result = prime * result + order; - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - FunctionContainer other = (FunctionContainer) obj; - if (function == null) { - if (other.function != null) - return false; - } else if (!function.equals(other.function)) - return false; - if (order != other.order) - return false; - return true; - } - - @Override - public int compareTo(FunctionContainer o) { - if (this.equals(o)) - return 0; - return this.order - o.order; + public int compare(Function func1, Function func2) { + return (func1.order() - func2.order()); } } } \ No newline at end of file diff --git a/src/main/java/com/l2jserver/util/calculator/CalculatorContext.java b/src/main/java/com/l2jserver/util/calculator/CalculatorContext.java new file mode 100644 index 000000000..47b11ce1f --- /dev/null +++ b/src/main/java/com/l2jserver/util/calculator/CalculatorContext.java @@ -0,0 +1,25 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.util.calculator; + +/** + * @author Rogiel + * + */ +public class CalculatorContext { + public double result; +} diff --git a/src/main/java/com/l2jserver/util/calculator/DivisionFunction.java b/src/main/java/com/l2jserver/util/calculator/DivisionFunction.java index cf0ebea85..5a0351b32 100644 --- a/src/main/java/com/l2jserver/util/calculator/DivisionFunction.java +++ b/src/main/java/com/l2jserver/util/calculator/DivisionFunction.java @@ -22,18 +22,19 @@ package com.l2jserver.util.calculator; * * @author Rogiel */ -public class DivisionFunction implements Function { +public class DivisionFunction extends AbstractFunction { /** * The value */ private final double value; - public DivisionFunction(double value) { + public DivisionFunction(int order, double value) { + super(order); this.value = value; } @Override - public Double calculate(Double value) { - return value / this.value; + public void calculate(CalculatorContext ctx) { + ctx.result /= this.value; } } diff --git a/src/main/java/com/l2jserver/util/calculator/Function.java b/src/main/java/com/l2jserver/util/calculator/Function.java index e0ed0fce5..442a56397 100644 --- a/src/main/java/com/l2jserver/util/calculator/Function.java +++ b/src/main/java/com/l2jserver/util/calculator/Function.java @@ -21,7 +21,7 @@ package com.l2jserver.util.calculator; * * @author Rogiel */ -public interface Function { +public interface Function { /** * Performs the operation in the calculation process. *

@@ -33,5 +33,10 @@ public interface Function { * the input value * @return the output value */ - T calculate(T value); + void calculate(T ctx); + + /** + * @return the order this function will be executed + */ + int order(); } diff --git a/src/main/java/com/l2jserver/util/calculator/ModulusFunction.java b/src/main/java/com/l2jserver/util/calculator/ModulusFunction.java index 3908b0a93..be064fec7 100644 --- a/src/main/java/com/l2jserver/util/calculator/ModulusFunction.java +++ b/src/main/java/com/l2jserver/util/calculator/ModulusFunction.java @@ -22,11 +22,14 @@ package com.l2jserver.util.calculator; * * @author Rogiel */ -public class ModulusFunction implements Function { +public class ModulusFunction extends AbstractFunction { + public ModulusFunction(int order) { + super(order); + } + @Override - public Double calculate(Double value) { - if (value < 0) - return value * -1; - return value; + public void calculate(CalculatorContext ctx) { + if (ctx.result < 0) + ctx.result *= -1; } } diff --git a/src/main/java/com/l2jserver/util/calculator/MultiplicationFunction.java b/src/main/java/com/l2jserver/util/calculator/MultiplicationFunction.java index 99b8a26e5..2ff5995aa 100644 --- a/src/main/java/com/l2jserver/util/calculator/MultiplicationFunction.java +++ b/src/main/java/com/l2jserver/util/calculator/MultiplicationFunction.java @@ -22,18 +22,19 @@ package com.l2jserver.util.calculator; * * @author Rogiel */ -public class MultiplicationFunction implements Function { +public class MultiplicationFunction extends AbstractFunction { /** * The value */ private final double value; - public MultiplicationFunction(double value) { + public MultiplicationFunction(int order, double value) { + super(order); this.value = value; } @Override - public Double calculate(Double value) { - return value * this.value; + public void calculate(CalculatorContext ctx) { + ctx.result *= this.value; } } diff --git a/src/main/java/com/l2jserver/util/calculator/NegateFunction.java b/src/main/java/com/l2jserver/util/calculator/NegateFunction.java index 6edb4c3ff..712e501fb 100644 --- a/src/main/java/com/l2jserver/util/calculator/NegateFunction.java +++ b/src/main/java/com/l2jserver/util/calculator/NegateFunction.java @@ -22,9 +22,13 @@ package com.l2jserver.util.calculator; * * @author Rogiel */ -public class NegateFunction implements Function { +public class NegateFunction extends AbstractFunction { + public NegateFunction(int order) { + super(order); + } + @Override - public Double calculate(Double value) { - return -value; + public void calculate(CalculatorContext ctx) { + ctx.result = -ctx.result; } } diff --git a/src/main/java/com/l2jserver/util/calculator/PercentFunction.java b/src/main/java/com/l2jserver/util/calculator/PercentFunction.java index 8cca8aee0..68dd000a5 100644 --- a/src/main/java/com/l2jserver/util/calculator/PercentFunction.java +++ b/src/main/java/com/l2jserver/util/calculator/PercentFunction.java @@ -26,7 +26,7 @@ public class PercentFunction extends MultiplicationFunction { /** * The value */ - public PercentFunction(double value) { - super(value / 100); + public PercentFunction(int order, double value) { + super(order, value / 100); } } diff --git a/src/main/java/com/l2jserver/util/calculator/RoundFunction.java b/src/main/java/com/l2jserver/util/calculator/RoundFunction.java index f3d4d48c0..ec065c488 100644 --- a/src/main/java/com/l2jserver/util/calculator/RoundFunction.java +++ b/src/main/java/com/l2jserver/util/calculator/RoundFunction.java @@ -21,9 +21,13 @@ package com.l2jserver.util.calculator; * * @author Rogiel */ -public class RoundFunction implements Function { +public class RoundFunction extends AbstractFunction { + public RoundFunction(int order) { + super(order); + } + @Override - public Double calculate(Double value) { - return (double) Math.round(value); + public void calculate(CalculatorContext ctx) { + ctx.result = Math.round(ctx.result); } } diff --git a/src/main/java/com/l2jserver/util/calculator/SetFunction.java b/src/main/java/com/l2jserver/util/calculator/SetFunction.java index 9f89e0f6c..39a59235a 100644 --- a/src/main/java/com/l2jserver/util/calculator/SetFunction.java +++ b/src/main/java/com/l2jserver/util/calculator/SetFunction.java @@ -17,23 +17,23 @@ package com.l2jserver.util.calculator; /** - * This function performs an set. It ignores the input value and return its - * own. + * This function performs an set. It ignores the input value and return its own. * * @author Rogiel */ -public class SetFunction implements Function { +public class SetFunction extends AbstractFunction { /** * The value */ private final double value; - public SetFunction(double value) { + public SetFunction(int order, double value) { + super(order); this.value = value; } @Override - public Double calculate(Double value) { - return this.value; + public void calculate(CalculatorContext ctx) { + ctx.result = value; } } diff --git a/src/main/java/com/l2jserver/util/calculator/SubtractFunction.java b/src/main/java/com/l2jserver/util/calculator/SubtractFunction.java index 929601365..d5489402c 100644 --- a/src/main/java/com/l2jserver/util/calculator/SubtractFunction.java +++ b/src/main/java/com/l2jserver/util/calculator/SubtractFunction.java @@ -22,18 +22,19 @@ package com.l2jserver.util.calculator; * * @author Rogiel */ -public class SubtractFunction implements Function { +public class SubtractFunction extends AbstractFunction { /** * The value */ private final double value; - public SubtractFunction(double value) { + public SubtractFunction(int order, double value) { + super(order); this.value = value; } @Override - public Double calculate(Double value) { - return value - this.value; + public void calculate(CalculatorContext ctx) { + ctx.result -= value; } } diff --git a/src/main/java/com/l2jserver/util/calculator/SumFunction.java b/src/main/java/com/l2jserver/util/calculator/SumFunction.java index 7b5c2166d..9c8e83075 100644 --- a/src/main/java/com/l2jserver/util/calculator/SumFunction.java +++ b/src/main/java/com/l2jserver/util/calculator/SumFunction.java @@ -22,18 +22,19 @@ package com.l2jserver.util.calculator; * * @author Rogiel */ -public class SumFunction implements Function { +public class SumFunction extends AbstractFunction { /** * The value */ private final double value; - public SumFunction(double value) { + public SumFunction(int order, double value) { + super(order); this.value = value; } @Override - public Double calculate(Double value) { - return value + this.value; + public void calculate(CalculatorContext ctx) { + ctx.result += value; } } diff --git a/src/test/java/com/l2jserver/model/world/character/CharacterFriendListTest.java b/src/test/java/com/l2jserver/model/world/character/CharacterFriendListTest.java index 4c98f02b8..269612717 100644 --- a/src/test/java/com/l2jserver/model/world/character/CharacterFriendListTest.java +++ b/src/test/java/com/l2jserver/model/world/character/CharacterFriendListTest.java @@ -25,6 +25,7 @@ import com.google.inject.Guice; import com.google.inject.Injector; import com.l2jserver.db.dao.CharacterFriendDAO; import com.l2jserver.db.dao.MySQL5DAOModule; +import com.l2jserver.model.game.CharacterFriend; import com.l2jserver.model.id.object.CharacterID; import com.l2jserver.model.id.object.provider.CharacterIDProvider; import com.l2jserver.model.id.provider.IDProviderModule; @@ -55,7 +56,7 @@ public class CharacterFriendListTest { .getInstance(CharacterFriendDAO.class); friendDao.load(character); - for (final L2Character friend : character.getFriendList()) { + for (final CharacterFriend friend : character.getFriendList()) { Assert.assertNotNull(friend); Assert.assertNotSame(friend.getID(), character.getID()); Assert.assertFalse(friend.getID().equals(character.getID())); diff --git a/src/test/java/com/l2jserver/service/game/scripting/ScriptingServiceImplTest.java b/src/test/java/com/l2jserver/service/game/scripting/ScriptingServiceImplTest.java index ed00a56cd..1fbd164ae 100644 --- a/src/test/java/com/l2jserver/service/game/scripting/ScriptingServiceImplTest.java +++ b/src/test/java/com/l2jserver/service/game/scripting/ScriptingServiceImplTest.java @@ -33,7 +33,7 @@ public class ScriptingServiceImplTest { .createInjector(new AbstractModule() { @Override protected void configure() { - bind(ScriptingService.class).to(PreCompiledScriptingService.class) + bind(ScriptingService.class).to(ScriptingServiceImpl.class) .in(Scopes.SINGLETON); } }); diff --git a/src/test/java/com/l2jserver/service/game/scripting/impl/compiled/PrecompiledScriptCompilerTest.java b/src/test/java/com/l2jserver/service/game/scripting/impl/compiled/PrecompiledScriptCompilerTest.java new file mode 100644 index 000000000..26488b60c --- /dev/null +++ b/src/test/java/com/l2jserver/service/game/scripting/impl/compiled/PrecompiledScriptCompilerTest.java @@ -0,0 +1,43 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.service.game.scripting.impl.compiled; + +import java.io.File; + +import org.apache.commons.io.FileUtils; +import org.junit.Test; + +import com.l2jserver.service.game.scripting.CompilationResult; + +/** + * @author Rogiel + * + */ +public class PrecompiledScriptCompilerTest { + /** + * Test method for + * {@link com.l2jserver.service.game.scripting.impl.compiled.PrecompiledScriptCompiler#compile(java.lang.Iterable)} + * . + */ + @Test + public void testCompileIterableOfFile() { + final PrecompiledScriptCompiler compiler = new PrecompiledScriptCompiler(); + final CompilationResult result = compiler.compile(FileUtils.listFiles( + new File("target/scripts/script/template"), new String[] { "class" }, true)); + System.out.println(result.getCompiledClasses()[0]); + } +} diff --git a/src/test/java/com/l2jserver/service/world/WorldEventDispatcherImplTest.java b/src/test/java/com/l2jserver/service/world/WorldEventDispatcherImplTest.java index 875345101..aa3fec3ab 100644 --- a/src/test/java/com/l2jserver/service/world/WorldEventDispatcherImplTest.java +++ b/src/test/java/com/l2jserver/service/world/WorldEventDispatcherImplTest.java @@ -69,9 +69,9 @@ public class WorldEventDispatcherImplTest { @Test public void testListeners1() throws InterruptedException { - final L2Character character1 = new L2Character(null, null); + final L2Character character1 = new L2Character(null); character1.setID(cidFactory.createID()); - final L2Character character2 = new L2Character(null, null); + final L2Character character2 = new L2Character(null); character2.setID(cidFactory.createID()); final Item item1 = new Item(null); item1.setID(iidFactory.createID()); @@ -110,9 +110,9 @@ public class WorldEventDispatcherImplTest { @Test public void testListeners2() throws InterruptedException { - final L2Character character1 = new L2Character(null, null); + final L2Character character1 = new L2Character(null); character1.setID(cidFactory.createID()); - final L2Character character2 = new L2Character(null, null); + final L2Character character2 = new L2Character(null); character2.setID(cidFactory.createID()); final Item item1 = new Item(null); item1.setID(iidFactory.createID()); diff --git a/src/test/java/com/l2jserver/service/world/WorldServiceImplTest.java b/src/test/java/com/l2jserver/service/world/WorldServiceImplTest.java index 57fa3857e..471ea4969 100644 --- a/src/test/java/com/l2jserver/service/world/WorldServiceImplTest.java +++ b/src/test/java/com/l2jserver/service/world/WorldServiceImplTest.java @@ -57,28 +57,28 @@ public class WorldServiceImplTest { @Test public void testAdd() { - final L2Character character = new L2Character(null, null); + final L2Character character = new L2Character(null); world.add(character); } @Test public void testRemove() { - final L2Character character = new L2Character(null, null); + final L2Character character = new L2Character(null); world.add(character); world.remove(character); } @Test public void testContains() { - final L2Character character = new L2Character(null, null); + final L2Character character = new L2Character(null); world.add(character); Assert.assertTrue(world.contains(character)); } @Test public void testIterator() { - final L2Character character1 = new L2Character(null, null); - final L2Character character2 = new L2Character(null, null); + final L2Character character1 = new L2Character(null); + final L2Character character2 = new L2Character(null); final Item item1 = new Item(null); world.add(character1); world.add(character2); diff --git a/src/test/java/com/l2jserver/util/calculator/CalculatorTest.java b/src/test/java/com/l2jserver/util/calculator/CalculatorTest.java index 10f53477c..78f4ee459 100644 --- a/src/test/java/com/l2jserver/util/calculator/CalculatorTest.java +++ b/src/test/java/com/l2jserver/util/calculator/CalculatorTest.java @@ -27,112 +27,137 @@ import org.junit.Test; public class CalculatorTest { @Test public void testSimple() { - final Calculator calc = new Calculator(); + final Calculator calc = new Calculator(); - calc.add(0, new SetFunction(10)); - calc.add(1, new MultiplicationFunction(2)); - calc.add(2, new SetFunction(30)); + calc.add(new SetFunction(0, 10)); + calc.add(new MultiplicationFunction(1, 2)); + calc.add(new SetFunction(2, 30)); - Assert.assertEquals(30.0, calc.calculate()); + final CalculatorContext ctx = new CalculatorContext(); + calc.calculate(ctx); + Assert.assertEquals(30.0, ctx.result); } @Test public void testPercent() { - final Calculator calc = new Calculator(); + final Calculator calc = new Calculator(); - calc.add(0, new SetFunction(10)); - calc.add(1, new MultiplicationFunction(2)); - calc.add(2, new PercentFunction(75)); + calc.add(new SetFunction(0, 10)); + calc.add(new MultiplicationFunction(1, 2)); + calc.add(new PercentFunction(2, 75)); - Assert.assertEquals(15.0, calc.calculate()); + final CalculatorContext ctx = new CalculatorContext(); + calc.calculate(ctx); + Assert.assertEquals(15.0, ctx.result); } @Test public void testComplex() { - final Calculator calc = new Calculator(); + final Calculator calc = new Calculator(); - calc.add(0, new SetFunction(10)); - calc.add(1, new MultiplicationFunction(2)); - calc.add(2, new PercentFunction(75)); - calc.add(3, new SumFunction(3)); - calc.add(4, new SubtractFunction(8)); - calc.add(5, new DivisionFunction(2)); + calc.add(new SetFunction(0, 10)); + calc.add(new MultiplicationFunction(1, 2)); + calc.add(new PercentFunction(2, 75)); + calc.add(new SumFunction(3, 3)); + calc.add(new SubtractFunction(4, 8)); + calc.add(new DivisionFunction(5, 2)); - Assert.assertEquals(5.0, calc.calculate()); + final CalculatorContext ctx = new CalculatorContext(); + calc.calculate(ctx); + Assert.assertEquals(5.0, ctx.result); } @Test public void testNesting() { - final Calculator calc1 = new Calculator(); + final Calculator calc1 = new Calculator(); + final CalculatorContext ctx1 = new CalculatorContext(); - calc1.add(0, new SetFunction(10)); - calc1.add(1, new MultiplicationFunction(2)); - calc1.add(2, new PercentFunction(75)); - calc1.add(3, new SumFunction(3)); - calc1.add(4, new SubtractFunction(8)); - calc1.add(5, new DivisionFunction(2)); - Assert.assertEquals(5.0, calc1.calculate()); + calc1.add(new SetFunction(0, 10)); + calc1.add(new MultiplicationFunction(1, 2)); + calc1.add(new PercentFunction(2, 75)); + calc1.add(new SumFunction(3, 3)); + calc1.add(new SubtractFunction(4, 8)); + calc1.add(new DivisionFunction(5, 2)); - final Calculator calc2 = new Calculator(); + calc1.calculate(ctx1); + Assert.assertEquals(5.0, ctx1.result); - calc2.add(0, new MultiplicationFunction(2)); - calc2.add(1, new PercentFunction(75)); - calc2.add(2, new SumFunction(3)); - calc2.add(3, new SubtractFunction(8)); - calc2.add(4, new DivisionFunction(2)); - Assert.assertEquals(-2.5, calc2.calculate()); + final Calculator calc2 = new Calculator(); + final CalculatorContext ctx2 = new CalculatorContext(); - final Calculator calc3 = new Calculator(); - calc3.add(0, calc1); - calc3.add(1, calc2); + calc2.add(new MultiplicationFunction(0, 2)); + calc2.add(new PercentFunction(1, 75)); + calc2.add(new SumFunction(2, 3)); + calc2.add(new SubtractFunction(3, 8)); + calc2.add(new DivisionFunction(4, 2)); + + calc2.calculate(ctx2); + Assert.assertEquals(-2.5, ctx2.result); + + final Calculator calc3 = new Calculator(); + final CalculatorContext ctx3 = new CalculatorContext(); + calc3.add(calc1); + calc3.add(calc2); // this should be executed - calc2.add(5, new SumFunction(1)); - - Assert.assertEquals(2.25, calc3.calculate()); + calc2.add(new SumFunction(10, 1)); + + calc3.calculate(ctx3); + Assert.assertEquals(2.25, ctx3.result); } @Test public void testImporting() { - final Calculator calc1 = new Calculator(); + final Calculator calc1 = new Calculator(); + final CalculatorContext ctx1 = new CalculatorContext(); - calc1.add(0, new SetFunction(10)); - calc1.add(2, new MultiplicationFunction(2)); - calc1.add(4, new PercentFunction(75)); - calc1.add(6, new SumFunction(3)); - calc1.add(8, new SubtractFunction(8)); - calc1.add(10, new DivisionFunction(2)); - Assert.assertEquals(5.0, calc1.calculate()); + calc1.add(new SetFunction(0, 10)); + calc1.add(new MultiplicationFunction(2, 2)); + calc1.add(new PercentFunction(4, 75)); + calc1.add(new SumFunction(6, 3)); + calc1.add(new SubtractFunction(8, 8)); + calc1.add(new DivisionFunction(10, 2)); - final Calculator calc2 = new Calculator(); + calc1.calculate(ctx1); + Assert.assertEquals(5.0, ctx1.result); - calc2.add(1, new MultiplicationFunction(2)); - calc2.add(3, new PercentFunction(75)); - calc2.add(5, new SumFunction(3)); - calc2.add(7, new SubtractFunction(8)); - calc2.add(9, new DivisionFunction(2)); - Assert.assertEquals(-2.5, calc2.calculate()); + final Calculator calc2 = new Calculator(); + final CalculatorContext ctx2 = new CalculatorContext(); - final Calculator calc3 = new Calculator(); + calc2.add(new MultiplicationFunction(1, 2)); + calc2.add(new PercentFunction(3, 75)); + calc2.add(new SumFunction(5, 3)); + calc2.add(new SubtractFunction(7, 8)); + calc2.add(new DivisionFunction(9, 2)); + + calc2.calculate(ctx2); + Assert.assertEquals(-2.5, ctx2.result); + + final Calculator calc3 = new Calculator(); + final CalculatorContext ctx3 = new CalculatorContext(); calc3.importFunctions(calc1); calc3.importFunctions(calc2); // this should not be executed - calc2.add(5, new SumFunction(50)); + calc2.add(new SumFunction(11, 50)); - Assert.assertEquals(1.25, calc3.calculate()); + calc3.calculate(ctx3); + Assert.assertEquals(1.25, ctx3.result); } @Test public void testRounding() { - final Calculator calc1 = new Calculator(); + final Calculator calc = new Calculator(); - calc1.add(0, new MultiplicationFunction(2)); - calc1.add(1, new PercentFunction(75)); - calc1.add(2, new SumFunction(3)); - calc1.add(3, new SubtractFunction(8.1)); - calc1.add(4, new DivisionFunction(2)); - calc1.add(5, new RoundFunction()); - Assert.assertEquals(-3.0, calc1.calculate()); + calc.add(new MultiplicationFunction(0, 2)); + calc.add(new PercentFunction(1, 75)); + calc.add(new SumFunction(2, 3)); + calc.add(new SubtractFunction(3, 8.1)); + calc.add(new DivisionFunction(4, 2)); + calc.add(new RoundFunction(5)); + + final CalculatorContext ctx = new CalculatorContext(); + calc.calculate(ctx); + Assert.assertEquals(-3.0, ctx.result); } } diff --git a/src/tool/java/com/l2jserver/tool/conversor/chartemplate/CharacterTemplateBase.txt b/src/tool/java/com/l2jserver/tool/conversor/chartemplate/CharacterTemplateBase.txt index 0486260ca..b7d604c3a 100644 --- a/src/tool/java/com/l2jserver/tool/conversor/chartemplate/CharacterTemplateBase.txt +++ b/src/tool/java/com/l2jserver/tool/conversor/chartemplate/CharacterTemplateBase.txt @@ -27,6 +27,18 @@ public class ${javaClassName}Template extends ${parent}Template { @Inject public ${javaClassName}Template(CharacterTemplateIDProvider provider) { super(provider.createID(${ClassId}.id), ${ClassId}, Point.fromXYZ(${x}, ${y}, ${z})); + + this.hpBase = ${defaulthpbase}; + this.hpAdd = ${defaulthpadd}; + this.hpMultiplier = ${defaulthpmod}; + this.mpBase = ${defaultmpbase}; + this.mpAdd = ${defaultmpadd}; + this.mpMultiplier = ${defaultmpmod}; + this.cpBase = ${defaultcpbase}; + this.cpAdd = ${defaultcpadd}; + this.cpMultiplier = ${defaultcpmod}; + this.minimumLevel = ${class_lvl}; + // ATTRIBUTES attributes.intelligence = ${_INT}; attributes.strength = ${STR}; diff --git a/src/tool/java/com/l2jserver/tool/conversor/chartemplate/CharacterTemplateConverter.java b/src/tool/java/com/l2jserver/tool/conversor/chartemplate/CharacterTemplateConverter.java index 893507124..7844d2817 100644 --- a/src/tool/java/com/l2jserver/tool/conversor/chartemplate/CharacterTemplateConverter.java +++ b/src/tool/java/com/l2jserver/tool/conversor/chartemplate/CharacterTemplateConverter.java @@ -55,7 +55,8 @@ public class CharacterTemplateConverter { JDBC_USERNAME, JDBC_PASSWORD); try { final PreparedStatement st = conn - .prepareStatement("SELECT * FROM char_templates"); + .prepareStatement("SELECT * FROM char_templates " + + "LEFT JOIN lvlupgain ON (char_templates.Classid = lvlupgain.classid)"); try { st.execute(); final ResultSet rs = st.getResultSet();