Examples of NpcData


Examples of com.l2client.model.network.NpcData

public final class NpcInfo extends GameServerPacket {

  @Override
  public void handlePacket() {
    log.finer("Read from Server "+this.getClass().getSimpleName());
    NpcData n = new NpcData();
    n.setObjectId(readD());
    n.setTemplateId(readD());
    //attackable
    readD();
    int x = readD();
    int y = readD();
    int z = readD();
log.finer("NPC at "+x+","+y+","+z+" placed in world at "+ServerValues.getClientString(x, y, z));
    n.setX(ServerValues.getClientCoordX(x));
    //reverted jme uses Y as up
    n.setY(ServerValues.getClientCoordY(z));
    n.setZ(ServerValues.getClientCoordZ(y));
    n.setHeading(ServerValues.getClientHeading(readD()));
    readD();
    readD();
    readD();
    //TODO diversify speed data, currently the fastest is stored
    int speed = readD();//run speed
    int nSpeed = readD();//walk speed
    //in L2J the following pairs are all the same as the two above
    readD();//swim run speed
    readD();//swim walk speed
    readD();//fly run speed
    readD();//fly walk speed
    readD();//fly run speed
    readD();//fly walk speed
    float mult = (float)readF();//movement speed multiplier

    if(mult <0.00001f)
      mult = 1.0f;
    n.setWalkSpeed(mult*ServerValues.getClientScaled(nSpeed));
    n.setRunSpeed(mult*ServerValues.getClientScaled(speed));
    readF();//attack speed multiplier
    readF();//collision radius
    readF();//collision height

    readD();//right hand weapon
    readD();//chest
    readD();//left hand weapon
    readC();//display name above char 1=true ?
    n.setRunning(readC()>0?true:false);//is running 1=true
    readC();//is in combat 1=true
    readC();//is like dead 1 = true
    readC();//is summoned 0=teleported 1=default 2=summoned
    readD();// -1 high five name
    n.setName(readS());
    readD();// -1 high five name
    n.setTitle(readS());
    readD();//Title color 0=client default
    readD();//0
    readD();//pvp flag

    readD();//AbnormalEffect
View Full Code Here

Examples of net.citizensnpcs.npcdata.NPCData

        HumanNPC npc = NPCSpawner.spawnNPC(UID, npcName, loc);

        NPCCreateEvent event = new NPCCreateEvent(npc, reason, loc);
        Bukkit.getServer().getPluginManager().callEvent(event);

        npc.setNPCData(new NPCData(npcName, UID, loc, colour, PropertyManager.getBasic().getItems(UID),
                NPCDataManager.NPCTexts.get(UID), PropertyManager.getBasic().isTalk(UID), PropertyManager.getBasic()
                        .isLookWhenClose(UID), PropertyManager.getBasic().isTalkWhenClose(UID), owner));
        PropertyManager.getBasic().saveOwner(UID, owner);
        PropertyManager.load(npc);
View Full Code Here

Examples of net.citizensnpcs.npcdata.NPCData

    @Override
    public void loadState(HumanNPC npc) {
        int UID = npc.getUID();

        NPCData npcdata = npc.getNPCData();

        npcdata.setTalk(isTalk(UID));
        npcdata.setName(getName(UID));
        npcdata.setLocation(getLocation(UID));
        npcdata.setColour(getColour(UID));
        npcdata.setItems(getItems(UID));
        npcdata.setTexts(getText(UID));
        npcdata.setLookClose(isLookWhenClose(UID));
        npcdata.setTalkClose(isTalkWhenClose(UID));
        npcdata.setOwner(getOwner(UID));
        npc.getWaypoints().setPoints(getWaypoints(UID, npc.getWorld()));
        npc.setBalance(getBalance(npc.getUID()));

        NPCDataManager.addItems(npc, npcdata.getItems());
        if (getInventory(npc.getUID()) != null) {
            npc.getInventory().setContents(getInventory(npc.getUID()).getContents());
        }
        npc.getHandle().setAutoPathfinder(profiles.getBoolean(UID + ".basic.wander", false));
        saveState(npc);
View Full Code Here

Examples of net.citizensnpcs.npcdata.NPCData

    @Override
    public void saveState(HumanNPC npc) {
        int UID = npc.getUID();

        NPCData npcdata = npc.getNPCData();

        saveBalance(npc.getUID(), npc.getBalance());
        saveName(npc.getUID(), npcdata.getName());
        saveLocation(npcdata.getLocation(), UID);
        saveColour(UID, npcdata.getColour());
        saveItems(UID, npcdata.getItems());
        saveInventory(UID, npc.getPlayer().getInventory());
        saveText(UID, npcdata.getTexts());
        saveLookWhenClose(UID, npcdata.isLookClose());
        saveTalkWhenClose(UID, npcdata.isTalkClose());
        saveTalk(UID, npcdata.isTalk());
        saveWaypoints(UID, npc.getWaypoints().getWaypoints());
        saveOwner(UID, npcdata.getOwner());

        profiles.setBoolean(UID + ".basic.wander", npc.getHandle().isAutoPathfinder());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.