Advertisement
Skorm

Crafty Chest v2

Sep 7th, 2013
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.15 KB | None | 0 0
  1. //warp portal 128 45, 141 150
  2. // warp portal prontera 139 150 ,prt_in 128 43
  3. //effect 47 light torch
  4. prontera,139,150,0  warp    CraftyChest#1   1,1,prt_in,128,43
  5. prt_in,128,45,0 warp    CraftyChest#2   1,1,prontera,141,150
  6. //By Skorm
  7. prt_in,132,29,3 script  Crafty Kreg 407,{
  8. setcell "prt_in",116,41,137,16,cell_shootable,0;
  9. setcell "prt_in",133,32,134,31,cell_walkable,0;
  10. set .npc$, "[Kreg]";
  11. //set @price,50;
  12. //getmapxy(.@map$,.@x,.@y,0);
  13. mes "(^00CC77So far "+$MaxCName$+" is the best at this game with "+$MaxCRound+" Rounds^000000)";
  14. set @price,100000;
  15. mes .npc$;
  16. mes "Hello, Do you want to try your luck at a game of Crafty Chest? But it's not cheap 50k to play.";
  17. //if(getmapusers("force_3-1")!=0) { mes "Room Status: [^FF0000Occupied^000000]"; close; } else
  18. //mes "Room Status: [^0000FFOpen^000000]";
  19. if(getgmlevel()>80){
  20. mes "Oh! Sir thanks for coming what would you like to do?";
  21. if(select("Continue to normal menu:Reset Best At game")-1){
  22. set $MaxCName,"";
  23. set $MaxCRound,0;
  24. mes "Done"; close;
  25. }
  26. }
  27.     switch(select("uhhmm yeah, sure I'll give it a shot.","Nawh this things a scam!","Can you Explain what that is first?","Rewards")) {
  28.  
  29.    
  30.     case 1:
  31.         if(Zeny < @price) { mes "Sorry you don't have enough zeny to play this game, it costs 50,000 Zeny to play."; close; end; } else
  32.         set Zeny,Zeny-@price;
  33.         next;
  34.         mes .npc$;
  35.         mes "Ok Just Pick a chest kill it if you win then you'll move on.";
  36.         next;
  37.         set CRound,0;
  38.         warp "prt_in",137,32;
  39.         callfunc "Crafty-chest";
  40.     case 2:
  41.         close;
  42.     case 3:
  43.         mes "Sure It's pretty self explained, you kill a chest, if you pick the right one you win and move on to the next round.";
  44.         close;
  45.     case 4:
  46.         switch(select("1-5:6-9:10+")){
  47.             if(@menu==1){
  48.                 for(set .@a,0; .@a<getarraysize(.PrizeR); set .@a,.@a + 1){
  49.                     mes getitemname(.PrizeR[.@a])+",";
  50.                     if(!(.@a%10)) next;
  51.                     if(.@a==(getarraysize(.PrizeR)-1)) close;
  52.                 }
  53.             } if(@menu==2){
  54.                 for(set .@a,0; .@a<getarraysize(.pos); set .@a,.@a + 1){
  55.                     mes getitemname(.pos[.@a])+",";
  56.                     if(!(.@a%10)) next;
  57.                     if(.@a==(getarraysize(.pos)-1)) close;
  58.                 }
  59.             } if(@menu==3){
  60.                 for(set .@a,0; .@a<getarraysize(.PrizeRs); set .@a,.@a + 1){
  61.                     mes getitemname(.PrizeRs[.@a])+",";
  62.                     if(!(.@a%10)) next;
  63.                     if(.@a==(getarraysize(.PrizeRs)-1)) close;
  64.                 }
  65.             }
  66.         }
  67.     }
  68.  
  69. OnInit:
  70. setcell "prt_in",116,41,137,16,cell_shootable,0;
  71. setcell "prt_in",133,32,134,31,cell_walkable,0;
  72. end;
  73.  
  74. OnNPCKillEvent:
  75.     if(getgmlevel()>10) end;
  76.     getmapxy(@map$,.@x,.@y,0);
  77.     if((killedrid==2288) && (@map$ == "prt_in")) {
  78.     if(getequipid(3)!=-1){ warp "prt_in",131,32; mes "Sorry you can't use weapons"; close; end; } else
  79.     if(getequipid(4)!=-1){ warp "prt_in",131,32; mes "Sorry you can't use weapons"; close; end; } else
  80.     setArray .PrizeR[1],
  81.         619, 0, 12016, 1000, 604, 678, 570, 645, 501, 0,
  82.         0, 0, 501, 502, 503, 504, 505, 506, 507, 12116,
  83.         0, 0, 9003, 0, 0, 601, 602, 603, 604, 12114,
  84.         605, 606, 607, 608, 609, 610, 611, 612, 0, 12117;
  85.     setArray .pos[0],2,572,10,21007,11,12208,12,12264,21,13804,22,20465,24,12020,25,12214,39,12115;
  86.     for(set .@a,0; .@a < getarraysize(.pos); set .@a,.@a + 2) {
  87.         set .@val,.@a + 1;
  88.         set .PrizeR[.pos[.@a]],.pos[.@val];
  89.     }
  90.     setArray .PrizeRs[1], 4365, 4441, 4403, 4342, 12103, 512, 4359, 4509, 25539, 4302;
  91.         if(CRound>=10) {
  92.             if(rand(1,20) == 1) { emotion e_grat,0; if(rand(0,1)) { set .@pz,rand(1,10); getitem .PrizeRs[.@pz],1; announce strcharinfo(0)+" made it to Round " + CRound + " in crafty chest and got a ["+getitemname(.PrizeRs[.@pz])+"].",bc_blue;} dispbottom "awesome Round!."; emotion e_omg,1; callfunc "Crafty-chest"; }
  93.             atcommand "@effect 1"; warp "prt_in",131,32; dispbottom "You lose."; set CRound,0; end;
  94.         } if(CRound>=8) {
  95.             if(((CRound>=9)?rand(1,10) == 1:rand(1,3) == 1)) { emotion e_grat,0; getitem .PrizeR[rand(1,40)],CRound; dispbottom "awesome Round!."; emotion e_omg,1; callfunc "Crafty-chest"; }
  96.             atcommand "@effect 1"; warp "prt_in",131,32; dispbottom "You lose."; set CRound,0; end;
  97.         } if(rand(1,2) == 1) { emotion e_grat,0; if(CRound>=3) { getitem .PrizeR[rand(1,40)],CRound; } dispbottom "awesome Round!."; emotion e_omg,1; callfunc "Crafty-chest"; }
  98.             atcommand "@effect 1"; warp "prt_in",131,32; dispbottom "You lose."; set CRound,0; end;
  99.     } else {
  100.         end;
  101.     }
  102. }
  103.  
  104. function    script  Crafty-chest    {
  105.     unequip 3;
  106.     unequip 4;
  107.     setArray .CraftyR[1],
  108.         1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
  109.         11, 12, 13, 14, 15, 16, 17, 18, 19, 20;
  110.     set CRound,CRound + 1;
  111.     if(CRound>=$MaxCRound) { set $MaxCRound,CRound; set $MaxCName$,""+strcharinfo(0)+""; } else
  112.     killmonsterall "prt_in";
  113.     monster "prt_in",136,34,"Crafty Chest-1",2288,1,"";
  114.     monster "prt_in",136,32,"Crafty Chest-2",2288,1,"";
  115.     if(CRound>=3) { monster "prt_in",136,30,"Crafty Chest-3",2288,1,""; } else
  116.     if(CRound>=8) { monster "prt_in",136,28,"Crafty Chest-4",2288,1,""; } else
  117.     if(CRound==getarraysize(.CraftyR[1])) { warp "prt_in",131,32; } else
  118.     dispbottom "Round "+CRound;
  119. //  atcommand "@localbroadcast Round "+CRound+""+@localbroadcast$;
  120.     mapannounce "prt_in",strcharinfo(0)+" made it to Round " + CRound + "",bc_map | bc_blue;
  121. }
  122.  
  123.  
  124. prt_in  mapflag nowarp
  125. prt_in  mapflag nomemo
  126. prt_in  mapflag nosave
  127. prt_in  mapflag noskill
  128. prt_in  mapflag nodrop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement