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

Item template structure

Signed-off-by: Rogiel <rogiel@rogiel.com>
This commit is contained in:
2011-05-14 20:11:42 -03:00
parent e886165b89
commit fe41dbdc6f
59 changed files with 1400 additions and 85 deletions

View File

@@ -0,0 +1,19 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.template.capability.Defendable;
import com.l2jserver.model.template.capability.IncomingDamageIntercept;
import com.l2jserver.model.world.Item;
/**
* Template for Armor {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class ArmorTemplate extends ItemTemplate implements Defendable,
IncomingDamageIntercept {
public ArmorTemplate(ItemTemplateID id) {
super(id);
}
}

View File

@@ -0,0 +1,15 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.world.Item;
/**
* Template for consumable arrow {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class ArrowTemplate extends ConsumableTemplate {
public ArrowTemplate(ItemTemplateID id, String icon, ItemMaterial material) {
super(id, icon, material);
}
}

View File

@@ -0,0 +1,16 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.world.Item;
/**
* Template for Castle Guard {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class CastleGuardTemplate extends ItemTemplate {
public CastleGuardTemplate(ItemTemplateID id) {
super(id);
}
}

View File

@@ -0,0 +1,19 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.template.capability.Consumable;
import com.l2jserver.model.world.Item;
/**
* Template for consumable {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class ConsumableTemplate extends ItemTemplate implements
Consumable {
public ConsumableTemplate(ItemTemplateID id, String icon,
ItemMaterial material) {
super(id, icon, material);
}
}

View File

@@ -0,0 +1,16 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.world.Item;
/**
* Template for coupom {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class CoupomTemplate extends ItemTemplate {
public CoupomTemplate(ItemTemplateID id) {
super(id);
}
}

View File

@@ -0,0 +1,16 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.world.Item;
/**
* Template for crop {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class CropTemplate extends ItemTemplate {
public CropTemplate(ItemTemplateID id) {
super(id);
}
}

View File

@@ -0,0 +1,15 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.world.Item;
/**
* Template for consumable Dye {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class DyeTemplate extends ConsumableTemplate {
public DyeTemplate(ItemTemplateID id, String icon, ItemMaterial material) {
super(id, icon, material);
}
}

View File

@@ -0,0 +1,15 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.world.Item;
/**
* Template for consumable elixir {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class ElixirTemplate extends ConsumableTemplate {
public ElixirTemplate(ItemTemplateID id, String icon, ItemMaterial material) {
super(id, icon, material);
}
}

View File

@@ -0,0 +1,15 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.world.Item;
/**
* Template for consumable enchant scroll {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class EnchantScrollTemplate extends ScrollTemplate {
public EnchantScrollTemplate(ItemTemplateID id, String icon) {
super(id, icon);
}
}

View File

@@ -0,0 +1,16 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.world.Item;
/**
* Template for harvest {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class HarvestTemplate extends ItemTemplate {
public HarvestTemplate(ItemTemplateID id) {
super(id);
}
}

View File

@@ -0,0 +1,15 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.world.Item;
/**
* Template for lottery ticket {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class LotteryTicketTemplate extends TicketTemplate {
public LotteryTicketTemplate(ItemTemplateID id) {
super(id);
}
}

View File

@@ -0,0 +1,16 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.world.Item;
/**
* Template for lure {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class LureTemplate extends ItemTemplate {
public LureTemplate(ItemTemplateID id) {
super(id);
}
}

View File

@@ -0,0 +1,16 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.world.Item;
/**
* Template for material {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class MaterialTemplate extends ItemTemplate {
public MaterialTemplate(ItemTemplateID id) {
super(id);
}
}

View File

@@ -0,0 +1,16 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.world.Item;
/**
* Template for pet collar {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class PetCollarTemplate extends ItemTemplate {
public PetCollarTemplate(ItemTemplateID id) {
super(id);
}
}

View File

@@ -0,0 +1,17 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.capability.Stackable;
import com.l2jserver.model.world.Item;
/**
* Template for Potion {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class PotionTemplate extends ConsumableTemplate implements
Stackable<Item> {
public PotionTemplate(ItemTemplateID id, String icon) {
super(id, icon, ItemMaterial.LIQUID);
}
}

View File

@@ -0,0 +1,15 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.world.Item;
/**
* Template for Race Ticket {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class RaceTicketTemplate extends TicketTemplate {
public RaceTicketTemplate(ItemTemplateID id) {
super(id);
}
}

View File

@@ -0,0 +1,18 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.world.Item;
/**
* Template for recipe {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class RecipeTemplate extends ItemTemplate {
private ItemTemplateID item;
public RecipeTemplate(ItemTemplateID id) {
super(id);
}
}

View File

@@ -0,0 +1,16 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.world.Item;
/**
* Template for rune {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class RuneTemplate extends ItemTemplate {
public RuneTemplate(ItemTemplateID id) {
super(id);
}
}

View File

@@ -0,0 +1,15 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.world.Item;
/**
* Template for consumable scroll {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class ScrollTemplate extends ConsumableTemplate {
public ScrollTemplate(ItemTemplateID id, String icon) {
super(id, icon, ItemMaterial.PAPER);
}
}

View File

@@ -0,0 +1,16 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.world.Item;
/**
* Template for seed {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class SeedTemplate extends ItemTemplate {
public SeedTemplate(ItemTemplateID id) {
super(id);
}
}

View File

@@ -0,0 +1,15 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.world.Item;
/**
* Template for ticket of lord {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class TicketOfLordTemplate extends TicketTemplate {
public TicketOfLordTemplate(ItemTemplateID id) {
super(id);
}
}

View File

@@ -0,0 +1,16 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.world.Item;
/**
* Template for ticket {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class TicketTemplate extends ItemTemplate {
public TicketTemplate(ItemTemplateID id) {
super(id);
}
}

View File

@@ -0,0 +1,201 @@
package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.template.capability.Attackable;
import com.l2jserver.model.world.Item;
import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll;
/**
* Template for Weapon {@link Item}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class WeaponTemplate extends ItemTemplate implements Attackable {
protected InventoryPaperdoll paperdoll = null;
protected WeaponType type;
public enum WeaponType {
FISHINGROD, CROSSBOW, BIG_SWORD, RAPIER, DUAL_FIST, ETC, DAGGER, BLUNT, BIG_BLUNT, DUAL_DAGGER, DUAL, FLAG, POLE, FIST, BOW, OWN_THING, SWORD, ANCIENT_SWORD;
}
protected final WeaponAttribute attribute = new WeaponAttribute();
protected int randomDamage = 0;
protected int attackRange = 0;
protected int[] damageRange = new int[] {};
protected int soulshots = 0;
protected int spiritshots = 0;
protected int crystals;
protected CrystalType crystal;
public enum CrystalType {
GRADE_A, GRADE_B, GRADE_C, GRADE_D;
}
public WeaponTemplate(ItemTemplateID id, String icon,
ItemMaterial material, InventoryPaperdoll paperdoll, WeaponType type) {
super(id, icon, material);
this.paperdoll = paperdoll;
this.type = type;
}
public enum WeaponAttributeType {
PHYSICAL_ATTACK, MAGICAL_ATTACK, R_CRITICAL, PHYSICAL_ATTACK_SPEED;
}
public class WeaponAttribute {
public void add(WeaponAttributeType type, int order, int value) {
}
public void set(WeaponAttributeType type, int order, int value) {
}
public void enchant(WeaponAttributeType type, int order, int value) {
}
}
/**
* @return the paperdoll
*/
public InventoryPaperdoll getPaperdoll() {
return paperdoll;
}
/**
* @param paperdoll
* the paperdoll to set
*/
public void setPaperdoll(InventoryPaperdoll paperdoll) {
this.paperdoll = paperdoll;
}
/**
* @return the type
*/
public WeaponType getType() {
return type;
}
/**
* @param type
* the type to set
*/
public void setType(WeaponType type) {
this.type = type;
}
/**
* @return the randomDamage
*/
public int getRandomDamage() {
return randomDamage;
}
/**
* @param randomDamage
* the randomDamage to set
*/
public void setRandomDamage(int randomDamage) {
this.randomDamage = randomDamage;
}
/**
* @return the attackRange
*/
public int getAttackRange() {
return attackRange;
}
/**
* @param attackRange
* the attackRange to set
*/
public void setAttackRange(int attackRange) {
this.attackRange = attackRange;
}
/**
* @return the damageRange
*/
public int[] getDamageRange() {
return damageRange;
}
/**
* @param damageRange
* the damageRange to set
*/
public void setDamageRange(int[] damageRange) {
this.damageRange = damageRange;
}
/**
* @return the soulshots
*/
public int getSoulshots() {
return soulshots;
}
/**
* @param soulshots
* the soulshots to set
*/
public void setSoulshots(int soulshots) {
this.soulshots = soulshots;
}
/**
* @return the spiritshots
*/
public int getSpiritshots() {
return spiritshots;
}
/**
* @param spiritshots
* the spiritshots to set
*/
public void setSpiritshots(int spiritshots) {
this.spiritshots = spiritshots;
}
/**
* @return the crystals
*/
public int getCrystals() {
return crystals;
}
/**
* @param crystals
* the crystals to set
*/
public void setCrystals(int crystals) {
this.crystals = crystals;
}
/**
* @return the crystal
*/
public CrystalType getCrystal() {
return crystal;
}
/**
* @param crystal
* the crystal to set
*/
public void setCrystal(CrystalType crystal) {
this.crystal = crystal;
}
/**
* @return the attribute
*/
public WeaponAttribute getAttribute() {
return attribute;
}
}