~case/dbns

ref: 85d3c74215baa48cb2fd97d3c85ff6060e7c42b1 dbns/src/skills_genie.c -rw-r--r-- 21.7 KiB
85d3c742Zerhyn SBC oopsie 3 years ago
                                                                                
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
#include <sys/types.h>
#include <ctype.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <time.h>
#include "mud.h"

extern void transStatApply args((CHAR_DATA * ch, int strMod, int spdMod, int intMod, int conMod));
extern void transStatRemove args((CHAR_DATA * ch));

bool 
removeGenieTrans(CHAR_DATA * ch)
{
	if (xIS_SET(ch->affected_by, AFF_EVIL_TRANS)) {
		xREMOVE_BIT(ch->affected_by, AFF_EVIL_TRANS);
		transStatRemove(ch);
		return true;
	}
	if (xIS_SET(ch->affected_by, AFF_SUPER_TRANS)) {
		xREMOVE_BIT(ch->affected_by, AFF_SUPER_TRANS);
		transStatRemove(ch);
		return true;
	}
	if (xIS_SET(ch->affected_by, AFF_KID_TRANS)) {
		xREMOVE_BIT(ch->affected_by, AFF_KID_TRANS);
		transStatRemove(ch);
		return true;
	}
	return (false);
}

void 
do_transform(CHAR_DATA * ch, char *argument)
{
	if (!is_genie(ch)) {
		send_to_char("You can't do that.\n\r", ch);
		return;
	}
	if (!argument || argument[0] == '\0') {
		send_to_char("Syntax: transform [thin|super|kid]\n\r", ch);
		return;
	}
	if (!str_prefix(argument, "thin")) {
		if (ch->exp < skill_table[gsn_thin_trans]->min_level[ch->race]) {
			send_to_char("You can't do that at your level.\n\r", ch);
			return;
		}
		if (ch->mana < skill_table[gsn_thin_trans]->min_mana) {
			send_to_char("You don't have enough energy.\n\r", ch);
			return;
		}
		WAIT_STATE(ch, skill_table[gsn_thin_trans]->beats);

		if (can_use_skill(ch, number_percent(), gsn_thin_trans)) {
			removeGenieTrans(ch);
			act(AT_PINK, "Steam courses through the series of holes along your head, as you begin", ch, NULL, NULL, TO_CHAR);
			act(AT_PINK, "to let out a high-pitched shriek.  Your rolling layers of pink flesh", ch, NULL, NULL, TO_CHAR);
			act(AT_PINK, "rapidly compact, giving you a leaner, more sinister look.", ch, NULL, NULL, TO_CHAR);

			act(AT_PINK, "Steam courses through the series of holes along $n's head as $e begins", ch, NULL, NULL, TO_NOTVICT);
			act(AT_PINK, "to let out a high-pitched shriek.  $*s rolling layers of pink flesh rapidly", ch, NULL, NULL, TO_NOTVICT);
			act(AT_PINK, "compact, giving $m a leaner, more sinister look.", ch, NULL, NULL, TO_NOTVICT);
			xSET_BIT(ch->affected_by, AFF_EVIL_TRANS);
			ch->pl = ch->exp * 12;
			transStatApply(ch, 9, 6, 6, 9);
			learn_from_success(ch, gsn_thin_trans);
		} else {
			act(AT_PLAIN, "You failed.", ch, NULL, NULL, TO_CHAR);
			learn_from_failure(ch, gsn_thin_trans);
		}

		ch->mana -= skill_table[gsn_thin_trans]->min_mana;
		return;
	}
	if (!str_prefix(argument, "super")) {
		if (ch->exp < skill_table[gsn_super_trans]->min_level[ch->race]) {
			send_to_char("You can't do that at your level.\n\r", ch);
			return;
		}
		if (!xIS_SET(ch->affected_by, AFF_EVIL_TRANS)
		    && !xIS_SET(ch->affected_by, AFF_KID_TRANS)) {
			send_to_char("You can't do that in this form.\n\r", ch);
			return;
		}
		if (ch->mana < skill_table[gsn_super_trans]->min_mana) {
			send_to_char("You don't have enough energy.\n\r", ch);
			return;
		}
		WAIT_STATE(ch, skill_table[gsn_super_trans]->beats);

		if (can_use_skill(ch, number_percent(), gsn_super_trans)) {
			removeGenieTrans(ch);
			act(AT_PINK, "You utter a low-pitched growl, steam blasting through the porting in", ch, NULL, NULL, TO_CHAR);
			act(AT_PINK, "your head, as you draw energy from your absorbed victims.  The tentacle", ch, NULL, NULL, TO_CHAR);
			act(AT_PINK, "atop your head lengthens to mid-back level and your slender body bulks", ch, NULL, NULL, TO_CHAR);
			act(AT_PINK, "up, taking on a powerful, muscular look.  An aura of dark purple energy", ch, NULL, NULL, TO_CHAR);
			act(AT_PINK, "surrounds you.", ch, NULL, NULL, TO_CHAR);

			act(AT_PINK, "$n utters a low-pitched growl, steam blasting through the porting", ch, NULL, NULL, TO_NOTVICT);
			act(AT_PINK, "in $s head, as $e draws energy from $s absorbed victims.  The tentacle", ch, NULL, NULL, TO_NOTVICT);
			act(AT_PINK, "atop $s head lengthens to mid-back level and $s slender body bulks up,", ch, NULL, NULL, TO_NOTVICT);
			act(AT_PINK, "taking on a powerful, muscular look.  An aura of dark purple energy", ch, NULL, NULL, TO_NOTVICT);
			act(AT_PINK, "surrounds $m.", ch, NULL, NULL, TO_NOTVICT);

			xSET_BIT(ch->affected_by, AFF_SUPER_TRANS);
			ch->pl = ch->exp * 20;
			transStatApply(ch, 18, 12, 12, 18);
			learn_from_success(ch, gsn_super_trans);
		} else {
			act(AT_PLAIN, "You failed.", ch, NULL, NULL, TO_CHAR);
			learn_from_failure(ch, gsn_super_trans);
		}

		ch->mana -= skill_table[gsn_super_trans]->min_mana;
		return;
	}
	if (!str_prefix(argument, "kid")) {
		if (ch->exp < skill_table[gsn_kid_trans]->min_level[ch->race]) {
			send_to_char("You can't do that at your level.\n\r", ch);
			return;
		}
		if (!xIS_SET(ch->affected_by, AFF_SUPER_TRANS)) {
			send_to_char("You can't do that in this form.\n\r", ch);
			return;
		}
		if (ch->mana < skill_table[gsn_kid_trans]->min_mana) {
			send_to_char("You don't have enough energy.\n\r", ch);
			return;
		}
		WAIT_STATE(ch, skill_table[gsn_kid_trans]->beats);

		if (can_use_skill(ch, number_percent(), gsn_kid_trans)) {
			removeGenieTrans(ch);
			act(AT_PINK, "You bellow loudly, your voice starting deep and gradually becoming more", ch, NULL, NULL, TO_CHAR);
			act(AT_PINK, "shrill as the stolen energy gives way to a terrifying strength of your", ch, NULL, NULL, TO_CHAR);
			act(AT_PINK, "own.  Steam shrieks through the holes along your head, completely masking", ch, NULL, NULL, TO_CHAR);
			act(AT_PINK, "your presence.  Your form shrinks and compacts and when the steam finally", ch, NULL, NULL, TO_CHAR);
			act(AT_PINK, "clears, you have transformed into a child-sized version of yourself,", ch, NULL, NULL, TO_CHAR);
			act(AT_PINK, "radiating a horrifying power.", ch, NULL, NULL, TO_CHAR);

			act(AT_PINK, "$n bellows loudly, $s voice starting deep and gradually becoming more", ch, NULL, NULL, TO_NOTVICT);
			act(AT_PINK, "shrill as the stolen energy gives way to a terrifying strength of $s own.", ch, NULL, NULL, TO_NOTVICT);
			act(AT_PINK, "Steam shrieks through the holes along $s head, completely masking $s", ch, NULL, NULL, TO_NOTVICT);
			act(AT_PINK, "presence.  $*s form shrinks and compacts and when the steam finally", ch, NULL, NULL, TO_NOTVICT);
			act(AT_PINK, "clears, $e has transformed into a child-sized version of $mself,", ch, NULL, NULL, TO_NOTVICT);
			act(AT_PINK, "radiating a horrifiyng power.", ch, NULL, NULL, TO_NOTVICT);

			xSET_BIT(ch->affected_by, AFF_KID_TRANS);
			ch->pl = ch->exp * 28;
			transStatApply(ch, 27, 18, 18, 27);
			learn_from_success(ch, gsn_kid_trans);
		} else {
			act(AT_PLAIN, "You failed.", ch, NULL, NULL, TO_CHAR);
			learn_from_failure(ch, gsn_kid_trans);
		}

		ch->mana -= skill_table[gsn_kid_trans]->min_mana;
		return;
	}

	do_transform(ch, "");
}

