martial_art.c
muddy/src/martial_art.c · 207.5 KB
From the archive astrum.tar.bz2
Download the archive « Back to the archive contents
/* $Id: martial_art.c,v 1.666 2004/09/20 10:49:50 shrike Exp $ */
/************************************************************************************
* Copyright 2004 Astrum Metaphora consortium *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
************************************************************************************/
/************************************************************************************
* ANATOLIA 2.1 is copyright 1996-1997 Serdar BULUT, Ibrahim CANPUNAR *
* ANATOLIA has been brought to you by ANATOLIA consortium *
* Serdar BULUT {Chronos} bulut@rorqual.cc.metu.edu.tr *
* Ibrahim Canpunar {Asena} canpunar@rorqual.cc.metu.edu.tr *
* Murat BICER {KIO} mbicer@rorqual.cc.metu.edu.tr *
* D.Baris ACAR {Powerman} dbacar@rorqual.cc.metu.edu.tr *
* By using this code, you have agreed to follow the terms of the *
* ANATOLIA license, in the file Anatolia/anatolia.licence *
***********************************************************************************/
/************************************************************************************
* 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-1995 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 *
*************************************************************************************/
/************************************************************************************
* Copyright (c) 1998 fjoe <fjoe@iclub.nsu.ru> *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the following disclaimer. *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND *
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE *
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE *
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE *
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL *
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS *
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) *
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY *
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF *
* SUCH DAMAGE. *
************************************************************************************/
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <stdarg.h>
#if !defined (WIN32)
#include <unistd.h>
#include <sys/time.h>
#endif
#include <ctype.h>
#ifdef SUNOS
#include <stdarg.h>
#include "compat/compat.h"
#endif
#include "war.h"
#include "merc.h"
#include "fight.h"
#include "wanderers.h"
DECLARE_DO_FUN (do_yell);
DECLARE_DO_FUN (do_sleep);
DECLARE_DO_FUN (do_sit);
DECLARE_DO_FUN (do_bash_door);
DECLARE_DO_FUN (do_look);
DECLARE_DO_FUN (set_spellbane);
DECLARE_DO_FUN (do_visible);
DECLARE_DO_FUN (do_throw_spear);
DECLARE_DO_FUN (do_throw_shuriken);
DECLARE_DO_FUN (do_throw_knife);
DECLARE_DO_FUN (do_throw_grenade);
extern bool check_trust(CHAR_DATA *ch, CHAR_DATA *victim);
extern STAT_DATA stat_record;
void check_downstrike (CHAR_DATA *, CHAR_DATA *);
void check_ground_control (CHAR_DATA *, CHAR_DATA *, int,int);
void agent_net_printf (CHAR_DATA *, CHAR_DATA *, int);
void one_hit (CHAR_DATA *, CHAR_DATA *, int, int);
void set_fighting (CHAR_DATA *, CHAR_DATA *);
bool recharge_battery (CHAR_DATA *, int);
bool check_mirror_image (CHAR_DATA *ch, CHAR_DATA *victim);
static inline bool check_yell (CHAR_DATA *, CHAR_DATA *, bool);
//
// rolling is auto-skill of thieves that enables them to roll out
// of bash, throw, trip attacks
//
bool check_roll (CHAR_DATA * ch)
{
int chance ;
if ((chance = get_skill (ch, gsn_roll)) <= 1) return FALSE ;
if (ch->move < 15 && !IS_NPC (ch)) return FALSE ;
chance = chance / 2 ;
chance += get_curr_stat (ch, STAT_DEX) / 2 ;
chance -= 2 * (ch->size - 6);
if (IS_AFFECTED (ch, AFF_HASTE)) chance += 10 ;
if (IS_AFFECTED (ch, AFF_SLOW)) chance -= 10 ;
chance -= number_range (0, 15);
if (number_percent () > chance)
{
check_improve (ch, gsn_roll, FALSE, 1);
return FALSE ;
}
act("$n ×ÙËÁÔÙ×ÁÅÔÓÑ ÉÚ-ÐÏÄ ÕÄÁÒÁ.", ch, NULL, NULL, TO_ROOM);
act("ôÙ ×ÙËÁÔÙ×ÁÅÛØÓÑ ÉÚ-ÐÏÄ ÕÄÁÒÁ.", ch, NULL, NULL, TO_CHAR);
check_improve (ch, gsn_roll, TRUE, 1);
// reset character position
RESET_WAIT_STATE (ch);
ch->position = POS_STANDING ;
return TRUE ;
}
// rolling is auto-skill of warriors that enables them to recovery
// of trip, throw attacks
bool check_recovery (CHAR_DATA * ch, CHAR_DATA * victim)
{
int chance;
if ((chance = get_skill (ch, gsn_recovery)) <= 1) return FALSE;
if (ch->move < 15 && !IS_NPC (ch)) return FALSE;
chance = chance / 2;
chance += get_curr_stat (ch, STAT_DEX);
if (IS_AFFECTED (ch, AFF_HASTE)) chance += 10;
if (IS_AFFECTED (ch, AFF_SLOW)) chance -= 10;
chance -= number_range (0, 10);
// samurai's recovery is slightly worse
if (IS_SAMURAI(ch)) chance -= 10;
if (number_percent() > chance)
{
check_improve (ch, gsn_recovery, FALSE, 1);
return FALSE;
}
// GM : aikido skill
if (number_range(0, 300) < get_skill(ch, sn_lookup("aikido")))
{
act("$n ÉÓÐÏÌØÚÕÅÔ ÓÉÌÕ ÐÒÏÔÉ×ÎÉËÁ, ÐÒÏÔÉ× ÎÅÇÏ ÓÁÍÏÇÏ.", ch, NULL, NULL, TO_ROOM);
act("ôÙ ÉÓÐÏÌØÚÕÅÛØ ÓÉÌÕ ÐÒÏÔÉ×ÎÉËÁ, ÐÒÏÔÉ× ÎÅÇÏ ÓÁÍÏÇÏ.", ch, NULL, NULL, TO_CHAR);
if (victim)
DAZE_STATE(victim, PULSE_VIOLENCE * 2);
check_improve(ch, sn_lookup("aikido"), TRUE, 1);
} else
{
act("$n ÉÚÂÅÇÁÅÔ ÐÁÄÅÎÉÑ É ÕÄÅÒÖÉ×ÁÅÔÓÑ ÎÁ ÎÏÇÁÈ.", ch, NULL, NULL, TO_ROOM);
act("ôÙ ÉÚÂÅÇÁÅÛØ ÐÁÄÅÎÉÑ É ÕÄÅÒÖÉ×ÁÅÛØÓÑ ÎÁ ÎÏÇÁÈ.", ch, NULL, NULL, TO_CHAR);
check_improve(ch, sn_lookup("aikido"), FALSE, 1);
}
// reset character position
RESET_WAIT_STATE (ch);
ch->position = POS_STANDING;
return TRUE;
}
// jammer is clan skill that enables to jamm
// bash, throw attacks
bool check_jammer (CHAR_DATA * ch)
{
int chance ;
if ((chance = get_skill (ch, gsn_jammer)) <= 1) return FALSE ;
if (ch->move < 15 && !IS_NPC (ch)) return FALSE ;
chance = chance * 6 / 10 ;
if (number_percent () < 50) chance += number_range (1, 10);
else chance -= number_range (1, 10);
if (number_percent () < chance)
{
check_improve (ch, gsn_jammer, TRUE, 1);
return TRUE ;
}
check_improve (ch, gsn_jammer, FALSE, 1);
return FALSE ;
}
// check if perception skill is working to detect any danger
bool check_perception (CHAR_DATA * ch, CHAR_DATA * victim)
{
int chance = 0 ;
chance = get_skill (ch, gsn_perception) / 2;
if (chance == 0)
{
chance = get_skill (ch, gsn_awareness) * (2 / 3);
if (is_affected(ch, sn_lookup("force sense")))
chance += get_curr_stat(ch, STAT_LCK);
} else
{
chance += get_skill (ch, gsn_awareness) / 4;
if (is_affected(ch, sn_lookup("force sense")))
chance += get_curr_stat(ch, STAT_LCK) / 4;
}
if (chance == 0) return FALSE ;
chance = chance / 4 + 4 * (get_curr_stat (ch, STAT_LCK) -
get_curr_stat (victim, STAT_LCK));
if (number_percent () < chance)
{
check_improve (ch, gsn_perception, 2, TRUE);
check_improve (ch, gsn_awareness, 2, TRUE);
return TRUE ;
}
check_improve (ch, gsn_perception, 2, FALSE);
check_improve (ch, gsn_awareness, 2, FALSE);
return FALSE ;
}
//
// those who are mastered in swords can riposte the attack
// and redirect it to the opponent
//
void check_riposte (CHAR_DATA * ch, CHAR_DATA * victim, int dam)
{
int chance ;
OBJ_DATA * wield ;
if ((chance = get_skill (ch, gsn_riposte)) <= 1) return ;
// must wield a primary weapon to riposte
// and this weapon must be sword
if ((wield = get_eq_char (ch, WEAR_WIELD)) == NULL) return ;
if (wield->value[0] != WEAPON_SWORD) return ;
// chance to success
chance = chance * 2 / 10 ;
chance += get_curr_stat (ch, STAT_STR);
chance -= get_curr_stat (victim, STAT_STR) / 2 ;
if (number_percent () < chance)
{
act("ôÙ ÐÁÒÉÒÕÅÛØ ÕÄÁÒ $N É ÎÁÎÏÓÉÛØ ÏÔ×ÅÔÎÙÊ ÕÄÁÒ!",
ch, NULL, victim, TO_CHAR | ACT_VERBOSE);
act("$n ÐÁÒÉÒÕÅÔ Ô×ÏÊ ÕÄÁÒ É ÎÁÎÏÓÉÔ ÏÔ×ÅÔÎÙÊ ÕÄÁÒ!",
ch, NULL, victim, TO_VICT | ACT_VERBOSE);
check_improve (ch, gsn_riposte, TRUE, 3);
damage (ch, victim, dam, gsn_riposte, TYPE_UNDEFINED, TRUE);
return ;
}
check_improve (ch, gsn_riposte, FALSE, 4);
return ;
}
//
// those who are mastered in daggers can rapidly restrike
// when parrying the attack
//
void check_restrike (CHAR_DATA * ch, CHAR_DATA * victim)
{
int chance ;
OBJ_DATA * wield ;
if ((chance = get_skill (ch, gsn_restrike)) <= 1) return ;
// must wield a primary weapon to restrike
// and this weapon must be dagger
if ((wield = get_eq_char (ch, WEAR_WIELD)) == NULL) return ;
if (wield->value[0] != WEAPON_DAGGER) return ;
// chance to success
chance = chance * 1 / 10 ;
if (IS_AFFECTED (ch, AFF_HASTE)) chance += 5 ;
if (IS_AFFECTED (ch, AFF_SLOW)) chance -= 5 ;
chance += get_curr_stat (ch, STAT_DEX) / 4 ;
if (number_percent () < chance)
{
act("ôÙ ÎÁÎÏÓÉÛØ ÍÏÌÎÉÅÎÏÓÎÙÊ ÕÄÁÒ ËÉÎÖÁÌÏÍ ÓË×ÏÚØ ÁÔÁËÕ $N.",
ch, NULL, victim, TO_CHAR | ACT_VERBOSE);
act("$n ÎÁÎÏÓÉÔ ÍÏÌÎÉÅÎÏÓÎÙÊ ÕÄÁÒ ËÉÎÖÁÌÏÍ ÓË×ÏÚØ Ô×ÏÀ ÁÔÁËÕ.",
ch, NULL, victim, TO_VICT | ACT_VERBOSE);
check_improve (ch, gsn_restrike, TRUE, 1);
one_hit (ch, victim, gsn_restrike, WEAR_WIELD);
return ;
}
check_improve (ch, gsn_restrike, FALSE, 1);
return ;
}
//
// warriors can bash opponent to the ground disabling him
//
void do_bash (CHAR_DATA * ch, const char * argument)
{
char arg [MAX_INPUT_LENGTH] ;
int chance, wait, damage_bash ;
CHAR_DATA * victim ;
if (MOUNTED (ch))
{
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ÔÏÌËÁÔØÓÑ ÓÉÄÑ × ÓÅÄÌÅ!", ch);
return ;
}
argument = one_argument(argument, arg, sizeof(arg));
if ((chance = get_skill (ch, gsn_bash)) == 0)
{
char_act("ôÏÌËÁÔØÓÑ? üÔÏ ËÁË?", ch);
return ;
}
// special skill to bash doors
if (arg[0] != '\0' && !str_cmp (arg, "door"))
{
do_bash_door (ch, argument);
return ;
}
if (ch->move < 40 && !IS_NPC (ch))
{
char_act("ôÙ ÓÌÉÛËÏÍ ÕÓÔÁÌ.", ch);
return ;
}
// find opponent
if (arg[0] == '\0')
{
victim = ch->fighting ;
if (victim == NULL ||
victim->in_room != ch->in_room)
{
char_act("îÏ ÔÙ ÎÉ Ó ËÅÍ ÎÅ ÓÒÁÖÁÅÛØÓÑ!", ch);
return ;
}
} else if ((victim = get_char_room(ch, arg)) == NULL)
{
char_act("ôÁËÉÈ ÔÕÔ ÎÅÔ.", ch);
return ;
}
if (IS_AFFECTED (ch, AFF_FEAR))
{
char_act("ôÙ ÞÔÏ? ôÙ ÖÅ ÍÏÖÅÛØ ËÏÇÏ-ÎÉÂÕÄØ ÓÂÉÔØ Ó ÎÏÇ!", ch);
return ;
}
if (is_safe (ch, victim)) return ;
// wait state to character that performs bashing
WAIT_STATE (ch, SKILL(gsn_bash)->beats);
if (victim->position < POS_FIGHTING)
{
act("äÁÊ $gN{ÅÍÕ} ÄÌÑ ÎÁÞÁÌÁ ×ÓÔÁÔØ.", ch, NULL, victim, TO_CHAR);
return ;
}
if (victim == ch)
{
char_act("ôÙ ÐÙÔÁÅÛØÓÑ ×ÙÛÉÂÉÔØ ÓÅÂÅ ÍÏÚÇÉ, ÎÏ, Ë ÎÅÓÞÁÓÔØÀ, ÂÅÚÕÓÐÅÛÎÏ.", ch);
return ;
}
if (MOUNTED (victim))
{
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ÔÏÌËÎÕÔØ ×ÓÁÄÎÉËÁ!", ch);
return ;
}
if (IS_AFFECTED (ch, AFF_CHARM) && ch->master == victim)
{
act("$N Ô×ÏÊ ÈÏÚÑÉÎ.", ch, NULL, victim, TO_CHAR);
return ;
}
// 70% probability that protective shield would prevent the attack
if (is_affected (victim, gsn_protective_shield)
&& number_percent () < 70)
{
act_puts("ôÙ ÐÙÔÁÅÛØÓÑ ÓÂÉÔØ $N Ó ÎÏÇ, ÎÏ ÎÁÔÙËÁÅÛØÓÑ ÎÁ ÏËÒÕÖÁÀÝÕÀ $gN{ÅÇÏ} ÚÁÝÉÔÎÕÀ ÁÕÒÕ.",
ch, NULL, victim, TO_CHAR, POS_FIGHTING);
act_puts("$n ÐÙÔÁÅÔÓÑ ÓÂÉÔØ ÔÅÂÑ Ó ÎÏÇ ÎÏ ÏÔÌÅÔÁÅÔ ÐÒÏÞØ, ÎÁÔÏÌËÎÕ×ÛÉÓØ ÎÁ ÏËÒÕÖÁÀÝÕÀ ÔÅÂÑ ÚÁÝÉÔÎÕÀ ÁÕÒÕ.",
ch, NULL, victim, TO_VICT, POS_FIGHTING);
act_puts("$n ÐÙÔÁÅÔÓÑ ÓÂÉÔØ Ó ÎÏÇ $N, ÎÏ ÎÁÔÙËÁÅÔÓÑ ÎÁ $gN{ÅÇÏ} ÚÁÝÉÔÎÕÀ ÁÕÒÕ.",
ch, NULL, victim, TO_NOTVICT, POS_FIGHTING);
return;
}
// modifiers
if (IS_NPC (ch) && IS_SET (ch->pIndexData->off_flags, OFF_FAST))
chance += 10 ;
if (IS_NPC (victim) && IS_SET (victim->pIndexData->off_flags, OFF_FAST))
chance -= 20 ;
chance += (ch->size - victim->size) * 3 ; // size bonus
chance += (LVL (ch) - LVL (victim)) * 2 ; // level bonus
chance += get_curr_stat (ch, STAT_STR);
chance -= get_curr_stat (victim, STAT_DEX) * 3 / 2 ;
if (IS_AFFECTED (ch, AFF_FLYING)) chance -= 10 ;
if (IS_AFFECTED (victim, AFF_FLYING)) chance -= 10 ;
if (IS_AFFECTED (victim, gsn_shield)) chance -= 10 ;
RESET_WAIT_STATE (ch);
if(check_mirror_image(ch,victim))
return;
// now the attack
if (number_percent () < chance)
{
AFFECT_DATA af ;
af.where = TO_AFFECTS ;
af.type = gsn_bash ;
af.level = LVL (ch) ;
af.duration = 1 ;
af.modifier = 0 ;
af.location = APPLY_NONE ;
af.bitvector = 0 ;
act("$n ÓÉÌØÎÏ ÔÏÌËÁÅÔ ÔÅÂÑ É ÔÙ ÐÁÄÁÅÛØ!",
ch, NULL, victim, TO_VICT);
act("ôÙ ÓÉÌØÎÏ ÔÏÌËÁÅÛØ $N É $gN{ÏÎ} ÐÁÄÁÅÔ!",
ch, NULL, victim, TO_CHAR);
act("$n ÓÉÌØÎÏ ÔÏÌËÁÅÔ $N É $gN{ÏÎ} ÐÁÄÁÅÔ.",
ch, NULL, victim, TO_NOTVICT);
check_improve (ch, gsn_bash, TRUE, 1);
// check for rolling out the attack
if (check_roll (victim)) return ;
wait = number_fuzzy (2);
victim->position = POS_RESTING ;
damage_bash = (ch->damroll / 2) +
number_range (4, 4 + ch->size + chance / 10);
damage (ch, victim, damage_bash, gsn_bash, DAM_BASH, TRUE);
if (check_recovery (victim, ch)) wait /= 2 ; else
if (check_jammer (victim)) wait /= 2 ; else
check_ground_control (ch, victim, chance, damage_bash);
wait = UMAX (wait, 1);
// daze/wait states
DAZE_STATE (victim, PULSE_VIOLENCE * wait) ;
WAIT_STATE (ch, SKILL(gsn_bash)->beats);
if (wait > 0) affect_to_char (victim, &af);
}
else
{
damage (ch, victim, 0, gsn_bash, DAM_BASH, TRUE);
act("ôÙ ÐÁÄÁÅÛØ, ÕÄÁÒÑÑÓØ ÇÏÌÏ×ÏÊ Ï ÚÅÍÌÀ!",
ch, NULL, victim, TO_CHAR);
act("$n ÐÁÄÁÅÔ, ÕÄÁÒÑÑÓØ ÇÏÌÏ×ÏÊ Ï ÚÅÍÌÀ!",
ch, NULL, victim, TO_NOTVICT);
act("ôÙ ÄÅÌÁÅÛØ ÛÁÇ × ÓÔÏÒÏÎÕ É $n ÐÁÄÁÅÔ, ÕÄÁÒÑÑÓØ ÇÏÌÏ×ÏÊ Ï ÚÅÍÌÀ!",
ch, NULL, victim, TO_VICT);
check_improve (ch, gsn_bash, FALSE, 1);
// ch->position = POS_RESTING ;
WAIT_STATE (ch, SKILL(gsn_bash)->beats);
}
if (check_yell (ch, victim, (ch->fighting != NULL)))
{
act_yell(victim, "îÁ ÐÏÍÏÝØ! $i ÔÏÌËÁÅÔ ÍÅÎÑ!", ch, NULL);
agent_net_printf (victim, ch, ANET_ATTACK);
}
}
//
// trip non-flying opponent to put him onto the ground
//
void do_trip (CHAR_DATA * ch, const char * argument)
{
char arg [MAX_INPUT_LENGTH] ;
int chance, wait, damage_trip ;
bool avoided = FALSE;
CHAR_DATA * victim ;
if (MOUNTED(ch))
{
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ÄÅÌÁÔØ ÐÏÄÓÅÞËÕ ÐÏËÁ ÔÙ ÓÉÄÉÛØ ×ÅÒÈÏÍ!", ch);
return ;
}
one_argument(argument, arg, sizeof(arg));
if ((chance = get_skill (ch, gsn_trip)) == 0)
{
char_act("ðÏÄÓÅÞËÁ? á ÞÔÏ ÜÔÏ ÔÁËÏÅ?", ch);
return ;
}
if (ch->move < 20 && !IS_NPC (ch))
{
char_act("ôÙ ÓÌÉÛËÏÍ ÕÓÔÁÌ.", ch);
return ;
}
// find opponent
if (arg[0] == '\0')
{
victim = ch->fighting ;
if (victim == NULL
|| victim->in_room != ch->in_room)
{
char_act("îÏ ÔÙ ÎÉ Ó ËÅÍ ÎÅ ÓÒÁÖÁÅÛØÓÑ!", ch);
return ;
}
} else if ((victim = get_char_room(ch, arg)) == NULL)
{
char_act("ôÁËÉÈ ÔÕÔ ÎÅÔ.", ch);
return ;
}
if (is_safe (ch, victim))
return;
if (IS_AFFECTED (ch, AFF_FEAR))
{
char_act("ôÙ ÞÔÏ? á ×ÄÒÕÇ ÏÎ ÕÐÁÄÅÔ?!", ch);
return ;
}
if (victim->position < POS_FIGHTING)
{
act("$N ÕÖÅ ÎÁ ÚÅÍÌÅ.", ch, NULL, victim, TO_CHAR);
return ;
}
if (victim == ch)
{
act("$n ÐÏÄÓÅËÁÅÔ Ó×ÏÀ ÓÏÂÓÔ×ÅÎÎÕÀ ÎÏÇÕ!", ch, NULL, NULL, TO_ROOM);
return ;
}
if (MOUNTED (victim))
{
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ÓÄÅÌÁÔØ ÐÏÄÓÅÞËÕ ×ÓÁÄÎÉËÕ!", ch);
return ;
}
if (IS_AFFECTED (ch, AFF_CHARM) && ch->master == victim)
{
act("$N Ô×ÏÊ ÈÏÚÑÉÎ.", ch, NULL, victim, TO_CHAR);
return ;
}
if (IS_AFFECTED (victim, AFF_FLYING))
{
act("$gN{ÅÇÏ} ÓÔÕÐÎÉ ÎÅ ËÁÓÁÀÔÓÑ ÚÅÍÌÉ.", ch, NULL, victim, TO_CHAR);
return ;
}
// modifiers
if (IS_NPC (ch) && IS_SET (ch->pIndexData->off_flags, OFF_FAST))
chance += 10 ;
if (IS_NPC (victim) && IS_SET (victim->pIndexData->off_flags, OFF_FAST))
chance -= 20 ;
chance += (ch->size - victim->size) * 2 ; // size bonus
chance += (LVL (ch) - LVL (victim)) * 2 ; // level bonus
chance += get_curr_stat (ch, STAT_DEX) -
get_curr_stat (victim, STAT_DEX);
if (IS_AFFECTED (ch, AFF_FLYING)) chance -= 10 ;
RESET_WAIT_STATE (ch);
if (check_mirror_image(ch,victim))
return;
// now the attack
if (number_percent () < chance)
{
AFFECT_DATA af ;
af.where = TO_AFFECTS ;
af.type = gsn_trip ;
af.level = LVL (ch) ;
af.duration = 1 ;
af.modifier = LVL (victim);
af.location = APPLY_AC ;
af.bitvector = 0 ;
act("$n ÄÅÌÁÅÔ ÔÅÂÅ ÐÏÄÓÅÞËÕ É ÔÙ ÐÁÄÁÅÛØ!",
ch, NULL, victim, TO_VICT);
act("ôÙ ÐÏÄÓÅËÁÅÛØ ÎÏÇÕ $N É $gN{ÏÎ} ÐÁÄÁÅÔ!",
ch, NULL, victim, TO_CHAR);
act("$n ÄÅÌÁÅÔ ÐÏÄÓÅÞËÕ $N, ÒÏÎÑÑ $gn{ÅÇÏ} ÎÁ ÚÅÍÌÀ.",
ch, NULL, victim, TO_NOTVICT);
check_improve (ch, gsn_trip, TRUE, 1);
// check for rolling out the attack
if (check_roll (victim))
{
WAIT_STATE (ch, SKILL(gsn_trip)->beats);
return;
}
wait = number_fuzzy (2);
victim->position = POS_RESTING ;
if ((avoided = (check_recovery(victim, ch) || check_jammer (victim))))
wait = wait / 2;
damage_trip = (ch->damroll / 2) +
number_range (4, 4 + ch->size + chance / 10);
damage (ch, victim, damage_trip, gsn_trip, DAM_BASH, TRUE);
if (!avoided)
check_downstrike (ch, victim);
wait = UMAX (wait, 1);
// daze/wait states
DAZE_STATE (victim, PULSE_VIOLENCE * wait) ;
WAIT_STATE (ch, SKILL(gsn_trip)->beats);
if (wait > 0) affect_to_char (victim, &af);
} else
{
damage (ch, victim, 0, gsn_trip, DAM_BASH, TRUE);
WAIT_STATE (ch, SKILL(gsn_trip)->beats);
check_improve (ch, gsn_trip, FALSE, 1);
}
if (JUST_KILLED(victim))
return;
if (check_yell (ch, victim, (ch->fighting != NULL)))
{
act_yell(victim, "îÁ ÐÏÍÏÝØ! $i ÐÙÔÁÅÔÓÑ ÐÏÄÓÅÞØ ÍÅÎÑ!", ch, NULL);
agent_net_printf (victim, ch, ANET_ATTACK);
}
}
//
// throws opponent to the ground damaging and disabling him
// or throw item (shuriken, spear, knife, grenade)
//
void do_throw (CHAR_DATA * ch, const char * argument)
{
char arg [MAX_INPUT_LENGTH] ;
int chance, wait, damage_throw, hand ;
CHAR_DATA * victim ;
if (MOUNTED (ch))
{
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ËÉÄÁÔØ ÐÏËÁ ÔÙ ×ÅÒÈÏÍ!", ch);
return ;
}
if (IS_AFFECTED (ch, AFF_FEAR))
{
char_act("ôÅÂÅ ÓÔÒÁÛÎÏ ËÉÄÁÔØÓÑ! á ×ÄÒÕÇ ÔÙ ÐÒÏÍÁÈÎÅÛØÓÑ?", ch);
return ;
}
argument = one_argument(argument, arg, sizeof(arg));
// special throwings
if (!str_cmp (arg, "spear"))
{
do_throw_spear (ch, argument);
return ;
}
if (!str_cmp (arg, "shuriken"))
{
do_throw_shuriken (ch, argument);
return ;
}
if (!str_cmp (arg, "knife"))
{
do_throw_knife (ch, argument);
return ;
}
if (!str_cmp (arg, "grenade"))
{
do_throw_grenade (ch, argument);
return ;
}
if ((chance = get_skill (ch, gsn_throw)) == 0)
{
char_act("îÅÕÍÅÈÁ ÔÉÐÁ ÔÅÂÑ ÎÅ ÓÍÏÖÅÔ ÂÒÏÓÉÔØ ÄÁÖÅ ÐÁÌËÕ.", ch);
return ;
}
if (ch->move < 40 && !IS_NPC(ch))
{
char_act("ôÙ ÓÌÉÛËÏÍ ÕÓÔÁÌ.", ch);
return ;
}
hand = (get_eq_char (ch, WEAR_WIELD) != NULL) +
(get_eq_char (ch, WEAR_SECOND_WIELD) != NULL) +
(get_eq_char (ch, WEAR_SHIELD) != NULL) +
(get_eq_char (ch, WEAR_HOLD) != NULL);
if (hand >= 2)
{
char_act("ôÅÂÅ ÎÕÖÎÁ ÈÏÔÑ ÂÙ ÏÄÎÁ Ó×ÏÂÏÄÎÁÑ ÒÕËÁ, ÞÔÏÂÙ ËÉÄÁÔØ", ch);
return ;
}
if (hand > 0) chance = chance * 3 / 5 ;
if ((victim = ch->fighting) == NULL || victim->in_room != ch->in_room)
{
char_act("ôÙ ÎÉ Ó ËÅÍ ÎÅ ÓÒÁÖÁÅÛØÓÑ.", ch);
return ;
}
if (IS_AFFECTED (ch, AFF_STUN) || IS_AFFECTED (ch, AFF_WEAK_STUN))
{
act("ôÙ ÐÁÒÁÌÉÚÏ×ÁÎ ÁÔÁËÏÊ $N É ÎÅ ÍÏÖÅÛØ ÂÒÏÓÉÔØ $gn{ÅÇÏ}!\n",
ch, NULL, victim, TO_CHAR);
return ;
}
if (is_safe (ch, victim)) return ;
WAIT_STATE (ch, SKILL(gsn_throw)->beats);
if (IS_AFFECTED (ch, AFF_FLYING))
{
char_act("ô×ÏÉ ÎÏÇÉ ÄÏÌÖÎÙ ËÁÓÁÔØÓÑ ÚÅÍÌÉ ÄÌÑ ÒÁ×ÎÏ×ÅÓÉÑ.", ch);
return;
}
if (IS_AFFECTED (ch,AFF_CHARM) && ch->master == victim)
{
act("$N Ô×ÏÊ ÈÏÚÑÉÎ!", ch, NULL, victim, TO_CHAR);
return ;
}
// 50% probability that protective shield would prevent the attack
if (is_affected (victim, gsn_protective_shield) &&
number_percent () < 50)
{
act_puts("ôÙ ÎÅ ÍÏÖÅÛØ ÄÏÓÔÁÔØ $gn{ÅÇÏ} ÒÕËÏÊ ÓË×ÏÚØ ÚÁÝÉÔÎÕÀ ÁÕÒÕ.", ch, NULL, victim, TO_CHAR, POS_FIGHTING);
act_puts("õ $n ÎÅ ÐÏÌÕÞÉÌÏÓØ ÐÒÏ×ÅÓÔÉ ÎÁ ÔÅÂÅ ÂÒÏÓÏË.", ch, NULL, victim, TO_VICT, POS_FIGHTING);
act_puts("õ $n ÎÅ ÐÏÌÕÞÉÌÏÓØ ÐÒÏ×ÅÓÔÉ ÂÒÏÓÏË ÎÁ $N.", ch, NULL, victim, TO_NOTVICT, POS_FIGHTING);
return ;
}
// modifiers
if (IS_NPC (ch) && IS_SET (ch->pIndexData->off_flags, OFF_FAST))
chance += 10 ;
if (IS_NPC (victim) && IS_SET (victim->pIndexData->off_flags, OFF_FAST))
chance -= 20 ;
chance += (ch->size - victim->size) * 2 ; // size bonus
chance += (LVL (ch) - LVL (victim)) * 2 ; // level bonus
chance += get_curr_stat (ch, STAT_STR);
chance -= get_curr_stat (victim, STAT_DEX) * 2 ;
if (IS_AFFECTED (ch, AFF_FLYING)) chance -= 10 ;
if (IS_AFFECTED (victim, AFF_FLYING)) chance -= 10 ;
RESET_WAIT_STATE (ch);
if(check_mirror_image(ch,victim))
return;
// now the attack
if (number_percent () < chance)
{
AFFECT_DATA af ;
af.where = TO_AFFECTS ;
af.type = gsn_throw ;
af.level = LVL (ch) ;
af.duration = 1 ;
af.modifier = 0 ;
af.location = APPLY_NONE ;
af.bitvector = 0 ;
act("ôÙ Ó ÏÛÅÌÏÍÌÑÀÝÅÊ ÓÉÌÏÊ ÂÒÏÓÁÅÛØ $N ÏÂ ÚÅÍÌÀ.",
ch, NULL, victim, TO_CHAR);
act("$n Ó ÏÛÅÌÏÍÌÑÀÝÅÊ ÓÉÌÏÊ ÂÒÏÓÁÅÔ ÔÅÂÑ ÏÂ ÚÅÍÌÀ!",
ch, NULL, victim, TO_VICT);
act("$n Ó ÏÛÅÌÏÍÌÑÀÝÅÊ ÓÉÌÏÊ ÂÒÏÓÁÅÔ $N ÏÂ ÚÅÍÌÀ.",
ch, NULL, victim, TO_NOTVICT);
check_improve (ch, gsn_throw, TRUE, 1);
// check for rolling out the attack
if (check_roll (victim)) return ;
wait = number_fuzzy (2);
victim->position = POS_RESTING ;
damage_throw = LVL (ch) + get_curr_stat (ch, STAT_STR);
damage (ch, victim, damage_throw, gsn_throw, DAM_BASH, TRUE);
if (check_recovery (victim, ch)) wait /= 2 ; else
if (check_jammer (victim)) wait /= 2 ; else
check_ground_control (ch, victim, chance, damage_throw);
wait = UMAX (wait, 1);
// daze/wait states
DAZE_STATE (victim, PULSE_VIOLENCE * wait) ;
WAIT_STATE (ch, SKILL(gsn_throw)->beats);
if (wait > 0) affect_to_char (victim, &af);
}
else
{
act("õ ÔÅÂÑ ÎÅ ÐÏÌÕÞÉÌÏÓØ ÓÈ×ÁÔÉÔØ Ó×ÏÅÇÏ ÐÒÏÔÉ×ÎÉËÁ.",
ch, NULL, NULL, TO_CHAR);
act("$N ÐÙÔÁÅÔÓÑ ÓÈ×ÁÔÉÔØ ÔÅÂÑ, ÎÏ ÔÙ ÌÏ×ËÏ ×ÙÓËÁÌØÚÙ×ÁÅÛØ ÉÚ $c1{$gN{ÏÎ}} ÒÕË.",
victim, NULL, ch, TO_CHAR);
act("$n ÐÙÔÁÅÔÓÑ ÓÈ×ÁÔÉÔØ $N.",
ch, NULL, victim, TO_NOTVICT);
WAIT_STATE (ch, SKILL(gsn_throw)->beats * 3 / 2);
check_improve (ch, gsn_throw, FALSE, 1);
}
}
//
// Lizards can trip opponent with their tail
//
void do_tail (CHAR_DATA * ch, const char * argument)
{
char arg [MAX_INPUT_LENGTH] ;
int chance, wait, damage_tail, damage_bonus = 0 ;
OBJ_DATA * tail_ring ;
AFFECT_DATA * af ;
CHAR_DATA * victim ;
if (MOUNTED (ch))
{
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ÐÏÄÓÅËÁÔØ È×ÏÓÔÏÍ, ÐÏËÁ ÔÙ ÓÉÄÉÛØ ×ÅÒÈÏÍ!", ch);
return ;
}
one_argument(argument, arg, sizeof(arg));
if ((chance = get_skill (ch, gsn_tail)) == 0)
{
char_act("Huh?", ch);
return ;
}
if (ch->move < 20 && !IS_NPC (ch))
{
char_act("ôÙ ÓÌÉÛËÏÍ ÕÓÔÁÌ.", ch);
return ;
}
// find opponent
if (arg[0] == '\0')
{
victim = ch->fighting ;
if (victim == NULL
|| victim->in_room != ch->in_room)
{
char_act("îÏ ÔÙ ÎÉ Ó ËÅÍ ÎÅ ÓÒÁÖÁÅÛØÓÑ!", ch);
return;
}
} else if ((victim = get_char_room(ch, arg)) == NULL)
{
char_act("ôÁËÉÈ ÔÕÔ ÎÅÔ.", ch);
return ;
}
if (is_safe (ch, victim)) return ;
WAIT_STATE (ch, SKILL(gsn_tail)->beats);
if (is_affected(ch, gsn_polymorph))
{
char_act("÷ ÉÚÍÅÎÅÎÎÏÍ ÓÏÓÔÏÑÎÉÉ È×ÏÓÔ ÎÅ ÓÌÕÛÁÅÔÓÑ ÔÅÂÑ!", ch);
return ;
}
if (victim->position < POS_FIGHTING)
{
act("äÁÊ $gN{ÅÍÕ} ÄÌÑ ÎÁÞÁÌÁ ×ÓÔÁÔØ.", ch, NULL, victim, TO_CHAR);
return ;
}
if (victim == ch)
{
char_act("ôÙ ÎÁÐÒÁÓÎÏ ÐÙÔÁÅÛØÓÑ ÕÄÁÒÉÔØ ÓÅÂÑ ÓÏÂÓÔ×ÅÎÎÙÍ È×ÏÓÔÏÍ, ÜÔÏ ÖÅ ÂÏÌØÎÏ!", ch);
return ;
}
if (IS_AFFECTED (ch, AFF_CHARM) && ch->master == victim)
{
act("$N Ô×ÏÊ ÈÏÚÑÉÎ!", ch, NULL, victim, TO_CHAR);
return ;
}
// 50% probability that protective shield would prevent the attack
if (is_affected (victim, gsn_protective_shield)
&& number_percent () < 50)
{
act_puts("ô×ÏÊ È×ÏÓÔ ÓËÏÌØÚÉÔ ÐÏ ÚÁÝÉÔÎÏÊ ÁÕÒÅ, ÏËÒÕÝÁÀÝÅÊ $N.",
ch, NULL, victim, TO_CHAR, POS_FIGHTING);
act_puts("è×ÏÓÔ $n ÓËÏÌØÚÉÔ ÐÏ ÚÁÝÉÔÎÏÊ ÁÕÒÅ, ÏËÒÕÖÁÀÝÅÊ ÔÅÂÑ.",
ch, NULL, victim, TO_VICT, POS_FIGHTING);
act_puts("è×ÏÓÔ $n ÓËÏÌØÚÉÔ ÐÏ ÚÁÝÉÔÎÏÊ ÁÕÒÅ, ÏËÒÕÖÁÀÝÅÊ $N.",
ch, NULL, victim, TO_NOTVICT, POS_FIGHTING);
return ;
}
// modifiers
if (IS_NPC (ch) && IS_SET (ch->pIndexData->off_flags, OFF_FAST))
chance += 10 ;
if (IS_NPC (victim) && IS_SET (victim->pIndexData->off_flags, OFF_FAST))
chance -= 20 ;
// size, level and weight
if (ch->carry_weight > victim->carry_weight)
chance += 5;
else
chance -= 5;
if (ch->size < victim->size) chance += (ch->size - victim->size) * 3 ;
else chance += (ch->size - victim->size) * 7 / 5 ;
chance += (LVL (ch) - LVL (victim)) * 2 ;
// stats
chance += get_curr_stat (ch, STAT_STR) + get_curr_stat (ch, STAT_DEX);
chance -= get_curr_stat (victim, STAT_DEX) * 2 ;
if (IS_AFFECTED (ch, AFF_FLYING)) chance -= 10 ;
if (IS_AFFECTED (victim, AFF_FLYING)) chance -= 10 ;
if (MOUNTED (victim)) chance -= 20 ;
RESET_WAIT_STATE (ch);
if (check_mirror_image(ch, victim))
return;
if ((tail_ring = get_eq_char (ch, WEAR_TAIL)) != NULL)
{
damage_bonus = tail_ring->weight > 150 ?
(50 + (tail_ring->weight - 150) / 5) : tail_ring->weight / 3 ;
for (af = tail_ring->affected ; af ; af = af->next)
{
if (af->where != TO_AFFECTS) continue ;
switch (af->location)
{
case APPLY_STR: damage_bonus += af->modifier * 25 ; break ;
case APPLY_DEX: chance += af->modifier * 10 ; break ;
case APPLY_HITROLL: chance += af->modifier * 4 ; break ;
case APPLY_DAMROLL: damage_bonus += af->modifier * 10 ; break ;
}
}
}
// now the attack
if (number_percent() < (chance * 2 / 3))
{
act("$n ÐÏÄÓÅËÁÅÔ Ô×ÏÉ ÎÏÇÉ ÍÏÝÎÙÍ ÕÄÁÒÏÍ È×ÏÓÔÁ!",
ch, NULL, victim, TO_VICT);
act("ôÙ ÐÏÄÓÅËÁÅÛØ ÎÏÇÉ $N ÍÏÝÎÙÍ ÕÄÁÒÏÍ È×ÏÓÔÁ!",
ch, NULL, victim, TO_CHAR);
act("$n ÐÏÄÓÅËÁÅÔ ÎÏÇÉ $N ÍÏÝÎÙÍ ÕÄÁÒÏÍ È×ÏÓÔÁ.",
ch, NULL, victim, TO_NOTVICT);
check_improve (ch, gsn_tail, TRUE, 1);
// check for rolling out the attack
if (check_roll (victim)) return ;
wait = number_fuzzy (3);
victim->position = POS_RESTING ;
damage_tail = ch->damroll +
(2 * number_range(4, 4 + 2 * ch->size + chance / 10));
damage_tail += damage_bonus;
damage (ch, victim, damage_tail, gsn_tail, DAM_BASH, TRUE);
if (check_recovery (victim, ch)) wait /= 2 ; else
if (check_jammer (victim)) wait /= 2 ; else
check_ground_control (ch, victim, chance, damage_tail);
wait = UMAX (wait, 1);
// daze/wait states
DAZE_STATE (victim, PULSE_VIOLENCE * wait) ;
WAIT_STATE (ch, SKILL(gsn_tail)->beats);
} else
{
damage (ch, victim, 0, gsn_tail, DAM_BASH, TRUE);
act("ôÙ ÔÅÒÑÅÛØ ÒÁ×ÎÏ×ÅÓÉÅ É ÐÁÄÁÅÛØ!",
ch, NULL, victim, TO_CHAR);
act("$n ÔÅÒÑÅÔ ÒÁ×ÎÏ×ÅÓÉÅ É ÐÁÄÁÅÔ!.",
ch, NULL, victim, TO_NOTVICT);
act("ôÙ Õ×ÏÒÁÞÉ×ÁÅÛØÓÑ ÏÔ È×ÏÓÔÁ $n, "
"ÚÁÓÔÁ×ÌÑÑ $gn{ÅÇÏ} ÐÏÔÅÒÑÔØ ÒÁ×ÎÏ×ÅÓÉÅ É ÕÐÁÓÔØ.",
ch, NULL, victim, TO_VICT);
check_improve (ch, gsn_tail, FALSE, 1);
ch->position = POS_RESTING ;
WAIT_STATE (ch, SKILL(gsn_tail)->beats * 3 / 2);
}
if (check_yell (ch, victim, (ch->fighting != NULL)))
{
act_yell(victim, "îÁ ÐÏÍÏÝØ! $i ÐÙÔÁÅÔÓÑ ÓÂÉÔØ ÍÅÎÑ È×ÏÓÔÏÍ!", ch, NULL);
agent_net_printf (victim, ch, ANET_ATTACK);
}
}
//
// Large warriors can crush opponent with their boots
//
void do_crush_boots (CHAR_DATA * ch, const char * argument)
{
int chance, wait, damage_crush ;
CHAR_DATA * victim ;
OBJ_DATA * boots ;
AFFECT_DATA * af ;
if (IS_NPC (ch)) return ;
if (MOUNTED (ch))
{
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ÄÁ×ÉÔØ ÏÐÐÏÎÅÎÔÏ× ÎÏÇÁÍÉ, ÐÏËÁ ÔÙ ÓÉÄÉÛØ ×ÅÒÈÏÍ!", ch);
return ;
}
if ((chance = get_skill (ch, gsn_crush_boots)) == 0)
{
char_act("ôÙ ÎÅ ÕÍÅÅÛØ ÄÁ×ÉÔØ ÏÐÐÏÎÅÎÔÏ× ÎÏÇÁÍÉ.", ch);
return ;
}
if (ch->move < 40 && !IS_NPC(ch))
{
char_act("ôÙ ÓÌÉÛËÏÍ ÕÓÔÁÌ.", ch);
return ;
}
if ((victim = ch->fighting) == NULL || victim->in_room != ch->in_room)
{
char_act("ôÙ ÎÉ Ó ËÅÍ ÎÅ ÓÒÁÖÁÅÛØÓÑ.", ch);
return ;
}
if (is_safe (ch, victim)) return;
WAIT_STATE (ch, SKILL(gsn_crush_boots)->beats);
if (victim->position < POS_FIGHTING)
{
act("äÁÊ $gN{ÅÍÕ} ÄÌÑ ÎÁÞÁÌÁ ×ÓÔÁÔØ.", ch, NULL, victim, TO_CHAR);
return ;
}
if (IS_AFFECTED (ch, AFF_CHARM) && ch->master == victim)
{
act("$N Ô×ÏÊ ÈÏÚÑÉÎ!", ch, NULL, victim, TO_CHAR);
return ;
}
if ((boots = get_eq_char (ch, WEAR_FEET)) == NULL)
{
char_act("ôÅÂÅ ÎÕÖÎÙ ÓÁÐÏÇÉ, ÞÔÏÂÙ ÄÁ×ÉÔØ ÏÐÐÏÎÅÎÔÏ× ÎÏÇÁÍÉ.", ch);
return ;
}
if (victim->size * 3 / 2 > ch->size)
{
char_act("ôÙ ÄÏÌÖÅÎ ÂÙÔØ ËÁË ÍÉÎÉÍÕÍ × ÐÏÌÔÏÒÁ ÒÁÚÁ ÂÏÌØÛÅ ×ÒÁÇÁ, ÞÔÏÂÙ ÒÁÓÔÏÐÔÁÔØ ÅÇÏ.", ch);
return ;
}
// 50% probability that protective shield would prevent the attack
if (is_affected (victim, gsn_protective_shield)
&& number_percent () < 50)
{
act_puts("ô×ÏÑ ÐÏÐÙÔËÁ ÒÁÓÔÏÐÔÁÔØ $N ÎÁÔÙËÁÅÔÓÑ ÎÁ ÚÁÝÉÔÎÕÀ ÁÕÒÕ, ÏËÒÕÖÁÀÝÕÀ $N.",
ch, NULL, victim, TO_CHAR, POS_FIGHTING);
act_puts("ðÏÐÙÔËÁ $n ÒÁÓÔÏÐÔÁÔØ ÔÅÂÑ ÎÁÔÙËÁÅÔÓÑ ÎÁ ÚÁÝÉÔÎÕÀ ÁÕÒÕ.",
ch, NULL, victim, TO_VICT, POS_FIGHTING);
act_puts("ðÏÐÙÔËÁ $n ÒÁÓÔÏÐÔÁÔØ $N ÎÁÔÙËÁÅÔÓÑ ÎÁ ÚÁÝÉÔÎÕÀ ÁÕÒÕ, ÏËÒÕÖÁÀÝÕÀ $N.",
ch, NULL, victim, TO_NOTVICT, POS_FIGHTING);
return;
}
// modifiers
// size, level and weight
if (ch->carry_weight > victim->carry_weight)
chance += 4;
if (ch->carry_weight < victim->carry_weight)
chance -= 4;
chance += (ch->size - victim->size) * 2 ;
chance += (LVL (ch) - LVL (victim));
// stats
chance += (get_curr_stat (ch, STAT_STR) - 18) * 4 ;
chance += (get_curr_stat (ch, STAT_DEX) - 18) * 4 ;
chance -= (get_curr_stat (victim, STAT_STR) - 18) * 4 ;
chance -= (get_curr_stat (victim, STAT_DEX) - 18) * 4 ;
if (IS_AFFECTED (ch, AFF_FLYING)) chance -= 10 ;
if (IS_AFFECTED (victim, AFF_FLYING)) chance -= 20 ;
if (MOUNTED (victim)) chance -= 20 ;
damage_crush = boots->weight > 150 ?
(50 + (boots->weight - 150) / 5) : boots->weight / 3 ;
damage_crush = UMIN(damage_crush, 200);
damage_crush += LVL (ch) + ch->damroll ;
// boots
for (af = boots->affected ; af ; af = af->next)
{
if (af->where != TO_AFFECTS) continue ;
switch (af->location)
{
case APPLY_STR: damage_crush += af->modifier * 25 ; break ;
case APPLY_DEX: chance += af->modifier * 10 ; break ;
case APPLY_HITROLL: chance += af->modifier * 4 ; break ;
case APPLY_DAMROLL: damage_crush += af->modifier * 10 ; break ;
}
}
if (IS_NPC(victim))
{
chance += 20;
damage_crush *= 2;
if (IS_AFFECTED (victim, AFF_CHARM))
{
chance += 20;
}
}
RESET_WAIT_STATE (ch);
if (check_mirror_image(ch, victim))
return;
// now the attack
if (number_percent () < chance)
{
act("$n ÒÁÓÔÁÐÔÙ×ÁÅÔ ÔÅÂÑ Ó×ÏÉÍÉ $p!", ch, boots, victim, TO_VICT);
act("ôÙ ÒÁÓÔÁÐÔÙ×ÁÅÛØ $N Ó×ÏÉÍÉ $p!", ch, boots, victim, TO_CHAR);
act("$n ÒÁÓÔÁÐÔÙ×ÁÅÔ $N Ó×ÏÉÍÉ $p.", ch, boots, victim, TO_NOTVICT);
check_improve (ch, gsn_crush_boots, TRUE, 1);
// check for rolling out the attack
if (check_roll (victim)) return ;
wait = number_fuzzy (2);
victim->position = POS_RESTING;
damage (ch, victim, damage_crush, gsn_crush_boots, DAM_BASH, TRUE);
if (check_recovery (victim, ch)) wait /= 2 ; else
if (check_jammer (victim)) wait /= 2 ; else
check_ground_control (ch, victim, chance, damage_crush);
wait = UMAX (wait, 1);
// daze/wait states
DAZE_STATE (victim, PULSE_VIOLENCE * wait) ;
WAIT_STATE (ch, SKILL(gsn_crush_boots)->beats);
} else
{
damage (ch, victim, 0, gsn_crush_boots, DAM_BASH, TRUE);
// act("ôÙ ÐÒÏÍÁÈÎÕÌÓÑ!", ch, boots, victim, TO_CHAR);
act("$n ÐÏÐÙÔÁÌÓÑ ÒÁÚÄÁ×ÉÔØ $N Ó×ÏÉÍÉ $p, ÎÏ ÐÒÏÍÁÈÎÕÌÓÑ.",
ch, boots, victim, TO_NOTVICT);
act("$n ÐÏÐÙÔÁÌÓÑ ÒÁÚÄÁ×ÉÔØ ÔÅÂÑ Ó×ÏÉÍÉ $p, ÎÏ ÔÙ Õ×ÅÒÎÕÌÓÑ!",
ch, boots, victim, TO_VICT);
check_improve (ch, gsn_crush_boots, FALSE, 1);
WAIT_STATE (ch, SKILL(gsn_crush_boots)->beats);
}
}
//
// Crushes an opponent inflicting damage and disabling him
//
void do_crush (CHAR_DATA * ch, const char * argument)
{
int chance, wait, damage_crush ;
CHAR_DATA * victim ;
if (MOUNTED (ch))
{
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ÎÁÎÏÓÉÔØ ÓÏËÒÕÛÉÔÅÌØÎÙÅ ÕÄÁÒÙ, ÐÏËÁ ÔÙ ÓÉÄÉÛØ ×ÅÒÈÏÍ!", ch);
return ;
}
if ((chance = get_skill (ch, gsn_crush)) == 0)
{
char_act("ôÙ ÎÅ ÕÍÅÅÛØ ÎÁÎÏÓÉÔØ ÓÏËÒÕÛÉÔÅÌØÎÙÅ ÕÄÁÒÙ.", ch);
return ;
}
if (ch->move < 40 && !IS_NPC(ch))
{
char_act("ôÙ ÓÌÉÛËÏÍ ÕÓÔÁÌ.", ch);
return ;
}
if ((victim = ch->fighting) == NULL || victim->in_room != ch->in_room)
{
char_act("ôÙ ÎÉ Ó ËÅÍ ÎÅ ÓÒÁÖÁÅÛØÓÑ.", ch);
return ;
}
if (is_safe (ch, victim)) return ;
WAIT_STATE (ch, SKILL(gsn_crush)->beats);
if (victim->position < POS_FIGHTING)
{
act("äÁÊ $gN{ÅÍÕ} ÄÌÑ ÎÁÞÁÌÁ ×ÓÔÁÔØ.", ch, NULL, victim, TO_CHAR);
return ;
}
if (IS_AFFECTED (ch, AFF_CHARM) && ch->master == victim)
{
act("$N Ô×ÏÊ ÈÏÚÑÉÎ!", ch, NULL, victim, TO_CHAR);
return ;
}
// 50% probability that protective shield would prevent the attack
if (is_affected (victim, gsn_protective_shield)
&& number_percent () < 50)
{
act_puts("ô×ÏÊ ÓÏËÒÕÛÉÔÅÌØÎÙÊ ÕÄÁÒ ÎÁÔÙËÁÅÔÓÑ ÎÁ ÚÁÝÉÔÎÕÀ ÁÕÒÕ, ÏËÒÕÖÁÀÝÕÀ $N.",
ch, NULL, victim, TO_CHAR, POS_FIGHTING);
act_puts("óÏËÒÕÛÉÔÅÌØÎÙÊ ÕÄÁÒ $n ÎÁÔÙËÁÅÔÓÑ ÎÁ ÏËÒÕÖÁÀÝÕÀ ÔÅÂÑ ÚÁÝÉÔÎÕÀ ÁÕÒÕ.",
ch, NULL, victim, TO_VICT, POS_FIGHTING);
act_puts("óÏËÒÕÛÉÔÅÌØÎÙÊ ÕÄÁÒ $n ÎÁÔÙËÁÅÔÓÑ ÎÁ ÚÁÝÉÔÎÕÀ ÁÕÒÕ, ÏËÒÕÖÁÀÝÕÀ $N.",
ch, NULL, victim, TO_NOTVICT, POS_FIGHTING);
return;
}
// modifiers
if (IS_NPC (ch) && IS_SET (ch->pIndexData->off_flags, OFF_FAST))
chance += 10 ;
if (IS_NPC (victim) && IS_SET (victim->pIndexData->off_flags, OFF_FAST))
chance -= 20 ;
// size, level and weight
if (ch->carry_weight > victim->carry_weight)
chance += 5;
else
chance -= 5;
chance += (LVL (ch) - LVL (victim)) * 2;
if (ch->size < victim->size) chance += (ch->size - victim->size) * 3 ;
else chance += (ch->size - victim->size) * 7 / 5 ;
// stats
chance += get_curr_stat (ch, STAT_STR);
chance -= get_curr_stat (victim, STAT_DEX) * 4 / 3 ;
if (IS_AFFECTED (ch, AFF_FLYING)) chance -= 10 ;
if (IS_AFFECTED (victim, AFF_FLYING)) chance -= 10 ;
if (MOUNTED (victim)) chance -= 20 ;
RESET_WAIT_STATE (ch);
if (check_mirror_image(ch, victim))
return;
// now the attack
if (number_percent () < chance)
{
act("$n ÎÁÎÏÓÉÔ ÓÏËÒÕÛÉÔÅÌØÎÙÊ ÕÄÁÒ, ÄÒÏÂÑÝÉÊ ÔÅÂÅ ËÏÓÔÉ!",
ch, NULL, victim, TO_VICT);
act("ôÙ ÎÁÎÏÓÉÛØ $N ÓÏËÒÕÛÉÔÅÌØÎÙÊ ÕÄÁÒ, ÄÒÏÂÑÝÉÊ $gN{ÅÍÕ} ËÏÓÔÉ!",
ch, NULL, victim, TO_CHAR);
act("$n ÎÁÎÏÓÉÔ $N ÓÏËÒÕÛÉÔÅÌØÎÙÊ ÕÄÁÒ, ÄÒÏÂÑÝÉÊ $gN{ÅÍÕ} ËÏÓÔÉ.",
ch, NULL, victim, TO_NOTVICT);
check_improve (ch, gsn_crush, TRUE, 1);
// check for rolling out the attack
if (check_roll (victim)) return ;
wait = number_fuzzy (2);
victim->position = POS_RESTING;
damage_crush = (ch->damroll / 2) +
number_range(4, 4 + ch->size + chance / 10);
damage (ch, victim, damage_crush, gsn_crush, DAM_BASH, TRUE);
if (check_recovery (victim, ch)) wait /= 2 ; else
if (check_jammer (victim)) wait /= 2 ; else
check_ground_control (ch, victim, chance, damage_crush);
wait = UMAX (wait, 1);
// daze/wait states
DAZE_STATE (victim, PULSE_VIOLENCE * wait) ;
WAIT_STATE (ch, SKILL(gsn_crush)->beats);
} else
{
damage (ch, victim, 0, gsn_crush, DAM_BASH, TRUE);
act("ôÙ ÐÁÄÁÅÛØ ÌÉÃÏÍ ÎÁ ÚÅÍÌÀ!", ch, NULL, victim, TO_CHAR);
act("$n ÐÁÄÁÅÔ ÌÉÃÏÍ ÎÁ ÚÅÍÌÀ.", ch, NULL, victim, TO_NOTVICT);
act("ôÙ ÉÚÂÅÇÁÅÛØ ÓÏËÒÕÛÉÔÅÌØÎÏÇÏ ÕÄÁÒÁ $n, "
"ÚÁÓÔÁ×ÌÑÑ $gn{ÅÇÏ} ÕÐÁÓÔØ ÌÉÃÏÍ ÎÁ ÚÅÍÌÀ!",
ch, NULL, victim, TO_VICT);
check_improve (ch, gsn_crush, FALSE, 1);
ch->position = POS_RESTING ;
WAIT_STATE (ch, SKILL(gsn_crush)->beats * 3 / 2);
}
}
//
// Clan Demons skill, that allows to prick opponent with horns and
// crush him to the ground
//
void do_horn_prick (CHAR_DATA * ch, const char * argument)
{
char arg [MAX_INPUT_LENGTH] ;
int chance = 0, wait, damage_horn ;
CHAR_DATA * victim ;
if (MOUNTED(ch))
{
char_act("÷ÅÒÈÏÍ ÎÁ ËÏÎÅ? ïÞÅÎØ ÚÁÂÁ×ÎÏ.", ch);
}
if (!IS_NPC(ch))
{
if ((chance = get_skill (ch, gsn_horn_prick)) == 0)
{
char_act("Huh?", ch);
return ;
}
}
if (ch->move < 30 && !IS_NPC (ch))
{
char_act("ôÙ ÓÌÉÛËÏÍ ÕÓÔÁÌ.", ch);
return ;
}
argument = one_argument(argument, arg, sizeof(arg));
// find opponent
if (arg[0] == '\0')
{
victim = ch->fighting ;
if (victim == NULL || victim->in_room != ch->in_room)
{
char_act("îÏ ÔÙ ÎÉ Ó ËÅÍ ÎÅ ÓÒÁÖÁÅÛØÓÑ!", ch);
return ;
}
} else if ((victim = get_char_room(ch, arg)) == NULL)
{
char_act("ôÁËÉÈ ÔÕÔ ÎÅÔ.", ch);
return ;
}
if (!IS_NPC(ch))
{
if (!IS_DEMON (ch))
{
char_act("ôÙ ÄÏÌÖÅÎ ÓÎÁÞÁÌÁ ÓÔÁÔØ ÄÅÍÏÎÏÍ.", ch);
return ;
}
}
if (is_safe (ch, victim))
return;
if (IS_AFFECTED (ch, AFF_CHARM) && ch->master == victim)
{
act("$N Ô×ÏÊ ÈÏÚÑÉÎ!", ch, NULL, victim, TO_CHAR);
return ;
}
// modifiers
chance -= (ch->size - victim->size) * 3 ;
chance += (LVL (ch) - LVL (victim)) * 2 ;
chance += get_curr_stat (ch, STAT_STR);
chance -= get_curr_stat (victim, STAT_DEX) * 2 ;
if (is_affected (victim, gsn_protective_shield))
chance /= 2;
// instant kill on NPC
if (!IS_NPC(ch))
{
if (number_range(1, 200) == 1 && IS_NPC (victim))
{
act("ôÙ {R***òáúòù÷áåûø***{x Ó×ÏÉÍÉ ÒÏÇÁÍÉ $N ÎÁ {Rä÷å þáóôé{x.",
ch, NULL, victim, TO_CHAR);
act("$n {R***òáúòù÷áåô***{x $N Ó×ÏÉÍÉ ÒÏÇÁÍÉ ÎÁ {Rä÷å þáóôé{x.",
ch, NULL, victim, TO_NOTVICT);
act("$n {R***òáúòù÷áåô***{x ÔÅÂÑ Ó×ÏÉÍÉ ÒÏÇÁÍÉ ÎÁ {Rä÷å þáóôé{x.",
ch, NULL, victim, TO_VICT);
char_act("ôÙ {RÚÁÍÅÒÔ×Ï{x ÐÁÄÁÅÛØ ÎÁ ÚÅÍÌÀ.", victim);
victim->position = POS_DEAD ;
handle_death (ch, victim);
return ;
}
} else
if (number_range(1, 200) == 1 )
{
act("ôÙ {R***òáúòù÷áåûø***{x Ó×ÏÉÍÉ ÒÏÇÁÍÉ $N ÎÁ {Rä÷å þáóôé{x.",
ch, NULL, victim, TO_CHAR);
act("$n {R***òáúòù÷áåô***{x $N Ó×ÏÉÍÉ ÒÏÇÁÍÉ ÎÁ {Rä÷å þáóôé{x.",
ch, NULL, victim, TO_NOTVICT);
act("$n {R***òáúòù÷áåô***{x ÔÅÂÑ Ó×ÏÉÍÉ ÒÏÇÁÍÉ ÎÁ {Rä÷å þáóôé{x.",
ch, NULL, victim, TO_VICT);
char_act("ôÙ {RÚÁÍÅÒÔ×Ï{x ÐÁÄÁÅÛØ ÎÁ ÚÅÍÌÀ.", victim);
victim->position = POS_DEAD ;
handle_death (ch, victim);
return ;
}
RESET_WAIT_STATE (ch);
if (check_mirror_image(ch, victim))
return;
// now the attack
if (number_percent() < chance)
{
AFFECT_DATA af ;
af.where = TO_AFFECTS ;
af.type = gsn_throw ;
af.level = LVL (ch) ;
af.duration = 1 ;
af.modifier = 0 ;
af.location = APPLY_NONE ;
af.bitvector = 0 ;
act("$n ÐÏÄÃÅÐÉÌ ÔÅÂÑ Ó×ÏÉÍÉ ÒÏÇÁÍÉ É ËÉÄÁÅÔ Ï ÚÅÍÌÀ!",
ch, NULL, victim, TO_VICT);
act("ôÙ ÐÏÄÃÅÐÌÑÅÛØ $N Ó×ÏÉÍÉ ÒÏÇÁÍÉ É ÓÏ ×ÓÅÊ ÓÉÌÙ ËÉÄÁÅÛØ Ï ÚÅÍÌÀ!",
ch, NULL, victim, TO_CHAR);
act("$n ÐÏÄÃÅÐÌÑÅÔ $N Ó×ÏÉÍÉ ÒÏÇÁÍÉ É ËÉÄÁÅÔ Ï ÚÅÍÌÀ!",
ch, NULL, victim, TO_NOTVICT);
check_improve (ch, gsn_horn_prick, TRUE, 1);
// check for rolling out the attack
if (check_roll (victim)) return ;
wait = number_fuzzy (2);
damage_horn = number_range (LVL (ch) * 2, LVL (ch) * 10);
if (is_affected (victim, gsn_protective_shield)) damage_horn /= 2 ;
if (number_percent () > 90)
{
act("{RóÉÌÁ ÁÄÁ ÐÒÉÈÏÄÉÔ ÔÅÂÅ ÎÁ ÐÏÍÏÝØ!{x", ch, NULL, victim, TO_CHAR);
act("{Rï! îÅÔ! õ ÔÅÂÑ ÎÅÔ ÎÉ ÍÁÌÅÊÛÅÇÏ ÛÁÎÓÁ ÏÓ×ÏÂÏÄÉÔÓÑ!{x", ch, NULL, victim, TO_VICT);
damage (ch, victim, damage_horn * 2, gsn_throw, DAM_BASH, TRUE);
check_ground_control (ch, victim, chance, damage_horn);
}
damage (ch, victim, damage_horn, gsn_throw, DAM_BASH, TRUE);
if (check_recovery (victim, ch)) wait /= 2 ; else
if (check_jammer (victim)) wait /= 2 ; else
check_ground_control (ch, victim, chance, damage_horn);
wait = UMAX (wait, 1);
// daze/wait states
DAZE_STATE (victim, PULSE_VIOLENCE * wait) ;
WAIT_STATE (ch, SKILL(gsn_horn_prick)->beats);
if (wait > 0) affect_to_char (victim, &af);
}
else
{
act("ôÙ ÐÒÏÍÁÈÉ×ÁÅÛØÓÑ É ×ÔÙËÁÅÛØÓÑ ÒÏÇÁÍÉ ÐÒÑÍÏ × ÚÅÍÌÀ",
ch, NULL, victim, TO_CHAR);
act("$n ÓÏ ×ÓÅÇÏ ÒÁÚÍÁÈÕ ×ÔÙËÁÅÔÓÑ ÒÏÇÁÍÉ ÐÒÑÍÏ × ÚÅÍÌÀ.",
ch, NULL, victim, TO_NOTVICT);
act("ôÙ Õ×ÏÒÁÞÉ×ÁÅÛØÓÑ ÏÔ ÓÍÅÒÔÏÎÏÓÎÏÇÏ ÕÄÁÒÁ É "
"$n ×ÔÙËÁÅÔÓÑ ÒÏÇÁÍÉ × ÚÅÍÌÀ.", ch, NULL, victim, TO_VICT);
check_improve (ch, gsn_horn_prick, FALSE, 1);
ch->position = POS_RESTING ;
WAIT_STATE (ch, SKILL(gsn_horn_prick)->beats * 2);
}
if (check_yell (ch, victim, (ch->fighting != NULL)))
{
act_yell(victim, "îÁ ÐÏÍÏÝØ! $i ÐÙÔÁÅÔÓÑ ÚÁËÏÌÏÔØ ÍÅÎÑ!", ch, NULL);
agent_net_printf (victim, ch, ANET_ATTACK);
}
}
/*
* Disarm a creature.
* Caller must check for successful attack.
*/
void disarm(CHAR_DATA *ch, CHAR_DATA *victim, OBJ_DATA *obj)
{
OBJ_DATA *obj2;
int skill;
if (IS_OBJ_STAT(obj, ITEM_NOREMOVE)) {
act("$gN{ÅÇÏ} ÏÒÕÖÉÅ ÎÅ Ä×ÉÇÁÅÔÓÑ!", ch, NULL, victim, TO_CHAR);
act("$n ÐÙÔÁÅÔÓÑ ÏÂÅÚÏÒÕÖÉÔØ ÔÅÂÑ, ÎÏ Ô×ÏÅ ÏÒÕÖÉÅ ÎÅ Ä×ÉÇÁÅÔÓÑ!",
ch, NULL, victim, TO_VICT);
act("$n ÐÙÔÁÅÔÓÑ ÏÂÅÚÏÒÕÖÉÔØ $N, ÎÏ ÔÅÒÐÉÔ ÎÅÕÄÁÞÕ.",
ch, NULL, victim, TO_NOTVICT);
return;
}
if ((skill = get_skill(victim, gsn_grip))) {
skill += (get_curr_stat(victim, STAT_STR) -
get_curr_stat(ch, STAT_STR)) * 5;
if (number_percent() < skill) {
act("$N ÌÏ×ËÏ Õ×ÏÒÁÞÉ×ÁÅÔÓÑ É Õ ÔÅÂÑ ÎÅ ÐÏÌÕÞÁÅÔÓÑ $gN{ÅÇÏ} ÏÂÅÚÏÒÕÖÉÔØ!",
ch, NULL, victim, TO_CHAR);
act("$n ÐÙÔÁÅÔÓÑ ÏÂÅÚÏÒÕÖÉÔØ ÔÅÂÑ, ÎÏ ÔÙ ÌÏ×ËÏ Õ×ÏÒÁÞÉ×ÁÅÛØÓÑ!",
ch, NULL, victim, TO_VICT);
act("$n ÐÙÔÁÅÔÓÑ ÏÂÅÚÏÒÕÖÉÔØ $N, ÎÏ ÔÅÒÐÉÔ ÎÅÕÄÁÞÕ.",
ch, NULL, victim, TO_NOTVICT);
check_improve(victim, gsn_grip, TRUE, 1);
return;
}
else
check_improve(victim,gsn_grip,FALSE,1);
}
act_puts("$n ÷ùâé÷áåô ïòõöéå ÉÚ Ô×ÏÉÈ ÒÕË!", ch, NULL, victim, TO_VICT, POS_FIGHTING);
act_puts("ôÙ ïâåúïòõöé÷áåûø $N!", ch, NULL, victim, TO_CHAR, POS_FIGHTING);
act_puts("$n ÏÂÅÚÏÒÕÖÉ×ÁÅÔ $N!", ch, NULL, victim, TO_NOTVICT, POS_FIGHTING);
obj_from_char(obj);
if (IS_OBJ_STAT(obj, ITEM_NODROP)
|| IS_OBJ_STAT(obj,ITEM_INVENTORY)
|| (victim->in_war && victim->war_status == PS_ALIVE)
|| (victim->in_room
&& IS_SET(victim->in_room->room_flags, ROOM_BATTLE_ARENA)))
obj_to_char(obj, victim);
else
{
obj_to_room(obj, victim->in_room);
if (IS_NPC(victim)
&& victim->wait == 0
&& can_see_obj(victim,obj)
&& !can_get_obj(victim, obj, TRUE))
{
get_obj(victim, obj, NULL, TRUE);
wear_obj(victim, obj, TRUE);
}
}
if ((obj2 = get_eq_char(victim, WEAR_SECOND_WIELD)) != NULL)
{
act_puts("ôÙ ÐÅÒÅËÌÁÄÙ×ÁÅÛØ ÏÒÕÖÉÅ ÉÚ ÏÄÎÏÊ ÒÕËÉ × ÄÒÕÇÕÀ!",
ch, NULL, victim, TO_VICT, POS_FIGHTING);
act_puts("$N ÐÅÒÅËÌÁÄÙ×ÁÅÔ Ó×ÏÅ ÏÒÕÖÉÅ ÉÚ ÏÄÎÏÊ ÒÕËÉ × ÄÒÕÇÕÀ!",
ch, NULL, victim, TO_CHAR, POS_FIGHTING);
act_puts("$N ÐÅÒÅËÌÁÄÙ×ÁÅÔ Ó×ÏÅ ÏÒÕÖÉÅ ÉÚ ÏÄÎÏÊ ÒÕËÉ × ÄÒÕÇÕÀ!",
ch, NULL, victim, TO_NOTVICT, POS_FIGHTING);
unequip_char(victim, obj2);
equip_char(victim, obj2, WEAR_WIELD);
}
}
DO_FUN(do_berserk)
{
int chance, hp_percent;
int need, chars;
if ((chance = get_skill(ch, gsn_berserk)) == 0)
{
char_act("ô×ÏÅ ÌÉÃÏ {rÂÁÇÒÏ×ÅÅÔ{x ÏÔ ÎÁÐÒÑÖÅÎÉÑ, ÎÏ ÎÉÞÅÇÏ ÎÅ ÐÒÏÉÓÈÏÄÉÔ.", ch);
return;
}
if (IS_AFFECTED(ch, AFF_BERSERK)
|| is_affected(ch, gsn_berserk))
{
char_act("ôÙ ×ÐÁÄÁÅÛØ × ÑÒÏÓÔØ!", ch);
return;
}
if (IS_AFFECTED(ch, AFF_CALM))
{
char_act("ô×ÏÅ ÒÁÓÓÌÁÂÌÅÎÎÏÅ ÓÏÓÔÏÑÎÉÅ ÎÅ ÐÏÚ×ÏÌÑÅÔ ÔÅÂÅ ×ÐÁÓÔØ × ÑÒÏÓÔØ.", ch);
return;
}
need = SKILL(gsn_berserk)->min_mana;
chars = IS_SET (muddy_mode, MUDDY_WARR_MOVES) ? ch->move : ch->mana;
if (chars < need && !IS_NPC(ch))
{
char_act("õ ÔÅÂÑ ÎÅÄÏÓÔÁÔÏÞÎÏ ÜÎÅÒÇÉÉ.", ch);
return;
}
/* modifiers */
/* fighting */
if (ch->position == POS_FIGHTING)
chance += 25;
/* damage -- below 50% of hp helps, above hurts */
hp_percent = 100 * ch->hit / ch->max_hit;
chance += 50 - hp_percent / 2;
if (number_percent() < chance)
{
AFFECT_DATA af;
WAIT_STATE(ch, SKILL(gsn_berserk)->beats);
if (IS_SET (muddy_mode, MUDDY_WARR_MOVES))
ch->move -= need;
else
ch->mana -= need;
/* heal a little damage */
ch->hit += (ch->level + chance) * 2;
ch->hit = UMIN(ch->hit, ch->max_hit);
char_act("ô×ÏÊ ÐÕÌØÓ ÕÞÁÝÁÅÔÓÑ É ÑÒÏÓÔØ ÚÁÐÏÌÎÑÅÔ ÔÅÂÑ!", ch);
act_puts("÷ ÇÌÁÚÁÈ $c1{$n} ÐÏÑ×ÌÑÅÔÓÑ ÂÅÚÕÍÉÅ!", ch, NULL, NULL, TO_ROOM, POS_FIGHTING);
check_improve(ch, gsn_berserk, TRUE, 2);
af.where = TO_AFFECTS;
af.type = gsn_berserk;
af.level = LVL(ch);
af.duration = number_fuzzy(LVL(ch) / 8);
af.modifier = UMAX(1, LVL(ch) / 5);
af.bitvector = 0;
af.location = APPLY_HITROLL;
affect_to_char(ch,&af);
af.location = APPLY_DAMROLL;
affect_to_char(ch,&af);
af.bitvector = AFF_BERSERK;
af.modifier = 50;
// af.modifier = -1 * UMAX(10, 10 * (LVL(ch) / 5));
af.location = APPLY_AC;
affect_to_char(ch,&af);
} else
{
WAIT_STATE(ch, (SKILL(gsn_berserk)->beats) * 2);
if (IS_SET (muddy_mode, MUDDY_WARR_MOVES))
ch->move -= need/2;
else
ch->mana -= need/2;
char_act("ô×ÏÊ ÐÕÌØÓ ÕÞÁÝÁÅÔÓÑ, ÎÏ ÎÉÞÅÇÏ ÎÅ ÐÒÏÉÓÈÏÄÉÔ.", ch);
check_improve(ch, gsn_berserk, FALSE, 2);
}
}
DO_FUN(do_arrest)
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
clan_t *clan = NULL;
int chance;
clan = clan_lookup(ch->clan);
if (((chance = get_skill(ch, gsn_arrest)) == 0) && !IS_NPC(ch))
{
char_act("Huh?", ch);
return;
}
one_argument(argument, arg, sizeof(arg));
if (arg[0] == 0)
{
char_act("áÒÅÓÔÏ×ÁÔØ ËÏÇÏ.", ch);
return;
}
victim = get_char_room(ch, arg);
if (!IS_NPC(ch)) WAIT_STATE(ch, SKILL(gsn_arrest)->beats);
if (victim == NULL)
{
char_act("ôÁËÉÈ ÔÕÔ ÎÅÔ.", ch);
return;
}
if (IS_NPC(victim))
{
char_act("ôÙ ÐÅÒÅÄÕÍÁÌ ÅÇÏ ÁÒÅÓÔÏ×Ù×ÁÔØ", ch);
return;
}
if (ch == victim)
{
char_act("îÅÍÎÏÇÏ ÐÏÒÁÚÍÙÓÌÉ×, ÔÙ ÒÅÛÉÌ ÞÔÏ ÁÒÅÓÔÏ×Ù×ÁÔØ ÓÅÂÑ ÜÔÏ ËÁË-ÔÏ ÎÅÐÒÁ×ÉÌØÎÏ.", ch);
return;
}
if (victim->fighting)
{
char_act("üÔÏ ÐÒÏÂÌÅÍÁÔÉÞÎÏ ËÏÇÄÁ ÏÎ ÄÅÒÅÔÓÑ.", ch);
return;
}
if (ch->fighting)
{
char_act("ôÙ ÖÅ ÓÒÁÖÁÅÛØÓÑ!", ch);
return;
}
if (!IS_SET(victim->plr_flags, PLR_WANTED))
{
char_act("úÁ ÞÔÏ? ïÎ ÖÅ ÎÅ ÎÁÒÕÛÁÌ ÚÁËÏÎÁ!", ch);
return;
}
if (is_affected(victim, gsn_arrest))
{
act("îÏ ÏÎ ÕÖÅ ÁÒÅÓÔÏ×ÁÎ!.", ch, NULL, NULL, TO_CHAR);
return;
}
if (IS_SET(ch->plr_flags, PLR_WANTED))
{
char_act("ôÙ ÎÅ ÞÉÓÔ ÐÅÒÅÄ ÚÁËÏÎÏÍ!", ch);
return;
}
if (IS_IMMORTAL(victim))
{
char_act("ôÙ ÒÁÄ ÜÔÏ ÓÄÅÌÁÔØ, ÎÏ ÐÏÌÎÏÍÏÞÉÊ Õ ÔÅÂÑ ÎÅ È×ÁÔÁÅÔ", ch);
return;
}
if (IS_AFFECTED(ch,AFF_FEAR))
{
char_act("ôÙ ÞÔÏ? á ×ÄÒÕÇ ÏÎ ÔÅÂÑ ÐÏÔÏÍ ÕÂØÅÔ?!", ch);
return;
}
chance += can_see(victim, ch) ? -20 : 20;
chance += URANGE(-10, (get_curr_stat(ch, STAT_DEX)-20)*2, 10);
if (IS_NPC(ch)) chance = 20;
chance += (LVL(ch) - LVL(victim)) / 10;
if (current_time - victim->last_fight_time < 300) chance /= 2;
if(check_mirror_image(ch,victim))
return;
if (number_percent() < chance)
{
AFFECT_DATA af;
ROOM_INDEX_DATA* pRoomIndex;
pcskill_t *ps;
af.where = TO_AFFECTS;
af.type = gsn_arrest;
af.level = LVL(ch);
af.duration = LVL(victim) * 2;
af.bitvector = 0;
af.location = APPLY_MOVE;
af.modifier = -1 * (victim->max_move - 30);
TOGGLE_BIT(victim->plr_flags, PLR_WANTED);
affect_to_char(victim, &af);
act_puts("$n ÌÏ×ËÉÍ ÐÒÉÅÍÏÍ ×ÁÌÉÔ ÔÅÂÑ ÎÁ ÚÅÍÌÀ É ÎÁÄÅ×ÁÅÔ ÎÁ ÒÕËÉ ÎÁÒÕÞÎÉËÉ.", ch, NULL, victim, TO_VICT, POS_RESTING);
act_puts("ôÙ ÌÏ×ËÉÍ ÐÒÉÅÍÏÍ ×ÁÌÉÛØ $N ÎÁ ÚÅÍÌÀ É ÎÁÄÅ×ÁÅÛØ ÎÁ $gN{ÎÅÇÏ} ÎÁÒÕÞÎÉËÉ.", ch, NULL, victim, TO_CHAR, POS_RESTING);
act_puts("$n ÌÏ×ËÉÍ ÐÒÉÅÍÏÍ ×ÁÌÉÔ $N ÎÁ ÚÅÍÌÀ É ÎÁÄÅ×ÁÅÔ ÎÁ $gN{ÎÅÇÏ} ÎÁÒÕÞÎÉËÉ.", ch, NULL, victim, TO_NOTVICT, POS_RESTING);
act_yell(ch, "ïÈÒÁÎÁ! ÷ ÔÀÒØÍÕ $gi{ÅÇÏ}!", victim, NULL);
act_puts("ðÁÒÁ ÎÁËÁÞÁÎÎÙÈ ÏÈÒÁÎÎÉËÏ× ÐÒÉÂÅÖÁÌÁ ÞÔÏ Õ×ÅÓÔÉ $N × ÔÀÒØÍÕ.\nïÈÒÁÎÎÉËÉ È×ÁÔÁÀÔ $gN{ÅÇÏ} ÐÏÄ ÒÕËÉ É Õ×ÏÄÑÔ × ÔÀÒØÍÕ.", ch, NULL, victim, TO_NOTVICT, POS_RESTING);
act_puts("ðÁÒÁ ÎÁËÁÞÁÎÎÙÈ ÏÈÒÁÎÉËÏ× ÐÒÉÂÅÖÁÌÁ ÞÔÏ Õ×ÅÓÔÉ $N × ÔÀÒØÍÕ.\nïÈÒÁÎÎÉËÉ È×ÁÔÁÀÔ $gN{ÅÇÏ} ÐÏÄ ÒÕËÉ É Õ×ÏÄÑÔ × ÔÀÒØÍÕ.", ch, NULL, victim, TO_CHAR, POS_RESTING);
char_act("ðÁÒÁ ÎÁËÁÞÁÎÎÙÈ ÏÈÒÁÎÉËÏ× ÐÒÉÂÅÖÁÌÁ ÞÔÏ Õ×ÅÓÔÉ ÔÅÂÑ ÔÀÒØÍÕ.\nïÈÒÁÎÉËÉ È×ÁÔÁÀÔ ÔÅÂÑ ÐÏÄ ÒÕËÉ É ÔÁÝÁÔ × ÔÀÒØÍÕ.", victim);
pRoomIndex = get_room_index(ROOM_VNUM_RULER_CELL);
char_from_room(victim);
char_to_room(victim, pRoomIndex);
++stat_record.arrested;
if (IS_AWAKE(victim))
do_look(victim, "auto");
if (!IS_NPC(ch))
{
ps = pc_skill_lookup(ch, gsn_arrest);
ps->percent++;
ps->percent = UMIN(ps->percent, 100);
/* Gold 4 Hunters */
if (IS_SET(clan->flags, CLAN_HIDDEN))
{
ch->pcdata->bank_g += (victim->level * 2);
char_act("÷ ÎÁÇÒÁÄÕ ÚÁ ÁÒÅÓÔ ÐÒÅÓÔÕÐÎÉËÁ ÎÁ Ô×ÏÊ ÓÞÅÔ ÐÅÒÅ×ÅÄÅÎÙ ÄÅÎØÇÉ.", ch);
}
}
agent_net_printf(ch, victim, ANET_ARREST);
return;
}
act("ôÙ ÐÙÔÁÅÛØÓÑ ÁÒÅÓÔÏ×ÁÔØ $N, ÎÏ ÔÅÂÅ ÜÔÏ ÎÅ ÕÄÁ£ÔÓÑ", ch, NULL, victim, TO_CHAR);
act("$n ÐÙÔÁÅÔÓÑ ÁÒÅÓÔÏ×ÁÔØ ÔÅÂÑ, ÎÏ $gn{ÅÍÕ} ÜÔÏ ÎÅ ÕÄÁ£ÔÓÑ", ch, NULL, victim, TO_VICT);
act("$n ÐÙÔÁÅÔÓÑ ÁÒÅÓÔÏ×ÁÔØ $N, ÎÏ Õ $gn{ÎÅÇÏ} ÎÉÞÅÇÏ ÎÅ ÐÏÌÕÞÉÌÏÓØ", ch, NULL, victim, TO_NOTVICT);
if (!IS_NPC(ch)) check_improve(victim, gsn_arrest, FALSE, 1);
// if (ch->level > victim->level) if (is_safe(ch, victim)) return;
multi_hit(victim,ch,TYPE_UNDEFINED);
}
DO_FUN(do_dirt)
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
bool fighting;
int chance;
if (MOUNTED(ch))
{
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ËÉÄÁÔØÓÑ ÐÙÌØÀ ÐÏËÁ ÔÙ ×ÅÒÈÏÍ!", ch);
return;
}
one_argument(argument, arg, sizeof(arg));
if ((chance = get_skill(ch, gsn_dirt)) == 0)
{
char_act("ô×ÏÑ ÏÂÕר ÓÔÁÎÏ×ÉÔÓÑ ÅÝÅ ÇÒÑÚÎÅÊ.", ch);
return;
}
WAIT_STATE(ch, SKILL(gsn_dirt)->beats);
if (arg[0] == '\0')
{
victim = ch->fighting;
if (victim == NULL
|| victim->in_room != ch->in_room)
{
char_act("îÏ ÔÙ ÎÅ ÓÒÁÖÁÅÛØÓÑ!", ch);
return;
}
}
else if ((victim = get_char_room(ch, arg)) == NULL)
{
char_act("ôÁËÉÈ ÔÕÔ ÎÅÔ.", ch);
return;
}
if (IS_AFFECTED(ch, AFF_FLYING))
{
char_act("÷ ÐÏÌÅÔÅ?", ch);
return;
}
if (IS_AFFECTED(victim, AFF_BLIND))
{
act("$gN{ÏÎ} ÕÖÅ ÎÉÞÅÇÏ ÎÅ ×ÉÄÉÔ.", ch, NULL, victim, TO_CHAR);
return;
}
if (victim == ch)
{
char_act("óÍÅÛÎÏ.", ch);
return;
}
if (MOUNTED(victim))
{
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ÐÏÐÁÓÔØ ÐÙÌØÀ × ÇÌÁÚÁ ×ÓÁÄÎÉËÕ!", ch);
return;
}
if (IS_AFFECTED(ch, AFF_CHARM) && ch->master == victim)
{
act("îÏ $N ÔÁËÏÊ ÈÏÒÏÛÉÊ ÄÒÕÇ!", ch, NULL, victim, TO_CHAR);
return;
}
if (IS_AFFECTED(ch, AFF_FEAR))
{
char_act("You too scare to do this! á ×ÄÒÕÇ ÏÎ ÏÓÌÅÐÎÅÔ?!", ch);
return;
}
if (is_safe(ch, victim))
return;
/* modifiers */
/* dexterity */
chance += get_curr_stat(ch, STAT_DEX);
chance -= 2 * get_curr_stat(victim, STAT_DEX);
/* speed */
if ((IS_NPC(ch) && IS_SET(ch->pIndexData->off_flags, OFF_FAST))
|| IS_AFFECTED(ch, AFF_HASTE))
chance += 10;
if ((IS_NPC(victim) && IS_SET(victim->pIndexData->off_flags, OFF_FAST))
|| IS_AFFECTED(victim, AFF_HASTE))
chance -= 25;
if (is_affected(ch, gsn_protective_shield))
chance -= 10;
if (is_affected(victim, gsn_protective_shield))
chance -= 20;
/* level */
chance += (LVL(ch) - LVL(victim)) * 2;
if (chance % 5 == 0)
chance += 1;
/* terrain */
switch(ch->in_room->sector_type)
{
case(SECT_INSIDE): chance -= 20; break;
case(SECT_CITY): chance -= 10; break;
case(SECT_FIELD): chance += 5; break;
case(SECT_FOREST): break;
case(SECT_HILLS): break;
case(SECT_MOUNTAIN): chance -= 10; break;
case(SECT_WATER_SWIM): chance = 0; break;
case(SECT_WATER_NOSWIM): chance = 0; break;
case(SECT_AIR): chance = 0; break;
case(SECT_DESERT): chance += 10; break;
}
if (chance == 0)
{
char_act("úÄÅÓØ ÎÅÔ ÐÙÌÉ, ËÏÔÏÒÕÀ ÍÏÖÎÏ ÂÙÌÏ ÂÙ ÐÎÕÔØ.", ch);
return;
}
fighting = (ch->fighting != NULL);
if(check_mirror_image(ch,victim))
return;
/* now the attack */
if (number_percent() < chance)
{
AFFECT_DATA af;
check_improve(ch, gsn_dirt, TRUE, 2);
if(IS_UNDEAD(victim))
{
act("$n ÎÅ ÏÂÒÁÝÁÅÔ ×ÎÉÍÁÎÉÑ ÎÁ ÐÙÌØ, ÐÏÐÁ×ÛÕÀ × ÇÌÁÚÁ!",
victim, NULL, NULL, TO_ROOM);
act("$N ÐÏÐÙÔÁÌÓÑ ÏÓÌÅÐÉÔØ ÔÅÂÑ ÇÒÑÚØÀ - ×ÏÔ ÄÕÒÁÞÏË.",
victim, NULL, ch, TO_CHAR);
return;
}
act("$n ÓÌÅÐÎÅÔ ÏÔ ÐÙÌÉ, ÐÏÐÁ×ÛÅÊ × ÇÌÁÚÁ!",
victim, NULL, NULL, TO_ROOM);
act("ôÙ ÓÌÅÐÎÅÛØ ÏÔ ÐÙÌÉ, ÐÏÐÁ×ÛÅÊ × ÇÌÁÚÁ!",
victim, NULL, NULL, TO_CHAR);
af.where = TO_AFFECTS;
af.type = gsn_dirt;
af.level = LVL(ch) + LVL(ch) / 10;
af.duration = 0;
af.location = APPLY_HITROLL;
af.modifier = 0 - number_fuzzy(LVL(ch)/5);
af.bitvector = AFF_BLIND;
affect_to_char(victim, &af);
damage(ch, victim, number_range(2, 5),
gsn_dirt, DAM_NONE, FALSE);
}
else {
damage(ch, victim, 0, gsn_dirt, DAM_NONE, TRUE);
check_improve(ch, gsn_dirt, FALSE, 2);
}
if (check_yell(ch, victim, fighting)) {
act_yell(victim, "îÁ ÐÏÍÏÝØ! $i ÐÙÔÁÅÔÓÑ ÐÏÐÁÓÔØ ÍÎÅ ÐÙÌØÀ × ÇÌÁÚÁ!", ch, NULL);
agent_net_printf(victim, ch, ANET_ATTACK);
}
return;
}
DO_FUN(do_soul)
{
int chance;
CHAR_DATA *soul;
CHAR_DATA *victim;
if ((chance = get_skill(ch, gsn_soul)) == 0) {
char_act("ðÏÔÅÒÑÌ ÄÕÛÕ? âÙ×ÁÅÔ..", ch);
return;
}
if ((victim = ch->fighting) != NULL) {
char_act("îÅÌØÚÑ ×ÙÊÔÉ ÉÚ ÔÅÌÁ ×Ï ×ÒÅÍÑ ÂÏÑ.", ch);
return;
}
if (!IS_DEMON(ch)) {
char_act("ôÏÌØËÏ äÅÍÏÎÙ ÍÏÇÕÔ ×ÙÈÏÄÉÔØ ÉÚ ÔÅÌÁ.", ch);
return;
}
if (ch->mana < 50) {
char_act("õ ÔÅÂÑ ÎÅÄÏÓÔÁÔÏÞÎÏ ÜÎÅÒÇÉÉ ÞÔÏÂÙ ×ÙÊÔÉ ÉÚ ÔÅÌÁ.", ch);
return;
}
else {
ch->mana -= 50;
}
if (number_percent() < chance) {
soul = create_mob(get_mob_index(MOB_VNUM_SOUL));
char_to_room(soul,ch->in_room);
if (soul->desc != NULL) {
char_act("õ ÔÅÂÑ ÎÅ ÐÏÌÕÞÉÌÏÓØ ×ÙÊÔÉ ÉÚ ÔÅÌÁ!!.", ch);
return;
}
ch->desc->character = soul;
ch->desc->original = ch;
soul->desc = ch->desc;
ch->desc = NULL;
soul->comm = ch->comm;
soul->lines = ch->lines;
/*TOGGLE_BIT(soul->plr_flags, PLR_GHOST);*/
char_act("ôÙ ÐÏÞÕÓÔ×Ï×ÁÌ ËÁË Ô×ÏÑ ÄÕÛÁ ×ÙÛÌÁ ÉÚ ÔÅÌÁ..", soul);
act("çÌÁÚÁ $n ÓÔÁÎÏ×ÑÔÓÑ ÐÕÓÔÙÍÉ É ÂÅÚÖÉÚÎÅÎÎÙÍÉ!", ch, NULL, NULL, TO_ROOM);
check_improve(ch,gsn_soul,TRUE, 5);
}
else
{
char_act("õ ÔÅÂÑ ÎÅ ÐÏÌÕÞÉÌÏÓØ ×ÙÊÔÉ ÉÚ ÔÅÌÁ...", ch);
check_improve(ch,gsn_soul,FALSE,1);
}
}
bool backstab_ok(CHAR_DATA *ch, CHAR_DATA *victim)
{
if (victim->fighting)
{
if (ch)
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ÕÄÁÒÉÔØ × ÓÐÉÎÕ ÓÒÁÖÁÀÝÅÍÕÓÑ ÐÅÒÓÏÎÁÖÕ.", ch);
return FALSE;
}
if (victim->hit < 7 * victim->max_hit / 10 && IS_AWAKE(victim))
{
if (ch)
act("$N ÒÁÎÅÎ É ÇÌÑÄÉÔ ÎÁÓÔÏÒÏÖÅÎÎÏ... "
"ÔÙ ÎÅ ÍÏÖÅÛØ ÐÏÄËÒÁÓÔØÓÑ ÎÅÚÁÍÅÔÎÏ.",
ch, NULL, victim, TO_CHAR);
return FALSE;
}
//if (current_time - victim->last_fight_time < 300 && !IS_AFFECTED(victim, AFF_SLEEP))
if (current_time - victim->last_fight_time < 300 && IS_AWAKE(victim))
{
if (ch)
act("$N ÇÌÑÄÉÔ ÎÁÓÔÏÒÏÖÅÎÎÏ... ÔÅÂÅ ÎÅ ÕÄÁÓÔÓÑ ÐÏÄËÒÁÓÔØÓÑ ÎÅÚÁÍÅÔÎÏ.",
ch, NULL, victim, TO_CHAR);
return FALSE;
}
if (victim && ch && !IS_NPC(victim))
if (can_see(victim, ch) && IS_AWAKE(victim))
{
act("$N ×ÉÄÉÔ ÔÅÂÑ. ôÙ ÎÅ ÓÍÏÖÅÛØ ÐÏÄËÒÁÓÔØÓÑ Ë ÎÅÍÕ ÎÅÚÁÍÅÔÎÏ",
ch, NULL, victim, TO_CHAR);
return FALSE;
}
if (ch && IS_AFFECTED(ch, AFF_FEAR))
{
act("ôÅÂÅ ÓÌÉÛËÏÍ ÓÔÒÁÛÎÏ! á ×ÄÒÕÇ ÔÙ ÕÂØÅÛØ $N?!", ch, NULL, victim, TO_CHAR);
return FALSE;
}
return TRUE;
}
void backstab(CHAR_DATA *ch, CHAR_DATA *victim, int chance)
{
if(check_mirror_image(ch,victim))
return;
if (number_percent() < chance)
{
check_improve(ch, gsn_backstab, TRUE, 1);
one_hit(ch, victim, gsn_backstab, WEAR_WIELD);
if (number_percent() <
get_skill(ch, gsn_dual_backstab) * 8 / 10 &&
get_eq_char(ch, WEAR_SECOND_WIELD))
{
check_improve(ch, gsn_dual_backstab, TRUE, 1);
one_hit(ch, victim, gsn_dual_backstab, WEAR_SECOND_WIELD);
}
else
{
check_improve(ch, gsn_dual_backstab, FALSE, 1);
}
}
else
{
check_improve(ch, gsn_backstab, FALSE, 1);
damage(ch, victim, 0, gsn_backstab, DAM_NONE, TRUE);
}
if (!IS_NPC(victim) && victim->position == POS_FIGHTING)
{
act_yell(victim, "õÍÒÉ, $i! ôÙ, ÐÏÄÌÙÊ ÈÏÒÅË!", ch, NULL);
agent_net_printf(victim, ch, ANET_ATTACK);
}
}
DO_FUN(do_backstab)
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
OBJ_DATA *obj;
int chance;
one_argument(argument, arg, sizeof(arg));
if (MOUNTED(ch))
{
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ÕÄÁÒÉÔØ × ÓÐÉÎÕ ÐÏËÁ ÔÙ ÓÉÄÉÛØ ×ÅÒÈÏÍ!", ch);
return;
}
if ((chance = get_skill(ch, gsn_backstab)) == 0)
{
char_act("ôÙ ÎÅ ÚÎÁÅÛØ ËÁË ÄÅÌÁÅÔÓÑ ÂÜËÓÔÜÂ.", ch);
return;
}
if ((obj = get_eq_char(ch, WEAR_WIELD)) == NULL)
{
char_act("ôÅÂÅ ÐÏÎÁÄÏÂÉÔÓÑ ÏÒÕÖÉÅ, ÞÔÏÂÙ ÕÄÁÒÉÔØ × ÓÐÉÎÕ.", ch);
return;
}
if (attack_table[obj->value[3]].damage != DAM_PIERCE)
{
char_act("ôÅÂÅ ÎÕÖÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ ÔÏÌØËÏ ËÏÌÀÝÅÅ ÏÒÕÖÉÅ ÄÌÑ ÕÄÁÒÁ × ÓÐÉÎÕ.", ch);
return;
}
if (arg[0] == '\0')
{
char_act("ëÏÇÏ ÕÄÁÒÉÔØ × ÓÐÉÎÕ?", ch);
return;
}
if (ch->move < 40 && !IS_NPC(ch))
{
char_act("ôÙ ÓÌÉÛËÏÍ ÕÓÔÁÌ.", ch);
return;
}
WAIT_STATE(ch, SKILL(gsn_backstab)->beats);
if ((victim = get_char_room(ch, arg)) == NULL)
{
char_act("ôÁËÉÈ ÔÕÔ ÎÅÔ.", ch);
return;
}
if (victim == ch)
{
char_act("ëÁË ÔÙ ÍÏÖÅÛØ ÏÓÔÁÔØÓÑ ÎÅÚÁÍÅÞÅÎÎÙÍ ÄÌÑ ÓÅÂÑ?", ch);
return;
}
if (is_safe(ch, victim))
return;
if (!backstab_ok(ch, victim))
return;
backstab(ch, victim, chance);
}
DO_FUN(do_cleave)
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
OBJ_DATA *obj;
int chance;
one_argument(argument, arg, sizeof(arg));
if (ch->master != NULL && IS_NPC(ch))
return;
if ((chance = get_skill(ch, gsn_cleave)) == 0)
{
char_act("ôÙ ÎÅ ÚÎÁÅÛØ ËÁË ÒÁÓËÁÌÙ×ÁÔØ.", ch);
return;
}
if (arg[0] == '\0')
{
char_act("òÁÓËÏÌÏÔØ ËÏÇÏ?", ch);
return;
}
if (ch->move < 40 && !IS_NPC(ch))
{
char_act("ôÙ ÓÌÉÛËÏÍ ÕÓÔÁÌ.", ch);
return;
}
WAIT_STATE(ch, SKILL(gsn_cleave)->beats);
if ((victim = get_char_room(ch, arg)) == NULL)
{
char_act("ôÁËÉÈ ÔÕÔ ÎÅÔ.", ch);
return;
}
if (victim == ch)
{
char_act("ëÁË ÔÙ ÍÏÖÅÛØ ÏÓÔÁÔØÓÑ ÎÅÚÁÍÅÞÅÎÎÙÍ ÄÌÑ ÓÅÂÑ?", ch);
return;
}
if ((obj = get_eq_char(ch, WEAR_WIELD)) == NULL)
{
char_act("ôÅÂÅ ÐÏÎÁÄÏÂÉÔÓÑ ÏÒÕÖÉÅ ÞÔÏÂÙ ÒÁÓËÁÌÙ×ÁÔØ.", ch);
return;
}
if ((obj->value[0] != WEAPON_AXE) && (obj->value[0] != WEAPON_SWORD))
{
char_act("ôÅÂÅ ÎÕÖÅÎ ÔÏÐÏÒ ÉÌÉ ÍÅÞ ÞÔÏÂÙ ÒÁÓËÁÌÙ×ÁÔØ.", ch);
return;
}
if (victim->fighting != NULL)
{
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ÒÁÓËÏÌÏÔØ ÓÒÁÖÁÀÝÅÇÏÓÑ ÐÅÒÓÏÎÁÖÁ.", ch);
return;
}
if ((victim->hit < (0.9 * victim->max_hit))
&& (IS_AWAKE(victim)))
{
act("$N ÒÁÎÅÎ É ÓÍÏÔÒÉÔ ÎÁÓÔÏÒÏÖÅÎÎÏ... ÔÙ ÎÅ ÍÏÖÅÛØ ÐÏÄÏÊÔÉ ÎÅÚÁÍÅÔÎÏ.",
ch, NULL, victim, TO_CHAR);
return;
}
if (IS_AFFECTED(ch,AFF_FEAR))
{
char_act("ëÁË ÔÁË ÍÏÖÎÏ? á ×ÄÒÕÇ ÏÎ ÒÁÓËÏÌÅÔÓÑ?!", ch);
return;
}
if (is_safe(ch, victim))
return;
if(check_mirror_image(ch,victim))
return;
if (!IS_AWAKE(victim)
|| IS_NPC(ch)
|| number_percent() < chance)
{
check_improve(ch, gsn_cleave, TRUE, 1);
one_hit(ch, victim, gsn_cleave,WEAR_WIELD);
}
else
{
check_improve(ch, gsn_cleave, FALSE, 1);
damage(ch, victim, 0, gsn_cleave, DAM_NONE, TRUE);
}
if (!IS_NPC(victim) && victim->position==POS_FIGHTING)
{
act_yell(victim, "õÍÒÉ, $i, ÛÁËÁÌ ÐÏÚÏÒÎÙÊ!", ch, NULL);
agent_net_printf(victim, ch, ANET_ATTACK);
}
}
DO_FUN(do_ambush)
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
int chance;
if (MOUNTED(ch)) {
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ÕÓÔÒÏÉÔØ ÚÁÓÁÄÕ ÓÉÄÑ × ÓÅÄÌÅ!", ch);
return;
}
one_argument(argument, arg, sizeof(arg));
if ((chance = get_skill(ch, gsn_ambush)) == 0) {
char_act("ôÙ ÎÅ ÚÎÁÅÛØ ËÁË ÕÓÔÒÁÉ×ÁÀÔÓÑ ÚÁÓÁÄÙ.", ch);
return;
}
if (arg[0] == '\0') {
char_act("õÓÔÒÏÉÔØ ÚÁÓÁÄÕ ÎÁ ËÏÇÏ?", ch);
return;
}
if (IS_AFFECTED(ch,AFF_FEAR)){
char_act("ôÅÂÅ ÓÌÉÛËÏÍ ÓÔÒÁÛÎÏ ÕÓÔÒÁÉ×ÁÔØ ÚÁÓÁÄÕ!", ch);
return;
}
if (ch->move < 40 && !IS_NPC(ch)) {
char_act("ôÙ ÓÌÉÛËÏÍ ÕÓÔÁÌ.", ch);
return;
}
WAIT_STATE(ch, SKILL(gsn_ambush)->beats);
if ((victim = get_char_room(ch, arg)) == NULL) {
char_act("ôÁËÉÈ ÔÕÔ ÎÅÔ.", ch);
return;
}
if (victim == ch) {
char_act("ôÙ ÓÏÂÉÒÁÅÛØÓÑ ÐÏÊÍÁÔØ ÓÅÂÑ × ÚÁÓÁÄÕ?", ch);
return;
}
if (victim->hit < victim->max_hit
&& can_see(victim, ch) && IS_AWAKE(victim)) {
act("$N ÒÁÎÅÎ É ÓÍÏÔÒÉÔ ÎÁÓÔÏÒÏÖÅÎÎÏ... ÔÙ ÎÅ ÍÏÖÅÛØ ÐÏÄÏÊÔÉ ÎÅÚÁÍÅÔÎÏ.",
ch, NULL, victim, TO_CHAR);
return;
}
if (is_safe(ch, victim))
return;
if(check_mirror_image(ch,victim))
return;
if (!IS_AWAKE(victim)
|| IS_NPC(ch)
|| number_percent() < chance) {
check_improve(ch, gsn_ambush, TRUE, 1);
one_hit(ch, victim, gsn_ambush,WEAR_WIELD);
}
else {
check_improve(ch, gsn_ambush, FALSE, 1);
damage(ch, victim, 0, gsn_ambush, DAM_NONE, TRUE);
}
if (!IS_NPC(victim) && victim->position==POS_FIGHTING) {
act_yell(victim, "ðÏÍÏÇÉÔÅ! ñ ÐÏÐÁÌ × ÌÁÐÙ Ë $i!", ch, NULL);
agent_net_printf(victim, ch, ANET_ATTACK);
}
}
DO_FUN(do_rescue)
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
CHAR_DATA *fch;
one_argument(argument, arg, sizeof(arg));
if (arg[0] == '\0')
{
char_act("óÐÁÓÔÉ ËÏÇÏ?", ch);
return;
}
if (ch->move < 20 && !IS_NPC(ch))
{
char_act("ôÙ ÓÌÉÛËÏÍ ÕÓÔÁÌ.", ch);
return;
}
WAIT_STATE(ch, SKILL(gsn_rescue)->beats);
if ((victim = get_char_room(ch, arg)) == NULL)
{
char_act("ôÁËÉÈ ÔÕÔ ÎÅÔ.", ch);
return;
}
if (victim == ch)
{
char_act("ëÁË ÎÁÓÞÅÔ ÓÍÙÔØÓÑ?", ch);
return;
}
if (IS_AFFECTED(ch, AFF_FEAR))
{
char_act("á ÍÏÖÅÔ, ÌÕÞÛÅ ÓÍÙÔØÓÑ?", ch);
return;
}
if (!IS_NPC(ch) && IS_NPC(victim))
{
char_act("îÅ ÎÕÖÄÁÅÔÓÑ × Ô×ÏÅÊ ÐÏÍÏÝÉ!", ch);
return;
}
if (ch->fighting == victim)
{
char_act("óÌÉÛËÏÍ ÐÏÚÄÎÏ.", ch);
return;
}
if ((fch = victim->fighting) == NULL)
{
char_act("üÔÏÔ ÐÅÒÓÏÎÁÖ ÓÅÊÞÁÓ ÎÅ ÓÒÁÖÁÅÔÓÑ.", ch);
return;
}
if (!can_see(ch, fch))
{
char_act("ôÙ ÂÙ ÒÁÄ ÜÔÏ ÓÄÅÌÁÔØ, ÎÏ ÎÅ ×ÉÄÉÛØ Ó ËÅÍ ÏÎ ÓÒÁÖÁÅÔÓÑ.", ch);
return;
}
if (IS_NPC(ch) && ch->master != NULL && IS_NPC(victim))
return;
if (ch->master != NULL && is_safe(ch->master, fch))
return;
if (is_affected(victim, gsn_mirror_image))
{
act("óÌÉÛËÏÍ ÍÎÏÇÏ $N, ÎÅÐÏÎÑÔÎÏ ËÏÇÏ ÓÐÁÓÁÔØ.",
ch, NULL, victim, TO_CHAR);
return;
}
if (IS_SAMURAI(victim) && !IS_SAMURAI(ch))
{
act("$N ÇÏÒÄÏ ÏÔËÁÚÁÌÓÑ ÏÔ Ô×ÏÅÊ ÐÏÍÏÝÉ.",
ch, NULL, victim, TO_CHAR);
act("ôÙ ÇÏÒÄÏ ÏÔËÁÚÁÌÓÑ ÏÔ ÐÏÍÏÝÉ ÐÒÅÄÌÏÖÅÎÎÏÊ $n.",
ch, NULL, victim, TO_VICT);
act("$N ÇÏÒÄÏ ÏÔËÁÚÁÌÓÑ ÏÔ ÐÏÍÏÝÉ $n.",
ch, NULL, victim, TO_NOTVICT);
return;
}
if (is_safe(ch, fch))
return;
if (!check_trust(ch, victim))
{
act_puts("$N ÎÅ ÄÏ×ÅÒÑÅÔ ÔÅÂÅ Ó×ÏÅ ÓÐÁÓÅÎÉÅ.",
ch, NULL, victim, TO_CHAR, POS_DEAD);
return;
}
if (number_percent() > get_skill(ch,gsn_rescue))
{
char_act("ðÏÐÙÔËÁ ÓÐÁÓÅÎÉÑ ÎÅ ÕÄÁÌÁÓØ.", ch);
check_improve(ch, gsn_rescue, FALSE, 1);
return;
}
act("ôÙ ÓÐÁÓÁÅÛØ $N!", ch, NULL, victim, TO_CHAR );
act("$n ÓÐÁÓÁÅÔ ÔÅÂÑ!", ch, NULL, victim, TO_VICT );
act("$n ÓÐÁÓÁÅÔ $N!", ch, NULL, victim, TO_NOTVICT);
check_improve(ch, gsn_rescue, TRUE, 1);
stop_fighting(fch, FALSE);
stop_fighting(victim, FALSE);
set_fighting(ch, fch);
set_fighting(fch, ch);
}
DO_FUN(do_kick)
{
CHAR_DATA *victim;
int kick_dam;
int chance;
int i;
if (MOUNTED(ch)) {
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ÐÉÎÁÔØÓÑ ÐÏËÁ ÔÙ ×ÅÒÈÏÍ!", ch);
return;
}
if ((chance = get_skill(ch, gsn_kick)) == 0) {
char_act("äÌÑ ÔÅÂÑ ÜÔÏ ÓÌÉÛËÏÍ ÓÌÏÖÎÏ.", ch);
return;
}
if ((victim = ch->fighting) == NULL
|| victim->in_room != ch->in_room) {
char_act("ôÙ ÎÉ Ó ËÅÍ ÎÅ ÓÒÁÖÁÅÛØÓÑ.", ch);
return;
}
if (ch->move < 10 && !IS_NPC(ch)) {
char_act("ôÙ ÓÌÉÛËÏÍ ÕÓÔÁÌ.", ch);
return;
}
if (IS_AFFECTED(ch, AFF_FLYING))
chance = chance * 11 / 10;
WAIT_STATE(ch, SKILL(gsn_kick)->beats);
if(check_mirror_image(ch,victim))
return;
if (IS_NPC(ch) || number_percent() < chance) {
kick_dam = number_range(1, LVL(ch));
if (IS_SAMURAI(ch) && (get_eq_char(ch, WEAR_FEET) == NULL))
kick_dam *= 2;
kick_dam += ch->damroll / 2;
damage(ch, victim, kick_dam, gsn_kick, DAM_BASH, TRUE);
check_improve(ch, gsn_kick, TRUE, 1);
/* ((get_eq_char(ch, WEAR_FEET) == NULL)
|| (get_curr_stat(ch, STAT_DEX) > 23))) */
if ((chance = get_skill(ch, gsn_master_kick)) !=0)
{
for (i = 1; i <= LVL(ch) / 20; i++)
if(number_percent() < (chance / i))
{
kick_dam = number_range(1, LVL(ch));
kick_dam += ch->damroll / 2 * i;
if (IS_NPC(victim))
kick_dam *= 2;
damage(ch, victim, kick_dam, gsn_kick, DAM_BASH, TRUE);
check_improve(ch, gsn_master_kick, TRUE, i);
}
else
{
check_improve(ch, gsn_master_kick, FALSE, 1);
break; /* for */
}
}
}
else
{
if ((IS_AFFECTED(victim, AFF_FLYING)&& !IS_AFFECTED(ch, AFF_FLYING))
&& ch->class == CLASS_THIEF)
{
chance = get_skill(ch, gsn_kick)*2/3
+ (get_carry_weight(ch) - get_carry_weight(ch))/100
- UMAX(get_curr_stat(victim,STAT_CON) - get_curr_stat(ch,STAT_CON), 0)*5
+ (ch->size-victim->size)*5
- (is_affected (ch, gsn_protective_shield)? 15:0);
if (number_percent() < chance)
{
char_act("ô×ÏÊ ÐÒÏÔÉ×ÎÉË ÔÅÒÑÅÔ ÒÁ×ÎÏ×ÅÓÉÅ.", ch);
DAZE_STATE(victim, SKILL(gsn_kick)->beats*3/4);
}
//char_act("ôÙ ÔÅÒÑÅÛØ ÒÁ×ÎÏ×ÅÓÉÅ ÏÔ ÕÄÁÒÁ ÎÏÇÏÊ.", ch);
}
damage(ch, victim, 0, gsn_kick, DAM_BASH, TRUE);
check_improve(ch, gsn_kick, FALSE, 1);
}
}
DO_FUN(do_circle)
{
CHAR_DATA *victim;
CHAR_DATA *rch;
int chance;
OBJ_DATA *obj;
if (MOUNTED(ch)) {
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ÂÅÇÁÔØ ËÒÕÇÁÍÉ ÐÏËÁ ÔÙ ÓÉÄÉÛØ ×ÅÒÈÏÍ!", ch);
return;
}
if ((chance = get_skill(ch, gsn_circle)) == 0) {
char_act("ôÙ ÎÅ ÕÍÅÅÛØ ÌÏ×ËÏ ÂÅÇÁÔØ ×ÏËÒÕÇ ÏÐÐÏÎÅÎÔÁ É ÎÁÎÏÓÉÔØ ÕÄÁÒÙ.", ch);
return;
}
if ((victim = ch->fighting) == NULL) {
char_act("ôÙ ÎÉ Ó ËÅÍ ÎÅ ÓÒÁÖÁÅÛØÓÑ.", ch);
return;
}
if ((obj = get_eq_char(ch, WEAR_WIELD)) == NULL
|| attack_table[obj->value[3]].damage != DAM_PIERCE) {
char_act("ôÅÂÅ ÐÏÎÁÄÏÂÉÔÓÑ ËÏÌÀÝÅÅ ÏÒÕÖÉÅ ÄÌÑ ÎÁÎÅÓÅÎÉÑ ËÒÕÇÏ×ÏÇÏ ÕÄÁÒÁ.", ch);
return;
}
if (is_safe(ch, victim))
return;
if (ch->move < 20 && !IS_NPC(ch)) {
char_act("ôÙ ÓÌÉÛËÏÍ ÕÓÔÁÌ.", ch);
return;
}
WAIT_STATE(ch, SKILL(gsn_circle)->beats);
for (rch = ch->in_room->people; rch; rch = rch->next_in_room) {
if (rch->fighting == ch) {
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ÎÁÎÏÓÉÔØ ËÒÕÇÏ×ÙÅ ÕÄÁÒÙ, ÐÏËÁ ÔÙ ÚÁÝÉÝÁÅÛØÓÑ.", ch);
return;
}
}
if(check_mirror_image(ch,victim))
return;
if (number_percent() < chance) {
one_hit(ch, victim, gsn_circle, WEAR_WIELD);
check_improve(ch, gsn_circle, TRUE, 1);
}
else {
damage(ch, victim, 0, gsn_circle, TYPE_UNDEFINED, TRUE);
check_improve(ch, gsn_circle, FALSE, 1);
}
}
DO_FUN(do_disarm)
{
CHAR_DATA *victim;
OBJ_DATA *wield;
OBJ_DATA *vwield;
int chance, ch_weapon, vict_weapon;
int loc = WEAR_WIELD;
char arg[MAX_INPUT_LENGTH];
int hth = 0;
if (ch->master != NULL && IS_NPC(ch))
return;
if ((chance = get_skill(ch, gsn_disarm)) == 0)
{
char_act("ôÙ ÎÅ ÚÎÁÅÛØ, ËÁË ÏÂÅÚÏÒÕÖÉÔØ ÐÒÏÔÉ×ÎÉËÁ.", ch);
return;
}
if ((wield = get_eq_char(ch, WEAR_WIELD)) == NULL
&& (hth = get_skill(ch, gsn_hand_to_hand)) == 0)
{
char_act("ôÅÂÅ ÎÕÖÎÏ ×ÏÏÒÕÖÉÔØÓÑ.", ch);
return;
}
if ((victim = ch->fighting) == NULL)
{
char_act("îÏ ÔÙ ÎÉ Ó ËÅÍ ÎÅ ÓÒÁÖÁÅÛØÓÑ!", ch);
return;
}
if (ch->move < 30 && !IS_NPC(ch))
{
char_act("ôÙ ÓÌÉÛËÏÍ ÕÓÔÁÌ.", ch);
return;
}
argument = one_argument(argument, arg, sizeof(arg));
if (arg[0] && !str_prefix(arg, "second"))
loc = WEAR_SECOND_WIELD;
if ((vwield = get_eq_char(victim, loc)) == NULL)
{
char_act("ô×ÏÊ ÐÒÏÔÉ×ÎÉË ÂÅÚÏÒÕÖÅÎ.", ch);
return;
}
/* find weapon skills */
ch_weapon = get_weapon_skill(ch, get_weapon_sn(wield));
vict_weapon = get_weapon_skill(victim, get_weapon_sn(vwield));
/* modifiers */
/* skill */
if (wield == NULL)
chance = chance * hth/150;
else
chance = chance * ch_weapon/100;
chance += (ch_weapon/2 - vict_weapon) / 2;
/* dex vs. strength */
chance += get_curr_stat(ch, STAT_DEX);
chance -= 2 * get_curr_stat(victim, STAT_STR);
/* level */
chance += (LVL(ch) - LVL(victim)) * 2;
/* and now the attack */
WAIT_STATE(ch, SKILL(gsn_disarm)->beats);
if(check_mirror_image(ch,victim))
return;
if (IS_NPC(ch)) chance = chance * 2 / 3;
if (number_percent() < chance)
{
disarm(ch, victim, vwield);
check_improve(ch, gsn_disarm, TRUE, 1);
}
else {
act("õ ÔÅÂÑ ÎÅ ÐÏÌÕÞÁÅÔÓÑ ÏÂÅÚÏÒÕÖÉÔØ $c3{$N}.", ch, NULL, victim, TO_CHAR);
act("$n ÐÙÔÁÅÔÓÑ ÏÂÅÚÏÒÕÖÉÔØ ÔÅÂÑ ÎÏ ÂÅÚÕÓÐÅÛÎÏ.",
ch, NULL, victim, TO_VICT);
act("$n ÐÙÔÁÅÔÓÑ ÏÂÅÚÏÒÕÖÉÔØ $c3{$N}, ÎÏ ÔÅÒÐÉÔ ÎÅÕÄÁÞÕ.",
ch, NULL, victim, TO_NOTVICT);
check_improve(ch, gsn_disarm, FALSE, 1);
}
}
DO_FUN(do_nerve)
{
CHAR_DATA *victim;
char arg[MAX_INPUT_LENGTH];
int chance;
one_argument(argument, arg, sizeof(arg));
if ((chance = get_skill(ch, gsn_nerve)) == 0)
{
char_act("Huh?", ch);
return;
}
if (IS_AFFECTED(ch, AFF_FEAR))
{
char_act("ëÁË ÔÙ ÍÏÖÅÛØ ÜÔÏ ÄÅÌÁÔØ? á ×ÄÒÕÇ ÏÎ ÏÓÌÁÂÅÅÔ?!", ch);
return;
}
if (MOUNTED(ch)) {
char_act("óÉÄÑ ×ÅÒÈÏÍ, ÔÙ ÎÅ ÍÏÖÅÛØ ÄÏÓÔÁÔØ ÒÕËÏÊ ÄÏ ÛÅÉ ÐÒÏÔÉ×ÎÉËÁ.", ch);
return;
}
if (!(FREE_HAND1(ch) || FREE_HAND2(ch))) {
char_act("ôÅÂÅ ÎÕÖÎÁ ÈÏÔÑ ÂÙ ÏÄÎÁ Ó×ÏÂÏÄÎÁÑ ÒÕËÁ.", ch);
return;
}
if (arg[0] == '\0') {
victim = ch->fighting;
if (victim == NULL
|| victim->in_room != ch->in_room) {
char_act("îÏ ÔÙ ÎÉ Ó ËÅÍ ÎÅ ÓÒÁÖÁÅÛØÓÑ!", ch);
return;
}
} else if ((victim = get_char_room(ch, arg)) == NULL) {
char_act("ôÁËÉÈ ÔÕÔ ÎÅÔ.", ch);
return;
}
if (ch == victim) {
char_act("îÕ ÏÞÅÎØ ÐÌÏÈÁÑ ÉÄÅÑ!", ch);
return;
}
if (is_affected(victim,gsn_nerve)) {
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ÅÝÅ ÂÏÌØÛÅ ÏÓÌÁÂÉÔØ ÜÔÏÇÏ ÐÅÒÓÏÎÁÖÁ.", ch);
return;
}
if (is_safe(ch, victim))
return;
if (ch->fighting)
chance /= 3;
if (ch->move < 30 && !IS_NPC(ch)) {
char_act("ôÙ ÓÌÉÛËÏÍ ÕÓÔÁÌ.", ch);
return;
}
WAIT_STATE(ch, SKILL(gsn_nerve)->beats);
if(check_mirror_image(ch,victim))
return;
if (ch->style && ch->style == STYLE_COBRA)
chance *= 2;
if (IS_NPC(ch)
|| number_percent() < 4 * chance / 5 + LVL(ch) - LVL(victim)
+ get_curr_stat(ch,STAT_DEX)
- get_curr_stat(victim,STAT_DEX)) {
AFFECT_DATA af;
af.where = TO_AFFECTS;
af.type = gsn_nerve;
af.level = LVL(ch);
af.duration = 10;
af.location = APPLY_STR;
af.modifier = (15)*(-1);
af.bitvector = 0;
affect_join(victim, &af);
act("ôÙ ÏÓÌÁÂÌÑÅÛØ $N, ÕÄÁÒÉ× ÐÁÌØÃÅÍ × ÔÏÞËÕ ÎÁ $gn{ÅÇÏ} ÛÅÅ.",
ch, NULL, victim, TO_CHAR);
act("$n ÏÓÌÁÂÌÑÅÔ ÔÅÂÑ, ÕÄÁÒÉ× ÐÁÌØÃÅÍ × ÔÏÞËÕ ÎÁ Ô×ÏÅÊ ÛÅÅ.",
ch, NULL, victim, TO_VICT);
act("$n ÏÓÌÁÂÌÑÅÔ $N, ÕÄÁÒÉ× ÐÁÌØÃÅÍ × ÔÏÞËÕ ÎÁ $gn{ÅÇÏ} ÛÅÅ.",
ch, NULL, victim, TO_NOTVICT);
char_act("ôÙ ÞÕ×ÓÔ×ÕÅÛØ, ËÁË ÓÉÌÙ ÐÏËÉÄÁÀÔ ÔÅÂÑ...", victim);
check_improve(ch, gsn_nerve, TRUE, 1);
}
else {
char_act("ôÙ ÐÏÐÁÄÁÅÛØ ÎÅ × ÔÕ ÔÏÞËÕ.", ch);
act("$n ÐÙÔÁÅÔÓÑ ÏÓÌÁÂÉÔØ ÔÅÂÑ, ÕÄÁÒÉ× ÐÁÌØÃÅÍ × ÔÏÞËÕ ÎÁ Ô×ÏÅÊ ÛÅÅ ÎÏ ÔÝÅÔÎÏ.",
ch, NULL, victim, TO_VICT);
act("$n ÐÙÔÁÅÔÓÑ ÏÓÌÁÂÉÔØ $N, ÕÄÁÒÉ× ÐÁÌØÃÅÍ × ÔÏÞËÕ ÎÁ $gn{ÅÇÏ} ÛÅÅ, ÎÏ ÂÅÚÕÓÐÅÛÎÏ.",
ch, NULL, victim, TO_NOTVICT);
check_improve(ch, gsn_nerve, FALSE, 1);
}
if (IS_AWAKE(victim))
multi_hit(victim,ch,TYPE_UNDEFINED);
}
DO_FUN(do_tame)
{
CHAR_DATA *victim;
char arg[MAX_INPUT_LENGTH];
int chance;
if ((chance = get_skill(ch, gsn_tame)) == 0)
{
char_act("Huh?", ch);
return;
}
one_argument(argument, arg, sizeof(arg));
if (arg[0] == '\0')
{
if (ch->fighting != NULL)
victim = ch->fighting;
else {
char_act("You are beyond taming.\n", ch);
act("$n tries to tame $gn{himself} but fails miserably.",
ch, NULL, NULL, TO_ROOM);
return;
}
} else if ((victim = get_char_room(ch, arg)) == NULL)
{
char_act("They're not here.", ch);
return;
}
WAIT_STATE(ch, SKILL(gsn_tame)->beats);
if (IS_NPC(ch))
{
char_act("Why don't you tame yourself first?", ch);
return;
}
if (!IS_NPC(victim))
{
act("$N is beyond taming.", ch, NULL, victim, TO_CHAR);
return;
}
if (!IS_SET(victim->pIndexData->act, ACT_AGGRESSIVE)
&& (victim->fighting == NULL))
{
act("$N is not usually aggressive.", ch, NULL, victim, TO_CHAR);
return;
}
if (!IS_SET(victim->pIndexData->act, ACT_AGGRESSIVE))
chance /= 4;
if (number_percent() < chance + 15 + 4*(LVL(ch) - LVL(victim)))
{
SET_BIT(victim->affected_by, AFF_CALM);
char_act("You calm down.", victim);
act("You calm $N down.", ch, NULL, victim, TO_CHAR);
act("$n calms $N down.", ch, NULL, victim, TO_NOTVICT);
stop_fighting(victim, TRUE);
check_improve(ch, gsn_tame, TRUE, 1);
} else
{
char_act("You failed.",ch);
act("$n tries to calm down $N but fails.", ch, NULL, victim, TO_NOTVICT);
act("$n tries to calm you down but fails.", ch, NULL, victim, TO_VICT);
check_improve(ch, gsn_tame, FALSE, 1);
}
}
DO_FUN(do_assassinate)
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
int chance;
if (MOUNTED(ch))
{
char_act("You can't assassinate while riding!", ch);
return;
}
one_argument(argument, arg, sizeof(arg));
if (ch->master != NULL && IS_NPC(ch))
return;
if ((chance = get_skill(ch, gsn_assassinate)) == 0)
{
char_act("You don't know how to assassinate.", ch);
return;
}
if (IS_AFFECTED(ch, AFF_CHARM))
{
char_act("You don't want to kill your beloved master.", ch);
return;
}
if (arg[0] == '\0')
{
char_act("Assassinate whom?", ch);
return;
}
if (IS_AFFECTED(ch, AFF_FEAR))
{
char_act("ëÁË ÔÙ ÍÏÖÅÛØ? á ×ÄÒÕÇ ÏÎ ÕÍÒÅÔ?!", ch);
return;
}
if (ch->move < 40 && !IS_NPC(ch))
{
char_act("You are too tired.", ch);
return;
}
WAIT_STATE(ch, SKILL(gsn_assassinate)->beats);
if ((victim = get_char_room(ch, arg)) == NULL)
{
char_act("They aren't here.", ch);
return;
}
if (victim == ch)
{
char_act("Suicide is against your way.", ch);
return;
}
if ((IS_IMMORTAL(victim) && !IS_NPC(victim))
|| IS_SET(victim->abilities, EA_IMMUN_INSTANT))
{
char_act("Your hands pass through.", ch);
return;
}
if (victim->fighting != NULL)
{
char_act("You can't assassinate a fighting person.", ch);
return;
}
if (!FREE_HAND1(ch) || !FREE_HAND2(ch))
{
char_act("You need both hands free to assassinate somebody.", ch);
return;
}
if (victim->hit < victim->max_hit
&& can_see(victim, ch) && IS_AWAKE(victim))
{
act("$N is hurt and suspicious ... you can't sneak up.",
ch, NULL, victim, TO_CHAR);
return;
}
if (IS_SET(victim->immunes, IMM_BASH))
{
act("$N seems immune to your assassination attempt.",
ch, NULL, victim, TO_CHAR);
act("$N seems immune to $n's assassination attempt.",
ch, NULL, victim, TO_ROOM);
return;
}
if (is_safe(ch, victim))
return;
if(check_mirror_image(ch,victim))
return;
if (number_percent() < chance
&& !IS_CLAN_GUARD(victim)
&& !IS_IMMORTAL(victim))
{
one_hit(ch, victim, gsn_assassinate,WEAR_WIELD);
} else
{
check_improve(ch, gsn_assassinate, FALSE, 1);
damage(ch, victim, 0, gsn_assassinate, DAM_NONE, TRUE);
}
if (!IS_NPC(victim) && victim->position == POS_FIGHTING)
{
act_yell(victim, "Help! $i tries to assasinate me!", ch, NULL);
agent_net_printf(victim, ch, ANET_ATTACK);
}
}
DO_FUN(do_caltrops)
{
CHAR_DATA *victim = ch->fighting;
int chance;
if ((chance = get_skill(ch, gsn_caltrops)) == 0)
{
char_act("Caltrops? Is that a dance step?", ch);
return;
}
if (victim == NULL
|| victim->in_room != ch->in_room)
{
char_act("You must be in combat.", ch);
return;
}
if (is_safe(ch,victim))
return;
if (IS_AFFECTED(victim, AFF_FLYING))
{
act("óÔÕÐÎÉ $N ÎÅ ËÁÓÁÀÔÓÑ ÚÅÍÌÉ.", ch, NULL, victim, TO_CHAR);
return;
}
if (ch->move < 20 && !IS_NPC(ch))
{
char_act("You are too tired.", ch);
return;
}
act("You throw a handful of sharp spikes at the feet of $N.",
ch, NULL, victim, TO_CHAR);
act("$n throws a handful of sharp spikes at your feet!",
ch, NULL, victim, TO_VICT);
WAIT_STATE(ch, SKILL(gsn_caltrops)->beats);
if (!IS_NPC(ch) && number_percent() >= chance)
{
damage(ch, victim, 0, gsn_caltrops, DAM_PIERCE, TRUE);
check_improve(ch, gsn_caltrops, FALSE, 1);
return;
}
if(check_mirror_image(ch,victim))
return;
damage(ch, victim, LVL(ch), gsn_caltrops, DAM_PIERCE, TRUE);
if (JUST_KILLED(victim))
return;
if (!is_affected(victim, gsn_caltrops))
{
AFFECT_DATA tohit, todam, todex;
tohit.where = TO_AFFECTS;
tohit.type = gsn_caltrops;
tohit.level = LVL(ch);
tohit.duration = -1;
tohit.location = APPLY_HITROLL;
tohit.modifier = -5;
tohit.bitvector = 0;
affect_to_char(victim, &tohit);
todam.where = TO_AFFECTS;
todam.type = gsn_caltrops;
todam.level = LVL(ch);
todam.duration = -1;
todam.location = APPLY_DAMROLL;
todam.modifier = -5;
todam.bitvector = 0;
affect_to_char(victim, &todam);
todex.type = gsn_caltrops;
todex.level = LVL(ch);
todex.duration = -1;
todex.location = APPLY_DEX;
todex.modifier = -5;
todex.bitvector = 0;
affect_to_char(victim, &todex);
act("$N starts limping.", ch, NULL, victim, TO_CHAR);
act("You start to limp.", ch, NULL, victim, TO_VICT);
check_improve(ch, gsn_caltrops, TRUE, 1);
}
}
void do_strangle (CHAR_DATA* ch, const char* argument)
{
CHAR_DATA* victim ;
AFFECT_DATA af ;
int chance, dt ;
if (MOUNTED (ch))
{
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ÄÕÛÉÔØ ×ÒÁÇÁ, ÐÏËÁ ÔÙ ÓÉÄÉÛØ ×ÅÒÈÏÍ!", ch);
return ;
}
if ((chance = get_skill(ch, gsn_strangle)) == 0)
{
char_act("ôÙ ÎÅ ÚÎÁÅÛØ ËÁË ÐÒÁ×ÉÌØÎÏ ÐÒÉÄÕÛÉÔØ ×ÒÁÇÁ.", ch);
return ;
}
if (IS_AFFECTED (ch, AFF_CHARM))
{
char_act("ôÙ ÎÅ ÈÏÞÅÛØ ÓÖÉÍÁÔØ ÛÅÀ Ó×ÏÅÇÏ ÐÏ×ÅÌÉÔÅÌÑ!", ch);
return ;
}
if (ch->move < 40 && !IS_NPC(ch))
{
char_act("ôÙ ÓÌÉÛËÏÍ ÕÓÔÁÌ.", ch);
return ;
}
WAIT_STATE (ch, MISSING_TARGET_DELAY);
if ((victim = get_char_room(ch, argument)) == NULL)
{
char_act("úÄÅÓØ ÔÁËÉÈ ÎÅÔ.", ch);
return ;
}
if (ch == victim)
{
char_act("îÅ ÎÁÄÏ ÇÌÕÐÉÔØ, ÓÅÂÑ ÔÙ ÎÅ ÐÒÉÄÕÛÉÛØ!", ch);
return ;
}
if (victim->fighting)
{
char_act("You can't strangle a fighting person.", ch);
return ;
}
if (MOUNTED (victim))
{
char_act("ôÙ ÎÅ ÍÏÖÅÛØ ÚÁÄÕÛÉÔØ ×ÓÁÄÎÉËÁ!", ch);
return ;
}
if (!FREE_HAND1(ch) || !FREE_HAND2(ch))
{
char_act("ôÅÂÅ ÐÏÎÁÄÏÂÑÔÓÑ Ä×Å Ó×ÏÂÏÄÎÙÅ ÒÕËÉ, ÞÔÏ ÐÒÉÄÕÛÉÔØ ÖÅÒÔ×Õ.", ch);
return ;
}
if (IS_AFFECTED (ch, AFF_FEAR))
{
char_act("You too scare to do this! á ×ÄÒÕÇ ÏÎ ÚÁÄÏÈÎÅÔÓÑ?", ch);
return ;
}
if (is_affected (victim, gsn_insomnia))
{
act("îÏ $N ÎÅ ÍÏÖÅÔ ÚÁÓÎÕÔØ.", ch, NULL, victim, TO_CHAR);
return ;
}
WAIT_STATE (ch, SKILL(gsn_strangle)->beats);
if (is_affected (victim, gsn_strangle)) return ;
if (is_safe (ch, victim)) return ;
chance = chance / 2 ;
chance += URANGE (0, (get_curr_stat(ch, STAT_DEX) - 20) * 2, 10);
chance += can_see (victim, ch) ? 0 : 33 ;
if ((dt = current_time - victim->last_fight_time) < 200)
chance -= dt < 200 ? (200 - dt) / 5 : 0 ;
if (current_time - ch->last_fight_time < 200)
chance -= 5 ;
if (IS_NPC (victim) && victim->pIndexData->pShop != NULL)
chance -= 40 ;
chance += (ch->size - victim->size) * 3 ;
chance += (LVL (ch) - LVL (victim)) * 4 ;
chance += (get_curr_stat(ch, STAT_STR) - get_curr_stat(victim, STAT_STR)) * 2 ;
chance += (get_curr_stat(ch, STAT_DEX) - get_curr_stat(victim, STAT_DEX)) * 2 ;
if (is_affected (ch, gsn_protective_shield)) chance -= 15 ; else
if (is_affected (ch, gsn_shield)) chance -= 5 ;
if (IS_NPC (victim)) chance += 10 ;
if (check_perception (victim, ch)) chance = 0 ;
SET_FIGHT_TIME (victim) ;
SET_FIGHT_TIME (ch) ;
if (check_mirror_image (ch, victim))
{
//The characters begin battle and must be visible
do_visible (ch, str_empty) ;
do_visible (victim, str_empty) ;
return ;
}
if (number_percent () < chance
&& !IS_CLAN_GUARD (victim)
&& !IS_IMMORTAL (victim)
&& !IS_UNDEAD (victim))
{
act("ôÙ ÓÖÉÍÁÅÛØ $gN{ÅÇÏ} ÛÅÀ É $N ÔÅÒÑÅÔ ÓÏÚÎÁÎÉÅ.",
ch, NULL, victim, TO_CHAR);
act("$n ÓÖÉÍÁÅÔ Ô×ÏÀ ÛÅÀ É ÔÙ ÔÅÒÑÅÛØ ÓÏÚÎÁÎÉÅ.",
ch, NULL, victim, TO_VICT);
act("$n ÄÕÛÉÔ $N.",
ch, NULL, victim, TO_NOTVICT);
check_improve (ch, gsn_strangle, TRUE, 1);
af.type = gsn_strangle ;
af.where = TO_AFFECTS ;
af.level = LVL(ch);
// af.duration = LVL(ch) / 15 + 1 ;
af.duration = IS_SET (muddy_mode, MUDDY_RANDOM_SLEEP) ?
number_range (0, LVL(ch) / 15 + 1) : // new value
LVL(ch) / 15 + 1; // old value
af.location = APPLY_NONE ;
af.modifier = 0 ;
af.bitvector = AFF_SLEEP ;
affect_join (victim, &af);
if (IS_AWAKE (victim)) victim->position = POS_SLEEPING ;
//The characters begin battle and must be visible
do_visible (ch, str_empty) ;
do_visible (victim, str_empty) ;
}
else
{
damage (ch, victim, 0, gsn_strangle, DAM_NONE, TRUE);
check_improve (ch, gsn_strangle, FALSE, 1);
if (!IS_NPC (victim))
{
act_yell(victim, "ðÏÍÏÇÉÔÅ! $i ÄÕÛÉÔ ÍÅÎÑ!", ch, NULL);
agent_net_printf (victim, ch, ANET_ATTACK);
}
}
}
void do_blackjack (CHAR_DATA* ch, const char* argument)
{
CHAR_DATA* victim ;
AFFECT_DATA af ;
int chance, dt ;
if (MOUNTED (ch))
{
char_act("You can't blackjack while riding!", ch);
return ;
}
if ((chance = get_skill (ch, gsn_blackjack)) == 0)
{
char_act("Huh?", ch);
return ;
}
if (ch->move < 40 && !IS_NPC(ch))
{
char_act("You're too tired.", ch);
return ;
}
if ((victim = get_char_room(ch, argument)) == NULL)
{
char_act("You do not see that person here.", ch);
WAIT_STATE (ch, MISSING_TARGET_DELAY);
return ;
}
if (MOUNTED (victim))
{
char_act("ôÙ ÎÅ ÓÍÏÖÅÛØ ÄÏ ÎÅÇÏ ÄÏÔÑÎÕÔÓÑ, ÏÎ ÖÅ ÎÁ ÌÏÛÁÄÉ!", ch);
return ;
}
if (victim->fighting)
{
char_act("You can't blackjack a fighting person.", ch);
return ;
}
if (ch == victim)
{
char_act("You idiot?! Blackjack your self?!", ch);
return ;
}
if (IS_AFFECTED (ch, AFF_CHARM))
{
char_act("You don't want to hit your beloved masters' head with a full filled jack.", ch);
return ;
}
if (IS_AFFECTED (victim, AFF_SLEEP))
{
act("$gN{ÏÎ} ÕÖÅ ÂÅÚ ÓÏÚÎÁÎÉÑ.", ch, NULL, victim, TO_CHAR);
return ;
}
if (IS_AFFECTED (ch, AFF_FEAR))
{
char_act("You too scare to do this! ïÎ ×ÅÄØ ÍÏÖÅÔ ÏÂÉÄÅÔØÓÑ! ", ch);
return ;
}
if (is_affected (victim, gsn_insomnia))
{
act("But $N could not sleep.", ch, NULL, victim, TO_CHAR);
return ;
}
if (IS_UNDEAD(victim))
{
act("$N is undead, it's pointless to struck his head!",
ch,NULL,victim, TO_CHAR);
return;
}
WAIT_STATE (ch, SKILL(gsn_blackjack)->beats);
if (is_safe (ch,victim)) return ;
chance = chance /2 ;
chance += can_see (victim, ch) ? 0 : 33 ;
if ((dt = current_time - victim->last_fight_time) < 200)
chance -= dt < 200 ? (200 - dt) / 5 : 0 ;
// äÅÌÁÅÍ ÏÔÌÉÞÉÅ ÏÔ óÔÒÁÎÇÌÁ. ÷Ó£ ÔÁËÉ ÐÅÒ×ÙÊ ÓÔÁ ÄÏÌÖÅÎ ÂÙÔØ.
if ((current_time - ch->last_fight_time) > 200 &&
(current_time - victim->last_fight_time) > 200) chance *= 2 ;
// ïÔÌÉÞÉÅ ÚÁËÏÎÞÉÌÏÓØ. ïÓÔÁÌØÎÏÅ ÎÅ ÔÒÏÇÁÀ, ÐÕÓÔØ ÂÕÄÅÔ - ÔÁË ÕÄÏÂÎÅÊ ÓÞÉÔÁÔØ.
if (current_time - ch->last_fight_time < 200) chance -= 5 ;
if (IS_NPC(victim) && victim->pIndexData->pShop != NULL) chance -= 40 ;
chance += (ch->size - victim->size) * 3 ;
chance += (LVL (ch) - LVL (victim)) * 4 ;
chance += (get_curr_stat(ch, STAT_DEX) - get_curr_stat(victim, STAT_DEX)) * 2 ;
if (is_affected (ch, gsn_protective_shield)) chance -= 15 ; else
if (is_affected (ch, gsn_shield)) chance -= 5 ;
if (IS_NPC(victim)) chance += 10 ;
if (check_perception (victim, ch)) chance = 0 ;
SET_FIGHT_TIME (victim);
SET_FIGHT_TIME (ch);
if (check_mirror_image (ch, victim))
{
//The characters begin battle and must be visible
do_visible (ch, str_empty) ;
do_visible (victim, str_empty) ;
return ;
}
if (number_percent () < chance &&
!IS_CLAN_GUARD (victim) &&
!IS_IMMORTAL (victim) &&
!IS_UNDEAD (victim))
{
act("ôÙ ÂØÅÛØ $N ÐÏ ÇÏÌÏ×Å ÍÁÌÅÎØËÏÊ ÄÕÂÉÎËÏÊ.",
ch, NULL, victim, TO_CHAR);
act("äÉËÁÑ ÂÏÌØ ÍÏÌÎÉÅÊ ÐÒÏÎÚÉÌÁ Ô×ÏÊ ÞÅÒÅÐ!",
ch, NULL, victim, TO_VICT);
act("$n ÂØÅÔ $N ÐÏ ÇÏÌÏ×Å ÎÅÂÏÌØÛÏÊ ÄÕÂÉÎËÏÊ! *ïê!*",
ch, NULL, victim, TO_NOTVICT);
check_improve (ch, gsn_blackjack, TRUE, 1);
af.type = gsn_blackjack ;
af.where = TO_AFFECTS ;
af.level = LVL(ch);
//af.duration = LVL(ch) / 15 + 1 ;
af.duration = IS_SET (muddy_mode, MUDDY_RANDOM_SLEEP) ?
number_range (0, LVLShowing the first 100 KB of 207.5 KB. Download the archive for the full file.