1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2026-03-12 21:58:28 +00:00

Implements automatically generated template classes from XSD schemas

This commit is contained in:
2011-12-31 13:09:56 -02:00
parent 273b872d53
commit beea690568
3394 changed files with 15664 additions and 10012 deletions

View File

@@ -0,0 +1,38 @@
<component
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2 http://maven.apache.org/xsd/component-1.1.2.xsd">
<fileSets>
<fileSet>
<directory>${project.basedir}/distribution</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
<source>${project.build.directory}/${project.artifactId}-${project.version}.jar</source>
<outputDirectory>/</outputDirectory>
<destName>l2jserver2.jar</destName>
<fileMode>0755</fileMode>
</file>
<file>
<source>${project.build.directory}/${project.artifactId}-${project.version}-data.zip</source>
<outputDirectory>/</outputDirectory>
<destName>data.zip</destName>
</file>
</files>
<dependencySets>
<dependencySet>
<outputDirectory>/libs</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
<unpack>false</unpack>
<scope>runtime</scope>
<excludes>
<exclude>mysql:*</exclude>
<exclude>com.orientechnologies:*</exclude>
<exclude>com.h2database:*</exclude>
<exclude>org.apache.derby:*</exclude>
</excludes>
</dependencySet>
</dependencySets>
</component>

View File

@@ -1,42 +1,24 @@
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>derby-bin</id>
<formats>
<format>zip</format>
</formats>
<baseDirectory></baseDirectory>
<fileSets>
<fileSet>
<directory>${project.basedir}/distribution</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
<source>${project.build.directory}/${project.artifactId}-${project.version}.jar</source>
<outputDirectory>/</outputDirectory>
<destName>l2jserver2.jar</destName>
<fileMode>0755</fileMode>
</file>
<file>
<source>${project.build.directory}/${project.artifactId}-${project.version}-data.zip</source>
<outputDirectory>/</outputDirectory>
<destName>data.zip</destName>
</file>
</files>
<includeBaseDirectory>true</includeBaseDirectory>
<componentDescriptors>
<componentDescriptor>src/main/assembly/distribution-bin.xml</componentDescriptor>
</componentDescriptors>
<dependencySets>
<dependencySet>
<outputDirectory>/libs</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<useProjectArtifact>false</useProjectArtifact>
<unpack>false</unpack>
<scope>runtime</scope>
<excludes>
<exclude>mysql:*</exclude>
<exclude>com.h2database:*</exclude>
<exclude>com.orientechnologies:*</exclude>
</excludes>
<includes>
<include>org.apache.derby:*</include>
</includes>
</dependencySet>
</dependencySets>
</assembly>

View File

@@ -1,42 +1,24 @@
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>h2-bin</id>
<formats>
<format>zip</format>
</formats>
<baseDirectory></baseDirectory>
<fileSets>
<fileSet>
<directory>${project.basedir}/distribution</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
<source>${project.build.directory}/${project.artifactId}-${project.version}.jar</source>
<outputDirectory>/</outputDirectory>
<destName>l2jserver2.jar</destName>
<fileMode>0755</fileMode>
</file>
<file>
<source>${project.build.directory}/${project.artifactId}-${project.version}-data.zip</source>
<outputDirectory>/</outputDirectory>
<destName>data.zip</destName>
</file>
</files>
<includeBaseDirectory>true</includeBaseDirectory>
<componentDescriptors>
<componentDescriptor>src/main/assembly/distribution-bin.xml</componentDescriptor>
</componentDescriptors>
<dependencySets>
<dependencySet>
<outputDirectory>/libs</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<useProjectArtifact>false</useProjectArtifact>
<unpack>false</unpack>
<scope>runtime</scope>
<excludes>
<exclude>mysql:*</exclude>
<exclude>org.apache.derby:*</exclude>
<exclude>com.orientechnologies:*</exclude>
</excludes>
<includes>
<include>com.h2database:*</include>
</includes>
</dependencySet>
</dependencySets>
</assembly>

View File

@@ -1,42 +1,24 @@
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>mysql5-bin</id>
<formats>
<format>zip</format>
</formats>
<baseDirectory></baseDirectory>
<fileSets>
<fileSet>
<directory>${project.basedir}/distribution</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
<source>${project.build.directory}/${project.artifactId}-${project.version}.jar</source>
<outputDirectory>/</outputDirectory>
<destName>l2jserver2.jar</destName>
<fileMode>0755</fileMode>
</file>
<file>
<source>${project.build.directory}/${project.artifactId}-${project.version}-data.zip</source>
<outputDirectory>/</outputDirectory>
<destName>data.zip</destName>
</file>
</files>
<includeBaseDirectory>true</includeBaseDirectory>
<componentDescriptors>
<componentDescriptor>src/main/assembly/distribution-bin.xml</componentDescriptor>
</componentDescriptors>
<dependencySets>
<dependencySet>
<outputDirectory>/libs</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<useProjectArtifact>false</useProjectArtifact>
<unpack>false</unpack>
<scope>runtime</scope>
<excludes>
<exclude>com.h2database:*</exclude>
<exclude>org.apache.derby:*</exclude>
<exclude>com.orientechnologies:*</exclude>
</excludes>
<includes>
<include>mysql:*</include>
</includes>
</dependencySet>
</dependencySets>
</assembly>

View File

@@ -1,42 +1,24 @@
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>orientdb-bin</id>
<formats>
<format>zip</format>
</formats>
<baseDirectory></baseDirectory>
<fileSets>
<fileSet>
<directory>${project.basedir}/distribution</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
<source>${project.build.directory}/${project.artifactId}-${project.version}.jar</source>
<outputDirectory>/</outputDirectory>
<destName>l2jserver2.jar</destName>
<fileMode>0755</fileMode>
</file>
<file>
<source>${project.build.directory}/${project.artifactId}-${project.version}-data.zip</source>
<outputDirectory>/</outputDirectory>
<destName>data.zip</destName>
</file>
</files>
<includeBaseDirectory>true</includeBaseDirectory>
<componentDescriptors>
<componentDescriptor>src/main/assembly/distribution-bin.xml</componentDescriptor>
</componentDescriptors>
<dependencySets>
<dependencySet>
<outputDirectory>/libs</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<useProjectArtifact>false</useProjectArtifact>
<unpack>false</unpack>
<scope>runtime</scope>
<excludes>
<exclude>mysql:*</exclude>
<exclude>com.h2database:*</exclude>
<exclude>org.apache.derby:*</exclude>
</excludes>
<includes>
<include>com.orientechnologies:*</include>
</includes>
</dependencySet>
</dependencySets>
</assembly>

View File

@@ -1,7 +1,7 @@
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>data</id>
<formats>
<format>zip</format>

View File

@@ -1,7 +1,7 @@
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>src</id>
<formats>
<format>zip</format>

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jaxb:bindings version="2.1" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb">
<!--
This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4
See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
Any modifications to this file will be lost upon recompilation of the source schema.
Generated on: 2011.12.31 at 03:24:00 AM BRST
-->
<jaxb:bindings scd="x-schema::tns" xmlns:tns="http://schemas.l2jserver2.com/character">
<jaxb:schemaBindings map="false"/>
<jaxb:bindings scd="tns:character">
<jaxb:class ref="com.l2jserver.model.template.CharacterTemplate"/>
</jaxb:bindings>
</jaxb:bindings>
<jaxb:bindings scd="x-schema::tns" xmlns:tns="http://schemas.l2jserver2.com/skill">
<jaxb:schemaBindings map="false"/>
<jaxb:bindings scd="tns:skill">
<jaxb:class ref="com.l2jserver.model.template.SkillTemplate"/>
</jaxb:bindings>
</jaxb:bindings>
<jaxb:bindings scd="x-schema::">
<jaxb:schemaBindings map="false"/>
<jaxb:bindings scd="~CalculatorFunction">
<jaxb:class ref="com.l2jserver.model.template.CalculatorFunction"/>
</jaxb:bindings>
<jaxb:bindings scd="~AbstractTemplate">
<jaxb:class ref="com.l2jserver.model.template.AbstractTemplate"/>
</jaxb:bindings>
<jaxb:bindings scd="~Coordinate">
<jaxb:class ref="com.l2jserver.model.template.Coordinate"/>
</jaxb:bindings>
<jaxb:bindings scd="~ActorTemplate">
<jaxb:class ref="com.l2jserver.model.template.ActorTemplate"/>
</jaxb:bindings>
<jaxb:bindings scd="~CalculatorFunctionOperation">
<jaxb:class ref="com.l2jserver.model.template.CalculatorFunctionOperation"/>
</jaxb:bindings>
</jaxb:bindings>
<jaxb:bindings scd="x-schema::tns" xmlns:tns="zones">
<jaxb:schemaBindings map="false"/>
<jaxb:bindings scd="tns:zones">
<jaxb:class ref="com.l2jserver.model.template.Zones"/>
</jaxb:bindings>
<jaxb:bindings scd="~tns:ZoneType">
<jaxb:class ref="com.l2jserver.model.template.ZoneType"/>
</jaxb:bindings>
</jaxb:bindings>
<jaxb:bindings scd="x-schema::tns" xmlns:tns="http://schemas.l2jserver2.com/item">
<jaxb:schemaBindings map="false"/>
<jaxb:bindings scd="tns:item">
<jaxb:class ref="com.l2jserver.model.template.ItemTemplate"/>
</jaxb:bindings>
</jaxb:bindings>
<jaxb:bindings scd="x-schema::tns" xmlns:tns="http://schemas.l2jserver2.com/teleport">
<jaxb:schemaBindings map="false"/>
<jaxb:bindings scd="tns:teleports">
<jaxb:class ref="com.l2jserver.model.template.Teleports"/>
</jaxb:bindings>
</jaxb:bindings>
<jaxb:bindings scd="x-schema::tns" xmlns:tns="http://schemas.l2jserver2.com/npc">
<jaxb:schemaBindings map="false"/>
<jaxb:bindings scd="tns:npc">
<jaxb:class ref="com.l2jserver.model.template.NPCTemplate"/>
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>

View File

@@ -0,0 +1,48 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.12.31 at 03:24:00 AM BRST
//
package com.l2jserver.model.template;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for AbstractTemplate complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="AbstractTemplate">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AbstractTemplate")
@XmlSeeAlso({
ItemTemplate.class,
ActorTemplate.class,
SkillTemplate.class,
com.l2jserver.model.template.Teleports.Teleport.class
})
public abstract class AbstractTemplate
implements Template
{
}

View File

@@ -0,0 +1,44 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.12.31 at 03:24:00 AM BRST
//
package com.l2jserver.model.template;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for ActorTemplate complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="ActorTemplate">
* &lt;complexContent>
* &lt;extension base="{}AbstractTemplate">
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ActorTemplate")
@XmlSeeAlso({
CharacterTemplate.class,
NPCTemplate.class
})
public abstract class ActorTemplate
extends AbstractTemplate
{
}

View File

@@ -0,0 +1,148 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.12.31 at 03:24:00 AM BRST
//
package com.l2jserver.model.template;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for CalculatorFunction complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="CalculatorFunction">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="set" type="{}CalculatorFunctionOperation" minOccurs="0"/>
* &lt;element name="add" type="{}CalculatorFunctionOperation" minOccurs="0"/>
* &lt;element name="subtract" type="{}CalculatorFunctionOperation" minOccurs="0"/>
* &lt;element name="random" type="{}CalculatorFunctionOperation" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CalculatorFunction", propOrder = {
"set",
"add",
"subtract",
"random"
})
public class CalculatorFunction {
protected CalculatorFunctionOperation set;
protected CalculatorFunctionOperation add;
protected CalculatorFunctionOperation subtract;
protected CalculatorFunctionOperation random;
/**
* Gets the value of the set property.
*
* @return
* possible object is
* {@link CalculatorFunctionOperation }
*
*/
public CalculatorFunctionOperation getSet() {
return set;
}
/**
* Sets the value of the set property.
*
* @param value
* allowed object is
* {@link CalculatorFunctionOperation }
*
*/
public void setSet(CalculatorFunctionOperation value) {
this.set = value;
}
/**
* Gets the value of the add property.
*
* @return
* possible object is
* {@link CalculatorFunctionOperation }
*
*/
public CalculatorFunctionOperation getAdd() {
return add;
}
/**
* Sets the value of the add property.
*
* @param value
* allowed object is
* {@link CalculatorFunctionOperation }
*
*/
public void setAdd(CalculatorFunctionOperation value) {
this.add = value;
}
/**
* Gets the value of the subtract property.
*
* @return
* possible object is
* {@link CalculatorFunctionOperation }
*
*/
public CalculatorFunctionOperation getSubtract() {
return subtract;
}
/**
* Sets the value of the subtract property.
*
* @param value
* allowed object is
* {@link CalculatorFunctionOperation }
*
*/
public void setSubtract(CalculatorFunctionOperation value) {
this.subtract = value;
}
/**
* Gets the value of the random property.
*
* @return
* possible object is
* {@link CalculatorFunctionOperation }
*
*/
public CalculatorFunctionOperation getRandom() {
return random;
}
/**
* Sets the value of the random property.
*
* @param value
* allowed object is
* {@link CalculatorFunctionOperation }
*
*/
public void setRandom(CalculatorFunctionOperation value) {
this.random = value;
}
}

View File

@@ -0,0 +1,85 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.12.31 at 03:24:00 AM BRST
//
package com.l2jserver.model.template;
import java.math.BigInteger;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for CalculatorFunctionOperation complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="CalculatorFunctionOperation">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="order" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
* &lt;attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CalculatorFunctionOperation")
public class CalculatorFunctionOperation {
@XmlAttribute(name = "order", required = true)
protected BigInteger order;
@XmlAttribute(name = "value", required = true)
protected double value;
/**
* Gets the value of the order property.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
public BigInteger getOrder() {
return order;
}
/**
* Sets the value of the order property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setOrder(BigInteger value) {
this.order = value;
}
/**
* Gets the value of the value property.
*
*/
public double getValue() {
return value;
}
/**
* Sets the value of the value property.
*
*/
public void setValue(double value) {
this.value = value;
}
}

