-
Notifications
You must be signed in to change notification settings - Fork 0
/
guild2.c
803 lines (791 loc) · 23.9 KB
/
guild2.c
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
/* omega copyright (C) by Laurence Raphael Brothers, 1987,1988,1989 */
/* guild2.c */
/* L_ functions */
/* These functions implement the various guilds. */
/* They are all l_ functions since they are basically activated*/
/* at some site or other. */
#include "glob.h"
void l_thieves_guild()
{
int fee,count,i,number,done=FALSE,dues=1000;
char c,action;
pob lockpick;
print1("You have penetrated to the Lair of the Thieves' Guild.");
if (! nighttime())
print2("There aren't any thieves around in the daytime.");
else {
if ((Player.rank[THIEVES]==TMASTER) &&
(Player.level > Shadowlordlevel) &&
find_and_remove_item(THINGID+16,-1)) {
print2("You nicked the Justiciar's Badge!");
morewait();
print1("The Badge is put in a place of honor in the Guild Hall.");
print2("You are now the Shadowlord of the Thieves' Guild!");
morewait();
print1("Who says there's no honor among thieves?");
strcpy(Shadowlord,Player.name);
Shadowlordlevel = Player.level;
morewait();
Shadowlordbehavior = fixnpc(4);
save_hiscore_npc(7);
clearmsg();
print1("You learn the Spell of Shadowform.");
Spells[S_SHADOWFORM].known = TRUE;
morewait();
clearmsg();
Player.rank[THIEVES]=SHADOWLORD;
Player.maxagi += 2;
Player.maxdex += 2;
Player.agi += 2;
Player.dex += 2;
}
while (! done) {
menuclear();
if (Player.rank[THIEVES] == 0)
menuprint("a: Join the Thieves' Guild.\n");
else
menuprint("b: Raise your Guild rank.\n");
menuprint("c: Get an item identified.\n");
if (Player.rank[THIEVES] > 0)
menuprint("d: Fence an item.\n");
menuprint("ESCAPE: Leave this Den of Iniquity.");
showmenu();
action = mgetc();
if (action == ESCAPE) done = TRUE;
else if (action == 'a') {
done = TRUE;
if (Player.rank[THIEVES]> 0)
print2("You are already a member!");
else if (Player.alignment > 10)
print2("You are too lawful to be a thief!");
else {
dues += dues*(12-Player.dex)/9;
dues += Player.alignment*5;
dues = max(100,dues);
clearmsg();
mprint("Dues are");
mnumprint(dues);
mprint(" Au. Pay it? [yn] ");
if (ynq1() =='y') {
if (Player.cash < dues) {
print1("You can't cheat the Thieves' Guild!");
print2("... but the Thieves' Guild can cheat you....");
Player.cash = 0;
}
else {
print1("Shadowlord ");
nprint1(Shadowlord);
print2("enters your name into the roll of the Guild.");
morewait();
clearmsg();
print1("As a special bonus, you get a free lockpick.");
print2("You are taught the spell of Object Detection.");
morewait();
Spells[S_OBJ_DET].known = TRUE;
lockpick = ((pob) checkmalloc(sizeof(objtype)));
*lockpick = Objects[THINGID+2]; /* lock pick */
gain_item(lockpick);
Player.cash -= dues;
dataprint();
Player.guildxp[THIEVES]=1;
Player.rank[THIEVES]=TMEMBER;
Player.maxdex++;Player.dex++;Player.agi++;Player.maxagi++;
}
}
}
}
else if (action == 'b') {
if (Player.rank[THIEVES]==0)
print2("You are not even a member!");
else if (Player.rank[THIEVES]==SHADOWLORD)
print2("You can't get any higher than this!");
else if (Player.rank[THIEVES]==TMASTER) {
if (Player.level <= Shadowlordlevel)
print2("You are not experienced enough to advance.");
else print2("You must bring back the Justiciar's Badge!");
}
else if (Player.rank[THIEVES]==THIEF) {
if (Player.guildxp[THIEVES] < 4000)
print2("You are not experienced enough to advance.");
else {
print1("You are now a Master Thief of the Guild!");
print2("You are taught the Spell of Apportation.");
morewait();
print1("To advance to the next level you must return with");
print2("the badge of the Justiciar (cursed be his name).");
morewait();
clearmsg();
print1("The Justiciar's office is just south of the gaol.");
Spells[S_APPORT].known = TRUE;
Player.rank[THIEVES]=TMASTER;
Player.maxagi++;
Player.maxdex++;
Player.agi++;
Player.dex++;
}
}
else if (Player.rank[THIEVES]==ATHIEF) {
if (Player.guildxp[THIEVES] < 1500)
print2("You are not experienced enough to advance.");
else {
print1("You are now a ranking Thief of the Guild!");
print2("You learn the Spell of Invisibility.");
Spells[S_INVISIBLE].known = TRUE;
Player.rank[THIEVES]=THIEF;
Player.agi++;
Player.maxagi++;
}
}
else if (Player.rank[THIEVES]==TMEMBER) {
if (Player.guildxp[THIEVES] < 400)
print2("You are not experienced enough to advance.");
else {
print1("You are now an Apprentice Thief!");
print2("You are taught the Spell of Levitation.");
Spells[S_LEVITATE].known = TRUE;
Player.rank[THIEVES]=ATHIEF;
Player.dex++;
Player.maxdex++;
}
}
}
else if (action == 'c') {
if (Player.rank[THIEVES]==0) {
print1("RTG, Inc, Appraisers. Identification Fee: 50Au/item.");
fee = 50;
}
else {
fee = 5;
print1("The fee is 5Au per item.");
}
print2("Identify one item, or all possessions? [ip] ");
if ((char) mcigetc()=='i') {
if (Player.cash < fee)
print2("Try again when you have the cash.");
else {
Player.cash -= fee;
dataprint();
identify(0);
}
}
else {
count = 0;
for(i=1;i<MAXITEMS;i++)
if (Player.possessions[i] != NULL)
if (Player.possessions[i]->known < 2)
count++;
for(i=0;i<Player.packptr;i++)
if (Player.pack[i] != NULL)
if (Player.pack[i]->known < 2)
count++;
clearmsg();
print1("The fee will be: ");
mnumprint(max(count*fee,fee));
nprint1("Au. Pay it? [yn] ");
if (ynq1()=='y')
if (Player.cash < max(count*fee,fee))
print2("Try again when you have the cash.");
else {
Player.cash -= max(count*fee,fee);
dataprint();
identify(1);
}
}
}
else if (action == 'd') {
if (Player.rank[THIEVES]==0)
print2("Fence? Who said anything about a fence?");
else {
print1("Fence one item or go through pack? [ip] ");
if ((char) mcigetc()=='i') {
i = getitem(NULL_ITEM);
if ((i==ABORT) || (Player.possessions[i] == NULL))
print2("Huh, Is this some kind of set-up?");
else if (Player.possessions[i]->blessing < 0)
print2("I don't want to buy a cursed item!");
else {
clearmsg();
print1("I'll give you ");
mlongprint(2 * item_value(Player.possessions[i]) / 3);
nprint1("Au each. OK? [yn] ");
if (ynq1() == 'y') {
number = getnumber(Player.possessions[i]->number);
if ((number >= Player.possessions[i]->number) &&
Player.possessions[i]->used) {
Player.possessions[i]->used = FALSE;
item_use(Player.possessions[i]);
}
Player.cash += number*2*item_value(Player.possessions[i])/3;
/* Fenced artifacts could turn up anywhere, really... */
if (Objects[Player.possessions[i]->id].uniqueness >
UNIQUE_UNMADE)
Objects[Player.possessions[i]->id].uniqueness = UNIQUE_UNMADE;
dispose_lost_objects(number,Player.possessions[i]);
dataprint();
}
else print2("Hey, gimme a break, it was a fair price!");
}
}
else {
for(i=0;i<Player.packptr;i++) {
if (Player.pack[i]->blessing > -1) {
clearmsg();
print1("Sell ");
nprint1(itemid(Player.pack[i]));
nprint1(" for ");
mlongprint(2*item_value(Player.pack[i])/3);
nprint1("Au each? [ynq] ");
if ((c=ynq1())=='y') {
number = getnumber(Player.pack[i]->number);
Player.cash += 2*number * item_value(Player.pack[i]) / 3;
Player.pack[i]->number -= number;
if (Player.pack[i]->number < 1) {
/* Fenced an artifact? You just might see it again. */
if (Objects[Player.pack[i]->id].uniqueness > UNIQUE_UNMADE)
Objects[Player.pack[i]->id].uniqueness = UNIQUE_UNMADE;
free((char *)Player.pack[i]);
Player.pack[i] = NULL;
}
dataprint();
}
else if (c=='q') break;
}
}
fixpack();
}
}
}
}
}
xredraw();
}
void l_college()
{
char action;
int done=FALSE,enrolled = FALSE;
print1("The Collegium Magii. Founded 16937, AOF.");
if (nighttime())
print2("The Registration desk is closed at night....");
else {
while (! done) {
if ((Player.rank[COLLEGE]==MAGE) &&
(Player.level > Archmagelevel) &&
find_and_remove_item(CORPSEID,EATER)) {
print1("You brought back the heart of the Eater of Magic!");
morewait();
print1("The Heart is sent to the labs for analysis.");
print2("The Board of Trustees appoints you Archmage!");
morewait();
clearmsg();
strcpy(Archmage,Player.name);
Archmagelevel = Player.level;
Player.rank[COLLEGE] = ARCHMAGE;
Player.maxiq += 5;
Player.iq += 5;
Player.maxpow += 5;
Player.pow += 5;
morewait();
Archmagebehavior = fixnpc(4);
save_hiscore_npc(9);
}
menuclear();
menuprint("May we help you?\n\n");
menuprint("a: Enroll in the College.\n");
menuprint("b: Raise your College rank.\n");
menuprint("c: Do spell research.\n");
menuprint("ESCAPE: Leave these hallowed halls.\n");
showmenu();
action = mgetc();
if (action == ESCAPE) done = TRUE;
else if (action == 'a') {
if (Player.rank[COLLEGE] > 0)
print2("You are already enrolled!");
else if (Player.iq < 13)
print2("Your low IQ renders you incapable of being educated.");
else if (Player.rank[CIRCLE] > 0)
print2("Sorcery and our Magic are rather incompatable, no?");
else {
if (Player.iq > 17) {
print2("You are given a scholarship!");
morewait();
enrolled=TRUE;
}
else {
print1("Tuition is 1000Au. ");
nprint1("Pay it? [yn] ");
if (ynq1() =='y') {
if (Player.cash < 1000)
print2("You don't have the funds!");
else {
Player.cash -= 1000;
enrolled = TRUE;
dataprint();
}
}
}
if (enrolled) {
print1("Archmage ");
nprint1(Archmage);
nprint1(" greets you and congratulates you on your acceptance.");
print2("You are now enrolled in the Collegium Magii!");
morewait();
print1("You are now a Novice.");
print2("You may research 1 spell, for your intro class.");
Spellsleft = 1;
Player.rank[COLLEGE] = INITIATE;
Player.guildxp[COLLEGE] = 1;
Player.maxiq += 1;
Player.iq += 1;
Player.maxpow += 1;
Player.pow += 1;
}
}
}
else if (action == 'b') {
if (Player.rank[COLLEGE] == 0)
print2("You have not even been initiated, yet!");
else if (Player.rank[COLLEGE]==ARCHMAGE)
print2("You are at the pinnacle of mastery in the Collegium.");
else if (Player.rank[COLLEGE]==MAGE) {
if (Player.level <= Archmagelevel)
print2("You are not experienced enough to advance.");
else
print2("You must return with the heart of the Eater of Magic!");
}
else if (Player.rank[COLLEGE]==PRECEPTOR) {
if (Player.guildxp[COLLEGE] < 4000)
print2("You are not experienced enough to advance.");
else {
print1("You are now a Mage of the Collegium Magii!");
print2("You may research 6 spells for postdoctoral research.");
Spellsleft += 6;
morewait();
print1("To become Archmage, you must return with the");
print2("heart of the Eater of Magic");
morewait();
clearmsg();
print1("The Eater may be found on a desert isle somewhere.");
Player.rank[COLLEGE] = MAGE;
Player.maxiq += 2;
Player.iq += 2;
Player.maxpow += 2;
Player.pow += 2;
}
}
else if (Player.rank[COLLEGE]==STUDENT) {
if (Player.guildxp[COLLEGE] < 1500)
print2("You are not experienced enough to advance.");
else {
print1("You are now a Preceptor of the Collegium Magii!");
print2("You are taught the basics of ritual magic.");
morewait();
clearmsg();
print1("Your position allows you to research 4 spells.");
Spellsleft +=4;
Spells[S_RITUAL].known = TRUE;
Player.rank[COLLEGE] = PRECEPTOR;
Player.maxiq += 1;
Player.iq += 1;
Player.maxpow += 1;
Player.pow += 1;
}
}
else if (Player.rank[COLLEGE]==NOVICE) {
if (Player.guildxp[COLLEGE] < 400)
print2("You are not experienced enough to advance.");
else {
print1("You are now a Student at the Collegium Magii!");
print2("You are taught the spell of identification.");
morewait();
clearmsg();
print1("Thesis research credit is 2 spells.");
Spellsleft+=2;
Spells[S_IDENTIFY].known = TRUE;
Player.rank[COLLEGE] = STUDENT;
Player.maxiq += 1;
Player.iq += 1;
Player.maxpow += 1;
Player.pow += 1;
}
}
}
else if (action == 'c') {
clearmsg();
if (Spellsleft > 0) {
print1("Research permitted: ");
mnumprint(Spellsleft);
nprint1(" Spells.");
morewait();
}
if (Spellsleft < 1) {
print1("Extracurricular Lab fee: 2000 Au. ");
nprint1("Pay it? [yn] ");
if (ynq1()=='y') {
if (Player.cash < 2000)
print1("Try again when you have the cash.");
else {
Player.cash -= 2000;
dataprint();
Spellsleft = 1;
}
}
}
if (Spellsleft > 0) {
learnspell(0);
Spellsleft--;
}
}
}
}
xredraw();
}
void l_sorcerors()
{
char action;
int done=FALSE,fee=3000;
long total;
print1("The Circle of Sorcerors.");
if (Player.rank[CIRCLE] == -1) {
print2("Fool! Didn't we tell you to go away?");
Player.mana = 0;
dataprint();
}
else while (! done) {
if ((Player.rank[CIRCLE]==HIGHSORCEROR) &&
(Player.level > Primelevel) &&
find_and_remove_item(CORPSEID,LAWBRINGER)) {
print2("You obtained the Crown of the Lawgiver!");
morewait();
print1("The Crown is ritually sacrificed to the Lords of Chaos.");
print2("You are now the Prime Sorceror of the Inner Circle!");
strcpy(Prime,Player.name);
Primelevel = Player.level;
morewait();
Primebehavior = fixnpc(4);
save_hiscore_npc(10);
clearmsg();
print1("You learn the Spell of Disintegration!");
morewait();
clearmsg();
Spells[S_DISINTEGRATE].known = TRUE;
Player.rank[CIRCLE] = PRIME;
Player.maxpow += 10;
Player.pow += 10;
}
menuclear();
menuprint("May we help you?\n\n");
menuprint("a: Become an Initiate of the Circle.\n");
menuprint("b: Raise your rank in the Circle.\n");
menuprint("c: Restore mana points\n");
menuprint("ESCAPE: Leave these Chambers of Power.\n");
showmenu();
action = mgetc();
if (action == ESCAPE) done = TRUE;
else if (action == 'a') {
if (Player.rank[CIRCLE] > 0)
print2("You are already an initiate!");
else if (Player.alignment > 0)
print2("You may not join -- you reek of Law!");
else if (Player.rank[COLLEGE] != 0)
print2("Foolish Mage! You don't have the right attitude to Power!");
else {
fee += Player.alignment*100;
fee += fee*(12 - Player.pow)/9;
fee = max(100,fee);
clearmsg();
mprint("For you, there is an initiation fee of");
mnumprint(fee);
mprint(" Au.");
print2("Pay it? [yn] ");
if (ynq2() =='y') {
if (Player.cash < fee)
print3("Try again when you have the cash!");
else {
print1("Prime Sorceror ");
nprint1(Prime);
print2("conducts your initiation into the circle of novices.");
morewait();
clearmsg();
print1("You learn the Spell of Magic Missiles.");
Spells[S_MISSILE].known = TRUE;
Player.cash -= fee;
dataprint();
Player.rank[CIRCLE] = INITIATE;
Player.guildxp[CIRCLE] = 1;
Player.maxpow++;
Player.pow++;
}
}
}
}
else if (action == 'b') {
if (Player.rank[CIRCLE] == 0)
print2("You have not even been initiated, yet!");
else if (Player.alignment > -1) {
print1("Ahh! You have grown too lawful!!!");
print2("You are hereby blackballed from the Circle!");
Player.rank[CIRCLE] = -1;
morewait();
clearmsg();
print1("A pox upon thee!");
if (! Player.immunity[INFECTION])
Player.status[DISEASED]+=100;
print2("And a curse on your possessions!");
morewait();
clearmsg();
acquire(-1);
clearmsg();
enchant(-1);
bless(-1);
print3("Die, false sorceror!");
p_damage(25,UNSTOPPABLE,"a sorceror's curse");
done = TRUE;
}
else if (Player.rank[CIRCLE]==PRIME)
print2("You are at the pinnacle of mastery in the Circle.");
else if (Player.rank[CIRCLE]==HIGHSORCEROR) {
if (Player.level <= Primelevel)
print2("You are not experienced enough to advance.");
else
print2("You must return with the Crown of the LawBringer!");
}
else if (Player.rank[CIRCLE]==SORCEROR) {
if (Player.guildxp[CIRCLE] < 4000)
print2("You are not experienced enough to advance.");
else {
print1("You are now a High Sorceror of the Inner Circle!");
print2("You learn the Spell of Disruption!");
morewait();
clearmsg();
print1("To advance you must return with the LawBringer's Crown!");
print2("The LawBringer resides on Star Peak.");
Spells[S_DISRUPT].known = TRUE;
Player.rank[CIRCLE] = HIGHSORCEROR;
Player.maxpow += 5;
Player.pow += 5;
}
}
else if (Player.rank[CIRCLE]==ENCHANTER) {
if (Player.guildxp[CIRCLE] < 1500)
print2("You are not experienced enough to advance.");
else {
print1("You are now a member of the Circle of Sorcerors!");
print2("You learn the Spell of Ball Lightning!");
Spells[S_LBALL].known = TRUE;
Player.rank[CIRCLE] = SORCEROR;
Player.maxpow += 2;
Player.pow+=2;
}
}
else if (Player.rank[CIRCLE]==INITIATE) {
if (Player.guildxp[CIRCLE] < 400)
print2("You are not experienced enough to advance.");
else {
print1("You are now a member of the Circle of Enchanters!");
print2("You learn the Spell of Firebolts.");
Spells[S_FIREBOLT].known = TRUE;
Player.rank[CIRCLE] = ENCHANTER;
Player.maxpow+=2;
Player.pow+=2;
}
}
}
else if (action == 'c') {
done = TRUE;
fee = Player.level*100;
if (Player.rank[CIRCLE]) fee = fee / 2;
clearmsg();
print1("That will be: ");
mnumprint(fee);
nprint1("Au. Pay it? [yn] ");
if (ynq1()=='y') {
if (Player.cash < fee)
print2("Begone, deadbeat, or face the wrath of the Circle!");
else {
Player.cash -= fee;
total = calcmana();
while (Player.mana < total) {
Player.mana++;
dataprint();
}
print2("Have a sorcerous day, now!");
}
}
else print2("Be seeing you!");
}
}
xredraw();
}
void l_order()
{
pob newitem;
pml ml;
print1("The Headquarters of the Order of Paladins.");
morewait();
if ((Player.rank[ORDER]==PALADIN) &&
(Player.level > Justiciarlevel) &&
gamestatusp(GAVE_STARGEM) &&
Player.alignment > 300) {
print1("You have succeeded in your quest!");
morewait();
print1("The previous Justiciar steps down in your favor.");
print2("You are now the Justiciar of Rampart and the Order!");
strcpy(Justiciar,Player.name);
for (ml = Level->mlist; ml && (ml->m->id != HISCORE_NPC ||
ml->m->aux2 != 15); ml = ml->next)
/* just scan for current Justicar */;
if (ml) {
Level->site[ml->m->x][ml->m->y].creature = NULL;
erase_monster(ml->m);
ml->m->hp = -1; /* signals "death" -- no credit to player, though */
}
Justiciarlevel = Player.level;
morewait();
Justiciarbehavior = fixnpc(4);
save_hiscore_npc(15);
clearmsg();
print1("You are awarded a blessed shield of deflection!");
morewait();
newitem = ((pob) checkmalloc(sizeof(objtype)));
*newitem = Objects[SHIELDID+7]; /* shield of deflection */
newitem->blessing = 9;
gain_item(newitem);
morewait();
Player.rank[ORDER] = JUSTICIAR;
Player.maxstr += 5;
Player.str += 5;
Player.maxpow += 5;
Player.pow += 5;
}
if (Player.alignment < 1) {
if (Player.rank[ORDER] > 0) {
print1("You have been tainted by chaos!");
print2("You are stripped of your rank in the Order!");
morewait();
Player.rank[ORDER]= -1;
send_to_jail();
}
else
print1("Get thee hence, minion of chaos!");
}
else if (Player.rank[ORDER] == -1)
print1("Thee again? Get thee hence, minion of chaos!");
else if (Player.rank[ORDER] == 0) {
if (Player.rank[ARENA] != 0)
print1("We do not accept bloodstained gladiators into our Order.");
else if (Player.rank[LEGION] != 0)
print1("Go back to your barracks, mercenary!");
else {
print1("Dost thou wish to join our Order? [yn] ");
if (ynq1()=='y') {
print1("Justiciar ");
nprint1(Justiciar);
nprint1(" welcomes you to the Order.");
print2("'Mayest thou always follow the sublime path of Law.'");
morewait();
print1("You are now a Gallant in the Order.");
print2("You are given a horse and a blessed spear.");
morewait();
Player.rank[ORDER] = GALLANT;
Player.guildxp[ORDER] = 1;
setgamestatus(MOUNTED);
newitem = ((pob) checkmalloc(sizeof(objtype)));
*newitem = Objects[WEAPONID+19]; /* spear */
newitem->blessing = 9;
newitem->plus = 1;
newitem->known = 2;
gain_item(newitem);
}
}
} else {
print1("'Welcome back, Paladin.'");
if (!gamestatusp(MOUNTED)) {
print2("You are given a new steed.");
setgamestatus(MOUNTED);
}
morewait();
clearmsg();
if ((Player.hp < Player.maxhp) || (Player.status[DISEASED]) ||
(Player.status[POISONED]))
print1("Your wounds are treated by a medic.");
cleanse(0);
Player.hp = Player.maxhp;
Player.food = 40;
print2("You get a hot meal from the refectory.");
morewait();
clearmsg();
if (Player.rank[ORDER]==PALADIN) {
if (Player.level <= Justiciarlevel)
print2("You are not experienced enough to advance.");
else if (Player.alignment < 300)
print2("You are not sufficiently Lawful as yet to advance.");
else print2("You must give the Star Gem to the LawBringer.");
}
else if (Player.rank[ORDER]==CHEVALIER) {
if (Player.guildxp[ORDER] < 4000)
print2("You are not experienced enough to advance.");
else if (Player.alignment < 200)
print2("You are not sufficiently Lawful as yet to advance.");
else {
print1("You are made a Paladin of the Order!");
print2("You learn the Spell of Heroism and get Mithril Plate!");
morewait();
newitem = ((pob) checkmalloc(sizeof(objtype)));
*newitem = Objects[ARMORID+11]; /* mithril plate armor */
newitem->blessing = 9;
newitem->known = 2;
gain_item(newitem);
morewait();
clearmsg();
print1("To advance you must rescue the Star Gem and return it");
print2("to its owner, the LawBringer, who resides on Star Peak.");
morewait();
print1("The Star Gem was stolen by the cursed Prime Sorceror,");
print2("whose headquarters may be found beyond the Astral Plane.");
morewait();
print1("The Oracle will send you to the Astral Plane if you");
print2("prove yourself worthy to her.");
morewait();
Spells[S_HERO].known = TRUE;
Player.rank[ORDER] = PALADIN;
}
}
else if (Player.rank[ORDER]==GUARDIAN) {
if (Player.guildxp[ORDER] < 1500)
print2("You are not experienced enough to advance.");
else if (Player.alignment < 125)
print2("You are not yet sufficiently Lawful to advance.");
else {
Player.rank[ORDER] = CHEVALIER;
print1("You are made a Chevalier of the Order!");
print2("You are given a Mace of Disruption!");
morewait();
clearmsg();
newitem = ((pob) checkmalloc(sizeof(objtype)));
*newitem = Objects[WEAPONID+25]; /* mace of disruption */
newitem->known = 2;
gain_item(newitem);
}
}
else if (Player.rank[ORDER]==GALLANT) {
if (Player.guildxp[ORDER] < 400)
print2("You are not experienced enough to advance.");
else if (Player.alignment < 50)
print2("You are not Lawful enough to advance.");
else {
print1("You are made a Guardian of the Order of Paladins!");
print2("You are given a Holy Hand Grenade (of Antioch).");
morewait();
print1("You hear a nasal monotone in the distance....");
print2("'...and the number of thy counting shall be 3...'");
morewait();
clearmsg();
Player.rank[ORDER] = GUARDIAN;
newitem = ((pob) checkmalloc(sizeof(objtype)));
*newitem = Objects[ARTIFACTID+7]; /* holy hand grenade. */
newitem->known = 2;
gain_item(newitem);
}
}
}
}