Facebook
From Williams, 3 Years ago, written in JavaScript.
Embed
Download Paste or View Raw
Hits: 266
  1. diff --git a/aCis_datapack/data/html/default/32011.htm b/aCis_datapack/data/html/default/32011.htm
  2. index 2341448..2c05cd2 100644
  3. --- a/aCis_datapack/data/html/default/32011.htm
  4. +++ b/aCis_datapack/data/html/default/32011.htm
  5. @@ -1,7 +1,7 @@
  6.  <html><body>
  7.  I feel an invisible barrier... Some sort of Magic Force Field has been put in place...<br>
  8.  ...? The guide of the Imperial mausoleum seems to have something to say.<br><br>
  9. -<a action="bypass -h npc_%objectId%_Quest FinalEmperialTomb">Enter the Magic Force Field</a><br>
  10. +<a action="bypass -h npc_%objectId%_Quest GrandBossTeleporters">Enter the Magic Force Field</a><br>
  11.  <a action="bypass -h npc_%objectId%_Chat 1">Listen to Imperial Tomb Guide</a><br>
  12.  <a action="bypass -h npc_%objectId%_Quest">Quest</a>
  13.  </body></html>
  14. \ No newline at end of file
  15. diff --git a/aCis_datapack/data/xml/items/8100-8199.xml b/aCis_datapack/data/xml/items/8100-8199.xml
  16. index 4bb03ff..5bf6ca6 100644
  17. --- a/aCis_datapack/data/xml/items/8100-8199.xml
  18. +++ b/aCis_datapack/data/xml/items/8100-8199.xml
  19. @@ -1658,6 +1658,7 @@
  20.      <set name="material" val="GOLD" />
  21.      <set name="weight" val="3" />
  22.      <set name="is_stackable" val="true" />
  23. +    <set name="handler" val="ItemSkills" />
  24.      <set name="item_skill" val="2234-1" />
  25.    </item>
  26.    <item id="8193" type="EtcItem" name="Fisherman's Potion - Green">
  27. diff --git a/aCis_datapack/data/xml/items/8500-8599.xml b/aCis_datapack/data/xml/items/8500-8599.xml
  28. index afa9970..930dbf6 100644
  29. --- a/aCis_datapack/data/xml/items/8500-8599.xml
  30. +++ b/aCis_datapack/data/xml/items/8500-8599.xml
  31. @@ -607,6 +607,7 @@
  32.      <set name="material" val="GOLD" />
  33.      <set name="weight" val="3" />
  34.      <set name="is_stackable" val="true" />
  35. +    <set name="handler" val="ItemSkills" />
  36.      <set name="item_skill" val="2276-1" />
  37.    </item>
  38.    <item id="8557" type="Armor" name="Blue Party Hat">
  39. diff --git a/aCis_datapack/data/xml/scripts.xml b/aCis_datapack/data/xml/scripts.xml
  40. index 1efb505..091956b 100644
  41. --- a/aCis_datapack/data/xml/scripts.xml
  42. +++ b/aCis_datapack/data/xml/scripts.xml
  43. @@ -374,7 +374,7 @@
  44.         <script path="scripts.ai.individual.Benom"/>
  45.         <script path="scripts.ai.individual.Core"/>
  46.         <script path="scripts.ai.individual.DrChaos"/>
  47. -<!--   <script path="scripts.ai.individual.Frintezza"/> -->
  48. +       <script path="scripts.ai.individual.Frintezza"/>
  49.         <script path="scripts.ai.individual.Gordon"/>
  50.  <!--   <script path="scripts.ai.individual.IceFairySirra"/> -->
  51.         <script path="scripts.ai.individual.Orfen"/>
  52. diff --git a/aCis_datapack/data/xml/skills/2200-2299.xml b/aCis_datapack/data/xml/skills/2200-2299.xml
  53. index 5ebb754..3869761 100644
  54. --- a/aCis_datapack/data/xml/skills/2200-2299.xml
  55. +++ b/aCis_datapack/data/xml/skills/2200-2299.xml
  56. @@ -550,15 +550,19 @@
  57.                 <set name="magicLvl" val="85" />
  58.                 <set name="ignoreResists" val="true" />
  59.                 <set name="operateType" val="OP_ACTIVE" />
  60. -               <set name="hitTime" val="500" />
  61. -               <set name="reuseDelay" val="30000" />
  62. +               <set name="weaponsAllowed" val="BOW" /> <!-- Bow -->
  63. +               <set name="itemConsumeId" val="8192" /> <!-- Soul Breaking Arrow -->
  64. +               <set name="itemConsumeCount" val="0" />
  65. +               <set name="hitTime" val="2000" />
  66. +               <set name="coolTime" val="1000" />
  67. +               <set name="reuseDelay" val="60000" />
  68.                 <set name="staticHitTime" val="true" />
  69. +               <set name="staticReuse" val="true" />
  70.                 <cond msgId="113" addName="1">
  71. -                       <using kind="BOW" />
  72. +                       <and>
  73. +                               <target npcId="29045" /> <!-- Frintezza -->
  74. +                       </and>
  75.                 </cond>
  76. -               <for>
  77. -                       <effect name="Stun" time="9" val="0" effectPower="50" effectType="STUN" stackOrder="1" stackType="stun" />
  78. -               </for>
  79.         </skill>
  80.         <skill id="2235" levels="1" name="Anteroom Door Key">
  81.                 <set name="target" val="TARGET_UNLOCKABLE" />
  82. @@ -1200,11 +1204,24 @@
  83.                 </cond>
  84.         </skill>
  85.         <skill id="2276" levels="1" name="Dewdrop of Destruction">
  86. -               <set name="target" val="TARGET_NONE" />
  87. -               <set name="skillType" val="NOTDONE" />
  88. -               <set name="operateType" val="OP_ACTIVE" />
  89. -               <set name="hitTime" val="2000" />
  90. -               <set name="staticHitTime" val="true" />
  91. +               <set name="power" val="9999" />
  92. +        <set name="target" val="TARGET_ONE"/>
  93. +        <set name="skillType" val="PDAM"/>
  94. +        <set name="operateType" val="OP_ACTIVE"/>
  95. +        <set name="itemConsumeId" val="8556"/> <!-- Dewdrop of Destruction -->
  96. +        <set name="itemConsumeCount" val="0"/>
  97. +        <set name="castRange" val="900"/>
  98. +        <set name="effectRange" val="1400"/>
  99. +        <set name="hitTime" val="2000"/>
  100. +        <set name="coolTime" val="1000"/>
  101. +        <set name="reuseDelay" val="3000"/>
  102. +        <set name="staticHitTime" val="true"/>
  103. +        <set name="staticReuse" val="true"/>
  104. +        <cond msgId="113" addName="1">
  105. +            <and>
  106. +                <target npcId="29048,29049"/> <!-- Evil Spirit -->
  107. +            </and>
  108. +        </cond>
  109.         </skill>
  110.         <skill id="2277" levels="6" name="Event Gift Box">
  111.                 <table name="#extractableItems">
  112. diff --git a/aCis_datapack/data/xml/skills/5000-5099.xml b/aCis_datapack/data/xml/skills/5000-5099.xml
  113. index 897b527..f474720 100644
  114. --- a/aCis_datapack/data/xml/skills/5000-5099.xml
  115. +++ b/aCis_datapack/data/xml/skills/5000-5099.xml
  116. @@ -68,8 +68,8 @@
  117.                 <set name="skillType" val="PDAM" />
  118.                 <set name="target" val="TARGET_AURA" />
  119.                 <for>
  120. -                       <effect name="ThrowUp" noicon="1" val="0" stackOrder="1" stackType="fly_away" />
  121. -                       <effect name="Stun" time="2" val="0" effectPower="100" effectType="STUN" />
  122. +                       <effect name="ThrowUp" noicon="1" val="0" abnormalLvl="1" abnormalType="fly_away" />
  123. +                       <effect name="Stun" abnormalTime="2" val="0" effectPower="100" effectType="STUN" />
  124.                 </for>
  125.         </skill>
  126.         <skill id="5005" levels="1" name="Frintezza's Ghost Summoning">
  127. @@ -268,7 +268,7 @@
  128.                 <set name="skillType" val="HEAL_PERCENT" />
  129.                 <set name="target" val="TARGET_SELF" />
  130.                 <for>
  131. -                       <effect name="Grow" time="7200" val="0" stackOrder="1" stackType="big_body">
  132. +                       <effect name="Buff" time="7200" val="0" stackOrder="1">
  133.                                 <mul order="0x30" stat="runSpd" val="1.22" />
  134.                         </effect>
  135.                 </for>
  136. diff --git a/aCis_datapack/data/xml/zones/BossZone.xml b/aCis_datapack/data/xml/zones/BossZone.xml
  137. index 846e93b..538a3eb 100644
  138. --- a/aCis_datapack/data/xml/zones/BossZone.xml
  139. +++ b/aCis_datapack/data/xml/zones/BossZone.xml
  140. @@ -109,13 +109,12 @@
  141.                 <node x="26846" y="-8117" />
  142.                 <node x="28231" y="-8163" />
  143.         </zone>
  144. -       <zone id="110012" shape="NPoly" minZ="-5200" maxZ="-4680"><!-- Frintezza -->
  145. -               <stat name="InvadeTime" val="1800000" />
  146. -               <node x="172031" y="-90127" />
  147. -               <node x="176428" y="-90089" />
  148. -               <node x="176428" y="-74051" />
  149. -               <node x="172057" y="-74108" />
  150. -       </zone>
  151. +        <zone id="110012" type="BossZone" shape="Cuboid" minZ="-5140" maxZ="-4000"> <!-- Frintezza -->
  152. +        <stat name="InvadeTime" val="1800000" />
  153. +               <stat name="isFlag" val="true" />
  154. +        <node x="172176" y="-74106" />
  155. +        <node x="176284" y="-90033" />
  156. +    </zone>
  157.         <zone id="110013" shape="NPoly" minZ="-5136" maxZ="864"><!-- Ice Fairy 1 -->
  158.                 <stat name="InvadeTime" val="1800000" />
  159.                 <node x="101450" y="-130042" />
  160. diff --git a/aCis_gameserver/b/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Frintezza.java b/aCis_gameserver/b/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Frintezza.java
  161. new file mode 100644
  162. index 0000000..11898b1
  163. --- /dev/null
  164. +++ b/aCis_gameserver/b/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/ai/individual/Frintezza.java
  165. @@ -0,0 +1,1101 @@
  166. + package net.sf.l2j.gameserver.scripting.scripts.ai.individual;
  167.  
  168. + import java.util.Set;
  169. + import java.util.concurrent.ConcurrentHashMap;
  170. + import net.sf.l2j.commons.random.Rnd;
  171. + import net.sf.l2j.commons.util.StatsSet;
  172. +
  173. + import net.sf.l2j.Config;
  174. + import net.sf.l2j.gameserver.data.SkillTable;
  175. + import net.sf.l2j.gameserver.data.manager.GrandBossManager;
  176. + import net.sf.l2j.gameserver.data.manager.ZoneManager;
  177. + import net.sf.l2j.gameserver.data.xml.DoorData;
  178. + import net.sf.l2j.gameserver.enums.IntentionType;
  179. + import net.sf.l2j.gameserver.enums.ScriptEventType;
  180. + import net.sf.l2j.gameserver.enums.skills.AbnormalEffect;
  181. + import net.sf.l2j.gameserver.enums.skills.FlyType;
  182. + import net.sf.l2j.gameserver.model.L2Skill;
  183. + import net.sf.l2j.gameserver.model.WorldObject;
  184. + import net.sf.l2j.gameserver.model.actor.Creature;
  185. + import net.sf.l2j.gameserver.model.actor.Npc;
  186. + import net.sf.l2j.gameserver.model.actor.Player;
  187. + import net.sf.l2j.gameserver.model.actor.instance.GrandBoss;
  188. + import net.sf.l2j.gameserver.model.zone.type.BossZone;
  189. + import net.sf.l2j.gameserver.network.SystemMessageId;
  190. + import net.sf.l2j.gameserver.network.clientpackets.Say2;
  191. + import net.sf.l2j.gameserver.network.serverpackets.AbstractNpcInfo.NpcInfo;
  192. + import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
  193. + import net.sf.l2j.gameserver.network.serverpackets.Earthquake;
  194. + import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;
  195. + import net.sf.l2j.gameserver.network.serverpackets.FlyToLocation;
  196. + import net.sf.l2j.gameserver.network.serverpackets.MagicSkillCanceled;
  197. + import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
  198. + import net.sf.l2j.gameserver.network.serverpackets.PlaySound;
  199. + import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
  200. + import net.sf.l2j.gameserver.network.serverpackets.SpecialCamera;
  201. + import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  202. + import net.sf.l2j.gameserver.network.serverpackets.ValidateLocation;
  203. + import net.sf.l2j.gameserver.scripting.scripts.ai.L2AttackableAIScript;
  204. +
  205. + public class Frintezza extends L2AttackableAIScript
  206. + {
  207. +       private static final BossZone ZONE = ZoneManager.getInstance().getZoneById(110012, BossZone.class);
  208. +      
  209. +       private static final int[][] SKILLS =
  210. +       {
  211. +               { 5015, 1, 5000 },
  212. +               { 5015, 4, 5000 },
  213. +               { 5015, 2, 5000 },
  214. +               { 5015, 5, 5000 },
  215. +               { 5018, 1, 10000 },
  216. +               { 5016, 1, 5000 },
  217. +               { 5015, 3, 5000 },
  218. +               { 5015, 6, 5000 },
  219. +               { 5018, 2, 10000 },
  220. +               { 5019, 1, 10000 },
  221. +               { 5016, 1, 5000 }
  222. +       };
  223. +      
  224. +       private static final int[][] MOBS =
  225. +       {
  226. +               { 18328,172894,-76019,-5107,243 },
  227. +               { 18328,174095,-77279,-5107,16216 },
  228. +               { 18328,174111,-74833,-5107,49043 },
  229. +               { 18328,175344,-76042,-5107,32847 },
  230. +               { 18330,173489,-76227,-5134,63565 },
  231. +               { 18330,173498,-75724,-5107,58498 },
  232. +               { 18330,174365,-76745,-5107,22424 },
  233. +               { 18330,174570,-75584,-5107,31968 },
  234. +               { 18330,174613,-76179,-5107,31471 },
  235. +               { 18332,173620,-75981,-5107,4588 },
  236. +               { 18332,173630,-76340,-5107,62454 },
  237. +               { 18332,173755,-75613,-5107,57892 },
  238. +               { 18332,173823,-76688,-5107,2411 },
  239. +               { 18332,174000,-75411,-5107,54718 },
  240. +               { 18332,174487,-75555,-5107,33861 },
  241. +               { 18332,174517,-76471,-5107,21893 },
  242. +               { 18332,174576,-76122,-5107,31176 },
  243. +               { 18332,174600,-75841,-5134,35927 },
  244. +               { 18329,173481,-76043,-5107,61312 },
  245. +               { 18329,173539,-75678,-5107,59524 },
  246. +               { 18329,173584,-76386,-5107,3041 },
  247. +               { 18329,173773,-75420,-5107,51115 },
  248. +               { 18329,173777,-76650,-5107,12588 },
  249. +               { 18329,174585,-76510,-5107,21704 },
  250. +               { 18329,174623,-75571,-5107,40141 },
  251. +               { 18329,174744,-76240,-5107,29202 },
  252. +               { 18329,174769,-75895,-5107,29572 },
  253. +               { 18333,173861,-76011,-5107,383 },
  254. +               { 18333,173872,-76461,-5107,8041 },
  255. +               { 18333,173898,-75668,-5107,51856 },
  256. +               { 18333,174422,-75689,-5107,42878 },
  257. +               { 18333,174460,-76355,-5107,27311 },
  258. +               { 18333,174483,-76041,-5107,30947 },
  259. +               { 18331,173515,-76184,-5107,6971 },
  260. +               { 18331,173516,-75790,-5134,3142 },
  261. +               { 18331,173696,-76675,-5107,6757 },
  262. +               { 18331,173766,-75502,-5134,60827 },
  263. +               { 18331,174473,-75321,-5107,37147 },
  264. +               { 18331,174493,-76505,-5107,34503 },
  265. +               { 18331,174568,-75654,-5134,41661 },
  266. +               { 18331,174584,-76263,-5107,31729 },
  267. +               { 18339,173892,-81592,-5123,50849 },
  268. +               { 18339,173958,-81820,-5123,7459 },
  269. +               { 18339,174128,-81805,-5150,21495 },
  270. +               { 18339,174245,-81566,-5123,41760 },
  271. +               { 18334,173264,-81529,-5072,1646 },
  272. +               { 18334,173265,-81656,-5072,441 },
  273. +               { 18334,173267,-81889,-5072,0 },
  274. +               { 18334,173271,-82015,-5072,65382 },
  275. +               { 18334,174867,-81655,-5073,32537 },
  276. +               { 18334,174868,-81890,-5073,32768 },
  277. +               { 18334,174869,-81485,-5073,32315 },
  278. +               { 18334,174871,-82017,-5073,33007 },
  279. +               { 18335,173074,-80817,-5107,8353 },
  280. +               { 18335,173128,-82702,-5107,5345 },
  281. +               { 18335,173181,-82544,-5107,65135 },
  282. +               { 18335,173191,-80981,-5107,6947 },
  283. +               { 18335,174859,-80889,-5134,24103 },
  284. +               { 18335,174924,-82666,-5107,38710 },
  285. +               { 18335,174947,-80733,-5107,22449 },
  286. +               { 18335,175096,-82724,-5107,42205 },
  287. +               { 18336,173435,-80512,-5107,65215 },
  288. +               { 18336,173440,-82948,-5107,417 },
  289. +               { 18336,173443,-83120,-5107,1094 },
  290. +               { 18336,173463,-83064,-5107,286 },
  291. +               { 18336,173465,-80453,-5107,174 },
  292. +               { 18336,173465,-83006,-5107,2604 },
  293. +               { 18336,173468,-82889,-5107,316 },
  294. +               { 18336,173469,-80570,-5107,65353 },
  295. +               { 18336,173469,-80628,-5107,166 },
  296. +               { 18336,173492,-83121,-5107,394 },
  297. +               { 18336,173493,-80683,-5107,0 },
  298. +               { 18336,173497,-80510,-5134,417 },
  299. +               { 18336,173499,-82947,-5107,0 },
  300. +               { 18336,173521,-83063,-5107,316 },
  301. +               { 18336,173523,-82889,-5107,128 },
  302. +               { 18336,173524,-80627,-5134,65027 },
  303. +               { 18336,173524,-83007,-5107,0 },
  304. +               { 18336,173526,-80452,-5107,64735 },
  305. +               { 18336,173527,-80569,-5134,65062 },
  306. +               { 18336,174602,-83122,-5107,33104 },
  307. +               { 18336,174604,-82949,-5107,33184 },
  308. +               { 18336,174609,-80514,-5107,33234 },
  309. +               { 18336,174609,-80684,-5107,32851 },
  310. +               { 18336,174629,-80627,-5107,33346 },
  311. +               { 18336,174632,-80570,-5107,32896 },
  312. +               { 18336,174632,-83066,-5107,32768 },
  313. +               { 18336,174635,-82893,-5107,33594 },
  314. +               { 18336,174636,-80456,-5107,32065 },
  315. +               { 18336,174639,-83008,-5107,33057 },
  316. +               { 18336,174660,-80512,-5107,33057 },
  317. +               { 18336,174661,-83121,-5107,32768 },
  318. +               { 18336,174663,-82948,-5107,32768 },
  319. +               { 18336,174664,-80685,-5107,32676 },
  320. +               { 18336,174687,-83008,-5107,32520 },
  321. +               { 18336,174691,-83066,-5107,32961 },
  322. +               { 18336,174692,-80455,-5107,33202 },
  323. +               { 18336,174692,-80571,-5107,32768 },
  324. +               { 18336,174693,-80630,-5107,32994 },
  325. +               { 18336,174693,-82889,-5107,32622 },
  326. +               { 18337,172837,-82382,-5107,58363 },
  327. +               { 18337,172867,-81123,-5107,64055 },
  328. +               { 18337,172883,-82495,-5107,64764 },
  329. +               { 18337,172916,-81033,-5107,7099 },
  330. +               { 18337,172940,-82325,-5107,58998 },
  331. +               { 18337,172946,-82435,-5107,58038 },
  332. +               { 18337,172971,-81198,-5107,14768 },
  333. +               { 18337,172992,-81091,-5107,9438 },
  334. +               { 18337,173032,-82365,-5107,59041 },
  335. +               { 18337,173064,-81125,-5107,5827 },
  336. +               { 18337,175014,-81173,-5107,26398 },
  337. +               { 18337,175061,-82374,-5107,43290 },
  338. +               { 18337,175096,-81080,-5107,24719 },
  339. +               { 18337,175169,-82453,-5107,37672 },
  340. +               { 18337,175172,-80972,-5107,32315 },
  341. +               { 18337,175174,-82328,-5107,41760 },
  342. +               { 18337,175197,-81157,-5107,27617 },
  343. +               { 18337,175245,-82547,-5107,40275 },
  344. +               { 18337,175249,-81075,-5107,28435 },
  345. +               { 18337,175292,-82432,-5107,42225 },
  346. +               { 18338,173014,-82628,-5107,11874 },
  347. +               { 18338,173033,-80920,-5107,10425 },
  348. +               { 18338,173095,-82520,-5107,49152 },
  349. +               { 18338,173115,-80986,-5107,9611 },
  350. +               { 18338,173144,-80894,-5107,5345 },
  351. +               { 18338,173147,-82602,-5107,51316 },
  352. +               { 18338,174912,-80825,-5107,24270 },
  353. +               { 18338,174935,-80899,-5107,18061 },
  354. +               { 18338,175016,-82697,-5107,39533 },
  355. +               { 18338,175041,-80834,-5107,25420 },
  356. +               { 18338,175071,-82549,-5107,39163 },
  357. +               { 18338,175154,-82619,-5107,36345 }
  358. +       };
  359. +      
  360. +       private static final int[][] PORTRAITS =
  361. +       {
  362. +               { 29049,175876,-88713 },
  363. +               { 29049,172608,-88702 },
  364. +               { 29048,175833,-87165 },
  365. +               { 29048,172634,-87165 }
  366. +       };
  367. +      
  368. +       private static final int[][] DEMONS =
  369. +       {
  370. +               { 29051,175876,-88713,-4972,28205 },
  371. +               { 29051,172608,-88702,-4972,64817 },
  372. +               { 29050,175833,-87165,-4972,35048 },
  373. +               { 29050,172634,-87165,-4972,57730 }
  374. +       };
  375. +      
  376. +       public static final int SCARLET1 = 29046;
  377. +       public static final int SCARLET2 = 29047;
  378. +       public static final int FRINTEZZA = 29045;
  379. +       public static final int CUBE = 29061;
  380. +       public static final int EVIL_SPIRIT = 29048;
  381. +       public static final int EVIL_SPIRIT_2 = 29049;
  382. +      
  383. +       private static final int SOUL_BREAKING_ARROW = 8192;
  384. +       private static final int DEWDROP_OF_DESTRUCTION = 8556;
  385. +      
  386. +       // Frintezza Status Tracking
  387. +       public static final byte DORMANT = 0; // Frintezza is spawned and no one has entered yet. Entry is unlocked
  388. +       public static final byte WAITING = 1; // Frintezza is spawend and someone has entered, triggering a 30 minute window for additional people to enter before he unleashes his attack. Entry is unlocked
  389. +       //before he unleashes his attack. Entry is unlocked
  390. +       public static final byte FIGHTING = 2; // Frintezza is engaged in battle, annihilating his foes. Entry is locked
  391. +       public static final byte DEAD = 3; // Frintezza has been killed. Entry is locked
  392. +      
  393. +       private Set<Npc> _roomMobs = ConcurrentHashMap.newKeySet();
  394. +       private int _notice;
  395. +
  396. +       private static final int[] NPCS =
  397. +       {
  398. +               SCARLET1, SCARLET2, FRINTEZZA, 18328, 18329, 18330, 18331, 18332, 18333,
  399. +               18334, 18335, 18336, 18337, 18338, 18339, 29048, 29049, 29050, 29051, 32011
  400. +       };
  401. +      
  402. +       // remover proximo update
  403. +       private static long _LastAction = 0;
  404. +       private static int _Angle = 0;
  405. +       private static int _Bomber = 0;
  406. +       private static int _CheckDie = 0;
  407. +       private static int _OnCheck = 0;
  408. +       private static int _OnSong = 0;
  409. +       private static int _Abnormal = 0;
  410. +       private static int _OnMorph = 0;
  411. +       private static int _Scarlet_x = 0;
  412. +       private static int _Scarlet_y = 0;
  413. +       private static int _Scarlet_z = 0;
  414. +       private static int _Scarlet_h = 0;
  415. +       private static int _SecondMorph = 0;
  416. +       private static int _ThirdMorph = 0;
  417. +       private static int _SoulBreakArrowUse = 0;
  418. +       private GrandBoss frintezza, weakScarlet, strongScarlet, activeScarlet;
  419. +       private Npc _frintezzaDummy, _overheadDummy, _portraitDummy1, _portraitDummy3, _scarletDummy;
  420. +      
  421. +       @Override
  422. +       protected void registerNpcs()
  423. +       {
  424. +               addEventIds(NPCS, ScriptEventType.ON_ATTACK, ScriptEventType.ON_KILL, ScriptEventType.ON_SKILL_SEE);
  425. +       }
  426. +      
  427. +       public Frintezza()
  428. +       {
  429. +               super("ai/individual");
  430. +              
  431. +               final int status = GrandBossManager.getInstance().getBossStatus(FRINTEZZA);
  432. +               if (status == DEAD)
  433. +               {
  434. +                       final long temp = GrandBossManager.getInstance().getStatsSet(FRINTEZZA).getLong("respawn_time") - System.currentTimeMillis();
  435. +                       if (temp > 0)
  436. +                               startQuestTimer("frintezza_unlock", temp, null, null, false);
  437. +                       else
  438. +                               GrandBossManager.getInstance().setBossStatus(FRINTEZZA, DORMANT);
  439. +               }
  440. +               else if (status != DORMANT)
  441. +                       GrandBossManager.getInstance().setBossStatus(FRINTEZZA, DORMANT);
  442. +       }
  443. +      
  444. +       @Override
  445. +       public String onAdvEvent(String event, Npc npc, Player player)
  446. +       {
  447. +               if (event.equalsIgnoreCase("beginning"))
  448. +               {
  449. +                       closeDoors();
  450. +                       _notice = 35;
  451. +                       for (int i = 0; i <= 17; i++)
  452. +                               _roomMobs.add(addSpawn(MOBS[i][0], MOBS[i][1], MOBS[i][2], MOBS[i][3], MOBS[i][4], false, 0, false));
  453. +                      
  454. +                       ZONE.broadcastPacket(new CreatureSay(0, Say2.SHOUT, "Hall Alarm Device", "Intruders! Sound the alarm!"));
  455. +                      
  456. +                       startQuestTimer("notice", 60000, null, null, false);
  457. +                       startQuestTimer("frintezza_despawn", 60000, null, null, false);
  458. +               }
  459. +               else if (event.equalsIgnoreCase("notice"))
  460. +               {
  461. +                       if (_notice == 0)
  462. +                       {
  463. +                               ZONE.broadcastPacket(new CreatureSay(0, Say2.SHOUT, "Frintezza Gatekeeper", "Time limit exceeded, challenge failed!"));
  464. +                               ZONE.oustAllPlayers();
  465. +                              
  466. +                               cancelQuestTimers("notice");
  467. +                               cancelQuestTimers("frintezza_despawn");
  468. +                              
  469. +                               deleteAllMobs();
  470. +                               closeDoors();
  471. +                              
  472. +                               GrandBossManager.getInstance().setBossStatus(FRINTEZZA, DORMANT);
  473. +                       }
  474. +                      
  475. +                       _notice--;
  476. +                       ZONE.broadcastPacket(new ExShowScreenMessage(_notice + " minute(s) remaining.", 10000));
  477. +               }
  478. +               else if (event.equalsIgnoreCase("waiting"))
  479. +               {
  480. +                       startQuestTimer("close", 27000, npc, null, false);
  481. +                       startQuestTimer("camera_1", 30000, npc, null, false);
  482. +                       ZONE.broadcastPacket(new Earthquake(174232, -88020, -5116, 45, 27));
  483. +               }
  484. +               else if (event.equalsIgnoreCase("close"))
  485. +                       closeDoors();
  486. +               else if (event.equalsIgnoreCase("loc_check"))
  487. +               {
  488. +                       if (GrandBossManager.getInstance().getBossStatus(FRINTEZZA) == FIGHTING)
  489. +                       {
  490. +                               if (!ZONE.isInsideZone(npc))
  491. +                                       npc.moveToLocation(174232, -88020, -5116, 0);
  492. +                               if (npc.getX() < 171932 || npc.getX() > 176532 || npc.getY() < -90320 || npc.getY() > -85720 || npc.getZ() < -5130)
  493. +                                       npc.moveToLocation(174232, -88020, -5116, 0);
  494. +                       }
  495. +               }
  496. +               else if (event.equalsIgnoreCase("camera_1"))
  497. +               {
  498. +                       GrandBossManager.getInstance().setBossStatus(FRINTEZZA, FIGHTING);
  499. +                       _frintezzaDummy = addSpawn(29052, 174240, -89805, -5022, 16048, false, 0, false);
  500. +                       _frintezzaDummy.setIsInvul(true);
  501. +                       _frintezzaDummy.setIsImmobilized(true);
  502. +                       _overheadDummy = addSpawn(29052, 174232, -88020, -5110, 16384, false, 0, false);
  503. +                       _overheadDummy.setIsInvul(true);
  504. +                       _overheadDummy.setIsImmobilized(true);
  505. +                       _overheadDummy.setCollisionHeight(600);
  506. +                       ZONE.broadcastPacket(new NpcInfo(_overheadDummy, null));
  507. +                       _portraitDummy1 = addSpawn(29052, 172450, -87890, -5100, 16048, false, 0, false);
  508. +                       _portraitDummy1.setIsImmobilized(true);
  509. +                       _portraitDummy1.setIsInvul(true);
  510. +                       _portraitDummy3 = addSpawn(29052, 176012, -87890, -5100, 16048, false, 0, false);
  511. +                       _portraitDummy3.setIsImmobilized(true);
  512. +                       _portraitDummy3.setIsInvul(true);
  513. +                       _scarletDummy = addSpawn(29053, 174232, -88020, -5110, 16384, false, 0, false);
  514. +                       _scarletDummy.setIsInvul(true);
  515. +                       _scarletDummy.setIsImmobilized(true);
  516. +                      
  517. +                       stopPcActions();
  518. +                       startQuestTimer("camera_2", 1000, _overheadDummy, null, false);
  519. +               }
  520. +               else if (event.equalsIgnoreCase("camera_2"))
  521. +               {
  522. +                       ZONE.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 0, 75, -89, 0, 100, 0, 0, 1, 0));
  523. +                       startQuestTimer("camera_2b", 0, _overheadDummy, null, false);
  524. +               }
  525. +               else if (event.equalsIgnoreCase("camera_2b"))
  526. +               {
  527. +                       ZONE.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 0, 75, -89, 0, 100, 0, 0, 1, 0));
  528. +                       startQuestTimer("camera_3", 0, _overheadDummy, null, false);
  529. +               }
  530. +               else if (event.equalsIgnoreCase("camera_3"))
  531. +               {
  532. +                       ZONE.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 300, 90, -10, 6500, 7000, 0, 0, 1, 0));
  533. +                       frintezza = (GrandBoss) addSpawn(FRINTEZZA, 174240, -89805, -5022, 16048, false, 0, false);
  534. +                       GrandBossManager.getInstance().addBoss(frintezza);
  535. +                       frintezza.setIsImmobilized(true);
  536. +                       frintezza.setIsInvul(true);
  537. +                       frintezza.disableAllSkills();
  538. +                      
  539. +                       for (int[] demon : DEMONS)
  540. +                       {
  541. +                               final Npc demons = addSpawn(demon[0], demon[1], demon[2], demon[3], demon[4], false, 0, false);
  542. +                               demons.setIsImmobilized(true);
  543. +                               demons.disableAllSkills();
  544. +                       }
  545. +                      
  546. +                       startQuestTimer("camera_4", 6500, _overheadDummy, null, false);
  547. +               }
  548. +               else if (event.equalsIgnoreCase("camera_4"))
  549. +               {
  550. +                       ZONE.broadcastPacket(new SpecialCamera(_frintezzaDummy.getObjectId(), 1800, 90, 8, 6500, 7000, 0, 0, 1, 0));
  551. +                       startQuestTimer("camera_5", 900, _frintezzaDummy, null, false);
  552. +               }
  553. +               else if (event.equalsIgnoreCase("camera_5"))
  554. +               {
  555. +                       ZONE.broadcastPacket(new SpecialCamera(_frintezzaDummy.getObjectId(), 140, 90, 10, 2500, 4500, 0, 0, 1, 0));
  556. +                       startQuestTimer("camera_5b", 4000, _frintezzaDummy, null, false);
  557. +               }
  558. +               else if (event.equalsIgnoreCase("camera_5b"))
  559. +               {
  560. +                       ZONE.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 40, 75, -10, 0, 1000, 0, 0, 1, 0));
  561. +                       startQuestTimer("camera_6", 0, frintezza, null, false);
  562. +               }
  563. +               else if (event.equalsIgnoreCase("camera_6"))
  564. +               {
  565. +                       ZONE.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 40, 75, -10, 0, 12000, 0, 0, 1, 0));
  566. +                       startQuestTimer("camera_7", 1350, frintezza, null, false);
  567. +               }
  568. +               else if (event.equalsIgnoreCase("camera_7"))
  569. +               {
  570. +                       ZONE.broadcastPacket(new SocialAction(frintezza, 2));
  571. +                       startQuestTimer("camera_8", 7000, frintezza, null, false);
  572. +               }
  573. +               else if (event.equalsIgnoreCase("camera_8"))
  574. +               {
  575. +                       startQuestTimer("camera_9", 1000, frintezza, null, false);
  576. +                       _frintezzaDummy.deleteMe();
  577. +                       _frintezzaDummy = null;
  578. +               }
  579. +               else if (event.equalsIgnoreCase("camera_9"))
  580. +               {
  581. +                       for (Npc mob : ZONE.getKnownTypeInside(Npc.class))
  582. +                       {
  583. +                               if (mob.getNpcId() == 29051 || mob.getNpcId() == 29050)
  584. +                                       ZONE.broadcastPacket(new SocialAction(mob, 1));
  585. +                       }
  586. +                      
  587. +                       startQuestTimer("camera_9b", 400, frintezza, null, false);
  588. +               }
  589. +               else if (event.equalsIgnoreCase("camera_9b"))
  590. +               {
  591. +                       for (Npc mob : ZONE.getKnownTypeInside(Npc.class))
  592. +                       {
  593. +                               if (mob.getNpcId() == 29051 || mob.getNpcId() == 29050)
  594. +                                       ZONE.broadcastPacket(new SocialAction(mob, 1));
  595. +                       }
  596. +                      
  597. +                       for (Creature pc : ZONE.getKnownTypeInside(Player.class))
  598. +                       {
  599. +                               if (pc.getX() < 174232)
  600. +                                       pc.broadcastPacket(new SpecialCamera(_portraitDummy1.getObjectId(), 1000, 118, 0, 0, 1000, 0, 0, 1, 0));
  601. +                               else
  602. +                                       pc.broadcastPacket(new SpecialCamera(_portraitDummy3.getObjectId(), 1000, 62, 0, 0, 1000, 0, 0, 1, 0));
  603. +                       }
  604. +                      
  605. +                       for (Creature pc : ZONE.getKnownTypeInside(Player.class))
  606. +                       {
  607. +                               if (pc.getX() < 174232)
  608. +                                       pc.broadcastPacket(new SpecialCamera(_portraitDummy1.getObjectId(), 1000, 118, 0, 0, 10000, 0, 0, 1, 0));
  609. +                               else
  610. +                                       pc.broadcastPacket(new SpecialCamera(_portraitDummy3.getObjectId(), 1000, 62, 0, 0, 10000, 0, 0, 1, 0));
  611. +                       }
  612. +                      
  613. +                       startQuestTimer("camera_10", 2000, frintezza, null, false);
  614. +               }
  615. +               else if (event.equalsIgnoreCase("camera_10"))
  616. +               {
  617. +                       ZONE.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 240, 90, 0, 0, 1000, 0, 0, 1, 0));
  618. +                       ZONE.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 240, 90, 25, 5500, 10000, 0, 0, 1, 0));
  619. +                      
  620. +                       ZONE.broadcastPacket(new SocialAction(frintezza, 3));
  621. +                       _portraitDummy1.deleteMe();
  622. +                       _portraitDummy3.deleteMe();
  623. +                       _portraitDummy1 = null;
  624. +                       _portraitDummy3 = null;
  625. +                       startQuestTimer("camera_11b", 4000, frintezza, null, false);
  626. +                       startQuestTimer("camera_12", 4500, frintezza, null, false);
  627. +               }
  628. +               else if (event.equalsIgnoreCase("camera_11b"))
  629. +                       ZONE.broadcastPacket(new MagicSkillUse(frintezza, frintezza, 5006, 1, 34000, 0));
  630. +               else if (event.equalsIgnoreCase("camera_12"))
  631. +               {
  632. +                       ZONE.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 100, 195, 35, 0, 10000, 0, 0, 1, 0));
  633. +                       startQuestTimer("camera_13", 700, frintezza, null, false);
  634. +               }
  635. +               else if (event.equalsIgnoreCase("camera_13"))
  636. +               {
  637. +                       ZONE.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 100, 195, 35, 0, 10000, 0, 0, 1, 0));
  638. +                       startQuestTimer("camera_14", 1300, frintezza, null, false);
  639. +               }
  640. +               else if (event.equalsIgnoreCase("camera_14"))
  641. +               {
  642. +                       ZONE.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 120, 180, 45, 1500, 10000, 0, 0, 1, 0));
  643. +                       startQuestTimer("camera_16", 1500, frintezza, null, false);
  644. +               }
  645. +               else if (event.equalsIgnoreCase("camera_16"))
  646. +               {
  647. +                       ZONE.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 520, 135, 45, 8000, 10000, 0, 0, 1, 0));
  648. +                       startQuestTimer("camera_17", 7500, frintezza, null, false);
  649. +               }
  650. +               else if (event.equalsIgnoreCase("camera_17"))
  651. +               {
  652. +                       ZONE.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 1500, 110, 25, 10000, 13000, 0, 0, 1, 0));
  653. +                       startQuestTimer("camera_18", 9500, frintezza, null, false);
  654. +               }
  655. +               else if (event.equalsIgnoreCase("camera_18"))
  656. +               {
  657. +                       ZONE.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 930, 160, -20, 0, 1000, 0, 0, 1, 0));
  658. +                       ZONE.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 600, 180, -25, 0, 10000, 0, 0, 1, 0));
  659. +                       ZONE.broadcastPacket(new MagicSkillUse(_scarletDummy, _scarletDummy, 5004, 1, 5800, 0));
  660. +                      
  661. +                       weakScarlet = (GrandBoss) addSpawn(29046, 174232, -88020, -5110, 16384, false, 0, true);
  662. +                       weakScarlet.setIsInvul(true);
  663. +                       weakScarlet.setIsImmobilized(true);
  664. +                       weakScarlet.disableAllSkills();
  665. +                       activeScarlet = weakScarlet;
  666. +                       startQuestTimer("camera_19", 2400, _scarletDummy, null, false);
  667. +                       startQuestTimer("camera_19b", 5000, _scarletDummy, null, false);
  668. +                       startQuestTimer("camera_19c", 6300, _scarletDummy, null, false);
  669. +               }
  670. +               else if (event.equalsIgnoreCase("camera_19"))
  671. +                       weakScarlet.moveToLocation(174232, -88020, -5110, 0);
  672. +               else if (event.equalsIgnoreCase("camera_19b"))
  673. +               {
  674. +                       ZONE.broadcastPacket(new SpecialCamera(_scarletDummy.getObjectId(), 800, 180, 10, 1000, 10000, 0, 0, 1, 0));
  675. +                       startQuestTimer("camera_20", 2100, _scarletDummy, null, false);
  676. +               }
  677. +               else if (event == "camera_19c")
  678. +                       throwUp(npc, 500, SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT).addSkillName(5004, 1));
  679. +               else if (event.equalsIgnoreCase("camera_20"))
  680. +               {
  681. +                       ZONE.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(), 300, 60, 8, 0, 10000, 0, 0, 1, 0));
  682. +                       startQuestTimer("camera_21", 2000, weakScarlet, null, false);
  683. +               }
  684. +               else if (event.equalsIgnoreCase("camera_21"))
  685. +               {
  686. +                       ZONE.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(), 500, 90, 10, 3000, 5000, 0, 0, 1, 0));
  687. +                       startQuestTimer("camera_22", 3000, weakScarlet, null, false);
  688. +               }
  689. +               else if (event.equalsIgnoreCase("camera_22"))
  690. +               {
  691. +                       for (int[] portrait : PORTRAITS)
  692. +                       {
  693. +                               final Npc portaits = addSpawn(portrait[0], portrait[1], portrait[2], -5000, 0, false, 0, false);
  694. +                               portaits.setIsImmobilized(true);
  695. +                               portaits.disableAllSkills();
  696. +                       }
  697. +                      
  698. +                       startNpcActions();
  699. +                      
  700. +                       startQuestTimer("camera_23", 2000, weakScarlet, null, false);
  701. +                       startQuestTimer("loc_check", 60000, weakScarlet, null, true);
  702. +                       startQuestTimer("songs_play", 10000 + Rnd.get(10000), frintezza, null, false);
  703. +                       startQuestTimer("skill01", 10000 + Rnd.get(10000), weakScarlet, null, false);
  704. +               }
  705. +               else if (event.equalsIgnoreCase("camera_23"))
  706. +               {
  707. +                       for (Npc minion : ZONE.getKnownTypeInside(Npc.class))
  708. +                       {
  709. +                               if (minion.getNpcId() == FRINTEZZA)
  710. +                                       continue;
  711. +                              
  712. +                               minion.setIsImmobilized(false);
  713. +                               minion.enableAllSkills();
  714. +                              
  715. +                               if (minion.getNpcId() == 29049 || minion.getNpcId() == 29048)
  716. +                                       startQuestTimer("spawn_minion", 20000, minion, null, false);
  717. +                       }
  718. +                      
  719. +                       startPcActions();
  720. +                       startNpcActions();
  721. +               }
  722. +               else if (event.equalsIgnoreCase("start_pc"))
  723. +                       startPcActions();
  724. +               else if (event.equalsIgnoreCase("start_npc"))
  725. +                       startNpcActions();
  726. +               else if (event.equalsIgnoreCase("morph_end"))
  727. +                       _OnMorph = 0;
  728. +               else if (event.equalsIgnoreCase("morph_01"))
  729. +               {
  730. +                       ZONE.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(), 250, _Angle, 12, 2000, 11000, 0, 0, 1, 0));
  731. +                       startQuestTimer("morph_02", 3000, weakScarlet, null, false);
  732. +               }
  733. +               else if (event.equalsIgnoreCase("morph_02"))
  734. +               {
  735. +                       ZONE.broadcastPacket(new SocialAction(weakScarlet, 1));
  736. +                       weakScarlet.setRightHandItemId(7903);
  737. +                       startQuestTimer("morph_03", 1500, weakScarlet, null, false);
  738. +               }
  739. +               else if (event.equalsIgnoreCase("morph_03"))
  740. +               {
  741. +                       startQuestTimer("morph_04", 1500, weakScarlet, null, false);
  742. +               }
  743. +               else if (event.equalsIgnoreCase("morph_04"))
  744. +               {
  745. +                       ZONE.broadcastPacket(new SocialAction(weakScarlet, 4));
  746. +                       L2Skill skill = SkillTable.getInstance().getInfo(5017, 1);
  747. +                       if (skill != null)
  748. +                               skill.getEffects(weakScarlet, weakScarlet);
  749. +                      
  750. +                       startQuestTimer("morph_end", 3000, weakScarlet, null, false);
  751. +                       startQuestTimer("start_pc", 1000, weakScarlet, null, false);
  752. +                       startQuestTimer("start_npc", 1000, weakScarlet, null, false);
  753. +                       startQuestTimer("songs_play", 10000 + Rnd.get(10000), frintezza, null, false);
  754. +                       startQuestTimer("skill02", 10000 + Rnd.get(10000), weakScarlet, null, false);
  755. +               }
  756. +               else if (event.equalsIgnoreCase("morph_05a"))
  757. +                       ZONE.broadcastPacket(new SocialAction(frintezza, 4));
  758. +               else if (event.equalsIgnoreCase("morph_05"))
  759. +               {
  760. +                       ZONE.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 250, 120, 15, 0, 1000, 0, 0, 1, 0));
  761. +                       startQuestTimer("morph_06", 0, frintezza, null, false);
  762. +               }
  763. +               else if (event.equalsIgnoreCase("morph_06"))
  764. +               {
  765. +                       ZONE.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 250, 120, 15, 0, 10000, 0, 0, 1, 0));
  766. +                      
  767. +                       cancelQuestTimers("loc_check");
  768. +                      
  769. +                       _Scarlet_x = weakScarlet.getX();
  770. +                       _Scarlet_y = weakScarlet.getY();
  771. +                       _Scarlet_z = weakScarlet.getZ();
  772. +                       _Scarlet_h = weakScarlet.getHeading();
  773. +                       weakScarlet.deleteMe();
  774. +                       weakScarlet = null;
  775. +                       activeScarlet = null;
  776. +                       weakScarlet = (GrandBoss) addSpawn(29046, _Scarlet_x, _Scarlet_y, _Scarlet_z, _Scarlet_h, false, 0, false);
  777. +                       weakScarlet.setIsInvul(true);
  778. +                       weakScarlet.setIsImmobilized(true);
  779. +                       weakScarlet.disableAllSkills();
  780. +                       weakScarlet.setRightHandItemId(7903);
  781. +                      
  782. +                       startQuestTimer("morph_07", 4000, frintezza, null, false);
  783. +               }
  784. +               else if (event.equalsIgnoreCase("morph_07"))
  785. +               {
  786. +                       ZONE.broadcastPacket(new MagicSkillUse(frintezza, frintezza, 5006, 1, 34000, 0));
  787. +                       ZONE.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 500, 70, 15, 3000, 10000, 0, 0, 1, 0));
  788. +                       startQuestTimer("morph_08", 3000, frintezza, null, false);
  789. +               }
  790. +               else if (event.equalsIgnoreCase("morph_08"))
  791. +               {
  792. +                       ZONE.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 2500, 90, 12, 6000, 10000, 0, 0, 1, 0));
  793. +                       startQuestTimer("morph_09", 3000, frintezza, null, false);
  794. +               }
  795. +               else if (event.equalsIgnoreCase("morph_09"))
  796. +               {
  797. +                       ZONE.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(), 250, _Angle, 12, 0, 1000, 0, 0, 1, 0));
  798. +                       ZONE.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(), 250, _Angle, 12, 0, 10000, 0, 0, 1, 0));
  799. +                       startQuestTimer("morph_11", 500, weakScarlet, null, false);
  800. +               }
  801. +               else if (event.equalsIgnoreCase("morph_11"))
  802. +               {
  803. +                       weakScarlet.doDie(weakScarlet);
  804. +                       ZONE.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(), 450, _Angle, 14, 8000, 8000, 0, 0, 1, 0));
  805. +                      
  806. +                       startQuestTimer("morph_12", 6250, weakScarlet, null, false);
  807. +                       startQuestTimer("morph_13", 7200, weakScarlet, null, false);
  808. +               }
  809. +               else if (event.equalsIgnoreCase("morph_12"))
  810. +               {
  811. +                       weakScarlet.deleteMe();
  812. +                       weakScarlet = null;
  813. +               }
  814. +               else if (event.equalsIgnoreCase("morph_13"))
  815. +               {
  816. +                       strongScarlet = (GrandBoss) addSpawn(SCARLET2, _Scarlet_x, _Scarlet_y, _Scarlet_z, _Scarlet_h, false, 0, false);
  817. +                       strongScarlet.setIsInvul(true);
  818. +                       strongScarlet.setIsImmobilized(true);
  819. +                       strongScarlet.disableAllSkills();
  820. +                       activeScarlet = strongScarlet;
  821. +                      
  822. +                       ZONE.broadcastPacket(new SpecialCamera(strongScarlet.getObjectId(), 450, _Angle, 12, 500, 20000, 0, 0, 1, 0));
  823. +                      
  824. +                       startQuestTimer("morph_14", 3000, strongScarlet, null, false);
  825. +                       startQuestTimer("loc_check", 60000, strongScarlet, null, true);
  826. +               }
  827. +               else if (event.equalsIgnoreCase("morph_14"))
  828. +                       startQuestTimer("morph_15", 11100, strongScarlet, null, false);
  829. +               else if (event.equalsIgnoreCase("morph_15"))
  830. +               {
  831. +                       ZONE.broadcastPacket(new SocialAction(strongScarlet, 2));
  832. +                       L2Skill skill = SkillTable.getInstance().getInfo(5017, 1);
  833. +                       if (skill != null)
  834. +                               skill.getEffects(strongScarlet, strongScarlet);
  835. +                      
  836. +                       startQuestTimer("morph_end", 9000, strongScarlet, null, false);
  837. +                       startQuestTimer("start_pc", 6000, strongScarlet, null, false);
  838. +                       startQuestTimer("start_npc", 6000, strongScarlet, null, false);
  839. +                       startQuestTimer("songs_play", 10000 + Rnd.get(10000), frintezza, null, false);
  840. +                       startQuestTimer("skill03", 10000 + Rnd.get(10000), strongScarlet, null, false);
  841. +               }
  842. +               else if (event.equalsIgnoreCase("morph_16"))
  843. +               {
  844. +                       ZONE.broadcastPacket(new SpecialCamera(strongScarlet.getObjectId(), 300, _Angle - 180, 5, 0, 7000, 0, 0, 1, 0));
  845. +                       ZONE.broadcastPacket(new SpecialCamera(strongScarlet.getObjectId(), 200, _Angle, 85, 4000, 10000, 0, 0, 1, 0));
  846. +                       startQuestTimer("morph_17b", 7400, frintezza, null, false);
  847. +                       startQuestTimer("morph_18", 7500, frintezza, null, false);
  848. +               }
  849. +               else if (event.equalsIgnoreCase("morph_17b"))
  850. +                       frintezza.doDie(frintezza);
  851. +               else if (event.equalsIgnoreCase("morph_18"))
  852. +               {
  853. +                       ZONE.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 100, 120, 5, 0, 7000, 0, 0, 1, 0));
  854. +                       startQuestTimer("morph_19", 0, frintezza, null, false);
  855. +               }
  856. +               else if (event.equalsIgnoreCase("morph_19"))
  857. +               {
  858. +                       ZONE.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 100, 90, 5, 5000, 15000, 0, 0, 1, 0));
  859. +                       startQuestTimer("morph_20", 7000, frintezza, null, false);
  860. +                       startQuestTimer("spawn_cubes", 7000, frintezza, null, false);
  861. +               }
  862. +               else if (event.equalsIgnoreCase("morph_20"))
  863. +               {
  864. +                       ZONE.broadcastPacket(new SpecialCamera(frintezza.getObjectId(), 900, 90, 25, 7000, 10000, 0, 0, 1, 0));
  865. +                       startQuestTimer("start_pc", 7000, frintezza, null, false);
  866. +               }
  867. +               else if (event.equalsIgnoreCase("songs_play"))
  868. +               {
  869. +                       _SoulBreakArrowUse = 0;
  870. +                      
  871. +                       if (frintezza != null && !frintezza.isDead() && _OnMorph == 0)
  872. +                       {
  873. +                               _OnSong = Rnd.get(1, 5);
  874. +                              
  875. +                               String SongName = "";
  876. +                              
  877. +                               // Name of the songs are custom, named with client side description.
  878. +                               switch (_OnSong)
  879. +                               {
  880. +                                       case 1:
  881. +                                               SongName = "Frintezza's Healing Rhapsody";
  882. +                                               break;
  883. +                                       case 2:
  884. +                                               SongName = "Frintezza's Rampaging Opus";
  885. +                                               break;
  886. +                                       case 3:
  887. +                                               SongName = "Frintezza's Power Concerto";
  888. +                                               break;
  889. +                                       case 4:
  890. +                                               SongName = "Frintezza's Plagued Concerto";
  891. +                                               break;
  892. +                                       case 5:
  893. +                                               SongName = "Frintezza's Psycho Symphony";
  894. +                                               break;
  895. +                                       default:
  896. +                                               SongName = "Frintezza's Song";
  897. +                                               break;
  898. +                               }
  899. +                              
  900. +                               // Like L2OFF the skill name is printed on screen
  901. +                               ZONE.broadcastPacket(new ExShowScreenMessage(SongName, 6000));
  902. +                              
  903. +                               if (_OnSong == 1 && _ThirdMorph == 1 && strongScarlet.getCurrentHp() < strongScarlet.getMaxHp() * 0.6 && Rnd.get(100) < 80)
  904. +                               {
  905. +                                       ZONE.broadcastPacket(new MagicSkillUse(frintezza, frintezza, 5007, 1, 32000, 0));
  906. +                                       startQuestTimer("songs_effect", 5000, frintezza, null, false);
  907. +                                       startQuestTimer("songs_play", 32000 + Rnd.get(10000), frintezza, null, false);
  908. +                               }
  909. +                               else if (_OnSong == 2 || _OnSong == 3)
  910. +                               {
  911. +                                       ZONE.broadcastPacket(new MagicSkillUse(frintezza, frintezza, 5007, _OnSong, 32000, 0));
  912. +                                       startQuestTimer("songs_effect", 5000, frintezza, null, false);
  913. +                                       startQuestTimer("songs_play", 32000 + Rnd.get(10000), frintezza, null, false);
  914. +                               }
  915. +                               else if (_OnSong == 4 && _SecondMorph == 1)
  916. +                               {
  917. +                                       ZONE.broadcastPacket(new MagicSkillUse(frintezza, frintezza, 5007, 4, 31000, 0));
  918. +                                       startQuestTimer("songs_effect", 5000, frintezza, null, false);
  919. +                                       startQuestTimer("songs_play", 31000 + Rnd.get(10000), frintezza, null, false);
  920. +                               }
  921. +                               else if (_OnSong == 5 && _ThirdMorph == 1 && _Abnormal == 0)
  922. +                               {
  923. +                                       _Abnormal = 1;
  924. +                                       ZONE.broadcastPacket(new MagicSkillUse(frintezza, frintezza, 5007, 5, 35000, 0));
  925. +                                       startQuestTimer("songs_effect", 5000, frintezza, null, false);
  926. +                                       startQuestTimer("songs_play", 35000 + Rnd.get(10000), frintezza, null, false);
  927. +                               }
  928. +                               else
  929. +                                       startQuestTimer("songs_play", 5000 + Rnd.get(5000), frintezza, null, false);
  930. +                       }
  931. +               }
  932. +               else if (event.equalsIgnoreCase("songs_effect"))
  933. +               {
  934. +                       L2Skill skill = SkillTable.getInstance().getInfo(5008, _OnSong);
  935. +                       if (skill == null)
  936. +                               return null;
  937. +                      
  938. +                       if (_OnSong == 1 || _OnSong == 2 || _OnSong == 3)
  939. +                       {
  940. +                               if (frintezza != null && !frintezza.isDead() && activeScarlet != null && !activeScarlet.isDead())
  941. +                                       skill.getEffects(frintezza, activeScarlet);
  942. +                       }
  943. +                       else if (_OnSong == 4)
  944. +                       {
  945. +                               for (Creature cha : ZONE.getKnownTypeInside(Player.class))
  946. +                               {
  947. +                                       if (Rnd.get(100) < 80)
  948. +                                       {
  949. +                                               skill.getEffects(frintezza, cha);
  950. +                                               cha.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT).addSkillName(5008, 4));
  951. +                                       }
  952. +                               }
  953. +                       }
  954. +                       else if (_OnSong == 5)
  955. +                       {
  956. +                               for (Creature cha : ZONE.getKnownTypeInside(Player.class))
  957. +                               {
  958. +                                       if (Rnd.get(100) < 70)
  959. +                                       {
  960. +                                               cha.abortAttack();
  961. +                                               cha.abortCast();
  962. +                                               cha.disableAllSkills();
  963. +                                               cha.stopMove(null);
  964. +                                               cha.setIsParalyzed(true);
  965. +                                               cha.setIsImmobilized(true);
  966. +                                               cha.getAI().setIntention(IntentionType.IDLE);
  967. +                                               skill.getEffects(frintezza, cha);
  968. +                                               cha.startAbnormalEffect(AbnormalEffect.DANCE_STUNNED);
  969. +                                               cha.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT).addSkillName(5008, 5));
  970. +                                       }
  971. +                               }
  972. +                               startQuestTimer("stop_effect", 25000, frintezza, null, false);
  973. +                       }
  974. +               }
  975. +               else if (event.equalsIgnoreCase("stop_effect"))
  976. +               {
  977. +                       for (Creature cha : ZONE.getKnownTypeInside(Player.class))
  978. +                       {
  979. +                               cha.stopAbnormalEffect(AbnormalEffect.DANCE_STUNNED);
  980. +                               cha.stopAbnormalEffect(AbnormalEffect.FLOATING_ROOT);
  981. +                               cha.enableAllSkills();
  982. +                               cha.setIsImmobilized(false);
  983. +                               cha.setIsParalyzed(false);
  984. +                       }
  985. +                       _Abnormal = 0;
  986. +               }
  987. +               else if (event.equalsIgnoreCase("check_hp"))
  988. +               {
  989. +                       if (npc.isDead())
  990. +                       {
  991. +                               _OnMorph = 1;
  992. +                               ZONE.broadcastPacket(new PlaySound(1, "BS01_D"));
  993. +                              
  994. +                               stopAttacks();
  995. +                               stopPcActions();
  996. +                               stopNpcActions();
  997. +                               startQuestTimer("morph_16", 0, npc, null, false);
  998. +                       }
  999. +                       else
  1000. +                       {
  1001. +                               _CheckDie = _CheckDie + 10;
  1002. +                               if (_CheckDie < 3000)
  1003. +                                       startQuestTimer("check_hp", 10, npc, null, false);
  1004. +                               else
  1005. +                               {
  1006. +                                       _OnCheck = 0;
  1007. +                                       _CheckDie = 0;
  1008. +                               }
  1009. +                       }
  1010. +               }
  1011. +               else if (event.equalsIgnoreCase("skill01"))
  1012. +               {
  1013. +                       if (weakScarlet != null && !weakScarlet.isDead() && _SecondMorph == 0 && _ThirdMorph == 0 && _OnMorph == 0)
  1014. +                       {
  1015. +                               int i = Rnd.get(0, 1);
  1016. +                               L2Skill skill = SkillTable.getInstance().getInfo(SKILLS[i][0], SKILLS[i][1]);
  1017. +                               if (skill != null)
  1018. +                               {
  1019. +                                       weakScarlet.stopMove(null);
  1020. +                                       weakScarlet.setIsCastingNow(true);
  1021. +                                       weakScarlet.doCast(skill);
  1022. +                               }
  1023. +                               startQuestTimer("skill01", SKILLS[i][2] + 5000 + Rnd.get(10000), npc, null,false);
  1024. +                       }
  1025. +               }
  1026. +               else if (event.equalsIgnoreCase("skill02"))
  1027. +               {
  1028. +                       if (weakScarlet != null && !weakScarlet.isDead() && _SecondMorph == 1 && _ThirdMorph == 0 && _OnMorph == 0)
  1029. +                       {
  1030. +                               int i = 0;
  1031. +                               if (_Abnormal == 0)
  1032. +                                       i = Rnd.get(2, 5);
  1033. +                               else
  1034. +                                       i = Rnd.get(2, 4);
  1035. +                              
  1036. +                               L2Skill skill = SkillTable.getInstance().getInfo(SKILLS[i][0], SKILLS[i][1]);
  1037. +                               if (skill != null)
  1038. +                               {
  1039. +                                       weakScarlet.stopMove(null);
  1040. +                                       weakScarlet.setIsCastingNow(true);
  1041. +                                       weakScarlet.doCast(skill);
  1042. +                               }
  1043. +                               startQuestTimer("skill02", SKILLS[i][2] + 5000 + Rnd.get(10000), npc, null,false);
  1044. +                              
  1045. +                               if (i == 5)
  1046. +                               {
  1047. +                                       _Abnormal = 1;
  1048. +                                       startQuestTimer("float_effect", 4000, weakScarlet, null, false);
  1049. +                               }
  1050. +                       }
  1051. +               }
  1052. +               else if (event.equalsIgnoreCase("skill03"))
  1053. +               {
  1054. +                       if (strongScarlet != null && !strongScarlet.isDead() && _SecondMorph == 1 && _ThirdMorph == 1 && _OnMorph == 0)
  1055. +                       {
  1056. +                               int i = 0;
  1057. +                               if (_Abnormal == 0)
  1058. +                                       i = Rnd.get(6, 10);
  1059. +                               else
  1060. +                                       i = Rnd.get(6, 9);
  1061. +                              
  1062. +                               L2Skill skill = SkillTable.getInstance().getInfo(SKILLS[i][0], SKILLS[i][1]);
  1063. +                               if (skill != null)
  1064. +                               {
  1065. +                                       strongScarlet.stopMove(null);
  1066. +                                       strongScarlet.setIsCastingNow(true);
  1067. +                                       strongScarlet.doCast(skill);
  1068. +                               }
  1069. +                               startQuestTimer("skill03", SKILLS[i][2] + 5000 + Rnd.get(10000), npc, null,false);
  1070. +                              
  1071. +                               if (i == 10)
  1072. +                               {
  1073. +                                       _Abnormal = 1;
  1074. +                                       startQuestTimer("float_effect", 3000, npc, null, false);
  1075. +                               }
  1076. +                       }
  1077. +               }
  1078. +               else if (event.equalsIgnoreCase("float_effect"))
  1079. +               {
  1080. +                       if (npc.isCastingNow())
  1081. +                               startQuestTimer("float_effect", 500, npc, null, false);
  1082. +                       else
  1083. +                       {
  1084. +                               for (Creature cha : ZONE.getKnownTypeInside(Player.class))
  1085. +                               {
  1086. +                                       if (cha.getFirstEffect(5016) != null)
  1087. +                                       {
  1088. +                                               cha.abortAttack();
  1089. +                                               cha.abortCast();
  1090. +                                               cha.disableAllSkills();
  1091. +                                               cha.stopMove(null);
  1092. +                                               cha.setIsParalyzed(true);
  1093. +                                               cha.setIsImmobilized(true);
  1094. +                                               cha.getAI().setIntention(IntentionType.IDLE);
  1095. +                                               cha.startAbnormalEffect(AbnormalEffect.FLOATING_ROOT);
  1096. +                                       }
  1097. +                               }
  1098. +                               startQuestTimer("stop_effect", 25000, npc, null, false);
  1099. +                       }
  1100. +               }
  1101. +               else if (event.equalsIgnoreCase("action"))
  1102. +                       ZONE.broadcastPacket(new SocialAction(npc, 1));
  1103. +               else if (event.equalsIgnoreCase("bomber"))
  1104. +                       _Bomber = 0;
  1105. +               else if (event.equalsIgnoreCase("frintezza_despawn"))
  1106. +               {
  1107. +                       if (System.currentTimeMillis() - _LastAction > 900000)
  1108. +                       {
  1109. +                               ZONE.oustAllPlayers();
  1110. +                              
  1111. +                               cancelQuestTimers("waiting");
  1112. +                               cancelQuestTimers("loc_check");
  1113. +                               cancelQuestTimers("spawn_minion");
  1114. +                               cancelQuestTimers("notice");
  1115. +                               cancelQuestTimers("frintezza_despawn");
  1116. +                              
  1117. +                               deleteAllMobs();
  1118. +                               closeDoors();
  1119. +                               stopAttacks();
  1120. +                              
  1121. +                               GrandBossManager.getInstance().setBossStatus(FRINTEZZA, DORMANT);
  1122. +                       }
  1123. +               }
  1124. +               else if (event.equalsIgnoreCase("spawn_minion"))
  1125. +               {
  1126. +                       if (npc != null && !npc.isDead() && frintezza != null && !frintezza.isDead())
  1127. +                       {
  1128. +                               Npc mob = addSpawn(npc.getNpcId() + 2, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0, false);
  1129. +                              
  1130. +                               startQuestTimer("action", 200, mob, null, false);
  1131. +                               startQuestTimer("spawn_minion", 18000, npc, null, false);
  1132. +                       }
  1133. +               }
  1134. +               else if (event.equalsIgnoreCase("spawn_cubes"))
  1135. +                       addSpawn(CUBE, 174232, -88020, -5114, 16384, false, 900000, false);
  1136. +               else if (event.equalsIgnoreCase("frintezza_unlock"))
  1137. +                       GrandBossManager.getInstance().setBossStatus(FRINTEZZA, DORMANT);
  1138. +               else if (event.equalsIgnoreCase("remove_players"))
  1139. +                       ZONE.oustAllPlayers();
  1140. +              
  1141. +               return super.onAdvEvent(event, npc, player);
  1142. +       }
  1143. +      
  1144. +       @Override
  1145. +       public String onSkillSee(Npc npc, Player caster, L2Skill skill, WorldObject[] targets, boolean isPet)
  1146. +       {
  1147. +               if (targets.length > 0 && targets[0] == npc)
  1148. +               {
  1149. +                       if (npc == frintezza)
  1150. +                               npc.getStatus().setCurrentHp(npc.getMaxHp(), false);
  1151. +                       switch (skill.getId())
  1152. +                       {
  1153. +                               case 2234:
  1154. +                                       if (frintezza != null && targets[0] == npc && npc.getNpcId() == FRINTEZZA && _SoulBreakArrowUse == 1)
  1155. +                                               ZONE.broadcastPacket(new SocialAction(npc, 2));
  1156. +                                      
  1157. +                                       if (frintezza != null && targets[0] == npc && npc.getNpcId() == FRINTEZZA && _SoulBreakArrowUse == 0)
  1158. +                                       {
  1159. +                                               if (Rnd.get(100) < 100)
  1160. +                                               {
  1161. +                                                       ZONE.broadcastPacket(new MagicSkillCanceled(frintezza.getObjectId()));
  1162. +                                                       cancelQuestTimers("songs_play");
  1163. +                                                       cancelQuestTimers("songs_effect");
  1164. +                                                       startQuestTimer("stop_effect", 0, frintezza, null, false);
  1165. +                                                       npc.abortCast();
  1166. +                                                       ZONE.broadcastPacket(new MagicSkillCanceled(frintezza.getObjectId()));
  1167. +                                                      
  1168. +                                                       for (Creature pc : ZONE.getKnownTypeInside(Player.class))
  1169. +                                                               pc.stopSkillEffects(5008);
  1170. +                                                      
  1171. +                                                       startQuestTimer("songs_play", 60000 + Rnd.get(60000), frintezza, null, false);
  1172. +                                                       npc.broadcastNpcSay("Musical performance as temporarily interrupted.");
  1173. +                                                       _SoulBreakArrowUse = 1;
  1174. +                                               }
  1175. +                                       }
  1176. +                                       break;
  1177. +                               case 2276:
  1178. +                                       if (frintezza != null && targets[0] == npc && npc.getNpcId() == EVIL_SPIRIT || frintezza != null && targets[0] == npc && npc.getNpcId() == EVIL_SPIRIT_2)
  1179. +                                       {
  1180. +                                               npc.doDie(caster);
  1181. +                                               npc.broadcastNpcSay("I was destroyed by Dewdrop of Destruction.");
  1182. +                                       }
  1183. +                                       break;
  1184. +                       }
  1185. +               }
  1186. +              
  1187. +               return super.onSkillSee(npc, caster, skill, targets, isPet);
  1188. +       }
  1189. +      
  1190. +       @Override
  1191. +       public String onAttack(Npc npc, Creature attacker, int damage, L2Skill skill)
  1192. +       {
  1193. +               _LastAction = System.currentTimeMillis();
  1194. +               if (npc.getNpcId() == FRINTEZZA)
  1195. +               {
  1196. +                       npc.setCurrentHpMp(npc.getMaxHp(), 0);
  1197. +                       return null;
  1198. +               }
  1199. +               if (npc.getNpcId() == SCARLET1 && _SecondMorph == 0 && _ThirdMorph == 0 && _OnMorph == 0 && npc.getCurrentHp() < npc.getMaxHp() * 0.75 && GrandBossManager.getInstance().getBossStatus(FRINTEZZA) == FIGHTING)
  1200. +               {
  1201. +                       stopAttacks();
  1202. +                       stopPcActions();
  1203. +                       stopNpcActions();
  1204. +                      
  1205. +                       _SecondMorph = 1;
  1206. +                       _OnMorph = 1;
  1207. +                      
  1208. +                       startQuestTimer("morph_01", 1100, npc, null, false);
  1209. +               }
  1210. +               else if (npc.getNpcId() == SCARLET1 && _SecondMorph == 1 && _ThirdMorph == 0 && _OnMorph == 0 && npc.getCurrentHp() < npc.getMaxHp() * 0.5 && GrandBossManager.getInstance().getBossStatus(FRINTEZZA) == FIGHTING)
  1211. +               {
  1212. +                       _ThirdMorph = 1;
  1213. +                       _OnMorph = 1;
  1214. +                      
  1215. +                       stopAttacks();
  1216. +                       stopPcActions();
  1217. +                       stopNpcActions();
  1218. +                      
  1219. +                       startQuestTimer("morph_05a", 2000, npc, null, false);
  1220. +                       startQuestTimer("morph_05", 2100, npc, null, false);
  1221. +               }
  1222. +               else if (npc.getNpcId() == SCARLET2 && _SecondMorph == 1 && _ThirdMorph == 1 && _OnCheck == 0 && damage >= npc.getCurrentHp() && GrandBossManager.getInstance().getBossStatus(FRINTEZZA) == FIGHTING)
  1223. +               {
  1224. +                       _OnCheck = 1;
  1225. +                       startQuestTimer("check_hp", 0, npc, null, false);
  1226. +               }
  1227. +               else if ((npc.getNpcId() == 29050 || npc.getNpcId() == 29051) && _Bomber == 0)
  1228. +               {
  1229. +                       if (npc.getCurrentHp() < npc.getMaxHp() * 0.1)
  1230. +                       {
  1231. +                               if (Rnd.get(100) < 30)
  1232. +                               {
  1233. +                                       _Bomber = 1;
  1234. +                                       startQuestTimer("bomber", 3000, npc, null, false);
  1235. +                                      
  1236. +                                       L2Skill sk = SkillTable.getInstance().getInfo(5011, 1);
  1237. +                                       if (sk != null)
  1238. +                                               npc.doCast(sk);
  1239. +                               }
  1240. +                       }
  1241. +               }
  1242. +              
  1243. +               return super.onAttack(npc, attacker, damage, skill);
  1244. +       }
  1245. +      
  1246. +       @Override
  1247. +       public String onKill(Npc npc, Creature killer)
  1248. +       {
  1249. +               final Player player = killer.getActingPlayer();
  1250. +               if (player == null)
  1251. +                       return null;
  1252. +              
  1253. +               if (npc.getNpcId() == SCARLET2)
  1254. +               {
  1255. +                       ZONE.broadcastPacket(new PlaySound(1, "BS01_D", npc));
  1256. +                      
  1257. +                       stopPcActions();
  1258. +                       stopNpcActions();
  1259. +                      
  1260. +                       int angle;
  1261. +                       if (npc.getHeading() < 32768)
  1262. +                               angle = Math.abs(180 - (int) (npc.getHeading() / 182.044444444));
  1263. +                       else
  1264. +                               angle = Math.abs(540 - (int) (npc.getHeading() / 182.044444444));
  1265. +                      
  1266. +                       ZONE.broadcastPacket(new SpecialCamera(npc.getObjectId(), 300, angle - 180, 5, 0, 7000));
  1267. +                       ZONE.broadcastPacket(new SpecialCamera(npc.getObjectId(), 200, angle, 85, 4000, 10000));
  1268. +                       startQuestTimer("morph_17b", 7400, npc, null, false);
  1269. +                      
  1270. +                       GrandBossManager.getInstance().setBossStatus(FRINTEZZA, DEAD);
  1271. +                       long respawnTime = (long) Config.SPAWN_INTERVAL_FRINTEZZA + Rnd.get(-Config.RANDOM_SPAWN_TIME_FRINTEZZA, Config.RANDOM_SPAWN_TIME_FRINTEZZA);
  1272. +                       respawnTime *= 3600000;
  1273. +                      
  1274. +                       cancelQuestTimers("spawn_minion");
  1275. +                       cancelQuestTimers("frintezza_despawn");
  1276. +                       startQuestTimer("remove_players", 900000, null, null, false);
  1277. +                       startQuestTimer("frintezza_unlock", respawnTime, null, null, false);
  1278. +                      
  1279. +                       StatsSet info = GrandBossManager.getInstance().getStatsSet(FRINTEZZA);
  1280. +                       info.set("respawn_time", System.currentTimeMillis() + respawnTime);
  1281. +                       GrandBossManager.getInstance().setStatsSet(FRINTEZZA, info);
  1282. +               }
  1283. +               else if (npc.getNpcId() == 18328)
  1284. +               {
  1285. +                       if (Rnd.get(100) < 33)
  1286. +                               player.addItem("Quest", DEWDROP_OF_DESTRUCTION, 1, npc, true);
  1287. +                      
  1288. +                       int alarmsRemaining = getMobs(npc);
  1289. +                       if (alarmsRemaining == 1)
  1290. +                       {
  1291. +                               for (int i = 25150051; i <= 25150058; i++)
  1292. +                                       DoorData.getInstance().getDoor(i).openMe();
  1293. +                       }
  1294. +                       else if (alarmsRemaining == 0)
  1295. +                       {
  1296. +                               ZONE.broadcastPacket(new CreatureSay(npc.getObjectId(), Say2.SHOUT, npc.getName(), "De-activate the alarm."));
  1297. +                               deleteAllMobs();
  1298. +                               room2Spawn(1);
  1299. +                       }
  1300. +               }
  1301. +               else if (npc.getNpcId() == 18333)
  1302. +               {
  1303. +                       if (Rnd.get(100) < 10)
  1304. +                               player.addItem("Quest", DEWDROP_OF_DESTRUCTION, 1, npc, true);
  1305. +               }
  1306. +               else if (npc.getNpcId() == 18339)
  1307. +               {
  1308. +                       if (getMobs(npc) == 0)
  1309. +                               room2Spawn(2);
  1310. +               }
  1311. +               else if (npc.getNpcId() == 18334)
  1312. +               {
  1313. +                       if (Rnd.get(100) < 33)
  1314. +                               player.addItem("Quest", SOUL_BREAKING_ARROW, Rnd.get(5,15), npc, true);
  1315. +                      
  1316. +                       if (getMobs(npc) == 0)
  1317. +                       {
  1318. +                               deleteAllMobs();
  1319. +                               DoorData.getInstance().getDoor(25150045).openMe();
  1320. +                               DoorData.getInstance().getDoor(25150046).openMe();
  1321. +                               cancelQuestTimers("notice");
  1322. +                               startQuestTimer("waiting", Config.WAIT_TIME_FRINTEZZA, null, null, false);
  1323. +                       }
  1324. +               }
  1325. +              
  1326. +               return super.onKill(npc, killer);
  1327. +       }
  1328. +      
  1329. +       private int getMobs(Npc npc)
  1330. +       {
  1331. +               _roomMobs.remove(npc);
  1332. +              
  1333. +               int count = 0;
  1334. +               for (Npc mob : _roomMobs)
  1335. +               {
  1336. +                       if (mob.getNpcId() == npc.getNpcId())
  1337. +                               count++;
  1338. +               }
  1339. +              
  1340. +               return count;
  1341. +       }
  1342. +      
  1343. +       private void deleteAllMobs()
  1344. +       {
  1345. +               for (Npc mob : _roomMobs)
  1346. +                       mob.deleteMe();
  1347. +              
  1348. +               for (Npc mob : ZONE.getKnownTypeInside(Npc.class))
  1349. +                       mob.deleteMe();
  1350. +              
  1351. +               _roomMobs.clear();
  1352. +              
  1353. +               if (frintezza != null)
  1354. +               {
  1355. +                       frintezza.deleteMe();
  1356. +                       frintezza = null;
  1357. +               }
  1358. +       }
  1359. +      
  1360. +       private void stopAttacks()
  1361. +       {
  1362. +               cancelQuestTimers("skill01");
  1363. +               cancelQuestTimers("skill02");
  1364. +               cancelQuestTimers("skill03");
  1365. +               cancelQuestTimers("songs_play");
  1366. +               cancelQuestTimers("songs_effect");
  1367. +              
  1368. +               ZONE.broadcastPacket(new MagicSkillCanceled(frintezza.getObjectId()));
  1369. +       }
  1370. +      
  1371. +       private void room2Spawn(int spawn)
  1372. +       {
  1373. +               if (spawn == 1)
  1374. +               {
  1375. +                       for (int i = 41; i <= 44; i++)
  1376. +                               _roomMobs.add(addSpawn(MOBS[i][0], MOBS[i][1], MOBS[i][2], MOBS[i][3], MOBS[i][4], false, 0, false));
  1377. +                      
  1378. +                       for (int i = 25150051; i <= 25150058; i++)
  1379. +                               DoorData.getInstance().getDoor(i).openMe();
  1380. +                      
  1381. +                       DoorData.getInstance().getDoor(25150042).openMe();
  1382. +                       DoorData.getInstance().getDoor(25150043).openMe();
  1383. +               }
  1384. +               else
  1385. +               {
  1386. +                       DoorData.getInstance().getDoor(25150042).closeMe();
  1387. +                       DoorData.getInstance().getDoor(25150043).closeMe();
  1388. +                       DoorData.getInstance().getDoor(25150045).closeMe();
  1389. +                       DoorData.getInstance().getDoor(25150046).closeMe();
  1390. +                      
  1391. +                       for (int i = 25150061; i <= 25150070; i++)
  1392. +                               DoorData.getInstance().getDoor(i).openMe();
  1393. +                      
  1394. +                       for (int i = 45; i <= 131; i++)
  1395. +                               _roomMobs.add(addSpawn(MOBS[i][0], MOBS[i][1], MOBS[i][2], MOBS[i][3], MOBS[i][4], false, 0, false));
  1396. +               }
  1397. +       }
  1398. +      
  1399. +       private static void stopNpcActions()
  1400. +       {
  1401. +               for (Npc mob : ZONE.getKnownTypeInside(Npc.class))
  1402. +               {
  1403. +                       if (mob.getNpcId() != FRINTEZZA)
  1404. +                       {
  1405. +                               mob.disableAllSkills();
  1406. +                               mob.setIsInvul(true);
  1407. +                               mob.setIsImmobilized(true);
  1408. +                       }
  1409. +               }
  1410. +       }
  1411. +      
  1412. +       private static void startNpcActions()
  1413. +       {
  1414. +               for (Npc mob : ZONE.getKnownTypeInside(Npc.class))
  1415. +               {
  1416. +                       if (mob.getNpcId() != FRINTEZZA)
  1417. +                       {
  1418. +                               mob.enableAllSkills();
  1419. +                               mob.setRunning();
  1420. +                               mob.setIsInvul(false);
  1421. +                               mob.setIsImmobilized(false);
  1422. +                       }
  1423. +               }
  1424. +       }
  1425. +      
  1426. +       private static void closeDoors()
  1427. +       {
  1428. +               for (int i = 25150051; i <= 25150058; i++)
  1429. +                       DoorData.getInstance().getDoor(i).closeMe();
  1430. +              
  1431. +               for (int i = 25150061; i <= 25150070; i++)
  1432. +                       DoorData.getInstance().getDoor(i).closeMe();
  1433. +              
  1434. +               DoorData.getInstance().getDoor(25150042).closeMe();
  1435. +               DoorData.getInstance().getDoor(25150043).closeMe();
  1436. +               DoorData.getInstance().getDoor(25150045).closeMe();
  1437. +               DoorData.getInstance().getDoor(25150046).closeMe();
  1438. +       }
  1439. +      
  1440. +       private static void stopPcActions()
  1441. +       {
  1442. +               for (Creature cha : ZONE.getKnownTypeInside(Player.class))
  1443. +               {
  1444. +                       cha.abortAttack();
  1445. +                       cha.abortCast();
  1446. +                       cha.disableAllSkills();
  1447. +                       cha.setTarget(null);
  1448. +                       cha.stopMove(null);
  1449. +                       cha.setIsImmobilized(true);
  1450. +                       cha.getAI().setIntention(IntentionType.IDLE);
  1451. +               }
  1452. +       }
  1453. +      
  1454. +       private static void startPcActions()
  1455. +       {
  1456. +               for (Creature cha : ZONE.getKnownTypeInside(Player.class))
  1457. +               {
  1458. +                       cha.enableAllSkills();
  1459. +                       cha.setIsImmobilized(false);
  1460. +               }
  1461. +       }
  1462. +      
  1463. +       private static void throwUp(Creature attacker, final double range, SystemMessage msg)
  1464. +       {
  1465. +               final int mx = attacker.getX(), my = attacker.getY();
  1466. +               for (Creature target : ZONE.getKnownTypeInside(Player.class))
  1467. +               {
  1468. +                       if (target == attacker)
  1469. +                               continue;
  1470. +                      
  1471. +                       if (target instanceof Npc && isFrintezzaFriend(((Npc)target).getNpcId()))
  1472. +                               continue;
  1473. +                      
  1474. +                       double dx = target.getX() - mx;
  1475. +                       double dy = target.getY() - my;
  1476. +                       if (dx == 0 && dy == 0) dx = dy = range / 2;
  1477. +                       double aa = range / Math.sqrt(dx * dx + dy * dy);
  1478. +                       if (aa > 1.0)
  1479. +                       {
  1480. +                               int x = mx + (int)(dx * aa);
  1481. +                               int y = my + (int)(dy * aa);
  1482. +                               int z = target.getZ();
  1483. +                               target.getAI().setIntention(IntentionType.IDLE);
  1484. +                               target.abortAttack();
  1485. +                               target.abortCast();
  1486. +                               target.broadcastPacket(new FlyToLocation(target, x, y, z, FlyType.THROW_UP));
  1487. +                               target.setXYZ(x, y, z);
  1488. +                               target.broadcastPacket(new ValidateLocation(target));
  1489. +                              
  1490. +                               if (msg != null)
  1491. +                                       target.sendPacket(msg);
  1492. +                              
  1493. +                               if (target instanceof Player)
  1494. +                                       ((Player)target).standUp();
  1495. +                       }
  1496. +               }
  1497. +       }
  1498. +      
  1499. +       private static boolean isFrintezzaFriend(int npcId)
  1500. +       {
  1501. +               return npcId >= 29045 && npcId <= 29053;
  1502. +       }
  1503. +}
  1504. \ No newline at end of file
  1505. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/teleports/GrandBossTeleporters.java b/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/teleports/GrandBossTeleporters.java
  1506. index bd709a0..a58c472 100644
  1507. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/teleports/GrandBossTeleporters.java
  1508. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/scripts/teleports/GrandBossTeleporters.java
  1509. @@ -18,6 +18,7 @@
  1510.  import net.sf.l2j.gameserver.scripting.QuestState;
  1511.  import net.sf.l2j.gameserver.scripting.scripts.ai.individual.Antharas;
  1512.  import net.sf.l2j.gameserver.scripting.scripts.ai.individual.Baium;
  1513. +import net.sf.l2j.gameserver.scripting.scripts.ai.individual.Frintezza;
  1514.  import net.sf.l2j.gameserver.scripting.scripts.ai.individual.Sailren;
  1515.  import net.sf.l2j.gameserver.scripting.scripts.ai.individual.Valakas;
  1516.  
  1517. @@ -26,6 +27,7 @@
  1518.   * <ul>
  1519.   * <li>13001, Heart of Warding : Teleport into Lair of Antharas</li>
  1520.   * <li>29055, Teleportation Cubic : Teleport out of Baium zone</li>
  1521. + * <li>29061, Teleportation Cubic : Teleport out of Frintezza zone</li>
  1522.   * <li>31859, Teleportation Cubic : Teleport out of Lair of Antharas</li>
  1523.   * <li>31384, Gatekeeper of Fire Dragon : Opening some doors</li>
  1524.   * <li>31385, Heart of Volcano : Teleport into Lair of Valakas</li>
  1525. @@ -34,6 +36,7 @@
  1526.   * <li>31687, Gatekeeper of Fire Dragon : Opens doors to Heart of Volcano</li>
  1527.   * <li>31759, Teleportation Cubic : Teleport out of Lair of Valakas</li>
  1528.   * <li>31862, Angelic Vortex : Baium Teleport (3 different HTMs according of situation)</li>
  1529. + * <li>32011, Imperial Tomb Guide : Teleport into Lair of Frintezza</li>
  1530.   * <li>32107, Teleportation Cubic : Teleport out of Sailren Nest</li>
  1531.   * <li>32109, Shilen's Stone Statue : Teleport to Sailren Nest</li>
  1532.  * </ul>
  1533. @@ -59,15 +62,25 @@
  1534.                 new Location(10769, -24107, -3672)
  1535.         };
  1536.        
  1537. +       private static final Location[] FRINTEZZA_IN =
  1538. +       {
  1539. +               new Location(174102, -76039, -5105),
  1540. +               new Location(173235, -76884, -5105),
  1541. +               new Location(175003, -76933, -5105),
  1542. +               new Location(174196, -76190, -5105),
  1543. +               new Location(174013, -76120, -5105),
  1544. +               new Location(173263, -75161, -5105)
  1545. +       };
  1546. +      
  1547.         private static int _valakasPlayersCount = 0;
  1548.        
  1549.         public GrandBossTeleporters()
  1550.         {
  1551.                 super(-1, "teleports");
  1552.                
  1553. -               addFirstTalkId(29055, 31862);
  1554. -               addStartNpc(13001, 29055, 31859, 31384, 31385, 31540, 31686, 31687, 31759, 31862, 32107, 32109);
  1555. -               addTalkId(13001, 29055, 31859, 31384, 31385, 31540, 31686, 31687, 31759, 31862, 32107, 32109);
  1556. +               addFirstTalkId(29055, 31862, 29061);
  1557. +               addStartNpc(13001, 29055, 29061, 31859, 31384, 31385, 31540, 31686, 31687, 31759, 31862, 32011, 32107, 32109);
  1558. +               addTalkId(13001, 29055, 29061, 31859, 31384, 31385, 31540, 31686, 31687, 31759, 31862, 32011, 32107, 32109);
  1559.         }
  1560.        
  1561.         @Override
  1562. @@ -132,6 +145,10 @@
  1563.                                 htmltext = "29055-01.htm";
  1564.                                 break;
  1565.                                
  1566. +                       case 29061:
  1567. +                               player.teleportTo(150037 + Rnd.get(500), -57720 + Rnd.get(500), -2976, 0);
  1568. +                               break;
  1569. +                              
  1570.                         case 31862:
  1571.                                 final int status = GrandBossManager.getInstance().getBossStatus(29020);
  1572.                                 if (status == Baium.AWAKE)
  1573. @@ -248,6 +265,34 @@
  1574.                                 player.teleportTo(150037, -57720, -2976, 250);
  1575.                                 break;
  1576.                                
  1577. +                       case 32011:
  1578. +                              
  1579. +                               if (st.hasQuestItems(8073))
  1580. +                               {
  1581. +                                       status = GrandBossManager.getInstance().getBossStatus(Frintezza.FRINTEZZA);
  1582. +                                       if (status == Frintezza.DORMANT)
  1583. +                                       {
  1584. +                                               GrandBossManager.getInstance().setBossStatus(Frintezza.FRINTEZZA, Frintezza.WAITING);
  1585. +                                               ScriptData.getInstance().getQuest("Frintezza").startQuestTimer("close", 100, null, null, false);
  1586. +                                               ScriptData.getInstance().getQuest("Frintezza").startQuestTimer("beginning", 5000, null, null, false);
  1587. +                                               ScriptData.getInstance().getQuest("Frintezza").startQuestTimer("notice", 2100000, null, null, false);
  1588. +                                               ScriptData.getInstance().getQuest("Frintezza").startQuestTimer("frintezza_despawn", 60000, null, null, false);
  1589. +
  1590. +                                               // Take item from party leader.
  1591. +                                               st.takeItems(8784, 1);
  1592. +                                              
  1593. +                                               final BossZone zone = ZoneManager.getInstance().getZoneById(110012, BossZone.class);
  1594. +                                               zone.allowPlayerEntry(player, 300);
  1595. +                                               player.teleportTo(Rnd.get(FRINTEZZA_IN), 50);
  1596. +                                       }
  1597. +                                       else if (status == Frintezza.DEAD)
  1598. +                                               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>";              
  1599. +                               }
  1600. +                               else
  1601. +                                       htmltext = "<html><body>You dont have required item.</body></html>";
  1602. +                              
  1603. +                               break;
  1604. +                              
  1605.                         case 32107:
  1606.                                 player.teleportTo(Rnd.get(SAILREN_OUT), 100);
  1607.                                 break;
  1608.