00001 #if defined(macintosh)
00002 #include <types.h>
00003 #else
00004 #include <sys/types.h>
00005 #endif
00006 #include <stdio.h>
00007 #include <string.h>
00008 #include <time.h>
00009 #include "merc.h"
00010 #include "interp.h"
00011 #include "tables.h"
00012 #include "lookup.h"
00013
00014 void do_side_kick(CHAR_DATA *ch, char *argument) {
00015 CHAR_DATA *victim;
00016 int chance=0;
00017
00018 if (!IS_NPC(ch) && ch->level <
00019 skill_table[gsn_side_kick].skill_level[ch->class])
00020 {
00021 send_to_char("You better leave the martial arts to monks.\n\r", ch);
00022 return;
00023 }
00024
00025 if (argument[0] == '\0')
00026 {
00027 victim = ch->fighting;
00028 if (victim == NULL)
00029 {
00030 send_to_char("But you aren't fighting anyone!\n\r",ch);
00031 return;
00032 }
00033 }
00034 else if ((victim = get_char_room(ch,argument)) == NULL)
00035 {
00036 send_to_char("They aren't here.\n\r",ch);
00037 return;
00038 }
00039
00040 if (victim->position < POS_FIGHTING)
00041 {
00042 act("You'll have to let $M get back up first.",ch,NULL,victim,TO_CHAR);
00043 return;
00044 }
00045
00046 if (victim == ch)
00047 {
00048 send_to_char("You try to kick your own head, but fail.\n\r",ch);
00049 return;
00050 }
00051
00052 if ( IS_NPC(victim) && victim->fighting != NULL &&
00053 !is_same_group(ch,victim->fighting))
00054 {
00055 send_to_char("Kill stealing is not permitted.\n\r",ch);
00056 return;
00057 }
00058
00059 if (IS_AFFECTED(ch,AFF_CHARM) && ch->master == victim)
00060 {
00061 act("But $N is your friend!",ch,NULL,victim,TO_CHAR);
00062 return;
00063 }
00064
00065 WAIT_STATE( ch, skill_table[gsn_side_kick].beats );
00066
00067 if ((get_skill(ch,gsn_side_kick) > number_percent())
00068 && damage(ch,victim,number_range(1,ch->level)*2,gsn_side_kick,DAM_OTHER,TRUE))
00069 {
00070
00071
00072
00073 check_improve(ch,gsn_side_kick,TRUE,1);
00074
00075 if (ch->size >= victim->size)
00076
00077 chance += 10;
00078 else
00079
00080 chance -= 5;
00081
00082 chance += get_curr_stat(ch,STAT_STR) / 2;
00083
00084 chance -= (get_curr_stat(victim,STAT_DEX))/5;
00085
00086
00087
00088
00089 if (IS_SET(ch->off_flags,OFF_FAST) || IS_AFFECTED(ch,AFF_HASTE))
00090 chance += 5;
00091 if (IS_SET(victim->off_flags,OFF_FAST) ||
00092 IS_AFFECTED(victim,AFF_HASTE))
00093 chance -= 5;
00094
00095 chance += (ch->level - victim->level);
00096
00097 if (chance <= 0)
00098 chance =1;
00099
00100
00101
00102
00103
00104
00105 if (number_percent() <= chance)
00106 {
00107 act("$n knocks you to the ground with a powerful kick!", ch, NULL, victim, TO_VICT);
00108 act("Your leg slams into $N, and knocks $M to the ground!", ch, NULL, victim,TO_CHAR);
00109 act("$n sends $N to the ground with a powerful kick.", ch, NULL, victim, TO_NOTVICT);
00110 check_improve(ch, gsn_side_kick, TRUE, 1);
00111 DAZE_STATE(victim, 1 * PULSE_VIOLENCE);
00112 WAIT_STATE(ch,skill_table[gsn_side_kick].beats);
00113 victim->position = POS_RESTING;
00114 }
00115
00116
00117
00118
00119
00120 check_improve(ch, gsn_side_kick, FALSE, 1);
00121
00122
00123
00124 }
00125 else
00126 {
00127
00128 act ("$n's kick falls short.", ch,NULL,victim, TO_VICT);
00129 act("$N gracefully turns with the kick.", ch, NULL, victim, TO_CHAR);
00130 check_improve(ch,gsn_side_kick,FALSE,1);
00131 }
00132
00133 check_killer(ch,victim);
00134 return;
00135 }
00136