Advertisement
Skorm

Gold Room

Jun 18th, 2013
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.52 KB | None | 0 0
  1. prontera,145,158,1  script  Gold Room   100,{
  2.     if (Life == 1) goto L_Life;
  3.     mes "[Gold Room]";
  4.     mes "Hey, Hey! You wonder why I am so Rich?!";
  5.     mes "Well, that because I found this place called the Gold Room";
  6.     mes "OMG! There's 10 Gold Room!";
  7.     mes "The 1x is free";
  8.     mes "But all the other Gold Room you have to pay Gold.";
  9.     mes "2x is 2000 Gold, 3x is 3000 Gold and Soon On...";
  10.     mes "Why you have to pay? Well it drops MORE Times the GOLD!";
  11.     mes "Oh! There's a Lifetime Pass! You need 30k Gold...";
  12.     mes "So, which Gold Room would you like to go too?"; next;
  13.     for(set(.@p, 1);.@p<=.pri_len;set(.@p,.@p+1)) {
  14.         set .@menu$, .@menu$ + ((.@p!=.pri_len )?
  15.                 .name$[.@p]+":"
  16.             :
  17.                 .name$[.@p]+":"+"Goodbye");
  18.     }
  19.     select(.@menu$);
  20.     set .@price,    .price[@menu];
  21.     set .@itmcnt,   countitem(.itemid);
  22.     if(@menu==(.pri_len-3)) {
  23.         mes "[Gold Room]";
  24.         mes "You need 30k Gold to have a Lifetime pass.";
  25.         mes "Lifetime Pass let's you go to ALL the Gold Room for Free!";
  26.         mes "Do you have 30k Gold?"; next;
  27.         menu "Yes!",-,"Nope",bye;
  28.             if (.@itmcnt<.@price ){
  29.                 mes "[Gold Room]";
  30.                 mes "You don't have it!";
  31.                 close;
  32.             }
  33.         delitem .itemid,.@price;
  34.         set Life,1;
  35.         mes "[Gold Room]";
  36.         mes "You have a Life Time Pass!";
  37.         close;
  38.         end;
  39.     } else if (@menu<.pri_len ) {
  40.         if (.@itmcnt<.@price ) {
  41.             mes "[Gold Room]";
  42.             mes "Ha! You don't have enough!";
  43.             next;
  44.             close;
  45.         }
  46.         mes "[Gold Room]";
  47.         mes "Have Fun!";
  48.         delitem .itemid,.@price;
  49.         close2;
  50.         warp "pvp_y_"+@menu+"-1",0,0;
  51.         end;
  52.     }
  53. goto Bye;
  54.  
  55. L_Life:
  56.     mes "[Gold Room]";
  57.     mes "You have a Life Time Pass";
  58.     mes "Which Room would you like to go in?"; next;
  59.     for(set(.@p, 1);.@p<=.pri_len;set(.@p,.@p+1)) {
  60.         set .@menu$, .@menu$ + ((.@p!=(.pri_len-3) )?
  61.                 .name$[.@p]+":"
  62.             :
  63.                 "Goodbye");
  64.     }
  65.     if(select(.@menu$)<.pri_len) {
  66.         mes "[Gold Room]";
  67.         mes "Have Fun!";
  68.         close2;
  69.         warp "pvp_y_"+@menu+"-1",0,0;
  70.         end;
  71.     }
  72.  
  73. Bye:
  74.     mes "[Gold Room]";
  75.     mes "Bye";
  76. close;
  77. end;
  78.  
  79. OnMobKilled:
  80.     getitem .itemid,.amtper;
  81.     //set .@map$, substr(strcharinfo(3), 6, 6);
  82.     set .@map$, callfunc("str_charat", strcharinfo(3), 6);
  83.     monster "pvp_y_"+.@map$+"-1",0,0,"Gold",1614,1,"Gold Room::OnMobKilled";
  84.     end;
  85.    
  86. OnInit:
  87.     setarray .price[1], 0, 20, 30, 40, 50, 60, 70, 80, 90, 100, 300;
  88.     setarray .name$[1], "1x", "2x", "3x", "4x", "5x", "6x", "7x", "8x", "Lifetime Pass";
  89.     set .itemid,    969;
  90.     set .pri_len,   getarraysize(.price);
  91.     set .amtper,    1;
  92.     for(set(.p, 1);.p<9;set(.p,.p+1)) {
  93.         monster "pvp_y_1-1",0,0,"Gold",1614,2500,"Gold Room::OnMobKilled";
  94.     }
  95. end;
  96. }
  97.  
  98. /// callfunc "str_charat", "<string>" , <pos> ;
  99. function    script  str_charat  {
  100.  
  101.     sleep2 1;
  102.  
  103.     setarray .@char$[ 0 ],
  104.         " ", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
  105.         "e", "i", "a", "s", "r", "n", "t", "o", "u", "l", "c",
  106.         "p", "m", "d", "v", "h", "g", "f", "b", "y", "q", "k",
  107.         "z", "x", "j", "w", "_", "-", ".", ",";
  108.  
  109.     set .@charsize, getarraysize(.@char$);
  110.     set .@tmp$, "|~key~|";
  111.     set .@str$, .@tmp$ + getarg(0) ;
  112.     set .@len, getstrlen(getarg(0));
  113.     set .@pos, getarg(1);
  114.  
  115.     if ( .@pos >= .@len ) return "";
  116.  
  117.     while( .@len>.@s ) {
  118.         set .@i,0;
  119.         while( .@i<.@charsize ) {
  120.             if ( ! ( set(.@l,.@l+1) % 650) )
  121.                 sleep2 1;
  122.             if ( compare( .@str$ , .@tmp$ + .@char$[.@i] ) ) {
  123.                 set .@tmp$, .@tmp$ + .@char$[.@i];
  124.                 if ( .@s == .@pos ) return .@char$[.@i] ;
  125.                 else break;
  126.             }
  127.             set .@i, .@i+1;
  128.         }
  129.         if ( .@i == .@charsize ) return 0;
  130.         else set .@s, .@s+1;
  131.     }
  132.     deletearray getd(getarg(1));
  133.     copyarray getd(getarg(1)), .@arr$, .@len;
  134.     return "";
  135. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement