FridayDungeon.txt 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881
  1. //===== rAthena Script =======================================
  2. //= Friday Memorial Dungeon
  3. //===== Description: =========================================
  4. //= [Walkthrough Conversion]
  5. //= Friday Memorial Dungeon
  6. //===== Changelogs: ==========================================
  7. //= 1.0 Initial release [Everade]
  8. //= 1.1 Clean-up [Capuche]
  9. //============================================================
  10. gef_tower,57,170,3 script Marry Jay 4_F_JOB_BLACKSMITH,{
  11. if (BaseLevel < 130) {
  12. mes "[Marry Jay]";
  13. mes "Your base level is too low, come back when you hit level 130.";
  14. close;
  15. }
  16. mes "^ff0000If you do any monster processing, such as monster taming within the dungeon, it won't count towards your progress. Please take note.^000000";
  17. next;
  18. .@day = gettime(DT_DAYOFWEEK);
  19. if (.@day != FRIDAY) {
  20. mes "[Marry Jay]";
  21. mes "Oh, a curious onlooker? I'm Marry Jay, the person in charge of Fridays among the days of the week.";
  22. next;
  23. select( "When is the opening time?" );
  24. mes "[Marry Jay]";
  25. mes "The dungeon will be open during:";
  26. mes "^0000FFFriday 00:00 ~ Friday 23:59^000000";
  27. next;
  28. mes "[Marry Jay]";
  29. mes "I hope to see you when Friday arrives~";
  30. close;
  31. }
  32. .@md_name$ = "Friday Dungeon";
  33. switch(checkquest(12379,PLAYTIME)) {
  34. case -1:
  35. break;
  36. case 0:
  37. case 1:
  38. mes "[Marry Jay]";
  39. mes "Sorry, but the entry period to the " + .@md_name$ + " has expired.";
  40. mes "Take a rest while waiting for the dungeon to be available again.";
  41. close;
  42. case 2:
  43. erasequest 12379;
  44. mes "[Marry Jay]";
  45. mes "The cooldown has expired.";
  46. mes "You may re-enter the Memorial Dungeon.";
  47. close;
  48. }
  49. mes "[Marry Jay]";
  50. mes "You came just in time.";
  51. mes "The memorial dungeon is just ready to be opened.";
  52. mes "Would you like to enter now?";
  53. next;
  54. if (is_party_leader() == true)
  55. .@menu$ = "Prepare Friday Memorial";
  56. switch( select( .@menu$, "Enter Friday Memorial", "Cancel" ) ) {
  57. case 1:
  58. instance_create(.@md_name$);
  59. mes "[Marry Jay]";
  60. mes "The Memorial Dungeon has been created.";
  61. mes "You may now enter.";
  62. close;
  63. case 2:
  64. switch( instance_enter(.@md_name$) ) {
  65. case IE_NOMEMBER:
  66. if (is_party_leader() == true)
  67. end;
  68. mes "Only party members can enter this Memorial dungeon.";
  69. close;
  70. case IE_NOINSTANCE:
  71. if (is_party_leader() == true) {
  72. mes "There is no Memorial Dungeon registered.";
  73. close;
  74. }
  75. mes "The Friday Memorial Dungeon does not exist.";
  76. mes "Your party leader has not yet created the Memorial dungeon.";
  77. close;
  78. case IE_OTHER:
  79. mes "An unknown error occurred.";
  80. close;
  81. case IE_OK:
  82. mes "[Marry Jay]";
  83. mes "Off you go!";
  84. mapannounce "gef_tower", "" + strcharinfo(0) + " of the party, " + getpartyname( getcharid(1) ) + ", is entering the " + .@md_name$ + ".", bc_map, 0xFF99;
  85. if (isbegin_quest(12379) < 1)
  86. setquest 12379;
  87. end;
  88. }
  89. end;
  90. case 3:
  91. mes "[Marry Jay]";
  92. mes "You have not prepared?";
  93. mes "Can't really help it I guess";
  94. close;
  95. }
  96. end;
  97. }
  98. //Instance
  99. 1@md_gef,185,81 monster Shining Plant 1083,1,1800000,900000
  100. 1@md_gef,110,129,6 script Marry Jay#0_1 4_F_JOB_BLACKSMITH,{
  101. if (is_party_leader() == false)
  102. end;
  103. mes "[Marry Jay]";
  104. mes "Before we start setting up the environment here, we'll give you the chance to choose an appropriate difficulty level.";
  105. mes "I could make my own choice, but each person handles it differently based on their abilities.";
  106. next;
  107. switch( select( "Cancel", "LV130 ~ 199", "LV200 + " ) ) {
  108. case 1:
  109. close;
  110. case 2:
  111. //MinLevel, Lich Lord, Nightmare, Jakk, Ghoul, Drainliar
  112. 'hard = 0;
  113. setarray 'mob[0],130,3658,3660,3662,3664,3666;
  114. break;
  115. case 3:
  116. if (BaseLevel < 200) {
  117. mes "[Marry Jay]";
  118. mes "You can't choose this difficulty, because your base level is below 200.";
  119. close;
  120. }
  121. 'hard = 1;
  122. setarray 'mob[0],200,3659,3661,3663,3665,3667;
  123. break;
  124. }
  125. if (BaseLevel < 'mob[0]) {
  126. mes "[Marry Jay]";
  127. mes "Your base level is too low to select this, you need to be level " + 'mob[0] + " or above.";
  128. close;
  129. }
  130. close2;
  131. npctalk "Now, this place is about to become a hunting ground. I'll get out and close the front door.";
  132. sleep 4000;
  133. npctalk "Good Luck~";
  134. sleep 3000;
  135. if ('step == 0) {
  136. 'step = 1;
  137. donpcevent instance_npcname("md_gef_mobs_spawn") + "::OnStart";
  138. disablenpc();
  139. enablenpc instance_npcname("The Stranger#cadaver");
  140. enablenpc instance_npcname("Bizzare Sculpture#boss");
  141. }
  142. end;
  143. }
  144. 1@md_gef,1,1,6 script md_gef_mobs_spawn -1,{
  145. end;
  146. OnStart:
  147. .@npc_name$ = instance_npcname("md_gef_mobs_spawn");
  148. monster 'map_md_gef$,0,0,"Nightmare",'mob[2],20, .@npc_name$ + "::OnNightmareDead";
  149. monster 'map_md_gef$,0,0,"Jakk",'mob[3],30, .@npc_name$ + "::OnJakkDead";
  150. monster 'map_md_gef$,0,0,"Ghoul",'mob[4],30, .@npc_name$ + "::OnGhoulDead";
  151. monster 'map_md_gef$,0,0,"Drainliar",'mob[5],20, .@npc_name$ + "::OnDrainliarDead";
  152. end;
  153. OnNightmareDead:
  154. callsub( S_Mob, 'mob[2], "Nightmare", "OnNightmareDead" );
  155. OnJakkDead:
  156. callsub( S_Mob, 'mob[3], "Jakk", "OnJakkDead" );
  157. OnGhoulDead:
  158. callsub( S_Mob, 'mob[4], "Ghoul", "OnGhoulDead" );
  159. OnDrainliarDead:
  160. callsub( S_Mob, 'mob[5], "Drainliar", "OnDrainliarDead" );
  161. S_Mob:
  162. 'count++;
  163. if (('count % 100) == 0) {
  164. 'rand_chest++;
  165. if ('rand_chest > 4)
  166. 'rand_chest = 1;
  167. // Treasure Chest Spawn
  168. donpcevent instance_npcname("#fd_box" + 'rand_chest) + "::OnStart";
  169. }
  170. sleep 10000;
  171. monster 'map_md_gef$,0,0, getarg(1), getarg(0),1, instance_npcname("md_gef_mobs_spawn") + "::" + getarg(2);
  172. end;
  173. OnInstanceInit:
  174. 'step = 0;
  175. 'hard = 0;
  176. 'count = 0;
  177. 'rand_chest = 0;
  178. 'freestones = 0;
  179. 'boss_actv = 0;
  180. 'map_md_gef$ = instance_mapname("1@md_gef");
  181. end;
  182. }
  183. 1@md_gef,110,129,6 script(DISABLED) Mary Juj#0_2 4_F_JOB_BLACKSMITH,{
  184. npctalk "Hello";
  185. end;
  186. }
  187. 1@md_gef,183,222,5 script(DISABLED) The Stranger#cadaver 4_TOWER_11,{
  188. mes "It is a stranger's corpse.";
  189. mes "Perhaps he died while wandering in this place on the search for treasure.";
  190. next;
  191. if (select( "Calm down", "Investigate the body" ) == 1) {
  192. mes "You respect the dead and decided to leave the body alone.";
  193. close;
  194. }
  195. mes "Looking at a hastily scribbled note in his pocket, perhaps the adventurer's name was Walter.";
  196. next;
  197. mes "[Adventurer's Log]";
  198. mes "My name is Walter. For the adventurers who will visit this place in the future, I'm leaving this so that you don't make the same mistake again.";
  199. next;
  200. mes "[Adventurer's Log]";
  201. mes "On the first day, I curiously put my hand on the slab of a strange Sculpture nearby.";
  202. mes "...and I awokened something that I should not have.";
  203. next;
  204. mes "[Adventurer's Log]";
  205. mes "Right now the revived ancient king is wandering in front of me.";
  206. mes "Perhaps he has no memories of his previous life.";
  207. mes "One thing is certain, he will kill me.";
  208. next;
  209. mes "[Adventurer's Log]";
  210. mes "To the adventurers who will visit this place in the future, I hope you do not make the same mistake as me.";
  211. mes "If you do see a suspicious slab, do not show any interest and pass by it.";
  212. next;
  213. mes "[Adventurer's Log]";
  214. mes "Again, never touch the slab. Whatever temptation you may have.";
  215. if ('freestones != 0)
  216. close;
  217. next;
  218. mes "Several craft stones fall from his body. They were probably collected while exploring this place.";
  219. close2;
  220. if ('freestones == 0) {
  221. 'freestones = 1;
  222. if ('hard == 1)
  223. .@num = rand(7,9);
  224. else
  225. .@num = rand(5,7);
  226. for ( .@i = 0; .@i < .@num; ++.@i )
  227. makeitem 25235,1, 'map_md_gef$, rand(181,183), rand(221,224);
  228. }
  229. end;
  230. }
  231. 1@md_gef,199,73,0 script(DISABLED) Bizzare Sculpture#boss CLEAR_NPC,{
  232. if ('count < 100) {
  233. mes "It is a strange sculpture with a lot of dust piled up. I don't see anything suspicious.";
  234. close;
  235. }
  236. if ('boss_actv >= 1) {
  237. mes "Craft Stones have been melted by a powerful force into the sockets.";
  238. mes "Seems like the sockets can't be used for a while.";
  239. close;
  240. }
  241. mes "At some point, the accumulated dust scatters, and 10 hollow holes are visible on the slab under the sculpture.";
  242. next;
  243. mes "Each of the 10 hollow sockets seem to perfectly fit a craft stone.";
  244. next;
  245. if (select( "Ignore", "Try inserting craft stones" ) == 1)
  246. end;
  247. if (countitem(25235) < 10) {
  248. mes "Craft Stones have been melted by a powerful force into the sockets.";
  249. mes "Seems like the sockets can't be used for a while.";
  250. close;
  251. }
  252. mes "When you insert a craft stone into a hole, it emits a bright light and melts.";
  253. next;
  254. delitem 25235,10;
  255. specialeffect EF_ANGELUS;
  256. if (rand(1,10) == 10) {
  257. mes "Something seems to have changed in the air around me.";
  258. instance_announce 0, "Lord of the Dead: Who Awakened Me? I will meet you in person and ask you why.", bc_map, "0xFFFF00";
  259. if ('boss_actv == 0) {
  260. 'boss_actv = 1;
  261. monster 'map_md_gef$,210,110,"Lich King",'mob[1],1;
  262. }
  263. }
  264. else {
  265. mes "But nothing else happened.";
  266. close2;
  267. if ('boss_actv == 0) {
  268. disablenpc(); // Disable NPC for 5 minutes when MVP didn't spawn.
  269. initnpctimer;
  270. }
  271. end;
  272. }
  273. close;
  274. OnTimer300000:
  275. stopnpctimer;
  276. enablenpc();
  277. end;
  278. }
  279. // Treasure Chest Reward
  280. 1@md_gef,212,212,3 script(DISABLED) #fd_box1 4_TREASURE_BOX,{
  281. specialeffect EF_COIN;
  282. disablenpc();
  283. stopnpctimer;
  284. sleep 500;
  285. if ('hard == 1)
  286. .@num = rand(7,9);
  287. else
  288. .@num = rand(5,7);
  289. .@npc_name$ = strnpcinfo(2);
  290. if (.@npc_name$ == "fd_box1") {
  291. for ( .@i = 0; .@i < .@num; ++.@i )
  292. makeitem 25235,1, 'map_md_gef$, rand(210,214), rand(210,214);
  293. }
  294. if (.@npc_name$ == "fd_box2") {
  295. for ( .@i = 0; .@i < .@num; ++.@i )
  296. makeitem 25235,1, 'map_md_gef$, rand(188,192), rand(54,58);
  297. }
  298. if (.@npc_name$ == "fd_box3") {
  299. for ( .@i = 0; .@i < .@num; ++.@i )
  300. makeitem 25235,1, 'map_md_gef$, rand(47,51), rand(55,59);
  301. }
  302. if (.@npc_name$ == "fd_box4") {
  303. for ( .@i = 0; .@i < .@num; ++.@i )
  304. makeitem 25235,1, 'map_md_gef$, rand(42,46), rand(209,213);
  305. }
  306. end;
  307. OnStart:
  308. enablenpc();
  309. instance_announce 0, "A treasure chest appeared somewhere in the dungeon. It'll disappear after a while, so let's find it.", bc_map, "0xff5500";
  310. initnpctimer;
  311. end;
  312. OnTimer180000: //3min before chest disappears
  313. disablenpc();
  314. stopnpctimer;
  315. end;
  316. }
  317. 1@md_gef,190,56,3 duplicate(#fd_box1) #fd_box2 4_TREASURE_BOX
  318. 1@md_gef,49,57,3 duplicate(#fd_box1) #fd_box3 4_TREASURE_BOX
  319. 1@md_gef,44,211,3 duplicate(#fd_box1) #fd_box4 4_TREASURE_BOX
  320. //Merchant
  321. gef_tower,57,167,3 script Amateur Collector#pa0829 1_F_01,{
  322. disable_items;
  323. function F_equip_menu;
  324. function F_enchant;
  325. if (checkweight(1201,1) == 0) {
  326. mes "You have too many kinds of objects. Clear your inventory.";
  327. close;
  328. }
  329. if (MaxWeight - Weight < 10000) {
  330. mes "Can't continue because you have too many heavy objects. Reduce your total weight by clearing your inventory.";
  331. close;
  332. }
  333. mes "[Amateur Collector]";
  334. mes "If you bring me a " + mesitemlink(25235, false) + ", I can enchant a wonderful effect on your accessory!";
  335. next;
  336. switch( select( "What can you do with the Crafting Stone?", "Accessory Enchantment", "Reset Enchant" ) ) {
  337. case 1:
  338. mes "[Amateur Collector]";
  339. mes "I trade expensive stones from the dungeon in exchange for my craftsmanship. I'm still a beginner, but my skills are passable.";
  340. mes "Please take care of me.";
  341. next;
  342. if (select( "I've heard this before.", "I'm listening." ) == 1) {
  343. mes "[Amateur Collector]";
  344. mes "Is that so?";
  345. close;
  346. }
  347. mes "[Amateur Collector]";
  348. mes "By using the Craft Stone, I can enchant one of your accessories with abilities.";
  349. next;
  350. mes "[Amateur Collector]";
  351. mes "I need 10 x " + mesitemlink(25235, false) + " and 100,000 Zeny.";
  352. mes "There is no failure in the enchantment process.";
  353. next;
  354. mes "[Amateur Collector]";
  355. mes "However ^0000FFif the accessory has a random option, the random option will be removed after enchantment.^000000";
  356. next;
  357. select( "Anything else?" );
  358. mes "[Amateur Collector]";
  359. mes "Cards slotted to the accessory will remain after the enchantement.";
  360. next;
  361. mes "[Amateur Collector]";
  362. mes "A reset is possible, but I can't say that I'm experienced.";
  363. mes "My success rate is:";
  364. mes "Royal Ring: 80%";
  365. mes "Other Accessory: 20%";
  366. next;
  367. mes "[Amateur Collector]";
  368. mes "^0000FFIf the accessory has a random option, the random option will be removed after initialization.^000000";
  369. close;
  370. case 2:
  371. .@type = 1;
  372. .@type_name$ = "enchant";
  373. break;
  374. case 3:
  375. .@type = 2;
  376. .@type_name$ = "reset";
  377. break;
  378. }
  379. .@slot = F_equip_menu();
  380. .@equip_id = getequipid(.@slot);
  381. setarray .@equip_card[0], getequipcardid(.@slot,0), getequipcardid(.@slot,1), getequipcardid(.@slot,2), getequipcardid(.@slot,3);
  382. copyarray .@card[0], .@equip_card[0], 4;
  383. switch( .@equip_id ) {
  384. case 0:
  385. mes "[Amateur Collector]";
  386. mes "Please equip your accessory.";
  387. close;
  388. case 28483:
  389. case 2601:
  390. case 2602:
  391. case 2603:
  392. case 2605:
  393. case 2607:
  394. case 2608:
  395. case 2609:
  396. case 2610:
  397. case 2611:
  398. case 2612:
  399. case 2613:
  400. case 2614:
  401. case 2615:
  402. case 2616:
  403. case 2617:
  404. case 2618:
  405. case 2619:
  406. case 2620:
  407. case 2621:
  408. case 2622:
  409. case 2623:
  410. case 2625:
  411. case 2626:
  412. case 2627:
  413. case 2628:
  414. case 2636:
  415. case 2637:
  416. case 2638:
  417. case 2639:
  418. case 2640:
  419. case 2641:
  420. case 2645:
  421. case 2648:
  422. case 2649:
  423. case 2650:
  424. case 2651:
  425. case 2652:
  426. case 2653:
  427. case 2654:
  428. case 2655:
  429. case 2656:
  430. case 2658:
  431. case 2663:
  432. case 2664:
  433. case 2665:
  434. case 2666:
  435. case 2667:
  436. case 2671:
  437. case 2680:
  438. case 2692:
  439. case 2700:
  440. case 2701:
  441. case 2702:
  442. case 2703:
  443. case 2712:
  444. case 2714:
  445. case 2715:
  446. case 2716:
  447. case 2718:
  448. case 2719:
  449. case 2720:
  450. case 2721:
  451. case 2722:
  452. case 2723:
  453. case 2724:
  454. case 2725:
  455. case 2726:
  456. case 2727:
  457. case 2728:
  458. case 2729:
  459. case 2730:
  460. case 2731:
  461. case 2732:
  462. case 2736:
  463. case 2737:
  464. case 2743:
  465. case 2744:
  466. case 2745:
  467. case 2746:
  468. case 2747:
  469. case 2748:
  470. case 2749:
  471. case 2766:
  472. case 2767:
  473. case 2768:
  474. case 2769:
  475. case 2770:
  476. case 2771:
  477. case 2772:
  478. case 2773:
  479. case 2774:
  480. case 2777:
  481. case 2778:
  482. case 2779:
  483. case 2780:
  484. case 2781:
  485. case 2783:
  486. case 2784:
  487. case 2787:
  488. case 2788:
  489. case 2789:
  490. case 2790:
  491. case 2794:
  492. case 2795:
  493. case 2800:
  494. case 2801:
  495. case 2802:
  496. case 2803:
  497. case 2804:
  498. case 2805:
  499. case 2807:
  500. case 2808:
  501. case 2809:
  502. case 2810:
  503. case 2826:
  504. case 2827:
  505. case 2843:
  506. case 2853:
  507. case 2854:
  508. case 2881:
  509. case 2956:
  510. break;
  511. default:
  512. mes "[Amateur Collector]";
  513. mes "I cannot " + .@type_name$ + " this " + mesitemlink(.@equip_id, false) + " accessory.";
  514. close;
  515. }
  516. if (.@type == 1) { // enchant
  517. switch( .@equip_id ) {
  518. case 28483: //Royal Ring Enchantment
  519. if (.@equip_card[2] != 0) {
  520. mes "[Amateur Collector]";
  521. mes "The " + mesitemlink(.@equip_id, false) + " already has maximum enchantment.";
  522. mes "I cannot work on this any further.";
  523. close;
  524. }
  525. .@pos = .@equip_card[3] != 0 ? 2 : 3;
  526. mes "[Amateur Collector]";
  527. mes "Please select an enchantment type~";
  528. next;
  529. switch( select( "Physical", "Magical", "Ranged" ) ) {
  530. case 1:
  531. if (.@pos == 2)
  532. .@equip_card[2] = F_enchant(2);
  533. else
  534. .@equip_card[3] = F_enchant(3);
  535. break;
  536. case 2:
  537. if (.@pos == 2)
  538. .@equip_card[2] = F_enchant(4);
  539. else
  540. .@equip_card[3] = F_enchant(5);
  541. break;
  542. case 3:
  543. if (.@pos == 2)
  544. .@equip_card[2] = F_enchant(6);
  545. else
  546. .@equip_card[3] = F_enchant(7);
  547. break;
  548. }
  549. if (.@pos == 2) {
  550. mes "[Amateur Collector]";
  551. mes "Are you sure to enhance the " + mesitemlink(.@equip_id, false) + "?";
  552. mes "^0000FFThere is a no chance of failure^000000.";
  553. next;
  554. if (select( "Yes, please proceed", "Cancel" ) == 2)
  555. end;
  556. }
  557. if (countitem(25235) < 10) {
  558. mes "[Amateur Collector]";
  559. mes "Please bring me 10 x " + mesitemlink(25235, false) + ".";
  560. close;
  561. }
  562. if (Zeny < 100000) {
  563. mes "[Amateur Collector]";
  564. mes "I need 100,000 zeny!";
  565. close;
  566. }
  567. delitem 25235,10; //Catalyst
  568. Zeny -= 100000;
  569. // anti-hack
  570. if (callfunc("F_IsEquipIDHack", .@slot, .@equip_id) || callfunc("F_IsEquipCardHack", .@slot, .@card[0], .@card[1], .@card[2], .@card[3]))
  571. end;
  572. delequip .@slot;
  573. specialeffect2 EF_REPAIRWEAPON;
  574. mes "[Amateur Collector]";
  575. mes "The " + mesitemlink(.@equip_id, false) + " has been enchanted!!";
  576. getitem2 .@equip_id,1,1,0,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@equip_card[3];
  577. close;
  578. default: // Normal Accessory Enchantment
  579. if (.@equip_card[3] != 0) {
  580. mes "[Amateur Collector]";
  581. mes "The " + mesitemlink(.@equip_id, false) + " already has an enchant.";
  582. mes "I cannot work on this any further.";
  583. close;
  584. }
  585. mes "[Amateur Collector]";
  586. mes "Are you sure you want to enhance the " + mesitemlink(.@equip_id, false) + "?";
  587. mes "^0000FFThere is a no chance of failure^000000.";
  588. next;
  589. if (select( "Yes, please proceed", "Cancel") == 2)
  590. end;
  591. if (countitem(25235) < 10) {
  592. mes "[Amateur Collector]";
  593. mes "Please bring me 10 x " + mesitemlink(25235, false) + ".";
  594. close;
  595. }
  596. if (Zeny < 100000) {
  597. mes "[Amateur Collector]";
  598. mes "I need 100,000 zeny!";
  599. close;
  600. }
  601. delitem 25235,10; //Catalyst
  602. Zeny -= 100000;
  603. // anti-hack
  604. if (callfunc("F_IsEquipIDHack", .@slot, .@equip_id) || callfunc("F_IsEquipCardHack", .@slot, .@card[0], .@card[1], .@card[2], .@card[3]))
  605. end;
  606. delequip .@slot;
  607. .@enchant = F_enchant(1);
  608. specialeffect2 EF_REPAIRWEAPON;
  609. mes "[Amateur Collector]";
  610. mes "The " + mesitemlink(.@equip_id, false) + " has been enchanted with " + mesitemlink(.@enchant, false) + ".";
  611. getitem2 .@equip_id,1,1,0,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@enchant;
  612. close;
  613. }
  614. end;
  615. }
  616. else { // reset
  617. if (.@equip_id == 28483) {
  618. .@pos = 2;
  619. .@success = 80; // success royal
  620. } else {
  621. .@pos = 3;
  622. .@success = 20; // success normal
  623. }
  624. if (.@equip_card[.@pos] == 0) {
  625. mes "[Amateur Collector]";
  626. mes "The " + mesitemlink(.@equip_id, false) + " is not at its maximum enchantment.";
  627. mes "I cannot reset this accessory.";
  628. close;
  629. }
  630. mes "[Amateur Collector]";
  631. mes "All enchanted effects will be removed from the " + mesitemlink(.@equip_id, false) + "?";
  632. mes "^FF0000There is a " + .@success + "% chance of success. The accessory will be destroyed if the reset fails!^000000";
  633. next;
  634. if (select( "I'll be back later", "Please proceed") == 1)
  635. end;
  636. if (countitem(25235) < 10) {
  637. mes "[Amateur Collector]";
  638. mes "Please bring me 10 x " + mesitemlink(25235, false) + "";
  639. close;
  640. }
  641. if (Zeny < 100000) {
  642. mes "[Amateur Collector]";
  643. mes "I need 100,000 zeny!";
  644. close;
  645. }
  646. delitem 25235,10; //Catalyst
  647. Zeny -= 100000;
  648. // anti-hack
  649. if (callfunc("F_IsEquipIDHack", .@slot, .@equip_id) || callfunc("F_IsEquipCardHack", .@slot, .@card[0], .@card[1], .@card[2], .@card[3]))
  650. end;
  651. delequip .@slot;
  652. if (rand(100) > .@success) {
  653. specialeffect2 EF_SUI_EXPLOSION;
  654. mes "[Amateur Collector]";
  655. mes "Darn it...";
  656. mes "I have failed and the accessory has been destroyed. I'm so sorry.";
  657. close;
  658. }
  659. specialeffect2 EF_REPAIRWEAPON;
  660. mes "[Amateur Collector]";
  661. mes "I have succeeded.";
  662. mes "The " + mesitemlink(.@equip_id, false) + " has been initialized.";
  663. getitem2 .@equip_id,1,1,0,0,.@equip_card[0],.@equip_card[1],0,0;
  664. close;
  665. }
  666. end;
  667. function F_equip_menu {
  668. .@l$ = getitemname(getequipid(EQI_ACC_L));
  669. .@r$ = getitemname(getequipid(EQI_ACC_R));
  670. .@acc_l$ = .@l$ == "null" ? "" : "Left Acc - " + .@l$;
  671. .@acc_r$ = .@r$ == "null" ? "" : "Right Acc - " + .@r$;
  672. switch( select( .@acc_l$, .@acc_r$ ) ) {
  673. case 1:
  674. .@slot = EQI_ACC_L;
  675. break;
  676. case 2:
  677. .@slot = EQI_ACC_R;
  678. break;
  679. }
  680. return .@slot;
  681. }
  682. function F_enchant {
  683. .@type = getarg(0);
  684. switch(.@type) {
  685. case 1: //Normal Enchant
  686. .@i = rand(920);
  687. if (.@i < 30) .@enchant = 4701; //STR+2
  688. else if (.@i < 60) .@enchant = 4702; //STR+3
  689. else if (.@i < 90) .@enchant = 4703; //STR+4
  690. else if (.@i < 120) .@enchant = 4711; //INT+2
  691. else if (.@i < 150) .@enchant = 4712; //INT+3
  692. else if (.@i < 180) .@enchant = 4713; //INT+4
  693. else if (.@i < 210) .@enchant = 4721; //DEX+2
  694. else if (.@i < 240) .@enchant = 4722; //DEX+3
  695. else if (.@i < 270) .@enchant = 4723; //DEX+4
  696. else if (.@i < 300) .@enchant = 4731; //AGI+2
  697. else if (.@i < 330) .@enchant = 4732; //AGI+3
  698. else if (.@i < 360) .@enchant = 4733; //AGI+4
  699. else if (.@i < 390) .@enchant = 4741; //VIT+2
  700. else if (.@i < 420) .@enchant = 4742; //VIT+3
  701. else if (.@i < 450) .@enchant = 4743; //VIT+4
  702. else if (.@i < 480) .@enchant = 4796; //HP+200
  703. else if (.@i < 510) .@enchant = 4798; //HP+400
  704. else if (.@i < 540) .@enchant = 4792; //DEF+6
  705. else if (.@i < 570) .@enchant = 4794; //DEF+12
  706. else if (.@i < 600) .@enchant = 4800; //SP+50
  707. else if (.@i < 630) .@enchant = 4801; //SP+100
  708. else if (.@i < 660) .@enchant = 4786; //MDEF+2
  709. else if (.@i < 690) .@enchant = 4787; //MDEF+4
  710. else if (.@i < 710) .@enchant = 4861; //MHP+1%
  711. else if (.@i < 730) .@enchant = 4862; //MHP+2%
  712. else if (.@i < 750) .@enchant = 4929; //MSP+1%
  713. else if (.@i < 770) .@enchant = 4882; //ATK+1%
  714. else if (.@i < 790) .@enchant = 4883; //MATK+1%
  715. else if (.@i < 800) .@enchant = 4817; //Sharp2
  716. else if (.@i < 810) .@enchant = 4816; //Sharp3
  717. else if (.@i < 815) .@enchant = 4843; //Sharp4
  718. else if (.@i < 825) .@enchant = 29047; //Fatal
  719. else if (.@i < 835) .@enchant = 4863; //Fatal1Lv
  720. else if (.@i < 840) .@enchant = 4864; //Fatal2Lv
  721. else if (.@i < 850) .@enchant = 4832; //Expert Archer1
  722. else if (.@i < 860) .@enchant = 4813; //Spell3
  723. else if (.@i < 870) .@enchant = 4812; //Spell4
  724. else if (.@i < 875) .@enchant = 4826; //Spell5
  725. else if (.@i < 885) .@enchant = 4805; //Archbishop1Lv
  726. else if (.@i < 895) .@enchant = 4850; //Heal Amount2
  727. else if (.@i < 905) .@enchant = 4809; //Fighting Spirit3
  728. else if (.@i < 915) .@enchant = 4808; //Fighting Spirit4
  729. else .@enchant = 4820; //Fighting Spirit5
  730. break;
  731. case 2: //Royal Physical Slot 3
  732. .@i = rand(225);
  733. if (.@i < 30) .@enchant = 4809; //Fighting Spirit3
  734. else if (.@i < 60) .@enchant = 4808; //Fighting Spirit4
  735. else if (.@i < 70) .@enchant = 4820; //Fighting Spirit5
  736. else if (.@i < 80) .@enchant = 4821; //Fighting Spirit6
  737. else if (.@i < 85) .@enchant = 4822; //Fighting Spirit7
  738. else if (.@i < 115) .@enchant = 4818; //Sharp1
  739. else if (.@i < 145) .@enchant = 4817; //Sharp2
  740. else if (.@i < 155) .@enchant = 4816; //Sharp3
  741. else if (.@i < 165) .@enchant = 4843; //Sharp4
  742. else if (.@i < 170) .@enchant = 4844; //Sharp5
  743. else if (.@i < 200) .@enchant = 4819; //Atk1
  744. else if (.@i < 210) .@enchant = 4766; //ATK+2%
  745. else if (.@i < 215) .@enchant = 4767; //ATK+3%
  746. else if (.@i < 220) .@enchant = 4807; //Atk Speed1
  747. else .@enchant = 4842; //Atk Speed2
  748. break;
  749. case 3: //Royal Physical Slot 4
  750. .@i = rand(375);
  751. if (.@i < 50) .@enchant = 4702; //STR+3
  752. else if (.@i < 100) .@enchant = 4703; //STR+4
  753. else if (.@i < 110) .@enchant = 4704; //STR+5
  754. else if (.@i < 120) .@enchant = 4705; //STR+6
  755. else if (.@i < 125) .@enchant = 4706; //STR+7
  756. else if (.@i < 175) .@enchant = 4732; //AGI+3
  757. else if (.@i < 225) .@enchant = 4733; //AGI+4
  758. else if (.@i < 235) .@enchant = 4734; //AGI+5
  759. else if (.@i < 245) .@enchant = 4735; //AGI+6
  760. else if (.@i < 250) .@enchant = 4736; //AGI+7
  761. else if (.@i < 300) .@enchant = 4742; //VIT+3
  762. else if (.@i < 350) .@enchant = 4743; //VIT+4
  763. else if (.@i < 360) .@enchant = 4744; //VIT+5
  764. else if (.@i < 370) .@enchant = 4745; //VIT+6
  765. else .@enchant = 4746; //VIT+7
  766. break;
  767. case 4: //Royal Magical Slot 3
  768. .@i = rand(230);
  769. if (.@i < 30) .@enchant = 4813; //Spell3
  770. else if (.@i < 60) .@enchant = 4812; //Spell4
  771. else if (.@i < 70) .@enchant = 4826; //Spell5
  772. else if (.@i < 80) .@enchant = 4827; //Spell6
  773. else if (.@i < 85) .@enchant = 4828; //Spell7
  774. else if (.@i < 115) .@enchant = 4929; //MSP+1%
  775. else if (.@i < 145) .@enchant = 4805; //Archbishop1Lv
  776. else if (.@i < 155) .@enchant = 4850; //Archbishop2Lv
  777. else if (.@i < 165) .@enchant = 4851; //Archbishop3Lv
  778. else if (.@i < 170) .@enchant = 4852; //Archbishop4Lv
  779. else if (.@i < 200) .@enchant = 4883; //MATK + 1%
  780. else if (.@i < 210) .@enchant = 4896; //MATK + 2%
  781. else if (.@i < 215) .@enchant = 4897; //MATK + 3%
  782. else if (.@i < 225) .@enchant = 4760; //MATK 1Lv
  783. else .@enchant = 4761; //MATK 2Lv
  784. break;
  785. case 5: //Royal Magical Slot 4
  786. .@i = rand(375);
  787. if (.@i < 50) .@enchant = 4712; //INT+3
  788. else if (.@i < 100) .@enchant = 4713; //INT+4
  789. else if (.@i < 110) .@enchant = 4714; //INT+5
  790. else if (.@i < 120) .@enchant = 4715; //INT+6
  791. else if (.@i < 125) .@enchant = 4716; //INT+7
  792. else if (.@i < 175) .@enchant = 4722; //DEX+3
  793. else if (.@i < 225) .@enchant = 4723; //DEX+4
  794. else if (.@i < 235) .@enchant = 4724; //DEX+5
  795. else if (.@i < 245) .@enchant = 4725; //DEX+6
  796. else if (.@i < 250) .@enchant = 4726; //DEX+7
  797. else if (.@i < 300) .@enchant = 4742; //VIT+3
  798. else if (.@i < 350) .@enchant = 4743; //VIT+4
  799. else if (.@i < 360) .@enchant = 4744; //VIT+5
  800. else if (.@i < 370) .@enchant = 4745; //VIT+6
  801. else .@enchant = 4746; //VIT+7
  802. break;
  803. case 6: //Royal Ranged Slot 3
  804. .@i = rand(225);
  805. if (.@i < 30) .@enchant = 29047; //Fatal
  806. else if (.@i < 60) .@enchant = 4863; //Fatal1Lv
  807. else if (.@i < 70) .@enchant = 4864; //Fatal2Lv
  808. else if (.@i < 80) .@enchant = 4865; //Fatal3Lv
  809. else if (.@i < 85) .@enchant = 4866; //Fatal4Lv
  810. else if (.@i < 115) .@enchant = 4818; //Sharp1
  811. else if (.@i < 145) .@enchant = 4817; //Sharp2
  812. else if (.@i < 155) .@enchant = 4816; //Sharp3
  813. else if (.@i < 165) .@enchant = 4843; //Sharp4
  814. else if (.@i < 170) .@enchant = 4844; //Sharp5
  815. else if (.@i < 200) .@enchant = 4832; //Expert Archer1
  816. else if (.@i < 210) .@enchant = 4833; //Expert Archer2
  817. else if (.@i < 215) .@enchant = 4834; //Expert Archer3
  818. else if (.@i < 220) .@enchant = 4807; //Atk Speed1
  819. else .@enchant = 4842; //Atk Speed2
  820. break;
  821. case 7: //Royal Ranged Slot 4
  822. .@i = rand(375);
  823. if (.@i < 50) .@enchant = 4732; //AGI+3
  824. else if (.@i < 100) .@enchant = 4733; //AGI+4
  825. else if (.@i < 110) .@enchant = 4734; //AGI+5
  826. else if (.@i < 120) .@enchant = 4735; //AGI+6
  827. else if (.@i < 125) .@enchant = 4736; //AGI+7
  828. else if (.@i < 175) .@enchant = 4722; //DEX+3
  829. else if (.@i < 225) .@enchant = 4723; //DEX+4
  830. else if (.@i < 235) .@enchant = 4724; //DEX+5
  831. else if (.@i < 245) .@enchant = 4725; //DEX+6
  832. else if (.@i < 250) .@enchant = 4726; //DEX+7
  833. else if (.@i < 300) .@enchant = 4752; //LUK+3
  834. else if (.@i < 350) .@enchant = 4753; //LUK+4
  835. else if (.@i < 360) .@enchant = 4754; //LUK+5
  836. else if (.@i < 370) .@enchant = 4755; //LUK+6
  837. else .@enchant = 4756; //LUK+7
  838. break;
  839. }
  840. return .@enchant;
  841. }
  842. }