Advertisement
Guest User

frintezza

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