CostyKiller

Throne of Heroes updates

Mar 21st, 2021 (edited)
934
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 23.12 KB | None | 0 0
  1. Index: java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
  2. ===================================================================
  3. --- java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java  (revision 8453)
  4. +++ java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java  (working copy)
  5.  
  6. @@ -844,6 +845,9 @@
  7.     private static final String TRAINING_CAMP_VAR = "TRAINING_CAMP";
  8.     private static final String TRAINING_CAMP_DURATION = "TRAINING_CAMP_DURATION";
  9.    
  10. +   // Throne of Heroes
  11. +   private static final String TOH_DONE = "TOH_DONE";
  12. +  
  13.     // Attendance Reward system
  14.     private static final String ATTENDANCE_DATE_VAR = "ATTENDANCE_DATE";
  15.     private static final String ATTENDANCE_INDEX_VAR = "ATTENDANCE_INDEX";
  16.                    
  17. @@ -14192,6 +14242,11 @@
  18.         return (trainingHolder != null) && (trainingHolder.getEndTime() > Chronos.currentTimeMillis());
  19.     }
  20.    
  21. +   public void resetThroneOfHeroesEntry()
  22. +   {
  23. +       getClan().getVariables().remove(TOH_DONE);
  24. +   }
  25. +  
  26.     public AttendanceInfoHolder getAttendanceInfo()
  27.     {
  28.         // Get reset time.
  29.  
  30. Index: java/org/l2jmobius/gameserver/network/NpcStringId.java
  31. ===================================================================
  32. --- java/org/l2jmobius/gameserver/network/NpcStringId.java  (revision 8453)
  33. +++ java/org/l2jmobius/gameserver/network/NpcStringId.java  (working copy)
  34. @@ -38717,7 +38717,7 @@
  35.     public static NpcStringId ANTHARAS_HAS_SUFFERED_CRITICAL_INJURIES;
  36.    
  37.     @ClientString(id = 1803449, message = "Zaken! Your time has come! Kill them all!")
  38. -   public static NpcStringId MARY_REED_SUMMONS_ZAKEN;
  39. +   public static NpcStringId ZAKEN_YOUR_TIME_HAS_COME;
  40.    
  41.     @ClientString(id = 1803450, message = "Mary Reed reveals her true power.")
  42.     public static NpcStringId MARY_REED_REVEALS_HER_TRUE_POWER;
  43. @@ -39082,8 +39082,8 @@
  44.     @ClientString(id = 1803599, message = "The fourth challenge begins.")
  45.     public static NpcStringId THE_FOURTH_CHALLENGE_BEGINS;
  46.    
  47. -   @ClientString(id = 1803600, message = "The fourth challenge has been completed successfully.")
  48. -   public static NpcStringId THE_FOURTH_CHALLENGE_HAS_BEEN_COMPLETED_SUCCESSFULLY;
  49. +   @ClientString(id = 1803600, message = "Mary Reed summons Zaken.\nZaken will be here very soon.")
  50. +   public static NpcStringId MARY_REED_SUMMONS_ZAKEN;
  51.    
  52.     @ClientString(id = 1803601, message = "Ekimus summons his minions.")
  53.     public static NpcStringId EKIMUS_SUMMONS_HIS_MINIONS;
  54.  
  55.  
  56. Index: java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java
  57. ===================================================================
  58. --- java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java (revision 8453)
  59. +++ java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java (working copy)
  60. @@ -67,6 +67,7 @@
  61.         resetRecommends();
  62.         resetWorldChatPoints();
  63.         resetTrainingCamp();
  64. +       resetThroneOfHeroes();
  65.     }
  66.    
  67.     @ScheduleTarget
  68. @@ -252,6 +253,33 @@
  69.         DailyMissionData.getInstance().getDailyMissionData().forEach(DailyMissionDataHolder::reset);
  70.     }
  71.    
  72. +   public void resetThroneOfHeroes()
  73. +   {
  74. +       try (Connection con = DatabaseFactory.getConnection())
  75. +       {
  76. +           try (PreparedStatement ps = con.prepareStatement("DELETE FROM clan_variables WHERE var=?"))
  77. +           {
  78. +               ps.setString(1, "TOH_DONE");
  79. +               ps.execute();
  80. +           }
  81. +       }
  82. +       catch (Exception e)
  83. +       {
  84. +           LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Throne of Heroes Reenter: " + e);
  85. +       }
  86. +       // Update data for online players.
  87. +       World.getInstance().getPlayers().stream().forEach(player ->
  88. +       {
  89. +           if (player.getClan() != null)
  90. +           {
  91. +               player.resetThroneOfHeroesEntry();
  92. +               player.getClan().getVariables().storeMe();
  93. +           }
  94. +       });
  95. +      
  96. +       LOGGER.info("Throne of Heroes Entry has been resetted.");
  97. +   }
  98. +  
  99.     public static DailyTaskManager getInstance()
  100.     {
  101.         return SingletonHolder.INSTANCE;
  102.  
  103.  
  104. Index: dist/game/data/stats/npcs/26200-26299.xml
  105. ===================================================================
  106. --- dist/game/data/stats/npcs/26200-26299.xml   (revision 8453)
  107. +++ dist/game/data/stats/npcs/26200-26299.xml   (working copy)
  108. @@ -3050,7 +3050,7 @@
  109.             <height normal="35" />
  110.         </collision>
  111.     </npc>
  112. -   <npc id="26255" level="108" type="RaidBoss" name="Zaken">
  113. +   <npc id="26255" level="120" type="RaidBoss" name="Zaken">
  114.         <race>UNDEAD</race>
  115.         <sex>MALE</sex>
  116.         <acquire exp="3766456368864" sp="3389803344" raidPoints="21" />
  117. @@ -3066,7 +3066,7 @@
  118.         <status attackable="true" />
  119.         <ai type="BALANCED" clanHelpRange="2000" aggroRange="2000">
  120.             <clanList>
  121. -               <clan>ZAKEN_TOH</clan>
  122. +               <clan>MARY_REED_TOH</clan>
  123.             </clanList>
  124.         </ai>
  125.         <collision>
  126.  
  127.  
  128. Index: dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.xml
  129. ===================================================================
  130. --- dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.xml  (revision 8453)
  131. +++ dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.xml  (working copy)
  132. @@ -4,8 +4,7 @@
  133.     <time duration="60" empty="1" />
  134.     <locations>
  135.         <enter type="FIXED">
  136. -           <location x="11722" y="-85014" z="-10972" /> <!-- battle location -->
  137. -           <!-- <location x="11715" y="-84303" z="-11030" /> behind the door -->
  138. +           <location x="11722" y="-85014" z="-10972" heading="52300" /> <!-- battle location -->
  139.         </enter>
  140.         <exit type="ORIGIN" />
  141.     </locations>
  142. @@ -39,10 +37,10 @@
  143.             <npc id="26250" x="11704" y="-86511" z="-10929" heading="0" /> <!-- Goldberg -->
  144.         </group>
  145.         <group name="GOLDBERG_MINIONS" spawnByDefault="false">
  146. -           <npc id="26251" x="11797" y="-86046" z="-10964" heading="0" respawnTime="1min" /> <!-- Handy Cannon Gunner -->
  147. -           <npc id="26252" x="11704" y="-86904" z="-10964" heading="0" respawnTime="1min" /> <!-- Anchor Warrior -->
  148. -           <npc id="26253" x="11303" y="-86510" z="-10964" heading="0" respawnTime="1min" /> <!-- Operator -->
  149. -           <npc id="26254" x="12136" y="-86488" z="-10964" heading="0" respawnTime="1min" /> <!-- Axe Warrior -->
  150. +           <npc id="26251" x="11797" y="-86046" z="-10964" heading="0" /> <!-- Handy Cannon Gunner -->
  151. +           <npc id="26252" x="11704" y="-86904" z="-10964" heading="0" /> <!-- Anchor Warrior -->
  152. +           <npc id="26253" x="11303" y="-86510" z="-10964" heading="0" /> <!-- Operator -->
  153. +           <npc id="26254" x="12136" y="-86488" z="-10964" heading="0" /> <!-- Axe Warrior -->
  154.         </group>
  155.     </spawnlist>
  156.  </instance>
  157. \ No newline at end of file
  158. Index: dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.xml
  159. ===================================================================
  160. --- dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.xml  (revision 8453)
  161. +++ dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.xml  (working copy)
  162. @@ -4,8 +4,7 @@
  163.     <time duration="60" empty="1" />
  164.     <locations>
  165.         <enter type="FIXED">
  166. -           <location x="11722" y="-85014" z="-10972" /> <!-- battle location -->
  167. -           <!-- <location x="11715" y="-84303" z="-11030" /> behind the door -->
  168. +           <location x="11722" y="-85014" z="-10972" heading="52300" /> <!-- battle location -->
  169.         </enter>
  170.         <exit type="ORIGIN" />
  171.     </locations>
  172. @@ -38,11 +36,8 @@
  173.         <group name="MARY_REED" spawnByDefault="false">
  174.             <npc id="26267" x="11704" y="-86511" z="-10929" heading="0" /> <!-- Mary Reed -->
  175.         </group>
  176. -       <group name="MARY_REED_MINIONS" spawnByDefault="false">
  177. -           <npc id="26268" x="11797" y="-86046" z="-10964" heading="0" respawnTime="1min" /> <!-- Shield Master -->
  178. -           <npc id="26269" x="11704" y="-86904" z="-10964" heading="0" respawnTime="1min" /> <!-- Spear Master -->
  179. -           <npc id="26270" x="11303" y="-86510" z="-10964" heading="0" respawnTime="1min" /> <!-- Bow Master -->
  180. -           <npc id="26271" x="12136" y="-86488" z="-10964" heading="0" respawnTime="1min" /> <!-- Magic Master -->
  181. +       <group name="MARY_REED_MINION_ZAKEN" spawnByDefault="false">
  182. +           <npc id="26255" x="11797" y="-86046" z="-10964" heading="0" /> <!-- Zaken -->
  183.         </group>
  184.     </spawnlist>
  185.  </instance>
  186. \ No newline at end of file
  187. Index: dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesTauti.xml
  188. ===================================================================
  189. --- dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesTauti.xml (revision 8453)
  190. +++ dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesTauti.xml (working copy)
  191. @@ -4,8 +4,7 @@
  192.     <time duration="60" empty="1" />
  193.     <locations>
  194.         <enter type="FIXED">
  195. -           <location x="11722" y="-85014" z="-10972" /> <!-- battle location -->
  196. -           <!-- <location x="11715" y="-84303" z="-11030" /> behind the door -->
  197. +           <location x="11722" y="-85014" z="-10972" heading="52300" /> <!-- battle location -->
  198.         </enter>
  199.         <exit type="ORIGIN" />
  200.     </locations>
  201.  
  202.  
  203. Index: dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.java
  204. ===================================================================
  205. --- dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.java (revision 8453)
  206. +++ dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.java (working copy)
  207. @@ -152,18 +152,17 @@
  208.         if (isInInstance(world))
  209.         {
  210.             final int hpPer = npc.getCurrentHpPercent();
  211. -           final int maxHp = npc.getMaxHp();
  212.             if (npc.getId() == GOLDBERG)
  213.             {
  214. -               if ((hpPer < (maxHp * 0.50)) && npc.isScriptValue(0))
  215. +               if ((hpPer <= 50) && world.isStatus(0))
  216.                 {
  217.                     startQuestTimer("SPAWN_GOLDBERG_MINIONS", 10000, npc, null);
  218. -                   npc.setScriptValue(1);
  219. +                   world.setStatus(1);
  220.                 }
  221. -               else if ((hpPer < (maxHp * 0.30)) && npc.isScriptValue(1))
  222. +               else if ((hpPer <= 30) && world.isStatus(1))
  223.                 {
  224.                     showOnScreenMsg(world, NpcStringId.GOLDBERG_BRINGS_OUT_ALL_OF_THE_POWER_WITHIN_HIM, ExShowScreenMessage.TOP_CENTER, 5000, true);
  225. -                   npc.setScriptValue(2);
  226. +                   world.setStatus(2);
  227.                 }
  228.             }
  229.         }
  230. @@ -186,18 +185,21 @@
  231.                 boolean eightCCMembersOrMore = ((killer.getCommandChannel() != null) && (killer.getCommandChannel().getMemberCount() >= 8));
  232.                 if (killer.isGM() || eightCCMembersOrMore)
  233.                 {
  234. -                   addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true);
  235. -                   addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true);
  236. +                   addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
  237. +                   addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
  238.                 }
  239.                 else
  240.                 {
  241. -                   addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true);
  242. +                   addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
  243.                 }
  244.                 // Finish instance
  245.                 world.finishInstance(2);
  246. -               // Set clan variable
  247. -               killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis());
  248. -               killer.getClan().getVariables().storeMe();
  249. +               if (!killer.isGM())
  250. +               {
  251. +                   // Set clan variable
  252. +                   killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis());
  253. +                   killer.getClan().getVariables().storeMe();
  254. +               }
  255.             }
  256.         }
  257.         return super.onKill(npc, killer, isSummon);
  258. Index: dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.java
  259. ===================================================================
  260. --- dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.java (revision 8453)
  261. +++ dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.java (working copy)
  262. @@ -17,7 +17,6 @@
  263.  package instances.ThroneOfHeroes;
  264.  
  265.  import org.l2jmobius.commons.util.Chronos;
  266. -import org.l2jmobius.commons.util.CommonUtil;
  267.  import org.l2jmobius.gameserver.model.actor.Npc;
  268.  import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  269.  import org.l2jmobius.gameserver.model.instancezone.Instance;
  270. @@ -36,14 +35,8 @@
  271.     private static final int ROIENTAL = 34571;
  272.     // Monsters
  273.     private static final int MARY_REED = 26267;
  274. -   private static final int[] MARY_REED_MINIONS =
  275. -   {
  276. -       // add Zaken as minion
  277. -       26268, // Shield Master -->
  278. -       26269, // Spear Master -->
  279. -       26270, // Bow Master -->
  280. -       26271 // Magic Master -->
  281. -   };
  282. +   private static final int MARY_REED_MINION_ZAKEN = 26255;
  283. +  
  284.     // Throne's Treasure Chest Mary Reed
  285.     private static final int TREASURE_CHEST = 26456;
  286.    
  287. @@ -54,7 +47,7 @@
  288.     private static final int TEMPLATE_ID = 308;
  289.    
  290.     // Npc Dialogs
  291. -   private static final NpcStringId[] MINIONS_MESSAGES =
  292. +   private static final NpcStringId[] ZAKEN_MESSAGES =
  293.     {
  294.         NpcStringId.MARY_REED_THEY_ARE_JUST_INSECTS_HAHA_SHOW_THEM_YOUR_TRUE_POWER,
  295.         NpcStringId.MARY_REED_THESE_BRATS_ARE_PRETTY_STRONG_I_SHALL_REST_UP_A_BIT,
  296. @@ -68,7 +61,7 @@
  297.         addInstanceCreatedId(TEMPLATE_ID);
  298.         addStartNpc(ROIENTAL);
  299.         addTalkId(ROIENTAL);
  300. -       addAttackId(MARY_REED);
  301. +       addAttackId(MARY_REED, MARY_REED_MINION_ZAKEN);
  302.         addKillId(MARY_REED);
  303.     }
  304.    
  305. @@ -114,31 +107,31 @@
  306.             case "ANNOUNCE_5":
  307.             {
  308.                 showOnScreenMsg(world, NpcStringId.FIVE_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true);
  309. -               startQuestTimer("ANNOUNCE_4", 2000, null, player);
  310. +               startQuestTimer("ANNOUNCE_4", 1000, null, player);
  311.                 break;
  312.             }
  313.             case "ANNOUNCE_4":
  314.             {
  315.                 showOnScreenMsg(world, NpcStringId.FOUR_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true);
  316. -               startQuestTimer("ANNOUNCE_3", 2000, null, player);
  317. +               startQuestTimer("ANNOUNCE_3", 1000, null, player);
  318.                 break;
  319.             }
  320.             case "ANNOUNCE_3":
  321.             {
  322.                 showOnScreenMsg(world, NpcStringId.THREE_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true);
  323. -               startQuestTimer("ANNOUNCE_2", 2000, null, player);
  324. +               startQuestTimer("ANNOUNCE_2", 1000, null, player);
  325.                 break;
  326.             }
  327.             case "ANNOUNCE_2":
  328.             {
  329.                 showOnScreenMsg(world, NpcStringId.TWO_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true);
  330. -               startQuestTimer("ANNOUNCE_1", 2000, null, player);
  331. +               startQuestTimer("ANNOUNCE_1", 1000, null, player);
  332.                 break;
  333.             }
  334.             case "ANNOUNCE_1":
  335.             {
  336.                 showOnScreenMsg(world, NpcStringId.ONE_SECOND_2, ExShowScreenMessage.TOP_CENTER, 1000, true);
  337. -               startQuestTimer("SPAWN_MARY_REED", 2000, null, player);
  338. +               startQuestTimer("SPAWN_MARY_REED", 1000, null, player);
  339.                 break;
  340.             }
  341.             case "SPAWN_MARY_REED":
  342. @@ -147,12 +140,18 @@
  343.                 world.spawnGroup("MARY_REED");
  344.                 break;
  345.             }
  346. -           case "SPAWN_MARY_REED_MINIONS":
  347. +           case "ANNOUNCE_MARY_REED_SPAWNS_ZAKEN":
  348.             {
  349.                 showOnScreenMsg(world, NpcStringId.MARY_REED_SUMMONS_ZAKEN, ExShowScreenMessage.TOP_CENTER, 5000, true);
  350. -               world.spawnGroup("MARY_REED_MINIONS");
  351. +               startQuestTimer("MARY_REED_SPAWNS_ZAKEN", 10000, null, player);
  352.                 break;
  353.             }
  354. +           case "MARY_REED_SPAWNS_ZAKEN":
  355. +           {
  356. +               showOnScreenMsg(world, NpcStringId.ZAKEN_YOUR_TIME_HAS_COME, ExShowScreenMessage.TOP_CENTER, 5000, true);
  357. +               world.spawnGroup("MARY_REED_MINION_ZAKEN");
  358. +               break;
  359. +           }
  360.         }
  361.         return super.onAdvEvent(event, npc, player);
  362.     }
  363. @@ -164,23 +163,22 @@
  364.         if (isInInstance(world))
  365.         {
  366.             final int hpPer = npc.getCurrentHpPercent();
  367. -           final int maxHp = npc.getMaxHp();
  368.             if (npc.getId() == MARY_REED)
  369.             {
  370. -               if ((hpPer < (maxHp * 0.50)) && npc.isScriptValue(0))
  371. +               if ((hpPer <= 50) && world.isStatus(0))
  372.                 {
  373. -                   startQuestTimer("SPAWN_MARY_REED_MINIONS", 10000, npc, null);
  374. -                   npc.setScriptValue(1);
  375. +                   startQuestTimer("ANNOUNCE_MARY_REED_SPAWNS_ZAKEN", 10000, npc, null);
  376. +                   world.setStatus(1);
  377.                 }
  378. -               else if ((hpPer < (maxHp * 0.30)) && npc.isScriptValue(1))
  379. +               else if ((hpPer <= 30) && world.isStatus(1))
  380.                 {
  381.                     showOnScreenMsg(world, NpcStringId.DO_YOU_THINK_YOU_CAN_EVADE_MY_STRIKE_TAKE_THAT, ExShowScreenMessage.TOP_CENTER, 5000, true);
  382. -                   npc.setScriptValue(2);
  383. +                   world.setStatus(2);
  384.                 }
  385.             }
  386. -           else if (CommonUtil.contains(MARY_REED_MINIONS, npc.getId()) && world.getNpc(MARY_REED).isScriptValue(2))
  387. +           else if ((npc.getId() == MARY_REED_MINION_ZAKEN) && world.isStatus(2))
  388.             {
  389. -               showOnScreenMsg(world, MINIONS_MESSAGES[getRandom(4)], ExShowScreenMessage.TOP_CENTER, 5000, true);
  390. +               showOnScreenMsg(world, ZAKEN_MESSAGES[getRandom(4)], ExShowScreenMessage.TOP_CENTER, 5000, true);
  391.             }
  392.         }
  393.         return super.onAttack(npc, attacker, damage, isSummon);
  394. @@ -195,25 +193,28 @@
  395.             if (npc.getId() == MARY_REED)
  396.             {
  397.                 // Despawn minions and stop timer
  398. -               cancelQuestTimer("SPAWN_MARY_REED_MINIONS", npc, killer);
  399. -               world.getAliveNpcs(MARY_REED_MINIONS).forEach(beast -> beast.doDie(null));
  400. +               cancelQuestTimer("ANNOUNCE_MARY_REED_SPAWNS_ZAKEN", npc, killer);
  401. +               world.getAliveNpcs(MARY_REED_MINION_ZAKEN).forEach(beast -> beast.doDie(null));
  402.                
  403.                 // Spawn treasure chests
  404.                 boolean eightCCMembersOrMore = ((killer.getCommandChannel() != null) && (killer.getCommandChannel().getMemberCount() >= 8));
  405.                 if (killer.isGM() || eightCCMembersOrMore)
  406.                 {
  407. -                   addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true);
  408. -                   addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true);
  409. +                   addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
  410. +                   addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
  411.                 }
  412.                 else
  413.                 {
  414. -                   addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true);
  415. +                   addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
  416.                 }
  417.                 // Finish instance
  418.                 world.finishInstance(2);
  419. -               // Set clan variable
  420. -               killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis());
  421. -               killer.getClan().getVariables().storeMe();
  422. +               if (!killer.isGM())
  423. +               {
  424. +                   // Set clan variable
  425. +                   killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis());
  426. +                   killer.getClan().getVariables().storeMe();
  427. +               }
  428.             }
  429.         }
  430.         return super.onKill(npc, killer, isSummon);
  431. Index: dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesTauti.java
  432. ===================================================================
  433. --- dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesTauti.java    (revision 8453)
  434. +++ dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesTauti.java    (working copy)
  435. @@ -104,31 +104,31 @@
  436.             case "ANNOUNCE_5":
  437.             {
  438.                 showOnScreenMsg(world, NpcStringId.FIVE_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true);
  439. -               startQuestTimer("ANNOUNCE_4", 2000, null, player);
  440. +               startQuestTimer("ANNOUNCE_4", 1000, null, player);
  441.                 break;
  442.             }
  443.             case "ANNOUNCE_4":
  444.             {
  445.                 showOnScreenMsg(world, NpcStringId.FOUR_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true);
  446. -               startQuestTimer("ANNOUNCE_3", 2000, null, player);
  447. +               startQuestTimer("ANNOUNCE_3", 1000, null, player);
  448.                 break;
  449.             }
  450.             case "ANNOUNCE_3":
  451.             {
  452.                 showOnScreenMsg(world, NpcStringId.THREE_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true);
  453. -               startQuestTimer("ANNOUNCE_2", 2000, null, player);
  454. +               startQuestTimer("ANNOUNCE_2", 1000, null, player);
  455.                 break;
  456.             }
  457.             case "ANNOUNCE_2":
  458.             {
  459.                 showOnScreenMsg(world, NpcStringId.TWO_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true);
  460. -               startQuestTimer("ANNOUNCE_1", 2000, null, player);
  461. +               startQuestTimer("ANNOUNCE_1", 1000, null, player);
  462.                 break;
  463.             }
  464.             case "ANNOUNCE_1":
  465.             {
  466.                 showOnScreenMsg(world, NpcStringId.ONE_SECOND_2, ExShowScreenMessage.TOP_CENTER, 1000, true);
  467. -               startQuestTimer("SPAWN_TAUTI", 2000, null, player);
  468. +               startQuestTimer("SPAWN_TAUTI", 1000, null, player);
  469.                 break;
  470.             }
  471.             case "SPAWN_TAUTI":
  472. @@ -137,12 +137,6 @@
  473.                 world.spawnGroup("TAUTI");
  474.                 break;
  475.             }
  476. -           // case "SPAWN_TAUTI_MINIONS":
  477. -           // {
  478. -           // showOnScreenMsg(world, NpcStringId.TAUTI_SUMMONS_HIS_MECHANICAL_CONTRAPTION, ExShowScreenMessage.TOP_CENTER, 5000, true);
  479. -           // world.spawnGroup("TAUTI_MINIONS");
  480. -           // break;
  481. -           // }
  482.         }
  483.         return super.onAdvEvent(event, npc, player);
  484.     }
  485. @@ -154,19 +148,17 @@
  486.         if (isInInstance(world))
  487.         {
  488.             final int hpPer = npc.getCurrentHpPercent();
  489. -           final int maxHp = npc.getMaxHp();
  490.             if (npc.getId() == TAUTI)
  491.             {
  492. -               if ((hpPer < (maxHp * 0.50)) && npc.isScriptValue(0))
  493. +               if ((hpPer <= 50) && world.isStatus(0))
  494.                 {
  495. -                   // startQuestTimer("SPAWN_TAUTI_MINIONS", 10000, npc, null);
  496.                     showOnScreenMsg(world, TAUTI_MESSAGES[getRandom(2)], ExShowScreenMessage.TOP_CENTER, 5000, true);
  497. -                   npc.setScriptValue(1);
  498. +                   world.setStatus(1);
  499.                 }
  500. -               else if ((hpPer < (maxHp * 0.30)) && npc.isScriptValue(1))
  501. +               else if ((hpPer <= 30) && world.isStatus(1))
  502.                 {
  503.                     showOnScreenMsg(world, TAUTI_MESSAGES[getRandom(2)], ExShowScreenMessage.TOP_CENTER, 5000, true);
  504. -                   npc.setScriptValue(2);
  505. +                   world.setStatus(2);
  506.                 }
  507.             }
  508.         }
  509. @@ -181,26 +173,25 @@
  510.         {
  511.             if (npc.getId() == TAUTI)
  512.             {
  513. -               // Despawn minions and stop timer
  514. -               // cancelQuestTimer("SPAWN_TAUTI_MINIONS", npc, killer);
  515. -               // world.getAliveNpcs(TAUTI_MINIONS).forEach(beast -> beast.doDie(null));
  516. -              
  517.                 // Spawn treasure chests
  518.                 boolean eightCCMembersOrMore = ((killer.getCommandChannel() != null) && (killer.getCommandChannel().getMemberCount() >= 8));
  519.                 if (killer.isGM() || eightCCMembersOrMore)
  520.                 {
  521. -                   addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true);
  522. -                   addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true);
  523. +                   addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
  524. +                   addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
  525.                 }
  526.                 else
  527.                 {
  528. -                   addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true);
  529. +                   addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
  530.                 }
  531.                 // Finish instance
  532.                 world.finishInstance(2);
  533. -               // Set clan variable
  534. -               killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis());
  535. -               killer.getClan().getVariables().storeMe();
  536. +               if (!killer.isGM())
  537. +               {
  538. +                   // Set clan variable
  539. +                   killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis());
  540. +                   killer.getClan().getVariables().storeMe();
  541. +               }
  542.             }
  543.         }
  544.         return super.onKill(npc, killer, isSummon);
  545.  
Add Comment
Please, Sign In to add comment