NpcLocationInfo.java 8.5 KB

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