Advertisement
akbare

woe supply giver

Dec 31st, 2014
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.72 KB | None | 0 0
  1. /*- script SupplyTrigger -1,{
  2. OnWed1700:
  3. OnSun1600:
  4. enablenpc "WoE Supply";
  5. end;
  6.  
  7. OnAgitEnd:
  8. OnAgitEnd2:
  9. disablenpc "WoE Supply";
  10. end;
  11. }*/
  12.  
  13.  
  14. prontera,164,173,9 script WoE Supply 78,{
  15. function sf {
  16. function s;
  17. .@a = getarg(2);
  18. .@len = getarg(3);
  19. return (
  20. sprintf( getarg(0),
  21. s(.@a, .@len, getarg(1)), s(.@a++, .@len, getarg(1)),
  22. s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)),
  23. s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)),
  24. s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)),
  25. s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1))
  26. )
  27. +(( .@a+1 < .@len )?":Next":":")
  28. +(( .@a-11 > 0 )?":Back":":")
  29. +":Cancel"
  30. );
  31. function s {
  32. if( getarg(0) >= getarg(1) ) return "";
  33. else {
  34. .@name$ = getguildname(getelementofarray(getarg(2),getarg(0)));
  35. return .@name$=="null"?"":.@name$;
  36. }
  37. };
  38. };
  39. function nex { return((getarg(0)+10)<getarg(1)?getarg(0)+10:getarg(1)-(getarg(1)%10)); };
  40. function bac { return((getarg(0)-10)>=0?getarg(0)-10:0); };
  41.  
  42. if(getgmlevel()>=80 ) {
  43. mes .Npc_Name$;
  44. mes "Hello Mr. GM what would you like to do?";
  45. next;
  46. switch( select("Add/Remove Guilds:Clear Guild Data:Player Menu:Cancel") ) {
  47. case 1:
  48. mes .Npc_Name$;
  49. mes "Would you like to add or remove a guild?";
  50. .@a_len = getarraysize($App_Guilds);
  51. .@format$ = "%s:%s:%s:%s:%s:%s:%s:%s:%s:%s";
  52. next;
  53. if( select("Remove:Add") == 1 ) {
  54. while( .@a != 9999 ) {
  55. select( sf( .@format$, $App_Guilds, .@a, .@a_len ) );
  56. switch( @menu ) {
  57. case 11: .@a = nex( .@a, .@a_len ); break;
  58. case 12: .@a = bac( .@a ); break;
  59. case 13: end;
  60.  
  61. default:
  62. .@select = .@a+@menu-1;
  63. mes .Npc_Name$;
  64. mes "You've selected ^0000FF["+getguildname($App_Guilds[.@select])+"]^000000 guild. Would you like to remove them from the accepted guilds?";
  65. next;
  66. if( select("Yes:No") == 1 ) {
  67. deletearray($App_Guilds[.@select],1);
  68. mes .Npc_Name$;
  69. mes "The guild has been removed!";
  70. }
  71. close;
  72. }
  73. }
  74. } else {
  75. mes .Npc_Name$;
  76. mes "Please input guild name or masters name.";
  77. next;
  78. input(.@input$);
  79. .@len = query_sql( "Select `guild_id` from `guild` where `name` like '%"+escape_sql(.@input$)+"%' or `master` like '%"+escape_sql(.@input$)+"%';",.@guild_id );
  80. while( .@a != 9999 ) {
  81. select( sf( .@format$, .@guild_id, .@a, .@len ) );
  82. switch( @menu ) {
  83. case 11: .@a = nex( .@a, .@len ); break;
  84. case 12: .@a = bac( .@a ); break;
  85. case 13: end;
  86.  
  87. default:
  88. .@select = .@a+@menu-1;
  89. .@a_len = getarraysize($App_Guilds);
  90. for(.@b=0;.@b<.@a_len;.@b++)
  91. if( $App_Guilds[.@b]==.@guild_id[.@select] ) {
  92. mes .Npc_Name$;
  93. mes "You've selected ^0000FF["+getguildname(.@guild_id[.@select])+"]^000000 guild. I'm sorry but that guild has already been added to the accepted list.";
  94. close;
  95. }
  96. mes .Npc_Name$;
  97. mes "You've selected ^0000FF["+getguildname(.@guild_id[.@select])+"]^000000 guild. Would you like to add them to the accepted guilds?";
  98. next;
  99. if( select("Yes:No") == 1 ) {
  100. .@a_len = getarraysize($App_Guilds);
  101. if( .@a_len>=128 ) {
  102. mes .Npc_Name$;
  103. mes "I'm sorry but the accepted list is full please make some room and try again...";
  104. } else {
  105. mes .Npc_Name$;
  106. mes "The guild was successfully added!";
  107. $App_Guilds[.@a_len] = .@guild_id[.@select];
  108. }
  109. }
  110. close;
  111. }
  112. }
  113. }
  114. case 2:
  115. mes .Npc_Name$;
  116. mes "Are you sure you want to clear the guild data?!";
  117. next;
  118. if( select("Yes!:No!")==1 ) {
  119. mes .Npc_Name$;
  120. mes "This is you last chance. Are you surely sure as sure can be?";
  121. next;
  122. if( select("Surly!:No, wait... Where am I?!!")==1 )
  123. deletearray($App_Guilds);
  124. }
  125. if( @menu==1 ) {
  126. mes .Npc_Name$;
  127. mes "The deed is done...";
  128. } else {
  129. mes .Npc_Name$;
  130. mes "Wow that was a close one... Have a nice day!";
  131. }
  132. close;
  133.  
  134. case 3: break;
  135.  
  136. case 4:
  137. mes .Npc_Name$;
  138. mes "Alright, have a nice day!";
  139. close;
  140. }
  141. }
  142.  
  143. mes .Npc_Name$;
  144. mes "I'm here to give you supplies for WoE!";
  145. next;
  146.  
  147. mes .Npc_Name$;
  148. .@len = getarraysize($App_Guilds);
  149. for( .@i=0; .@i <= .@len; .@i++ ) {
  150. if( getcharid(2) == $App_Guilds[.@i] )
  151. set .@Guild_Check, .@Guild_Check+1;
  152. }
  153. if( .@Guild_Check < 1 ) {
  154. mes "Your guild has not yet been approved, please contact the GMs";
  155. close;
  156. }
  157. if( !getcharid(2) ) {
  158. mes "Sorry only members of a guild may use this npc.";
  159. close;
  160. }
  161. if( BaseLevel < 99 || Class > 4022 ) {
  162. mes "Sorry this is for Lvl 99 Trans Class only";
  163. close;
  164. }
  165. if( gettimetick(2) < #delay ) {
  166. mes "Sorry, you can only claim this once every WoE";
  167. close;
  168. }
  169. switch( Class ) {
  170.  
  171. case 28: //Soul Linker
  172. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  173. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  174. break;
  175. case 27: //Star Gladiator
  176. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  177. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  178. break;
  179. case 26: //Gunslinger
  180. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  181. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  182. break;
  183. case 4006: //Clown
  184. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  185. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  186. break;
  187. case 4007: //Gyspy
  188. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  189. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  190. break;
  191. case 4008: //Paladin
  192. getitembound2 13534,4,0,0,0,0,0,0,0,1;//whitepotion
  193. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  194. break;
  195. case 4009: //High Priest
  196. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  197. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  198. getitembound2 717,100,0,0,0,0,0,0,0,1;//bluegem
  199. getitembound2 523,20,0,0,0,0,0,0,0,1;//holy water
  200. break;
  201. case 4010: //High Wizard
  202. mes "Please choose your role";
  203. mes "Support : Ganbantien";
  204. mes "Offensive : SG/MS/LOV (Includes Crystal Fragments)";
  205. next;
  206. if( select("Support High Wizard:Offensive High Wizard")==1 )
  207. //Support High Wizard
  208. getitembound2 715,50,0,0,0,0,0,0,0,1;//yellowgem
  209. getitembound2 717,50,0,0,0,0,0,0,0,1;//bluegem
  210. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  211. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  212. else
  213. //Offensive HWIZ Pack
  214. getitembound2 7321,100,0,0,0,0,0,0,0,1;//Crystal Fragments
  215. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  216. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  217. break;
  218. case 4011: //Whitesmith
  219. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  220. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  221. break;
  222. case 4012: //Sniper
  223. getitembound2 1065,100,0,0,0,0,0,0,0,1;//traps
  224. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  225. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  226. break;
  227. case 4013: //Sinx
  228. mes "Please choose your role.";
  229. mes "Breaker - 3 Sec Break";
  230. mes "Killer - Do what you want";
  231. next;
  232. if( select("Breaker Sinx:Sonic Blow Sinx")==1)
  233. getitembound2 678,20,0,0,0,0,0,0,0,1;//poisonbottle
  234. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  235. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  236. getitembound2 12020,20,0,0,0,0,0,0,0,1;//cursedwater
  237. else
  238. getitembound2 678,20,0,0,0,0,0,0,0,1;//poisonbottle
  239. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  240. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  241. getitembound2 12114,10,0,0,0,0,0,0,0,1;//fireconv
  242. getitembound2 12115,10,0,0,0,0,0,0,0,1;//waterconv
  243. getitembound2 12116,10,0,0,0,0,0,0,0,1;//earthconv
  244. getitembound2 12117,10,0,0,0,0,0,0,0,1;//windconv
  245. break;
  246. case 4016: //Champion
  247. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  248. getitembound2 13810,4,0,0,0,0,0,0,0,1;//bluepotion
  249. break;
  250. case 4017: //Professor
  251. getitembound2 1025,100,0,0,0,0,0,0,0,1;//cobweb
  252. getitembound2 715,50,0,0,0,0,0,0,0,1;//yellowgem
  253. getitembound2 716,50,0,0,0,0,0,0,0,1;//redgem
  254. getitembound2 717,50,0,0,0,0,0,0,0,1;//bluegem
  255. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  256. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  257. break;
  258. case 4018: //Stalker
  259. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  260. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  261. break;
  262. case 4019: //Creator
  263. mes "Please choose your role.";
  264. mes "Support : Slim Potion Pitcher";
  265. mes "Offensive : Acid Demonstration";
  266. next;
  267. if( select("Support Creator:Offensive Creator")==1 )
  268. //Support
  269. getitembound2 7139,20,0,0,0,0,0,0,0,1;//glisteningcoat
  270. getitembound2 547,150,0,0,0,0,0,0,0,1;//slimwhitepot
  271. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  272. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  273. else
  274. //Offensive
  275. getitembound2 7136,25,0,0,0,0,0,0,0,1;acid bottle
  276. getitembound2 7135,25,0,0,0,0,0,0,0,1;bottle grenade
  277. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  278. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  279. break;
  280. case 25: //Ninja
  281. mes "Please choose your type.";
  282. mes "Flame : Flame Stone";
  283. mes "Ice : Ice Stone";
  284. mes "Wind : Wind Stone";
  285. mes "Shadow : Shadow Orb";
  286. next;
  287. switch( select("Flame:Ice:Wind:Shadow") ) {
  288. //Flame
  289. case 1: getitembound2 7521,50,0,0,0,0,0,0,0,1;
  290. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  291. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  292. break;
  293. //Ice
  294. case 2: getitembound2 7522,50,0,0,0,0,0,0,0,1;
  295. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  296. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  297. break;
  298. //Wind
  299. case 3: getitembound2 7523,50,0,0,0,0,0,0,0,1;
  300. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  301. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  302. break;
  303. //Shadow
  304. case 4: getitembound2 7524,50,0,0,0,0,0,0,0,1;
  305. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  306. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  307. }
  308. break;
  309. case 4020: //Lord Knight
  310. getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
  311. getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
  312. getitembound2 12114,10,0,0,0,0,0,0,0,1;//fireconv
  313. getitembound2 12115,10,0,0,0,0,0,0,0,1;//waterconv
  314. getitembound2 12116,10,0,0,0,0,0,0,0,1;//earthconv
  315. getitembound2 12117,10,0,0,0,0,0,0,0,1;//windconv
  316. break;
  317. //Add more cases for all classes
  318. default:
  319. if( !callsub( L_GLSub, .Npc_Name$ ) )
  320. mes "Sorry this is only for the classes which require items for using skills.";
  321. close;
  322. }
  323. set #delay, gettimetick(2)+10800;
  324. callsub( L_GLSub, .Npc_Name$ );
  325. mes "There you are, goodluck!";
  326. close;
  327.  
  328. L_GLSub:
  329. if( getguildmasterid(getcharid(2)) == getcharid(0) ) {
  330. mes getarg(0);
  331. mes "Would you like to claim your guild leader package too?";
  332. next;
  333. if( select("Yes:No")==1 )
  334. switch( gettime(4) ) {
  335. //Treasure Box x 10 - Needs to be discussed
  336. case 0: getitembound2 7444,10,0,0,0,0,0,0,0,1; break; //Sunday
  337. case 1: getitembound2 7444,10,0,0,0,0,0,0,0,1; break; //Monday
  338. case 2: getitembound2 7444,10,0,0,0,0,0,0,0,1; break; //Tuesday
  339. case 3: getitembound2 7444,10,0,0,0,0,0,0,0,1; break; //Wednesday
  340. case 4: getitembound2 7444,10,0,0,0,0,0,0,0,1; break; //Thursday
  341. case 5: getitembound2 7444,10,0,0,0,0,0,0,0,1; break; //Friday
  342. case 6: getitembound2 7444,10,0,0,0,0,0,0,0,1; //Saturday
  343. }
  344. return 1;
  345. }
  346. return 0;
  347.  
  348. OnInit:
  349. set .Npc_Name$, "[^0000FF WoE Supply ^000000]";
  350. disablenpc "WoE Supply";
  351. end;
  352. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement