NpcLocationInfo.java 8.4 KB

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