Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.26 KB | None | 0 0
  1. prontera,100,200,3    script    WoE Supply    78,{
  2.     function sf {
  3.         function s;
  4.         .@a = getarg(2);
  5.         .@len = getarg(3);
  6.         return (
  7.             sprintf( getarg(0),
  8.                 s(.@a, .@len, getarg(1)), s(.@a++, .@len, getarg(1)),
  9.                 s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)),
  10.                 s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)), 
  11.                 s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)), 
  12.                 s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1))
  13.             )
  14.             +(( .@a+1 < .@len )?":Next":":")
  15.             +(( .@a-11 > 0 )?":Back":":")
  16.             +":Cancel"
  17.         );
  18.         function s {
  19.             if( getarg(0) >= getarg(1) ) return "";
  20.             else {
  21.                 .@name$ = getguildname(getelementofarray(getarg(2),getarg(0)));
  22.                 return .@name$=="null"?"":.@name$;
  23.             }
  24.         };
  25.     };
  26.     function nex { return((getarg(0)+10)<getarg(1)?getarg(0)+10:getarg(1)-(getarg(1)%10)); };
  27.     function bac { return((getarg(0)-10)>=0?getarg(0)-10:0); };
  28.  
  29.     if( getgmlevel()>=80 ) {
  30.         mes .Npc_Name$;
  31.         mes "Hello Mr. GM what would you like to do?";
  32.         next;
  33.         switch( select("Add/Remove Guilds:Clear Guild Data:Player Menu:Cancel") ) {
  34.             case 1:
  35.                 mes .Npc_Name$;
  36.                 mes "Would you like to add or remove a guild?";
  37.                 .@a_len = getarraysize($App_Guilds);
  38.                 .@format$ = "%s:%s:%s:%s:%s:%s:%s:%s:%s:%s";
  39.                 next;
  40.                 if( select("Remove:Add") == 1 ) {
  41.                     while( .@a != 9999 ) {
  42.                         select( sf( .@format$, $App_Guilds, .@a, .@a_len ) );
  43.                         switch( @menu ) {
  44.                             case 11: .@a = nex( .@a, .@a_len ); break;
  45.                             case 12: .@a = bac( .@a ); break;
  46.                             case 13: end;
  47.                             
  48.                             default:
  49.                                 .@select = .@a+@menu-1;
  50.                                 mes .Npc_Name$;
  51.                                 mes "You've selected ^0000FF["+getguildname($App_Guilds[.@select])+"]^000000 guild. Would you like to remove them from the accepted guilds?";
  52.                                 next;
  53.                                 if( select("Yes:No") == 1 ) {
  54.                                     deletearray($App_Guilds[.@select],1);
  55.                                     mes .Npc_Name$;
  56.                                     mes "The guild has been removed!";
  57.                                 }
  58.                                 close;
  59.                         }
  60.                     }
  61.                 } else {
  62.                     mes .Npc_Name$;
  63.                     mes "Please input guild name or masters name.";
  64.                     next;
  65.                     input(.@input$);
  66.                     .@len = query_sql( "Select `guild_id` from `guild` where `name` like '%"+escape_sql(.@input$)+"%' or `master` like '%"+escape_sql(.@input$)+"%';",.@guild_id );
  67.                     while( .@a != 9999 ) {
  68.                         select( sf( .@format$, .@guild_id, .@a, .@len ) );
  69.                         switch( @menu ) {
  70.                             case 11: .@a = nex( .@a, .@len ); break;
  71.                             case 12: .@a = bac( .@a ); break;
  72.                             case 13: end;
  73.                             
  74.                             default:
  75.                                 .@select = .@a+@menu-1;
  76.                                 .@a_len = getarraysize($App_Guilds);
  77.                                 for(.@b=0;.@b<.@a_len;.@b++)
  78.                                     if( $App_Guilds[.@b]==.@guild_id[.@select] ) {
  79.                                         mes .Npc_Name$;
  80.                                         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.";
  81.                                         close;
  82.                                     }
  83.                                 mes .Npc_Name$;
  84.                                 mes "You've selected ^0000FF["+getguildname(.@guild_id[.@select])+"]^000000 guild. Would you like to add them to the accepted guilds?";
  85.                                 next;
  86.                                 if( select("Yes:No") == 1 ) {
  87.                                     .@a_len = getarraysize($App_Guilds);
  88.                                     if( .@a_len>=128 ) {
  89.                                         mes .Npc_Name$;
  90.                                         mes "I'm sorry but the accepted list is full please make some room and try again...";
  91.                                     } else {
  92.                                         mes .Npc_Name$;
  93.                                         mes "The guild was successfully added!";
  94.                                         $App_Guilds[.@a_len] = .@guild_id[.@select];
  95.                                     }
  96.                                 }
  97.                                 close;
  98.                         }
  99.                     }
  100.                 }
  101.             case 2:
  102.                 mes .Npc_Name$;
  103.                 mes "Are you sure you want to clear the guild data?!";
  104.                 next;
  105.                 if( select("Yes!:No!")==1 ) {
  106.                     mes .Npc_Name$;
  107.                     mes "This is you last chance. Are you surly sure as sure can be?";
  108.                     next;
  109.                     if( select("Surly!:No, wait... Where am I?!!")==1 )
  110.                         deletearray($App_Guilds);
  111.                 }
  112.                 if( @menu==1 ) {
  113.                     mes .Npc_Name$;
  114.                     mes "The deed is done...";
  115.                 } else {
  116.                     mes .Npc_Name$;
  117.                     mes "Wow that was a close one... Have a nice day!";
  118.                 }
  119.                 close;
  120.                 
  121.             case 3: break;
  122.             
  123.             case 4:
  124.                 mes .Npc_Name$;
  125.                 mes "Alright, have a nice day!";
  126.                 close;
  127.         }
  128.     }
  129.  
  130.     mes .Npc_Name$;
  131.     mes "I'm here to give you supplies for WoE!";
  132.     next;
  133.     
  134.     mes .Npc_Name$;
  135.     .@len = getarraysize($App_Guilds);
  136.     for( .@i=0; .@i <= .@len; .@i++ ) {
  137.         if( getcharid(2) == $App_Guilds[.@i] )
  138.             set .@Guild_Check, .@Guild_Check+1;
  139.     }
  140.     if( .@Guild_Check < 1 ) {
  141.         mes "Your guild has not yet been approved, please contact the GMs";
  142.         close;
  143.     }
  144.     if( !getcharid(2) ) {
  145.         mes "Sorry only members of a guild may use this npc.";
  146.         close;    
  147.     }
  148.     if( BaseLevel < 99 || Class > 4022 ) {
  149.         mes "Sorry this is for Lvl 99 Trans Class only";
  150.         close;    
  151.     }
  152.     if( gettimetick(2) < #delay ) {
  153.         mes "Sorry, you can only claim this once every WoE";
  154.         close;
  155.     }
  156.     switch( Class ) {
  157.         case 4009: //High Priest
  158.             getitem 19052,1; //HP Pack
  159.             break;
  160.         case 4010: //High Wizard
  161.             mes "Please choose your role";
  162.             mes "Support : Ganbantien";
  163.             mes "Offensive : SG/MS/LOV (Includes Crystal Fragments)";
  164.             next;
  165.             if( select("Support High Wizard:Offensive High Wizard")==1 )
  166.                 getitem 19047,1; //Support HWIZ Pack
  167.             else
  168.                 getitem 19046,1; //Offensive HWIZ Pack
  169.             break;
  170.         case 4011: //Whitesmith
  171.             getitem 19051,1; //Whitesmith Pack
  172.             break;
  173.         case 4012: //Sniper
  174.             getitem 19054,1; //Sniper Pack
  175.             break;
  176.         case 4013: //Sinx
  177.             getitem 19055,1; //Sinx Pack
  178.             break;
  179.         case 4016: //Champion
  180.             getitem 19053,1; //Champion Pack
  181.             break;
  182.         case 4017: //Professor
  183.             getitem 19048,1; //Prof Pack
  184.             break;
  185.         case 4018: //Stalker
  186.             mes "Please choose your type.";
  187.             mes "Flame : Flame Stone";
  188.             mes "Ice : Ice Stone";
  189.             mes "Wind : Wind Stone";
  190.             mes "Shadow : Shadow Orb";
  191.             next;
  192.             switch( select("Flame:Ice:Wind:Shadow") ) {
  193.                 case 1: getitem 19056,1; break;
  194.                 case 2: getitem 19057,1; break;
  195.                 case 3: getitem 19058,1; break;
  196.                 case 4: getitem 19059,1;
  197.             }
  198.             break;
  199.         case 4019: //Creator
  200.             mes "Please choose your role.";
  201.             mes "Support : Slim Potion Pitcher";
  202.             mes "Offensive : Acid Demonstration";
  203.             next;
  204.             if( select("Support Creator:Offensive Creator")==1 )
  205.                 getitem 19050,1;
  206.             else
  207.                 getitem 19049,1;
  208.             break;
  209.         case 25: //Ninja
  210.             mes "Please choose your type.";
  211.             mes "Flame : Flame Stone";
  212.             mes "Ice : Ice Stone";
  213.             mes "Wind : Wind Stone";
  214.             mes "Shadow : Shadow Orb";
  215.             next;
  216.             switch( select("Flame:Ice:Wind:Shadow") ) {
  217.                 case 1: getitem 19056,1; break;
  218.                 case 2: getitem 19057,1; break;
  219.                 case 3: getitem 19058,1; break;
  220.                 case 4: getitem 19059,1;
  221.             }
  222.             break;
  223.         //Add more cases for all classes
  224.         default:
  225.             if( !callsub( L_GLSub, .Npc_Name$ ) )
  226.                 mes "Sorry this is only for the classes which require items for using skills.";
  227.             close; 
  228.     }
  229.     set #delay, gettimetick(2)+10800;
  230.     callsub( L_GLSub, .Npc_Name$ );
  231.     mes "There you are, goodluck!";
  232.     close;
  233.     
  234. L_GLSub:
  235.     if( getguildmasterid(getcharid(2)) == getcharid(0) ) {
  236.         mes getarg(0);
  237.         mes "Would you like to claim your guild leader package too?";
  238.         next;
  239.         if( select("Yes:No")==1 )
  240.             switch( gettime(4) ) {
  241.                 case 0: getitem 19056,1; break; //Sunday
  242.                 case 1: getitem 19056,1; break; //Monday
  243.                 case 2: getitem 19056,1; break; //Tuesday
  244.                 case 3: getitem 19056,1; break; //Wednesday
  245.                 case 4: getitem 19056,1; break; //Thursday
  246.                 case 5: getitem 19056,1; break; //Friday
  247.                 case 6: getitem 19056,1; //Saturday
  248.             }
  249.         return 1;
  250.     }
  251.     return 0;
  252.  
  253. OnInit:
  254.     set .Npc_Name$, "[^0000FF WoE Supply ^000000]";
  255.     end;
  256. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement