-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathcedit.c
executable file
·2639 lines (2326 loc) · 89.1 KB
/
cedit.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
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
/**************************************************************************
* File: cedit.c Part of LuminariMUD *
* Usage: A graphical in-game game configuration utility for OasisOLC. *
* *
* Copyright 2002-2003 Kip Potter *
**************************************************************************/
#include "conf.h"
#include "sysdep.h"
#include "structs.h"
#include "utils.h"
#include "comm.h"
#include "interpreter.h"
#include "db.h"
#include "constants.h"
#include "genolc.h"
#include "oasis.h"
#include "improved-edit.h"
#include "modify.h"
#define CHECK_VAR(var) ((var == YES) ? "Yes" : "No")
#define TOGGLE_VAR(var) \
if (var == YES) \
{ \
var = NO; \
} \
else \
{ \
var = YES; \
}
/* local scope functions, not used externally */
static void cedit_disp_menu(struct descriptor_data *d);
static void cedit_save_internally(struct descriptor_data *d);
static void cedit_disp_game_play_options(struct descriptor_data *d);
static void cedit_disp_crash_save_options(struct descriptor_data *d);
static void cedit_disp_room_numbers(struct descriptor_data *d);
static void cedit_disp_operation_options(struct descriptor_data *d);
static void cedit_disp_autowiz_options(struct descriptor_data *d);
static void reassign_rooms(void);
static void cedit_setup(struct descriptor_data *d);
ACMD(do_oasis_cedit)
{
struct descriptor_data *d;
char buf1[MAX_STRING_LENGTH] = {'\0'};
/* No building as a mob or while being forced. */
if (IS_NPC(ch) || !ch->desc || STATE(ch->desc) != CON_PLAYING)
return;
/* Parse any arguments. */
one_argument(argument, buf1, sizeof(buf1));
if (GET_LEVEL(ch) < LVL_IMPL)
{
send_to_char(ch, "You can't modify the game configuration.\r\n");
return;
}
d = ch->desc;
if (!*buf1)
{
CREATE(d->olc, struct oasis_olc_data, 1);
OLC_ZONE(d) = 0;
cedit_setup(d);
STATE(d) = CON_CEDIT;
act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM);
SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING);
mudlog(BRF, LVL_IMMORT, TRUE,
"OLC: %s starts editing the game configuration.", GET_NAME(ch));
return;
}
else if (str_cmp("save", buf1) != 0)
{
send_to_char(ch, "Yikes! Stop that, someone will get hurt!\r\n");
return;
}
send_to_char(ch, "Saving the game configuration.\r\n");
mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(ch)), TRUE,
"OLC: %s saves the game configuration.", GET_NAME(ch));
cedit_save_to_disk();
}
static void cedit_setup(struct descriptor_data *d)
{
/* Create the config_data struct. */
CREATE(OLC_CONFIG(d), struct config_data, 1);
/* Copy the current configuration from the config_info to this one and copy
* the game play options from the configuration info struct. */
OLC_CONFIG(d)->play.pk_allowed = CONFIG_PK_ALLOWED;
OLC_CONFIG(d)->play.pt_allowed = CONFIG_PT_ALLOWED;
OLC_CONFIG(d)->play.level_can_shout = CONFIG_LEVEL_CAN_SHOUT;
OLC_CONFIG(d)->play.holler_move_cost = CONFIG_HOLLER_MOVE_COST;
OLC_CONFIG(d)->play.tunnel_size = CONFIG_TUNNEL_SIZE;
OLC_CONFIG(d)->play.max_exp_gain = CONFIG_MAX_EXP_GAIN;
OLC_CONFIG(d)->play.max_exp_loss = CONFIG_MAX_EXP_LOSS;
OLC_CONFIG(d)->play.max_npc_corpse_time = CONFIG_MAX_NPC_CORPSE_TIME;
OLC_CONFIG(d)->play.max_pc_corpse_time = CONFIG_MAX_PC_CORPSE_TIME;
OLC_CONFIG(d)->play.idle_void = CONFIG_IDLE_VOID;
OLC_CONFIG(d)->play.idle_rent_time = CONFIG_IDLE_RENT_TIME;
OLC_CONFIG(d)->play.idle_max_level = CONFIG_IDLE_MAX_LEVEL;
OLC_CONFIG(d)->play.dts_are_dumps = CONFIG_DTS_ARE_DUMPS;
OLC_CONFIG(d)->play.load_into_inventory = CONFIG_LOAD_INVENTORY;
OLC_CONFIG(d)->play.track_through_doors = CONFIG_TRACK_T_DOORS;
OLC_CONFIG(d)->play.no_mort_to_immort = CONFIG_NO_MORT_TO_IMMORT;
OLC_CONFIG(d)->play.disp_closed_doors = CONFIG_DISP_CLOSED_DOORS;
OLC_CONFIG(d)->play.diagonal_dirs = CONFIG_DIAGONAL_DIRS;
OLC_CONFIG(d)->play.map_option = CONFIG_MAP;
OLC_CONFIG(d)->play.map_size = CONFIG_MAP_SIZE;
OLC_CONFIG(d)->play.minimap_size = CONFIG_MINIMAP_SIZE;
OLC_CONFIG(d)->play.script_players = CONFIG_SCRIPT_PLAYERS;
OLC_CONFIG(d)->play.min_pop_to_claim = CONFIG_MIN_POP_TO_CLAIM;
/* Crash Saves */
OLC_CONFIG(d)->csd.free_rent = CONFIG_FREE_RENT;
OLC_CONFIG(d)->csd.max_obj_save = CONFIG_MAX_OBJ_SAVE;
OLC_CONFIG(d)->csd.min_rent_cost = CONFIG_MIN_RENT_COST;
OLC_CONFIG(d)->csd.auto_save = CONFIG_AUTO_SAVE;
OLC_CONFIG(d)->csd.autosave_time = CONFIG_AUTOSAVE_TIME;
OLC_CONFIG(d)->csd.crash_file_timeout = CONFIG_CRASH_TIMEOUT;
OLC_CONFIG(d)->csd.rent_file_timeout = CONFIG_RENT_TIMEOUT;
/* Room Numbers */
OLC_CONFIG(d)->room_nums.mortal_start_room = CONFIG_MORTAL_START;
OLC_CONFIG(d)->room_nums.immort_start_room = CONFIG_IMMORTAL_START;
OLC_CONFIG(d)->room_nums.frozen_start_room = CONFIG_FROZEN_START;
OLC_CONFIG(d)->room_nums.donation_room_1 = CONFIG_DON_ROOM_1;
OLC_CONFIG(d)->room_nums.donation_room_2 = CONFIG_DON_ROOM_2;
OLC_CONFIG(d)->room_nums.donation_room_3 = CONFIG_DON_ROOM_3;
/* Game Operation */
OLC_CONFIG(d)->operation.DFLT_PORT = CONFIG_DFLT_PORT;
OLC_CONFIG(d)->operation.max_playing = CONFIG_MAX_PLAYING;
OLC_CONFIG(d)->operation.max_filesize = CONFIG_MAX_FILESIZE;
OLC_CONFIG(d)->operation.max_bad_pws = CONFIG_MAX_BAD_PWS;
OLC_CONFIG(d)->operation.siteok_everyone = CONFIG_SITEOK_ALL;
OLC_CONFIG(d)->operation.use_new_socials = CONFIG_NEW_SOCIALS;
OLC_CONFIG(d)->operation.auto_save_olc = CONFIG_OLC_SAVE;
OLC_CONFIG(d)->operation.nameserver_is_slow = CONFIG_NS_IS_SLOW;
OLC_CONFIG(d)->operation.medit_advanced = CONFIG_MEDIT_ADVANCED;
OLC_CONFIG(d)->operation.ibt_autosave = CONFIG_IBT_AUTOSAVE;
OLC_CONFIG(d)->operation.protocol_negotiation = CONFIG_PROTOCOL_NEGOTIATION;
OLC_CONFIG(d)->operation.special_in_comm = CONFIG_SPECIAL_IN_COMM;
OLC_CONFIG(d)->operation.debug_mode = CONFIG_DEBUG_MODE;
/* Autowiz */
OLC_CONFIG(d)->autowiz.use_autowiz = CONFIG_USE_AUTOWIZ;
OLC_CONFIG(d)->autowiz.min_wizlist_lev = CONFIG_MIN_WIZLIST_LEV;
/* Happy Hour */
OLC_CONFIG(d)->happy_hour.chance = CONFIG_HAPPY_HOUR_CHANCE;
OLC_CONFIG(d)->happy_hour.exp = CONFIG_HAPPY_HOUR_EXP;
OLC_CONFIG(d)->happy_hour.qp = CONFIG_HAPPY_HOUR_QP;
OLC_CONFIG(d)->happy_hour.gold = CONFIG_HAPPY_HOUR_GOLD;
OLC_CONFIG(d)->happy_hour.treasure = CONFIG_HAPPY_HOUR_TREASURE;
/* Player config stuff */
OLC_CONFIG(d)->player_config.psionic_power_damage_bonus = CONFIG_PSIONIC_DAMAGE;
OLC_CONFIG(d)->player_config.divine_spell_damage_bonus = CONFIG_DIVINE_DAMAGE;
OLC_CONFIG(d)->player_config.arcane_spell_damage_bonus = CONFIG_ARCANE_DAMAGE;
OLC_CONFIG(d)->player_config.psionic_mem_times = CONFIG_PSIONIC_PREP_TIME;
OLC_CONFIG(d)->player_config.divine_mem_times = CONFIG_DIVINE_PREP_TIME;
OLC_CONFIG(d)->player_config.arcane_mem_times = CONFIG_ARCANE_PREP_TIME;
OLC_CONFIG(d)->player_config.alchemy_mem_times = CONFIG_ALCHEMY_PREP_TIME;
OLC_CONFIG(d)->player_config.extra_hp_per_level = CONFIG_EXTRA_PLAYER_HP_PER_LEVEL;
OLC_CONFIG(d)->player_config.extra_mv_per_level = CONFIG_EXTRA_PLAYER_MV_PER_LEVEL;
OLC_CONFIG(d)->player_config.armor_class_cap = CONFIG_PLAYER_AC_CAP;
OLC_CONFIG(d)->player_config.group_level_difference_restriction = CONFIG_EXP_LEVEL_DIFFERENCE;
OLC_CONFIG(d)->player_config.death_exp_loss_penalty = CONFIG_DEATH_EXP_LOSS;
OLC_CONFIG(d)->player_config.level_1_10_summon_hp = CONFIG_SUMMON_LEVEL_1_10_HP;
OLC_CONFIG(d)->player_config.level_1_10_summon_hit_and_dam = CONFIG_SUMMON_LEVEL_1_10_HIT_DAM;
OLC_CONFIG(d)->player_config.level_1_10_summon_ac = CONFIG_SUMMON_LEVEL_1_10_AC;
OLC_CONFIG(d)->player_config.level_11_20_summon_hp = CONFIG_SUMMON_LEVEL_11_20_HP;
OLC_CONFIG(d)->player_config.level_11_20_summon_hit_and_dam = CONFIG_SUMMON_LEVEL_11_20_HIT_DAM;
OLC_CONFIG(d)->player_config.level_11_20_summon_ac = CONFIG_SUMMON_LEVEL_11_20_AC;
OLC_CONFIG(d)->player_config.level_21_30_summon_hp = CONFIG_SUMMON_LEVEL_21_30_HP;
OLC_CONFIG(d)->player_config.level_21_30_summon_hit_and_dam = CONFIG_SUMMON_LEVEL_21_30_HIT_DAM;
OLC_CONFIG(d)->player_config.level_21_30_summon_ac = CONFIG_SUMMON_LEVEL_21_30_AC;
/* Allocate space for the strings. */
OLC_CONFIG(d)->play.OK = str_udup(CONFIG_OK);
OLC_CONFIG(d)->play.NOPERSON = str_udup(CONFIG_NOPERSON);
OLC_CONFIG(d)->play.NOEFFECT = str_udup(CONFIG_NOEFFECT);
if (CONFIG_DFLT_IP)
OLC_CONFIG(d)->operation.DFLT_IP = strdup(CONFIG_DFLT_IP);
else
OLC_CONFIG(d)->operation.DFLT_IP = NULL;
if (CONFIG_DFLT_DIR)
OLC_CONFIG(d)->operation.DFLT_DIR = strdup(CONFIG_DFLT_DIR);
else
OLC_CONFIG(d)->operation.DFLT_DIR = NULL;
if (CONFIG_LOGNAME)
OLC_CONFIG(d)->operation.LOGNAME = strdup(CONFIG_LOGNAME);
else
OLC_CONFIG(d)->operation.LOGNAME = NULL;
if (CONFIG_MENU)
OLC_CONFIG(d)->operation.MENU = strdup(CONFIG_MENU);
else
OLC_CONFIG(d)->operation.MENU = NULL;
if (CONFIG_WELC_MESSG)
OLC_CONFIG(d)->operation.WELC_MESSG = strdup(CONFIG_WELC_MESSG);
else
OLC_CONFIG(d)->operation.WELC_MESSG = NULL;
if (CONFIG_START_MESSG)
OLC_CONFIG(d)->operation.START_MESSG = strdup(CONFIG_START_MESSG);
else
OLC_CONFIG(d)->operation.START_MESSG = NULL;
cedit_disp_menu(d);
}
static void cedit_save_internally(struct descriptor_data *d)
{
/* see if we need to reassign spec procs on rooms */
int reassign = (CONFIG_DTS_ARE_DUMPS != OLC_CONFIG(d)->play.dts_are_dumps);
/* Copy the data back from the descriptor to the config_info structure. */
CONFIG_PK_ALLOWED = OLC_CONFIG(d)->play.pk_allowed;
CONFIG_PT_ALLOWED = OLC_CONFIG(d)->play.pt_allowed;
CONFIG_LEVEL_CAN_SHOUT = OLC_CONFIG(d)->play.level_can_shout;
CONFIG_HOLLER_MOVE_COST = OLC_CONFIG(d)->play.holler_move_cost;
CONFIG_TUNNEL_SIZE = OLC_CONFIG(d)->play.tunnel_size;
CONFIG_MAX_EXP_GAIN = OLC_CONFIG(d)->play.max_exp_gain;
CONFIG_MAX_EXP_LOSS = OLC_CONFIG(d)->play.max_exp_loss;
CONFIG_MAX_NPC_CORPSE_TIME = OLC_CONFIG(d)->play.max_npc_corpse_time;
CONFIG_MAX_PC_CORPSE_TIME = OLC_CONFIG(d)->play.max_pc_corpse_time;
CONFIG_IDLE_VOID = OLC_CONFIG(d)->play.idle_void;
CONFIG_IDLE_RENT_TIME = OLC_CONFIG(d)->play.idle_rent_time;
CONFIG_IDLE_MAX_LEVEL = OLC_CONFIG(d)->play.idle_max_level;
CONFIG_DTS_ARE_DUMPS = OLC_CONFIG(d)->play.dts_are_dumps;
CONFIG_LOAD_INVENTORY = OLC_CONFIG(d)->play.load_into_inventory;
CONFIG_TRACK_T_DOORS = OLC_CONFIG(d)->play.track_through_doors;
CONFIG_NO_MORT_TO_IMMORT = OLC_CONFIG(d)->play.no_mort_to_immort;
CONFIG_DISP_CLOSED_DOORS = OLC_CONFIG(d)->play.disp_closed_doors;
CONFIG_DIAGONAL_DIRS = OLC_CONFIG(d)->play.diagonal_dirs;
CONFIG_MAP = OLC_CONFIG(d)->play.map_option;
CONFIG_MAP_SIZE = OLC_CONFIG(d)->play.map_size;
CONFIG_MINIMAP_SIZE = OLC_CONFIG(d)->play.minimap_size;
CONFIG_SCRIPT_PLAYERS = OLC_CONFIG(d)->play.script_players;
CONFIG_MIN_POP_TO_CLAIM = OLC_CONFIG(d)->play.min_pop_to_claim;
/* Crash Saves */
CONFIG_FREE_RENT = OLC_CONFIG(d)->csd.free_rent;
CONFIG_MAX_OBJ_SAVE = OLC_CONFIG(d)->csd.max_obj_save;
CONFIG_MIN_RENT_COST = OLC_CONFIG(d)->csd.min_rent_cost;
CONFIG_AUTO_SAVE = OLC_CONFIG(d)->csd.auto_save;
CONFIG_AUTOSAVE_TIME = OLC_CONFIG(d)->csd.autosave_time;
CONFIG_CRASH_TIMEOUT = OLC_CONFIG(d)->csd.crash_file_timeout;
CONFIG_RENT_TIMEOUT = OLC_CONFIG(d)->csd.rent_file_timeout;
/* Room Numbers */
CONFIG_MORTAL_START = OLC_CONFIG(d)->room_nums.mortal_start_room;
CONFIG_IMMORTAL_START = OLC_CONFIG(d)->room_nums.immort_start_room;
CONFIG_FROZEN_START = OLC_CONFIG(d)->room_nums.frozen_start_room;
CONFIG_DON_ROOM_1 = OLC_CONFIG(d)->room_nums.donation_room_1;
CONFIG_DON_ROOM_2 = OLC_CONFIG(d)->room_nums.donation_room_2;
CONFIG_DON_ROOM_3 = OLC_CONFIG(d)->room_nums.donation_room_3;
/* Game Operation */
CONFIG_DFLT_PORT = OLC_CONFIG(d)->operation.DFLT_PORT;
CONFIG_MAX_PLAYING = OLC_CONFIG(d)->operation.max_playing;
CONFIG_MAX_FILESIZE = OLC_CONFIG(d)->operation.max_filesize;
CONFIG_MAX_BAD_PWS = OLC_CONFIG(d)->operation.max_bad_pws;
CONFIG_SITEOK_ALL = OLC_CONFIG(d)->operation.siteok_everyone;
CONFIG_NEW_SOCIALS = OLC_CONFIG(d)->operation.use_new_socials;
CONFIG_NS_IS_SLOW = OLC_CONFIG(d)->operation.nameserver_is_slow;
CONFIG_OLC_SAVE = OLC_CONFIG(d)->operation.auto_save_olc;
CONFIG_MEDIT_ADVANCED = OLC_CONFIG(d)->operation.medit_advanced;
CONFIG_IBT_AUTOSAVE = OLC_CONFIG(d)->operation.ibt_autosave;
CONFIG_PROTOCOL_NEGOTIATION = OLC_CONFIG(d)->operation.protocol_negotiation;
CONFIG_SPECIAL_IN_COMM = OLC_CONFIG(d)->operation.special_in_comm;
CONFIG_DEBUG_MODE = OLC_CONFIG(d)->operation.debug_mode;
/* Autowiz */
CONFIG_USE_AUTOWIZ = OLC_CONFIG(d)->autowiz.use_autowiz;
CONFIG_MIN_WIZLIST_LEV = OLC_CONFIG(d)->autowiz.min_wizlist_lev;
/* Happy Hour */
CONFIG_HAPPY_HOUR_CHANCE = OLC_CONFIG(d)->happy_hour.chance;
CONFIG_HAPPY_HOUR_EXP = OLC_CONFIG(d)->happy_hour.exp;
CONFIG_HAPPY_HOUR_QP = OLC_CONFIG(d)->happy_hour.qp;
CONFIG_HAPPY_HOUR_GOLD = OLC_CONFIG(d)->happy_hour.gold;
CONFIG_HAPPY_HOUR_TREASURE = OLC_CONFIG(d)->happy_hour.treasure;
CONFIG_PSIONIC_DAMAGE = OLC_CONFIG(d)->player_config.psionic_power_damage_bonus;
CONFIG_DIVINE_DAMAGE = OLC_CONFIG(d)->player_config.divine_spell_damage_bonus;
CONFIG_ARCANE_DAMAGE = OLC_CONFIG(d)->player_config.arcane_spell_damage_bonus;
CONFIG_PSIONIC_PREP_TIME = OLC_CONFIG(d)->player_config.psionic_mem_times;
CONFIG_DIVINE_PREP_TIME = OLC_CONFIG(d)->player_config.divine_mem_times;
CONFIG_ARCANE_PREP_TIME = OLC_CONFIG(d)->player_config.arcane_mem_times;
CONFIG_ALCHEMY_PREP_TIME = OLC_CONFIG(d)->player_config.alchemy_mem_times;
CONFIG_EXTRA_PLAYER_HP_PER_LEVEL = OLC_CONFIG(d)->player_config.extra_hp_per_level;
CONFIG_EXTRA_PLAYER_MV_PER_LEVEL = OLC_CONFIG(d)->player_config.extra_mv_per_level;
CONFIG_PLAYER_AC_CAP = OLC_CONFIG(d)->player_config.armor_class_cap;
CONFIG_EXP_LEVEL_DIFFERENCE = OLC_CONFIG(d)->player_config.group_level_difference_restriction;
CONFIG_DEATH_EXP_LOSS = OLC_CONFIG(d)->player_config.death_exp_loss_penalty;
CONFIG_SUMMON_LEVEL_1_10_HP = OLC_CONFIG(d)->player_config.level_1_10_summon_hp;
CONFIG_SUMMON_LEVEL_1_10_HIT_DAM = OLC_CONFIG(d)->player_config.level_1_10_summon_hit_and_dam;
CONFIG_SUMMON_LEVEL_1_10_AC = OLC_CONFIG(d)->player_config.level_1_10_summon_ac;
CONFIG_SUMMON_LEVEL_11_20_HP = OLC_CONFIG(d)->player_config.level_11_20_summon_hp;
CONFIG_SUMMON_LEVEL_11_20_HIT_DAM = OLC_CONFIG(d)->player_config.level_11_20_summon_hit_and_dam;
CONFIG_SUMMON_LEVEL_11_20_AC = OLC_CONFIG(d)->player_config.level_11_20_summon_ac;
CONFIG_SUMMON_LEVEL_21_30_HP = OLC_CONFIG(d)->player_config.level_21_30_summon_hp;
CONFIG_SUMMON_LEVEL_21_30_HIT_DAM = OLC_CONFIG(d)->player_config.level_21_30_summon_hit_and_dam;
CONFIG_SUMMON_LEVEL_21_30_AC = OLC_CONFIG(d)->player_config.level_21_30_summon_ac;
/* Allocate space for the strings. */
if (CONFIG_OK)
free(CONFIG_OK);
CONFIG_OK = str_udup(OLC_CONFIG(d)->play.OK);
if (CONFIG_NOPERSON)
free(CONFIG_NOPERSON);
CONFIG_NOPERSON = str_udup(OLC_CONFIG(d)->play.NOPERSON);
if (CONFIG_NOEFFECT)
free(CONFIG_NOEFFECT);
CONFIG_NOEFFECT = str_udup(OLC_CONFIG(d)->play.NOEFFECT);
if (CONFIG_DFLT_IP)
free(CONFIG_DFLT_IP);
if (OLC_CONFIG(d)->operation.DFLT_IP)
CONFIG_DFLT_IP = strdup(OLC_CONFIG(d)->operation.DFLT_IP);
else
CONFIG_DFLT_IP = NULL;
if (CONFIG_DFLT_DIR)
free(CONFIG_DFLT_DIR);
if (OLC_CONFIG(d)->operation.DFLT_DIR)
CONFIG_DFLT_DIR = strdup(OLC_CONFIG(d)->operation.DFLT_DIR);
else
CONFIG_DFLT_DIR = NULL;
if (CONFIG_LOGNAME)
free(CONFIG_LOGNAME);
if (OLC_CONFIG(d)->operation.LOGNAME)
CONFIG_LOGNAME = strdup(OLC_CONFIG(d)->operation.LOGNAME);
else
CONFIG_LOGNAME = NULL;
if (CONFIG_MENU)
free(CONFIG_MENU);
if (OLC_CONFIG(d)->operation.MENU)
CONFIG_MENU = strdup(OLC_CONFIG(d)->operation.MENU);
else
CONFIG_MENU = NULL;
if (CONFIG_WELC_MESSG)
free(CONFIG_WELC_MESSG);
if (OLC_CONFIG(d)->operation.WELC_MESSG)
CONFIG_WELC_MESSG = strdup(OLC_CONFIG(d)->operation.WELC_MESSG);
else
CONFIG_WELC_MESSG = NULL;
if (CONFIG_START_MESSG)
free(CONFIG_START_MESSG);
if (OLC_CONFIG(d)->operation.START_MESSG)
CONFIG_START_MESSG = strdup(OLC_CONFIG(d)->operation.START_MESSG);
else
CONFIG_START_MESSG = NULL;
/* if we changed the dts to/from dumps, reassign - Welcor */
if (reassign)
reassign_rooms();
add_to_save_list(NOWHERE, SL_CFG);
}
void cedit_save_to_disk(void)
{
/* Just call save_config and get it over with. */
save_config(NOWHERE);
}
int save_config(IDXTYPE nowhere)
{
FILE *fl;
char buf[MAX_STRING_LENGTH] = {'\0'};
if (!(fl = fopen(CONFIG_CONFFILE, "w")))
{
perror("SYSERR: save_config");
return (FALSE);
}
fprintf(fl,
"* This file is autogenerated by OasisOLC (CEdit).\n"
"* Please note the following information about this file's format.\n"
"*\n"
"* - If variable is a yes/no or true/false based variable, use 1's and 0's\n"
"* where YES or TRUE = 1 and NO or FALSE = 0.\n"
"* - Variable names in this file are case-insensitive. Variable values\n"
"* are not case-insensitive.\n"
"* -----------------------------------------------------------------------\n"
"* Lines starting with * are comments, and are not parsed.\n"
"* -----------------------------------------------------------------------\n\n"
"* [ Game Play Options ]\n");
fprintf(fl, "* Is player killing allowed on the mud?\n"
"pk_allowed = %d\n\n",
CONFIG_PK_ALLOWED);
fprintf(fl, "* Is player thieving allowed on the mud?\n"
"pt_allowed = %d\n\n",
CONFIG_PT_ALLOWED);
fprintf(fl, "* What is the minimum level a player can shout/gossip/etc?\n"
"level_can_shout = %d\n\n",
CONFIG_LEVEL_CAN_SHOUT);
fprintf(fl, "* How many movement points does shouting cost the player?\n"
"holler_move_cost = %d\n\n",
CONFIG_HOLLER_MOVE_COST);
fprintf(fl, "* How many players can fit in a tunnel?\n"
"tunnel_size = %d\n\n",
CONFIG_TUNNEL_SIZE);
fprintf(fl, "* Maximum experience gainable per kill?\n"
"max_exp_gain = %d\n\n",
CONFIG_MAX_EXP_GAIN);
fprintf(fl, "* Maximum experience loseable per death?\n"
"max_exp_loss = %d\n\n",
CONFIG_MAX_EXP_LOSS);
fprintf(fl, "* Number of tics before NPC corpses decompose.\n"
"max_npc_corpse_time = %d\n\n",
CONFIG_MAX_NPC_CORPSE_TIME);
fprintf(fl, "* Number of tics before PC corpses decompose.\n"
"max_pc_corpse_time = %d\n\n",
CONFIG_MAX_PC_CORPSE_TIME);
fprintf(fl, "* Number of tics before a PC is sent to the void.\n"
"idle_void = %d\n\n",
CONFIG_IDLE_VOID);
fprintf(fl, "* Number of tics before a PC is autorented.\n"
"idle_rent_time = %d\n\n",
CONFIG_IDLE_RENT_TIME);
fprintf(fl, "* Level and above of players whom are immune to idle penalties.\n"
"idle_max_level = %d\n\n",
CONFIG_IDLE_MAX_LEVEL);
fprintf(fl, "* Should the items in death traps be junked automatically?\n"
"dts_are_dumps = %d\n\n",
CONFIG_DTS_ARE_DUMPS);
fprintf(fl, "* When an immortal loads an object, should it load into their inventory?\n"
"load_into_inventory = %d\n\n",
CONFIG_LOAD_INVENTORY);
fprintf(fl, "* Should PC's be able to track through hidden or closed doors?\n"
"track_through_doors = %d\n\n",
CONFIG_TRACK_T_DOORS);
fprintf(fl, "* Should players who reach enough exp automatically level to immortal?\n"
"no_mort_to_immort = %d\n\n",
CONFIG_NO_MORT_TO_IMMORT);
fprintf(fl, "* Should closed doors be shown on autoexit / exit?\n"
"disp_closed_doors = %d\n\n",
CONFIG_DISP_CLOSED_DOORS);
fprintf(fl, "* Are diagonal directions enabled?\n"
"diagonal_dirs = %d\n\n",
CONFIG_DIAGONAL_DIRS);
fprintf(fl, "* Who can use the map functions? 0=off, 1=on, 2=imm_only\n"
"map_option = %d\n\n",
CONFIG_MAP);
fprintf(fl, "* Default size of map shown by 'map' command\n"
"default_map_size = %d\n\n",
CONFIG_MAP_SIZE);
fprintf(fl, "* Default minimap size shown to the right of room descriptions\n"
"default_minimap_size = %d\n\n",
CONFIG_MINIMAP_SIZE);
fprintf(fl, "* Do you want scripts to be attachable to players?\n"
"script_players = %d\n\n",
CONFIG_SCRIPT_PLAYERS);
fprintf(fl, "* Minimum popularity percentage required to claim a zone for your clan?\n"
"min_pop_to_claim = %f\n\n",
CONFIG_MIN_POP_TO_CLAIM);
strlcpy(buf, CONFIG_OK, sizeof(buf));
strip_cr(buf);
fprintf(fl, "* Text sent to players when OK is all that is needed.\n"
"ok = %s\n\n",
buf);
strlcpy(buf, CONFIG_NOPERSON, sizeof(buf));
strip_cr(buf);
fprintf(fl, "* Text sent to players when noone is available.\n"
"noperson = %s\n\n",
buf);
strlcpy(buf, CONFIG_NOEFFECT, sizeof(buf));
strip_cr(buf);
fprintf(fl, "* Text sent to players when an effect fails.\n"
"noeffect = %s\n",
buf);
/* RENT / CRASHSAVE OPTIONS */
fprintf(fl, "\n\n\n* [ Rent/Crashsave Options ]\n");
fprintf(fl, "* Should the MUD allow you to 'rent' for free? (i.e. if you just quit,\n"
"* your objects are saved at no cost, as in Merc-type MUDs.)\n"
"free_rent = %d\n\n",
CONFIG_FREE_RENT);
fprintf(fl, "* Maximum number of items players are allowed to rent.\n"
"max_obj_save = %d\n\n",
CONFIG_MAX_OBJ_SAVE);
fprintf(fl, "* Should the game automatically save people?\n"
"auto_save = %d\n\n",
CONFIG_AUTO_SAVE);
fprintf(fl, "* If auto_save = 1, how often (in minutes) should the game save people's objects?\n"
"autosave_time = %d\n\n",
CONFIG_AUTOSAVE_TIME);
fprintf(fl, "* Lifetime of crashfiles and force-rent (idlesave) files in days.\n"
"crash_file_timeout = %d\n\n",
CONFIG_CRASH_TIMEOUT);
fprintf(fl, "* Lifetime of normal rent files in days.\n"
"rent_file_timeout = %d\n\n",
CONFIG_RENT_TIMEOUT);
/* ROOM NUMBERS */
fprintf(fl, "\n\n\n* [ Room Numbers ]\n");
fprintf(fl, "* The virtual number of the room that mortals should enter at.\n"
"mortal_start_room = %d\n\n",
CONFIG_MORTAL_START);
fprintf(fl, "* The virtual number of the room that immorts should enter at.\n"
"immort_start_room = %d\n\n",
CONFIG_IMMORTAL_START);
fprintf(fl, "* The virtual number of the room that frozen people should enter at.\n"
"frozen_start_room = %d\n\n",
CONFIG_FROZEN_START);
fprintf(fl, "* The virtual numbers of the donation rooms. Note: Add donation rooms\n"
"* sequentially (1 & 2 before 3). If you don't, you might not be able to\n"
"* donate. Use -1 for 'no such room'.\n"
"donation_room_1 = %d\n"
"donation_room_2 = %d\n"
"donation_room_3 = %d\n\n",
CONFIG_DON_ROOM_1 != NOWHERE ? CONFIG_DON_ROOM_1 : -1,
CONFIG_DON_ROOM_2 != NOWHERE ? CONFIG_DON_ROOM_2 : -1,
CONFIG_DON_ROOM_3 != NOWHERE ? CONFIG_DON_ROOM_3 : -1);
fprintf(fl, "\n\n\n* [ Game Operation Options ]\n");
fprintf(fl, "* This is the default port on which the game should run if no port is\n"
"* given on the command-line. NOTE WELL: If you're using the\n"
"* 'autorun' script, the port number there will override this setting.\n"
"* Change the PORT= line in autorun instead of (or in addition to)\n"
"* changing this.\n"
"DFLT_PORT = %d\n\n",
CONFIG_DFLT_PORT);
if (CONFIG_DFLT_IP)
{
strlcpy(buf, CONFIG_DFLT_IP, sizeof(buf));
strip_cr(buf);
fprintf(fl, "* IP address to which the MUD should bind.\nDFLT_IP = %s\n\n", buf);
}
if (CONFIG_DFLT_DIR)
{
strlcpy(buf, CONFIG_DFLT_DIR, sizeof(buf));
strip_cr(buf);
fprintf(fl, "* default directory to use as data directory.\n"
"DFLT_DIR = %s\n\n",
buf);
}
if (CONFIG_LOGNAME)
{
strlcpy(buf, CONFIG_LOGNAME, sizeof(buf));
strip_cr(buf);
fprintf(fl, "* What file to log messages to (ex: 'log/syslog').\n"
"LOGNAME = %s\n\n",
buf);
}
fprintf(fl, "* Maximum number of players allowed before game starts to turn people away.\n"
"max_playing = %d\n\n",
CONFIG_MAX_PLAYING);
fprintf(fl, "* Maximum size of bug, typo, and idea files in bytes (to prevent bombing).\n"
"max_filesize = %d\n\n",
CONFIG_MAX_FILESIZE);
fprintf(fl, "* Maximum number of password attempts before disconnection.\n"
"max_bad_pws = %d\n\n",
CONFIG_MAX_BAD_PWS);
fprintf(fl, "* Is the site ok for everyone except those that are banned?\n"
"siteok_everyone = %d\n\n",
CONFIG_SITEOK_ALL);
fprintf(fl, "* If you want to use the original social file format\n"
"* and disable Aedit, set to 0, otherwise, 1.\n"
"use_new_socials = %d\n\n",
CONFIG_NEW_SOCIALS);
fprintf(fl, "* If the nameserver is fast, set to 0, otherwise, 1.\n"
"nameserver_is_slow = %d\n\n",
CONFIG_NS_IS_SLOW);
fprintf(fl, "* Should OLC autosave to disk (1) or save internally (0).\n"
"auto_save_olc = %d\n\n",
CONFIG_OLC_SAVE);
if (CONFIG_MENU)
{
strlcpy(buf, CONFIG_MENU, sizeof(buf));
strip_cr(buf);
fprintf(fl, "* The entrance/exit menu.\n"
"MENU = \n%s~\n\n",
convert_from_tabs(buf));
}
if (CONFIG_WELC_MESSG)
{
strlcpy(buf, CONFIG_WELC_MESSG, sizeof(buf));
strip_cr(buf);
fprintf(fl, "* The welcome message.\nWELC_MESSG = \n%s~\n\n", convert_from_tabs(buf));
}
if (CONFIG_START_MESSG)
{
strlcpy(buf, CONFIG_START_MESSG, sizeof(buf));
strip_cr(buf);
fprintf(fl, "* NEWBIE start message.\n"
"START_MESSG = \n%s~\n\n",
convert_from_tabs(buf));
}
fprintf(fl, "* Should the medit OLC show the advanced stats menu (1) or not (0).\n"
"medit_advanced_stats = %d\n\n",
CONFIG_MEDIT_ADVANCED);
fprintf(fl, "* Should the idea, bug and typo commands autosave (1) or not (0).\n"
"ibt_autosave = %d\n\n",
CONFIG_IBT_AUTOSAVE);
fprintf(fl, "\n\n\n* [ Autowiz Options ]\n");
fprintf(fl, "* Should the game automatically create a new wizlist/immlist every time\n"
"* someone immorts, or is promoted to a higher (or lower) god level?\n"
"use_autowiz = %d\n\n",
CONFIG_USE_AUTOWIZ);
fprintf(fl, "* If yes, what is the lowest level which should be on the wizlist?\n"
"min_wizlist_lev = %d\n\n",
CONFIG_MIN_WIZLIST_LEV);
fprintf(fl, "* If yes, enable the protocol negotiation system.\n"
"protocol_negotiation = %d\n\n",
CONFIG_PROTOCOL_NEGOTIATION);
fprintf(fl, "* If yes, enable the special character in comm channels.\n"
"special_in_comm = %d\n\n",
CONFIG_SPECIAL_IN_COMM);
fprintf(fl, "* If 0 then off, otherwise 1: Brief, 2: Normal, 3: Complete.\n"
"debug_mode = %d\n\n",
CONFIG_DEBUG_MODE);
fprintf(fl, "* Chance for Happy Hour to Occur randomly and automatically each rl hour.\n"
"happy_hour_chance = %d\n\n",
CONFIG_HAPPY_HOUR_CHANCE);
fprintf(fl, "* Percent increase in experience gained during automated happy hour.\n"
"happy_hour_exp_bonus = %d\n\n",
CONFIG_HAPPY_HOUR_EXP);
fprintf(fl, "* Percent increase in qp gained during automated happy hour.\n"
"happy_hour_qp_bonus = %d\n\n",
CONFIG_HAPPY_HOUR_QP);
fprintf(fl, "* Percent increase in gold gained during automated happy hour.\n"
"happy_hour_gold_bonus = %d\n\n",
CONFIG_HAPPY_HOUR_GOLD);
fprintf(fl, "* Percent Increase for chance of random treasure during automated happy hour.\n"
"happy_hour_treasure_bonus = %d\n\n",
CONFIG_HAPPY_HOUR_TREASURE);
// Player stats stuff
fprintf(fl, "* Percent increase on psionic power damage .\n"
"psionic_power_damage = %d\n\n",
CONFIG_PSIONIC_DAMAGE);
fprintf(fl, "* Percent increase on divine spell damage .\n"
"divine_spell_damage = %d\n\n",
CONFIG_DIVINE_DAMAGE);
fprintf(fl, "* Percent increase on arcane spell damage .\n"
"arcane_spell_damage = %d\n\n",
CONFIG_ARCANE_DAMAGE);
fprintf(fl, "* Percent of psionic psp regen rate .\n"
"psionic_mem_times = %d\n\n",
CONFIG_PSIONIC_PREP_TIME);
fprintf(fl, "* Percent of divine spell prep time .\n"
"divine_mem_times = %d\n\n",
CONFIG_DIVINE_PREP_TIME);
fprintf(fl, "* Percent of arcane spell prep time .\n"
"arcane_mem_times = %d\n\n",
CONFIG_ARCANE_PREP_TIME);
fprintf(fl, "* Percent of alchemy concoction prep time .\n"
"alchemy_mem_times = %d\n\n",
CONFIG_ALCHEMY_PREP_TIME);
fprintf(fl, "* Extra hp per level for players.\n"
"extra_level_hp = %d\n\n",
CONFIG_EXTRA_PLAYER_HP_PER_LEVEL);
fprintf(fl, "* Extra mv per level for players.\n"
"extra_level_mv = %d\n\n",
CONFIG_EXTRA_PLAYER_MV_PER_LEVEL);
fprintf(fl, "* Maximum player armor class.\n"
"ac_cap = %d\n\n",
CONFIG_PLAYER_AC_CAP);
fprintf(fl, "* Maximum difference in player and mob level for exp.\n"
"exp_level_difference = %d\n\n",
CONFIG_EXP_LEVEL_DIFFERENCE);
fprintf(fl, "* Percentage compared to normal, for exp loss when a player dies.\n"
"death_exp_loss_penalty = %d\n\n",
CONFIG_DEATH_EXP_LOSS);
fprintf(fl, "* Percentage of summoned charmies hp compared to normal, level 1-10 summons.\n"
"summon_1_10_hp = %d\n\n",
CONFIG_SUMMON_LEVEL_1_10_HP);
fprintf(fl, "* Percentage of summoned charmies hit and dam compared to normal, level 1-10 summons.\n"
"summon_1_10_hit_dam = %d\n\n",
CONFIG_SUMMON_LEVEL_1_10_HIT_DAM);
fprintf(fl, "* Percentage of summoned charmies ac compared to normal, level 1-10 summons.\n"
"summon_1_10_ac = %d\n\n",
CONFIG_SUMMON_LEVEL_1_10_AC);
fprintf(fl, "* Percentage of summoned charmies hp compared to normal, level 11-20 summons.\n"
"summon_11_20_hp = %d\n\n",
CONFIG_SUMMON_LEVEL_11_20_HP);
fprintf(fl, "* Percentage of summoned charmies hit and dam compared to normal, level 11-20 summons.\n"
"summon_11_20_hit_dam = %d\n\n",
CONFIG_SUMMON_LEVEL_11_20_HIT_DAM);
fprintf(fl, "* Percentage of summoned charmies ac compared to normal, level 11-20 summons.\n"
"summon_11_20_ac = %d\n\n",
CONFIG_SUMMON_LEVEL_11_20_AC);
fprintf(fl, "* Percentage of summoned charmies hp compared to normal, level 21-30 summons.\n"
"summon_21_30_hp = %d\n\n",
CONFIG_SUMMON_LEVEL_21_30_HP);
fprintf(fl, "* Percentage of summoned charmies hit and dam compared to normal, level 21-30 summons.\n"
"summon_21_30_hit_dam = %d\n\n",
CONFIG_SUMMON_LEVEL_21_30_HIT_DAM);
fprintf(fl, "* Percentage of summoned charmies ac compared to normal, level 21-30 summons.\n"
"summon_21_30_ac = %d\n\n",
CONFIG_SUMMON_LEVEL_21_30_AC);
fclose(fl);
if (in_save_list(NOWHERE, SL_CFG))
remove_from_save_list(NOWHERE, SL_CFG);
return (TRUE);
}
/* Menu functions - The main menu. */
static void cedit_disp_menu(struct descriptor_data *d)
{
get_char_colors(d->character);
clear_screen(d);
/* Menu header. */
write_to_output(d,
"OasisOLC MUD Configuration Editor\r\n"
"%sG%s) Game Play Options\r\n"
"%sC%s) Crashsave/Rent Options\r\n"
"%sR%s) Room Numbers\r\n"
"%sO%s) Operation Options\r\n"
"%sA%s) Autowiz Options\r\n"
"%sH%s) Happy Hour Options\r\n"
"%sP%s) Player Stat Options\r\n"
"%sQ%s) Quit\r\n"
"Enter your choice : ",
grn, nrm,
grn, nrm,
grn, nrm,
grn, nrm,
grn, nrm,
grn, nrm,
grn, nrm,
grn, nrm);
OLC_MODE(d) = CEDIT_MAIN_MENU;
}
static void cedit_disp_happy_hour_options(struct descriptor_data *d)
{
get_char_colors(d->character);
clear_screen(d);
write_to_output(d, "\r\n\r\n"
"AUTOMATED HAPPY HOUR SETTINGS\r\n"
"%s1%s) Chance to Occur Each RL Hour : %s%d\r\n"
"%s2%s) Percent Amount of Additional QP : %s%d\r\n"
"%s3%s) Percent Amount of Additional EXP : %s%d\r\n"
"%s4%s) Percent Amount of Additional Gold : %s%d\r\n"
"%s5%s) Increase Percent Chance of Random Treasure : %s%d\r\n"
"%sQ%s) Exit To The Main Menu\r\n"
"Enter your choice : ",
grn, nrm, cyn, OLC_CONFIG(d)->happy_hour.chance,
grn, nrm, cyn, OLC_CONFIG(d)->happy_hour.qp,
grn, nrm, cyn, OLC_CONFIG(d)->happy_hour.exp,
grn, nrm, cyn, OLC_CONFIG(d)->happy_hour.gold,
grn, nrm, cyn, OLC_CONFIG(d)->happy_hour.treasure,
grn, nrm);
OLC_MODE(d) = CEDIT_HAPPY_HOUR_MENU;
}
static void cedit_disp_player_options(struct descriptor_data *d)
{
get_char_colors(d->character);
clear_screen(d);
write_to_output(d, "\r\n\r\n"
"PLAYER OPTIONS\r\n"
"%s1%s) Psionic Power Damage Bonus : %s%s%d%%\r\n"
"%s2%s) Divine Spell Damage Bonus : %s%s%d%%\r\n"
"%s3%s) Arcane Spell Damage Bonus : %s%s%d%%\r\n"
"\r\n"
"%s4%s) Psionic Prep Time : %s%d%%\r\n"
"%s5%s) Divine Prep Time : %s%d%%\r\n"
"%s6%s) Arcane Prep Time : %s%d%%\r\n"
"%s7%s) Alchemy Prep Time : %s%d%%\r\n"
"\r\n"
"%s8%s) Extra Hit Points per Level : %s%d\r\n"
"%s9%s) Extra Movement Points per Level : %s%d\r\n"
"%sA%s) Armor Class Cap : %s%d\r\n"
"%sB%s) Player-Mob Level Difference to Gain Exp : %s%d\r\n"
"%sC%s) Death Experience Less Penalty : %s%d%%\r\n"
"\r\n"
"%sD%s) Level 1-10 Summon HP Percentage : %s%d%%\r\n"
"%sE%s) Level 1-10 Summon Hit & Dam Roll Percentage : %s%d%%\r\n"
"%sF%s) Level 1-10 Summon AC Percentage : %s%d%%\r\n"
"\r\n"
"%sG%s) Level 11-20 Summon HP Percentage : %s%d%%\r\n"
"%sH%s) Level 11-20 Summon Hit & Dam Roll Percentage : %s%d%%\r\n"
"%sI%s) Level 11-20 Summon AC Percentage : %s%d%%\r\n"
"\r\n"
"%sJ%s) Level 21-30 Summon HP Percentage : %s%d%%\r\n"
"%sK%s) Level 21-30 Summon Hit & Dam Roll Percentage : %s%d%%\r\n"
"%sL%s) Level 21-30 Summon AC Percentage : %s%d%%\r\n"
"\r\n"
"%sQ%s) Exit To The Main Menu\r\n"
"Enter your choice : ",
grn, nrm, cyn, (OLC_CONFIG(d)->player_config.psionic_power_damage_bonus > 0) ? "+" : "", OLC_CONFIG(d)->player_config.psionic_power_damage_bonus, // 1
grn, nrm, cyn, (OLC_CONFIG(d)->player_config.divine_spell_damage_bonus > 0) ? "+" : "", OLC_CONFIG(d)->player_config.divine_spell_damage_bonus, // 2
grn, nrm, cyn, (OLC_CONFIG(d)->player_config.arcane_spell_damage_bonus > 0) ? "+" : "", OLC_CONFIG(d)->player_config.arcane_spell_damage_bonus, // 3
grn, nrm, cyn, OLC_CONFIG(d)->player_config.psionic_mem_times, // 4
grn, nrm, cyn, OLC_CONFIG(d)->player_config.divine_mem_times, // 5
grn, nrm, cyn, OLC_CONFIG(d)->player_config.arcane_mem_times, // 6
grn, nrm, cyn, OLC_CONFIG(d)->player_config.alchemy_mem_times, // 7
grn, nrm, cyn, OLC_CONFIG(d)->player_config.extra_hp_per_level, // 8
grn, nrm, cyn, OLC_CONFIG(d)->player_config.extra_mv_per_level, // 9
grn, nrm, cyn, OLC_CONFIG(d)->player_config.armor_class_cap, // A
grn, nrm, cyn, OLC_CONFIG(d)->player_config.group_level_difference_restriction, // B
grn, nrm, cyn, OLC_CONFIG(d)->player_config.death_exp_loss_penalty, // C
grn, nrm, cyn, OLC_CONFIG(d)->player_config.level_1_10_summon_hp, // D
grn, nrm, cyn, OLC_CONFIG(d)->player_config.level_1_10_summon_hit_and_dam, // E
grn, nrm, cyn, OLC_CONFIG(d)->player_config.level_1_10_summon_ac, // F
grn, nrm, cyn, OLC_CONFIG(d)->player_config.level_11_20_summon_hp, // G
grn, nrm, cyn, OLC_CONFIG(d)->player_config.level_11_20_summon_hit_and_dam, // H
grn, nrm, cyn, OLC_CONFIG(d)->player_config.level_11_20_summon_ac, // I
grn, nrm, cyn, OLC_CONFIG(d)->player_config.level_21_30_summon_hp, // J
grn, nrm, cyn, OLC_CONFIG(d)->player_config.level_21_30_summon_hit_and_dam, // K
grn, nrm, cyn, OLC_CONFIG(d)->player_config.level_21_30_summon_ac, // L
grn, nrm);
OLC_MODE(d) = CEDIT_PLAYER_OPTIONS_MENU;
}
static void cedit_disp_game_play_options(struct descriptor_data *d)
{
int m_opt;
m_opt = OLC_CONFIG(d)->play.map_option;
get_char_colors(d->character);
clear_screen(d);
write_to_output(d, "\r\n\r\n"
"%sA%s) Player Killing Allowed : %s%s\r\n"
"%sB%s) Player Thieving Allowed : %s%s\r\n"
"%sC%s) Minimum Level To Shout : %s%d\r\n"
"%sD%s) Holler Move Cost : %s%d\r\n"
"%sE%s) Tunnel Size : %s%d\r\n"
"%sF%s) Maximum Experience Gain : %s%d\r\n"
"%sG%s) Maximum Experience Loss : %s%d\r\n"
"%sH%s) Max Time for NPC Corpse : %s%d\r\n"
"%sI%s) Max Time for PC Corpse : %s%d\r\n"
"%sJ%s) Tics before PC Sent to Void : %s%d\r\n"
"%sK%s) Tics before PC is Autosaved : %s%d\r\n"
"%sL%s) Level Immune To IDLE : %s%d\r\n"
"%sM%s) Death Traps Junk Items : %s%s\r\n"
"%sN%s) Objects Load Into Inventory : %s%s\r\n"
"%sO%s) Track Through Doors : %s%s\r\n"
"%sP%s) Display Closed Doors : %s%s\r\n"
"%sR%s) Diagonal Directions : %s%s\r\n"
"%sS%s) Prevent Mortal -> Staff Lvel : %s%s\r\n"
"%s1%s) OK Message Text : %s%s"
"%s2%s) NOPERSON Message Text : %s%s"
"%s3%s) NOEFFECT Message Text : %s%s"
"%s4%s) Map/Automap Option : %s%s\r\n"
"%s5%s) Default Map Size : %s%d\r\n"
"%s6%s) Default Minimap Size : %s%d\r\n"
"%s7%s) Scripts on PC's : %s%s\r\n"
"%s8%s) Min %% Pop. to Claim Zones : %s%3.2f\r\n"
"%sQ%s) Exit To The Main Menu\r\n"
"Enter your choice : ",
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.pk_allowed),
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.pt_allowed),
grn, nrm, cyn, OLC_CONFIG(d)->play.level_can_shout,
grn, nrm, cyn, OLC_CONFIG(d)->play.holler_move_cost,
grn, nrm, cyn, OLC_CONFIG(d)->play.tunnel_size,
grn, nrm, cyn, OLC_CONFIG(d)->play.max_exp_gain,
grn, nrm, cyn, OLC_CONFIG(d)->play.max_exp_loss,
grn, nrm, cyn, OLC_CONFIG(d)->play.max_npc_corpse_time,
grn, nrm, cyn, OLC_CONFIG(d)->play.max_pc_corpse_time,
grn, nrm, cyn, OLC_CONFIG(d)->play.idle_void,
grn, nrm, cyn, OLC_CONFIG(d)->play.idle_rent_time,
grn, nrm, cyn, OLC_CONFIG(d)->play.idle_max_level,
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.dts_are_dumps),
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.load_into_inventory),
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.track_through_doors),
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.disp_closed_doors),
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.diagonal_dirs),
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.no_mort_to_immort),
grn, nrm, cyn, OLC_CONFIG(d)->play.OK,
grn, nrm, cyn, OLC_CONFIG(d)->play.NOPERSON,
grn, nrm, cyn, OLC_CONFIG(d)->play.NOEFFECT,
grn, nrm, cyn, m_opt == 0 ? "Off" : (m_opt == 1 ? "On" : (m_opt == 2 ? "Imm-Only" : "Invalid!")),
grn, nrm, cyn, OLC_CONFIG(d)->play.map_size,
grn, nrm, cyn, OLC_CONFIG(d)->play.minimap_size,
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.script_players),
grn, nrm, cyn, OLC_CONFIG(d)->play.min_pop_to_claim,
grn, nrm);
OLC_MODE(d) = CEDIT_GAME_OPTIONS_MENU;
}
static void cedit_disp_crash_save_options(struct descriptor_data *d)
{
get_char_colors(d->character);
clear_screen(d);
write_to_output(d, "\r\n\r\n"
"%sA%s) Free Rent : %s%s\r\n"
"%sB%s) Max Objects Saved : %s%d\r\n"
"%sC%s) Minimum Rent Cost : %s%d\r\n"
"%sD%s) Auto Save : %s%s\r\n"
"%sE%s) Auto Save Time : %s%d minute(s)\r\n"
"%sF%s) Crash File Timeout : %s%d day(s)\r\n"
"%sG%s) Rent File Timeout : %s%d day(s)\r\n"
"%sQ%s) Exit To The Main Menu\r\n"
"Enter your choice : ",
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->csd.free_rent),
grn, nrm, cyn, OLC_CONFIG(d)->csd.max_obj_save,
grn, nrm, cyn, OLC_CONFIG(d)->csd.min_rent_cost,
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->csd.auto_save),
grn, nrm, cyn, OLC_CONFIG(d)->csd.autosave_time,
grn, nrm, cyn, OLC_CONFIG(d)->csd.crash_file_timeout,
grn, nrm, cyn, OLC_CONFIG(d)->csd.rent_file_timeout,
grn, nrm);
OLC_MODE(d) = CEDIT_CRASHSAVE_OPTIONS_MENU;
}
static void cedit_disp_room_numbers(struct descriptor_data *d)
{