mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-08 08:23:11 +00:00
@@ -4,6 +4,12 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.l2jserver.model.id.template.ItemTemplateID;
|
||||
import com.l2jserver.model.template.capability.Depositable;
|
||||
import com.l2jserver.model.template.capability.Dropable;
|
||||
import com.l2jserver.model.template.capability.Enchantable;
|
||||
import com.l2jserver.model.template.capability.Sellable;
|
||||
import com.l2jserver.model.template.capability.Tradable;
|
||||
import com.l2jserver.model.template.capability.Usable;
|
||||
import com.l2jserver.model.world.Item;
|
||||
|
||||
/**
|
||||
@@ -18,16 +24,114 @@ public abstract class ItemTemplate extends AbstractTemplate<Item> {
|
||||
private static final Logger log = LoggerFactory
|
||||
.getLogger(ItemTemplate.class);
|
||||
|
||||
protected int weight = 0;
|
||||
protected int price = 0;
|
||||
protected String icon;
|
||||
protected boolean immediateEffect = true;
|
||||
|
||||
protected ItemMaterial material;
|
||||
|
||||
public enum ItemMaterial {
|
||||
COTTON, WOOD, PAPER, FISH, ORIHARUKON, HORN, ADAMANTAITE, CHRYSOLITE, MITHRIL, COBWEB, RUNE_XP, CLOTH, SCALE_OF_DRAGON, BONE, GOLD, LEATHER, FINE_STEEL, SILVER, DYESTUFF, CRYSTAL, RUNE_REMOVE_PENALTY, STEEL, BRONZE, RUNE_SP, LIQUID, BLOOD_STEEL, DAMASCUS;
|
||||
}
|
||||
|
||||
public ItemTemplate(ItemTemplateID id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
public ItemTemplate(final ItemTemplateID id, String icon,
|
||||
ItemMaterial material) {
|
||||
super(id);
|
||||
this.icon = icon;
|
||||
this.material = material;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item create() {
|
||||
log.debug("Creating a new Item instance with template {}", this);
|
||||
return new Item(this.getID());
|
||||
}
|
||||
|
||||
public void stack(Item... object) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if item is enchantable
|
||||
*/
|
||||
public boolean isEnchantable() {
|
||||
return (this instanceof Enchantable);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the sellable
|
||||
*/
|
||||
public boolean isSellable() {
|
||||
return (this instanceof Sellable);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the dropable
|
||||
*/
|
||||
public boolean isDropable() {
|
||||
return (this instanceof Dropable);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the tradable
|
||||
*/
|
||||
public boolean isTradable() {
|
||||
return (this instanceof Tradable);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the usable
|
||||
*/
|
||||
public boolean isUsable() {
|
||||
return (this instanceof Usable);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the usable
|
||||
*/
|
||||
public boolean isDepositable() {
|
||||
return (this instanceof Depositable);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the weight
|
||||
*/
|
||||
public int getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the price
|
||||
*/
|
||||
public int getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the icon
|
||||
*/
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the immediateEffect
|
||||
*/
|
||||
public boolean isImmediateEffect() {
|
||||
return immediateEffect;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the material
|
||||
*/
|
||||
public ItemMaterial getMaterial() {
|
||||
return material;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemTemplateID getID() {
|
||||
return (ItemTemplateID) super.getID();
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.l2jserver.model.template;
|
||||
|
||||
import com.l2jserver.model.id.template.ItemTemplateID;
|
||||
import com.l2jserver.model.template.capability.Attackable;
|
||||
import com.l2jserver.model.world.Item;
|
||||
|
||||
/**
|
||||
* Template for Weapon {@link Item}
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public abstract class WeaponTemplate extends ItemTemplate implements Attackable {
|
||||
public WeaponTemplate(ItemTemplateID id) {
|
||||
super(id);
|
||||
}
|
||||
}
|
||||
@@ -14,8 +14,4 @@ import com.l2jserver.model.world.capability.Attacker;
|
||||
public interface Attackable extends TemplateCapability {
|
||||
void attack(Attacker source,
|
||||
com.l2jserver.model.world.capability.Attackable target);
|
||||
|
||||
int getPhysicalDamage();
|
||||
|
||||
int getMagicalDamage();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.l2jserver.model.template.capability;
|
||||
|
||||
import com.l2jserver.model.template.Template;
|
||||
import com.l2jserver.model.world.capability.Attacker;
|
||||
|
||||
/**
|
||||
* Defines an {@link Template template} {@link TemplateCapability capability}
|
||||
* that can be selled.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Depositable extends TemplateCapability {
|
||||
void sell(Attacker source,
|
||||
com.l2jserver.model.world.capability.Attackable target);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.l2jserver.model.template.capability;
|
||||
|
||||
import com.l2jserver.model.template.Template;
|
||||
import com.l2jserver.model.world.capability.Attacker;
|
||||
|
||||
/**
|
||||
* Defines an {@link Template template} {@link TemplateCapability capability}
|
||||
* that can be selled.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Dropable extends TemplateCapability {
|
||||
void sell(Attacker source,
|
||||
com.l2jserver.model.world.capability.Attackable target);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.l2jserver.model.template.capability;
|
||||
|
||||
import com.l2jserver.model.template.Template;
|
||||
import com.l2jserver.model.world.capability.Attacker;
|
||||
|
||||
/**
|
||||
* Defines an {@link Template template} {@link TemplateCapability capability}
|
||||
* that can be selled.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Sellable extends TemplateCapability {
|
||||
void sell(Attacker source,
|
||||
com.l2jserver.model.world.capability.Attackable target);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.l2jserver.model.template.capability;
|
||||
|
||||
import com.l2jserver.model.template.Template;
|
||||
import com.l2jserver.model.world.capability.Attacker;
|
||||
|
||||
/**
|
||||
* Defines an {@link Template template} {@link TemplateCapability capability}
|
||||
* that can be selled.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Tradable extends TemplateCapability {
|
||||
void sell(Attacker source,
|
||||
com.l2jserver.model.world.capability.Attackable target);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.l2jserver.model.template.capability;
|
||||
|
||||
import com.l2jserver.model.template.Template;
|
||||
|
||||
/**
|
||||
* Defines an {@link Template template} {@link TemplateCapability capability}
|
||||
* that can be used.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Usable extends TemplateCapability {
|
||||
void canUse();
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.l2jserver.model.template;
|
||||
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;
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.l2jserver.model.template;
|
||||
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;
|
||||
|
||||
@@ -11,7 +12,8 @@ import com.l2jserver.model.world.Item;
|
||||
*/
|
||||
public abstract class ConsumableTemplate extends ItemTemplate implements
|
||||
Consumable {
|
||||
public ConsumableTemplate(ItemTemplateID id) {
|
||||
super(id);
|
||||
public ConsumableTemplate(ItemTemplateID id, String icon,
|
||||
ItemMaterial material) {
|
||||
super(id, icon, material);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.l2jserver.model.template;
|
||||
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;
|
||||
|
||||
/**
|
||||
@@ -8,8 +9,9 @@ import com.l2jserver.model.world.Item;
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public abstract class PotionTemplate extends ConsumableTemplate {
|
||||
public PotionTemplate(ItemTemplateID id) {
|
||||
super(id);
|
||||
public abstract class PotionTemplate extends ConsumableTemplate implements
|
||||
Stackable<Item> {
|
||||
public PotionTemplate(ItemTemplateID id, String icon) {
|
||||
super(id, icon, ItemMaterial.LIQUID);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user