NpcLocationInfo.java 8.4 KB

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