Advertisement
Guest User

Frintezza arrumando

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