From 7277aadaa608fc589b2a08d04bc70a8a3f18cd01 Mon Sep 17 00:00:00 2001 From: Rogiel Date: Mon, 10 Oct 2011 11:52:40 -0300 Subject: [PATCH] Implement the skill effect engine Implements the skill effect classes and loader from XML files --- l2jserver2-common/pom.xml | 4 +- l2jserver2-gameserver/data/sample/skill.xml | 6 + l2jserver2-gameserver/pom.xml | 4 +- .../model/template/SkillTemplate.java | 36 +++++ .../model/template/skill/SkillEffect.java | 30 +++++ .../template/skill/effect/BuffEffect.java | 47 +++++++ .../template/skill/effect/TeleportEffect.java | 47 +++++++ .../filter/impl/KnownListUpdateFilter.java | 1 - l2jserver2-loginserver/pom.xml | 4 +- l2jserver2-site/dependencies.html | 0 l2jserver2-site/distribution-management.html | 125 ++++++++++++++++++ l2jserver2-site/images/close.gif | Bin 0 -> 279 bytes l2jserver2-site/index.html | 125 ++++++++++++++++++ l2jserver2-site/source-repository.html | 125 ++++++++++++++++++ l2jserver2-tools/pom.xml | 4 +- pom.xml | 18 ++- 16 files changed, 562 insertions(+), 14 deletions(-) create mode 100644 l2jserver2-gameserver/src/main/java/com/l2jserver/model/template/skill/SkillEffect.java create mode 100644 l2jserver2-gameserver/src/main/java/com/l2jserver/model/template/skill/effect/BuffEffect.java create mode 100644 l2jserver2-gameserver/src/main/java/com/l2jserver/model/template/skill/effect/TeleportEffect.java create mode 100644 l2jserver2-site/dependencies.html create mode 100644 l2jserver2-site/distribution-management.html create mode 100644 l2jserver2-site/images/close.gif create mode 100644 l2jserver2-site/index.html create mode 100644 l2jserver2-site/source-repository.html diff --git a/l2jserver2-common/pom.xml b/l2jserver2-common/pom.xml index eb44d3d8c..7d6bd1765 100644 --- a/l2jserver2-common/pom.xml +++ b/l2jserver2-common/pom.xml @@ -9,8 +9,8 @@ l2jserver2-common - L2JServer 2 - Commons module - Lineage II server emulator + L2JServer 2 commons + This module contains all classes common to both login and game server http://github.com/l2jserver2 2011 diff --git a/l2jserver2-gameserver/data/sample/skill.xml b/l2jserver2-gameserver/data/sample/skill.xml index e1ff3b9de..56259d13d 100644 --- a/l2jserver2-gameserver/data/sample/skill.xml +++ b/l2jserver2-gameserver/data/sample/skill.xml @@ -17,6 +17,12 @@ + + + + + + diff --git a/l2jserver2-gameserver/pom.xml b/l2jserver2-gameserver/pom.xml index 863ad2dfb..95859d37a 100644 --- a/l2jserver2-gameserver/pom.xml +++ b/l2jserver2-gameserver/pom.xml @@ -9,8 +9,8 @@ l2jserver2-gameserver - L2JServer 2 - Game server module - Lineage II server emulator + L2JServer 2 game server + 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. http://github.com/l2jserver2 2011 diff --git a/l2jserver2-gameserver/src/main/java/com/l2jserver/model/template/SkillTemplate.java b/l2jserver2-gameserver/src/main/java/com/l2jserver/model/template/SkillTemplate.java index 7dc0109a1..2cfedff71 100644 --- a/l2jserver2-gameserver/src/main/java/com/l2jserver/model/template/SkillTemplate.java +++ b/l2jserver2-gameserver/src/main/java/com/l2jserver/model/template/SkillTemplate.java @@ -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 { */ protected int maximumLevel = 1; + @XmlElements({ @XmlElement(name = "teleport", type = TeleportEffect.class) }) + protected List effects = CollectionFactory.newList(); + @Override public Skill create() { return create(null); @@ -108,6 +119,31 @@ public class SkillTemplate extends AbstractTemplate { return cooldown; } + /** + * @return the effects + */ + public List getEffects() { + return Collections.unmodifiableList(effects); + } + + /** + * Tries to locate in the effects list an effect of the given type. + * + * @param + * the effect type + * @param effectType + * the effect type class + * @return the effect found, if any. + */ + @SuppressWarnings("unchecked") + public E getEffect(Class effectType) { + for (final SkillEffect effect : effects) { + if (effectType.isInstance(effect)) + return (E) effect; + } + return null; + } + @Override public SkillTemplateID getID() { return id; diff --git a/l2jserver2-gameserver/src/main/java/com/l2jserver/model/template/skill/SkillEffect.java b/l2jserver2-gameserver/src/main/java/com/l2jserver/model/template/skill/SkillEffect.java new file mode 100644 index 000000000..d041e9897 --- /dev/null +++ b/l2jserver2-gameserver/src/main/java/com/l2jserver/model/template/skill/SkillEffect.java @@ -0,0 +1,30 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.template.skill; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + +/** + * @author Rogiel + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Effect") +public abstract class SkillEffect { +} diff --git a/l2jserver2-gameserver/src/main/java/com/l2jserver/model/template/skill/effect/BuffEffect.java b/l2jserver2-gameserver/src/main/java/com/l2jserver/model/template/skill/effect/BuffEffect.java new file mode 100644 index 000000000..02a29e60c --- /dev/null +++ b/l2jserver2-gameserver/src/main/java/com/l2jserver/model/template/skill/effect/BuffEffect.java @@ -0,0 +1,47 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.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 Rogiel + */ +@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; + } +} diff --git a/l2jserver2-gameserver/src/main/java/com/l2jserver/model/template/skill/effect/TeleportEffect.java b/l2jserver2-gameserver/src/main/java/com/l2jserver/model/template/skill/effect/TeleportEffect.java new file mode 100644 index 000000000..13cfb30dc --- /dev/null +++ b/l2jserver2-gameserver/src/main/java/com/l2jserver/model/template/skill/effect/TeleportEffect.java @@ -0,0 +1,47 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.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 Rogiel + */ +@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; + } +} diff --git a/l2jserver2-gameserver/src/main/java/com/l2jserver/service/game/world/filter/impl/KnownListUpdateFilter.java b/l2jserver2-gameserver/src/main/java/com/l2jserver/service/game/world/filter/impl/KnownListUpdateFilter.java index ade8f61d2..f3bd6f885 100644 --- a/l2jserver2-gameserver/src/main/java/com/l2jserver/service/game/world/filter/impl/KnownListUpdateFilter.java +++ b/l2jserver2-gameserver/src/main/java/com/l2jserver/service/game/world/filter/impl/KnownListUpdateFilter.java @@ -46,7 +46,6 @@ public class KnownListUpdateFilter extends AndFilter { * @param old * the old position */ - @SuppressWarnings("unchecked") public KnownListUpdateFilter(PositionableObject object, Point3D old) { super(new KnownListFilter(object), new NotFilter( new RangePointFilter(old, KNOWNLIST_RANGE))); diff --git a/l2jserver2-loginserver/pom.xml b/l2jserver2-loginserver/pom.xml index f0e07033d..4b268f7fc 100644 --- a/l2jserver2-loginserver/pom.xml +++ b/l2jserver2-loginserver/pom.xml @@ -9,8 +9,8 @@ l2jserver2-loginserver - L2JServer 2 - Login server module - Lineage II server emulator + L2JServer 2 login server + The login server provides authentication capabilities for the game clients. The login server can provide login for several game servers at the same time. http://github.com/l2jserver2 2011 diff --git a/l2jserver2-site/dependencies.html b/l2jserver2-site/dependencies.html new file mode 100644 index 000000000..e69de29bb diff --git a/l2jserver2-site/distribution-management.html b/l2jserver2-site/distribution-management.html new file mode 100644 index 000000000..f2ca539b5 --- /dev/null +++ b/l2jserver2-site/distribution-management.html @@ -0,0 +1,125 @@ + + + + + + Project Distribution Management + + + + + + + + + +
+ +
+
+
+

Overview

The following is the distribution management information used by this project.

+
+
+
+
+
+ + + diff --git a/l2jserver2-site/images/close.gif b/l2jserver2-site/images/close.gif new file mode 100644 index 0000000000000000000000000000000000000000..1c26bbc5264fcc943ad7b5a0f1a84daece211f34 GIT binary patch literal 279 zcmZ?wbhEHb6kyFkwP}e}6+mLp=yE)H5&?6cps==O-j2#K*@61O)i|`#U%|*xTD17#Qg5 z>nkWI$ji$M2ng`=^D}^ygDj#2&;c6F0P+h1n~g(5frm~PL&uV$l`S$eFDwzBDbhJD v>}Bvw*Al_tWna1PC9OaGVdk23i}vRhZI{iR^*V|n<^22a#~T_O9T}_vbswrX literal 0 HcmV?d00001 diff --git a/l2jserver2-site/index.html b/l2jserver2-site/index.html new file mode 100644 index 000000000..32e878868 --- /dev/null +++ b/l2jserver2-site/index.html @@ -0,0 +1,125 @@ + + + + + + About + + + + + + + + + +
+ +
+
+
+

About L2JServer 2 commons

This module contains all classes common to both login and game server

+
+
+
+
+
+ + + diff --git a/l2jserver2-site/source-repository.html b/l2jserver2-site/source-repository.html new file mode 100644 index 000000000..7fdded8a8 --- /dev/null +++ b/l2jserver2-site/source-repository.html @@ -0,0 +1,125 @@ + + + + + + Source Repository + + + + + + + + + +
+ +
+
+
+

