Advertisement
Guest User

Untitled

a guest
Sep 28th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. prontera,164,173,3 script Ticket Gambling 562,{
  2. mes .n$;
  3. for( .@j = 0; .@j < getarraysize(.item); .@j++ ) {
  4. mes .qnt[.@j] +"x "+ Itemlink(.item[.@j ]) +"";
  5. }
  6. next;
  7. mes .n$;
  8. mes "Would you like to insert a Ticket now?";
  9. next;
  10. if( select("- Insert Ticket:- Cancel") == 2 ) {
  11. mes .n$;
  12. mes " ";
  13. close;
  14. }
  15. if( countitem(7608) >= 1 ) {
  16. mes .n$;
  17. mes "^0000FF*You insert the Promotion Ticket into the Machine slot and watch as she pulls the Ticket automatically*^000000";
  18. next;
  19. mes .n$;
  20. mes "This is great! This will be very useful.";
  21. delitem 7608,1;
  22. for( .@i = 0; .@i < getarraysize(.item); .@i++ ) {
  23. if( rand(1,100) <= .chance[.@i] ) {
  24. if( .item[.@i] == .GlobalMessage ) {
  25. announce "Player "+ strcharinfo(0) +" obtaining "+ .qnt[.@i] +" x "+ getitemname(.item[.@i]) +".",0;
  26. }
  27. getitem .item[.@i],.qnt[.@i];
  28. .@reward = 1;
  29. mes ""+.qnt[.@i]+" x "+Itemlink(.item[.@i])+"";
  30. close;
  31. }
  32. }
  33. if( !.@reward ) {
  34. .@i = rand(getarraysize(.item));
  35. if( .item[.@i] == .GlobalMessage ) {
  36. announce "Player "+ strcharinfo(0) +" obtaining "+ .qnt[.@i] +" x "+ getitemname(.item[.@i]) +".",0;
  37. }
  38. getitem .item[.@i], .qnt[.@i];
  39. end;
  40. }
  41. else {
  42. mes "You must have ^008800Premium Ticket^000000 to receive one of the items.";
  43. close;
  44. }
  45. }
  46. }
  47.  
  48. OnInit:
  49. .n$ = "[ Ticket Gambling ]";
  50. // Array of items, quantity and chance.
  51. // Chance 1 = 0.01
  52. setarray .item[0], 30029, 12412, 12915, 12903, 12904, 12908, 12905, 12906, 12907, 12912, 13858, 13588, 12210, 12709, 12710, 13718, 13750, 13756, 13714, 13711, 7608;
  53. setarray .qnt[0], 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 20, 5, 1, 1, 1, 1;
  54. setarray .chance[0], 50, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 5, 5, 10, 10;
  55.  
  56. // Send a Global Message to everyone online when win item with id
  57. .GlobalMessage = 7608;
  58. end;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement