Frintezza.java 53 KB

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