public L1FollowerInstance(L1Npc template, L1NpcInstance target, L1Character master) { super(template); _master = master; setId(IdFactory.getInstance().nextId()); setMaster(master); setX(target.getX()); setY(target.getY()); setMap(target.getMapId()); setHeading(target.getHeading()); setLightSize(target.getLightSize()); target.setParalyzed(true); target.setDead(true); target.deleteMe(); L1World.getInstance().storeObject(this); L1World.getInstance().addVisibleObject(this); for (L1PcInstance pc : L1World.getInstance().getRecognizePlayer(this)) { onPerceive(pc); } startAI(); master.addFollower(this); }
@Override public synchronized void deleteMe() { _master.getFollowerList().remove(getId()); getMap().setPassable(getLocation(), true); super.deleteMe(); }