forked from triem/Electric-Dreams
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmerc.h
3855 lines (3569 loc) · 102 KB
/
merc.h
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
/***************************************************************************
* Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer, *
* Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe. *
* *
* Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael *
* Chastain, Michael Quan, and Mitchell Tse. *
* *
* In order to use any part of this Merc Diku Mud, you must comply with *
* both the original Diku license in 'license.doc' as well the Merc *
* license in 'license.txt'. In particular, you may not remove either of *
* these copyright notices. *
* *
* Much time and thought has gone into this software and you are *
* benefitting. We hope that you share your changes too. What goes *
* around, comes around. *
***************************************************************************/
/*
* Accommodate old non-Ansi compilers.
*/
#if defined(TRADITIONAL)
#define const
#define args( list ) ( )
#define DECLARE_DO_FUN( fun ) void fun( )
#define DECLARE_ROOM_FUN( fun ) void fun( )
#define DECLARE_OBJ_FUN( fun ) void fun( )
#define DECLARE_SPEC_FUN( fun ) bool fun( )
#define DECLARE_OBJ_SPEC_FUN( fun ) bool fun( )
#define DECLARE_SPELL_FUN( fun ) void fun( )
#else
#define args( list ) list
#define DECLARE_DO_FUN( fun ) DO_FUN fun
#define DECLARE_ROOM_FUN( fun ) ROOM_FUN fun
#define DECLARE_OBJ_FUN( fun ) OBJ_FUN fun
#define DECLARE_SPEC_FUN( fun ) SPEC_FUN fun
#define DECLARE_OBJ_SPEC_FUN( fun ) OBJ_SPEC_FUN fun
#define DECLARE_SPELL_FUN( fun ) SPELL_FUN fun
#endif
/* system calls */
int unlink();
int system();
/*
* Short scalar types.
* Diavolo reports AIX compiler has bugs with short types.
*/
#if !defined(FALSE)
#define FALSE 0
#endif
#if !defined(TRUE)
#define TRUE 1
#endif
#if defined(_AIX)
#if !defined(const)
#define const
#endif
typedef int sh_int;
typedef int bool;
#define unix
#else
typedef short int sh_int;
// Didn't need this, already defined in c++: typedef unsigned char bool;
#endif
/*
* Structure types.
*/
typedef struct message_buf MESSAGE_BUF; /* Message Ques */
typedef struct editing_data EDITING_DATA; /* OLC */
typedef struct affect_data AFFECT_DATA;
typedef struct area_data AREA_DATA;
typedef struct world_data WORLD_DATA;
typedef struct ban_data BAN_DATA;
typedef struct buf_type BUFFER;
typedef struct bhost_list BHOST_LIST;
typedef struct track_type TRACK_TYPE;
typedef struct bet_type BET_DATA;
typedef struct horse_race_type HORSE_RACE_TYPE;
typedef struct topic_data TOPIC_DATA;
typedef struct group_data GROUP_DATA;
typedef struct char_data CHAR_DATA;
typedef struct clan_type CLAN_DATA;
typedef struct pc_clan_data PC_CLAN_DATA;
typedef struct top_ten_type TOP_TEN_DATA;
typedef struct descriptor_data DESCRIPTOR_DATA;
typedef struct snoop_list SNOOP_LIST;
typedef struct room_snoop_list ROOM_SNOOP_LIST;
typedef struct exit_data EXIT_DATA;
typedef struct lock_data LOCK_DATA;
typedef struct extra_descr_data EXTRA_DESCR_DATA;
typedef struct help_data HELP_DATA;
typedef struct room_list_struct BFS_ROOM;
typedef struct bfs_queue_struct BFS_QUEUE;
typedef struct gainer_type GAINER_DATA;
typedef struct moveable MOVEABLE_DATA;
typedef struct logon_data LOGON_DATA;
typedef struct global_random_data GLOBAL_RANDOM_DATA;
typedef struct wizlist_data WIZLIST_DATA;
typedef struct finger_data FINGER_DATA;
typedef struct kill_data KILL_DATA;
typedef struct mob_index_data MOB_INDEX_DATA;
typedef struct note_data NOTE_DATA;
typedef struct read_notes READ_NOTES;
typedef struct spell_list SPELL_LIST;
typedef struct magic_data MAGIC_DATA;
typedef struct wear_data WEAR_DATA;
typedef struct equip_data EQUIP_DATA;
typedef struct inside_data INSIDE_DATA;
typedef struct edible_data EDIBLE_DATA;
typedef struct light_data LIGHT_DATA;
typedef struct approve_data APPROVE_DATA;
typedef struct gate_data GATE_DATA;
typedef struct cont_data CONT_DATA;
typedef struct trap_data TRAP_DATA;
typedef struct track_data TRACK_DATA;
typedef struct weapon_data WEAPON_DATA;
typedef struct inside_area INSIDE_AREA_DATA;
typedef struct obj_data OBJ_DATA;
typedef struct obj_index_data OBJ_INDEX_DATA;
typedef struct pc_data PC_DATA;
typedef struct card_type CARD_DATA;
typedef struct debt_data DEBT_DATA;
typedef struct reset_data RESET_DATA;
typedef struct event_data EVENT_DATA;
typedef struct quest_data QUEST_DATA;
typedef struct char_quests CHAR_QUESTS;
typedef struct room_index_data ROOM_INDEX_DATA;
typedef struct shop_data SHOP_DATA;
typedef struct time_info_data TIME_INFO_DATA;
typedef struct weather_data WEATHER_DATA;
typedef struct specpro_data SPECPRO_DATA;
typedef struct specpro_list SPECPRO_LIST;
typedef struct script_data SCRIPT_DATA; /* scripts */
typedef struct trigger_data TRIGGER_DATA; /* scripts */
typedef struct trigger_list_data TRIGGER_LIST_DATA; /* scripts */
typedef struct trigger_index_data TRIGGER_INDEX_DATA; /* scripts */
typedef struct variable_data VARIABLE_DATA; /* scripts */
typedef struct skill_list SKILL_LIST; /* mobiles */
typedef struct castle_data CASTLE_DATA; /* castle code */
typedef struct change_data CHANGE_DATA;
/*
* Function types.
*/
typedef void DO_FUN args( ( CHAR_DATA *ch, char *argument ) );
typedef void ROOM_FUN args( ( ROOM_INDEX_DATA * pRoom, char * argument ) );
typedef void OBJ_FUN args( ( OBJ_DATA * obj, char * argument ) );
typedef bool SPEC_FUN args( ( CHAR_DATA *ch ) );
typedef bool OBJ_SPEC_FUN args( ( OBJ_DATA *obj ) );
typedef void SPELL_FUN args( ( int sn, int level, CHAR_DATA *ch, void *vo ) );
/*
* String and memory management parameters.
*/
#define MAX_VNUM 80000
#define MAX_KEY_HASH 1024
#define MAX_STRING_LENGTH 4096
#define MAX_INPUT_LENGTH 4000
#define PAGELEN 22
#define MAX_BUF_LIST 14
#define MAX_BUF 262144
#define BUF_STRING 256
#define BASE_BUF 1024
#define MAX_COLORS 11
#define MAX_COLORS_LIST 16
#define MAX_MOOD 8
#define MAX_LOGON 5000
#define CONVERSION 0
#define LOGON_ON 1
#define MAGIC_NUM 52571214
#define BUFSIZE 256
extern long autosave_system;
extern long changed_system;
#define AUTOSAVE_HELPS A
#define AUTOSAVE_SOCIALS B
#define AUTOSAVE_CLANS E
#define AUTOSAVE_TRIGGERS F
#define AUTOSAVE_RACES G
#define AUTOSAVE_GUILDS H
#define AUTOSAVE_LOGONS I
#define AUTOSAVE_QUESTS J
#define AUTOSAVE_RANDOM K
#define CHANGED_HELPS A
#define CHANGED_SOCIALS B
#define CHANGED_TRIGGERS E
#define CHANGED_CLANS F
#define CHANGED_RACES G
#define CHANGED_GUILDS H
#define CHANGED_LOGONS I
#define CHANGED_QUESTS J
#define CHANGED_RANDOM K
extern int per_cpu_usage[];
/*
* Game parameters.
* Increase the max'es if you add more of something.
* Adjust the pulse numbers to suit yourself.
*/
#define MAX_SPECPRO 37
#define MAX_TOKENS 1500
#define MAX_TOKENS_2 35
#define MAX_GREETING 4
#define MAX_SOCIALS 512
#define MAX_SKILL 247
#define MAX_MINERAL 16
#define MAX_ELEMENT_TYPE 5
#define MAX_ELEMENT_POWER 3
#define MAX_WEAPON_TYPE 9
#define MAX_WEAPON_POWER 3
#define MAX_LANGUAGE 11
#define MAX_WORLD 4
#define MAX_RACE 30
#define MAX_HORSE 20
#define MAX_BET 50000
#define MAX_HORSE_RACE 3
#define MAX_LEVEL 60
#define MAX_DAMAGE_MESSAGE 35
#define MAX_DAMAGE_TYPE 34
#define SEND_INVITATION FALSE
#define MAX_COND 3
#define COST_HOUSE 5000000
#define LEVEL_HERO (MAX_LEVEL - 10)
#define LEVEL_IMMORTAL (MAX_LEVEL - 5)
#define MAX_OPTIWIZ 3
#define MAX_GROUP 21
#define MAX_IN_GROUP 30
#define MAX_SCAN_ITEMS 5
#define MAX_GAIN_STATS 5
#define PULSE_PER_SECOND 4
#define PULSE_VIOLENCE ( 4 * PULSE_PER_SECOND)
#define PULSE_MOBILE 1
#define PULSE_MESSAGE_QUE ( 2 * PULSE_PER_SECOND)
#define PULSE_OBJ_TRIGGER ( 4 * PULSE_PER_SECOND)
#define PULSE_ROOMS ( 3 * PULSE_PER_SECOND)
#define PULSE_CHAR_DREAM_UPDATE ( 4 * PULSE_PER_SECOND)
#define PULSE_CHAR_FORGE_UPDATE ( 4 * PULSE_PER_SECOND)
#define PULSE_TICK (30 * PULSE_PER_SECOND)
#define PULSE_REGEN (5 * PULSE_PER_SECOND)
#define PULSE_TRIGGER (35 * PULSE_PER_SECOND)
#define PULSE_RACE ( 8 * PULSE_PER_SECOND)
#define PULSE_AREA (60 * PULSE_PER_SECOND)
#define PULSE_SAVE_AREA (70 * PULSE_PER_SECOND)
#define PULSE_SAVE_LOGON (50 * PULSE_PER_SECOND)
#define PULSE_SAVE_RANDOM (75 * PULSE_PER_SECOND)
#define PULSE_SAVE_QUESTS (80 * PULSE_PER_SECOND)
#define PULSE_SAVE_WIZLIST (45 * PULSE_PER_SECOND)
#define PULSE_CHECK_OBJ ( 5 * PULSE_PER_SECOND)
#define PULSE_REBOOT ( 5 * PULSE_PER_SECOND)
#define IMPLEMENTOR MAX_LEVEL
#define CREATOR (MAX_LEVEL - 1)
#define SUPREME (MAX_LEVEL - 2)
#define DEITY (MAX_LEVEL - 3)
#define GOD (MAX_LEVEL - 4)
#define IMMORTAL (MAX_LEVEL - 5)
#define DEMI (MAX_LEVEL - 6)
#define ANGEL (MAX_LEVEL - 7)
#define AVATAR (MAX_LEVEL - 8)
#define HERO LEVEL_HERO
#define LEVEL_SCRIPT (MAX_LEVEL-1) /* for scripts */
#define LEVEL_BUILDER (MAX_LEVEL - 5) /* scripts */
#define ED_JAIL_HOUSE 18002
/*
* Trigger types for repetitive loops, command etc. for scripts
*/
#define TRIG_COMMAND 0 /* When a player types x command */
#define TRIG_EACH_PULSE 1 /* Increments every pulse */
#define TRIG_COMBAT 2 /* Every combat pulse */
#define TRIG_TICK_PULSE 3 /* Every tick (one mud-hour) */
#define TRIG_BORN 4 /* Happens upon creation */
#define TRIG_GETS 5 /* Happens when a mob gets/is given */
#define TRIG_SAY 6 /* Happens when a mob sees a string */
#define TRIG_TELL 7 /* Happens when a mob sees a string */
#define TRIG_KILLS_PLAYER 8 /* Happens when a mob kills a player */
#define TRIG_DIES 9 /* Happens when the mob is killed */
#define TRIG_ENTER 10 /* Happens on arrival (for each person) */
#define TRIG_MOVES 11 /* Happens whenever a mobile moves */
#define TRIG_KILLS_MOB 12 /* Happens whenever a mobile kills a mob */
#define TRIG_LEAVES 13 /* Happens whenever a leaves */
#define TRIG_LOOK 14 /* Happens whenever a looks */
#define TRIG_WEAR 15 /* Happens someone wears an item */
#define TRIG_GIVE 16 /* Happens someone gives an item */
#define TRIG_DROP 17 /* Happens someone drops an item */
#define TRIG_WIELD 18 /* Happens someone wields an item */
#define TRIG_TROOM 19 /* room techo to mob */
#define TRIG_DOOR_OPEN 20 /* a door is opened */
#define TRIG_GAINS 21 /* Happens when a player gains a skill */
#define MAX_TRIG_TYPE 22
#define TRIG_TYPE_MOB 0 /* Script is for Mobiles */
#define TRIG_TYPE_ROOM 1 /* Script is for Rooms */
#define TRIG_TYPE_OBJ 2 /* Script is for Objects */
/*
* BFS return values.
*/
#define BFS_ERROR -1
#define BFS_ALREADY_THERE -2
#define BFS_NO_PATH -3
#define ELEMENT_FIRE 0
#define ELEMENT_WATER 1
#define ELEMENT_EARTH 2
#define ELEMENT_WIND 3
#define ELEMENT_SPIRIT 4
#define MINERAL_STEEL 0
#define MINERAL_COPPER 1
#define MINERAL_IRON 2
#define MINERAL_SILVER 3
#define MINERAL_GOLD 4
#define MINERAL_RUBY 5
#define MINERAL_SAPPHIRE 6
#define MINERAL_EMERALD 7
#define MINERAL_BRONZE 8
#define MINERAL_ADAMANTITE 9
#define MINERAL_TITANIUM 10
#define MINERAL_ALABASTER 11
#define MINERAL_MITHRIL 12
#define MINERAL_OBSIDIAN 13
#define MINERAL_PLATINUM 14
#define MINERAL_DIAMOND 15
/*
* Internally used bits for triggers. for scripts
*/
#define SCRIPT_ADVANCE (A) /* Its OK to go to next command set */
#define SCRIPT_HALT (B) /* current=NULL & disallow trig */
#define SCRIPT_PATH (C) /* Path done */
/* And some externaly used bits for triggers */
#define TRIG_MOB (D) /* Trigger will act from a mob */
#define TRIG_PC (E) /* Trigger will act from a pc */
#define SCRIPT_HALT_RESET (F) /* current=NULL Until Reset */
#define TRIG_INACTIVE (G) /* Trig will not run till set to active */
#define TRIG_INSTANT (H) /* Trig runs NOW! */
#define BUFFER_SAFE 0
#define BUFFER_OVERFLOW 1
#define BUFFER_FREED 2
/*
* RACE INFO
*/
#define ATTACK_NORMAL 0
#define ATTACK_BITE 1
/*
* Un colour type.
*/
struct color_data
{
char code[10];
char act_code[8];
char name[15];
int number;
};
/*
* Site ban structure.
*/
struct ban_data
{
BAN_DATA * next;
char name[31];
};
struct buf_type
{
BUFFER * next;
bool valid;
sh_int state; /* error state of the buffer */
long size; /* size in k */
char * string; /* buffer's string rev */
};
struct bhost_list
{
BHOST_LIST * next;
char host[16];
long time;
};
struct track_type
{
TRACK_TYPE * last;
TRACK_TYPE * next;
int dir;
ROOM_INDEX_DATA * room;
};
struct horse_type
{
char name[31];
sh_int number;
sh_int odds;
sh_int curr_odds;
sh_int position;
bool racing;
};
struct horse_race_type
{
struct horse_type horse[MAX_HORSE];
BET_DATA * bets;
sh_int timer;
BET_DATA * pay_offs;
long in_room;
};
struct bet_type
{
CHAR_DATA * ch;
long amount;
sh_int coin_type;
sh_int horse;
sh_int odds;
BET_DATA * next;
};
struct skill_list
{
SKILL_LIST * next;
int sn;
};
/*
* castle code
*/
struct castle_data
{
CASTLE_DATA * next;
char owner[30];
long castle;
long barracks;
long barracks2;
long library;
long library2;
long smithy;
long smithy2;
long magic_shop;
long armory;
long grainery;
long inn;
long inn2;
long bank;
long track;
};
/*
* Quests for player data
*/
struct char_quests
{
CHAR_QUESTS * next;
sh_int quest_number;
long flags;
};
/*
* for scripts
*/
struct trigger_index_data
{
TRIGGER_INDEX_DATA * next;
SCRIPT_DATA * script;
sh_int trigger_type;
long bits;
char keywords[31];
char key_sim[31];
char key_words[31];
char key_string[31];
char name[31];
char desc[81];
sh_int security;
sh_int chance;
char builders[31];
sh_int script_type;
sh_int vnum;
long gets_vnum;
long mob_vnum;
long flags;
long step;
long step_pre;
sh_int quests;
sh_int quests_pre;
sh_int timer;
};
/*
* for scripts
*/
struct trigger_list_data
{
TRIGGER_LIST_DATA * next;
sh_int vnum;
};
/*
* for scripts
*/
struct trigger_data
{
TRIGGER_DATA * next;
TRIGGER_DATA * next_in_list;
SCRIPT_DATA * script;
SCRIPT_DATA * current;
AREA_DATA * area;
sh_int tracer;
sh_int timer;
long activated;
long attempts;
sh_int waiting;
sh_int trigger_type;
long bits;
char keywords[31];
char key_sim[31];
char key_words[31];
char key_string[31];
char name[31];
sh_int vnum;
long gets_vnum;
long mob_vnum;
long flags;
long step;
long step_pre;
sh_int quests;
sh_int quests_pre;
};
/*
* for scripts
*/
struct script_data
{
SCRIPT_DATA * next;
char * command;
};
/*
* for scripts
*/
struct variable_data
{
VARIABLE_DATA * next;
char name[81];
char value[81];
};
/*
* Time and weather stuff.
*/
#define SUN_DARK 0
#define SUN_RISE 1
#define SUN_LIGHT 2
#define SUN_SET 3
#define SKY_CLOUDLESS 0
#define SKY_CLOUDY 1
#define SKY_RAINING 2
#define SKY_LIGHTNING 3
#define SKY_SNOWING 4
#define SKY_BLIZZARD 5
#define SKY_RAINING_WINDY 6
#define SKY_HURICANE 7
#define SKY_WINDY 8
#define SKY_TORNADO 9
#define SKY_WINDY_2 10
#define SKY_SANDSTORM 11
#define MAX_SKY 12
struct time_table_type
{
int sunrise;
char * sunrise_dir;
int sunset;
char * sunset_dir;
int hours_day;
int days_week;
int days_month;
int months_year;
};
struct time_info_data
{
int hour;
int day;
int month;
int year;
};
#define MAX_SEASON 4
struct weather_data
{
WEATHER_DATA * next;
/* the month that each season occurs on */
sh_int spring;
sh_int summer;
sh_int fall;
sh_int winter;
sh_int season;
/* the probability of each weather type happening during each season */
/* ie 25, 50, 75, 100 */
sh_int chance[ MAX_SEASON ][ 4 ];
sh_int storm_type[ MAX_SEASON ];
sh_int speed;
int mmhg;
int change;
int sky;
int sunlight;
};
/*
* Connected state for a channel.
*/
#define CON_AEDITOR -1
#define CON_REDITOR -2
#define CON_MEDITOR -3
#define CON_OEDITOR -4
#define CON_HEDITOR -5
#define CON_SEDITOR -6
#define CON_RAEDITOR -7
#define CON_MAEDITOR -8
#define CON_EDITING -9
#define CON_TEDITOR -10
#define CON_PEDITOR -11
#define CON_GEDITOR -12
#define CON_PLAYING 0
#define CON_COPYOVER_RECOVER -15
#define CON_GET_NAME 1
#define CON_GET_OLD_PASSWORD 2
#define CON_CONFIRM_NEW_NAME 3
#define CON_GET_NEW_PASSWORD 4
#define CON_CONFIRM_NEW_PASSWORD 5
#define CON_GET_NEW_RACE 6
#define CON_GET_NEW_SEX 7
#define CON_DEFAULT_CHOICE 10
#define CON_GET_NEW_GUILDS 11
#define CON_CHOOSE_CREATION 12
#define CON_READ_IMOTD 13
#define CON_READ_MOTD 14
#define CON_BREAK_CONNECT 15
#define CON_DEFAULT_COLOR 16
#define CON_ROLL_STATS 17
#define CON_AFT_LOGIN 100
#define CON_DEAD 101
#define CON_DO_GREETING 103
#define MAX_HISTORY 10
struct snoop_list
{
DESCRIPTOR_DATA * desc;
SNOOP_LIST * next;
};
/*
* Descriptor (channel) structure.
*/
struct descriptor_data
{
DESCRIPTOR_DATA * next;
SNOOP_LIST * snoop_by;
CHAR_DATA * character;
CHAR_DATA * original;
char host[16];
char * host_save;
sh_int descriptor;
sh_int connected;
bool fcommand;
char inbuf [8 * MAX_INPUT_LENGTH];
char incomm [MAX_INPUT_LENGTH];
char * inlast[MAX_HISTORY];
int repeat;
char * outbuf;
long outsize;
long outtop;
char * showstr_head;
char * showstr_point;
EDITING_DATA * editing; /* OLC */
void * pEdit; /* OLC */
char ** pString; /* OLC */
bool color; /* for beginning screen */
char alias_point [MAX_INPUT_LENGTH];
char alias_arg [MAX_INPUT_LENGTH];
};
/*
* Attribute bonus structures.
*/
struct str_app_type
{
sh_int tohit;
sh_int todam;
sh_int carry;
sh_int wield;
};
struct int_app_type
{
sh_int learn;
};
struct wis_app_type
{
sh_int practice;
};
struct chr_app_type
{
sh_int haggle;
};
struct dex_app_type
{
sh_int defensive;
};
struct con_app_type
{
sh_int hitp;
sh_int shock;
};
/*
* TO types for act.
*/
#define TO_ROOM 0
#define TO_NOTVICT 1
#define TO_VICT 2
#define TO_CHAR 3
#define TO_WORLD 4
struct bfs_queue_struct
{
ROOM_INDEX_DATA *room;
sh_int dir;
sh_int depth;
BFS_QUEUE *next;
};
struct room_list_struct
{
ROOM_INDEX_DATA *room;
BFS_ROOM *next;
};
/*
* Help table types.
*/
struct help_data
{
HELP_DATA * next;
sh_int level;
char keyword[51];
char * text;
int vnum;
int type;
};
/*
* Shop types.
*/
#define MAX_TRADE 5
struct shop_data
{
SHOP_DATA * next; /* Next shop in list */
AREA_DATA * load_with_area;
long keeper; /* Vnum of shop keeper mob */
sh_int type; /* Shop Type */
sh_int profit_buy; /* Cost multiplier for buying */
sh_int profit_sell; /* Cost multiplier for selling */
sh_int open_hour; /* First opening hour */
sh_int close_hour; /* First closing hour */
/* Added by Trice for POS (Player Ownable Shops) */
/* char * owner; Shop owners name if ownable
bool ownable; Is the shop buyable */
};
/*
* Per-class stuff.
*/
#define MAX_GUILD 12
#define MAX_STATS 6
#define MAX_AGE 195
#define STAT_STR 0
#define STAT_INT 1
#define STAT_WIS 2
#define STAT_DEX 3
#define STAT_CON 4
#define STAT_CHR 5
struct attack_type
{
char * name; /* name and message */
int damage; /* damage class */
};
struct mood_type
{
char * mood; /* name and message mood */
int type; /* type of mood */
};
struct exp_type
{
int level; /* Level for exp */
long exp_at_level; /* Amount of exp total to level */
long exp_for_mob; /* Amount base of exp for mob */
};
struct exp_type_old /* once all char are past version 9 remove this */
{
int level; /* Level for exp */
long exp_at_level; /* Amount of exp total to level */
long exp_for_mob; /* Amount base of exp for mob */
};
struct top_ten_type
{
char saying[81];
char name[31];
int value;
};
struct clan_type
{
CLAN_DATA * next;
char name[31];
char title[81];
CHAR_DATA * leader;
char leader_name[31];
CHAR_DATA * sponser;
char sponser_name[31];
long treasury;
long clan_info;
long recall_room;
long donate_room;
char rank1[31];
char rank2[31];
char rank3[31];
char rank4[31];
char rank5[31];
char rank6[31];
char rank7[31];
char rank8[31];
char rank9[31];
char rank10[31];
};
struct pc_clan_data
{
PC_CLAN_DATA * next;
CLAN_DATA * clan;
sh_int clanrank;
};
#define RACE_CHANGED (A)
struct race_list_type
{
char filename[21];
char name[16];
char builders[31];
sh_int security;
long race_flags;
};
struct race_type
{
char name[16]; /* call name of the race */
bool pc_race; /* can be chosen by pcs */
sh_int world; /* World number */
sh_int size;
sh_int dam_type;
long act; /* act bits for the race */
long act2; /* act2 bits for the race */
long aff; /* aff bits for the race */
long aff2; /* aff2 bits for the race */
long off; /* off bits for the race */
long imm; /* imm bits for the race */
long res; /* res bits for the race */
long vuln; /* vuln bits for the race */
long form; /* default form flag for the race */
sh_int language;
char who_name[6];
sh_int scan_dist; /* Scanning distance */
sh_int stats[MAX_STATS]; /* starting stats */
sh_int max_stats[MAX_STATS]; /* maximum stats */
long weapon; /* First weapon */
long map;
sh_int gold; /* Amount of gold per level ( average ) */
sh_int start_age; /* Starting Age */
sh_int year_per_hour; /* Year of age per hour played */
sh_int thac0_00; /* Thac0 for level 0 */
sh_int thac0_32; /* Thac0 for level 32 */
sh_int hp_mult;
sh_int dam_dice;
sh_int dam_die;
sh_int dam_bonus;
sh_int ac_dice[4];
sh_int ac_die[4];
sh_int ac_bonus[4];
sh_int mana_dice[MAX_ELEMENT_TYPE];
sh_int mana_die[MAX_ELEMENT_TYPE];
sh_int mana_bonus[MAX_ELEMENT_TYPE];
sh_int age_stats[40][MAX_STATS];
sh_int max_condition[MAX_COND];
sh_int condition_rate[MAX_COND];
sh_int skill_level[MAX_SKILL];
sh_int rating[MAX_SKILL];
sh_int adept[MAX_SKILL];
sh_int starting[MAX_SKILL];
bool gained[MAX_SKILL];
long begin;
long die;
long donate;
};
#define GUILD_CHANGED (A)
struct guild_type
{
char name[31];
char filename[31];
char title[31];
char builders[31];
long flag;
sh_int security;
long guild_flags;
sh_int rating[MAX_GROUP];
};
#define NOTE_NO_DELETE 1
#define NOTE_RECIEPT 2
/*
* Data structure for notes.
*/
struct note_data
{
NOTE_DATA * next;
char sender[31];
char date[31];
char to_list[81];
char subject[31];
char * text;
time_t date_stamp;
char read_list[81];
long flags;
};
// Data structure for changes.
struct change_data
{
CHANGE_DATA *next;
int vnum;
char author[31];
time_t date_stamp;
int security;
char *text;
};
/*
* For bit type in affect_data
*/
/*
Why not just do a
typedef enum
{BIT_AFFECT = 1,BIT_VULN,BIT_RES,BIT,AFFECT2,BIT_IMM} b_affect;
This would make it easier to add bits, less typeing. let the
code do the numbering for us.
Sounds good to me.. Just not sure how to do it :)
Wana show me? G
*/
#define BIT_AFFECT 1
#define BIT_VULN 2
#define BIT_RES 3
#define BIT_AFFECT2 4
#define BIT_IMM 5
/*
* An affect.
*/
struct affect_data
{
AFFECT_DATA * next;
sh_int type;