-
Notifications
You must be signed in to change notification settings - Fork 0
/
currency.cpp
687 lines (614 loc) · 21.9 KB
/
currency.cpp
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
/* these are some commands that we can start with now
to give places for people to spend their tokens
the first command lets people transfer tokens in their
account into practice sessions.
This is helpful for newbies, but most players
that have a few remorts have practice sessions in the thousands.
This will also allow them to use up their practice sessions.
100 practice sessions can equal 1 bronze token.
20 practice sessions can equal 1 brass token.
whereas it will cost 1 brass token to buy a practice session.
(5 brass = bronze)
The command will be: transfer <token|sessions> <number>
transfer token 1 - will transfer 1 brass token into a training session.
transfer session 1 - will transfer 20 sessions into a brass token.
------------------------
the command convert will be used for players to make 1 larger
denomonation in their account into the next smaller denomonation.
ie: 1 gold into 10 silver.
1 silver into 10 bronze.
1 bronze into 5 brass.
convert <brass|bronze|silver|gold>
it will just place that amount in your account for you to deduct.
-------------------------mord-----------------------------
O======================================================================O
|Name: Soulstar Class: [ Thief ] |Level: [ 255] |
|Race: Faun Sex: [ Male ] |Age: [ 26] |
|-------------------------------|----------------+---------------------|
|Str: [17] [17] [100] [100] |Weight: [ 4%] |Brass Tokens:[ 100] |
|Int: [25] [17] Wis: [25] [17] |Items: [ 4%] |Bronze Tokens:[ 100] |
|Con: [25] [17] Dex: [25] [17] |Thirst: [ -4%] |Silver Tokens:[ 100] |
|Cha: [25] [17] |Full: [ -4%] |Gold Tokens:[ 100] |
|Gold: [ ] |Drunk: [-10%] | |
|Bank: [ ] | |Fame :[ 100] |
|-------------------------------+----------------+---------------------|
|Exp. Gained : [ 999999000 ] |PKills:[ 12] |Bank: [ 0 ] |
|Exp. to Level: [ 3294968296 ] |PDeath:[ 12] |Gold: [ 983897 ] |
|-------------------------------+----------------+---------------------|
|Hit Points: [ 3050] [ 3050] |SPEEDMIN: [ 8] |Alignment: [-1000] |
|Mana Points: [ 2702] [ 2702] |SPEEDMAX: [ 20] |Hit Bonus: [ 23] |
|Move Points: [ 1747] [ 1747] | |Dam Bonus: [ 78] |
|Damage Percent Resist: [ 90%] |Mail: [yes] |Practices: [12343] |
O======================================================================O
equip_char(ch, obj, where);
*/
#include "config.h"
#include "sysdep.h"
#include "structs.h"
#include "utils.h"
#include "comm.h"
#include "interpreter.h"
#include "handler.h"
#include "db.h"
#include "house.h"
#include "screen.h"
#include "constants.h"
#include "oasis.h"
#include "dg_scripts.h"
#include "spells.h"
#include "genmob.h"
/* external variables */
void convert_tokens ( Character *ch );
ACMD ( do_convert )
{
char arg2[MAX_INPUT_LENGTH];
int counter, amount = 1;
struct obj_data *obj;
if ( IS_NPC ( ch ) )
{
ch->Send ( "Silly mob, you don't collect tokens.\r\n" );
return;
}
one_argument ( argument, arg2 );
if ( !*arg2 )
{
ch->Send ( "Usage: convert <tokentype>.\r\n" );
return;
}
if ( amount < 0 )
{
ch->Send ( "Your attempt at cheating has been logged. The Imms will be notified.\r\n" );
return;
}
if ( isname ( "brass", arg2 ) )
{
if ( GET_BRASS_TOKEN_COUNT ( ch ) >= amount )
{
ch->Send ( "You can't split a brass token. If you want to Deduct say so.\r\n" );
return;
}
else
{
ch->Send ( "You don't have that many tokens on account.\r\n" );
return;
}
}
else if ( isname ( "bronze", arg2 ) )
{
if ( GET_BRONZE_TOKEN_COUNT ( ch ) >= amount )
{
ch->Send ( "%d tokens were deducted from your account and split to brass.\r\n",
amount );
GET_BRONZE_TOKEN_COUNT ( ch ) -= amount;
for ( counter = 0; counter < 5; counter++ )
{
obj = read_object ( 3300, VIRTUAL );
if ( obj )
obj_to_char ( obj, ch );
}
return;
}
else
{
ch->Send ( "You don't have that many tokens on account.\r\n" );
return;
}
}
else if ( isname ( "silver", arg2 ) )
{
if ( GET_SILVER_TOKEN_COUNT ( ch ) >= amount )
{
ch->Send ( "%d tokens were deducted from your account and split to bronze.\r\n",
amount );
GET_SILVER_TOKEN_COUNT ( ch ) -= amount;
for ( counter = 0; counter < 10; counter++ )
{
obj = read_object ( 3301, VIRTUAL );
if ( obj )
obj_to_char ( obj, ch );
}
return;
}
else
{
ch->Send ( "You don't have that many tokens on account.\r\n" );
return;
}
}
else if ( isname ( "gold", arg2 ) )
{
if ( GET_GOLD_TOKEN_COUNT ( ch ) >= amount )
{
ch->Send ( "%d tokens were deducted from your account and split.\r\n", amount );
GET_GOLD_TOKEN_COUNT ( ch ) -= amount;
for ( counter = 0; counter < 10; counter++ )
{
obj = read_object ( 3302, VIRTUAL );
if ( obj )
obj_to_char ( obj, ch );
}
return;
}
else
{
ch->Send ( "You don't have enough tokens on account.\r\n" );
return;
}
}
else
{
ch->Send ( "You can only deduct tokens from your account.\r\n" );
return;
}
return;
}
ACMD ( do_convey )
{
char arg1[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
gold_int amount = 0;
if ( IS_NPC ( ch ) )
{
ch->Send ( "Silly mob, you don't collect tokens.\r\n" );
return;
}
// Removed Remort check per Molly. - Prometheus.
//
// if ( GET_REMORT ( ch ) == -1 )
// {
// ch->Send ( "This command works for remorted players only.\r\n" );
// return;
// }
two_arguments ( argument, arg2, arg1 );
if ( !*arg1 || !*arg2 )
{
ch->Send ( "Usage: convey <award|token|gold|maxmove|tradepoints> <amount>.\r\n" );
ch->Send ( "see HELP CONVEY for more info.\r\n"
"CONVEY gold <amount>, turns gold coins into exp points at 4 to 1 ratio\r\n"
"CONVEY maxmove 1, turns (num of times used x ) 10 mill into 100 maxmove\r\n" );
return;
}
amount = atoll ( arg1 );
if ( isname ( arg2, "tokens" ) )
{
if ( amount > 50 )
{
ch->Send ( "You can only convey 50 bronze tokens or less.\r\n" );
}
else
{
int silver_tokens = amount / 50;
int bronze_tokens = ( amount - silver_tokens * 50 ) / 5;
int brass_tokens = amount - silver_tokens * 50 - bronze_tokens * 5;
int new_gold_tokencount = GET_GOLD_TOKEN_COUNT ( ch );
int new_silver_tokencount = GET_SILVER_TOKEN_COUNT ( ch ) - silver_tokens;
int new_bronze_tokencount = GET_BRONZE_TOKEN_COUNT ( ch ) - bronze_tokens;
int new_brass_tokencount = GET_BRASS_TOKEN_COUNT ( ch ) - brass_tokens;
if ( new_brass_tokencount < 0 )
{
new_bronze_tokencount--;
new_brass_tokencount = 5 + new_brass_tokencount;
}
if ( new_bronze_tokencount < 0 )
{
new_silver_tokencount--;
new_bronze_tokencount = 10 + new_bronze_tokencount;
}
if ( new_silver_tokencount < 0 )
{
new_gold_tokencount--;
new_silver_tokencount = 10 + new_silver_tokencount;
}
if ( new_gold_tokencount < 0 )
{
ch->Send ( "You don't have that many tokens on your account.\r\n" );
}
else
{
char buf[100];
char *bufpointer=buf;
int sessions=silver_tokens * 500 + bronze_tokens * 50 + brass_tokens * 5;
bufpointer+=snprintf ( bufpointer, ( size_t ) ( 98 - ( bufpointer - buf ) ), "You convey " );
if ( silver_tokens > 0 )
bufpointer += snprintf ( bufpointer, ( size_t ) ( 98 - ( bufpointer - buf ) ), "%d silver token%s",
silver_tokens,
silver_tokens > 1 ? "s" : "" );
if ( bronze_tokens > 0 )
bufpointer += snprintf ( bufpointer, ( size_t ) ( 98 - ( bufpointer - buf ) ), "%s%s%d bronze token%s",
silver_tokens > 0 && brass_tokens > 0 ? ", " : "",
silver_tokens > 0 && brass_tokens == 0 ? " and " : "",
bronze_tokens,
bronze_tokens > 1 ? "s" : "" );
if ( brass_tokens > 0 )
bufpointer += snprintf ( bufpointer, ( size_t ) ( 98 - ( bufpointer - buf ) ), "%s%d brass token%s",
silver_tokens > 0 || bronze_tokens > 0 ? " and " : "",
brass_tokens,
brass_tokens > 1 ? "s" : "" );
bufpointer += snprintf ( bufpointer, ( size_t ) ( 98 - ( bufpointer - buf ) ), " to %d training session%s.\r\n",
sessions,
sessions > 1 ? "s":"" );
ch->Send ( "%s", buf );
GET_GOLD_TOKEN_COUNT ( ch ) = new_gold_tokencount;
GET_SILVER_TOKEN_COUNT ( ch ) = new_silver_tokencount;
GET_BRONZE_TOKEN_COUNT ( ch ) = new_bronze_tokencount;
GET_BRASS_TOKEN_COUNT ( ch ) = new_brass_tokencount;
GET_PRACTICES ( ch ) += sessions;
}
}
/* no more session converting. It's EVIL!!!!
} else if (isname(arg2, "sessions")) {
if ((amount % 20)) {
ch->Send("The number must be devisable by 20.");
return;
}
if (amount < 20) {
ch->Send("The amount must be greater than 20.");
return;
}
if (!(amount <= 200)) {
ch->Send("The amount must be less than or equal to 200.");
return;
}
if (GET_PRACTICES(ch) >= amount) {
ch->Send("You convey %lld practice sessions to %lld bronze tokens.\r\n",
amount, amount / 20);
GET_BRONZE_TOKEN_COUNT(ch) += amount / 20;
GET_PRACTICES(ch) -= amount;
convert_tokens(ch);
return;
} else {
ch->Send("You don't have that many sessions.\r\n");
return;
}
*/
}
// This should be arg2 then gold not gold then arg2
// Changed this from "gold" to "maxmove" since the rest of the
// code does the next agruement. Prometheus.
// else if ( isname ( arg2, "gold" ) )
// {
else if ( isname ( arg2, "maxmove" ) )
{
gold_int cost = 10000000LL * GET_CONVERSIONS ( ch );
if ( ch->Gold ( 0, GOLD_ALL ) >= cost)
{
log ( "INFO: %s conveyed %lld gold into 100 maxmove", GET_NAME ( ch ), cost );
ch->Send ( "You convey %lld gold to 100 maxmove.\r\n", cost );
GET_MAX_MOVE ( ch ) += 100;
ch->Gold ( -cost, GOLD_ALL );
GET_CONVERSIONS ( ch ) ++;
ch->affect_total();
}
else
{
ch->Send ( "You can't afford to!\r\n" );
}
return;
}
else if (isname(arg2, "gold")) {
if ( ! ( amount >= 4 ) )
{
ch->Send ( "The amount must be greater than 4.\r\n" );
return;
}
if ( amount % 4 != 0 )
{
ch->Send ( "The amount must be a multiple of 4.\r\n" );
return;
}
if ( ch->Gold ( 0, GOLD_ALL ) >= amount )
{
log ( "INFO: %s conveyed %lld gold into %lld exp", GET_NAME ( ch ), amount, amount/4 );
ch->Send ( "You convey %lld gold to %lld exp points.\r\n", amount, amount / 4 );
gain_exp ( ch, amount / 4 );
ch->Gold ( -amount, GOLD_ALL );
return;
}
else
{
ch->Send ( "You can't afford to!\r\n" );
}
}
else if ( isname ( arg2, "award" ) )
{
if ( PLR_FLAGGED ( ch, PLR_HERO ) || PLR_FLAGGED ( ch, PLR_RP_LEADER ) )
{
ch->Send ( "Sorry, can't do that.\r\n" );
return;
}
if ( ( amount % 10 ) )
{
ch->Send ( "The amount must be a multiple of 10." );
return;
}
if ( amount < 10 )
{
ch->Send ( "You can only convey 10 or more.\r\n" );
return;
}
if ( amount > GET_AWARD ( ch ) )
{
ch->Send ( "You can't afford that action.\r\n" );
return;
}
log ( "INFO: %s conveyed %d award points into %d bronze tokens", GET_NAME ( ch ), ( int ) amount, ( int ) ( amount/10 ) );
ch->Send ( "You convey %d award points to %d bronze tokens.\r\n", ( int ) amount, ( int ) ( amount/10 ) );
GET_BRONZE_TOKEN_COUNT ( ch ) += ( int ) ( amount/10 );
GET_AWARD ( ch ) -= amount;
convert_tokens ( ch );
}
else if ( isname ( arg2, "tradepoints" ) )
{
if ( amount < 1 )
{
ch->Send ( "You have to convey at least 1\r\n" );
return;
}
if ( amount > TRADEPOINTS ( ch ) )
{
ch->Send ( "You can't afford that action.\r\n" );
return;
}
ch->Send ( "You convey tradepoints for exp \r\nat the rate of 1 tradepoint per level 40 mob's exp equivalent.\r\n" );
// Changed this to fixed value
// Since code isn't getting value.
//gain_exp ( ch, amount * mob_stats[30].exp );
gold_int gain = amount * 1100000LL;
gain_exp (ch, gain);
TRADEPOINTS ( ch ) -= amount;
new_mudlog ( CMP, MAX ( LVL_SEN, GET_INVIS_LEV ( ch ) ), TRUE, "[TRADEPOINTS] %s conveyed %lld tradepoints to %lld xp. (%d tradepoints remaining)", GET_NAME ( ch ), amount, gain, TRADEPOINTS(ch));
}
else
{
ch->Send ( "You can only convey tokens, gold, maxmove, award points or trade points.\r\n" );
return;
}
return;
}
void convert_tokens ( Character *ch )
{
div_t brass, bronze, silver;
/*
log("%s before conversion.", GET_NAME(ch));
log("brass: %5d, bronze: %5d, silver: %5d, gold: %5d.",
GET_BRASS_TOKEN_COUNT(ch), GET_BRONZE_TOKEN_COUNT(ch),
GET_SILVER_TOKEN_COUNT(ch), GET_GOLD_TOKEN_COUNT(ch));
*/
/* convert brass to bronze */
brass = div ( GET_BRASS_TOKEN_COUNT ( ch ), 5 );
GET_BRASS_TOKEN_COUNT ( ch ) = brass.rem;
GET_BRONZE_TOKEN_COUNT ( ch ) += brass.quot;
/* convert bronze to silver */
bronze = div ( GET_BRONZE_TOKEN_COUNT ( ch ), 10 );
GET_BRONZE_TOKEN_COUNT ( ch ) = bronze.rem;
GET_SILVER_TOKEN_COUNT ( ch ) += bronze.quot;
/* convert silver to gold */
silver = div ( GET_SILVER_TOKEN_COUNT ( ch ), 10 );
GET_SILVER_TOKEN_COUNT ( ch ) = silver.rem;
GET_GOLD_TOKEN_COUNT ( ch ) += silver.quot;
/*
log("%s after conversion.", GET_NAME(ch));
log("brass: %5d, bronze: %5d, silver: %5d, gold: %5d.",
GET_BRASS_TOKEN_COUNT(ch), GET_BRONZE_TOKEN_COUNT(ch),
GET_SILVER_TOKEN_COUNT(ch), GET_GOLD_TOKEN_COUNT(ch));
*/
return;
}
SPECIAL ( token_machine )
{
char arg1[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
struct obj_data *obj, *cont;
Character *tmp_char;
// int obj_dotmode, cont_dotmode, found = 0;
if ( !CMD_IS ( "put" ) )
return ( 0 );
if ( IS_NPC ( ch ) )
return 0;
two_arguments ( argument, arg1, arg2 );
if ( !*arg1 )
{
ch->Send ( "What do you want to put where?\r\n" );
return ( 1 );
}
if ( !*arg2 )
{
ch->Send ( "What do you want to put it in?\r\n" );
return ( 1 );
}
generic_find ( arg2, FIND_OBJ_INV | FIND_OBJ_ROOM, ch, &tmp_char, &cont );
if ( !cont )
return ( 0 );
if ( GET_OBJ_VNUM ( cont ) != 219 )
return ( 0 );
if ( ! ( obj = get_obj_in_list_vis ( ch, arg1, NULL, ch->carrying ) ) )
{
ch->Send ( "You aren't carrying %s %s.\r\n", AN ( arg1 ), arg1 );
return ( 1 );
}
else if ( ( GET_OBJ_VNUM ( obj ) == 3301 ) || ( GET_OBJ_VNUM ( obj ) == 3304 )
|| ( GET_OBJ_VNUM ( obj ) == 3307 )
|| ( GET_OBJ_VNUM ( obj ) == 3310 ) )
{
ch->Send ( "You put %s %s into the machine.\r\n", AN ( arg1 ),
arg1 );
obj_from_char ( obj );
extract_obj ( obj );
GET_BRONZE_TOKEN_COUNT ( ch ) += 1;
convert_tokens ( ch );
return ( 1 );
}
else if ( GET_OBJ_VNUM ( obj ) == 3300 )
{
ch->Send ( "You put %s %s into the machine.\r\n", AN ( arg1 ),
arg1 );
obj_from_char ( obj );
extract_obj ( obj );
GET_BRASS_TOKEN_COUNT ( ch ) += 1;
convert_tokens ( ch );
return ( 1 );
}
else if ( ( GET_OBJ_VNUM ( obj ) == 3302 ) || ( GET_OBJ_VNUM ( obj ) == 3305 )
|| ( GET_OBJ_VNUM ( obj ) == 3308 )
|| ( GET_OBJ_VNUM ( obj ) == 3311 ) )
{
ch->Send ( "You put %s %s into the machine.\r\n", AN ( arg1 ),
arg1 );
obj_from_char ( obj );
extract_obj ( obj );
GET_SILVER_TOKEN_COUNT ( ch ) += 1;
convert_tokens ( ch );
return ( 1 );
}
else if ( ( GET_OBJ_VNUM ( obj ) == 3303 ) || ( GET_OBJ_VNUM ( obj ) == 3306 )
|| ( GET_OBJ_VNUM ( obj ) == 3309 )
|| ( GET_OBJ_VNUM ( obj ) == 3312 ) )
{
ch->Send ( "You put %s %s into the machine.\r\n", AN ( arg1 ),
arg1 );
obj_from_char ( obj );
extract_obj ( obj );
GET_GOLD_TOKEN_COUNT ( ch ) += 1;
convert_tokens ( ch );
return ( 1 );
}
else
{
ch->Send ( "The machine doesn't accept that.\r\n" );
return ( 1 );
}
}
ACMD ( do_deduct )
{
char arg1[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
int amount = 0, counter;
struct obj_data *obj;
if ( IS_NPC ( ch ) )
{
ch->Send ( "Silly mob, you don't collect tokens.\r\n" );
return;
}
two_arguments ( argument, arg1, arg2 );
if ( !*arg1 || !*arg2 )
{
ch->Send ( "Usage: deduct <amount> <type>.\r\n" );
return;
}
amount = atoi ( arg1 );
if ( amount < 0 )
{
ch->Send ( "Your attempt at cheating has been logged. The Imms will be notified.\r\n" );
return;
}
if ( isname ( "brass", arg2 ) )
{
if ( GET_BRASS_TOKEN_COUNT ( ch ) >= amount )
{
ch->Send ( "%d tokens were deducted from your account.\r\n", amount );
GET_BRASS_TOKEN_COUNT ( ch ) -= amount;
for ( counter = 0; counter < amount; counter++ )
{
obj = read_object ( 3300, VIRTUAL );
if ( obj )
obj_to_char ( obj, ch );
}
return;
}
else
{
ch->Send ( "You don't have that many tokens on account.\r\n" );
return;
}
}
else if ( isname ( "bronze", arg2 ) )
{
if ( GET_BRONZE_TOKEN_COUNT ( ch ) >= amount )
{
ch->Send ( "%d tokens were deducted from your account.\r\n", amount );
GET_BRONZE_TOKEN_COUNT ( ch ) -= amount;
for ( counter = 0; counter < amount; counter++ )
{
obj = read_object ( 3301, VIRTUAL );
if ( obj )
obj_to_char ( obj, ch );
}
return;
}
else
{
ch->Send ( "You don't have that many tokens on account.\r\n" );
return;
}
}
else if ( isname ( "silver", arg2 ) )
{
if ( GET_SILVER_TOKEN_COUNT ( ch ) >= amount )
{
ch->Send (
"%d tokens were deducted from your account.\r\n",
amount );
GET_SILVER_TOKEN_COUNT ( ch ) -= amount;
for ( counter = 0; counter < amount; counter++ )
{
obj = read_object ( 3302, VIRTUAL );
if ( obj )
obj_to_char ( obj, ch );
}
return;
}
else
{
ch->Send ( "You don't have that many tokens on account.\r\n" );
return;
}
}
else if ( isname ( "gold", arg2 ) )
{
if ( GET_GOLD_TOKEN_COUNT ( ch ) >= amount )
{
ch->Send (
"%d tokens were deducted from your account.\r\n",
amount );
GET_GOLD_TOKEN_COUNT ( ch ) -= amount;
for ( counter = 0; counter < amount; counter++ )
{
obj = read_object ( 3303, VIRTUAL );
if ( obj )
obj_to_char ( obj, ch );
}
return;
}
else
{
ch->Send ( "You don't have that many tokens on account.\r\n" );
return;
}
}
else
{
ch->Send ( "You can only deduct tokens from your account.\r\n" );
return;
}
return;
}