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

Removed object capabilities

Signed-off-by: Rogiel <rogiel@rogiel.com>
This commit is contained in:
2011-05-22 14:55:54 -03:00
parent 3554664367
commit 49a8513ec5
109 changed files with 158 additions and 1569 deletions

View File

@@ -20,9 +20,9 @@ import script.AIInterest;
import com.l2jserver.game.net.Lineage2Connection; import com.l2jserver.game.net.Lineage2Connection;
import com.l2jserver.game.net.packet.server.ActorMovementPacket; import com.l2jserver.game.net.packet.server.ActorMovementPacket;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.capability.Attackable; import com.l2jserver.model.world.PositionableObject;
import com.l2jserver.model.world.capability.Positionable;
import com.l2jserver.model.world.character.event.CharacterMoveEvent; import com.l2jserver.model.world.character.event.CharacterMoveEvent;
import com.l2jserver.service.game.ai.AIScript; import com.l2jserver.service.game.ai.AIScript;
import com.l2jserver.service.game.ai.script.AttackAIScript; import com.l2jserver.service.game.ai.script.AttackAIScript;
@@ -119,10 +119,10 @@ public class CharacterAI implements AIScript, WalkingAIScript, AttackAIScript {
} }
@Override @Override
public void follow(Positionable positionable) { public void follow(PositionableObject positionable) {
} }
@Override @Override
public void attack(Attackable target) { public void attack(Actor target) {
} }
} }

View File

