Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void do_hitall( CHAR_DATA* ch, const char* argument )
- {
- CHAR_DATA* vch;
- CHAR_DATA* vch_next;
- sh_int nvict = 0;
- sh_int nhit = 0;
- if ( xIS_SET( ch->in_room->room_flags, ROOM_SAFE ) )
- {
- send_to_char_color( "&BA godly force prevents you.\n\r", ch );
- return;
- }
- if ( !ch->in_room->first_person )
- {
- send_to_char( "There's no one else here!\n\r", ch );
- return;
- }
- for ( vch = ch->in_room->first_person; vch; vch = vch_next )
- vch_next = vch->next_in_room;
- if ( is_same_group( ch, vch ) || !is_legal_kill( ch, vch ) ||
- !can_see( ch, vch ) || is_safe( ch, vch, TRUE ) )
- continue;
- if ( !IS_NPC( vch ) )
- continue;
- if ( who_fighting( vch ) != NULL )
- continue;
- if ( check_illegal_pk( ch, vch ) )
- continue;
- nvict++;
- }
- if ( ch->mana < ( ch->max_mana * ( 0.007 * nvict ) ) )
- {
- send_to_char( "You do not have enough ki to attack everyone.\n\r", ch );
- return;
- }
- /*
- if ( nvict == 1 )
- {
- send_to_char( "Theres only 1 target, why don't you just kill them?\n\r", ch );
- return;
- }
- */
- if ( !nvict )
- {
- send_to_char( "There's no one else here to attack!\n\r", ch );
- return;
- }
- for ( vch = ch->in_room->first_person; vch; vch = vch_next )
- {
- vch_next = vch->next_in_room;
- if ( is_same_group( ch, vch ) || !is_legal_kill( ch, vch ) ||
- !can_see( ch, vch ) || is_safe( ch, vch, TRUE ) )
- continue;
- if ( !IS_NPC( vch ) )
- continue;
- if ( who_fighting( vch ) != NULL )
- continue;
- if ( check_illegal_pk( ch, vch ) )
- continue;
- if ( can_use_skill( ch, number_percent( ), gsn_hitall ) )
- {
- nhit++;
- if ( IS_NPC( vch ) && xIS_SET( vch->act, ACT_MIRRORPL ) )
- {
- if ( ( long double ) ch->pl > ( long double ) vch->pl )
- {
- vch->exp = ch->pl;
- vch->pl = ch->pl;
- }
- if ( IS_NPC( vch ) && xIS_SET( vch->act, ACT_MIRRORHP ) )
- {
- if ( ch->hit > vch->hit )
- {
- if ( !vch->fighting )
- {
- vch->hit = ch->hit;
- vch->max_hit = ch->hit;
- }
- }
- }
- if ( IS_NPC( vch ) && xIS_SET( vch->act, ACT_MIRRORSTAT ) )
- {
- if ( get_curr_str( ch ) > get_curr_str( vch ) )
- {
- vch->perm_str = get_perm_stat( 0, ch );
- vch->mod_str = ch->mod_str;
- }
- if ( get_curr_dex( ch ) > get_curr_dex( vch ) )
- {
- vch->perm_dex = get_perm_stat( 1, ch );
- vch->mod_dex = ch->mod_dex;
- }
- if ( get_curr_con( ch ) > get_curr_con( vch ) )
- {
- vch->perm_con = get_perm_stat( 3, ch );
- vch->mod_con = ch->mod_con;
- }
- if ( get_curr_int( ch ) > get_curr_int( vch ) )
- {
- vch->perm_int = get_perm_stat( 2, ch );
- vch->mod_int = ch->mod_int;
- }
- }
- }
- global_retcode = one_hit( ch, vch, TYPE_UNDEFINED );
- }
- else
- global_retcode = damage( ch, vch, 0, TYPE_HIT );
- if ( IS_NPC( vch ) && xIS_SET( vch->act, ACT_MIRRORPL ) )
- {
- if ( ( long double ) ch->pl > ( long double ) vch->pl )
- {
- vch->exp = ch->pl;
- vch->pl = ch->pl;
- }
- if ( IS_NPC( vch ) && xIS_SET( vch->act, ACT_MIRRORHP ) )
- {
- if ( ch->hit > vch->hit )
- {
- if ( !vch->fighting )
- {
- vch->hit = ch->hit;
- vch->max_hit = ch->hit;
- }
- }
- }
- if ( IS_NPC( vch ) && xIS_SET( vch->act, ACT_MIRRORSTAT ) )
- {
- if ( get_curr_str( ch ) > get_curr_str( vch ) )
- {
- vch->perm_str = ch->perm_str;
- vch->mod_str = ch->mod_str;
- }
- if ( get_curr_dex( ch ) > get_curr_dex( vch ) )
- {
- vch->perm_dex = ch->perm_dex;
- vch->mod_dex = ch->mod_dex;
- }
- if ( get_curr_con( ch ) > get_curr_con( vch ) )
- {
- vch->perm_con = ch->perm_con;
- vch->mod_con = ch->mod_con;
- }
- if ( get_curr_int( ch ) > get_curr_int( vch ) )
- {
- vch->perm_int = ch->perm_int;
- vch->mod_int = ch->mod_int;
- }
- }
- }
- if ( global_retcode == rCHAR_DIED || global_retcode == rBOTH_DIED || char_died( ch ) )
- return;
- }
- ch->mana -= ch->max_mana * ( 0.007 * nvict );
- if ( ch->mana < 1 )
- ch->mana = 0;
- if ( nhit )
- {
- learn_from_success( ch, gsn_hitall );
- WAIT_STATE( ch, skill_table[ gsn_hitall ]->beats );
- }
- else
- {
- learn_from_failure( ch, gsn_hitall );
- WAIT_STATE( ch, skill_table[ gsn_hitall ]->beats );
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement