mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-06 07:32:46 +00:00
Update assembly descriptor and improves significantly the documentation
Fixes an issue in the assembly descriptor that included older compilation binaries into assemblies. Improved javadoc documentation in more than 150 classes, including fixing mistakes.
This commit is contained in:
5
.project
5
.project
@@ -10,11 +10,6 @@
|
|||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
<buildCommand>
|
|
||||||
<name>org.maven.ide.eclipse.maven2Builder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
<buildCommand>
|
<buildCommand>
|
||||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||||
<arguments>
|
<arguments>
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
#Tue Sep 13 16:51:09 BRT 2011
|
#Tue Sep 13 17:32:00 BRT 2011
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||||
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
org.eclipse.jdt.core.compiler.source=1.7
|
||||||
|
|||||||
70
pom.xml
70
pom.xml
@@ -8,6 +8,45 @@
|
|||||||
<description>Lineage II server emulator</description>
|
<description>Lineage II server emulator</description>
|
||||||
<inceptionYear>2011</inceptionYear>
|
<inceptionYear>2011</inceptionYear>
|
||||||
|
|
||||||
|
<issueManagement>
|
||||||
|
<system>GitHub</system>
|
||||||
|
<url>https://github.com/l2jserver2/l2jserver2-gs/issues</url>
|
||||||
|
</issueManagement>
|
||||||
|
|
||||||
|
<ciManagement>
|
||||||
|
<system>GitHub</system>
|
||||||
|
<url>https://github.com/l2jserver2/l2jserver2-gs/wiki</url>
|
||||||
|
</ciManagement>
|
||||||
|
|
||||||
|
<developers>
|
||||||
|
<developer>
|
||||||
|
<id>rogiel</id>
|
||||||
|
<name>Rogiel</name>
|
||||||
|
<email>rogiel@rogiel.com</email>
|
||||||
|
<url>http://www.rogiel.com/</url>
|
||||||
|
<timezone>-3</timezone>
|
||||||
|
<roles>
|
||||||
|
<role>Creator</role>
|
||||||
|
<role>API Designer</role>
|
||||||
|
</roles>
|
||||||
|
</developer>
|
||||||
|
</developers>
|
||||||
|
|
||||||
|
<scm>
|
||||||
|
<connection>git://github.com/l2jserver2/l2jserver2-gs.git</connection>
|
||||||
|
<developerConnection>ssh://git@github.com:l2jserver2/l2jserver2-gs.git</developerConnection>
|
||||||
|
<tag>master</tag>
|
||||||
|
<url>https://github.com/l2jserver2/l2jserver2-gs</url>
|
||||||
|
</scm>
|
||||||
|
|
||||||
|
<licenses>
|
||||||
|
<license>
|
||||||
|
<name>GNU General Public License version 3</name>
|
||||||
|
<url>http://www.gnu.org/licenses/gpl.txt</url>
|
||||||
|
<distribution>manual</distribution>
|
||||||
|
</license>
|
||||||
|
</licenses>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<defaultGoal>package</defaultGoal>
|
<defaultGoal>package</defaultGoal>
|
||||||
<plugins>
|
<plugins>
|
||||||
@@ -198,40 +237,11 @@
|
|||||||
<!-- vfs -->
|
<!-- vfs -->
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<issueManagement>
|
|
||||||
<system>GitHub</system>
|
|
||||||
<url>https://github.com/Rogiel/l2jserver2-gs/issues</url>
|
|
||||||
</issueManagement>
|
|
||||||
<ciManagement>
|
|
||||||
<system>GitHub</system>
|
|
||||||
<url>https://github.com/Rogiel/l2jserver2-gs/wiki</url>
|
|
||||||
</ciManagement>
|
|
||||||
<developers>
|
|
||||||
<developer>
|
|
||||||
<id>rogiel</id>
|
|
||||||
<name>Rogiel</name>
|
|
||||||
<email>rogiel@rogiel.com</email>
|
|
||||||
<url>http://www.rogiel.com</url>
|
|
||||||
<timezone>GMT - 3</timezone>
|
|
||||||
<roles>
|
|
||||||
<role>Creator</role>
|
|
||||||
<role>API Designer</role>
|
|
||||||
</roles>
|
|
||||||
</developer>
|
|
||||||
</developers>
|
|
||||||
<contributors>
|
|
||||||
</contributors>
|
|
||||||
<scm>
|
|
||||||
<connection>git://github.com/Rogiel/l2jserver2-gs.git</connection>
|
|
||||||
<developerConnection>ssh://git@github.com:Rogiel/l2jserver2-gs.git</developerConnection>
|
|
||||||
<tag>master</tag>
|
|
||||||
<url>https://github.com/Rogiel/l2jserver2-gs</url>
|
|
||||||
</scm>
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>repository.jboss.org</id>
|
<id>repository.jboss.org</id>
|
||||||
<url>https://repository.jboss.org/nexus/content/repositories/releases/
|
<url>https://repository.jboss.org/nexus/content/repositories/releases/
|
||||||
</url>
|
</url>
|
||||||
<snapshots>
|
<snapshots>
|
||||||
<enabled>false</enabled>
|
<enabled>false</enabled>
|
||||||
</snapshots>
|
</snapshots>
|
||||||
|
|||||||
@@ -31,12 +31,8 @@
|
|||||||
<directory>${project.build.directory}</directory>
|
<directory>${project.build.directory}</directory>
|
||||||
<outputDirectory>/</outputDirectory>
|
<outputDirectory>/</outputDirectory>
|
||||||
<includes>
|
<includes>
|
||||||
<include>*.jar</include>
|
<include>${project.artifactId}-${project.version}.jar</include>
|
||||||
</includes>
|
</includes>
|
||||||
<excludes>
|
|
||||||
<exclude>*-sources.jar</exclude>
|
|
||||||
<exclude>*-javadoc.jar</exclude>
|
|
||||||
</excludes>
|
|
||||||
</fileSet>
|
</fileSet>
|
||||||
</fileSets>
|
</fileSets>
|
||||||
<dependencySets>
|
<dependencySets>
|
||||||
|
|||||||
@@ -31,12 +31,8 @@
|
|||||||
<directory>${project.build.directory}</directory>
|
<directory>${project.build.directory}</directory>
|
||||||
<outputDirectory>/</outputDirectory>
|
<outputDirectory>/</outputDirectory>
|
||||||
<includes>
|
<includes>
|
||||||
<include>*.jar</include>
|
<include>${project.artifactId}-${project.version}.jar</include>
|
||||||
</includes>
|
</includes>
|
||||||
<excludes>
|
|
||||||
<exclude>*-sources.jar</exclude>
|
|
||||||
<exclude>*-javadoc.jar</exclude>
|
|
||||||
</excludes>
|
|
||||||
</fileSet>
|
</fileSet>
|
||||||
</fileSets>
|
</fileSets>
|
||||||
<dependencySets>
|
<dependencySets>
|
||||||
|
|||||||
@@ -30,8 +30,17 @@ import com.l2jserver.service.game.world.WorldIDService;
|
|||||||
import com.l2jserver.service.network.NetworkService;
|
import com.l2jserver.service.network.NetworkService;
|
||||||
import com.l2jserver.service.network.keygen.BlowfishKeygenService;
|
import com.l2jserver.service.network.keygen.BlowfishKeygenService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main class
|
||||||
|
*
|
||||||
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
|
*/
|
||||||
public class L2JGameServerMain {
|
public class L2JGameServerMain {
|
||||||
public static void main(String[] args) throws InterruptedException {
|
/**
|
||||||
|
* Main method
|
||||||
|
* @param args no arguments are used
|
||||||
|
*/
|
||||||
|
public static void main(String[] args) {
|
||||||
final L2JGameServer server = new L2JGameServer();
|
final L2JGameServer server = new L2JGameServer();
|
||||||
try {
|
try {
|
||||||
final ServiceManager serviceManager = server.getInjector()
|
final ServiceManager serviceManager = server.getInjector()
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.google.inject.Inject;
|
|||||||
import com.l2jserver.game.ai.desires.Desire;
|
import com.l2jserver.game.ai.desires.Desire;
|
||||||
import com.l2jserver.game.ai.desires.DesireQueue;
|
import com.l2jserver.game.ai.desires.DesireQueue;
|
||||||
import com.l2jserver.model.world.Actor;
|
import com.l2jserver.model.world.Actor;
|
||||||
|
import com.l2jserver.service.game.world.WorldService;
|
||||||
import com.l2jserver.service.game.world.event.WorldEventDispatcher;
|
import com.l2jserver.service.game.world.event.WorldEventDispatcher;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,9 +38,18 @@ public abstract class AI<T extends Actor> {
|
|||||||
*/
|
*/
|
||||||
protected final T actor;
|
protected final T actor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The {@link WorldService} event dispatcher
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
protected WorldEventDispatcher eventDispatcher;
|
protected WorldEventDispatcher eventDispatcher;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new AI
|
||||||
|
*
|
||||||
|
* @param actor
|
||||||
|
* the actor controlled by this {@link AI}
|
||||||
|
*/
|
||||||
protected AI(T actor) {
|
protected AI(T actor) {
|
||||||
this.actor = actor;
|
this.actor = actor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,20 +62,6 @@ public class Lineage2Client {
|
|||||||
* The Lineage 2 session
|
* The Lineage 2 session
|
||||||
*/
|
*/
|
||||||
private Lineage2Session session;
|
private Lineage2Session session;
|
||||||
/**
|
|
||||||
* The connection state
|
|
||||||
*/
|
|
||||||
private ConnectionState state = ConnectionState.CONNECTED;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Each connection is represented by an state: connected, authenticated and
|
|
||||||
* in-game.
|
|
||||||
*
|
|
||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
|
||||||
*/
|
|
||||||
public enum ConnectionState {
|
|
||||||
CONNECTED, AUTHENTICATED, IN_GAME;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The client supported protocol version
|
* The client supported protocol version
|
||||||
@@ -99,6 +85,8 @@ public class Lineage2Client {
|
|||||||
*
|
*
|
||||||
* @param worldService
|
* @param worldService
|
||||||
* the world service
|
* the world service
|
||||||
|
* @param networkService
|
||||||
|
* the network service
|
||||||
* @param channel
|
* @param channel
|
||||||
* the channel
|
* the channel
|
||||||
*/
|
*/
|
||||||
@@ -155,21 +143,6 @@ public class Lineage2Client {
|
|||||||
this.session = session;
|
this.session = session;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the state
|
|
||||||
*/
|
|
||||||
public ConnectionState getState() {
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param state
|
|
||||||
* the state to set
|
|
||||||
*/
|
|
||||||
public void setState(ConnectionState state) {
|
|
||||||
this.state = state;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the version
|
* @return the version
|
||||||
*/
|
*/
|
||||||
@@ -190,6 +163,7 @@ public class Lineage2Client {
|
|||||||
* if the protocol is not known false will always be returned.
|
* if the protocol is not known false will always be returned.
|
||||||
*
|
*
|
||||||
* @param version
|
* @param version
|
||||||
|
* the protocol version to test for support
|
||||||
* @return true if version is supported by the client
|
* @return true if version is supported by the client
|
||||||
* @see com.l2jserver.game.net.ProtocolVersion#supports(com.l2jserver.game.net.ProtocolVersion)
|
* @see com.l2jserver.game.net.ProtocolVersion#supports(com.l2jserver.game.net.ProtocolVersion)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -78,6 +78,11 @@ public class Lineage2CryptographyKey {
|
|||||||
key[11] = (byte) (old >> 0x18 & 0xff);
|
key[11] = (byte) (old >> 0x18 & 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a copy of this key
|
||||||
|
*
|
||||||
|
* @return the copied key
|
||||||
|
*/
|
||||||
public Lineage2CryptographyKey copy() {
|
public Lineage2CryptographyKey copy() {
|
||||||
return new Lineage2CryptographyKey(Arrays.copyOf(key, key.length));
|
return new Lineage2CryptographyKey(Arrays.copyOf(key, key.length));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import org.jboss.netty.channel.ChannelPipelineFactory;
|
|||||||
import org.jboss.netty.handler.logging.LoggingHandler;
|
import org.jboss.netty.handler.logging.LoggingHandler;
|
||||||
import org.jboss.netty.logging.InternalLogLevel;
|
import org.jboss.netty.logging.InternalLogLevel;
|
||||||
|
|
||||||
|
import com.google.inject.Guice;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Injector;
|
import com.google.inject.Injector;
|
||||||
import com.l2jserver.game.net.codec.Lineage2Decrypter;
|
import com.l2jserver.game.net.codec.Lineage2Decrypter;
|
||||||
@@ -56,6 +57,12 @@ public class Lineage2PipelineFactory implements ChannelPipelineFactory {
|
|||||||
*/
|
*/
|
||||||
private final WorldService worldService;
|
private final WorldService worldService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of this pipeline
|
||||||
|
* @param injector the {@link Guice} {@link Injector}
|
||||||
|
* @param networkService the network service
|
||||||
|
* @param worldService the world service
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public Lineage2PipelineFactory(Injector injector,
|
public Lineage2PipelineFactory(Injector injector,
|
||||||
NetworkService networkService, WorldService worldService) {
|
NetworkService networkService, WorldService worldService) {
|
||||||
|
|||||||
@@ -40,18 +40,45 @@ public enum ProtocolVersion {
|
|||||||
*/
|
*/
|
||||||
HIGH5(268, FREYA);
|
HIGH5(268, FREYA);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The parent version
|
||||||
|
*/
|
||||||
public final ProtocolVersion parent;
|
public final ProtocolVersion parent;
|
||||||
|
/**
|
||||||
|
* This version numeric ID
|
||||||
|
*/
|
||||||
public final int version;
|
public final int version;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance
|
||||||
|
*
|
||||||
|
* @param version
|
||||||
|
* the version integer id
|
||||||
|
*/
|
||||||
ProtocolVersion(int version) {
|
ProtocolVersion(int version) {
|
||||||
this(version, null);
|
this(version, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance with a parent version
|
||||||
|
*
|
||||||
|
* @param version
|
||||||
|
* the version integer id
|
||||||
|
* @param parent
|
||||||
|
* the parent version
|
||||||
|
*/
|
||||||
ProtocolVersion(int version, ProtocolVersion parent) {
|
ProtocolVersion(int version, ProtocolVersion parent) {
|
||||||
this.version = version;
|
this.version = version;
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if an given version is compatible with this
|
||||||
|
*
|
||||||
|
* @param version
|
||||||
|
* the target version to be tested
|
||||||
|
* @return true if version is compatible
|
||||||
|
*/
|
||||||
public boolean supports(ProtocolVersion version) {
|
public boolean supports(ProtocolVersion version) {
|
||||||
if (this == version)
|
if (this == version)
|
||||||
return true;
|
return true;
|
||||||
@@ -60,6 +87,11 @@ public enum ProtocolVersion {
|
|||||||
return this.parent.supports(version);
|
return this.parent.supports(version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param version
|
||||||
|
* the version integer id
|
||||||
|
* @return the detected version from the numeric id. Can be <tt>null</tt>
|
||||||
|
*/
|
||||||
public static ProtocolVersion fromVersion(int version) {
|
public static ProtocolVersion fromVersion(int version) {
|
||||||
for (ProtocolVersion v : values()) {
|
for (ProtocolVersion v : values()) {
|
||||||
if (v.version == version)
|
if (v.version == version)
|
||||||
|
|||||||
@@ -15206,9 +15206,19 @@ public enum SystemMessage {
|
|||||||
*/
|
*/
|
||||||
THOMAS_D_TURKEY_DISAPPEARED(6505);
|
THOMAS_D_TURKEY_DISAPPEARED(6505);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The system message integer id
|
||||||
|
*/
|
||||||
public final int id;
|
public final int id;
|
||||||
|
/**
|
||||||
|
* The cached {@link SM_SYSTEM_MESSAGE} packet
|
||||||
|
*/
|
||||||
public final SM_SYSTEM_MESSAGE packet;
|
public final SM_SYSTEM_MESSAGE packet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id
|
||||||
|
* the integer id
|
||||||
|
*/
|
||||||
SystemMessage(int id) {
|
SystemMessage(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.packet = new SM_SYSTEM_MESSAGE(this);
|
this.packet = new SM_SYSTEM_MESSAGE(this);
|
||||||
|
|||||||
@@ -70,7 +70,8 @@ public class Lineage2Decrypter extends OneToOneDecoder {
|
|||||||
/**
|
/**
|
||||||
* Creates a random key and enables descrypting
|
* Creates a random key and enables descrypting
|
||||||
*
|
*
|
||||||
* @return the generated key
|
* @param key
|
||||||
|
* the key
|
||||||
*/
|
*/
|
||||||
public void enable(Lineage2CryptographyKey key) {
|
public void enable(Lineage2CryptographyKey key) {
|
||||||
this.setKey(key);
|
this.setKey(key);
|
||||||
@@ -89,10 +90,19 @@ public class Lineage2Decrypter extends OneToOneDecoder {
|
|||||||
this.key = key;
|
this.key = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if decrypter is enabled
|
||||||
|
*/
|
||||||
public boolean isEnabled() {
|
public boolean isEnabled() {
|
||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the state of this decrypter
|
||||||
|
*
|
||||||
|
* @param enabled
|
||||||
|
* the new state
|
||||||
|
*/
|
||||||
public void setEnabled(boolean enabled) {
|
public void setEnabled(boolean enabled) {
|
||||||
this.enabled = enabled;
|
this.enabled = enabled;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,10 +90,19 @@ public class Lineage2Encrypter extends OneToOneEncoder {
|
|||||||
this.key = key;
|
this.key = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if this encrypter is enabled
|
||||||
|
*/
|
||||||
public boolean isEnabled() {
|
public boolean isEnabled() {
|
||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the state of this encrypter
|
||||||
|
*
|
||||||
|
* @param enabled
|
||||||
|
* the new state
|
||||||
|
*/
|
||||||
public void setEnabled(boolean enabled) {
|
public void setEnabled(boolean enabled) {
|
||||||
this.enabled = enabled;
|
this.enabled = enabled;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ import org.jboss.netty.handler.codec.frame.FrameDecoder;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class Lineage2FrameDecoder extends FrameDecoder {
|
public class Lineage2FrameDecoder extends FrameDecoder {
|
||||||
|
/**
|
||||||
|
* The message header size (in bytes)
|
||||||
|
*/
|
||||||
private static final int HEADER_SIZE = 2;
|
private static final int HEADER_SIZE = 2;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -53,6 +53,14 @@ public class Lineage2PacketHandler extends SimpleChannelHandler {
|
|||||||
*/
|
*/
|
||||||
private Lineage2Client connection;
|
private Lineage2Client connection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of the packet handler
|
||||||
|
*
|
||||||
|
* @param nettyNetworkService
|
||||||
|
* the netty network service
|
||||||
|
* @param worldService
|
||||||
|
* the world service
|
||||||
|
*/
|
||||||
public Lineage2PacketHandler(NettyNetworkService nettyNetworkService,
|
public Lineage2PacketHandler(NettyNetworkService nettyNetworkService,
|
||||||
WorldService worldService) {
|
WorldService worldService) {
|
||||||
this.nettyNetworkService = nettyNetworkService;
|
this.nettyNetworkService = nettyNetworkService;
|
||||||
|
|||||||
@@ -23,8 +23,17 @@ package com.l2jserver.game.net.packet;
|
|||||||
* @see ServerPacket
|
* @see ServerPacket
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractServerPacket implements ServerPacket {
|
public abstract class AbstractServerPacket implements ServerPacket {
|
||||||
|
/**
|
||||||
|
* The packet OPCODE
|
||||||
|
*/
|
||||||
private final int opcode;
|
private final int opcode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of the packet
|
||||||
|
*
|
||||||
|
* @param opcode
|
||||||
|
* the packet opcode
|
||||||
|
*/
|
||||||
public AbstractServerPacket(int opcode) {
|
public AbstractServerPacket(int opcode) {
|
||||||
this.opcode = opcode;
|
this.opcode = opcode;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,35 +43,108 @@ public class CM_ACTION_USE extends AbstractClientPacket {
|
|||||||
*/
|
*/
|
||||||
private final CharacterService charService;
|
private final CharacterService charService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The action to be performed
|
||||||
|
*/
|
||||||
private Action action;
|
private Action action;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The enumeration of all possible actions
|
||||||
|
*
|
||||||
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
|
*/
|
||||||
public enum Action {
|
public enum Action {
|
||||||
SIT_STAND(0), WALK_RUN(1),
|
/**
|
||||||
|
* Toggles the character in SIT or STAND mode
|
||||||
PRIVATE_STORE_SELL(10), PRIVATE_STORE_BUY(11),
|
*/
|
||||||
|
SIT_STAND(0),
|
||||||
PET_FOLLOW_MOVE(15), PET_FOLLOW_MOVE2(21),
|
/**
|
||||||
|
* Toggles the character in WALK or RUN mode
|
||||||
PET_ATTACK(16), PET_ATTACK2(22),
|
*/
|
||||||
|
WALK_RUN(1),
|
||||||
PET_STOP(17), PET_STOP2(23),
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stats a new private store sell
|
||||||
|
*/
|
||||||
|
PRIVATE_STORE_SELL(10),
|
||||||
|
/**
|
||||||
|
* Stats a new private store buy
|
||||||
|
*/
|
||||||
|
PRIVATE_STORE_BUY(11),
|
||||||
|
/**
|
||||||
|
* Sets the pet in follow mode
|
||||||
|
*/
|
||||||
|
PET_FOLLOW_MOVE(15),
|
||||||
|
/**
|
||||||
|
* Sets the pet in follow mode 2
|
||||||
|
*/
|
||||||
|
PET_FOLLOW_MOVE2(21),
|
||||||
|
/**
|
||||||
|
* Orders the pet to attack
|
||||||
|
*/
|
||||||
|
PET_ATTACK(16),
|
||||||
|
/**
|
||||||
|
* Orders the pet to attack (second type)
|
||||||
|
*/
|
||||||
|
PET_ATTACK2(22),
|
||||||
|
/**
|
||||||
|
* Orders the pet to stop
|
||||||
|
*/
|
||||||
|
PET_STOP(17),
|
||||||
|
/**
|
||||||
|
* Orders the pet to stop (second type)
|
||||||
|
*/
|
||||||
|
PET_STOP2(23),
|
||||||
|
/**
|
||||||
|
* Unsummons the pet
|
||||||
|
*/
|
||||||
PET_UNSUMMON(19),
|
PET_UNSUMMON(19),
|
||||||
|
/**
|
||||||
|
* Mounts or dismount from pet
|
||||||
|
*/
|
||||||
MOUNT_DISMOUNT(38),
|
MOUNT_DISMOUNT(38),
|
||||||
|
/**
|
||||||
|
* Switch Wild Hog Cannon mode
|
||||||
|
*/
|
||||||
|
WILD_HOG_CANNON_SWITCH_MODE(32),
|
||||||
|
/**
|
||||||
|
* Stops Wild Hog Cannon
|
||||||
|
*/
|
||||||
|
WILD_HOG_CANNON_STOP(41),
|
||||||
|
|
||||||
WILD_HOG_CANNON_SWITCH_MODE(32), WILD_HOG_CANNON_STOP(41),
|
/**
|
||||||
|
* Souless toxic smoke
|
||||||
SOULESS_TOXIC_SMOKE(36), SOULESS_PARASITE_BURST(39),
|
*/
|
||||||
|
SOULESS_TOXIC_SMOKE(36),
|
||||||
|
/**
|
||||||
|
* Souless parasite burst
|
||||||
|
*/
|
||||||
|
SOULESS_PARASITE_BURST(39),
|
||||||
|
/**
|
||||||
|
* Creates a new darwven manufacture
|
||||||
|
*/
|
||||||
DWARVEN_MANUFACTURE(37);
|
DWARVEN_MANUFACTURE(37);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The numeric action id
|
||||||
|
*/
|
||||||
public final int id;
|
public final int id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id
|
||||||
|
* the numeric action id
|
||||||
|
*/
|
||||||
Action(int id) {
|
Action(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolves the numeric id into an Java type action
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* the numeric id
|
||||||
|
* @return the resolved action
|
||||||
|
*/
|
||||||
public static Action fromID(int id) {
|
public static Action fromID(int id) {
|
||||||
for (final Action action : values())
|
for (final Action action : values())
|
||||||
if (action.id == id)
|
if (action.id == id)
|
||||||
@@ -80,11 +153,21 @@ public class CM_ACTION_USE extends AbstractClientPacket {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If CTRL key was pressed for this action
|
||||||
|
*/
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private boolean ctrlPressed;
|
private boolean ctrlPressed;
|
||||||
|
/**
|
||||||
|
* If SHIFT key was pressed for this action
|
||||||
|
*/
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private boolean shiftPressed;
|
private boolean shiftPressed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param charService
|
||||||
|
* the character service
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public CM_ACTION_USE(CharacterService charService) {
|
public CM_ACTION_USE(CharacterService charService) {
|
||||||
this.charService = charService;
|
this.charService = charService;
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ public class CM_ADMIN_COMMAND extends AbstractClientPacket {
|
|||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private String command;
|
private String command;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param adminService
|
||||||
|
* the administrator service
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public CM_ADMIN_COMMAND(AdministratorService adminService) {
|
public CM_ADMIN_COMMAND(AdministratorService adminService) {
|
||||||
this.adminService = adminService;
|
this.adminService = adminService;
|
||||||
|
|||||||
@@ -76,6 +76,11 @@ public class CM_ATTACK extends AbstractClientPacket {
|
|||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private CharacterAttackAction action;
|
private CharacterAttackAction action;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enumeration of all possible attack actions
|
||||||
|
*
|
||||||
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
|
*/
|
||||||
public enum CharacterAttackAction {
|
public enum CharacterAttackAction {
|
||||||
/**
|
/**
|
||||||
* Normal click
|
* Normal click
|
||||||
@@ -86,12 +91,27 @@ public class CM_ATTACK extends AbstractClientPacket {
|
|||||||
*/
|
*/
|
||||||
SHIFT_CLICK(1);
|
SHIFT_CLICK(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attack action numeric id
|
||||||
|
*/
|
||||||
public final int id;
|
public final int id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id
|
||||||
|
* the action numeric id
|
||||||
|
*/
|
||||||
CharacterAttackAction(int id) {
|
CharacterAttackAction(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolves the numeric action id to an {@link CharacterAttackAction}
|
||||||
|
* type
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* the numeric id
|
||||||
|
* @return the resolved action
|
||||||
|
*/
|
||||||
public static CharacterAttackAction fromID(int id) {
|
public static CharacterAttackAction fromID(int id) {
|
||||||
for (final CharacterAttackAction action : values())
|
for (final CharacterAttackAction action : values())
|
||||||
if (action.id == id)
|
if (action.id == id)
|
||||||
@@ -100,6 +120,12 @@ public class CM_ATTACK extends AbstractClientPacket {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param charService
|
||||||
|
* the character service
|
||||||
|
* @param idResolver
|
||||||
|
* the object id resolver
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public CM_ATTACK(CharacterService charService, ObjectIDResolver idResolver) {
|
public CM_ATTACK(CharacterService charService, ObjectIDResolver idResolver) {
|
||||||
this.charService = charService;
|
this.charService = charService;
|
||||||
|
|||||||
@@ -58,11 +58,29 @@ public class CM_AUTH_LOGIN extends AbstractClientPacket {
|
|||||||
* User account name
|
* User account name
|
||||||
*/
|
*/
|
||||||
private String loginName;
|
private String loginName;
|
||||||
|
/**
|
||||||
|
* The play key 1
|
||||||
|
*/
|
||||||
private int playKey1;
|
private int playKey1;
|
||||||
|
/**
|
||||||
|
* The play key 2
|
||||||
|
*/
|
||||||
private int playKey2;
|
private int playKey2;
|
||||||
|
/**
|
||||||
|
* The login key 1
|
||||||
|
*/
|
||||||
private int loginKey1;
|
private int loginKey1;
|
||||||
|
/**
|
||||||
|
* The login key 2
|
||||||
|
*/
|
||||||
private int loginKey2;
|
private int loginKey2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param characterDao
|
||||||
|
* the character DAO
|
||||||
|
* @param accountIdFactory
|
||||||
|
* the account id factory
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public CM_AUTH_LOGIN(CharacterDAO characterDao,
|
public CM_AUTH_LOGIN(CharacterDAO characterDao,
|
||||||
AccountIDProvider accountIdFactory) {
|
AccountIDProvider accountIdFactory) {
|
||||||
|
|||||||
@@ -40,6 +40,9 @@ import com.l2jserver.util.BufferUtils;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class CM_BYPASS extends AbstractClientPacket {
|
public class CM_BYPASS extends AbstractClientPacket {
|
||||||
|
/**
|
||||||
|
* The logger
|
||||||
|
*/
|
||||||
private final Logger log = LoggerFactory.getLogger(this.getClass());
|
private final Logger log = LoggerFactory.getLogger(this.getClass());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,6 +64,12 @@ public class CM_BYPASS extends AbstractClientPacket {
|
|||||||
*/
|
*/
|
||||||
private String command;
|
private String command;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param idResolver
|
||||||
|
* the object id resolver
|
||||||
|
* @param npcService
|
||||||
|
* the {@link NPC} service
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public CM_BYPASS(ObjectIDResolver idResolver, NPCService npcService) {
|
public CM_BYPASS(ObjectIDResolver idResolver, NPCService npcService) {
|
||||||
this.idResolver = idResolver;
|
this.idResolver = idResolver;
|
||||||
@@ -98,6 +107,11 @@ public class CM_BYPASS extends AbstractClientPacket {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tokenizer
|
||||||
|
* the tokenizer
|
||||||
|
* @return an array of strings with each parameter
|
||||||
|
*/
|
||||||
private String[] createArgumentArray(StringTokenizer tokenizer) {
|
private String[] createArgumentArray(StringTokenizer tokenizer) {
|
||||||
if (!tokenizer.hasMoreTokens())
|
if (!tokenizer.hasMoreTokens())
|
||||||
return new String[0];
|
return new String[0];
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ public class SM_SYSTEM_MESSAGE extends AbstractServerPacket {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new instance
|
* Creates a new instance
|
||||||
|
*
|
||||||
|
* @param message
|
||||||
|
* the {@link SystemMessage}
|
||||||
*/
|
*/
|
||||||
public SM_SYSTEM_MESSAGE(SystemMessage message) {
|
public SM_SYSTEM_MESSAGE(SystemMessage message) {
|
||||||
super(OPCODE);
|
super(OPCODE);
|
||||||
@@ -108,8 +111,9 @@ public class SM_SYSTEM_MESSAGE extends AbstractServerPacket {
|
|||||||
* 81-89 Territory names<br>
|
* 81-89 Territory names<br>
|
||||||
* 101-121 Fortress names<br>
|
* 101-121 Fortress names<br>
|
||||||
*
|
*
|
||||||
* @param number
|
* @param fort
|
||||||
* @return
|
* the fort
|
||||||
|
* @return the {@link SM_SYSTEM_MESSAGE} instance
|
||||||
*/
|
*/
|
||||||
public final SM_SYSTEM_MESSAGE addFort(final Fort fort) {
|
public final SM_SYSTEM_MESSAGE addFort(final Fort fort) {
|
||||||
params.add(new SystemMessagePacketParameter() {
|
params.add(new SystemMessagePacketParameter() {
|
||||||
@@ -206,7 +210,8 @@ public class SM_SYSTEM_MESSAGE extends AbstractServerPacket {
|
|||||||
* Elemental name - 0(Fire) ...
|
* Elemental name - 0(Fire) ...
|
||||||
*
|
*
|
||||||
* @param type
|
* @param type
|
||||||
* @return
|
* the type
|
||||||
|
* @return the {@link SM_SYSTEM_MESSAGE} instance
|
||||||
*/
|
*/
|
||||||
public final SM_SYSTEM_MESSAGE addElemntal(final int type) {
|
public final SM_SYSTEM_MESSAGE addElemntal(final int type) {
|
||||||
params.add(new SystemMessagePacketParameter() {
|
params.add(new SystemMessagePacketParameter() {
|
||||||
@@ -223,7 +228,8 @@ public class SM_SYSTEM_MESSAGE extends AbstractServerPacket {
|
|||||||
* ID from sysstring-e.dat
|
* ID from sysstring-e.dat
|
||||||
*
|
*
|
||||||
* @param type
|
* @param type
|
||||||
* @return
|
* the type
|
||||||
|
* @return the {@link SM_SYSTEM_MESSAGE} instance
|
||||||
*/
|
*/
|
||||||
public final SM_SYSTEM_MESSAGE addSystemString(final int type) {
|
public final SM_SYSTEM_MESSAGE addSystemString(final int type) {
|
||||||
params.add(new SystemMessagePacketParameter() {
|
params.add(new SystemMessagePacketParameter() {
|
||||||
@@ -241,7 +247,7 @@ public class SM_SYSTEM_MESSAGE extends AbstractServerPacket {
|
|||||||
*
|
*
|
||||||
* @param type
|
* @param type
|
||||||
* id of instance
|
* id of instance
|
||||||
* @return
|
* @return the {@link SM_SYSTEM_MESSAGE} instance
|
||||||
*/
|
*/
|
||||||
public final SM_SYSTEM_MESSAGE addInstanceName(final int type) {
|
public final SM_SYSTEM_MESSAGE addInstanceName(final int type) {
|
||||||
params.add(new SystemMessagePacketParameter() {
|
params.add(new SystemMessagePacketParameter() {
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ import com.l2jserver.model.id.ID;
|
|||||||
/**
|
/**
|
||||||
* Simple model interface implementing {@link ID} related methods
|
* Simple model interface implementing {@link ID} related methods
|
||||||
*
|
*
|
||||||
|
* @param <T>
|
||||||
|
* the ID type used to represent this {@link Model}
|
||||||
|
*
|
||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractModel<T extends ID<?>> implements Model<T> {
|
public abstract class AbstractModel<T extends ID<?>> implements Model<T> {
|
||||||
@@ -63,6 +66,7 @@ public abstract class AbstractModel<T extends ID<?>> implements Model<T> {
|
|||||||
* {@link ObjectDesire#INSERT} or {@link ObjectDesire#DELETE} the desire
|
* {@link ObjectDesire#INSERT} or {@link ObjectDesire#DELETE} the desire
|
||||||
* will not be changed.
|
* will not be changed.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("javadoc")
|
||||||
protected void desireUpdate() {
|
protected void desireUpdate() {
|
||||||
if (this.desire != ObjectDesire.INSERT
|
if (this.desire != ObjectDesire.INSERT
|
||||||
&& this.desire != ObjectDesire.DELETE)
|
&& this.desire != ObjectDesire.DELETE)
|
||||||
@@ -73,6 +77,7 @@ public abstract class AbstractModel<T extends ID<?>> implements Model<T> {
|
|||||||
* Set this object desire to {@link ObjectDesire#INSERT}. If the desire is
|
* Set this object desire to {@link ObjectDesire#INSERT}. If the desire is
|
||||||
* {@link ObjectDesire#DELETE} the desire will not be changed.
|
* {@link ObjectDesire#DELETE} the desire will not be changed.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("javadoc")
|
||||||
protected void desireInsert() {
|
protected void desireInsert() {
|
||||||
if (this.desire != ObjectDesire.DELETE)
|
if (this.desire != ObjectDesire.DELETE)
|
||||||
this.desire = ObjectDesire.INSERT;
|
this.desire = ObjectDesire.INSERT;
|
||||||
|
|||||||
@@ -20,8 +20,13 @@ import com.l2jserver.model.id.ID;
|
|||||||
import com.l2jserver.service.database.DatabaseService;
|
import com.l2jserver.service.database.DatabaseService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* Base model. Each object model must implement this interface to be able to be
|
||||||
|
* inserted into the database.
|
||||||
*
|
*
|
||||||
|
* @param <T>
|
||||||
|
* the {@link ID} type used to represent this {@link Model}
|
||||||
|
*
|
||||||
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public interface Model<T extends ID<?>> {
|
public interface Model<T extends ID<?>> {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public interface NPCDAO extends DataAccessObject<NPC, NPCID>, Cacheable {
|
|||||||
/**
|
/**
|
||||||
* Select an {@link NPC} by its template.
|
* Select an {@link NPC} by its template.
|
||||||
*
|
*
|
||||||
* @param name
|
* @param templateID
|
||||||
* the npc template id
|
* the npc template id
|
||||||
* @return the found NPC. Null if does not exists.
|
* @return the found NPC. Null if does not exists.
|
||||||
*/
|
*/
|
||||||
|
|||||||
133
src/main/java/com/l2jserver/model/game/Castle.java
Normal file
133
src/main/java/com/l2jserver/model/game/Castle.java
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
/*
|
||||||
|
* 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.game;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.l2jserver.model.AbstractModel;
|
||||||
|
import com.l2jserver.model.id.CastleID;
|
||||||
|
import com.l2jserver.model.id.FortID;
|
||||||
|
import com.l2jserver.model.id.object.CharacterID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An fort in Lineage II game world
|
||||||
|
*
|
||||||
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
|
*/
|
||||||
|
public class Castle extends AbstractModel<FortID> {
|
||||||
|
/**
|
||||||
|
* The {@link Castle} of which this {@link Castle} belongs to
|
||||||
|
*/
|
||||||
|
private CastleID castleID;
|
||||||
|
/**
|
||||||
|
* The owner (clan leader) of which this {@link Castle} belongs to.
|
||||||
|
*/
|
||||||
|
private CharacterID ownerID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The castle name
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* The siege date
|
||||||
|
*/
|
||||||
|
private Date siegeDate;
|
||||||
|
/**
|
||||||
|
* The last time this fort was owned by someone
|
||||||
|
*/
|
||||||
|
private Date lastOwnedTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the castleID
|
||||||
|
*/
|
||||||
|
public CastleID getCastleID() {
|
||||||
|
return castleID;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param castleID
|
||||||
|
* the castleID to set
|
||||||
|
*/
|
||||||
|
public void setCastleID(CastleID castleID) {
|
||||||
|
desireUpdate();
|
||||||
|
this.castleID = castleID;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the ownerID
|
||||||
|
*/
|
||||||
|
public CharacterID getOwnerID() {
|
||||||
|
return ownerID;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ownerID
|
||||||
|
* the ownerID to set
|
||||||
|
*/
|
||||||
|
public void setOwnerID(CharacterID ownerID) {
|
||||||
|
desireUpdate();
|
||||||
|
this.ownerID = ownerID;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the name
|
||||||
|
*/
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param name
|
||||||
|
* the name to set
|
||||||
|
*/
|
||||||
|
public void setName(String name) {
|
||||||
|
desireUpdate();
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the siegeDate
|
||||||
|
*/
|
||||||
|
public Date getSiegeDate() {
|
||||||
|
return siegeDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param siegeDate
|
||||||
|
* the siegeDate to set
|
||||||
|
*/
|
||||||
|
public void setSiegeDate(Date siegeDate) {
|
||||||
|
desireUpdate();
|
||||||
|
this.siegeDate = siegeDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the lastOwnedTime
|
||||||
|
*/
|
||||||
|
public Date getLastOwnedTime() {
|
||||||
|
return lastOwnedTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param lastOwnedTime
|
||||||
|
* the lastOwnedTime to set
|
||||||
|
*/
|
||||||
|
public void setLastOwnedTime(Date lastOwnedTime) {
|
||||||
|
desireUpdate();
|
||||||
|
this.lastOwnedTime = lastOwnedTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,22 +27,38 @@ import com.l2jserver.model.world.L2Character;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class CharacterFriend extends AbstractModel<FriendID> {
|
public class CharacterFriend extends AbstractModel<FriendID> {
|
||||||
|
/**
|
||||||
|
* @param id
|
||||||
|
* the friend id
|
||||||
|
*/
|
||||||
public CharacterFriend(FriendID id) {
|
public CharacterFriend(FriendID id) {
|
||||||
this.setID(id);
|
this.setID(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the character id
|
||||||
|
*/
|
||||||
public CharacterID getCharacterID() {
|
public CharacterID getCharacterID() {
|
||||||
return id.getID1();
|
return id.getID1();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the character
|
||||||
|
*/
|
||||||
public L2Character getCharacter() {
|
public L2Character getCharacter() {
|
||||||
return id.getID1().getObject();
|
return id.getID1().getObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the friend id
|
||||||
|
*/
|
||||||
public CharacterID getFriendID() {
|
public CharacterID getFriendID() {
|
||||||
return id.getID2();
|
return id.getID2();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the friend
|
||||||
|
*/
|
||||||
public L2Character getFriend() {
|
public L2Character getFriend() {
|
||||||
return id.getID2().getObject();
|
return id.getID2().getObject();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,14 @@ public class Fort extends AbstractModel<FortID> {
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public enum FortType {
|
public enum FortType {
|
||||||
TYPE1, TYPE2;
|
/**
|
||||||
|
* Fort type 1
|
||||||
|
*/
|
||||||
|
TYPE1,
|
||||||
|
/**
|
||||||
|
* Fort type 2
|
||||||
|
*/
|
||||||
|
TYPE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -63,13 +63,39 @@ public class Shortcut extends AbstractModel<ShortcutID> {
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public enum ShortcutType {
|
public enum ShortcutType {
|
||||||
ITEM(1), SKILL(2), ACTION(3), MACRO(4), RECIPE(5), TPBOOKMARK(6);
|
/**
|
||||||
|
* Item shortcut
|
||||||
|
*/
|
||||||
|
ITEM(1),
|
||||||
|
/**
|
||||||
|
* Skill shortcut
|
||||||
|
*/
|
||||||
|
SKILL(2),
|
||||||
|
/**
|
||||||
|
* Social action shortcut
|
||||||
|
*/
|
||||||
|
ACTION(3),
|
||||||
|
/**
|
||||||
|
* Macro shortcut
|
||||||
|
*/
|
||||||
|
MACRO(4),
|
||||||
|
/**
|
||||||
|
* Recipe shortcut
|
||||||
|
*/
|
||||||
|
RECIPE(5),
|
||||||
|
/**
|
||||||
|
* Bookmark shortcut
|
||||||
|
*/
|
||||||
|
TPBOOKMARK(6);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The shortcut type id
|
* The shortcut type id
|
||||||
*/
|
*/
|
||||||
public final int id;
|
public final int id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id the numeric id
|
||||||
|
*/
|
||||||
ShortcutType(int id) {
|
ShortcutType(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
@@ -78,7 +104,7 @@ public class Shortcut extends AbstractModel<ShortcutID> {
|
|||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* the type id
|
* the type id
|
||||||
* @return
|
* @return the {@link ShortcutType}
|
||||||
*/
|
*/
|
||||||
public static ShortcutType fromID(int id) {
|
public static ShortcutType fromID(int id) {
|
||||||
for (final ShortcutType shortcut : values()) {
|
for (final ShortcutType shortcut : values()) {
|
||||||
@@ -101,8 +127,8 @@ public class Shortcut extends AbstractModel<ShortcutID> {
|
|||||||
/**
|
/**
|
||||||
* Creates a new instance
|
* Creates a new instance
|
||||||
*
|
*
|
||||||
* @param character
|
* @param characterID
|
||||||
* the character
|
* the character id
|
||||||
*/
|
*/
|
||||||
public Shortcut(CharacterID characterID) {
|
public Shortcut(CharacterID characterID) {
|
||||||
this.characterID = characterID;
|
this.characterID = characterID;
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ import com.l2jserver.model.world.Actor;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class Skill extends AbstractModel<SkillID> {
|
public class Skill extends AbstractModel<SkillID> {
|
||||||
|
/**
|
||||||
|
* The {@link Skill} template id
|
||||||
|
*/
|
||||||
private final SkillTemplateID templateID;
|
private final SkillTemplateID templateID;
|
||||||
/**
|
/**
|
||||||
* The skill level learned
|
* The skill level learned
|
||||||
@@ -38,6 +41,8 @@ public class Skill extends AbstractModel<SkillID> {
|
|||||||
/**
|
/**
|
||||||
* Creates a new instance in level one
|
* Creates a new instance in level one
|
||||||
*
|
*
|
||||||
|
* @param templateID
|
||||||
|
* the {@link SkillTemplateID} instance
|
||||||
* @param level
|
* @param level
|
||||||
* the level of this skill
|
* the level of this skill
|
||||||
*/
|
*/
|
||||||
@@ -48,6 +53,9 @@ public class Skill extends AbstractModel<SkillID> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new instance in level one
|
* Creates a new instance in level one
|
||||||
|
*
|
||||||
|
* @param templateID
|
||||||
|
* the {@link SkillTemplateID} instance
|
||||||
*/
|
*/
|
||||||
public Skill(SkillTemplateID templateID) {
|
public Skill(SkillTemplateID templateID) {
|
||||||
this(templateID, 1);
|
this(templateID, 1);
|
||||||
|
|||||||
@@ -22,6 +22,11 @@ import com.l2jserver.model.Model;
|
|||||||
* This is an abstract ID for most model objects that do not extend
|
* This is an abstract ID for most model objects that do not extend
|
||||||
* {@link ObjectID}.
|
* {@link ObjectID}.
|
||||||
*
|
*
|
||||||
|
* @param <T>
|
||||||
|
* the raw id type
|
||||||
|
* @param <O>
|
||||||
|
* the model this {@link ID} provides
|
||||||
|
*
|
||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractModelID<T, O extends Model<? extends ID<T>>>
|
public abstract class AbstractModelID<T, O extends Model<? extends ID<T>>>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package com.l2jserver.model.id;
|
|||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.assistedinject.Assisted;
|
import com.google.inject.assistedinject.Assisted;
|
||||||
|
import com.l2jserver.model.game.Castle;
|
||||||
import com.l2jserver.model.id.provider.IDProvider;
|
import com.l2jserver.model.id.provider.IDProvider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ import com.google.inject.Inject;
|
|||||||
/**
|
/**
|
||||||
* The ID interface. Each object must be represented by an unique ID.
|
* The ID interface. Each object must be represented by an unique ID.
|
||||||
*
|
*
|
||||||
|
* @param <T>
|
||||||
|
* the raw id type
|
||||||
|
*
|
||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public abstract class ID<T> {
|
public abstract class ID<T> {
|
||||||
@@ -29,6 +32,9 @@ public abstract class ID<T> {
|
|||||||
*/
|
*/
|
||||||
protected final T id;
|
protected final T id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id the raw id
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
protected ID(T id) {
|
protected ID(T id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import java.lang.ref.SoftReference;
|
|||||||
|
|
||||||
import com.l2jserver.model.id.provider.IDProvider;
|
import com.l2jserver.model.id.provider.IDProvider;
|
||||||
import com.l2jserver.model.template.Template;
|
import com.l2jserver.model.template.Template;
|
||||||
|
import com.l2jserver.service.game.template.TemplateService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Templates IDs, different from {@link ObjectID}s, can be repeated and are
|
* Templates IDs, different from {@link ObjectID}s, can be repeated and are
|
||||||
@@ -29,9 +30,22 @@ import com.l2jserver.model.template.Template;
|
|||||||
* Please, do not directly instantiate this class, use an {@link IDProvider}
|
* Please, do not directly instantiate this class, use an {@link IDProvider}
|
||||||
* instead.
|
* instead.
|
||||||
*
|
*
|
||||||
|
* @param <T>
|
||||||
|
* the template type provided by this {@link TemplateID}
|
||||||
|
* @param <I>
|
||||||
|
* the raw ID type
|
||||||
|
*
|
||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public abstract class TemplateID<T extends Template<?>, I> extends ID<I> {
|
public abstract class TemplateID<T extends Template<?>, I> extends ID<I> {
|
||||||
|
/**
|
||||||
|
* The cached template {@link Reference}
|
||||||
|
* <p>
|
||||||
|
* Please, avoid using it directly. Instead use {@link #getTemplate()} to
|
||||||
|
* retrieve the template object, since it will check if the reference is
|
||||||
|
* still valid and if not, will request the template with
|
||||||
|
* {@link TemplateService}.
|
||||||
|
*/
|
||||||
private Reference<T> cached;
|
private Reference<T> cached;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -21,6 +21,11 @@ import com.l2jserver.model.id.ID;
|
|||||||
/**
|
/**
|
||||||
* The compound {@link ID} is composed of two IDs.
|
* The compound {@link ID} is composed of two IDs.
|
||||||
*
|
*
|
||||||
|
* @param <T1>
|
||||||
|
* the first {@link ID} type
|
||||||
|
* @param <T2>
|
||||||
|
* the second {@link ID} type
|
||||||
|
*
|
||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class AbstractCompoundID<T1, T2> extends ID<AbstractCompoundID<T1, T2>> {
|
public class AbstractCompoundID<T1, T2> extends ID<AbstractCompoundID<T1, T2>> {
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ import com.l2jserver.model.world.Actor;
|
|||||||
* the actor subclass
|
* the actor subclass
|
||||||
*/
|
*/
|
||||||
public abstract class ActorID<T extends Actor> extends ObjectID<T> {
|
public abstract class ActorID<T extends Actor> extends ObjectID<T> {
|
||||||
|
/**
|
||||||
|
* @param id the raw id
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public ActorID(@Assisted int id) {
|
public ActorID(@Assisted int id) {
|
||||||
super(id);
|
super(id);
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ public final class CharacterID extends ActorID<L2Character> {
|
|||||||
*/
|
*/
|
||||||
private transient final CharacterDAO characterDao;
|
private transient final CharacterDAO characterDao;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id the raw id
|
||||||
|
* @param characterDao the character DAO
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public CharacterID(@Assisted int id, CharacterDAO characterDao) {
|
public CharacterID(@Assisted int id, CharacterDAO characterDao) {
|
||||||
super(id);
|
super(id);
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ public final class ClanID extends ObjectID<Clan> {
|
|||||||
*/
|
*/
|
||||||
private final ClanDAO clanDao;
|
private final ClanDAO clanDao;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id the raw id
|
||||||
|
* @param clanDao the clan DAO
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
protected ClanID(@Assisted int id, ClanDAO clanDao) {
|
protected ClanID(@Assisted int id, ClanDAO clanDao) {
|
||||||
super(id);
|
super(id);
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ public final class ItemID extends ObjectID<Item> {
|
|||||||
*/
|
*/
|
||||||
private final ItemDAO itemDao;
|
private final ItemDAO itemDao;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id the raw id
|
||||||
|
* @param itemDao the item DAO
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
protected ItemID(@Assisted int id, ItemDAO itemDao) {
|
protected ItemID(@Assisted int id, ItemDAO itemDao) {
|
||||||
super(id);
|
super(id);
|
||||||
|
|||||||
@@ -40,6 +40,12 @@ public final class NPCID extends ActorID<NPC> {
|
|||||||
*/
|
*/
|
||||||
private final WorldService worldService;
|
private final WorldService worldService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id
|
||||||
|
* the raw id
|
||||||
|
* @param worldService
|
||||||
|
* the world service
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public NPCID(@Assisted int id, WorldService worldService) {
|
public NPCID(@Assisted int id, WorldService worldService) {
|
||||||
super(id);
|
super(id);
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ public final class PetID extends ActorID<Pet> {
|
|||||||
*/
|
*/
|
||||||
private final PetDAO petDao;
|
private final PetDAO petDao;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id the raw id
|
||||||
|
* @param petDao the pet DAO
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
protected PetID(int id, PetDAO petDao) {
|
protected PetID(int id, PetDAO petDao) {
|
||||||
super(id);
|
super(id);
|
||||||
|
|||||||
@@ -22,20 +22,40 @@ package com.l2jserver.model.id.object.allocator;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class IDAllocatorException extends RuntimeException {
|
public class IDAllocatorException extends RuntimeException {
|
||||||
|
/**
|
||||||
|
* The Java Serialization Serial
|
||||||
|
*/
|
||||||
private static final long serialVersionUID = 111195059766878062L;
|
private static final long serialVersionUID = 111195059766878062L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an empty instance of this exception
|
||||||
|
*/
|
||||||
public IDAllocatorException() {
|
public IDAllocatorException() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param message
|
||||||
|
* the message
|
||||||
|
* @param cause
|
||||||
|
* the root cause
|
||||||
|
*/
|
||||||
public IDAllocatorException(String message, Throwable cause) {
|
public IDAllocatorException(String message, Throwable cause) {
|
||||||
super(message, cause);
|
super(message, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param message
|
||||||
|
* the message
|
||||||
|
*/
|
||||||
public IDAllocatorException(String message) {
|
public IDAllocatorException(String message) {
|
||||||
super(message);
|
super(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param cause
|
||||||
|
* the root cause
|
||||||
|
*/
|
||||||
public IDAllocatorException(Throwable cause) {
|
public IDAllocatorException(Throwable cause) {
|
||||||
super(cause);
|
super(cause);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,14 @@ public class CharacterIDProvider implements ObjectIDProvider<CharacterID> {
|
|||||||
*/
|
*/
|
||||||
private final CharacterIDGuiceFactory factory;
|
private final CharacterIDGuiceFactory factory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param allocator
|
||||||
|
* the id allocator
|
||||||
|
* @param idService
|
||||||
|
* the world id service
|
||||||
|
* @param factory
|
||||||
|
* the character id factory
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public CharacterIDProvider(IDAllocator allocator, WorldIDService idService,
|
public CharacterIDProvider(IDAllocator allocator, WorldIDService idService,
|
||||||
CharacterIDGuiceFactory factory) {
|
CharacterIDGuiceFactory factory) {
|
||||||
|
|||||||
@@ -42,6 +42,14 @@ public class ClanIDProvider implements ObjectIDProvider<ClanID> {
|
|||||||
*/
|
*/
|
||||||
private final ClanIDGuiceFactory factory;
|
private final ClanIDGuiceFactory factory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param allocator
|
||||||
|
* the id allocator
|
||||||
|
* @param idService
|
||||||
|
* the world id service
|
||||||
|
* @param factory
|
||||||
|
* the clan id factory
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public ClanIDProvider(IDAllocator allocator, WorldIDService idService,
|
public ClanIDProvider(IDAllocator allocator, WorldIDService idService,
|
||||||
ClanIDGuiceFactory factory) {
|
ClanIDGuiceFactory factory) {
|
||||||
|
|||||||
@@ -42,6 +42,14 @@ public class ItemIDProvider implements ObjectIDProvider<ItemID> {
|
|||||||
*/
|
*/
|
||||||
private final ItemIDGuiceFactory factory;
|
private final ItemIDGuiceFactory factory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param allocator
|
||||||
|
* the id allocator
|
||||||
|
* @param idService
|
||||||
|
* the world id service
|
||||||
|
* @param factory
|
||||||
|
* the item id factory
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public ItemIDProvider(IDAllocator allocator, WorldIDService idService,
|
public ItemIDProvider(IDAllocator allocator, WorldIDService idService,
|
||||||
ItemIDGuiceFactory factory) {
|
ItemIDGuiceFactory factory) {
|
||||||
|
|||||||
@@ -42,6 +42,14 @@ public class NPCIDProvider implements ObjectIDProvider<NPCID> {
|
|||||||
*/
|
*/
|
||||||
private final NPCIDGuiceFactory factory;
|
private final NPCIDGuiceFactory factory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param allocator
|
||||||
|
* the id allocator
|
||||||
|
* @param idService
|
||||||
|
* the world id service
|
||||||
|
* @param factory
|
||||||
|
* the npc id factory
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public NPCIDProvider(IDAllocator allocator, WorldIDService idService,
|
public NPCIDProvider(IDAllocator allocator, WorldIDService idService,
|
||||||
NPCIDGuiceFactory factory) {
|
NPCIDGuiceFactory factory) {
|
||||||
|
|||||||
@@ -19,6 +19,12 @@ package com.l2jserver.model.id.object.provider;
|
|||||||
import com.l2jserver.model.id.ObjectID;
|
import com.l2jserver.model.id.ObjectID;
|
||||||
import com.l2jserver.model.id.provider.IDProvider;
|
import com.l2jserver.model.id.provider.IDProvider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
|
*
|
||||||
|
* @param <T>
|
||||||
|
* the ID type provided
|
||||||
|
*/
|
||||||
public interface ObjectIDProvider<T extends ObjectID<?>> extends
|
public interface ObjectIDProvider<T extends ObjectID<?>> extends
|
||||||
IDProvider<Integer, T> {
|
IDProvider<Integer, T> {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -55,6 +55,10 @@ public class ObjectIDResolver implements ObjectIDProvider<ObjectID<?>> {
|
|||||||
*/
|
*/
|
||||||
private final WorldIDService idService;
|
private final WorldIDService idService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param idService
|
||||||
|
* the world id service
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public ObjectIDResolver(WorldIDService idService) {
|
public ObjectIDResolver(WorldIDService idService) {
|
||||||
this.idService = idService;
|
this.idService = idService;
|
||||||
@@ -64,6 +68,7 @@ public class ObjectIDResolver implements ObjectIDProvider<ObjectID<?>> {
|
|||||||
* Resolvers do not support creating new IDs
|
* Resolvers do not support creating new IDs
|
||||||
*
|
*
|
||||||
* @throws UnsupportedOperationException
|
* @throws UnsupportedOperationException
|
||||||
|
* always
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ObjectID<?> createID() {
|
public ObjectID<?> createID() {
|
||||||
@@ -94,6 +99,7 @@ public class ObjectIDResolver implements ObjectIDProvider<ObjectID<?>> {
|
|||||||
* Resolvers do not support destroying IDs
|
* Resolvers do not support destroying IDs
|
||||||
*
|
*
|
||||||
* @throws UnsupportedOperationException
|
* @throws UnsupportedOperationException
|
||||||
|
* always
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void destroy(ObjectID<?> id) {
|
public void destroy(ObjectID<?> id) {
|
||||||
|
|||||||
@@ -42,6 +42,14 @@ public class PetIDProvider implements ObjectIDProvider<PetID> {
|
|||||||
*/
|
*/
|
||||||
private final PetIDGuiceFactory factory;
|
private final PetIDGuiceFactory factory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param allocator
|
||||||
|
* the id allocator
|
||||||
|
* @param idService
|
||||||
|
* the world id service
|
||||||
|
* @param factory
|
||||||
|
* the pet id factory
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public PetIDProvider(IDAllocator allocator, WorldIDService idService,
|
public PetIDProvider(IDAllocator allocator, WorldIDService idService,
|
||||||
PetIDGuiceFactory factory) {
|
PetIDGuiceFactory factory) {
|
||||||
|
|||||||
@@ -24,6 +24,12 @@ import com.l2jserver.model.id.compound.AbstractCompoundID;
|
|||||||
* The ID factory is used to create instances of IDs. It will automatically make
|
* The ID factory is used to create instances of IDs. It will automatically make
|
||||||
* sure the ID is free before allocating it.
|
* sure the ID is free before allocating it.
|
||||||
*
|
*
|
||||||
|
* @param <I1>
|
||||||
|
* the first compound {@link ID} type
|
||||||
|
* @param <I2>
|
||||||
|
* the second compound {@link ID} type
|
||||||
|
* @param <T>
|
||||||
|
* the {@link CompoundIDProvider} type
|
||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public interface CompoundIDProvider<I1 extends ID<?>, I2 extends ID<?>, T extends AbstractCompoundID<I1, I2>> {
|
public interface CompoundIDProvider<I1 extends ID<?>, I2 extends ID<?>, T extends AbstractCompoundID<I1, I2>> {
|
||||||
|
|||||||
@@ -31,6 +31,10 @@ import com.l2jserver.model.id.ID;
|
|||||||
* object will be created and following calls will always return the same
|
* object will be created and following calls will always return the same
|
||||||
* object.
|
* object.
|
||||||
*
|
*
|
||||||
|
* @param <I>
|
||||||
|
* the raw id type
|
||||||
|
* @param <T>
|
||||||
|
* the {@link ID} implementation
|
||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public interface IDProvider<I, T extends ID<I>> {
|
public interface IDProvider<I, T extends ID<I>> {
|
||||||
@@ -38,7 +42,8 @@ public interface IDProvider<I, T extends ID<I>> {
|
|||||||
* Creates the ID object for an <b>EXISTING</b> ID.
|
* Creates the ID object for an <b>EXISTING</b> ID.
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* the raw id value
|
||||||
|
* @return the resolved {@link ID} object
|
||||||
*/
|
*/
|
||||||
T resolveID(I id);
|
T resolveID(I id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ import com.l2jserver.service.game.template.TemplateService;
|
|||||||
/**
|
/**
|
||||||
* An {@link TemplateID} instance representing an {@link ActorTemplate} object
|
* An {@link TemplateID} instance representing an {@link ActorTemplate} object
|
||||||
*
|
*
|
||||||
|
* @param <T>
|
||||||
|
* the type of {@link ActorTemplate} this {@link TemplateID} represents
|
||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class ActorTemplateID<T extends ActorTemplate<?>> extends
|
public class ActorTemplateID<T extends ActorTemplate<?>> extends
|
||||||
@@ -36,6 +38,10 @@ public class ActorTemplateID<T extends ActorTemplate<?>> extends
|
|||||||
*/
|
*/
|
||||||
private transient final TemplateService templateService;
|
private transient final TemplateService templateService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id the raw id
|
||||||
|
* @param templateService the template service
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
protected ActorTemplateID(@Assisted int id, TemplateService templateService) {
|
protected ActorTemplateID(@Assisted int id, TemplateService templateService) {
|
||||||
super(id);
|
super(id);
|
||||||
|
|||||||
@@ -29,6 +29,10 @@ import com.l2jserver.service.game.template.TemplateService;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class CharacterTemplateID extends ActorTemplateID<CharacterTemplate> {
|
public class CharacterTemplateID extends ActorTemplateID<CharacterTemplate> {
|
||||||
|
/**
|
||||||
|
* @param id the raw id
|
||||||
|
* @param templateService the template service
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public CharacterTemplateID(@Assisted int id, TemplateService templateService) {
|
public CharacterTemplateID(@Assisted int id, TemplateService templateService) {
|
||||||
super(id, templateService);
|
super(id, templateService);
|
||||||
|
|||||||
@@ -36,8 +36,11 @@ public class ItemTemplateID extends TemplateID<ItemTemplate, Integer> {
|
|||||||
*/
|
*/
|
||||||
private final TemplateService templateService;
|
private final TemplateService templateService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id the raw id
|
||||||
|
* @param templateService the template service
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
// FIXME this should be protected
|
|
||||||
public ItemTemplateID(@Assisted int id, TemplateService templateService) {
|
public ItemTemplateID(@Assisted int id, TemplateService templateService) {
|
||||||
super(id);
|
super(id);
|
||||||
this.templateService = templateService;
|
this.templateService = templateService;
|
||||||
|
|||||||
@@ -32,6 +32,10 @@ import com.l2jserver.util.jaxb.NPCTemplateIDAdapter;
|
|||||||
*/
|
*/
|
||||||
@XmlJavaTypeAdapter(value = NPCTemplateIDAdapter.class)
|
@XmlJavaTypeAdapter(value = NPCTemplateIDAdapter.class)
|
||||||
public class NPCTemplateID extends ActorTemplateID<NPCTemplate> {
|
public class NPCTemplateID extends ActorTemplateID<NPCTemplate> {
|
||||||
|
/**
|
||||||
|
* @param id the raw id
|
||||||
|
* @param templateService the template service
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public NPCTemplateID(@Assisted int id, TemplateService templateService) {
|
public NPCTemplateID(@Assisted int id, TemplateService templateService) {
|
||||||
super(id, templateService);
|
super(id, templateService);
|
||||||
|
|||||||
@@ -33,6 +33,10 @@ public class SkillTemplateID extends TemplateID<SkillTemplate, Integer> {
|
|||||||
*/
|
*/
|
||||||
private final TemplateService templateService;
|
private final TemplateService templateService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id the raw id
|
||||||
|
* @param templateService the template service
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public SkillTemplateID(@Assisted int id, TemplateService templateService) {
|
public SkillTemplateID(@Assisted int id, TemplateService templateService) {
|
||||||
super(id);
|
super(id);
|
||||||
|
|||||||
@@ -39,6 +39,10 @@ public class TeleportationTemplateID extends
|
|||||||
*/
|
*/
|
||||||
private final TemplateService templateService;
|
private final TemplateService templateService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id the raw id
|
||||||
|
* @param templateService the template service
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public TeleportationTemplateID(@Assisted int id,
|
public TeleportationTemplateID(@Assisted int id,
|
||||||
TemplateService templateService) {
|
TemplateService templateService) {
|
||||||
|
|||||||
@@ -22,10 +22,11 @@ import com.l2jserver.model.id.provider.IDProvider;
|
|||||||
/**
|
/**
|
||||||
* Creates a new {@link TemplateID}
|
* Creates a new {@link TemplateID}
|
||||||
*
|
*
|
||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @param <I>
|
||||||
*
|
* the raw id type
|
||||||
* @param <T>
|
* @param <T>
|
||||||
* the subclass of {@link TemplateID} that will be createdF
|
* the subclass of {@link TemplateID} that will be created
|
||||||
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public interface TemplateIDProvider<I, T extends TemplateID<?, I>> extends
|
public interface TemplateIDProvider<I, T extends TemplateID<?, I>> extends
|
||||||
IDProvider<I, T> {
|
IDProvider<I, T> {
|
||||||
|
|||||||
@@ -73,6 +73,10 @@ public class AttackHit {
|
|||||||
*/
|
*/
|
||||||
public final byte flag;
|
public final byte flag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param flag
|
||||||
|
* the bitset flag
|
||||||
|
*/
|
||||||
AttackHitFlag(byte flag) {
|
AttackHitFlag(byte flag) {
|
||||||
this.flag = flag;
|
this.flag = flag;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,11 +24,23 @@ import com.l2jserver.util.calculator.ComplexCalculator;
|
|||||||
*/
|
*/
|
||||||
public class AttackCalculator extends
|
public class AttackCalculator extends
|
||||||
ComplexCalculator<AttackCalculatorContext, AttackCalculatorType> {
|
ComplexCalculator<AttackCalculatorContext, AttackCalculatorType> {
|
||||||
|
/**
|
||||||
|
* @param functions
|
||||||
|
* the functions
|
||||||
|
*/
|
||||||
public AttackCalculator(AttackCalculatorFunction... functions) {
|
public AttackCalculator(AttackCalculatorFunction... functions) {
|
||||||
super(AttackCalculatorType.class, functions);
|
super(AttackCalculatorType.class, functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The calculator attributes
|
||||||
|
*
|
||||||
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
|
*/
|
||||||
public enum AttackCalculatorType {
|
public enum AttackCalculatorType {
|
||||||
|
/**
|
||||||
|
* Calculates the damage dealt by the attack
|
||||||
|
*/
|
||||||
DAMAGE;
|
DAMAGE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,9 +23,21 @@ import com.l2jserver.util.calculator.CalculatorContext;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class AttackCalculatorContext extends CalculatorContext {
|
public class AttackCalculatorContext extends CalculatorContext {
|
||||||
|
/**
|
||||||
|
* The attacker actor
|
||||||
|
*/
|
||||||
public final Actor attacker;
|
public final Actor attacker;
|
||||||
|
/**
|
||||||
|
* The target actor
|
||||||
|
*/
|
||||||
public final Actor target;
|
public final Actor target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param attacker
|
||||||
|
* the attacker
|
||||||
|
* @param target
|
||||||
|
* the target
|
||||||
|
*/
|
||||||
public AttackCalculatorContext(Actor attacker, Actor target) {
|
public AttackCalculatorContext(Actor attacker, Actor target) {
|
||||||
this.attacker = attacker;
|
this.attacker = attacker;
|
||||||
this.target = target;
|
this.target = target;
|
||||||
|
|||||||
@@ -25,6 +25,12 @@ import com.l2jserver.util.calculator.AbstractDoubleFunction;
|
|||||||
*/
|
*/
|
||||||
public abstract class AttackCalculatorFunction extends
|
public abstract class AttackCalculatorFunction extends
|
||||||
AbstractDoubleFunction<AttackCalculatorContext, AttackCalculatorType> {
|
AbstractDoubleFunction<AttackCalculatorContext, AttackCalculatorType> {
|
||||||
|
/**
|
||||||
|
* @param order
|
||||||
|
* the calculation order
|
||||||
|
* @param type
|
||||||
|
* the function attribute
|
||||||
|
*/
|
||||||
public AttackCalculatorFunction(int order, AttackCalculatorType type) {
|
public AttackCalculatorFunction(int order, AttackCalculatorType type) {
|
||||||
super(order, type);
|
super(order, type);
|
||||||
}
|
}
|
||||||
@@ -34,5 +40,14 @@ public abstract class AttackCalculatorFunction extends
|
|||||||
return calculate(ctx.attacker, ctx.target, value);
|
return calculate(ctx.attacker, ctx.target, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param attacker
|
||||||
|
* the attacker
|
||||||
|
* @param target
|
||||||
|
* the target
|
||||||
|
* @param value
|
||||||
|
* the original value
|
||||||
|
* @return the calculated value
|
||||||
|
*/
|
||||||
public abstract double calculate(Actor attacker, Actor target, double value);
|
public abstract double calculate(Actor attacker, Actor target, double value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ import com.l2jserver.model.world.Actor;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class PhysicalAttackCalculator extends AttackCalculator {
|
public class PhysicalAttackCalculator extends AttackCalculator {
|
||||||
|
/**
|
||||||
|
* Creates a new instance
|
||||||
|
*/
|
||||||
public PhysicalAttackCalculator() {
|
public PhysicalAttackCalculator() {
|
||||||
super(new AttackCalculatorFunction(0x000, AttackCalculatorType.DAMAGE) {
|
super(new AttackCalculatorFunction(0x000, AttackCalculatorType.DAMAGE) {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ import com.l2jserver.model.world.Actor;
|
|||||||
/**
|
/**
|
||||||
* Template for {@link Actor}
|
* Template for {@link Actor}
|
||||||
*
|
*
|
||||||
|
* @param <T>
|
||||||
|
* the {@link Actor} type this template is for
|
||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public abstract class ActorTemplate<T extends Actor> extends
|
public abstract class ActorTemplate<T extends Actor> extends
|
||||||
@@ -42,5 +44,10 @@ public abstract class ActorTemplate<T extends Actor> extends
|
|||||||
return actor;
|
return actor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance
|
||||||
|
*
|
||||||
|
* @return the created template instance
|
||||||
|
*/
|
||||||
protected abstract T createInstance();
|
protected abstract T createInstance();
|
||||||
}
|
}
|
||||||
@@ -207,6 +207,9 @@ public class CharacterTemplate extends ActorTemplate<L2Character> {
|
|||||||
return stats.crafter;
|
return stats.crafter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the base HP
|
||||||
|
*/
|
||||||
public double getBaseHP() {
|
public double getBaseHP() {
|
||||||
if (stats == null)
|
if (stats == null)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -215,6 +218,9 @@ public class CharacterTemplate extends ActorTemplate<L2Character> {
|
|||||||
return stats.hp.base;
|
return stats.hp.base;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the base HP modifier
|
||||||
|
*/
|
||||||
public double getBaseHPModifier() {
|
public double getBaseHPModifier() {
|
||||||
if (stats == null)
|
if (stats == null)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -223,6 +229,9 @@ public class CharacterTemplate extends ActorTemplate<L2Character> {
|
|||||||
return stats.hp.modifier;
|
return stats.hp.modifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the base HP add
|
||||||
|
*/
|
||||||
public double getBaseHPAdd() {
|
public double getBaseHPAdd() {
|
||||||
if (stats == null)
|
if (stats == null)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -231,7 +240,10 @@ public class CharacterTemplate extends ActorTemplate<L2Character> {
|
|||||||
return stats.hp.add;
|
return stats.hp.add;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getBaseBaseMP() {
|
/**
|
||||||
|
* @return the base MP
|
||||||
|
*/
|
||||||
|
public double getBaseMP() {
|
||||||
if (stats == null)
|
if (stats == null)
|
||||||
return 0;
|
return 0;
|
||||||
if (stats.mp == null)
|
if (stats.mp == null)
|
||||||
@@ -239,6 +251,9 @@ public class CharacterTemplate extends ActorTemplate<L2Character> {
|
|||||||
return stats.mp.base;
|
return stats.mp.base;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the base MP modifier
|
||||||
|
*/
|
||||||
public double getBaseMPModifier() {
|
public double getBaseMPModifier() {
|
||||||
if (stats == null)
|
if (stats == null)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -247,6 +262,9 @@ public class CharacterTemplate extends ActorTemplate<L2Character> {
|
|||||||
return stats.mp.modifier;
|
return stats.mp.modifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the base MP add
|
||||||
|
*/
|
||||||
public double getBaseMPAdd() {
|
public double getBaseMPAdd() {
|
||||||
if (stats == null)
|
if (stats == null)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -255,6 +273,9 @@ public class CharacterTemplate extends ActorTemplate<L2Character> {
|
|||||||
return stats.mp.add;
|
return stats.mp.add;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the base CP
|
||||||
|
*/
|
||||||
public double getBaseCP() {
|
public double getBaseCP() {
|
||||||
if (stats == null)
|
if (stats == null)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -263,6 +284,9 @@ public class CharacterTemplate extends ActorTemplate<L2Character> {
|
|||||||
return stats.cp.base;
|
return stats.cp.base;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the base CP modifier
|
||||||
|
*/
|
||||||
public double getBaseCPModifier() {
|
public double getBaseCPModifier() {
|
||||||
if (stats == null)
|
if (stats == null)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -271,6 +295,9 @@ public class CharacterTemplate extends ActorTemplate<L2Character> {
|
|||||||
return stats.cp.modifier;
|
return stats.cp.modifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the base CP add
|
||||||
|
*/
|
||||||
public double getBaseCPAdd() {
|
public double getBaseCPAdd() {
|
||||||
if (stats == null)
|
if (stats == null)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -390,6 +417,9 @@ public class CharacterTemplate extends ActorTemplate<L2Character> {
|
|||||||
return stats.attack.magical.speed;
|
return stats.attack.magical.speed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the base run speed
|
||||||
|
*/
|
||||||
public double getBaseRunSpeed() {
|
public double getBaseRunSpeed() {
|
||||||
if (stats == null)
|
if (stats == null)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -398,6 +428,9 @@ public class CharacterTemplate extends ActorTemplate<L2Character> {
|
|||||||
return stats.move.run;
|
return stats.move.run;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the base walk speed
|
||||||
|
*/
|
||||||
public double getBaseWalkSpeed() {
|
public double getBaseWalkSpeed() {
|
||||||
if (stats == null)
|
if (stats == null)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -481,6 +514,9 @@ public class CharacterTemplate extends ActorTemplate<L2Character> {
|
|||||||
return stats.maximumLoad;
|
return stats.maximumLoad;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the male collision radius
|
||||||
|
*/
|
||||||
public double getMaleCollisionRadius() {
|
public double getMaleCollisionRadius() {
|
||||||
if (collision == null)
|
if (collision == null)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -489,6 +525,9 @@ public class CharacterTemplate extends ActorTemplate<L2Character> {
|
|||||||
return collision.male.radius;
|
return collision.male.radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the male collision height
|
||||||
|
*/
|
||||||
public double getMaleCollisionHeight() {
|
public double getMaleCollisionHeight() {
|
||||||
if (collision == null)
|
if (collision == null)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -497,6 +536,9 @@ public class CharacterTemplate extends ActorTemplate<L2Character> {
|
|||||||
return collision.male.height;
|
return collision.male.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the female collision radius
|
||||||
|
*/
|
||||||
public double getFemaleCollisionRadius() {
|
public double getFemaleCollisionRadius() {
|
||||||
if (collision == null)
|
if (collision == null)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -505,6 +547,9 @@ public class CharacterTemplate extends ActorTemplate<L2Character> {
|
|||||||
return collision.female.radius;
|
return collision.female.radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the female collision height
|
||||||
|
*/
|
||||||
public double getFemaleCollisionHeight() {
|
public double getFemaleCollisionHeight() {
|
||||||
if (collision == null)
|
if (collision == null)
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -57,6 +57,14 @@ public class SkillTemplate extends AbstractTemplate<Skill> {
|
|||||||
return create(null);
|
return create(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance
|
||||||
|
*
|
||||||
|
* @param actorID
|
||||||
|
* the actor ID
|
||||||
|
*
|
||||||
|
* @return the created template instance
|
||||||
|
*/
|
||||||
public Skill create(ActorID<?> actorID) {
|
public Skill create(ActorID<?> actorID) {
|
||||||
final Skill skill = new Skill(id);
|
final Skill skill = new Skill(id);
|
||||||
if (actorID != null)
|
if (actorID != null)
|
||||||
|
|||||||
@@ -7,14 +7,33 @@ package com.l2jserver.model.template.actor;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public enum ActorSex {
|
public enum ActorSex {
|
||||||
MALE(0x00), FEMALE(0x01);
|
/**
|
||||||
|
* Represents an male character
|
||||||
|
*/
|
||||||
|
MALE(0x00),
|
||||||
|
/**
|
||||||
|
* Represents an female character
|
||||||
|
*/
|
||||||
|
FEMALE(0x01);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The numeric sex option
|
||||||
|
*/
|
||||||
public final int option;
|
public final int option;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param option
|
||||||
|
* the numeric sex option
|
||||||
|
*/
|
||||||
ActorSex(int option) {
|
ActorSex(int option) {
|
||||||
this.option = option;
|
this.option = option;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param option
|
||||||
|
* the numeric sex option
|
||||||
|
* @return the resolved {@link ActorSex}
|
||||||
|
*/
|
||||||
public static ActorSex fromOption(int option) {
|
public static ActorSex fromOption(int option) {
|
||||||
for (ActorSex sex : values()) {
|
for (ActorSex sex : values()) {
|
||||||
if (sex.option == option)
|
if (sex.option == option)
|
||||||
|
|||||||
@@ -27,8 +27,17 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ItemSetActorCalculator extends ActorFormula {
|
public class ItemSetActorCalculator extends ActorFormula {
|
||||||
|
/**
|
||||||
|
* The stat set
|
||||||
|
*/
|
||||||
private final StatSet set;
|
private final StatSet set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param set
|
||||||
|
* the stat set
|
||||||
|
* @param type
|
||||||
|
* the stat type
|
||||||
|
*/
|
||||||
public ItemSetActorCalculator(StatSet set, StatType type) {
|
public ItemSetActorCalculator(StatSet set, StatType type) {
|
||||||
super(set.getOrder(), type);
|
super(set.getOrder(), type);
|
||||||
this.set = set;
|
this.set = set;
|
||||||
|
|||||||
@@ -24,13 +24,16 @@ import com.l2jserver.util.exception.L2Exception;
|
|||||||
/**
|
/**
|
||||||
* Defines an {@link Template} which the player can interact with
|
* Defines an {@link Template} which the player can interact with
|
||||||
*
|
*
|
||||||
|
* @param <T>
|
||||||
|
* the interable {@link WorldObject} type
|
||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public interface Interactable<T extends WorldObject> extends TemplateCapability {
|
public interface Interactable<T extends WorldObject> extends TemplateCapability {
|
||||||
/**
|
/**
|
||||||
* Performs an interaction with this template.
|
* Performs an interaction with this template.
|
||||||
*
|
*
|
||||||
|
* @param object
|
||||||
|
* the object to interact with
|
||||||
* @param character
|
* @param character
|
||||||
* the interacting character
|
* the interacting character
|
||||||
* @param args
|
* @param args
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ public enum CharacterRace {
|
|||||||
*/
|
*/
|
||||||
public final int id;
|
public final int id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id the race numeric id
|
||||||
|
*/
|
||||||
CharacterRace(int id) {
|
CharacterRace(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,6 +133,10 @@ public enum ItemType {
|
|||||||
*/
|
*/
|
||||||
public final int id;
|
public final int id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id
|
||||||
|
* the numeric id
|
||||||
|
*/
|
||||||
ItemType(int id) {
|
ItemType(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,12 +78,12 @@ public enum WeaponType {
|
|||||||
DUALDAGGER(StatType.DUALDAGGER_WPN_VULN);
|
DUALDAGGER(StatType.DUALDAGGER_WPN_VULN);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This weapon type weaknesses
|
* This weapon type of weaknesses
|
||||||
*/
|
*/
|
||||||
public final StatType weaknessesStat;
|
public final StatType weaknessesStat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param weaknesses
|
* @param weaknessesStat
|
||||||
* the weapon weaknesses
|
* the weapon weaknesses
|
||||||
*/
|
*/
|
||||||
WeaponType(StatType weaknessesStat) {
|
WeaponType(StatType weaknessesStat) {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jserver.model.world;
|
package com.l2jserver.model.world;
|
||||||
|
|
||||||
|
import com.l2jserver.model.id.TemplateID;
|
||||||
import com.l2jserver.model.id.object.ActorID;
|
import com.l2jserver.model.id.object.ActorID;
|
||||||
import com.l2jserver.model.id.template.ActorTemplateID;
|
import com.l2jserver.model.id.template.ActorTemplateID;
|
||||||
import com.l2jserver.model.template.ActorTemplate;
|
import com.l2jserver.model.template.ActorTemplate;
|
||||||
@@ -30,6 +31,9 @@ import com.l2jserver.model.world.actor.stat.ActorStats;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public abstract class Actor extends PositionableObject {
|
public abstract class Actor extends PositionableObject {
|
||||||
|
/**
|
||||||
|
* The {@link Actor} {@link TemplateID}
|
||||||
|
*/
|
||||||
protected ActorTemplateID<?> templateID;
|
protected ActorTemplateID<?> templateID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -101,10 +105,17 @@ public abstract class Actor extends PositionableObject {
|
|||||||
*/
|
*/
|
||||||
protected final ActorSkillContainer skills = new ActorSkillContainer(this);
|
protected final ActorSkillContainer skills = new ActorSkillContainer(this);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param templateID
|
||||||
|
* the actor template id
|
||||||
|
*/
|
||||||
protected Actor(ActorTemplateID<?> templateID) {
|
protected Actor(ActorTemplateID<?> templateID) {
|
||||||
this.templateID = templateID;
|
this.templateID = templateID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the actor stats
|
||||||
|
*/
|
||||||
public abstract ActorStats<?> getStats();
|
public abstract ActorStats<?> getStats();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -267,6 +278,9 @@ public abstract class Actor extends PositionableObject {
|
|||||||
return effects;
|
return effects;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the actor skills
|
||||||
|
*/
|
||||||
public ActorSkillContainer getSkills() {
|
public ActorSkillContainer getSkills() {
|
||||||
return skills;
|
return skills;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,6 +69,9 @@ public class Item extends PositionableObject {
|
|||||||
*/
|
*/
|
||||||
private long count = 1;
|
private long count = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param templateID the item template id
|
||||||
|
*/
|
||||||
public Item(ItemTemplateID templateID) {
|
public Item(ItemTemplateID templateID) {
|
||||||
this.templateID = templateID;
|
this.templateID = templateID;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,10 +136,25 @@ public class L2Character extends Player {
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public enum CharacterMoveType {
|
public enum CharacterMoveType {
|
||||||
RUN(0x01), WALK(0x00);
|
/**
|
||||||
|
* Run mode
|
||||||
|
*/
|
||||||
|
RUN(0x01),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Walk mode
|
||||||
|
*/
|
||||||
|
WALK(0x00);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The move mode numeric id
|
||||||
|
*/
|
||||||
public final int id;
|
public final int id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id
|
||||||
|
* the mode numeric id
|
||||||
|
*/
|
||||||
CharacterMoveType(int id) {
|
CharacterMoveType(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
@@ -158,8 +173,8 @@ public class L2Character extends Player {
|
|||||||
/**
|
/**
|
||||||
* Creates a new instance
|
* Creates a new instance
|
||||||
*
|
*
|
||||||
* @param baseAttributes
|
* @param templateID
|
||||||
* the base attribute for this character
|
* the {@link CharacterTemplateID}
|
||||||
*/
|
*/
|
||||||
public L2Character(CharacterTemplateID templateID) {
|
public L2Character(CharacterTemplateID templateID) {
|
||||||
super(templateID);
|
super(templateID);
|
||||||
|
|||||||
@@ -93,18 +93,32 @@ public class NPC extends Actor {
|
|||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the maximum HP
|
||||||
|
*/
|
||||||
public double getMaxHP() {
|
public double getMaxHP() {
|
||||||
return this.getTemplate().getMaximumHP();
|
return this.getTemplate().getMaximumHP();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param maxHP the maximum HP
|
||||||
|
* @throws UnsupportedOperationException always
|
||||||
|
*/
|
||||||
public void setMaxHP(double maxHP) {
|
public void setMaxHP(double maxHP) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the maximum MP
|
||||||
|
*/
|
||||||
public double getMaxMP() {
|
public double getMaxMP() {
|
||||||
return this.getTemplate().getMaximumMP();
|
return this.getTemplate().getMaximumMP();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param maxMP the maximum MP
|
||||||
|
* @throws UnsupportedOperationException always
|
||||||
|
*/
|
||||||
public void setMaxMP(double maxMP) {
|
public void setMaxMP(double maxMP) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ public class Pet extends Player {
|
|||||||
*/
|
*/
|
||||||
private ItemID itemID;
|
private ItemID itemID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param templateID the pet template id
|
||||||
|
*/
|
||||||
public Pet(ActorTemplateID<?> templateID) {
|
public Pet(ActorTemplateID<?> templateID) {
|
||||||
super(templateID);
|
super(templateID);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ import com.l2jserver.model.id.template.ActorTemplateID;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public abstract class Player extends Actor {
|
public abstract class Player extends Actor {
|
||||||
|
/**
|
||||||
|
* @param templateID the actor template id
|
||||||
|
*/
|
||||||
public Player(ActorTemplateID<?> templateID) {
|
public Player(ActorTemplateID<?> templateID) {
|
||||||
super(templateID);
|
super(templateID);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,10 +47,16 @@ public abstract class PositionableObject extends AbstractObject {
|
|||||||
this.point = point;
|
this.point = point;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the position coodinate
|
||||||
|
*/
|
||||||
public Coordinate getPosition() {
|
public Coordinate getPosition() {
|
||||||
return point.getCoordinate();
|
return point.getCoordinate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param coord sets the current position
|
||||||
|
*/
|
||||||
public void setPosition(Coordinate coord) {
|
public void setPosition(Coordinate coord) {
|
||||||
desireUpdate();
|
desireUpdate();
|
||||||
this.point = new Point3D(coord, (point != null ? point.getAngle() : 0));
|
this.point = new Point3D(coord, (point != null ? point.getAngle() : 0));
|
||||||
|
|||||||
@@ -78,6 +78,9 @@ public enum ActorExperience {
|
|||||||
*/
|
*/
|
||||||
public final int level;
|
public final int level;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param experience the minimum experience for the level
|
||||||
|
*/
|
||||||
ActorExperience(long experience) {
|
ActorExperience(long experience) {
|
||||||
this.experience = experience;
|
this.experience = experience;
|
||||||
this.level = this.ordinal();
|
this.level = this.ordinal();
|
||||||
|
|||||||
@@ -25,8 +25,12 @@ import com.l2jserver.util.calculator.ComplexCalculator;
|
|||||||
*/
|
*/
|
||||||
public class ActorCalculator extends
|
public class ActorCalculator extends
|
||||||
ComplexCalculator<ActorCalculatorContext, StatType> {
|
ComplexCalculator<ActorCalculatorContext, StatType> {
|
||||||
public ActorCalculator(Class<StatType> type,
|
/**
|
||||||
|
* @param calculators
|
||||||
|
* the calculators
|
||||||
|
*/
|
||||||
|
public ActorCalculator(
|
||||||
Calculator<ActorCalculatorContext, StatType>... calculators) {
|
Calculator<ActorCalculatorContext, StatType>... calculators) {
|
||||||
super(type, calculators);
|
super(StatType.class, calculators);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,10 @@ public class ActorCalculatorContext extends CalculatorContext {
|
|||||||
*/
|
*/
|
||||||
public final Actor actor;
|
public final Actor actor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param actor
|
||||||
|
* the actor
|
||||||
|
*/
|
||||||
public ActorCalculatorContext(Actor actor) {
|
public ActorCalculatorContext(Actor actor) {
|
||||||
this.actor = actor;
|
this.actor = actor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,12 @@ import com.l2jserver.util.calculator.AbstractDoubleFunction;
|
|||||||
*/
|
*/
|
||||||
public abstract class ActorCalculatorFunction extends
|
public abstract class ActorCalculatorFunction extends
|
||||||
AbstractDoubleFunction<ActorCalculatorContext, StatType> {
|
AbstractDoubleFunction<ActorCalculatorContext, StatType> {
|
||||||
|
/**
|
||||||
|
* @param order
|
||||||
|
* the calculation order
|
||||||
|
* @param type
|
||||||
|
* the stat type
|
||||||
|
*/
|
||||||
public ActorCalculatorFunction(int order, StatType type) {
|
public ActorCalculatorFunction(int order, StatType type) {
|
||||||
super(order, type);
|
super(order, type);
|
||||||
}
|
}
|
||||||
@@ -37,6 +43,15 @@ public abstract class ActorCalculatorFunction extends
|
|||||||
return calculate(ctx.actor, ctx.actor.getTemplate(), value);
|
return calculate(ctx.actor, ctx.actor.getTemplate(), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param a
|
||||||
|
* the actor
|
||||||
|
* @param t
|
||||||
|
* the actor template
|
||||||
|
* @param value
|
||||||
|
* 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);
|
double value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,12 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public abstract class ActorFormula extends ActorCalculatorFunction {
|
public abstract class ActorFormula extends ActorCalculatorFunction {
|
||||||
|
/**
|
||||||
|
* @param order
|
||||||
|
* the calculation order
|
||||||
|
* @param type
|
||||||
|
* the stat type
|
||||||
|
*/
|
||||||
public ActorFormula(int order, StatType type) {
|
public ActorFormula(int order, StatType type) {
|
||||||
super(order, type);
|
super(order, type);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class AttackAccuracyBonusCalculator extends ActorFormula {
|
public class AttackAccuracyBonusCalculator extends ActorFormula {
|
||||||
|
/**
|
||||||
|
* Creates a new instance
|
||||||
|
*/
|
||||||
public AttackAccuracyBonusCalculator() {
|
public AttackAccuracyBonusCalculator() {
|
||||||
super(0x200, StatType.ACCURACY_COMBAT);
|
super(0x200, StatType.ACCURACY_COMBAT);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class AttackEvasionBonusCalculator extends ActorFormula {
|
public class AttackEvasionBonusCalculator extends ActorFormula {
|
||||||
|
/**
|
||||||
|
* Creates a new instance
|
||||||
|
*/
|
||||||
public AttackEvasionBonusCalculator() {
|
public AttackEvasionBonusCalculator() {
|
||||||
super(0x200, StatType.EVASION_RATE);
|
super(0x200, StatType.EVASION_RATE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class MagicalAttackBonusCalculator extends ActorFormula {
|
public class MagicalAttackBonusCalculator extends ActorFormula {
|
||||||
|
/**
|
||||||
|
* Creates a new instance
|
||||||
|
*/
|
||||||
public MagicalAttackBonusCalculator() {
|
public MagicalAttackBonusCalculator() {
|
||||||
super(0x200, StatType.MAGIC_ATTACK);
|
super(0x200, StatType.MAGIC_ATTACK);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class MagicalAttackSpeedBonusCalculator extends ActorFormula {
|
public class MagicalAttackSpeedBonusCalculator extends ActorFormula {
|
||||||
|
/**
|
||||||
|
* Creates a new instance
|
||||||
|
*/
|
||||||
public MagicalAttackSpeedBonusCalculator() {
|
public MagicalAttackSpeedBonusCalculator() {
|
||||||
super(0x200, StatType.MAGIC_ATTACK_SPEED);
|
super(0x200, StatType.MAGIC_ATTACK_SPEED);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class MagicalCriticalRateBonusCalculator extends ActorFormula {
|
public class MagicalCriticalRateBonusCalculator extends ActorFormula {
|
||||||
|
/**
|
||||||
|
* Creates a new instance
|
||||||
|
*/
|
||||||
public MagicalCriticalRateBonusCalculator() {
|
public MagicalCriticalRateBonusCalculator() {
|
||||||
super(0x300, StatType.MCRITICAL_RATE);
|
super(0x300, StatType.MCRITICAL_RATE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,9 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class MagicalDefenseBonusCalculator extends ActorFormula {
|
public class MagicalDefenseBonusCalculator extends ActorFormula {
|
||||||
|
/**
|
||||||
|
* Creates a new instance
|
||||||
|
*/
|
||||||
public MagicalDefenseBonusCalculator() {
|
public MagicalDefenseBonusCalculator() {
|
||||||
super(0x200, StatType.MAGIC_DEFENSE);
|
super(0x200, StatType.MAGIC_DEFENSE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class MaximumHPBonusCalculator extends ActorFormula {
|
public class MaximumHPBonusCalculator extends ActorFormula {
|
||||||
|
/**
|
||||||
|
* Creates a new instance
|
||||||
|
*/
|
||||||
public MaximumHPBonusCalculator() {
|
public MaximumHPBonusCalculator() {
|
||||||
super(0x200, StatType.MAX_HP);
|
super(0x200, StatType.MAX_HP);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class MaximumMPBonusCalculator extends ActorFormula {
|
public class MaximumMPBonusCalculator extends ActorFormula {
|
||||||
|
/**
|
||||||
|
* Creates a new instance
|
||||||
|
*/
|
||||||
public MaximumMPBonusCalculator() {
|
public MaximumMPBonusCalculator() {
|
||||||
super(0x200, StatType.MAX_MP);
|
super(0x200, StatType.MAX_MP);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class PhysicalAttackBonusCalculator extends ActorFormula {
|
public class PhysicalAttackBonusCalculator extends ActorFormula {
|
||||||
|
/**
|
||||||
|
* Creates a new instance
|
||||||
|
*/
|
||||||
public PhysicalAttackBonusCalculator() {
|
public PhysicalAttackBonusCalculator() {
|
||||||
super(0x100, StatType.POWER_ATTACK);
|
super(0x100, StatType.POWER_ATTACK);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class PhysicalAttackSpeedBonusCalculator extends ActorFormula {
|
public class PhysicalAttackSpeedBonusCalculator extends ActorFormula {
|
||||||
|
/**
|
||||||
|
* Creates a new instance
|
||||||
|
*/
|
||||||
public PhysicalAttackSpeedBonusCalculator() {
|
public PhysicalAttackSpeedBonusCalculator() {
|
||||||
super(0x200, StatType.POWER_ATTACK_SPEED);
|
super(0x200, StatType.POWER_ATTACK_SPEED);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class PhysicalCriticalRateBonusCalculator extends ActorFormula {
|
public class PhysicalCriticalRateBonusCalculator extends ActorFormula {
|
||||||
|
/**
|
||||||
|
* Creates a new instance
|
||||||
|
*/
|
||||||
public PhysicalCriticalRateBonusCalculator() {
|
public PhysicalCriticalRateBonusCalculator() {
|
||||||
super(0x090, StatType.CRITICAL_RATE);
|
super(0x090, StatType.CRITICAL_RATE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class PhysicalDefenseBonusCalculator extends ActorFormula {
|
public class PhysicalDefenseBonusCalculator extends ActorFormula {
|
||||||
|
/**
|
||||||
|
* Creates a new instance
|
||||||
|
*/
|
||||||
public PhysicalDefenseBonusCalculator() {
|
public PhysicalDefenseBonusCalculator() {
|
||||||
super(0x200, StatType.POWER_DEFENSE);
|
super(0x200, StatType.POWER_DEFENSE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class RunSpeedBonusCalculator extends ActorFormula {
|
public class RunSpeedBonusCalculator extends ActorFormula {
|
||||||
|
/**
|
||||||
|
* Creates a new instance
|
||||||
|
*/
|
||||||
public RunSpeedBonusCalculator() {
|
public RunSpeedBonusCalculator() {
|
||||||
super(0x300, StatType.RUN_SPEED);
|
super(0x300, StatType.RUN_SPEED);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ import com.l2jserver.model.world.actor.stat.StatType;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class WalkSpeedBonusCalculator extends ActorFormula {
|
public class WalkSpeedBonusCalculator extends ActorFormula {
|
||||||
|
/**
|
||||||
|
* Creates a new instance
|
||||||
|
*/
|
||||||
public WalkSpeedBonusCalculator() {
|
public WalkSpeedBonusCalculator() {
|
||||||
super(0x300, StatType.WALK_SPEED);
|
super(0x300, StatType.WALK_SPEED);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,5 +25,8 @@ import com.l2jserver.service.game.world.event.WorldEvent;
|
|||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public interface ActorEvent extends WorldEvent {
|
public interface ActorEvent extends WorldEvent {
|
||||||
|
/**
|
||||||
|
* @return the event actor
|
||||||
|
*/
|
||||||
Actor getActor();
|
Actor getActor();
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user