View File

@@ -0,0 +1,97 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.12.31 at 03:24:00 AM BRST
//
package com.l2jserver.model.template;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for Coordinate complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Coordinate">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;/sequence>
* &lt;attribute name="x" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
* &lt;attribute name="y" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
* &lt;attribute name="z" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Coordinate")
public class Coordinate {
@XmlAttribute(name = "x", required = true)
protected int x;
@XmlAttribute(name = "y", required = true)
protected int y;
@XmlAttribute(name = "z", required = true)
protected int z;
/**
* Gets the value of the x property.
*
*/
public int getX() {
return x;
}
/**
* Sets the value of the x property.
*
*/
public void setX(int value) {
this.x = value;
}
/**
* Gets the value of the y property.
*
*/
public int getY() {
return y;
}
/**
* Sets the value of the y property.
*
*/
public void setY(int value) {
this.y = value;
}
/**
* Gets the value of the z property.
*
*/
public int getZ() {
return z;
}
/**
* Sets the value of the z property.
*
*/
public void setZ(int value) {
this.z = value;
}
}

View File

@@ -0,0 +1,535 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.12.31 at 03:24:00 AM BRST
//
package com.l2jserver.model.template;
import javax.xml.bind.annotation.XmlRegistry;
/**
* This object contains factory methods for each
* Java content interface and Java element interface
* generated in the com.l2jserver.model.template package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
* content can consist of schema derived interfaces
* and classes representing the binding of schema
* type definitions, element declarations and model
* groups. Factory methods for each of these are
* provided in this class.
*
*/
@XmlRegistry
public class ObjectFactory {
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.l2jserver.model.template
*
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link NPCTemplate }
*
*/
public NPCTemplate createNPCTemplate() {
return new NPCTemplate();
}
/**
* Create an instance of {@link NPCTemplate.Droplist }
*
*/
public NPCTemplate.Droplist createNPCTemplateDroplist() {
return new NPCTemplate.Droplist();
}
/**
* Create an instance of {@link NPCTemplate.Droplist.Item }
*
*/
public NPCTemplate.Droplist.Item createNPCTemplateDroplistItem() {
return new NPCTemplate.Droplist.Item();
}
/**
* Create an instance of {@link Teleports }
*
*/
public Teleports createTeleports() {
return new Teleports();
}
/**
* Create an instance of {@link Zones }
*
*/
public Zones createZones() {
return new Zones();
}
/**
* Create an instance of {@link ZoneType }
*
*/
public ZoneType createZoneType() {
return new ZoneType();
}
/**
* Create an instance of {@link Zones.Castle }
*
*/
public Zones.Castle createZonesCastle() {
return new Zones.Castle();
}
/**
* Create an instance of {@link Teleports.Teleport }
*
*/
public Teleports.Teleport createTeleportsTeleport() {
return new Teleports.Teleport();
}
/**
* Create an instance of {@link NPCTemplate.Skills }
*
*/
public NPCTemplate.Skills createNPCTemplateSkills() {
return new NPCTemplate.Skills();
}
/**
* Create an instance of {@link NPCTemplate.Talk }
*
*/
public NPCTemplate.Talk createNPCTemplateTalk() {
return new NPCTemplate.Talk();
}
/**
* Create an instance of {@link NPCTemplate.Info }
*
*/
public NPCTemplate.Info createNPCTemplateInfo() {
return new NPCTemplate.Info();
}
/**
* Create an instance of {@link NPCTemplate.Info.Stats }
*
*/
public NPCTemplate.Info.Stats createNPCTemplateInfoStats() {
return new NPCTemplate.Info.Stats();
}
/**
* Create an instance of {@link NPCTemplate.Info.Stats.Defense }
*
*/
public NPCTemplate.Info.Stats.Defense createNPCTemplateInfoStatsDefense() {
return new NPCTemplate.Info.Stats.Defense();
}
/**
* Create an instance of {@link NPCTemplate.Info.Stats.Attack }
*
*/
public NPCTemplate.Info.Stats.Attack createNPCTemplateInfoStatsAttack() {
return new NPCTemplate.Info.Stats.Attack();
}
/**
* Create an instance of {@link ItemTemplate }
*
*/
public ItemTemplate createItemTemplate() {
return new ItemTemplate();
}
/**
* Create an instance of {@link ItemTemplate.Armor }
*
*/
public ItemTemplate.Armor createItemTemplateArmor() {
return new ItemTemplate.Armor();
}
/**
* Create an instance of {@link ItemTemplate.Attributes }
*
*/
public ItemTemplate.Attributes createItemTemplateAttributes() {
return new ItemTemplate.Attributes();
}
/**
* Create an instance of {@link CharacterTemplate }
*
*/
public CharacterTemplate createCharacterTemplate() {
return new CharacterTemplate();
}
/**
* Create an instance of {@link CharacterTemplate.Collision }
*
*/
public CharacterTemplate.Collision createCharacterTemplateCollision() {
return new CharacterTemplate.Collision();
}
/**
* Create an instance of {@link CharacterTemplate.Stats }
*
*/
public CharacterTemplate.Stats createCharacterTemplateStats() {
return new CharacterTemplate.Stats();
}
/**
* Create an instance of {@link CharacterTemplate.Stats.Defense }
*
*/
public CharacterTemplate.Stats.Defense createCharacterTemplateStatsDefense() {
return new CharacterTemplate.Stats.Defense();
}
/**
* Create an instance of {@link CharacterTemplate.Stats.Attack }
*
*/
public CharacterTemplate.Stats.Attack createCharacterTemplateStatsAttack() {
return new CharacterTemplate.Stats.Attack();
}
/**
* Create an instance of {@link CalculatorFunction }
*
*/
public CalculatorFunction createCalculatorFunction() {
return new CalculatorFunction();
}
/**
* Create an instance of {@link Coordinate }
*
*/
public Coordinate createCoordinate() {
return new Coordinate();
}
/**
* Create an instance of {@link CalculatorFunctionOperation }
*
*/
public CalculatorFunctionOperation createCalculatorFunctionOperation() {
return new CalculatorFunctionOperation();
}
/**
* Create an instance of {@link SkillTemplate }
*
*/
public SkillTemplate createSkillTemplate() {
return new SkillTemplate();
}
/**
* Create an instance of {@link ZoneType.Point }
*
*/
public ZoneType.Point createZoneTypePoint() {
return new ZoneType.Point();
}
/**
* Create an instance of {@link Zones.Castle.Siege }
*
*/
public Zones.Castle.Siege createZonesCastleSiege() {
return new Zones.Castle.Siege();
}
/**
* Create an instance of {@link Teleports.Teleport.Restrictions }
*
*/
public Teleports.Teleport.Restrictions createTeleportsTeleportRestrictions() {
return new Teleports.Teleport.Restrictions();
}
/**
* Create an instance of {@link NPCTemplate.Ai }
*
*/
public NPCTemplate.Ai createNPCTemplateAi() {
return new NPCTemplate.Ai();
}
/**
* Create an instance of {@link NPCTemplate.Skills.Skill }
*
*/
public NPCTemplate.Skills.Skill createNPCTemplateSkillsSkill() {
return new NPCTemplate.Skills.Skill();
}
/**
* Create an instance of {@link NPCTemplate.Talk.Chat }
*
*/
public NPCTemplate.Talk.Chat createNPCTemplateTalkChat() {
return new NPCTemplate.Talk.Chat();
}
/**
* Create an instance of {@link NPCTemplate.Info.Name }
*
*/
public NPCTemplate.Info.Name createNPCTemplateInfoName() {
return new NPCTemplate.Info.Name();
}
/**
* Create an instance of {@link NPCTemplate.Info.Title }
*
*/
public NPCTemplate.Info.Title createNPCTemplateInfoTitle() {
return new NPCTemplate.Info.Title();
}
/**
* Create an instance of {@link NPCTemplate.Info.Item }
*
*/
public NPCTemplate.Info.Item createNPCTemplateInfoItem() {
return new NPCTemplate.Info.Item();
}
/**
* Create an instance of {@link NPCTemplate.Info.Collision }
*
*/
public NPCTemplate.Info.Collision createNPCTemplateInfoCollision() {
return new NPCTemplate.Info.Collision();
}
/**
* Create an instance of {@link NPCTemplate.Info.Stats.Hp }
*
*/
public NPCTemplate.Info.Stats.Hp createNPCTemplateInfoStatsHp() {
return new NPCTemplate.Info.Stats.Hp();
}
/**
* Create an instance of {@link NPCTemplate.Info.Stats.Mp }
*
*/
public NPCTemplate.Info.Stats.Mp createNPCTemplateInfoStatsMp() {
return new NPCTemplate.Info.Stats.Mp();
}
/**
* Create an instance of {@link NPCTemplate.Info.Stats.Move }
*
*/
public NPCTemplate.Info.Stats.Move createNPCTemplateInfoStatsMove() {
return new NPCTemplate.Info.Stats.Move();
}
/**
* Create an instance of {@link NPCTemplate.Info.Stats.Base }
*
*/
public NPCTemplate.Info.Stats.Base createNPCTemplateInfoStatsBase() {
return new NPCTemplate.Info.Stats.Base();
}
/**
* Create an instance of {@link NPCTemplate.Info.Stats.Defense.Physical }
*
*/
public NPCTemplate.Info.Stats.Defense.Physical createNPCTemplateInfoStatsDefensePhysical() {
return new NPCTemplate.Info.Stats.Defense.Physical();
}
/**
* Create an instance of {@link NPCTemplate.Info.Stats.Defense.Magical }
*
*/
public NPCTemplate.Info.Stats.Defense.Magical createNPCTemplateInfoStatsDefenseMagical() {
return new NPCTemplate.Info.Stats.Defense.Magical();
}
/**
* Create an instance of {@link NPCTemplate.Info.Stats.Attack.Physical }
*
*/
public NPCTemplate.Info.Stats.Attack.Physical createNPCTemplateInfoStatsAttackPhysical() {
return new NPCTemplate.Info.Stats.Attack.Physical();
}
/**
* Create an instance of {@link NPCTemplate.Info.Stats.Attack.Magical }
*
*/
public NPCTemplate.Info.Stats.Attack.Magical createNPCTemplateInfoStatsAttackMagical() {
return new NPCTemplate.Info.Stats.Attack.Magical();
}
/**
* Create an instance of {@link ItemTemplate.Controller }
*
*/
public ItemTemplate.Controller createItemTemplateController() {
return new ItemTemplate.Controller();
}
/**
* Create an instance of {@link ItemTemplate.Effect }
*
*/
public ItemTemplate.Effect createItemTemplateEffect() {
return new ItemTemplate.Effect();
}
/**
* Create an instance of {@link ItemTemplate.EtcItem }
*
*/
public ItemTemplate.EtcItem createItemTemplateEtcItem() {
return new ItemTemplate.EtcItem();
}
/**
* Create an instance of {@link ItemTemplate.Weapon }
*
*/
public ItemTemplate.Weapon createItemTemplateWeapon() {
return new ItemTemplate.Weapon();
}
/**
* Create an instance of {@link ItemTemplate.Armor.Cost }
*
*/
public ItemTemplate.Armor.Cost createItemTemplateArmorCost() {
return new ItemTemplate.Armor.Cost();
}
/**
* Create an instance of {@link ItemTemplate.Armor.Equipment }
*
*/
public ItemTemplate.Armor.Equipment createItemTemplateArmorEquipment() {
return new ItemTemplate.Armor.Equipment();
}
/**
* Create an instance of {@link ItemTemplate.Attributes.Cost }
*
*/
public ItemTemplate.Attributes.Cost createItemTemplateAttributesCost() {
return new ItemTemplate.Attributes.Cost();
}
/**
* Create an instance of {@link CharacterTemplate.Collision.Male }
*
*/
public CharacterTemplate.Collision.Male createCharacterTemplateCollisionMale() {
return new CharacterTemplate.Collision.Male();
}
/**
* Create an instance of {@link CharacterTemplate.Collision.Female }
*
*/
public CharacterTemplate.Collision.Female createCharacterTemplateCollisionFemale() {
return new CharacterTemplate.Collision.Female();
}
/**
* Create an instance of {@link CharacterTemplate.Stats.Hp }
*
*/
public CharacterTemplate.Stats.Hp createCharacterTemplateStatsHp() {
return new CharacterTemplate.Stats.Hp();
}
/**
* Create an instance of {@link CharacterTemplate.Stats.Mp }
*
*/
public CharacterTemplate.Stats.Mp createCharacterTemplateStatsMp() {
return new CharacterTemplate.Stats.Mp();
}
/**
* Create an instance of {@link CharacterTemplate.Stats.Cp }
*
*/
public CharacterTemplate.Stats.Cp createCharacterTemplateStatsCp() {
return new CharacterTemplate.Stats.Cp();
}
/**
* Create an instance of {@link CharacterTemplate.Stats.Move }
*
*/
public CharacterTemplate.Stats.Move createCharacterTemplateStatsMove() {
return new CharacterTemplate.Stats.Move();
}
/**
* Create an instance of {@link CharacterTemplate.Stats.Base }
*
*/
public CharacterTemplate.Stats.Base createCharacterTemplateStatsBase() {
return new CharacterTemplate.Stats.Base();
}
/**
* Create an instance of {@link CharacterTemplate.Stats.Defense.Physical }
*
*/
public CharacterTemplate.Stats.Defense.Physical createCharacterTemplateStatsDefensePhysical() {
return new CharacterTemplate.Stats.Defense.Physical();
}
/**
* Create an instance of {@link CharacterTemplate.Stats.Defense.Magical }
*
*/
public CharacterTemplate.Stats.Defense.Magical createCharacterTemplateStatsDefenseMagical() {
return new CharacterTemplate.Stats.Defense.Magical();
}
/**
* Create an instance of {@link CharacterTemplate.Stats.Attack.Physical }
*
*/
public CharacterTemplate.Stats.Attack.Physical createCharacterTemplateStatsAttackPhysical() {
return new CharacterTemplate.Stats.Attack.Physical();
}
/**
* Create an instance of {@link CharacterTemplate.Stats.Attack.Magical }
*
*/
public CharacterTemplate.Stats.Attack.Magical createCharacterTemplateStatsAttackMagical() {
return new CharacterTemplate.Stats.Attack.Magical();
}
}

View File

@@ -0,0 +1,162 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.12.31 at 03:24:00 AM BRST
//
package com.l2jserver.model.template;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import com.l2jserver.model.id.template.SkillTemplateID;
import com.l2jserver.util.jaxb.SkillTemplateIDAdapter;
/**
* <p>Java class for skill element declaration.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;element name="skill">
* &lt;complexType>
* &lt;complexContent>
* &lt;extension base="{}AbstractTemplate">
* &lt;sequence>
* &lt;element name="maximumLevel" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;/sequence>
* &lt;attribute name="id" use="required" type="{http://schemas.l2jserver2.com/skill}SkillTemplateID" />
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="delay" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
* &lt;attribute name="cooldown" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;/element>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"maximumLevel"
})
@XmlRootElement(name = "skill", namespace = "http://schemas.l2jserver2.com/skill")
public class SkillTemplate
extends AbstractTemplate
{
protected int maximumLevel;
@XmlAttribute(name = "id", required = true)
@XmlJavaTypeAdapter(SkillTemplateIDAdapter.class)
protected SkillTemplateID id;
@XmlAttribute(name = "name", required = true)
protected String name;
@XmlAttribute(name = "delay", required = true)
protected int delay;
@XmlAttribute(name = "cooldown", required = true)
protected int cooldown;
/**
* Gets the value of the maximumLevel property.
*
*/
public int getMaximumLevel() {
return maximumLevel;
}
/**
* Sets the value of the maximumLevel property.
*
*/
public void setMaximumLevel(int value) {
this.maximumLevel = value;
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public SkillTemplateID getID() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setID(SkillTemplateID value) {
this.id = value;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
/**
* Gets the value of the delay property.
*
*/
public int getDelay() {
return delay;
}
/**
* Sets the value of the delay property.
*
*/
public void setDelay(int value) {
this.delay = value;
}
/**
* Gets the value of the cooldown property.
*
*/
public int getCooldown() {
return cooldown;
}
/**
* Sets the value of the cooldown property.
*
*/
public void setCooldown(int value) {
this.cooldown = value;
}
}

View File

@@ -0,0 +1,379 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.12.31 at 03:24:00 AM BRST
//
package com.l2jserver.model.template;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import com.l2jserver.model.id.template.TeleportationTemplateID;
import com.l2jserver.util.jaxb.TeleportationTemplateIDAdapter;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="teleport" maxOccurs="unbounded">
* &lt;complexType>
* &lt;complexContent>
* &lt;extension base="{}AbstractTemplate">
* &lt;sequence>
* &lt;element name="point" type="{}Coordinate" minOccurs="0"/>
* &lt;element name="restrictions" minOccurs="0">
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="restriction" maxOccurs="unbounded">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;enumeration value="NOBLE"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/element>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;/element>
* &lt;/sequence>
* &lt;attribute name="id" use="required" type="{http://schemas.l2jserver2.com/teleport}TeleportationTemplateID" />
* &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="item" type="{http://www.w3.org/2001/XMLSchema}int" />
* &lt;attribute name="price" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;/element>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"teleport"
})
@XmlRootElement(name = "teleports", namespace = "http://schemas.l2jserver2.com/teleport")
public class Teleports {
@XmlElement(required = true)
protected List<Teleports.Teleport> teleport;
/**
* Gets the value of the teleport property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the teleport property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getTeleport().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Teleports.Teleport }
*
*
*/
public List<Teleports.Teleport> getTeleport() {
if (teleport == null) {
teleport = new ArrayList<Teleports.Teleport>();
}
return this.teleport;
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;extension base="{}AbstractTemplate">
* &lt;sequence>
* &lt;element name="point" type="{}Coordinate" minOccurs="0"/>
* &lt;element name="restrictions" minOccurs="0">
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="restriction" maxOccurs="unbounded">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;enumeration value="NOBLE"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/element>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;/element>
* &lt;/sequence>
* &lt;attribute name="id" use="required" type="{http://schemas.l2jserver2.com/teleport}TeleportationTemplateID" />
* &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="item" type="{http://www.w3.org/2001/XMLSchema}int" />
* &lt;attribute name="price" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"point",
"restrictions"
})
public static class Teleport
extends AbstractTemplate
{
protected Coordinate point;
protected Teleports.Teleport.Restrictions restrictions;
@XmlAttribute(name = "id", required = true)
@XmlJavaTypeAdapter(TeleportationTemplateIDAdapter.class)
protected TeleportationTemplateID id;
@XmlAttribute(name = "name")
protected String name;
@XmlAttribute(name = "item")
protected Integer item;
@XmlAttribute(name = "price", required = true)
protected int price;
/**
* Gets the value of the point property.
*
* @return
* possible object is
* {@link Coordinate }
*
*/
public Coordinate getPoint() {
return point;
}
/**
* Sets the value of the point property.
*
* @param value
* allowed object is
* {@link Coordinate }
*
*/
public void setPoint(Coordinate value) {
this.point = value;
}
/**
* Gets the value of the restrictions property.
*
* @return
* possible object is
* {@link Teleports.Teleport.Restrictions }
*
*/
public Teleports.Teleport.Restrictions getRestrictions() {
return restrictions;
}
/**
* Sets the value of the restrictions property.
*
* @param value
* allowed object is
* {@link Teleports.Teleport.Restrictions }
*
*/
public void setRestrictions(Teleports.Teleport.Restrictions value) {
this.restrictions = value;
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public TeleportationTemplateID getID() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setID(TeleportationTemplateID value) {
this.id = value;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
/**
* Gets the value of the item property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getItem() {
return item;
}
/**
* Sets the value of the item property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setItem(Integer value) {
this.item = value;
}
/**
* Gets the value of the price property.
*
*/
public int getPrice() {
return price;
}
/**
* Sets the value of the price property.
*
*/
public void setPrice(int value) {
this.price = value;
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="restriction" maxOccurs="unbounded">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;enumeration value="NOBLE"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/element>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"restriction"
})
public static class Restrictions {
@XmlElement(required = true)
protected List<String> restriction;
/**
* Gets the value of the restriction property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the restriction property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getRestriction().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getRestriction() {
if (restriction == null) {
restriction = new ArrayList<String>();
}
return this.restriction;
}
}
}
}

View File

@@ -0,0 +1,179 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.12.31 at 03:24:00 AM BRST
//
package com.l2jserver.model.template;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for ZoneType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="ZoneType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="point" maxOccurs="unbounded">
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;/sequence>
* &lt;attribute name="x" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
* &lt;attribute name="y" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;/element>
* &lt;/sequence>
* &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ZoneType", namespace = "zones", propOrder = {
"point"
})
public class ZoneType {
@XmlElement(required = true)
protected List<ZoneType.Point> point;
@XmlAttribute(name = "id", required = true)
protected String id;
/**
* Gets the value of the point property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the point property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getPoint().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link ZoneType.Point }
*
*
*/
public List<ZoneType.Point> getPoint() {
if (point == null) {
point = new ArrayList<ZoneType.Point>();
}
return this.point;
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setId(String value) {
this.id = value;
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;/sequence>
* &lt;attribute name="x" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
* &lt;attribute name="y" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
public static class Point {
@XmlAttribute(name = "x", required = true)
protected int x;
@XmlAttribute(name = "y", required = true)
protected int y;
/**
* Gets the value of the x property.
*
*/
public int getX() {
return x;
}
/**
* Sets the value of the x property.
*
*/
public void setX(int value) {
this.x = value;
}
/**
* Gets the value of the y property.
*
*/
public int getY() {
return y;
}
/**
* Sets the value of the y property.
*
*/
public void setY(int value) {
this.y = value;
}
}
}

View File

@@ -0,0 +1,211 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.12.31 at 03:24:00 AM BRST
//
package com.l2jserver.model.template;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="castle">
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="siege">
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="zone" type="{zones}ZoneType"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;/element>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;/element>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"castle"
})
@XmlRootElement(name = "zones", namespace = "zones")
public class Zones {
@XmlElement(required = true)
protected Zones.Castle castle;
/**
* Gets the value of the castle property.
*
* @return
* possible object is
* {@link Zones.Castle }
*
*/
public Zones.Castle getCastle() {
return castle;
}
/**
* Sets the value of the castle property.
*
* @param value
* allowed object is
* {@link Zones.Castle }
*
*/
public void setCastle(Zones.Castle value) {
this.castle = value;
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="siege">
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="zone" type="{zones}ZoneType"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;/element>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"siege"
})
public static class Castle {
@XmlElement(required = true)
protected Zones.Castle.Siege siege;
/**
* Gets the value of the siege property.
*
* @return
* possible object is
* {@link Zones.Castle.Siege }
*
*/
public Zones.Castle.Siege getSiege() {
return siege;
}
/**
* Sets the value of the siege property.
*
* @param value
* allowed object is
* {@link Zones.Castle.Siege }
*
*/
public void setSiege(Zones.Castle.Siege value) {
this.siege = value;
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="zone" type="{zones}ZoneType"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"zone"
})
public static class Siege {
@XmlElement(required = true)
protected ZoneType zone;
/**
* Gets the value of the zone property.
*
* @return
* possible object is
* {@link ZoneType }
*
*/
public ZoneType getZone() {
return zone;
}
/**
* Sets the value of the zone property.
*
* @param value
* allowed object is
* {@link ZoneType }
*
*/
public void setZone(ZoneType value) {
this.zone = value;
}
}
}
}

View File

@@ -34,7 +34,7 @@ import com.l2jserver.game.net.packet.server.SM_SYSTEM_MESSAGE;
import com.l2jserver.model.game.Fort;
import com.l2jserver.model.game.Skill;
import com.l2jserver.model.id.object.CharacterID;
import com.l2jserver.model.template.item.ItemTemplate;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.world.Item;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.util.html.markup.HtmlTemplate;

View File

@@ -41,8 +41,8 @@ import com.l2jserver.game.net.packet.client.CM_CHAR_OPEN_MAP;
import com.l2jserver.game.net.packet.client.CM_CHAR_POSITION;
import com.l2jserver.game.net.packet.client.CM_CHAR_REQ_INVENTORY;
import com.l2jserver.game.net.packet.client.CM_CHAR_SELECT;
import com.l2jserver.game.net.packet.client.CM_CHAR_SHORTCUT_REMOVE;
import com.l2jserver.game.net.packet.client.CM_CHAR_SHORTCUT_CREATE;
import com.l2jserver.game.net.packet.client.CM_CHAR_SHORTCUT_REMOVE;
import com.l2jserver.game.net.packet.client.CM_CHAR_TARGET_UNSELECT;
import com.l2jserver.game.net.packet.client.CM_ENTER_WORLD;
import com.l2jserver.game.net.packet.client.CM_EXT_REQ_ALL_FORTRESS_INFO;

View File

@@ -27,8 +27,8 @@ import com.l2jserver.model.id.object.ItemID;
import com.l2jserver.model.id.object.provider.ItemIDProvider;
import com.l2jserver.model.world.Item;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.service.game.character.ShortcutSlotNotFreeServiceException;
import com.l2jserver.service.game.character.ShortcutService;
import com.l2jserver.service.game.character.ShortcutSlotNotFreeServiceException;
/**
* Completes the creation of an character. Creates the object, inserts into the

View File

@@ -26,6 +26,7 @@ import com.l2jserver.model.id.object.ItemID;
import com.l2jserver.model.id.object.provider.ItemIDProvider;
import com.l2jserver.model.world.Item;
import com.l2jserver.service.game.item.ItemService;
import com.l2jserver.service.game.item.NonStackableItemsServiceException;
import com.l2jserver.service.game.item.NotEnoughItemsServiceException;
/**
@@ -96,7 +97,7 @@ public class CM_ITEM_DESTROY extends AbstractClientPacket {
} else {
conn.updateInventoryItems(item);
}
} catch (NotEnoughItemsServiceException e) {
} catch (NotEnoughItemsServiceException | NonStackableItemsServiceException e) {
conn.sendSystemMessage(SystemMessage.CANNOT_DISCARD_THIS_ITEM);
}
}

View File

@@ -27,6 +27,7 @@ import com.l2jserver.model.id.object.provider.ItemIDProvider;
import com.l2jserver.model.world.Item;
import com.l2jserver.service.game.item.ItemAlreadyOnGroundServiceException;
import com.l2jserver.service.game.item.ItemService;
import com.l2jserver.service.game.item.NonStackableItemsServiceException;
import com.l2jserver.service.game.item.NotEnoughItemsServiceException;
import com.l2jserver.service.game.spawn.AlreadySpawnedServiceException;
import com.l2jserver.service.game.spawn.SpawnPointNotFoundServiceException;
@@ -118,7 +119,7 @@ public class CM_ITEM_DROP extends AbstractClientPacket {
} catch (ItemAlreadyOnGroundServiceException
| AlreadySpawnedServiceException
| SpawnPointNotFoundServiceException
| NotEnoughItemsServiceException e) {
| NotEnoughItemsServiceException | NonStackableItemsServiceException e) {
conn.sendActionFailed();
}
}

View File

@@ -26,8 +26,8 @@ import com.l2jserver.game.net.packet.AbstractClientPacket;
import com.l2jserver.game.net.packet.server.SM_CHAR_TEMPLATE;
import com.l2jserver.model.id.template.CharacterTemplateID;
import com.l2jserver.model.id.template.provider.CharacterTemplateIDProvider;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.template.character.CharacterClass;
import com.l2jserver.model.template.character.CharacterTemplate;
/**
* Requests the creation of a new Character. The list of character templates is

View File

@@ -239,13 +239,15 @@ public class SM_CHAR_INFO extends AbstractServerPacket {
// writeF(_activeChar.getCollisionHeight());
// }
if (character.getSex() == ActorSex.MALE) {
buffer.writeDouble(character.getTemplate().getMaleCollisionRadius());
buffer.writeDouble(character.getTemplate().getMaleCollisionHeight());
buffer.writeDouble(character.getTemplate().getCollision().getMale()
.getRadius());
buffer.writeDouble(character.getTemplate().getCollision().getMale()
.getHeigth());
} else {
buffer.writeDouble(character.getTemplate()
.getFemaleCollisionRadius());
buffer.writeDouble(character.getTemplate()
.getFemaleCollisionHeight());
buffer.writeDouble(character.getTemplate().getCollision()
.getFemale().getRadius());
buffer.writeDouble(character.getTemplate().getCollision()
.getFemale().getHeigth());
}
buffer.writeInt(character.getAppearance().getHairStyle().option);

View File

@@ -166,13 +166,15 @@ public class SM_CHAR_INFO_BROADCAST extends AbstractServerPacket {
buffer.writeDouble(0x01); // attack speed multiplier
if (character.getSex() == ActorSex.MALE) {
buffer.writeDouble(character.getTemplate().getMaleCollisionRadius());
buffer.writeDouble(character.getTemplate().getMaleCollisionHeight());
buffer.writeDouble(character.getTemplate().getCollision().getMale()
.getRadius());
buffer.writeDouble(character.getTemplate().getCollision().getMale()
.getHeigth());
} else {
buffer.writeDouble(character.getTemplate()
.getFemaleCollisionRadius());
buffer.writeDouble(character.getTemplate()
.getFemaleCollisionHeight());
buffer.writeDouble(character.getTemplate().getCollision()
.getFemale().getRadius());
buffer.writeDouble(character.getTemplate().getCollision()
.getFemale().getHeigth());
}
buffer.writeInt(character.getAppearance().getHairStyle().option);

View File

@@ -20,7 +20,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
import com.l2jserver.game.net.Lineage2Client;
import com.l2jserver.game.net.packet.AbstractServerPacket;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
/**
* An packet that sends all character templates to the client.
@@ -39,7 +39,8 @@ public class SM_CHAR_TEMPLATE extends AbstractServerPacket {
private CharacterTemplate[] templates;
/**
* @param templates the character templates
* @param templates
* the character templates
*/
public SM_CHAR_TEMPLATE(CharacterTemplate... templates) {
super(OPCODE);
@@ -50,25 +51,25 @@ public class SM_CHAR_TEMPLATE extends AbstractServerPacket {
public void write(Lineage2Client conn, ChannelBuffer buffer) {
buffer.writeInt(templates.length);
for (final CharacterTemplate template : templates) {
buffer.writeInt(template.getRace().id);
buffer.writeInt(template.getCharacterClass().id);
buffer.writeInt(template.getID().getCharacterClass().race.id);
buffer.writeInt(template.getID().getCharacterClass().id);
buffer.writeInt(0x46);
buffer.writeInt(template.getBaseStrength());
buffer.writeInt(template.getStats().getBase().getStr());
buffer.writeInt(0x0a);
buffer.writeInt(0x46);
buffer.writeInt(template.getBaseDexterity());
buffer.writeInt(template.getStats().getBase().getDex());
buffer.writeInt(0x0a);
buffer.writeInt(0x46);
buffer.writeInt(template.getBaseConcentration());
buffer.writeInt(template.getStats().getBase().getDex());
buffer.writeInt(0x0a);
buffer.writeInt(0x46);
buffer.writeInt(template.getBaseIntelligence());
buffer.writeInt(template.getStats().getBase().getInt());
buffer.writeInt(0x0a);
buffer.writeInt(0x46);
buffer.writeInt(template.getBaseWitness());
buffer.writeInt(template.getStats().getBase().getWit());
buffer.writeInt(0x0a);
buffer.writeInt(0x46);
buffer.writeInt(template.getBaseMentality());
buffer.writeInt(template.getStats().getBase().getMen());
buffer.writeInt(0x0a);
}
}

View File

@@ -20,7 +20,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
import com.l2jserver.game.net.Lineage2Client;
import com.l2jserver.game.net.packet.AbstractServerPacket;
import com.l2jserver.model.template.npc.NPCTemplate;
import com.l2jserver.model.template.NPCTemplate;
import com.l2jserver.model.world.NPC;
import com.l2jserver.util.BufferUtils;
@@ -40,7 +40,8 @@ public class SM_NPC_INFO extends AbstractServerPacket {
private final NPC npc;
/**
* @param npc the npc
* @param npc
* the npc
*/
public SM_NPC_INFO(NPC npc) {
super(OPCODE);
@@ -52,9 +53,11 @@ public class SM_NPC_INFO extends AbstractServerPacket {
final NPCTemplate template = npc.getTemplate();
buffer.writeInt(npc.getID().getID());
buffer.writeInt(template.getID().getID() + 1000000); // npctype id
//buffer.writeInt((template.isAttackable() ? 0x01 : 0x00)); // attackable
//FIXME unhard code it
buffer.writeInt(template.getID().getID() + 1000000); // npctype
// id
// buffer.writeInt((template.isAttackable() ? 0x01 : 0x00)); //
// attackable
// FIXME unhard code it
buffer.writeInt(0x00); // attackable
buffer.writeInt(npc.getPoint().getX());
buffer.writeInt(npc.getPoint().getY());
@@ -73,20 +76,22 @@ public class SM_NPC_INFO extends AbstractServerPacket {
buffer.writeInt(npc.getStats().getWalkSpeed()); // fly run speed
buffer.writeDouble(0x01); // TODO
buffer.writeDouble(0x01);// TODO
buffer.writeDouble(template.getCollisionRadius());
buffer.writeDouble(template.getCollisionHeight());
buffer.writeInt((template.getRightHand() != null ? template
.getRightHand().getID() : 0x00));
buffer.writeDouble(template.getInfo().getCollision().getRadius());
buffer.writeDouble(template.getInfo().getCollision().getHeigth());
buffer.writeInt((template.getInfo().getItem().getRightHand() != null ? template
.getInfo().getItem().getRightHand().getID()
: 0x00));
buffer.writeInt(0x00); // chest
buffer.writeInt((template.getLeftHand() != null ? template
.getLeftHand().getID() : 0x00));
buffer.writeInt((template.getInfo().getItem().getLeftHand() != null ? template
.getInfo().getItem().getLeftHand().getID()
: 0x00));
buffer.writeByte(1); // name above char 1=true ... ??
buffer.writeByte(0x00); // is running
buffer.writeByte((npc.isAttacking() ? 0x01 : 0x00)); // is in combat
buffer.writeByte((npc.isDead() ? 0x01 : 0x00)); // is like dead (faking)
buffer.writeByte(0x00); // 0=teleported 1=default 2=summoned
BufferUtils.writeString(buffer, template.getName());
BufferUtils.writeString(buffer, template.getTitle());
BufferUtils.writeString(buffer, template.getInfo().getName().getValue());
BufferUtils.writeString(buffer, template.getInfo().getTitle().getValue());
buffer.writeInt(0x00); // Title color 0=client default
buffer.writeInt(0x00); // pvp flag
buffer.writeInt(0x00); // karma
@@ -99,15 +104,15 @@ public class SM_NPC_INFO extends AbstractServerPacket {
buffer.writeByte(0x00); // C2 - is flying
buffer.writeByte(0x00); // title color 0=client
buffer.writeDouble(template.getCollisionRadius());
buffer.writeDouble(template.getCollisionHeight());
buffer.writeDouble(template.getInfo().getCollision().getRadius());
buffer.writeDouble(template.getInfo().getCollision().getHeigth());
buffer.writeInt(0x00); // C4 - enchant effect
buffer.writeInt(0x00); // C6 -- is flying
buffer.writeInt(0x00); // unk
buffer.writeInt(0x00);// CT1.5 Pet form and skills, Color effect
buffer.writeByte((template.getDisplayName() ? 0x01 : 0x00)); // hide
buffer.writeByte((template.getInfo().getName().isDisplay() ? 0x01 : 0x00)); // hide
// name
buffer.writeByte((template.getDisplayName() ? 0x01 : 0x00)); // hide
buffer.writeByte((template.getInfo().getName().isDisplay() ? 0x01 : 0x00)); // hide
// name,
// again

View File

@@ -20,7 +20,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
import com.l2jserver.game.net.Lineage2Client;
import com.l2jserver.game.net.packet.AbstractServerPacket;
import com.l2jserver.model.template.npc.NPCTemplate;
import com.l2jserver.model.template.NPCTemplate;
import com.l2jserver.model.world.NPC;
import com.l2jserver.util.BufferUtils;
@@ -55,19 +55,19 @@ public class SM_SERVER_OBJECT extends AbstractServerPacket {
buffer.writeInt(npc.getID().getID()); // obj id
buffer.writeInt(npc.getTemplateID().getID() + 1000000); // template id
BufferUtils.writeString(buffer, template.getName()); // name
buffer.writeInt((template.isAttackable() ? 0x01 : 0x00)); // attackable
BufferUtils.writeString(buffer, template.getInfo().getName().getValue()); // name
buffer.writeInt((template.getInfo().isAttackable() ? 0x01 : 0x00)); // attackable
buffer.writeInt(npc.getPoint().getX()); // x
buffer.writeInt(npc.getPoint().getY()); // y
buffer.writeInt(npc.getPoint().getZ()); // z
buffer.writeInt((int) npc.getPoint().getAngle()); // angle
buffer.writeDouble(0x01); // move mult
buffer.writeDouble(0x01); // attack spd mult
buffer.writeDouble(template.getCollisionRadius());
buffer.writeDouble(template.getCollisionHeight());
buffer.writeInt((int) (template.isAttackable() ? npc.getHP() : 0x00));
buffer.writeInt((int) (template.isAttackable() ? template
.getMaximumHP() : 0x00));
buffer.writeDouble(template.getInfo().getCollision().getRadius());
buffer.writeDouble(template.getInfo().getCollision().getHeigth());
buffer.writeInt((int) (template.getInfo().isAttackable() ? npc.getHP() : 0x00));
buffer.writeInt((int) (template.getInfo().isAttackable() ? template
.getInfo().getStats().getHp() : 0x00));
buffer.writeInt(0x01); // object type
buffer.writeInt(0x00); // special effects
}

View File

@@ -26,8 +26,8 @@ import com.l2jserver.game.net.packet.AbstractServerPacket;
import com.l2jserver.model.game.Castle;
import com.l2jserver.model.game.Fort;
import com.l2jserver.model.game.Skill;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.template.SkillTemplate;
import com.l2jserver.model.template.item.ItemTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.Item;
import com.l2jserver.model.world.NPC;

View File

@@ -32,7 +32,6 @@ import com.l2jserver.model.id.object.provider.NPCIDProvider;
import com.l2jserver.model.id.object.provider.NPCIDProvider.NPCIDGuiceFactory;
import com.l2jserver.model.id.object.provider.ObjectIDResolver;
import com.l2jserver.model.id.template.provider.CharacterTemplateIDProvider;
import com.l2jserver.model.id.template.provider.EffectTemplateIDProvider;
import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider;
import com.l2jserver.model.id.template.provider.NPCTemplateIDProvider;
import com.l2jserver.model.id.template.provider.SkillTemplateIDProvider;
@@ -77,8 +76,6 @@ public class IDProviderModule extends AbstractModule {
// TEMPLATE IDS
install(new FactoryModuleBuilder().build(ItemTemplateIDProvider.class));
install(new FactoryModuleBuilder()
.build(EffectTemplateIDProvider.class));
install(new FactoryModuleBuilder().build(SkillTemplateIDProvider.class));
install(new FactoryModuleBuilder()
.build(CharacterTemplateIDProvider.class));

View File

@@ -21,7 +21,7 @@ import javax.xml.bind.annotation.XmlTransient;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import com.l2jserver.model.id.TemplateID;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.service.game.template.TemplateService;
/**
@@ -32,7 +32,7 @@ import com.l2jserver.service.game.template.TemplateService;
* represents
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public class ActorTemplateID<T extends ActorTemplate<?>> extends
public class ActorTemplateID<T extends ActorTemplate> extends
TemplateID<T, Integer> {
/**
* The template service

View File

@@ -19,7 +19,8 @@ package com.l2jserver.model.id.template;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import com.l2jserver.model.id.TemplateID;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.template.character.CharacterClass;
import com.l2jserver.service.game.template.TemplateService;
/**
@@ -39,4 +40,11 @@ public class CharacterTemplateID extends ActorTemplateID<CharacterTemplate> {
public CharacterTemplateID(@Assisted int id, TemplateService templateService) {
super(id, templateService);
}
/**
* @return the character class
*/
public CharacterClass getCharacterClass() {
return CharacterClass.fromID(id);
}
}

View File

@@ -1,52 +0,0 @@
/*
* This file is part of l2jserver2 <l2jserver2.com>.
*
* l2jserver2 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.
*
* l2jserver2 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 l2jserver2. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.model.id.template;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import com.l2jserver.model.id.TemplateID;
import com.l2jserver.model.template.effect.EffectTemplate;
import com.l2jserver.service.game.template.TemplateService;
/**
* An {@link TemplateID} instance representing an {@link EffectTemplate} object
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public class EffectTemplateID extends TemplateID<EffectTemplate, Integer> {
/**
* The template service
*/
private transient final TemplateService templateService;
/**
* @param id
* the raw id
* @param templateService
* the template service
*/
@Inject
public EffectTemplateID(@Assisted int id, TemplateService templateService) {
super(id);
this.templateService = templateService;
}
@Override
public EffectTemplate loadTemplate() {
return templateService.getTemplate(this);
}
}

View File

@@ -21,7 +21,7 @@ import javax.xml.bind.annotation.XmlTransient;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import com.l2jserver.model.id.TemplateID;
import com.l2jserver.model.template.item.ItemTemplate;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.service.game.template.TemplateService;
/**

View File

@@ -21,7 +21,7 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import com.l2jserver.model.id.TemplateID;
import com.l2jserver.model.template.npc.NPCTemplate;
import com.l2jserver.model.template.NPCTemplate;
import com.l2jserver.service.game.template.TemplateService;
import com.l2jserver.util.jaxb.NPCTemplateIDAdapter;

View File

@@ -1,169 +0,0 @@
/*
* This file is part of l2jserver2 <l2jserver2.com>.
*
* l2jserver2 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.
*
* l2jserver2 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 l2jserver2. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.model.template;
import java.util.Arrays;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import com.l2jserver.model.game.Skill;
import com.l2jserver.model.id.object.ActorID;
import com.l2jserver.model.id.template.SkillTemplateID;
import com.l2jserver.model.template.effect.EffectTemplate;
import com.l2jserver.model.template.effect.TeleportEffectTemplate;
import com.l2jserver.util.jaxb.SkillTemplateIDAdapter;
/**
* Template for {@link Skill} object
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlRootElement(name = "skill", namespace = "http://schemas.l2jserver2.com/skill")
@XmlType(namespace = "http://schemas.l2jserver2.com/skill", name = "SkillType")
@XmlAccessorType(XmlAccessType.FIELD)
public class SkillTemplate extends AbstractTemplate {
/**
* The skill id
*/
@XmlAttribute(name = "id", required = true)
@XmlJavaTypeAdapter(value = SkillTemplateIDAdapter.class)
protected SkillTemplateID id;
/**
* The skill name
*/
@XmlAttribute(name = "name", required = true)
protected String name;
/**
* The skill delay
*/
@XmlAttribute(name = "delay")
protected int delay;
/**
* The skill cooldown
*/
@XmlAttribute(name = "cooldown")
protected int cooldown;
/**
* The maximum level supported by this skill
*/
protected int maximumLevel = 1;
/**
* The skill effects
*/
@XmlElements({ @XmlElement(name = "teleport", type = TeleportEffectTemplate.class) })
protected EffectTemplate[] effects;
/**
* Create a new {@link Skill}
*
* @return the created object
*/
public Skill create() {
return create(null);
}
/**
* Creates a new instance
*
* @param actorID
* the actor ID
*
* @return the created template instance
*/
public Skill create(ActorID<?> actorID) {
final Skill skill = new Skill(id);
if (actorID != null)
skill.setActorID(actorID);
skill.setLevel(1);
return skill;
}
/**
* @return the maximumLevel
*/
public int getMaximumLevel() {
return maximumLevel;
}
/**
* @return the id
*/
public SkillTemplateID getId() {
return id;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @return the delay
*/
public int getDelay() {
return delay;
}
/**
* @return the cooldown
*/
public int getCooldown() {
return cooldown;
}
/**
* @return the effects
*/
public List<EffectTemplate> getEffects() {
return Arrays.asList(effects);
}
/**
* Tries to locate in the effects list an effect of the given type.
*
* @param <E>
* the effect type
* @param effectType
* the effect type class
* @return the effect found, if any.
*/
@SuppressWarnings("unchecked")
public <E extends EffectTemplate> E getEffect(Class<E> effectType) {
for (final EffectTemplate effect : effects) {
if (effectType.isInstance(effect))
return (E) effect;
}
return null;
}
@Override
public SkillTemplateID getID() {
return id;
}
}

View File

@@ -1,60 +0,0 @@
/*
* This file is part of l2jserver2 <l2jserver2.com>.
*
* l2jserver2 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.
*
* l2jserver2 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 l2jserver2. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.model.template.actor;
import javax.xml.bind.annotation.XmlType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.l2jserver.model.template.AbstractTemplate;
import com.l2jserver.model.world.Actor;
/**
* Template for {@link Actor}
*
* @param <T>
* the {@link Actor} type this template is for
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "AbstractActorType")
public abstract class ActorTemplate<T extends Actor> extends AbstractTemplate {
/**
* The logger
*/
private static final Logger log = LoggerFactory
.getLogger(ActorTemplate.class);
/**
* Create a new {@link Actor}
*
* @return the created object
*/
public T create() {
log.debug("Creating a new Actor instance with template {}", this);
final T actor = createInstance();
return actor;
}
/**
* Creates a new instance
*
* @return the created template instance
*/
protected abstract T createInstance();
}

View File

@@ -1,729 +0,0 @@
/*
* This file is part of l2jserver <l2jserver.com>.
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.model.template.character;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import com.l2jserver.model.id.template.CharacterTemplateID;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.util.jaxb.CharacterTemplateIDAdapter;
/**
* The {@link L2Character} template. Each character instance is backed by an
* template.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlRootElement(name = "character", namespace = "http://schemas.l2jserver2.com/character")
@XmlType(namespace = "http://schemas.l2jserver2.com/character", name = "CharacterType")
@XmlAccessorType(XmlAccessType.FIELD)
public class CharacterTemplate extends ActorTemplate<L2Character> {
/**
* The character templat eid
*/
@XmlJavaTypeAdapter(CharacterTemplateIDAdapter.class)
@XmlAttribute(name = "class", required = true)
protected CharacterTemplateID id = null;
/**
* The character stats
*/
@XmlElement(name = "stats", required = true)
protected CharacterStatsMetadata stats = null;
/**
* Defines the character stats
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "CharacterStatsType")
protected static class CharacterStatsMetadata {
/**
* The character level
*/
@XmlAttribute(name = "level", required = true)
protected int level = 0;
/**
* Whether the character is an crafter or not
*/
@XmlAttribute(name = "crafter", required = false)
protected boolean crafter = false;
/**
* The character HP descriptor
*/
@XmlElement(name = "hp", required = true)
protected Stat hp = null;
/**
* The character MP descriptor
*/
@XmlElement(name = "mp", required = true)
protected Stat mp = null;
/**
* The character CP descriptor
*/
@XmlElement(name = "cp", required = true)
protected Stat cp = null;
/**
* Describes an character stat (HP, MP or CP)
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "")
protected static class Stat {
/**
* The base value
*/
@XmlAttribute(name = "base", required = true)
protected double base = 0;
/**
* The value modified
*/
@XmlAttribute(name = "modifier", required = true)
protected double modifier = 0;
/**
* The value add
*/
@XmlAttribute(name = "add", required = true)
protected double add = 0;
}
/**
* The character attack data
*/
@XmlElement(name = "attack", required = true)
protected AttackMetadata attack = null;
/**
* Defines the character attack data
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "CharacterAttackType")
protected static class AttackMetadata {
/**
* The character evasion
*/
@XmlAttribute(name = "evasion", required = true)
protected int evasion = 0;
/**
* The character critical chance
*/
@XmlAttribute(name = "critical", required = true)
protected int critical = 0;
/**
* The character accuracy
*/
@XmlAttribute(name = "accuracy", required = true)
protected int accuracy = 0;
/**
* The character physical attack data
*/
@XmlElement(name = "physical", required = true)
protected AttackValueMetadata physical = null;
/**
* The character magical attack data
*/
@XmlElement(name = "magical", required = true)
protected AttackValueMetadata magical = null;
/**
* Defines an attack attribute
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "")
protected static class AttackValueMetadata {
/**
* The damage dealt
*/
@XmlAttribute(name = "damage", required = true)
protected double damage = 0;
/**
* The attack speed
*/
@XmlAttribute(name = "speed", required = true)
protected double speed = 0;
}
}
/**
* The character defense data
*/
@XmlElement(name = "defense", required = true)
protected DefenseMetadata defense = null;
/**
* Defines the character defense data
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "CharacterDefenseType")
protected static class DefenseMetadata {
/**
* The character physical defense
*/
@XmlElement(name = "physical", required = true)
protected DefenseValueMetadata physical = null;
/**
* The character magical defense
*/
@XmlElement(name = "magical", required = true)
protected DefenseValueMetadata magical = null;
/**
* Defines an defense attribute
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "")
protected static class DefenseValueMetadata {
/**
* The defense value
*/
@XmlAttribute(name = "value", required = true)
protected double value = 0;
}
}
/**
* The charatcer movement medatata
*/
@XmlElement(name = "move", required = true)
protected MoveMetadata move = null;
/**
* Defines the character movement
* @author <a href="http://www.rogiel.com">Rogiel</a>
*
*/
@XmlType(name = "CharacterMovementType")
protected static class MoveMetadata {
/**
* The run speed
*/
@XmlAttribute(name = "run", required = true)
protected double run = 0;
/**
* The walk speed
*/
@XmlAttribute(name = "walk", required = true)
protected double walk = 0;
}
/**
* The character base stats
*/
@XmlElement(name = "base", required = true)
protected BaseMetadata base = null;
/**
* Defines an character base stats
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "CharacterBaseStatsType")
protected static class BaseMetadata {
/**
* The intelligence
*/
@XmlAttribute(name = "int", required = true)
protected int intelligence = 0;
/**
* The strength
*/
@XmlAttribute(name = "str", required = true)
protected int strength = 0;
/**
* The concentration
*/
@XmlAttribute(name = "con", required = true)
protected int concentration = 0;
/**
* The mentality
*/
@XmlAttribute(name = "men", required = true)
protected int mentality = 0;
/**
* The dexterity
*/
@XmlAttribute(name = "dex", required = true)
protected int dexterity = 0;
/**
* The witness
*/
@XmlAttribute(name = "wit", required = true)
protected int witness = 0;
}
/**
* The character maximum load
*/
@XmlElement(name = "maxload", required = true)
protected int maximumLoad = 0;
}
/**
* The character collision data
*/
@XmlElement(name = "collision", required = true)
protected CollitionMetadataContainer collision = null;
/**
* Defines the character collision data
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "CharacterCollisionType")
protected static class CollitionMetadataContainer {
/**
* Collision data for male characters
*/
@XmlElement(name = "male", required = true)
protected CollisionMetadata male = null;
/**
* Collision data for female characters
*/
@XmlElement(name = "female", required = true)
protected CollisionMetadata female = null;
/**
* Defines an collision data
* @author <a href="http://www.rogiel.com">Rogiel</a>
*
*/
@XmlType(name = "")
protected static class CollisionMetadata {
/**
* The character radius
*/
@XmlAttribute(name = "radius", required = true)
protected double radius = 0;
/**
* The character height
*/
@XmlAttribute(name = "heigth", required = true)
protected double height = 0;
}
}
@Override
protected L2Character createInstance() {
final L2Character character = new L2Character(id);
character.setCharacterClass(getCharacterClass());
character.setRace(getRace());
return character;
// character.setPosition(null); // TODO spawn location
// return null;
}
/**
* @return the character Class
*/
public CharacterClass getCharacterClass() {
return CharacterClass.fromID(id.getID());
}
/**
* @return the character race
*/
public CharacterRace getRace() {
return getCharacterClass().race;
}
/**
* @return the minimum level
*/
public int getMinimumLevel() {
if (stats == null)
return 0;
return stats.level;
}
/**
* @return true if class is crafter
*/
public boolean isCrafter() {
if (stats == null)
return false;
return stats.crafter;
}
/**
* @return the base HP
*/
public double getBaseHP() {
if (stats == null)
return 0;
if (stats.hp == null)
return 0;
return stats.hp.base;
}
/**
* @return the base HP modifier
*/
public double getBaseHPModifier() {
if (stats == null)
return 0;
if (stats.hp == null)
return 0;
return stats.hp.modifier;
}
/**
* @return the base HP add
*/
public double getBaseHPAdd() {
if (stats == null)
return 0;
if (stats.hp == null)
return 0;
return stats.hp.add;
}
/**
* @return the base MP
*/
public double getBaseMP() {
if (stats == null)
return 0;
if (stats.mp == null)
return 0;
return stats.mp.base;
}
/**
* @return the base MP modifier
*/
public double getBaseMPModifier() {
if (stats == null)
return 0;
if (stats.mp == null)
return 0;
return stats.mp.modifier;
}
/**
* @return the base MP add
*/
public double getBaseMPAdd() {
if (stats == null)
return 0;
if (stats.mp == null)
return 0;
return stats.mp.add;
}
/**
* @return the base CP
*/
public double getBaseCP() {
if (stats == null)
return 0;
if (stats.cp == null)
return 0;
return stats.cp.base;
}
/**
* @return the base CP modifier
*/
public double getBaseCPModifier() {
if (stats == null)
return 0;
if (stats.cp == null)
return 0;
return stats.cp.modifier;
}
/**
* @return the base CP add
*/
public double getBaseCPAdd() {
if (stats == null)
return 0;
if (stats.cp == null)
return 0;
return stats.cp.add;
}
/**
* @return the evasion
*/
public int getBaseEvasion() {
if (stats == null)
return 0;
if (stats.attack == null)
return 0;
return stats.attack.evasion;
}
/**
* @return the critical
*/
public int getBaseCritical() {
if (stats == null)
return 0;
if (stats.attack == null)
return 0;
return stats.attack.critical;
}
/**
* @return the accuracy
*/
public int getBaseAccuracy() {
if (stats == null)
return 0;
if (stats.attack == null)
return 0;
return stats.attack.accuracy;
}
/**
* @return the physical attack
*/
public double getBasePhysicalAttack() {
if (stats == null)
return 0;
if (stats.attack == null)
return 0;
if (stats.attack.physical == null)
return 0;
return stats.attack.physical.damage;
}
/**
* @return the physical defense
*/
public double getBasePhysicalDefense() {
if (stats == null)
return 0;
if (stats.defense == null)
return 0;
if (stats.defense.physical == null)
return 0;
return stats.defense.physical.value;
}
/**
* @return the physical attack speed
*/
public double getBasePhysicalAttackSpeed() {
if (stats == null)
return 0;
if (stats.attack == null)
return 0;
if (stats.attack.physical == null)
return 0;
return stats.attack.physical.speed;
}
/**
* @return the magical attack
*/
public double getBaseMagicalAttack() {
if (stats == null)
return 0;
if (stats.attack == null)
return 0;
if (stats.attack.magical == null)
return 0;
return stats.attack.magical.damage;
}
/**
* @return the magical attack
*/
public double getBaseMagicalDefense() {
if (stats == null)
return 0;
if (stats.defense == null)
return 0;
if (stats.defense.magical == null)
return 0;
return stats.defense.magical.value;
}
/**
* @return the magical attack speed
*/
public double getBaseMagicalAttackSpeed() {
if (stats == null)
return 0;
if (stats.attack == null)
return 0;
if (stats.attack.magical == null)
return 0;
return stats.attack.magical.speed;
}
/**
* @return the base run speed
*/
public double getBaseRunSpeed() {
if (stats == null)
return 0;
if (stats.move == null)
return 0;
return stats.move.run;
}
/**
* @return the base walk speed
*/
public double getBaseWalkSpeed() {
if (stats == null)
return 0;
if (stats.move == null)
return 0;
return stats.move.walk;
}
/**
* @return the intelligence
*/
public int getBaseIntelligence() {
if (stats == null)
return 0;
if (stats.base == null)
return 0;
return stats.base.intelligence;
}
/**
* @return the strength
*/
public int getBaseStrength() {
if (stats == null)
return 0;
if (stats.base == null)
return 0;
return stats.base.strength;
}
/**
* @return the concentration
*/
public int getBaseConcentration() {
if (stats == null)
return 0;
if (stats.base == null)
return 0;
return stats.base.concentration;
}
/**
* @return the mentality
*/
public int getBaseMentality() {
if (stats == null)
return 0;
if (stats.base == null)
return 0;
return stats.base.mentality;
}
/**
* @return the dexterity
*/
public int getBaseDexterity() {
if (stats == null)
return 0;
if (stats.base == null)
return 0;
return stats.base.dexterity;
}
/**
* @return the witness
*/
public int getBaseWitness() {
if (stats == null)
return 0;
if (stats.base == null)
return 0;
return stats.base.witness;
}
/**
* @return the witness
*/
public int getBaseMaximumLoad() {
if (stats == null)
return 0;
return stats.maximumLoad;
}
/**
* @return the male collision radius
*/
public double getMaleCollisionRadius() {
if (collision == null)
return 0;
if (collision.male == null)
return 0;
return collision.male.radius;
}
/**
* @return the male collision height
*/
public double getMaleCollisionHeight() {
if (collision == null)
return 0;
if (collision.male == null)
return 0;
return collision.male.height;
}
/**
* @return the female collision radius
*/
public double getFemaleCollisionRadius() {
if (collision == null)
return 0;
if (collision.female == null)
return 0;
return collision.female.radius;
}
/**
* @return the female collision height
*/
public double getFemaleCollisionHeight() {
if (collision == null)
return 0;
if (collision.female == null)
return 0;
return collision.female.height;
}
@Override
public CharacterTemplateID getID() {
return id;
}
}

