1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-06 07:32:46 +00:00

Implement the skill effect engine

Implements the skill effect classes and loader from XML files
This commit is contained in:
2011-10-10 11:52:40 -03:00
parent 8b787349d4
commit 7277aadaa6
16 changed files with 562 additions and 14 deletions

View File

@@ -9,8 +9,8 @@
</parent>
<artifactId>l2jserver2-common</artifactId>
<name>L2JServer 2 - Commons module</name>
<description>Lineage II server emulator</description>
<name>L2JServer 2 commons</name>
<description>This module contains all classes common to both login and game server</description>
<url>http://github.com/l2jserver2</url>
<inceptionYear>2011</inceptionYear>

View File

@@ -17,6 +17,12 @@
<soulshot count="1" boost="2.0" />
<hit time="1080" />
<effects range="400">
<teleport>
</teleport>
<buff duration="15" abnormal="speed_up_special">
</buff>
<effect name="BUFF" duration="15" abnormalType="speed_up_special">
<add order="0x40" stat="RUN_SPEED" />
</effect>

View File

@@ -9,8 +9,8 @@
</parent>
<artifactId>l2jserver2-gameserver</artifactId>
<name>L2JServer 2 - Game server module</name>
<description>Lineage II server emulator</description>
<name>L2JServer 2 game server</name>
<description>This game server is responsible for communicating the game client with the game virtual world. It provides data storage and processing along with broadcasting positioning data to other connected clients.</description>
<url>http://github.com/l2jserver2</url>
<inceptionYear>2011</inceptionYear>

View File

@@ -16,9 +16,14 @@
*/
package com.l2jserver.model.template;
import java.util.Collections;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
@@ -26,6 +31,9 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import com.l2jserver.model.game.Skill;
import com.l2jserver.model.id.object.ActorID;
import com.l2jserver.model.id.template.SkillTemplateID;
import com.l2jserver.model.template.skill.SkillEffect;
import com.l2jserver.model.template.skill.effect.TeleportEffect;
import com.l2jserver.util.factory.CollectionFactory;
import com.l2jserver.util.jaxb.SkillTemplateIDAdapter;
/**
@@ -52,6 +60,9 @@ public class SkillTemplate extends AbstractTemplate<Skill> {
*/
protected int maximumLevel = 1;
@XmlElements({ @XmlElement(name = "teleport", type = TeleportEffect.class) })
protected List<SkillEffect> effects = CollectionFactory.newList();
@Override
public Skill create() {
return create(null);
@@ -108,6 +119,31 @@ public class SkillTemplate extends AbstractTemplate<Skill> {
return cooldown;
}
/**
* @return the effects
*/
public List<SkillEffect> getEffects() {
return Collections.unmodifiableList(effects);
}
/**
* Tries to locate in the effects list an effect of the given type.
*
* @param <E>
* the effect type
* @param effectType
* the effect type class
* @return the effect found, if any.
*/
@SuppressWarnings("unchecked")
public <E extends SkillEffect> E getEffect(Class<E> effectType) {
for (final SkillEffect effect : effects) {
if (effectType.isInstance(effect))
return (E) effect;
}
return null;
}
@Override
public SkillTemplateID getID() {
return id;

View File

@@ -0,0 +1,30 @@
/*
* This file is part of l2jserver <l2jserver.com>.
*
* l2jserver is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* l2jserver is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.model.template.skill;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* @author <a href="http://www.rogiel.com">Rogiel</a>
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Effect")
public abstract class SkillEffect {
}

View File

@@ -0,0 +1,47 @@
/*
* This file is part of l2jserver <l2jserver.com>.
*
* l2jserver is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* l2jserver is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.model.template.skill.effect;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import com.l2jserver.model.template.skill.SkillEffect;
/**
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TeleportEffect")
public class BuffEffect extends SkillEffect {
public enum SkillTeleportEffectLocation {
TARGET, OFFSET_FROM_TARGET, POINT;
}
@XmlAttribute(name = "type", required = false)
protected SkillTeleportEffectLocation type = SkillTeleportEffectLocation.TARGET;
/**
* @return the teleport effect type
*/
public SkillTeleportEffectLocation getType() {
return type;
}
}

View File

@@ -0,0 +1,47 @@
/*
* This file is part of l2jserver <l2jserver.com>.
*
* l2jserver is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* l2jserver is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.model.template.skill.effect;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import com.l2jserver.model.template.skill.SkillEffect;
/**
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TeleportEffect")
public class TeleportEffect extends SkillEffect {
public enum SkillTeleportEffectLocation {
TARGET, OFFSET_FROM_TARGET, POINT;
}
@XmlAttribute(name = "type", required = false)
protected SkillTeleportEffectLocation type = SkillTeleportEffectLocation.TARGET;
/**
* @return the teleport effect type
*/
public SkillTeleportEffectLocation getType() {
return type;
}
}

View File

@@ -46,7 +46,6 @@ public class KnownListUpdateFilter extends AndFilter<PositionableObject> {
* @param old
* the old position
*/
@SuppressWarnings("unchecked")
public KnownListUpdateFilter(PositionableObject object, Point3D old) {
super(new KnownListFilter(object), new NotFilter<PositionableObject>(
new RangePointFilter(old, KNOWNLIST_RANGE)));

View File

@@ -9,8 +9,8 @@
</parent>
<artifactId>l2jserver2-loginserver</artifactId>
<name>L2JServer 2 - Login server module</name>
<description>Lineage II server emulator</description>
<name>L2JServer 2 login server</name>
<description>The login server provides authentication capabilities for the game clients. The login server can provide login for several game servers at the same time.</description>
<url>http://github.com/l2jserver2</url>
<inceptionYear>2011</inceptionYear>

View File

View File

@@ -0,0 +1,125 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Generated by Apache Maven Doxia at Oct 9, 2011 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Project Distribution Management</title>
<style type="text/css" media="all">
@import url("./css/maven-base.css");
@import url("./css/maven-theme.css");
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
<meta name="Date-Revision-yyyymmdd" content="20111009" />
<meta http-equiv="Content-Language" content="en" />
</head>
<body class="composite">
<div id="banner">
<div id="bannerLeft">
L2JServer 2 commons
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
<span id="publishDate">Last Published: 2011-10-09</span>
&nbsp;| <span id="projectVersion">Version: 0.1.0-SNAPSHOT</span>
</div>
<div class="xright"> <a href="./" title="L2JServer 2 commons">L2JServer 2 commons</a>
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>Parent Project</h5>
<ul>
<li class="none">
<a href="../index.html" title="L2JServer 2">L2JServer 2</a>
</li>
</ul>
<h5>Project Documentation</h5>
<ul>
<li class="expanded">
<a href="project-info.html" title="Project Information">Project Information</a>
<ul>
<li class="none">
<a href="source-repository.html" title="Source Repository">Source Repository</a>
</li>
<li class="none">
<a href="index.html" title="About">About</a>
</li>
<li class="none">
<strong>Distribution Management</strong>
</li>
<li class="none">
<a href="dependencies.html" title="Dependencies">Dependencies</a>
</li>
<li class="none">
<a href="plugin-management.html" title="Plugin Management">Plugin Management</a>
</li>
<li class="none">
<a href="integration.html" title="Continuous Integration">Continuous Integration</a>
</li>
<li class="none">
<a href="project-summary.html" title="Project Summary">Project Summary</a>
</li>
<li class="none">
<a href="mail-lists.html" title="Mailing Lists">Mailing Lists</a>
</li>
<li class="none">
<a href="dependency-convergence.html" title="Dependency Convergence">Dependency Convergence</a>
</li>
<li class="none">
<a href="plugins.html" title="Project Plugins">Project Plugins</a>
</li>
<li class="none">
<a href="team-list.html" title="Project Team">Project Team</a>
</li>
<li class="none">
<a href="license.html" title="Project License">Project License</a>
</li>
<li class="none">
<a href="issue-tracking.html" title="Issue Tracking">Issue Tracking</a>
</li>
</ul>
</li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img class="poweredBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<div class="section"><h2>Overview<a name="Overview"></a></h2><a name="Overview"></a><p>The following is the distribution management information used by this project.</p><div class="section"><h3>Download URL<a name="Download_URL"></a></h3><a name="Download_URL"></a><a class="externalLink" href="https://github.com/l2jserver2/l2jserver2/downloads">https://github.com/l2jserver2/l2jserver2/downloads</a></div></div>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div class="xright">
Copyright &#169; 2011
<a href="http://www.l2jserver.com/">L2JServer team</a>.
All Rights Reserved.
</div>
<div class="clear">
<hr/>
</div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

125
l2jserver2-site/index.html Normal file
View File

@@ -0,0 +1,125 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Generated by Apache Maven Doxia at Oct 9, 2011 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>About</title>
<style type="text/css" media="all">
@import url("./css/maven-base.css");
@import url("./css/maven-theme.css");
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
<meta name="Date-Revision-yyyymmdd" content="20111009" />
<meta http-equiv="Content-Language" content="en" />
</head>
<body class="composite">
<div id="banner">
<div id="bannerLeft">
L2JServer 2 commons
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
<span id="publishDate">Last Published: 2011-10-09</span>
&nbsp;| <span id="projectVersion">Version: 0.1.0-SNAPSHOT</span>
</div>
<div class="xright"> <a href="./" title="L2JServer 2 commons">L2JServer 2 commons</a>
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>Parent Project</h5>
<ul>
<li class="none">
<a href="../index.html" title="L2JServer 2">L2JServer 2</a>
</li>
</ul>
<h5>Project Documentation</h5>
<ul>
<li class="expanded">
<a href="project-info.html" title="Project Information">Project Information</a>
<ul>
<li class="none">
<a href="source-repository.html" title="Source Repository">Source Repository</a>
</li>
<li class="none">
<strong>About</strong>
</li>
<li class="none">
<a href="distribution-management.html" title="Distribution Management">Distribution Management</a>
</li>
<li class="none">
<a href="dependencies.html" title="Dependencies">Dependencies</a>
</li>
<li class="none">
<a href="plugin-management.html" title="Plugin Management">Plugin Management</a>
</li>
<li class="none">
<a href="integration.html" title="Continuous Integration">Continuous Integration</a>
</li>
<li class="none">
<a href="project-summary.html" title="Project Summary">Project Summary</a>
</li>
<li class="none">
<a href="mail-lists.html" title="Mailing Lists">Mailing Lists</a>
</li>
<li class="none">
<a href="dependency-convergence.html" title="Dependency Convergence">Dependency Convergence</a>
</li>
<li class="none">
<a href="plugins.html" title="Project Plugins">Project Plugins</a>
</li>
<li class="none">
<a href="team-list.html" title="Project Team">Project Team</a>
</li>
<li class="none">
<a href="license.html" title="Project License">Project License</a>
</li>
<li class="none">
<a href="issue-tracking.html" title="Issue Tracking">Issue Tracking</a>
</li>
</ul>
</li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img class="poweredBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<div class="section"><h2>About L2JServer 2 commons<a name="About_L2JServer_2_commons"></a></h2><a name="About_L2JServer_2_commons"></a><p>This module contains all classes common to both login and game server</p></div>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div class="xright">
Copyright &#169; 2011
<a href="http://www.l2jserver.com/">L2JServer team</a>.
All Rights Reserved.
</div>
<div class="clear">
<hr/>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,125 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Generated by Apache Maven Doxia at Oct 9, 2011 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Source Repository</title>
<style type="text/css" media="all">
@import url("./css/maven-base.css");
@import url("./css/maven-theme.css");
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
<meta name="Date-Revision-yyyymmdd" content="20111009" />
<meta http-equiv="Content-Language" content="en" />
</head>
<body class="composite">
<div id="banner">
<div id="bannerLeft">
L2JServer 2 commons
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
<span id="publishDate">Last Published: 2011-10-09</span>
&nbsp;| <span id="projectVersion">Version: 0.1.0-SNAPSHOT</span>
</div>
<div class="xright"> <a href="./" title="L2JServer 2 commons">L2JServer 2 commons</a>
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>Parent Project</h5>
<ul>
<li class="none">
<a href="../index.html" title="L2JServer 2">L2JServer 2</a>
</li>
</ul>
<h5>Project Documentation</h5>
<ul>
<li class="expanded">
<a href="project-info.html" title="Project Information">Project Information</a>
<ul>
<li class="none">
<strong>Source Repository</strong>
</li>
<li class="none">
<a href="index.html" title="About">About</a>
</li>
<li class="none">
<a href="distribution-management.html" title="Distribution Management">Distribution Management</a>
</li>
<li class="none">
<a href="dependencies.html" title="Dependencies">Dependencies</a>
</li>
<li class="none">
<a href="plugin-management.html" title="Plugin Management">Plugin Management</a>
</li>
<li class="none">
<a href="integration.html" title="Continuous Integration">Continuous Integration</a>
</li>
<li class="none">
<a href="project-summary.html" title="Project Summary">Project Summary</a>
</li>
<li class="none">
<a href="mail-lists.html" title="Mailing Lists">Mailing Lists</a>
</li>
<li class="none">
<a href="dependency-convergence.html" title="Dependency Convergence">Dependency Convergence</a>
</li>
<li class="none">
<a href="plugins.html" title="Project Plugins">Project Plugins</a>
</li>
<li class="none">
<a href="team-list.html" title="Project Team">Project Team</a>
</li>
<li class="none">
<a href="license.html" title="Project License">Project License</a>
</li>
<li class="none">
<a href="issue-tracking.html" title="Issue Tracking">Issue Tracking</a>
</li>
</ul>
</li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img class="poweredBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<div class="section"><h2>Overview<a name="Overview"></a></h2><a name="Overview"></a><p>This project uses a Source Content Management System to manage its source code.</p></div><div class="section"><h2>Web Access<a name="Web_Access"></a></h2><a name="Web_Access"></a><p>The following is a link to the online source repository.</p><div class="source"><pre><a class="externalLink" href="https://github.com/l2jserver2/l2jserver2/l2jserver2-common">https://github.com/l2jserver2/l2jserver2/l2jserver2-common</a></pre></div></div><div class="section"><h2>Anonymous access<a name="Anonymous_access"></a></h2><a name="Anonymous_access"></a><p>Refer to the documentation of the SCM used for more information about anonymously check out. The connection url is:</p><div class="source"><pre>git://github.com/l2jserver2/l2jserver2.git/l2jserver2-common</pre></div></div><div class="section"><h2>Developer access<a name="Developer_access"></a></h2><a name="Developer_access"></a><p>Refer to the documentation of the SCM used for more information about developer check out. The connection url is:</p><div class="source"><pre>ssh://git@github.com:l2jserver2/l2jserver2.git/l2jserver2-common</pre></div></div><div class="section"><h2>Access from behind a firewall<a name="Access_from_behind_a_firewall"></a></h2><a name="Access_from_behind_a_firewall"></a><p>Refer to the documentation of the SCM used for more information about access behind a firewall.</p></div>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div class="xright">
Copyright &#169; 2011
<a href="http://www.l2jserver.com/">L2JServer team</a>.
All Rights Reserved.
</div>
<div class="clear">
<hr/>
</div>
</div>
</body>
</html>

View File

@@ -9,8 +9,8 @@
</parent>
<artifactId>l2jserver2-tools</artifactId>
<name>L2JServer 2 - Commons module</name>
<description>Lineage II server emulator</description>
<name>L2JServer 2 tools</name>
<description>Module providing tools for developer usage only. Those tools are used for conversion and batch updating scripts.</description>
<url>http://github.com/l2jserver2</url>
<inceptionYear>2011</inceptionYear>

18
pom.xml
View File

@@ -9,6 +9,15 @@
<name>L2JServer 2</name>
<description>Lineage II server emulator</description>
<inceptionYear>2011</inceptionYear>
<organization>
<name>L2JServer team</name>
<url>http://www.l2jserver.com/</url>
</organization>
<url>http://github.com/l2jserver2</url>
<distributionManagement>
<downloadUrl>https://github.com/l2jserver2/l2jserver2/downloads</downloadUrl>
</distributionManagement>
<modules>
<module>l2jserver2-common</module>
@@ -18,13 +27,13 @@
</modules>
<issueManagement>
<system>GitHub</system>
<system>GitHub Issues</system>
<url>https://github.com/l2jserver2/l2jserver2/issues</url>
</issueManagement>
<ciManagement>
<system>GitHub</system>
<url>https://github.com/l2jserver2/l2jserver2/wiki</url>
<url>https://github.com/l2jserver2/l2jserver2</url>
</ciManagement>
<developers>
@@ -45,14 +54,14 @@
<connection>scm:git://github.com/l2jserver2/l2jserver2.git</connection>
<developerConnection>scm:ssh://git@github.com:l2jserver2/l2jserver2.git</developerConnection>
<tag>master</tag>
<url>https://github.com/l2jserver2/l2jserver2</url>
<url>https://github.com/l2jserver2/l2jserver2/tree/${project.scm.tag}</url>
</scm>
<licenses>
<license>
<name>GNU General Public License version 3</name>
<url>http://www.gnu.org/licenses/gpl.txt</url>
<distribution>manual</distribution>
<distribution>repo</distribution>
</license>
</licenses>
@@ -125,5 +134,4 @@
</snapshots>
</repository>
</repositories>
<url>http://github.com/l2jserver2</url>
</project>