Advertisement
Guest User

frit

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