1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-09 08:52:51 +00:00

Semi-working attack service

Signed-off-by: Rogiel <rogiel@rogiel.com>
This commit is contained in:
2011-05-30 20:02:19 -03:00
parent 52d4be0bf2
commit ae3007559f
61 changed files with 537 additions and 181 deletions

View File

@@ -28,6 +28,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.calculator.ItemPhysicalDamageActorCalculator;
import com.l2jserver.model.world.Item;
import com.l2jserver.util.jaxb.ItemTemplateIDAdapter;
@@ -58,15 +59,26 @@ public class ItemTemplate extends AbstractTemplate<Item> {
protected int price = 0;
@XmlElement(name = "icon")
protected String icon;
@XmlElement(name = "weight")
@XmlElement(name = "effect")
protected EffectContainer effect;
@XmlType(namespace = "item")
private static class EffectContainer {
@XmlAttribute(name = "type")
protected EffectType effect = null;
protected EffectType effect;
}
@XmlType(namespace = "item")
protected static class StatsContainer {
@XmlElement(name = "physicalDamage")
protected StatAttribute physicalDamage;
@XmlElement(name = "magicalDamage")
protected StatAttribute magicalDamage;
}
@XmlElement(name = "stats")
protected StatsContainer stats;
protected ItemMaterial material;
public enum ItemMaterial {
@@ -77,6 +89,38 @@ public class ItemTemplate extends AbstractTemplate<Item> {
IMMEDIATE;
}
@XmlType(namespace = "item")
public static class StatAttribute {
@XmlElement(name = "set")
protected StatSet set;
public static class StatSet {
protected int order;
protected double value;
/**
* @return the order
*/
public int getOrder() {
return order;
}
/**
* @return the value
*/
public double getValue() {
return value;
}
}
/**
* @return the set
*/
public StatSet getSet() {
return set;
}
}
@Override
public Item create() {
log.debug("Creating a new Item instance with template {}", this);
@@ -125,6 +169,24 @@ public class ItemTemplate extends AbstractTemplate<Item> {
return material;
}
/**
* @return the physical damage
*/
public ItemPhysicalDamageActorCalculator getPhysicalDamage() {
if (stats == null)
return null;
return new ItemPhysicalDamageActorCalculator(stats.physicalDamage.set);
}
/**
* @return the magical damage
*/
public StatAttribute getMagicalDamage() {
if (stats == null)
return null;
return stats.magicalDamage;
}
/*
* (non-Javadoc)
*