-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfamhist2.php
2291 lines (2231 loc) · 80.9 KB
/
famhist2.php
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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML>
<?php
/*
TO DO
=====
Early Family History
Random clans
Random homelands
Random ancestor backgrounds
Random own homeland
Choices (like in Battle of Pennel Ford result 20)
Alternative birth years
Add Balazarings http://www.backtobalazar.com/significant-family-events/
Optional participation in yearly events
Option to input dice roll results
*/
echo "<html>";
echo "<head>";
echo " <meta charset=\"utf-8\">";
echo " <title>RQG Family History</title>";
echo " <link rel=\"stylesheet\" href=\"css/style.css\" />";
echo "</head>";
echo "<body>";
echo "<h1>Family History</h1>";
$homeland = $_POST['homeland'];
$grandocc = $_POST['grandocc'];
$parentocc = $_POST['parentocc'];
$early = $_POST['early'];
$gpdead = 0;
$pdead = 0;
$siege1623 = 0;
$pennel = 0;
$liberation = 0;
function hitLoc()
{
$loc = mt_rand (1,20);
if ($loc < 5)
{
$hit = "right leg";
return $hit;
}
if ($loc > 4 && $loc < 9)
{
$hit = "left leg";
return $hit;
}
if ($loc > 8 && $loc < 12)
{
$hit = "abdomen";
return $hit;
}
if ($loc == 12)
{
$hit = "chest";
return $hit;
}
if ($loc > 12 && $loc < 16)
{
$hit = "right arm";
return $hit;
}
if ($loc > 15 && $loc < 19)
{
$hit = "right arm";
return $hit;
}
if ($loc > 18)
{
$hit = "head";
return $hit;
}
}
function elderRace()
{
$race = mt_rand (1,6);
if ($race == 1)
{
return "Aldryami";
}
if ($race == 2)
{
return "Beast Men";
}
if ($race == 3)
{
return "dragonewts";
}
if ($race == 4)
{
return "dwarves";
}
if ($race == 5)
{
return "trolls";
}
if ($race == 6)
{
return "tusk riders";
}
}
function elderFriend()
{
$race = mt_rand (1,9);
if ($race == 1)
{
return "centaur";
}
if ($race == 2)
{
return "dark troll";
}
if ($race == 3)
{
return "dragonewt";
}
if ($race == 4)
{
return "dwarf";
}
if ($race == 5)
{
return "duck";
}
if ($race == 6)
{
return "elf";
}
if ($race == 7)
{
return "fox woman";
}
if ($race == 8)
{
return "Telmori werewolf";
}
if ($race == 9)
{
return "Wind Child";
}
}
function civilwar()
{
$civilwar = mt_rand (1,20);
if ($homeland == "Lunar Tarsh")
{
$civilwar = $civilwar - 5;
}
if ($homeland == "Esrolia" || $homeland == "Sartar")
{
$civilwar = $civilwar + 5;
}
if ($civilwar < 6)
{
echo "<p>You barely survived assassination by Old Earth Alliance partisans. Gain Hate (Esrolia).</p>";
}
if ($civilwar > 5 && $civilwar < 16)
{
echo "<p>You survived.</p>";
$siege1623 = 1;
}
if ($civilwar > 15 && $civilwar < 18)
{
echo "<p>You barely survived assassination by Red Earth Alliance partisans of the Lunar Empire. Gain Hate (Lunar Empire).</p>";
}
if ($civilwar > 17 && $civilwar < 20)
{
$pillage = 100*(mt_rand (1,6) + mt_rand (1,6) + mt_rand (1,6));
echo "<p>You pillaged Red Earth supporters. Gain $pillage L.</p>";
}
if ($civilwar > 19)
{
$rep = mt_rand (1,6);
echo "<p>You fought gloriously protecting Queen Samastina from Red Earth assassins. Gain Honor and Loyalty (Queen Samastina). Gain +$rep% Reputation.</p>";
}
}
function aurochHills()
{
$auroch = mt_rand (1,20);
if ($homeland == "Lunar Tarsh")
{
$auroch = $auroch - 5;
}
if ($homeland == "Sartar")
{
$auroch = $auroch + 5;
}
if ($auroch < 2)
{
echo "You were nearly killed by rebel magicians. Gain Battle +5% and Hate (Sartar).</p>";
}
if ($auroch > 1 && $auroch < 6)
{
echo "You were nearly killed in battle. Gain Battle +5%.</p>";
}
if ($auroch > 5 && $auroch < 16)
{
echo "You survived. Gain Battle +5%.</p>";
}
if ($auroch > 15 && $auroch < 18)
{
echo "You were wounded. Gain Battle +5%.</p>";
}
if ($auroch > 17 && $auroch < 20)
{
$rep = mt_rand (1,6);
echo "You fought with great glory for the gods. Gain Honor Passion, Loyalty (temple), and +$rep% Reputation.</p>";
}
if ($auroch > 19)
{
$rep = mt_rand (1,6);
echo "You aided King Broyan in awakening Orlanth. Gain +5% Battle, Devotion (deity), and +$rep% Reputation. You then took part in the civil war in Esrolia.</p>";
civilwar();
}
}
function jaldonsum()
{
$jaldon = mt_rand (1,20);
if ($jaldon < 11)
{
echo "<p>You were present at the summoning of Jaldon Goldentooth. You acknowledged Argrath as the White Bull and returned to your tribe. Gain Loyalty (White Bull).</p>";
}
if ($jaldon > 10 && $jaldon < 16)
{
echo "<p>You were present at the summoning of Jaldon Goldentooth. You acknowledged Argrath as the White Bull and returned to your tribe. Gain Loyalty (White Bull).</p>";
$liberation = 1;
}
if ($jaldon > 15 && $jaldon < 19)
{
echo "<p>You were present at the summoning of Jaldon Goldentooth. You pledged undying loyalty to Argrath as the White Bull and to Jaldon Goldentooth. Gain Devotion (White Bull). Gain Loyalty (White Bull) at 70% or +20%.</p>";
$liberation = 1;
}
if ($jaldon > 18)
{
$rep = mt_rand (1,6);
echo "<p>You were present at the summoning of Jaldon Goldentooth. You killed a member of your tribe who opposed allying with the White Bull. Gain +$rep% Reputation, Loyalty (White Bull) at 70% or +20%, and modify Loyalty (tribe) by -10%</p>";
$liberation = 1;
}
}
function heirloom($roll)
{
$magic = " ";
if ($roll == 1)
{
$magic = "an ancestor worshiped as a hero by your cult. Gain Devotion (deity) or Loyalty (temple) or add +10% if already possessed. You also get +5% bonus to your Orate and +5% to your Reputation.";
}
if ($roll == 2)
{
$magic = "a famous hero as an ancestor. Add +10% to the Orate skill and +5% to your Reputation.";
}
if ($roll == 3)
{
$pot = mt_rand (1,6);
$magic = "a pot of woad (see Rune magic spell Bless Woad), $pot points of potency.";
}
if ($roll == 4)
{
$pots = mt_rand (1,3);
$magic = "$pots pots of Rhino Fat. Each pot contains enough to add 1 point of armor to all hit locations, which can be worn below clothing and armor, though the smell is quite pungent. One application takes ten minutes to apply and lasts one hour, though the smell of rancid meat lingers.";
}
if ($roll == 5)
{
$magic = "a bronze or ceramic votive image of your god that adds +10% to the Worship (deity) skill.";
}
if ($roll == 6)
{
$flip = mt_rand (1,2);
if ($flip == 1)
{
$thing = "brooch";
} else
{
$thing = "buckle";
}
$magic = "a $thing depicting a fat, grinning dwarf that is a 2-point spell matrix for Heal 2.";
}
if ($roll == 7)
{
$magic = "a small stone figurine of a crested dragonewt pointing in a direction. The figurine is a 1-point spell matrix for a Find (substance) spell; the player chooses what specific substance.";
}
if ($roll > 7 && $roll < 12)
{
$mps = (mt_rand (1,6) + mt_rand (1,6)) + 3;
$magic = "a magic POW storage crystal that can hold up to $mps magic points or serve as a spiritbinding matrix.";
}
if ($roll == 12)
{
$int = (mt_rand (1,6) + mt_rand (1,6) + mt_rand (1,6));
$pow = (mt_rand (1,6) + mt_rand (1,6) + mt_rand (1,6));
$magic = "an awakened small animal (SIZ 2 or less, such as a cat, a lizard, a bird, etc.) with $int INT and $pow POW. Otherwise it is normal for its species. The animal knows 3 points of spirit magic of your choice. It can speak the adventurer's language and serves as a loyal companion, but is otherwise independent.";
}
if ($roll == 13)
{
$num = mt_rand (1,6);
$magic = "$num healing potions that heal 1D10 points of damage each.";
}
if ($roll == 14)
{
$worth = 100 * (mt_rand (1,6) + mt_rand (1,6));
$magic = "a necklace worth $worth L containing a 2-point spirit magic matrix for Glamour 2.";
}
if ($roll == 15)
{
$worth = 100 * (mt_rand (1,6) + mt_rand (1,6));
$magic = "an ancient gold serpent armband with 2 points of a spirit magic matrix, worth $worth L.";
}
if ($roll == 16)
{
$magic = "a finely-made musical instrument, imbued with magical properties (add +20% to Play Instrument when used).";
}
if ($roll == 17)
{
$magic = "a finely made weapon (+1 HP and worth twice as much as normal) containing a 2-point spirit magic spell matrix (Bladesharp, Bludgeon, Multimissile, or Strength).";
}
if ($roll == 18)
{
$enc = mt_rand (1,3);
$magic = "an ingot of iron or other pure Rune metal weighing $enc ENC which can be forged into a weapon, piece of armor, or other object. An unenchanted iron item has half again the number of hit or armor points. Each point of ENC reduces the user's chance of casting magic by -5%, with the same chance that magic spells cast on them will have no effect. Enchanted items act as normal.";
}
if ($roll == 19)
{
$magic = "an ostentatious metal helmet (normal AP and ENC but worth thrice normal) and containing a 2-point spirit magic matrix (Countermagic, Protection, or Spirit Screen).";
}
if ($roll > 19)
{
$magic = "<i>((Roll twice. If this roll comes up again, roll twice more.))</i>";
}
return $magic;
}
function libPavis()
{
$pavis = mt_rand (1,20);
if ($homeland == "Lunar Tarsh")
{
$pavis = $pavis - 10;
}
if ($homeland == "Prax")
{
$pavis = $pavis + 5;
}
if ($homeland == "Sartar")
{
$pavis = $pavis + 5;
}
if ($pavis < 2)
{
echo "<p>During the Liberation of Pavis you were sold into slavery. You may have later escaped, or you now belong to another. Gain Hate (Prax) at 80%.</p>";
}
if ($pavis == 2)
{
echo "<p>During the Liberation of Pavis you were badly wounded, robbed, and left for dead by Praxians or Sartarite rebels. Gain Hate (Prax) or Hate (Sartar). Give yourself a distinctive scar.</p>";
}
if ($pavis > 2 && $pavis < 9)
{
$hit = hitLoc();
echo "<p>During the Liberation of Pavis you were nearly killed in battle. Gain Battle +5% and a distinctive scar on your $hit.</p>";
}
if ($pavis > 8 && $pavis < 14)
{
echo "<p>You survived the Liberation of Pavis. Gain Battle +5%.</p>";
}
if ($pavis == 14)
{
$rep = mt_rand (1,3);
$hit = hitLoc();
echo "<p>You fought with great glory during the Liberation of Pavis. Gain Honor Passion, Battle +10%, +$rep% Reputation, and a distinctive scar on your $hit.</p>";
}
if ($pavis > 14 && $pavis < 20)
{
$pavisloot = 100 * (mt_rand (1,6));
$rep = mt_rand (1,3);
echo "<p>You fought in the Liberation of Pavis and acclaimed Argrath as King of Pavis. Gain Loyalty (Argrath), Battle +10%, +$rep% Reputation, and $pavisloot L in war booty.</p>";
}
if ($pavis > 19)
{
echo "<p>After the Liberation of Pavis you were nearly killed or temporarily driven insane by Lunar demons when the Praxians came to Dragon Pass to destroy the New Lunar Temple. Gain Hate (Lunar Empire) and Spirit Combat +10%.</p>";
}
}
function libSartar()
{
$sartar = mt_rand (1,20);
if ($sartar == 1)
{
$rep = mt_rand (1,3);
echo "<p>You fought with great glory during the Liberation of Sartar. Gain Honor Passion, Loyalty (Sartar), +$rep% Reputation, and Battle +10%.</p>";
}
if ($sartar > 1 && $sartar < 6)
{
$hit = hitLoc();
echo "<p>You were nearly killed in battle during the Liberation of Sartar. Gain a distinctive scar on your $hit and Battle +5%.</p>";
}
if ($sartar > 5 && $sartar < 11)
{
echo "<p>You fought in the Liberation of Sartar and survived. Gain Battle +5%.</p>";
}
if ($sartar > 10)
{
echo "<p>After the Liberation of Sartar you witnessed Kallyr Starbrow acclaimed as Prince of Sartar in Boldhome. Gain Loyalty (Sartar) and Battle +5%.</p>";
}
}
function shaker()
{
$shaker = mt_rand (1,20);
if ($shaker == 1)
{
$rep = mt_rand (1,3);
echo "<p>As the Shaker Priestess appointed a New King you were offered as sacrifice to the Cannibal Virgins but somehow survived. Gain Devotion (deity) and +$rep% Reputation.</p>";
}
if ($shaker > 1 && $shaker < 7)
{
echo "<p>You supported Onjur Fazzursson as king. Gain Loyalty (General Fazzur).</p>";
}
if ($shaker > 6 && $shaker < 19)
{
echo "<p>You witnessed the Shaker Priestess acclaim Unstey as King of Wintertop. Gain Loyalty (Shaker Temple).</p>";
}
if ($shaker > 18)
{
$hit = hitLoc();
$rep = mt_rand (1,3);
echo "<p>As the Shaker Priestess appointed a New King you were nearly killed fighting followers of King Pharandros. Gain Hate (King Pharandros), +$rep% Reputation, and a distinctive scar on your $hit.</p>";
}
}
function death()
{
$how = mt_rand (1,20);
if ($how < 4)
{
echo "was killed in a personal feud with another clan. Gain Hate (other clan) or Loyalty (own clan).";
}
if ($how > 3 && $how < 7)
{
echo "was killed in battle with a neighboring land. Gain Hate (other Homeland).";
}
if ($how == 7)
{
echo "was killed by ";
$chaos = mt_rand (1,4);
if ($chaos == 1)
{
echo "broo. ";
}
if ($chaos == 2)
{
echo "disease spirit. ";
}
if ($chaos == 3)
{
echo "ogres. ";
}
if ($chaos == 4)
{
echo "scorpion men. ";
}
echo "Gain Hate (Chaos).";
}
if ($how > 7 && $how < 11)
{
echo "was killed by ";
$who = elderRace();
echo $who,". Gain Hate (",$who,").";
}
if ($how == 11)
{
echo "was killed by spirits.";
}
if ($how > 11 && $how < 14)
{
echo "was killed in an accident.";
}
if ($how > 13 && $how < 18)
{
echo "died of an illness.";
}
if ($how == 18)
{
echo "was killed by monster.";
}
if ($how == 19)
{
echo "died of unknown cause, just disappeared.";
}
if ($how == 20)
{
echo "was killed in a magical ceremony.";
}
}
function boon()
{
$rboon = mt_rand (1,20);
if ($rboon < 3)
{
$friend = elderfriend();
echo "<p>You befriended a $friend. Gain +10% Lore ($friend), and the creature you befriended remains friendly towards you.</p>";
}
if ($rboon > 2 && $rboon < 5)
{
echo "<p>You fell in love. Gain a Love (specific person) Passion.</p>";
}
if ($rboon > 4 && $rboon < 7)
{
echo "<p>You gained a follower. Perhaps it is a free person who carries your shield and other weapons into battle. Perhaps it is a servant or slave who carries your stuff, makes your meals, or performs other manual labor.</p>";
}
if ($rboon > 6 && $rboon < 9)
{
echo "<p>You made a professional accomplishment. Gain +10% to any non-combat professional skill (choose this when you determine your adventurer's occupational skills) and add one year's income to your starting wealth.</p>";
}
if ($rboon > 8 && $rboon < 11)
{
$magic = heirloom(mt_rand (1,20));
echo "<p>You were gifted with $magic Decide why you received it. If it was given to you by a person, gain a Loyalty (that person).</p>";
}
if ($rboon > 10 && $rboon < 13)
{
echo "<p>You gained the favor of your temple. Gain Loyalty (temple).</p>";
}
if ($rboon > 12 && $rboon < 15)
{
echo "<p>Your clan came strongly to your aid in a dispute with outsiders. Gain Loyalty (clan).</p>";
}
if ($rboon > 14 && $rboon < 17)
{
echo "<p>Your clan assigned you a hide of land for your services. Gain Loyalty (clan). Depending on your occupation, you may need to have tenants farm the land.</p>";
}
if ($rboon > 16 && $rboon < 19)
{
echo "<p>You gained the blessings of your ancestors. Gain either +10% to Love (family) or +10% to the Spirit Combat skill.</p>";
}
if ($rboon == 19)
{
echo "<p>You gained the blessing of your god. When you determine your cult, you start with 1 extra Rune point towards that god. Gain Devotion (deity).</p>";
}
if ($rboon == 20)
{
$pow = mt_rand (1,6) + mt_rand (1,6) + mt_rand (1,6);
$cha = mt_rand (1,6) + mt_rand (1,6);
echo "<p>You gained a spirit bound into an animal or item. It has a POW of $pow and a CHA of $cha.</p>";
}
}
echo "<h2>Your grandparent's history</h2>";
echo "<p>Your grandparent was a(n) $grandocc from $homeland.</p>";
echo "<h3>Year 1561</h3>";
echo "<p>Your grandparents were born this year.</p>";
echo "<h3>Year 1582</h3>";
echo "<p>King Tarkalor and his wife the Feathered Horse Queen went to war with the Lunar Empire to aid the Old Tarshites, aided by Praxian and Esrolian mercenaries and volunteers. The Red Emperor personally led the Lunar Army and when the armies met at the Battle of Grizzly Peak, the Lunar Army swept the field with their vastly superior magicians. Both King Tarkalor and his Queen were killed.</p>";
echo "<p>Of special note, your parents were born by this year.</p>";
$y1582 = mt_rand (1,20);
if ($homeland == "esrolia" || $homeland == "prax") {
$y1582 = $y1582 - 5;
} elseif ($homeland == "grazelands" || $homeland == "old Tarsh" || $homeland == "sartar") {
$y1582 = $y1582 + 5;
}
$grizzlypeak = 0;
if ($y1582 < 11)
{
echo "<p>Your grandparent was not present at the Battle of Grizzly Peak. </p>";
} else
{
echo "<p>Your grandparent was present at the Battle of Grizzly Peak. ";
$grizzlypeak = mt_rand (1,20);
if ($grandocc == "noble" || $grandocc == "priest")
{
$grizzlypeak = $grizzlypeak + 5;
}
if ($grizzlypeak < 11)
{
echo "They survived. ";
if ($homeland == "Sartar" || $homeland == "Lunar Tarsh")
{
$aldachur = mt_rand (1,20);
if ($aldachur < 19)
{
if ($homeland == "Sartar")
{
echo "Your grandparent then participated in the battle of Alda-Chur and witnessed the Alda-Churi acclaim Tarkalors son Terasarin as Prince of Alda-Chur. Gain Loyalty (Sartar).</p>";
} else
{
echo "Your grandparent then participated in the battle of Alda-Chur and retreated home.</p>";
}
} elseif ($aldachur == 19)
{
echo "Your grandparent then died in the Battle of Alda-Chur.</p>";
$gpdead = 1;
} else
{
$rep = mt_rand (1,3);
echo "Your grandparent then died with great glory in the Battle of Alda-Chur. Gain Honor Passion and +$rep% Reputation.</p>";
$gpdead = 1;
}
} else
{
echo "Your grandparent then went home.</p>";
}
} elseif ($grizzlypeak < 16)
{
if ($homeland == "Lunar Tarsh")
{
echo "Your grandparent died in battle. Gain Loyalty (Red Emperor <i>or</i> King of Tarsh).</p>";
$gpdead = 1;
} else
{
echo "Your grandparent was killed by Lunar spirits. Gain Hate (Lunar Empire).</p>";
$gpdead = 1;
}
} else
{
if ($homeland == "Lunar Tarsh")
{
$rep = mt_rand (1,3);
echo "Your grandparent died fighting the royla bodyguard. Gain Honor Passion and +$rep Reputation.";
$gpdead = 1;
} else
{
$rep = mt_rand (1,3);
echo "Your grandparent died with great glory defending the king and queen. Gain Honor Passion and Loyalty (Sartar) <i>or</i> Feathered Horse Queen). You have a famous ancestor and get +5% bonus to your Orate skill and +$rep% Reputation.</p>";
$gpdead = 1;
}
}
}
if ($early == "Yes")
{
if (($homeland == "Esrolia" || $homeland == "Lunar Tarsh" || $homeland == "Sartar") && $gpdead != 1)
{
echo "<h3>Year 1591</h3>";
echo "<p>The Kingdom of Sartar is invaded by the Lunar Empire with its Tarshite and Tusk Rider allies. Belintar the God-King secretly supports the Kingdom against the Lunar invasion, and the invasion is defeated by Prince Terasarin.</p>";
$y1591 = mt_rand (1,20);
if ($homeland == "Esrolia" || $homeland == "Lunar Tarsh" || $homeland == "Sartar")
{
$y1591 = $y1591 + 5;
}
if ($y1591 < 6)
{
echo "<p>Your grandparent was killed in battle in other lands. Gain Hate (Other Homeland).</p>";
$gpdead = 1;
}
if ($y1591 > 5 && $y1591 < 11)
{
$sarinv = mt_rand (1,20);
if ($sarinv < 5)
{
$loot = 100 * (mt_rand (1,6));
echo "During the invasion your grandparent plundered Far Place. Gain $loot L.</p>";
}
if ($sarinv > 4 && $sarinv < 14)
{
echo "Your grandparent survived the invasion of Sartar.</p>";
}
if ($sarinv > 13 && $sarinv < 19)
{
echo "Your grandparent was killed in battle during the invasion of Sartar. Gain Honor Passion.</p>";
$gpdead = 1;
}
if ($sarinv > 18)
{
$rep = mt_rand (1,3);
echo "Your grandparent died with great glory in battle during the invasion of Sartar. Gain Honor Passion, Devotion (deity), and +$rep% Reputation. ";
if ($homeland == "Sartar")
{
echo "Gain Hate (Lunar Empire).";
}
echo "</p>";
$gpdead = 1;
}
}
}
}
if (($homeland == "Esrolia" || $homeland == "Grazelands" || $homeland == "Lunar Tarsh" || $homeland == "Sartar") && $gpdead != 1)
{
echo "<h3>Year 1597</h3>";
echo "<p>Lunar assassins killed members of the Sartar royal house in the Holy Country, and many got entangled in the cycles of murder and vengeance.</p>";
$y1597 = mt_rand (1,20);
if ($homeland == "Grazelands" || $homeland == "Old Tarsh" || $homeland == "Prax")
{
$y1597 = $y1597-5;
}
if ($grandocc == "noble" || $grandocc == "priest")
{
$y1597 = $y1597+5;
}
if ($y1597 < 10)
{
echo "<p>A normal year.</p>";
}
if ($y1597 == 10)
{
echo "<p>Your grandparent ";
$cause = death();
echo "</p>";
$gpdead = 1;
}
if ($y1597 > 10 && $y1597 < 18)
{
echo "<p>Your grandparent fought in the Holy Country and survived.</p>";
}
if ($y1597 > 17 && $y1597 < 20)
{
echo "<p>Your grandparent fought in the Holy Country, witnessed murder of a member of the Sartar royal house. Gain Hate (Lunar Empire).</p>";
}
if ($y1597 > 19)
{
if ($homeland == "Lunar Tarsh")
{
echo "<p>Your grandparent died with great glory trying to kill a member of the Sartar royal house. Gain Loyalty (Red Emperor) and +5% Orate skill because of your famous ancestor.</p>";
$gpdead = 1;
} else
{
$rep = mt_rand (1,3);
echo "<p>Your grandparent died defending a member of the Sartar royal house. Gain Loyalty (Sartar) and +$rep% Reputation. Gain a +5% bonus to your Orate skill because of your famous ancestor.</p>";
$gpdead = 1;
}
}
}
if ($early == "Yes")
{
if (($homeland == "Sartar") && $gpdead != 1)
{
$y1600 = mt_rand (1,20);
if ($grandocc == "noble" || $grandocc == "priest")
{
$y1600 = $y1600 + 5;
}
if ($y1600 < 2)
{
echo "<p>Your grandparent ";
$cause = death();
echo ".</p>";
$gpdead = 1;
}
if ($y1600 > 1 && $y1600 < 20)
{
echo "<p>A normal year. Gain +10% in one of a $grandocc's occupational skills.</p>";
}
if ($y1600 > 19)
{
echo "<p>Your grandparent witnessed King Terasarin killed by dinosaur. Gain Fear (dinosaurs).</p>";
}
}
}
if ($gpdead != 1)
{
echo "<h3>Year 1602</h3><p>The Lunar army invaded the kingdom of Sartar with great success, although at high cost, seizing the supposedly impregnable capital city by force and extinguishing the Flame of Sartar that united the legendary kingdom.</p>";
$y1602 = mt_rand (1,20);
if ($homeland == "Lunar Tarsh")
{
$y1602 = $y1602 + 5;
}
if ($homeland == "Sartar")
{
$y1602 = $y1602 + 10;
}
if ($y1602 < 11)
{
echo "<p>A normal year.</p>";
} else
{
$boldhome = mt_rand (1,20);
if ($homeland == "Sartar")
{
$boldhome = $boldhome + 5;
if ($grandocc == "noble" || $grandocc == "priest" || $grandocc == "warrior")
{
$boldhome = $boldhome + 5;
}
}
if ($boldhome < 5)
{
$loot = 100 * (mt_rand (1,6));
echo "Your grandparent plundered Boldhome. Gain $loot L.</p>";
}
if ($boldhome > 4 && $boldhome < 14)
{
echo "Your grandparent participated in the Boldhome Campaign and survived.</p>";
}
if ($boldhome > 13 && $boldhome < 18)
{
echo "Your grandparent was killed in battle in the Boldhome Campaign. Gain Honor Passion.</p>";
$gpdead = 1;
}
if ($boldhome > 17 && $boldhome < 20)
{
echo "Your grandparent participated in the Boldhome Campaign and was devoured by the Crimson Bat. Your grandparent's soul no longer exists. Gain Hate (Chaos) at 70% or Hate (Lunar Empire) at 70% or add +20% to one of those Passions.</p>";
$gpdead = 1;
}
if ($boldhome > 19)
{
$rep = mt_rand (1,3);
echo "Your grandparent died with great glory in the Battle of Boldhome. Gain Honor Passion and Devotion (deity), and +$rep% Reputation. ";
if ($homeland == "Sartar")
{
echo "Gain Hate (Lunar Empire).";
}
echo "</p>";
$gpdead = 1;
}
}
}
if (($homeland == "Esrolia" || $homeland == "Lunar Tarsh" || $homeland == "Sartar") && $gpdead != 1)
{
echo "<h3>Interim Years (1603-1604)</h3>";
echo "<p>After the Boldhome Campaign, the Lunar Empire dominated Dragon Pass. Old rivalries reignited, and the Lunar authorities encouraged the tribes to kill each other off.</p>";
$y1603 = mt_rand (1,20);
if ($homeland == "Esrolia" || $homeland == "Lunar Tarsh")
{
$y1603 = $y1603 - 5;
}
if ($homeland == "Sartar")
{
$y1603 = $y1603 + 5;
}
if ($y1603 < 9)
{
echo "<p>A normal year.</p>";
}
if ($y1603 > 8 && $y1603 < 11)
{
echo "<p>Your grandparent ";
$cause = death();
echo ".</p>";
$gpdead = 1;
}
if ($y1603 > 10 && $y1603 < 16)
{
echo "<p>Your grandparent survived despite widespread conflict and feuds.</p>";
}
if ($y1603 == 16)
{
echo "<p>Resettled in New Pavis to escape Dragon Pass.</p>";
$homeland = "Prax";
}
if ($y1603 > 16 && $y1603 < 19)
{
echo "<p>Your grandparent was killed by Telmori. Gain Hate (Telmori).</p>";
$gpdead = 1;
}
if ($y1603 > 18)
{
echo "<p>Your grandparent was killed by rival tribe. Gain Hate (other tribe).</p>";
$gpdead = 1;
}
}
echo "<p>1604 is the year of your adventurer's birth, unless you have chosen to be older or younger. Your adventurer will be 21 in 1625, the year this game is set.</p>";
if (($homeland == "Esrolia" || $homeland == "Grazelands" || $homeland == "Lunar Tarsh" || $homeland == "Sartar") && $gpdead != 1)
{
echo "<h3>Year 1605</h3>";
echo "<p>A major thrust by the Lunar army to invade the Holy Country, striking at heavily populated Esrolia. Countering with magical strength, the god-king Belintar stopped the Lunars by inflicting a decisive and humiliating defeat.</p>";
$y1605 = mt_rand (1,20);
if ($homeland == "Old Tarsh")
{
$y1605 = $y1605 - 10;
}
if ($homeland == "Prax" || $homeland == "Sartar")
{
$y1605 = $y1605 - 5;
}
if ($homeland == "Esrolia")
{
$y1605 = $y1605 + 10;
}
if ($y1605 < 6)
{
echo "<p>A normal year.</p>";
}
if ($y1605 > 5 && $y1605 < 11)
{
$y1603 = mt_rand (1,20);
if ($homeland == "Esrolia" || $homeland == "Lunar Tarsh")
{
$y1603 = $y1603 - 5;
}
if ($homeland == "Sartar")
{
$y1603 = $y1603 + 5;
}
if ($y1603 < 9)
{
echo "<p>A normal year.</p>";
}
if ($y1603 > 8 && $y1603 < 11)
{
echo "<p>Your grandparent ";
$cause = death();
echo ".</p>";
$gpdead = 1;
}
if ($y1603 > 10 && $y1603 < 16)
{
echo "<p>Your grandparent survived despite widespread conflict and feuds.</p>";
}
if ($y1603 == 16)
{
echo "<p>Resettled in New Pavis to escape Dragon Pass.</p>";
$homeland = "Prax";
}
if ($y1603 > 16 && $y1603 < 19)
{
echo "<p>Your grandparent was killed by Telmori. Gain Hate (Telmori).</p>";
$gpdead = 1;
}
if ($y1603 > 18)
{
echo "<p>Your grandparent was killed by rival tribe. Gain Hate (other tribe).</p>";
$gpdead = 1;
}
}
if ($y1605 > 10 && $y1605 < 16)
{
echo "<p>Your grandparent fought in the Feint to the Sea Campaign ";
$feint = mt_rand (1,20);
if ($feint < 18)
{
echo "and survived.</p>";
}
if ($feint > 17 && $feint < 20)
{
echo "and was killed at the siege of Karse.";
if ($homeland == "Lunar Tarsh")
{
echo " Gain Loyalty (Fazzur Wideread).";
}
echo "</p>";
$gpdead = 1;
}
if ($feint > 19)
{
echo "and died with great glory. Gain Honor Passion and +1D3% Reputation.";
if ($homeland == "Lunar Tarsh")
{
echo " Gain Loyalty (Fazzur Wideread).";
}
echo "</p>";
$gpdead = 1;
}
}
if ($y1605 > 15)
{
$building = mt_rand (1,20);
echo "<p>";
if ($homeland == "Lunar Tarsh")
{
$ybuilding = $building - 5;
}
if ($homeland == "Esrolia")
{
$ybuilding = $building + 5;
}
if ($building < 6)
{
echo "Your grandparent was killed at the Building Wall Batlle by Belintar's magic. Gain Hate (Esrolia).</p>";
$gpdead = 1;
}
if ($building > 5 && $building < 10)
{
echo "Your grandparent was killed in the Building Wall Battle.</p>";
$gpdead = 1;
}
if ($building > 9 && $building < 19)
{
echo "Your grandparent fought in the Building Wall Battle and survived.</p>";
}
if ($building > 18 && $building < 20)