CostyKiller

Faction Certificates Custom Script and npcs html updates

Oct 9th, 2020
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 10.21 KB | None | 0 0
  1. Index: dist/game/data/scripts/ai/others/FactionCertificates/FactionCertificates.java
  2. ===================================================================
  3. --- dist/game/data/scripts/ai/others/FactionCertificates/FactionCertificates.java   (nonexistent)
  4. +++ dist/game/data/scripts/ai/others/FactionCertificates/FactionCertificates.java   (working copy)
  5. @@ -0,0 +1,123 @@
  6. +/*
  7. + * This file is part of the L2J Mobius project.
  8. + *
  9. + * This program is free software: you can redistribute it and/or modify
  10. + * it under the terms of the GNU General Public License as published by
  11. + * the Free Software Foundation, either version 3 of the License, or
  12. + * (at your option) any later version.
  13. + *
  14. + * This program is distributed in the hope that it will be useful,
  15. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. + * General Public License for more details.
  18. + *
  19. + * You should have received a copy of the GNU General Public License
  20. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. + */
  22. +package ai.others.FactionCertificates;
  23. +
  24. +import org.l2jmobius.gameserver.enums.Faction;
  25. +import org.l2jmobius.gameserver.model.actor.Npc;
  26. +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  27. +import org.l2jmobius.gameserver.model.quest.QuestState;
  28. +
  29. +import ai.AbstractNpcAI;
  30. +import quests.Q10875_ForReputation.Q10875_ForReputation;
  31. +import quests.Q10881_ForThePride.Q10881_ForThePride;
  32. +
  33. +/**
  34. + * Custom Faction Certificates AI.
  35. + * @author CostyKiller
  36. + */
  37. +public class FactionCertificates extends AbstractNpcAI
  38. +{
  39. +   // NPCs
  40. +   private static final int LEONA_BLACKBIRD = 31595; // Blackbird Guild Leader
  41. +   private static final int KEKROPUS = 34222; // Giant Trackers Guild Leader
  42. +   private static final int IRENE = 34233; // Mother Tree Guardians Guild Leader
  43. +   private static final int FERIN = 34054; // Unwordly Visitors Guild Leader
  44. +   private static final int LOGART_VAN_DIKE = 34235; // Royal Kingdom Guards Guild Leader
  45. +   // Certificates
  46. +   private static final int BLACKBIRD_CLAN_CERTIFICATION = 47840;
  47. +   private static final int GIANT_TRACKERS_CERTIFICATION = 47841;
  48. +   private static final int MOTHER_TREE_GUARDIANS_CERTIFICATION = 47844;
  49. +   private static final int UNWORDLY_VISITORS_CERTIFICATION = 47845;
  50. +   private static final int KINGDOM_ROYAL_GUARDS_CERTIFICATION = 47846;
  51. +   // Other
  52. +   private static final int FACTION_LEVEL = 6;
  53. +  
  54. +   private FactionCertificates()
  55. +   {
  56. +       addStartNpc(LEONA_BLACKBIRD, KEKROPUS, IRENE, FERIN, LOGART_VAN_DIKE);
  57. +       addTalkId(LEONA_BLACKBIRD, KEKROPUS, IRENE, FERIN, LOGART_VAN_DIKE);
  58. +   }
  59. +  
  60. +   @Override
  61. +   public String onAdvEvent(String event, Npc npc, PlayerInstance player)
  62. +   {
  63. +       String htmltext = null;
  64. +       final QuestState qs1 = player.getQuestState(Q10875_ForReputation.class.getSimpleName());
  65. +       final QuestState qs2 = player.getQuestState(Q10881_ForThePride.class.getSimpleName());
  66. +       if (((qs1 != null) && qs1.isStarted()) || ((qs2 != null) && qs2.isStarted()))
  67. +       {
  68. +           if (event.equals("getCertificate"))
  69. +           {
  70. +               switch (npc.getId())
  71. +               {
  72. +                   case LEONA_BLACKBIRD:
  73. +                   {
  74. +                       if (!hasQuestItems(player, BLACKBIRD_CLAN_CERTIFICATION) && (player.getFactionLevel(Faction.BLACKBIRD_CLAN) >= FACTION_LEVEL))
  75. +                       {
  76. +                           giveItems(player, BLACKBIRD_CLAN_CERTIFICATION, 1);
  77. +                           htmltext = "certificate.html";
  78. +                       }
  79. +                       break;
  80. +                   }
  81. +                   case KEKROPUS:
  82. +                   {
  83. +                       if (!hasQuestItems(player, GIANT_TRACKERS_CERTIFICATION) && (player.getFactionLevel(Faction.GIANT_TRACKERS) >= FACTION_LEVEL))
  84. +                       {
  85. +                           giveItems(player, GIANT_TRACKERS_CERTIFICATION, 1);
  86. +                           htmltext = "certificate.html";
  87. +                       }
  88. +                       break;
  89. +                   }
  90. +                   case IRENE:
  91. +                   {
  92. +                       if (!hasQuestItems(player, MOTHER_TREE_GUARDIANS_CERTIFICATION) && (player.getFactionLevel(Faction.MOTHER_TREE_GUARDIANS) >= FACTION_LEVEL))
  93. +                       {
  94. +                           giveItems(player, MOTHER_TREE_GUARDIANS_CERTIFICATION, 1);
  95. +                           htmltext = "certificate.html";
  96. +                       }
  97. +                       break;
  98. +                   }
  99. +                   case FERIN:
  100. +                   {
  101. +                       if (!hasQuestItems(player, UNWORDLY_VISITORS_CERTIFICATION) && (player.getFactionLevel(Faction.UNWORLDLY_VISITORS) >= FACTION_LEVEL))
  102. +                       {
  103. +                           giveItems(player, UNWORDLY_VISITORS_CERTIFICATION, 1);
  104. +                           htmltext = "certificate.html";
  105. +                       }
  106. +                       break;
  107. +                   }
  108. +                   case LOGART_VAN_DIKE:
  109. +                   {
  110. +                       if (!hasQuestItems(player, KINGDOM_ROYAL_GUARDS_CERTIFICATION) && (player.getFactionLevel(Faction.KINGDOM_ROYAL_GUARDS) >= FACTION_LEVEL))
  111. +                       {
  112. +                           giveItems(player, KINGDOM_ROYAL_GUARDS_CERTIFICATION, 1);
  113. +                           htmltext = "certificate.html";
  114. +                       }
  115. +                       break;
  116. +                   }
  117. +               }
  118. +           }
  119. +       }
  120. +       htmltext = "not-ready.html";
  121. +       return htmltext;
  122. +   }
  123. +  
  124. +   public static void main(String[] args)
  125. +   {
  126. +       new FactionCertificates();
  127. +   }
  128. +}
  129. Index: dist/game/data/scripts/ai/others/FactionCertificates/certificate.html
  130. ===================================================================
  131. --- dist/game/data/scripts/ai/others/FactionCertificates/certificate.html   (nonexistent)
  132. +++ dist/game/data/scripts/ai/others/FactionCertificates/certificate.html   (working copy)
  133. @@ -0,0 +1,3 @@
  134. +<html><body>Guild Leader:<br>
  135. +Here is our guild certificate. Use it wisely.<br>
  136. +</body></html>
  137. \ No newline at end of file
  138. Index: dist/game/data/scripts/ai/others/FactionCertificates/not-ready.html
  139. ===================================================================
  140. --- dist/game/data/scripts/ai/others/FactionCertificates/not-ready.html (nonexistent)
  141. +++ dist/game/data/scripts/ai/others/FactionCertificates/not-ready.html (working copy)
  142. @@ -0,0 +1,4 @@
  143. +<html><body>Guild Leader:<br>
  144. +You are not ready to get our certificate. Come back when you are ready.<br>
  145. +(For Reputation or For The Pride exalted sub quests must be in progress.)
  146. +</body></html>
  147. \ No newline at end of file
  148. Index: dist/game/data/scripts/ai/areas/HellboundIsland/LeonaBlackbird/31595.html
  149. ===================================================================
  150. --- dist/game/data/scripts/ai/areas/HellboundIsland/LeonaBlackbird/31595.html   (revision 7680)
  151. +++ dist/game/data/scripts/ai/areas/HellboundIsland/LeonaBlackbird/31595.html   (working copy)
  152. @@ -4,5 +4,6 @@
  153.  <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LeonaBlackbird 31595-01.html">"I heard something about slave trading. What's going on?"</Button>
  154.  <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LeonaBlackbird 31595-02.html">"Tell me about the Fragments of Chaos?"</Button>
  155.  <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LeonaBlackbird 31595-03.html">"What is a Giant's Grinder?"</Button>
  156. +<Button ALIGN=LEFT ICON="QUEST" action="bypass -h Quest FactionCertificates getCertificate">Get guild certificate.</Button>
  157.  <Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
  158.  </body></html>
  159. \ No newline at end of file
  160. Index: dist/game/data/scripts/ai/areas/Giran/Kekropus/34222.html
  161. ===================================================================
  162. --- dist/game/data/scripts/ai/areas/Giran/Kekropus/34222.html   (revision 7680)
  163. +++ dist/game/data/scripts/ai/areas/Giran/Kekropus/34222.html   (working copy)
  164. @@ -5,5 +5,6 @@
  165.  <Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest Kekropus teleport"><font color="LEVEL">Go up to the Superion</font></Button>
  166.  <Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest Kekropus helios"><font color="LEVEL">Open the path to Helios' Throne</font></Button>
  167.  <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 3422201">Exchange supplies to take on Helios</Button>
  168. +<Button ALIGN=LEFT ICON="QUEST" action="bypass -h Quest FactionCertificates getCertificate">Get guild certificate.</Button>
  169.  <Button ALIGN=LEFT ICON="Quest" action="bypass -h npc_%objectId%_Quest">Quest</Button>
  170.  </body></html>
  171. \ No newline at end of file
  172. Index: dist/game/data/html/default/34233.html
  173. ===================================================================
  174. --- dist/game/data/html/default/34233.html  (revision 7680)
  175. +++ dist/game/data/html/default/34233.html  (working copy)
  176. @@ -2,5 +2,6 @@
  177.  Greetings. I am Irene, leader of the Mother Tree Guardians.<br>
  178.  We the Mother Tree Guardians are engaged in a variety of activities to revive the dying Mother Tree.<br>
  179.  There is still so much we need to talk about. I hope that we can talk some more when the opportunity is right.<br>
  180. +<Button ALIGN=LEFT ICON="QUEST" action="bypass -h Quest FactionCertificates getCertificate">Get guild certificate.</Button>
  181.  <Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
  182.  </body></html>
  183. \ No newline at end of file
  184. Index: dist/game/data/html/default/34054.htm
  185. ===================================================================
  186. --- dist/game/data/html/default/34054.htm   (revision 7680)
  187. +++ dist/game/data/html/default/34054.htm   (working copy)
  188. @@ -1,5 +1,6 @@
  189.  <html><body>Ferin:<br>
  190.  What brings you here? Well, I don't really care about what you are up to. Can you stop looking down at me like that? I'm not a kid.<b>
  191.  <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 1">"What happened to the Ertheia?"</Button>
  192. +<Button ALIGN=LEFT ICON="QUEST" action="bypass -h Quest FactionCertificates getCertificate">Get guild certificate.</Button>
  193.  <Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
  194.  </body></html>
  195. \ No newline at end of file
  196. Index: dist/game/data/html/default/34235.html
  197. ===================================================================
  198. --- dist/game/data/html/default/34235.html  (revision 7680)
  199. +++ dist/game/data/html/default/34235.html  (working copy)
  200. @@ -3,5 +3,6 @@
  201.  I am Captain Logart Van Dyke of the Kingdom's Royal Guard, successor of the Van Dyke household. <br>
  202.  We, Kingdom's Royal Guard, are under the direct command of Amadeo Cadmus, King of Aden.<br>
  203.  You must consider all assignments I give you to be directly from the king himself, and apply yourself with diligence!<br>
  204. +<Button ALIGN=LEFT ICON="QUEST" action="bypass -h Quest FactionCertificates getCertificate">Get guild certificate.</Button>
  205.  <Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
  206.  </body></html>
  207. \ No newline at end of file
  208.  
Add Comment
Please, Sign In to add comment