View File

@@ -1,66 +0,0 @@
/*
* This file is part of l2jserver2 <l2jserver2.com>.
*
* l2jserver2 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.
*
* l2jserver2 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 l2jserver2. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.model.template.effect;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import com.l2jserver.model.id.template.EffectTemplateID;
import com.l2jserver.model.template.Template;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.actor.effect.Effect;
import com.l2jserver.util.jaxb.EffectTemplateIDAdapter;
/**
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Effect")
@XmlSeeAlso({ TeleportEffectTemplate.class })
public abstract class EffectTemplate implements Template {
/**
* The effect template ID
*/
@XmlAttribute(name = "id")
@XmlJavaTypeAdapter(EffectTemplateIDAdapter.class)
protected EffectTemplateID id;
/**
* Creates a new instance
*/
protected EffectTemplate() {
this.id = null;
}
/**
* Creates a new effect for the given <tt>actor</tt>
*
* @param actor
* the actor
* @return the newly created effect
*/
public abstract Effect createEffect(Actor actor);
@Override
public EffectTemplateID getID() {
return id;
}
}

View File

@@ -1,101 +0,0 @@
/*
* This file is part of l2jserver2 <l2jserver2.com>.
*
* l2jserver2 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.
*
* l2jserver2 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 l2jserver2. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.model.template.effect;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import com.google.inject.Inject;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.actor.effect.AbstractEffect;
import com.l2jserver.model.world.actor.effect.Effect;
import com.l2jserver.service.game.spawn.CharacterAlreadyTeleportingServiceException;
import com.l2jserver.service.game.spawn.NotSpawnedServiceException;
import com.l2jserver.service.game.spawn.SpawnService;
import com.l2jserver.util.geometry.Coordinate;
import com.l2jserver.util.jaxb.CoordinateAdapter;
/**
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TeleportEffect")
public class TeleportEffectTemplate extends EffectTemplate {
/**
* The teleportation type
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public enum SkillTeleportEffectLocation {
/**
* Teleports the caster to the current target
*/
TARGET,
/**
* Teleports the caster to an offset from the target
*/
OFFSET_FROM_TARGET,
/**
* Teleports the caster to an fixed point
*/
POINT;
}
/**
* The type of teleportation
*/
@XmlAttribute(name = "type", required = false)
private SkillTeleportEffectLocation type = SkillTeleportEffectLocation.TARGET;
/**
* The point (only of <code>type</code> is {@link SkillTeleportEffectLocation#POINT})
*/
@XmlElement(name = "point")
@XmlJavaTypeAdapter(CoordinateAdapter.class)
private Coordinate coordinate;
/**
* Creates a new instance
*/
private TeleportEffectTemplate() {
super();
}
@Override
public Effect createEffect(Actor actor) {
return new AbstractEffect<TeleportEffectTemplate>(this, actor) {
@Inject
private SpawnService spawnService;
@Override
public void applyEffect() throws NotSpawnedServiceException,
CharacterAlreadyTeleportingServiceException {
spawnService.teleport(actor, template.coordinate);
}
};
}
/**
* @return the teleport effect type
*/
public SkillTeleportEffectLocation getType() {
return type;
}
}

