Beispiel #1
0
 @Override
 public void runImpl() throws Exception {
   try {
     switch (_taskId) {
       case 1:
         int angle =
             Math.abs(
                 (weakScarlet.getHeading() < 32768 ? 180 : 540)
                     - (int) (weakScarlet.getHeading() / 182.044444444));
         for (Player pc : getPlayers()) pc.enterMovieMode();
         blockAll(true);
         showSocialActionMovie(weakScarlet, 500, angle, 5, 500, 15000, 0);
         ThreadPoolManager.getInstance().schedule(new SecondMorph(2), 2000);
         break;
       case 2:
         weakScarlet.broadcastPacket(new SocialActionPacket(weakScarlet.getObjectId(), 1));
         weakScarlet.setCurrentHp(weakScarlet.getMaxHp() * 3 / 4, false);
         weakScarlet.setRHandId(_frintezzasSwordId);
         weakScarlet.broadcastCharInfo();
         ThreadPoolManager.getInstance().schedule(new SecondMorph(3), 5500);
         break;
       case 3:
         weakScarlet.broadcastPacket(new SocialActionPacket(weakScarlet.getObjectId(), 4));
         blockAll(false);
         Skill skill = SkillTable.getInstance().getInfo(5017, 1);
         skill.getEffects(weakScarlet, weakScarlet, false, false);
         for (Player pc : getPlayers()) pc.leaveMovieMode();
         break;
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
Beispiel #2
0
 /**
  * Shows a movie to the players in the lair.
  *
  * @param target - L2NpcInstance target is the center of this movie
  * @param dist - int distance from target
  * @param yaw - angle of movie (north = 90, south = 270, east = 0 , west = 180)
  * @param pitch - pitch > 0 looks up / pitch < 0 looks down
  * @param time - fast ++ or slow -- depends on the value
  * @param duration - How long to watch the movie
  * @param socialAction - 1,2,3,4 social actions / other values do nothing
  */
 private void showSocialActionMovie(
     NpcInstance target, int dist, int yaw, int pitch, int time, int duration, int socialAction) {
   if (target == null) return;
   for (Player pc : getPlayers())
     if (pc.getDistance(target) <= 2550) {
       pc.enterMovieMode();
       pc.specialCamera(target, dist, yaw, pitch, time, duration);
     } else pc.leaveMovieMode();
   if (socialAction > 0 && socialAction < 5)
     target.broadcastPacket(new SocialActionPacket(target.getObjectId(), socialAction));
 }
Beispiel #3
0
 @Override
 public void runImpl() throws Exception {
   try {
     switch (_taskId) {
       case 1:
         _angle =
             Math.abs(
                 (weakScarlet.getHeading() < 32768 ? 180 : 540)
                     - (int) (weakScarlet.getHeading() / 182.044444444));
         for (Player pc : getPlayers()) pc.enterMovieMode();
         blockAll(true);
         frintezza.broadcastPacket(new MagicSkillCanceled(frintezza.getObjectId()));
         frintezza.broadcastPacket(new SocialActionPacket(frintezza.getObjectId(), 4));
         ThreadPoolManager.getInstance().schedule(new ThirdMorph(2), 100);
         break;
       case 2:
         showSocialActionMovie(frintezza, 250, 120, 15, 0, 1000, 0);
         showSocialActionMovie(frintezza, 250, 120, 15, 0, 10000, 0);
         ThreadPoolManager.getInstance().schedule(new ThirdMorph(3), 6500);
         break;
       case 3:
         frintezza.broadcastPacket(new MagicSkillUse(frintezza, frintezza, 5006, 1, 34000, 0));
         showSocialActionMovie(frintezza, 500, 70, 15, 3000, 10000, 0);
         ThreadPoolManager.getInstance().schedule(new ThirdMorph(4), 3000);
         break;
       case 4:
         showSocialActionMovie(frintezza, 2500, 90, 12, 6000, 10000, 0);
         ThreadPoolManager.getInstance().schedule(new ThirdMorph(5), 3000);
         break;
       case 5:
         showSocialActionMovie(weakScarlet, 250, _angle, 12, 0, 1000, 0);
         showSocialActionMovie(weakScarlet, 250, _angle, 12, 0, 10000, 0);
         ThreadPoolManager.getInstance().schedule(new ThirdMorph(6), 500);
         break;
       case 6:
         weakScarlet.doDie(weakScarlet);
         showSocialActionMovie(weakScarlet, 450, _angle, 14, 8000, 8000, 0);
         ThreadPoolManager.getInstance().schedule(new ThirdMorph(7), 6250);
         break;
       case 7:
         NpcLocation loc = new NpcLocation();
         loc.set(weakScarlet.getLoc());
         loc.npcId = _strongScarletId;
         weakScarlet.deleteMe();
         weakScarlet = null;
         strongScarlet = spawn(loc);
         strongScarlet.addListener(_deathListener);
         block(strongScarlet, true);
         showSocialActionMovie(strongScarlet, 450, _angle, 12, 500, 14000, 2);
         ThreadPoolManager.getInstance().schedule(new ThirdMorph(9), 5000);
         break;
       case 9:
         blockAll(false);
         for (Player pc : getPlayers()) pc.leaveMovieMode();
         Skill skill = SkillTable.getInstance().getInfo(5017, 1);
         skill.getEffects(strongScarlet, strongScarlet, false, false);
         break;
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
 }