Beispiel #1
0
  public Npc(NPCLoc loc) {
    for (int i : Constants.GameServer.UNDEAD_NPCS) {
      if (loc.getId() == i) {
        this.undead = true;
      }
    }
    for (int i : Constants.GameServer.ARMOR_NPCS) {
      if (loc.getId() == i) {
        this.hasArmor = true;
      }
    }

    def = EntityHandler.getNpcDef(loc.getId());
    curHits = def.getHits();

    this.loc = loc;
    super.setID(loc.getId());
    this.setLocation(Point.location(loc.startX(), loc.startY()), true);
    super.setCombatLevel(
        Formulae.getCombatLevel(def.getAtt(), def.getDef(), def.getStr(), def.getHits(), 0, 0, 0));

    if (this.loc.getId() == 189
        || this.loc.getId() == 53
        || this.loc.getId() == 19) { // this should not be here
      this.def.aggressive = true;
    }
  }
Beispiel #2
0
 @Override
 public String toString() {
   return "[NPC:" + EntityHandler.getNpcDef(id).getName() + "]";
 }
Beispiel #3
0
 public NPCDef getDef() {
   return EntityHandler.getNpcDef(getID());
 }