viewing paste Ez2 Lotto | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304
//===== eAthena Script =======================================
//= Ez2 Lottery Script
//===== By: ==================================================
//= chan - teamcars1broglobal.blogspot.com
//===== Current Version: =====================================
//= 1.1.1a
//===== Compatible With: =====================================
//= Any Hercules Version
//===== Description: =========================================
//= Ez2 lottery draw. 
//= Just like in Ez2 Lotto in the Philippines
//===== Additional Comments: =================================
//= Numbers drawn daily every hour
//= this is from acky Lottery Script
//= I just modify it
//============================================================
 
prontera,162,194,5  script  ezlotterygenerator  817,{
 
OnInit:
waitingroom "Let's Play Ez2 Lotto",0;
set $L_TicketPrice,10; // TICKET COST
set $L_Prize_Money,1000000; // JACKPOT AMOUNT
set $L_Prize_Money_Small,500000; // SECONDARY PRIZE
if ($LID == 0) goto L_GenID;
end;
 
//Modify for own time
    OnClock0000:
    OnClock0100:
    OnClock0200:
    OnClock0300:
    OnClock0400:
    OnClock0500:
    OnClock0600:
    OnClock0700:
    OnClock0800:
    OnClock0900:
    OnClock1000:
    OnClock1100:
    OnClock1200:
    OnClock1300:
    OnClock1400:
    OnClock1500:
    OnClock1600:
    OnClock1700:
    OnClock1800:
    OnClock1900:
    OnClock2000:
    OnClock2100:
    OnClock2200:
    OnClock2300:
set $S_LastDr$,gettimestr("%H:%M",21);
goto C_Ez2;
 
C_Ez2:
// CHECKS IF LOTTERY IS RIGGED
if ($L_Rigged == 1) goto L_Rigged_Draw;
// GENERATES RANDOM NUMBERS 1-31
Pick1:
set $LW1,rand (1,31);
Pick2:
set $LW2,rand (1,31);
 
 
 
// BROADCASTS DRAW
L_Broadcast:
announce "Welcome to Ez2 Lotto " + $S_LastDr$ + " Draw!",8;
announce "The numbers are as follows: [" + $LW1 + "] [" + $LW2 + "]",8;
announce "Congratulations to the winners of Ez2 Lotto!",8;
 
 
// GENERATES DRAW ID CODE
L_GenID:
set $LID2,$LID;
// setS Next ID NUMBER
set $LID,rand (100000,999999);
end;
 
// setS DRAW TO RIGGED NUMBERS
L_Rigged_Draw:
 
set $LW1,$LR1;
set $LW2,$LR2;
set $L_Rigged,0;
goto L_Broadcast;
 
}
 
// BEGIN LOTTERY SCRIPT
-   script  ezlottery   76,{
L_Begin:
mes "[^008800Ez2 Teller^000000]";
mes "Winning EZ2 Lotto Numbers ("+$LID2+"):";
mes "The Last Draw ^0000FF[" + $S_LastDr$ + "]^000000";
mes "^0000FF[" + $LW1 + "] [" + $LW2 + "]^000000";
if ($LID > 99999) mes "Your Ticket ("+#LID+"):";
if ($LID > 99999) mes "^FF0000[" + #LW1 + "] [" + #LW2 + "]^000000";
mes "Next Draw-ID: ^FF0000" + $LID + "^000000.";
next;
if (getgmlevel() > 2) goto L_GM;
menu "Claim Prize",L_Claim,"Buy New Ticket",L_Buy,"Cancel",L_Cancel;
 
// PURCHASE TICKET
L_Buy:
if (#LID == $LID && #LW1 != 0) goto L_DoubleTicket;
mes "[^008800Ez2 Teller^000000]";
mes "Tickets cost ^0000FF" + $L_TicketPrice + "z^000000.";
mes "The Jackpot is ^FF0000" + $L_Prize_Money + "z^000000.";
next;
menu "Buy Ticket",-,"Cancel",L_Cancel;
if (Zeny < $L_TicketPrice) goto L_NoZeny;
set Zeny,Zeny-$L_TicketPrice;
mes "[^008800Ez2 Teller^000000]";
mes "Would you like your numbers Hand Picked or Lucky Picked?";
next;
menu "Lucky Picked",L_ComputerGen,"Hand Picked",L_HandPick,"Renew Ticket",L_Renew;
 
// RENEW LAST TICKET
L_Renew:
if ($LID < 99999) goto L_Invalid;
set #LID,$LID;
goto L_Confirm2;
 
L_ComputerGen:
// SELECTS RANDOM NUMBERS
set @L1,0;
set @L2,0;
 
Pick1:
set @L1,rand (1,31);
Pick2:
set @L2,rand (1,31);
 
 
mes "[^008800Ez2 Teller^000000]";
mes "The computer has selected the following numbers:";
mes "^0000FF" + @L1 + " " + @L2 + "^000000";
next;
menu "Confirm",L_Confirm,"Re-Generate",L_ComputerGen;
 
// HAND PICK LOTTERY NUMBERS
L_HandPick:
mes "[^008800Ez2 Teller^000000]";
mes "Please pick your numbers (1-31):";
set @L1,0;
set @L2,0;
 
input1:
input @L1;
if (@L1 < 1 || @L1 > 31) goto input1;
mes @L1;
input2:
input @L2;
if (@L2 < 1 || @L2 > 31) goto input2;
 
mes @L2;
 
next;
mes "[^008800Ez2 Teller^000000]";
mes "Your numbers are:";
mes "^0000FF" + @L1 + " " + @L2 + "^000000";
next;
menu "Confirm",L_Confirm,"Re-Pick",L_HandPick;
 
L_Confirm:
set #LW1,@L1;
set #LW2,@L2;
set #LID,$LID;
L_Confirm2:
mes "[^008800Ez2 Teller^000000]";
mes "The live broadcasted draw are at 11am, 4pm and 9pm";
mes "You can claim your ticket between then and the next draw.";
next;
mes "[^008800Ez2 Teller^000000]";
mes "Good luck!";
close;
 
L_Claim:
// CHECKS TICKET VALIDILITY
if (#LID != $LID2) goto L_Invalid;
// CHECKS HOW MANY NUMBERS MATCHED
set @LPrize,0;
if (#LW1 == $LW1) set @LPrize,@LPrize+1;
if (#LW2 == $LW2) set @LPrize,@LPrize+1;
if (@LPrize == 2) goto LWinBig;
if (#LW1 == $LW2) set @LPrize,@LPrize+2;
if (#LW2 == $LW1) set @LPrize,@LPrize+2;
if (@LPrize == 4) goto LWinSmall;
 
// NO WINNER
mes "[^008800Ez2 Teller^000000]";
mes "Bad luck, it appears you do not hold a winning ticket.";
next;
mes "[^008800Ez2 Teller^000000]";
mes "Better luck next time!.";
set #LID,0;
close;
 
// MATCHED TWO IN EXACT ORDER
LWinBig:
mes "[^008800Ez2 Teller^000000]";
mes "You have matched Two Numbers in Exact Order";
mes "Jackpot!";
mes "You've won ^0000FF" + $L_Prize_Money + "z^000000.";
set Zeny,Zeny+$L_Prize_Money;
announce "Ez2 Teller: " + strcharinfo(0) + " has won the JACKPOT of " + $L_Prize_Money + "z!",8;
set #LID,0;
close;
 
// MATCHED TWO I RANDOM ORDER
LWinSmall:
mes "[^008800Ez2 Teller^000000]";
mes "You have matched Two numbers in Random Order";
mes "You've won ^0000FF" + $L_Prize_Money_Small + "z^000000.";
set Zeny,Zeny+$L_Prize_Money_Small;
announce "Ez2 Teller: " + strcharinfo(0) + " has won a prize of " + $L_Prize_Money_Small + "z!",8;
set #LID,0;
close;
 
// NO Zeny
L_NoZeny:
mes "[^008800Ez2 Teller^000000]";
mes "You can't afford a Ez2 Lottery ticket.";
close;
 
// INVALID TICKET
L_Invalid:
mes "[^008800Ez2 Teller^000000]";
mes "I'm sorry but it appears that you have an invalid ticket.";
close;
 
// DOUBLE TICKET
L_DoubleTicket:
mes "[^008800Ez2 Teller^000000]";
mes "It appears that you already have a ticket for today.";
mes "You may only purchase one ticket per draw.";
close;
 
L_Cancel:
mes "[^008800Ez2 Teller^000000]";
mes "Come back soon!";
close;
 
// GM MENU (Lets you manually do draws)
L_GM:
menu "Claim Prize",L_Claim,"Buy New Ticket",L_Buy,"[GM]Do Draw Now",-,"[GM]Rig the Ez2 Lottery",L_GM_Rig,"Cancel",L_Cancel;
 
// CHECKS IF Lottery IS RIGGED
if ($L_Rigged == 1) goto L_Rigged_Draw;
// GENERATES RANDOM NUMBERS 1-31
GMPick1:
set $LW1,rand (1,31);
 
GMPick2:
set $LW2,rand (1,31);
 
 
 
// BROADCASTS DRAW
L_Broadcast:
announce "Ez2 Teller: Welcome to the Special GM's Ez2 Lotto draw!",8;
announce "The numbers are as follows: [" + $LW1 + "] [" + $LW2 + "]",8;
announce "Congratulations to the Ez2 Lotto winners!",8;
 
// GENERATES DRAW ID CODE
L_GenID:
set $LID2,$LID;
// setS Next ID NUMBER
set $LID,rand (100000,999999);
set $S_LastDr$,"Special GM's draw!";
close;
 
// setS DRAW TO RIGGED NUMBERS
L_Rigged_Draw:
set $LW1,$LR1;
set $LW2,$LR2;
set $L_Rigged,0;
goto L_Broadcast;
 
// ALLOWS GM TO DO A RIGGED DRAW
L_GM_Rig:
mes "[Lottery]";
mes "Please pick your numbers (1-31):";
set $LR1,0;
set $LR2,0;
GMinput1:
input $LR1;
if ($LR1 < 1 || $LR1 > 31) goto GMinput1;
mes $LR1;
GMinput2:
input $LR2;
if ($LR2 < 1 || $LR2 > 31) goto GMinput2;
 
mes $LR2;
next;
mes "[^008800Ez2 Teller^000000]";
mes "Lottery rigged for next draw.";
set $L_Rigged,1;
close;
}
 
prontera,162,194,5  duplicate(ezlottery)    Ez2 Lotto Teller    817
Viewed 1198 times, submitted by Guest.