Q00230_TestOfTheSummoner.java 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286
  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.Q00230_TestOfTheSummoner;
  20. import java.util.HashMap;
  21. import java.util.Map;
  22. import com.l2jserver.gameserver.enums.QuestSound;
  23. import com.l2jserver.gameserver.model.actor.L2Npc;
  24. import com.l2jserver.gameserver.model.actor.L2Summon;
  25. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  26. import com.l2jserver.gameserver.model.base.ClassId;
  27. import com.l2jserver.gameserver.model.holders.SkillHolder;
  28. import com.l2jserver.gameserver.model.quest.Quest;
  29. import com.l2jserver.gameserver.model.quest.QuestState;
  30. import com.l2jserver.gameserver.network.NpcStringId;
  31. import com.l2jserver.gameserver.network.clientpackets.Say2;
  32. import com.l2jserver.gameserver.network.serverpackets.NpcSay;
  33. import com.l2jserver.gameserver.network.serverpackets.SocialAction;
  34. import com.l2jserver.gameserver.util.Broadcast;
  35. import com.l2jserver.gameserver.util.Util;
  36. /**
  37. * Test Of The Summoner (230)
  38. * @author ivantotov
  39. */
  40. public final class Q00230_TestOfTheSummoner extends Quest
  41. {
  42. // NPCs
  43. private static final int GROCER_LARA = 30063;
  44. private static final int HIGH_SUMMONER_GALATEA = 30634;
  45. private static final int SUMMONER_ALMORS = 30635;
  46. private static final int SUMMONER_CAMONIELL = 30636;
  47. private static final int SUMMONER_BELTHUS = 30637;
  48. private static final int SUMMONER_BASILLA = 30638;
  49. private static final int SUMMONER_CELESTIEL = 30639;
  50. private static final int SUMMONER_BRYNTHEA = 30640;
  51. // Items
  52. private static final int LETOLIZARDMAN_AMULET = 3337;
  53. private static final int SAC_OF_REDSPORES = 3338;
  54. private static final int KARULBUGBEAR_TOTEM = 3339;
  55. private static final int SHARDS_OF_MANASHEN = 3340;
  56. private static final int BREKAORC_TOTEM = 3341;
  57. private static final int CRIMSON_BLOODSTONE = 3342;
  58. private static final int TALONS_OF_TYRANT = 3343;
  59. private static final int WINGS_OF_DRONEANT = 3344;
  60. private static final int TUSK_OF_WINDSUS = 3345;
  61. private static final int FANGS_OF_WYRM = 3346;
  62. private static final int LARAS_1ST_LIST = 3347;
  63. private static final int LARAS_2ND_LIST = 3348;
  64. private static final int LARAS_3RD_LIST = 3349;
  65. private static final int LARAS_4TH_LIST = 3350;
  66. private static final int LARAS_5TH_LIST = 3351;
  67. private static final int GALATEAS_LETTER = 3352;
  68. private static final int BEGINNERS_ARCANA = 3353;
  69. private static final int ALMORS_ARCANA = 3354;
  70. private static final int CAMONIELL_ARCANA = 3355;
  71. private static final int BELTHUS_ARCANA = 3356;
  72. private static final int BASILLIA_ARCANA = 3357;
  73. private static final int CELESTIEL_ARCANA = 3358;
  74. private static final int BRYNTHEA_ARCANA = 3359;
  75. private static final int CRYSTAL_OF_STARTING_1ST = 3360;
  76. private static final int CRYSTAL_OF_INPROGRESS_1ST = 3361;
  77. private static final int CRYSTAL_OF_FOUL_1ST = 3362;
  78. private static final int CRYSTAL_OF_DEFEAT_1ST = 3363;
  79. private static final int CRYSTAL_OF_VICTORY_1ST = 3364;
  80. private static final int CRYSTAL_OF_STARTING_2ND = 3365;
  81. private static final int CRYSTAL_OF_INPROGRESS_2ND = 3366;
  82. private static final int CRYSTAL_OF_FOUL_2ND = 3367;
  83. private static final int CRYSTAL_OF_DEFEAT_2ND = 3368;
  84. private static final int CRYSTAL_OF_VICTORY_2ND = 3369;
  85. private static final int CRYSTAL_OF_STARTING_3RD = 3370;
  86. private static final int CRYSTAL_OF_INPROGRESS_3RD = 3371;
  87. private static final int CRYSTAL_OF_FOUL_3RD = 3372;
  88. private static final int CRYSTAL_OF_DEFEAT_3RD = 3373;
  89. private static final int CRYSTAL_OF_VICTORY_3RD = 3374;
  90. private static final int CRYSTAL_OF_STARTING_4TH = 3375;
  91. private static final int CRYSTAL_OF_INPROGRESS_4TH = 3376;
  92. private static final int CRYSTAL_OF_FOUL_4TH = 3377;
  93. private static final int CRYSTAL_OF_DEFEAT_4TH = 3378;
  94. private static final int CRYSTAL_OF_VICTORY_4TH = 3379;
  95. private static final int CRYSTAL_OF_STARTING_5TH = 3380;
  96. private static final int CRYSTAL_OF_INPROGRESS_5TH = 3381;
  97. private static final int CRYSTAL_OF_FOUL_5TH = 3382;
  98. private static final int CRYSTAL_OF_DEFEAT_5TH = 3383;
  99. private static final int CRYSTAL_OF_VICTORY_5TH = 3384;
  100. private static final int CRYSTAL_OF_STARTING_6TH = 3385;
  101. private static final int CRYSTAL_OF_INPROGRESS_6TH = 3386;
  102. private static final int CRYSTAL_OF_FOUL_6TH = 3387;
  103. private static final int CRYSTAL_OF_DEFEAT_6TH = 3388;
  104. private static final int CRYSTAL_OF_VICTORY_6TH = 3389;
  105. // Reward
  106. private static final int MARK_OF_SUMMONER = 3336;
  107. private static final int DIMENSIONAL_DIAMOND = 7562;
  108. // Monster
  109. private static final int NOBLE_ANT = 20089;
  110. private static final int NOBLE_ANT_LEADER = 20090;
  111. private static final int WYRM = 20176;
  112. private static final int TYRANT = 20192;
  113. private static final int TYRANT_KINGPIN = 20193;
  114. private static final int BREKA_ORC = 20267;
  115. private static final int BREKA_ORC_ARCHER = 20268;
  116. private static final int BREKA_ORC_SHAMAN = 20269;
  117. private static final int BREKA_ORC_OVERLORD = 20270;
  118. private static final int BREKA_ORC_WARRIOR = 20271;
  119. private static final int FETTERED_SOUL = 20552;
  120. private static final int WINDSUS = 20553;
  121. private static final int GIANT_FUNGUS = 20555;
  122. private static final int MANASHEN_GARGOYLE = 20563;
  123. private static final int LETO_LIZARDMAN = 20577;
  124. private static final int LETO_LIZARDMAN_ARCHER = 20578;
  125. private static final int LETO_LIZARDMAN_SOLDIER = 20579;
  126. private static final int LETO_LIZARDMAN_WARRIOR = 20580;
  127. private static final int LETO_LIZARDMAN_SHAMAN = 20581;
  128. private static final int LETO_LIZARDMAN_OVERLORD = 20582;
  129. private static final int KARUL_BUGBEAR = 20600;
  130. // Quest Monster
  131. private static final int PAKO_THE_CAT = 27102;
  132. private static final int UNICORN_RACER = 27103;
  133. private static final int SHADOW_TUREN = 27104;
  134. private static final int MIMI_THE_CAT = 27105;
  135. private static final int UNICORN_PHANTASM = 27106;
  136. private static final int SILHOUETTE_TILFO = 27107;
  137. // Skill
  138. private static final SkillHolder REDUCTION_IN_RECOVERY_TIME = new SkillHolder(4126, 1);
  139. // Misc
  140. private static final int MIN_LEVEL = 39;
  141. private static final Map<Integer, MonsterData> MONSTERS = new HashMap<>();
  142. static
  143. {
  144. MONSTERS.put(PAKO_THE_CAT, new MonsterData(CRYSTAL_OF_INPROGRESS_1ST, CRYSTAL_OF_VICTORY_1ST, NpcStringId.IM_SORRY_LORD));
  145. MONSTERS.put(UNICORN_RACER, new MonsterData(CRYSTAL_OF_INPROGRESS_3RD, CRYSTAL_OF_VICTORY_3RD, NpcStringId.I_LOSE));
  146. MONSTERS.put(SHADOW_TUREN, new MonsterData(CRYSTAL_OF_INPROGRESS_5TH, CRYSTAL_OF_VICTORY_5TH, NpcStringId.UGH_I_LOST));
  147. MONSTERS.put(MIMI_THE_CAT, new MonsterData(CRYSTAL_OF_INPROGRESS_2ND, CRYSTAL_OF_VICTORY_2ND, NpcStringId.LOST_SORRY_LORD));
  148. MONSTERS.put(UNICORN_PHANTASM, new MonsterData(CRYSTAL_OF_INPROGRESS_4TH, CRYSTAL_OF_VICTORY_4TH, NpcStringId.I_LOSE));
  149. MONSTERS.put(SILHOUETTE_TILFO, new MonsterData(CRYSTAL_OF_INPROGRESS_6TH, CRYSTAL_OF_VICTORY_6TH, NpcStringId.UGH_CAN_THIS_BE_HAPPENING));
  150. }
  151. public Q00230_TestOfTheSummoner()
  152. {
  153. super(230, Q00230_TestOfTheSummoner.class.getSimpleName(), "Test Of The Summoner");
  154. addStartNpc(HIGH_SUMMONER_GALATEA);
  155. addTalkId(HIGH_SUMMONER_GALATEA, GROCER_LARA, SUMMONER_ALMORS, SUMMONER_CAMONIELL, SUMMONER_BELTHUS, SUMMONER_BASILLA, SUMMONER_CELESTIEL, SUMMONER_BRYNTHEA);
  156. addKillId(NOBLE_ANT, NOBLE_ANT_LEADER, WYRM, TYRANT, TYRANT_KINGPIN, BREKA_ORC, BREKA_ORC_ARCHER, BREKA_ORC_SHAMAN, BREKA_ORC_OVERLORD, BREKA_ORC_WARRIOR, FETTERED_SOUL, WINDSUS, GIANT_FUNGUS, MANASHEN_GARGOYLE, LETO_LIZARDMAN, LETO_LIZARDMAN_ARCHER, LETO_LIZARDMAN_SOLDIER, LETO_LIZARDMAN_WARRIOR, LETO_LIZARDMAN_SHAMAN, LETO_LIZARDMAN_OVERLORD, KARUL_BUGBEAR);
  157. addKillId(MONSTERS.keySet());
  158. addAttackId(PAKO_THE_CAT, UNICORN_RACER, SHADOW_TUREN, MIMI_THE_CAT, UNICORN_PHANTASM, SILHOUETTE_TILFO);
  159. registerQuestItems(LETOLIZARDMAN_AMULET, SAC_OF_REDSPORES, KARULBUGBEAR_TOTEM, SHARDS_OF_MANASHEN, BREKAORC_TOTEM, CRIMSON_BLOODSTONE, TALONS_OF_TYRANT, WINGS_OF_DRONEANT, TUSK_OF_WINDSUS, FANGS_OF_WYRM, LARAS_1ST_LIST, LARAS_2ND_LIST, LARAS_3RD_LIST, LARAS_4TH_LIST, LARAS_5TH_LIST, GALATEAS_LETTER, BEGINNERS_ARCANA, ALMORS_ARCANA, CAMONIELL_ARCANA, BELTHUS_ARCANA, BASILLIA_ARCANA, CELESTIEL_ARCANA, BRYNTHEA_ARCANA, CRYSTAL_OF_STARTING_1ST, CRYSTAL_OF_INPROGRESS_1ST, CRYSTAL_OF_FOUL_1ST, CRYSTAL_OF_DEFEAT_1ST, CRYSTAL_OF_VICTORY_1ST, CRYSTAL_OF_STARTING_2ND, CRYSTAL_OF_INPROGRESS_2ND, CRYSTAL_OF_FOUL_2ND, CRYSTAL_OF_DEFEAT_2ND, CRYSTAL_OF_VICTORY_2ND, CRYSTAL_OF_STARTING_3RD, CRYSTAL_OF_INPROGRESS_3RD, CRYSTAL_OF_FOUL_3RD, CRYSTAL_OF_DEFEAT_3RD, CRYSTAL_OF_VICTORY_3RD, CRYSTAL_OF_STARTING_4TH, CRYSTAL_OF_INPROGRESS_4TH, CRYSTAL_OF_FOUL_4TH, CRYSTAL_OF_DEFEAT_4TH, CRYSTAL_OF_VICTORY_4TH, CRYSTAL_OF_STARTING_5TH, CRYSTAL_OF_INPROGRESS_5TH, CRYSTAL_OF_FOUL_5TH, CRYSTAL_OF_DEFEAT_5TH, CRYSTAL_OF_VICTORY_5TH, CRYSTAL_OF_STARTING_6TH, CRYSTAL_OF_INPROGRESS_6TH, CRYSTAL_OF_FOUL_6TH, CRYSTAL_OF_DEFEAT_6TH, CRYSTAL_OF_VICTORY_6TH);
  160. }
  161. @Override
  162. public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  163. {
  164. switch (event)
  165. {
  166. case "DESPAWN":
  167. {
  168. npc.deleteMe();
  169. break;
  170. }
  171. case "KILLED_ATTACKER":
  172. {
  173. final L2Summon summon = npc.getVariables().getObject("ATTACKER", L2Summon.class);
  174. if ((summon != null) && summon.isDead())
  175. {
  176. npc.deleteMe();
  177. }
  178. else
  179. {
  180. startQuestTimer("KILLED_ATTACKER", 5000, npc, null);
  181. }
  182. break;
  183. }
  184. }
  185. // For NPC-only timers, player is null and no further checks or actions are required.
  186. if (player == null)
  187. {
  188. return null;
  189. }
  190. final QuestState qs = getQuestState(player, false);
  191. if (qs == null)
  192. {
  193. return null;
  194. }
  195. String htmltext = null;
  196. switch (event)
  197. {
  198. case "ACCEPT":
  199. {
  200. if (qs.isCreated())
  201. {
  202. qs.startQuest();
  203. playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  204. giveItems(player, GALATEAS_LETTER, 1);
  205. if (player.getVariables().getInt("2ND_CLASS_DIAMOND_REWARD", 0) == 0)
  206. {
  207. giveItems(player, DIMENSIONAL_DIAMOND, 122);
  208. player.getVariables().set("2ND_CLASS_DIAMOND_REWARD", 1);
  209. htmltext = "30634-08a.htm";
  210. }
  211. else
  212. {
  213. htmltext = "30634-08.htm";
  214. }
  215. }
  216. break;
  217. }
  218. case "30634-04.htm":
  219. case "30634-05.htm":
  220. case "30634-06.htm":
  221. case "30634-07.htm":
  222. case "30634-11.html":
  223. case "30634-11a.html":
  224. case "30634-11b.html":
  225. case "30634-11c.html":
  226. case "30634-11d.html":
  227. {
  228. htmltext = event;
  229. break;
  230. }
  231. case "30063-02.html":
  232. {
  233. switch (getRandom(5))
  234. {
  235. case 0:
  236. {
  237. giveItems(player, LARAS_1ST_LIST, 1);
  238. break;
  239. }
  240. case 1:
  241. {
  242. giveItems(player, LARAS_2ND_LIST, 1);
  243. break;
  244. }
  245. case 2:
  246. {
  247. giveItems(player, LARAS_3RD_LIST, 1);
  248. break;
  249. }
  250. case 3:
  251. {
  252. giveItems(player, LARAS_4TH_LIST, 1);
  253. break;
  254. }
  255. case 4:
  256. {
  257. giveItems(player, LARAS_5TH_LIST, 1);
  258. break;
  259. }
  260. }
  261. qs.setCond(2, true);
  262. takeItems(player, GALATEAS_LETTER, 1);
  263. htmltext = event;
  264. break;
  265. }
  266. case "30063-04.html":
  267. {
  268. switch (getRandom(5))
  269. {
  270. case 0:
  271. {
  272. giveItems(player, LARAS_1ST_LIST, 1);
  273. break;
  274. }
  275. case 1:
  276. {
  277. giveItems(player, LARAS_2ND_LIST, 1);
  278. break;
  279. }
  280. case 2:
  281. {
  282. giveItems(player, LARAS_3RD_LIST, 1);
  283. break;
  284. }
  285. case 3:
  286. {
  287. giveItems(player, LARAS_4TH_LIST, 1);
  288. break;
  289. }
  290. case 4:
  291. {
  292. giveItems(player, LARAS_5TH_LIST, 1);
  293. break;
  294. }
  295. }
  296. htmltext = event;
  297. break;
  298. }
  299. case "30635-03.html":
  300. {
  301. if (hasQuestItems(player, BEGINNERS_ARCANA))
  302. {
  303. htmltext = event;
  304. }
  305. else
  306. {
  307. htmltext = "30635-02.html";
  308. }
  309. break;
  310. }
  311. case "30635-04.html":
  312. {
  313. addSkillCastDesire(npc, player, REDUCTION_IN_RECOVERY_TIME, 1000000);
  314. takeItems(player, BEGINNERS_ARCANA, 1);
  315. giveItems(player, CRYSTAL_OF_STARTING_1ST, 1);
  316. takeItems(player, CRYSTAL_OF_FOUL_1ST, 1);
  317. takeItems(player, CRYSTAL_OF_DEFEAT_1ST, 1);
  318. htmltext = event;
  319. break;
  320. }
  321. case "30636-03.html":
  322. {
  323. if (hasQuestItems(player, BEGINNERS_ARCANA))
  324. {
  325. htmltext = event;
  326. }
  327. else
  328. {
  329. htmltext = "30636-02.html";
  330. }
  331. break;
  332. }
  333. case "30636-04.html":
  334. {
  335. addSkillCastDesire(npc, player, REDUCTION_IN_RECOVERY_TIME, 1000000);
  336. takeItems(player, BEGINNERS_ARCANA, 1);
  337. giveItems(player, CRYSTAL_OF_STARTING_3RD, 1);
  338. takeItems(player, CRYSTAL_OF_FOUL_3RD, 1);
  339. takeItems(player, CRYSTAL_OF_DEFEAT_3RD, 1);
  340. htmltext = event;
  341. break;
  342. }
  343. case "30637-03.html":
  344. {
  345. if (hasQuestItems(player, BEGINNERS_ARCANA))
  346. {
  347. htmltext = event;
  348. }
  349. else
  350. {
  351. htmltext = "30637-02.html";
  352. }
  353. break;
  354. }
  355. case "30637-04.html":
  356. {
  357. addSkillCastDesire(npc, player, REDUCTION_IN_RECOVERY_TIME, 1000000);
  358. takeItems(player, BEGINNERS_ARCANA, 1);
  359. giveItems(player, CRYSTAL_OF_STARTING_5TH, 1);
  360. takeItems(player, CRYSTAL_OF_FOUL_5TH, 1);
  361. takeItems(player, CRYSTAL_OF_DEFEAT_5TH, 1);
  362. htmltext = event;
  363. break;
  364. }
  365. case "30638-03.html":
  366. {
  367. if (hasQuestItems(player, BEGINNERS_ARCANA))
  368. {
  369. htmltext = event;
  370. }
  371. else
  372. {
  373. htmltext = "30638-02.html";
  374. }
  375. break;
  376. }
  377. case "30638-04.html":
  378. {
  379. addSkillCastDesire(npc, player, REDUCTION_IN_RECOVERY_TIME, 1000000);
  380. takeItems(player, BEGINNERS_ARCANA, 1);
  381. giveItems(player, CRYSTAL_OF_STARTING_2ND, 1);
  382. takeItems(player, CRYSTAL_OF_FOUL_2ND, 1);
  383. takeItems(player, CRYSTAL_OF_DEFEAT_2ND, 1);
  384. htmltext = event;
  385. break;
  386. }
  387. case "30639-03.html":
  388. {
  389. if (hasQuestItems(player, BEGINNERS_ARCANA))
  390. {
  391. htmltext = event;
  392. }
  393. else
  394. {
  395. htmltext = "30639-02.html";
  396. }
  397. break;
  398. }
  399. case "30639-04.html":
  400. {
  401. addSkillCastDesire(npc, player, REDUCTION_IN_RECOVERY_TIME, 1000000);
  402. takeItems(player, BEGINNERS_ARCANA, 1);
  403. giveItems(player, CRYSTAL_OF_STARTING_4TH, 1);
  404. takeItems(player, CRYSTAL_OF_FOUL_4TH, 1);
  405. takeItems(player, CRYSTAL_OF_DEFEAT_4TH, 1);
  406. htmltext = event;
  407. break;
  408. }
  409. case "30640-03.html":
  410. {
  411. if (hasQuestItems(player, BEGINNERS_ARCANA))
  412. {
  413. htmltext = event;
  414. }
  415. else
  416. {
  417. htmltext = "30640-02.html";
  418. }
  419. break;
  420. }
  421. case "30640-04.html":
  422. {
  423. addSkillCastDesire(npc, player, REDUCTION_IN_RECOVERY_TIME, 1000000);
  424. takeItems(player, BEGINNERS_ARCANA, 1);
  425. giveItems(player, CRYSTAL_OF_STARTING_6TH, 1);
  426. takeItems(player, CRYSTAL_OF_FOUL_6TH, 1);
  427. takeItems(player, CRYSTAL_OF_DEFEAT_6TH, 1);
  428. htmltext = event;
  429. break;
  430. }
  431. }
  432. return htmltext;
  433. }
  434. @Override
  435. public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
  436. {
  437. switch (npc.getId())
  438. {
  439. case PAKO_THE_CAT:
  440. {
  441. switch (npc.getScriptValue())
  442. {
  443. case 0:
  444. {
  445. if (isSummon)
  446. {
  447. npc.getVariables().set("ATTACKER", attacker.getSummon());
  448. npc.setScriptValue(1);
  449. startQuestTimer("DESPAWN", 120000, npc, null);
  450. startQuestTimer("KILLED_ATTACKER", 5000, npc, null);
  451. final QuestState qs = getQuestState(attacker, false);
  452. if (hasQuestItems(attacker, CRYSTAL_OF_STARTING_1ST) && (qs != null) && qs.isStarted())
  453. {
  454. Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getTemplate().getDisplayId(), NpcStringId.WHHIISSHH));
  455. takeItems(attacker, CRYSTAL_OF_STARTING_1ST, -1);
  456. giveItems(attacker, CRYSTAL_OF_INPROGRESS_1ST, 1);
  457. addAttackPlayerDesire(npc, attacker.getSummon(), 100000);
  458. }
  459. }
  460. break;
  461. }
  462. case 1:
  463. {
  464. if (!isSummon || (npc.getVariables().getObject("ATTACKER", L2Summon.class) != attacker.getSummon()))
  465. {
  466. final QuestState qs = getQuestState(attacker, false);
  467. if (!hasQuestItems(attacker, CRYSTAL_OF_STARTING_1ST) && hasQuestItems(attacker, CRYSTAL_OF_INPROGRESS_1ST) && (qs != null) && qs.isStarted())
  468. {
  469. npc.setScriptValue(2);
  470. Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getTemplate().getDisplayId(), NpcStringId.RULE_VIOLATION));
  471. takeItems(attacker, CRYSTAL_OF_INPROGRESS_1ST, -1);
  472. giveItems(attacker, CRYSTAL_OF_FOUL_1ST, 1);
  473. takeItems(attacker, CRYSTAL_OF_STARTING_1ST, -1);
  474. }
  475. npc.deleteMe();
  476. }
  477. break;
  478. }
  479. }
  480. break;
  481. }
  482. case UNICORN_RACER:
  483. {
  484. switch (npc.getScriptValue())
  485. {
  486. case 0:
  487. {
  488. if (isSummon)
  489. {
  490. npc.getVariables().set("ATTACKER", attacker.getSummon());
  491. npc.setScriptValue(1);
  492. startQuestTimer("DESPAWN", 120000, npc, null);
  493. startQuestTimer("KILLED_ATTACKER", 5000, npc, null);
  494. final QuestState qs = getQuestState(attacker, false);
  495. if (hasQuestItems(attacker, CRYSTAL_OF_STARTING_3RD) && (qs != null) && qs.isStarted())
  496. {
  497. Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getTemplate().getDisplayId(), NpcStringId.START_DUEL));
  498. takeItems(attacker, CRYSTAL_OF_STARTING_3RD, -1);
  499. giveItems(attacker, CRYSTAL_OF_INPROGRESS_3RD, 1);
  500. addAttackPlayerDesire(npc, attacker.getSummon(), 100000);
  501. }
  502. }
  503. break;
  504. }
  505. case 1:
  506. {
  507. if (!isSummon || (npc.getVariables().getObject("ATTACKER", L2Summon.class) != attacker.getSummon()))
  508. {
  509. final QuestState qs = getQuestState(attacker, false);
  510. if (!hasQuestItems(attacker, CRYSTAL_OF_STARTING_3RD) && hasQuestItems(attacker, CRYSTAL_OF_INPROGRESS_3RD) && (qs != null) && qs.isStarted())
  511. {
  512. npc.setScriptValue(2);
  513. Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getTemplate().getDisplayId(), NpcStringId.RULE_VIOLATION));
  514. takeItems(attacker, CRYSTAL_OF_INPROGRESS_3RD, -1);
  515. giveItems(attacker, CRYSTAL_OF_FOUL_3RD, 1);
  516. takeItems(attacker, CRYSTAL_OF_STARTING_3RD, -1);
  517. }
  518. npc.deleteMe();
  519. }
  520. break;
  521. }
  522. }
  523. }
  524. case SHADOW_TUREN:
  525. {
  526. switch (npc.getScriptValue())
  527. {
  528. case 0:
  529. {
  530. if (isSummon)
  531. {
  532. npc.getVariables().set("ATTACKER", attacker.getSummon());
  533. npc.setScriptValue(1);
  534. startQuestTimer("DESPAWN", 120000, npc, null);
  535. startQuestTimer("KILLED_ATTACKER", 5000, npc, null);
  536. final QuestState qs = getQuestState(attacker, false);
  537. if (hasQuestItems(attacker, CRYSTAL_OF_STARTING_5TH) && (qs != null) && qs.isStarted())
  538. {
  539. Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getTemplate().getDisplayId(), NpcStringId.SO_SHALL_WE_START));
  540. takeItems(attacker, CRYSTAL_OF_STARTING_5TH, -1);
  541. giveItems(attacker, CRYSTAL_OF_INPROGRESS_5TH, 1);
  542. addAttackPlayerDesire(npc, attacker.getSummon(), 100000);
  543. }
  544. }
  545. break;
  546. }
  547. case 1:
  548. {
  549. if (!isSummon || (npc.getVariables().getObject("ATTACKER", L2Summon.class) != attacker.getSummon()))
  550. {
  551. final QuestState qs = getQuestState(attacker, false);
  552. if (!hasQuestItems(attacker, CRYSTAL_OF_STARTING_5TH) && hasQuestItems(attacker, CRYSTAL_OF_INPROGRESS_5TH) && (qs != null) && qs.isStarted())
  553. {
  554. npc.setScriptValue(2);
  555. Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getTemplate().getDisplayId(), NpcStringId.RULE_VIOLATION));
  556. takeItems(attacker, CRYSTAL_OF_INPROGRESS_5TH, -1);
  557. giveItems(attacker, CRYSTAL_OF_FOUL_5TH, 1);
  558. takeItems(attacker, CRYSTAL_OF_STARTING_5TH, -1);
  559. }
  560. npc.deleteMe();
  561. }
  562. break;
  563. }
  564. }
  565. }
  566. case MIMI_THE_CAT:
  567. {
  568. switch (npc.getScriptValue())
  569. {
  570. case 0:
  571. {
  572. if (isSummon)
  573. {
  574. npc.getVariables().set("ATTACKER", attacker.getSummon());
  575. npc.setScriptValue(1);
  576. startQuestTimer("DESPAWN", 120000, npc, null);
  577. startQuestTimer("KILLED_ATTACKER", 5000, npc, null);
  578. final QuestState qs = getQuestState(attacker, false);
  579. if (hasQuestItems(attacker, CRYSTAL_OF_STARTING_2ND) && (qs != null) && qs.isStarted())
  580. {
  581. Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getTemplate().getDisplayId(), NpcStringId.WHISH_FIGHT));
  582. takeItems(attacker, CRYSTAL_OF_STARTING_2ND, -1);
  583. giveItems(attacker, CRYSTAL_OF_INPROGRESS_2ND, 1);
  584. addAttackPlayerDesire(npc, attacker.getSummon(), 100000);
  585. }
  586. }
  587. break;
  588. }
  589. case 1:
  590. {
  591. if (!isSummon || (npc.getVariables().getObject("ATTACKER", L2Summon.class) != attacker.getSummon()))
  592. {
  593. final QuestState qs = getQuestState(attacker, false);
  594. if (!hasQuestItems(attacker, CRYSTAL_OF_STARTING_2ND) && hasQuestItems(attacker, CRYSTAL_OF_INPROGRESS_2ND) && (qs != null) && qs.isStarted())
  595. {
  596. npc.setScriptValue(2);
  597. Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getTemplate().getDisplayId(), NpcStringId.RULE_VIOLATION));
  598. takeItems(attacker, CRYSTAL_OF_INPROGRESS_2ND, -1);
  599. giveItems(attacker, CRYSTAL_OF_FOUL_2ND, 1);
  600. takeItems(attacker, CRYSTAL_OF_STARTING_2ND, -1);
  601. }
  602. npc.deleteMe();
  603. }
  604. break;
  605. }
  606. }
  607. }
  608. case UNICORN_PHANTASM:
  609. {
  610. switch (npc.getScriptValue())
  611. {
  612. case 0:
  613. {
  614. if (isSummon)
  615. {
  616. npc.getVariables().set("ATTACKER", attacker.getSummon());
  617. npc.setScriptValue(1);
  618. startQuestTimer("DESPAWN", 120000, npc, null);
  619. startQuestTimer("KILLED_ATTACKER", 5000, npc, null);
  620. final QuestState qs = getQuestState(attacker, false);
  621. if (hasQuestItems(attacker, CRYSTAL_OF_STARTING_4TH) && (qs != null) && qs.isStarted())
  622. {
  623. Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getTemplate().getDisplayId(), NpcStringId.START_DUEL));
  624. takeItems(attacker, CRYSTAL_OF_STARTING_4TH, -1);
  625. giveItems(attacker, CRYSTAL_OF_INPROGRESS_4TH, 1);
  626. addAttackPlayerDesire(npc, attacker.getSummon(), 100000);
  627. }
  628. }
  629. break;
  630. }
  631. case 1:
  632. {
  633. if (!isSummon || (npc.getVariables().getObject("ATTACKER", L2Summon.class) != attacker.getSummon()))
  634. {
  635. final QuestState qs = getQuestState(attacker, false);
  636. if (!hasQuestItems(attacker, CRYSTAL_OF_STARTING_4TH) && hasQuestItems(attacker, CRYSTAL_OF_INPROGRESS_4TH) && (qs != null) && qs.isStarted())
  637. {
  638. npc.setScriptValue(2);
  639. Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getTemplate().getDisplayId(), NpcStringId.RULE_VIOLATION));
  640. takeItems(attacker, CRYSTAL_OF_INPROGRESS_4TH, -1);
  641. giveItems(attacker, CRYSTAL_OF_FOUL_4TH, 1);
  642. takeItems(attacker, CRYSTAL_OF_STARTING_4TH, -1);
  643. }
  644. npc.deleteMe();
  645. }
  646. break;
  647. }
  648. }
  649. }
  650. case SILHOUETTE_TILFO:
  651. {
  652. switch (npc.getScriptValue())
  653. {
  654. case 0:
  655. {
  656. if (isSummon)
  657. {
  658. npc.getVariables().set("ATTACKER", attacker.getSummon());
  659. npc.setScriptValue(1);
  660. startQuestTimer("DESPAWN", 120000, npc, null);
  661. startQuestTimer("KILLED_ATTACKER", 5000, npc, null);
  662. final QuestState qs = getQuestState(attacker, false);
  663. if (hasQuestItems(attacker, CRYSTAL_OF_STARTING_6TH) && (qs != null) && qs.isStarted())
  664. {
  665. Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getTemplate().getDisplayId(), NpcStringId.ILL_WALK_ALL_OVER_YOU));
  666. takeItems(attacker, CRYSTAL_OF_STARTING_6TH, -1);
  667. giveItems(attacker, CRYSTAL_OF_INPROGRESS_6TH, 1);
  668. addAttackPlayerDesire(npc, attacker.getSummon(), 100000);
  669. }
  670. }
  671. break;
  672. }
  673. case 1:
  674. {
  675. if (!isSummon || (npc.getVariables().getObject("ATTACKER", L2Summon.class) != attacker.getSummon()))
  676. {
  677. final QuestState qs = getQuestState(attacker, false);
  678. if (!hasQuestItems(attacker, CRYSTAL_OF_STARTING_6TH) && hasQuestItems(attacker, CRYSTAL_OF_INPROGRESS_6TH) && (qs != null) && qs.isStarted())
  679. {
  680. npc.setScriptValue(2);
  681. Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getTemplate().getDisplayId(), NpcStringId.RULE_VIOLATION));
  682. takeItems(attacker, CRYSTAL_OF_INPROGRESS_6TH, -1);
  683. giveItems(attacker, CRYSTAL_OF_FOUL_6TH, 1);
  684. takeItems(attacker, CRYSTAL_OF_STARTING_6TH, -1);
  685. }
  686. npc.deleteMe();
  687. }
  688. break;
  689. }
  690. }
  691. }
  692. }
  693. return super.onAttack(npc, attacker, damage, isSummon);
  694. }
  695. @Override
  696. public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
  697. {
  698. final QuestState qs = getQuestState(killer, false);
  699. if ((qs != null) && qs.isStarted() && Util.checkIfInRange(1500, npc, killer, true))
  700. {
  701. switch (npc.getId())
  702. {
  703. case NOBLE_ANT:
  704. case NOBLE_ANT_LEADER:
  705. {
  706. if (!hasQuestItems(killer, GALATEAS_LETTER) && hasQuestItems(killer, LARAS_5TH_LIST))
  707. {
  708. giveItemRandomly(killer, npc, WINGS_OF_DRONEANT, 2, 30, 1.0, true);
  709. }
  710. break;
  711. }
  712. case WYRM:
  713. {
  714. if (!hasQuestItems(killer, GALATEAS_LETTER) && hasQuestItems(killer, LARAS_5TH_LIST))
  715. {
  716. giveItemRandomly(killer, npc, FANGS_OF_WYRM, 3, 30, 1.0, true);
  717. }
  718. break;
  719. }
  720. case TYRANT:
  721. case TYRANT_KINGPIN:
  722. {
  723. if (!hasQuestItems(killer, GALATEAS_LETTER) && hasQuestItems(killer, LARAS_4TH_LIST))
  724. {
  725. giveItemRandomly(killer, npc, TALONS_OF_TYRANT, 3, 30, 1.0, true);
  726. }
  727. break;
  728. }
  729. case BREKA_ORC:
  730. case BREKA_ORC_ARCHER:
  731. case BREKA_ORC_WARRIOR:
  732. {
  733. if (!hasQuestItems(killer, GALATEAS_LETTER) && hasQuestItems(killer, LARAS_3RD_LIST))
  734. {
  735. giveItemRandomly(killer, npc, BREKAORC_TOTEM, 1, 30, 1.0, true);
  736. }
  737. break;
  738. }
  739. case BREKA_ORC_SHAMAN:
  740. case BREKA_ORC_OVERLORD:
  741. {
  742. if (!hasQuestItems(killer, GALATEAS_LETTER) && hasQuestItems(killer, LARAS_3RD_LIST))
  743. {
  744. giveItemRandomly(killer, npc, BREKAORC_TOTEM, 2, 30, 1.0, true);
  745. }
  746. break;
  747. }
  748. case FETTERED_SOUL:
  749. {
  750. if (!hasQuestItems(killer, GALATEAS_LETTER) && hasQuestItems(killer, LARAS_3RD_LIST))
  751. {
  752. giveItemRandomly(killer, npc, CRIMSON_BLOODSTONE, 6, 30, 1.0, true);
  753. }
  754. break;
  755. }
  756. case WINDSUS:
  757. {
  758. if (!hasQuestItems(killer, GALATEAS_LETTER) && hasQuestItems(killer, LARAS_4TH_LIST))
  759. {
  760. giveItemRandomly(killer, npc, TUSK_OF_WINDSUS, 3, 30, 1.0, true);
  761. }
  762. break;
  763. }
  764. case GIANT_FUNGUS:
  765. {
  766. if (!hasQuestItems(killer, GALATEAS_LETTER) && hasQuestItems(killer, LARAS_1ST_LIST))
  767. {
  768. giveItemRandomly(killer, npc, SAC_OF_REDSPORES, 2, 30, 1.0, true);
  769. }
  770. break;
  771. }
  772. case MANASHEN_GARGOYLE:
  773. {
  774. if (!hasQuestItems(killer, GALATEAS_LETTER) && hasQuestItems(killer, LARAS_2ND_LIST))
  775. {
  776. giveItemRandomly(killer, npc, SHARDS_OF_MANASHEN, 2, 30, 1.0, true);
  777. }
  778. break;
  779. }
  780. case LETO_LIZARDMAN:
  781. case LETO_LIZARDMAN_ARCHER:
  782. case LETO_LIZARDMAN_SOLDIER:
  783. case LETO_LIZARDMAN_WARRIOR:
  784. {
  785. if (!hasQuestItems(killer, GALATEAS_LETTER) && hasQuestItems(killer, LARAS_1ST_LIST))
  786. {
  787. giveItemRandomly(killer, npc, LETOLIZARDMAN_AMULET, 1, 30, 1.0, true);
  788. }
  789. break;
  790. }
  791. case LETO_LIZARDMAN_SHAMAN:
  792. case LETO_LIZARDMAN_OVERLORD:
  793. {
  794. if (!hasQuestItems(killer, GALATEAS_LETTER) && hasQuestItems(killer, LARAS_1ST_LIST))
  795. {
  796. giveItemRandomly(killer, npc, LETOLIZARDMAN_AMULET, 2, 30, 1.0, true);
  797. }
  798. break;
  799. }
  800. case KARUL_BUGBEAR:
  801. {
  802. if (!hasQuestItems(killer, GALATEAS_LETTER) && hasQuestItems(killer, LARAS_2ND_LIST))
  803. {
  804. giveItemRandomly(killer, npc, KARULBUGBEAR_TOTEM, 2, 30, 1.0, true);
  805. }
  806. break;
  807. }
  808. case SILHOUETTE_TILFO:
  809. case UNICORN_PHANTASM:
  810. case MIMI_THE_CAT:
  811. case SHADOW_TUREN:
  812. case UNICORN_RACER:
  813. case PAKO_THE_CAT:
  814. {
  815. final MonsterData data = MONSTERS.get(npc.getId());
  816. if (hasQuestItems(killer, data.getCrystalOfInprogress()))
  817. {
  818. npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, data.getNpcStringId()));
  819. takeItems(killer, data.getCrystalOfInprogress(), 1);
  820. giveItems(killer, data.getCrystalOfVictory(), 1);
  821. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  822. }
  823. break;
  824. }
  825. }
  826. }
  827. return super.onKill(npc, killer, isSummon);
  828. }
  829. @Override
  830. public String onTalk(L2Npc npc, L2PcInstance player)
  831. {
  832. final QuestState qs = getQuestState(player, true);
  833. String htmltext = getNoQuestMsg(player);
  834. if (qs.isCreated())
  835. {
  836. if (npc.getId() == HIGH_SUMMONER_GALATEA)
  837. {
  838. if ((player.getClassId() == ClassId.wizard) || (player.getClassId() == ClassId.elvenWizard) || (player.getClassId() == ClassId.darkWizard))
  839. {
  840. if (player.getLevel() >= MIN_LEVEL)
  841. {
  842. htmltext = "30634-03.htm";
  843. }
  844. else
  845. {
  846. htmltext = "30634-02.html";
  847. }
  848. }
  849. else
  850. {
  851. htmltext = "30634-01.html";
  852. }
  853. }
  854. }
  855. else if (qs.isStarted())
  856. {
  857. switch (npc.getId())
  858. {
  859. case HIGH_SUMMONER_GALATEA:
  860. {
  861. if (hasQuestItems(player, GALATEAS_LETTER))
  862. {
  863. htmltext = "30634-09.html";
  864. }
  865. else if (!hasQuestItems(player, GALATEAS_LETTER))
  866. {
  867. if (!hasQuestItems(player, ALMORS_ARCANA, BASILLIA_ARCANA, CAMONIELL_ARCANA, CELESTIEL_ARCANA, BELTHUS_ARCANA, BRYNTHEA_ARCANA) && !hasQuestItems(player, BEGINNERS_ARCANA))
  868. {
  869. htmltext = "30634-10.html";
  870. }
  871. else if (!hasQuestItems(player, ALMORS_ARCANA, BASILLIA_ARCANA, CAMONIELL_ARCANA, CELESTIEL_ARCANA, BELTHUS_ARCANA, BRYNTHEA_ARCANA) && hasQuestItems(player, BEGINNERS_ARCANA))
  872. {
  873. htmltext = "30634-11.html";
  874. }
  875. else if (hasQuestItems(player, ALMORS_ARCANA, BASILLIA_ARCANA, CAMONIELL_ARCANA, CELESTIEL_ARCANA, BELTHUS_ARCANA, BRYNTHEA_ARCANA))
  876. {
  877. giveAdena(player, 300960, true);
  878. giveItems(player, MARK_OF_SUMMONER, 1);
  879. addExpAndSp(player, 1664494, 114220);
  880. qs.exitQuest(false, true);
  881. player.sendPacket(new SocialAction(player.getObjectId(), 3));
  882. htmltext = "30634-12.html";
  883. }
  884. }
  885. break;
  886. }
  887. case GROCER_LARA:
  888. {
  889. if (hasQuestItems(player, GALATEAS_LETTER))
  890. {
  891. htmltext = "30063-01.html";
  892. }
  893. else if (!hasQuestItems(player, GALATEAS_LETTER))
  894. {
  895. if (!hasAtLeastOneQuestItem(player, LARAS_1ST_LIST, LARAS_2ND_LIST, LARAS_3RD_LIST, LARAS_4TH_LIST, LARAS_5TH_LIST))
  896. {
  897. htmltext = "30063-03.html";
  898. }
  899. else if (hasQuestItems(player, LARAS_1ST_LIST))
  900. {
  901. if ((getQuestItemsCount(player, LETOLIZARDMAN_AMULET) >= 30) && (getQuestItemsCount(player, SAC_OF_REDSPORES) >= 30))
  902. {
  903. takeItems(player, LETOLIZARDMAN_AMULET, -1);
  904. takeItems(player, SAC_OF_REDSPORES, -1);
  905. takeItems(player, LARAS_1ST_LIST, 1);
  906. giveItems(player, BEGINNERS_ARCANA, 2);
  907. qs.setCond(3, true);
  908. htmltext = "30063-06.html";
  909. }
  910. else
  911. {
  912. htmltext = "30063-05.html";
  913. }
  914. }
  915. else if (hasQuestItems(player, LARAS_2ND_LIST))
  916. {
  917. if ((getQuestItemsCount(player, KARULBUGBEAR_TOTEM) >= 30) && (getQuestItemsCount(player, SHARDS_OF_MANASHEN) >= 30))
  918. {
  919. takeItems(player, KARULBUGBEAR_TOTEM, -1);
  920. takeItems(player, SHARDS_OF_MANASHEN, -1);
  921. takeItems(player, LARAS_2ND_LIST, 1);
  922. giveItems(player, BEGINNERS_ARCANA, 2);
  923. qs.setCond(3, true);
  924. htmltext = "30063-08.html";
  925. }
  926. else
  927. {
  928. htmltext = "30063-07.html";
  929. }
  930. }
  931. else if (hasQuestItems(player, LARAS_3RD_LIST))
  932. {
  933. if ((getQuestItemsCount(player, BREKAORC_TOTEM) >= 30) && (getQuestItemsCount(player, CRIMSON_BLOODSTONE) >= 30))
  934. {
  935. takeItems(player, BREKAORC_TOTEM, -1);
  936. takeItems(player, CRIMSON_BLOODSTONE, -1);
  937. takeItems(player, LARAS_3RD_LIST, 1);
  938. giveItems(player, BEGINNERS_ARCANA, 2);
  939. qs.setCond(3, true);
  940. htmltext = "30063-10.html";
  941. }
  942. else
  943. {
  944. htmltext = "30063-09.html";
  945. }
  946. }
  947. else if (hasQuestItems(player, LARAS_4TH_LIST))
  948. {
  949. if ((getQuestItemsCount(player, TALONS_OF_TYRANT) >= 30) && (getQuestItemsCount(player, TUSK_OF_WINDSUS) >= 30))
  950. {
  951. takeItems(player, TALONS_OF_TYRANT, -1);
  952. takeItems(player, TUSK_OF_WINDSUS, -1);
  953. takeItems(player, LARAS_4TH_LIST, 1);
  954. giveItems(player, BEGINNERS_ARCANA, 2);
  955. qs.setCond(3, true);
  956. htmltext = "30063-12.html";
  957. }
  958. else
  959. {
  960. htmltext = "30063-11.html";
  961. }
  962. }
  963. else if (hasQuestItems(player, LARAS_5TH_LIST))
  964. {
  965. if ((getQuestItemsCount(player, WINGS_OF_DRONEANT) >= 30) && (getQuestItemsCount(player, FANGS_OF_WYRM) >= 30))
  966. {
  967. takeItems(player, WINGS_OF_DRONEANT, -1);
  968. takeItems(player, FANGS_OF_WYRM, -1);
  969. takeItems(player, LARAS_5TH_LIST, 1);
  970. giveItems(player, BEGINNERS_ARCANA, 2);
  971. qs.setCond(3, true);
  972. htmltext = "30063-14.html";
  973. }
  974. else
  975. {
  976. htmltext = "30063-13.html";
  977. }
  978. }
  979. }
  980. break;
  981. }
  982. case SUMMONER_ALMORS:
  983. {
  984. if (!hasQuestItems(player, ALMORS_ARCANA))
  985. {
  986. if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_1ST, CRYSTAL_OF_INPROGRESS_1ST, CRYSTAL_OF_FOUL_1ST, CRYSTAL_OF_DEFEAT_1ST, CRYSTAL_OF_VICTORY_1ST))
  987. {
  988. htmltext = "30635-01.html";
  989. }
  990. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_1ST, CRYSTAL_OF_INPROGRESS_1ST, CRYSTAL_OF_FOUL_1ST, CRYSTAL_OF_VICTORY_1ST) && hasQuestItems(player, CRYSTAL_OF_DEFEAT_1ST))
  991. {
  992. htmltext = "30635-05.html";
  993. }
  994. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_1ST, CRYSTAL_OF_INPROGRESS_1ST, CRYSTAL_OF_DEFEAT_1ST, CRYSTAL_OF_VICTORY_1ST) && hasQuestItems(player, CRYSTAL_OF_FOUL_1ST))
  995. {
  996. htmltext = "30635-06.html";
  997. }
  998. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_1ST, CRYSTAL_OF_INPROGRESS_1ST, CRYSTAL_OF_FOUL_1ST, CRYSTAL_OF_DEFEAT_1ST) && hasQuestItems(player, CRYSTAL_OF_VICTORY_1ST))
  999. {
  1000. giveItems(player, ALMORS_ARCANA, 1);
  1001. takeItems(player, CRYSTAL_OF_VICTORY_1ST, 1);
  1002. if (hasQuestItems(player, BASILLIA_ARCANA, CAMONIELL_ARCANA, CELESTIEL_ARCANA, BELTHUS_ARCANA, BRYNTHEA_ARCANA))
  1003. {
  1004. qs.setCond(4, true);
  1005. }
  1006. htmltext = "30635-07.html";
  1007. }
  1008. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_INPROGRESS_1ST, CRYSTAL_OF_FOUL_1ST, CRYSTAL_OF_DEFEAT_1ST, CRYSTAL_OF_VICTORY_1ST) && hasQuestItems(player, CRYSTAL_OF_STARTING_1ST))
  1009. {
  1010. htmltext = "30635-08.html";
  1011. }
  1012. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_1ST, CRYSTAL_OF_FOUL_1ST, CRYSTAL_OF_DEFEAT_1ST, CRYSTAL_OF_VICTORY_1ST) && hasQuestItems(player, CRYSTAL_OF_INPROGRESS_1ST))
  1013. {
  1014. htmltext = "30635-09.html";
  1015. }
  1016. }
  1017. else
  1018. {
  1019. htmltext = "30635-10.html";
  1020. }
  1021. break;
  1022. }
  1023. case SUMMONER_CAMONIELL:
  1024. {
  1025. if (!hasQuestItems(player, CAMONIELL_ARCANA))
  1026. {
  1027. if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_3RD, CRYSTAL_OF_INPROGRESS_3RD, CRYSTAL_OF_FOUL_3RD, CRYSTAL_OF_DEFEAT_3RD, CRYSTAL_OF_VICTORY_3RD))
  1028. {
  1029. htmltext = "30636-01.html";
  1030. }
  1031. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_3RD, CRYSTAL_OF_INPROGRESS_3RD, CRYSTAL_OF_FOUL_3RD, CRYSTAL_OF_VICTORY_3RD) && hasQuestItems(player, CRYSTAL_OF_DEFEAT_3RD))
  1032. {
  1033. htmltext = "30636-05.html";
  1034. }
  1035. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_3RD, CRYSTAL_OF_INPROGRESS_3RD, CRYSTAL_OF_DEFEAT_3RD, CRYSTAL_OF_VICTORY_3RD) && hasQuestItems(player, CRYSTAL_OF_FOUL_3RD))
  1036. {
  1037. htmltext = "30636-06.html";
  1038. }
  1039. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_3RD, CRYSTAL_OF_INPROGRESS_3RD, CRYSTAL_OF_FOUL_3RD, CRYSTAL_OF_DEFEAT_3RD) && hasQuestItems(player, CRYSTAL_OF_VICTORY_3RD))
  1040. {
  1041. giveItems(player, CAMONIELL_ARCANA, 1);
  1042. takeItems(player, CRYSTAL_OF_VICTORY_3RD, 1);
  1043. if (hasQuestItems(player, ALMORS_ARCANA, BASILLIA_ARCANA, CELESTIEL_ARCANA, BELTHUS_ARCANA, BRYNTHEA_ARCANA))
  1044. {
  1045. qs.setCond(4, true);
  1046. }
  1047. htmltext = "30636-07.html";
  1048. }
  1049. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_INPROGRESS_3RD, CRYSTAL_OF_FOUL_3RD, CRYSTAL_OF_DEFEAT_3RD, CRYSTAL_OF_VICTORY_3RD) && hasQuestItems(player, CRYSTAL_OF_STARTING_3RD))
  1050. {
  1051. htmltext = "30636-08.html";
  1052. }
  1053. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_3RD, CRYSTAL_OF_FOUL_3RD, CRYSTAL_OF_DEFEAT_3RD, CRYSTAL_OF_VICTORY_3RD) && hasQuestItems(player, CRYSTAL_OF_INPROGRESS_3RD))
  1054. {
  1055. htmltext = "30636-09.html";
  1056. }
  1057. }
  1058. else
  1059. {
  1060. htmltext = "30636-10.html";
  1061. }
  1062. break;
  1063. }
  1064. case SUMMONER_BELTHUS:
  1065. {
  1066. if (!hasQuestItems(player, BELTHUS_ARCANA))
  1067. {
  1068. if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_5TH, CRYSTAL_OF_INPROGRESS_5TH, CRYSTAL_OF_FOUL_5TH, CRYSTAL_OF_DEFEAT_5TH, CRYSTAL_OF_VICTORY_5TH))
  1069. {
  1070. htmltext = "30637-01.html";
  1071. }
  1072. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_5TH, CRYSTAL_OF_INPROGRESS_5TH, CRYSTAL_OF_FOUL_5TH, CRYSTAL_OF_VICTORY_5TH) && hasQuestItems(player, CRYSTAL_OF_DEFEAT_5TH))
  1073. {
  1074. htmltext = "30637-05.html";
  1075. }
  1076. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_5TH, CRYSTAL_OF_INPROGRESS_5TH, CRYSTAL_OF_DEFEAT_5TH, CRYSTAL_OF_VICTORY_5TH) && hasQuestItems(player, CRYSTAL_OF_FOUL_5TH))
  1077. {
  1078. htmltext = "30637-06.html";
  1079. }
  1080. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_5TH, CRYSTAL_OF_INPROGRESS_5TH, CRYSTAL_OF_FOUL_5TH, CRYSTAL_OF_DEFEAT_5TH) && hasQuestItems(player, CRYSTAL_OF_VICTORY_5TH))
  1081. {
  1082. giveItems(player, BELTHUS_ARCANA, 1);
  1083. takeItems(player, CRYSTAL_OF_VICTORY_5TH, 1);
  1084. if (hasQuestItems(player, ALMORS_ARCANA, BASILLIA_ARCANA, CAMONIELL_ARCANA, CELESTIEL_ARCANA, BRYNTHEA_ARCANA))
  1085. {
  1086. qs.setCond(4, true);
  1087. }
  1088. htmltext = "30637-07.html";
  1089. }
  1090. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_INPROGRESS_5TH, CRYSTAL_OF_FOUL_5TH, CRYSTAL_OF_DEFEAT_5TH, CRYSTAL_OF_VICTORY_5TH) && hasQuestItems(player, CRYSTAL_OF_STARTING_5TH))
  1091. {
  1092. htmltext = "30637-08.html";
  1093. }
  1094. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_5TH, CRYSTAL_OF_FOUL_5TH, CRYSTAL_OF_DEFEAT_5TH, CRYSTAL_OF_VICTORY_5TH) && hasQuestItems(player, CRYSTAL_OF_INPROGRESS_5TH))
  1095. {
  1096. htmltext = "30637-09.html";
  1097. }
  1098. }
  1099. else
  1100. {
  1101. htmltext = "30637-10.html";
  1102. }
  1103. break;
  1104. }
  1105. case SUMMONER_BASILLA:
  1106. {
  1107. if (!hasQuestItems(player, BASILLIA_ARCANA))
  1108. {
  1109. if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_2ND, CRYSTAL_OF_INPROGRESS_2ND, CRYSTAL_OF_FOUL_2ND, CRYSTAL_OF_DEFEAT_2ND, CRYSTAL_OF_VICTORY_2ND))
  1110. {
  1111. htmltext = "30638-01.html";
  1112. }
  1113. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_2ND, CRYSTAL_OF_INPROGRESS_2ND, CRYSTAL_OF_FOUL_2ND, CRYSTAL_OF_VICTORY_2ND) && hasQuestItems(player, CRYSTAL_OF_DEFEAT_2ND))
  1114. {
  1115. htmltext = "30638-05.html";
  1116. }
  1117. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_2ND, CRYSTAL_OF_INPROGRESS_2ND, CRYSTAL_OF_DEFEAT_2ND, CRYSTAL_OF_VICTORY_2ND) && hasQuestItems(player, CRYSTAL_OF_FOUL_2ND))
  1118. {
  1119. htmltext = "30638-06.html";
  1120. }
  1121. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_2ND, CRYSTAL_OF_INPROGRESS_2ND, CRYSTAL_OF_FOUL_2ND, CRYSTAL_OF_DEFEAT_2ND) && hasQuestItems(player, CRYSTAL_OF_VICTORY_2ND))
  1122. {
  1123. giveItems(player, BASILLIA_ARCANA, 1);
  1124. takeItems(player, CRYSTAL_OF_VICTORY_2ND, 1);
  1125. if (hasQuestItems(player, ALMORS_ARCANA, CAMONIELL_ARCANA, CELESTIEL_ARCANA, BELTHUS_ARCANA, BRYNTHEA_ARCANA))
  1126. {
  1127. qs.setCond(4, true);
  1128. }
  1129. htmltext = "30638-07.html";
  1130. }
  1131. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_INPROGRESS_2ND, CRYSTAL_OF_FOUL_2ND, CRYSTAL_OF_DEFEAT_2ND, CRYSTAL_OF_VICTORY_2ND) && hasQuestItems(player, CRYSTAL_OF_STARTING_2ND))
  1132. {
  1133. htmltext = "30638-08.html";
  1134. }
  1135. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_2ND, CRYSTAL_OF_FOUL_2ND, CRYSTAL_OF_DEFEAT_2ND, CRYSTAL_OF_VICTORY_2ND) && hasQuestItems(player, CRYSTAL_OF_INPROGRESS_2ND))
  1136. {
  1137. htmltext = "30638-09.html";
  1138. }
  1139. }
  1140. else
  1141. {
  1142. htmltext = "30638-10.html";
  1143. }
  1144. break;
  1145. }
  1146. case SUMMONER_CELESTIEL:
  1147. {
  1148. if (!hasQuestItems(player, CELESTIEL_ARCANA))
  1149. {
  1150. if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_4TH, CRYSTAL_OF_INPROGRESS_4TH, CRYSTAL_OF_FOUL_4TH, CRYSTAL_OF_DEFEAT_4TH, CRYSTAL_OF_VICTORY_4TH))
  1151. {
  1152. htmltext = "30639-01.html";
  1153. }
  1154. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_4TH, CRYSTAL_OF_INPROGRESS_4TH, CRYSTAL_OF_FOUL_4TH, CRYSTAL_OF_VICTORY_4TH) && hasQuestItems(player, CRYSTAL_OF_DEFEAT_4TH))
  1155. {
  1156. htmltext = "30639-05.html";
  1157. }
  1158. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_4TH, CRYSTAL_OF_INPROGRESS_4TH, CRYSTAL_OF_DEFEAT_4TH, CRYSTAL_OF_VICTORY_4TH) && hasQuestItems(player, CRYSTAL_OF_FOUL_4TH))
  1159. {
  1160. htmltext = "30639-06.html";
  1161. }
  1162. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_4TH, CRYSTAL_OF_INPROGRESS_4TH, CRYSTAL_OF_FOUL_4TH, CRYSTAL_OF_DEFEAT_4TH) && hasQuestItems(player, CRYSTAL_OF_VICTORY_4TH))
  1163. {
  1164. giveItems(player, CELESTIEL_ARCANA, 1);
  1165. takeItems(player, CRYSTAL_OF_VICTORY_4TH, 1);
  1166. if (hasQuestItems(player, ALMORS_ARCANA, BASILLIA_ARCANA, CAMONIELL_ARCANA, BELTHUS_ARCANA, BRYNTHEA_ARCANA))
  1167. {
  1168. qs.setCond(4, true);
  1169. }
  1170. htmltext = "30639-07.html";
  1171. }
  1172. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_INPROGRESS_4TH, CRYSTAL_OF_FOUL_4TH, CRYSTAL_OF_DEFEAT_4TH, CRYSTAL_OF_VICTORY_4TH) && hasQuestItems(player, CRYSTAL_OF_STARTING_4TH))
  1173. {
  1174. htmltext = "30639-08.html";
  1175. }
  1176. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_4TH, CRYSTAL_OF_FOUL_4TH, CRYSTAL_OF_DEFEAT_4TH, CRYSTAL_OF_VICTORY_4TH) && hasQuestItems(player, CRYSTAL_OF_INPROGRESS_4TH))
  1177. {
  1178. htmltext = "30639-09.html";
  1179. }
  1180. }
  1181. else
  1182. {
  1183. htmltext = "30639-10.html";
  1184. }
  1185. break;
  1186. }
  1187. case SUMMONER_BRYNTHEA:
  1188. {
  1189. if (!hasQuestItems(player, BRYNTHEA_ARCANA))
  1190. {
  1191. if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_6TH, CRYSTAL_OF_INPROGRESS_6TH, CRYSTAL_OF_FOUL_6TH, CRYSTAL_OF_DEFEAT_6TH, CRYSTAL_OF_VICTORY_6TH))
  1192. {
  1193. htmltext = "30640-01.html";
  1194. }
  1195. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_6TH, CRYSTAL_OF_INPROGRESS_6TH, CRYSTAL_OF_FOUL_6TH, CRYSTAL_OF_VICTORY_6TH) && hasQuestItems(player, CRYSTAL_OF_DEFEAT_6TH))
  1196. {
  1197. htmltext = "30640-05.html";
  1198. }
  1199. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_6TH, CRYSTAL_OF_INPROGRESS_6TH, CRYSTAL_OF_DEFEAT_6TH, CRYSTAL_OF_VICTORY_6TH) && hasQuestItems(player, CRYSTAL_OF_FOUL_6TH))
  1200. {
  1201. htmltext = "30640-06.html";
  1202. }
  1203. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_6TH, CRYSTAL_OF_INPROGRESS_6TH, CRYSTAL_OF_FOUL_6TH, CRYSTAL_OF_DEFEAT_6TH) && hasQuestItems(player, CRYSTAL_OF_VICTORY_6TH))
  1204. {
  1205. giveItems(player, BRYNTHEA_ARCANA, 1);
  1206. takeItems(player, CRYSTAL_OF_VICTORY_6TH, 1);
  1207. if (hasQuestItems(player, ALMORS_ARCANA, BASILLIA_ARCANA, CAMONIELL_ARCANA, CELESTIEL_ARCANA, BELTHUS_ARCANA))
  1208. {
  1209. qs.setCond(4, true);
  1210. }
  1211. htmltext = "30640-07.html";
  1212. }
  1213. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_INPROGRESS_6TH, CRYSTAL_OF_FOUL_6TH, CRYSTAL_OF_DEFEAT_6TH, CRYSTAL_OF_VICTORY_6TH) && hasQuestItems(player, CRYSTAL_OF_STARTING_6TH))
  1214. {
  1215. htmltext = "30640-08.html";
  1216. }
  1217. else if (!hasAtLeastOneQuestItem(player, CRYSTAL_OF_STARTING_6TH, CRYSTAL_OF_FOUL_6TH, CRYSTAL_OF_DEFEAT_6TH, CRYSTAL_OF_VICTORY_6TH) && hasQuestItems(player, CRYSTAL_OF_INPROGRESS_6TH))
  1218. {
  1219. htmltext = "30640-09.html";
  1220. }
  1221. }
  1222. else
  1223. {
  1224. htmltext = "30640-10.html";
  1225. }
  1226. break;
  1227. }
  1228. }
  1229. }
  1230. else if (qs.isCompleted())
  1231. {
  1232. if (npc.getId() == HIGH_SUMMONER_GALATEA)
  1233. {
  1234. htmltext = getAlreadyCompletedMsg(player);
  1235. }
  1236. }
  1237. return htmltext;
  1238. }
  1239. private static class MonsterData
  1240. {
  1241. private final int _crystalOfInprogress;
  1242. private final int _crystalOfVictory;
  1243. private final NpcStringId _npcStringId;
  1244. protected MonsterData(int crystalOfInprogress, int crystalOfVictory, NpcStringId npcStringId)
  1245. {
  1246. _crystalOfInprogress = crystalOfInprogress;
  1247. _crystalOfVictory = crystalOfVictory;
  1248. _npcStringId = npcStringId;
  1249. }
  1250. protected int getCrystalOfInprogress()
  1251. {
  1252. return _crystalOfInprogress;
  1253. }
  1254. protected int getCrystalOfVictory()
  1255. {
  1256. return _crystalOfVictory;
  1257. }
  1258. protected NpcStringId getNpcStringId()
  1259. {
  1260. return _npcStringId;
  1261. }
  1262. }
  1263. }