Exemplo n.º 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;
    }
  }
Exemplo n.º 2
0
 public void weakenStrength(int offset) {
   super.setCombatLevel(
       Formulae.getCombatLevel(
           def.getAtt(), def.getDef(), (def.getStr() - offset), def.getHits(), 0, 0, 0));
 }