@@ -18,12 +18,9 @@ package script.template.item;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider; import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider;
import com.l2jserver.model.template.capability.Stackable;
import com.l2jserver.model.template.item.EtcItemTemplate; import com.l2jserver.model.template.item.EtcItemTemplate;
import com.l2jserver.model.world.Item;
public class AdenaItemTemplate extends EtcItemTemplate implements public class AdenaItemTemplate extends EtcItemTemplate {
Stackable<Item> {
public static final int ID = 57; public static final int ID = 57;
@Inject @Inject

View File

@@ -19,12 +19,9 @@ package script.template.item;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider; import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider;
import com.l2jserver.model.id.template.provider.SkillTemplateIDProvider; import com.l2jserver.model.id.template.provider.SkillTemplateIDProvider;
import com.l2jserver.model.template.capability.Stackable;
import com.l2jserver.model.template.item.SkillEtcItemTemplate; import com.l2jserver.model.template.item.SkillEtcItemTemplate;
import com.l2jserver.model.world.Item;
public class LargaFireworkItemTemplate extends SkillEtcItemTemplate implements public class LargaFireworkItemTemplate extends SkillEtcItemTemplate {
Stackable<Item> {
public static final int ID = 6407; public static final int ID = 6407;
@Inject @Inject

View File

@@ -18,29 +18,11 @@ package script.template.item.armor;
import com.l2jserver.model.id.template.ItemTemplateID; import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.capability.Enchantable; import com.l2jserver.model.template.capability.Enchantable;
import com.l2jserver.model.template.capability.Penalty;
import com.l2jserver.model.template.item.ArmorTemplate; import com.l2jserver.model.template.item.ArmorTemplate;
import com.l2jserver.model.world.capability.Equiper;
public abstract class AbstractGradeAArmorTemplate extends ArmorTemplate public abstract class AbstractGradeAArmorTemplate extends ArmorTemplate
implements Enchantable, Penalty { implements Enchantable {
public AbstractGradeAArmorTemplate(ItemTemplateID id) { public AbstractGradeAArmorTemplate(ItemTemplateID id) {
super(id); super(id);
} }
@Override
public void enchant(com.l2jserver.model.world.capability.Enchantable target) {
target.setEnchantLevel(target.getEnchantLevel() + 1);
}
@Override
public void penalty(Equiper user) {
// if (!(user instanceof Levelable) && !(user instanceof Castable))
// return;
// final Levelable levelable = (Levelable) user;
// final Castable castable = (Castable) user;
// if (levelable.getLevel() < 20) {
//
// }
}
} }

View File

@@ -18,9 +18,6 @@ package script.template.item.armor;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider; import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider;
import com.l2jserver.model.world.capability.Attackable;
import com.l2jserver.model.world.capability.Attacker;
import com.l2jserver.model.world.capability.Enchantable;
public class Dummy2ArmorTemplate extends AbstractGradeAArmorTemplate { public class Dummy2ArmorTemplate extends AbstractGradeAArmorTemplate {
public static final int ID = 10; public static final int ID = 10;
@@ -33,25 +30,4 @@ public class Dummy2ArmorTemplate extends AbstractGradeAArmorTemplate {
public Dummy2ArmorTemplate(ItemTemplateIDProvider factory) { public Dummy2ArmorTemplate(ItemTemplateIDProvider factory) {
super(factory.createID(ID)); super(factory.createID(ID));
} }
@Override
public void defend(Attacker source, Attackable target) {
}
@Override
public void enchant(Enchantable target) {
if (target.getEnchantLevel() >= MAX_ENCHANT)
return;
super.enchant(target);
}
@Override
public int getPhysicalDefense() {
return REDUCED_DAMAGE_PHYSICAL;
}
@Override
public int getMagicalDefense() {
return REDUCED_DAMAGE_MAGICAL;
}
} }

View File

@@ -18,8 +18,6 @@ package script.template.item.armor;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider; import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider;
import com.l2jserver.model.world.capability.Attackable;
import com.l2jserver.model.world.capability.Attacker;
public class DummyArmorTemplate extends AbstractNoGradeArmorTemplate { public class DummyArmorTemplate extends AbstractNoGradeArmorTemplate {
public static final int ID = 20; public static final int ID = 20;
@@ -31,18 +29,4 @@ public class DummyArmorTemplate extends AbstractNoGradeArmorTemplate {
public DummyArmorTemplate(ItemTemplateIDProvider factory) { public DummyArmorTemplate(ItemTemplateIDProvider factory) {
super(factory.createID(ID)); super(factory.createID(ID));
} }
@Override
public void defend(Attacker source, Attackable target) {
}
@Override
public int getPhysicalDefense() {
return REDUCED_DAMAGE_PHYSICAL;
}
@Override
public int getMagicalDefense() {
return REDUCED_DAMAGE_MAGICAL;
}
} }

View File

@@ -19,8 +19,6 @@ package script.template.item.potion;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider; import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider;
import com.l2jserver.model.template.item.PotionTemplate; import com.l2jserver.model.template.item.PotionTemplate;
import com.l2jserver.model.world.capability.Attackable;
import com.l2jserver.model.world.capability.Attacker;
public class RedPotionTemplate extends PotionTemplate { public class RedPotionTemplate extends PotionTemplate {
public static final int ID = 15; public static final int ID = 15;
@@ -32,9 +30,4 @@ public class RedPotionTemplate extends PotionTemplate {
this.price = 40; this.price = 40;
} }
@Override
public void consume(Attacker source, Attackable target) {
// TODO Auto-generated method stub
}
} }

View File

@@ -23,8 +23,6 @@ import static com.l2jserver.model.template.item.WeaponTemplate.WeaponAttributeTy
import com.google.inject.Inject; import com.google.inject.Inject;
import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider; import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider;
import com.l2jserver.model.world.capability.Attackable;
import com.l2jserver.model.world.capability.Attacker;
import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll; import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll;
public class LongSwordTemplate extends AbstractNoGradeWeaponTemplate { public class LongSwordTemplate extends AbstractNoGradeWeaponTemplate {
@@ -49,10 +47,4 @@ public class LongSwordTemplate extends AbstractNoGradeWeaponTemplate {
this.soulshots = 2; this.soulshots = 2;
this.spiritshots = 2; this.spiritshots = 2;
} }
@Override
public void attack(Attacker source, Attackable target) {
source.attack(target, this);
target.receiveAttack(source, this);
}
} }

View File

@@ -23,8 +23,6 @@ import static com.l2jserver.model.template.item.WeaponTemplate.WeaponAttributeTy
import com.google.inject.Inject; import com.google.inject.Inject;
import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider; import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider;
import com.l2jserver.model.world.capability.Attackable;
import com.l2jserver.model.world.capability.Attacker;
import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll; import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll;
public class ShortSwordTemplate extends AbstractNoGradeWeaponTemplate { public class ShortSwordTemplate extends AbstractNoGradeWeaponTemplate {
@@ -52,10 +50,4 @@ public class ShortSwordTemplate extends AbstractNoGradeWeaponTemplate {
this.soulshots = 1; this.soulshots = 1;
this.spiritshots = 1; this.spiritshots = 1;
} }
@Override
public void attack(Attacker source, Attackable target) {
source.attack(target, this);
target.receiveAttack(source, this);
}
} }

View File

@@ -19,8 +19,6 @@ package script.template.skill;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.l2jserver.model.id.template.provider.SkillTemplateIDProvider; import com.l2jserver.model.id.template.provider.SkillTemplateIDProvider;
import com.l2jserver.model.template.SkillTemplate; import com.l2jserver.model.template.SkillTemplate;
import com.l2jserver.model.world.capability.Castable;
import com.l2jserver.model.world.capability.Caster;
import com.l2jserver.model.world.character.CharacterClass; import com.l2jserver.model.world.character.CharacterClass;
public class TestSkillTemplate extends SkillTemplate { public class TestSkillTemplate extends SkillTemplate {
@@ -36,9 +34,4 @@ public class TestSkillTemplate extends SkillTemplate {
public CharacterClass[] getClasses() { public CharacterClass[] getClasses() {
return new CharacterClass[] { CharacterClass.HUMAN_FIGHTER }; return new CharacterClass[] { CharacterClass.HUMAN_FIGHTER };
} }
@Override
public void cast(Caster caster, Castable... targets) {
// TODO do casting
}
} }

View File

@@ -33,8 +33,8 @@ import com.l2jserver.model.id.provider.AccountIDProvider;
import com.l2jserver.model.id.template.CharacterTemplateID; import com.l2jserver.model.id.template.CharacterTemplateID;
import com.l2jserver.model.id.template.provider.CharacterTemplateIDProvider; import com.l2jserver.model.id.template.provider.CharacterTemplateIDProvider;
import com.l2jserver.model.template.CharacterTemplate; import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.AbstractActor.Race; import com.l2jserver.model.world.Actor.Race;
import com.l2jserver.model.world.AbstractActor.Sex; import com.l2jserver.model.world.Actor.Sex;
import com.l2jserver.model.world.Clan; import com.l2jserver.model.world.Clan;
import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.character.CharacterAppearance; import com.l2jserver.model.world.character.CharacterAppearance;

View File

@@ -27,8 +27,8 @@ import com.l2jserver.game.net.packet.server.ActionFailedPacket;
import com.l2jserver.model.id.ObjectID; import com.l2jserver.model.id.ObjectID;
import com.l2jserver.model.id.object.ActorID; import com.l2jserver.model.id.object.ActorID;
import com.l2jserver.model.id.object.provider.ObjectIDResolver; import com.l2jserver.model.id.object.provider.ObjectIDResolver;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.capability.Actor;
import com.l2jserver.service.game.character.ActorIsNotAttackableServiceException; import com.l2jserver.service.game.character.ActorIsNotAttackableServiceException;
import com.l2jserver.service.game.character.CannotSetTargetServiceException; import com.l2jserver.service.game.character.CannotSetTargetServiceException;
import com.l2jserver.service.game.character.CharacterService; import com.l2jserver.service.game.character.CharacterService;

View File

@@ -31,8 +31,8 @@ import com.l2jserver.model.id.object.provider.CharacterIDProvider;
import com.l2jserver.model.id.template.CharacterTemplateID; import com.l2jserver.model.id.template.CharacterTemplateID;
import com.l2jserver.model.id.template.provider.CharacterTemplateIDProvider; import com.l2jserver.model.id.template.provider.CharacterTemplateIDProvider;
import com.l2jserver.model.template.CharacterTemplate; import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.AbstractActor.Race; import com.l2jserver.model.world.Actor.Race;
import com.l2jserver.model.world.AbstractActor.Sex; import com.l2jserver.model.world.Actor.Sex;
import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.character.CharacterAppearance.CharacterFace; import com.l2jserver.model.world.character.CharacterAppearance.CharacterFace;
import com.l2jserver.model.world.character.CharacterAppearance.CharacterHairColor; import com.l2jserver.model.world.character.CharacterAppearance.CharacterHairColor;

View File

@@ -21,8 +21,8 @@ import org.jboss.netty.buffer.ChannelBuffer;
import com.l2jserver.game.net.Lineage2Connection; import com.l2jserver.game.net.Lineage2Connection;
import com.l2jserver.game.net.packet.AbstractServerPacket; import com.l2jserver.game.net.packet.AbstractServerPacket;
import com.l2jserver.game.net.packet.server.CharacterCreateFailPacket.Reason; import com.l2jserver.game.net.packet.server.CharacterCreateFailPacket.Reason;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.capability.Actor;
import com.l2jserver.service.game.chat.ChatMessageDestination; import com.l2jserver.service.game.chat.ChatMessageDestination;
import com.l2jserver.util.BufferUtils; import com.l2jserver.util.BufferUtils;

View File

@@ -21,7 +21,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
import com.l2jserver.game.net.Lineage2Connection; import com.l2jserver.game.net.Lineage2Connection;
import com.l2jserver.game.net.packet.AbstractServerPacket; import com.l2jserver.game.net.packet.AbstractServerPacket;
import com.l2jserver.game.net.packet.server.CharacterCreateFailPacket.Reason; import com.l2jserver.game.net.packet.server.CharacterCreateFailPacket.Reason;
import com.l2jserver.model.world.capability.Actor; import com.l2jserver.model.world.Actor;
import com.l2jserver.util.dimensional.Coordinate; import com.l2jserver.util.dimensional.Coordinate;
/** /**

View File

@@ -21,7 +21,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
import com.l2jserver.game.net.Lineage2Connection; import com.l2jserver.game.net.Lineage2Connection;
import com.l2jserver.game.net.packet.AbstractServerPacket; import com.l2jserver.game.net.packet.AbstractServerPacket;
import com.l2jserver.game.net.packet.server.CharacterCreateFailPacket.Reason; import com.l2jserver.game.net.packet.server.CharacterCreateFailPacket.Reason;
import com.l2jserver.model.world.capability.Actor; import com.l2jserver.model.world.Actor;
/** /**
* This packet notifies the client that the chosen character has been * This packet notifies the client that the chosen character has been

View File

@@ -27,8 +27,8 @@ import com.l2jserver.model.game.Fort;
import com.l2jserver.model.game.Skill; import com.l2jserver.model.game.Skill;
import com.l2jserver.model.template.ItemTemplate; import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.template.SkillTemplate; import com.l2jserver.model.template.SkillTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.Item; import com.l2jserver.model.world.Item;
import com.l2jserver.model.world.capability.Actor;
import com.l2jserver.util.BufferUtils; import com.l2jserver.util.BufferUtils;
import com.l2jserver.util.factory.CollectionFactory; import com.l2jserver.util.factory.CollectionFactory;

View File

@@ -16,11 +16,13 @@
*/ */
package com.l2jserver.model; package com.l2jserver.model;
import com.google.common.base.Preconditions;
import com.l2jserver.model.id.ID; import com.l2jserver.model.id.ID;
/** /**
* @author <a href="http://www.rogiel.com">Rogiel</a> * Simple model interface implementing {@link ID} related methods
* *
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/ */
public class AbstractModel<T extends ID<?>> implements Model<T> { public class AbstractModel<T extends ID<?>> implements Model<T> {
/** /**
@@ -35,8 +37,7 @@ public class AbstractModel<T extends ID<?>> implements Model<T> {
@Override @Override
public void setID(T ID) { public void setID(T ID) {
if (this.id != null) Preconditions.checkState(id == null, "ID is already set");
throw new IllegalStateException("ID is already set");
this.id = ID; this.id = ID;
} }

View File

@@ -19,7 +19,7 @@ package com.l2jserver.model.game;
import com.l2jserver.model.id.object.ActorID; import com.l2jserver.model.id.object.ActorID;
import com.l2jserver.model.id.template.SkillTemplateID; import com.l2jserver.model.id.template.SkillTemplateID;
import com.l2jserver.model.template.SkillTemplate; import com.l2jserver.model.template.SkillTemplate;
import com.l2jserver.model.world.capability.Actor; import com.l2jserver.model.world.Actor;
/** /**
* Register the state of a skill known by an {@link Actor}. * Register the state of a skill known by an {@link Actor}.

View File

@@ -19,7 +19,7 @@ package com.l2jserver.model.id.object;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted; import com.google.inject.assistedinject.Assisted;
import com.l2jserver.model.id.ObjectID; import com.l2jserver.model.id.ObjectID;
import com.l2jserver.model.world.capability.Actor; import com.l2jserver.model.world.Actor;
/** /**
* An {@link ObjectID} instance representing an {@link Actor} object * An {@link ObjectID} instance representing an {@link Actor} object

View File

@@ -20,9 +20,9 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import com.l2jserver.model.id.template.ActorTemplateID; import com.l2jserver.model.id.template.ActorTemplateID;
import com.l2jserver.model.world.AbstractActor.Race; import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.Actor.Race;
import com.l2jserver.model.world.actor.ActorAttributes; import com.l2jserver.model.world.actor.ActorAttributes;
import com.l2jserver.model.world.capability.Actor;
/** /**
* Template for {@link Actor} * Template for {@link Actor}

View File

@@ -23,12 +23,10 @@ import com.google.inject.Inject;
import com.l2jserver.game.net.Lineage2Connection; import com.l2jserver.game.net.Lineage2Connection;
import com.l2jserver.model.id.object.CharacterID; import com.l2jserver.model.id.object.CharacterID;
import com.l2jserver.model.id.template.ItemTemplateID; 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.Dropable;
import com.l2jserver.model.template.capability.Enchantable; import com.l2jserver.model.template.capability.Enchantable;
import com.l2jserver.model.template.capability.Sellable; import com.l2jserver.model.template.capability.Sellable;
import com.l2jserver.model.template.capability.Tradable; import com.l2jserver.model.template.capability.Tradable;
import com.l2jserver.model.template.capability.Usable;
import com.l2jserver.model.world.Item; import com.l2jserver.model.world.Item;
import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.L2Character;
import com.l2jserver.service.network.NetworkService; import com.l2jserver.service.network.NetworkService;
@@ -117,20 +115,6 @@ public abstract class ItemTemplate extends AbstractTemplate<Item> {
return (this instanceof Tradable); 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 * @return the weight
*/ */

View File

@@ -23,10 +23,11 @@ import com.l2jserver.game.net.packet.server.NPCHtmlMessagePacket;
import com.l2jserver.model.id.template.ItemTemplateID; import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.id.template.NPCTemplateID; import com.l2jserver.model.id.template.NPCTemplateID;
import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider; import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider;
import com.l2jserver.model.world.AbstractActor.Race; import com.l2jserver.model.template.capability.Interactable;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.Actor.Race;
import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.NPC; import com.l2jserver.model.world.NPC;
import com.l2jserver.model.world.capability.Actor;
import com.l2jserver.service.game.character.CannotSetTargetServiceException; import com.l2jserver.service.game.character.CannotSetTargetServiceException;
import com.l2jserver.service.game.character.CharacterService; import com.l2jserver.service.game.character.CharacterService;
import com.l2jserver.service.network.NetworkService; import com.l2jserver.service.network.NetworkService;
@@ -39,7 +40,8 @@ import com.l2jserver.util.html.markup.HtmlTemplate;
* *
* @author <a href="http://www.rogiel.com">Rogiel</a> * @author <a href="http://www.rogiel.com">Rogiel</a>
*/ */
public abstract class NPCTemplate extends ActorTemplate<NPC> { public abstract class NPCTemplate extends ActorTemplate<NPC> implements
Interactable<NPC> {
/** /**
* The {@link NetworkService} * The {@link NetworkService}
*/ */
@@ -93,17 +95,7 @@ public abstract class NPCTemplate extends ActorTemplate<NPC> {
super(id, null); super(id, null);
} }
/** @Override
* Performs an interaction with this NPC. This is normally invoked from
* <tt>npc</tt> instance.
*
* @param character
* the interacting character
* @param args
* the action arguments
* @throws L2Exception
* any {@link L2Exception}
*/
public void action(NPC npc, L2Character character, String... args) public void action(NPC npc, L2Character character, String... args)
throws L2Exception { throws L2Exception {
Preconditions.checkNotNull(npc, "npc"); Preconditions.checkNotNull(npc, "npc");
@@ -140,7 +132,7 @@ public abstract class NPCTemplate extends ActorTemplate<NPC> {
* the action arguments * the action arguments
* @throws L2Exception * @throws L2Exception
*/ */
public void talk(NPC npc, L2Character character, Lineage2Connection conn, protected void talk(NPC npc, L2Character character, Lineage2Connection conn,
String... args) throws L2Exception { String... args) throws L2Exception {
if (args.length == 0 || (args.length >= 1 && args[0].equals("Chat"))) { if (args.length == 0 || (args.length >= 1 && args[0].equals("Chat"))) {
String name = ""; String name = "";

View File

@@ -18,7 +18,6 @@ package com.l2jserver.model.template;
import com.l2jserver.model.game.Skill; import com.l2jserver.model.game.Skill;
import com.l2jserver.model.id.template.SkillTemplateID; import com.l2jserver.model.id.template.SkillTemplateID;
import com.l2jserver.model.template.capability.Castable;
import com.l2jserver.model.world.character.CharacterClass; import com.l2jserver.model.world.character.CharacterClass;
/** /**
@@ -26,8 +25,7 @@ import com.l2jserver.model.world.character.CharacterClass;
* *
* @author <a href="http://www.rogiel.com">Rogiel</a> * @author <a href="http://www.rogiel.com">Rogiel</a>
*/ */
public abstract class SkillTemplate extends AbstractTemplate<Skill> implements public abstract class SkillTemplate extends AbstractTemplate<Skill> {
Castable {
/** /**
* The maximum level supported by this skill * The maximum level supported by this skill
*/ */

View File

@@ -1,33 +0,0 @@
/*
* 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.capability;
import com.l2jserver.model.template.Template;
import com.l2jserver.model.world.capability.Caster;
/**
* Defines an {@link Template template} {@link TemplateCapability capability}
* that an {@link Caster} can cast on an
* {@link com.l2jserver.model.world.capability.Castable}.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*
*/
public interface Castable extends TemplateCapability {
void cast(Caster caster,
com.l2jserver.model.world.capability.Castable... targets);
}

View File

@@ -1,31 +0,0 @@
/*
* 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.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 consumed.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Consumable extends TemplateCapability {
void consume(Attacker source,
com.l2jserver.model.world.capability.Attackable target);
}

View File

@@ -1,36 +0,0 @@
/*
* 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.capability;
import com.l2jserver.model.template.Template;
import com.l2jserver.model.world.capability.Attacker;
/**
* Defines an {@link Template template} {@link TemplateCapability capability}
* that an {@link com.l2jserver.model.world.capability.Attackable} can use to
* defend from an {@link Attacker}.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Defendable extends TemplateCapability {
void defend(Attacker source,
com.l2jserver.model.world.capability.Attackable target);
int getPhysicalDefense();
int getMagicalDefense();
}

View File

@@ -1,31 +0,0 @@
/*
* 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.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);
}

View File

@@ -17,7 +17,6 @@
package com.l2jserver.model.template.capability; package com.l2jserver.model.template.capability;
import com.l2jserver.model.template.Template; import com.l2jserver.model.template.Template;
import com.l2jserver.model.world.capability.Attacker;
/** /**
* Defines an {@link Template template} {@link TemplateCapability capability} * Defines an {@link Template template} {@link TemplateCapability capability}
@@ -26,6 +25,5 @@ import com.l2jserver.model.world.capability.Attacker;
* @author <a href="http://www.rogiel.com">Rogiel</a> * @author <a href="http://www.rogiel.com">Rogiel</a>
*/ */
public interface Dropable extends TemplateCapability { public interface Dropable extends TemplateCapability {
void sell(Attacker source,
com.l2jserver.model.world.capability.Attackable target);
} }

View File

@@ -25,5 +25,5 @@ import com.l2jserver.model.template.Template;
* @author <a href="http://www.rogiel.com">Rogiel</a> * @author <a href="http://www.rogiel.com">Rogiel</a>
*/ */
public interface Enchantable extends TemplateCapability { public interface Enchantable extends TemplateCapability {
void enchant(com.l2jserver.model.world.capability.Enchantable target);
} }

View File

@@ -1,31 +0,0 @@
/*
* 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.capability;
import com.l2jserver.model.template.Template;
import com.l2jserver.model.world.capability.Equiper;
/**
* Defines an {@link Template template} {@link TemplateCapability capability}
* for an object that acn be equipable by an {@link Equiper}.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*
*/
public interface Equipable extends TemplateCapability {
void equip(Equiper equiper);
}

View File

@@ -17,17 +17,27 @@
package com.l2jserver.model.template.capability; package com.l2jserver.model.template.capability;
import com.l2jserver.model.template.Template; import com.l2jserver.model.template.Template;
import com.l2jserver.model.world.capability.Attacker; import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.WorldObject;
import com.l2jserver.util.exception.L2Exception;
/** /**
* Defines an {@link Template template} {@link TemplateCapability capability} * Defines an {@link Template} which the player can interact with
* that an {@link Attacker} can use to attack an
* {@link com.l2jserver.model.world.capability.Attackable}
* *
* @author <a href="http://www.rogiel.com">Rogiel</a> * @author <a href="http://www.rogiel.com">Rogiel</a>
* *
*/ */
public interface Attackable extends TemplateCapability { public interface Interactable<T extends WorldObject> extends TemplateCapability {
void attack(Attacker source, /**
com.l2jserver.model.world.capability.Attackable target); * Performs an interaction with this template.
*
* @param character
* the interacting character
* @param args
* the action arguments
* @throws L2Exception
* any {@link L2Exception}
*/
void action(T object, L2Character character, String... args)
throws L2Exception;
} }

View File

@@ -1,30 +0,0 @@
/*
* 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.capability;
import com.l2jserver.model.template.AbstractTemplate;
import com.l2jserver.model.world.capability.Equiper;
/**
* Indicated than an {@link AbstractTemplate} can add penalties to an given
* {@link Equiper}.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Penalty extends TemplateCapability {
void penalty(Equiper user);
}

View File

@@ -17,7 +17,6 @@
package com.l2jserver.model.template.capability; package com.l2jserver.model.template.capability;
import com.l2jserver.model.template.Template; import com.l2jserver.model.template.Template;
import com.l2jserver.model.world.capability.Attacker;
/** /**
* Defines an {@link Template template} {@link TemplateCapability capability} * Defines an {@link Template template} {@link TemplateCapability capability}
@@ -26,6 +25,5 @@ import com.l2jserver.model.world.capability.Attacker;
* @author <a href="http://www.rogiel.com">Rogiel</a> * @author <a href="http://www.rogiel.com">Rogiel</a>
*/ */
public interface Sellable extends TemplateCapability { public interface Sellable extends TemplateCapability {
void sell(Attacker source,
com.l2jserver.model.world.capability.Attackable target);
} }

View File

@@ -1,29 +0,0 @@
/*
* 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.capability;
import com.l2jserver.model.world.WorldObject;
/**
* Defines an template that can be stacked (i.e. more then one item per slot in
* the inventory)
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Stackable<T extends WorldObject> extends TemplateCapability {
void stack(T... object);
}

View File

@@ -17,7 +17,6 @@
package com.l2jserver.model.template.capability; package com.l2jserver.model.template.capability;
import com.l2jserver.model.template.Template; import com.l2jserver.model.template.Template;
import com.l2jserver.model.world.capability.Attacker;
/** /**
* Defines an {@link Template template} {@link TemplateCapability capability} * Defines an {@link Template template} {@link TemplateCapability capability}
@@ -26,6 +25,5 @@ import com.l2jserver.model.world.capability.Attacker;
* @author <a href="http://www.rogiel.com">Rogiel</a> * @author <a href="http://www.rogiel.com">Rogiel</a>
*/ */
public interface Tradable extends TemplateCapability { public interface Tradable extends TemplateCapability {
void sell(Attacker source,
com.l2jserver.model.world.capability.Attackable target);
} }

View File

@@ -1,29 +0,0 @@
/*
* 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.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();
}

View File

@@ -18,7 +18,6 @@ package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID; import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.ItemTemplate; import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.template.capability.Defendable;
import com.l2jserver.model.world.Item; import com.l2jserver.model.world.Item;
/** /**
@@ -26,7 +25,7 @@ import com.l2jserver.model.world.Item;
* *
* @author <a href="http://www.rogiel.com">Rogiel</a> * @author <a href="http://www.rogiel.com">Rogiel</a>
*/ */
public abstract class ArmorTemplate extends ItemTemplate implements Defendable { public abstract class ArmorTemplate extends ItemTemplate {
public ArmorTemplate(ItemTemplateID id) { public ArmorTemplate(ItemTemplateID id) {
super(id); super(id);
} }

View File

@@ -18,7 +18,6 @@ package com.l2jserver.model.template.item;
import com.l2jserver.model.id.template.ItemTemplateID; import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.ItemTemplate; import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.template.capability.Consumable;
import com.l2jserver.model.world.Item; import com.l2jserver.model.world.Item;
/** /**
@@ -26,8 +25,7 @@ import com.l2jserver.model.world.Item;
* *
* @author <a href="http://www.rogiel.com">Rogiel</a> * @author <a href="http://www.rogiel.com">Rogiel</a>
*/ */
public abstract class ConsumableTemplate extends ItemTemplate implements public abstract class ConsumableTemplate extends ItemTemplate {
Consumable {
public ConsumableTemplate(ItemTemplateID id, String icon, public ConsumableTemplate(ItemTemplateID id, String icon,
ItemMaterial material) { ItemMaterial material) {
super(id, icon, material); super(id, icon, material);

View File

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

View File

@@ -21,7 +21,6 @@ import java.util.Map.Entry;
import com.l2jserver.model.id.template.ItemTemplateID; import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.ItemTemplate; import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.template.capability.Attackable;
import com.l2jserver.model.world.Item; import com.l2jserver.model.world.Item;
import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll; import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll;
import com.l2jserver.util.calculator.Calculator; import com.l2jserver.util.calculator.Calculator;
@@ -38,7 +37,7 @@ import com.l2jserver.util.factory.CollectionFactory;
* *
* @author <a href="http://www.rogiel.com">Rogiel</a> * @author <a href="http://www.rogiel.com">Rogiel</a>
*/ */
public abstract class WeaponTemplate extends ItemTemplate implements Attackable { public abstract class WeaponTemplate extends ItemTemplate {
/** /**
* The paperldoll slot used by this weapon * The paperldoll slot used by this weapon
*/ */

View File

@@ -17,15 +17,8 @@
package com.l2jserver.model.world; package com.l2jserver.model.world;
import com.l2jserver.model.id.object.ActorID; import com.l2jserver.model.id.object.ActorID;
import com.l2jserver.model.template.SkillTemplate;
import com.l2jserver.model.template.capability.Attackable;
import com.l2jserver.model.world.actor.ActorEffects; import com.l2jserver.model.world.actor.ActorEffects;
import com.l2jserver.model.world.actor.ActorSkillContainer; import com.l2jserver.model.world.actor.ActorSkillContainer;
import com.l2jserver.model.world.capability.Actor;
import com.l2jserver.model.world.capability.Attacker;
import com.l2jserver.model.world.capability.Castable;
import com.l2jserver.model.world.capability.Equipable;
import com.l2jserver.model.world.capability.Equiper;
import com.l2jserver.util.dimensional.Coordinate; import com.l2jserver.util.dimensional.Coordinate;
import com.l2jserver.util.dimensional.Point; import com.l2jserver.util.dimensional.Point;
@@ -34,7 +27,7 @@ import com.l2jserver.util.dimensional.Point;
* *
* @author <a href="http://www.rogiel.com">Rogiel</a> * @author <a href="http://www.rogiel.com">Rogiel</a>
*/ */
public abstract class AbstractActor extends AbstractObject implements Actor { public abstract class Actor extends PositionableObject {
/** /**
* The actor race * The actor race
*/ */
@@ -124,78 +117,14 @@ public abstract class AbstractActor extends AbstractObject implements Actor {
*/ */
protected final ActorSkillContainer skills = new ActorSkillContainer(this); protected final ActorSkillContainer skills = new ActorSkillContainer(this);
@Override
public void receiveDamage(int damage) {
// TODO Auto-generated method stub
}
@Override
public int getHP() { public int getHP() {
return hp; return hp;
} }
@Override
public void setHP(int hp) { public void setHP(int hp) {
this.hp = hp; this.hp = hp;
} }
@Override
public void receiveAttack(Attacker attacker, Attackable weapon) {
// TODO
}
@Override
public void attack(com.l2jserver.model.world.capability.Attackable target,
Attackable weapon) {
// TODO
}
@Override
public void cast() {
// TODO
}
@Override
public void cast(SkillTemplate skill, Castable cast) {
// TODO
}
@Override
public void spawn(Coordinate coordinate) {
// TODO
}
@Override
public boolean isSpawned() {
return false;
}
/**
* @return the coordinate point
*/
public Point getPoint() {
return point;
}
/**
* @param point
* the coordinate point to set
*/
public void setPoint(Point point) {
this.point = point;
}
@Override
public Coordinate getPosition() {
return point.getCoordinate();
}
@Override
public void setPosition(Coordinate coord) {
this.point = new Point(coord, (point != null ? point.getAngle() : 0));
}
/** /**
* @return the race * @return the race
*/ */
@@ -226,12 +155,10 @@ public abstract class AbstractActor extends AbstractObject implements Actor {
this.sex = sex; this.sex = sex;
} }
@Override
public int getLevel() { public int getLevel() {
return level; return level;
} }
@Override
public void setLevel(int level) { public void setLevel(int level) {
this.level = level; this.level = level;
} }
@@ -239,52 +166,14 @@ public abstract class AbstractActor extends AbstractObject implements Actor {
/** /**
* @return the active effects on this actor * @return the active effects on this actor
*/ */
@Override
public ActorEffects getEffects() { public ActorEffects getEffects() {
return effects; return effects;
} }
@Override
public ActorSkillContainer getSkills() { public ActorSkillContainer getSkills() {
return skills; return skills;
} }
@Override
public void die(WorldObject killer) {
// TODO
}
@Override
public void equip(Equipable equipable) {
// TODO
}
@Override
public boolean isEquiped(Equipable equipment) {
return false;
}
@Override
public boolean isEquiped(
com.l2jserver.model.template.capability.Equipable equipable) {
return false;
}
@Override
public void setEquipment(Object slot, Equipable equipment) {
// TODO
}
@Override
public void getEquipment(Object slot) {
// TODO
}
@Override
public void equip(Equiper equiper) {
// TODO
}
@Override @Override
public ActorID<?> getID() { public ActorID<?> getID() {
return (ActorID<?>) super.getID(); return (ActorID<?>) super.getID();

View File

@@ -21,7 +21,6 @@ import java.util.Iterator;
import com.l2jserver.model.id.object.CharacterID; import com.l2jserver.model.id.object.CharacterID;
import com.l2jserver.model.id.object.ClanID; import com.l2jserver.model.id.object.ClanID;
import com.l2jserver.model.id.object.iterator.WorldObjectIterator; import com.l2jserver.model.id.object.iterator.WorldObjectIterator;
import com.l2jserver.model.world.capability.Joinable;
import com.l2jserver.model.world.clan.ClanMembers; import com.l2jserver.model.world.clan.ClanMembers;
/** /**
@@ -29,7 +28,7 @@ import com.l2jserver.model.world.clan.ClanMembers;
* *
* @author <a href="http://www.rogiel.com">Rogiel</a> * @author <a href="http://www.rogiel.com">Rogiel</a>
*/ */
public class Clan extends AbstractObject implements Joinable<L2Character> { public class Clan extends AbstractObject implements Iterable<L2Character> {
/** /**
* Clan leader * Clan leader
*/ */
@@ -40,16 +39,6 @@ public class Clan extends AbstractObject implements Joinable<L2Character> {
*/ */
private final ClanMembers members = new ClanMembers(this); private final ClanMembers members = new ClanMembers(this);
@Override
public void join(L2Character member) {
members.add(member);
}
@Override
public void leave(L2Character member) {
members.remove(member);
}
/** /**
* @return the leaderID * @return the leaderID
*/ */

View File

@@ -19,9 +19,6 @@ package com.l2jserver.model.world;
import com.l2jserver.model.id.object.CharacterID; import com.l2jserver.model.id.object.CharacterID;
import com.l2jserver.model.id.template.ItemTemplateID; import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.ItemTemplate; import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.world.capability.Dropable;
import com.l2jserver.model.world.capability.Playable;
import com.l2jserver.model.world.capability.Spawnable;
import com.l2jserver.model.world.character.CharacterInventory.InventoryLocation; import com.l2jserver.model.world.character.CharacterInventory.InventoryLocation;
import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll; import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll;
import com.l2jserver.util.dimensional.Coordinate; import com.l2jserver.util.dimensional.Coordinate;
@@ -47,8 +44,7 @@ import com.l2jserver.util.dimensional.Point;
* *
* @author <a href="http://www.rogiel.com">Rogiel</a> * @author <a href="http://www.rogiel.com">Rogiel</a>
*/ */
public class Item extends AbstractObject implements Playable, Spawnable, public class Item extends PositionableObject {
Dropable {
/** /**
* The {@link ItemTemplate} ID * The {@link ItemTemplate} ID
*/ */
@@ -80,33 +76,6 @@ public class Item extends AbstractObject implements Playable, Spawnable,
this.templateID = templateID; this.templateID = templateID;
} }
@Override
public void drop(Coordinate position) {
this.coordinate = position;
this.location = null;
this.paperdoll = null;
}
@Override
public void spawn(Coordinate coordinate) {
this.drop(coordinate);
}
@Override
public boolean isSpawned() {
return (location != null);
}
@Override
public Coordinate getPosition() {
return coordinate;
}
@Override
public void setPosition(Coordinate coord) {
this.coordinate = coord;
}
/** /**
* @return the count * @return the count
*/ */
@@ -176,17 +145,10 @@ public class Item extends AbstractObject implements Playable, Spawnable,
this.ownerID = ownerID; this.ownerID = ownerID;
} }
/*
* (non-Javadoc)
*
* @see com.l2jserver.model.world.capability.Pointable#getPoint()
*/
@Override
public Point getPoint() { public Point getPoint() {
return null; return null;
} }
@Override
public void setPoint(Point point) { public void setPoint(Point point) {
} }

View File

@@ -25,7 +25,6 @@ import com.l2jserver.model.id.object.ClanID;
import com.l2jserver.model.id.object.PetID; import com.l2jserver.model.id.object.PetID;
import com.l2jserver.model.template.CharacterTemplate; import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.actor.ActorAttributes; import com.l2jserver.model.world.actor.ActorAttributes;
import com.l2jserver.model.world.capability.Actor;
import com.l2jserver.model.world.character.CharacterAppearance; import com.l2jserver.model.world.character.CharacterAppearance;
import com.l2jserver.model.world.character.CharacterCalculatedAttributes; import com.l2jserver.model.world.character.CharacterCalculatedAttributes;
import com.l2jserver.model.world.character.CharacterClass; import com.l2jserver.model.world.character.CharacterClass;

View File

@@ -29,7 +29,7 @@ import com.l2jserver.service.game.ai.AIScript;
* *
* @author <a href="http://www.rogiel.com">Rogiel</a> * @author <a href="http://www.rogiel.com">Rogiel</a>
*/ */
public class NPC extends AbstractActor { public class NPC extends Actor {
/** /**
* The NPC template ID * The NPC template ID
*/ */

View File

@@ -1,58 +0,0 @@
/*
* 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.world;
import java.util.Iterator;
import java.util.List;
import com.l2jserver.model.id.object.CharacterID;
import com.l2jserver.model.id.object.ClanID;
import com.l2jserver.model.id.object.iterator.WorldObjectIterator;
import com.l2jserver.model.world.capability.Joinable;
import com.l2jserver.util.factory.CollectionFactory;
/**
* This class represents an Party in Lineage II world
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public class Party extends AbstractObject implements Joinable<L2Character> {
/**
* Active party members
*/
private final List<CharacterID> members = CollectionFactory.newList();
@Override
public void join(L2Character member) {
members.add(member.getID());
}
@Override
public ClanID getID() {
return (ClanID) super.getID();
}
@Override
public void leave(L2Character member) {
}
@Override
public Iterator<L2Character> iterator() {
return new WorldObjectIterator<L2Character>(members.iterator());
}
}

View File

@@ -18,15 +18,13 @@ package com.l2jserver.model.world;
import com.l2jserver.model.id.object.CharacterID; import com.l2jserver.model.id.object.CharacterID;
import com.l2jserver.model.id.object.ItemID; import com.l2jserver.model.id.object.ItemID;
import com.l2jserver.model.world.capability.Summonable;
import com.l2jserver.util.dimensional.Coordinate;
/** /**
* This class represents an Pet in the Lineage II World * This class represents an Pet in the Lineage II World
* *
* @author <a href="http://www.rogiel.com">Rogiel</a> * @author <a href="http://www.rogiel.com">Rogiel</a>
*/ */
public class Pet extends Player implements Summonable { public class Pet extends Player {
/** /**
* The {@link CharacterID} pet's owner * The {@link CharacterID} pet's owner
*/ */
@@ -36,18 +34,6 @@ public class Pet extends Player implements Summonable {
*/ */
private ItemID itemID; private ItemID itemID;
@Override
public void summon(Coordinate coordinate) {
// TODO Auto-generated method stub
}
@Override
public boolean isSummoned() {
// TODO Auto-generated method stub
return false;
}
/** /**
* @return the owner ID * @return the owner ID
*/ */

View File

@@ -16,15 +16,12 @@
*/ */
package com.l2jserver.model.world; package com.l2jserver.model.world;
import com.l2jserver.model.world.capability.Actor;
import com.l2jserver.model.world.capability.Playable;
/** /**
* {@link Player} is any object that can be controlled by the player. The most * {@link Player} is any object that can be controlled by the player. The most
* common implementation is {@link L2Character}. * common implementation is {@link L2Character}.
* *
* @author Rogiel * @author Rogiel
*/ */
public abstract class Player extends AbstractActor implements Playable, Actor { public abstract class Player extends Actor {
} }

View File

@@ -14,22 +14,38 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>. * along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.l2jserver.model.world.capability; package com.l2jserver.model.world;
import com.l2jserver.model.world.AbstractObject;
import com.l2jserver.util.dimensional.Coordinate; import com.l2jserver.util.dimensional.Coordinate;
import com.l2jserver.util.dimensional.Point;
/** /**
* Defines an {@link AbstractObject} that can be dropped on the ground.
*
* @author <a href="http://www.rogiel.com">Rogiel</a> * @author <a href="http://www.rogiel.com">Rogiel</a>
*
*/ */
public interface Dropable extends Positionable { public abstract class PositionableObject extends AbstractObject {
private Point point;
/** /**
* When an item is dropped its position will be set as <tt>position</tt> * @return the coordinate point
*
* @param position
* the position
*/ */
void drop(Coordinate position); public Point getPoint() {
return point;
}
/**
* @param point
* the coordinate point to set
*/
public void setPoint(Point point) {
this.point = point;
}
public Coordinate getPosition() {
return point.getCoordinate();
}
public void setPosition(Coordinate coord) {
this.point = new Point(coord, (point != null ? point.getAngle() : 0));
}
} }

View File

@@ -16,7 +16,7 @@
*/ */
package com.l2jserver.model.world.actor; package com.l2jserver.model.world.actor;
import com.l2jserver.model.world.capability.Actor; import com.l2jserver.model.world.Actor;
/** /**
* Class controlling active effects on an {@link Actor}. * Class controlling active effects on an {@link Actor}.

View File

@@ -16,7 +16,7 @@
*/ */
package com.l2jserver.model.world.actor; package com.l2jserver.model.world.actor;
import com.l2jserver.model.world.capability.Actor; import com.l2jserver.model.world.Actor;
/** /**
* This enumeration maps for each level the minimum experience required. * This enumeration maps for each level the minimum experience required.

View File

@@ -23,7 +23,7 @@ import java.util.List;
import com.l2jserver.model.game.Skill; import com.l2jserver.model.game.Skill;
import com.l2jserver.model.id.template.SkillTemplateID; import com.l2jserver.model.id.template.SkillTemplateID;
import com.l2jserver.model.template.SkillTemplate; import com.l2jserver.model.template.SkillTemplate;
import com.l2jserver.model.world.capability.Actor; import com.l2jserver.model.world.Actor;
import com.l2jserver.util.factory.CollectionFactory; import com.l2jserver.util.factory.CollectionFactory;
/** /**

View File

@@ -16,7 +16,7 @@
*/ */
package com.l2jserver.model.world.actor.event; package com.l2jserver.model.world.actor.event;
import com.l2jserver.model.world.capability.Actor; import com.l2jserver.model.world.Actor;
import com.l2jserver.service.game.world.event.WorldEvent; import com.l2jserver.service.game.world.event.WorldEvent;
/** /**

View File

@@ -17,8 +17,8 @@
package com.l2jserver.model.world.actor.event; package com.l2jserver.model.world.actor.event;
import com.l2jserver.model.id.ObjectID; import com.l2jserver.model.id.ObjectID;
import com.l2jserver.model.world.capability.Actor; import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.capability.Spawnable; import com.l2jserver.model.world.WorldObject;
import com.l2jserver.model.world.event.SpawnEvent; import com.l2jserver.model.world.event.SpawnEvent;
import com.l2jserver.util.dimensional.Point; import com.l2jserver.util.dimensional.Point;
@@ -51,7 +51,7 @@ public class ActorSpawnEvent implements ActorEvent, SpawnEvent {
} }
@Override @Override
public Spawnable getObject() { public WorldObject getObject() {
return actor; return actor;
} }

View File

@@ -1,44 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.id.object.ActorID;
import com.l2jserver.model.world.AbstractObject;
import com.l2jserver.model.world.actor.ActorEffects;
import com.l2jserver.model.world.actor.ActorSkillContainer;
/**
* Defines an {@link AbstractObject} that defines an Actor (NPC, player, pet,
* etc...)
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Actor extends Spawnable, Pointable, Damagable, Attackable,
Attacker, Castable, Caster, Levelable, Killable, Equiper, Equipable {
/**
* @return the actor effects
*/
ActorEffects getEffects();
/**
* @return the actor skills
*/
ActorSkillContainer getSkills();
@Override
ActorID<?> getID();
}

View File

@@ -1,30 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
/**
* Defines an {@link AbstractObject} that can receive attacks from an
* {@link Attacker}.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Attackable extends ObjectCapability {
void receiveAttack(Attacker attacker,
com.l2jserver.model.template.capability.Attackable weapon);
}

View File

@@ -1,29 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
/**
* Defines an {@link AbstractObject} that can attack an {@link Attackable}.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Attacker extends ObjectCapability {
void attack(Attackable target,
com.l2jserver.model.template.capability.Attackable weapon);
}

View File

@@ -1,28 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
/**
* Defines an {@link AbstractObject} that can receive skill castings.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Castable extends ObjectCapability {
void cast();
}

View File

@@ -1,29 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.template.SkillTemplate;
import com.l2jserver.model.world.AbstractObject;
/**
* Defines an {@link AbstractObject} that can cast skills.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Caster extends ObjectCapability {
void cast(SkillTemplate skill, Castable cast);
}

View File

@@ -1,29 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.world.AbstractObject;
/**
* Defines an {@link AbstractObject} that can be consumed.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Consumable extends ObjectCapability {
void consume(ItemTemplate item, Castable target);
}

View File

@@ -1,28 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
/**
* Defines an {@link AbstractObject} that an player can talk to.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Conversable extends ObjectCapability {
void talk(Talker talker);
}

View File

@@ -1,32 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
/**
* Defines an {@link AbstractObject} that can be damaged (HP)
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Damagable extends ObjectCapability {
void receiveDamage(int damage);
int getHP();
void setHP(int hp);
}

View File

@@ -1,41 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
/**
* Defines an {@link AbstractObject} that can be enchanted.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Enchantable extends ObjectCapability {
/**
* Get the current enchant level in the object
*
* @return the enchant level
*/
int getEnchantLevel();
/**
* Set the new enchant level in the object
*
* @param level
* the enchant level
*/
void setEnchantLevel(int level);
}

View File

@@ -1,29 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
/**
* Defines an {@link AbstractObject} that can be equipped into an
* {@link Equiper}.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Equipable extends ObjectCapability {
void equip(Equiper equiper);
}

View File

@@ -1,38 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
/**
* Defines an {@link AbstractObject} that can be equipped with {@link Equipable}
* instances.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Equiper extends ObjectCapability {
void equip(Equipable equipable);
boolean isEquiped(Equipable equipment);
boolean isEquiped(
com.l2jserver.model.template.capability.Equipable equipable);
void setEquipment(Object slot, Equipable equipment);
void getEquipment(Object slot);
}

View File

@@ -1,30 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
/**
* Defines an {@link AbstractObject} that can become invisible to other objects.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Invisible extends ObjectCapability {
boolean isInvisible();
void setInvisible();
}

View File

@@ -1,42 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
/**
* Defines an {@link AbstractObject} that other objects can join to.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Joinable<T> extends ObjectCapability, Iterable<T> {
/**
* Join an <tt>member</tt> to this object.
*
* @param member
* the entering member
*/
void join(T member);
/**
* Removes the joined <tt>member</tt> from this object
*
* @param member
* the exiting member
*/
void leave(T member);
}

View File

@@ -1,36 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
import com.l2jserver.model.world.WorldObject;
/**
* Defines an {@link AbstractObject} that can be killed.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Killable extends ObjectCapability {
/**
* Process the dying routines. Note that if the object killed himself,
* <tt>killer</tt> must be his instance.
*
* @param killer
* the killer. Can be null if unknown.
*/
void die(WorldObject killer);
}

View File

@@ -1,40 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
/**
* Defines an {@link AbstractObject} that has levels.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Levelable extends ObjectCapability {
/**
* Get this object`s level
*
* @return the level
*/
int getLevel();
/**
* Set this object's level
*
* @param level
*/
void setLevel(int level);
}

View File

@@ -1,32 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
/**
* Defines an {@link AbstractObject} that can be damaged (HP)
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Mana extends ObjectCapability {
void consumeMana(int amount);
int getMP();
void setMP(int mana);
}

View File

@@ -1,29 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
import com.l2jserver.model.world.WorldObject;
/**
* Defines an base interface for all capabilities for {@link AbstractObject}
* instances. No implementing class need to implement this interface.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface ObjectCapability extends WorldObject {
}

View File

@@ -1,29 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
/**
* Defines an {@link AbstractObject} that can be played (i.e. controlled by the
* player)
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Playable extends ObjectCapability {
}

View File

@@ -1,32 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
import com.l2jserver.util.dimensional.Point;
/**
* Defines an {@link AbstractObject} that can be positioned and pointed in the
* world.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Pointable extends Positionable {
Point getPoint();
void setPoint(Point point);
}

View File

@@ -1,31 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
import com.l2jserver.util.dimensional.Coordinate;
/**
* Defines an {@link AbstractObject} that can be positioned in the world.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Positionable extends ObjectCapability {
Coordinate getPosition();
void setPosition(Coordinate coord);
}

View File

@@ -1,31 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
import com.l2jserver.util.dimensional.Coordinate;
/**
* Represents an {@link AbstractObject} that can be spawned.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Spawnable extends ObjectCapability, Positionable, Pointable {
void spawn(Coordinate coordinate);
boolean isSpawned();
}

View File

@@ -1,31 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
import com.l2jserver.util.dimensional.Coordinate;
/**
* Represents an {@link AbstractObject} that can be summoned.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Summonable extends Spawnable {
void summon(Coordinate coordinate);
boolean isSummoned();
}

View File

@@ -1,27 +0,0 @@
/*
* 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.world.capability;
import com.l2jserver.model.world.AbstractObject;
/**
* Defines an {@link AbstractObject} that can talk to an {@link Conversable}.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Talker extends ObjectCapability {
}

View File

@@ -16,7 +16,7 @@
*/ */
package com.l2jserver.model.world.character; package com.l2jserver.model.world.character;
import com.l2jserver.model.world.AbstractActor.Race; import com.l2jserver.model.world.Actor.Race;
/** /**
* Defines all the possible classes for an character * Defines all the possible classes for an character

View File

@@ -19,10 +19,10 @@ package com.l2jserver.model.world.character.event;
import java.util.Date; import java.util.Date;
import com.l2jserver.model.id.ObjectID; import com.l2jserver.model.id.ObjectID;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.Player; import com.l2jserver.model.world.Player;
import com.l2jserver.model.world.WorldObject; import com.l2jserver.model.world.WorldObject;
import com.l2jserver.model.world.capability.Actor;
/** /**
* Event triggered once a character logs-in. * Event triggered once a character logs-in.

View File

@@ -19,10 +19,10 @@ package com.l2jserver.model.world.character.event;
import java.util.Date; import java.util.Date;
import com.l2jserver.model.id.ObjectID; import com.l2jserver.model.id.ObjectID;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.Player; import com.l2jserver.model.world.Player;
import com.l2jserver.model.world.WorldObject; import com.l2jserver.model.world.WorldObject;
import com.l2jserver.model.world.capability.Actor;
/** /**
* Event triggered once a character logs-out. * Event triggered once a character logs-out.

View File

@@ -17,10 +17,10 @@
package com.l2jserver.model.world.character.event; package com.l2jserver.model.world.character.event;
import com.l2jserver.model.id.ObjectID; import com.l2jserver.model.id.ObjectID;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.Player; import com.l2jserver.model.world.Player;
import com.l2jserver.model.world.WorldObject; import com.l2jserver.model.world.WorldObject;
import com.l2jserver.model.world.capability.Actor;
import com.l2jserver.util.dimensional.Point; import com.l2jserver.util.dimensional.Point;
/** /**

View File

@@ -17,10 +17,10 @@
package com.l2jserver.model.world.character.event; package com.l2jserver.model.world.character.event;
import com.l2jserver.model.id.ObjectID; import com.l2jserver.model.id.ObjectID;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.Player; import com.l2jserver.model.world.Player;
import com.l2jserver.model.world.WorldObject; import com.l2jserver.model.world.WorldObject;
import com.l2jserver.model.world.capability.Actor;
/** /**
* Event triggered once a character starts running * Event triggered once a character starts running

View File

@@ -17,10 +17,10 @@
package com.l2jserver.model.world.character.event; package com.l2jserver.model.world.character.event;
import com.l2jserver.model.id.ObjectID; import com.l2jserver.model.id.ObjectID;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.Player; import com.l2jserver.model.world.Player;
import com.l2jserver.model.world.WorldObject; import com.l2jserver.model.world.WorldObject;
import com.l2jserver.model.world.capability.Actor;
import com.l2jserver.util.dimensional.Point; import com.l2jserver.util.dimensional.Point;
/** /**

View File

@@ -17,10 +17,10 @@
package com.l2jserver.model.world.character.event; package com.l2jserver.model.world.character.event;
import com.l2jserver.model.id.ObjectID; import com.l2jserver.model.id.ObjectID;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.Player; import com.l2jserver.model.world.Player;
import com.l2jserver.model.world.WorldObject; import com.l2jserver.model.world.WorldObject;
import com.l2jserver.model.world.capability.Actor;
/** /**
* Event triggered once a character moves * Event triggered once a character moves

View File

@@ -17,10 +17,10 @@
package com.l2jserver.model.world.character.event; package com.l2jserver.model.world.character.event;
import com.l2jserver.model.id.ObjectID; import com.l2jserver.model.id.ObjectID;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.Player; import com.l2jserver.model.world.Player;
import com.l2jserver.model.world.WorldObject; import com.l2jserver.model.world.WorldObject;
import com.l2jserver.model.world.capability.Actor;
/** /**
* Event triggered once a character moves * Event triggered once a character moves

View File

@@ -17,10 +17,10 @@
package com.l2jserver.model.world.character.event; package com.l2jserver.model.world.character.event;
import com.l2jserver.model.id.ObjectID; import com.l2jserver.model.id.ObjectID;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.Player; import com.l2jserver.model.world.Player;
import com.l2jserver.model.world.WorldObject; import com.l2jserver.model.world.WorldObject;
import com.l2jserver.model.world.capability.Actor;
/** /**
* Event triggered once a character starts walking * Event triggered once a character starts walking

View File

@@ -16,7 +16,6 @@
*/ */
package com.l2jserver.model.world.event; package com.l2jserver.model.world.event;
import com.l2jserver.model.world.capability.Spawnable;
import com.l2jserver.service.game.world.event.WorldEvent; import com.l2jserver.service.game.world.event.WorldEvent;
import com.l2jserver.util.dimensional.Point; import com.l2jserver.util.dimensional.Point;
@@ -26,9 +25,6 @@ import com.l2jserver.util.dimensional.Point;
* @author <a href="http://www.rogiel.com">Rogiel</a> * @author <a href="http://www.rogiel.com">Rogiel</a>
*/ */
public interface SpawnEvent extends WorldEvent { public interface SpawnEvent extends WorldEvent {
@Override
Spawnable getObject();
/** /**
* @return the spawning point * @return the spawning point
*/ */

View File

@@ -17,10 +17,10 @@
package com.l2jserver.model.world.item; package com.l2jserver.model.world.item;
import com.l2jserver.model.id.ObjectID; import com.l2jserver.model.id.ObjectID;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.Item; import com.l2jserver.model.world.Item;
import com.l2jserver.model.world.Player; import com.l2jserver.model.world.Player;
import com.l2jserver.model.world.WorldObject; import com.l2jserver.model.world.WorldObject;
import com.l2jserver.model.world.capability.Actor;
import com.l2jserver.model.world.player.event.PlayerEvent; import com.l2jserver.model.world.player.event.PlayerEvent;
/** /**

View File

@@ -1,30 +0,0 @@
/*
* 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.world.party;
import com.l2jserver.model.world.Clan;
import com.l2jserver.model.world.Party;
import com.l2jserver.service.game.world.event.WorldEvent;
/**
* Base event for {@link Party} objects
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface PartyEvent extends WorldEvent {
Clan getClan();
}

View File

@@ -1,39 +0,0 @@
/*
* 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.world.party;
import com.l2jserver.service.game.world.event.WorldEvent;
import com.l2jserver.service.game.world.event.WorldListener;
/**
* This listener will filter to only dispatch {@link PartyEvent} events.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class PartyListener implements WorldListener {
@Override
public boolean dispatch(WorldEvent e) {
if (!(e instanceof PartyEvent))
return false;
return dispatch((PartyEvent) e);
}
/**
* @see WorldListener#dispatch(WorldEvent)
*/
protected abstract boolean dispatch(PartyEvent e);
}

View File

@@ -17,9 +17,9 @@
package com.l2jserver.model.world.player.event; package com.l2jserver.model.world.player.event;
import com.l2jserver.model.id.ObjectID; import com.l2jserver.model.id.ObjectID;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.Player; import com.l2jserver.model.world.Player;
import com.l2jserver.model.world.WorldObject; import com.l2jserver.model.world.WorldObject;
import com.l2jserver.model.world.capability.Actor;
import com.l2jserver.util.dimensional.Point; import com.l2jserver.util.dimensional.Point;
/** /**

View File

@@ -16,7 +16,7 @@
*/ */
package com.l2jserver.service.game.ai; package com.l2jserver.service.game.ai;
import com.l2jserver.model.world.capability.Actor; import com.l2jserver.model.world.Actor;
import com.l2jserver.service.Service; import com.l2jserver.service.Service;
import com.l2jserver.util.dimensional.Coordinate; import com.l2jserver.util.dimensional.Coordinate;

View File

@@ -17,7 +17,7 @@
package com.l2jserver.service.game.ai; package com.l2jserver.service.game.ai;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.l2jserver.model.world.capability.Actor; import com.l2jserver.model.world.Actor;
import com.l2jserver.service.AbstractService; import com.l2jserver.service.AbstractService;
import com.l2jserver.service.AbstractService.Depends; import com.l2jserver.service.AbstractService.Depends;
import com.l2jserver.service.ServiceStartException; import com.l2jserver.service.ServiceStartException;

View File

@@ -16,12 +16,12 @@
*/ */
package com.l2jserver.service.game.ai.script; package com.l2jserver.service.game.ai.script;
import com.l2jserver.model.world.capability.Attackable; import com.l2jserver.model.world.Actor;
import com.l2jserver.service.game.ai.AIScript; import com.l2jserver.service.game.ai.AIScript;
/** /**
* @author <a href="http://www.rogiel.com">Rogiel</a * @author <a href="http://www.rogiel.com">Rogiel</a
*/ */
public interface AttackAIScript extends AIScript { public interface AttackAIScript extends AIScript {
void attack(Attackable target); void attack(Actor actor);
} }

View File

@@ -16,7 +16,7 @@
*/ */
package com.l2jserver.service.game.ai.script; package com.l2jserver.service.game.ai.script;
import com.l2jserver.model.world.capability.Positionable; import com.l2jserver.model.world.PositionableObject;
/** /**
* This AI is used to receive notifications once another object aproaches. * This AI is used to receive notifications once another object aproaches.
@@ -31,5 +31,5 @@ public interface ProximityAIScript {
* @param object * @param object
* the object * the object
*/ */
void approach(Positionable object); void approach(PositionableObject object);
} }

View File

@@ -16,7 +16,7 @@
*/ */
package com.l2jserver.service.game.ai.script; package com.l2jserver.service.game.ai.script;
import com.l2jserver.model.world.capability.Positionable; import com.l2jserver.model.world.PositionableObject;
import com.l2jserver.service.game.ai.AIScript; import com.l2jserver.service.game.ai.AIScript;
import com.l2jserver.util.dimensional.Coordinate; import com.l2jserver.util.dimensional.Coordinate;
@@ -26,5 +26,5 @@ import com.l2jserver.util.dimensional.Coordinate;
public interface WalkingAIScript extends AIScript { public interface WalkingAIScript extends AIScript {
void walk(Coordinate coord); void walk(Coordinate coord);
void follow(Positionable positionable); void follow(PositionableObject positionable);
} }

View File

@@ -16,7 +16,7 @@
*/ */
package com.l2jserver.service.game.character; package com.l2jserver.service.game.character;
import com.l2jserver.model.world.capability.Actor; import com.l2jserver.model.world.Actor;
/** /**
* Exception thrown when the character is trying to attack an {@link Actor} that * Exception thrown when the character is trying to attack an {@link Actor} that

View File

@@ -16,8 +16,8 @@
*/ */
package com.l2jserver.service.game.character; package com.l2jserver.service.game.character;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.capability.Actor;
import com.l2jserver.service.Service; import com.l2jserver.service.Service;
import com.l2jserver.service.game.spawn.AlreadySpawnedServiceException; import com.l2jserver.service.game.spawn.AlreadySpawnedServiceException;
import com.l2jserver.service.game.spawn.NotSpawnedServiceException; import com.l2jserver.service.game.spawn.NotSpawnedServiceException;

View File

@@ -32,13 +32,13 @@ import com.l2jserver.game.net.packet.server.GameGuardQueryPacket;
import com.l2jserver.game.net.packet.server.NPCInformationPacket; import com.l2jserver.game.net.packet.server.NPCInformationPacket;
import com.l2jserver.model.id.object.CharacterID; import com.l2jserver.model.id.object.CharacterID;
import com.l2jserver.model.template.NPCTemplate; import com.l2jserver.model.template.NPCTemplate;
import com.l2jserver.model.world.Actor;
import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.L2Character.CharacterMoveType; import com.l2jserver.model.world.L2Character.CharacterMoveType;
import com.l2jserver.model.world.L2Character.CharacterState; import com.l2jserver.model.world.L2Character.CharacterState;
import com.l2jserver.model.world.NPC; import com.l2jserver.model.world.NPC;
import com.l2jserver.model.world.PositionableObject;
import com.l2jserver.model.world.WorldObject; import com.l2jserver.model.world.WorldObject;
import com.l2jserver.model.world.capability.Actor;
import com.l2jserver.model.world.capability.Positionable;
import com.l2jserver.model.world.character.event.CharacterEnterWorldEvent; import com.l2jserver.model.world.character.event.CharacterEnterWorldEvent;
import com.l2jserver.model.world.character.event.CharacterEvent; import com.l2jserver.model.world.character.event.CharacterEvent;
import com.l2jserver.model.world.character.event.CharacterLeaveWorldEvent; import com.l2jserver.model.world.character.event.CharacterLeaveWorldEvent;
@@ -160,10 +160,10 @@ public class CharacterServiceImpl extends AbstractService implements
// the given event will be broadcasted or not // the given event will be broadcasted or not
// TODO this should not be here, it should be i world service or a newly // TODO this should not be here, it should be i world service or a newly
// created broadcast service. // created broadcast service.
final WorldListener broadcastListener = new FilteredWorldListener<Positionable>( final WorldListener broadcastListener = new FilteredWorldListener<PositionableObject>(
new KnownListFilter(character)) { new KnownListFilter(character)) {
@Override @Override
protected boolean dispatch(WorldEvent e, Positionable object) { protected boolean dispatch(WorldEvent e, PositionableObject object) {
if (e instanceof NPCSpawnEvent) { if (e instanceof NPCSpawnEvent) {
conn.write(new NPCInformationPacket((NPC) object)); conn.write(new NPCInformationPacket((NPC) object));
} else if (e instanceof CharacterMoveEvent) { } else if (e instanceof CharacterMoveEvent) {
@@ -175,7 +175,7 @@ public class CharacterServiceImpl extends AbstractService implements
} else if (e instanceof PlayerTeleportedEvent } else if (e instanceof PlayerTeleportedEvent
|| e instanceof CharacterEnterWorldEvent) { || e instanceof CharacterEnterWorldEvent) {
// TODO this should not be here! // TODO this should not be here!
for (final WorldObject o : worldService for (final PositionableObject o : worldService
.iterable(new KnownListFilter(character))) { .iterable(new KnownListFilter(character))) {
if (o instanceof NPC) { if (o instanceof NPC) {
conn.write(new NPCInformationPacket((NPC) o)); conn.write(new NPCInformationPacket((NPC) o));

Some files were not shown because too many files have changed in this diff Show More