View File

@@ -1,313 +0,0 @@
/*
* This file is part of l2jserver2 <l2jserver2.com>.
*
* l2jserver2 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.
*
* l2jserver2 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 l2jserver2. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.model.template.item;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.AbstractTemplate;
import com.l2jserver.model.template.calculator.ItemSetActorCalculator;
import com.l2jserver.model.world.Item;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.util.jaxb.ItemTemplateIDAdapter;
/**
* Template for an {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlRootElement(name = "item", namespace = "http://schemas.l2jserver2.com/item")
@XmlType(namespace = "http://schemas.l2jserver2.com/item", name = "ItemType")
@XmlAccessorType(XmlAccessType.FIELD)
public class ItemTemplate extends AbstractTemplate {
/**
* The logger
*/
private static final Logger log = LoggerFactory
.getLogger(ItemTemplate.class);
/**
* The Item Template ID
*/
@XmlAttribute(name = "id", required = true)
@XmlJavaTypeAdapter(ItemTemplateIDAdapter.class)
protected ItemTemplateID id;
/**
* The item name
*/
@XmlAttribute(name = "name", required = true)
protected String name;
/**
* The item weight
*/
@XmlElement(name = "weight", required = true)
protected int weight = 0;
/**
* The item price
*/
@XmlElement(name = "price", required = true)
protected int price = 0;
/**
* The item icon
*/
@XmlElement(name = "icon", required = false)
protected String icon;
/**
* The item effects
*/
@XmlElement(name = "effect", required = false)
protected EffectContainer effect;
/**
* Effect container for items
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "ItemEffectsType")
private static class EffectContainer {
/**
* The effect type
*/
@XmlAttribute(name = "type", required = true)
protected EffectType effect;
}
/**
* The item stats container
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "ItemStatsType")
protected static class StatsContainer {
/**
* The weapon's physical damage
*/
@XmlElement(name = "physicalDamage", required = false)
protected StatAttribute physicalDamage;
/**
* The weapons's magical damage
*/
@XmlElement(name = "magicalDamage", required = false)
protected StatAttribute magicalDamage;
/**
* The weapon's critical chance
*/
@XmlElement(name = "criticalChance", required = false)
protected StatAttribute criticalChance;
/**
* The weapon's physical attack speed
*/
@XmlElement(name = "physicalAttackSpeed", required = false)
protected StatAttribute physicalAttackSpeed;
}
/**
* The item stats
*/
@XmlElement(name = "stats", required = false)
protected StatsContainer stats;
/**
* The item material
*/
@XmlElement(name = "material", required = true)
protected ItemMaterial material;
/**
* The item effect type
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "ItemEffectType")
public enum EffectType {
/**
* The effect is applied immediately once used
*/
IMMEDIATE;
}
/**
* The item type
*/
protected ItemType itemType = ItemType.NONE;
/**
* The weapon type
*/
protected WeaponType weaponType = WeaponType.NONE;
/**
* The armor type
*/
protected ArmorType armorType = ArmorType.NONE;
/**
* An item stat attribute
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "ItemAttributeType")
public static class StatAttribute {
/**
* The set
*/
@XmlElement(name = "set", required = true)
protected StatSet set;
/**
* Defines an SET calculator function
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlType(name = "")
public static class StatSet {
/**
* The execution order
*/
@XmlAttribute(name = "order", required = true)
protected int order;
/**
* The value to be set
*/
@XmlValue
protected double value;
/**
* @return the order
*/
public int getOrder() {
return order;
}
/**
* @return the value
*/
public double getValue() {
return value;
}
}
/**
* @return the set
*/
public StatSet getSet() {
return set;
}
}
/**
* Create a new {@link Item}
*
* @return the created object
*/
public Item create() {
log.debug("Creating a new Item instance with template {}", this);
return new Item(id);
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @return the weight
*/
public int getWeight() {
return weight;
}
/**
* @return the price
*/
public int getPrice() {
return price;
}
/**
* @return the icon
*/
public String getIcon() {
return icon;
}
/**
* @return the immediateEffect
*/
public EffectType getEffectType() {
return effect.effect;
}
/**
* @return the material
*/
public ItemMaterial getMaterial() {
return material;
}
/**
* @return the physical damage
*/
public ItemSetActorCalculator getPhysicalDamage() {
if (stats == null)
return null;
if (stats.physicalDamage == null)
return null;
return new ItemSetActorCalculator(stats.physicalDamage.set,
StatType.POWER_ATTACK);
}
/**
* @return the magical damage
*/
public ItemSetActorCalculator getMagicalDamage() {
if (stats == null)
return null;
if (stats.magicalDamage == null)
return null;
return new ItemSetActorCalculator(stats.magicalDamage.set,
StatType.MAGIC_ATTACK);
}
/**
* @return the magical damage
*/
public ItemSetActorCalculator getCriticalChance() {
if (stats == null)
return null;
if (stats.criticalChance == null)
return null;
return new ItemSetActorCalculator(stats.criticalChance.set,
StatType.CRITICAL_RATE);
}
@Override
public ItemTemplateID getID() {
return id;
}
}

View File

