Advertisement
Guest User

Untitled

a guest
Jun 8th, 2021
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 88.05 KB | None | 0 0
  1.  
  2. /*
  3.  * This program is free software: you can redistribute it and/or modify it under
  4.  * the terms of the GNU General Public License as published by the Free Software
  5.  * Foundation, either version 3 of the License, or (at your option) any later
  6.  * version.
  7.  * 
  8.  * This program is distributed in the hope that it will be useful, but WITHOUT
  9.  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  10.  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  11.  * details.
  12.  * 
  13.  * You should have received a copy of the GNU General Public License along with
  14.  * this program. If not, see <http://www.gnu.org/licenses/>.
  15.  */
  16. package net.sf.game.ai.additional;
  17.  
  18. import java.text.DateFormat;
  19. import java.text.SimpleDateFormat;
  20. import java.util.Calendar;
  21. import java.util.Date;
  22. import java.util.GregorianCalendar;
  23. import java.util.List;
  24.  
  25. import javolution.util.FastList;
  26. import net.sf.Config;
  27. import net.sf.game.ai.CtrlIntention;
  28. import net.sf.game.datatables.SkillTable;
  29. import net.sf.game.datatables.csv.DoorTable;
  30. import net.sf.game.managers.GrandBossManager;
  31. import net.sf.game.model.L2Attackable;
  32. import net.sf.game.model.L2Character;
  33. import net.sf.game.model.L2CommandChannel;
  34. import net.sf.game.model.L2Party;
  35. import net.sf.game.model.L2Skill;
  36. import net.sf.game.model.actor.instance.L2GrandBossInstance;
  37. import net.sf.game.model.actor.instance.L2MonsterInstance;
  38. import net.sf.game.model.actor.instance.L2NpcInstance;
  39. import net.sf.game.model.actor.instance.L2PcInstance;
  40. import net.sf.game.model.entity.Announcements;
  41. import net.sf.game.model.quest.Quest;
  42. import net.sf.game.model.zone.type.L2BossZone;
  43. import net.sf.game.network.SystemMessageId;
  44. import net.sf.game.network.serverpackets.CreatureSay;
  45. import net.sf.game.network.serverpackets.Earthquake;
  46. import net.sf.game.network.serverpackets.ExShowScreenMessage;
  47. import net.sf.game.network.serverpackets.MagicSkillCanceld;
  48. import net.sf.game.network.serverpackets.MagicSkillUser;
  49. import net.sf.game.network.serverpackets.NpcInfo;
  50. import net.sf.game.network.serverpackets.PlaySound;
  51. import net.sf.game.network.serverpackets.SocialAction;
  52. import net.sf.game.network.serverpackets.SpecialCamera;
  53. import net.sf.game.network.serverpackets.SystemMessage;
  54. import net.sf.game.templates.StatsSet;
  55. import net.sf.log.Log;
  56. import net.sf.util.random.Rnd;
  57.  
  58. public class Frintezza extends Quest implements Runnable
  59. {
  60.     private final SimpleDateFormat date = new SimpleDateFormat("H:mm:ss yyyy/MM/dd");
  61.     
  62.     private static final int[][] _invadeLoc =
  63.     {
  64.         {
  65.             174102,
  66.             -76039,
  67.             -5105
  68.         },
  69.         {
  70.             173235,
  71.             -76884,
  72.             -5105
  73.         },
  74.         {
  75.             175003,
  76.             -76933,
  77.             -5105
  78.         },
  79.         {
  80.             174196,
  81.             -76190,
  82.             -5105
  83.         },
  84.         {
  85.             174013,
  86.             -76120,
  87.             -5105
  88.         },
  89.         {
  90.             173263,
  91.             -75161,
  92.             -5105
  93.         }
  94.     };
  95.     
  96.     private static final int[][] _skill =
  97.     {
  98.         {
  99.             5015,
  100.             1,
  101.             5000
  102.         },
  103.         {
  104.             5015,
  105.             4,
  106.             5000
  107.         },
  108.         {
  109.             5015,
  110.             2,
  111.             5000
  112.         },
  113.         {
  114.             5015,
  115.             5,
  116.             5000
  117.         },
  118.         {
  119.             5018,
  120.             1,
  121.             10000
  122.         },
  123.         {
  124.             5016,
  125.             1,
  126.             5000
  127.         },
  128.         {
  129.             5015,
  130.             3,
  131.             5000
  132.         },
  133.         {
  134.             5015,
  135.             6,
  136.             5000
  137.         },
  138.         {
  139.             5018,
  140.             2,
  141.             10000
  142.         },
  143.         {
  144.             5019,
  145.             1,
  146.             10000
  147.         },
  148.         {
  149.             5016,
  150.             1,
  151.             5000
  152.         }
  153.     };
  154.     
  155.     private static final int[][] _mobLoc =
  156.     {
  157.         {
  158.             18328,
  159.             172894,
  160.             -76019,
  161.             -5107,
  162.             243
  163.         },
  164.         {
  165.             18328,
  166.             174095,
  167.             -77279,
  168.             -5107,
  169.             16216
  170.         },
  171.         {
  172.             18328,
  173.             174111,
  174.             -74833,
  175.             -5107,
  176.             49043
  177.         },
  178.         {
  179.             18328,
  180.             175344,
  181.             -76042,
  182.             -5107,
  183.             32847
  184.         },
  185.         {
  186.             18330,
  187.             173489,
  188.             -76227,
  189.             -5134,
  190.             63565
  191.         },
  192.         {
  193.             18330,
  194.             173498,
  195.             -75724,
  196.             -5107,
  197.             58498
  198.         },
  199.         {
  200.             18330,
  201.             174365,
  202.             -76745,
  203.             -5107,
  204.             22424
  205.         },
  206.         {
  207.             18330,
  208.             174570,
  209.             -75584,
  210.             -5107,
  211.             31968
  212.         },
  213.         {
  214.             18330,
  215.             174613,
  216.             -76179,
  217.             -5107,
  218.             31471
  219.         },
  220.         {
  221.             18332,
  222.             173620,
  223.             -75981,
  224.             -5107,
  225.             4588
  226.         },
  227.         {
  228.             18332,
  229.             173630,
  230.             -76340,
  231.             -5107,
  232.             62454
  233.         },
  234.         {
  235.             18332,
  236.             173755,
  237.             -75613,
  238.             -5107,
  239.             57892
  240.         },
  241.         {
  242.             18332,
  243.             173823,
  244.             -76688,
  245.             -5107,
  246.             2411
  247.         },
  248.         {
  249.             18332,
  250.             174000,
  251.             -75411,
  252.             -5107,
  253.             54718
  254.         },
  255.         {
  256.             18332,
  257.             174487,
  258.             -75555,
  259.             -5107,
  260.             33861
  261.         },
  262.         {
  263.             18332,
  264.             174517,
  265.             -76471,
  266.             -5107,
  267.             21893
  268.         },
  269.         {
  270.             18332,
  271.             174576,
  272.             -76122,
  273.             -5107,
  274.             31176
  275.         },
  276.         {
  277.             18332,
  278.             174600,
  279.             -75841,
  280.             -5134,
  281.             35927
  282.         },
  283.         {
  284.             18329,
  285.             173481,
  286.             -76043,
  287.             -5107,
  288.             61312
  289.         },
  290.         {
  291.             18329,
  292.             173539,
  293.             -75678,
  294.             -5107,
  295.             59524
  296.         },
  297.         {
  298.             18329,
  299.             173584,
  300.             -76386,
  301.             -5107,
  302.             3041
  303.         },
  304.         {
  305.             18329,
  306.             173773,
  307.             -75420,
  308.             -5107,
  309.             51115
  310.         },
  311.         {
  312.             18329,
  313.             173777,
  314.             -76650,
  315.             -5107,
  316.             12588
  317.         },
  318.         {
  319.             18329,
  320.             174585,
  321.             -76510,
  322.             -5107,
  323.             21704
  324.         },
  325.         {
  326.             18329,
  327.             174623,
  328.             -75571,
  329.             -5107,
  330.             40141
  331.         },
  332.         {
  333.             18329,
  334.             174744,
  335.             -76240,
  336.             -5107,
  337.             29202
  338.         },
  339.         {
  340.             18329,
  341.             174769,
  342.             -75895,
  343.             -5107,
  344.             29572
  345.         },
  346.         {
  347.             18333,
  348.             173861,
  349.             -76011,
  350.             -5107,
  351.             383
  352.         },
  353.         {
  354.             18333,
  355.             173872,
  356.             -76461,
  357.             -5107,
  358.             8041
  359.         },
  360.         {
  361.             18333,
  362.             173898,
  363.             -75668,
  364.             -5107,
  365.             51856
  366.         },
  367.         {
  368.             18333,
  369.             174422,
  370.             -75689,
  371.             -5107,
  372.             42878
  373.         },
  374.         {
  375.             18333,
  376.             174460,
  377.             -76355,
  378.             -5107,
  379.             27311
  380.         },
  381.         {
  382.             18333,
  383.             174483,
  384.             -76041,
  385.             -5107,
  386.             30947
  387.         },
  388.         {
  389.             18331,
  390.             173515,
  391.             -76184,
  392.             -5107,
  393.             6971
  394.         },
  395.         {
  396.             18331,
  397.             173516,
  398.             -75790,
  399.             -5134,
  400.             3142
  401.         },
  402.         {
  403.             18331,
  404.             173696,
  405.             -76675,
  406.             -5107,
  407.             6757
  408.         },
  409.         {
  410.             18331,
  411.             173766,
  412.             -75502,
  413.             -5134,
  414.             60827
  415.         },
  416.         {
  417.             18331,
  418.             174473,
  419.             -75321,
  420.             -5107,
  421.             37147
  422.         },
  423.         {
  424.             18331,
  425.             174493,
  426.             -76505,
  427.             -5107,
  428.             34503
  429.         },
  430.         {
  431.             18331,
  432.             174568,
  433.             -75654,
  434.             -5134,
  435.             41661
  436.         },
  437.         {
  438.             18331,
  439.             174584,
  440.             -76263,
  441.             -5107,
  442.             31729
  443.         },
  444.         {
  445.             18339,
  446.             173892,
  447.             -81592,
  448.             -5123,
  449.             50849
  450.         },
  451.         {
  452.             18339,
  453.             173958,
  454.             -81820,
  455.             -5123,
  456.             7459
  457.         },
  458.         {
  459.             18339,
  460.             174128,
  461.             -81805,
  462.             -5150,
  463.             21495
  464.         },
  465.         {
  466.             18339,
  467.             174245,
  468.             -81566,
  469.             -5123,
  470.             41760
  471.         },
  472.         {
  473.             18334,
  474.             173264,
  475.             -81529,
  476.             -5072,
  477.             1646
  478.         },
  479.         {
  480.             18334,
  481.             173265,
  482.             -81656,
  483.             -5072,
  484.             441
  485.         },
  486.         {
  487.             18334,
  488.             173267,
  489.             -81889,
  490.             -5072,
  491.             0
  492.         },
  493.         {
  494.             18334,
  495.             173271,
  496.             -82015,
  497.             -5072,
  498.             65382
  499.         },
  500.         {
  501.             18334,
  502.             174867,
  503.             -81655,
  504.             -5073,
  505.             32537
  506.         },
  507.         {
  508.             18334,
  509.             174868,
  510.             -81890,
  511.             -5073,
  512.             32768
  513.         },
  514.         {
  515.             18334,
  516.             174869,
  517.             -81485,
  518.             -5073,
  519.             32315
  520.         },
  521.         {
  522.             18334,
  523.             174871,
  524.             -82017,
  525.             -5073,
  526.             33007
  527.         },
  528.         {
  529.             18335,
  530.             173074,
  531.             -80817,
  532.             -5107,
  533.             8353
  534.         },
  535.         {
  536.             18335,
  537.             173128,
  538.             -82702,
  539.             -5107,
  540.             5345
  541.         },
  542.         {
  543.             18335,
  544.             173181,
  545.             -82544,
  546.             -5107,
  547.             65135
  548.         },
  549.         {
  550.             18335,
  551.             173191,
  552.             -80981,
  553.             -5107,
  554.             6947
  555.         },
  556.         {
  557.             18335,
  558.             174859,
  559.             -80889,
  560.             -5134,
  561.             24103
  562.         },
  563.         {
  564.             18335,
  565.             174924,
  566.             -82666,
  567.             -5107,
  568.             38710
  569.         },
  570.         {
  571.             18335,
  572.             174947,
  573.             -80733,
  574.             -5107,
  575.             22449
  576.         },
  577.         {
  578.             18335,
  579.             175096,
  580.             -82724,
  581.             -5107,
  582.             42205
  583.         },
  584.         {
  585.             18336,
  586.             173435,
  587.             -80512,
  588.             -5107,
  589.             65215
  590.         },
  591.         {
  592.             18336,
  593.             173440,
  594.             -82948,
  595.             -5107,
  596.             417
  597.         },
  598.         {
  599.             18336,
  600.             173443,
  601.             -83120,
  602.             -5107,
  603.             1094
  604.         },
  605.         {
  606.             18336,
  607.             173463,
  608.             -83064,
  609.             -5107,
  610.             286
  611.         },
  612.         {
  613.             18336,
  614.             173465,
  615.             -80453,
  616.             -5107,
  617.             174
  618.         },
  619.         {
  620.             18336,
  621.             173465,
  622.             -83006,
  623.             -5107,
  624.             2604
  625.         },
  626.         {
  627.             18336,
  628.             173468,
  629.             -82889,
  630.             -5107,
  631.             316
  632.         },
  633.         {
  634.             18336,
  635.             173469,
  636.             -80570,
  637.             -5107,
  638.             65353
  639.         },
  640.         {
  641.             18336,
  642.             173469,
  643.             -80628,
  644.             -5107,
  645.             166
  646.         },
  647.         {
  648.             18336,
  649.             173492,
  650.             -83121,
  651.             -5107,
  652.             394
  653.         },
  654.         {
  655.             18336,
  656.             173493,
  657.             -80683,
  658.             -5107,
  659.             0
  660.         },
  661.         {
  662.             18336,
  663.             173497,
  664.             -80510,
  665.             -5134,
  666.             417
  667.         },
  668.         {
  669.             18336,
  670.             173499,
  671.             -82947,
  672.             -5107,
  673.             0
  674.         },
  675.         {
  676.             18336,
  677.             173521,
  678.             -83063,
  679.             -5107,
  680.             316
  681.         },
  682.         {
  683.             18336,
  684.             173523,
  685.             -82889,
  686.             -5107,
  687.             128
  688.         },
  689.         {
  690.             18336,
  691.             173524,
  692.             -80627,
  693.             -5134,
  694.             65027
  695.         },
  696.         {
  697.             18336,
  698.             173524,
  699.             -83007,
  700.             -5107,
  701.             0
  702.         },
  703.         {
  704.             18336,
  705.             173526,
  706.             -80452,
  707.             -5107,
  708.             64735
  709.         },
  710.         {
  711.             18336,
  712.             173527,
  713.             -80569,
  714.             -5134,
  715.             65062
  716.         },
  717.         {
  718.             18336,
  719.             174602,
  720.             -83122,
  721.             -5107,
  722.             33104
  723.         },
  724.         {
  725.             18336,
  726.             174604,
  727.             -82949,
  728.             -5107,
  729.             33184
  730.         },
  731.         {
  732.             18336,
  733.             174609,
  734.             -80514,
  735.             -5107,
  736.             33234
  737.         },
  738.         {
  739.             18336,
  740.             174609,
  741.             -80684,
  742.             -5107,
  743.             32851
  744.         },
  745.         {
  746.             18336,
  747.             174629,
  748.             -80627,
  749.             -5107,
  750.             33346
  751.         },
  752.         {
  753.             18336,
  754.             174632,
  755.             -80570,
  756.             -5107,
  757.             32896
  758.         },
  759.         {
  760.             18336,
  761.             174632,
  762.             -83066,
  763.             -5107,
  764.             32768
  765.         },
  766.         {
  767.             18336,
  768.             174635,
  769.             -82893,
  770.             -5107,
  771.             33594
  772.         },
  773.         {
  774.             18336,
  775.             174636,
  776.             -80456,
  777.             -5107,
  778.             32065
  779.         },
  780.         {
  781.             18336,
  782.             174639,
  783.             -83008,
  784.             -5107,
  785.             33057
  786.         },
  787.         {
  788.             18336,
  789.             174660,
  790.             -80512,
  791.             -5107,
  792.             33057
  793.         },
  794.         {
  795.             18336,
  796.             174661,
  797.             -83121,
  798.             -5107,
  799.             32768
  800.         },
  801.         {
  802.             18336,
  803.             174663,
  804.             -82948,
  805.             -5107,
  806.             32768
  807.         },
  808.         {
  809.             18336,
  810.             174664,
  811.             -80685,
  812.             -5107,
  813.             32676
  814.         },
  815.         {
  816.             18336,
  817.             174687,
  818.             -83008,
  819.             -5107,
  820.             32520
  821.         },
  822.         {
  823.             18336,
  824.             174691,
  825.             -83066,
  826.             -5107,
  827.             32961
  828.         },
  829.         {
  830.             18336,
  831.             174692,
  832.             -80455,
  833.             -5107,
  834.             33202
  835.         },
  836.         {
  837.             18336,
  838.             174692,
  839.             -80571,
  840.             -5107,
  841.             32768
  842.         },
  843.         {
  844.             18336,
  845.             174693,
  846.             -80630,
  847.             -5107,
  848.             32994
  849.         },
  850.         {
  851.             18336,
  852.             174693,
  853.             -82889,
  854.             -5107,
  855.             32622
  856.         },
  857.         {
  858.             18337,
  859.             172837,
  860.             -82382,
  861.             -5107,
  862.             58363
  863.         },
  864.         {
  865.             18337,
  866.             172867,
  867.             -81123,
  868.             -5107,
  869.             64055
  870.         },
  871.         {
  872.             18337,
  873.             172883,
  874.             -82495,
  875.             -5107,
  876.             64764
  877.         },
  878.         {
  879.             18337,
  880.             172916,
  881.             -81033,
  882.             -5107,
  883.             7099
  884.         },
  885.         {
  886.             18337,
  887.             172940,
  888.             -82325,
  889.             -5107,
  890.             58998
  891.         },
  892.         {
  893.             18337,
  894.             172946,
  895.             -82435,
  896.             -5107,
  897.             58038
  898.         },
  899.         {
  900.             18337,
  901.             172971,
  902.             -81198,
  903.             -5107,
  904.             14768
  905.         },
  906.         {
  907.             18337,
  908.             172992,
  909.             -81091,
  910.             -5107,
  911.             9438
  912.         },
  913.         {
  914.             18337,
  915.             173032,
  916.             -82365,
  917.             -5107,
  918.             59041
  919.         },
  920.         {
  921.             18337,
  922.             173064,
  923.             -81125,
  924.             -5107,
  925.             5827
  926.         },
  927.         {
  928.             18337,
  929.             175014,
  930.             -81173,
  931.             -5107,
  932.             26398
  933.         },
  934.         {
  935.             18337,
  936.             175061,
  937.             -82374,
  938.             -5107,
  939.             43290
  940.         },
  941.         {
  942.             18337,
  943.             175096,
  944.             -81080,
  945.             -5107,
  946.             24719
  947.         },
  948.         {
  949.             18337,
  950.             175169,
  951.             -82453,
  952.             -5107,
  953.             37672
  954.         },
  955.         {
  956.             18337,
  957.             175172,
  958.             -80972,
  959.             -5107,
  960.             32315
  961.         },
  962.         {
  963.             18337,
  964.             175174,
  965.             -82328,
  966.             -5107,
  967.             41760
  968.         },
  969.         {
  970.             18337,
  971.             175197,
  972.             -81157,
  973.             -5107,
  974.             27617
  975.         },
  976.         {
  977.             18337,
  978.             175245,
  979.             -82547,
  980.             -5107,
  981.             40275
  982.         },
  983.         {
  984.             18337,
  985.             175249,
  986.             -81075,
  987.             -5107,
  988.             28435
  989.         },
  990.         {
  991.             18337,
  992.             175292,
  993.             -82432,
  994.             -5107,
  995.             42225
  996.         },
  997.         {
  998.             18338,
  999.             173014,
  1000.             -82628,
  1001.             -5107,
  1002.             11874
  1003.         },
  1004.         {
  1005.             18338,
  1006.             173033,
  1007.             -80920,
  1008.             -5107,
  1009.             10425
  1010.         },
  1011.         {
  1012.             18338,
  1013.             173095,
  1014.             -82520,
  1015.             -5107,
  1016.             49152
  1017.         },
  1018.         {
  1019.             18338,
  1020.             173115,
  1021.             -80986,
  1022.             -5107,
  1023.             9611
  1024.         },
  1025.         {
  1026.             18338,
  1027.             173144,
  1028.             -80894,
  1029.             -5107,
  1030.             5345
  1031.         },
  1032.         {
  1033.             18338,
  1034.             173147,
  1035.             -82602,
  1036.             -5107,
  1037.             51316
  1038.         },
  1039.         {
  1040.             18338,
  1041.             174912,
  1042.             -80825,
  1043.             -5107,
  1044.             24270
  1045.         },
  1046.         {
  1047.             18338,
  1048.             174935,
  1049.             -80899,
  1050.             -5107,
  1051.             18061
  1052.         },
  1053.         {
  1054.             18338,
  1055.             175016,
  1056.             -82697,
  1057.             -5107,
  1058.             39533
  1059.         },
  1060.         {
  1061.             18338,
  1062.             175041,
  1063.             -80834,
  1064.             -5107,
  1065.             25420
  1066.         },
  1067.         {
  1068.             18338,
  1069.             175071,
  1070.             -82549,
  1071.             -5107,
  1072.             39163
  1073.         },
  1074.         {
  1075.             18338,
  1076.             175154,
  1077.             -82619,
  1078.             -5107,
  1079.             36345
  1080.         }
  1081.     };
  1082.     
  1083.     private static final int SCARLET1 = 29046;
  1084.     private static final int SCARLET2 = 29047;
  1085.     private static final int FRINTEZZA = 29045;
  1086.     private static final int GUIDE = 32011;
  1087.     private static final int CUBE = 29061;
  1088.     
  1089.     // Frintezza Status Tracking :
  1090.     private static final byte DORMANT = 0; // Frintezza is spawned and no one has entered yet. Entry is unlocked
  1091.     private static final byte WAITING = 1; // Frintezza is spawend and someone has entered, triggering a 30 minute window for additional people to enter
  1092.     // before he unleashes his attack. Entry is unlocked
  1093.     private static final byte FIGHTING = 2; // Frintezza is engaged in battle, annihilating his foes. Entry is locked
  1094.     private static final byte DEAD = 3; // Frintezza has been killed. Entry is locked
  1095.     
  1096.     private static long _LastAction = 0;
  1097.     private static int _Angle = 0;
  1098.     private static int _Heading = 0;
  1099.     private static int _LocCycle = 0;
  1100.     private static int _Bomber = 0;
  1101.     private static int _CheckDie = 0;
  1102.     private static int _OnCheck = 0;
  1103.     private static int _OnSong = 0;
  1104.     private static int _Abnormal = 0;
  1105.     private static int _OnMorph = 0;
  1106.     private static int _Scarlet_x = 0;
  1107.     private static int _Scarlet_y = 0;
  1108.     private static int _Scarlet_z = 0;
  1109.     private static int _Scarlet_h = 0;
  1110.     private static int _SecondMorph = 0;
  1111.     private static int _ThirdMorph = 0;
  1112.     private static int _KillHallAlarmDevice = 0;
  1113.     private static int _KillDarkChoirPlayer = 0;
  1114.     private static int _KillDarkChoirCaptain = 0;
  1115.     protected long _respawnEnd;
  1116.     
  1117.     private static L2BossZone _Zone;
  1118.     
  1119.     @SuppressWarnings("unused")
  1120.     private L2GrandBossInstance frintezza, weakScarlet, strongScarlet, activeScarlet;
  1121.     
  1122.     private L2MonsterInstance demon1, demon2, demon3, demon4, portrait1, portrait2, portrait3, portrait4;
  1123.     private L2NpcInstance _frintezzaDummy, _overheadDummy, _portraitDummy1, _portraitDummy3, _scarletDummy;
  1124.     private List<L2PcInstance> _PlayersInside = new FastList<>();
  1125.     private List<L2NpcInstance> _Room1Mobs = new FastList<>();
  1126.     private List<L2NpcInstance> _Room2Mobs = new FastList<>();
  1127.     private List<L2Attackable> Minions = new FastList<>();
  1128.     
  1129.     // Boss: Frintezza
  1130.     public Frintezza(int id, String name, String descr)
  1131.     {
  1132.         super(id, name, descr);
  1133.         
  1134.         int[] mob =
  1135.         {
  1136.             SCARLET1,
  1137.             SCARLET2,
  1138.             FRINTEZZA,
  1139.             18328,
  1140.             18329,
  1141.             18330,
  1142.             18331,
  1143.             18332,
  1144.             18333,
  1145.             18334,
  1146.             18335,
  1147.             18336,
  1148.             18337,
  1149.             18338,
  1150.             18339,
  1151.             29048,
  1152.             29049,
  1153.             29050,
  1154.             29051
  1155.         };
  1156.         
  1157.         _Zone = GrandBossManager.getInstance().getZone(getXFix(174232), getYFix(-88020), getZFix(-5116));
  1158.         
  1159.         registerMobs(mob);
  1160.         
  1161.         addStartNpc(GUIDE);
  1162.         addTalkId(GUIDE);
  1163.         addStartNpc(CUBE);
  1164.         addTalkId(CUBE);
  1165.         
  1166.         StatsSet info = GrandBossManager.getInstance().getStatsSet(FRINTEZZA);
  1167.         Integer status = GrandBossManager.getInstance().getBossStatus(FRINTEZZA);
  1168.         
  1169.         if (status == DEAD)
  1170.         {
  1171.             long temp = (info.getLong("respawn_time") - Calendar.getInstance().getTimeInMillis());
  1172.             if (temp > 0)
  1173.             {
  1174.                 startQuestTimer("frintezza_unlock", temp, null, null);
  1175.             }
  1176.             else
  1177.             {
  1178.                 GrandBossManager.getInstance().setBossStatus(FRINTEZZA, DORMANT);
  1179.             }
  1180.         }
  1181.         else if (status != DORMANT)
  1182.         {
  1183.             GrandBossManager.getInstance().setBossStatus(FRINTEZZA, DORMANT);
  1184.         }
  1185.         
  1186.         // temp fix for messed door cords
  1187.         /*
  1188.          * for (int i = 0; i < 8; i++) { DoorTable.getInstance().getDoor(25150051 + i).setRange(0, 0, 0, 0, 0, 0); }
  1189.          */
  1190.     }
  1191.     
  1192.     @Override
  1193.     public String onSpawn(L2NpcInstance npc)
  1194.     {
  1195.         final L2MonsterInstance mob = (L2MonsterInstance) npc;
  1196.         if (mob != null)
  1197.         {
  1198.             mob.setIsBossInstance(true);
  1199.         }
  1200.         return super.onSpawn(npc);
  1201.     }
  1202.     
  1203.     @Override
  1204.     public String onAdvEvent(String event, L2NpcInstance npc, L2PcInstance player)
  1205.     {
  1206.         long temp = 0;
  1207.         if (event.equalsIgnoreCase("waiting"))
  1208.         {
  1209.             startQuestTimer("close", 27000, npc, null);
  1210.             startQuestTimer("camera_1", 30000, npc, null);
  1211.             _Zone.broadcastPacket(new Earthquake(getXFix(174232), getYFix(-88020), getZFix(-5116), 45, 27));
  1212.         }
  1213.         else if (event.equalsIgnoreCase("room1_spawn"))
  1214.         {
  1215.             for (int i = 0; i <= 17; i++)
  1216.             {
  1217.                 L2NpcInstance mob = addSpawn(_mobLoc[i][0], _mobLoc[i][1], _mobLoc[i][2], _mobLoc[i][3], _mobLoc[i][4], false, 0);
  1218.                 synchronized (_Room1Mobs)
  1219.                 {
  1220.                     _Room1Mobs.add(mob);
  1221.                 }
  1222.                 
  1223.             }
  1224.         }
  1225.         else if (event.equalsIgnoreCase("room1_spawn2"))
  1226.         {
  1227.             for (int i = 18; i <= 26; i++)
  1228.             {
  1229.                 L2NpcInstance mob = addSpawn(_mobLoc[i][0], _mobLoc[i][1], _mobLoc[i][2], _mobLoc[i][3], _mobLoc[i][4], false, 0);
  1230.                 synchronized (_Room1Mobs)
  1231.                 {
  1232.                     _Room1Mobs.add(mob);
  1233.                 }
  1234.                 
  1235.             }
  1236.         }
  1237.         else if (event.equalsIgnoreCase("room1_spawn3"))
  1238.         {
  1239.             for (int i = 27; i <= 32; i++)
  1240.             {
  1241.                 L2NpcInstance mob = addSpawn(_mobLoc[i][0], _mobLoc[i][1], _mobLoc[i][2], _mobLoc[i][3], _mobLoc[i][4], false, 0);
  1242.                 synchronized (_Room1Mobs)
  1243.                 {
  1244.                     _Room1Mobs.add(mob);
  1245.                 }
  1246.                 
  1247.             }
  1248.         }
  1249.         else if (event.equalsIgnoreCase("room1_spawn4"))
  1250.         {
  1251.             for (int i = 33; i <= 40; i++)
  1252.             {
  1253.                 L2NpcInstance mob = addSpawn(_mobLoc[i][0], _mobLoc[i][1], _mobLoc[i][2], _mobLoc[i][3], _mobLoc[i][4], false, 0);
  1254.                 synchronized (_Room1Mobs)
  1255.                 {
  1256.                     _Room1Mobs.add(mob);
  1257.                 }
  1258.                 
  1259.             }
  1260.         }
  1261.         else if (event.equalsIgnoreCase("room2_spawn"))
  1262.         {
  1263.             for (int i = 41; i <= 44; i++)
  1264.             {
  1265.                 L2NpcInstance mob = addSpawn(_mobLoc[i][0], _mobLoc[i][1], _mobLoc[i][2], _mobLoc[i][3], _mobLoc[i][4], false, 0);
  1266.                 synchronized (_Room2Mobs)
  1267.                 {
  1268.                     _Room2Mobs.add(mob);
  1269.                 }
  1270.                 
  1271.             }
  1272.         }
  1273.         else if (event.equalsIgnoreCase("room2_spawn2"))
  1274.         {
  1275.             for (int i = 45; i <= 131; i++)
  1276.             {
  1277.                 L2NpcInstance mob = addSpawn(_mobLoc[i][0], _mobLoc[i][1], _mobLoc[i][2], _mobLoc[i][3], _mobLoc[i][4], false, 0);
  1278.                 synchronized (_Room2Mobs)
  1279.                 {
  1280.                     _Room2Mobs.add(mob);
  1281.                 }
  1282.                 
  1283.             }
  1284.         }
  1285.         else if (event.equalsIgnoreCase("room1_del"))
  1286.         {
  1287.             synchronized (_Room1Mobs)
  1288.             {
  1289.                 for (L2NpcInstance mob : _Room1Mobs)
  1290.                 {
  1291.                     if (mob != null)
  1292.                     {
  1293.                         mob.deleteMe();
  1294.                     }
  1295.                 }
  1296.                 _Room1Mobs.clear();
  1297.             }
  1298.             
  1299.         }
  1300.         else if (event.equalsIgnoreCase("room2_del"))
  1301.         {
  1302.             synchronized (_Room2Mobs)
  1303.             {
  1304.                 for (L2NpcInstance mob : _Room2Mobs)
  1305.                 {
  1306.                     if (mob != null)
  1307.                     {
  1308.                         mob.deleteMe();
  1309.                     }
  1310.                 }
  1311.                 _Room2Mobs.clear();
  1312.             }
  1313.             
  1314.         }
  1315.         else if (event.equalsIgnoreCase("room3_del"))
  1316.         {
  1317.             if (demon1 != null)
  1318.             {
  1319.                 demon1.deleteMe();
  1320.             }
  1321.             if (demon2 != null)
  1322.             {
  1323.                 demon2.deleteMe();
  1324.             }
  1325.             if (demon3 != null)
  1326.             {
  1327.                 demon3.deleteMe();
  1328.             }
  1329.             if (demon4 != null)
  1330.             {
  1331.                 demon4.deleteMe();
  1332.             }
  1333.             if (portrait1 != null)
  1334.             {
  1335.                 portrait1.deleteMe();
  1336.             }
  1337.             if (portrait2 != null)
  1338.             {
  1339.                 portrait2.deleteMe();
  1340.             }
  1341.             if (portrait3 != null)
  1342.             {
  1343.                 portrait3.deleteMe();
  1344.             }
  1345.             if (portrait4 != null)
  1346.             {
  1347.                 portrait4.deleteMe();
  1348.             }
  1349.             if (frintezza != null)
  1350.             {
  1351.                 frintezza.deleteMe();
  1352.             }
  1353.             if (weakScarlet != null)
  1354.             {
  1355.                 weakScarlet.deleteMe();
  1356.             }
  1357.             if (strongScarlet != null)
  1358.             {
  1359.                 strongScarlet.deleteMe();
  1360.             }
  1361.             
  1362.             demon1 = null;
  1363.             demon2 = null;
  1364.             demon3 = null;
  1365.             demon4 = null;
  1366.             portrait1 = null;
  1367.             portrait2 = null;
  1368.             portrait3 = null;
  1369.             portrait4 = null;
  1370.             frintezza = null;
  1371.             weakScarlet = null;
  1372.             strongScarlet = null;
  1373.             activeScarlet = null;
  1374.         }
  1375.         else if (event.equalsIgnoreCase("clean"))
  1376.         {
  1377.             _LastAction = 0;
  1378.             _LocCycle = 0;
  1379.             _CheckDie = 0;
  1380.             _OnCheck = 0;
  1381.             _Abnormal = 0;
  1382.             _OnMorph = 0;
  1383.             _SecondMorph = 0;
  1384.             _ThirdMorph = 0;
  1385.             _KillHallAlarmDevice = 0;
  1386.             _KillDarkChoirPlayer = 0;
  1387.             _KillDarkChoirCaptain = 0;
  1388.             _PlayersInside.clear();
  1389.         }
  1390.         else if (event.equalsIgnoreCase("close"))
  1391.         {
  1392.             for (int i = 25150051; i <= 25150058; i++)
  1393.             {
  1394.                 DoorTable.getInstance().getDoor(i).closeMe();
  1395.             }
  1396.             for (int i = 25150061; i <= 25150070; i++)
  1397.             {
  1398.                 DoorTable.getInstance().getDoor(i).closeMe();
  1399.             }
  1400.             
  1401.             DoorTable.getInstance().getDoor(25150042).closeMe();
  1402.             DoorTable.getInstance().getDoor(25150043).closeMe();
  1403.             DoorTable.getInstance().getDoor(25150045).closeMe();
  1404.             DoorTable.getInstance().getDoor(25150046).closeMe();
  1405.         }
  1406.         /*
  1407.          * else if (event.equalsIgnoreCase("loc_check")) { Integer status = GrandBossManager.getInstance().getBossStatus(FRINTEZZA); if (status == FIGHTING) { if (!_Zone.isInsideZone(npc)) npc.teleToLocation(getXFix(174232),getYFix(-88020),getZFix(-5116)); if (npc.getX() < getXFix(171932) ||
  1408.          * npc.getX() > getXFix(176532) || npc.getY() < getYFix(-90320) || npc.getY() > getYFix(-85720) || npc.getZ() < getZFix(-5130)) npc.teleToLocation(getXFix(174232),getYFix(-88020),getZFix(-5116)); } }
  1409.          */
  1410.         else if (event.equalsIgnoreCase("camera_1"))
  1411.         {
  1412.             GrandBossManager.getInstance().setBossStatus(FRINTEZZA, FIGHTING);
  1413.             
  1414.             _frintezzaDummy = addSpawn(29052, 174240, -89805, -5022, 16048, false, 0);
  1415.             _frintezzaDummy.setIsInvul(true);
  1416.             _frintezzaDummy.setIsImobilised(true);
  1417.             
  1418.             _overheadDummy = addSpawn(29052, 174232, -88020, -5110, 16384, false, 0);
  1419.             _overheadDummy.setIsInvul(true);
  1420.             _overheadDummy.setIsImobilised(true);
  1421.             _overheadDummy.setCollisionHeight(600);
  1422.             _Zone.broadcastPacket(new NpcInfo(_overheadDummy, null));
  1423.             
  1424.             _portraitDummy1 = addSpawn(29052, 172450, -87890, -5100, 16048, false, 0);
  1425.             _portraitDummy1.setIsImobilised(true);
  1426.             _portraitDummy1.setIsInvul(true);
  1427.             
  1428.             _portraitDummy3 = addSpawn(29052, 176012, -87890, -5100, 16048, false, 0);
  1429.             _portraitDummy3.setIsImobilised(true);
  1430.             _portraitDummy3.setIsInvul(true);
  1431.             
  1432.             _scarletDummy = addSpawn(29053, 174232, -88020, -5110, 16384, false, 0);
  1433.             _scarletDummy.setIsInvul(true);
  1434.             _scarletDummy.setIsImobilised(true);
  1435.             
  1436.             startQuestTimer("stop_pc", 0, npc, null);
  1437.             startQuestTimer("camera_2", 1000, _overheadDummy, null);
  1438.         }
  1439.         else if (event.equalsIgnoreCase("camera_2"))
  1440.         {
  1441.             _Zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 0, 75, -89, 0, 100));
  1442.             startQuestTimer("camera_2b", 0, _overheadDummy, null);
  1443.         }
  1444.         else if (event.equalsIgnoreCase("camera_2b"))
  1445.         {
  1446.             _Zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 0, 75, -89, 0, 100));
  1447.             startQuestTimer("camera_3", 0, _overheadDummy, null);
  1448.         }
  1449.         else if (event.equalsIgnoreCase("camera_3"))
  1450.         {
  1451.             _Zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 300, 90, -10, 6500, 7000));
  1452.             
  1453.             frintezza = (L2GrandBossInstance) addSpawn(FRINTEZZA, 174240, -89805, -5022, 16048, false, 0);
  1454.             GrandBossManager.getInstance().addBoss(frintezza);
  1455.             if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
  1456.             {
  1457.                 Announcements.getInstance().announceWithServerName("The Grand boss " + frintezza.getName() + " spawned in world.");
  1458.             }
  1459.             frintezza.setIsImobilised(true);
  1460.             frintezza.setIsInvul(true);
  1461.             frintezza.disableAllSkills();
  1462.             _Zone.updateKnownList(frintezza);
  1463.             
  1464.             demon2 = (L2MonsterInstance) addSpawn(29051, 175876, -88713, -5100, 28205, false, 0);
  1465.             demon2.setIsImobilised(true);
  1466.             demon2.disableAllSkills();
  1467.             _Zone.updateKnownList(demon2);
  1468.             
  1469.             demon3 = (L2MonsterInstance) addSpawn(29051, 172608, -88702, -5100, 64817, false, 0);
  1470.             demon3.setIsImobilised(true);
  1471.             demon3.disableAllSkills();
  1472.             _Zone.updateKnownList(demon3);
  1473.             
  1474.             demon1 = (L2MonsterInstance) addSpawn(29050, 175833, -87165, -5100, 35048, false, 0);
  1475.             demon1.setIsImobilised(true);
  1476.             demon1.disableAllSkills();
  1477.             _Zone.updateKnownList(demon1);
  1478.             
  1479.             demon4 = (L2MonsterInstance) addSpawn(29050, 172634, -87165, -5100, 57730, false, 0);
  1480.             demon4.setIsImobilised(true);
  1481.             demon4.disableAllSkills();
  1482.             _Zone.updateKnownList(demon4);
  1483.             
  1484.             startQuestTimer("camera_4", 6500, _overheadDummy, null);
  1485.         }
  1486.         else if (event.equalsIgnoreCase("camera_4"))
  1487.         {
  1488.             _Zone.broadcastPacket(new SpecialCamera(_frintezzaDummy.getObjectId(), 1800, 90, 8, 6500, 7000));
  1489.             startQuestTimer("camera_5", 900, _frintezzaDummy, null);
  1490.         }
  1491.         else if (event.equalsIgnoreCase("camera_5"))
  1492.         {
  1493.             _Zone.broadcastPacket(new SpecialCamera(_frintezzaDummy.getObjectId(), 140, 90, 10, 2500, 4500));
  1494.             startQuestTimer("camera_5b", 4000, _frintezzaDummy, null);
  1495.         }
  1496.         else if (event.equalsIgnoreCase("camera_5b"))
  1497.         {
  1498.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 40, 75, -10, 0, 1000));
  1499.             startQuestTimer("camera_6", 0, frintezza, null);
  1500.         }
  1501.         else if (event.equalsIgnoreCase("camera_6"))
  1502.         {
  1503.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 40, 75, -10, 0, 12000));
  1504.             startQuestTimer("camera_7", 1350, frintezza, null);
  1505.         }
  1506.         else if (event.equalsIgnoreCase("camera_7"))
  1507.         {
  1508.             _Zone.broadcastPacket(new SocialAction(frintezza.getObjectId(), 2));
  1509.             startQuestTimer("camera_8", 7000, frintezza, null);
  1510.         }
  1511.         else if (event.equalsIgnoreCase("camera_8"))
  1512.         {
  1513.             startQuestTimer("camera_9", 1000, frintezza, null);
  1514.             _frintezzaDummy.deleteMe();
  1515.             _frintezzaDummy = null;
  1516.         }
  1517.         else if (event.equalsIgnoreCase("camera_9"))
  1518.         {
  1519.             _Zone.broadcastPacket(new SocialAction(demon2.getObjectId(), 1));
  1520.             _Zone.broadcastPacket(new SocialAction(demon3.getObjectId(), 1));
  1521.             startQuestTimer("camera_9b", 400, frintezza, null);
  1522.         }
  1523.         else if (event.equalsIgnoreCase("camera_9b"))
  1524.         {
  1525.             _Zone.broadcastPacket(new SocialAction(demon1.getObjectId(), 1));
  1526.             _Zone.broadcastPacket(new SocialAction(demon4.getObjectId(), 1));
  1527.             
  1528.             for (L2Character pc : _Zone.getCharactersInside())
  1529.             {
  1530.                 if (pc instanceof L2PcInstance)
  1531.                 {
  1532.                     if (pc.getX() < getXFix(174232))
  1533.                     {
  1534.                         pc.broadcastPacket(new SpecialCamera(_portraitDummy1.getObjectId(), 1000, 118, 0, 0, 1000));
  1535.                     }
  1536.                     else
  1537.                     {
  1538.                         pc.broadcastPacket(new SpecialCamera(_portraitDummy3.getObjectId(), 1000, 62, 0, 0, 1000));
  1539.                     }
  1540.                 }
  1541.             }
  1542.             startQuestTimer("camera_9c", 0, frintezza, null);
  1543.         }
  1544.         else if (event.equalsIgnoreCase("camera_9c"))
  1545.         {
  1546.             for (L2Character pc : _Zone.getCharactersInside())
  1547.             {
  1548.                 if (pc instanceof L2PcInstance)
  1549.                 {
  1550.                     if (pc.getX() < getXFix(174232))
  1551.                     {
  1552.                         pc.broadcastPacket(new SpecialCamera(_portraitDummy1.getObjectId(), 1000, 118, 0, 0, 10000));
  1553.                     }
  1554.                     else
  1555.                     {
  1556.                         pc.broadcastPacket(new SpecialCamera(_portraitDummy3.getObjectId(), 1000, 62, 0, 0, 10000));
  1557.                     }
  1558.                 }
  1559.             }
  1560.             startQuestTimer("camera_10", 2000, frintezza, null);
  1561.         }
  1562.         else if (event.equalsIgnoreCase("camera_10"))
  1563.         {
  1564.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 240, 90, 0, 0, 1000));
  1565.             startQuestTimer("camera_11", 0, frintezza, null);
  1566.         }
  1567.         else if (event.equalsIgnoreCase("camera_11"))
  1568.         {
  1569.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 240, 90, 25, 5500, 10000));
  1570.             _Zone.broadcastPacket(new SocialAction(frintezza.getObjectId(), 3));
  1571.             _portraitDummy1.deleteMe();
  1572.             _portraitDummy3.deleteMe();
  1573.             _portraitDummy1 = null;
  1574.             _portraitDummy3 = null;
  1575.             
  1576.             startQuestTimer("camera_12", 4500, frintezza, null);
  1577.         }
  1578.         else if (event.equalsIgnoreCase("camera_12"))
  1579.         {
  1580.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 100, 195, 35, 0, 10000));
  1581.             startQuestTimer("camera_13", 700, frintezza, null);
  1582.         }
  1583.         else if (event.equalsIgnoreCase("camera_13"))
  1584.         {
  1585.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 100, 195, 35, 0, 10000));
  1586.             startQuestTimer("camera_14", 1300, frintezza, null);
  1587.         }
  1588.         else if (event.equalsIgnoreCase("camera_14"))
  1589.         {
  1590.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 120, 180, 45, 1500, 10000));
  1591.             _Zone.broadcastPacket(new MagicSkillUser(frintezza, frintezza, 5006, 1, 34000, 0));
  1592.             startQuestTimer("camera_16", 1500, frintezza, null);
  1593.         }
  1594.         else if (event.equalsIgnoreCase("camera_16"))
  1595.         {
  1596.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 520, 135, 45, 8000, 10000));
  1597.             startQuestTimer("camera_17", 7500, frintezza, null);
  1598.         }
  1599.         else if (event.equalsIgnoreCase("camera_17"))
  1600.         {
  1601.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 1500, 110, 25, 10000, 13000));
  1602.             startQuestTimer("camera_18", 9500, frintezza, null);
  1603.         }
  1604.         else if (event.equalsIgnoreCase("camera_18"))
  1605.         {
  1606.             _Zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 930, 160, -20, 0, 1000));
  1607.             startQuestTimer("camera_18b", 0, _overheadDummy, null);
  1608.         }
  1609.         else if (event.equalsIgnoreCase("camera_18b"))
  1610.         {
  1611.             _Zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 600, 180, -25, 0, 10000));
  1612.             _Zone.broadcastPacket(new MagicSkillUser(_scarletDummy, _overheadDummy, 5004, 1, 5800, 0));
  1613.             
  1614.             weakScarlet = (L2GrandBossInstance) addSpawn(SCARLET1, 174232, -88020, -5110, 16384, false, 0);
  1615.             weakScarlet.setIsInvul(true);
  1616.             weakScarlet.setIsImobilised(true);
  1617.             weakScarlet.disableAllSkills();
  1618.             _Zone.updateKnownList(weakScarlet);
  1619.             activeScarlet = weakScarlet;
  1620.             
  1621.             /*
  1622.              * startQuestTimer("camera_19", 2400, _scarletDummy, null); startQuestTimer("camera_19b", 5000, _scarletDummy, null);
  1623.              */
  1624.             startQuestTimer("camera_19", 5500, _scarletDummy, null);
  1625.             startQuestTimer("camera_19b", 5400, weakScarlet, null);
  1626.         }
  1627.         else if (event.equalsIgnoreCase("camera_19"))
  1628.         {
  1629.             weakScarlet.teleToLocation(getXFix(174232), getYFix(-88020), getZFix(-5110));
  1630.         }
  1631.         else if (event.equalsIgnoreCase("camera_19b"))
  1632.         {
  1633.             _Zone.broadcastPacket(new SpecialCamera(_scarletDummy.getObjectId(), 800, 180, 10, 1000, 10000));
  1634.             startQuestTimer("camera_20", 2100, _scarletDummy, null);
  1635.         }
  1636.         else if (event.equalsIgnoreCase("camera_20"))
  1637.         {
  1638.             _Zone.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(), 300, 60, 8, 0, 10000));
  1639.             startQuestTimer("camera_21", 2000, weakScarlet, null);
  1640.         }
  1641.         else if (event.equalsIgnoreCase("camera_21"))
  1642.         {
  1643.             _Zone.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(), 500, 90, 10, 3000, 5000));
  1644.             startQuestTimer("camera_22", 3000, weakScarlet, null);
  1645.         }
  1646.         else if (event.equalsIgnoreCase("camera_22"))
  1647.         {
  1648.             portrait2 = (L2MonsterInstance) addSpawn(29049, 175876, -88713, -5113, 28205, false, 0);
  1649.             portrait2.setIsImobilised(true);
  1650.             portrait2.disableAllSkills();
  1651.             _Zone.updateKnownList(portrait2);
  1652.             
  1653.             portrait3 = (L2MonsterInstance) addSpawn(29049, 172608, -88702, -5113, 64817, false, 0);
  1654.             portrait3.setIsImobilised(true);
  1655.             portrait3.disableAllSkills();
  1656.             _Zone.updateKnownList(portrait3);
  1657.             
  1658.             portrait1 = (L2MonsterInstance) addSpawn(29048, 175833, -87165, -5113, 35048, false, 0);
  1659.             portrait1.setIsImobilised(true);
  1660.             portrait1.disableAllSkills();
  1661.             _Zone.updateKnownList(portrait1);
  1662.             
  1663.             portrait4 = (L2MonsterInstance) addSpawn(29048, 172634, -87165, -5113, 57730, false, 0);
  1664.             portrait4.setIsImobilised(true);
  1665.             portrait4.disableAllSkills();
  1666.             _Zone.updateKnownList(portrait4);
  1667.             
  1668.             _overheadDummy.deleteMe();
  1669.             _scarletDummy.deleteMe();
  1670.             _overheadDummy = null;
  1671.             _scarletDummy = null;
  1672.             
  1673.             startQuestTimer("camera_23", 2000, weakScarlet, null);
  1674.             startQuestTimer("start_pc", 2000, weakScarlet, null);
  1675.             // startQuestTimer("loc_check", 60000, weakScarlet, null, true);
  1676.             startQuestTimer("songs_play", 10000 + Rnd.get(10000), frintezza, null);
  1677.             startQuestTimer("skill01", 10000 + Rnd.get(10000), weakScarlet, null);
  1678.         }
  1679.         else if (event.equalsIgnoreCase("camera_23"))
  1680.         {
  1681.             demon1.setIsImobilised(false);
  1682.             demon2.setIsImobilised(false);
  1683.             demon3.setIsImobilised(false);
  1684.             demon4.setIsImobilised(false);
  1685.             demon1.enableAllSkills();
  1686.             demon2.enableAllSkills();
  1687.             demon3.enableAllSkills();
  1688.             demon4.enableAllSkills();
  1689.             portrait1.setIsImobilised(false);
  1690.             portrait2.setIsImobilised(false);
  1691.             portrait3.setIsImobilised(false);
  1692.             portrait4.setIsImobilised(false);
  1693.             portrait1.enableAllSkills();
  1694.             portrait2.enableAllSkills();
  1695.             portrait3.enableAllSkills();
  1696.             portrait4.enableAllSkills();
  1697.             weakScarlet.setIsInvul(false);
  1698.             weakScarlet.setIsImobilised(false);
  1699.             weakScarlet.enableAllSkills();
  1700.             weakScarlet.setRunning();
  1701.             
  1702.             startQuestTimer("spawn_minion", 20000, portrait1, null);
  1703.             startQuestTimer("spawn_minion", 20000, portrait2, null);
  1704.             startQuestTimer("spawn_minion", 20000, portrait3, null);
  1705.             startQuestTimer("spawn_minion", 20000, portrait4, null);
  1706.         }
  1707.         else if (event.equalsIgnoreCase("stop_pc"))
  1708.         {
  1709.             for (L2Character cha : _Zone.getCharactersInside())
  1710.             {
  1711.                 cha.abortAttack();
  1712.                 cha.abortCast();
  1713.                 cha.disableAllSkills();
  1714.                 cha.setTarget(null);
  1715.                 cha.stopMove(null);
  1716.                 cha.setIsImobilised(true);
  1717.                 cha.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
  1718.             }
  1719.         }
  1720.         else if (event.equalsIgnoreCase("stop_npc"))
  1721.         {
  1722.             _Heading = npc.getHeading();
  1723.             if (_Heading < 32768)
  1724.             {
  1725.                 _Angle = Math.abs(180 - (int) (_Heading / 182.044444444));
  1726.             }
  1727.             else
  1728.             {
  1729.                 _Angle = Math.abs(540 - (int) (_Heading / 182.044444444));
  1730.             }
  1731.         }
  1732.         else if (event.equalsIgnoreCase("start_pc"))
  1733.         {
  1734.             for (L2Character cha : _Zone.getCharactersInside())
  1735.             {
  1736.                 if (cha != frintezza)
  1737.                 {
  1738.                     cha.enableAllSkills();
  1739.                     cha.setIsImobilised(false);
  1740.                 }
  1741.             }
  1742.         }
  1743.         else if (event.equalsIgnoreCase("start_npc"))
  1744.         {
  1745.             npc.setRunning();
  1746.             npc.setIsInvul(false);
  1747.         }
  1748.         else if (event.equalsIgnoreCase("morph_end"))
  1749.         {
  1750.             _OnMorph = 0;
  1751.         }
  1752.         else if (event.equalsIgnoreCase("morph_01"))
  1753.         {
  1754.             _Zone.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(), 250, _Angle, 12, 2000, 15000));
  1755.             startQuestTimer("morph_02", 3000, weakScarlet, null);
  1756.         }
  1757.         else if (event.equalsIgnoreCase("morph_02"))
  1758.         {
  1759.             _Zone.broadcastPacket(new SocialAction(weakScarlet.getObjectId(), 1));
  1760.             weakScarlet.setRHandId(7903);
  1761.             startQuestTimer("morph_03", 4000, weakScarlet, null);
  1762.         }
  1763.         else if (event.equalsIgnoreCase("morph_03"))
  1764.         {
  1765.             startQuestTimer("morph_04", 1500, weakScarlet, null);
  1766.         }
  1767.         else if (event.equalsIgnoreCase("morph_04"))
  1768.         {
  1769.             _Zone.broadcastPacket(new SocialAction(weakScarlet.getObjectId(), 4));
  1770.             L2Skill skill = SkillTable.getInstance().getInfo(5017, 1);
  1771.             if (skill != null)
  1772.             {
  1773.                 skill.getEffects(weakScarlet, weakScarlet, false, false, false);
  1774.             }
  1775.             
  1776.             startQuestTimer("morph_end", 6000, weakScarlet, null);
  1777.             startQuestTimer("start_pc", 3000, weakScarlet, null);
  1778.             startQuestTimer("start_npc", 3000, weakScarlet, null);
  1779.             startQuestTimer("songs_play", 10000 + Rnd.get(10000), frintezza, null);
  1780.             startQuestTimer("skill02", 10000 + Rnd.get(10000), weakScarlet, null);
  1781.         }
  1782.         else if (event.equalsIgnoreCase("morph_05a"))
  1783.         {
  1784.             _Zone.broadcastPacket(new SocialAction(frintezza.getObjectId(), 4));
  1785.         }
  1786.         else if (event.equalsIgnoreCase("morph_05"))
  1787.         {
  1788.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 250, 120, 15, 0, 1000));
  1789.             startQuestTimer("morph_06", 0, frintezza, null);
  1790.         }
  1791.         else if (event.equalsIgnoreCase("morph_06"))
  1792.         {
  1793.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 250, 120, 15, 0, 10000));
  1794.             
  1795.             // cancelQuestTimer("loc_check");
  1796.             
  1797.             _Scarlet_x = weakScarlet.getX();
  1798.             _Scarlet_y = weakScarlet.getY();
  1799.             _Scarlet_z = weakScarlet.getZ();
  1800.             _Scarlet_h = weakScarlet.getHeading();
  1801.             weakScarlet.deleteMe();
  1802.             weakScarlet = null;
  1803.             activeScarlet = null;
  1804.             weakScarlet = (L2GrandBossInstance) addSpawn(SCARLET1, _Scarlet_x, _Scarlet_y, _Scarlet_z, _Scarlet_h, false, 0);
  1805.             weakScarlet.setIsInvul(true);
  1806.             weakScarlet.setIsImobilised(true);
  1807.             weakScarlet.disableAllSkills();
  1808.             weakScarlet.setRHandId(7903);
  1809.             _Zone.updateKnownList(weakScarlet);
  1810.             
  1811.             startQuestTimer("morph_07", 7000, frintezza, null);
  1812.         }
  1813.         else if (event.equalsIgnoreCase("morph_07"))
  1814.         {
  1815.             _Zone.broadcastPacket(new MagicSkillUser(frintezza, frintezza, 5006, 1, 34000, 0));
  1816.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 500, 70, 15, 3000, 10000));
  1817.             startQuestTimer("morph_08", 3000, frintezza, null);
  1818.         }
  1819.         else if (event.equalsIgnoreCase("morph_08"))
  1820.         {
  1821.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 2500, 90, 12, 6000, 10000));
  1822.             startQuestTimer("morph_09", 3000, frintezza, null);
  1823.         }
  1824.         else if (event.equalsIgnoreCase("morph_09"))
  1825.         {
  1826.             _Zone.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(), 250, _Angle, 12, 0, 1000));
  1827.             startQuestTimer("morph_10", 0, weakScarlet, null);
  1828.         }
  1829.         else if (event.equalsIgnoreCase("morph_10"))
  1830.         {
  1831.             _Zone.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(), 250, _Angle, 12, 0, 10000));
  1832.             startQuestTimer("morph_11", 500, weakScarlet, null);
  1833.         }
  1834.         else if (event.equalsIgnoreCase("morph_11"))
  1835.         {
  1836.             weakScarlet.doDie(weakScarlet);
  1837.             _Zone.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(), 450, _Angle, 14, 8000, 8000));
  1838.             
  1839.             startQuestTimer("morph_12", 6250, weakScarlet, null);
  1840.             startQuestTimer("morph_13", 7200, weakScarlet, null);
  1841.         }
  1842.         else if (event.equalsIgnoreCase("morph_12"))
  1843.         {
  1844.             weakScarlet.deleteMe();
  1845.             weakScarlet = null;
  1846.         }
  1847.         else if (event.equalsIgnoreCase("morph_13"))
  1848.         {
  1849.             strongScarlet = (L2GrandBossInstance) addSpawn(SCARLET2, reverseXFix(_Scarlet_x), reverseYFix(_Scarlet_y), reverseZFix(_Scarlet_z), _Scarlet_h, false, 0);
  1850.             strongScarlet.setIsInvul(true);
  1851.             strongScarlet.setIsImobilised(true);
  1852.             strongScarlet.disableAllSkills();
  1853.             _Zone.updateKnownList(strongScarlet);
  1854.             activeScarlet = strongScarlet;
  1855.             
  1856.             _Zone.broadcastPacket(new SpecialCamera(strongScarlet.getObjectId(), 450, _Angle, 12, 500, 14000));
  1857.             
  1858.             startQuestTimer("morph_14", 3000, strongScarlet, null);
  1859.             // startQuestTimer("loc_check", 60000, strongScarlet, null, true);
  1860.         }
  1861.         else if (event.equalsIgnoreCase("morph_14"))
  1862.         {
  1863.             startQuestTimer("morph_15", 5100, strongScarlet, null);
  1864.         }
  1865.         else if (event.equalsIgnoreCase("morph_15"))
  1866.         {
  1867.             _Zone.broadcastPacket(new SocialAction(strongScarlet.getObjectId(), 2));
  1868.             L2Skill skill = SkillTable.getInstance().getInfo(5017, 1);
  1869.             if (skill != null)
  1870.             {
  1871.                 skill.getEffects(strongScarlet, strongScarlet, false, false, false);
  1872.             }
  1873.             
  1874.             startQuestTimer("morph_end", 9000, strongScarlet, null);
  1875.             startQuestTimer("start_pc", 6000, strongScarlet, null);
  1876.             startQuestTimer("start_npc", 6000, strongScarlet, null);
  1877.             startQuestTimer("songs_play", 10000 + Rnd.get(10000), frintezza, null);
  1878.             startQuestTimer("skill03", 10000 + Rnd.get(10000), strongScarlet, null);
  1879.         }
  1880.         else if (event.equalsIgnoreCase("morph_16"))
  1881.         {
  1882.             _Zone.broadcastPacket(new SpecialCamera(strongScarlet.getObjectId(), 300, _Angle - 180, 5, 0, 7000));
  1883.             startQuestTimer("morph_17", 0, strongScarlet, null);
  1884.         }
  1885.         else if (event.equalsIgnoreCase("morph_17"))
  1886.         {
  1887.             _Zone.broadcastPacket(new SpecialCamera(strongScarlet.getObjectId(), 200, _Angle, 85, 4000, 10000));
  1888.             startQuestTimer("morph_17b", 7400, frintezza, null);
  1889.             startQuestTimer("morph_18", 7500, frintezza, null);
  1890.         }
  1891.         else if (event.equalsIgnoreCase("morph_17b"))
  1892.         {
  1893.             frintezza.doDie(frintezza);
  1894.         }
  1895.         else if (event.equalsIgnoreCase("morph_18"))
  1896.         {
  1897.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 100, 120, 5, 0, 7000));
  1898.             startQuestTimer("morph_19", 0, frintezza, null);
  1899.         }
  1900.         else if (event.equalsIgnoreCase("morph_19"))
  1901.         {
  1902.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 100, 90, 5, 5000, 15000));
  1903.             startQuestTimer("morph_20", 7000, frintezza, null);
  1904.             startQuestTimer("spawn_cubes", 7000, frintezza, null);
  1905.         }
  1906.         else if (event.equalsIgnoreCase("morph_20"))
  1907.         {
  1908.             _Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 900, 90, 25, 7000, 10000));
  1909.             startQuestTimer("start_pc", 7000, frintezza, null);
  1910.         }
  1911.         else if (event.equalsIgnoreCase("songs_play"))
  1912.         {
  1913.             if (frintezza != null && !frintezza.isDead() && _OnMorph == 0)
  1914.             {
  1915.                 _OnSong = Rnd.get(1, 5);
  1916.                 if (_OnSong == 3)
  1917.                 { // to fix skill exception
  1918.                     _OnSong = 2;
  1919.                 }
  1920.                 
  1921.                 String SongName = "";
  1922.                 
  1923.                 // Name of the songs are custom, named with client side description.
  1924.                 switch (_OnSong)
  1925.                 {
  1926.                     case 1:
  1927.                         SongName = "Frintezza's Healing Rhapsody";
  1928.                         break;
  1929.                     case 2:
  1930.                         SongName = "Frintezza's Rampaging Opus";
  1931.                         break;
  1932.                     case 3:
  1933.                         SongName = "Frintezza's Power Concerto";
  1934.                         break;
  1935.                     case 4:
  1936.                         SongName = "Frintezza's Plagued Concerto";
  1937.                         break;
  1938.                     case 5:
  1939.                         SongName = "Frintezza's Psycho Symphony";
  1940.                         break;
  1941.                     default:
  1942.                         SongName = "Frintezza's Song";
  1943.                         break;
  1944.                 }
  1945.                 
  1946.                 // Like L2OFF the skill name is printed on screen
  1947.                 _Zone.broadcastPacket(new ExShowScreenMessage(SongName, 6000));
  1948.                 
  1949.                 if (_OnSong == 1 && _ThirdMorph == 1 && strongScarlet.getCurrentHp() < strongScarlet.getMaxHp() * 0.6 && Rnd.get(100) < 80)
  1950.                 {
  1951.                     _Zone.broadcastPacket(new MagicSkillUser(frintezza, frintezza, 5007, 1, 32000, 0));
  1952.                     startQuestTimer("songs_effect", 5000, frintezza, null);
  1953.                     startQuestTimer("songs_play", 32000 + Rnd.get(10000), frintezza, null);
  1954.                 }
  1955.                 else if (_OnSong == 2 || _OnSong == 3)
  1956.                 {
  1957.                     _Zone.broadcastPacket(new MagicSkillUser(frintezza, frintezza, 5007, _OnSong, 32000, 0));
  1958.                     startQuestTimer("songs_effect", 5000, frintezza, null);
  1959.                     startQuestTimer("songs_play", 32000 + Rnd.get(10000), frintezza, null);
  1960.                 }
  1961.                 else if (_OnSong == 4 && _SecondMorph == 1)
  1962.                 {
  1963.                     _Zone.broadcastPacket(new MagicSkillUser(frintezza, frintezza, 5007, 4, 31000, 0));
  1964.                     startQuestTimer("songs_effect", 5000, frintezza, null);
  1965.                     startQuestTimer("songs_play", 31000 + Rnd.get(10000), frintezza, null);
  1966.                 }
  1967.                 else if (_OnSong == 5 && _ThirdMorph == 1 && _Abnormal == 0)
  1968.                 {
  1969.                     _Abnormal = 1;
  1970.                     _Zone.broadcastPacket(new MagicSkillUser(frintezza, frintezza, 5007, 5, 35000, 0));
  1971.                     startQuestTimer("songs_effect", 5000, frintezza, null);
  1972.                     startQuestTimer("songs_play", 35000 + Rnd.get(10000), frintezza, null);
  1973.                 }
  1974.                 else
  1975.                 {
  1976.                     startQuestTimer("songs_play", 5000 + Rnd.get(5000), frintezza, null);
  1977.                 }
  1978.             }
  1979.         }
  1980.         else if (event.equalsIgnoreCase("songs_effect"))
  1981.         {
  1982.             L2Skill skill = SkillTable.getInstance().getInfo(5008, _OnSong);
  1983.             if (skill == null)
  1984.             {
  1985.                 return null;
  1986.             }
  1987.             
  1988.             String SongName = "";
  1989.             
  1990.             // Name of the songs are custom, named with client side description.
  1991.             switch (_OnSong)
  1992.             {
  1993.                 case 1:
  1994.                     SongName = "Frintezza's Concert Hall Melody";
  1995.                     break;
  1996.                 case 2:
  1997.                     SongName = "Frintezza's Rampaging Opus en masse";
  1998.                     break;
  1999.                 case 3:
  2000.                     SongName = "Frintezza Power Encore";
  2001.                     break;
  2002.                 case 4:
  2003.                     SongName = "Mournful Chorale Prelude";
  2004.                     break;
  2005.                 case 5:
  2006.                     SongName = "Hypnotic Mazurka ";
  2007.                     break;
  2008.                 default:
  2009.                     SongName = "Frintezza's Song";
  2010.                     break;
  2011.             }
  2012.             
  2013.             // Like L2OFF the skill name is printed on screen
  2014.             _Zone.broadcastPacket(new ExShowScreenMessage(SongName, 6000));
  2015.             
  2016.             if (_OnSong == 1 || _OnSong == 2 || _OnSong == 3)
  2017.             {
  2018.                 /*
  2019.                  * TODO: Frintezza songs to be fixed like retail if (frintezza != null && !frintezza.isDead() && activeScarlet != null && !activeScarlet.isDead()) skill.getEffects(frintezza, activeScarlet, false, false, false);
  2020.                  */
  2021.             }
  2022.             else if (_OnSong == 4)
  2023.             {
  2024.                 for (L2Character cha : _Zone.getCharactersInside())
  2025.                 {
  2026.                     if (cha instanceof L2PcInstance && Rnd.get(100) < 80)
  2027.                     {
  2028.                         skill.getEffects(frintezza, cha, false, false, false);
  2029.                         cha.sendPacket(new SystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT).addSkillName(5008, 4));
  2030.                     }
  2031.                 }
  2032.             }
  2033.             else if (_OnSong == 5)
  2034.             {
  2035.                 for (L2Character cha : _Zone.getCharactersInside())
  2036.                 {
  2037.                     if (cha instanceof L2PcInstance && Rnd.get(100) < 70)
  2038.                     {
  2039.                         /*
  2040.                          * cha.abortAttack(); cha.abortCast(); cha.disableAllSkills(); cha.stopMove(null); cha.setIsImobilised(true); cha.setIsParalyzed(true); cha.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); skill.getEffects(frintezza, cha, false, false, false);
  2041.                          * cha.startAbnormalEffect(L2Character.ABNORMAL_EFFECT_DANCE_STUNNED);
  2042.                          */
  2043.                         skill.getEffects(frintezza, cha, false, false, false);
  2044.                         cha.sendPacket(new SystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT).addSkillName(5008, 5));
  2045.                     }
  2046.                 }
  2047.                 // startQuestTimer("stop_effect", 25000, frintezza, null);
  2048.             }
  2049.         }
  2050.         /*
  2051.          * else if (event.equalsIgnoreCase("stop_effect")) { for (L2Character cha : _Zone.getCharactersInside()) { if (cha instanceof L2PcInstance) { cha.stopAbnormalEffect(L2Character.ABNORMAL_EFFECT_DANCE_STUNNED); cha.stopAbnormalEffect(L2Character.ABNORMAL_EFFECT_FLOATING_ROOT);
  2052.          * cha.enableAllSkills(); cha.setIsImobilised(false); cha.setIsParalyzed(false); } } _Abnormal = 0; }
  2053.          */
  2054.         else if (event.equalsIgnoreCase("attack_stop"))
  2055.         {
  2056.             cancelQuestTimer("skill01", npc, null);
  2057.             cancelQuestTimer("skill02", npc, null);
  2058.             cancelQuestTimer("skill03", npc, null);
  2059.             cancelQuestTimer("songs_play", npc, null);
  2060.             cancelQuestTimer("songs_effect", npc, null);
  2061.             
  2062.             if (frintezza != null)
  2063.             {
  2064.                 _Zone.broadcastPacket(new MagicSkillCanceld(frintezza.getObjectId()));
  2065.             }
  2066.         }
  2067.         else if (event.equalsIgnoreCase("check_hp"))
  2068.         {
  2069.             if (npc.isDead())
  2070.             {
  2071.                 _OnMorph = 1;
  2072.                 _Zone.broadcastPacket(new PlaySound(1, "BS01_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
  2073.                 
  2074.                 startQuestTimer("attack_stop", 0, frintezza, null);
  2075.                 startQuestTimer("stop_pc", 0, npc, null);
  2076.                 startQuestTimer("stop_npc", 0, npc, null);
  2077.                 startQuestTimer("morph_16", 0, npc, null);
  2078.             }
  2079.             else
  2080.             {
  2081.                 _CheckDie = _CheckDie + 10;
  2082.                 if (_CheckDie < 3000)
  2083.                 {
  2084.                     startQuestTimer("check_hp", 10, npc, null);
  2085.                 }
  2086.                 else
  2087.                 {
  2088.                     _OnCheck = 0;
  2089.                     _CheckDie = 0;
  2090.                 }
  2091.             }
  2092.         }
  2093.         else if (event.equalsIgnoreCase("skill01"))
  2094.         {
  2095.             if (weakScarlet != null && !weakScarlet.isDead() && _SecondMorph == 0 && _ThirdMorph == 0 && _OnMorph == 0)
  2096.             {
  2097.                 int i = Rnd.get(0, 1);
  2098.                 L2Skill skill = SkillTable.getInstance().getInfo(_skill[i][0], _skill[i][1]);
  2099.                 if (skill != null)
  2100.                 {
  2101.                     weakScarlet.stopMove(null);
  2102.                     weakScarlet.doCast(skill);
  2103.                 }
  2104.                 startQuestTimer("skill01", _skill[i][2] + 5000 + Rnd.get(10000), npc, null);
  2105.             }
  2106.         }
  2107.         else if (event.equalsIgnoreCase("skill02"))
  2108.         {
  2109.             if (weakScarlet != null && !weakScarlet.isDead() && _SecondMorph == 1 && _ThirdMorph == 0 && _OnMorph == 0)
  2110.             {
  2111.                 int i = 0;
  2112.                 if (_Abnormal == 0)
  2113.                 {
  2114.                     i = Rnd.get(2, 5);
  2115.                 }
  2116.                 else
  2117.                 {
  2118.                     i = Rnd.get(2, 4);
  2119.                 }
  2120.                 
  2121.                 L2Skill skill = SkillTable.getInstance().getInfo(_skill[i][0], _skill[i][1]);
  2122.                 if (skill != null)
  2123.                 {
  2124.                     weakScarlet.stopMove(null);
  2125.                     weakScarlet.doCast(skill);
  2126.                 }
  2127.                 startQuestTimer("skill02", _skill[i][2] + 5000 + Rnd.get(10000), npc, null);
  2128.                 
  2129.                 /*
  2130.                  * if (i == 5) { _Abnormal = 1; startQuestTimer("float_effect", 4000, weakScarlet, null); }
  2131.                  */
  2132.             }
  2133.         }
  2134.         else if (event.equalsIgnoreCase("skill03"))
  2135.         {
  2136.             if (strongScarlet != null && !strongScarlet.isDead() && _SecondMorph == 1 && _ThirdMorph == 1 && _OnMorph == 0)
  2137.             {
  2138.                 int i = 0;
  2139.                 if (_Abnormal == 0)
  2140.                 {
  2141.                     i = Rnd.get(6, 10);
  2142.                 }
  2143.                 else
  2144.                 {
  2145.                     i = Rnd.get(6, 9);
  2146.                 }
  2147.                 
  2148.                 L2Skill skill = SkillTable.getInstance().getInfo(_skill[i][0], _skill[i][1]);
  2149.                 if (skill != null)
  2150.                 {
  2151.                     strongScarlet.stopMove(null);
  2152.                     // strongScarlet.setIsCastingNow(true);
  2153.                     strongScarlet.doCast(skill);
  2154.                 }
  2155.                 startQuestTimer("skill03", _skill[i][2] + 5000 + Rnd.get(10000), npc, null);
  2156.                 
  2157.                 /*
  2158.                  * if (i == 10) { _Abnormal = 1; startQuestTimer("float_effect", 3000, npc, null); }
  2159.                  */
  2160.             }
  2161.         }
  2162.         /*
  2163.          * else if (event.equalsIgnoreCase("float_effect")) { if (npc.isCastingNow()) { startQuestTimer("float_effect", 500, npc, null); } else { for (L2Character cha : _Zone.getCharactersInside()) { if (cha instanceof L2PcInstance) { if (cha.getFirstEffect(5016) != null) { cha.abortAttack();
  2164.          * cha.abortCast(); cha.disableAllSkills(); cha.stopMove(null); cha.setIsImobilised(true); cha.setIsParalyzed(true); cha.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); cha.startAbnormalEffect(L2Character.ABNORMAL_EFFECT_FLOATING_ROOT); } } } startQuestTimer("stop_effect", 15000, npc,
  2165.          * null); } }
  2166.          */
  2167.         else if (event.equalsIgnoreCase("action"))
  2168.         {
  2169.             _Zone.broadcastPacket(new SocialAction(npc.getObjectId(), 1));
  2170.         }
  2171.         else if (event.equalsIgnoreCase("bomber"))
  2172.         {
  2173.             _Bomber = 0;
  2174.         }
  2175.         else if (event.equalsIgnoreCase("room_final"))
  2176.         {
  2177.             _Zone.broadcastPacket(new CreatureSay(npc.getObjectId(), 1, npc.getName(), "Exceeded his time limit, challenge failed!"));
  2178.             _Zone.oustAllPlayers();
  2179.             
  2180.             cancelQuestTimer("waiting", npc, null);
  2181.             cancelQuestTimer("frintezza_despawn", null, null);
  2182.             startQuestTimer("clean", 1000, npc, null);
  2183.             startQuestTimer("close", 1000, npc, null);
  2184.             startQuestTimer("room1_del", 1000, npc, null);
  2185.             startQuestTimer("room2_del", 1000, npc, null);
  2186.             
  2187.             GrandBossManager.getInstance().setBossStatus(FRINTEZZA, DORMANT);
  2188.         }
  2189.         else if (event.equalsIgnoreCase("frintezza_despawn"))
  2190.         {
  2191.             temp = (System.currentTimeMillis() - _LastAction);
  2192.             if (temp > 900000)
  2193.             {
  2194.                 _Zone.oustAllPlayers();
  2195.                 
  2196.                 cancelQuestTimer("waiting", npc, null);
  2197.                 // cancelQuestTimer("loc_check");
  2198.                 cancelQuestTimer("room_final", null, null);
  2199.                 cancelQuestTimer("spawn_minion", npc, null);
  2200.                 startQuestTimer("clean", 1000, npc, null);
  2201.                 startQuestTimer("close", 1000, npc, null);
  2202.                 startQuestTimer("attack_stop", 1000, npc, null);
  2203.                 startQuestTimer("room1_del", 1000, npc, null);
  2204.                 startQuestTimer("room2_del", 1000, npc, null);
  2205.                 startQuestTimer("room3_del", 1000, npc, null);
  2206.                 startQuestTimer("minions_despawn", 1000, npc, null);
  2207.                 
  2208.                 GrandBossManager.getInstance().setBossStatus(FRINTEZZA, DORMANT);
  2209.                 
  2210.                 cancelQuestTimer("frintezza_despawn", null, null);
  2211.             }
  2212.         }
  2213.         else if (event.equalsIgnoreCase("minions_despawn"))
  2214.         {
  2215.             synchronized (Minions)
  2216.             {
  2217.                 for (int i = 0; i < Minions.size(); i++)
  2218.                 {
  2219.                     L2Attackable mob = Minions.get(i);
  2220.                     if (mob != null)
  2221.                     {
  2222.                         mob.decayMe();
  2223.                     }
  2224.                 }
  2225.                 Minions.clear();
  2226.             }
  2227.             
  2228.         }
  2229.         else if (event.equalsIgnoreCase("spawn_minion"))
  2230.         {
  2231.             if (npc != null && !npc.isDead() && frintezza != null && !frintezza.isDead())
  2232.             {
  2233.                 L2NpcInstance mob = addSpawn(npc.getNpcId() + 2, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
  2234.                 
  2235.                 synchronized (Minions)
  2236.                 {
  2237.                     Minions.add((L2Attackable) mob);
  2238.                 }
  2239.                 
  2240.                 startQuestTimer("action", 200, mob, null);
  2241.                 startQuestTimer("spawn_minion", 18000, npc, null);
  2242.             }
  2243.         }
  2244.         else if (event.equalsIgnoreCase("spawn_cubes"))
  2245.         {
  2246.             addSpawn(CUBE, 174232, -88020, -5114, 16384, false, 900000);
  2247.         }
  2248.         else if (event.equalsIgnoreCase("frintezza_unlock"))
  2249.         {
  2250.             GrandBossManager.getInstance().setBossStatus(FRINTEZZA, DORMANT);
  2251.         }
  2252.         else if (event.equalsIgnoreCase("remove_players"))
  2253.         {
  2254.             _Zone.oustAllPlayers();
  2255.         }
  2256.         
  2257.         return super.onAdvEvent(event, npc, player);
  2258.     }
  2259.     
  2260.     @Override
  2261.     public String onTalk(L2NpcInstance npc, L2PcInstance player)
  2262.     {
  2263.         if (npc.getNpcId() == CUBE)
  2264.         {
  2265.             int x = 150037 + Rnd.get(500);
  2266.             int y = -57720 + Rnd.get(500);
  2267.             player.teleToLocation(x, y, -2976);
  2268.             return null;
  2269.         }
  2270.         
  2271.         String htmltext = null;
  2272.         
  2273.         Integer status = GrandBossManager.getInstance().getBossStatus(FRINTEZZA);
  2274.         
  2275.         if (status == DEAD)
  2276.         {
  2277.             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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement