Q00233_TestOfTheWarSpirit.java 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  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 quests.Q00233_TestOfTheWarSpirit;
  20. import com.l2jserver.gameserver.enums.QuestSound;
  21. import com.l2jserver.gameserver.enums.Race;
  22. import com.l2jserver.gameserver.model.actor.L2Npc;
  23. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  24. import com.l2jserver.gameserver.model.base.ClassId;
  25. import com.l2jserver.gameserver.model.quest.Quest;
  26. import com.l2jserver.gameserver.model.quest.QuestState;
  27. import com.l2jserver.gameserver.network.serverpackets.SocialAction;
  28. import com.l2jserver.gameserver.util.Util;
  29. /**
  30. * Test Of The War Spirit (233)
  31. * @author ivantotov
  32. */
  33. public final class Q00233_TestOfTheWarSpirit extends Quest
  34. {
  35. // NPCs
  36. private static final int PRIESTESS_VIVYAN = 30030;
  37. private static final int TRADER_SARIEN = 30436;
  38. private static final int SEER_RACOY = 30507;
  39. private static final int SEER_SOMAK = 30510;
  40. private static final int SEER_MANAKIA = 30515;
  41. private static final int SHADOW_ORIM = 30630;
  42. private static final int ANCESTOR_MARTANKUS = 30649;
  43. private static final int SEER_PEKIRON = 30682;
  44. // Items
  45. private static final int VENDETTA_TOTEM = 2880;
  46. private static final int TAMLIN_ORC_HEAD = 2881;
  47. private static final int WARSPIRIT_TOTEM = 2882;
  48. private static final int ORIMS_CONTRACT = 2883;
  49. private static final int PORTAS_EYE = 2884;
  50. private static final int EXCUROS_SCALE = 2885;
  51. private static final int MORDEOS_TALON = 2886;
  52. private static final int BRAKIS_REMAINS1 = 2887;
  53. private static final int PEKIRONS_TOTEM = 2888;
  54. private static final int TONARS_SKULL = 2889;
  55. private static final int TONARS_RIB_BONE = 2890;
  56. private static final int TONARS_SPINE = 2891;
  57. private static final int TONARS_ARM_BONE = 2892;
  58. private static final int TONARS_THIGH_BONE = 2893;
  59. private static final int TONARS_REMAINS1 = 2894;
  60. private static final int MANAKIAS_TOTEM = 2895;
  61. private static final int HERMODTS_SKULL = 2896;
  62. private static final int HERMODTS_RIB_BONE = 2897;
  63. private static final int HERMODTS_SPINE = 2898;
  64. private static final int HERMODTS_ARM_BONE = 2899;
  65. private static final int HERMODTS_THIGH_BONE = 2900;
  66. private static final int HERMODTS_REMAINS1 = 2901;
  67. private static final int RACOYS_TOTEM = 2902;
  68. private static final int VIVIANTES_LETTER = 2903;
  69. private static final int INSECT_DIAGRAM_BOOK = 2904;
  70. private static final int KIRUNAS_SKULL = 2905;
  71. private static final int KIRUNAS_RIB_BONE = 2906;
  72. private static final int KIRUNAS_SPINE = 2907;
  73. private static final int KIRUNAS_ARM_BONE = 2908;
  74. private static final int KIRUNAS_THIGH_BONE = 2909;
  75. private static final int KIRUNAS_REMAINS1 = 2910;
  76. private static final int BRAKIS_REMAINS2 = 2911;
  77. private static final int TONARS_REMAINS2 = 2912;
  78. private static final int HERMODTS_REMAINS2 = 2913;
  79. private static final int KIRUNAS_REMAINS2 = 2914;
  80. // Reward
  81. private static final int MARK_OF_WARSPIRIT = 2879;
  82. private static final int DIMENSIONAL_DIAMOND = 7562;
  83. // Monster
  84. private static final int NOBLE_ANT = 20089;
  85. private static final int NOBLE_ANT_LEADER = 20090;
  86. private static final int MEDUSA = 20158;
  87. private static final int PORTA = 20213;
  88. private static final int EXCURO = 20214;
  89. private static final int MORDERO = 20215;
  90. private static final int LETO_LIZARDMAN_SHAMAN = 20581;
  91. private static final int LETO_LIZARDMAN_OVERLORD = 20582;
  92. private static final int TAMLIN_ORC = 20601;
  93. private static final int TAMLIN_ORC_ARCHER = 20602;
  94. // Quest Monster
  95. private static final int STENOA_GORGON_QUEEN = 27108;
  96. // Misc
  97. private static final int MIN_LEVEL = 39;
  98. public Q00233_TestOfTheWarSpirit()
  99. {
  100. super(233, Q00233_TestOfTheWarSpirit.class.getSimpleName(), "Test Of The War Spirit");
  101. addStartNpc(SEER_SOMAK);
  102. addTalkId(SEER_SOMAK, PRIESTESS_VIVYAN, TRADER_SARIEN, SEER_RACOY, SEER_MANAKIA, SHADOW_ORIM, ANCESTOR_MARTANKUS, SEER_PEKIRON);
  103. addKillId(NOBLE_ANT, NOBLE_ANT_LEADER, MEDUSA, PORTA, EXCURO, MORDERO, LETO_LIZARDMAN_SHAMAN, LETO_LIZARDMAN_OVERLORD, TAMLIN_ORC, TAMLIN_ORC_ARCHER, STENOA_GORGON_QUEEN);
  104. registerQuestItems(VENDETTA_TOTEM, TAMLIN_ORC_HEAD, WARSPIRIT_TOTEM, ORIMS_CONTRACT, PORTAS_EYE, EXCUROS_SCALE, MORDEOS_TALON, BRAKIS_REMAINS1, PEKIRONS_TOTEM, TONARS_SKULL, TONARS_RIB_BONE, TONARS_SPINE, TONARS_ARM_BONE, TONARS_THIGH_BONE, TONARS_REMAINS1, MANAKIAS_TOTEM, HERMODTS_SKULL, HERMODTS_RIB_BONE, HERMODTS_SPINE, HERMODTS_ARM_BONE, HERMODTS_THIGH_BONE, HERMODTS_REMAINS1, RACOYS_TOTEM, VIVIANTES_LETTER, INSECT_DIAGRAM_BOOK, KIRUNAS_SKULL, KIRUNAS_RIB_BONE, KIRUNAS_SPINE, KIRUNAS_ARM_BONE, KIRUNAS_THIGH_BONE, KIRUNAS_REMAINS1, BRAKIS_REMAINS2, TONARS_REMAINS2, HERMODTS_REMAINS2, KIRUNAS_REMAINS2);
  105. }
  106. @Override
  107. public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  108. {
  109. final QuestState qs = getQuestState(player, false);
  110. if (qs == null)
  111. {
  112. return null;
  113. }
  114. String htmltext = null;
  115. switch (event)
  116. {
  117. case "ACCEPT":
  118. {
  119. if (qs.isCreated())
  120. {
  121. qs.startQuest();
  122. if (player.getVariables().getInt("2ND_CLASS_DIAMOND_REWARD", 0) == 0)
  123. {
  124. giveItems(player, DIMENSIONAL_DIAMOND, 92);
  125. player.getVariables().set("2ND_CLASS_DIAMOND_REWARD", 1);
  126. htmltext = "30510-05e.htm";
  127. }
  128. else
  129. {
  130. htmltext = "30510-05.htm";
  131. }
  132. }
  133. break;
  134. }
  135. case "30510-05a.html":
  136. case "30510-05b.html":
  137. case "30510-05c.html":
  138. case "30510-05d.html":
  139. case "30510-05.html":
  140. case "30030-02.html":
  141. case "30030-03.html":
  142. case "30630-02.html":
  143. case "30630-03.html":
  144. case "30649-02.html":
  145. {
  146. htmltext = event;
  147. break;
  148. }
  149. case "30030-04.html":
  150. {
  151. giveItems(player, VIVIANTES_LETTER, 1);
  152. htmltext = event;
  153. break;
  154. }
  155. case "30507-02.html":
  156. {
  157. giveItems(player, RACOYS_TOTEM, 1);
  158. htmltext = event;
  159. break;
  160. }
  161. case "30515-02.html":
  162. {
  163. giveItems(player, MANAKIAS_TOTEM, 1);
  164. htmltext = event;
  165. break;
  166. }
  167. case "30630-04.html":
  168. {
  169. giveItems(player, ORIMS_CONTRACT, 1);
  170. htmltext = event;
  171. break;
  172. }
  173. case "30649-03.html":
  174. {
  175. if (hasQuestItems(player, TONARS_REMAINS2))
  176. {
  177. giveAdena(player, 161806, true);
  178. giveItems(player, MARK_OF_WARSPIRIT, 1);
  179. addExpAndSp(player, 894888, 61408);
  180. qs.exitQuest(false, true);
  181. player.sendPacket(new SocialAction(player.getObjectId(), 3));
  182. htmltext = event;
  183. }
  184. break;
  185. }
  186. case "30682-02.html":
  187. {
  188. giveItems(player, PEKIRONS_TOTEM, 1);
  189. htmltext = event;
  190. break;
  191. }
  192. }
  193. return htmltext;
  194. }
  195. @Override
  196. public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
  197. {
  198. final QuestState qs = getQuestState(killer, false);
  199. if ((qs != null) && qs.isStarted() && Util.checkIfInRange(1500, npc, killer, true))
  200. {
  201. switch (npc.getId())
  202. {
  203. case NOBLE_ANT:
  204. case NOBLE_ANT_LEADER:
  205. {
  206. if (hasQuestItems(killer, RACOYS_TOTEM, INSECT_DIAGRAM_BOOK))
  207. {
  208. final int i0 = getRandom(100);
  209. if (i0 > 65)
  210. {
  211. if (!hasQuestItems(killer, KIRUNAS_THIGH_BONE))
  212. {
  213. giveItems(killer, KIRUNAS_THIGH_BONE, 1);
  214. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  215. }
  216. else if (!hasQuestItems(killer, KIRUNAS_ARM_BONE))
  217. {
  218. giveItems(killer, KIRUNAS_ARM_BONE, 1);
  219. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  220. }
  221. }
  222. else if (i0 > 30)
  223. {
  224. if (!hasQuestItems(killer, KIRUNAS_SPINE))
  225. {
  226. giveItems(killer, KIRUNAS_SPINE, 1);
  227. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  228. }
  229. else if (!hasQuestItems(killer, KIRUNAS_RIB_BONE))
  230. {
  231. giveItems(killer, KIRUNAS_RIB_BONE, 1);
  232. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  233. }
  234. }
  235. else if (i0 > 0)
  236. {
  237. if (!hasQuestItems(killer, KIRUNAS_SKULL))
  238. {
  239. giveItems(killer, KIRUNAS_SKULL, 1);
  240. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  241. }
  242. }
  243. }
  244. break;
  245. }
  246. case MEDUSA:
  247. {
  248. if (hasQuestItems(killer, MANAKIAS_TOTEM))
  249. {
  250. if (!hasQuestItems(killer, HERMODTS_RIB_BONE))
  251. {
  252. giveItems(killer, HERMODTS_RIB_BONE, 1);
  253. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  254. }
  255. else if (!hasQuestItems(killer, HERMODTS_SPINE))
  256. {
  257. giveItems(killer, HERMODTS_SPINE, 1);
  258. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  259. }
  260. else if (!hasQuestItems(killer, HERMODTS_ARM_BONE))
  261. {
  262. giveItems(killer, HERMODTS_ARM_BONE, 1);
  263. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  264. }
  265. else if (!hasQuestItems(killer, HERMODTS_THIGH_BONE))
  266. {
  267. giveItems(killer, HERMODTS_THIGH_BONE, 1);
  268. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  269. }
  270. }
  271. break;
  272. }
  273. case PORTA:
  274. {
  275. if (hasQuestItems(killer, ORIMS_CONTRACT))
  276. {
  277. giveItemRandomly(killer, npc, PORTAS_EYE, 2, 10, 1.0, true);
  278. }
  279. break;
  280. }
  281. case EXCURO:
  282. {
  283. if (hasQuestItems(killer, ORIMS_CONTRACT))
  284. {
  285. giveItemRandomly(killer, npc, EXCUROS_SCALE, 5, 10, 1.0, true);
  286. }
  287. break;
  288. }
  289. case MORDERO:
  290. {
  291. if (hasQuestItems(killer, ORIMS_CONTRACT))
  292. {
  293. giveItemRandomly(killer, npc, MORDEOS_TALON, 5, 10, 1.0, true);
  294. }
  295. break;
  296. }
  297. case LETO_LIZARDMAN_SHAMAN:
  298. case LETO_LIZARDMAN_OVERLORD:
  299. {
  300. if (hasQuestItems(killer, PEKIRONS_TOTEM))
  301. {
  302. if (!hasQuestItems(killer, TONARS_SKULL))
  303. {
  304. giveItems(killer, TONARS_SKULL, 1);
  305. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  306. }
  307. else if (!hasQuestItems(killer, TONARS_RIB_BONE))
  308. {
  309. giveItems(killer, TONARS_RIB_BONE, 1);
  310. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  311. }
  312. else if (!hasQuestItems(killer, TONARS_SPINE))
  313. {
  314. giveItems(killer, TONARS_SPINE, 1);
  315. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  316. }
  317. else if (!hasQuestItems(killer, TONARS_ARM_BONE))
  318. {
  319. giveItems(killer, TONARS_ARM_BONE, 1);
  320. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  321. }
  322. else if (!hasQuestItems(killer, TONARS_THIGH_BONE))
  323. {
  324. giveItems(killer, TONARS_THIGH_BONE, 1);
  325. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  326. }
  327. }
  328. break;
  329. }
  330. case TAMLIN_ORC:
  331. case TAMLIN_ORC_ARCHER:
  332. {
  333. if (hasQuestItems(killer, VENDETTA_TOTEM))
  334. {
  335. if (giveItemRandomly(killer, npc, TAMLIN_ORC_HEAD, 1, 13, 1.0, true))
  336. {
  337. qs.setCond(4, true);
  338. }
  339. }
  340. break;
  341. }
  342. case STENOA_GORGON_QUEEN:
  343. {
  344. if (hasQuestItems(killer, MANAKIAS_TOTEM) && !hasQuestItems(killer, HERMODTS_SKULL))
  345. {
  346. giveItems(killer, HERMODTS_SKULL, 1);
  347. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  348. }
  349. break;
  350. }
  351. }
  352. }
  353. return super.onKill(npc, killer, isSummon);
  354. }
  355. @Override
  356. public String onTalk(L2Npc npc, L2PcInstance player)
  357. {
  358. final QuestState qs = getQuestState(player, true);
  359. String htmltext = getNoQuestMsg(player);
  360. if (qs.isCreated())
  361. {
  362. if (npc.getId() == SEER_SOMAK)
  363. {
  364. if (player.getRace() == Race.ORC)
  365. {
  366. if (player.getClassId() == ClassId.orcShaman)
  367. {
  368. if (player.getLevel() < MIN_LEVEL)
  369. {
  370. htmltext = "30510-03.html";
  371. }
  372. else
  373. {
  374. htmltext = "30510-04.htm";
  375. }
  376. }
  377. else
  378. {
  379. htmltext = "30510-02.html";
  380. }
  381. }
  382. else
  383. {
  384. htmltext = "30510-01.html";
  385. }
  386. }
  387. }
  388. else if (qs.isStarted())
  389. {
  390. switch (npc.getId())
  391. {
  392. case SEER_SOMAK:
  393. {
  394. if (!hasAtLeastOneQuestItem(player, VENDETTA_TOTEM, WARSPIRIT_TOTEM))
  395. {
  396. if (hasQuestItems(player, BRAKIS_REMAINS1, HERMODTS_REMAINS1, KIRUNAS_REMAINS1, TONARS_REMAINS1))
  397. {
  398. giveItems(player, VENDETTA_TOTEM, 1);
  399. takeItems(player, BRAKIS_REMAINS1, 1);
  400. takeItems(player, TONARS_REMAINS1, 1);
  401. takeItems(player, HERMODTS_REMAINS1, 1);
  402. takeItems(player, KIRUNAS_REMAINS1, 1);
  403. qs.setCond(3);
  404. htmltext = "30510-07.html";
  405. }
  406. else
  407. {
  408. htmltext = "30510-06.html";
  409. }
  410. }
  411. else if (hasQuestItems(player, VENDETTA_TOTEM))
  412. {
  413. if (getQuestItemsCount(player, TAMLIN_ORC_HEAD) < 13)
  414. {
  415. htmltext = "30510-08.html";
  416. }
  417. else
  418. {
  419. takeItems(player, VENDETTA_TOTEM, 1);
  420. giveItems(player, WARSPIRIT_TOTEM, 1);
  421. giveItems(player, BRAKIS_REMAINS2, 1);
  422. giveItems(player, TONARS_REMAINS2, 1);
  423. giveItems(player, HERMODTS_REMAINS2, 1);
  424. giveItems(player, KIRUNAS_REMAINS2, 1);
  425. qs.setCond(5);
  426. htmltext = "30510-09.html";
  427. }
  428. }
  429. else if (hasQuestItems(player, WARSPIRIT_TOTEM))
  430. {
  431. htmltext = "30510-10.html";
  432. }
  433. break;
  434. }
  435. case PRIESTESS_VIVYAN:
  436. {
  437. if (hasQuestItems(player, RACOYS_TOTEM) && !hasAtLeastOneQuestItem(player, VIVIANTES_LETTER, INSECT_DIAGRAM_BOOK))
  438. {
  439. htmltext = "30030-01.html";
  440. }
  441. else if (hasQuestItems(player, RACOYS_TOTEM, VIVIANTES_LETTER) && !hasQuestItems(player, INSECT_DIAGRAM_BOOK))
  442. {
  443. htmltext = "30030-05.html";
  444. }
  445. else if (hasQuestItems(player, RACOYS_TOTEM, INSECT_DIAGRAM_BOOK) && !hasQuestItems(player, VIVIANTES_LETTER))
  446. {
  447. htmltext = "30030-06.html";
  448. }
  449. else if (!hasQuestItems(player, RACOYS_TOTEM) && hasAtLeastOneQuestItem(player, KIRUNAS_REMAINS1, KIRUNAS_REMAINS2, VENDETTA_TOTEM))
  450. {
  451. htmltext = "30030-07.html";
  452. }
  453. break;
  454. }
  455. case TRADER_SARIEN:
  456. {
  457. if (hasQuestItems(player, RACOYS_TOTEM, VIVIANTES_LETTER) && !hasQuestItems(player, INSECT_DIAGRAM_BOOK))
  458. {
  459. takeItems(player, VIVIANTES_LETTER, 1);
  460. giveItems(player, INSECT_DIAGRAM_BOOK, 1);
  461. htmltext = "30436-01.html";
  462. }
  463. else if (hasQuestItems(player, RACOYS_TOTEM, INSECT_DIAGRAM_BOOK) && !hasQuestItems(player, VIVIANTES_LETTER))
  464. {
  465. htmltext = "30436-02.html";
  466. }
  467. else if (!hasQuestItems(player, RACOYS_TOTEM) && hasAtLeastOneQuestItem(player, KIRUNAS_REMAINS1, KIRUNAS_REMAINS2, VENDETTA_TOTEM))
  468. {
  469. htmltext = "30436-03.html";
  470. }
  471. break;
  472. }
  473. case SEER_RACOY:
  474. {
  475. if (!hasAtLeastOneQuestItem(player, RACOYS_TOTEM, KIRUNAS_REMAINS1, KIRUNAS_REMAINS2, VENDETTA_TOTEM))
  476. {
  477. htmltext = "30507-01.html";
  478. }
  479. else if (hasQuestItems(player, RACOYS_TOTEM) && !hasAtLeastOneQuestItem(player, VIVIANTES_LETTER, INSECT_DIAGRAM_BOOK))
  480. {
  481. htmltext = "30507-03.html";
  482. }
  483. else if (hasQuestItems(player, RACOYS_TOTEM, VIVIANTES_LETTER) && !hasQuestItems(player, INSECT_DIAGRAM_BOOK))
  484. {
  485. htmltext = "30507-04.html";
  486. }
  487. else if (hasQuestItems(player, RACOYS_TOTEM, INSECT_DIAGRAM_BOOK) && !hasQuestItems(player, VIVIANTES_LETTER))
  488. {
  489. if (hasQuestItems(player, KIRUNAS_SKULL, KIRUNAS_RIB_BONE, KIRUNAS_SPINE, KIRUNAS_ARM_BONE, KIRUNAS_THIGH_BONE))
  490. {
  491. takeItems(player, RACOYS_TOTEM, 1);
  492. takeItems(player, INSECT_DIAGRAM_BOOK, 1);
  493. takeItems(player, KIRUNAS_SKULL, 1);
  494. takeItems(player, KIRUNAS_RIB_BONE, 1);
  495. takeItems(player, KIRUNAS_SPINE, 1);
  496. takeItems(player, KIRUNAS_ARM_BONE, 1);
  497. takeItems(player, KIRUNAS_THIGH_BONE, 1);
  498. giveItems(player, KIRUNAS_REMAINS1, 1);
  499. if (hasQuestItems(player, BRAKIS_REMAINS1, HERMODTS_REMAINS1, TONARS_REMAINS1))
  500. {
  501. qs.setCond(2);
  502. }
  503. htmltext = "30507-06.html";
  504. }
  505. else
  506. {
  507. htmltext = "30507-05.html";
  508. }
  509. }
  510. else if (!hasQuestItems(player, RACOYS_TOTEM) && hasAtLeastOneQuestItem(player, KIRUNAS_REMAINS1, KIRUNAS_REMAINS2, VENDETTA_TOTEM))
  511. {
  512. htmltext = "30507-07.html";
  513. }
  514. break;
  515. }
  516. case SEER_MANAKIA:
  517. {
  518. if (!hasAtLeastOneQuestItem(player, MANAKIAS_TOTEM, HERMODTS_REMAINS2, VENDETTA_TOTEM, HERMODTS_REMAINS1))
  519. {
  520. htmltext = "30515-01.html";
  521. }
  522. else if (hasQuestItems(player, MANAKIAS_TOTEM))
  523. {
  524. if (hasQuestItems(player, HERMODTS_SKULL, HERMODTS_RIB_BONE, HERMODTS_SPINE, HERMODTS_ARM_BONE, HERMODTS_THIGH_BONE))
  525. {
  526. takeItems(player, MANAKIAS_TOTEM, 1);
  527. takeItems(player, HERMODTS_SKULL, 1);
  528. takeItems(player, HERMODTS_RIB_BONE, 1);
  529. takeItems(player, HERMODTS_SPINE, 1);
  530. takeItems(player, HERMODTS_ARM_BONE, 1);
  531. takeItems(player, HERMODTS_THIGH_BONE, 1);
  532. giveItems(player, HERMODTS_REMAINS1, 1);
  533. if (hasQuestItems(player, BRAKIS_REMAINS1, KIRUNAS_REMAINS1, TONARS_REMAINS1))
  534. {
  535. qs.setCond(2);
  536. }
  537. htmltext = "30515-04.html";
  538. }
  539. else
  540. {
  541. htmltext = "30515-03.html";
  542. }
  543. }
  544. else if (!hasQuestItems(player, MANAKIAS_TOTEM) && hasAtLeastOneQuestItem(player, HERMODTS_REMAINS1, HERMODTS_REMAINS2, VENDETTA_TOTEM))
  545. {
  546. htmltext = "30515-05.html";
  547. }
  548. break;
  549. }
  550. case SHADOW_ORIM:
  551. {
  552. if (!hasAtLeastOneQuestItem(player, ORIMS_CONTRACT, BRAKIS_REMAINS1, BRAKIS_REMAINS2, VENDETTA_TOTEM))
  553. {
  554. htmltext = "30630-01.html";
  555. }
  556. else if (hasQuestItems(player, ORIMS_CONTRACT))
  557. {
  558. if ((getQuestItemsCount(player, PORTAS_EYE) + getQuestItemsCount(player, EXCUROS_SCALE) + getQuestItemsCount(player, MORDEOS_TALON)) < 30)
  559. {
  560. htmltext = "30630-05.html";
  561. }
  562. else
  563. {
  564. takeItems(player, ORIMS_CONTRACT, 1);
  565. takeItems(player, PORTAS_EYE, -1);
  566. takeItems(player, EXCUROS_SCALE, -1);
  567. takeItems(player, MORDEOS_TALON, -1);
  568. giveItems(player, BRAKIS_REMAINS1, 1);
  569. if (hasQuestItems(player, HERMODTS_REMAINS1, KIRUNAS_REMAINS1, TONARS_REMAINS1))
  570. {
  571. qs.setCond(2);
  572. }
  573. htmltext = "30630-06.html";
  574. }
  575. }
  576. else if (!hasQuestItems(player, ORIMS_CONTRACT) && hasAtLeastOneQuestItem(player, BRAKIS_REMAINS1, BRAKIS_REMAINS2, VENDETTA_TOTEM))
  577. {
  578. htmltext = "30630-07.html";
  579. }
  580. break;
  581. }
  582. case ANCESTOR_MARTANKUS:
  583. {
  584. if (hasQuestItems(player, WARSPIRIT_TOTEM))
  585. {
  586. htmltext = "30649-01.html";
  587. }
  588. break;
  589. }
  590. case SEER_PEKIRON:
  591. {
  592. if (!hasAtLeastOneQuestItem(player, PEKIRONS_TOTEM, TONARS_REMAINS1, TONARS_REMAINS2, VENDETTA_TOTEM))
  593. {
  594. htmltext = "30682-01.html";
  595. }
  596. else if (hasQuestItems(player, PEKIRONS_TOTEM))
  597. {
  598. if (hasQuestItems(player, TONARS_SKULL, TONARS_RIB_BONE, TONARS_SPINE, TONARS_ARM_BONE, TONARS_THIGH_BONE))
  599. {
  600. takeItems(player, PEKIRONS_TOTEM, 1);
  601. takeItems(player, TONARS_SKULL, 1);
  602. takeItems(player, TONARS_RIB_BONE, 1);
  603. takeItems(player, TONARS_SPINE, 1);
  604. takeItems(player, TONARS_ARM_BONE, 1);
  605. takeItems(player, TONARS_THIGH_BONE, 1);
  606. giveItems(player, TONARS_REMAINS1, 1);
  607. if (hasQuestItems(player, BRAKIS_REMAINS1, HERMODTS_REMAINS1, KIRUNAS_REMAINS1))
  608. {
  609. qs.setCond(2);
  610. }
  611. htmltext = "30682-04.html";
  612. }
  613. else
  614. {
  615. htmltext = "30682-03.html";
  616. }
  617. }
  618. else if (!hasQuestItems(player, PEKIRONS_TOTEM) && hasAtLeastOneQuestItem(player, TONARS_REMAINS1, TONARS_REMAINS2, VENDETTA_TOTEM))
  619. {
  620. htmltext = "30682-05.html";
  621. }
  622. break;
  623. }
  624. }
  625. }
  626. else if (qs.isCompleted())
  627. {
  628. if (npc.getId() == SEER_SOMAK)
  629. {
  630. htmltext = getAlreadyCompletedMsg(player);
  631. }
  632. }
  633. return htmltext;
  634. }
  635. }