Overview

This project uses a Source Content Management System to manage its source code.

Web Access

The following is a link to the online source repository.

Anonymous access

Refer to the documentation of the SCM used for more information about anonymously check out. The connection url is:

git://github.com/l2jserver2/l2jserver2.git/l2jserver2-common

Developer access

Refer to the documentation of the SCM used for more information about developer check out. The connection url is:

ssh://git@github.com:l2jserver2/l2jserver2.git/l2jserver2-common

Access from behind a firewall

Refer to the documentation of the SCM used for more information about access behind a firewall.

+
+
+
+
+
+ + + diff --git a/l2jserver2-tools/pom.xml b/l2jserver2-tools/pom.xml index cd9d2db59..dbfb84fcd 100644 --- a/l2jserver2-tools/pom.xml +++ b/l2jserver2-tools/pom.xml @@ -9,8 +9,8 @@ l2jserver2-tools - L2JServer 2 - Commons module - Lineage II server emulator + L2JServer 2 tools + Module providing tools for developer usage only. Those tools are used for conversion and batch updating scripts. http://github.com/l2jserver2 2011 diff --git a/pom.xml b/pom.xml index 394338a7b..9ca633960 100644 --- a/pom.xml +++ b/pom.xml @@ -9,6 +9,15 @@ L2JServer 2 Lineage II server emulator 2011 + + L2JServer team + http://www.l2jserver.com/ + + http://github.com/l2jserver2 + + + https://github.com/l2jserver2/l2jserver2/downloads + l2jserver2-common @@ -18,13 +27,13 @@ - GitHub + GitHub Issues https://github.com/l2jserver2/l2jserver2/issues GitHub - https://github.com/l2jserver2/l2jserver2/wiki + https://github.com/l2jserver2/l2jserver2 @@ -45,14 +54,14 @@ scm:git://github.com/l2jserver2/l2jserver2.git scm:ssh://git@github.com:l2jserver2/l2jserver2.git master - https://github.com/l2jserver2/l2jserver2 + https://github.com/l2jserver2/l2jserver2/tree/${project.scm.tag} GNU General Public License version 3 http://www.gnu.org/licenses/gpl.txt - manual + repo @@ -125,5 +134,4 @@ - http://github.com/l2jserver2