Quote:
PHP Code:
if(player.rupees > 19){
player.chat = "I Brought A Lottery Ticket!";
Lottery.addAccount(player.account);
player.rupees -= 20;
server.jackpot += 20;
onUpdateText();
}
|
You probably should check if the player has already gotten a ticket before removing their rupees, or increase his/her chances by removing:
Quote:
PHP Code:
if (inLottery(acct)) {
// Already in lottery
return false;
}
|
Also, I believe there is a rediculously slight chance that
Quote:
PHP Code:
public function pickLotteryWinner() {
return this.lottery[int(random(0, this.lottery.size()))];
}
|
will return null in the case that the random function returned the maximum possibility. However, I might be wrong about that. I'm not sure.
Perhaps try something like this to ensure that does not happen, although this does very slightly affect the odds...
PHP Code:
return this.lottery[int(random(0, this.lottery.size()-0.01))];