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

Merge branch 'development/skill'

This commit is contained in:
2011-10-12 12:37:00 -03:00
15 changed files with 562 additions and 13 deletions

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;
}
}