1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-11 17:52:52 +00:00

Several improvements

Signed-off-by: Rogiel <rogiel@rogiel.com>
This commit is contained in:
2011-05-19 01:40:53 -03:00
parent 9bb83652e4
commit 2c4af6d91d
263 changed files with 2135 additions and 663 deletions

View File

@@ -16,10 +16,53 @@
*/
package com.l2jserver.model.world;
import com.l2jserver.game.net.packet.client.CharacterActionPacket.CharacterAction;
import com.l2jserver.model.id.object.NPCID;
import com.l2jserver.model.id.template.NPCTemplateID;
import com.l2jserver.model.template.NPCTemplate;
/**
* @author <a href="http://www.rogiel.com">Rogiel</a>
*
*/
public class NPC extends AbstractActor {
/**
* The NPC template ID
*/
private final NPCTemplateID templateID;
public NPC(NPCTemplateID templateID) {
this.templateID = templateID;
}
/**
* Executes an action on this NPC
*
* @param character
* the interacting character
* @param action
* the action
*/
public void action(L2Character character, CharacterAction action) {
getTemplate().action(this, character, action);
}
/**
* @return the NPC template ID
*/
public NPCTemplateID getTemplateID() {
return templateID;
}
/**
* @return the NPC template
*/
public NPCTemplate getTemplate() {
return templateID.getTemplate();
}
@Override
public NPCID getID() {
return (NPCID) super.getID();
}
}