#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# More elegant way to do this?

edited January 2013
I have a monster that can lay four different kinds of eggs, with different attributes. My notes go like this:
She was implanted with her 1st clutch, (4-kind). (5-wrong?) She laid (6-number of eggs) eggs, (7-days) days later. (8-survivors)% died, with a total of (8b) survivors. She rested (9-days) days.

5 - Generate random number between 1 & 100. If 1-5, print 'Something went wrong, (5b) days in.' Otherwise blank.
5b - If 4=drone, generate random number between 25 & 50. If 4=warrior, generate random number between 25 & 80. If 4=artisan, generate random number between 25 & 110. If 4=speaker, generate random number between 25 & 170.

6 - If 4=drone, generate random number between 30 & 40. If 4=warrior, generate random number between 15 & 20. If 4=artisan, generate random number between 10 & 12. If 4=speaker, generate random number between 6 & 10.

(7, 8, and 9 are dependent on 4 as well)

And my generator so far goes like this:
```Table: Mother
Set: Kind = &#91;@Kind&;#93;
She was implanted with her 1st clutch, {Kind}, on (2b). &#91;@Wrong&;#93;

Table: Kind
Type: Lookup
Roll: 1d20
1-7: drones
8-13: warriors
14-17: speakers
18-20: artisans

Table: Wrong
Type: Lookup
Roll: 1d100
1-5: Something went wrong &#91;@WrongDays&;#93; days in.
6-100: // leave blank
```

And that's where everything fell apart. What I need is something like:
if {\$Kind} = drones {1d25 + 25}
if {\$Kind} = warriors {1d55 + 25}
if {\$Kind} = speakers {1d145 + 25}
if {\$Kind} = artisans[do] {1d85 + 25}[end]

But conditionals can't do that and I can't figure a way to make it work. The only way I can figure to do it is something like
```Table: Mothers
She was implanted with her 1st clutch, &#91;@Kind&;#93;, on (2b).

Table: Kind
Type: Lookup
Roll: 1d20
1-7: &#91;@Drones&;#93;
8-13: warriors
14-17: speakers
18-20: artisans

Table: Drones
, on (2b). &#91;@WrongDrone&;#93;. She laid {1d10 + 20} eggs, {1d12 + 54} days later. {1d10 * 10}% died. (etc)

Table: WrongDrone
Type: Lookup
Roll: 1d100
1-5: Something went wrong {1d25 + 25} days in.
6-100: // leave blank
```

And basically duplicate all the stuff four times. There HAS to be a better way of doing that, but I don't know it. Suggestions?