1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-11 09:42:54 +00:00

Character broadcast working

Signed-off-by: Rogiel <rogiel@rogiel.com>
This commit is contained in:
2011-05-22 21:32:55 -03:00
parent 49a8513ec5
commit 98feb1ecce
148 changed files with 2309 additions and 597 deletions

View File

@@ -17,9 +17,10 @@
package com.l2jserver.model.world;
import com.l2jserver.model.id.object.ActorID;
import com.l2jserver.model.id.template.ActorTemplateID;
import com.l2jserver.model.template.ActorTemplate;
import com.l2jserver.model.world.actor.ActorEffects;
import com.l2jserver.model.world.actor.ActorSkillContainer;
import com.l2jserver.util.dimensional.Coordinate;
import com.l2jserver.util.dimensional.Point;
/**
@@ -28,6 +29,8 @@ import com.l2jserver.util.dimensional.Point;
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class Actor extends PositionableObject {
protected ActorTemplateID<?> templateID;
/**
* The actor race
*/
@@ -117,6 +120,10 @@ public abstract class Actor extends PositionableObject {
*/
protected final ActorSkillContainer skills = new ActorSkillContainer(this);
public Actor(ActorTemplateID<?> templateID) {
this.templateID = templateID;
}
public int getHP() {
return hp;
}
@@ -174,6 +181,20 @@ public abstract class Actor extends PositionableObject {
return skills;
}
/**
* @return the templateID
*/
public ActorTemplateID<?> getTemplateID() {
return templateID;
}
/**
* @return the template
*/
public ActorTemplate<?> getTemplate() {
return templateID.getTemplate();
}
@Override
public ActorID<?> getID() {
return (ActorID<?>) super.getID();

View File

@@ -21,8 +21,6 @@ import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.template.ItemTemplate;
import com.l2jserver.model.world.character.CharacterInventory.InventoryLocation;
import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll;
import com.l2jserver.util.dimensional.Coordinate;
import com.l2jserver.util.dimensional.Point;
/**
* This class represents an {@link Item} in the Lineage II World. The item can
@@ -37,10 +35,13 @@ import com.l2jserver.util.dimensional.Point;
* <li><b>Equipped by the {@link L2Character character}</b>: <tt>location</tt>
* is {@link InventoryLocation#PAPERDOLL}, <tt>paperdoll</tt> is not null and
* <tt>coordinate</tt> is null.</li>
* <li><b>Dropped on the ground</b>: <tt>location</li> and <tt>paperdoll</tt>
* <li><b>Dropped on the ground</b>: <tt>location</tt></li> and <tt>paperdoll</tt>
* are null, <tt>coordinate</tt> is not null and represents the dropping
* location.
* </ul>
* <p>
* Please note that {@link PositionableObject} values are only set if the object
* is dropped on the ground.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@@ -62,10 +63,6 @@ public class Item extends PositionableObject {
* Paperdoll slot for this item
*/
private InventoryPaperdoll paperdoll;
/**
* Drop coordinate of this item
*/
private Coordinate coordinate;
/**
* Count of items
@@ -144,12 +141,4 @@ public class Item extends PositionableObject {
public void setOwnerID(CharacterID ownerID) {
this.ownerID = ownerID;
}
public Point getPoint() {
return null;
}
public void setPoint(Point point) {
}
}

View File

@@ -23,6 +23,7 @@ import com.l2jserver.model.id.object.ActorID;
import com.l2jserver.model.id.object.CharacterID;
import com.l2jserver.model.id.object.ClanID;
import com.l2jserver.model.id.object.PetID;
import com.l2jserver.model.id.template.CharacterTemplateID;
import com.l2jserver.model.template.CharacterTemplate;
import com.l2jserver.model.world.actor.ActorAttributes;
import com.l2jserver.model.world.character.CharacterAppearance;
@@ -138,7 +139,9 @@ public class L2Character extends Player {
* @param baseAttributes
* the base attribute for this character
*/
public L2Character(CharacterTemplate.ActorBaseAttributes baseAttributes) {
public L2Character(CharacterTemplateID templateID,
CharacterTemplate.ActorBaseAttributes baseAttributes) {
super(templateID);
this.baseAttributes = baseAttributes;
this.attributes = new CharacterCalculatedAttributes(this);
}
@@ -369,6 +372,16 @@ public class L2Character extends Player {
return shortcuts;
}
@Override
public CharacterTemplateID getTemplateID() {
return (CharacterTemplateID) super.getTemplateID();
}
@Override
public CharacterTemplate getTemplate() {
return (CharacterTemplate) super.getTemplate();
}
@Override
public CharacterID getID() {
return (CharacterID) super.getID();

View File

@@ -30,11 +30,6 @@ import com.l2jserver.service.game.ai.AIScript;
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public class NPC extends Actor {
/**
* The NPC template ID
*/
private final NPCTemplateID templateID;
/**
* Creates a new instance
*
@@ -42,21 +37,21 @@ public class NPC extends Actor {
* the {@link NPC} {@link TemplateID}
*/
public NPC(NPCTemplateID templateID) {
this.templateID = templateID;
super(templateID);
}
/**
* @return the NPC template ID
*/
public NPCTemplateID getTemplateID() {
return templateID;
return (NPCTemplateID) templateID;
}
/**
* @return the NPC template
*/
public NPCTemplate getTemplate() {
return templateID.getTemplate();
return (NPCTemplate) templateID.getTemplate();
}
@Override

View File

@@ -18,6 +18,7 @@ package com.l2jserver.model.world;
import com.l2jserver.model.id.object.CharacterID;
import com.l2jserver.model.id.object.ItemID;
import com.l2jserver.model.id.template.ActorTemplateID;
/**
* This class represents an Pet in the Lineage II World
@@ -34,6 +35,10 @@ public class Pet extends Player {
*/
private ItemID itemID;
public Pet(ActorTemplateID<?> templateID) {
super(templateID);
}
/**
* @return the owner ID
*/

View File

@@ -16,6 +16,8 @@
*/
package com.l2jserver.model.world;
import com.l2jserver.model.id.template.ActorTemplateID;
/**
* {@link Player} is any object that can be controlled by the player. The most
* common implementation is {@link L2Character}.
@@ -23,5 +25,7 @@ package com.l2jserver.model.world;
* @author Rogiel
*/
public abstract class Player extends Actor {
public Player(ActorTemplateID<?> templateID) {
super(templateID);
}
}

View File

@@ -20,10 +20,15 @@ import com.l2jserver.util.dimensional.Coordinate;
import com.l2jserver.util.dimensional.Point;
/**
* @author <a href="http://www.rogiel.com">Rogiel</a>
* This is an abstract object that objects that can be placed in world should
* extend.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class PositionableObject extends AbstractObject {
/**
* The point this object is currently in
*/
private Point point;
/**

View File

@@ -34,7 +34,7 @@ public class CharacterMoveEvent implements CharacterEvent {
*/
private final L2Character character;
/**
* The new point of the character
* The old point of the character
*/
private final Point point;
@@ -44,7 +44,7 @@ public class CharacterMoveEvent implements CharacterEvent {
* @param character
* the character
* @param point
* the character point
* the character point before moving
*/
public CharacterMoveEvent(L2Character character, Point point) {
this.character = character;
@@ -52,7 +52,7 @@ public class CharacterMoveEvent implements CharacterEvent {
}
/**
* @return the new point
* @return the old point
*/
public Point getPoint() {
return point;