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

Created CharacterTemplate object for all classes

Signed-off-by: Rogiel <rogiel@rogiel.com>
This commit is contained in:
2011-05-14 16:39:33 -03:00
parent d8d561688b
commit e886165b89
137 changed files with 6472 additions and 97 deletions

View File

@@ -1,5 +1,6 @@
package com.l2jserver.model.id;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
/**
@@ -15,6 +16,7 @@ public class AccountID extends ID<String> {
* @param login
* the login
*/
@Inject
public AccountID(@Assisted String login) {
super(login);
}

View File

@@ -8,7 +8,7 @@ import com.l2jserver.model.world.AbstractActor.Race;
import com.l2jserver.model.world.L2Character;
import com.l2jserver.model.world.character.CharacterBaseAttributes;
import com.l2jserver.model.world.character.CharacterClass;
import com.l2jserver.util.Coordinate;
import com.l2jserver.util.dimensional.Point;
/**
* Template for {@link L2Character}
@@ -33,7 +33,7 @@ public abstract class CharacterTemplate extends AbstractTemplate<L2Character> {
/**
* The initial location for the character to be spawned
*/
protected final Coordinate spawnLocation;
protected final Point spawnLocation;
/**
* The base attributes instance
*/
@@ -45,7 +45,7 @@ public abstract class CharacterTemplate extends AbstractTemplate<L2Character> {
int physicalAttack, int magicalAttack, int physicalDefense,
int magicalDefense, int attackSpeed, int castSpeed, int accuracy,
int criticalChance, int evasionChance, int moveSpeed,
int maxWeigth, boolean craft, Coordinate spawnLocation) {
int maxWeigth, boolean craft, Point spawnLocation) {
super(id);
this.race = characterClass.race;
this.characterClass = characterClass;
@@ -64,7 +64,7 @@ public abstract class CharacterTemplate extends AbstractTemplate<L2Character> {
character.setRace(race);
character.setCharacterClass(characterClass);
character.setPosition(spawnLocation);
character.setPoint(spawnLocation);
// character.getBaseAttributes().setIntelligence(intelligence);
// character.getBaseAttributes().setStrength(strength);
@@ -91,9 +91,9 @@ public abstract class CharacterTemplate extends AbstractTemplate<L2Character> {
}
/**
* @return the spawnLocation
* @return the initial spawn location
*/
public Coordinate getSpawnLocation() {
public Point getSpawnLocation() {
return spawnLocation;
}

View File

@@ -8,7 +8,8 @@ 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.Coordinate;
import com.l2jserver.util.dimensional.Coordinate;
import com.l2jserver.util.dimensional.Point;
/**
* Abstract {@link Actor} class.
@@ -83,9 +84,9 @@ public abstract class AbstractActor extends AbstractObject implements Actor {
*/
protected int hp;
/**
* The actor coordinate
* The actor coordinate point
*/
protected Coordinate position;
protected Point point;
/**
* The currently effects active on the actor
*/
@@ -138,14 +139,29 @@ public abstract class AbstractActor extends AbstractObject implements Actor {
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 position;
return point.getCoordinate();
}
@Override
public void setPosition(Coordinate coord) {
this.position = coord;
this.point = new Point(coord, (point != null ? point.getAngle() : 0));
}
/**

View File

@@ -10,7 +10,7 @@ import com.l2jserver.model.world.character.CharacterInventory.InventoryLocation;
import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll;
import com.l2jserver.model.world.item.ItemEvent;
import com.l2jserver.model.world.item.ItemListener;
import com.l2jserver.util.Coordinate;
import com.l2jserver.util.dimensional.Coordinate;
/**
* This class represents an {@link Item} in the Lineage II World. The item can

View File

@@ -3,7 +3,7 @@ package com.l2jserver.model.world;
import com.l2jserver.model.id.object.CharacterID;
import com.l2jserver.model.id.object.ItemID;
import com.l2jserver.model.world.capability.Summonable;
import com.l2jserver.util.Coordinate;
import com.l2jserver.util.dimensional.Coordinate;
/**
* This class represents an Pet in the Lineage II World

View File

@@ -3,7 +3,7 @@ package com.l2jserver.model.world;
import com.l2jserver.model.world.capability.Actor;
import com.l2jserver.model.world.capability.Playable;
import com.l2jserver.model.world.capability.Teleportable;
import com.l2jserver.util.Coordinate;
import com.l2jserver.util.dimensional.Coordinate;
/**
* {@link Player} is any object that can be controlled by the player. The most

View File

@@ -12,7 +12,7 @@ import com.l2jserver.model.world.actor.ActorListener;
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface Actor extends Listenable<ActorListener, ActorEvent>,
Spawnable, Positionable, Damagable, Attackable, Attacker, Castable,
Spawnable, Pointable, Damagable, Attackable, Attacker, Castable,
Caster, Levelable, Killable, Equiper, Equipable {
ActorEffects getEffects();
}

View File

@@ -1,7 +1,7 @@
package com.l2jserver.model.world.capability;
import com.l2jserver.model.world.AbstractObject;
import com.l2jserver.util.Coordinate;
import com.l2jserver.util.dimensional.Coordinate;
/**
* Defines an {@link AbstractObject} that can be dropped on the ground.

View File

@@ -0,0 +1,16 @@
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,7 +1,7 @@
package com.l2jserver.model.world.capability;
import com.l2jserver.model.world.AbstractObject;
import com.l2jserver.util.Coordinate;
import com.l2jserver.util.dimensional.Coordinate;
/**
* Defines an {@link AbstractObject} that can be positioned in the world.

View File

@@ -1,7 +1,7 @@
package com.l2jserver.model.world.capability;
import com.l2jserver.model.world.AbstractObject;
import com.l2jserver.util.Coordinate;
import com.l2jserver.util.dimensional.Coordinate;
/**
* Represents an {@link AbstractObject} that can be spawned.

View File

@@ -1,7 +1,7 @@
package com.l2jserver.model.world.capability;
import com.l2jserver.model.world.AbstractObject;
import com.l2jserver.util.Coordinate;
import com.l2jserver.util.dimensional.Coordinate;
/**
* Represents an {@link AbstractObject} that can be summoned.

View File

@@ -1,7 +1,7 @@
package com.l2jserver.model.world.capability;
import com.l2jserver.model.world.AbstractObject;
import com.l2jserver.util.Coordinate;
import com.l2jserver.util.dimensional.Coordinate;
/**
* Defines an {@link AbstractObject} that can be teleported by

View File

@@ -1,7 +1,7 @@
package com.l2jserver.model.world.capability;
import com.l2jserver.model.world.AbstractObject;
import com.l2jserver.util.Coordinate;
import com.l2jserver.util.dimensional.Coordinate;
/**
* Defines an {@link AbstractObject} that can teleport {@link Teleportable}

View File

@@ -285,7 +285,7 @@ public enum CharacterClass {
* the class id
* @return the {@link CharacterClass} instance found
*/
public CharacterClass fromID(int id) {
public static CharacterClass fromID(int id) {
for (final CharacterClass c : values()) {
if (c.id == id)
return c;

View File

@@ -1,7 +1,7 @@
package com.l2jserver.model.world.event;
import com.l2jserver.model.world.capability.Spawnable;
import com.l2jserver.util.Coordinate;
import com.l2jserver.util.dimensional.Coordinate;
/**
* Event for objects spawning

View File

@@ -2,7 +2,7 @@ package com.l2jserver.model.world.filter.impl;
import com.l2jserver.model.world.capability.Positionable;
import com.l2jserver.model.world.filter.WorldObjectFilter;
import com.l2jserver.util.Coordinate;
import com.l2jserver.util.dimensional.Coordinate;
/**
* Filter objects that are in the <tt>range</tt> of <tt>coordinate</tt>

View File

@@ -5,7 +5,7 @@ import com.l2jserver.model.world.capability.Actor;
import com.l2jserver.model.world.capability.Listenable;
import com.l2jserver.model.world.capability.Spawnable;
import com.l2jserver.model.world.event.SpawnEvent;
import com.l2jserver.util.Coordinate;
import com.l2jserver.util.dimensional.Coordinate;
/**
* Event dispatcher once an player has spawned in the world

View File

@@ -1,7 +1,7 @@
package com.l2jserver.model.world.player;
import com.l2jserver.model.world.Player;
import com.l2jserver.util.Coordinate;
import com.l2jserver.util.dimensional.Coordinate;
/**
* Event dispatched once an player is teleported.