@Override
 protected void handleSpawned() {
   super.handleSpawned();
   towerCenter = getPosition().getWorldMapInstance().getNpc(831130);
   AI2Actions.targetCreature(AwakenedGuardianTombGhostAI2.this, towerCenter);
   getAggroList().addHate(towerCenter, 100000);
 }
 @Override
 protected void handleDied() {
   cancelPhaseTask();
   if (getNpcId() == 217309) {
     sendMsg(1500390);
     spawn(217310, 238.160f, 598.624f, 178.480f, (byte) 0);
     deleteHelpers();
     AI2Actions.deleteOwner(this);
   } else {
     sendMsg(1500391);
     final WorldMapInstance instance = getPosition().getWorldMapInstance();
     if (instance != null) {
       final Npc ariana = instance.getNpc(799668);
       if (ariana != null) {
         ariana.getEffectController().removeEffect(19921);
         ThreadPoolManager.getInstance()
             .schedule(
                 new Runnable() {
                   @Override
                   public void run() {
                     ariana.getSpawn().setWalkerId("30028000016");
                     WalkManager.startWalking((NpcAI2) ariana.getAi2());
                   }
                 },
                 1000);
         NpcShoutsService.getInstance().sendMsg(ariana, 1500415, ariana.getObjectId(), 0, 4000);
         NpcShoutsService.getInstance().sendMsg(ariana, 1500416, ariana.getObjectId(), 0, 13000);
         ThreadPoolManager.getInstance()
             .schedule(
                 new Runnable() {
                   @Override
                   public void run() {
                     if (instance != null) {
                       SkillEngine.getInstance()
                           .getSkill(ariana, 19358, 60, ariana)
                           .useNoAnimationSkill();
                       instance.getDoors().get(145).setOpen(true);
                       deleteNpcs(instance.getNpcs(701156));
                       ThreadPoolManager.getInstance()
                           .schedule(
                               new Runnable() {
                                 @Override
                                 public void run() {
                                   if (ariana != null && !NpcActions.isAlreadyDead(ariana)) {
                                     NpcActions.delete(ariana);
                                   }
                                 }
                               },
                               13000);
                     }
                   }
                 },
                 13000);
       }
     }
   }
   super.handleDied();
 }
 @Override
 protected void handleUseItemFinish(Player player) {
   switch (getNpcId()) {
     case 730770:
       player.getLifeStats().increaseHp(SM_ATTACK_STATUS.TYPE.HP, 5000);
       AI2Actions.deleteOwner(this);
       break;
   }
 }
Ejemplo n.º 4
0
 @Override
 public boolean onDialogSelect(
     final Player player, int dialogId, int questId, int extendedRewardIndex) {
   if (dialogId == DialogAction.SETPRO1.id()) {
     AI2Actions.deleteOwner(this);
   } else if (dialogId == DialogAction.SELECT_ACTION_1012.id())
     PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(getObjectId(), 1012));
   return true;
 }
Ejemplo n.º 5
0
  @Override
  protected void handleDialogStart(Player player) {
    if (player.getKisk() == getOwner()) {
      PacketSendUtility.sendPacket(player, SM_SYSTEM_MESSAGE.STR_BINDSTONE_ALREADY_REGISTERED);
      return;
    }

    if (getOwner().canBind(player)) {
      AI2Actions.addRequest(
          this,
          player,
          SM_QUESTION_WINDOW.STR_ASK_REGISTER_BINDSTONE,
          getOwner().getObjectId(),
          CANCEL_DIALOG_METERS,
          new AI2Request() {
            private boolean decisionTaken = false;

            @Override
            public void acceptRequest(Creature requester, Player responder) {
              if (!decisionTaken) {
                // Check again if it's full (If they waited to press OK)
                if (!getOwner().canBind(responder)) {
                  PacketSendUtility.sendPacket(
                      responder, SM_SYSTEM_MESSAGE.STR_CANNOT_REGISTER_BINDSTONE_HAVE_NO_AUTHORITY);
                  return;
                }
                KiskService.getInstance().onBind(getOwner(), responder);
              }
            }

            @Override
            public void denyRequest(Creature requester, Player responder) {
              decisionTaken = true;
            }
          });

    } else if (getOwner().getCurrentMemberCount() >= getOwner().getMaxMembers()) {
      PacketSendUtility.sendPacket(player, SM_SYSTEM_MESSAGE.STR_CANNOT_REGISTER_BINDSTONE_FULL);
    } else {
      PacketSendUtility.sendPacket(
          player, SM_SYSTEM_MESSAGE.STR_CANNOT_REGISTER_BINDSTONE_HAVE_NO_AUTHORITY);
    }
  }
Ejemplo n.º 6
0
 @Override
 protected void handleDied() {
   super.handleDied();
   AI2Actions.deleteOwner(this);
 }
Ejemplo n.º 7
0
 private void doHeal(Creature creature) {
   AI2Actions.targetSelf(this);
   AI2Actions.useSkill(this, 21363);
   apllyEffect(creature, 21363);
 }
 @Override
 protected void handleActivate() {
   super.handleActivate();
   towerCenter = getPosition().getWorldMapInstance().getNpc(831130);
   AI2Actions.targetCreature(AwakenedGuardianTombGhostAI2.this, towerCenter);
 }
Ejemplo n.º 9
0
 @Override
 protected void handleSpawnFinished(SummonGroup summonGroup) {
   if (summonGroup.getNpcId() == 281948) {
     AI2Actions.useSkill(this, 18671);
   }
 }
Ejemplo n.º 10
0
 @Override
 protected void handleBeforeSpawn(Percentage percent) {
   AI2Actions.useSkill(this, 19189);
   AI2Actions.useSkill(this, 19191);
 }