//Determines the race of a generated henchman, with some being more probable than the others void main() { object oPC = GetPCSpeaker(); //30% chance of the henchman being a human if (d100()<=30) { SetLocalString(oPC, "hench_race", "_h"); } //20% chance of the henchman being an elf else if (d100()<=29) { SetLocalString(oPC, "hench_race", "_e"); } //20% chance of the henchman being a dwarf else if (d100()<=40) { SetLocalString(oPC, "hench_race", "_d"); } //10% chance of the henchman being a gnome else if (d100()<=33) { SetLocalString(oPC, "hench_race", "_g"); } //10% chance of the henchman being a halfling else if (d100()<=50) { SetLocalString(oPC, "hench_race", "_ha"); } //5% chance of the henchman being a half-orc else if (d100()<=50) { SetLocalString(oPC, "hench_race", "_ho"); } //5% chance of the henchman being a half-elf else { SetLocalString(oPC, "hench_race", "_he"); } //Choose the appropriate name and surname from the set established earlier SetLocalString(oPC, "hench_name", ("name" + GetLocalString(oPC, "hench_race") + GetLocalString(oPC, "hench_gender"))); SetLocalString(oPC, "hench_surname", ("name" + GetLocalString(oPC, "hench_race") + "_s")); //Set custom token with the name of the henchman to refer to it in a moment in a conversation. SetCustomToken(968,GetLocalString(oPC, GetLocalString(oPC, "hench_name"))); }