Exemple #1
0
 @Override
 protected void onEvtSpawn() {
   super.onEvtSpawn();
   NpcInstance actor = getActor();
   _entranceactive = false;
   Functions.npcShout(actor, "The lock has been put on the Controller device");
 }
Exemple #2
0
 @Override
 protected void onEvtDead(Creature killer) {
   NpcInstance actor = getActor();
   _entranceactive = true;
   Functions.npcShout(actor, "The lock has been removed from the Controller device");
   super.onEvtDead(killer);
 }
Exemple #3
0
  @Override
  protected void onEvtAttacked(Creature attacker, int damage) {
    super.onEvtAttacked(attacker, damage);
    OrfenInstance actor = getActor();
    if (actor.isCastingNow()) {
      return;
    }

    double distance = actor.getDistance(attacker);

    // if(attacker.isMuted() &&)
    if (distance > 300 && distance < 1000 && _damSkills.length > 0 && Rnd.chance(10)) {
      Functions.npcSay(
          actor, MsgOnRecall[Rnd.get(MsgOnRecall.length - 1)].sprintf(attacker.getName()));
      teleToLocation(attacker, Location.findFrontPosition(actor, attacker, 0, 50));
      Skill r_skill = _damSkills[Rnd.get(_damSkills.length)];
      if (canUseSkill(r_skill, attacker, -1)) {
        addTaskAttack(attacker, r_skill, 1000000);
      }
    } else if (_paralyze.length > 0 && Rnd.chance(20)) {
      Skill r_skill = _paralyze[Rnd.get(_paralyze.length)];
      if (canUseSkill(r_skill, attacker, -1)) {
        addTaskAttack(attacker, r_skill, 1000000);
      }
    }
  }
Exemple #4
0
  @Override
  protected void onEvtSeeSpell(Skill skill, Creature caster) {
    super.onEvtSeeSpell(skill, caster);
    OrfenInstance actor = getActor();
    if (actor.isCastingNow()) {
      return;
    }

    double distance = actor.getDistance(caster);
    if (_damSkills.length > 0 && skill.getEffectPoint() > 0 && distance < 1000 && Rnd.chance(20)) {
      Functions.npcSay(actor, MsgOnRecall[Rnd.get(MsgOnRecall.length)].sprintf(caster.getName()));
      teleToLocation(caster, Location.findFrontPosition(actor, caster, 0, 50));
      Skill r_skill = _damSkills[Rnd.get(_damSkills.length)];
      if (canUseSkill(r_skill, caster, -1)) {
        addTaskAttack(caster, r_skill, 1000000);
      }
    }
  }