Nottingale.java 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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.network.serverpackets.RadarControl;
  21. /**
  22. * @authors Kerberos (python), Nyaran (java)
  23. */
  24. public class Nottingale extends Quest
  25. {
  26. private static final String qn = "Nottingale";
  27. private static final int NPC = 32627;
  28. public Nottingale(int questId, String name, String descr)
  29. {
  30. super(questId, name, descr);
  31. addStartNpc(NPC);
  32. addFirstTalkId(NPC);
  33. addTalkId(NPC);
  34. }
  35. @Override
  36. public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  37. {
  38. String htmltext = event;
  39. QuestState qs = player.getQuestState("10273_GoodDayToFly");
  40. if (qs == null || !qs.isCompleted())
  41. {
  42. player.sendPacket(new RadarControl(2, 2, 0, 0, 0));
  43. player.sendPacket(new RadarControl(0, 2, -184545, 243120, 1581));
  44. htmltext = "32627.htm";
  45. }
  46. else if (event.equals("32627-3.htm"))
  47. {
  48. player.sendPacket(new RadarControl(2, 2, 0, 0, 0));
  49. player.sendPacket(new RadarControl(0, 2, -192361, 254528, 3598));
  50. }
  51. else if (event.equals("32627-4.htm"))
  52. {
  53. player.sendPacket(new RadarControl(2, 2, 0, 0, 0));
  54. player.sendPacket(new RadarControl(0, 2, -174600, 219711, 4424));
  55. }
  56. else if (event.equals("32627-5.htm"))
  57. {
  58. player.sendPacket(new RadarControl(2, 2, 0, 0, 0));
  59. player.sendPacket(new RadarControl(0, 2, -181989, 208968, 4424));
  60. }
  61. else if (event.equals("32627-6.htm"))
  62. {
  63. player.sendPacket(new RadarControl(2, 2, 0, 0, 0));
  64. player.sendPacket(new RadarControl(0, 2, -252898, 235845, 5343));
  65. }
  66. else if (event.equals("32627-8.htm"))
  67. {
  68. player.sendPacket(new RadarControl(2, 2, 0, 0, 0));
  69. player.sendPacket(new RadarControl(0, 2, -212819, 209813, 4288));
  70. }
  71. else if (event.equals("32627-9.htm"))
  72. {
  73. player.sendPacket(new RadarControl(2, 2, 0, 0, 0));
  74. player.sendPacket(new RadarControl(0, 2, -246899, 251918, 4352));
  75. }
  76. return htmltext;
  77. }
  78. @Override
  79. public String onFirstTalk(L2Npc npc, L2PcInstance player)
  80. {
  81. QuestState st = player.getQuestState(qn);
  82. if (st == null)
  83. st = this.newQuestState(player);
  84. player.setLastQuestNpcObject(npc.getObjectId());
  85. npc.showChatWindow(player);
  86. return null;
  87. }
  88. public static void main(String[] args)
  89. {
  90. new Nottingale(-1, qn, "custom");
  91. }
  92. }