NpcLocationInfo.java 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. /*
  2. * Copyright (C) 2004-2014 L2J DataPack
  3. *
  4. * This file is part of L2J DataPack.
  5. *
  6. * L2J DataPack is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * L2J DataPack is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. package custom.NpcLocationInfo;
  20. import com.l2jserver.gameserver.datatables.SpawnTable;
  21. import com.l2jserver.gameserver.model.L2Spawn;
  22. import com.l2jserver.gameserver.model.actor.L2Npc;
  23. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  24. import com.l2jserver.gameserver.model.quest.Quest;
  25. import com.l2jserver.gameserver.model.quest.QuestState;
  26. import com.l2jserver.gameserver.util.Util;
  27. /**
  28. * Npc Location Info AI.
  29. * @author Nyaran
  30. */
  31. public final class NpcLocationInfo extends Quest
  32. {
  33. private static final int[] NPC =
  34. {
  35. 30598,
  36. 30599,
  37. 30600,
  38. 30601,
  39. 30602,
  40. 32135
  41. };
  42. private static final int[] NPCRADAR =
  43. {
  44. // Talking Island
  45. 30006, // Gatekeeper Roxxy
  46. 30039, // Captain Gilbert
  47. 30040, // Guard Leon
  48. 30041, // Guard Arnold
  49. 30042, // Guard Abellos
  50. 30043, // Guard Johnstone
  51. 30044, // Guard Chiperan
  52. 30045, // Guard Kenyos
  53. 30046, // Guard Hanks
  54. 30283, // Blacksmith Altran
  55. 30003, // Trader Silvia
  56. 30004, // Trader Katerina
  57. 30001, // Trader Lector
  58. 30002, // Trader Jackson
  59. 30031, // High Priest Biotin
  60. 30033, // Magister Baulro
  61. 30035, // Magister Harrys
  62. 30032, // Priest Yohanes
  63. 30036, // Priest Petron
  64. 30026, // Grand Master Bitz
  65. 30027, // Master Gwinter
  66. 30029, // Master Minia
  67. 30028, // Master Pintage
  68. 30054, // Warehouse Keeper Rant
  69. 30055, // Warehouse Keeper Rolfe
  70. 30005, // Warehouse Keeper Wilford
  71. 30048, // Darin
  72. 30312, // Lighthouse Keeper Rockswell
  73. 30368, // Lilith
  74. 30049, // Bonnie
  75. 30047, // Wharf Manager Firon
  76. 30497, // Edmond
  77. 30050, // Elias
  78. 30311, // Sir Collin Windawood
  79. 30051, // Cristel
  80. // Dark Elf Vill
  81. 30134, // Gatekeeper Jasmine
  82. 30224, // Sentry Knight Rayla
  83. 30348, // Sentry Nelsya
  84. 30355, // Sentry Roselyn
  85. 30347, // Sentry Marion
  86. 30432, // Sentry Irene
  87. 30356, // Sentry Altima
  88. 30349, // Sentry Jenna
  89. 30346, // Sentry Kayleen
  90. 30433, // Sentry Kathaway
  91. 30357, // Sentry Kristin
  92. 30431, // Sentry Eriel
  93. 30430, // Sentry Trionell
  94. 30307, // Blacksmith Karrod
  95. 30138, // Trader Minaless
  96. 30137, // Trader Vollodos
  97. 30135, // Trader Iria
  98. 30136, // Trader Payne
  99. 30143, // Master Trudy
  100. 30360, // Master Harant
  101. 30145, // Master Vlasty
  102. 30135, // Magister Harne
  103. 30144, // Tetrarch Vellior
  104. 30358, // Tetrarch Thifiell
  105. 30359, // Tetrarch Kaitar
  106. 30141, // Tetrarch Talloth
  107. 30139, // Warehouse Keeper Dorankus
  108. 30140, // Warehouse Keeper Erviante
  109. 30350, // Warehouse Freightman Carlon
  110. 30421, // Varika
  111. 30419, // Arkenia
  112. 30130, // Abyssal Celebrant Undrias
  113. 30351, // Astaron
  114. 30353, // Jughead
  115. 30354, // Jewel
  116. // Elven Village
  117. 30146, // Gatekeeper Mirabel
  118. 30285, // Sentinel Gartrandell
  119. 30284, // Sentinel Knight Alberius
  120. 30221, // Sentinel Rayen
  121. 30217, // Sentinel Berros
  122. 30219, // Sentinel Veltress
  123. 30220, // Sentinel Starden
  124. 30218, // Sentinel Kendell
  125. 30216, // Sentinel Wheeler
  126. 30363, // Blacksmith Aios
  127. 30149, // Trader Creamees
  128. 30150, // Trader Herbiel
  129. 30148, // Trader Ariel
  130. 30147, // Trader Unoren
  131. 30155, // Master Ellenia
  132. 30156, // Master Cobendell
  133. 30157, // Magister Greenis
  134. 30158, // Magister Esrandell
  135. 30154, // Hierarch Asterios
  136. 30153, // Warehouse Keeper Markius
  137. 30152, // Warehouse Keeper Julia
  138. 30151, // Warehouse Freightman Chad
  139. 30423, // Northwind
  140. 30414, // Rosella
  141. 31853, // Treant Bremec
  142. 30223, // Arujien
  143. 30362, // Andellia
  144. 30222, // Alshupes
  145. 30371, // Thalia
  146. 31852, // Pixy Murika
  147. // Dwarven Villa
  148. 30540, // Gatekeeper Wirphy
  149. 30541, // Protector Paion
  150. 30542, // Defender Runant
  151. 30543, // Defender Ethan
  152. 30544, // Defender Cromwell
  153. 30545, // Defender Proton
  154. 30546, // Defender Dinkey
  155. 30547, // Defender Tardyon
  156. 30548, // Defender Nathan
  157. 30531, // Iron Gate's Lockirin
  158. 30532, // Golden Wheel's Spiron
  159. 30533, // Silver Scale's Balanki
  160. 30534, // Bronze Key's Keef
  161. 30535, // Filaur of the Gray Pillar
  162. 30536, // Black Anvil's Arin
  163. 30525, // Head Blacksmith Bronk
  164. 30526, // Blacksmith Brunon
  165. 30527, // Blacksmith Silvera
  166. 30518, // Trader Garita
  167. 30519, // Trader Mion
  168. 30516, // Trader Reep
  169. 30517, // Trader Shari
  170. 30520, // Warehouse Chief Reed
  171. 30521, // Warehouse Freightman Murdoc
  172. 30522, // Warehouse Keeper Airy
  173. 30523, // Collector Gouph
  174. 30524, // Collector Pippi
  175. 30537, // Daichir, Priest of the Eart
  176. 30650, // Priest of the Earth Gerald
  177. 30538, // Priest of the Earth Zimenf
  178. 30539, // Priestess of the Earth Chichirin
  179. 30671, // Captain Croto
  180. 30651, // Wanderer Dorf
  181. 30550, // Gauri Twinklerock
  182. 30554, // Miner Bolter
  183. 30553, // Maryse Redbonnet
  184. // Orc Village
  185. 30576, // Gatekeeper Tamil
  186. 30577, // Praetorian Rukain
  187. 30578, // Centurion Nakusin
  188. 30579, // Centurion Tamai
  189. 30580, // Centurion Parugon
  190. 30581, // Centurion Orinak
  191. 30582, // Centurion Tiku
  192. 30583, // Centurion Petukai
  193. 30584, // Centurion Vapook
  194. 30569, // Prefect Brukurse
  195. 30570, // Prefect Karukia
  196. 30571, // Seer Tanapi
  197. 30572, // Seer Livina
  198. 30564, // Blacksmith Sumari
  199. 30560, // Trader Uska
  200. 30561, // Trader Papuma
  201. 30558, // Trader Jakal
  202. 30559, // Trader Kunai
  203. 30562, // Warehouse Keeper Grookin
  204. 30563, // Warehouse Keeper Imantu
  205. 30565, // Flame Lord Kakai
  206. 30566, // Atuba Chief Varkees
  207. 30567, // Neruga Chief Tantus
  208. 30568, // Urutu Chief Hatos
  209. 30585, // Tataru Zu Hestui
  210. 30587, // Gantaki Zu Urutu
  211. // Kamael Villag
  212. 32163, // Gatekeeper Ragara
  213. 32173, // Zerstorer Marcela
  214. 32174, // Marksman Maddy
  215. 32175, // Marksman Bixon
  216. 32176, // Marksman Ambra
  217. 32177, // Marksman Syzar
  218. 32178, // Guard Karba
  219. 32179, // Marksman Putin
  220. 32180, // Marksman Kato
  221. 32164, // Weapons Trader Erinu
  222. 32165, // Armor Trader Zacon
  223. 32168, // Magic Trader Janis
  224. 32166, // Accessory Trader Treavi
  225. 32167, // Consumption Goods Trader Neazel
  226. 32141, // Master Nerga
  227. 32142, // Master Tenor
  228. 32143, // Master Belkis
  229. 32144, // Master Sonya
  230. 32145, // Grand Master Maynard
  231. 32146, // Grand Master Valpor
  232. 32139, // Hierarch Casca
  233. 32140, // Hierarch Zenya
  234. 32138, // Hierarch Kekropus
  235. 32171, // Warehouse Chief Hoffa
  236. 32170, // Warehouse Keeper Benis
  237. 32172, // Warehouse Freightman Saylem
  238. 32153, // High Priest Prana
  239. 32154, // Grand Master Aldenia
  240. 32155, // Priest Nabot
  241. 32156, // Master Talbot
  242. 32150, // Hight Prefect Took
  243. 32151, // Prefect Harz
  244. 32152, // Seer Henri
  245. 32147, // Grand Master Libian
  246. 32148, // Master Sydnet
  247. 32149, // Magister Enea
  248. 32160, // Grand Magister Devon
  249. 32162, // Magister Martika
  250. 32161, // Master Black
  251. 32158, // Warehouse Chief Fisler
  252. 32157, // Head Blacksmith Moka
  253. 32159, // Blacksmith Kincaid
  254. 32169, // Spellbook Trader Mifren
  255. };
  256. private NpcLocationInfo()
  257. {
  258. super(-1, NpcLocationInfo.class.getSimpleName(), "custom");
  259. addStartNpc(NPC);
  260. addTalkId(NPC);
  261. }
  262. @Override
  263. public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  264. {
  265. String htmltext = event;
  266. QuestState st = player.getQuestState(getName());
  267. if (st == null)
  268. {
  269. return htmltext;
  270. }
  271. if (Util.isDigit(event))
  272. {
  273. htmltext = null;
  274. int npcId = Integer.parseInt(event);
  275. if (Util.contains(NPCRADAR, npcId))
  276. {
  277. int x = 0, y = 0, z = 0;
  278. final L2Spawn spawn = SpawnTable.getInstance().getFirstSpawn(npcId);
  279. if (spawn != null)
  280. {
  281. x = spawn.getX();
  282. y = spawn.getY();
  283. z = spawn.getZ();
  284. }
  285. st.addRadar(x, y, z);
  286. htmltext = "MoveToLoc.htm";
  287. }
  288. st.exitQuest(true);
  289. }
  290. return htmltext;
  291. }
  292. @Override
  293. public String onTalk(L2Npc npc, L2PcInstance player)
  294. {
  295. String htmltext = getNoQuestMsg(player);
  296. int npcId = npc.getId();
  297. if (Util.contains(NPC, npcId))
  298. {
  299. htmltext = String.valueOf(npcId) + ".htm";
  300. }
  301. return htmltext;
  302. }
  303. public static void main(String args[])
  304. {
  305. new NpcLocationInfo();
  306. }
  307. }