Q00216_TrialOfTheGuildsman.java 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  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.Q00216_TrialOfTheGuildsman;
  20. import com.l2jserver.gameserver.enums.QuestSound;
  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.itemcontainer.Inventory;
  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. * Trial Of The Guildsman (216)
  31. * @author ivantotov
  32. */
  33. public final class Q00216_TrialOfTheGuildsman extends Quest
  34. {
  35. private static final int WAREHOUSE_KEEPER_VALKON = 30103;
  36. private static final int WAREHOUSE_KEEPER_NORMAN = 30210;
  37. private static final int BLACKSMITH_ALTRAN = 30283;
  38. private static final int BLACKSMITH_PINTER = 30298;
  39. private static final int BLACKSMITH_DUNING = 30688;
  40. // Items
  41. private static final int RECIPE_JOURNEYMAN_RING = 3024;
  42. private static final int RECIPE_AMBER_BEAD = 3025;
  43. private static final int VALKONS_RECOMMENDATION = 3120;
  44. private static final int MANDRAGORA_BERRY = 3121;
  45. private static final int ALLTRANS_INSTRUCTIONS = 3122;
  46. private static final int ALLTRANS_1ST_RECOMMENDATION = 3123;
  47. private static final int ALLTRANS_2ND_RECOMMENDATION = 3124;
  48. private static final int NORMANS_INSTRUCTIONS = 3125;
  49. private static final int NORMANS_RECEIPT = 3126;
  50. private static final int DUNINGS_INSTRUCTIONS = 3127;
  51. private static final int DUNINGS_KEY = 3128;
  52. private static final int NORMANS_LIST = 3129;
  53. private static final int GRAY_BONE_POWDER = 3130;
  54. private static final int GRANITE_WHETSTONE = 3131;
  55. private static final int RED_PIGMENT = 3132;
  56. private static final int BRAIDED_YARN = 3133;
  57. private static final int JOURNEYMAN_GEM = 3134;
  58. private static final int PINTERS_INSTRUCTIONS = 3135;
  59. private static final int AMBER_BEAD = 3136;
  60. private static final int AMBER_LUMP = 3137;
  61. private static final int JOURNEYMAN_DECO_BEADS = 3138;
  62. private static final int JOURNEYMAN_RING = 3139;
  63. // Reward
  64. private static final int MARK_OF_GUILDSMAN = 3119;
  65. private static final int DIMENSIONAL_DIAMOND = 7562;
  66. // Monsters
  67. private static final int ANT = 20079;
  68. private static final int ANT_CAPTAIN = 20080;
  69. private static final int ANT_OVERSEER = 20081;
  70. private static final int GRANITE_GOLEM = 20083;
  71. private static final int MANDRAGORA_SPROUT1 = 20154;
  72. private static final int MANDRAGORA_SAPLONG = 20155;
  73. private static final int MANDRAGORA_BLOSSOM = 20156;
  74. private static final int SILENOS = 20168;
  75. private static final int STRAIN = 20200;
  76. private static final int GHOUL = 20201;
  77. private static final int DEAD_SEEKER = 20202;
  78. private static final int MANDRAGORA_SPROUT2 = 20223;
  79. private static final int BREKA_ORC = 20267;
  80. private static final int BREKA_ORC_ARCHER = 20268;
  81. private static final int BREKA_ORC_SHAMAN = 20269;
  82. private static final int BREKA_ORC_OVERLORD = 20270;
  83. private static final int BREKA_ORC_WARRIOR = 20271;
  84. // Misc
  85. private static final int MIN_LVL = 35;
  86. public Q00216_TrialOfTheGuildsman()
  87. {
  88. super(216, Q00216_TrialOfTheGuildsman.class.getSimpleName(), "Trial Of The Guildsman");
  89. addStartNpc(WAREHOUSE_KEEPER_VALKON);
  90. addTalkId(WAREHOUSE_KEEPER_VALKON, WAREHOUSE_KEEPER_NORMAN, BLACKSMITH_ALTRAN, BLACKSMITH_PINTER, BLACKSMITH_DUNING);
  91. addKillId(ANT, ANT_CAPTAIN, ANT_OVERSEER, GRANITE_GOLEM, MANDRAGORA_SPROUT1, MANDRAGORA_SAPLONG, MANDRAGORA_BLOSSOM, SILENOS, STRAIN, GHOUL, DEAD_SEEKER, MANDRAGORA_SPROUT2, BREKA_ORC, BREKA_ORC_ARCHER, BREKA_ORC_SHAMAN, BREKA_ORC_OVERLORD, BREKA_ORC_WARRIOR);
  92. registerQuestItems(RECIPE_JOURNEYMAN_RING, RECIPE_AMBER_BEAD, VALKONS_RECOMMENDATION, MANDRAGORA_BERRY, ALLTRANS_INSTRUCTIONS, ALLTRANS_1ST_RECOMMENDATION, ALLTRANS_2ND_RECOMMENDATION, NORMANS_INSTRUCTIONS, NORMANS_RECEIPT, DUNINGS_INSTRUCTIONS, DUNINGS_KEY, NORMANS_LIST, GRAY_BONE_POWDER, GRANITE_WHETSTONE, RED_PIGMENT, BRAIDED_YARN, JOURNEYMAN_GEM, PINTERS_INSTRUCTIONS, AMBER_BEAD, AMBER_LUMP, JOURNEYMAN_DECO_BEADS, JOURNEYMAN_RING);
  93. }
  94. @Override
  95. public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  96. {
  97. final QuestState qs = getQuestState(player, false);
  98. if (qs == null)
  99. {
  100. return null;
  101. }
  102. String htmltext = null;
  103. switch (event)
  104. {
  105. case "ACCEPT":
  106. {
  107. if (getQuestItemsCount(player, Inventory.ADENA_ID) >= 2000)
  108. {
  109. qs.startQuest();
  110. takeItems(player, Inventory.ADENA_ID, 2000);
  111. if (!hasQuestItems(player, VALKONS_RECOMMENDATION))
  112. {
  113. giveItems(player, VALKONS_RECOMMENDATION, 1);
  114. }
  115. playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  116. if (player.getVariables().getInt("2ND_CLASS_DIAMOND_REWARD", 0) == 0)
  117. {
  118. giveItems(player, DIMENSIONAL_DIAMOND, 85);
  119. player.getVariables().set("2ND_CLASS_DIAMOND_REWARD", 1);
  120. htmltext = "30103-06d.htm";
  121. }
  122. else
  123. {
  124. htmltext = "30103-06.htm";
  125. }
  126. }
  127. else
  128. {
  129. htmltext = "30103-05b.htm";
  130. }
  131. break;
  132. }
  133. case "30103-04.htm":
  134. case "30103-05.htm":
  135. case "30103-05a.html":
  136. case "30103-06a.html":
  137. case "30103-06b.html":
  138. case "30103-06c.html":
  139. case "30103-07a.html":
  140. case "30103-07b.html":
  141. case "30103-07c.html":
  142. case "30210-02.html":
  143. case "30210-03.html":
  144. case "30210-08.html":
  145. case "30210-09.html":
  146. case "30210-11a.html":
  147. case "30283-03a.html":
  148. case "30283-03b.html":
  149. case "30283-04.html":
  150. case "30298-03.html":
  151. case "30298-05a.html":
  152. {
  153. htmltext = event;
  154. break;
  155. }
  156. case "30103-09a.html":
  157. {
  158. if (hasQuestItems(player, ALLTRANS_INSTRUCTIONS) && (getQuestItemsCount(player, JOURNEYMAN_RING) >= 7))
  159. {
  160. giveAdena(player, 187606, true);
  161. giveItems(player, MARK_OF_GUILDSMAN, 1);
  162. addExpAndSp(player, 1029478, 66768);
  163. qs.exitQuest(false, true);
  164. player.sendPacket(new SocialAction(player.getObjectId(), 3));
  165. htmltext = event;
  166. }
  167. break;
  168. }
  169. case "30103-09b.html":
  170. {
  171. if (hasQuestItems(player, ALLTRANS_INSTRUCTIONS) && (getQuestItemsCount(player, JOURNEYMAN_RING) >= 7))
  172. {
  173. giveAdena(player, 93803, true);
  174. giveItems(player, MARK_OF_GUILDSMAN, 1);
  175. addExpAndSp(player, 514739, 33384);
  176. qs.exitQuest(false, true);
  177. player.sendPacket(new SocialAction(player.getObjectId(), 3));
  178. htmltext = event;
  179. }
  180. break;
  181. }
  182. case "30210-04.html":
  183. {
  184. if (hasQuestItems(player, ALLTRANS_1ST_RECOMMENDATION))
  185. {
  186. takeItems(player, ALLTRANS_1ST_RECOMMENDATION, 1);
  187. giveItems(player, NORMANS_INSTRUCTIONS, 1);
  188. giveItems(player, NORMANS_RECEIPT, 1);
  189. htmltext = event;
  190. }
  191. break;
  192. }
  193. case "30210-10.html":
  194. {
  195. if (hasQuestItems(player, NORMANS_INSTRUCTIONS))
  196. {
  197. takeItems(player, NORMANS_INSTRUCTIONS, 1);
  198. takeItems(player, DUNINGS_KEY, -1);
  199. giveItems(player, NORMANS_LIST, 1);
  200. htmltext = event;
  201. }
  202. break;
  203. }
  204. case "30283-03.html":
  205. {
  206. if (hasQuestItems(player, VALKONS_RECOMMENDATION, MANDRAGORA_BERRY))
  207. {
  208. giveItems(player, RECIPE_JOURNEYMAN_RING, 1);
  209. takeItems(player, VALKONS_RECOMMENDATION, 1);
  210. takeItems(player, MANDRAGORA_BERRY, 1);
  211. giveItems(player, ALLTRANS_INSTRUCTIONS, 1);
  212. giveItems(player, ALLTRANS_1ST_RECOMMENDATION, 1);
  213. giveItems(player, ALLTRANS_2ND_RECOMMENDATION, 1);
  214. qs.setCond(5, true);
  215. htmltext = event;
  216. }
  217. break;
  218. }
  219. case "30298-04.html":
  220. {
  221. if (player.getClassId() == ClassId.scavenger)
  222. {
  223. if (hasQuestItems(player, ALLTRANS_2ND_RECOMMENDATION))
  224. {
  225. takeItems(player, ALLTRANS_2ND_RECOMMENDATION, 1);
  226. giveItems(player, PINTERS_INSTRUCTIONS, 1);
  227. htmltext = event;
  228. }
  229. }
  230. else if (hasQuestItems(player, ALLTRANS_2ND_RECOMMENDATION))
  231. {
  232. giveItems(player, RECIPE_AMBER_BEAD, 1);
  233. takeItems(player, ALLTRANS_2ND_RECOMMENDATION, 1);
  234. giveItems(player, PINTERS_INSTRUCTIONS, 1);
  235. htmltext = "30298-05.html";
  236. }
  237. break;
  238. }
  239. case "30688-02.html":
  240. {
  241. if (hasQuestItems(player, NORMANS_RECEIPT))
  242. {
  243. takeItems(player, NORMANS_RECEIPT, 1);
  244. giveItems(player, DUNINGS_INSTRUCTIONS, 1);
  245. htmltext = event;
  246. }
  247. break;
  248. }
  249. }
  250. return htmltext;
  251. }
  252. @Override
  253. public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
  254. {
  255. switch (npc.getId())
  256. {
  257. case ANT:
  258. case ANT_CAPTAIN:
  259. case ANT_OVERSEER:
  260. {
  261. final QuestState qs = getRandomPartyMemberState(killer, -1, 2, npc);
  262. if (qs != null)
  263. {
  264. int count = 0;
  265. if ((qs.getPlayer().getClassId() == ClassId.scavenger) && npc.isSweepActive())
  266. {
  267. count += 5;
  268. }
  269. if (getRandomBoolean() && (qs.getPlayer().getClassId() == ClassId.artisan))
  270. {
  271. giveItems(qs.getPlayer(), AMBER_LUMP, 1);
  272. playSound(qs.getPlayer(), QuestSound.ITEMSOUND_QUEST_MIDDLE);
  273. }
  274. if ((getQuestItemsCount(qs.getPlayer(), AMBER_BEAD) + count) < 70)
  275. {
  276. count += 5;
  277. }
  278. if (count > 0)
  279. {
  280. giveItemRandomly(qs.getPlayer(), npc, AMBER_BEAD, count, 70, 1.0, true);
  281. }
  282. }
  283. break;
  284. }
  285. case GRANITE_GOLEM:
  286. {
  287. final QuestState qs = getRandomPartyMemberState(killer, -1, 2, npc);
  288. if (qs != null)
  289. {
  290. giveItems(qs.getPlayer(), GRANITE_WHETSTONE, 7);
  291. if (getQuestItemsCount(qs.getPlayer(), GRANITE_WHETSTONE) == 70)
  292. {
  293. playSound(qs.getPlayer(), QuestSound.ITEMSOUND_QUEST_MIDDLE);
  294. }
  295. else
  296. {
  297. playSound(qs.getPlayer(), QuestSound.ITEMSOUND_QUEST_ITEMGET);
  298. }
  299. }
  300. break;
  301. }
  302. case MANDRAGORA_SPROUT1:
  303. case MANDRAGORA_SAPLONG:
  304. case MANDRAGORA_BLOSSOM:
  305. case MANDRAGORA_SPROUT2:
  306. {
  307. final QuestState qs = getQuestState(killer, false);
  308. if ((qs != null) && qs.isStarted() && Util.checkIfInRange(1500, npc, killer, true))
  309. {
  310. if (hasQuestItems(killer, VALKONS_RECOMMENDATION) && !hasQuestItems(killer, MANDRAGORA_BERRY))
  311. {
  312. giveItems(killer, MANDRAGORA_BERRY, 1);
  313. qs.setCond(4, true);
  314. }
  315. }
  316. break;
  317. }
  318. case SILENOS:
  319. {
  320. final QuestState qs = getRandomPartyMemberState(killer, -1, 2, npc);
  321. if (qs != null)
  322. {
  323. giveItems(qs.getPlayer(), BRAIDED_YARN, 10);
  324. if (getQuestItemsCount(qs.getPlayer(), BRAIDED_YARN) == 70)
  325. {
  326. playSound(qs.getPlayer(), QuestSound.ITEMSOUND_QUEST_MIDDLE);
  327. }
  328. else
  329. {
  330. playSound(qs.getPlayer(), QuestSound.ITEMSOUND_QUEST_ITEMGET);
  331. }
  332. }
  333. break;
  334. }
  335. case STRAIN:
  336. case GHOUL:
  337. {
  338. final QuestState qs = getRandomPartyMemberState(killer, -1, 2, npc);
  339. if (qs != null)
  340. {
  341. giveItems(qs.getPlayer(), GRAY_BONE_POWDER, 5);
  342. if (getQuestItemsCount(qs.getPlayer(), GRAY_BONE_POWDER) == 70)
  343. {
  344. playSound(qs.getPlayer(), QuestSound.ITEMSOUND_QUEST_MIDDLE);
  345. }
  346. else
  347. {
  348. playSound(qs.getPlayer(), QuestSound.ITEMSOUND_QUEST_ITEMGET);
  349. }
  350. }
  351. break;
  352. }
  353. case DEAD_SEEKER:
  354. {
  355. final QuestState qs = getRandomPartyMemberState(killer, -1, 2, npc);
  356. if (qs != null)
  357. {
  358. giveItems(qs.getPlayer(), RED_PIGMENT, 7);
  359. if (getQuestItemsCount(qs.getPlayer(), RED_PIGMENT) == 70)
  360. {
  361. playSound(qs.getPlayer(), QuestSound.ITEMSOUND_QUEST_MIDDLE);
  362. }
  363. else
  364. {
  365. playSound(qs.getPlayer(), QuestSound.ITEMSOUND_QUEST_ITEMGET);
  366. }
  367. }
  368. break;
  369. }
  370. case BREKA_ORC:
  371. case BREKA_ORC_ARCHER:
  372. case BREKA_ORC_SHAMAN:
  373. case BREKA_ORC_OVERLORD:
  374. case BREKA_ORC_WARRIOR:
  375. {
  376. final QuestState qs = getRandomPartyMemberState(killer, -1, 2, npc);
  377. if (qs != null)
  378. {
  379. if (getQuestItemsCount(qs.getPlayer(), DUNINGS_KEY) >= 29)
  380. {
  381. giveItems(qs.getPlayer(), DUNINGS_KEY, 1);
  382. takeItems(qs.getPlayer(), DUNINGS_INSTRUCTIONS, 1);
  383. playSound(qs.getPlayer(), QuestSound.ITEMSOUND_QUEST_MIDDLE);
  384. }
  385. else
  386. {
  387. giveItems(qs.getPlayer(), DUNINGS_KEY, 1);
  388. playSound(qs.getPlayer(), QuestSound.ITEMSOUND_QUEST_ITEMGET);
  389. }
  390. }
  391. break;
  392. }
  393. }
  394. return super.onKill(npc, killer, isSummon);
  395. }
  396. @Override
  397. public String onTalk(L2Npc npc, L2PcInstance player)
  398. {
  399. final QuestState qs = getQuestState(player, true);
  400. String htmltext = getNoQuestMsg(player);
  401. if (qs.isCreated())
  402. {
  403. if (npc.getId() == WAREHOUSE_KEEPER_VALKON)
  404. {
  405. if ((player.getClassId() == ClassId.artisan) || (player.getClassId() == ClassId.scavenger))
  406. {
  407. if (player.getLevel() < MIN_LVL)
  408. {
  409. htmltext = "30103-02.html";
  410. }
  411. else
  412. {
  413. htmltext = "30103-03.htm";
  414. }
  415. }
  416. else
  417. {
  418. htmltext = "30103-01.html";
  419. }
  420. }
  421. }
  422. else if (qs.isStarted())
  423. {
  424. switch (npc.getId())
  425. {
  426. case WAREHOUSE_KEEPER_VALKON:
  427. {
  428. if (hasQuestItems(player, VALKONS_RECOMMENDATION))
  429. {
  430. qs.setCond(3, true);
  431. htmltext = "30103-07.html";
  432. }
  433. else if (hasQuestItems(player, ALLTRANS_INSTRUCTIONS))
  434. {
  435. if (getQuestItemsCount(player, JOURNEYMAN_RING) < 7)
  436. {
  437. htmltext = "30103-08.html";
  438. }
  439. else
  440. {
  441. htmltext = "30103-09.html";
  442. }
  443. }
  444. break;
  445. }
  446. case WAREHOUSE_KEEPER_NORMAN:
  447. {
  448. if (hasQuestItems(player, ALLTRANS_INSTRUCTIONS))
  449. {
  450. if (hasQuestItems(player, ALLTRANS_1ST_RECOMMENDATION))
  451. {
  452. htmltext = "30210-01.html";
  453. }
  454. else if (hasQuestItems(player, NORMANS_INSTRUCTIONS, NORMANS_RECEIPT))
  455. {
  456. htmltext = "30210-05.html";
  457. }
  458. else if (hasQuestItems(player, NORMANS_INSTRUCTIONS, DUNINGS_INSTRUCTIONS))
  459. {
  460. htmltext = "30210-06.html";
  461. }
  462. else if (hasQuestItems(player, NORMANS_INSTRUCTIONS) && (getQuestItemsCount(player, DUNINGS_KEY) >= 30))
  463. {
  464. htmltext = "30210-07.html";
  465. }
  466. else if (hasQuestItems(player, NORMANS_LIST))
  467. {
  468. if ((getQuestItemsCount(player, GRAY_BONE_POWDER) >= 70) && (getQuestItemsCount(player, GRANITE_WHETSTONE) >= 70) && (getQuestItemsCount(player, RED_PIGMENT) >= 70) && (getQuestItemsCount(player, BRAIDED_YARN) >= 70))
  469. {
  470. takeItems(player, NORMANS_LIST, 1);
  471. takeItems(player, GRAY_BONE_POWDER, -1);
  472. takeItems(player, GRANITE_WHETSTONE, -1);
  473. takeItems(player, RED_PIGMENT, -1);
  474. takeItems(player, BRAIDED_YARN, -1);
  475. giveItems(player, JOURNEYMAN_GEM, 7);
  476. if (getQuestItemsCount(player, JOURNEYMAN_DECO_BEADS) >= 7)
  477. {
  478. qs.setCond(6, true);
  479. }
  480. htmltext = "30210-12.html";
  481. }
  482. else
  483. {
  484. htmltext = "30210-11.html";
  485. }
  486. }
  487. else if (!hasAtLeastOneQuestItem(player, NORMANS_INSTRUCTIONS, NORMANS_LIST) && hasAtLeastOneQuestItem(player, JOURNEYMAN_GEM, JOURNEYMAN_RING))
  488. {
  489. htmltext = "30210-13.html";
  490. }
  491. }
  492. break;
  493. }
  494. case BLACKSMITH_ALTRAN:
  495. {
  496. if (hasQuestItems(player, VALKONS_RECOMMENDATION))
  497. {
  498. if (!hasQuestItems(player, MANDRAGORA_BERRY))
  499. {
  500. qs.setCond(2, true);
  501. htmltext = "30283-01.html";
  502. }
  503. else
  504. {
  505. htmltext = "30283-02.html";
  506. }
  507. }
  508. else if (hasQuestItems(player, ALLTRANS_INSTRUCTIONS))
  509. {
  510. if (getQuestItemsCount(player, JOURNEYMAN_RING) < 7)
  511. {
  512. htmltext = "30283-04.html";
  513. }
  514. else
  515. {
  516. htmltext = "30283-05.html";
  517. }
  518. }
  519. break;
  520. }
  521. case BLACKSMITH_PINTER:
  522. {
  523. if (hasQuestItems(player, ALLTRANS_INSTRUCTIONS))
  524. {
  525. if (hasQuestItems(player, ALLTRANS_2ND_RECOMMENDATION))
  526. {
  527. htmltext = "30298-02.html";
  528. }
  529. else if (hasQuestItems(player, PINTERS_INSTRUCTIONS))
  530. {
  531. if (getQuestItemsCount(player, AMBER_BEAD) < 70)
  532. {
  533. htmltext = "30298-06.html";
  534. }
  535. else
  536. {
  537. takeItems(player, RECIPE_AMBER_BEAD, 1);
  538. takeItems(player, PINTERS_INSTRUCTIONS, 1);
  539. takeItems(player, AMBER_BEAD, -1);
  540. takeItems(player, AMBER_LUMP, -1);
  541. giveItems(player, JOURNEYMAN_DECO_BEADS, 7);
  542. if (getQuestItemsCount(player, JOURNEYMAN_GEM) >= 7)
  543. {
  544. qs.setCond(6, true);
  545. }
  546. htmltext = "30298-07.html";
  547. }
  548. }
  549. else if (!hasQuestItems(player, PINTERS_INSTRUCTIONS) && hasAtLeastOneQuestItem(player, JOURNEYMAN_DECO_BEADS, JOURNEYMAN_RING))
  550. {
  551. htmltext = "30298-08.html";
  552. }
  553. }
  554. break;
  555. }
  556. case BLACKSMITH_DUNING:
  557. {
  558. if (hasQuestItems(player, ALLTRANS_INSTRUCTIONS, NORMANS_INSTRUCTIONS))
  559. {
  560. if (hasQuestItems(player, NORMANS_RECEIPT) && !hasQuestItems(player, DUNINGS_INSTRUCTIONS))
  561. {
  562. htmltext = "30688-01.html";
  563. }
  564. if (hasQuestItems(player, DUNINGS_INSTRUCTIONS) && !hasQuestItems(player, NORMANS_RECEIPT) && (getQuestItemsCount(player, DUNINGS_KEY) < 30))
  565. {
  566. htmltext = "30688-03.html";
  567. }
  568. else if ((getQuestItemsCount(player, DUNINGS_KEY) >= 30) && !hasQuestItems(player, DUNINGS_INSTRUCTIONS))
  569. {
  570. htmltext = "30688-04.html";
  571. }
  572. }
  573. else if (hasQuestItems(player, ALLTRANS_INSTRUCTIONS) && !hasAtLeastOneQuestItem(player, NORMANS_INSTRUCTIONS, DUNINGS_INSTRUCTIONS))
  574. {
  575. htmltext = "30688-05.html";
  576. }
  577. break;
  578. }
  579. }
  580. }
  581. else if (qs.isCompleted())
  582. {
  583. if (npc.getId() == WAREHOUSE_KEEPER_VALKON)
  584. {
  585. htmltext = getAlreadyCompletedMsg(player);
  586. }
  587. }
  588. return htmltext;
  589. }
  590. @Override
  591. public boolean checkPartyMember(L2PcInstance player, L2Npc npc)
  592. {
  593. boolean check = false;
  594. switch (npc.getId())
  595. {
  596. case ANT:
  597. case ANT_CAPTAIN:
  598. case ANT_OVERSEER:
  599. {
  600. check = hasQuestItems(player, ALLTRANS_INSTRUCTIONS, PINTERS_INSTRUCTIONS) && (getQuestItemsCount(player, AMBER_BEAD) < 70);
  601. break;
  602. }
  603. case GRANITE_GOLEM:
  604. {
  605. check = hasQuestItems(player, ALLTRANS_INSTRUCTIONS, NORMANS_LIST) && (getQuestItemsCount(player, GRANITE_WHETSTONE) < 70);
  606. break;
  607. }
  608. case SILENOS:
  609. {
  610. check = hasQuestItems(player, ALLTRANS_INSTRUCTIONS, NORMANS_LIST) && (getQuestItemsCount(player, BRAIDED_YARN) < 70);
  611. break;
  612. }
  613. case STRAIN:
  614. case GHOUL:
  615. {
  616. check = hasQuestItems(player, ALLTRANS_INSTRUCTIONS, NORMANS_LIST) && (getQuestItemsCount(player, GRAY_BONE_POWDER) < 70);
  617. break;
  618. }
  619. case DEAD_SEEKER:
  620. {
  621. check = hasQuestItems(player, ALLTRANS_INSTRUCTIONS, NORMANS_LIST) && (getQuestItemsCount(player, RED_PIGMENT) < 70);
  622. break;
  623. }
  624. case BREKA_ORC:
  625. case BREKA_ORC_ARCHER:
  626. case BREKA_ORC_SHAMAN:
  627. case BREKA_ORC_OVERLORD:
  628. case BREKA_ORC_WARRIOR:
  629. {
  630. check = hasQuestItems(player, ALLTRANS_INSTRUCTIONS, NORMANS_INSTRUCTIONS, DUNINGS_INSTRUCTIONS) && (getQuestItemsCount(player, DUNINGS_KEY) < 30);
  631. break;
  632. }
  633. }
  634. return check;
  635. }
  636. }