Gladicek

Jinia

Dec 1st, 2012
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.98 KB | None | 0 0
  1. Index: frozen-core.htm
  2. ===================================================================
  3. --- frozen-core.htm (revision 0)
  4. +++ frozen-core.htm (working copy)
  5. @@ -0,0 +1,4 @@
  6. +<html><body>Jinia<br>
  7. +It´s a pieace of Frozen Core. But even you might not be able to derive all of its power.
  8. + Whatever happens be careful, you won´t be able to use it very often.<br>
  9. +</body></html>
  10. \ No newline at end of file
  11. Index: jinia-frozen-core-already.htm
  12. ===================================================================
  13. --- jinia-frozen-core-already.htm   (revision 0)
  14. +++ jinia-frozen-core-already.htm   (working copy)
  15. @@ -0,0 +1,3 @@
  16. +<html><body>Jinia<br>
  17. +Remember, Sirra gave us the Frozen Core. They should be power enough.<br>
  18. +</body></html>
  19. \ No newline at end of file
  20. Index: Jinia.java
  21. ===================================================================
  22. --- Jinia.java  (revision 0)
  23. +++ Jinia.java  (working copy)
  24. @@ -0,0 +1,73 @@
  25. +/*
  26. + * This program is free software: you can redistribute it and/or modify it under
  27. + * the terms of the GNU General Public License as published by the Free Software
  28. + * Foundation, either version 3 of the License, or (at your option) any later
  29. + * version.
  30. + *
  31. + * This program is distributed in the hope that it will be useful, but WITHOUT
  32. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  33. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  34. + * details.
  35. + *
  36. + * You should have received a copy of the GNU General Public License along with
  37. + * this program. If not, see <http://www.gnu.org/licenses/>.
  38. + */
  39. +package ai.npc.Jinia;
  40. +
  41. +import ai.npc.AbstractNpcAI;
  42. +
  43. +import com.l2jserver.gameserver.instancemanager.QuestManager;
  44. +import com.l2jserver.gameserver.model.actor.L2Npc;
  45. +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  46. +import com.l2jserver.gameserver.model.quest.Quest;
  47. +import com.l2jserver.gameserver.model.quest.QuestState;
  48. +
  49. +/**
  50. + ** @author Gladicek
  51. + */
  52. +
  53. +public class Jinia extends AbstractNpcAI
  54. +{
  55. +  
  56. +   // NPC
  57. +   private static final int JINIA = 32781;
  58. +   // Items
  59. +   private static final int FROZEN_CORE = 15469;
  60. +  
  61. +   @Override
  62. +   public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  63. +   {
  64. +       String htmltext = event;
  65. +      
  66. +       QuestState st = player.getQuestState(getName());
  67. +       if (st == null)
  68. +       {
  69. +           Quest q = QuestManager.getInstance().getQuest(getName());
  70. +           st = q.newQuestState(player);
  71. +       }
  72. +      
  73. +       if (event.equalsIgnoreCase("frozen_core"))
  74. +       {
  75. +           if (st.getQuestItemsCount(FROZEN_CORE) >= 1)
  76. +           {
  77. +               return "jinia-frozen-core-already.htm";
  78. +           }
  79. +           st.giveItems(FROZEN_CORE, 1);
  80. +           return "frozen-core.htm";
  81. +       }
  82. +      
  83. +       return htmltext;
  84. +   }
  85. +  
  86. +   public Jinia(String name, String descr)
  87. +   {
  88. +       super(name, descr);
  89. +       addStartNpc(JINIA);
  90. +       addTalkId(JINIA);
  91. +   }
  92. +  
  93. +   public static void main(String[] args)
  94. +   {
  95. +       new Jinia(Jinia.class.getSimpleName(), "ai/npc");
  96. +   }
  97. +}
  98. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment