Q00417_PathOfTheScavenger.java 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  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.Q00417_PathOfTheScavenger;
  20. import com.l2jserver.gameserver.model.actor.L2Attackable;
  21. import com.l2jserver.gameserver.model.actor.L2Npc;
  22. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  23. import com.l2jserver.gameserver.model.base.ClassId;
  24. import com.l2jserver.gameserver.model.quest.Quest;
  25. import com.l2jserver.gameserver.model.quest.QuestState;
  26. import com.l2jserver.gameserver.model.skills.Skill;
  27. import com.l2jserver.gameserver.network.serverpackets.SocialAction;
  28. import com.l2jserver.gameserver.util.Util;
  29. /**
  30. * Path Of The Scavenger (417)
  31. * @author ivantotov
  32. */
  33. public final class Q00417_PathOfTheScavenger extends Quest
  34. {
  35. // NPCs
  36. private static final int WAREHOUSE_KEEPER_RAUT = 30316;
  37. private static final int TRADER_SHARI = 30517;
  38. private static final int TRADER_MION = 30519;
  39. private static final int COLLECTOR_PIPI = 30524;
  40. private static final int HEAD_BLACKSMITH_BRONK = 30525;
  41. private static final int PRIEST_OF_THE_EARTH_ZIMENF = 30538;
  42. private static final int MASTER_TOMA = 30556;
  43. private static final int TORAI = 30557;
  44. private static final int WAREHOUSE_CHIEF_YASENI = 31958;
  45. // Items
  46. private static final int PIPPIS_LETTER_OF_RECOMMENDATION = 1643;
  47. private static final int ROUTS_TELEPORT_SCROLL = 1644;
  48. private static final int SUCCUBUS_UNDIES = 1645;
  49. private static final int MIONS_LETTER = 1646;
  50. private static final int BRONKS_INGOT = 1647;
  51. private static final int SHARIS_AXE = 1648;
  52. private static final int ZIMENFS_POTION = 1649;
  53. private static final int BRONKS_PAY = 1650;
  54. private static final int SHARIS_PAY = 1651;
  55. private static final int ZIMENFS_PAY = 1652;
  56. private static final int BEAR_PICTURE = 1653;
  57. private static final int TARANTULA_PICTURE = 1654;
  58. private static final int HONEY_JAR = 1655;
  59. private static final int BEAD = 1656;
  60. private static final int BEAD_PARCEL = 1657;
  61. private static final int BEAD_PARCEL2 = 8543;
  62. // Reward
  63. private static final int RING_OF_RAVEN = 1642;
  64. // Monster
  65. private static final int HUNTER_TARANTULA = 20403;
  66. private static final int PLUNDER_TARANTULA = 20508;
  67. private static final int HUNTER_BEAR = 20777;
  68. // Quest Monster
  69. private static final int HONEY_BEAR = 27058;
  70. // Skill
  71. private static final int SPOIL = 254;
  72. // Misc
  73. private static final int MIN_LEVEL = 18;
  74. private static final String FIRST_ATTACKER = "FIRST_ATTACKER";
  75. private static final String FLAG = "FLAG";
  76. public Q00417_PathOfTheScavenger()
  77. {
  78. super(417, Q00417_PathOfTheScavenger.class.getSimpleName(), "Path Of The Scavenger");
  79. addStartNpc(COLLECTOR_PIPI);
  80. addTalkId(COLLECTOR_PIPI, WAREHOUSE_KEEPER_RAUT, TRADER_MION, TRADER_SHARI, HEAD_BLACKSMITH_BRONK, PRIEST_OF_THE_EARTH_ZIMENF, MASTER_TOMA, TORAI, WAREHOUSE_CHIEF_YASENI);
  81. addAttackId(HUNTER_TARANTULA, PLUNDER_TARANTULA, HUNTER_BEAR, HONEY_BEAR);
  82. addKillId(HUNTER_TARANTULA, PLUNDER_TARANTULA, HUNTER_BEAR, HONEY_BEAR);
  83. registerQuestItems(PIPPIS_LETTER_OF_RECOMMENDATION, ROUTS_TELEPORT_SCROLL, SUCCUBUS_UNDIES, MIONS_LETTER, BRONKS_INGOT, SHARIS_AXE, ZIMENFS_POTION, BRONKS_PAY, SHARIS_PAY, ZIMENFS_PAY, BEAR_PICTURE, TARANTULA_PICTURE, HONEY_JAR, BEAD, BEAD_PARCEL, BEAD_PARCEL2);
  84. }
  85. @Override
  86. public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  87. {
  88. final QuestState qs = getQuestState(player, false);
  89. if (qs == null)
  90. {
  91. return null;
  92. }
  93. String htmltext = null;
  94. switch (event)
  95. {
  96. case "ACCEPT":
  97. {
  98. if (player.getClassId() == ClassId.dwarvenFighter)
  99. {
  100. if (player.getLevel() >= MIN_LEVEL)
  101. {
  102. if (hasQuestItems(player, RING_OF_RAVEN))
  103. {
  104. htmltext = "30524-04.htm";
  105. }
  106. else
  107. {
  108. qs.startQuest();
  109. qs.setMemoStateEx(1, 0);
  110. giveItems(player, PIPPIS_LETTER_OF_RECOMMENDATION, 1);
  111. htmltext = "30524-05.htm";
  112. }
  113. }
  114. else
  115. {
  116. htmltext = "30524-02.htm";
  117. }
  118. }
  119. else if (player.getClassId() == ClassId.scavenger)
  120. {
  121. htmltext = "30524-02a.htm";
  122. }
  123. else
  124. {
  125. htmltext = "30524-08.htm";
  126. }
  127. break;
  128. }
  129. case "30524-03.html":
  130. case "30557-02.html":
  131. case "30519-06.html":
  132. {
  133. htmltext = event;
  134. break;
  135. }
  136. case "reply_1":
  137. {
  138. if (hasQuestItems(player, PIPPIS_LETTER_OF_RECOMMENDATION))
  139. {
  140. takeItems(player, PIPPIS_LETTER_OF_RECOMMENDATION, 1);
  141. switch (getRandom(3))
  142. {
  143. case 0:
  144. {
  145. giveItems(player, ZIMENFS_POTION, 1);
  146. htmltext = "30519-02.html";
  147. break;
  148. }
  149. case 1:
  150. {
  151. giveItems(player, SHARIS_AXE, 1);
  152. htmltext = "30519-03.html";
  153. break;
  154. }
  155. case 2:
  156. {
  157. giveItems(player, BRONKS_INGOT, 1);
  158. htmltext = "30519-04.html";
  159. break;
  160. }
  161. }
  162. }
  163. break;
  164. }
  165. case "30519-07.html":
  166. {
  167. qs.setMemoStateEx(1, qs.getMemoStateEx(1) + 1);
  168. htmltext = event;
  169. break;
  170. }
  171. case "reply_2":
  172. {
  173. switch (getRandom(2))
  174. {
  175. case 0:
  176. {
  177. htmltext = "30519-06.html";
  178. break;
  179. }
  180. case 1:
  181. {
  182. htmltext = "30519-11.html";
  183. break;
  184. }
  185. }
  186. break;
  187. }
  188. case "reply_3":
  189. {
  190. if ((qs.getMemoStateEx(1) % 10) < 2)
  191. {
  192. qs.setMemoStateEx(1, qs.getMemoStateEx(1) + 1);
  193. htmltext = "30519-07.html";
  194. }
  195. else if (((qs.getMemoStateEx(1) % 10) == 2) && qs.isMemoState(0))
  196. {
  197. htmltext = "30519-07.html";
  198. }
  199. else if (((qs.getMemoStateEx(1) % 10) == 2) && qs.isMemoState(1))
  200. {
  201. qs.setMemoStateEx(1, qs.getMemoStateEx(1) + 1);
  202. htmltext = "30519-09.html";
  203. }
  204. else if (((qs.getMemoStateEx(1) % 10) >= 3) && qs.isMemoState(1))
  205. {
  206. giveItems(player, MIONS_LETTER, 1);
  207. takeItems(player, SHARIS_AXE, 1);
  208. takeItems(player, ZIMENFS_POTION, 1);
  209. takeItems(player, BRONKS_INGOT, 1);
  210. qs.setCond(4, true);
  211. htmltext = "30519-10.html";
  212. }
  213. break;
  214. }
  215. case "reply_4":
  216. {
  217. takeItems(player, ZIMENFS_PAY, 1);
  218. takeItems(player, SHARIS_PAY, 1);
  219. takeItems(player, BRONKS_PAY, 1);
  220. switch (getRandom(3))
  221. {
  222. case 0:
  223. {
  224. giveItems(player, ZIMENFS_POTION, 1);
  225. htmltext = "30519-02.html";
  226. break;
  227. }
  228. case 1:
  229. {
  230. giveItems(player, SHARIS_AXE, 1);
  231. htmltext = "30519-03.html";
  232. break;
  233. }
  234. case 2:
  235. {
  236. giveItems(player, BRONKS_INGOT, 1);
  237. htmltext = "30519-04.html";
  238. break;
  239. }
  240. }
  241. break;
  242. }
  243. case "30556-05b.html":
  244. {
  245. if (hasQuestItems(player, TARANTULA_PICTURE) && (getQuestItemsCount(player, BEAD) >= 20))
  246. {
  247. takeItems(player, TARANTULA_PICTURE, 1);
  248. takeItems(player, BEAD, -1);
  249. giveItems(player, BEAD_PARCEL, 1);
  250. qs.setCond(9, true);
  251. htmltext = event;
  252. }
  253. break;
  254. }
  255. case "30556-06b.html":
  256. {
  257. if (hasQuestItems(player, TARANTULA_PICTURE) && (getQuestItemsCount(player, BEAD) >= 20))
  258. {
  259. takeItems(player, TARANTULA_PICTURE, 1);
  260. takeItems(player, BEAD, -1);
  261. giveItems(player, BEAD_PARCEL2, 1);
  262. qs.setMemoState(2);
  263. qs.setCond(12, true);
  264. htmltext = event;
  265. }
  266. break;
  267. }
  268. case "30316-02.html":
  269. {
  270. if (hasQuestItems(player, BEAD_PARCEL))
  271. {
  272. takeItems(player, BEAD_PARCEL, 1);
  273. giveItems(player, ROUTS_TELEPORT_SCROLL, 1);
  274. qs.setCond(10, true);
  275. htmltext = event;
  276. }
  277. break;
  278. }
  279. case "30316-03.html":
  280. {
  281. if (hasQuestItems(player, BEAD_PARCEL))
  282. {
  283. giveItems(player, ROUTS_TELEPORT_SCROLL, 1);
  284. takeItems(player, BEAD_PARCEL, 1);
  285. qs.setCond(10, true);
  286. htmltext = event;
  287. }
  288. break;
  289. }
  290. case "30557-03.html":
  291. {
  292. if (hasQuestItems(player, ROUTS_TELEPORT_SCROLL))
  293. {
  294. takeItems(player, ROUTS_TELEPORT_SCROLL, 1);
  295. giveItems(player, SUCCUBUS_UNDIES, 1);
  296. qs.setCond(11, true);
  297. npc.deleteMe();
  298. htmltext = event;
  299. }
  300. break;
  301. }
  302. case "31958-02.html":
  303. {
  304. if (qs.isMemoState(2) && hasQuestItems(player, BEAD_PARCEL2))
  305. {
  306. giveAdena(player, 163800, true);
  307. giveItems(player, RING_OF_RAVEN, 1);
  308. final int level = player.getLevel();
  309. if (level >= 20)
  310. {
  311. addExpAndSp(player, 320534, 35412);
  312. }
  313. else if (level == 19)
  314. {
  315. addExpAndSp(player, 456128, 42110);
  316. }
  317. else
  318. {
  319. addExpAndSp(player, 591724, 48808);
  320. }
  321. qs.exitQuest(false, true);
  322. player.sendPacket(new SocialAction(player.getObjectId(), 3));
  323. qs.saveGlobalQuestVar("1ClassQuestFinished", "1");
  324. htmltext = event;
  325. }
  326. break;
  327. }
  328. }
  329. return htmltext;
  330. }
  331. @Override
  332. public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon, Skill skill)
  333. {
  334. final QuestState qs = getQuestState(attacker, false);
  335. if ((qs != null) && qs.isStarted())
  336. {
  337. switch (npc.getId())
  338. {
  339. case HUNTER_BEAR:
  340. {
  341. switch (npc.getScriptValue())
  342. {
  343. case 0:
  344. {
  345. npc.setScriptValue(1);
  346. npc.getVariables().set(FIRST_ATTACKER, attacker.getObjectId());
  347. break;
  348. }
  349. case 1:
  350. {
  351. if (npc.getVariables().getInt(FIRST_ATTACKER) != attacker.getObjectId())
  352. {
  353. npc.setScriptValue(2);
  354. }
  355. break;
  356. }
  357. }
  358. break;
  359. }
  360. case HUNTER_TARANTULA:
  361. case PLUNDER_TARANTULA:
  362. case HONEY_BEAR:
  363. {
  364. if (npc.isScriptValue(0))
  365. {
  366. npc.setScriptValue(1);
  367. npc.getVariables().set(FIRST_ATTACKER, attacker.getObjectId());
  368. }
  369. // TODO: This should be skill parameter and not last skill casted.
  370. if ((attacker.getLastSkillCast() != null) && (attacker.getLastSkillCast().getId() == SPOIL))
  371. {
  372. npc.setScriptValue(2);
  373. attacker.setLastSkillCast(null); // Reset last skill cast.
  374. }
  375. break;
  376. }
  377. }
  378. }
  379. return super.onAttack(npc, attacker, damage, isSummon);
  380. }
  381. @Override
  382. public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
  383. {
  384. final QuestState qs = getQuestState(killer, false);
  385. if ((qs != null) && qs.isStarted() && Util.checkIfInRange(1500, npc, killer, true) && npc.isAttackable())
  386. {
  387. final boolean firstAttacker = (killer.getObjectId() == npc.getVariables().getInt(FIRST_ATTACKER));
  388. switch (npc.getId())
  389. {
  390. case HUNTER_BEAR:
  391. {
  392. if (npc.isScriptValue(1) && firstAttacker && hasQuestItems(killer, BEAR_PICTURE) && (getQuestItemsCount(killer, HONEY_JAR) < 5))
  393. {
  394. final int flag = qs.getInt(FLAG);
  395. if ((flag > 0) && (getRandom(100) < (20 * flag)))
  396. {
  397. addSpawn(HONEY_BEAR, npc, true, 0, true);
  398. qs.set(FLAG, 0);
  399. }
  400. else
  401. {
  402. qs.set(FLAG, flag + 1);
  403. }
  404. }
  405. break;
  406. }
  407. case HONEY_BEAR:
  408. {
  409. if (npc.isScriptValue(2) && firstAttacker && ((L2Attackable) npc).isSpoiled() && hasQuestItems(killer, BEAR_PICTURE))
  410. {
  411. if (giveItemRandomly(killer, npc, HONEY_JAR, 1, 5, 1.0, true))
  412. {
  413. qs.setCond(6);
  414. }
  415. }
  416. break;
  417. }
  418. case HUNTER_TARANTULA:
  419. case PLUNDER_TARANTULA:
  420. {
  421. if (npc.isScriptValue(2) && firstAttacker && ((L2Attackable) npc).isSpoiled() && hasQuestItems(killer, TARANTULA_PICTURE))
  422. {
  423. if (giveItemRandomly(killer, npc, BEAD, 1, 20, 1.0, true))
  424. {
  425. qs.setCond(8);
  426. }
  427. }
  428. break;
  429. }
  430. }
  431. }
  432. return super.onKill(npc, killer, isSummon);
  433. }
  434. @Override
  435. public String onTalk(L2Npc npc, L2PcInstance player)
  436. {
  437. final QuestState qs = getQuestState(player, true);
  438. String htmltext = getNoQuestMsg(player);
  439. if (qs.isCreated() || qs.isCompleted())
  440. {
  441. if (npc.getId() == COLLECTOR_PIPI)
  442. {
  443. htmltext = "30524-01.htm";
  444. }
  445. }
  446. else if (qs.isStarted())
  447. {
  448. switch (npc.getId())
  449. {
  450. case COLLECTOR_PIPI:
  451. {
  452. if (hasQuestItems(player, PIPPIS_LETTER_OF_RECOMMENDATION))
  453. {
  454. htmltext = "30524-06.html";
  455. }
  456. else
  457. {
  458. htmltext = "30524-07.html";
  459. }
  460. break;
  461. }
  462. case TRADER_MION:
  463. {
  464. if (hasQuestItems(player, PIPPIS_LETTER_OF_RECOMMENDATION))
  465. {
  466. qs.setCond(2, true);
  467. htmltext = "30519-01.html";
  468. }
  469. else if ((getQuestItemsCount(player, SHARIS_AXE) + getQuestItemsCount(player, BRONKS_INGOT) + getQuestItemsCount(player, ZIMENFS_POTION)) == 1)
  470. {
  471. if ((qs.getMemoStateEx(1) % 10) == 0)
  472. {
  473. htmltext = "30519-05.html";
  474. }
  475. else if ((qs.getMemoStateEx(1) % 10) > 0)
  476. {
  477. htmltext = "30519-08.html";
  478. }
  479. }
  480. else if ((getQuestItemsCount(player, SHARIS_PAY) + getQuestItemsCount(player, BRONKS_PAY) + getQuestItemsCount(player, ZIMENFS_PAY)) == 1)
  481. {
  482. if (qs.getMemoStateEx(1) < 50)
  483. {
  484. htmltext = "30519-12.html";
  485. }
  486. else
  487. {
  488. giveItems(player, MIONS_LETTER, 1);
  489. takeItems(player, SHARIS_PAY, 1);
  490. takeItems(player, ZIMENFS_PAY, 1);
  491. takeItems(player, BRONKS_PAY, 1);
  492. qs.setCond(4, true);
  493. htmltext = "30519-15.html";
  494. }
  495. }
  496. else if (hasQuestItems(player, MIONS_LETTER))
  497. {
  498. htmltext = "30519-13.html";
  499. }
  500. else if (hasAtLeastOneQuestItem(player, BEAR_PICTURE, TARANTULA_PICTURE, BEAD_PARCEL, ROUTS_TELEPORT_SCROLL, SUCCUBUS_UNDIES))
  501. {
  502. htmltext = "30519-14.html";
  503. }
  504. break;
  505. }
  506. case TRADER_SHARI:
  507. {
  508. if (hasQuestItems(player, SHARIS_AXE))
  509. {
  510. if (qs.getMemoStateEx(1) < 20)
  511. {
  512. takeItems(player, SHARIS_AXE, 1);
  513. giveItems(player, SHARIS_PAY, 1);
  514. qs.setMemoStateEx(1, qs.getMemoStateEx(1) + 10);
  515. htmltext = "30517-01.html";
  516. }
  517. else
  518. {
  519. takeItems(player, SHARIS_AXE, 1);
  520. giveItems(player, SHARIS_PAY, 1);
  521. qs.setMemoState(1);
  522. qs.setMemoStateEx(1, qs.getMemoStateEx(1) + 10);
  523. qs.setCond(3, true);
  524. htmltext = "30517-02.html";
  525. }
  526. }
  527. else if (hasQuestItems(player, SHARIS_PAY))
  528. {
  529. htmltext = "30517-03.html";
  530. }
  531. break;
  532. }
  533. case HEAD_BLACKSMITH_BRONK:
  534. {
  535. if (hasQuestItems(player, BRONKS_INGOT))
  536. {
  537. if (qs.getMemoStateEx(1) < 20)
  538. {
  539. takeItems(player, BRONKS_INGOT, 1);
  540. giveItems(player, BRONKS_PAY, 1);
  541. qs.setMemoStateEx(1, qs.getMemoStateEx(1) + 10);
  542. htmltext = "30525-01.html";
  543. }
  544. else
  545. {
  546. takeItems(player, BRONKS_INGOT, 1);
  547. giveItems(player, BRONKS_PAY, 1);
  548. qs.setMemoState(1);
  549. qs.setMemoStateEx(1, qs.getMemoStateEx(1) + 10);
  550. qs.setCond(3, true);
  551. htmltext = "30525-02.html";
  552. }
  553. }
  554. else if (hasQuestItems(player, BRONKS_PAY))
  555. {
  556. htmltext = "30525-03.html";
  557. }
  558. break;
  559. }
  560. case PRIEST_OF_THE_EARTH_ZIMENF:
  561. {
  562. if (hasQuestItems(player, ZIMENFS_POTION))
  563. {
  564. if (qs.getMemoStateEx(1) < 20)
  565. {
  566. takeItems(player, ZIMENFS_POTION, 1);
  567. giveItems(player, ZIMENFS_PAY, 1);
  568. qs.setMemoStateEx(1, qs.getMemoStateEx(1) + 10);
  569. htmltext = "30538-01.html";
  570. }
  571. else
  572. {
  573. takeItems(player, ZIMENFS_POTION, 1);
  574. giveItems(player, ZIMENFS_PAY, 1);
  575. qs.setMemoState(1);
  576. qs.setMemoStateEx(1, qs.getMemoStateEx(1) + 10);
  577. qs.setCond(3, true);
  578. htmltext = "30538-02.html";
  579. }
  580. }
  581. else if (hasQuestItems(player, ZIMENFS_PAY))
  582. {
  583. htmltext = "30538-03.html";
  584. }
  585. break;
  586. }
  587. case MASTER_TOMA:
  588. {
  589. if (hasQuestItems(player, MIONS_LETTER))
  590. {
  591. takeItems(player, MIONS_LETTER, 1);
  592. giveItems(player, BEAR_PICTURE, 1);
  593. qs.setCond(5, true);
  594. qs.set(FLAG, 0);
  595. htmltext = "30556-01.html";
  596. }
  597. else if (hasQuestItems(player, BEAR_PICTURE))
  598. {
  599. if (getQuestItemsCount(player, HONEY_JAR) < 5)
  600. {
  601. htmltext = "30556-02.html";
  602. }
  603. else
  604. {
  605. takeItems(player, BEAR_PICTURE, 1);
  606. giveItems(player, TARANTULA_PICTURE, 1);
  607. takeItems(player, HONEY_JAR, -1);
  608. qs.setCond(7, true);
  609. htmltext = "30556-03.html";
  610. }
  611. }
  612. else if (hasQuestItems(player, TARANTULA_PICTURE))
  613. {
  614. if (getQuestItemsCount(player, BEAD) < 20)
  615. {
  616. htmltext = "30556-04.html";
  617. }
  618. else
  619. {
  620. htmltext = "30556-05a.html";
  621. }
  622. }
  623. else if (hasQuestItems(player, BEAD_PARCEL) && !hasQuestItems(player, BEAD_PARCEL2))
  624. {
  625. htmltext = "30556-06a.html";
  626. }
  627. else if (hasQuestItems(player, BEAD_PARCEL2) && !hasQuestItems(player, BEAD_PARCEL) && qs.isMemoState(2))
  628. {
  629. htmltext = "30556-06c.html";
  630. }
  631. else if (hasAtLeastOneQuestItem(player, ROUTS_TELEPORT_SCROLL, SUCCUBUS_UNDIES))
  632. {
  633. htmltext = "30556-07.html";
  634. }
  635. break;
  636. }
  637. case WAREHOUSE_KEEPER_RAUT:
  638. {
  639. if (hasQuestItems(player, BEAD_PARCEL))
  640. {
  641. htmltext = "30316-01.html";
  642. }
  643. else if (hasQuestItems(player, ROUTS_TELEPORT_SCROLL))
  644. {
  645. htmltext = "30316-04.html";
  646. }
  647. else if (hasQuestItems(player, SUCCUBUS_UNDIES))
  648. {
  649. giveAdena(player, 81900, true);
  650. giveItems(player, RING_OF_RAVEN, 1);
  651. final int level = player.getLevel();
  652. if (level >= 20)
  653. {
  654. addExpAndSp(player, 160267, 17706);
  655. }
  656. else if (level == 19)
  657. {
  658. addExpAndSp(player, 228064, 21055);
  659. }
  660. else
  661. {
  662. addExpAndSp(player, 295862, 24404);
  663. }
  664. qs.exitQuest(false, true);
  665. player.sendPacket(new SocialAction(player.getObjectId(), 3));
  666. qs.saveGlobalQuestVar("1ClassQuestFinished", "1");
  667. htmltext = "30316-05.html";
  668. }
  669. break;
  670. }
  671. case TORAI:
  672. {
  673. if (hasQuestItems(player, ROUTS_TELEPORT_SCROLL))
  674. {
  675. htmltext = "30557-01.html";
  676. }
  677. break;
  678. }
  679. case WAREHOUSE_CHIEF_YASENI:
  680. {
  681. if (hasQuestItems(player, BEAD_PARCEL2) && !hasQuestItems(player, BEAD_PARCEL) && qs.isMemoState(2))
  682. {
  683. htmltext = "31958-01.html";
  684. }
  685. break;
  686. }
  687. }
  688. }
  689. return htmltext;
  690. }
  691. }