Nottingale.java 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package custom.Nottingale;
  16. import com.l2jserver.gameserver.model.actor.L2Npc;
  17. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  18. import com.l2jserver.gameserver.model.quest.Quest;
  19. import com.l2jserver.gameserver.model.quest.QuestState;
  20. import com.l2jserver.gameserver.model.quest.State;
  21. import com.l2jserver.gameserver.network.serverpackets.RadarControl;
  22. /**
  23. * @authors Kerberos (python), Nyaran (java)
  24. */
  25. public class Nottingale extends Quest
  26. {
  27. private static final String qn = "Nottingale";
  28. private static final int NPC = 32627;
  29. public Nottingale(int questId, String name, String descr)
  30. {
  31. super(questId, name, descr);
  32. addStartNpc(NPC);
  33. addFirstTalkId(NPC);
  34. addTalkId(NPC);
  35. }
  36. @Override
  37. public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  38. {
  39. String htmltext = event;
  40. QuestState qs = player.getQuestState("10273_GoodDayToFly");
  41. if (qs == null || qs.getState() != State.COMPLETED)
  42. {
  43. player.sendPacket(new RadarControl(2, 2, 0, 0, 0));
  44. player.sendPacket(new RadarControl(0, 2, -184545, 243120, 1581));
  45. htmltext = "32627.htm";
  46. }
  47. else if (event.equals("32627-3.htm"))
  48. {
  49. player.sendPacket(new RadarControl(2, 2, 0, 0, 0));
  50. player.sendPacket(new RadarControl(0, 2, -192361, 254528, 3598));
  51. }
  52. else if (event.equals("32627-4.htm"))
  53. {
  54. player.sendPacket(new RadarControl(2, 2, 0, 0, 0));
  55. player.sendPacket(new RadarControl(0, 2, -174600, 219711, 4424));
  56. }
  57. else if (event.equals("32627-5.htm"))
  58. {
  59. player.sendPacket(new RadarControl(2, 2, 0, 0, 0));
  60. player.sendPacket(new RadarControl(0, 2, -181989, 208968, 4424));
  61. }
  62. else if (event.equals("32627-6.htm"))
  63. {
  64. player.sendPacket(new RadarControl(2, 2, 0, 0, 0));
  65. player.sendPacket(new RadarControl(0, 2, -252898, 235845, 5343));
  66. }
  67. else if (event.equals("32627-8.htm"))
  68. {
  69. player.sendPacket(new RadarControl(2, 2, 0, 0, 0));
  70. player.sendPacket(new RadarControl(0, 2, -212819, 209813, 4288));
  71. }
  72. else if (event.equals("32627-9.htm"))
  73. {
  74. player.sendPacket(new RadarControl(2, 2, 0, 0, 0));
  75. player.sendPacket(new RadarControl(0, 2, -246899, 251918, 4352));
  76. }
  77. return htmltext;
  78. }
  79. @Override
  80. public String onFirstTalk(L2Npc npc, L2PcInstance player)
  81. {
  82. QuestState st = player.getQuestState(qn);
  83. if (st == null)
  84. st = this.newQuestState(player);
  85. player.setLastQuestNpcObject(npc.getObjectId());
  86. npc.showChatWindow(player);
  87. return null;
  88. }
  89. public static void main(String[] args)
  90. {
  91. new Nottingale(-1, qn, "custom");
  92. }
  93. }