@@ -19,9 +19,8 @@ package com.l2jserver.model.world;
import com.l2jserver.model.id.TemplateID;
import com.l2jserver.model.id.object.ActorID;
import com.l2jserver.model.id.template.ActorTemplateID;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.model.template.actor.ActorSex;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.world.actor.ActorEffectContainer;
import com.l2jserver.model.world.actor.ActorSkillContainer;
import com.l2jserver.model.world.actor.stat.ActorStats;
@@ -96,10 +95,10 @@ public abstract class Actor extends PositionableObject {
DEAD;
}
/**
* The currently effects active on the actor
*/
protected final ActorEffectContainer effects = new ActorEffectContainer(this);
// /**
// * The currently effects active on the actor
// */
// protected final ActorEffectContainer effects = new ActorEffectContainer(this);
/**
* The skills learned by this actor
*/
@@ -271,12 +270,12 @@ public abstract class Actor extends PositionableObject {
return state == ActorState.ATTACKING;
}
/**
* @return the active effects on this actor
*/
public ActorEffectContainer getEffects() {
return effects;
}
// /**
// * @return the active effects on this actor
// */
// public ActorEffectContainer getEffects() {
// return effects;
// }
/**
* @return the actor skills
@@ -295,7 +294,7 @@ public abstract class Actor extends PositionableObject {
/**
* @return the template
*/
public ActorTemplate<?> getTemplate() {
public ActorTemplate getTemplate() {
return templateID.getTemplate();
}

View File

@@ -19,7 +19,7 @@ package com.l2jserver.model.world;
import com.l2jserver.model.id.object.CharacterID;
import com.l2jserver.model.id.object.ItemID;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.item.ItemTemplate;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll;
import com.l2jserver.model.world.character.CharacterInventory.ItemLocation;
@@ -71,11 +71,11 @@ public class Item extends PositionableObject {
private long count = 1;
/**
* @param templateID
* the item template id
* @param template
* the item template
*/
public Item(ItemTemplateID templateID) {
this.templateID = templateID;
public Item(ItemTemplate template) {
this.templateID = template.getID();
}
/**

View File

@@ -24,9 +24,9 @@ import com.l2jserver.model.id.object.CharacterID;
import com.l2jserver.model.id.object.ClanID;
import com.l2jserver.model.id.object.PetID;
import com.l2jserver.model.id.template.CharacterTemplateID;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.template.character.CharacterClass;
import com.l2jserver.model.template.character.CharacterRace;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.world.character.CharacterAppearance;
import com.l2jserver.model.world.character.CharacterFriendList;
import com.l2jserver.model.world.character.CharacterInventory;
@@ -169,11 +169,13 @@ public class L2Character extends Player {
/**
* Creates a new instance
*
* @param templateID
* @param template
* the {@link CharacterTemplateID}
*/
public L2Character(CharacterTemplateID templateID) {
super(templateID);
public L2Character(CharacterTemplate template) {
super(template.getID());
this.characterClass = template.getID().getCharacterClass();
this.race = this.characterClass.race;
}
/**

View File

@@ -16,11 +16,11 @@
*/
package com.l2jserver.model.world;
import com.l2jserver.model.id.TemplateID;
import com.l2jserver.model.id.object.NPCID;
import com.l2jserver.model.id.template.NPCTemplateID;
import com.l2jserver.model.template.NPCTemplate;
import com.l2jserver.model.template.Template;
import com.l2jserver.model.template.actor.ActorSex;
import com.l2jserver.model.template.npc.NPCTemplate;
import com.l2jserver.model.world.npc.NPCStats;
import com.l2jserver.service.game.ai.AIScript;
@@ -44,11 +44,11 @@ public class NPC extends Actor {
/**
* Creates a new instance
*
* @param templateID
* the {@link NPC} {@link TemplateID}
* @param template
* the {@link NPC} {@link Template}
*/
public NPC(NPCTemplateID templateID) {
super(templateID);
public NPC(NPCTemplate template) {
super(template.getID());
}
/**
@@ -75,7 +75,7 @@ public class NPC extends Actor {
// TEMPLATE WRAPPERS
@Override
public ActorSex getSex() {
return this.getTemplate().getSex();
return this.getTemplate().getInfo().getSex();
}
@Override
@@ -85,7 +85,7 @@ public class NPC extends Actor {
@Override
public int getLevel() {
return this.getTemplate().getLevel();
return this.getTemplate().getInfo().getLevel();
}
@Override
@@ -97,7 +97,7 @@ public class NPC extends Actor {
* @return the maximum HP
*/
public double getMaxHP() {
return this.getTemplate().getMaximumHP();
return this.getTemplate().getInfo().getStats().getHp().getMax();
}
/**
@@ -114,7 +114,7 @@ public class NPC extends Actor {
* @return the maximum MP
*/
public double getMaxMP() {
return this.getTemplate().getMaximumMP();
return this.getTemplate().getInfo().getStats().getMp().getMax();
}
/**
@@ -129,7 +129,7 @@ public class NPC extends Actor {
@Override
public long getExperience() {
return this.getTemplate().getExperience();
return this.getTemplate().getInfo().getExperience();
}
@Override
@@ -139,7 +139,7 @@ public class NPC extends Actor {
@Override
public int getSP() {
return this.getTemplate().getSP();
return this.getTemplate().getInfo().getSp();
}
@Override

View File

@@ -1,89 +0,0 @@
/*
* This file is part of l2jserver2 <l2jserver2.com>.
*
* l2jserver2 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.
*
* l2jserver2 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 l2jserver2. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.model.world.actor;
import java.util.Iterator;
import java.util.Set;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.actor.effect.Effect;
import com.l2jserver.util.factory.CollectionFactory;
/**
* Class controlling active effects on an {@link Actor}.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public class ActorEffectContainer implements Iterable<Effect> {
/**
* The actor being affected by the effects
*/
private final Actor actor;
/**
* The list of all active effects
*/
private Set<Effect> effects = CollectionFactory.newSet();
/**
* Creates a new instance
*
* @param actor
* the actor
*/
public ActorEffectContainer(Actor actor) {
this.actor = actor;
}
/**
* Adds a new effect to the actor's effect container.
* <p>
* Please note that if the <i>same</i> effect object is already in this
* container, nothing no exception will be thrown and the effect will not be
* applied twice.
*
* @param effect
* the effect to be added
*/
public void addEffect(Effect effect) {
effects.add(effect);
}
/**
* Removes an effect that is attached to the actor's effect container.
* <p>
* Please note that if the effect is not in the container, no exception will
* be thrown.
*
* @param effect
* the effect to be removed
*/
public void removeEffect(Effect effect) {
effects.remove(effect);
}
@Override
public Iterator<Effect> iterator() {
return effects.iterator();
}
/**
* @return the actor
*/
public Actor getActor() {
return actor;
}
}

View File

@@ -22,7 +22,6 @@ import java.util.List;
import com.l2jserver.model.game.Skill;
import com.l2jserver.model.id.template.SkillTemplateID;
import com.l2jserver.model.template.SkillTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.util.factory.CollectionFactory;
@@ -52,69 +51,6 @@ public class ActorSkillContainer implements Iterable<Skill> {
this.actor = actor;
}
/**
* Learns a new skill
*
* @param template
* the skill to be learned
* @param level
* the skill level
* @return the created skill object, null if skill existed or could not be
* learned.
*/
public Skill learn(SkillTemplate template, int level) {
if (hasSkill(template.getID()) != null)
return null;
if (level > template.getMaximumLevel())
level = template.getMaximumLevel();
final Skill newSkill = template.create();
newSkill.setLevel(level);
if (skills.add(newSkill))
return newSkill;
return null;
}
/**
* Learns a new skill. The skill <tt>level</tt> will be 1.
*
* @param template
* the skill to be learned
* @return the created skill object, null if skill existed or could not be
* learned.
* @see ActorSkillContainer#learn(SkillTemplate, int)
*/
public Skill learn(SkillTemplate template) {
return learn(template, 1);
}
/**
* Learns a new skill
*
* @param skill
* the skill to be learned
* @param level
* the skill level
* @return the created skill object, null if skill existed or could not be
* learned.
* @see ActorSkillContainer#learn(SkillTemplate, int)
*/
public Skill learn(SkillTemplateID skill, int level) {
return learn(skill.getTemplate(), level);
}
/**
* Learns a new skill. The skill <tt>level</tt> will be 1.
*
* @param skill
* the skill to be learned
* @return the created skill object, null if skill existed or could not be
* learned.
* @see ActorSkillContainer#learn(SkillTemplate, int)
*/
public Skill learn(SkillTemplateID skill) {
return learn(skill, 1);
}
/**
* Test is the actor knows the given <tt>skillTemplate</tt>
*

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.actor.calculator;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.util.calculator.AbstractDoubleFunction;
@@ -52,6 +52,6 @@ public abstract class ActorCalculatorFunction extends
* the original value
* @return the calculated value
*/
protected abstract double calculate(Actor a, ActorTemplate<?> t,
protected abstract double calculate(Actor a, ActorTemplate t,
double value);
}

View File

@@ -18,7 +18,7 @@ package com.l2jserver.model.world.actor.calculator;
import org.apache.commons.math.util.FastMath;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.actor.stat.StatType;
@@ -46,7 +46,7 @@ public class AttackAccuracyBonusCalculator extends ActorFormula {
}
@Override
protected double calculate(Actor a, ActorTemplate<?> t, double value) {
protected double calculate(Actor a, ActorTemplate t, double value) {
final int level = a.getLevel();
value += FastMath.sqrt(a.getStats().getDexterity()) * 6;

View File

@@ -18,7 +18,7 @@ package com.l2jserver.model.world.actor.calculator;
import org.apache.commons.math.util.FastMath;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.actor.stat.StatType;
@@ -46,7 +46,7 @@ public class AttackEvasionBonusCalculator extends ActorFormula {
}
@Override
protected double calculate(Actor a, ActorTemplate<?> t, double value) {
protected double calculate(Actor a, ActorTemplate t, double value) {
final int level = a.getLevel();
value += FastMath.sqrt(a.getStats().getDexterity()) * 6;

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.actor.calculator;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.actor.stat.BaseStats;
import com.l2jserver.model.world.actor.stat.StatType;
@@ -40,7 +40,7 @@ public class MagicalAttackBonusCalculator extends ActorFormula {
}
@Override
protected double calculate(Actor a, ActorTemplate<?> t, double value) {
protected double calculate(Actor a, ActorTemplate t, double value) {
return value
* Math.pow(((100.0 - 11 + a.getLevel()) / 100.0), 2)
* Math.pow(BaseStats.INT.calculateBonus(a.getStats()

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.actor.calculator;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.actor.stat.BaseStats;
import com.l2jserver.model.world.actor.stat.StatType;
@@ -40,7 +40,7 @@ public class MagicalAttackSpeedBonusCalculator extends ActorFormula {
}
@Override
protected double calculate(Actor a, ActorTemplate<?> t, double value) {
protected double calculate(Actor a, ActorTemplate t, double value) {
return value * BaseStats.WIT.calculateBonus(a.getStats().getWitness());
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.actor.calculator;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.actor.stat.BaseStats;
import com.l2jserver.model.world.actor.stat.StatType;
@@ -40,7 +40,7 @@ public class MagicalCriticalRateBonusCalculator extends ActorFormula {
}
@Override
protected double calculate(Actor a, ActorTemplate<?> t, double value) {
protected double calculate(Actor a, ActorTemplate t, double value) {
// TODO only apply if using a weapon
return value * BaseStats.WIT.calculateBonus(a.getStats().getWitness());
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.actor.calculator;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.actor.stat.BaseStats;
import com.l2jserver.model.world.actor.stat.StatType;
@@ -50,7 +50,7 @@ public class MagicalDefenseBonusCalculator extends ActorFormula {
}
@Override
protected double calculate(Actor a, ActorTemplate<?> t, double value) {
protected double calculate(Actor a, ActorTemplate t, double value) {
// final CharacterInventory inv = c.getInventory();
// if (inv.has(LEFT_FINGER))

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.actor.calculator;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.actor.stat.BaseStats;
import com.l2jserver.model.world.actor.stat.StatType;
@@ -39,7 +39,7 @@ public class MaximumHPBonusCalculator extends ActorFormula {
}
@Override
protected double calculate(Actor a, ActorTemplate<?> t, double value) {
protected double calculate(Actor a, ActorTemplate t, double value) {
return value
* BaseStats.CON.calculateBonus(a.getStats().getConcentration());
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.actor.calculator;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.actor.stat.BaseStats;
import com.l2jserver.model.world.actor.stat.StatType;
@@ -39,7 +39,7 @@ public class MaximumMPBonusCalculator extends ActorFormula {
}
@Override
protected double calculate(Actor a, ActorTemplate<?> t, double value) {
protected double calculate(Actor a, ActorTemplate t, double value) {
return value
* BaseStats.MEN.calculateBonus(a.getStats().getMentality());
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.actor.calculator;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.actor.stat.BaseStats;
import com.l2jserver.model.world.actor.stat.StatType;
@@ -41,7 +41,7 @@ public class PhysicalAttackBonusCalculator extends ActorFormula {
}
@Override
protected double calculate(Actor a, ActorTemplate<?> t, double value) {
protected double calculate(Actor a, ActorTemplate t, double value) {
return value * BaseStats.STR.calculateBonus(a.getStats().getStrength())
* ((100.0 - 11 + a.getLevel()) / 100.0);
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.actor.calculator;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.actor.stat.BaseStats;
import com.l2jserver.model.world.actor.stat.StatType;
@@ -40,7 +40,7 @@ public class PhysicalAttackSpeedBonusCalculator extends ActorFormula {
}
@Override
protected double calculate(Actor a, ActorTemplate<?> t, double value) {
protected double calculate(Actor a, ActorTemplate t, double value) {
return value
* BaseStats.DEX.calculateBonus(a.getStats().getDexterity());
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.actor.calculator;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.actor.stat.BaseStats;
import com.l2jserver.model.world.actor.stat.StatType;
@@ -41,7 +41,7 @@ public class PhysicalCriticalRateBonusCalculator extends ActorFormula {
}
@Override
protected double calculate(Actor a, ActorTemplate<?> t, double value) {
protected double calculate(Actor a, ActorTemplate t, double value) {
return value
* BaseStats.DEX.calculateBonus(a.getStats().getDexterity())
* 10;

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.actor.calculator;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.actor.stat.StatType;
@@ -51,7 +51,7 @@ public class PhysicalDefenseBonusCalculator extends ActorFormula {
}
@Override
protected double calculate(Actor a, ActorTemplate<?> t, double value) {
protected double calculate(Actor a, ActorTemplate t, double value) {
// final CharacterInventory inv = c.getInventory();
//
// // orc mystics are a special case

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.actor.calculator;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.actor.stat.BaseStats;
import com.l2jserver.model.world.actor.stat.StatType;
@@ -39,7 +39,7 @@ public class RunSpeedBonusCalculator extends ActorFormula {
}
@Override
protected double calculate(Actor c, ActorTemplate<?> t, double value) {
protected double calculate(Actor c, ActorTemplate t, double value) {
return value
* BaseStats.DEX.calculateBonus(c.getStats().getDexterity());
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.actor.calculator;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.actor.stat.BaseStats;
import com.l2jserver.model.world.actor.stat.StatType;
@@ -39,7 +39,7 @@ public class WalkSpeedBonusCalculator extends ActorFormula {
}
@Override
protected double calculate(Actor c, ActorTemplate<?> t, double value) {
protected double calculate(Actor c, ActorTemplate t, double value) {
return value
* BaseStats.DEX.calculateBonus(c.getStats().getDexterity());
}

View File

@@ -1,73 +0,0 @@
/*
* This file is part of l2jserver2 <l2jserver2.com>.
*
* l2jserver2 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.
*
* l2jserver2 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 l2jserver2. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.model.world.actor.effect;
import com.l2jserver.model.id.object.ActorID;
import com.l2jserver.model.id.template.EffectTemplateID;
import com.l2jserver.model.template.effect.EffectTemplate;
import com.l2jserver.model.world.Actor;
/**
* An simple {@link Effect} implementing basic methods. Effect implementations
* are encouraged to implement this class instead of {@link Effect} directly.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
* @param <T>
* the effect template type
*/
public abstract class AbstractEffect<T extends EffectTemplate> implements
Effect {
/**
* The effect template
*/
protected final T template;
/**
* The actor that the effect is applied to
*/
protected final Actor actor;
/**
* @param template
* the effect template
* @param actor
* the actor that the effect is applied to
*/
public AbstractEffect(T template, Actor actor) {
this.template = template;
this.actor = actor;
}
@Override
public EffectTemplateID getTemplateID() {
return template.getID();
}
@Override
public EffectTemplate getTemplate() {
return template;
}
@Override
public ActorID<?> getActorID() {
return actor.getID();
}
@Override
public Actor getActor() {
return actor;
}
}

View File

@@ -1,84 +0,0 @@
/*
* This file is part of l2jserver2 <l2jserver2.com>.
*
* l2jserver2 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.
*
* l2jserver2 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 l2jserver2. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.model.world.actor.effect;
import com.l2jserver.model.template.effect.EffectTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.util.exception.L2Exception;
/**
* An simple {@link TemporalEffect} implementing basic methods. Effect
* implementations are encouraged to implement this class instead of
* {@link TemporalEffect} directly.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
* @param <T>
* the effect template type
*/
public abstract class AbstractTemporalEffect<T extends EffectTemplate> extends
AbstractEffect<T> implements TemporalEffect {
/**
* The last time the effect ticked
*/
protected long lastCallTime;
/**
* @param template
* the effect template
* @param actor
* the actor that the effect is applied to
*/
public AbstractTemporalEffect(T template, Actor actor) {
super(template, actor);
}
@Override
public final void applyEffect() throws L2Exception {
lastCallTime = System.currentTimeMillis();
applyEffectImpl();
}
/**
* Applies the given effect to <tt>actor</tt>
*
* @throws L2Exception
* if any {@link L2Exception} occur
* @see TemporalEffect#applyEffect()
*/
public abstract void applyEffectImpl() throws L2Exception;
@Override
public final TemporalEffectAction continueEffect() {
long now = System.currentTimeMillis();
long delta = now - lastCallTime;
try {
return continueEffect(delta);
} finally {
lastCallTime = now;
}
}
/**
* Continues the effect calculation, if necessary.
*
* @param elapsedTime
* the time elapsed since the last call
* @return the next action
* @see TemporalEffect#continueEffect()
*/
protected abstract TemporalEffectAction continueEffect(long elapsedTime);
}

View File

@@ -1,59 +0,0 @@
/*
* This file is part of l2jserver2 <l2jserver2.com>.
*
* l2jserver2 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.
*
* l2jserver2 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 l2jserver2. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.model.world.actor.effect;
import com.l2jserver.model.id.ID;
import com.l2jserver.model.id.object.ActorID;
import com.l2jserver.model.id.template.EffectTemplateID;
import com.l2jserver.model.template.effect.EffectTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.util.exception.L2Exception;
/**
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Effect {
/**
* Applies the given effect to <tt>actor</tt>
*
* @throws L2Exception
* if any {@link L2Exception} occur
*/
void applyEffect() throws L2Exception;
/**
* @return this effect template id
*/
EffectTemplateID getTemplateID();
/**
* @return this effect template
*/
EffectTemplate getTemplate();
/**
* @return the actor {@link ID} to which this {@link Effect} is (or was or
* will be) applied to.
*/
ActorID<?> getActorID();
/**
* @return the {@link Actor} to which this {@link Effect} is (or was or will
* be) applied to.
*/
Actor getActor();
}

View File

@@ -1,54 +0,0 @@
/*
* This file is part of l2jserver2 <l2jserver2.com>.
*
* l2jserver2 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.
*
* l2jserver2 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 l2jserver2. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.model.world.actor.effect;
import com.l2jserver.service.game.effect.EffectService;
/**
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface TemporalEffect extends Effect {
/**
* Continues the effect calculation, if necessary.
*
* @return the next action
*/
TemporalEffectAction continueEffect();
/**
* The result from {@link TemporalEffect#continueEffect()}, instructs the
* {@link EffectService} in what it should do next.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public enum TemporalEffectAction {
/**
* Cancels the effect after this tick
*/
CANCEL,
/**
* Continues this effect for at least one more tick
*/
CONTINUE;
}
/**
* Ends the effect. Deattachs the actor from any service it may have been
* attached due to this effect and reverts actor back to normal state.
*/
void cancelEffect();
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character;
import com.l2jserver.model.template.item.ItemTemplate;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.calculator.ActorCalculator;
import com.l2jserver.model.world.actor.calculator.ActorCalculatorContext;
@@ -300,7 +300,7 @@ public class CharacterStats extends ActorStats<CharacterCalculatorContext> {
public void addMaxCP(Calculator<ActorCalculatorContext, StatType> formula) {
calculator.add(formula);
}
/**
* Reset the calculator to its default state
*/
@@ -315,17 +315,18 @@ public class CharacterStats extends ActorStats<CharacterCalculatorContext> {
public int getMaximumLoad() {
return (int) calc(StatType.MAX_LOAD);
}
/**
* Adds an formula to the character calculator
*
* @param formula
* the formula
*/
public void addMaximumLoad(Calculator<ActorCalculatorContext, StatType> formula) {
public void addMaximumLoad(
Calculator<ActorCalculatorContext, StatType> formula) {
calculator.add(formula);
}
/**
* Reset the calculator to its default state
*/
@@ -387,10 +388,10 @@ public class CharacterStats extends ActorStats<CharacterCalculatorContext> {
private void addItem(InventoryPaperdoll paperdoll) {
if (!character.getInventory().has(paperdoll))
return;
@SuppressWarnings("unused")
final ItemTemplate item = character.getInventory().getItem(paperdoll)
.getTemplate();
calculator.add(item.getPhysicalDamage());
calculator.add(item.getMagicalDamage());
// TODO add item calculator
}
@Override

View File

@@ -16,8 +16,8 @@
*/
package com.l2jserver.model.world.character.calculator;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.calculator.ActorCalculatorFunction;
@@ -41,7 +41,7 @@ public abstract class CharacterCalculatorFunction extends
}
@Override
protected final double calculate(Actor a, ActorTemplate<?> actorTemplate,
protected final double calculate(Actor a, ActorTemplate actorTemplate,
double value) {
return calculate((L2Character) a, (CharacterTemplate) actorTemplate,
value);

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
@@ -43,10 +43,10 @@ public class MaximumCPAddCalculator extends CharacterFormula {
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
int lvl = c.getLevel() - t.getMinimumLevel();
double mod = t.getBaseCPModifier() * lvl;
double max = (t.getBaseCPAdd() + mod) * lvl;
double min = (t.getBaseCPAdd() * lvl) + mod;
int lvl = c.getLevel() - t.getStats().getLevel();
double mod = t.getStats().getCp().getModifier() * lvl;
double max = (t.getStats().getCp().getAdd() + mod) * lvl;
double min = (t.getStats().getCp().getAdd() * lvl) + mod;
return value + (max + min) / 2;
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.BaseStats;
import com.l2jserver.model.world.actor.stat.StatType;

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
@@ -43,10 +43,10 @@ public class MaximumHPAddCalculator extends CharacterFormula {
@Override
public double calculate(L2Character c, CharacterTemplate t, double value) {
int lvl = c.getLevel() - t.getMinimumLevel();
double mod = t.getBaseHPModifier() * lvl;
double max = (t.getBaseHPAdd() + mod) * lvl;
double min = (t.getBaseHPAdd() * lvl) + mod;
int lvl = c.getLevel() - t.getStats().getLevel();
double mod = t.getStats().getHp().getModifier() * lvl;
double max = (t.getStats().getHp().getAdd() + mod) * lvl;
double min = ( t.getStats().getHp().getAdd() * lvl) + mod;
return value + (max + min) / 2;
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
@@ -43,10 +43,10 @@ public class MaximumMPAddCalculator extends CharacterFormula {
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
int lvl = c.getLevel() - t.getMinimumLevel();
double mod = t.getBaseMPModifier() * lvl;
double max = (t.getBaseMPAdd() + mod) * lvl;
double min = (t.getBaseMPAdd() * lvl) + mod;
int lvl = c.getLevel() - t.getStats().getLevel();
double mod = t.getStats().getMp().getModifier() * lvl;
double max = (t.getStats().getMp().getAdd() + mod) * lvl;
double min = (t.getStats().getMp().getAdd() * lvl) + mod;
return value + (max + min) / 2;
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -40,6 +40,6 @@ public class CharacterBaseAttackAccuracyCalculator extends CharacterFormula {
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBaseAccuracy();
return t.getStats().getAttack().getAccuracy();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -40,6 +40,6 @@ public class CharacterBaseAttackEvasionCalculator extends CharacterFormula {
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBaseEvasion();
return t.getStats().getAttack().getEvasion();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -40,6 +40,6 @@ public class CharacterBaseCPCalculator extends CharacterFormula {
@Override
public double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBaseCP();
return t.getStats().getCp().getBase();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -40,6 +40,6 @@ public class CharacterBaseConcentrationCalculator extends CharacterFormula {
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBaseConcentration();
return t.getStats().getBase().getCon();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -40,6 +40,6 @@ public class CharacterBaseDexterityCalculator extends CharacterFormula {
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBaseDexterity();
return t.getStats().getBase().getDex();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -40,6 +40,6 @@ public class CharacterBaseHPCalculator extends CharacterFormula {
@Override
public double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBaseHP();
return t.getStats().getHp().getBase();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -40,6 +40,6 @@ public class CharacterBaseIntelligenceCalculator extends CharacterFormula {
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBaseIntelligence();
return t.getStats().getBase().getInt();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -40,6 +40,6 @@ public class CharacterBaseMPCalculator extends CharacterFormula {
@Override
public double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBaseMP();
return t.getStats().getMp().getBase();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -41,6 +41,6 @@ public class CharacterBaseMagicalAttackCalculator extends CharacterFormula {
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBaseMagicalAttack();
return t.getStats().getAttack().getMagical().getDamage();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -40,6 +40,6 @@ public class CharacterBaseMagicalAttackSpeedCalculator extends CharacterFormula
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBaseMagicalAttackSpeed();
return t.getStats().getAttack().getMagical().getSpeed();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -42,6 +42,6 @@ public class CharacterBaseMagicalCriticalRateCalculator extends
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBaseCritical();
return t.getStats().getAttack().getCritical();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -51,6 +51,6 @@ public class CharacterBaseMagicalDefenseCalculator extends CharacterFormula {
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBaseMagicalDefense();
return t.getStats().getDefense().getMagical().getValue();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -40,6 +40,6 @@ public class CharacterBaseMentalityCalculator extends CharacterFormula {
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBaseMentality();
return t.getStats().getBase().getMen();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -42,6 +42,6 @@ public class CharacterBasePhysicalAttackCalculator extends CharacterFormula {
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBasePhysicalAttack();
return t.getStats().getAttack().getPhysical().getDamage();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -42,6 +42,6 @@ public class CharacterBasePhysicalAttackSpeedCalculator extends
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBasePhysicalAttackSpeed();
return t.getStats().getAttack().getPhysical().getSpeed();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -43,6 +43,6 @@ public class CharacterBasePhysicalCriticalRateCalculator extends
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBaseCritical();
return t.getStats().getAttack().getCritical();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -53,6 +53,6 @@ public class CharacterBasePhysicalDefenseCalculator extends CharacterFormula {
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBasePhysicalDefense();
return t.getStats().getDefense().getPhysical().getValue();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -41,6 +41,6 @@ public class CharacterBaseRunSpeedCalculator extends CharacterFormula {
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBaseRunSpeed();
return t.getStats().getMove().getRun();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -40,6 +40,6 @@ public class CharacterBaseStrengthCalculator extends CharacterFormula {
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBaseStrength();
return t.getStats().getBase().getStr();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -41,6 +41,6 @@ public class CharacterBaseWalkSpeedCalculator extends CharacterFormula {
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBaseWalkSpeed();
return t.getStats().getMove().getWalk();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.model.world.character.calculator.base;
import com.l2jserver.model.template.character.CharacterTemplate;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.actor.stat.StatType;
import com.l2jserver.model.world.character.calculator.CharacterFormula;
@@ -40,6 +40,6 @@ public class CharacterBaseWitnessCalculator extends CharacterFormula {
@Override
protected double calculate(L2Character c, CharacterTemplate t, double value) {
return t.getBaseWitness();
return t.getStats().getBase().getWit();
}
}

View File

@@ -17,12 +17,14 @@
package com.l2jserver.model.world.npc;
import java.util.Arrays;
import java.util.List;
import org.htmlparser.Parser;
import org.htmlparser.util.ParserException;
import com.google.inject.Inject;
import com.l2jserver.model.template.npc.NPCTemplate;
import com.l2jserver.model.template.NPCTemplate;
import com.l2jserver.model.template.NPCTemplate.Talk.Chat;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.NPC;
import com.l2jserver.service.game.character.CharacterService;
@@ -77,7 +79,7 @@ public abstract class BaseNPCController implements NPCController {
public void interact(NPC npc, L2Character character, final String... args)
throws L2Exception {
if (args.length == 2) {
switch(args[0]) {
switch (args[0]) {
case "Chat":
if (talk(npc, character,
Arrays.copyOfRange(args, 1, args.length)))
@@ -138,14 +140,21 @@ public abstract class BaseNPCController implements NPCController {
* @return the html code
*/
protected String getHTML(NPC npc, String id) {
// id correction - on l2j default chat is also "0".
if ("0".equals(id)) // avoid NullPointerException
id = null;
final NPCTemplate template = npc.getTemplate();
String html = template.getHTML(id);
if (html == null)
// id correction - on l2j default chat is also "0".
if ("0".equals(id) || id == null) // avoid NullPointerException
id = template.getTalk().getDefault();
final List<Chat> chats = template.getTalk().getChat();
String html = null;
for (final Chat chat : chats) {
if (chat.getId().equals(id)) {
html = chat.getValue();
break;
}
}
if(html == null)
return null;
// TODO use an decent template engine
return html.replaceAll("%objectId%", npc.getID().getID().toString());
}

View File

@@ -16,9 +16,9 @@
*/
package com.l2jserver.model.world.npc.calculator;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.model.template.NPCTemplate;
import com.l2jserver.model.template.Template;
import com.l2jserver.model.template.actor.ActorTemplate;
import com.l2jserver.model.template.npc.NPCTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.NPC;
import com.l2jserver.model.world.actor.calculator.ActorCalculatorFunction;
@@ -43,7 +43,7 @@ public abstract class NPCCalculatorFunction extends ActorCalculatorFunction {
}
@Override
protected final double calculate(Actor a, ActorTemplate<?> actorTemplate,
protected final double calculate(Actor a, ActorTemplate actorTemplate,
double value) {
return calculate((NPC) a, (NPCTemplate) actorTemplate, value);
}

Some files were not shown because too many files have changed in this diff Show More