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

Small script changes

Signed-off-by: Rogiel <rogiel@rogiel.com>
This commit is contained in:
2011-05-13 13:50:51 -03:00
parent da28654510
commit 4b954b2818
8 changed files with 173 additions and 10 deletions

View File

@@ -2,25 +2,46 @@ package com.l2jserver.model.world;
import com.l2jserver.model.id.object.CharacterID;
import com.l2jserver.model.id.template.ItemTemplateID;
import com.l2jserver.model.world.capability.Dropable;
import com.l2jserver.model.world.capability.Listenable;
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.InventoryPaperdoll;
import com.l2jserver.model.world.item.ItemEvent;
import com.l2jserver.model.world.item.ItemListener;
import com.l2jserver.util.Coordinate;
public class Item extends AbstractObject implements Playable, Spawnable,
Listenable<ItemListener, ItemEvent> {
Listenable<ItemListener, ItemEvent>, Dropable {
private final ItemTemplateID templateID;
private CharacterID ownerID;
/**
* Inventory location of this item
*/
private InventoryLocation location;
/**
* Paperdoll slot for this item
*/
private InventoryPaperdoll paperdoll;
/**
* Drop coordinate of this item
*/
private Coordinate coordinate;
public Item(ItemTemplateID templateID) {
this.templateID = templateID;
}
@Override
public void spawn(Coordinate coordinate) {
public void drop(Coordinate position) {
this.coordinate = position;
}
@Override
public void spawn(Coordinate coordinate) {
this.drop(coordinate);
}
@Override
@@ -31,13 +52,44 @@ public class Item extends AbstractObject implements Playable, Spawnable,
@Override
public Coordinate getPosition() {
// TODO Auto-generated method stub
return null;
return coordinate;
}
@Override
public void setPosition(Coordinate coord) {
this.coordinate = coord;
}
/**
* @return the location
*/
public InventoryLocation getLocation() {
return location;
}
/**
* @param location
* the location to set
*/
public void setLocation(InventoryLocation location) {
this.location = location;
if (location != InventoryLocation.PAPERDOLL)
this.paperdoll = null;
}
/**
* @return the paperdoll
*/
public InventoryPaperdoll getPaperdoll() {
return paperdoll;
}
/**
* @param paperdoll
* the paperdoll to set
*/
public void setPaperdoll(InventoryPaperdoll paperdoll) {
this.paperdoll = paperdoll;
}
/**