The Hazard game has the following rules : The player rolls 2d6. If the score is 7, they win. Any other score is called the main, and they have to roll the dice again. After that, the main wins; 7 loses and any other score rolls again.
Examples: player rolls 7 (wins). Player rolls 6, 3, 6 (wins). Player rolls 6, 3, 7 (loses).
The player decides how much to bet before the first roll. If they win, they get twice the stake, otherwise they lose it.
Medieval rules were more complicated:
http://en.wikipedia....i/Hazard_(game)
The game is in the conversation croupier_hazard. It's embedded in my monolithic scripting system, which probably won't interest you, but you can break out the logic from the following into conventional condition / action scripts.
The condition scripts corresponding to check options 1-5 are
Spoiler
object oPC = GetFirstPC();
int nGold = GetGold(oPC);
if (nOption == 1) return (nGold >= 10);
if (nOption == 2) return (nGold >= 100);
if (nOption == 3) return (nGold >= 1000);
if (nOption == 4) {bhHazard();
if (!GetLocalInt(oPC, "DiceMain"))
{
if (GetLocalInt(oPC, "DiceRoll") == 7)
{GiveGoldToCreature(oPC, 2 * GetLocalInt(oPC, "AlbaBetGold"));
DeleteLocalInt(oPC, "DiceMain"); return TRUE;}
SetLocalInt(oPC, "DiceMain", GetLocalInt(oPC, "DiceRoll"));
return FALSE;
}
if (GetLocalInt(oPC, "DiceRoll") == GetLocalInt(oPC, "DiceMain"))
{GiveGoldToCreature(oPC, 2 * GetLocalInt(oPC, "AlbaBetGold"));
DeleteLocalInt(oPC, "DiceMain"); return TRUE;}
return FALSE;}
if (nOption == 5) if (GetLocalInt(oPC, "DiceRoll") == 7) {DeleteLocalInt(oPC, "DiceMain"); return TRUE;}
else return FALSE;
This could simply be five conditional scripts. The hazard function is
The Action Taken scripts are
Spoiler
if (nOption == 1) {SetLocalInt(oPC, "AlbaBetGold", 10); TakeGoldFromCreature(10, oPC, FALSE);}
if (nOption == 2) {SetLocalInt(oPC, "AlbaBetGold", 100); TakeGoldFromCreature(100, oPC, FALSE);}
if (nOption == 3) {SetLocalInt(oPC, "AlbaBetGold", 1000); TakeGoldFromCreature(1000, oPC, FALSE);}