Gladicek

Crimson Hatu Otis patch

Apr 28th, 2013
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.86 KB | None | 0 0
  1. Index: dist/game/data/scripts.cfg
  2. ===================================================================
  3. --- dist/game/data/scripts.cfg (revision 9645)
  4. +++ dist/game/data/scripts.cfg (working copy)
  5. @@ -108,6 +108,7 @@
  6. ai/individual/Baium.java
  7. ai/individual/Beleth.java
  8. ai/individual/CatsEyeBandit.java
  9. +ai/individual/CrimsonHatuOtis.java
  10. ai/individual/Core.java
  11. ai/individual/DarkWaterDragon.java
  12. ai/individual/DemonPrince.java
  13. Index: dist/game/data/scripts/ai/individual/CrimsonHatuOtis.java
  14. ===================================================================
  15. --- dist/game/data/scripts/ai/individual/CrimsonHatuOtis.java (revision 0)
  16. +++ dist/game/data/scripts/ai/individual/CrimsonHatuOtis.java (working copy)
  17. @@ -0,0 +1,103 @@
  18. +/*
  19. + * Copyright (C) 2004-2013 L2J DataPack
  20. + *
  21. + * This file is part of L2J DataPack.
  22. + *
  23. + * L2J DataPack is free software: you can redistribute it and/or modify
  24. + * it under the terms of the GNU General Public License as published by
  25. + * the Free Software Foundation, either version 3 of the License, or
  26. + * (at your option) any later version.
  27. + *
  28. + * L2J DataPack is distributed in the hope that it will be useful,
  29. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  30. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  31. + * General Public License for more details.
  32. + *
  33. + * You should have received a copy of the GNU General Public License
  34. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  35. + */
  36. +package ai.individual;
  37. +
  38. +import ai.npc.AbstractNpcAI;
  39. +
  40. +import com.l2jserver.gameserver.model.actor.L2Npc;
  41. +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  42. +import com.l2jserver.gameserver.model.holders.SkillHolder;
  43. +import com.l2jserver.gameserver.network.NpcStringId;
  44. +import com.l2jserver.gameserver.network.clientpackets.Say2;
  45. +
  46. +/**
  47. + * AI for Kamaloka (33) - Crimson Hatu Otis
  48. + * @author Gladicek
  49. + */
  50. +public final class CrimsonHatuOtis extends AbstractNpcAI
  51. +{
  52. + // Npc
  53. + private static final int CRIMSON_HATU_OTIS = 18558;
  54. + // Skills
  55. + private static SkillHolder BOSS_SPINING_SLASH = new SkillHolder(4737, 1);
  56. + private static SkillHolder BOSS_HASTE = new SkillHolder(4175, 1);
  57. +
  58. + private CrimsonHatuOtis(String name, String descr)
  59. + {
  60. + super(name, descr);
  61. + addAttackId(CRIMSON_HATU_OTIS);
  62. + addKillId(CRIMSON_HATU_OTIS);
  63. + }
  64. +
  65. + @Override
  66. + public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  67. + {
  68. + switch (event)
  69. + {
  70. + case "skill":
  71. + if (npc.isDead())
  72. + {
  73. + cancelQuestTimer("skill", npc, null);
  74. + return null;
  75. + }
  76. + npc.setTarget(player);
  77. + npc.doCast(BOSS_SPINING_SLASH.getSkill());
  78. + startQuestTimer("skill", 60000, npc, null);
  79. + break;
  80. + case "buff":
  81. + if (npc.isScriptValue(2))
  82. + {
  83. + npc.setTarget(npc);
  84. + npc.doCast(BOSS_HASTE.getSkill());
  85. + }
  86. + break;
  87. + }
  88. + return null;
  89. + }
  90. +
  91. + @Override
  92. + public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
  93. + {
  94. + if (npc.isScriptValue(0))
  95. + {
  96. + npc.setScriptValue(1);
  97. + startQuestTimer("skill", 5000, npc, null);
  98. + }
  99. + else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.3)) && npc.isScriptValue(1))
  100. + {
  101. + broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.IVE_HAD_IT_UP_TO_HERE_WITH_YOU_ILL_TAKE_CARE_OF_YOU);
  102. + npc.setScriptValue(2);
  103. + startQuestTimer("buff", 1000, npc, null);
  104. + }
  105. + return super.onAttack(npc, attacker, damage, isSummon);
  106. + }
  107. +
  108. + @Override
  109. + public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
  110. + {
  111. + cancelQuestTimer("skill", npc, null);
  112. + cancelQuestTimer("buff", npc, null);
  113. + return super.onKill(npc, player, isSummon);
  114. + }
  115. +
  116. + public static void main(String[] args)
  117. + {
  118. + new CrimsonHatuOtis(CrimsonHatuOtis.class.getSimpleName(), "ai");
  119. + }
  120. +}
  121. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment