yuhsing

Untitled

Nov 25th, 2012
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 125.24 KB | None | 0 0
  1. //===== eAthena Script ============================================
  2. //= Recruiter
  3. //===== By: =======================================================
  4. //= Kenedos (FlowFallFlakes)
  5. //===== Current Version: ==========================================
  6. //= 2.0
  7. //===== Compatible With: ==========================================
  8. //= eAthena 14214+ Trunk TXT/SQL
  9. //===== Description: ==============================================
  10. //= Lists party, or guild registries, allowing people to
  11. //= Join party/guilds with certain ease.
  12. //===== Topic =====================================================
  13. //= http://www.eathena.ws/board/index.php?showtopic=242306
  14. //===== Additional Comments: ======================================
  15. //= Added guild-part, reorganized party-part.
  16. //= Please report any further bugs you find.
  17. //= Special thanks to AnnieRuru, Zippy, Z3R0, alexxdls and every other eA
  18. //= scripter for their hard work helping us newbies, and for making guides
  19. //= that contribute to everyone.
  20. //=================================================================
  21.  
  22. prontera,158,188,5 script Recruiter#h1-0 758,{
  23.  
  24.  
  25. // ------------------------------------------------------
  26. // | ____ __ __ _ |
  27. // | / __/__ / /_/ /_(_)__ ___ ____ |
  28. // | _\ \/ -_) __/ __/ / _ \/ _ `(_-< |
  29. // | /___/\__/\__/\__/_/_//_/\_, /___/ |
  30. // | /___/ |
  31. // | |
  32. // ------------------------------------------------------
  33.  
  34. // --------------------------------------------------------------------------------
  35. // ------------------------------- Party Side -------------------------------------
  36. // --------------------------------------------------------------------------------
  37.  
  38. //Max character base level for the party part of the script.
  39. //Default : 99
  40. set .@maxservlvl, 99;
  41.  
  42. //Input the maximum ammount of parties in the list (If you set this too high, it may overload your server!)
  43. //Default : 30
  44. set .@maxptnum, 30;
  45.  
  46. //Input the delay (in seconds) between announcements for both leader and members. (the "Charname wants to join your party" message.)
  47. //Default : 30
  48. set @announcecd, 30;
  49.  
  50. //Input 1 for true and 0 for false.
  51. //This will allow players to change their settings, to show or hide any of the 3 parameters bellow.
  52. //Default: 1
  53. set .@allowchange,1;
  54.  
  55. //Ignore this part -------
  56. if (0) {
  57. // -----------------------
  58.  
  59. //This will display party member's level in the "List Members" option
  60. //Default : 1
  61. set .list0, 1;
  62.  
  63. //This will display the party member's job in the "List Members" option
  64. //Default : 1
  65. set .list1, 1;
  66.  
  67. //This will display the party member's location in the "List Members" option
  68. //Default : 0
  69. set .list2, 0;
  70.  
  71.  
  72. }// -------------------------------------------------------------------------------
  73. // ------------------------------- Guild Side -------------------------------------
  74. // --------------------------------------------------------------------------------
  75.  
  76. //Max number of guild registries (If you set this too high, it may overload your server!)
  77. //Default : 30
  78. set .maxgnum, 30;
  79.  
  80. //Max number of guild objectives
  81. //Default : 3
  82. //Maximum : 6
  83. set .@objnum, 6;
  84.  
  85. //Max level of guild members
  86. //Default : 99
  87. set .@maxglvl, 99;
  88.  
  89. //If your server has third classes, set to 1, otherwise, set to 0.
  90. //Default : 0
  91. set .@gthird, 1;
  92.  
  93. //Max number of jobs chosen generally
  94. //Default : 3
  95. //Maximum : 6
  96. set .@jobnum1, 6;
  97.  
  98. //Max number of jobs chosen specifically
  99. //Default : 6
  100. //Maximum : 18
  101. set .@jobnum2, 18;
  102.  
  103. //Max numer of items in item requirement list
  104. //Default : 3
  105. set .@gmaxitem, 10;
  106.  
  107. //Cooldown of Leader and Member announcements
  108. //Default : 30
  109. set .gannocd, 30;
  110.  
  111. //Answer time for Guild Leader warps.
  112. //Default : 10
  113. set .gwdelay, 10;
  114.  
  115. //Wait time for Map Search and List Members (Sleep time)
  116. //The higher, the longer it will take to calculate those functions.
  117. //but also will lag less your server.
  118. //WARNING : Setting this too low will CRASH your server.
  119. //Minimum : 10
  120. //Default : 15
  121. set .sleeptime, 15;
  122.  
  123. //Initial Bitmask Option (Must be a potency of 2)
  124. //Default : 7859
  125. //Maximum : 16383
  126. set .@bitmask, 7859;
  127.  
  128. //Max Bitmask Options (Do not mess with this unless you know what you are doing!)
  129. //Default : 8192
  130. set .maxbit, 8192;
  131.  
  132. //Max Bitmask Number (Do not mess with this unless you know what you are doing!)
  133. //Default : 14
  134. set .maxbitn, 14;
  135.  
  136. // --------------------------------------------------------------------------------
  137. // ----------------------------- End of Settings ----------------------------------
  138. // --------------------------------------------------------------------------------
  139.  
  140. if (.reload == 1 ) {
  141. mes "["+strnpcinfo(1)+"]";
  142. mes "Please wait, this npc is still being ^0000FFLoaded^000000. This may happen after server restarts or npc reloads.";
  143. close;
  144. }
  145.  
  146. mes "["+strnpcinfo(1)+"]";
  147. mes "Welcome! I'm here to offer you the ^009900Party^000000 and ^FF0000Guild^000000 Recruiting services. Wich kind of service are you interested in?";
  148. next;
  149.  
  150. L_start:
  151.  
  152. switch (select ("Party Function:Guild Function")) {
  153. case 1:
  154.  
  155. //Check for a player inside a party, but not party leader.
  156. if (getcharid(1) != 0) {
  157. if ( getpartyleader(getcharid(1),2) != getcharid(0) ){
  158. mes "[Party Warper]";
  159. mes "Sorry but you are already inside a party.";
  160. close;
  161. }
  162. }
  163.  
  164. if (getcharid(1) == 0) {
  165. mes "["+strnpcinfo(1)+"]";
  166. mes "Looking for a party? Let me check the list of avaible parties for you...";
  167. next;
  168. }
  169.  
  170. for (set .@dyn,0; .@dyn<.@maxptnum; set .@dyn,.@dyn+1){
  171. if (getd("puprdy"+.@dyn) == 1){
  172. if (getcharid(1) == 0)
  173. setd "puprdy"+.@dyn,0;
  174. else if ((getpartyleader(getcharid(1))) != (getd(".partyinfo"+.@dyn+"$[4]")))
  175. setd "puprdy"+.@dyn,0;
  176. else if (getcharid(1,strcharinfo(0)) != getd(".partyinfo"+.@dyn+"[0]")) {
  177. //there is a deletearray here to retain from a player creating a party, leaving the party and before anyone talks to the npc he remakes another party and re-recruit. this deletearray here is to prevent this bug.
  178. setd "puprdy"+.@dyn,0;
  179. deletearray getd(".partyinfo"+.@dyn+"$");
  180. deletearray getd(".partyinfo"+.@dyn);
  181. }
  182. }
  183. }
  184.  
  185. set .@leaderid, getpartyleader(getcharid(1),2);
  186.  
  187. if(.@leaderid == getcharid(0)){
  188. for (set .@k,0;.@k<.@maxptnum;set .@k,.@k+1){
  189. if (getd("puprdy"+.@k) == 1){
  190. mes "["+strnpcinfo(1)+"]";
  191. mes "You already registered a party.";
  192. close;
  193. }
  194. }
  195. mes "["+strnpcinfo(1)+"]";
  196. mes "Would you like to register your party for recruiting new members?";
  197. if (select ("Yes:No") == 2)
  198. close;
  199. set @plevel$,"Any";
  200. set @plocation$,"Any";
  201. set @pjob$,"Any";
  202. set @pobj$,"Any";
  203. set @pname$,strcharinfo(1);
  204. set @pequip1,32767;
  205. set @pequip2,32767;
  206. set @pequip3,32767;
  207. while (1) {
  208. if (.@breakeq)
  209. set .@breakeq,0;
  210. next;
  211. mes "["+strnpcinfo(1)+"]";
  212. mes "Please fill the information for ^0000FF"+strcharinfo(1)+"^000000 party";
  213. switch (select ("Objective (^FF0000"+@pobj$+"^000000):Level (^FF0000"+@plevel$+"^000000):Location (^FF0000"+@plocation$+"^000000):Jobs (^FF0000"+@pjob$+"^000000):Equips:^00AA00Complete^000000") ) {
  214. case 1:
  215. next;
  216. mes "["+strnpcinfo(1)+"]";
  217. mes "Please select the objective of your party";
  218. switch ( select ("Any:Leveling:Item Hunting:MVPing:PVPing:Role-Playing:Cancel") ) {
  219. case 1:
  220. set @pobj$,"Any";
  221. break;
  222. case 2:
  223. set @pobj$,"Leveling";
  224. break;
  225. case 3:
  226. set @pobj$,"Item Hunting";
  227. break;
  228. case 4:
  229. set @pobj$,"MVPing";
  230. break;
  231. case 5:
  232. set @pobj$,"PVPing";
  233. break;
  234. case 6:
  235. set @pobj$,"Role-Playing";
  236. break;
  237. case 7:
  238. break;
  239. }
  240. break;
  241.  
  242. case 2:
  243. next;
  244. //ATTENTION : the maximum level is 99 by default! change this in the beggining of the script!
  245. mes "["+strnpcinfo(1)+"]";
  246. mes "Please input the minimum level requirement";
  247. input @pminlvl;
  248. if ((@pminlvl > .@maxservlvl ) || ( @pminlvl < 1 )) {
  249. next;
  250. mes "["+strnpcinfo(1)+"]";
  251. mes "Sorry but the minimum level requirement is invalid.";
  252. break;
  253. }
  254. next;
  255. mes "["+strnpcinfo(1)+"]";
  256. mes "Please input the maximum level requirement";
  257. input @pmaxlvl;
  258. if ((@pmaxlvl > .@maxservlvl ) || ( @pmaxlvl < 1 ) || (@pminlvl >= @pmaxlvl)) {
  259. next;
  260. mes "["+strnpcinfo(1)+"]";
  261. mes "Sorry but the maximum level requirement is invalid.";
  262. break;
  263. }
  264. set @plevel$,""+@pminlvl+"~"+@pmaxlvl+"";
  265. break;
  266.  
  267. case 3:
  268. next;
  269. mes "["+strnpcinfo(1)+"]";
  270. mes "Please enter the party location";
  271. menu "Any",-,"Fields",field,"Dungeons",dungeon,"Instanced Dungeons",indun,"Cancel",premenu;
  272. set @plocation$,"Any";
  273. break;
  274.  
  275. indun:
  276. menu "Endless Tower",in1,"Orc Memorial Dungeon",in2,"Sealed Shrine",in3,"Quest Dungeons",inquest,"Cancel",premenu;
  277.  
  278. field:
  279. menu "Amatsu Fields",wamafild,
  280. "Ayothaya Fields",wayofild,
  281. "Bifrost Fields",wbiffild,
  282. "Brasilis Fields",wbrfild,
  283. "Comodo Fields",wcmdfild,
  284. "Descates Fields",wdescatesfild,
  285. "Einbroch Fields",weinfild,
  286. "Geffen Fields",wgeffild,
  287. "Gonryun Fields",wgonfild,
  288. "Hugel Fields",whufild,
  289. "Lighthalzen Fields",wlhzfild,
  290. "Louyang Field",wloufild,
  291. "Lutie Field",wxmasfild,
  292. "Manuk Fields",wmanukfild,
  293. "Mjolnir Fields",wmjolnir,
  294. "Moscovia Fields",wmosc,
  295. "Niflheim Fields",wniffild,
  296. "Odin Temple",wodint,
  297. "Payon Forests",wpayfor,
  298. "Prontera Fields",wprtfild,
  299. "Rachel Fields",warunfild,
  300. "Sograt Deserts",wmocfild,
  301. "Umbala Fields",wumfild,
  302. "Veins Fields",wveinsfild,
  303. "Yuno Fields",wyunofild,
  304. "Cancel",premenu;
  305.  
  306. dungeon:
  307. menu "Abbey, Cursed Monastery",wabbey,
  308. "Abyss Lakes",wabyss,
  309. "Amatsu Dungeon",ama,
  310. "Anthell",ant,
  311. "Ayothaya Dungeons",wayodun,
  312. "Beach Dungeon",beach,
  313. "Byalan Dungeon",byalan,
  314. "Brasilis Dungeon",toilet,
  315. "Clock Tower",clock,
  316. "Coal Mines",coal,
  317. "Culverts",culvert,
  318. "Einbroch Dungeons",weindun,
  319. "Gefenia",gefenia,
  320. "Geffen Dungeon",geffen,
  321. "Glast Heim",glast,
  322. "Gonryun Dungeon",gon,
  323. "Hidden Dungeon",hidden,
  324. "Ice Dungeon",iced,
  325. "Juperos Dungeons",wjuper,
  326. "Kiel Dungeons",wkieldun,
  327. "Lighthalzen",wlhzdun,
  328. "Louyang Dungeons",wloudun,
  329. "Magma Dungeon",magma,
  330. "Moscovia Dungeon",wmosk,
  331. "Niddhogr Dungeon",niddhogr,
  332. "Orc Dungeon",orc,
  333. "Payon Dungeon",payon,
  334. "Pyramids",pyramids,
  335. "Rachel Sanctuary",rachels,
  336. "Scaraba Hole",scaraba,
  337. "Sphinx",sphinx,
  338. "Sunken Ship",sunken,
  339. "Thanatos Tower",wthat,
  340. "Thor Volcano",wthor,
  341. "Toy Factory",toy,
  342. "Turtle Dungeon",turtle,
  343. "Umbala Dungeons",wumdun,
  344. "Dimensonal Gorge",dimen,
  345. "Cancel",premenu;
  346.  
  347. premenu:
  348. break;
  349.  
  350. wamafild:
  351. set @plocation$,"Amatsu Field";
  352.  
  353. break;
  354. wayofild:
  355. set @plocation$,"Ayothaya Field";
  356.  
  357. break;
  358. wbiffild:
  359. //attention! this field is new, it may bug ur server
  360. set @plocation$,"Bifrost Field";
  361.  
  362. break;
  363. wbrfild:
  364. set @plocation$,"Brasilis Field";
  365.  
  366. break;
  367. wcmdfild:
  368. set @plocation$,"Comodo Field";
  369.  
  370. break;
  371. wdescatesfild:
  372. set @plocation$,"Descates Field";
  373.  
  374. break;
  375. weinfild:
  376. set @plocation$,"Einbroch Field";
  377.  
  378. break;
  379. wgeffild:
  380. set @plocation$,"Geffen Field";
  381.  
  382. break;
  383. wgonfild:
  384. set @plocation$,"Gonryun Field";
  385.  
  386. break;
  387. whufild:
  388. set @plocation$,"Hugel Fields";
  389.  
  390. break;
  391. wlhzfild:
  392. set @plocation$,"Lighthalzen Fields";
  393.  
  394. break;
  395. wloufild:
  396. set @plocation$,"Louyang Fields";
  397.  
  398. break;
  399. wxmasfild:
  400. set @plocation$,"Lutie Fields";
  401.  
  402. break;
  403. wmanukfild:
  404. set @plocation$,"Manuk Fields";
  405.  
  406. break;
  407. wmjolnir:
  408. set @plocation$,"Mjolnir Fields";
  409.  
  410. break;
  411. wmosc:
  412. set @plocation$,"Moscovia Fields";
  413.  
  414. break;
  415. wniffild:
  416. set @plocation$,"Nifflheim Fields";
  417.  
  418. break;
  419. wodint:
  420. set @plocation$,"Odin Temple";
  421.  
  422. break;
  423. wpayfor:
  424. set @plocation$,"Payon Forests";
  425.  
  426. break;
  427. wprtfild:
  428. set @plocation$,"Prontera Fields";
  429.  
  430. break;
  431. warunfild:
  432. set @plocation$,"Rachel Fields";
  433.  
  434. break;
  435. wmocfild:
  436. set @plocation$,"Sograt Deserts";
  437.  
  438. break;
  439. wumfild:
  440. set @plocation$,"Umbala Fields";
  441.  
  442. break;
  443. wveinsfild:
  444. set @plocation$,"Veins Fields";
  445.  
  446. break;
  447. wyunofild:
  448. set @plocation$,"Yuno Fields";
  449.  
  450. break;
  451.  
  452. //Dungeons -------------------------------------
  453.  
  454. wabbey:
  455. set @plocation$,"Cursed Abbey";
  456.  
  457. break;
  458. wabyss:
  459. set @plocation$,"Abyss Lakes";
  460.  
  461. break;
  462. ama:
  463. set @plocation$,"Amatsu Dungeon";
  464.  
  465. break;
  466. ant:
  467. set @plocation$,"Anthell";
  468.  
  469. break;
  470. wayodun:
  471. set @plocation$,"Ayothaya Dungeon";
  472.  
  473. break;
  474. beach:
  475. set @plocation$,"Beach Dungeon";
  476.  
  477. break;
  478. byalan:
  479. set @plocation$,"Byalan Dungeon";
  480.  
  481. break;
  482. toilet:
  483. set @plocation$,"Brasilis Dungeon";
  484.  
  485. break;
  486. clock:
  487. set @plocation$,"Clock Tower";
  488.  
  489. break;
  490. coal:
  491. set @plocation$,"Coal Mines";
  492.  
  493. break;
  494. culvert:
  495. set @plocation$,"Culvert";
  496.  
  497. break;
  498. weindun:
  499. set @plocation$,"Einbroch Dungeon";
  500.  
  501. break;
  502. gefenia:
  503. set @plocation$,"Gefenia";
  504.  
  505. break;
  506. geffen:
  507. set @plocation$,"Geffen Dungeon";
  508.  
  509. break;
  510. glast:
  511. set @plocation$,"Glast Heim";
  512.  
  513. break;
  514. gon:
  515. set @plocation$,"Gonryun Dungeon";
  516.  
  517. break;
  518. hidden:
  519. set @plocation$,"Hidden Temple";
  520.  
  521. break;
  522. iced:
  523. set @plocation$,"Ice Dungeon";
  524.  
  525. break;
  526. wjuper:
  527. set @plocation$,"Juperos";
  528.  
  529. break;
  530. wkieldun:
  531. set @plocation$,"Kiel Dungeon";
  532.  
  533. break;
  534. wlhzdun:
  535. set @plocation$,"Lighthalzen Dungeon";
  536.  
  537. break;
  538. wloudun:
  539. set @plocation$,"Louyang Dungeon";
  540.  
  541. //oh my god i cant take it anymore
  542. break;
  543. magma:
  544. set @plocation$,"Magma Dungeon";
  545.  
  546. break;
  547. wmosk:
  548. set @plocation$,"Moscovia Dungeon";
  549.  
  550. break;
  551. niddhogr:
  552. set @plocation$,"Niddhogr Dungeon";
  553.  
  554. break;
  555. orc:
  556. set @plocation$,"Orc Dungeon";
  557.  
  558. break;
  559. payon:
  560. set @plocation$,"Payon Dungeon";
  561.  
  562. break;
  563. pyramids:
  564. set @plocation$,"Pyramids";
  565.  
  566. break;
  567. rachels:
  568. set @plocation$,"Rachel Sanctuary";
  569.  
  570. break;
  571. scaraba:
  572. set @plocation$,"Scaraba Hole";
  573.  
  574. break;
  575. sphinx:
  576. set @plocation$,"Sphinx";
  577.  
  578. break;
  579. sunken:
  580. set @plocation$,"Sunken Ship";
  581.  
  582. break;
  583. wthat:
  584. set @plocation$,"Thanatos Tower";
  585.  
  586. break;
  587. wthor:
  588. set @plocation$,"Thors Volcano";
  589.  
  590. break;
  591. toy:
  592. set @plocation$,"Toy Factory";
  593.  
  594. break;
  595. turtle:
  596. set @plocation$,"Turtle Dungeon";
  597.  
  598. break;
  599. wumdun:
  600. set @plocation$,"Umbala Dungeon";
  601.  
  602. break;
  603. dimen:
  604. set @plocation$,"Dimensional Gorge";
  605.  
  606. break;
  607.  
  608.  
  609. //Instances -----------------------------------
  610.  
  611. in1:
  612. set @plocation$,"Endless Tower";
  613.  
  614. break;
  615. in2:
  616. set @plocation$,"Orc Memorial Dungeon";
  617.  
  618. break;
  619. in3:
  620. set @plocation$,"Sealed Shrine";
  621.  
  622. break;
  623.  
  624. inquest:
  625. set @plocation$,"Quest Dungeons";
  626.  
  627. break;
  628.  
  629. case 4:
  630. next;
  631. mes "["+strnpcinfo(1)+"]";
  632. mes "The current jobs are (^FF0000"+@pjob$+"^000000)";
  633. mes "Please select the jobs you want";
  634. menu "Any",anyj,"Damage Dealers",dd,"Tankers",tanker,"Mobbers",mobber,"Spellcasters",spell,"Healers",healer,"Supports",support,"Cancel",-;
  635. break;
  636.  
  637. anyj:
  638. set @pjob$,"Any";
  639. break;
  640.  
  641. dd:
  642. set @pjob$,"Damage Dealers";
  643. break;
  644.  
  645. tanker:
  646. set @pjob$,"Tankers";
  647. break;
  648.  
  649. mobber:
  650. set @pjob$,"Mobbers";
  651. break;
  652.  
  653. spell:
  654. set @pjob$,"Spellcasters";
  655. break;
  656.  
  657. healer:
  658. set @pjob$,"Healers";
  659. break;
  660.  
  661. support:
  662. set @pjob$,"Supports";
  663. break;
  664.  
  665. case 5:
  666. while (1) {
  667. if (.@breakeq)
  668. break;
  669. next;
  670. mes "["+strnpcinfo(1)+"]";
  671. mes "Current required equipment list is:";
  672. mes "Item 1: ^FF0000"+getitemname(@pequip1)+"^000000";
  673. mes "Item 2: ^0000FF"+getitemname(@pequip2)+"^000000";
  674. mes "Item 3: ^009900"+getitemname(@pequip3)+"^000000";
  675. switch ( select ("Add Item:Remove Item:Back") ) {
  676.  
  677. case 1:
  678. next;
  679. mes "["+strnpcinfo(1)+"]";
  680. mes "Input the item ID";
  681. input @pequip,0,32767;
  682. if (getitemname(@pequip)=="null"){
  683. mes "["+strnpcinfo(1)+"]";
  684. mes "Invalid Item!";
  685. break;
  686. }
  687. if (getitemname(@pequip1)=="null") set @pequip1,@pequip;
  688. else if (getitemname(@pequip2)=="null") set @pequip2,@pequip;
  689. else if (getitemname(@pequip3)=="null") set @pequip3,@pequip;
  690. else {
  691. mes "["+strnpcinfo(1)+"]";
  692. mes "All Item Slots are full!";
  693. next;
  694. }
  695. break;
  696.  
  697. case 2:
  698. next;
  699. mes "["+strnpcinfo(1)+"]";
  700. mes "Wich item would you like to remove?";
  701. switch ( select("^FF0000"+getitemname(@pequip1)+"^000000:^0000FF"+getitemname(@pequip2)+"^000000:^009900"+getitemname(@pequip3)+"^000000:Cancel") ) {
  702. case 1:
  703. set @pequip1,32767;
  704. break;
  705. case 2:
  706. set @pequip2,32767;
  707. break;
  708. case 3:
  709. set @pequip3,32767;
  710. break;
  711. case 4:
  712. break;
  713. }
  714. break;
  715.  
  716. case 3:
  717. set .@breakeq,1;
  718. break;
  719. }
  720. }
  721. break;
  722.  
  723. case 6:
  724. next;
  725. //thanks to alexxdls for the dynamic variables idea!
  726. for (set .@i,0; .@i <.@maxptnum ; set .@i, .@i + 1 ) {
  727. if (getarraysize(getd(".partyinfo"+.@i+"$")) == 0) {
  728. set @pleadername$,strcharinfo(0);
  729. set @partyid,getcharid(1,strcharinfo(0));
  730. setd ".partyinfo"+.@i+"$[0]",@pname$;
  731. setd ".partyinfo"+.@i+"$[1]",@plevel$;
  732. setd ".partyinfo"+.@i+"$[2]",@plocation$;
  733. setd ".partyinfo"+.@i+"$[3]",@pjob$;
  734. setd ".partyinfo"+.@i+"$[4]",@pleadername$;
  735. setd ".partyinfo"+.@i+"$[5]",@pobj$;
  736. setd ".partyinfo"+.@i+"[0]",@partyid;
  737. setd ".partyinfo"+.@i+"[1]",@pequip1;
  738. setd ".partyinfo"+.@i+"[2]",@pequip2;
  739. setd ".partyinfo"+.@i+"[3]",@pequip3;
  740. setd "puprdy"+.@i,1;
  741. mes "["+strnpcinfo(1)+"]";
  742. mes "Your party has been added succesfully!";
  743. if (@pobj$ == "Any" ) announce @pname$ +" party level "+@plevel$+" for "+@plocation$+" location is recruiting "+@pjob$+" jobs!",bc_all,0x8080FF;
  744. else announce @pobj$+" : "+@pname$+" party level "+@plevel$+" for "+@plocation$+" location is recruiting "+@pjob$+" jobs!",bc_all,0x8080FF;
  745. break;
  746. }
  747.  
  748. if (.@i >= .@maxptnum) {
  749. mes "["+strnpcinfo(1)+"]";
  750. mes "Im sorry but all the slots for parties are filled up, please come back later";
  751. break;
  752. }
  753. }
  754. close;
  755. }
  756. }
  757. }
  758.  
  759. if (.@leaderid != getcharid(0)){
  760. L_return:
  761.  
  762.  
  763. //uses the function for this specific kind of restriction.
  764. set .@pupnow,99;
  765. for (set .@dyn,0; .@dyn<.@maxptnum; set .@dyn, .@dyn+1) {
  766. if (getarraysize(getd(".partyinfo"+.@dyn+"$")) != 0) {
  767. set .@restrict, callfunc ( "checkonline#pt1",.@pupnow,getd(".partyinfo"+.@dyn+"$[4]"),getd(".partyinfo"+.@dyn+"[0]") );
  768. if (.@restrict != 0) {
  769. deletearray getd(".partyinfo"+.@dyn+"$");
  770. deletearray getd(".partyinfo"+.@dyn);
  771. }
  772. }
  773. }
  774.  
  775. //Reorganizes arrays
  776. set .@w, 0;
  777. while (.@w < .@maxptnum) {
  778. if ( getarraysize(getd(".partyinfo"+.@w+"$")) != 0 ) {
  779. set .@i,.@w - 1;
  780. while ( .@i >= 0 ) {
  781. if (getarraysize(getd(".partyinfo"+.@i+"$")) == 0) {
  782. setd ".partyinfo"+.@i+"$[0]", getd(".partyinfo"+.@w+"$[0]");
  783. setd ".partyinfo"+.@i+"$[1]", getd(".partyinfo"+.@w+"$[1]");
  784. setd ".partyinfo"+.@i+"$[2]", getd(".partyinfo"+.@w+"$[2]");
  785. setd ".partyinfo"+.@i+"$[3]", getd(".partyinfo"+.@w+"$[3]");
  786. setd ".partyinfo"+.@i+"$[4]", getd(".partyinfo"+.@w+"$[4]");
  787. setd ".partyinfo"+.@i+"$[5]", getd(".partyinfo"+.@w+"$[5]");
  788. setd ".partyinfo"+.@i+"[0]", getd(".partyinfo"+.@w+"[0]");
  789. setd ".partyinfo"+.@i+"[1]", getd(".partyinfo"+.@w+"[1]");
  790. setd ".partyinfo"+.@i+"[2]", getd(".partyinfo"+.@w+"[2]");
  791. setd ".partyinfo"+.@i+"[3]", getd(".partyinfo"+.@w+"[3]");
  792. deletearray getd(".partyinfo"+.@w+"$");
  793. deletearray getd(".partyinfo"+.@w);
  794. }
  795. set .@i, .@i - 1;
  796. }
  797. }
  798. set .@w,.@w+1;
  799. }
  800.  
  801.  
  802.  
  803.  
  804.  
  805. //First dynamic menu try
  806. //Thanks to Z3R0 and AnnieRuru for their guides and assitance.
  807. set .menu$,"";
  808. set .@cn,0;
  809. for (set .@den,0; .@den<.@maxptnum; set .@den,.@den+1) {
  810. if ((getarraysize(getd(".partyinfo"+.@den+"$"))) != 0) {
  811. if (getcharid(0,getd(".partyinfo"+.@den+"$[4]")) == 0 ) {
  812. set .@menu$, .@menu$ + ":" + "Party- ^0000FF" + getd(".partyinfo"+.@den+"$") + " (^FF0000Off^000000)";
  813. set .@cn,.@cn+1;
  814. }
  815. else{
  816. set .@menu$, .@menu$ + ":" + "Party- ^0000FF" + getd(".partyinfo"+.@den+"$") + " (^009900On^000000)";
  817. set .@cn,.@cn+1;
  818. }
  819. }
  820.  
  821. }
  822. set .@cn,.@cn+2;
  823. set .@menu$, .@menu$ +":Cancel";
  824. if (.@menu$ == ":Cancel" ) {
  825. mes "["+strnpcinfo(1)+"]";
  826. mes "Im sorry but there are no parties avaible at the moment.";
  827. close;
  828. }
  829. mes "["+strnpcinfo(1)+"]";
  830. mes "Please select your party! Then I can provide you the information and functions related to your choice";
  831. set .@menu, select(.@menu$);
  832.  
  833. next;
  834. if (.@menu == .@cn) {
  835. mes "["+strnpcinfo(1)+"]";
  836. mes "Thanks for your time, may I help you with something else?";
  837. set .@menu$,"";
  838. next;
  839. goto L_start;
  840. }
  841. set .@pupnow, .@menu - 2;
  842. L_sameparty:
  843.  
  844. if (.@redop == 1) {
  845. mes "["+strnpcinfo(1)+"]";
  846. mes "That was the avaible list of party members. Would you like to do any other function related to this party?";
  847. set .@redop,0;
  848. next;
  849. }
  850.  
  851. set .@restrict, callfunc ( "checkonline#pt1",.@pupnow,getd(".partyinfo"+.@pupnow+"$[4]"),getd(".partyinfo"+.@pupnow+"[0]") );
  852. if (.@restrict != 0)
  853. goto L_ultimatecheck;
  854. for (set .@i,1;.@i<4;set .@i,.@i+1){
  855. if (getd(".partyinfo"+.@pupnow+"["+.@i+"]") < 32767){
  856. if (countitem (getd(".partyinfo"+.@pupnow+"["+.@i+"]")) < 1) {
  857. set .@poornoob,1;
  858. }
  859. }
  860. }
  861. if (.@poornoob == 1){
  862. mes "["+strnpcinfo(1)+"]";
  863. mes "Im sorry but you are missing the following items :";
  864. for (set .@i,1;.@i<4;set .@i,.@i+1){
  865. if (getd(".partyinfo"+.@pupnow+"["+.@i+"]") != 32767){
  866. mes "^0000FF"+getitemname(getelementofarray(getd(".partyinfo"+.@pupnow),.@i))+"^000000";
  867. }
  868. }
  869. close;
  870. }
  871. getmapxy (.@leadermap$,.@varx,.@vary,0,getelementofarray(getd(".partyinfo"+.@pupnow+"$"),4));
  872. mes "["+strnpcinfo(1)+"]";
  873. mes "Party Leader : ^FF9900"+getelementofarray(getd(".partyinfo"+.@pupnow+"$"),4)+"^000000";
  874. mes "Leader Location : ^FF0099"+.@leadermap$+" ^0099FF"+.@varx+" "+.@vary+"^000000";
  875. mes "Objective : ^339966"+getelementofarray(getd(".partyinfo"+.@pupnow+"$"),5)+"^000000";
  876. mes "Level : ^0000FF"+getelementofarray(getd(".partyinfo"+.@pupnow+"$"),1)+"^000000";
  877. mes "Location : ^FF0000"+getelementofarray(getd(".partyinfo"+.@pupnow+"$"),2)+"^000000";
  878. mes "Jobs : ^FF9900"+getelementofarray(getd(".partyinfo"+.@pupnow+"$"),3)+"^000000";
  879. getpartymember(getcharid(1,getelementofarray(getd(".partyinfo"+.@pupnow+"$"),4))); //Added in here to make sure it wont lose data (like it would make any difference >_>)
  880. mes "Party Members : ^FF9900"+$@partymembercount+"^000000";
  881. set .@tempname$,strcharinfo(0);
  882. menu "Announce to Leader",ano1,"Warp to Leader",wa1,"List Members",list1,"Cancel",-;
  883. next;
  884. set .@menu$,"";
  885. goto L_return;
  886.  
  887. ano1:
  888. //this re-check is made to not bug the script if the party leader logs out, changes party, or leaves party while the character speaking to the npc
  889. //is within the function selection menu.
  890. set .@restrict, callfunc ( "checkonline#pt1",.@pupnow,getd(".partyinfo"+.@pupnow+"$[4]"),getd(".partyinfo"+.@pupnow+"[0]") );
  891. if (.@restrict != 0) {
  892. next;
  893. goto L_ultimatecheck;
  894. }
  895. if (gettimetick(2) < p_announce) {
  896. next;
  897. mes "["+strnpcinfo(1)+"]";
  898. set @remainingt,p_announce-gettimetick(2);
  899. mes "Sorry but you must wait ^FF0000"+@remainingt+"^000000 more seconds to use this function again.";
  900. set .@menu$, "";
  901. next;
  902. goto L_return;
  903. }
  904. next;
  905. mes "["+strnpcinfo(1)+"]";
  906. mes "You have been announced to the party leader.";
  907. close2;
  908. set p_announce,gettimetick(2)+@announcecd;
  909. attachrid(getcharid(3,getd(".partyinfo"+.@pupnow+"$[4]")));
  910. announce ""+.@tempname$+" wants to join your party",bc_self,0x8080FF,0,0,0;
  911. end;
  912.  
  913. wa1:
  914. //this re-check is made to not bug the script if the party leader logs out, changes party, or leaves party while the character speaking to the npc
  915. //is within the function selection menu.
  916. set .@restrict, callfunc ( "checkonline#pt1",.@pupnow,getd(".partyinfo"+.@pupnow+"$[4]"),getd(".partyinfo"+.@pupnow+"[0]") );
  917. if (.@restrict != 0) {
  918. next;
  919. goto L_ultimatecheck;
  920. }
  921. warp .@leadermap$,.@varx,.@vary;
  922. end;
  923.  
  924. list1:
  925. //this re-check is made to not bug the script if the party leader logs out, changes party, or leaves party while the character speaking to the npc
  926. //is within the function selection menu.
  927. set .@restrict, callfunc ( "checkonline#pt1",.@pupnow,getd(".partyinfo"+.@pupnow+"$[4]"),getd(".partyinfo"+.@pupnow+"[0]") );
  928. if (.@restrict != 0) {
  929. next;
  930. goto L_ultimatecheck;
  931. }
  932. getpartymember(getcharid(1,getelementofarray(getd(".partyinfo"+.@pupnow+"$"),4)));
  933. set @partymembercount,$@partymembercount;
  934. copyarray @partymembername$[0],$@partymembername$[0],@partymembercount;
  935. set @count,0;
  936. if (.@allowchange == 1) {
  937. next;
  938. mes "["+strnpcinfo(1)+"]";
  939. set .@repeatoff,0;
  940. }
  941. L_DisplayMember:
  942. set .@menu2$,"";
  943. if (.@allowchange == 1)
  944. {
  945. if (.@repeatoff != 1)
  946. mes "Please select your settings for the party listing. The more settings you enable, the bigger the list will be.";
  947. set .@repeatoff,1;
  948. set .@menu2$, .@menu2$ +"List Members";
  949. for (set .@i,0; .@i<3 ; set .@i,.@i+1) {
  950. if (.@i == 0)
  951. set .@show$,"Lvl";
  952. if (.@i == 1)
  953. set .@show$,"Job";
  954. if (.@i == 2)
  955. set .@show$,"Location";
  956. if (getd(".list"+.@i) == 1)
  957. set .@menu2$, .@menu2$ + ":" + "Show "+.@show$+" (^009900On^000000)";
  958. else
  959. set .@menu2$, .@menu2$ + ":" + "Show "+.@show$+" (^FF0000Off^000000)";
  960. }
  961. set .@menu2$,.@menu2$ + ":Cancel";
  962. set .@menu2, select (.@menu2$);
  963. set .@menu2,.@menu2 - 2;
  964. }
  965. if ( (.@menu2 == -1) || (.@allowchange != 1) ) {
  966. next;
  967. mes "["+strnpcinfo(1)+"]";
  968. while (@count != @partymembercount) {
  969. set .@invokerrid,getcharid(3);
  970. if (getcharid(0,@partymembername$[@count]) != 0) {
  971. attachrid(getcharid(3,@partymembername$[@count]));
  972. if (.list0 == 1)
  973. set .@templevel,BaseLevel;
  974. if (.list1 == 1)
  975. set .@tjob$,jobname(Class);
  976. if (.list2 == 1)
  977. getmapxy .@tmap$,.@tx,.@ty,0;
  978. attachrid(.@invokerrid);
  979. mes (@count + 1) + " - ^3388FF" + @partymembername$[@count] + "^000000";
  980. if (.list0 == 1)
  981. mes "Lv: ^DD1100"+.@templevel+"^000000";
  982. if (.list1 == 1)
  983. mes "Job: ^CC9922"+.@tjob$+"^000000";
  984. if (.list2 == 1)
  985. mes "Location :^FF0099"+.@tmap$+"^000000 ^33DD66"+.@tx+"^000000, ^33DD66"+.@ty+"^000000";
  986. }
  987. else {
  988. mes (@count + 1) + " - ^3388FF" + @partymembername$[@count] + " ^000000(^FF0000Offline^000000)";
  989. }
  990. mes " ";
  991. set @count,@count+1;
  992. }
  993. L_DisplayMemberEnd:
  994. next;
  995. set .@menu$, "";
  996. set .@redop,1;
  997. goto L_sameparty;
  998. }
  999. if (.@allowchange == 1) {
  1000. for (set .@targ,0; .@targ < 3; set .@targ, .@targ+1) {
  1001. if (.@menu2 == .@targ) {
  1002. if (getd(".list"+.@targ) == 0)
  1003. setd ".list"+.@targ,1;
  1004. else
  1005. setd ".list"+.@targ,0;
  1006. goto L_DisplayMember;
  1007. }
  1008. }
  1009. }
  1010.  
  1011. if (.@allowchange == 1) {
  1012. if (.@menu2 == 3) {
  1013. next;
  1014. set .@menu$, "";
  1015. goto L_sameparty;
  1016. }
  1017. }
  1018. }
  1019.  
  1020. // --------------------------------------------------------------------------------------------------------
  1021. // _____ _ __ __ ___ _ __ __ |
  1022. // / ___/_ __(_) /__/ / / _ \___ __________ __(_) /___ _ ___ ___ / /_ |
  1023. // / (_ / // / / / _ / / , _/ -_) __/ __/ // / / __/ ' \/ -_) _ \/ __/ |
  1024. // \___/\_,_/_/_/\_,_/ /_/|_|\__/\__/_/ \_,_/_/\__/_/_/_/\__/_//_/\__/ |
  1025. // |
  1026. // --------------------------------------------------------------------------------------------------------
  1027.  
  1028. case 2:
  1029. while (1) {
  1030. if (getguildname(getcharid(2)) != "null") {
  1031. if ( getguildmaster (getcharid(2)) == strcharinfo(0) ) {
  1032. mes "["+strnpcinfo(1)+"]";
  1033. if (sex)
  1034. mes "Sir ^0000FF"+strcharinfo(0)+"^000000, how may I be of service?";
  1035. else
  1036. mes "Lady ^0000FF"+strcharinfo(0)+"^000000, how may I be of service?";
  1037. next;
  1038. switch ( select ("Create Recruitment:Modify Recruitment:Delete Recruitment:Cancel") ) {
  1039.  
  1040. //----------------------------------------------------------------------------------------------------------------------------------
  1041. //Create Registry Part -------------------------------------------------------------------------------------------------------------
  1042. // ---------------------------------------------------------------------------------------------------------------------------------
  1043. case 1:
  1044. //Check if you already registered.
  1045. for (set .@i,0; .@i < .maxgnum; set .@i, .@i + 1) {
  1046. if (getarraysize (getd(".guildinfo"+.@i)) != 0) {
  1047. if ( ( getd(".guildinfo"+.@i+"[1]") == getcharid(2) ) && (getguildmaster(getd(".guildinfo"+.@i+"[1]")) == strcharinfo(0)) ) {
  1048. mes "["+strnpcinfo(1)+"]";
  1049. mes "Im sorry but your guild is already registered.";
  1050. close;
  1051. }
  1052. }
  1053. }
  1054.  
  1055. while (1) {
  1056. if ( getguildmaster (getcharid(2)) == strcharinfo(0) ) {
  1057. set .@guildname$, strcharinfo(2);
  1058. mes "["+strnpcinfo(1)+"]";
  1059. mes "Please fill in the application for ^FF0000"+.@guildname$+"^000000 guild...";
  1060. next;
  1061. switch (select ("Objectives ( ^FF0000"+.@gobj$+"^000000):Description:Level ( ^FF0000"+.@glvl$+"^000000):Jobs:Equips:Display Options:^009900Complete^000000") ) {
  1062.  
  1063. case 1:
  1064. mes "["+strnpcinfo(1)+"]";
  1065. mes "You can write the objective, or the main focus of your guild.";
  1066. if (.@gobj$ == "") {
  1067. mes "The current objective is ^FF0000Empty^000000";
  1068. }
  1069. else {
  1070. mes "Current objective:";
  1071. mes "^FF0000"+.@gobj$+"^000000";
  1072. }
  1073. if (select ("Modify:Delete:Cancel") == 3) {
  1074. next;
  1075. break;
  1076. }
  1077. if (@menu == 2) {
  1078. next;
  1079. mes "["+strnpcinfo(1)+"]";
  1080. mes "The objective has been successfully deleted.";
  1081. set .@gobj$,"";
  1082. next;
  1083. break;
  1084. }
  1085. set .@gobj$, callfunc ("calcmenu#g1",6,.@objnum,"objectives","Level","MvP","WoE","Social","Event","Quest");
  1086. break;
  1087.  
  1088. case 2:
  1089. mes "["+strnpcinfo(1)+"]";
  1090. mes "You can input the description, comments, or additional info related to your guild.";
  1091. if (.@gdesc$ == "") {
  1092. mes "The current description is ^FF0000Empty^000000";
  1093. }
  1094. else {
  1095. mes "Current Description:";
  1096. mes "^FF0000"+.@gdesc$+"^000000";
  1097. }
  1098. if (select ("Modify:Delete:Cancel") == 3) {
  1099. next;
  1100. break;
  1101. }
  1102. if (@menu == 2) {
  1103. next;
  1104. mes "["+strnpcinfo(1)+"]";
  1105. mes "The description has been successfully deleted.";
  1106. set .@gdesc$,"";
  1107. next;
  1108. break;
  1109. }
  1110.  
  1111. set .@gdesc$,"";
  1112. for (set .@i,1; .@i < 4; set .@i, .@i + 1 )
  1113. set getd(".@gdesc"+.@i+"$"),"";
  1114. for (set .@i,1; .@i < 5 ; set .@i, .@i + 1 ) {
  1115. next;
  1116. mes "["+strnpcinfo(1)+"]";
  1117. if ( (.@i > 1) && (.@i < 4) )
  1118. mes "Would you like to write more information about your guild?";
  1119. else if (.@i == 1)
  1120. mes "Please write down the description of your guild.";
  1121. else if (.@i >= 4) {
  1122. mes "Thank you for writting the whole description for your guild.";
  1123. mes "Final Description:";
  1124. mes "^FF0000"+.@gdesc$+"^000000";
  1125. break;
  1126. }
  1127. if ( (.@i > 1) && (.@i < 4) ) {
  1128. mes "Current Description:";
  1129. mes "^FF0000"+.@gdesc$+"^000000";
  1130. if ( select ("Yes:No") == 2)
  1131. break;
  1132. }
  1133. input getd(".@gdesc"+.@i+"$");
  1134. set .@gdesc$,.@gdesc1$ + " " + .@gdesc2$ + " " + .@gdesc3$;
  1135. }
  1136. next;
  1137. break;
  1138.  
  1139. case 3:
  1140. mes "["+strnpcinfo(1)+"]";
  1141. mes "You can add the level range required to enter your guild.";
  1142. if (.@glvl$ == "")
  1143. mes "The current level is ^FF0000Empty^000000";
  1144. else
  1145. mes "Current level:";
  1146. mes "^FF0000"+.@glvl$+"^000000";
  1147. next;
  1148. if (select ("Modify:Delete:Cancel") == 3) break;
  1149. if (@menu == 2) {
  1150. next;
  1151. mes "["+strnpcinfo(1)+"]";
  1152. mes "The level has been successfully deleted.";
  1153. set .@glvl$,"";
  1154. next;
  1155. break;
  1156. }
  1157. mes "["+strnpcinfo(1)+"]";
  1158. mes "Please input the minimum level requirement.";
  1159. input .@gminlvl;
  1160. if ((.@gminlvl > .@maxglvl ) || ( .@gminlvl < 1 )) {
  1161. next;
  1162. mes "["+strnpcinfo(1)+"]";
  1163. mes "Sorry but the minimum level requirement is invalid.";
  1164. next;
  1165. break;
  1166. }
  1167. next;
  1168. mes "["+strnpcinfo(1)+"]";
  1169. mes "Please input the maximum level requirement.";
  1170. input .@gmaxlvl;
  1171. if ((.@gmaxlvl > .@maxglvl ) || ( .@gmaxlvl < 1 ) || (.@gminlvl > .@gmaxlvl)) {
  1172. next;
  1173. mes "["+strnpcinfo(1)+"]";
  1174. mes "Sorry but the maximum level requirement is invalid.";
  1175. next;
  1176. break;
  1177. }
  1178. set .@glvl$,""+.@gminlvl+"~"+.@gmaxlvl+" ";
  1179. next;
  1180. break;
  1181.  
  1182. case 4:
  1183. mes "["+strnpcinfo(1)+"]";
  1184. mes "You can add the jobs you're looking foward joining your guild.";
  1185. if (.@gjob$ != "") {
  1186. mes "Current jobs:";
  1187. mes "^FF0000"+.@gjob$+"^000000";
  1188. }
  1189. else
  1190. mes "The current job list is ^FF0000Empty^000000.";
  1191. next;
  1192. switch (select ("Modify:Delete:Cancel") ) {
  1193.  
  1194. case 1:
  1195. mes "["+strnpcinfo(1)+"]";
  1196. mes "Would you like to choose specifically or generally?";
  1197. next;
  1198. if (select ("Generally:Specifically") == 1) {
  1199. set .@gjob$, callfunc ("calcmenu#g1",6,.@jobnum1,"jobs","Damage-Dealers","Tankers","Mobbers","Spellcasters","Healers","Supports");
  1200. }
  1201. else {
  1202. if ( .@gthird )
  1203. set .@gjob$, callfunc ("calcmenu#g1",18,.@jobnum2,"jobs","Rune-Knights","Royal-Guards","Warlocks","Sorcerers","Rangers","Minstrels",
  1204. "Wanderers","Arch-Bishops","Suras","Mechanics","Genetics","Guillotine-Cross","Shadow-Chasers","Ninja","Gunslinger","Soul-Linker",
  1205. "Star-Gladiator","Super-Novice");
  1206. else
  1207. set .@gjob$, callfunc ("calcmenu#g1",18,.@jobnum2,"jobs","Lord-Knights","Paladins","High-Wizards","Professors","Snipers","Clowns",
  1208. "Gypsies","High-Priests","Champions","Whitesmiths","Creators","Assassin-Cross","Stalkers","Ninja","Gunslinger","Soul-Linker",
  1209. "Star-Gladiator","Super-Novice");
  1210. }
  1211. break;
  1212.  
  1213. case 2:
  1214. next;
  1215. mes "["+strnpcinfo(1)+"]";
  1216. mes "The job list has been succesfully deleted.";
  1217. set .@gjob$,"";
  1218. next;
  1219. break;
  1220.  
  1221. case 3:
  1222. break;
  1223.  
  1224. }
  1225. break;
  1226.  
  1227.  
  1228.  
  1229. case 5:
  1230. mes "["+strnpcinfo(1)+"]";
  1231. mes "You can write the required cards, equipment or items for your guild.";
  1232. mes "Current equipments:";
  1233. for (set .@i,1; .@i <= .@gmaxitem; set .@i,.@i + 1) {
  1234. if (getitemname(getd(".@gequip"+.@i))=="null") {
  1235. mes .@i+"- ^FF0000Empty^000000";
  1236. }
  1237. else {
  1238. mes .@i+"- ^0000FF"+getitemname(getd(".@gequip"+.@i))+"^000000";
  1239. }
  1240. }
  1241. if (select ("Modify:Delete:Cancel") == 3) {
  1242. next;
  1243. break;
  1244. }
  1245. if (@menu == 2) {
  1246. next;
  1247. mes "["+strnpcinfo(1)+"]";
  1248. mes "The equip list has been successfully deleted.";
  1249. for (set .@i,1; .@i <= .@gmaxitem; set .@i,.@i + 1) {
  1250. setd ".@gequip"+.@i,0;
  1251. }
  1252. set .@max,0;
  1253. next;
  1254. break;
  1255. }
  1256.  
  1257. while (1) {
  1258. if (.@breakeq) {
  1259. set .@breakeq,0;
  1260. break;
  1261. }
  1262. next;
  1263. mes "["+strnpcinfo(1)+"]";
  1264. mes "You can write the required cards, equipment or items for your guild.";
  1265. mes "Current equipments:";
  1266. for (set .@i,1; .@i <= .@gmaxitem; set .@i,.@i + 1) {
  1267. if (getitemname(getd(".@gequip"+.@i))=="null") {
  1268. mes .@i+"- ^FF0000Empty^000000";
  1269. }
  1270. else {
  1271. mes .@i+"- ^0000FF"+getitemname(getd(".@gequip"+.@i))+"^000000";
  1272. }
  1273. }
  1274.  
  1275. switch ( select ("Add Item:Remove Item:Back") ) {
  1276.  
  1277. case 1:
  1278. if (.@max == .@gmaxitem) {
  1279. next;
  1280. mes "["+strnpcinfo(1)+"]";
  1281. mes "All Item Slots are full!";
  1282. break;
  1283. }
  1284. next;
  1285. mes "["+strnpcinfo(1)+"]";
  1286. mes "Input the item ID";
  1287. input .@gequip,0,32767;
  1288. if (getitemname(.@gequip)=="null"){
  1289. next;
  1290. mes "["+strnpcinfo(1)+"]";
  1291. mes "Invalid Item!";
  1292. break;
  1293. }
  1294. for (set .@i,1; .@i <= .@gmaxitem; set .@i,.@i + 1) {
  1295. if (getitemname(getd(".@gequip"+.@i))=="null") {
  1296. setd ".@gequip"+.@i,.@gequip;
  1297. set .@max,.@max + 1;
  1298. for (set .@j, 1; .@j <= .@gmaxitem; set .@j,.@j + 1) {
  1299. if ( ( getitemname(getd(".@gequip"+.@i)) == getitemname(getd(".@gequip"+.@j)) ) && (.@i != .@j) && (getitemname(getd(".@gequip"+.@j)) != "null") ) {
  1300. next;
  1301. mes "["+strnpcinfo(1)+"]";
  1302. mes "This item is already in the list...";
  1303. setd ".@gequip"+.@i,0;
  1304. set .@max,.@max - 1;
  1305. break;
  1306. }
  1307. }
  1308. break;
  1309. }
  1310. }
  1311. break;
  1312.  
  1313. case 2:
  1314. next;
  1315. mes "["+strnpcinfo(1)+"]";
  1316. mes "Let me check the avaible item list...";
  1317. set .@menu4$,"";
  1318. for (set .@i,1; .@i <= .@gmaxitem; set .@i,.@i + 1) {
  1319. if ( getitemname(getd(".@gequip"+.@i)) != "null" ) {
  1320. set .@menu4$, .@menu4$ + ":" + .@i + "- ^0000FF"+getitemname(getd(".@gequip"+.@i))+"^000000";
  1321. set .@cncheck,.@cncheck + 1;
  1322. }
  1323. }
  1324. set .@menu4$,.@menu4$ + ":Cancel";
  1325. set .@cncheck,.@cncheck + 1;
  1326. if (.@menu4$ == ":Cancel") {
  1327. next;
  1328. mes "["+strnpcinfo(1)+"]";
  1329. mes "There are no items avaible to delete.";
  1330. break;
  1331. }
  1332. else {
  1333. next;
  1334. mes "["+strnpcinfo(1)+"]";
  1335. mes "Please select the item you wish to delete.";
  1336. }
  1337. set .@menu4,select(.@menu4$);
  1338. set .@menu4,.@menu4 - 1;
  1339. for (set .@i,1; .@i <= .@gmaxitem ; set .@i, .@i + 1) {
  1340. if (.@menu4 == .@cncheck)
  1341. break;
  1342. if (.@menu4 == .@i) {
  1343. set .@max,.@max - 1;
  1344. setd ".@gequip"+.@i,0;
  1345. break;
  1346. }
  1347. }
  1348. for (set .@i,1; .@i <= .@gmaxitem; set .@i, .@i + 1) {
  1349. if ( !getd(".@gequip"+.@i) ) {
  1350. for (set .@j, 1; .@j <= .@gmaxitem; set .@j, .@j + 1) {
  1351. if ( (getd(".@gequip"+.@j) ) && (.@i < .@j) ) {
  1352. setd ".@gequip"+.@i,getd(".@gequip"+.@j);
  1353. setd ".@gequip"+.@j,0;
  1354. break;
  1355. }
  1356. }
  1357. }
  1358. }
  1359. break;
  1360.  
  1361. case 3:
  1362. next;
  1363. set .@breakeq,1;
  1364. break;
  1365. }
  1366. }
  1367. break;
  1368.  
  1369. case 6:
  1370. set .@megabreak,0;
  1371. set .@repeatoff,0;
  1372. while (1) {
  1373. if (.@megabreak) {
  1374. next;
  1375. break;
  1376. }
  1377. if (!.@repeatoff) {
  1378. mes "["+strnpcinfo(1)+"]";
  1379. mes "You can turn on/off the options regarding your guild here.";
  1380. }
  1381. set .@repeatoff,1;
  1382. set .@n,0;
  1383. set .@i,0;
  1384. while ( .@i < .maxbit ) {
  1385. set .@i, pow(2,.@n);
  1386. if (.@bitmask & .@i)
  1387. setd ".@bitopt"+.@n,1;
  1388. else
  1389. setd ".@bitopt"+.@n,0;
  1390. set .@n,.@n + 1;
  1391. }
  1392. set .@menu5$,"";
  1393. for (set .@i,0; .@i < .maxbitn; set .@i,.@i + 1) {
  1394.  
  1395. set .@display$, callfunc ("displaylist#g1",.@i);
  1396.  
  1397. if (getd(".@bitopt"+.@i)) {
  1398. if ( .@display$ == "Allow Member Listing" )
  1399. set .@menu5$, .@menu5$ + ":^FF0000" + .@display$ + "^000000 (^009900On^000000)";
  1400. else if ( .@display$ == "Allow Warp to Guild Leader" )
  1401. set .@menu5$, .@menu5$ + ":^FF0000" + .@display$ + "^000000 (^009900On^000000)";
  1402. else
  1403. set .@menu5$, .@menu5$ + ":" + .@display$ + " (^009900On^000000)";
  1404. }
  1405. else {
  1406. if ( .@display$ == "Always Accept Warps" )
  1407. set .@menu5$, .@menu5$ + ":^0000FF" + .@display$ + "^000000 (^FF0000Off^000000)";
  1408. else if ( .@display$ == "Allow Announce to Member" )
  1409. set .@menu5$, .@menu5$ + ":^0000FF" + .@display$ + "^000000 (^FF0000Off^000000)";
  1410. else if ( .@display$ == "Display Online Member Level" )
  1411. set .@menu5$, .@menu5$ + ":^0000FF" + .@display$ + "^000000 (^FF0000Off^000000)";
  1412. else if ( .@display$ == "Display Online Member Job" )
  1413. set .@menu5$, .@menu5$ + ":^0000FF" + .@display$ + "^000000 (^FF0000Off^000000)";
  1414. else if ( .@display$ == "Display Online Member Location" )
  1415. set .@menu5$, .@menu5$ + ":^0000FF" + .@display$ + "^000000 (^FF0000Off^000000)";
  1416. else
  1417. set .@menu5$, .@menu5$ + ":" + .@display$ + " (^FF0000Off^000000)";
  1418. }
  1419. }
  1420. set .@menu5$, .@menu5$ + ":^009900Back^000000";
  1421. set .@menu5, select (.@menu5$);
  1422. set .@menu5, .@menu5 - 2;
  1423. for (set .@i,0; .@i < .maxbitn ; set .@i, .@i + 1 ) {
  1424. if (.@menu5 == .maxbitn) {
  1425. set .@megabreak,1;
  1426. break;
  1427. }
  1428. if (.@menu5 == .@i) {
  1429. if (.@i == 0) {
  1430. if (.@bitopt0) {
  1431. next;
  1432. mes "["+strnpcinfo(1)+"]";
  1433. mes "^FF0000Warning:^000000 ^990099Disabling^000000 this option will also disable:";
  1434. mes "^0000FF-Allow Announce to Member^000000";
  1435. mes "^0000FF-Display Leader in Member List^000000";
  1436. mes "^0000FF-Display Online Member Level^000000";
  1437. mes "^0000FF-Display Online Member Job^000000";
  1438. mes "^0000FF-Display Online Member Location^000000";
  1439. next;
  1440. if (select ("Continue:Return") == 2) {
  1441. set .@repeatoff,0;
  1442. break;
  1443. }
  1444. set .@bitopt7,0;
  1445. set .@bitopt0,0;
  1446. set .@bitopt4,0;
  1447. set .@bitopt5,0;
  1448. set .@bitopt6,0;
  1449. set .@bitopt1,0;
  1450. set .@repeatoff,0;
  1451. break;
  1452. }
  1453. else {
  1454. set .@bitopt0,1;
  1455. break;
  1456. }
  1457. }
  1458. if ( (.@i == 1) || (.@i == 4) || (.@i == 5) || (.@i == 6) ) {
  1459. if ( (!.@bitopt1) || (!.@bitopt4) || (!.@bitopt5) || (!.@bitopt6) ) {
  1460. next;
  1461. mes "["+strnpcinfo(1)+"]";
  1462. mes "^FF0000Warning:^000000 ^009900Enabling^000000 this option will also enable:";
  1463. mes "^0000FF-Allow Member Listing^000000";
  1464. next;
  1465. if (select ("Continue:Return") == 2) {
  1466. set .@repeatoff,0;
  1467. break;
  1468. }
  1469. if (.@i == 1)
  1470. set .@bitopt1,1;
  1471. if (.@i == 4)
  1472. set .@bitopt4,1;
  1473. if (.@i == 5)
  1474. set .@bitopt5,1;
  1475. if (.@i == 6)
  1476. set .@bitopt6,1;
  1477. set .@bitopt0,1;
  1478. set .@repeatoff,0;
  1479. break;
  1480. }
  1481. else {
  1482. if (.@i == 1)
  1483. set .@bitopt1,0;
  1484. if (.@i == 4)
  1485. set .@bitopt4,0;
  1486. if (.@i == 5)
  1487. set .@bitopt5,0;
  1488. if (.@i == 6)
  1489. set .@bitopt6,0;
  1490. }
  1491. }
  1492. if (.@i == 13) {
  1493. if (!.@bitopt13) {
  1494. next;
  1495. mes "["+strnpcinfo(1)+"]";
  1496. mes "^FF0000Warning:^000000 ^009900Enabling^000000 this option will also enable:";
  1497. mes "^0000FF-Allow Warp to Guild Leader^000000";
  1498. next;
  1499. if (select ("Continue:Return") == 2) {
  1500. set .@repeatoff,0;
  1501. break;
  1502. }
  1503. set .@bitopt13,1;
  1504. set .@bitopt12,1;
  1505. set .@repeatoff,0;
  1506. break;
  1507. }
  1508. else
  1509. set .@bitopt13,1;
  1510. }
  1511. if (.@i == 12) {
  1512. if (.@bitopt12) {
  1513. next;
  1514. mes "["+strnpcinfo(1)+"]";
  1515. mes "^FF0000Warning:^000000 ^990099Disabling^000000 this option will also disable:";
  1516. mes "^0000FF-Always Accept Warps^000000";
  1517. next;
  1518. if (select ("Continue:Return") == 2) {
  1519. set .@repeatoff,0;
  1520. break;
  1521. }
  1522. set .@bitopt13,0;
  1523. set .@bitopt12,0;
  1524. set .@repeatoff,0;
  1525. break;
  1526. }
  1527. else
  1528. set .@bitopt12,1;
  1529. }
  1530. else {
  1531. if (getd(".@bitopt"+.@i) )
  1532. setd ".@bitopt"+.@i,0;
  1533. else
  1534. setd ".@bitopt"+.@i,1;
  1535. break;
  1536. }
  1537. }
  1538. }
  1539. set .@bitmask,0;
  1540. for (set .@i,0; .@i < .maxbitn; set .@i , .@i + 1) {
  1541. if (getd(".@bitopt"+.@i))
  1542. set .@bitmask,.@bitmask | pow (2,.@i);
  1543. }
  1544. }
  1545. break;
  1546.  
  1547. case 7:
  1548. for (set .@i,0; .@i <.maxgnum ; set .@i, .@i + 1 ) {
  1549. if (getarraysize(getd(".guildinfo"+.@i+"$")) == 0) {
  1550.  
  1551. //String Array
  1552. //Leader Name
  1553. setd ".guildinfo"+.@i+"$[0]", strcharinfo(0);
  1554. //Objective Inputted
  1555. setd ".guildinfo"+.@i+"$[1]", .@gobj$;
  1556. //Level Inputted
  1557. setd ".guildinfo"+.@i+"$[2]", .@glvl$;
  1558. //Description Inputted
  1559. setd ".guildinfo"+.@i+"$[3]", .@gdesc$;
  1560. //Job Inputted
  1561. setd ".guildinfo"+.@i+"$[4]", .@gjob$;
  1562.  
  1563. //Numeric Array
  1564. //Bitmask
  1565. setd ".guildinfo"+.@i+"[0]", .@bitmask;
  1566. //Guild ID
  1567. setd ".guildinfo"+.@i+"[1]", getcharid(2,strcharinfo(0));
  1568. //Equips
  1569. set .@n, 1;
  1570. for (set .@j,1; .@j <= .@gmaxitem; set .@j, .@j + 1) {
  1571. set .@n, .@n + 1;
  1572. if (getd(".@gequip"+.@j) == 0)
  1573. setd ".@gequip"+.@j,32767;
  1574. setd ".guildinfo"+.@i+"["+.@n+"]", getd(".@gequip"+.@j);
  1575. }
  1576. mes "["+strnpcinfo(1)+"]";
  1577. mes "Your guild has been added succesfully!";
  1578. break;
  1579. }
  1580. }
  1581. if (.@i >= .maxgnum) {
  1582. mes "["+strnpcinfo(1)+"]";
  1583. mes "Im sorry but all the slots for parties are filled up, please come back later";
  1584. close;
  1585. }
  1586. close;
  1587. break;
  1588. }
  1589. }
  1590. else {
  1591. mes "["+strnpcinfo(1)+"]";
  1592. mes "^FF0000Error^000000 you are no longer the guild leader. This function has been terminated.";
  1593. close;
  1594. }
  1595. }
  1596. break;
  1597.  
  1598. //----------------------------------------------------------------------------------------------------------------------------------
  1599. //Modify Registry Part -------------------------------------------------------------------------------------------------------------
  1600. // ---------------------------------------------------------------------------------------------------------------------------------
  1601.  
  1602. case 2:
  1603. while (1) {
  1604. if ( getguildmaster (getcharid(2)) == strcharinfo(0) ) {
  1605. for (set .@i,0; .@i < .maxgnum ; set .@i, .@i + 1) {
  1606. if ( (getd (".guildinfo"+.@i+"$[0]") == strcharinfo(0)) && (getarraysize(getd(".guildinfo"+.@i)) != 0) && (getd (".guildinfo"+.@i+"[1]") == getcharid(2)) ) {
  1607.  
  1608. //Set the semi-permanent array back into temporary values.
  1609. //String Part
  1610. //Checks if char is in same guild as the old guild.
  1611. if ( getd (".guildinfo"+.@i+"$[0]") != strcharinfo(0) ) {
  1612. mes "["+strnpcinfo(1)+"]";
  1613. mes "An unexpected ^FF0000error^000000 has ocurred, I'm sorry but you are no longer the leader of this guild.";
  1614. close;
  1615. }
  1616. //Objective Retaken
  1617. set .@gobj$, getd (".guildinfo"+.@i+"$[1]");
  1618. //Level Retaken
  1619. set .@glvl$, getd (".guildinfo"+.@i+"$[2]");
  1620. //Description Retaken
  1621. set .@gdesc$, getd (".guildinfo"+.@i+"$[3]");
  1622. //Job Retaken
  1623. set .@gjob$, getd (".guildinfo"+.@i+"$[4]");
  1624.  
  1625. //Numeric Part
  1626. //Bitmask Retaken
  1627. set .@bitmask, getd (".guildinfo"+.@i+"[0]");
  1628. //Equips Retaken
  1629. set .@n, 1;
  1630. for (set .@j,1; .@j <= .@gmaxitem; set .@j, .@j + 1) {
  1631. set .@n, .@n + 1;
  1632. if (getd (".guildinfo"+.@i+"["+.@n+"]") == 32767)
  1633. setd ".@gequip"+.@j,0;
  1634. setd ".@gequip"+.@j, getd (".guildinfo"+.@i+"["+.@n+"]");
  1635. }
  1636. //End of temporary variable setting.
  1637.  
  1638. while (1) {
  1639. mes "["+strnpcinfo(1)+"]";
  1640. mes "Please select your modifications...";
  1641. next;
  1642. switch (select ("Objectives ( ^FF0000"+.@gobj$+"^000000):Description:Level ( ^FF0000"+.@glvl$+"^000000):Jobs:Equips:Display Options:^009900Complete^000000") ) {
  1643.  
  1644. case 1:
  1645. mes "["+strnpcinfo(1)+"]";
  1646. mes "You can write the objective, or the main focus of your guild.";
  1647. if (.@gobj$ == "") {
  1648. mes "The current objective is ^FF0000Empty^000000";
  1649. }
  1650. else {
  1651. mes "Current objective:";
  1652. mes "^FF0000"+.@gobj$+"^000000";
  1653. }
  1654. if (select ("Modify:Delete:Cancel") == 3) {
  1655. next;
  1656. break;
  1657. }
  1658. if (@menu == 2) {
  1659. next;
  1660. mes "["+strnpcinfo(1)+"]";
  1661. mes "The objective has been successfully deleted.";
  1662. set .@gobj$,"";
  1663. next;
  1664. break;
  1665. }
  1666. set .@gobj$, callfunc ("calcmenu#g1",6,.@objnum,"objectives","Level","MvP","WoE","Social","Event","Quest");
  1667. break;
  1668.  
  1669. case 2:
  1670. mes "["+strnpcinfo(1)+"]";
  1671. mes "You can input the description, comments, or additional info related to your guild.";
  1672. if (.@gdesc$ == "") {
  1673. mes "The current description is ^FF0000Empty^000000";
  1674. }
  1675. else {
  1676. mes "Current Description:";
  1677. mes "^FF0000"+.@gdesc$+"^000000";
  1678. }
  1679. if (select ("Modify:Delete:Cancel") == 3) {
  1680. next;
  1681. break;
  1682. }
  1683. if (@menu == 2) {
  1684. next;
  1685. mes "["+strnpcinfo(1)+"]";
  1686. mes "The description has been successfully deleted.";
  1687. set .@gdesc$,"";
  1688. next;
  1689. break;
  1690. }
  1691.  
  1692. set .@gdesc$,"";
  1693. for (set .@i,1; .@i < 4; set .@i, .@i + 1 )
  1694. set getd(".@gdesc"+.@i+"$"),"";
  1695. for (set .@i,1; .@i < 5 ; set .@i, .@i + 1 ) {
  1696. next;
  1697. mes "["+strnpcinfo(1)+"]";
  1698. if ( (.@i > 1) && (.@i < 4) )
  1699. mes "Would you like to write more information about your guild?";
  1700. else if (.@i == 1)
  1701. mes "Please write down the description of your guild.";
  1702. else if (.@i >= 4) {
  1703. mes "Thank you for writting the whole description for your guild.";
  1704. mes "Final Description:";
  1705. mes "^FF0000"+.@gdesc$+"^000000";
  1706. break;
  1707. }
  1708. if ( (.@i > 1) && (.@i < 4) ) {
  1709. mes "Current Description:";
  1710. mes "^FF0000"+.@gdesc$+"^000000";
  1711. if ( select ("Yes:No") == 2)
  1712. break;
  1713. }
  1714. input getd(".@gdesc"+.@i+"$");
  1715. set .@gdesc$,.@gdesc1$ + " " + .@gdesc2$ + " " + .@gdesc3$;
  1716. }
  1717. next;
  1718. break;
  1719.  
  1720. case 3:
  1721. mes "["+strnpcinfo(1)+"]";
  1722. mes "You can add the level range required to enter your guild.";
  1723. if (.@glvl$ == "")
  1724. mes "The current level is ^FF0000Empty^000000";
  1725. else
  1726. mes "Current level:";
  1727. mes "^FF0000"+.@glvl$+"^000000";
  1728. next;
  1729. if (select ("Modify:Delete:Cancel") == 3) break;
  1730. if (@menu == 2) {
  1731. next;
  1732. mes "["+strnpcinfo(1)+"]";
  1733. mes "The level has been successfully deleted.";
  1734. set .@glvl$,"";
  1735. next;
  1736. break;
  1737. }
  1738. mes "["+strnpcinfo(1)+"]";
  1739. mes "Please input the minimum level requirement.";
  1740. input .@gminlvl;
  1741. if ((.@gminlvl > .@maxglvl ) || ( .@gminlvl < 1 )) {
  1742. next;
  1743. mes "["+strnpcinfo(1)+"]";
  1744. mes "Sorry but the minimum level requirement is invalid.";
  1745. next;
  1746. break;
  1747. }
  1748. next;
  1749. mes "["+strnpcinfo(1)+"]";
  1750. mes "Please input the maximum level requirement.";
  1751. input .@gmaxlvl;
  1752. if ((.@gmaxlvl > .@maxglvl ) || ( .@gmaxlvl < 1 ) || (.@gminlvl > .@gmaxlvl)) {
  1753. next;
  1754. mes "["+strnpcinfo(1)+"]";
  1755. mes "Sorry but the maximum level requirement is invalid.";
  1756. next;
  1757. break;
  1758. }
  1759. set .@glvl$,""+.@gminlvl+"~"+.@gmaxlvl+" ";
  1760. next;
  1761. break;
  1762.  
  1763. case 4:
  1764. mes "["+strnpcinfo(1)+"]";
  1765. mes "You can add the jobs you're looking foward joining your guild.";
  1766. if (.@gjob$ != "") {
  1767. mes "Current jobs:";
  1768. mes "^FF0000"+.@gjob$+"^000000";
  1769. }
  1770. else
  1771. mes "The current job list is ^FF0000Empty^000000.";
  1772. next;
  1773. switch (select ("Modify:Delete:Cancel") ) {
  1774.  
  1775. case 1:
  1776. mes "["+strnpcinfo(1)+"]";
  1777. mes "Would you like to choose specifically or generally?";
  1778. next;
  1779. if (select ("Generally:Specifically") == 1) {
  1780. set .@gjob$, callfunc ("calcmenu#g1",6,.@jobnum1,"jobs","Damage-Dealers","Tankers","Mobbers","Spellcasters","Healers","Supports");
  1781. }
  1782. else {
  1783. if ( .@gthird )
  1784. set .@gjob$, callfunc ("calcmenu#g1",18,.@jobnum2,"jobs","Rune-Knights","Royal-Guards","Warlocks","Sorcerers","Rangers","Minstrels",
  1785. "Wanderers","Arch-Bishops","Suras","Mechanics","Genetics","Guillotine-Cross","Shadow-Chasers","Ninja","Gunslinger","Soul-Linker",
  1786. "Star-Gladiator","Super-Novice");
  1787. else
  1788. set .@gjob$, callfunc ("calcmenu#g1",18,.@jobnum2,"jobs","Lord-Knights","Paladins","High-Wizards","Professors","Snipers","Clowns",
  1789. "Gypsies","High-Priests","Champions","Whitesmiths","Creators","Assassin-Cross","Stalkers","Ninja","Gunslinger","Soul-Linker",
  1790. "Star-Gladiator","Super-Novice");
  1791. }
  1792. break;
  1793.  
  1794. case 2:
  1795. next;
  1796. mes "["+strnpcinfo(1)+"]";
  1797. mes "The job list has been succesfully deleted.";
  1798. set .@gjob$,"";
  1799. next;
  1800. break;
  1801.  
  1802. case 3:
  1803. break;
  1804.  
  1805. }
  1806. break;
  1807.  
  1808.  
  1809.  
  1810. case 5:
  1811. mes "["+strnpcinfo(1)+"]";
  1812. mes "You can write the required cards, equipment or items for your guild.";
  1813. mes "Current equipments:";
  1814. for (set .@i,1; .@i <= .@gmaxitem; set .@i,.@i + 1) {
  1815. if (getitemname(getd(".@gequip"+.@i))=="null") {
  1816. mes .@i+"- ^FF0000Empty^000000";
  1817. }
  1818. else {
  1819. mes .@i+"- ^0000FF"+getitemname(getd(".@gequip"+.@i))+"^000000";
  1820. }
  1821. }
  1822. if (select ("Modify:Delete:Cancel") == 3) {
  1823. next;
  1824. break;
  1825. }
  1826. if (@menu == 2) {
  1827. next;
  1828. mes "["+strnpcinfo(1)+"]";
  1829. mes "The equip list has been successfully deleted.";
  1830. for (set .@i,1; .@i <= .@gmaxitem; set .@i,.@i + 1) {
  1831. setd ".@gequip"+.@i,0;
  1832. }
  1833. set .@max,0;
  1834. next;
  1835. break;
  1836. }
  1837.  
  1838. while (1) {
  1839. if (.@breakeq) {
  1840. set .@breakeq,0;
  1841. break;
  1842. }
  1843. next;
  1844. mes "["+strnpcinfo(1)+"]";
  1845. mes "You can write the required cards, equipment or items for your guild.";
  1846. mes "Current equipments:";
  1847. for (set .@i,1; .@i <= .@gmaxitem; set .@i,.@i + 1) {
  1848. if (getitemname(getd(".@gequip"+.@i))=="null") {
  1849. mes .@i+"- ^FF0000Empty^000000";
  1850. }
  1851. else {
  1852. mes .@i+"- ^0000FF"+getitemname(getd(".@gequip"+.@i))+"^000000";
  1853. }
  1854. }
  1855.  
  1856. switch ( select ("Add Item:Remove Item:Back") ) {
  1857.  
  1858. case 1:
  1859. if (.@max == .@gmaxitem) {
  1860. next;
  1861. mes "["+strnpcinfo(1)+"]";
  1862. mes "All Item Slots are full!";
  1863. break;
  1864. }
  1865. next;
  1866. mes "["+strnpcinfo(1)+"]";
  1867. mes "Input the item ID";
  1868. input .@gequip,0,32767;
  1869. if (getitemname(.@gequip)=="null"){
  1870. next;
  1871. mes "["+strnpcinfo(1)+"]";
  1872. mes "Invalid Item!";
  1873. break;
  1874. }
  1875. for (set .@i,1; .@i <= .@gmaxitem; set .@i,.@i + 1) {
  1876. if (getitemname(getd(".@gequip"+.@i))=="null") {
  1877. setd ".@gequip"+.@i,.@gequip;
  1878. set .@max,.@max + 1;
  1879. for (set .@j, 1; .@j <= .@gmaxitem; set .@j,.@j + 1) {
  1880. if ( ( getitemname(getd(".@gequip"+.@i)) == getitemname(getd(".@gequip"+.@j)) ) && (.@i != .@j) && (getitemname(getd(".@gequip"+.@j)) != "null") ) {
  1881. next;
  1882. mes "["+strnpcinfo(1)+"]";
  1883. mes "This item is already in the list...";
  1884. setd ".@gequip"+.@i,0;
  1885. set .@max,.@max - 1;
  1886. break;
  1887. }
  1888. }
  1889. break;
  1890. }
  1891. }
  1892. break;
  1893.  
  1894. case 2:
  1895. next;
  1896. mes "["+strnpcinfo(1)+"]";
  1897. mes "Let me check the avaible item list...";
  1898. set .@menu4$,"";
  1899. for (set .@i,1; .@i <= .@gmaxitem; set .@i,.@i + 1) {
  1900. if ( getitemname(getd(".@gequip"+.@i)) != "null" ) {
  1901. set .@menu4$, .@menu4$ + ":" + .@i + "- ^0000FF"+getitemname(getd(".@gequip"+.@i))+"^000000";
  1902. set .@cncheck,.@cncheck + 1;
  1903. }
  1904. }
  1905. set .@menu4$,.@menu4$ + ":Cancel";
  1906. set .@cncheck,.@cncheck + 1;
  1907. if (.@menu4$ == ":Cancel") {
  1908. next;
  1909. mes "["+strnpcinfo(1)+"]";
  1910. mes "There are no items avaible to delete.";
  1911. break;
  1912. }
  1913. else {
  1914. next;
  1915. mes "["+strnpcinfo(1)+"]";
  1916. mes "Please select the item you wish to delete.";
  1917. }
  1918. set .@menu4,select(.@menu4$);
  1919. set .@menu4,.@menu4 - 1;
  1920. for (set .@i,1; .@i <= .@gmaxitem ; set .@i, .@i + 1) {
  1921. if (.@menu4 == .@cncheck)
  1922. break;
  1923. if (.@menu4 == .@i) {
  1924. set .@max,.@max - 1;
  1925. setd ".@gequip"+.@i,0;
  1926. break;
  1927. }
  1928. }
  1929. for (set .@i,1; .@i <= .@gmaxitem; set .@i, .@i + 1) {
  1930. if ( !getd(".@gequip"+.@i) ) {
  1931. for (set .@j, 1; .@j <= .@gmaxitem; set .@j, .@j + 1) {
  1932. if ( (getd(".@gequip"+.@j) ) && (.@i < .@j) ) {
  1933. setd ".@gequip"+.@i,getd(".@gequip"+.@j);
  1934. setd ".@gequip"+.@j,0;
  1935. break;
  1936. }
  1937. }
  1938. }
  1939. }
  1940. break;
  1941.  
  1942. case 3:
  1943. next;
  1944. set .@breakeq,1;
  1945. break;
  1946. }
  1947. }
  1948. break;
  1949.  
  1950. case 6:
  1951. set .@megabreak,0;
  1952. set .@repeatoff,0;
  1953. while (1) {
  1954. if (.@megabreak) {
  1955. next;
  1956. break;
  1957. }
  1958. if (!.@repeatoff) {
  1959. mes "["+strnpcinfo(1)+"]";
  1960. mes "You can turn on/off the options regarding your guild here.";
  1961. }
  1962. set .@repeatoff,1;
  1963. set .@n,0;
  1964. set .@i,0;
  1965. while ( .@i < .maxbit ) {
  1966. set .@i, pow(2,.@n);
  1967. if (.@bitmask & .@i)
  1968. setd ".@bitopt"+.@n,1;
  1969. else
  1970. setd ".@bitopt"+.@n,0;
  1971. set .@n,.@n + 1;
  1972. }
  1973. set .@menu5$,"";
  1974. for (set .@i,0; .@i < .maxbitn; set .@i,.@i + 1) {
  1975.  
  1976. set .@display$, callfunc ("displaylist#g1",.@i);
  1977.  
  1978. if (getd(".@bitopt"+.@i)) {
  1979. if ( .@display$ == "Allow Member Listing" )
  1980. set .@menu5$, .@menu5$ + ":^FF0000" + .@display$ + "^000000 (^009900On^000000)";
  1981. else if ( .@display$ == "Allow Warp to Guild Leader" )
  1982. set .@menu5$, .@menu5$ + ":^FF0000" + .@display$ + "^000000 (^009900On^000000)";
  1983. else
  1984. set .@menu5$, .@menu5$ + ":" + .@display$ + " (^009900On^000000)";
  1985. }
  1986. else {
  1987. if ( .@display$ == "Always Accept Warps" )
  1988. set .@menu5$, .@menu5$ + ":^0000FF" + .@display$ + "^000000 (^FF0000Off^000000)";
  1989. else if ( .@display$ == "Allow Announce to Member" )
  1990. set .@menu5$, .@menu5$ + ":^0000FF" + .@display$ + "^000000 (^FF0000Off^000000)";
  1991. else if ( .@display$ == "Display Online Member Level" )
  1992. set .@menu5$, .@menu5$ + ":^0000FF" + .@display$ + "^000000 (^FF0000Off^000000)";
  1993. else if ( .@display$ == "Display Online Member Job" )
  1994. set .@menu5$, .@menu5$ + ":^0000FF" + .@display$ + "^000000 (^FF0000Off^000000)";
  1995. else if ( .@display$ == "Display Online Member Location" )
  1996. set .@menu5$, .@menu5$ + ":^0000FF" + .@display$ + "^000000 (^FF0000Off^000000)";
  1997. else
  1998. set .@menu5$, .@menu5$ + ":" + .@display$ + " (^FF0000Off^000000)";
  1999. }
  2000. }
  2001. set .@menu5$, .@menu5$ + ":^009900Back^000000";
  2002. set .@menu5, select (.@menu5$);
  2003. set .@menu5, .@menu5 - 2;
  2004. for (set .@i,0; .@i < .maxbitn ; set .@i, .@i + 1 ) {
  2005. if (.@menu5 == .maxbitn) {
  2006. set .@megabreak,1;
  2007. break;
  2008. }
  2009. if (.@menu5 == .@i) {
  2010. if (.@i == 0) {
  2011. if (.@bitopt0) {
  2012. next;
  2013. mes "["+strnpcinfo(1)+"]";
  2014. mes "^FF0000Warning:^000000 ^990099Disabling^000000 this option will also disable:";
  2015. mes "^0000FF-Allow Announce to Member^000000";
  2016. mes "^0000FF-Display Leader in Member List^000000";
  2017. mes "^0000FF-Display Online Member Level^000000";
  2018. mes "^0000FF-Display Online Member Job^000000";
  2019. mes "^0000FF-Display Online Member Location^000000";
  2020. next;
  2021. if (select ("Continue:Return") == 2) {
  2022. set .@repeatoff,0;
  2023. break;
  2024. }
  2025. set .@bitopt7,0;
  2026. set .@bitopt0,0;
  2027. set .@bitopt4,0;
  2028. set .@bitopt5,0;
  2029. set .@bitopt6,0;
  2030. set .@bitopt1,0;
  2031. set .@repeatoff,0;
  2032. break;
  2033. }
  2034. else {
  2035. set .@bitopt0,1;
  2036. break;
  2037. }
  2038. }
  2039. if ( (.@i == 1) || (.@i == 4) || (.@i == 5) || (.@i == 6) ) {
  2040. if ( (!.@bitopt1) || (!.@bitopt4) || (!.@bitopt5) || (!.@bitopt6) ) {
  2041. next;
  2042. mes "["+strnpcinfo(1)+"]";
  2043. mes "^FF0000Warning:^000000 ^009900Enabling^000000 this option will also enable:";
  2044. mes "^0000FF-Allow Member Listing^000000";
  2045. next;
  2046. if (select ("Continue:Return") == 2) {
  2047. set .@repeatoff,0;
  2048. break;
  2049. }
  2050. if (.@i == 1)
  2051. set .@bitopt1,1;
  2052. if (.@i == 4)
  2053. set .@bitopt4,1;
  2054. if (.@i == 5)
  2055. set .@bitopt5,1;
  2056. if (.@i == 6)
  2057. set .@bitopt6,1;
  2058. set .@bitopt0,1;
  2059. set .@repeatoff,0;
  2060. break;
  2061. }
  2062. else {
  2063. if (.@i == 1)
  2064. set .@bitopt1,0;
  2065. if (.@i == 4)
  2066. set .@bitopt4,0;
  2067. if (.@i == 5)
  2068. set .@bitopt5,0;
  2069. if (.@i == 6)
  2070. set .@bitopt6,0;
  2071. }
  2072. }
  2073. if (.@i == 13) {
  2074. if (!.@bitopt13) {
  2075. next;
  2076. mes "["+strnpcinfo(1)+"]";
  2077. mes "^FF0000Warning:^000000 ^009900Enabling^000000 this option will also enable:";
  2078. mes "^0000FF-Allow Warp to Guild Leader^000000";
  2079. next;
  2080. if (select ("Continue:Return") == 2) {
  2081. set .@repeatoff,0;
  2082. break;
  2083. }
  2084. set .@bitopt13,1;
  2085. set .@bitopt12,1;
  2086. set .@repeatoff,0;
  2087. break;
  2088. }
  2089. else
  2090. set .@bitopt13,1;
  2091. }
  2092. if (.@i == 12) {
  2093. if (.@bitopt12) {
  2094. next;
  2095. mes "["+strnpcinfo(1)+"]";
  2096. mes "^FF0000Warning:^000000 ^990099Disabling^000000 this option will also disable:";
  2097. mes "^0000FF-Always Accept Warps^000000";
  2098. next;
  2099. if (select ("Continue:Return") == 2) {
  2100. set .@repeatoff,0;
  2101. break;
  2102. }
  2103. set .@bitopt13,0;
  2104. set .@bitopt12,0;
  2105. set .@repeatoff,0;
  2106. break;
  2107. }
  2108. else
  2109. set .@bitopt12,1;
  2110. }
  2111. else {
  2112. if (getd(".@bitopt"+.@i) )
  2113. setd ".@bitopt"+.@i,0;
  2114. else
  2115. setd ".@bitopt"+.@i,1;
  2116. break;
  2117. }
  2118. }
  2119. }
  2120. set .@bitmask,0;
  2121. for (set .@i,0; .@i < .maxbitn; set .@i , .@i + 1) {
  2122. if (getd(".@bitopt"+.@i))
  2123. set .@bitmask,.@bitmask | pow (2,.@i);
  2124. }
  2125. }
  2126. break;
  2127.  
  2128. case 7:
  2129. for (set .@i,0; .@i <.maxgnum ; set .@i, .@i + 1 ) {
  2130.  
  2131. if ( (getd (".guildinfo"+.@i+"$[0]") == strcharinfo(0) ) && (getarraysize(getd(".guildinfo"+.@i)) != 0) && (getd (".guildinfo"+.@i+"[1]") == getcharid(2)) ) {
  2132.  
  2133. //Deletes Old Registry
  2134. deletearray getd(".guildinfo$"+.@i);
  2135. deletearray getd(".guildinfo"+.@i);
  2136.  
  2137. //String Array
  2138. //Leader Name
  2139. setd ".guildinfo"+.@i+"$[0]", strcharinfo(0);
  2140. //Objective Inputted
  2141. setd ".guildinfo"+.@i+"$[1]", .@gobj$;
  2142. //Level Inputted
  2143. setd ".guildinfo"+.@i+"$[2]", .@glvl$;
  2144. //Description Inputted
  2145. setd ".guildinfo"+.@i+"$[3]", .@gdesc$;
  2146. //Job Inputted
  2147. setd ".guildinfo"+.@i+"$[4]", .@gjob$;
  2148.  
  2149. //Numeric Array
  2150. //Bitmask
  2151. setd ".guildinfo"+.@i+"[0]", .@bitmask;
  2152. //Guild ID
  2153. setd ".guildinfo"+.@i+"[1]", getcharid(2,strcharinfo(0));
  2154. //Equips
  2155. set .@n, 1;
  2156. for (set .@j,1; .@j <= .@gmaxitem; set .@j, .@j + 1) {
  2157. set .@n, .@n + 1;
  2158. if (getd(".@gequip"+.@j) == 0)
  2159. setd ".@gequip"+.@j,32767;
  2160. setd ".guildinfo"+.@i+"["+.@n+"]", getd(".@gequip"+.@j);
  2161. }
  2162.  
  2163. mes "["+strnpcinfo(1)+"]";
  2164. mes "Your guild has been added succesfully!";
  2165. break;
  2166. }
  2167. }
  2168. if (.@i >= .maxgnum) {
  2169. mes "["+strnpcinfo(1)+"]";
  2170. mes "Im sorry but all the slots for parties are filled up, please come back later";
  2171. close;
  2172. }
  2173. close;
  2174. break;
  2175. }
  2176. }
  2177. break;
  2178. }
  2179. else {
  2180. mes "["+strnpcinfo(1)+"]";
  2181. mes "Sorry but I do not have any registry of your guild recruitment. Please try creating a new guild registry.";
  2182. close;
  2183. }
  2184. }
  2185. }
  2186. else {
  2187. mes "["+strnpcinfo(1)+"]";
  2188. mes "^FF0000Error^000000 you are no longer the guild leader. This function has been terminated.";
  2189. close;
  2190. }
  2191. }
  2192. break;
  2193.  
  2194. //----------------------------------------------------------------------------------------------------------------------------------
  2195. //Delete Registry Part -------------------------------------------------------------------------------------------------------------
  2196. // ---------------------------------------------------------------------------------------------------------------------------------
  2197. case 3:
  2198. if ( getguildmaster (getcharid(2)) == strcharinfo(0) ) {
  2199. for (set .@i,0; .@i < .maxgnum ; set .@i, .@i + 1 ) {
  2200. if ( (getd (".guildinfo"+.@i+"$[0]") == strcharinfo(0)) && (getarraysize(getd(".guildinfo"+.@i)) != 0) && (getd (".guildinfo"+.@i+"[1]") == getcharid(2)) ) {
  2201. mes "["+strnpcinfo(1)+"]";
  2202. mes "The registry for ^009900"+getd (".guildinfo"+.@i+"$[0]")+"^000000 guild has been found. Are you sure you want to delete this registry?";
  2203. next;
  2204. if (select("Yes:No") == 2) break;
  2205. deletearray getd(".guildinfo"+.@i+"$");
  2206. deletearray getd(".guildinfo"+.@i);
  2207. mes "["+strnpcinfo(1)+"]";
  2208. mes "The registry has been successfully deleted.";
  2209. close;
  2210. }
  2211. else {
  2212. mes "["+strnpcinfo(1)+"]";
  2213. mes "I'm sorry but you do not have a guild registry with us.";
  2214. close;
  2215. }
  2216. }
  2217. break;
  2218. }
  2219. else {
  2220. mes "["+strnpcinfo(1)+"]";
  2221. mes "^FF0000Error^000000 you are no longer the guild leader. This function has been terminated.";
  2222. close;
  2223. }
  2224. break;
  2225.  
  2226. //Cancel Part
  2227. case 4:
  2228. mes "["+strnpcinfo(1)+"]";
  2229. mes "Thank you for your time.";
  2230. close;
  2231. }
  2232. }
  2233. else {
  2234.  
  2235. //Guild Member but not leader part
  2236.  
  2237. mes "["+strnpcinfo(1)+"]";
  2238. mes "Im sorry but you are already inside a guild.";
  2239. close;
  2240. }
  2241.  
  2242. }
  2243. else {
  2244.  
  2245. //Unguildied part
  2246.  
  2247. while (1) {
  2248.  
  2249. //Checks if Registered Player is Still Leader of Registered Guild
  2250. for (set .@i,0; .@i < .maxgnum; set .@i, .@i + 1) {
  2251. if (getarraysize(getd(".guildinfo"+.@i)) != 0) {
  2252. set .@restrict, callfunc ( "checkrest#g1",getd(".guildinfo"+.@i+"$[0]"),getd(".guildinfo"+.@i+"[1]") );
  2253. if (.@restrict) {
  2254. deletearray getd(".guildinfo"+.@i+"$");
  2255. deletearray getd(".guildinfo"+.@i);
  2256. }
  2257. }
  2258. }
  2259.  
  2260. //Reorganizes arrays
  2261. set .@w, 0;
  2262. while (.@w < .maxgnum) {
  2263. if ( getarraysize(getd(".guildinfo"+.@w)) != 0 ) {
  2264. set .@i,.@w - 1;
  2265. while ( .@i >= 0 ) {
  2266. if (getarraysize(getd(".guildinfo"+.@i)) == 0) {
  2267.  
  2268. //Sets a new place for the array
  2269. //String Array
  2270. //Leader Name
  2271. setd ".guildinfo"+.@i+"$[0]", getd(".guildinfo"+.@w+"$[0]");
  2272. //Objective Inputted
  2273. setd ".guildinfo"+.@i+"$[1]", getd(".guildinfo"+.@w+"$[1]");
  2274. //Level Inputted
  2275. setd ".guildinfo"+.@i+"$[2]", getd(".guildinfo"+.@w+"$[2]");
  2276. //Description Inputted
  2277. setd ".guildinfo"+.@i+"$[3]", getd(".guildinfo"+.@w+"$[3]");
  2278. //Job Inputted
  2279. setd ".guildinfo"+.@i+"$[4]", getd(".guildinfo"+.@w+"$[4]");
  2280.  
  2281. //Numeric Array
  2282. //Bitmask
  2283. setd ".guildinfo"+.@i+"[0]", getd (".guildinfo"+.@w+"[0]");
  2284. //Guild ID
  2285. setd ".guildinfo"+.@i+"[1]", getd (".guildinfo"+.@w+"[1]");
  2286. //Equips
  2287. for (set .@n,2; .@n <= .@gmaxitem + 1; set .@n, .@n + 1) {
  2288. setd ".guildinfo"+.@i+"["+.@n+"]", getd (".guildinfo"+.@w+"["+.@n+"]");
  2289. }
  2290.  
  2291. //Deletes Old Array
  2292. deletearray getd(".guildinfo"+.@w+"$");
  2293. deletearray getd(".guildinfo"+.@w);
  2294. }
  2295. set .@i, .@i - 1;
  2296. }
  2297. }
  2298. set .@w, .@w + 1;
  2299. }
  2300.  
  2301.  
  2302. //Dynamic Menu
  2303. set .@cn,0;
  2304. set .@menu$,"";
  2305. for (set .@i,0; .@i < .maxgnum; set .@i, .@i + 1) {
  2306. if ((getarraysize(getd(".guildinfo"+.@i))) != 0) {
  2307. if (getcharid(0,getd(".guildinfo"+.@i+"$[0]")) == 0 ) {
  2308. set .@menu$, .@menu$ + ":" + "Guild- ^009900" + getguildname( getd(".guildinfo"+.@i+"[1]") ) + "^000000 (Leader- ^FF0000Off^000000)";
  2309. set .@cn,.@cn+1;
  2310. }
  2311. else{
  2312. set .@menu$, .@menu$ + ":" + "Guild- ^009900" + getguildname( getd(".guildinfo"+.@i+"[1]") ) + "^000000 (Leader- ^009900On^000000)";
  2313. set .@cn,.@cn+1;
  2314. }
  2315. }
  2316.  
  2317. }
  2318. set .@menu$, .@menu$ +":Cancel";
  2319. if (.@menu$ == ":Cancel" ) {
  2320. mes "["+strnpcinfo(1)+"]";
  2321. mes "Im sorry but there are no guilds avaible at the moment.";
  2322. close;
  2323. }
  2324. mes "["+strnpcinfo(1)+"]";
  2325. mes "Please select a guild registry, then I can provide you the avaible info regarding that guild.";
  2326. next;
  2327. set .@menu, select(.@menu$);
  2328. set .@menu, .@menu - 2;
  2329. for (set .@i, 0; .@i < .maxgnum; set .@i, .@i + 1) {
  2330. if (.@menu == .@cn) {
  2331. mes "["+strnpcinfo(1)+"]";
  2332. mes "Thank you for your time.";
  2333. close;
  2334. }
  2335. if (.@menu == .@i) {
  2336. if ( callfunc ( "checkrest#g1",getd(".guildinfo"+.@i+"$[0]"),getd(".guildinfo"+.@i+"[1]") ) ) {
  2337. deletearray getd(".guildinfo"+.@i+"$");
  2338. deletearray getd(".guildinfo"+.@i);
  2339. }
  2340. if (getarraysize(getd(".guildinfo"+.@i)) != 0 ) {
  2341.  
  2342. //Sets bitmask to guild's bitmask.
  2343. set .@bitmask, getd(".guildinfo"+.@i+"[0]");
  2344.  
  2345. //Guild Information
  2346. mes "["+strnpcinfo(1)+"]";
  2347.  
  2348. //Guild Name
  2349. mes "^000000Guild- ^99CC33" + getguildname(getd(".guildinfo"+.@i+"[1]"));
  2350. //Leader Avaible Information
  2351. if ( ( getd (".guildinfo"+.@i+"[0]") & pow (2,9) ) || ( getd (".guildinfo"+.@i+"[0]") & pow (2,10) ) || ( getd (".guildinfo"+.@i+"[0]") & pow (2,11) ) || ( .@bitmask & pow(2,7) ) ) {
  2352. mes "----- Leader Information -----";
  2353. //Leader Name
  2354. if ( .@bitmask & pow(2,7) )
  2355. mes "^000000Name- ^6633CC" + getd(".guildinfo"+.@i+"$[0]");
  2356. set .@leaderinfo$, callfunc("leaderinfo#g1", getd(".guildinfo"+.@i+"$[0]"), getd (".guildinfo"+.@i+"[0]"));
  2357. mes .@leaderinfo$;
  2358. mes "------------------------------";
  2359. }
  2360. //Objective
  2361. if ( getd (".guildinfo"+.@i+"$[1]") != "" ) {
  2362. mes "^000000Objective- ^33CC00" + getd(".guildinfo"+.@i+"$[1]");
  2363. }
  2364. //Level
  2365. if ( getd (".guildinfo"+.@i+"$[2]") != "" ) {
  2366. mes "^000000Levels- ^99CC33" + getd(".guildinfo"+.@i+"$[2]");
  2367. }
  2368. if ( getd (".guildinfo"+.@i+"$[4]") != "" ) {
  2369. //Jobs
  2370. mes "^000000Jobs- ^FF0033" + getd(".guildinfo"+.@i+"$[4]");
  2371. }
  2372. //Equips
  2373. for (set .@n,2; .@n <= .@gmaxitem + 1; set .@n, .@n + 1) {
  2374. if (getd (".guildinfo"+.@i+"["+.@n+"]") != 32767)
  2375. mes "^000000Equips- ^FF00CC" + getitemname( getd (".guildinfo"+.@i+"["+.@n+"]") );
  2376. }
  2377. //Castles
  2378. if ( getd (".guildinfo"+.@i+"[0]") & pow (2,8) ) {
  2379. set .@castles$, callfunc("castles#g1", getd(".guildinfo"+.@i+"[1]") );
  2380. if ( (.@castles$) == "" )
  2381. set .@castles$,"None";
  2382. mes "^000000Castles- ^3399FF" + .@castles$;
  2383. }
  2384. //Description
  2385. if ( getd (".guildinfo"+.@i+"$[3]") != "" ) {
  2386. mes "^000000Description- ^996600" + getd(".guildinfo"+.@i+"$[3]");
  2387. }
  2388. mes "^000000";
  2389.  
  2390.  
  2391. //Dynamic Menu Selection
  2392. set .@menu, callfunc ("calcmenu#g2",getd(".guildinfo"+.@i+"[0]"));
  2393. // set .@menu, .@menu + 1;
  2394. //Checks the maximum menu
  2395. set .@maxmenu, 1;
  2396. set .@tempbit, 0;
  2397. for (set .@p, 0; .@p < .maxbitn ; set .@p, .@p + 1) {
  2398. set .@o, pow (2,.@p);
  2399. if ( getd (".guildinfo"+.@i+"[0]") & (.@o) ) {
  2400. if ( (.@p == 0 ) || (.@p == 2) || (.@p == 3) || (.@p == 12) ) {
  2401. set .@maxmenu, .@maxmenu + 1;
  2402.  
  2403. //Makes a temporary bitmask reorganized
  2404. if (.@p == 0)
  2405. set .@tempbit, .@tempbit | pow(2,2);
  2406. if (.@p == 2)
  2407. set .@tempbit, .@tempbit | pow(2,1);
  2408. if (.@p == 3)
  2409. set .@tempbit, .@tempbit | pow(2,3);
  2410. if (.@p == 12)
  2411. set .@tempbit, .@tempbit | pow(2,0);
  2412. }
  2413. }
  2414. }
  2415.  
  2416. //Breaks for "Back" Menu
  2417. if (.@menu == .@maxmenu) {
  2418. next;
  2419. break;
  2420. }
  2421.  
  2422. //Resets Negates
  2423. for (set .@t, 1; .@t < .@maxmenu ; set .@t, .@t + 1) {
  2424. setd ".@negate"+.@t, 0;
  2425. }
  2426.  
  2427. //Change this value for menu modifications.
  2428. //Input the ABSOLUTE maximum value for this dynamic menu.
  2429. //Remember to also change the number of negates!
  2430. set .@totalmax, 5;
  2431.  
  2432. //Checks ammounts of shifts for each menu
  2433. for (set .@t, 1; .@t < .@maxmenu ; set .@t, .@t + 1) {
  2434. if ( ( .@tempbit & pow(2,(.@t - 1)) ) == 0 ) {
  2435. for (set .@k, (.@t + 1) ; .@k < .@totalmax ; set .@k, .@k + 1) {
  2436. if ( ( .@tempbit & pow(2,(.@k - 1)) ) != 0 ) {
  2437. setd ".@negate"+.@t, .@k - .@t;
  2438. set .@tempbit, .@tempbit ^ pow(2,(.@k - 1));
  2439. break;
  2440. }
  2441. }
  2442. }
  2443. }
  2444.  
  2445. //Readapt menu to the ammount of shifts
  2446. for (set .@t, 1; .@t < .@maxmenu ; set .@t, .@t + 1) {
  2447. if (.@menu == .@t)
  2448. set .@menu, .@menu + getd(".@negate"+.@t);
  2449. }
  2450.  
  2451. next;
  2452. if ( (.@menu != 99) || (.@menu != 98) ) {
  2453.  
  2454. //---------------------------------------------------------------------------------------------------------
  2455. //--------------------------------------- Announce to Leader ----------------------------------------------
  2456. //---------------------------------------------------------------------------------------------------------
  2457.  
  2458. if (.@menu == 0) {
  2459. if ( (getcharid(0,getd(".guildinfo"+.@i+"$[0]"))) && (!callfunc("checkrest#g1",getd(".guildinfo"+.@i+"$[0]"),getd(".guildinfo"+.@i+"[1]"))) ) {
  2460. callfunc("leaderanno#g1", getd(".guildinfo"+.@i+"$[0]"), getd (".guildinfo"+.@i+"[0]"), getd (".guildinfo"+.@i+"[1]"), .gannocd );
  2461. break;
  2462. }
  2463. else {
  2464. mes "["+strnpcinfo(1)+"]";
  2465. mes "I'm sorry but it seems that the Guild Leader has just become unavailable.";
  2466. next;
  2467. break;
  2468. }
  2469. }
  2470.  
  2471. //---------------------------------------------------------------------------------------------------------
  2472. //--------------------------------------- Warp to Leader --------------------------------------------------
  2473. //---------------------------------------------------------------------------------------------------------
  2474.  
  2475. if ((.@menu + .@negate1) == 1) {
  2476. if ( (getcharid(0,getd(".guildinfo"+.@i+"$[0]"))) && (!callfunc("checkrest#g1",getd(".guildinfo"+.@i+"$[0]"),getd(".guildinfo"+.@i+"[1]") )) ) {
  2477. //Sets the variable into permanent one, to survive the doevent.
  2478. set .i2, .@i;
  2479. if ( (getd (".guildinfo"+.@i+"[0]") & (pow(2,13))) == 0)
  2480. doevent strnpcinfo(0)+"::OnGCount";
  2481. callfunc("leaderwarp#g1", getd(".guildinfo"+.@i+"$[0]"), getd (".guildinfo"+.@i+"[0]"), getd (".guildinfo"+.@i+"[1]") );
  2482. break;
  2483.  
  2484. OnRequest:
  2485. disable_items;
  2486. set .@leadertime, gettimetick(2) + .gwdelay;
  2487. //Leader Display Part 2
  2488. if (prompt ("Accept:Refuse") == 1) {
  2489. if (.@leadertime > gettimetick(2)) {
  2490. set .request, 2;
  2491. }
  2492. else {
  2493. next;
  2494. mes "["+strnpcinfo(1)+"]";
  2495. mes "Sorry but the time for answering has ran out. The warp is no longer avaible.";
  2496. }
  2497. }
  2498. else if (@menu == 2) {
  2499. if (.@leadertime > gettimetick(2)) {
  2500. set .request, 1;
  2501. }
  2502. else {
  2503. next;
  2504. mes "["+strnpcinfo(1)+"]";
  2505. mes "Sorry but the time for answering has ran out. The warp is no longer avaible.";
  2506. }
  2507. }
  2508. else {
  2509. if (.@leadertime > gettimetick(2)) {
  2510. set .request, 1;
  2511. }
  2512. end;
  2513. }
  2514. set .@leadertime, 0;
  2515. enable_items;
  2516. close;
  2517.  
  2518.  
  2519. //Threading
  2520. OnGCount:
  2521. //User Display Part
  2522. set .@i, .i2;
  2523. set .i2, 0;
  2524. set .@rid, getcharid(3);
  2525. set .@request, 0;
  2526. mes "["+strnpcinfo(1)+"]";
  2527. mes "Please ^0000FFWait^000000 while the Guild Leader accepts the warp.";
  2528. mes "Time Left: ";
  2529. set .@delaytime, gettimetick(2) + .gwdelay;
  2530. while (1) {
  2531. attachrid (.@rid);
  2532. if (.@rid == 0)
  2533. end;
  2534. disable_items;
  2535. if (.@delaytime > gettimetick(2)) {
  2536. mes "^FF0000" + ( .@delaytime - gettimetick(2) ) + "^000000 seconds...";
  2537. sleep2 990;
  2538. if (.request == 2) {
  2539. set .request, 0;
  2540. set .@rid, getcharid(3);
  2541. getmapxy .@m$,.@x,.@y, 0, getd(".guildinfo"+.@i+"$[0]");
  2542. attachrid(.@rid);
  2543. enable_items;
  2544. warp .@m$,.@x,.@y;
  2545. end;
  2546. }
  2547. if (.request == 1) {
  2548. set .request, 0;
  2549. enable_items;
  2550. next;
  2551. mes "["+strnpcinfo(1)+"]";
  2552. mes "Sorry but the Guild Leader has refused your warp request.";
  2553. close;
  2554. }
  2555. }
  2556. else {
  2557. enable_items;
  2558. next;
  2559. mes "["+strnpcinfo(1)+"]";
  2560. mes "Sorry but It seems the Guild Leader is not answering the request.";
  2561. close;
  2562. }
  2563. }
  2564. }
  2565. else {
  2566. mes "["+strnpcinfo(1)+"]";
  2567. mes "I'm sorry but it seems that the Guild Leader has just become unavailable.";
  2568. next;
  2569. break;
  2570. }
  2571. }
  2572.  
  2573. //---------------------------------------------------------------------------------------------------------
  2574. //----------------------------------------- Spy Guild Chat ------------------------------------------------
  2575. //---------------------------------------------------------------------------------------------------------
  2576.  
  2577. if ((.@menu + .@negate2) == 2) {
  2578. if ( !callfunc("checkrest#g1",getd(".guildinfo"+.@i+"$[0]"),getd(".guildinfo"+.@i+"[1]") ) ) {
  2579. callfunc("spychat#g1", getd(".guildinfo"+.@i+"[1]"), getd (".guildinfo"+.@i+"$[0]") );
  2580. next;
  2581. break;
  2582. }
  2583. else {
  2584. mes "["+strnpcinfo(1)+"]";
  2585. mes "I'm sorry but it seems that the Guild has just become unavailable.";
  2586. next;
  2587. break;
  2588. }
  2589. }
  2590.  
  2591. //---------------------------------------------------------------------------------------------------------
  2592. //------------------------------------------- List Members ------------------------------------------------
  2593. //---------------------------------------------------------------------------------------------------------
  2594.  
  2595. if ((.@menu + .@negate3) == 3) {
  2596. if ( !callfunc("checkrest#g1",getd(".guildinfo"+.@i+"$[0]"),getd(".guildinfo"+.@i+"[1]") ) ) {
  2597.  
  2598.  
  2599.  
  2600.  
  2601. //This function is very similar to "Map Member Search"
  2602. //Due to the functions limitations, I won't be using it for this menu selection.
  2603.  
  2604. if (.@bitmask & pow(2,0)) {
  2605. mes "["+strnpcinfo(1)+"]";
  2606. mes "Please wait while the member list is being loaded.";
  2607.  
  2608. //Looks through all accounts for the users in map, then looks if they're in guild.
  2609. set .@p, 2000000;
  2610. set .@j, 0;
  2611. set .@rid, getcharid(3);
  2612. detachrid;
  2613. while ( .@p < 2010000 ) {
  2614. if ( .@p % 500 == 0 ) sleep .sleeptime; // prevent infinite loop
  2615. if ( attachrid(.@p) ) {
  2616. attachrid(.@p);
  2617. if (getcharid(2) == getd(".guildinfo"+.@i+"[1]")) {
  2618. getmapxy .@m$, .@x, .@y, 0;
  2619. //Display Member Name
  2620. setd ".@name$["+.@j+"]", strcharinfo(0);
  2621. //Display Member Level
  2622. if ( .@bitmask & pow(2,4) )
  2623. setd ".@lvl["+.@j+"]", BaseLevel;
  2624. //Display Member Job
  2625. if ( .@bitmask & pow(2,5) )
  2626. setd ".@job$["+.@j+"]", jobname(Class);
  2627. //Display Member Location
  2628. if ( .@bitmask & pow(2,6) )
  2629. setd ".@loc$["+.@j+"]", "^2FE954" + .@m$ + " ^000000(^996600" + .@x + "^000000, ^996600" + .@y + "^000000)";
  2630. set .@j, .@j + 1;
  2631. }
  2632. }
  2633. set .@p, .@p +1;
  2634. }
  2635. //Attaches back the rid.
  2636. attachrid(.@rid);
  2637.  
  2638. //Sets the found variables into permanent ones
  2639. //So that they aren't lost upon the doevent.
  2640. for (set .@h, 0; .@h < .@j ; set .@h, .@h + 1) {
  2641. setd ".name2$["+.@h+"]", getd (".@name$["+.@h+"]");
  2642. if ( .@bitmask & pow(2,4) )
  2643. setd ".lvl2["+.@h+"]", getd (".@lvl["+.@h+"]");
  2644. if ( .@bitmask & pow(2,5) )
  2645. setd ".job2$["+.@h+"]", getd (".@job$["+.@h+"]");
  2646. if ( .@bitmask & pow(2,6) )
  2647. setd ".loc2$["+.@h+"]", getd (".@loc$["+.@h+"]");
  2648. }
  2649. set .j2, .@j;
  2650. set .i3, .@i;
  2651. set .tbitmask2, .@bitmask;
  2652.  
  2653. //Does THE Event.
  2654. //No temporary variable has ever survived it...
  2655. doevent strnpcinfo(0) + "::OnContinue6";
  2656. end;
  2657.  
  2658. OnContinue6:
  2659.  
  2660. //Resets the variables into temporary ones.
  2661. set .@j, .j2;
  2662. set .@bitmask, .tbitmask2;
  2663. set .@i, .i3;
  2664. for (set .@h, 0; .@h < .@j ; set .@h, .@h + 1) {
  2665. setd ".@name$["+.@h+"]", getd (".name2$["+.@h+"]");
  2666. if ( .@bitmask & pow(2,4) )
  2667. setd ".@lvl["+.@h+"]", getd (".lvl2["+.@h+"]");
  2668. if ( .@bitmask & pow(2,5) )
  2669. setd ".@job$["+.@h+"]", getd (".job2$["+.@h+"]");
  2670. if ( .@bitmask & pow(2,6) )
  2671. setd ".@loc$["+.@h+"]", getd (".loc2$["+.@h+"]");
  2672. }
  2673.  
  2674.  
  2675. //Deletes the permanent variables.
  2676. set .j2, 0;
  2677. set .i3, 0;
  2678. set .tbitmask2, 0;
  2679. deletearray .name2$;
  2680. deletearray .lvl2;
  2681. deletearray .job2$;
  2682. deletearray .loc2$;
  2683. next;
  2684.  
  2685. }
  2686. else {
  2687. mes "["+strnpcinfo(1)+"]";
  2688. mes "Sorry but this guild registry has been cancelled.";
  2689. close;
  2690. }
  2691.  
  2692. mes "["+strnpcinfo(1)+"]";
  2693. if ( (.@bitmask & pow(2,4)) || (.@bitmask & pow(2,5)) || (.@bitmask & pow(2,6)) || (.@bitmask & pow(2,1)) )
  2694. mes "Please select a member for further info.";
  2695. else {
  2696. for (set .@u, 0; .@u < .@j ; set .@u, .@u + 1){
  2697. if ( ( getd(".@name$["+.@u+"]") == getd(".guildinfo"+.@i+"$[0]") ) && (.@bitmask & pow(2,7)) )
  2698. mes "0000FF" + getd(".@name$["+.@u+"]") + " (^FF0000Leader^000000)";
  2699. else
  2700. mes "^0000FF" + getd(".@name$["+.@u+"]");
  2701. }
  2702. next;
  2703. break;
  2704. }
  2705.  
  2706. set .@menu$, "";
  2707. for (set .@u, 0; .@u < .@j ; set .@u, .@u + 1){
  2708. if ( ( getd(".@name$["+.@u+"]") == getd(".guildinfo"+.@i+"$[0]") ) && (.@bitmask & pow(2,7)) ) {
  2709. set .@menu$, .@menu$ + ":" + getd(".@name$["+.@u+"]") + " (^FF0000Leader^000000)";
  2710. }
  2711. else
  2712. set .@menu$, .@menu$ + ":" + getd(".@name$["+.@u+"]");
  2713. }
  2714.  
  2715. next;
  2716. set .@menu, select (.@menu$);
  2717. set .@menu, .@menu - 2;
  2718. set .@j, .@menu;
  2719. set .@c, .@menu;
  2720.  
  2721. //Checks for Guild Avaibility
  2722. if ( callfunc("checkrest#g1",getd(".guildinfo"+.@i+"$[0]"),getd(".guildinfo"+.@i+"[1]") ) ) {
  2723. mes "["+strnpcinfo(1)+"]";
  2724. mes "Sorry but the Guild is no longer available.";
  2725. close;
  2726. }
  2727.  
  2728. //Checks for Offline member
  2729. if (!getcharid(3,getd(".@name$["+.@j+"]"))) {
  2730. mes "["+strnpcinfo(1)+"]";
  2731. mes "Sorry but the Player has just logged off. This function has been terminated.";
  2732. close;
  2733. }
  2734.  
  2735. if ( (.@bitmask & pow(2,4)) || (.@bitmask & pow(2,5)) || (.@bitmask & pow(2,6)) || (.@bitmask & pow(2,1)) ) {
  2736. mes "["+strnpcinfo(1)+"]";
  2737. if ( ( getd(".@name$["+.@c+"]") == getd(".guildinfo"+.@i+"$[0]") ) && (.@bitmask & pow(2,7)) )
  2738. mes "^FF0000Leader^000000- ^0000FF" + getd(".@name$["+.@j+"]") + "^000000";
  2739. else
  2740. mes "Member- ^0000FF" + getd(".@name$["+.@j+"]") + "^000000";
  2741. }
  2742. if (.@bitmask & pow(2,4))
  2743. mes "Level- ^99CC33" + getd(".@lvl["+.@j+"]") + "^000000";
  2744. if (.@bitmask & pow(2,5))
  2745. mes "Job- ^FF0033" + getd(".@job$["+.@j+"]") + "^000000";
  2746. if (.@bitmask & pow(2,6))
  2747. mes "Location- " + getd(".@loc$["+.@j+"]");
  2748.  
  2749. set .@menu$, "";
  2750. set .@menu, 0;
  2751. if (.@bitmask & pow(2,1)) {
  2752. if ( ( getd(".@name$["+.@c+"]") == getd(".guildinfo"+.@i+"$[0]") ) && (.@bitmask & pow(2,7)) )
  2753. set .@menu$, .@menu$ + ":Announce to ^FF0000Leader^000000";
  2754. else
  2755. set .@menu$, .@menu$ + ":Announce to Member";
  2756. }
  2757. set .@menu$, .@menu$ + ":^0000FFBack^000000";
  2758. next;
  2759. set .@menu, select(.@menu$);
  2760. set .@menu, .@menu - 1;
  2761.  
  2762. //Check for Guild Avaibility
  2763. if ( callfunc("checkrest#g1",getd(".guildinfo"+.@i+"$[0]"),getd(".guildinfo"+.@i+"[1]") ) ) {
  2764. mes "["+strnpcinfo(1)+"]";
  2765. mes "Sorry but the Guild is no longer available.";
  2766. close;
  2767. }
  2768.  
  2769. //Checks for Offline member
  2770. if (!getcharid(3,getd(".@name$["+.@j+"]"))) {
  2771. mes "["+strnpcinfo(1)+"]";
  2772. mes "Sorry but the Player has just logged off. This function has been terminated.";
  2773. close;
  2774. }
  2775.  
  2776. if ( (.@menu == 1) && (.@bitmask & pow(2,1)) ) {
  2777. mes "["+strnpcinfo(1)+"]";
  2778. if ( ( getd(".@name$["+.@c+"]") == getd(".guildinfo"+.@i+"$[0]") ) && (.@bitmask & pow(2,7)) )
  2779. mes "You have been announced to the Guild ^FF0000Leader^000000 ^0000FF"+getd(".@name$["+.@j+"]")+"^000000.";
  2780. else
  2781. mes "You have been announced to the Guild Member ^0000FF"+getd(".@name$["+.@j+"]")+"^000000.";
  2782. set .@pname$, strcharinfo(0);
  2783. set .@plvl, BaseLevel;
  2784. set .@job$, jobname(Class);
  2785. set @g_announce, gettimetick(2) + @announcecd;
  2786. close2;
  2787. attachrid (getcharid(3,getd(".@name$["+.@j+"]")));
  2788. announce .@name$+" level "+.@lvl+" job "+.@job$+" wants to join your guild.",bc_self,0x2FE954,0,0,0;
  2789. end;
  2790. }
  2791. if ( (.@menu == 2) && (.@bitmask & pow(2,1)) ) {
  2792. //Deletes Arrays
  2793. deletearray .@name$;
  2794. deletearray .@lvl;
  2795. deletearray .@job$;
  2796. deletearray .@loc$;
  2797. break;
  2798. }
  2799. if (.@menu == 1) {
  2800. //Deletes Arrays
  2801. deletearray .@name$;
  2802. deletearray .@lvl;
  2803. deletearray .@job$;
  2804. deletearray .@loc$;
  2805. break;
  2806. }
  2807.  
  2808. //Deletes Arrays
  2809. deletearray .@name$;
  2810. deletearray .@lvl;
  2811. deletearray .@job$;
  2812. deletearray .@loc$;
  2813. break;
  2814.  
  2815.  
  2816.  
  2817.  
  2818. }
  2819. else {
  2820. mes "["+strnpcinfo(1)+"]";
  2821. mes "I'm sorry but it seems that the Guild has just become unavailable.";
  2822. next;
  2823. break;
  2824. }
  2825. }
  2826.  
  2827. //---------------------------------------------------------------------------------------------------------
  2828. //--------------------------------------- Map Member Search -----------------------------------------------
  2829. //---------------------------------------------------------------------------------------------------------
  2830.  
  2831. if ((.@menu + .@negate4) == 4) {
  2832. if ( !callfunc("checkrest#g1",getd(".guildinfo"+.@i+"$[0]"),getd(".guildinfo"+.@i+"[1]") ) ) {
  2833.  
  2834. //Due to the functions limitations, I won't be using it for this menu selection.
  2835.  
  2836. mes "["+strnpcinfo(1)+"]";
  2837. mes "Please write the map name, then I will search for ammount of guild members inside that map.";
  2838. next;
  2839. input .@map$;
  2840.  
  2841. //Looks through all accounts for the users in map, then looks if they're in guild.
  2842. if (getmapguildusers (.@map$,getd(".guildinfo"+.@i+"[1]")) > 0) {
  2843. if ( (.@bitmask & pow(2,4)) || (.@bitmask & pow(2,5)) || (.@bitmask & pow(2,6)) || (.@bitmask & pow(2,1)) ) {
  2844. mes "["+strnpcinfo(1)+"]";
  2845. mes "Please wait while the map is being scanned.";
  2846. set .@p, 2000000;
  2847. set .@j, 0;
  2848. set .@rid, getcharid(3);
  2849. detachrid;
  2850. while ( .@p < 2010000 ) {
  2851. if ( .@p % 500 == 0 ) sleep .sleeptime; // prevent infinite loop
  2852. if ( attachrid(.@p) ) {
  2853. attachrid(.@p);
  2854. getmapxy .@m$, .@x, .@y, 0;
  2855. if ( .@m$ == .@map$) {
  2856. if (getcharid(2) == getd(".guildinfo"+.@i+"[1]")) {
  2857. //Display Member Name
  2858. setd ".@name$["+.@j+"]", strcharinfo(0);
  2859. //Display Member Level
  2860. if ( .@bitmask & pow(2,4) )
  2861. setd ".@lvl["+.@j+"]", BaseLevel;
  2862. //Display Member Job
  2863. if ( .@bitmask & pow(2,5) )
  2864. setd ".@job$["+.@j+"]", jobname(Class);
  2865. //Display Member Location
  2866. if ( .@bitmask & pow(2,6) )
  2867. setd ".@loc$["+.@j+"]", .@x + ", " + .@y;
  2868. set .@j, .@j + 1;
  2869. }
  2870. }
  2871. }
  2872. set .@p, .@p +1;
  2873. }
  2874. //Attaches back the rid.
  2875. attachrid(.@rid);
  2876.  
  2877. //Sets the found variables into permanent ones
  2878. //So that they aren't lost upon the doevent.
  2879. for (set .@h, 0; .@h < .@j ; set .@h, .@h + 1) {
  2880. setd ".name$["+.@h+"]", getd (".@name$["+.@h+"]");
  2881. if ( .@bitmask & pow(2,4) )
  2882. setd ".lvl["+.@h+"]", getd (".@lvl["+.@h+"]");
  2883. if ( .@bitmask & pow(2,5) )
  2884. setd ".job$["+.@h+"]", getd (".@job$["+.@h+"]");
  2885. if ( .@bitmask & pow(2,6) )
  2886. setd ".loc$["+.@h+"]", getd (".@loc$["+.@h+"]");
  2887. }
  2888. set .j, .@j;
  2889. set .i, .@i;
  2890. set .tbitmask, .@bitmask;
  2891. set .map$, .@map$;
  2892.  
  2893. //Does THE Event.
  2894. //No temporary variable has ever survived it...
  2895. doevent strnpcinfo(0) + "::OnContinue5";
  2896. end;
  2897.  
  2898. OnContinue5:
  2899.  
  2900. //Resets the variables into temporary ones.
  2901. set .@j, .j;
  2902. set .@bitmask, .tbitmask;
  2903. set .@i, .i;
  2904. set .@map$, .map$;
  2905. for (set .@h, 0; .@h < .@j ; set .@h, .@h + 1) {
  2906. setd ".@name$["+.@h+"]", getd (".name$["+.@h+"]");
  2907. if ( .@bitmask & pow(2,4) )
  2908. setd ".@lvl["+.@h+"]", getd (".lvl["+.@h+"]");
  2909. if ( .@bitmask & pow(2,5) )
  2910. setd ".@job$["+.@h+"]", getd (".job$["+.@h+"]");
  2911. if ( .@bitmask & pow(2,6) )
  2912. setd ".@loc$["+.@h+"]", getd (".loc$["+.@h+"]");
  2913. }
  2914.  
  2915.  
  2916. //Deletes the permanent variables.
  2917. set .map$, "";
  2918. set .j, 0;
  2919. set .i, 0;
  2920. set .tbitmask, 0;
  2921. deletearray .name$;
  2922. deletearray .lvl;
  2923. deletearray .job$;
  2924. deletearray .loc$;
  2925. next;
  2926.  
  2927. }
  2928. }
  2929. else {
  2930. mes "["+strnpcinfo(1)+"]";
  2931. mes "No users from ^009900"+getguildname(getd(".guildinfo"+.@i+"[1]"))+"^000000 Guild were found in the selected map.";
  2932. next;
  2933. break;
  2934. }
  2935.  
  2936. mes "["+strnpcinfo(1)+"]";
  2937. mes "Guild Members in ^009900"+.@map$+" : ^FF0000"+ getmapguildusers (.@map$,getd(".guildinfo"+.@i+"[1]")) +"^000000";
  2938. if ( (.@bitmask & pow(2,4)) || (.@bitmask & pow(2,5)) || (.@bitmask & pow(2,6)) || (.@bitmask & pow(2,1)) )
  2939. mes "Please select a member for further info.";
  2940. else {
  2941. next;
  2942. break;
  2943. }
  2944.  
  2945. set .@menu$, "";
  2946. for (set .@u, 0; .@u < .@j ; set .@u, .@u + 1){
  2947. if ( ( getd(".@name$["+.@u+"]") == getd(".guildinfo"+.@i+"$[0]") ) && (.@bitmask & pow(2,7)) ) {
  2948. set .@menu$, .@menu$ + ":" + getd(".@name$["+.@u+"]") + " (^FF0000Leader^000000)";
  2949. }
  2950. else
  2951. set .@menu$, .@menu$ + ":" + getd(".@name$["+.@u+"]");
  2952. }
  2953.  
  2954. next;
  2955. set .@menu, select (.@menu$);
  2956. set .@menu, .@menu - 2;
  2957. set .@j, .@menu;
  2958. set .@c, .@menu;
  2959.  
  2960. //Checks for Guild Avaibility
  2961. if ( callfunc("checkrest#g1",getd(".guildinfo"+.@i+"$[0]"),getd(".guildinfo"+.@i+"[1]") ) ) {
  2962. mes "["+strnpcinfo(1)+"]";
  2963. mes "Sorry but the Guild is no longer available.";
  2964. close;
  2965. }
  2966.  
  2967. //Checks for Offline member
  2968. if (!getcharid(3,getd(".@name$["+.@j+"]"))) {
  2969. mes "["+strnpcinfo(1)+"]";
  2970. mes "Sorry but the Player has just logged off. This function has been terminated.";
  2971. close;
  2972. }
  2973.  
  2974. if ( (.@bitmask & pow(2,4)) || (.@bitmask & pow(2,5)) || (.@bitmask & pow(2,6)) || (.@bitmask & pow(2,1)) ) {
  2975. mes "["+strnpcinfo(1)+"]";
  2976. if ( ( getd(".@name$["+.@c+"]") == getd(".guildinfo"+.@i+"$[0]") ) && (.@bitmask & pow(2,7)) )
  2977. mes "^FF0000Leader^000000- ^0000FF" + getd(".@name$["+.@j+"]") + "^000000";
  2978. else
  2979. mes "Member- ^0000FF" + getd(".@name$["+.@j+"]") + "^000000";
  2980. }
  2981. if (.@bitmask & pow(2,4))
  2982. mes "Level- ^99CC33" + getd(".@lvl["+.@j+"]") + "^000000";
  2983. if (.@bitmask & pow(2,5))
  2984. mes "Job- ^FF0033" + getd(".@job$["+.@j+"]") + "^000000";
  2985. if (.@bitmask & pow(2,6))
  2986. mes "Coords- (^996600" + getd(".@loc$["+.@j+"]") + "^000000)";
  2987.  
  2988. set .@menu$, "";
  2989. set .@menu, 0;
  2990. if (.@bitmask & pow(2,1)) {
  2991. if ( ( getd(".@name$["+.@c+"]") == getd(".guildinfo"+.@i+"$[0]") ) && (.@bitmask & pow(2,7)) )
  2992. set .@menu$, .@menu$ + ":Announce to ^FF0000Leader^000000";
  2993. else
  2994. set .@menu$, .@menu$ + ":Announce to Member";
  2995. }
  2996. set .@menu$, .@menu$ + ":^0000FFBack^000000";
  2997. next;
  2998. set .@menu, select(.@menu$);
  2999. set .@menu, .@menu - 1;
  3000.  
  3001. //Check for Guild Avaibility
  3002. if ( callfunc("checkrest#g1",getd(".guildinfo"+.@i+"$[0]"),getd(".guildinfo"+.@i+"[1]") ) ) {
  3003. mes "["+strnpcinfo(1)+"]";
  3004. mes "Sorry but the Guild is no longer available.";
  3005. close;
  3006. }
  3007.  
  3008. //Checks for Offline member
  3009. if (!getcharid(3,getd(".@name$["+.@j+"]"))) {
  3010. mes "["+strnpcinfo(1)+"]";
  3011. mes "Sorry but the Player has just logged off. This function has been terminated.";
  3012. close;
  3013. }
  3014.  
  3015. if ( (.@menu == 1) && (.@bitmask & pow(2,1)) ) {
  3016. mes "["+strnpcinfo(1)+"]";
  3017. if ( ( getd(".@name$["+.@c+"]") == getd(".guildinfo"+.@i+"$[0]") ) && (.@bitmask & pow(2,7)) )
  3018. mes "You have been announced to the Guild ^FF0000Leader^000000 ^0000FF"+getd(".@name$["+.@j+"]")+"^000000.";
  3019. else
  3020. mes "You have been announced to the Guild Member ^0000FF"+getd(".@name$["+.@j+"]")+"^000000.";
  3021. set .@pname$, strcharinfo(0);
  3022. set .@plvl, BaseLevel;
  3023. set .@job$, jobname(Class);
  3024. set @g_announce, gettimetick(2) + @announcecd;
  3025. close2;
  3026. attachrid (getcharid(3,getd(".@name$["+.@j+"]")));
  3027. announce .@name$+" level "+.@lvl+" job "+.@job$+" wants to join your guild.",bc_self,0x2FE954,0,0,0;
  3028. end;
  3029. }
  3030. if ( (.@menu == 2) && (.@bitmask & pow(2,1)) ) {
  3031. //Deletes Arrays
  3032. deletearray .@name$;
  3033. deletearray .@lvl;
  3034. deletearray .@job$;
  3035. deletearray .@loc$;
  3036. break;
  3037. }
  3038. if (.@menu == 1) {
  3039. //Deletes Arrays
  3040. deletearray .@name$;
  3041. deletearray .@lvl;
  3042. deletearray .@job$;
  3043. deletearray .@loc$;
  3044. break;
  3045. }
  3046.  
  3047. //Deletes Arrays
  3048. deletearray .@name$;
  3049. deletearray .@lvl;
  3050. deletearray .@job$;
  3051. deletearray .@loc$;
  3052. break;
  3053.  
  3054. }
  3055. else {
  3056. mes "["+strnpcinfo(1)+"]";
  3057. mes "I'm sorry but it seems that the Guild has just become unavailable.";
  3058. next;
  3059. break;
  3060. }
  3061. }
  3062.  
  3063. //Please Add Additionals Menu Here, For NPC Modifying.
  3064.  
  3065. else {
  3066. mes "["+strnpcinfo(1)+"]";
  3067. mes "^FF0000Critical Error^000000 This Function has been terminated.";
  3068. mes "^0000FFDebug:^000000 The number of menus is smaller than it should be.";
  3069. close;
  3070. }
  3071. }
  3072. else if (.@menu == 99)
  3073. break;
  3074. else if (.@menu == 98) {
  3075. mes "["+strnpcinfo(1)+"]";
  3076. mes "^FF0000Critical Error^000000 This Function has been terminated.";
  3077. mes "^0000FFDebug:^000000 Please Modify your ^FF0000.@maxmenu^000000 variable under ^009900calcmenu#g2^000000 function.";
  3078. close;
  3079. }
  3080. }
  3081. else {
  3082. mes "["+strnpcinfo(1)+"]";
  3083. mes "I'm Sorry but this Guild Registry has been cancelled.";
  3084. next;
  3085. break;
  3086. }
  3087. }
  3088. }
  3089. }
  3090. }
  3091. }
  3092. }
  3093.  
  3094. L_ultimatecheck:
  3095. if (.@restrict == 2) {
  3096. next;
  3097. mes "["+strnpcinfo(1)+"]";
  3098. mes "Im sorry but this registration has been cancelled. Therefore this function has failed.";
  3099. deletearray getd(".partyinfo"+.@pupnow+"$");
  3100. deletearray getd(".partyinfo"+.@pupnow);
  3101. }
  3102. else if (.@restrict == 3) {
  3103. mes "["+strnpcinfo(1)+"]";
  3104. mes "Im sorry but the Party Leader (^0000FF"+getd(".partyinfo"+.@pupnow+"$[4]")+"^000000) is currently ^FF0000Offline^000000";
  3105. }
  3106. next;
  3107. set .@menu$,"";
  3108. goto L_return;
  3109.  
  3110. OnTimer1800000:
  3111. for (set .@don,0; .@don <.@maxptnum ; set .@don,.@don + 1){
  3112. if (getarraysize(getd(".partyinfo"+.@don+"$")) != 0){
  3113. if (getcharid(0,getd(".partyinfo"+.@don+"$[4]")) == 0){
  3114. deletearray getd(".partyinfo"+.@don+"$");
  3115. deletearray getd(".partyinfo"+.@don);
  3116. attachrid (getcharid(3,getd(".partyinfo"+.@don+"$[4]")));
  3117. setd "puprdy"+.@don,0;
  3118. }
  3119. }
  3120. }
  3121. npctalk "Parties Refreshed";
  3122. initnpctimer;
  3123. end;
  3124.  
  3125. OnInit:
  3126. //thanks to AnnieRuru for the attachrid on all accs
  3127. set .reload,1;
  3128. set .@i, 2000000;
  3129. while ( .@i < 2010000 ) {
  3130. if ( .@i % 500 == 0 ) sleep 50;
  3131. if ( attachrid(.@i) ) {
  3132. for (set .@dun,0; .@dun <.@maxptnum; set .@dun,.@dun+1){
  3133. if (getd("puprdy"+.@dun) == 1) setd "puprdy"+.@dun,0;
  3134. }
  3135. }
  3136. set .@i, .@i +1;
  3137. }
  3138. set .reload,0;
  3139. startnpctimer;
  3140. end;
  3141.  
  3142. }
  3143.  
  3144. //---------------------------------------------------------------------------------------------------------
  3145. //------------------------------------------- Functions ---------------------------------------------------
  3146. //---------------------------------------------------------------------------------------------------------
  3147.  
  3148. function script checkonline#pt1 {
  3149.  
  3150. if (getarg(0) != 99) {
  3151. if (getcharid(0,getarg(1)) == 0) {
  3152. return 3;
  3153. }
  3154. if ( (getcharid(0,getarg(1)) != getpartyleader(getarg(2),2)) || (getcharid(1,getarg(1)) == 0) || (getcharid(1,getarg(1)) != getarg(2)) ) {
  3155. return 2;
  3156. }
  3157. }
  3158. else {
  3159. if (getcharid(0,getarg(1)) != 0) {
  3160. if ( (getcharid(1,getarg(1)) == 0) || (getcharid(0,getarg(1)) != getpartyleader(getarg(2),2)) || (getcharid(1,getarg(1)) != getarg(2)) ){
  3161. return 1;
  3162. }
  3163. }
  3164. }
  3165.  
  3166. return 0;
  3167. }
  3168.  
  3169. //Receives :
  3170. //Max Loops (Number of Menus), Max Selections (Options), Menu1,Menu2,Menu3...
  3171. //Returns Selection of Menus in a string.
  3172.  
  3173. function script calcmenu#g1 {
  3174.  
  3175. set .@menu3$,"";
  3176. set .@maxopt, getarg(1);
  3177.  
  3178. while (1) {
  3179.  
  3180. next;
  3181. mes "["+strnpcinfo(1)+"]";
  3182. mes "You can select ^FF0000"+.@maxopt+"^000000 more "+getarg(2)+", and then confirm.";
  3183. mes "Current "+getarg(2)+" :";
  3184. mes "^FF0000"+.@return$+"^000000";
  3185.  
  3186. set .@menu3$,"";
  3187. for (set .@i,0; .@i < getarg(0) ; set .@i,.@i + 1) {
  3188.  
  3189. for (set .@j,0; .@j < getarg(0) ; set .@j, .@j + 1 ) {
  3190. if (.@i == .@j)
  3191. set .@menuname$, getarg(.@j + 3);
  3192. }
  3193.  
  3194. if ( getd(".@menuopt"+.@i) == 1 )
  3195. set .@menu3$, .@menu3$ + ":^009900"+.@menuname$+"^000000";
  3196. else
  3197. set .@menu3$, .@menu3$ + ":^FF0000"+.@menuname$+"^000000";
  3198. }
  3199. set .@menu3$,.@menu3$ + ":^0000FFConfirm";
  3200. set .@menu3, select (.@menu3$);
  3201. set .@menu3,.@menu3 - 2;
  3202.  
  3203. for (set .@targ,0; .@targ < getarg(0) ; set .@targ, .@targ+1) {
  3204. if (.@menu3 == .@targ) {
  3205. if (.@maxopt > 0) {
  3206. if (getd(".@menuopt"+.@targ) == 0) {
  3207. setd ".@menuopt"+.@targ,1;
  3208. set .@maxopt,.@maxopt - 1;
  3209. }
  3210. else {
  3211. setd ".@menuopt"+.@targ,0;
  3212. set .@maxopt,.@maxopt + 1;
  3213. }
  3214. }
  3215. else {
  3216. if (getd(".@menuopt"+.@targ) == 0)
  3217. break;
  3218. else {
  3219. setd ".@menuopt"+.@targ,0;
  3220. set .@maxopt, .@maxopt + 1;
  3221. }
  3222. }
  3223. }
  3224. }
  3225.  
  3226. set .@return$, "";
  3227. for (set .@targ,0; .@targ < getarg(0); set .@targ, .@targ+1) {
  3228. for (set .@j,0; .@j < getarg(0) ; set .@j, .@j + 1 ) {
  3229. if ( (getd(".@menuopt"+.@targ) == 1) && (.@targ == .@j) )
  3230. set .@return$,.@return$ + getarg(.@j + 3) + " ";
  3231. }
  3232. }
  3233. if ( .@menu3 == getarg(0) ) {
  3234. next;
  3235. break;
  3236. }
  3237.  
  3238. }
  3239. return .@return$;
  3240. }
  3241.  
  3242. //Receives the looping argument and displays the list of options
  3243. function script displaylist#g1 {
  3244.  
  3245. set .@display$,"";
  3246. if (getarg(0) == 0)
  3247. set .@display$,"Allow Member Listing";
  3248. if (getarg(0) == 1)
  3249. set .@display$,"Allow Announce to Member";
  3250. if (getarg(0) == 2)
  3251. set .@display$,"Allow Spy Guild Chat";
  3252. if (getarg(0) == 3)
  3253. set .@display$,"Allow Map Member Search";
  3254. if (getarg(0) == 4)
  3255. set .@display$,"Display Online Member Level";
  3256. if (getarg(0) == 5)
  3257. set .@display$,"Display Online Member Job";
  3258. if (getarg(0) == 6)
  3259. set .@display$,"Display Online Member Location";
  3260. if (getarg(0) == 7)
  3261. set .@display$,"Display Guild Leader Name";
  3262. if (getarg(0) == 8)
  3263. set .@display$,"Display Guild Castles";
  3264. if (getarg(0) == 9)
  3265. set .@display$,"Show Guild Leader Level";
  3266. if (getarg(0) == 10)
  3267. set .@display$,"Show Guild Leader Job";
  3268. if (getarg(0) == 11)
  3269. set .@display$,"Show Guild Leader Location";
  3270. if (getarg(0) == 12)
  3271. set .@display$,"Allow Warp to Guild Leader";
  3272. if (getarg(0) == 13)
  3273. set .@display$,"Always Accept Warps";
  3274.  
  3275. return .@display$;
  3276.  
  3277. }
  3278.  
  3279. //Receives :
  3280. //Guild Leader Name, Guild ID
  3281. //Returns 1 for unavaible Guild
  3282. //Returns 0 for avaible Guild
  3283. function script checkrest#g1 {
  3284.  
  3285. //Registered Player is not Guild Master of Registered Guild Anymore
  3286. if ( getarg(0) != getguildmaster(getarg(1)))
  3287. return 1;
  3288.  
  3289. else
  3290. return 0;
  3291. }
  3292.  
  3293. //Receives:
  3294. //The guild bitmask
  3295. //Returns :
  3296. //The new menu (numeric)
  3297. function script calcmenu#g2 {
  3298.  
  3299. //For Modifications, Change this number to allow bigger menus
  3300. set .@maxmenu, 6;
  3301.  
  3302. set .@menu$,"";
  3303. set .@cn,0;
  3304. set .@menu$, .@menu$ + ":Announce to Leader";
  3305. set .@cn, .@cn + 1;
  3306. if (getarg(0) & pow(2,12)) {
  3307. set .@menu$, .@menu$ + ":Warp to Leader";
  3308. set .@cn, .@cn + 1;
  3309. }
  3310. if (getarg(0) & pow(2,2)) {
  3311. set .@menu$, .@menu$ + ":Spy Guild Chat";
  3312. set .@cn, .@cn + 1;
  3313. }
  3314. if (getarg(0) & pow(2,0)) {
  3315. set .@menu$, .@menu$ + ":List Guild Members";
  3316. set .@cn, .@cn + 1;
  3317. }
  3318. if (getarg(0) & pow(2,3)) {
  3319. set .@menu$, .@menu$ + ":Map Member Search";
  3320. set .@cn, .@cn + 1;
  3321. }
  3322.  
  3323. //Please Add Additonal Menus Here, For NPC Modifying.
  3324.  
  3325. set .@menu$, .@menu$ + ":^0000FFBack";
  3326. set .@cn, .@cn + 1;
  3327. set .@menu, select(.@menu$);
  3328. set .@menu, .@menu - 2;
  3329. for (set .@i, 0; .@i < .@maxmenu ; set .@i, .@i + 1) {
  3330. if (.@menu == .@maxmenu)
  3331. return 99;
  3332. if (.@menu == .@i)
  3333. return .@menu;
  3334. }
  3335.  
  3336. //Critical Error
  3337. return 98;
  3338.  
  3339. }
  3340.  
  3341. //Receives :
  3342. //Leader Name, Bitmask
  3343. //Returns :
  3344. //Leader Information
  3345. function script leaderinfo#g1 {
  3346.  
  3347. set .@leaderinfo$,"";
  3348.  
  3349. if ( getcharid(0,(getarg(0))) ){
  3350. set .@leaderinfo$,"^000000Status- ^009900On^000000";
  3351. set .@rid, getcharid(3);
  3352. attachrid( getcharid(3,getarg(0)) );
  3353. if ( getarg(1) & pow(2,9) ) {
  3354. set .@lvl,BaseLevel;
  3355. set .@leaderinfo$, .@leaderinfo$ + "^000000 Lvl- ^0066CC" + .@lvl;
  3356. }
  3357. if ( getarg(1) & pow(2,10) ) {
  3358. set .@job$,jobname(Class);
  3359. set .@leaderinfo$, .@leaderinfo$ + "^000000 Job- ^FF0033" + .@job$;
  3360. }
  3361. if ( getarg(1) & pow(2,11) ) {
  3362. getmapxy .@map$,.@x,.@y,0;
  3363. set .@leaderinfo$, .@leaderinfo$ + "^000000 Location- ^FF9933" + .@map$ + " " + .@x + ", " + .@y + "^000000";
  3364. }
  3365. attachrid(.@rid);
  3366. }
  3367. else {
  3368. set .@leaderinfo$,"^000000Status- ^FF0000Off^000000";
  3369. }
  3370.  
  3371. return .@leaderinfo$;
  3372.  
  3373. }
  3374.  
  3375. //Receives :
  3376. //Guild ID
  3377. //Returns :
  3378. //Guild Castles
  3379. function script castles#g1 {
  3380.  
  3381. set .@castles$, "";
  3382. if ( getarg(0) == getcastledata("n_castle",1) ) set .@castles$, .@castles$ + getcastlename("n_castle");
  3383. if ( getarg(0) == getcastledata("nguild_gef",1) ) set .@castles$, .@castles$ + getcastlename("nguild_gef");
  3384. if ( getarg(0) == getcastledata("nguild_prt",1) ) set .@castles$, .@castles$ + getcastlename("nguild_prt");
  3385. if ( getarg(0) == getcastledata("nguild_pay",1) ) set .@castles$, .@castles$ + getcastlename("nguild_pay");
  3386. if ( getarg(0) == getcastledata("nguild_alde",1) ) set .@castles$, .@castles$ + getcastlename("nguild_alde");
  3387. if ( getarg(0) == getcastledata("schg_cas01",1) ) set .@castles$, .@castles$ + getcastlename("schg_cas01");
  3388. if ( getarg(0) == getcastledata("schg_cas02",1) ) set .@castles$, .@castles$ + getcastlename("schg_cas02");
  3389. if ( getarg(0) == getcastledata("schg_cas03",1) ) set .@castles$, .@castles$ + getcastlename("schg_cas03");
  3390. if ( getarg(0) == getcastledata("schg_cas04",1) ) set .@castles$, .@castles$ + getcastlename("schg_cas04");
  3391. if ( getarg(0) == getcastledata("schg_cas05",1) ) set .@castles$, .@castles$ + getcastlename("schg_cas05");
  3392. if ( getarg(0) == getcastledata("arug_cas01",1) ) set .@castles$, .@castles$ + getcastlename("arug_cas01");
  3393. if ( getarg(0) == getcastledata("arug_cas02",1) ) set .@castles$, .@castles$ + getcastlename("arug_cas02");
  3394. if ( getarg(0) == getcastledata("arug_cas03",1) ) set .@castles$, .@castles$ + getcastlename("arug_cas03");
  3395. if ( getarg(0) == getcastledata("arug_cas04",1) ) set .@castles$, .@castles$ + getcastlename("arug_cas04");
  3396. if ( getarg(0) == getcastledata("arug_cas05",1) ) set .@castles$, .@castles$ + getcastlename("arug_cas05");
  3397. if ( getarg(0) == getcastledata("aldeg_cas01",1) ) set .@castles$, .@castles$ + getcastlename("aldeg_cas01");
  3398. if ( getarg(0) == getcastledata("aldeg_cas02",1) ) set .@castles$, .@castles$ + getcastlename("aldeg_cas02");
  3399. if ( getarg(0) == getcastledata("aldeg_cas03",1) ) set .@castles$, .@castles$ + getcastlename("aldeg_cas03");
  3400. if ( getarg(0) == getcastledata("aldeg_cas04",1) ) set .@castles$, .@castles$ + getcastlename("aldeg_cas04");
  3401. if ( getarg(0) == getcastledata("aldeg_cas05",1) ) set .@castles$, .@castles$ + getcastlename("aldeg_cas05");
  3402. if ( getarg(0) == getcastledata("gefg_cas01",1) ) set .@castles$, .@castles$ + getcastlename("gefg_cas01");
  3403. if ( getarg(0) == getcastledata("gefg_cas02",1) ) set .@castles$, .@castles$ + getcastlename("gefg_cas02");
  3404. if ( getarg(0) == getcastledata("gefg_cas03",1) ) set .@castles$, .@castles$ + getcastlename("gefg_cas03");
  3405. if ( getarg(0) == getcastledata("gefg_cas04",1) ) set .@castles$, .@castles$ + getcastlename("gefg_cas04");
  3406. if ( getarg(0) == getcastledata("gefg_cas05",1) ) set .@castles$, .@castles$ + getcastlename("gefg_cas05");
  3407. if ( getarg(0) == getcastledata("payg_cas01",1) ) set .@castles$, .@castles$ + getcastlename("payg_cas01");
  3408. if ( getarg(0) == getcastledata("payg_cas02",1) ) set .@castles$, .@castles$ + getcastlename("payg_cas02");
  3409. if ( getarg(0) == getcastledata("payg_cas03",1) ) set .@castles$, .@castles$ + getcastlename("payg_cas03");
  3410. if ( getarg(0) == getcastledata("payg_cas04",1) ) set .@castles$, .@castles$ + getcastlename("payg_cas04");
  3411. if ( getarg(0) == getcastledata("payg_cas05",1) ) set .@castles$, .@castles$ + getcastlename("payg_cas05");
  3412. if ( getarg(0) == getcastledata("prtg_cas01",1) ) set .@castles$, .@castles$ + getcastlename("prtg_cas01");
  3413. if ( getarg(0) == getcastledata("prtg_cas02",1) ) set .@castles$, .@castles$ + getcastlename("prtg_cas02");
  3414. if ( getarg(0) == getcastledata("prtg_cas03",1) ) set .@castles$, .@castles$ + getcastlename("prtg_cas03");
  3415. if ( getarg(0) == getcastledata("prtg_cas04",1) ) set .@castles$, .@castles$ + getcastlename("prtg_cas04");
  3416. if ( getarg(0) == getcastledata("prtg_cas05",1) ) set .@castles$, .@castles$ + getcastlename("prtg_cas05");
  3417. //Add More Castles Here
  3418.  
  3419. return .@castles$;
  3420.  
  3421. }
  3422.  
  3423. //Receives: Leader Name, Bitmask,Guild ID
  3424. function script leaderwarp#g1 {
  3425.  
  3426. if (getcharid(0,getarg(0))) {
  3427. if (!callfunc ("checkrest#g1",getarg(0),getarg(2) )) {
  3428. if (getarg(1) & pow(2,13)) {
  3429. set .@rid,getcharid(3);
  3430. attachrid(getcharid(3,getarg(0)));
  3431. getmapxy(.@m$,.@x,.@y,0);
  3432. if (!callfunc ("checkrest#g2",.@m$)) {
  3433. attachrid(.@rid);
  3434. warp .@m$,.@x,.@y;
  3435. end;
  3436. }
  3437. else {
  3438. attachrid(.@rid);
  3439. mes "["+strnpcinfo(1)+"]";
  3440. mes "The Guild Leader is currently in a non-warpable location.";
  3441. next;
  3442. }
  3443. }
  3444. else {
  3445. getmapxy(.@m$,.@x,.@y,0,getarg(0));
  3446. if (!callfunc ("checkrest#g2",.@m$)) {
  3447. //Player Info
  3448. set .@name$, strcharinfo(0);
  3449. set .@job$, jobname(Class);
  3450. set .@lvl, BaseLevel;
  3451.  
  3452. //Leader Display Part 1
  3453. attachrid(getcharid(3,getarg(0)));
  3454. mes "["+strnpcinfo(1)+"]";
  3455. mes "The Player ^0000FF"+.@name$+"^000000 requested a warp.";
  3456. mes "You have 10 seconds to accept.";
  3457. mes "Job- ^0000FF"+.@job$+"^000000";
  3458. mes "Level- ^009900"+.@lvl+"^000000";
  3459. doevent strnpcinfo(0)+"::OnRequest";
  3460. end;
  3461.  
  3462. }
  3463. else {
  3464. attachrid(.@rid);
  3465. next;
  3466. mes "["+strnpcinfo(1)+"]";
  3467. mes "The Guild Leader is currently in a non-warpable location.";
  3468. next;
  3469. }
  3470. }
  3471. }
  3472. else {
  3473. next;
  3474. mes "["+strnpcinfo(1)+"]";
  3475. mes "Im sorry but this guild registry has been cancelled.";
  3476. next;
  3477. }
  3478. }
  3479. else {
  3480. next;
  3481. mes "["+strnpcinfo(1)+"]";
  3482. mes "Sorry but the Guild Leader has just logged off. Therefore the warp function has failed.";
  3483. next;
  3484. }
  3485.  
  3486. return;
  3487.  
  3488. }
  3489.  
  3490. //Receives:
  3491. //Leader Name, Bitmask, Guild ID, Announce Cool Down
  3492. function script leaderanno#g1 {
  3493.  
  3494. if (@g_announce < gettimetick(2)) {
  3495. if (getcharid(0,getarg(0))) {
  3496. if (!callfunc ("checkrest#g1",getarg(0),getarg(2) )) {
  3497. //User Part
  3498. set .@rid,getcharid(3);
  3499. set .@gannodel, getarg(3);
  3500. mes "["+strnpcinfo(1)+"]";
  3501. mes "You have been announced to the Guild Leader.";
  3502. set @g_announce, gettimetick(2) + .@gannodel;
  3503. set .@name$, strcharinfo(0);
  3504. set .@job$, jobname(Class);
  3505. set .@lvl, BaseLevel;
  3506.  
  3507. //Guild Leader Part
  3508. attachrid(getcharid(3,getarg(0)));
  3509. announce .@name$+" level "+.@lvl+" job "+.@job$+" wants to join your guild.",bc_self,0x2FE954,0,0,0;
  3510.  
  3511. //User Part
  3512. attachrid(.@rid);
  3513. next;
  3514. }
  3515. else {
  3516. mes "["+strnpcinfo(1)+"]";
  3517. mes "Im sorry but this guild registry has been cancelled.";
  3518. next;
  3519. }
  3520. }
  3521. else {
  3522. mes "["+strnpcinfo(1)+"]";
  3523. mes "Sorry but the Guild Leader has just logged off. Therefore the warp function has failed.";
  3524. next;
  3525. }
  3526. }
  3527. else {
  3528. mes "["+strnpcinfo(1)+"]";
  3529. set .@temp, @g_announce - gettimetick(2);
  3530. mes "You must wait ^0000FF" + .@temp + "^000000 more seconds to use this function again.";
  3531. next;
  3532. }
  3533.  
  3534. return;
  3535.  
  3536. }
  3537.  
  3538. //Receives :
  3539. //Guild ID, Leader Name
  3540. //Returns :
  3541. //Nothing
  3542. function script spychat#g1 {
  3543.  
  3544. disable_items;
  3545. pcblockmove getcharid(3),1;
  3546. atcommand "@guildspy " + getarg(0);
  3547. mes "["+strnpcinfo(1)+"]";
  3548. mes "You are spying the selected guild chat. Please select ^0000FFReturn^000000 to cancel.";
  3549. if (prompt ("Return") == 1) {
  3550. atcommand "@guildspy " + getarg(0);
  3551. pcblockmove getcharid(3),0;
  3552. enable_items;
  3553. return;
  3554. }
  3555. else {
  3556. atcommand "@guildspy " + getarg(0);
  3557. pcblockmove getcharid(3),0;
  3558. enable_items;
  3559. end;
  3560. }
  3561.  
  3562. return;
  3563.  
  3564. }
  3565.  
  3566. //Receives:
  3567. //Map Name
  3568. //Return:
  3569. //1 - Map Restricted
  3570. //0 - Map Avaible
  3571. function script checkrest#g2 {
  3572. if ( (getmapflag(getarg(0),gvg) == 1) || (getmapflag (getarg(0),gvg_castle) == 1) || (getmapflag (getarg(0),gvg_dungeon) == 1 ) || (getmapflag (getarg(0),battleground) == 1) ) {
  3573. if ( (getarg(0) != "abbey01") || (getarg(0) != "abbey01") || (getarg(0) != "abbey01") || (getarg(0) != "1@cata") || (getarg(0) != "2@cata") ||
  3574. (getarg(0) != "1@tower") || (getarg(0) != "2@tower") || (getarg(0) != "3@tower") || (getarg(0) != "4@tower") || (getarg(0) != "5@tower") || (getarg(0) != "6@tower") )
  3575. return 1;
  3576. }
  3577. else
  3578. return 0;
  3579.  
  3580. }
  3581.  
  3582. morocc,161,97,5 duplicate(Recruiter#h1-0) Recruiter#h1-2 758
  3583. ayothaya,145,121,5 duplicate(Recruiter#h1-0) Recruiter#h1-3 758
  3584. geffen,114,58,0 duplicate(Recruiter#h1-0) Recruiter#h1-4 758
  3585. umbala,94,162,5 duplicate(Recruiter#h1-0) Recruiter#h1-5 758
  3586. payon,25,240,5 duplicate(Recruiter#h1-0) Recruiter#h1-6 758
  3587. alberta,25,240,4 duplicate(Recruiter#h1-0) Recruiter#h1-7 758
  3588. aldebaran,147,120,4 duplicate(Recruiter#h1-0) Recruiter#h1-8 758
  3589. izlude,122,98,5 duplicate(Recruiter#h1-0) Recruiter#h1-9 758
  3590. xmas,152,134,3 duplicate(Recruiter#h1-0) Recruiter#h1-10 758
  3591. comodo,197,160,4 duplicate(Recruiter#h1-0) Recruiter#h1-11 758
  3592. amatsu,204,97,4 duplicate(Recruiter#h1-0) Recruiter#h1-12 758
  3593. gonryun,165,122,4 duplicate(Recruiter#h1-0) Recruiter#h1-13 758
  3594. yuno,147,184,5 duplicate(Recruiter#h1-0) Recruiter#h1-14 758
  3595. niflheim,200,188,4 duplicate(Recruiter#h1-0) Recruiter#h1-15 758
  3596. louyang,224,107,4 duplicate(Recruiter#h1-0) Recruiter#h1-16 758
  3597. veins,220,127,4 duplicate(Recruiter#h1-0) Recruiter#h1-17 758
  3598. rachel,136,115,4 duplicate(Recruiter#h1-0) Recruiter#h1-18 758
  3599. moscovia,218,196,5 duplicate(Recruiter#h1-0) Recruiter#h1-19 758
  3600. hugel,93,154,5 duplicate(Recruiter#h1-0) Recruiter#h1-20 758
  3601. einbroch,184,169,4 duplicate(Recruiter#h1-0) Recruiter#h1-21 758
  3602. einbech,199,83,4 duplicate(Recruiter#h1-0) Recruiter#h1-22 758
  3603. lighthalzen,163,96,4 duplicate(Recruiter#h1-0) Recruiter#h1-23 758
  3604. brasilis,200,183,4 duplicate(Recruiter#h1-0) Recruiter#h1-24 758
  3605. dicastes01,191,194,5 duplicate(Recruiter#h1-0) Recruiter#h1-25 758
  3606. //ATTENTION : the city bellow belongs to a new patch! it may give errors in your server!
  3607. //mora,120,86,4 duplicate(Recruiter#h1-0) Recruiter#h1-26 758
  3608. mid_camp,222,243,4 duplicate(Recruiter#h1-0) Recruiter#h1-27 758
Add Comment
Please, Sign In to add comment