void 
do_demon_wave(CHAR_DATA * ch, char *argument)
{
	CHAR_DATA *victim;
	int 	dam = 0;

	if (!IS_NPC(ch) && ch->exp < skill_table[gsn_demonwave]->skill_level[ch->class]) {
		send_to_char("You can't do that.\n\r", ch);
		return;
	}
	if ((victim = who_fighting(ch)) == NULL) {
		send_to_char("You aren't fighting anyone.\n\r", ch);
		return;
	}
	if (ch->mana < skill_table[gsn_demonwave]->min_mana) {
		send_to_char("You don't have enough energy.\n\r", ch);
		return;
	}
	if (ch->focus < skill_table[gsn_demonwave]->focus) {
		send_to_char("You need to focus more.\n\r", ch);
		return;
	}
	ch->focus -= skill_table[gsn_demonwave]->focus;
	WAIT_STATE(ch, skill_table[gsn_demonwave]->beats);

	if (can_use_skill(ch, number_percent(), gsn_demonwave)) {
		dam = get_attmod(ch, victim) * number_range(22, 28);
		if (ch->charge > 0)
			dam = chargeDamMult(ch, dam);

		act(AT_SKILL, "You cup your hands and grin at $N, \"You go bye bye now!\"  A ball of", ch, NULL, victim, TO_CHAR);
		act(AT_SKILL, "sparkling purple energy appears in your palms and you push your hands", ch, NULL, victim, TO_CHAR);
		act(AT_SKILL, "forward, creating a massive wave of energy that flies at $N! &W[$t]", ch, num_punct(dam), victim, TO_CHAR);

		act(AT_SKILL, "$n cups $s hands and grins at you, \"You go bye bye now!\"  A ball of", ch, NULL, victim, TO_VICT);
		act(AT_SKILL, "sparkling purple energy appears in $s palms and $e pushes $s hands", ch, NULL, victim, TO_VICT);
		act(AT_SKILL, "forward, creating a massive wave of energy that flies at you! &W[$t]", ch, num_punct(dam), victim, TO_VICT);

		act(AT_SKILL, "$n cups $s hands and grins at $N, \"You go bye bye now!\"  A ball of", ch, NULL, victim, TO_NOTVICT);
		act(AT_SKILL, "sparkling purple energy appears in $s palms and $e pushes $s hands", ch, NULL, victim, TO_NOTVICT);
		act(AT_SKILL, "forward, creating a massive wave of energy that flies at $N! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT);

		dam = ki_absorb(victim, ch, dam, gsn_demonwave);
		learn_from_success(ch, gsn_demonwave);
		global_retcode = damage(ch, victim, dam, TYPE_HIT);
	} else {
		act(AT_SKILL, "You missed $N with your demon wave.", ch, NULL, victim, TO_CHAR);
		act(AT_SKILL, "$n misses you with $s demon wave.", ch, NULL, victim, TO_VICT);
		act(AT_SKILL, "$n missed $N with a demon wave.", ch, NULL, victim, TO_NOTVICT);
		learn_from_failure(ch, gsn_demonwave);
		global_retcode = damage(ch, victim, 0, TYPE_HIT);
	}

	ch->mana -= skill_table[gsn_demonwave]->min_mana;
}

void 
do_candy_blast(CHAR_DATA * ch, char *argument)
{
	CHAR_DATA *victim;
	int 	dam = 0;

	if (is_namek(ch)) {
		ch_printf(ch, "You are not allowed.\n\r");
		return;
	}
	if (IS_NPC(ch) && IS_AFFECTED(ch, AFF_CHARM)) {
		send_to_char("You can't concentrate enough for that.\n\r", ch);
		return;
	}
	if (!IS_NPC(ch) && ch->exp < skill_table[gsn_candyblast]->skill_level[ch->class]) {
		send_to_char("You can't do that.\n\r", ch);
		return;
	}
	if ((victim = who_fighting(ch)) == NULL) {
		send_to_char("You aren't fighting anyone.\n\r", ch);
		return;
	}
	if (ch->mana < skill_table[gsn_candyblast]->min_mana) {
		send_to_char("You don't have enough energy.\n\r", ch);
		return;
	}
	if (ch->focus < skill_table[gsn_candyblast]->focus) {
		send_to_char("You need to focus more.\n\r", ch);
		return;
	} else
		ch->focus -= skill_table[gsn_candyblast]->focus;

	WAIT_STATE(ch, skill_table[gsn_candyblast]->beats);
	if (can_use_skill(ch, number_percent(), gsn_candyblast)) {
		dam = get_attmod(ch, victim) * number_range(35, 45);
		if (ch->charge > 0)
			dam = chargeDamMult(ch, dam);

		act(AT_SKILL, "Your head tentacle flips towards $N and fires a pink beam of energy.  The", ch, NULL, victim, TO_CHAR);
		act(AT_SKILL, "ray hits and engulfs $N in a pink blaze that electrifies $S body.  &W[$t]", ch, num_punct(dam), victim, TO_CHAR);

		act(AT_SKILL, "$n's head tentacle flips towards you and fires a pink beam of energy.  The", ch, NULL, victim, TO_VICT);
		act(AT_SKILL, "ray hits and engulfs you in a pink blaze that electrifies your body. &W[$t]", ch, num_punct(dam), victim, TO_VICT);

		act(AT_SKILL, "$n's head tentacle flips towards $N and fires a pink beam of energy.  The", ch, NULL, victim, TO_NOTVICT);
		act(AT_SKILL, "ray hits and engulfs $N in a pink blaze that electrifies $S body. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT);

		dam = ki_absorb(victim, ch, dam, gsn_candyblast);
		learn_from_success(ch, gsn_candyblast);
		global_retcode = damage(ch, victim, dam, TYPE_HIT);
	} else {
		act(AT_SKILL, "You missed $N with your candy blast.", ch, NULL, victim, TO_CHAR);
		act(AT_SKILL, "$n misses you with $s candy blast.", ch, NULL, victim, TO_VICT);
		act(AT_SKILL, "$n missed $N with a candy blast.", ch, NULL, victim, TO_NOTVICT);
		learn_from_failure(ch, gsn_candyblast);
		global_retcode = damage(ch, victim, 0, TYPE_HIT);
	}

	ch->mana -= skill_table[gsn_candyblast]->min_mana;
}

/*
void do_super_ghost_kamikaze( CHAR_DATA *ch, char *argument )
{
    char buf[MAX_STRING_LENGTH];
    char buf2[MAX_STRING_LENGTH];
    CHAR_DATA *victim;
    int shot = 0;
    int shots = 0;
    int dam = 0;
    int energy = 0;
    int damPerShot = 0;

    if( IS_NPC(ch) && IS_AFFECTED( ch, AFF_CHARM ) )
    {
	send_to_char( "You can't concentrate enough for that.\n\r", ch );
	return;
    }

    if( !IS_NPC(ch) && ch->exp < skill_table[gsn_sgkamikaze]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

    if( arg[0] == '\0' || atoi( arg ) <= 0 )
    {
	send_to_char( "Syntax: scatter <# of shots>\n\r", ch );
	return;
    }

    if( ( victim = who_fighting( ch ) ) == NULL )
    {
	send_to_char( "You aren't fighting anyone.\n\r", ch );
	return;
    }

    shot = atoi( arg );
    if( shot > 50 )
	shot = 50;
    energy = shot * skill_table[gsn_sgkamikaze]->min_mana;
    shots = shot;
    strcpy( buf, num_punct( shot ) );

    if( ch->mana < energy )
    {
	send_to_char( "You don't have enough energy.\n\r", ch );
	return;
    }
    if( ch->focus < ( skill_table[gsn_sgkamikaze]->focus * ( 1 + ( shot / 10 ) ) ) )
    {
	send_to_char( "You need to focus more.\n\r", ch );
	return;
    }
    else
	ch->focus -= ( skill_table[gsn_sgkamikaze]->focus * ( 1 + ( shot / 10 ) ) );

    WAIT_STATE( ch, ( skill_table[gsn_sgkamikaze]->beats * ( 1 + ( shot / 10 ) ) ) );

    if( can_use_skill( ch, number_percent(), gsn_sgkamikaze ) )
    {
	while( shots > 0 )
	{
	    switch( number_range( 1, 4 ) )
	    {
		default:
		case 1:
		    break;
		case 2:
		case 3:
		    dam += number_range( 0, 1 );
		    break;
		case 4:
		    dam += number_range( 0, 2 );
		    break;
	    }
	    shots--;
	}
	damPerShot = number_range( 1, 3 );
	strcpy( buf2, num_punct( get_attmod( ch, victim ) * dam * damPerShot ) );

	act( AT_SKILL, "You power up and yell, 'SCATTER SHOT!'", ch, NULL, victim, TO_CHAR );
	act2( AT_SKILL, "You launch a barrage of $t energy balls towards $N, "
		"all exploding on contact. &W[$T]", ch, buf, victim, TO_CHAR, buf2 );
	act( AT_SKILL, "$n powers up and yells, 'SCATTER SHOT!'", ch, NULL, victim, TO_VICT );
	act2( AT_SKILL, "$e launches a barrage of $t energy balls towards you, "
		"all exploding on contact. &W[$T]", ch, buf, victim, TO_VICT, buf2 );
	act( AT_SKILL, "$n powers up and yells, 'SCATTER SHOT!'", ch, NULL, victim, TO_NOTVICT );
	act2( AT_SKILL, "$e launches a barrage of $t energy balls towards $N, "
		"all exploding on contact. &W[$T]", ch, buf, victim, TO_NOTVICT, buf2 );

	learn_from_success( ch, gsn_sgkamikaze );
	global_retcode = damage( ch, victim, (get_attmod(ch, victim) * dam * damPerShot), TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You launch a barrage of $t energy balls towards $N but $E is to fast to hit.", ch, buf, victim, TO_CHAR );
	act( AT_SKILL, "$n launches a barrage of $t energy balls towards $N but you are to fast to hit.", ch, buf, victim, TO_VICT $
	act( AT_SKILL, "$n launches a barrage of $t energy balls towards $N but $E is to fast to hit.", ch, buf, victim, TO_NOTVICT$
	learn_from_failure( ch, gsn_sgkamikaze );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
    ch->mana -= energy;
    return;
}
*/

void 
do_tentacle_attack(CHAR_DATA * ch, char *argument)
{
	CHAR_DATA *victim;

	if (IS_NPC(ch) && IS_AFFECTED(ch, AFF_CHARM)) {
		send_to_char("You can't concentrate enough for that.\n\r", ch);
		return;
	}
	if (!IS_NPC(ch) && ch->exp < skill_table[gsn_tentacle]->skill_level[ch->class]) {
		send_to_char("You better leave the martial arts to fighters.\n\r", ch);
		return;
	}
	if ((victim = who_fighting(ch)) == NULL) {
		send_to_char("You aren't fighting anyone.\n\r", ch);
		return;
	}
	if (ch->mana < skill_table[gsn_tentacle]->min_mana) {
		send_to_char("You don't have enough energy.\n\r", ch);
		return;
	}
	if (ch->focus < skill_table[gsn_tentacle]->focus) {
		send_to_char("You need to focus more.\n\r", ch);
		return;
	} else
		ch->focus -= skill_table[gsn_tentacle]->focus;

	WAIT_STATE(ch, skill_table[gsn_tentacle]->beats);

	if (can_use_skill(ch, number_percent(), gsn_tentacle)) {
		learn_from_success(ch, gsn_tentacle);
		global_retcode = damage(ch, victim, (get_attmod(ch, victim) * number_range(1, 5)), gsn_tentacle);
	} else {
		learn_from_failure(ch, gsn_tentacle);
		global_retcode = damage(ch, victim, 0, gsn_tentacle);
	}

	ch->mana -= skill_table[gsn_tentacle]->min_mana;
}

/*
void do_genocide_attack( CHAR_DATA *ch, char *argument )
{
    char buf[MAX_STRING_LENGTH];
    char buf2[MAX_STRING_LENGTH];
    CHAR_DATA *victim;
    int shot = 0;
    int shots = 0;
    int dam = 0;
    int energy = 0;
    int damPerShot = 0;

    if( IS_NPC(ch) && IS_AFFECTED( ch, AFF_CHARM ) )
    {
	send_to_char( "You can't concentrate enough for that.\n\r", ch );
	return;
    }

    if( !IS_NPC(ch) && ch->exp < skill_table[gsn_sgkamikaze]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

    if( arg[0] == '\0' || atoi( arg ) <= 0 )
    {
	send_to_char( "Syntax: scatter <# of shots>\n\r", ch );
	return;
    }

    if( ( victim = who_fighting( ch ) ) == NULL )
    {
	send_to_char( "You aren't fighting anyone.\n\r", ch );
	return;
    }

    shot = atoi( arg );
    if( shot > 50 )
	shot = 50;
    energy = shot * skill_table[gsn_sgkamikaze]->min_mana;
    shots = shot;
    strcpy( buf, num_punct( shot ) );

    if( ch->mana < energy )
    {
	send_to_char( "You don't have enough energy.\n\r", ch );
	return;
    }
    if( ch->focus < ( skill_table[gsn_sgkamikaze]->focus * ( 1 + ( shot / 10 ) ) ) )
    {
	send_to_char( "You need to focus more.\n\r", ch );
	return;
    }
    else
	ch->focus -= ( skill_table[gsn_sgkamikaze]->focus * ( 1 + ( shot / 10 ) ) );

    WAIT_STATE( ch, ( skill_table[gsn_sgkamikaze]->beats * ( 1 + ( shot / 10 ) ) ) );

    if( can_use_skill( ch, number_percent(), gsn_sgkamikaze ) )
    {
	while( shots > 0 )
	{
	    switch( number_range( 1, 4 ) )
	    {
		default:
		case 1:
		    break;
		case 2:
		case 3:
		    dam += number_range( 0, 1 );
		    break;
		case 4:
		    dam += number_range( 0, 2 );
		    break;
	    }
	    shots--;
	}
	damPerShot = number_range( 1, 3 );
	strcpy( buf2, num_punct( get_attmod( ch, victim ) * dam * damPerShot ) );

	act( AT_SKILL, "You power up and yell, 'SCATTER SHOT!'", ch, NULL, victim, TO_CHAR );
	act2( AT_SKILL, "You launch a barrage of $t energy balls towards $N, "
		"all exploding on contact. &W[$T]", ch, buf, victim, TO_CHAR, buf2 );
	act( AT_SKILL, "$n powers up and yells, 'SCATTER SHOT!'", ch, NULL, victim, TO_VICT );
	act2( AT_SKILL, "$e launches a barrage of $t energy balls towards you, "
		"all exploding on contact. &W[$T]", ch, buf, victim, TO_VICT, buf2 );
	act( AT_SKILL, "$n powers up and yells, 'SCATTER SHOT!'", ch, NULL, victim, TO_NOTVICT );
	act2( AT_SKILL, "$e launches a barrage of $t energy balls towards $N, "
		"all exploding on contact. &W[$T]", ch, buf, victim, TO_NOTVICT, buf2 );

	learn_from_success( ch, gsn_sgkamikaze );
	global_retcode = damage( ch, victim, (get_attmod(ch, victim) * dam * damPerShot), TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You launch a barrage of $t energy balls towards $N but $E is to fast to hit.", ch, buf, victim, TO_CHAR );
	act( AT_SKILL, "$n launches a barrage of $t energy balls towards $N but you are to fast to hit.", ch, buf, victim, TO_VICT $
	act( AT_SKILL, "$n launches a barrage of $t energy balls towards $N but $E is to fast to hit.", ch, buf, victim, TO_NOTVICT$
	learn_from_failure( ch, gsn_sgkamikaze );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
    ch->mana -= energy;
    return;
}
*/

void 
do_skin_trap(CHAR_DATA * ch, char *argument)
{
	CHAR_DATA *victim;
	int 	dam = 0;

	if (!IS_NPC(ch) && ch->exp < skill_table[gsn_skin_trap]->skill_level[ch->class]) {
		send_to_char("You can't do that.\n\r", ch);
		return;
	}
	if ((victim = who_fighting(ch)) == NULL) {
		send_to_char("You aren't fighting anyone.\n\r", ch);
		return;
	}
	if (ch->mana < skill_table[gsn_skin_trap]->min_mana) {
		send_to_char("You don't have enough energy.\n\r", ch);
		return;
	}
	if (ch->focus < skill_table[gsn_skin_trap]->focus) {
		send_to_char("You need to focus more.\n\r", ch);
		return;
	}
	ch->focus -= skill_table[gsn_skin_trap]->focus;
	WAIT_STATE(ch, skill_table[gsn_skin_trap]->beats);

	if (can_use_skill(ch, number_percent(), gsn_skin_trap)) {
		dam = get_attmod(ch, victim) * number_range(20, 25);
		if (ch->charge > 0)
			dam = chargeDamMult(ch, dam);

		act(AT_SKILL, "A nodule of flesh detaches from you and soars towards $N, entrapping", ch, NULL, victim, TO_CHAR);
		act(AT_SKILL, "$m in its rubbery depths. &W[$t]", ch, num_punct(dam), victim, TO_CHAR);

		act(AT_SKILL, "Amidst the raging battle, a flicker of movement catches the corner", ch, NULL, victim, TO_VICT);
		act(AT_SKILL, "of your eye.  A large nodule of severed pink flesh soars towards", ch, NULL, victim, TO_VICT);
		act(AT_SKILL, "you, entrapping you within its rubbery depths. &W[$t]", ch, num_punct(dam), victim, TO_VICT);

		act(AT_SKILL, "A nodule of flesh detaches from $n and soars towards $N, entrapping", ch, NULL, victim, TO_NOTVICT);
		act(AT_SKILL, "$m in its rubbery depths. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT);

		dam = ki_absorb(victim, ch, dam, gsn_skin_trap);
		learn_from_success(ch, gsn_skin_trap);
		global_retcode = damage(ch, victim, dam, TYPE_HIT);
	} else {
		act(AT_SKILL, "You missed $N with your skin trap.", ch, NULL, victim, TO_CHAR);

		act(AT_SKILL, "A nodule of flesh detaches from you and soars towards $N,", ch, NULL, victim, TO_CHAR);
		act(AT_SKILL, "but $E manages to avoid it, and you re-absorb your skin. &W[$t]", ch, num_punct(0), victim, TO_CHAR);

		act(AT_SKILL, "Amidst the raging battle, a flicker of movement catches the", ch, NULL, victim, TO_VICT);
		act(AT_SKILL, "corner of your eye.  A large nodule of severed pink flesh soars", ch, NULL, victim, TO_VICT);
		act(AT_SKILL, "towards you.  You narrowly avoid it, and $N re-absorbs it into", ch, NULL, victim, TO_VICT);
		act(AT_SKILL, "self. &W[$t]", ch, num_punct(0), victim, TO_VICT);

		act(AT_SKILL, "A nodule of flesh detaches from $n and soars towards $N,", ch, NULL, victim, TO_NOTVICT);
		act(AT_SKILL, "but $E manages to avoid it, and you re-absorb your skin. &W[$t]", ch, num_punct(0), victim, TO_CHAR);

		learn_from_failure(ch, gsn_skin_trap);
		global_retcode = damage(ch, victim, 0, TYPE_HIT);
	}

	ch->mana -= skill_table[gsn_skin_trap]->min_mana;
}