-
Notifications
You must be signed in to change notification settings - Fork 0
/
remort.c
481 lines (416 loc) · 15.1 KB
/
remort.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
/***************************************************************************
* 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. *
**************************************************************************/
/***************************************************************************
* ROM 2.4 is copyright 1993-1996 Russ Taylor *
* ROM has been brought to you by the ROM consortium *
* Russ Taylor (rtaylor@pacinfo.com) *
* Gabrielle Taylor (gtaylor@pacinfo.com) *
* Brian Moore (rom@rom.efn.org) *
* By using this code, you have agreed to follow the terms of the *
* ROM license, in the file Rom24/doc/rom.license *
***************************************************************************/
#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#include <sys/time.h>
#endif
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include "merc.h"
void do_remort_engine args(( CHAR_DATA *ch, bool IsRemort));
void do_vampire_engine args(( CHAR_DATA *ch, bool IsRemort ));
void do_remor( CHAR_DATA *ch, char *argument )
{
send_to_char( "If you want to REMORT, you must spell it out.\n\r", ch );
return;
}
void do_remort( CHAR_DATA *ch, char *argument )
{
extern bool betalock;
char buf[MAX_INPUT_LENGTH];
if (betalock)
{
send_to_char("The game is Betalocked.\n\rYou may not remort in this mode.\n\r", ch);
return;
}
if ( IS_NPC(ch) || (ch->desc == NULL) )
return;
if ( ch->level < 100 && !IS_REMORT(ch) )
{
send_to_char( "You must be level 100 to remort.\n\r", ch );
return;
}
if (ch->level >= 400 && IS_REMORT(ch) )
{
send_to_char("You are eligible for second tier remort races.", ch);
}
if ( ch->pcdata->confirm_remort )
{
if (argument[0] != '\0')
{
send_to_char( "Remort status removed.\n\r", ch );
ch->pcdata->confirm_remort = FALSE;
return;
}
else
{
do_remort_engine( ch, TRUE );
return;
}
}
if ( argument[0] != '\0' )
{
send_to_char( "Just type remort. No argument.\n\r", ch );
return;
}
send_to_char("Type remort again to confirm this command.\n\r", ch );
send_to_char("{rWARNING:{w This command is irreversible.\n\r", ch );
send_to_char("Typing remort with an argument will undo remort status.\n\r", ch );
ch->pcdata->confirm_remort = TRUE;
sprintf(buf, "%s is contemplating remorting.", ch->name );
wiznet( buf,NULL,NULL,0,0,get_trust(ch));
log_string( buf );
return;
}
void do_remort_engine( CHAR_DATA *ch, bool IsRemort )
{
DESCRIPTOR_DATA *d;
char strsave[MAX_INPUT_LENGTH], player_name[MAX_INPUT_LENGTH];
char player_pwd[MAX_STRING_LENGTH];
int player_incarnations;
int player_hours;
int player_bank;
int player_jedi;
int player_remort2;
extern bool betalock;
char buf[MAX_INPUT_LENGTH];
if (betalock)
{
send_to_char("The game is Betalocked.\n\rYou may not remort in this mode.\n\r", ch);
return;
}
/*
* Get ready to delete the pfile, send a nice informational message.
*/
d = ch->desc;
if ( IsRemort )
{
sprintf( strsave, "%s%s", PLAYER_DIR, capitalize( ch->name ) );
stop_fighting( ch, TRUE );
send_to_char( "You have chosen to remort. You will now be dropped in at the race\n\r", ch );
send_to_char( "selection section of character creation, and will be allowed to choose from\n\r", ch );
send_to_char( "a wider selection of races and classes.\n\r\n\r", ch );
send_to_char( "In the unlikely event that you are disconnected or the MUD\n\r", ch );
send_to_char( "crashes while you are creating your character, create a new character\n\r", ch );
send_to_char( "as normal and write a note to 'immortal'.\n\r", ch );
send_to_char( "\n\r[Hit Enter to Continue]\n\r", ch );
sprintf( buf, "%s has remorted.", ch->name );
wiznet( buf, NULL, NULL, 0, 0, 0 );
log_string( buf );
do_mudwatch_out( ch );
/*
* I quote:
* "After extract_char the ch is no longer valid!"
*/
sprintf( player_name, "%s", ch->name );
sprintf( player_pwd, "%s", ch->pcdata->pwd );
player_bank = ++ch->bank;
player_incarnations = ++ch->pcdata->incarnations;
player_jedi = ch->pcdata->jedi; //Jedi Grayson 24 June 2004
if ( ch->perm_played < ch->played )
player_hours = ++ch->played;
else
player_hours = ++ch->perm_played;
if (ch->level >= 400 && IS_REMORT(ch) )
{
player_remort2 = 1;
}
else player_remort2 = 0;
extract_char( ch, TRUE );
/*
* Delete the pfile, but don't boot the character.
* Instead, do a load_char_obj to get a new ch,
* saving the password, and the incarnations. Then,
* set the PLR_REMORT bit and drop the player in at
* CON_BEGIN_REMORT.
*/
unlink( strsave );
load_char_obj( d, player_name );
d->character->pcdata->pwd = str_dup( player_pwd );
d->character->pcdata->incarnations = player_incarnations;
d->character->played = 0;
d->character->perm_played = player_hours;
d->character->bank = player_bank;
d->character->pcdata->jedi = player_jedi; //Jedi Grayson 24 June 2004
if( !IS_SET( ch->act, PLR_REMORT ) )
SET_BIT( ch->act, PLR_REMORT );
if (player_remort2 && !IS_SET(ch->act, PLR_REMORT2) )
SET_BIT(ch->act, PLR_REMORT2);
d->connected = CON_BEGIN_REMORT;
return;
}
else
{
sprintf( strsave, "%s%s", PLAYER_DIR, capitalize( ch->name ) );
stop_fighting( ch, TRUE );
send_to_char( "You will now be dropped in at the race selection section of character creation.\n\r", ch );
send_to_char( "In the unlikely event that you are disconnected or the MUD\n\r", ch );
send_to_char( "crashes while you are creating your character, create a new character\n\r", ch );
send_to_char( "as normal and write a note to 'immortal'.\n\r", ch );
send_to_char( "\n\r[Hit Enter to Continue]\n\r", ch );
sprintf( buf, "%s has been recreated.", ch->name );
wiznet( buf, NULL, NULL, 0, 0, 0 );
log_string( buf );
do_mudwatch_out( ch );
/*
* I quote:
* "After extract_char the ch is no longer valid!"
*/
sprintf( player_name, "%s", ch->name );
sprintf( player_pwd, "%s", ch->pcdata->pwd );
if ( ch->perm_played < ch->played )
player_hours = ++ch->played;
else
player_hours = ++ch->perm_played;
extract_char( ch, TRUE );
/*
* Delete the pfile, but don't boot the character.
* Instead, do a load_char_obj to get a new ch,
* saving the password, and the incarnations. Then,
* drop the player in at CON_BEGIN_REMORT.
*/
unlink( strsave );
load_char_obj( d, player_name );
d->character->pcdata->pwd = str_dup( player_pwd );
d->character->played = 0;
d->character->perm_played = player_hours;
d->connected = CON_BEGIN_REMORT;
return;
}
return;
}
//Grayson Vampire 28 June 2004
void do_reject_vampire (CHAR_DATA *ch, char *argument )
{
send_to_char( "Vampire status removed.\n\r", ch );
ch->pcdata->confirm_vampire = FALSE;
return;
}
void do_accept_vampire( CHAR_DATA *ch, char *argument )
{
extern bool betalock;
char buf[MAX_INPUT_LENGTH];
if (betalock)
{
send_to_char("The game is Betalocked.\n\rYou may not become a vampire in this mode.\n\r", ch);
return;
}
if ( IS_NPC(ch) || (ch->desc == NULL) )
return;
if ( ch->level < 100 && !IS_REMORT(ch) )
{
send_to_char( "You must be level 100 to become a vampire.\n\r", ch );
return;
}
if ( ch->pcdata->confirm_vampire )
{
if (argument[0] != '\0')
{
send_to_char( "Vampire status removed.\n\r", ch );
ch->pcdata->confirm_vampire = FALSE;
return;
}
else
{
do_vampire_engine( ch, TRUE );
return;
}
}
/*
if ( argument[0] != '\0' )
{
send_to_char( "Just type accept. No argument.\n\r", ch );
return;
}
*/
/*
send_to_char("Type accept again to confirm this command.\n\r", ch );
send_to_char("{rWARNING:{w This command is irreversible.\n\r", ch );
send_to_char("Typing accept with an argument will undo vampire status.\n\r", ch );
ch->pcdata->confirm_remort = TRUE;
*/
sprintf(buf, "%s is contemplating becoming a vampire.", ch->name );
wiznet( buf,NULL,NULL,0,0,get_trust(ch));
log_string( buf );
return;
}
void do_vampire_engine( CHAR_DATA *ch, bool IsRemort )
{
DESCRIPTOR_DATA *d;
char strsave[MAX_INPUT_LENGTH], player_name[MAX_INPUT_LENGTH];
char player_pwd[MAX_STRING_LENGTH];
int player_incarnations;
int player_hours;
int player_bank;
int player_jedi;
int player_remort2;
int confirm_vampire;
extern bool betalock;
char buf[MAX_INPUT_LENGTH];
if (betalock)
{
send_to_char("The game is Betalocked.\n\rYou may not become a vampire in this mode.\n\r", ch);
return;
}
/*
* Get ready to delete the pfile, send a nice informational message.
*/
d = ch->desc;
if ( IsRemort )
{
sprintf( strsave, "%s%s", PLAYER_DIR, capitalize( ch->name ) );
stop_fighting( ch, TRUE );
send_to_char( "You have chosen to become a vampire. You will now be dropped in at the sex\n\r", ch );
send_to_char( "selection section of character creation.", ch );
send_to_char( "In the unlikely event that you are disconnected or the MUD\n\r", ch );
send_to_char( "crashes while you are creating your character, create a new character\n\r", ch );
send_to_char( "as normal and write a note to 'immortal'.\n\r", ch );
send_to_char( "\n\r[Hit Enter to Continue]\n\r", ch );
sprintf( buf, "%s has become a vampire.", ch->name );
wiznet( buf, NULL, NULL, 0, 0, 0 );
log_string( buf );
do_mudwatch_out( ch );
/*
* I quote:
* "After extract_char the ch is no longer valid!"
*/
sprintf( player_name, "%s", ch->name );
sprintf( player_pwd, "%s", ch->pcdata->pwd );
player_bank = ++ch->bank;
player_incarnations = ++ch->pcdata->incarnations;
player_jedi = ch->pcdata->jedi; //Jedi Grayson 24 June 2004
if ( ch->perm_played < ch->played )
player_hours = ++ch->played;
else
player_hours = ++ch->perm_played;
extract_char( ch, TRUE );
/*
* Delete the pfile, but don't boot the character.
* Instead, do a load_char_obj to get a new ch,
* saving the password, and the incarnations. Then,
* set the PLR_REMORT bit and drop the player in at
* CON_BEGIN_REMORT.
*/
unlink( strsave );
load_char_obj( d, player_name );
d->character->pcdata->pwd = str_dup( player_pwd );
d->character->pcdata->incarnations = player_incarnations;
d->character->played = 0;
d->character->perm_played = player_hours;
d->character->bank = player_bank;
d->character->pcdata->jedi = player_jedi; //Jedi Grayson 24 June 2004
/*
if( !IS_SET( ch->act, PLR_REMORT ) )
SET_BIT( ch->act, PLR_REMORT );
if (player_remort2 && !IS_SET(ch->act, PLR_REMORT2) )
SET_BIT(ch->act, PLR_REMORT2);
*/
d->connected = CON_BEGIN_VAMPIRE;
return;
}
else
{
sprintf( strsave, "%s%s", PLAYER_DIR, capitalize( ch->name ) );
stop_fighting( ch, TRUE );
send_to_char( "You have chosen to become a vampire. You will now be dropped in at the sex\n\r", ch );
send_to_char( "selection section of character creation.", ch );
send_to_char( "In the unlikely event that you are disconnected or the MUD\n\r", ch );
send_to_char( "crashes while you are creating your character, create a new character\n\r", ch );
send_to_char( "as normal and write a note to 'immortal'.\n\r", ch );
send_to_char( "\n\r[Hit Enter to Continue]\n\r", ch );
sprintf( buf, "%s has become a vampire.", ch->name );
wiznet( buf, NULL, NULL, 0, 0, 0 );
log_string( buf );
do_mudwatch_out( ch );
/*
* I quote:
* "After extract_char the ch is no longer valid!"
*/
sprintf( player_name, "%s", ch->name );
sprintf( player_pwd, "%s", ch->pcdata->pwd );
if ( ch->perm_played < ch->played )
player_hours = ++ch->played;
else
player_hours = ++ch->perm_played;
extract_char( ch, TRUE );
/*
* Delete the pfile, but don't boot the character.
* Instead, do a load_char_obj to get a new ch,
* saving the password, and the incarnations. Then,
* drop the player in at CON_BEGIN_REMORT.
*/
unlink( strsave );
load_char_obj( d, player_name );
d->character->pcdata->pwd = str_dup( player_pwd );
d->character->played = 0;
d->character->perm_played = player_hours;
d->connected = CON_BEGIN_VAMPIRE;
return;
}
return;
}
void do_turn_vampire( CHAR_DATA *ch, char *argument )
{
extern bool betalock;
char buf[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
char arg [MAX_INPUT_LENGTH];
argument = one_argument( argument, arg );
if ( ( victim = get_char_room( ch, arg) ) == NULL )
{
send_to_char("They aren't here.\n\r",ch);
return;
}
if (IS_SET(victim->in_room->room_flags,ROOM_SAFE))
{
send_to_char("The gods will not allow that here.\n\r",ch);
return;
}
if (race_lookup("vampire") != ch->race)
{
send_to_char("What? Do you think you're some kind of vampire or something?\n\r",ch);
return;
}
if (race_lookup("vampire") == victim->race)
{
act("$N already is a vampire.",ch,NULL,victim,TO_CHAR);
return;
}
act("You sink your teeth into $N's neck.",ch,NULL,victim,TO_CHAR);
act("You can feel $N's heart pumping as $S blood flows into your mouth.",ch,NULL,victim,TO_CHAR);
act("$n sinks $s teeth into $N's neck.",ch,NULL,victim,TO_NOTVICT);
act("$n sinks $s teeth into your neck.",ch,NULL,victim,TO_VICT);
send_to_char("You begin to grow cold as your body is drained of blood.\n\r", victim);
act("$n offers you $s vein.",ch, NULL,victim, TO_VICT);
send_to_char("Do you wish to drink?\n\r", victim );
send_to_char("Type 'accept' with no arguement to accept, or type 'reject' to fight\n\r",victim);
victim->pcdata->confirm_vampire = TRUE;
return;
}