brounlimited

Frintezza Ai for aCis

Feb 11th, 2014
814
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 51.59 KB | None | 0 0
  1. /*
  2.  * This program is free software: you can redistribute it and/or modify it under
  3.  * the terms of the GNU General Public License as published by the Free Software
  4.  * Foundation, either version 3 of the License, or (at your option) any later
  5.  * version.
  6.  *
  7.  * This program is distributed in the hope that it will be useful, but WITHOUT
  8.  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9.  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10.  * details.
  11.  *
  12.  * You should have received a copy of the GNU General Public License along with
  13.  * this program. If not, see <http://www.gnu.org/licenses/>.
  14.  */
  15. package ai.individual;
  16.  
  17. import java.util.List;
  18.  
  19. import java.util.ArrayList;
  20. import net.sf.l2j.Config;
  21. import net.sf.l2j.gameserver.ai.CtrlIntention;
  22. import net.sf.l2j.gameserver.datatables.DoorTable;
  23. import net.sf.l2j.gameserver.datatables.SkillTable;
  24. import net.sf.l2j.gameserver.instancemanager.GrandBossManager;
  25. import net.sf.l2j.gameserver.model.L2CommandChannel;
  26. import net.sf.l2j.gameserver.model.L2Party;
  27. import net.sf.l2j.gameserver.model.L2Skill;
  28. import net.sf.l2j.gameserver.model.actor.L2Attackable;
  29. import net.sf.l2j.gameserver.model.actor.L2Character;
  30. import net.sf.l2j.gameserver.model.actor.L2Npc;
  31. import net.sf.l2j.gameserver.model.actor.instance.L2GrandBossInstance;
  32. import net.sf.l2j.gameserver.model.actor.instance.L2MonsterInstance;
  33. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  34. import net.sf.l2j.gameserver.model.zone.type.L2BossZone;
  35. import net.sf.l2j.gameserver.network.SystemMessageId;
  36. import net.sf.l2j.gameserver.network.serverpackets.Earthquake;
  37. import net.sf.l2j.gameserver.network.serverpackets.MagicSkillCanceld;
  38. import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
  39. import net.sf.l2j.gameserver.network.serverpackets.NpcSay;
  40. import net.sf.l2j.gameserver.network.serverpackets.PlaySound;
  41. import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
  42. import net.sf.l2j.gameserver.network.serverpackets.SpecialCamera;
  43. import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  44. import net.sf.l2j.gameserver.network.serverpackets.AbstractNpcInfo.NpcInfo;
  45. import net.sf.l2j.gameserver.skills.AbnormalEffect;
  46. import net.sf.l2j.gameserver.templates.StatsSet;
  47. import net.sf.l2j.util.Rnd;
  48. import ai.AbstractNpcAI;
  49.  
  50. public class Frintezza extends AbstractNpcAI
  51. {
  52.     private static final int[][] _invadeLoc =
  53.     {
  54.         { 174102, -76039, -5105 },
  55.         { 173235, -76884, -5105 },
  56.         { 175003, -76933, -5105 },
  57.         { 174196, -76190, -5105 },
  58.         { 174013, -76120, -5105 },
  59.         { 173263, -75161, -5105 }
  60.     };
  61.  
  62.     private static final int[][] _skill =
  63.     {
  64.         { 5015, 1, 5000 },
  65.         { 5015, 4, 5000 },
  66.         { 5015, 2, 5000 },
  67.         { 5015, 5, 5000 },
  68.         { 5018, 1, 10000 },
  69.         { 5016, 1, 5000 },
  70.         { 5015, 3, 5000 },
  71.         { 5015, 6, 5000 },
  72.         { 5018, 2, 10000 },
  73.         { 5019, 1, 10000 },
  74.         { 5016, 1, 5000 }
  75.     };
  76.  
  77.     private static final int[][] _mobLoc =
  78.     {
  79.         { 18328,172894,-76019,-5107,243 },
  80.         { 18328,174095,-77279,-5107,16216 },
  81.         { 18328,174111,-74833,-5107,49043 },
  82.         { 18328,175344,-76042,-5107,32847 },
  83.         { 18330,173489,-76227,-5134,63565 },
  84.         { 18330,173498,-75724,-5107,58498 },
  85.         { 18330,174365,-76745,-5107,22424 },
  86.         { 18330,174570,-75584,-5107,31968 },
  87.         { 18330,174613,-76179,-5107,31471 },
  88.         { 18332,173620,-75981,-5107,4588 },
  89.         { 18332,173630,-76340,-5107,62454 },
  90.         { 18332,173755,-75613,-5107,57892 },
  91.         { 18332,173823,-76688,-5107,2411 },
  92.         { 18332,174000,-75411,-5107,54718 },
  93.         { 18332,174487,-75555,-5107,33861 },
  94.         { 18332,174517,-76471,-5107,21893 },
  95.         { 18332,174576,-76122,-5107,31176 },
  96.         { 18332,174600,-75841,-5134,35927 },
  97.         { 18329,173481,-76043,-5107,61312 },
  98.         { 18329,173539,-75678,-5107,59524 },
  99.         { 18329,173584,-76386,-5107,3041 },
  100.         { 18329,173773,-75420,-5107,51115 },
  101.         { 18329,173777,-76650,-5107,12588 },
  102.         { 18329,174585,-76510,-5107,21704 },
  103.         { 18329,174623,-75571,-5107,40141 },
  104.         { 18329,174744,-76240,-5107,29202 },
  105.         { 18329,174769,-75895,-5107,29572 },
  106.         { 18333,173861,-76011,-5107,383 },
  107.         { 18333,173872,-76461,-5107,8041 },
  108.         { 18333,173898,-75668,-5107,51856 },
  109.         { 18333,174422,-75689,-5107,42878 },
  110.         { 18333,174460,-76355,-5107,27311 },
  111.         { 18333,174483,-76041,-5107,30947 },
  112.         { 18331,173515,-76184,-5107,6971 },
  113.         { 18331,173516,-75790,-5134,3142 },
  114.         { 18331,173696,-76675,-5107,6757 },
  115.         { 18331,173766,-75502,-5134,60827 },
  116.         { 18331,174473,-75321,-5107,37147 },
  117.         { 18331,174493,-76505,-5107,34503 },
  118.         { 18331,174568,-75654,-5134,41661 },
  119.         { 18331,174584,-76263,-5107,31729 },
  120.         { 18339,173892,-81592,-5123,50849 },
  121.         { 18339,173958,-81820,-5123,7459 },
  122.         { 18339,174128,-81805,-5150,21495 },
  123.         { 18339,174245,-81566,-5123,41760 },
  124.         { 18334,173264,-81529,-5072,1646 },
  125.         { 18334,173265,-81656,-5072,441 },
  126.         { 18334,173267,-81889,-5072,0 },
  127.         { 18334,173271,-82015,-5072,65382 },
  128.         { 18334,174867,-81655,-5073,32537 },
  129.         { 18334,174868,-81890,-5073,32768 },
  130.         { 18334,174869,-81485,-5073,32315 },
  131.         { 18334,174871,-82017,-5073,33007 },
  132.         { 18335,173074,-80817,-5107,8353 },
  133.         { 18335,173128,-82702,-5107,5345 },
  134.         { 18335,173181,-82544,-5107,65135 },
  135.         { 18335,173191,-80981,-5107,6947 },
  136.         { 18335,174859,-80889,-5134,24103 },
  137.         { 18335,174924,-82666,-5107,38710 },
  138.         { 18335,174947,-80733,-5107,22449 },
  139.         { 18335,175096,-82724,-5107,42205 },
  140.         { 18336,173435,-80512,-5107,65215 },
  141.         { 18336,173440,-82948,-5107,417 },
  142.         { 18336,173443,-83120,-5107,1094 },
  143.         { 18336,173463,-83064,-5107,286 },
  144.         { 18336,173465,-80453,-5107,174 },
  145.         { 18336,173465,-83006,-5107,2604 },
  146.         { 18336,173468,-82889,-5107,316 },
  147.         { 18336,173469,-80570,-5107,65353 },
  148.         { 18336,173469,-80628,-5107,166 },
  149.         { 18336,173492,-83121,-5107,394 },
  150.         { 18336,173493,-80683,-5107,0 },
  151.         { 18336,173497,-80510,-5134,417 },
  152.         { 18336,173499,-82947,-5107,0 },
  153.         { 18336,173521,-83063,-5107,316 },
  154.         { 18336,173523,-82889,-5107,128 },
  155.         { 18336,173524,-80627,-5134,65027 },
  156.         { 18336,173524,-83007,-5107,0 },
  157.         { 18336,173526,-80452,-5107,64735 },
  158.         { 18336,173527,-80569,-5134,65062 },
  159.         { 18336,174602,-83122,-5107,33104 },
  160.         { 18336,174604,-82949,-5107,33184 },
  161.         { 18336,174609,-80514,-5107,33234 },
  162.         { 18336,174609,-80684,-5107,32851 },
  163.         { 18336,174629,-80627,-5107,33346 },
  164.         { 18336,174632,-80570,-5107,32896 },
  165.         { 18336,174632,-83066,-5107,32768 },
  166.         { 18336,174635,-82893,-5107,33594 },
  167.         { 18336,174636,-80456,-5107,32065 },
  168.         { 18336,174639,-83008,-5107,33057 },
  169.         { 18336,174660,-80512,-5107,33057 },
  170.         { 18336,174661,-83121,-5107,32768 },
  171.         { 18336,174663,-82948,-5107,32768 },
  172.         { 18336,174664,-80685,-5107,32676 },
  173.         { 18336,174687,-83008,-5107,32520 },
  174.         { 18336,174691,-83066,-5107,32961 },
  175.         { 18336,174692,-80455,-5107,33202 },
  176.         { 18336,174692,-80571,-5107,32768 },
  177.         { 18336,174693,-80630,-5107,32994 },
  178.         { 18336,174693,-82889,-5107,32622 },
  179.         { 18337,172837,-82382,-5107,58363 },
  180.         { 18337,172867,-81123,-5107,64055 },
  181.         { 18337,172883,-82495,-5107,64764 },
  182.         { 18337,172916,-81033,-5107,7099 },
  183.         { 18337,172940,-82325,-5107,58998 },
  184.         { 18337,172946,-82435,-5107,58038 },
  185.         { 18337,172971,-81198,-5107,14768 },
  186.         { 18337,172992,-81091,-5107,9438 },
  187.         { 18337,173032,-82365,-5107,59041 },
  188.         { 18337,173064,-81125,-5107,5827 },
  189.         { 18337,175014,-81173,-5107,26398 },
  190.         { 18337,175061,-82374,-5107,43290 },
  191.         { 18337,175096,-81080,-5107,24719 },
  192.         { 18337,175169,-82453,-5107,37672 },
  193.         { 18337,175172,-80972,-5107,32315 },
  194.         { 18337,175174,-82328,-5107,41760 },
  195.         { 18337,175197,-81157,-5107,27617 },
  196.         { 18337,175245,-82547,-5107,40275 },
  197.         { 18337,175249,-81075,-5107,28435 },
  198.         { 18337,175292,-82432,-5107,42225 },
  199.         { 18338,173014,-82628,-5107,11874 },
  200.         { 18338,173033,-80920,-5107,10425 },
  201.         { 18338,173095,-82520,-5107,49152 },
  202.         { 18338,173115,-80986,-5107,9611 },
  203.         { 18338,173144,-80894,-5107,5345 },
  204.         { 18338,173147,-82602,-5107,51316 },
  205.         { 18338,174912,-80825,-5107,24270 },
  206.         { 18338,174935,-80899,-5107,18061 },
  207.         { 18338,175016,-82697,-5107,39533 },
  208.         { 18338,175041,-80834,-5107,25420 },
  209.         { 18338,175071,-82549,-5107,39163 },
  210.         { 18338,175154,-82619,-5107,36345 }
  211.     };
  212.  
  213.     private static final int SCARLET1 = 29046;
  214.     private static final int SCARLET2 = 29047;
  215.     private static final int FRINTEZZA = 29045;
  216.     private static final int GUIDE = 32011;
  217.     private static final int CUBE = 29061;
  218.  
  219.     //Frintezza Status Tracking :
  220.     private static final byte DORMANT = 0;      //Frintezza is spawned and no one has entered yet. Entry is unlocked
  221.     private static final byte WAITING = 1;      //Frintezza is spawend and someone has entered, triggering a 30 minute window for additional people to enter
  222.                                                 //before he unleashes his attack. Entry is unlocked
  223.     private static final byte FIGHTING = 2;     //Frintezza is engaged in battle, annihilating his foes. Entry is locked
  224.     private static final byte DEAD = 3;         //Frintezza has been killed. Entry is locked
  225.  
  226.     private static long _LastAction = 0;
  227.     private static int _Angle = 0;
  228.     private static int _Heading = 0;
  229.     private static int _LocCycle = 0;
  230.     private static int _Bomber = 0;
  231.     private static int _CheckDie = 0;
  232.     private static int _OnCheck = 0;
  233.     private static int _OnSong = 0;
  234.     private static int _Abnormal = 0;
  235.     private static int _OnMorph = 0;
  236.     private static int _Scarlet_x = 0;
  237.     private static int _Scarlet_y = 0;
  238.     private static int _Scarlet_z = 0;
  239.     private static int _Scarlet_h = 0;
  240.     private static int _SecondMorph = 0;
  241.     private static int _ThirdMorph = 0;
  242.     private static int _KillHallAlarmDevice = 0;
  243.     private static int _KillDarkChoirPlayer = 0;
  244.     private static int _KillDarkChoirCaptain = 0;
  245.  
  246.     private static L2BossZone _Zone;
  247.     private L2GrandBossInstance frintezza, weakScarlet, strongScarlet, activeScarlet;
  248.     private L2MonsterInstance demon1, demon2, demon3, demon4, portrait1, portrait2, portrait3, portrait4;
  249.     private L2Npc _frintezzaDummy, _overheadDummy, _portraitDummy1, _portraitDummy3, _scarletDummy;
  250.     private static List<L2PcInstance> _PlayersInside = new ArrayList<L2PcInstance>();
  251.     private static List<L2Npc> _Room1Mobs = new ArrayList<L2Npc>();
  252.     private static List<L2Npc> _Room2Mobs = new ArrayList<L2Npc>();
  253.     private static List<L2Attackable> Minions = new ArrayList<L2Attackable>();
  254.  
  255.     // Boss: Frintezza
  256.     public Frintezza(String name, String descr)
  257.     {
  258.         super(name, descr);
  259.         int[] mob = {SCARLET1, SCARLET2, FRINTEZZA, 18328, 18329, 18330, 18331, 18332, 18333, 18334, 18335, 18336, 18337, 18338, 18339, 29048, 29049, 29050, 29051};
  260.         _Zone = GrandBossManager.getZoneByXYZ(174232, -88020, -5116);
  261.         registerMobs(mob);
  262.         addStartNpc(GUIDE);
  263.         addTalkId(GUIDE);
  264.         addStartNpc(CUBE);
  265.         addTalkId(CUBE);
  266.         StatsSet info = GrandBossManager.getStatsSet(FRINTEZZA);
  267.         int status = GrandBossManager.getBossStatus(FRINTEZZA);
  268.         if (status == DEAD)
  269.         {
  270.             long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
  271.             if (temp > 0)
  272.                 startQuestTimer("frintezza_unlock", temp, null, null, false);
  273.             else
  274.                 GrandBossManager.setBossStatus(FRINTEZZA,DORMANT);
  275.         }
  276.         else if (status != DORMANT)
  277.             GrandBossManager.setBossStatus(FRINTEZZA,DORMANT);
  278.        
  279.         //tempfix for messed door cords
  280.         for (int i = 0; i < 8; i++)
  281.             DoorTable.getInstance().getDoor(25150051+i).setRange(0, 0, 0, 0, 0, 0);
  282.     }
  283.  
  284.     @Override
  285.     public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  286.     {
  287.         long temp = 0;
  288.         if (event.equalsIgnoreCase("waiting"))
  289.         {
  290.             startQuestTimer("close", 27000, npc, null, false);
  291.             startQuestTimer("camera_1", 30000, npc, null, false);
  292.             _Zone.broadcastPacket(new Earthquake(174232, -88020, -5116, 45, 27));
  293.         }
  294.         else if (event.equalsIgnoreCase("room1_spawn"))
  295.         {
  296.             for (int i = 0; i <= 17; i++)
  297.             {
  298.                 L2Npc mob = addSpawn(_mobLoc[i][0],_mobLoc[i][1],_mobLoc[i][2],_mobLoc[i][3],_mobLoc[i][4], false, 0, false);
  299.                 _Room1Mobs.add(mob);
  300.             }
  301.         }
  302.         else if (event.equalsIgnoreCase("room1_spawn2"))
  303.         {
  304.             for (int i = 18; i <= 26; i++)
  305.             {
  306.                 L2Npc mob = addSpawn(_mobLoc[i][0],_mobLoc[i][1],_mobLoc[i][2],_mobLoc[i][3],_mobLoc[i][4], false, 0, false);
  307.                 _Room1Mobs.add(mob);
  308.             }
  309.         }
  310.         else if (event.equalsIgnoreCase("room1_spawn3"))
  311.         {
  312.             for (int i = 27; i <= 32; i++)
  313.             {
  314.                 L2Npc mob = addSpawn(_mobLoc[i][0],_mobLoc[i][1],_mobLoc[i][2],_mobLoc[i][3],_mobLoc[i][4], false, 0, false);
  315.                 _Room1Mobs.add(mob);
  316.             }
  317.         }
  318.         else if (event.equalsIgnoreCase("room1_spawn4"))
  319.         {
  320.             for (int i = 33; i <= 40; i++)
  321.             {
  322.                 L2Npc mob = addSpawn(_mobLoc[i][0],_mobLoc[i][1],_mobLoc[i][2],_mobLoc[i][3],_mobLoc[i][4], false, 0, false);
  323.                 _Room1Mobs.add(mob);
  324.             }
  325.         }
  326.         else if (event.equalsIgnoreCase("room2_spawn"))
  327.         {
  328.             for (int i = 41; i <= 44; i++)
  329.             {
  330.                 L2Npc mob = addSpawn(_mobLoc[i][0],_mobLoc[i][1],_mobLoc[i][2],_mobLoc[i][3],_mobLoc[i][4], false, 0, false);
  331.                 _Room2Mobs.add(mob);
  332.             }
  333.         }
  334.         else if (event.equalsIgnoreCase("room2_spawn2"))
  335.         {
  336.             for (int i = 45; i <= 131; i++)
  337.             {
  338.                 L2Npc mob = addSpawn(_mobLoc[i][0],_mobLoc[i][1],_mobLoc[i][2],_mobLoc[i][3],_mobLoc[i][4], false, 0, false);
  339.                 _Room2Mobs.add(mob);
  340.             }
  341.         }
  342.         else if (event.equalsIgnoreCase("room1_del"))
  343.         {
  344.             for (L2Npc mob : _Room1Mobs)
  345.             {
  346.                 if (mob != null)
  347.                     mob.deleteMe();
  348.             }
  349.             _Room1Mobs.clear();
  350.         }
  351.         else if (event.equalsIgnoreCase("room2_del"))
  352.         {
  353.             for (L2Npc mob : _Room2Mobs)
  354.             {
  355.                 if (mob != null)
  356.                     mob.deleteMe();
  357.             }
  358.             _Room2Mobs.clear();
  359.         }
  360.         else if (event.equalsIgnoreCase("room3_del"))
  361.         {
  362.             if (demon1 != null)
  363.                 demon1.deleteMe();
  364.             if (demon2 != null)
  365.                 demon2.deleteMe();
  366.             if (demon3 != null)
  367.                 demon3.deleteMe();
  368.             if (demon4 != null)
  369.                 demon4.deleteMe();
  370.             if (portrait1 != null)
  371.                 portrait1.deleteMe();
  372.             if (portrait2 != null)
  373.                 portrait2.deleteMe();
  374.             if (portrait3 != null)
  375.                 portrait3.deleteMe();
  376.             if (portrait4 != null)
  377.                 portrait4.deleteMe();
  378.             if (frintezza != null)
  379.                 frintezza.deleteMe();
  380.             if (weakScarlet != null)
  381.                 weakScarlet.deleteMe();
  382.             if (strongScarlet != null)
  383.                 strongScarlet.deleteMe();
  384.  
  385.             demon1 = null;
  386.             demon2 = null;
  387.             demon3 = null;
  388.             demon4 = null;
  389.             portrait1 = null;
  390.             portrait2 = null;
  391.             portrait3 = null;
  392.             portrait4 = null;
  393.             frintezza = null;
  394.             weakScarlet = null;
  395.             strongScarlet = null;
  396.             activeScarlet = null;
  397.         }
  398.         else if (event.equalsIgnoreCase("clean"))
  399.         {
  400.             _LastAction = 0;
  401.             _LocCycle = 0;
  402.             _CheckDie = 0;
  403.             _OnCheck = 0;
  404.             _Abnormal = 0;
  405.             _OnMorph = 0;
  406.             _SecondMorph = 0;
  407.             _ThirdMorph = 0;
  408.             _KillHallAlarmDevice = 0;
  409.             _KillDarkChoirPlayer = 0;
  410.             _KillDarkChoirCaptain = 0;
  411.             _PlayersInside.clear();
  412.         }
  413.         else if (event.equalsIgnoreCase("close"))
  414.         {
  415.             for (int i = 25150051; i <= 25150058; i++)
  416.                 DoorTable.getInstance().getDoor(i).closeMe();
  417.             for (int i = 25150061; i <= 25150070; i++)
  418.                 DoorTable.getInstance().getDoor(i).closeMe();
  419.  
  420.             DoorTable.getInstance().getDoor(25150042).closeMe();
  421.             DoorTable.getInstance().getDoor(25150043).closeMe();
  422.             DoorTable.getInstance().getDoor(25150045).closeMe();
  423.             DoorTable.getInstance().getDoor(25150046).closeMe();
  424.         }
  425.         else if (event.equalsIgnoreCase("loc_check"))
  426.         {
  427.             if (GrandBossManager.getBossStatus(FRINTEZZA) == FIGHTING)
  428.             {
  429.                 if (!_Zone.isInsideZone(npc))
  430.                     npc.teleToLocation(174232,-88020,-5116,0);
  431.                 if (npc.getX() < 171932 || npc.getX() > 176532 || npc.getY() < -90320 || npc.getY() > -85720 || npc.getZ() < -5130)
  432.                     npc.teleToLocation(174232,-88020,-5116,0);
  433.             }
  434.         }
  435.         else if (event.equalsIgnoreCase("camera_1"))
  436.         {
  437.             GrandBossManager.setBossStatus(FRINTEZZA,FIGHTING);
  438.  
  439.             _frintezzaDummy = addSpawn(29052,174240,-89805,-5022,16048, false, 0, false);
  440.             _frintezzaDummy.setIsInvul(true);
  441.             _frintezzaDummy.setIsImmobilized(true);
  442.  
  443.             _overheadDummy = addSpawn(29052,174232,-88020,-5110,16384, false, 0, false);
  444.             _overheadDummy.setIsInvul(true);
  445.             _overheadDummy.setIsImmobilized(true);
  446.             _overheadDummy.setCollisionHeight(600);
  447.             _Zone.broadcastPacket(new NpcInfo(_overheadDummy, null));
  448.  
  449.             _portraitDummy1 = addSpawn(29052, 172450, -87890, -5100, 16048, false, 0, false);
  450.             _portraitDummy1.setIsImmobilized(true);
  451.             _portraitDummy1.setIsInvul(true);
  452.  
  453.             _portraitDummy3 = addSpawn(29052, 176012, -87890, -5100, 16048, false, 0, false);
  454.             _portraitDummy3.setIsImmobilized(true);
  455.             _portraitDummy3.setIsInvul(true);
  456.  
  457.             _scarletDummy = addSpawn(29053,174232,-88020,-5110,16384, false, 0, false);
  458.             _scarletDummy.setIsInvul(true);
  459.             _scarletDummy.setIsImmobilized(true);
  460.  
  461.             startQuestTimer("stop_pc", 0, npc, null, false);
  462.             startQuestTimer("camera_2", 1000, _overheadDummy, null, false);
  463.         }
  464.         else if (event.equalsIgnoreCase("camera_2"))
  465.         {
  466.             _Zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(),0, 75, -89, 0, 100,0,0,1,0));
  467.             startQuestTimer("camera_2b", 0, _overheadDummy, null, false);
  468.         }
  469.         else if (event.equalsIgnoreCase("camera_2b"))
  470.         {
  471.             _Zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(),0, 75, -89, 0, 100,0,0,1,0));
  472.             startQuestTimer("camera_3", 0, _overheadDummy, null, false);
  473.         }
  474.         else if (event.equalsIgnoreCase("camera_3"))
  475.         {
  476.             _Zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(),300, 90, -10, 6500, 7000,0,0,1,0));
  477.  
  478.             frintezza = (L2GrandBossInstance) addSpawn(FRINTEZZA, 174240, -89805, -5022, 16048, false, 0, false);
  479.             GrandBossManager.addBoss(frintezza);
  480.             frintezza.setIsImmobilized(true);
  481.             frintezza.setIsInvul(true);
  482.             frintezza.disableAllSkills();
  483.             _Zone.updateKnownList(frintezza);
  484.  
  485.             demon2 = (L2MonsterInstance) addSpawn(29051, 175876, -88713, -5100, 28205, false, 0, false);
  486.             demon2.setIsImmobilized(true);
  487.             demon2.disableAllSkills();
  488.             _Zone.updateKnownList(demon2);
  489.  
  490.             demon3 = (L2MonsterInstance) addSpawn(29051, 172608, -88702, -5100, 64817, false, 0, false);
  491.             demon3.setIsImmobilized(true);
  492.             demon3.disableAllSkills();
  493.             _Zone.updateKnownList(demon3);
  494.  
  495.             demon1 = (L2MonsterInstance) addSpawn(29050, 175833, -87165, -5100, 35048, false, 0, false);
  496.             demon1.setIsImmobilized(true);
  497.             demon1.disableAllSkills();
  498.             _Zone.updateKnownList(demon1);
  499.  
  500.             demon4 = (L2MonsterInstance) addSpawn(29050, 172634, -87165, -5100, 57730, false, 0, false);
  501.             demon4.setIsImmobilized(true);
  502.             demon4.disableAllSkills();
  503.             _Zone.updateKnownList(demon4);
  504.  
  505.             startQuestTimer("camera_4", 6500, _overheadDummy, null, false);
  506.         }
  507.         else if (event.equalsIgnoreCase("camera_4"))
  508.         {
  509.             _Zone.broadcastPacket(new SpecialCamera(_frintezzaDummy.getObjectId(),1800, 90, 8, 6500, 7000,0,0,1,0));
  510.             startQuestTimer("camera_5", 900, _frintezzaDummy, null, false);
  511.         }
  512.         else if (event.equalsIgnoreCase("camera_5"))
  513.         {
  514.             _Zone.broadcastPacket(new SpecialCamera(_frintezzaDummy.getObjectId(),140, 90, 10, 2500, 4500,0,0,1,0));
  515.             startQuestTimer("camera_5b", 4000, _frintezzaDummy, null, false);
  516.         }
  517.         else if (event.equalsIgnoreCase("camera_5b"))
  518.         {
  519.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),40, 75, -10, 0, 1000,0,0,1,0));
  520.             startQuestTimer("camera_6", 0, frintezza, null, false);
  521.         }
  522.         else if (event.equalsIgnoreCase("camera_6"))
  523.         {
  524.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),40, 75, -10, 0, 12000,0,0,1,0));
  525.             startQuestTimer("camera_7", 1350, frintezza, null, false);
  526.         }
  527.         else if (event.equalsIgnoreCase("camera_7"))
  528.         {
  529.             _Zone.broadcastPacket(new SocialAction(frintezza,2));
  530.             startQuestTimer("camera_8", 7000, frintezza, null, false);
  531.         }
  532.         else if (event.equalsIgnoreCase("camera_8"))
  533.         {
  534.             startQuestTimer("camera_9", 1000, frintezza, null, false);
  535.             _frintezzaDummy.deleteMe();
  536.             _frintezzaDummy = null;
  537.         }
  538.         else if (event.equalsIgnoreCase("camera_9"))
  539.         {
  540.             _Zone.broadcastPacket(new SocialAction(demon2,1));
  541.             _Zone.broadcastPacket(new SocialAction(demon3,1));
  542.             startQuestTimer("camera_9b", 400, frintezza, null, false);
  543.         }
  544.         else if (event.equalsIgnoreCase("camera_9b"))
  545.         {
  546.             _Zone.broadcastPacket(new SocialAction(demon1,1));
  547.             _Zone.broadcastPacket(new SocialAction(demon4,1));
  548.  
  549.             for (L2Character pc : _Zone.getCharactersInside())
  550.             {
  551.                 if (pc instanceof L2PcInstance)
  552.                 {
  553.                     if (pc.getX() < 174232)
  554.                         pc.broadcastPacket(new SpecialCamera(_portraitDummy1.getObjectId(),1000, 118, 0, 0, 1000,0,0,1,0));
  555.                     else
  556.                         pc.broadcastPacket(new SpecialCamera(_portraitDummy3.getObjectId(),1000, 62, 0, 0, 1000,0,0,1,0));
  557.                 }
  558.             }
  559.             startQuestTimer("camera_9c", 0, frintezza, null, false);
  560.         }
  561.         else if (event.equalsIgnoreCase("camera_9c"))
  562.         {
  563.             for (L2Character pc : _Zone.getCharactersInside())
  564.             {
  565.                 if (pc instanceof L2PcInstance)
  566.                 {
  567.                     if (pc.getX() < 174232)
  568.                         pc.broadcastPacket(new SpecialCamera(_portraitDummy1.getObjectId(),1000, 118, 0, 0, 10000,0,0,1,0));
  569.                     else
  570.                         pc.broadcastPacket(new SpecialCamera(_portraitDummy3.getObjectId(),1000, 62, 0, 0, 10000,0,0,1,0));
  571.                 }
  572.             }
  573.             startQuestTimer("camera_10", 2000, frintezza, null, false);
  574.         }
  575.         else if (event.equalsIgnoreCase("camera_10"))
  576.         {
  577.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),240, 90, 0, 0, 1000,0,0,1,0));
  578.             startQuestTimer("camera_11", 0, frintezza, null, false);
  579.         }
  580.         else if (event.equalsIgnoreCase("camera_11"))
  581.         {
  582.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),240, 90, 25, 5500, 10000,0,0,1,0));
  583.             _Zone.broadcastPacket(new SocialAction(frintezza,3));
  584.             _portraitDummy1.deleteMe();
  585.             _portraitDummy3.deleteMe();
  586.             _portraitDummy1 = null;
  587.             _portraitDummy3 = null;
  588.  
  589.             startQuestTimer("camera_12", 4500, frintezza, null, false);
  590.         }
  591.         else if (event.equalsIgnoreCase("camera_12"))
  592.         {
  593.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),100, 195, 35, 0, 10000,0,0,1,0));
  594.             startQuestTimer("camera_13", 700, frintezza, null, false);
  595.         }
  596.         else if (event.equalsIgnoreCase("camera_13"))
  597.         {
  598.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),100, 195, 35, 0, 10000,0,0,1,0));
  599.             startQuestTimer("camera_14", 1300, frintezza, null, false);
  600.         }
  601.         else if (event.equalsIgnoreCase("camera_14"))
  602.         {
  603.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),120, 180, 45, 1500, 10000,0,0,1,0));
  604.             _Zone.broadcastPacket(new MagicSkillUse(frintezza, frintezza, 5006, 1, 34000, 0));
  605.             startQuestTimer("camera_16", 1500, frintezza, null, false);
  606.         }
  607.         else if (event.equalsIgnoreCase("camera_16"))
  608.         {
  609.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),520, 135, 45, 8000, 10000,0,0,1,0));
  610.             startQuestTimer("camera_17", 7500, frintezza, null, false);
  611.         }
  612.         else if (event.equalsIgnoreCase("camera_17"))
  613.         {
  614.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),1500, 110, 25, 10000, 13000,0,0,1,0));
  615.             startQuestTimer("camera_18", 9500, frintezza, null, false);
  616.         }
  617.         else if (event.equalsIgnoreCase("camera_18"))
  618.         {
  619.             _Zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(),930, 160, -20, 0, 1000,0,0,1,0));
  620.             startQuestTimer("camera_18b", 0, _overheadDummy, null, false);
  621.         }
  622.         else if (event.equalsIgnoreCase("camera_18b"))
  623.         {
  624.             _Zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 600, 180, -25, 0, 10000,0,0,1,0));
  625.             _Zone.broadcastPacket(new MagicSkillUse(_scarletDummy,_overheadDummy, 5004, 1, 5800, 0));
  626.  
  627.             weakScarlet = (L2GrandBossInstance) addSpawn(29046, 174232, -88020, -5110, 16384, false, 0, true);
  628.             weakScarlet.setIsInvul(true);
  629.             weakScarlet.setIsImmobilized(true);
  630.             weakScarlet.disableAllSkills();
  631.             _Zone.updateKnownList(weakScarlet);
  632.             activeScarlet = weakScarlet;
  633.  
  634.             startQuestTimer("camera_19",  2400, _scarletDummy, null,false);
  635.             startQuestTimer("camera_19b", 5000, _scarletDummy, null,false);
  636.         }
  637.         else if (event.equalsIgnoreCase("camera_19"))
  638.         {
  639.             weakScarlet.teleToLocation(174232, -88020, -5110,0);
  640.         }
  641.         else if (event.equalsIgnoreCase("camera_19b"))
  642.         {
  643.             _Zone.broadcastPacket(new SpecialCamera(_scarletDummy.getObjectId(), 800, 180, 10, 1000, 10000,0,0,1,0));
  644.             startQuestTimer("camera_20", 2100, _scarletDummy, null,false);
  645.         }
  646.         else if (event.equalsIgnoreCase("camera_20"))
  647.         {
  648.             _Zone.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(),300, 60, 8, 0, 10000,0,0,1,0));
  649.             startQuestTimer("camera_21", 2000, weakScarlet, null,false);
  650.         }
  651.         else if (event.equalsIgnoreCase("camera_21"))
  652.         {
  653.             _Zone.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(),500, 90, 10, 3000, 5000,0,0,1,0));
  654.             startQuestTimer("camera_22", 3000, weakScarlet, null,false);
  655.         }
  656.         else if (event.equalsIgnoreCase("camera_22"))
  657.         {
  658.             portrait2 = (L2MonsterInstance) addSpawn(29049, 175876, -88713, -5000, 28205, false, 0, false);
  659.             portrait2.setIsImmobilized(true);
  660.             portrait2.disableAllSkills();
  661.             _Zone.updateKnownList(portrait2);
  662.  
  663.             portrait3 = (L2MonsterInstance) addSpawn(29049, 172608, -88702, -5000, 64817, false, 0, false);
  664.             portrait3.setIsImmobilized(true);
  665.             portrait3.disableAllSkills();
  666.             _Zone.updateKnownList(portrait3);
  667.  
  668.             portrait1 = (L2MonsterInstance) addSpawn(29048, 175833, -87165, -5000, 35048, false, 0, false);
  669.             portrait1.setIsImmobilized(true);
  670.             portrait1.disableAllSkills();
  671.             _Zone.updateKnownList(portrait1);
  672.  
  673.             portrait4 = (L2MonsterInstance) addSpawn(29048, 172634, -87165, -5000, 57730, false, 0, false);
  674.             portrait4.setIsImmobilized(true);
  675.             portrait4.disableAllSkills();
  676.             _Zone.updateKnownList(portrait4);
  677.  
  678.             _overheadDummy.deleteMe();
  679.             _scarletDummy.deleteMe();
  680.             _overheadDummy = null;
  681.             _scarletDummy = null;
  682.  
  683.             startQuestTimer("camera_23", 2000, weakScarlet, null,false);
  684.             startQuestTimer("start_pc", 2000, weakScarlet, null,false);
  685.             startQuestTimer("loc_check", 60000, weakScarlet, null, true);
  686.             startQuestTimer("songs_play", 10000 + Rnd.get(10000), frintezza, null,false);
  687.             startQuestTimer("skill01", 10000 + Rnd.get(10000), weakScarlet, null,false);
  688.         }
  689.         else if (event.equalsIgnoreCase("camera_23"))
  690.         {
  691.             demon1.setIsImmobilized(false);
  692.             demon2.setIsImmobilized(false);
  693.             demon3.setIsImmobilized(false);
  694.             demon4.setIsImmobilized(false);
  695.             demon1.enableAllSkills();
  696.             demon2.enableAllSkills();
  697.             demon3.enableAllSkills();
  698.             demon4.enableAllSkills();
  699.             portrait1.setIsImmobilized(false);
  700.             portrait2.setIsImmobilized(false);
  701.             portrait3.setIsImmobilized(false);
  702.             portrait4.setIsImmobilized(false);
  703.             portrait1.enableAllSkills();
  704.             portrait2.enableAllSkills();
  705.             portrait3.enableAllSkills();
  706.             portrait4.enableAllSkills();
  707.             weakScarlet.setIsInvul(false);
  708.             weakScarlet.setIsImmobilized(false);
  709.             weakScarlet.enableAllSkills();
  710.             weakScarlet.setRunning();
  711.  
  712.             startQuestTimer("spawn_minion", 20000, portrait1, null,false);
  713.             startQuestTimer("spawn_minion", 20000, portrait2, null,false);
  714.             startQuestTimer("spawn_minion", 20000, portrait3, null,false);
  715.             startQuestTimer("spawn_minion", 20000, portrait4, null,false);
  716.         }
  717.         else if (event.equalsIgnoreCase("stop_pc"))
  718.         {
  719.             for (L2Character cha : _Zone.getCharactersInside())
  720.             {
  721.                 cha.abortAttack();
  722.                 cha.abortCast();
  723.                 cha.disableAllSkills();
  724.                 cha.setTarget(null);
  725.                 cha.stopMove(null);
  726.                 cha.setIsImmobilized(true);
  727.                 cha.getAI().setIntention(CtrlIntention.IDLE);
  728.             }
  729.         }
  730.         else if (event.equalsIgnoreCase("stop_npc"))
  731.         {
  732.             _Heading = npc.getHeading();
  733.             if (_Heading < 32768)
  734.                 _Angle = Math.abs(180 - (int)(_Heading / 182.044444444));
  735.             else
  736.                 _Angle = Math.abs(540 - (int)(_Heading / 182.044444444));
  737.         }
  738.         else if (event.equalsIgnoreCase("start_pc"))
  739.         {
  740.             for (L2Character cha : _Zone.getCharactersInside())
  741.             {
  742.                 if (cha != frintezza)
  743.                 {
  744.                     cha.enableAllSkills();
  745.                     cha.setIsImmobilized(false);
  746.                 }
  747.             }
  748.         }
  749.         else if (event.equalsIgnoreCase("start_npc"))
  750.         {
  751.             npc.setRunning();
  752.             npc.setIsInvul(false);
  753.         }
  754.         else if (event.equalsIgnoreCase("morph_end"))
  755.         {
  756.             _OnMorph = 0;
  757.         }
  758.         else if (event.equalsIgnoreCase("morph_01"))
  759.         {
  760.             _Zone.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(),250, _Angle, 12, 2000, 15000,0,0,1,0));
  761.             startQuestTimer("morph_02", 3000, weakScarlet, null,false);
  762.         }
  763.         else if (event.equalsIgnoreCase("morph_02"))
  764.         {
  765.             _Zone.broadcastPacket(new SocialAction(weakScarlet,1));
  766.             weakScarlet.setRHandId(7903);
  767.             startQuestTimer("morph_03", 4000, weakScarlet, null,false);
  768.         }
  769.         else if (event.equalsIgnoreCase("morph_03"))
  770.         {
  771.             startQuestTimer("morph_04", 1500, weakScarlet, null,false);
  772.         }
  773.         else if (event.equalsIgnoreCase("morph_04"))
  774.         {
  775.             _Zone.broadcastPacket(new SocialAction(weakScarlet,4));
  776.             L2Skill skill = SkillTable.getInstance().getInfo(5017, 1);
  777.             if (skill != null)
  778.                 skill.getEffects(weakScarlet, weakScarlet);
  779.  
  780.             startQuestTimer("morph_end", 6000, weakScarlet, null,false);
  781.             startQuestTimer("start_pc", 3000, weakScarlet, null,false);
  782.             startQuestTimer("start_npc", 3000, weakScarlet, null,false);
  783.             startQuestTimer("songs_play", 10000 + Rnd.get(10000), frintezza, null,false);
  784.             startQuestTimer("skill02", 10000 + Rnd.get(10000), weakScarlet, null,false);
  785.         }
  786.         else if (event.equalsIgnoreCase("morph_05a"))
  787.         {
  788.             _Zone.broadcastPacket(new SocialAction(frintezza,4));
  789.         }
  790.         else if (event.equalsIgnoreCase("morph_05"))
  791.         {
  792.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),250, 120, 15, 0, 1000,0,0,1,0));
  793.             startQuestTimer("morph_06", 0, frintezza, null,false);
  794.         }
  795.         else if (event.equalsIgnoreCase("morph_06"))
  796.         {
  797.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),250, 120, 15, 0, 10000,0,0,1,0));
  798.  
  799.             cancelQuestTimers("loc_check");
  800.  
  801.             _Scarlet_x = weakScarlet.getX();
  802.             _Scarlet_y = weakScarlet.getY();
  803.             _Scarlet_z = weakScarlet.getZ();
  804.             _Scarlet_h = weakScarlet.getHeading();
  805.             weakScarlet.deleteMe();
  806.             weakScarlet = null;
  807.             activeScarlet = null;
  808.             weakScarlet = (L2GrandBossInstance) addSpawn(29046, _Scarlet_x, _Scarlet_y, _Scarlet_z, _Scarlet_h, false, 0, false);
  809.             weakScarlet.setIsInvul(true);
  810.             weakScarlet.setIsImmobilized(true);
  811.             weakScarlet.disableAllSkills();
  812.             weakScarlet.setRHandId(7903);
  813.             _Zone.updateKnownList(weakScarlet);
  814.  
  815.             startQuestTimer("morph_07", 7000, frintezza, null,false);
  816.         }
  817.         else if (event.equalsIgnoreCase("morph_07"))
  818.         {
  819.             _Zone.broadcastPacket(new MagicSkillUse(frintezza, frintezza, 5006, 1, 34000, 0));
  820.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),500, 70, 15, 3000, 10000,0,0,1,0));
  821.             startQuestTimer("morph_08", 3000, frintezza, null,false);
  822.         }
  823.         else if (event.equalsIgnoreCase("morph_08"))
  824.         {
  825.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),2500, 90, 12, 6000, 10000,0,0,1,0));
  826.             startQuestTimer("morph_09", 3000, frintezza, null,false);
  827.         }
  828.         else if (event.equalsIgnoreCase("morph_09"))
  829.         {
  830.             _Zone.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(),250, _Angle, 12, 0, 1000,0,0,1,0));
  831.             startQuestTimer("morph_10", 0, weakScarlet, null,false);
  832.         }
  833.         else if (event.equalsIgnoreCase("morph_10"))
  834.         {
  835.             _Zone.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(),250, _Angle, 12, 0, 10000,0,0,1,0));
  836.             startQuestTimer("morph_11", 500, weakScarlet, null,false);
  837.         }
  838.         else if (event.equalsIgnoreCase("morph_11"))
  839.         {
  840.             weakScarlet.doDie(weakScarlet);
  841.             _Zone.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(),450, _Angle, 14, 8000, 8000,0,0,1,0));
  842.  
  843.             startQuestTimer("morph_12", 6250, weakScarlet, null,false);
  844.             startQuestTimer("morph_13", 7200, weakScarlet, null,false);
  845.         }
  846.         else if (event.equalsIgnoreCase("morph_12"))
  847.         {
  848.             weakScarlet.deleteMe();
  849.             weakScarlet = null;
  850.         }
  851.         else if (event.equalsIgnoreCase("morph_13"))
  852.         {
  853.             strongScarlet = (L2GrandBossInstance) addSpawn(SCARLET2, _Scarlet_x, _Scarlet_y, _Scarlet_z, _Scarlet_h, false, 0, false);
  854.             strongScarlet.setIsInvul(true);
  855.             strongScarlet.setIsImmobilized(true);
  856.             strongScarlet.disableAllSkills();
  857.             _Zone.updateKnownList(strongScarlet);
  858.             activeScarlet = strongScarlet;
  859.  
  860.             _Zone.broadcastPacket(new SpecialCamera(strongScarlet.getObjectId(),450, _Angle, 12, 500, 14000,0,0,1,0));
  861.  
  862.             startQuestTimer("morph_14", 3000, strongScarlet, null,false);
  863.             startQuestTimer("loc_check", 60000, strongScarlet, null, true);
  864.         }
  865.         else if (event.equalsIgnoreCase("morph_14"))
  866.         {
  867.             startQuestTimer("morph_15", 5100, strongScarlet, null,false);
  868.         }
  869.         else if (event.equalsIgnoreCase("morph_15"))
  870.         {
  871.             _Zone.broadcastPacket(new SocialAction(strongScarlet,2));
  872.             L2Skill skill = SkillTable.getInstance().getInfo(5017, 1);
  873.             if (skill != null)
  874.                 skill.getEffects(strongScarlet, strongScarlet);
  875.  
  876.             startQuestTimer("morph_end", 9000, strongScarlet, null,false);
  877.             startQuestTimer("start_pc", 6000, strongScarlet, null,false);
  878.             startQuestTimer("start_npc", 6000, strongScarlet, null,false);
  879.             startQuestTimer("songs_play", 10000 + Rnd.get(10000), frintezza, null,false);
  880.             startQuestTimer("skill03", 10000 + Rnd.get(10000), strongScarlet, null,false);
  881.         }
  882.         else if (event.equalsIgnoreCase("morph_16"))
  883.         {
  884.             _Zone.broadcastPacket(new SpecialCamera(strongScarlet.getObjectId(),300, _Angle - 180 , 5, 0, 7000,0,0,1,0));
  885.             startQuestTimer("morph_17", 0, strongScarlet, null,false);
  886.         }
  887.         else if (event.equalsIgnoreCase("morph_17"))
  888.         {
  889.             _Zone.broadcastPacket(new SpecialCamera(strongScarlet.getObjectId(),200, _Angle, 85, 4000, 10000,0,0,1,0));
  890.             startQuestTimer("morph_17b", 7400, frintezza, null,false);
  891.             startQuestTimer("morph_18", 7500, frintezza, null,false);
  892.         }
  893.         else if (event.equalsIgnoreCase("morph_17b"))
  894.         {
  895.             frintezza.doDie(frintezza);
  896.         }
  897.         else if (event.equalsIgnoreCase("morph_18"))
  898.         {
  899.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),100, 120, 5, 0, 7000,0,0,1,0));
  900.             startQuestTimer("morph_19", 0, frintezza, null,false);
  901.         }
  902.         else if (event.equalsIgnoreCase("morph_19"))
  903.         {
  904.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),100, 90, 5, 5000, 15000,0,0,1,0));
  905.             startQuestTimer("morph_20", 7000, frintezza, null,false);
  906.             startQuestTimer("spawn_cubes", 7000, frintezza, null,false);
  907.         }
  908.         else if (event.equalsIgnoreCase("morph_20"))
  909.         {
  910.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),900, 90, 25, 7000, 10000,0,0,1,0));
  911.             startQuestTimer("start_pc", 7000, frintezza, null,false);
  912.         }
  913.         else if (event.equalsIgnoreCase("songs_play"))
  914.         {
  915.             if (frintezza != null && !frintezza.isDead() && _OnMorph == 0)
  916.             {
  917.                 _OnSong = Rnd.get(1, 5);
  918.                 if (_OnSong == 1 && _ThirdMorph == 1 && strongScarlet.getCurrentHp() < strongScarlet.getMaxHp() * 0.6 && Rnd.get(100) < 80)
  919.                 {
  920.                     _Zone.broadcastPacket(new MagicSkillUse(frintezza, frintezza, 5007, 1, 32000, 0));
  921.                     startQuestTimer("songs_effect", 5000, frintezza, null,false);
  922.                     startQuestTimer("songs_play", 32000 + Rnd.get(10000), frintezza, null,false);
  923.                 }
  924.                 else if (_OnSong == 2 || _OnSong == 3)
  925.                 {
  926.                     _Zone.broadcastPacket(new MagicSkillUse(frintezza, frintezza, 5007, _OnSong, 32000, 0));
  927.                     startQuestTimer("songs_effect", 5000, frintezza, null,false);
  928.                     startQuestTimer("songs_play", 32000 + Rnd.get(10000), frintezza, null,false);
  929.                 }
  930.                 else if (_OnSong == 4 && _SecondMorph == 1)
  931.                 {
  932.                     _Zone.broadcastPacket(new MagicSkillUse(frintezza, frintezza, 5007, 4, 31000, 0));
  933.                     startQuestTimer("songs_effect", 5000, frintezza, null,false);
  934.                     startQuestTimer("songs_play", 31000 + Rnd.get(10000), frintezza, null,false);
  935.                 }
  936.                 else if (_OnSong == 5 && _ThirdMorph == 1 && _Abnormal == 0)
  937.                 {
  938.                     _Abnormal = 1;
  939.                     _Zone.broadcastPacket(new MagicSkillUse(frintezza, frintezza, 5007, 5, 35000, 0));
  940.                     startQuestTimer("songs_effect", 5000, frintezza, null,false);
  941.                     startQuestTimer("songs_play", 35000 + Rnd.get(10000), frintezza, null,false);
  942.                 }
  943.                 else
  944.                     startQuestTimer("songs_play", 5000 + Rnd.get(5000), frintezza, null,false);
  945.             }
  946.         }
  947.         else if (event.equalsIgnoreCase("songs_effect"))
  948.         {
  949.             L2Skill skill = SkillTable.getInstance().getInfo(5008, _OnSong);
  950.             if (skill == null)
  951.                 return null;
  952.  
  953.             if (_OnSong == 1 || _OnSong == 2 || _OnSong == 3)
  954.             {
  955.                 if (frintezza != null && !frintezza.isDead() && activeScarlet != null && !activeScarlet.isDead())
  956.                     skill.getEffects(frintezza, activeScarlet);
  957.             }
  958.             else if (_OnSong == 4)
  959.             {
  960.                 for (L2Character cha : _Zone.getCharactersInside())
  961.                 {
  962.                     if (cha instanceof L2PcInstance && Rnd.get(100) < 80)
  963.                     {
  964.                         skill.getEffects(frintezza, cha);
  965.                         cha.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT).addSkillName(5008, 4));
  966.                     }
  967.                 }
  968.             }
  969.             else if (_OnSong == 5)
  970.             {
  971.                 for (L2Character cha : _Zone.getCharactersInside())
  972.                 {
  973.                     if (cha instanceof L2PcInstance && Rnd.get(100) < 70)
  974.                     {
  975.                         cha.abortAttack();
  976.                         cha.abortCast();
  977.                         cha.disableAllSkills();
  978.                         cha.stopMove(null);
  979.                         cha.setIsParalyzed(true);
  980.                         cha.setIsImmobilized(true);
  981.                         cha.getAI().setIntention(CtrlIntention.IDLE);
  982.                         skill.getEffects(frintezza, cha);
  983.                         cha.startAbnormalEffect(AbnormalEffect.DANCE_STUNNED);
  984.                         cha.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT).addSkillName(5008, 5));
  985.                     }
  986.                 }
  987.                 startQuestTimer("stop_effect", 25000, frintezza, null,false);
  988.             }
  989.         }
  990.         else if (event.equalsIgnoreCase("stop_effect"))
  991.         {
  992.             for (L2Character cha : _Zone.getCharactersInside())
  993.             {
  994.                 if (cha instanceof L2PcInstance)
  995.                 {
  996.                     cha.stopAbnormalEffect(AbnormalEffect.DANCE_STUNNED);
  997.                     cha.stopAbnormalEffect(AbnormalEffect.FLOATING_ROOT);
  998.                     cha.enableAllSkills();
  999.                     cha.setIsImmobilized(false);
  1000.                     cha.setIsParalyzed(false);
  1001.                 }
  1002.             }
  1003.             _Abnormal = 0;
  1004.         }
  1005.         else if (event.equalsIgnoreCase("attack_stop"))
  1006.         {
  1007.             cancelQuestTimers("skill01");
  1008.             cancelQuestTimers("skill02");
  1009.             cancelQuestTimers("skill03");
  1010.             cancelQuestTimers("songs_play");
  1011.             cancelQuestTimers("songs_effect");
  1012.  
  1013.             _Zone.broadcastPacket(new MagicSkillCanceld(frintezza.getObjectId()));
  1014.         }
  1015.         else if (event.equalsIgnoreCase("check_hp"))
  1016.         {
  1017.             if (npc.isDead())
  1018.             {
  1019.                 _OnMorph = 1;
  1020.                 _Zone.broadcastPacket(new PlaySound(1, "BS01_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
  1021.  
  1022.                 startQuestTimer("attack_stop", 0, frintezza, null,false);
  1023.                 startQuestTimer("stop_pc", 0, npc, null,false);
  1024.                 startQuestTimer("stop_npc", 0, npc, null,false);
  1025.                 startQuestTimer("morph_16", 0, npc, null,false);
  1026.             }
  1027.             else
  1028.             {
  1029.                 _CheckDie = _CheckDie + 10;
  1030.                 if (_CheckDie < 3000)
  1031.                     startQuestTimer("check_hp", 10, npc, null,false);
  1032.                 else
  1033.                 {
  1034.                     _OnCheck = 0;
  1035.                     _CheckDie = 0;
  1036.                 }
  1037.             }
  1038.         }
  1039.         else if (event.equalsIgnoreCase("skill01"))
  1040.         {
  1041.             if (weakScarlet != null && !weakScarlet.isDead() && _SecondMorph == 0 && _ThirdMorph == 0 && _OnMorph == 0)
  1042.             {
  1043.                 int i = Rnd.get(0,1);
  1044.                 L2Skill skill = SkillTable.getInstance().getInfo(_skill[i][0],_skill[i][1]);
  1045.                 if (skill != null)
  1046.                 {
  1047.                     weakScarlet.stopMove(null);
  1048.                     weakScarlet.setIsCastingNow(true);
  1049.                     weakScarlet.doCast(skill);
  1050.                 }
  1051.                 startQuestTimer("skill01", _skill[i][2] + 5000 + Rnd.get(10000), npc, null,false);
  1052.             }
  1053.         }
  1054.         else if (event.equalsIgnoreCase("skill02"))
  1055.         {
  1056.             if (weakScarlet != null && !weakScarlet.isDead() && _SecondMorph == 1 && _ThirdMorph == 0 && _OnMorph == 0)
  1057.             {
  1058.                 int i = 0;
  1059.                 if (_Abnormal == 0)
  1060.                     i = Rnd.get(2,5);
  1061.                 else
  1062.                     i = Rnd.get(2,4);
  1063.  
  1064.                 L2Skill skill = SkillTable.getInstance().getInfo(_skill[i][0],_skill[i][1]);
  1065.                 if (skill != null)
  1066.                 {
  1067.                     weakScarlet.stopMove(null);
  1068.                     weakScarlet.setIsCastingNow(true);
  1069.                     weakScarlet.doCast(skill);
  1070.                 }
  1071.                 startQuestTimer("skill02", _skill[i][2] + 5000 + Rnd.get(10000), npc, null,false);
  1072.  
  1073.                 if (i == 5)
  1074.                 {
  1075.                     _Abnormal = 1;
  1076.                     startQuestTimer("float_effect", 4000, weakScarlet, null,false);
  1077.                 }
  1078.             }
  1079.         }
  1080.         else if (event.equalsIgnoreCase("skill03"))
  1081.         {
  1082.             if (strongScarlet != null && !strongScarlet.isDead() && _SecondMorph == 1 && _ThirdMorph == 1 && _OnMorph == 0)
  1083.             {
  1084.                 int i = 0;
  1085.                 if (_Abnormal == 0)
  1086.                     i = Rnd.get(6,10);
  1087.                 else
  1088.                     i = Rnd.get(6,9);
  1089.  
  1090.                 L2Skill skill = SkillTable.getInstance().getInfo(_skill[i][0],_skill[i][1]);
  1091.                 if (skill != null)
  1092.                 {
  1093.                     strongScarlet.stopMove(null);
  1094.                     strongScarlet.setIsCastingNow(true);
  1095.                     strongScarlet.doCast(skill);
  1096.                 }
  1097.                 startQuestTimer("skill03", _skill[i][2] + 5000 + Rnd.get(10000), npc, null,false);
  1098.  
  1099.                 if (i == 10)
  1100.                 {
  1101.                     _Abnormal = 1;
  1102.                     startQuestTimer("float_effect", 3000, npc, null,false);
  1103.                 }
  1104.             }
  1105.         }
  1106.         else if (event.equalsIgnoreCase("float_effect"))
  1107.         {
  1108.             if (npc.isCastingNow())
  1109.             {
  1110.                 startQuestTimer("float_effect", 500, npc, null,false);
  1111.             }
  1112.             else
  1113.             {
  1114.                 for (L2Character cha : _Zone.getCharactersInside())
  1115.                 {
  1116.                     if (cha instanceof L2PcInstance)
  1117.                     {
  1118.                         if (cha.getFirstEffect(5016) != null)
  1119.                         {
  1120.                             cha.abortAttack();
  1121.                             cha.abortCast();
  1122.                             cha.disableAllSkills();
  1123.                             cha.stopMove(null);
  1124.                             cha.setIsParalyzed(true);
  1125.                             cha.setIsImmobilized(true);
  1126.                             cha.getAI().setIntention(CtrlIntention.IDLE);
  1127.                             cha.startAbnormalEffect(AbnormalEffect.FLOATING_ROOT);
  1128.                         }
  1129.                     }
  1130.                 }
  1131.                 startQuestTimer("stop_effect", 25000, npc, null,false);
  1132.             }
  1133.         }
  1134.         else if (event.equalsIgnoreCase("action"))
  1135.         {
  1136.             _Zone.broadcastPacket(new SocialAction(npc,1));
  1137.         }
  1138.         else if (event.equalsIgnoreCase("bomber"))
  1139.         {
  1140.             _Bomber = 0;
  1141.         }
  1142.         else if (event.equalsIgnoreCase("room_final"))
  1143.         {
  1144.             _Zone.broadcastPacket(new NpcSay(npc.getObjectId(),1,npc.getNpcId(),"Exceeded his time limit, challenge failed!"));
  1145.             _Zone.oustAllPlayers();
  1146.  
  1147.             cancelQuestTimers("waiting");
  1148.             cancelQuestTimers("frintezza_despawn");
  1149.             startQuestTimer("clean", 1000, npc, null,false);
  1150.             startQuestTimer("close", 1000, npc, null,false);
  1151.             startQuestTimer("room1_del", 1000, npc, null,false);
  1152.             startQuestTimer("room2_del", 1000, npc, null,false);
  1153.  
  1154.             GrandBossManager.setBossStatus(FRINTEZZA,DORMANT);
  1155.         }
  1156.         else if (event.equalsIgnoreCase("frintezza_despawn"))
  1157.         {
  1158.             temp = (System.currentTimeMillis() - _LastAction);
  1159.             if (temp > 900000)
  1160.             {
  1161.                 _Zone.oustAllPlayers();
  1162.  
  1163.                 cancelQuestTimers("waiting");
  1164.                 cancelQuestTimers("loc_check");
  1165.                 cancelQuestTimers("room_final");
  1166.                 cancelQuestTimers("spawn_minion");
  1167.                 startQuestTimer("clean", 1000, npc, null,false);
  1168.                 startQuestTimer("close", 1000, npc, null,false);
  1169.                 startQuestTimer("attack_stop", 1000, npc, null,false);
  1170.                 startQuestTimer("room1_del", 1000, npc, null,false);
  1171.                 startQuestTimer("room2_del", 1000, npc, null,false);
  1172.                 startQuestTimer("room3_del", 1000, npc, null,false);
  1173.                 startQuestTimer("minions_despawn", 1000, npc, null,false);
  1174.  
  1175.                 GrandBossManager.setBossStatus(FRINTEZZA,DORMANT);
  1176.  
  1177.                 cancelQuestTimers("frintezza_despawn");
  1178.             }
  1179.         }
  1180.         else if (event.equalsIgnoreCase("minions_despawn"))
  1181.         {
  1182.             for (int i = 0; i < Minions.size(); i++)
  1183.             {
  1184.                 L2Attackable mob = Minions.get(i);
  1185.                 if (mob != null)
  1186.                     mob.decayMe();
  1187.             }
  1188.             Minions.clear();
  1189.         }
  1190.         else if (event.equalsIgnoreCase("spawn_minion"))
  1191.         {
  1192.             if (npc != null && !npc.isDead() && frintezza != null && !frintezza.isDead())
  1193.             {
  1194.                 L2Npc mob = addSpawn(npc.getNpcId()+2,npc.getX(),npc.getY(),npc.getZ(),npc.getHeading(), false, 0, false);
  1195.                 ((L2Attackable)mob).setIsRaidMinion(true);
  1196.                 Minions.add((L2Attackable)mob);
  1197.                 startQuestTimer("action", 200, mob, null,false);
  1198.                 startQuestTimer("spawn_minion", 18000, npc, null,false);
  1199.             }
  1200.         }
  1201.         else if (event.equalsIgnoreCase("spawn_cubes"))
  1202.         {
  1203.             addSpawn(CUBE, 174232, -88020, -5114, 16384, false, 900000, false);
  1204.         }
  1205.         else if (event.equalsIgnoreCase("frintezza_unlock"))
  1206.         {
  1207.             GrandBossManager.setBossStatus(FRINTEZZA,DORMANT);
  1208.         }
  1209.         else if (event.equalsIgnoreCase("remove_players"))
  1210.         {
  1211.             _Zone.oustAllPlayers();
  1212.         }
  1213.  
  1214.         return super.onAdvEvent(event, npc, player);
  1215.     }
  1216.  
  1217.     @Override
  1218.     public String onTalk (L2Npc npc, L2PcInstance player)
  1219.     {
  1220.         if (npc.getNpcId() == CUBE)
  1221.         {
  1222.             int x = 150037 + Rnd.get(500);
  1223.             int y = -57720 + Rnd.get(500);
  1224.             player.teleToLocation(x, y, -2976,0);
  1225.             return null;
  1226.         }
  1227.  
  1228.         String htmltext = "";
  1229.         if (GrandBossManager.getBossStatus(FRINTEZZA) == DEAD)
  1230.         {
  1231.             htmltext = "<html><body>There is nothing beyond the Magic Force Field. Come back later.<br>(You may not enter because Frintezza is not inside the Imperial Tomb.)</body></html>";
  1232.         }
  1233.         else if (GrandBossManager.getBossStatus(FRINTEZZA) == DORMANT)
  1234.         {
  1235.             if ((!player.isInParty() || !player.getParty().isLeader(player))
  1236.                 || (player.getParty().getCommandChannel() == null)
  1237.                 || (player.getParty().getCommandChannel().getChannelLeader() != player))
  1238.             {
  1239.                 htmltext = "<html><body>No reaction. Contact must be initiated by the Command Channel Leader.</body></html>";
  1240.             }
  1241.             else if (player.getParty().getCommandChannel().getPartys().size() < 4 || player.getParty().getCommandChannel().getPartys().size() > 5)
  1242.             {
  1243.                 htmltext = "<html><body>Your command channel needs to have at least 4 parties and a maximum of 5.</body></html>";
  1244.             }
  1245.             else if (player.getInventory().getItemByItemId(8073) == null)
  1246.             {
  1247.                 htmltext = "<html><body>You dont have required item.</body></html>";
  1248.             }
  1249.             else
  1250.             {
  1251.                 player.destroyItemByItemId("Quest", 8073, 1, player, true);
  1252.                 L2CommandChannel CC = player.getParty().getCommandChannel();
  1253.                 GrandBossManager.setBossStatus(FRINTEZZA, WAITING);
  1254.  
  1255.                 startQuestTimer("close", 0, npc, null,false);
  1256.                 startQuestTimer("room1_spawn", 5000, npc, null,false);
  1257.                 startQuestTimer("room_final", 2100000, npc, null,false);
  1258.                 startQuestTimer("frintezza_despawn", 60000, npc, null, true);
  1259.  
  1260.                 _LastAction = System.currentTimeMillis();
  1261.                 for (L2Party party : CC.getPartys())
  1262.                 {
  1263.                     if (party == null)
  1264.                         continue;
  1265.                     for (L2PcInstance member : party.getPartyMembers())
  1266.                     {
  1267.                         if (member == null || member.getLevel() < 74)
  1268.                             continue;
  1269.                         if (!member.isInsideRadius(npc, 700, false, false))
  1270.                             continue;
  1271.                         if (_PlayersInside.size() > 45)
  1272.                         {
  1273.                             member.sendMessage("The number of challenges have been full, so can not enter.");
  1274.                             break;
  1275.                         }
  1276.                         _PlayersInside.add(member);
  1277.                         _Zone.allowPlayerEntry(member, 300);
  1278.                         member.teleToLocation(_invadeLoc[_LocCycle][0] + Rnd.get(50), _invadeLoc[_LocCycle][1] + Rnd.get(50), _invadeLoc[_LocCycle][2],0);
  1279.                     }
  1280.                     if (_PlayersInside.size() > 45)
  1281.                         break;
  1282.  
  1283.                     _LocCycle++;
  1284.                     if (_LocCycle >= 6)
  1285.                         _LocCycle = 1;
  1286.                 }
  1287.             }
  1288.         }
  1289.         else
  1290.             htmltext = "<html><body>Someone else is already inside the Magic Force Field. Try again later.</body></html>";
  1291.  
  1292.         return htmltext;
  1293.     }
  1294.  
  1295.     @Override
  1296.     public String onAttack (L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
  1297.     {
  1298.         _LastAction = System.currentTimeMillis();
  1299.         if (npc.getNpcId() == FRINTEZZA)
  1300.         {
  1301.             npc.setCurrentHpMp(npc.getMaxHp(), 0);
  1302.             return null;
  1303.         }
  1304.         if (npc.getNpcId() == SCARLET1 && _SecondMorph == 0 && _ThirdMorph == 0 && _OnMorph == 0 && npc.getCurrentHp() < npc.getMaxHp() * 0.75 && GrandBossManager.getBossStatus(FRINTEZZA) == FIGHTING)
  1305.         {
  1306.             startQuestTimer("attack_stop", 0, frintezza, null,false);
  1307.  
  1308.             _SecondMorph = 1;
  1309.             _OnMorph = 1;
  1310.  
  1311.             startQuestTimer("stop_pc", 1000, npc, null,false);
  1312.             startQuestTimer("stop_npc", 1000, npc, null,false);
  1313.             startQuestTimer("morph_01", 1100, npc, null,false);
  1314.         }
  1315.         else if (npc.getNpcId() == SCARLET1 && _SecondMorph == 1 && _ThirdMorph == 0 && _OnMorph == 0 && npc.getCurrentHp() < npc.getMaxHp() * 0.5 && GrandBossManager.getBossStatus(FRINTEZZA) == FIGHTING)
  1316.         {
  1317.             startQuestTimer("attack_stop", 0, frintezza, null,false);
  1318.            
  1319.             _ThirdMorph = 1;
  1320.             _OnMorph = 1;
  1321.  
  1322.             startQuestTimer("stop_pc", 2000, npc, null,false);
  1323.             startQuestTimer("stop_npc", 2000, npc, null,false);
  1324.             startQuestTimer("morph_05a", 2000, npc, null,false);
  1325.             startQuestTimer("morph_05", 2100, npc, null,false);
  1326.         }
  1327.         else if (npc.getNpcId() == SCARLET2 && _SecondMorph == 1 && _ThirdMorph == 1 && _OnCheck == 0 && damage >= npc.getCurrentHp() && GrandBossManager.getBossStatus(FRINTEZZA) == FIGHTING)
  1328.         {
  1329.             _OnCheck = 1;
  1330.             startQuestTimer("check_hp", 0, npc, null,false);
  1331.         }
  1332.         else if ((npc.getNpcId() == 29050 || npc.getNpcId() == 29051) && _Bomber == 0)
  1333.         {
  1334.             if (npc.getCurrentHp() < npc.getMaxHp() * 0.1)
  1335.             {
  1336.                 if (Rnd.get(100) < 30)
  1337.                 {
  1338.                     _Bomber = 1;
  1339.                     startQuestTimer("bomber", 3000, npc, null,false);
  1340.  
  1341.                     L2Skill skill = SkillTable.getInstance().getInfo(5011,1);
  1342.                     if (skill != null)
  1343.                     {
  1344.                         npc.setIsCastingNow(true);
  1345.                         npc.doCast(skill);
  1346.                     }
  1347.                 }
  1348.             }
  1349.         }
  1350.  
  1351.         return super.onAttack(npc, attacker, damage, isPet);
  1352.     }
  1353.  
  1354.     @Override
  1355.     public String onKill (L2Npc npc, L2PcInstance killer, boolean isPet)
  1356.     {
  1357.         if (npc.getNpcId() == FRINTEZZA)
  1358.         {
  1359.             return null;
  1360.         }
  1361.         else if (npc.getNpcId() == SCARLET2 && _OnCheck == 0 && GrandBossManager.getBossStatus(FRINTEZZA) == FIGHTING)
  1362.         {
  1363.             _OnCheck = 1;
  1364.             startQuestTimer("stop_pc", 0, npc, null,false);
  1365.             startQuestTimer("stop_npc", 0, npc, null,false);
  1366.             startQuestTimer("morph_16", 0, npc, null,false);
  1367.         }
  1368.         else if (npc.getNpcId() == SCARLET2 && _OnCheck == 1 && GrandBossManager.getBossStatus(FRINTEZZA) == FIGHTING)
  1369.         {
  1370.             cancelQuestTimers("loc_check");
  1371.             cancelQuestTimers("spawn_minion");
  1372.             cancelQuestTimers("frintezza_despawn");
  1373.             startQuestTimer("clean", 30000, npc, null,false);
  1374.             startQuestTimer("close", 30000, npc, null,false);
  1375.             startQuestTimer("room3_del", 60000, npc, null,false);
  1376.             startQuestTimer("minions_despawn", 60000, npc, null,false);
  1377.             startQuestTimer("remove_players", 900000, npc, null,false);
  1378.  
  1379.             GrandBossManager.setBossStatus(FRINTEZZA,DEAD);
  1380.             long respawnTime = (long) Config.SPAWN_INTERVAL_CORE + Rnd.get(-Config.RANDOM_SPAWN_TIME_CORE, Config.RANDOM_SPAWN_TIME_CORE);
  1381.             startQuestTimer("frintezza_unlock", respawnTime, npc, null,false);
  1382.             // also save the respawn time so that the info is maintained past reboots
  1383.             StatsSet info = GrandBossManager.getStatsSet(FRINTEZZA);
  1384.             info.set("respawn_time", System.currentTimeMillis() + respawnTime);
  1385.             GrandBossManager.setStatsSet(FRINTEZZA, info);
  1386.         }
  1387.         else if (npc.getNpcId() == 18328)
  1388.         {
  1389.             _KillHallAlarmDevice++;
  1390.             if (_KillHallAlarmDevice == 4)
  1391.             {
  1392.                 startQuestTimer("room1_del", 100, npc, null,false);
  1393.                 startQuestTimer("room2_spawn", 100, npc, null,false);
  1394.                 DoorTable.getInstance().getDoor(25150042).openMe();
  1395.                 DoorTable.getInstance().getDoor(25150043).openMe();
  1396.                 for (int i = 25150051; i <= 25150058; i++)
  1397.                     DoorTable.getInstance().getDoor(i).openMe();
  1398.             }
  1399.         }
  1400.         else if (npc.getNpcId() == 18339)
  1401.         {
  1402.             _KillDarkChoirPlayer ++;
  1403.             if (_KillDarkChoirPlayer == 2)
  1404.             {
  1405.                 DoorTable.getInstance().getDoor(25150042).closeMe();
  1406.                 DoorTable.getInstance().getDoor(25150043).closeMe();
  1407.                 DoorTable.getInstance().getDoor(25150045).closeMe();
  1408.                 DoorTable.getInstance().getDoor(25150046).closeMe();
  1409.                 int outside = 0;
  1410.                 for (L2PcInstance room2_pc : _PlayersInside)
  1411.                 {
  1412.                     if (_Zone.isInsideZone(room2_pc) && room2_pc.getY() > -86130)
  1413.                         outside++;
  1414.                 }
  1415.                 if (outside == 0)
  1416.                 {
  1417.                     startQuestTimer("room2_del", 100, npc, null,false);
  1418.                     startQuestTimer("waiting", 180000, npc, null,false);
  1419.                     cancelQuestTimers("room_final");
  1420.                 }
  1421.                 else
  1422.                 {
  1423.                     for (int i = 25150061; i <= 25150070; i++)
  1424.                         DoorTable.getInstance().getDoor(i).openMe();
  1425.  
  1426.                     startQuestTimer("room2_spawn2", 1000, npc, null,false);
  1427.                 }
  1428.             }
  1429.         }
  1430.         else if (npc.getNpcId() == 18334)
  1431.         {
  1432.             _KillDarkChoirCaptain ++;
  1433.             if (_KillDarkChoirCaptain == 8)
  1434.             {
  1435.                 startQuestTimer("room2_del", 100, npc, null,false);
  1436.  
  1437.                 DoorTable.getInstance().getDoor(25150045).openMe();
  1438.                 DoorTable.getInstance().getDoor(25150046).openMe();
  1439.  
  1440.                 startQuestTimer("waiting", 180000, npc, null,false);
  1441.                 cancelQuestTimers("room_final");
  1442.             }
  1443.         }
  1444.  
  1445.         return super.onKill(npc,killer,isPet);
  1446.     }
  1447.  
  1448.     public static void main(String[] args)
  1449.     {
  1450.         // now call the constructor (starts up the ai)
  1451.         new Frintezza("Frintezza","ai");
  1452.     }
  1453. }
Advertisement
Add Comment
Please, Sign In to add comment