コード例 #1
0
  /**
   * Constructs new <tt>SM_NPC_INFO </tt> packet
   *
   * @param player
   * @param kisk - the visible npc.
   */
  public SM_NPC_INFO(Player player, Kisk kisk) {
    this.npc = kisk;
    npcTypeId =
        (kisk.isAggroFrom(player) ? NpcType.ATTACKABLE.getId() : NpcType.NON_ATTACKABLE.getId());
    npcTemplate = kisk.getObjectTemplate();
    npcId = kisk.getNpcId();

    masterObjId = kisk.getOwnerObjectId();
    masterName = kisk.getOwnerName();
  }
コード例 #2
0
  /**
   * @param player
   * @param groupgate - the visible npc.
   */
  public SM_NPC_INFO(Player player, GroupGate groupgate) {
    this.npc = groupgate;
    npcTypeId =
        (groupgate.isAggroFrom(player)
            ? NpcType.ATTACKABLE.getId()
            : NpcType.NON_ATTACKABLE.getId());
    npcTemplate = groupgate.getObjectTemplate();
    npcId = groupgate.getNpcId();

    Player owner = (Player) groupgate.getCreator();
    if (owner != null) {
      masterObjId = owner.getObjectId();
      masterName = owner.getName();
    }
  }