Package com.l2client.model.network

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

TOP

Related Classes of com.l2client.model.network.NpcData

Copyright © 2018 www.massapicom. 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.