Beispiel #1
0
bool spec_new_republic_trooper(CHAR_DATA * ch)
{
	CHAR_DATA *victim;
	CHAR_DATA *v_next;

	if (!IS_AWAKE(ch) || ch->fighting)
		return FALSE;

	for (victim = ch->in_room->first_person; victim; victim = v_next) {
		v_next = victim->next_in_room;
		if (!can_see(ch, victim))
			continue;
		if (get_timer(victim, TIMER_RECENTFIGHT) > 0)
			continue;
		if ((IS_NPC(victim) && nifty_is_name("imperial", victim->name)
		     && victim->fighting && who_fighting(victim) != ch) ||
		    (!IS_NPC(victim) && victim->pcdata && victim->pcdata->clan
		     && IS_AWAKE(victim)
		     && nifty_is_name("empire", victim->pcdata->clan->name))) {
			do_yell(ch, "Long live the New Republic!");
			multi_hit(ch, victim, TYPE_UNDEFINED);
			return TRUE;
		}

	}

	return FALSE;

}
Beispiel #2
0
bool spec_clan_guard(CHAR_DATA * ch)
{
	CHAR_DATA *victim;
	CHAR_DATA *v_next;

	if (!IS_AWAKE(ch) || ch->fighting)
		return FALSE;

	for (victim = ch->in_room->first_person; victim; victim = v_next) {
		v_next = victim->next_in_room;
		if (!can_see(ch, victim))
			continue;
		if (get_timer(victim, TIMER_RECENTFIGHT) > 0)
			continue;
		if (!IS_NPC(victim) && victim->pcdata && victim->pcdata->clan
		    && IS_AWAKE(victim)
		    && str_cmp(ch->name, victim->pcdata->clan->name)) {
			do_yell(ch, "Hey your not allowed in here!");
			multi_hit(ch, victim, TYPE_UNDEFINED);
			return TRUE;
		}
	}

	return FALSE;
}
Beispiel #3
0
void do_wake (CHAR_DATA * ch, char *argument)
{
    char arg[MAX_INPUT_LENGTH];
    CHAR_DATA *victim;

    one_argument (argument, arg);
    if (arg[0] == '\0')
    {
        do_function (ch, &do_stand, "");
        return;
    }

    if (!IS_AWAKE (ch))
    {
        send_to_char ("You are asleep yourself!\n\r", ch);
        return;
    }

    if ((victim = get_char_room (ch, arg)) == NULL)
    {
        send_to_char ("They aren't here.\n\r", ch);
        return;
    }

    if (IS_AWAKE (victim))
    {
        act ("$N is already awake.", ch, NULL, victim, TO_CHAR);
        return;
    }


    act_new ("$n wakes you.", ch, NULL, victim, TO_VICT, POS_SLEEPING);
    do_function (ch, &do_stand, "");
    return;
}
Beispiel #4
0
bool spec_clan_guard( CHAR_DATA * ch )
{
  CHAR_DATA *victim = NULL;
  CHAR_DATA *v_next = NULL;

  if( !IS_AWAKE( ch ) || ch->fighting || !ch->mob_clan )
    return FALSE;

  for( victim = ch->in_room->first_person; victim; victim = v_next )
  {
    v_next = victim->next_in_room;
    if( !can_see( ch, victim ) )
      continue;
    if( get_timer( victim, TIMER_RECENTFIGHT ) > 0 )
      continue;
    if( !IS_NPC( victim ) && victim->pcdata && victim->pcdata->clan
	&& IS_AWAKE( victim ) && victim->pcdata->clan != ch->mob_clan
	&& nifty_is_name( victim->pcdata->clan->name,
	  ch->mob_clan->atwar ) )
    {
      char buf[MAX_STRING_LENGTH];
      snprintf( buf, MAX_STRING_LENGTH, "%s",
		"Hey you're not allowed in here!" );
      do_yell( ch, buf );
      multi_hit( ch, victim, TYPE_UNDEFINED );
      return TRUE;
    }
  }

  return FALSE;
}
Beispiel #5
0
bool spec_janitor(CHAR_DATA * ch)
{
	OBJ_DATA *trash;
	OBJ_DATA *trash_next;

	if (!IS_AWAKE(ch))
		return FALSE;

	for (trash = ch->in_room->first_content; trash; trash = trash_next) {
		trash_next = trash->next_content;
		if (!IS_SET(trash->wear_flags, ITEM_TAKE)
		    || IS_OBJ_STAT(trash, ITEM_BURRIED))
			continue;
		if (trash->item_type == ITEM_DRINK_CON
		    || trash->item_type == ITEM_TRASH
		    || trash->cost < 10
		    || (trash->pIndexData->vnum == OBJ_VNUM_SHOPPING_BAG
			&& !trash->first_content)) {
			act(AT_ACTION, "$n picks up some trash.", ch, NULL,
			    NULL, TO_ROOM);
			obj_from_room(trash);
			obj_to_char(trash, ch);
			return TRUE;
		}
	}

	return FALSE;
}
Beispiel #6
0
bool spec_executioner( CHAR_DATA *ch )
{
	char buf[MSL]={'\0'};
	CHAR_DATA *victim;
	CHAR_DATA *v_next;
	char *crime;

	if ( !IS_AWAKE(ch) || ch->fighting != NULL )
	return FALSE;

	crime = "";
	for ( victim = ch->in_room->people; victim != NULL; victim = v_next )
	{
	v_next = victim->next_in_room;

	if ( !IS_NPC(victim) && IS_SET(victim->act, PLR_KILLER) 
	&&   can_see(ch,victim))
		{ crime = "KILLER"; break; }

	if ( !IS_NPC(victim) && IS_SET(victim->act, PLR_THIEF) 
	&&   can_see(ch,victim))
		{ crime = "THIEF"; break; }
	}

	if ( victim == NULL )
	return FALSE;

	sprintf( buf, "%s is a %s!  PROTECT THE INNOCENT!  MORE BLOOOOD!!!", victim->name, crime );
	REMOVE_BIT(ch->comm,COMM_NOSHOUT);
	do_function(ch, &do_yell, buf );
	multi_hit( ch, victim, TYPE_UNDEFINED );
	return TRUE;
}
Beispiel #7
0
bool spec_police_attack(CHAR_DATA * ch)
{
	CHAR_DATA *victim;
	CHAR_DATA *v_next;
	int vip;
	char buf[MAX_STRING_LENGTH];

	if (!IS_AWAKE(ch) || ch->fighting)
		return FALSE;

	for (victim = ch->in_room->first_person; victim; victim = v_next) {
		v_next = victim->next_in_room;
		if (IS_NPC(victim))
			continue;
		if (!can_see(ch, victim))
			continue;
		if (number_bits(1) == 0)
			continue;
		for (vip = 0; vip < 32; vip++)
			if (IS_SET(ch->vip_flags, 1 << vip)
			    && IS_SET(victim->pcdata->wanted_flags, 1 << vip)) {
				sprintf(buf, "Hey you're wanted on %s!",
					planet_flags[vip]);
				do_say(ch, buf);
				REMOVE_BIT(victim->pcdata->wanted_flags,
					   1 << vip);
				multi_hit(ch, victim, TYPE_UNDEFINED);
				return TRUE;
			}

	}

	return FALSE;

}
/*
 * Check for parry.
 */
bool check_parry( CHAR_DATA *ch, CHAR_DATA *victim )
{
	int chance;

	if ( !IS_AWAKE(victim) )
		return FALSE;

	chance = get_skill(victim,gsn_parry) / 2;

	if ( get_eq_char( victim, WEAR_WIELD ) == NULL )
	{
		if (IS_NPC(victim))
			chance /= 2;
		else
			return FALSE;
	}

	if (!can_see(ch,victim))
		return FALSE;

	if ( dice_rolls(ch, chance,8) >= 1 )
		return FALSE;

	act( "You parry $n's attack.",  ch, NULL, victim, TO_VICT, 1 );
	act( "$N parries your attack.", ch, NULL, victim, TO_CHAR, 1 );
	return TRUE;
}
Beispiel #9
0
bool spec_executioner( CHAR_DATA *ch )
{
    char buf[MAX_STRING_LENGTH];
    CHAR_DATA *victim;
    CHAR_DATA *v_next;
    char *crime;

    if ( !IS_AWAKE(ch) || ch->fighting != NULL )
	return FALSE;

    crime = "";
    for ( victim = ch->in_room->people; victim != NULL; victim = v_next )
    {
	v_next = victim->next_in_room;

	if ( !IS_NPC(victim) && IS_SET(victim->act, PLR_KILLER) )
	    { crime = "KILLER"; break; }

	if ( !IS_NPC(victim) && IS_SET(victim->act, PLR_THIEF) )
	    { crime = "THIEF"; break; }
    }

    if ( victim == NULL )
	return FALSE;

    sprintf( buf, "%s is a %s!  PROTECT THE INNOCENT!  MORE BLOOOOD!!!",
	victim->name, crime );
    do_shout( ch, buf );
    multi_hit( ch, victim, TYPE_UNDEFINED );
    char_to_room( create_mobile( get_mob_index(MOB_VNUM_CITYGUARD) ),
	ch->in_room );
    char_to_room( create_mobile( get_mob_index(MOB_VNUM_CITYGUARD) ),
	ch->in_room );
    return TRUE;
}
Beispiel #10
0
void lightning( void )
{
 DESCRIPTOR_DATA *d;
  for ( d = descriptor_list; d != NULL; d = d->next )
        {
            if ( d->connected == CON_PLAYING
                && IS_OUTDOORS( d->character )
                && IS_AWAKE  ( d->character )
                && number_chance(10)
                && !IS_IMMORTAL(d->character)
                && d->character->level > 17
                && weather_info.sky == SKY_LIGHTNING ) {

 send_to_char("{x{RYou see a brilliant flash come down from the sky and then black out!{x\n\r",d->character);
 act( "$n has been struck by lightning!", d->character, NULL, NULL,TO_ROOM);
if(check_immune(d->character,DAM_LIGHTNING) != IS_IMMUNE) {
 if(d->character->fighting) {
stop_fighting(d->character,TRUE); }
if(check_immune(d->character,DAM_LIGHTNING) != IS_RESISTANT)
if (d->character->level < LI1);
d->character->hit -= d->character->hit/25;
if (d->character->level < LI2);
d->character->hit -= d->character->hit/20;
if (d->character->level < LI3);
d->character->hit -= d->character->hit/15;
WAIT_STATE(d->character,40); 
 } else {
if(check_immune(d->character,DAM_LIGHTNING) == IS_VULNERABLE) {
d->character->hit -= d->character->hit/10;
WAIT_STATE(d->character,40); } }
} }
}
Beispiel #11
0
void do_tell( CHAR_DATA *ch, const char *argument )
{
    CHAR_DATA *victim;
    char       arg [ MAX_INPUT_LENGTH ];
    int        position;

    if ( IS_AFFECTED( ch, AFF_MUTE )
        || IS_SET( ch->in_room->room_flags, ROOM_CONE_OF_SILENCE ) )
    {
        send_to_char( "You can't seem to break the silence.\n\r", ch );
        return;
    }

    one_argument( argument, arg );

    /*
     * Can tell to PC's anywhere, but NPC's only in same room.
     * -- Furey
     */
    if ( !( victim = get_char_world( ch, arg ) )
	|| ( IS_NPC( victim ) && victim->in_room != ch->in_room ) )
    {
	send_to_char( "They aren't here.\n\r", ch );
	return;
    }

    if ( ( !IS_NPC( ch ) && (   IS_SET( ch->act, PLR_SILENCE )
			     || IS_SET( ch->act, PLR_NO_TELL ) ) )
	|| IS_SET( victim->in_room->room_flags, ROOM_CONE_OF_SILENCE ) )
    {
	send_to_char( "Your message didn't get through.\n\r", ch );
	return;
    }

    argument = one_argument( argument, arg );

    if ( arg[0] == '\0' || argument[0] == '\0' )
    {
	send_to_char( "Tell whom what?\n\r", ch );
	return;
    }

    if ( !IS_IMMORTAL( ch ) && !IS_AWAKE( victim ) )
    {
	act( "$E can't hear you.", ch, 0, victim, TO_CHAR );
	return;
    }

    act( "You tell $N '$t'", ch, argument, victim, TO_CHAR );
    position		= victim->position;
    victim->position	= POS_STANDING;
    act( "$n tells you '$t'", ch, argument, victim, TO_VICT );
    victim->position	= position;
    victim->reply	= ch;

    if ( IS_SET( victim->act, PLR_AFK ) )
        act( "Just so you know, $E is AFK.", ch, NULL, victim, TO_CHAR );

    return;
}
Beispiel #12
0
bool spec_police_fine( CHAR_DATA * ch )
{
   CHAR_DATA *victim;
   CHAR_DATA *v_next;
   int vip;
   char buf[MAX_STRING_LENGTH];

   if( !IS_AWAKE( ch ) || ch->fighting )
      return FALSE;

   for( victim = ch->in_room->first_person; victim; victim = v_next )
   {
      v_next = victim->next_in_room;
      if( IS_NPC( victim ) )
         continue;
      if( !can_see( ch, victim ) )
         continue;
      if( number_bits( 1 ) == 0 )
         continue;
      for( vip = 0; vip <= 31; vip++ )
         if( IS_SET( ch->vip_flags, 1 << vip ) && IS_SET( victim->pcdata->wanted_flags, 1 << vip ) )
         {
            sprintf( buf, "Hey you're wanted on %s!", planet_flags[vip] );
            do_say( ch, buf );
            act( AT_ACTION, "$n fines $N an enormous amount of money.", ch, NULL, victim, TO_NOTVICT );
            act( AT_ACTION, "$n fines you an enourmous amount of money.", ch, NULL, victim, TO_VICT );
            victim->gold /= 2;
            REMOVE_BIT( victim->pcdata->wanted_flags, 1 << vip );
            return TRUE;
         }
   }
   return FALSE;
}
Beispiel #13
0
bool spec_fido( CHAR_DATA *ch )
{
	OBJ_DATA *corpse;
	OBJ_DATA *c_next;
	OBJ_DATA *obj;
	OBJ_DATA *obj_next;

	if ( !IS_AWAKE(ch) )
	return FALSE;

	for ( corpse = ch->in_room->contents; corpse != NULL; corpse = c_next )
	{
	c_next = corpse->next_content;
	if ( corpse->item_type != ITEM_CORPSE_NPC )
		continue;

	act( "$n savagely devours a corpse.", ch, NULL, NULL, TO_ROOM );
	for ( obj = corpse->contains; obj; obj = obj_next )
	{
		obj_next = obj->next_content;
		obj_from_obj( obj );
		obj_to_room( obj, ch->in_room );
	}
	extract_obj( corpse );
	return TRUE;
	}

	return FALSE;
}
Beispiel #14
0
void do_reply( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int position;

    if ( !IS_NPC(ch) && IS_SET(ch->act, PLR_SILENCE) )
    {
	send_to_char( "Your message didn't get through.\n\r", ch );
	return;
    }

    if ( ( victim = ch->reply ) == NULL )
    {
	send_to_char( "They aren't here.\n\r", ch );
	return;
    }

    if ( !IS_IMMORTAL(ch) && !IS_AWAKE(victim) )
    {
	act( "$E can't hear you.", ch, 0, victim, TO_CHAR );
	return;
    }

    act( "You tell $N '$t'.", ch, argument, victim, TO_CHAR );
    position		= victim->position;
    victim->position	= POS_STANDING;
    act( "$n tells you '$t'.", ch, argument, victim, TO_VICT );
    victim->position	= position;
    victim->reply	= ch;

    return;
}
Beispiel #15
0
bool spec_janitor( CHAR_DATA *ch )
{
	OBJ_DATA *trash;
	OBJ_DATA *trash_next;

	if ( !IS_AWAKE(ch) )
	return FALSE;

	for ( trash = ch->in_room->contents; trash != NULL; trash = trash_next )
	{
	trash_next = trash->next_content;
	if ( !IS_SET( trash->wear_flags, ITEM_TAKE ) || !can_loot(ch,trash))
		continue;
	if ( trash->item_type == ITEM_DRINK_CON
	||   trash->item_type == ITEM_TRASH
	||   trash->cost < 10 )
	{
		act( "$n picks up some trash.", ch, NULL, NULL, TO_ROOM );
		obj_from_room( trash );
		obj_to_char( trash, ch );
		return TRUE;
	}
	}

	return FALSE;
}
Beispiel #16
0
bool spec_cast_adept( CHAR_DATA *ch )
{
    CHAR_DATA *victim;
    CHAR_DATA *v_next;

    if ( !IS_AWAKE(ch) )
	return FALSE;

    for ( victim = ch->in_room->people; victim != NULL; victim = v_next )
    {
	v_next = victim->next_in_room;
	if ( victim != ch && can_see( ch, victim ) && number_bits( 1 ) == 0 )
	    break;
    }

    if ( victim == NULL )
	return FALSE;

    switch ( number_bits( 3 ) )
    {
    case 0:
	act( "$n utters the word 'tehctah'.", ch, NULL, NULL, TO_ROOM );
	spell_armor( skill_lookup( "armor" ), ch->level, ch, victim );
	return TRUE;

    case 1:
	act( "$n utters the word 'nhak'.", ch, NULL, NULL, TO_ROOM );
	spell_bless( skill_lookup( "bless" ), ch->level, ch, victim );
	return TRUE;

    case 2:
	act( "$n utters the word 'yeruf'.", ch, NULL, NULL, TO_ROOM );
	spell_cure_blindness( skill_lookup( "cure blindness" ),
	    ch->level, ch, victim );
	return TRUE;

    case 3:
	act( "$n utters the word 'garf'.", ch, NULL, NULL, TO_ROOM );
	spell_cure_light( skill_lookup( "cure light" ),
	    ch->level, ch, victim );
	return TRUE;

    case 4:
	act( "$n utters the words 'rozar'.", ch, NULL, NULL, TO_ROOM );
	spell_cure_poison( skill_lookup( "cure poison" ),
	    ch->level, ch, victim );
	return TRUE;

    case 5:
	act( "$n utters the words 'nadroj'.", ch, NULL, NULL, TO_ROOM );
	spell_refresh( skill_lookup( "refresh" ), ch->level, ch, victim );
	return TRUE;

    }

    return FALSE;
}
Beispiel #17
0
bool spec_executioner( CHAR_DATA *ch )
{
    char buf[MAX_STRING_LENGTH];
    MOB_INDEX_DATA *cityguard;
    CHAR_DATA *victim;
    CHAR_DATA *v_next;
    char *crime;

    if ( !IS_AWAKE(ch) || ch->fighting )
	return FALSE;

    crime = "";
    for ( victim = ch->in_room->first_person; victim; victim = v_next )
    {
	v_next = victim->next_in_room;

	if ( !IS_NPC(victim) && xIS_SET(victim->act, PLR_KILLER) )
	    { crime = "KILLER"; break; }

	if ( !IS_NPC(victim) && xIS_SET(victim->act, PLR_THIEF) )
	    { crime = "THIEF"; break; }
    }

    if ( !victim )
	return FALSE;

    if ( xIS_SET( ch->in_room->room_flags, ROOM_SAFE ) )
    {
	sprintf( buf, "%s is a %s!  As well as a COWARD!",
		victim->name, crime );
	do_yell( ch, buf );
	return TRUE;
    }

    sprintf( buf, "%s is a %s!  PROTECT THE INNOCENT!  MORE BLOOOOD!!!",
	victim->name, crime );
    do_yell( ch, buf );
    multi_hit( ch, victim, TYPE_UNDEFINED );
    if ( char_died(ch) )
      return TRUE;

    /* Added log in case of missing cityguard -- Tri */

    cityguard = get_mob_index( MOB_VNUM_CITYGUARD );

    if ( !cityguard )
    {
      sprintf( buf, "Missing Cityguard - Vnum:[%d]", MOB_VNUM_CITYGUARD );
      bug( buf, 0 );
      return TRUE;
    }

    char_to_room( create_mobile( cityguard ), ch->in_room );
    char_to_room( create_mobile( cityguard ), ch->in_room );
    return TRUE;
}
Beispiel #18
0
bool spec_guard( CHAR_DATA *ch )
{
	char buf[MSL]={'\0'};
	CHAR_DATA *victim;
	CHAR_DATA *v_next;
	CHAR_DATA *ech;
	char *crime;
	int max_evil;

	if ( !IS_AWAKE(ch) || ch->fighting != NULL )
	return FALSE;

	max_evil = 300;
	ech      = NULL;
	crime    = "";

	for ( victim = ch->in_room->people; victim != NULL; victim = v_next )
	{
	v_next = victim->next_in_room;

	if ( !IS_NPC(victim) && IS_SET(victim->act, PLR_KILLER) 
	&&   can_see(ch,victim))
		{ crime = "KILLER"; break; }

	if ( !IS_NPC(victim) && IS_SET(victim->act, PLR_THIEF) 
	&&   can_see(ch,victim))
		{ crime = "THIEF"; break; }

	if ( victim->fighting != NULL
	&&   victim->fighting != ch
	&&   victim->alignment < max_evil )
	{
		max_evil = victim->alignment;
		ech      = victim;
	}
	}

	if ( victim != NULL )
	{
	sprintf( buf, "%s is a %s!  PROTECT THE INNOCENT!!  BANZAI!!", victim->name, crime );
	REMOVE_BIT(ch->comm,COMM_NOSHOUT);
	do_function(ch, &do_yell, buf );
	multi_hit( ch, victim, TYPE_UNDEFINED );
	return TRUE;
	}

	if ( ech != NULL )
	{
	act( "$n screams 'PROTECT THE INNOCENT!!  BANZAI!!", ch, NULL, NULL, TO_ROOM );
	multi_hit( ch, ech, TYPE_UNDEFINED );
	return TRUE;
	}

	return FALSE;
}
Beispiel #19
0
bool spec_ogre_member( CHAR_DATA *ch )
{
    CHAR_DATA * vch, *victim = NULL;
    int count = 0;
    char *message;

    if ( !IS_AWAKE( ch ) || IS_AFFECTED( ch, AFF_CALM ) || ch->in_room == NULL
         || IS_AFFECTED( ch, AFF_CHARM ) || ch->fighting != NULL )
        return FALSE;

    /* find an troll to beat up */
    for ( vch = ch->in_room->people; vch != NULL; vch = vch->next_in_room )
    {
        if ( !IS_NPC( vch ) || ch == vch )
            continue;

        if ( !str_cmp( race_table[ GET_RACE(vch) ].name, "troll" )
             && ch->level > vch->level - 2 && !is_safe( ch, vch, TRUE ) )
        {
            if ( number_range( 0, count ) == 0 )
                victim = vch;

            count++;
        }
    }

    if ( victim == NULL )
        return FALSE;

    /* say something, then raise hell */
    switch ( number_range( 0, 6 ) )
    {
        default: message = NULL;	break;
        case 0: message = "$n wrzeszczy 'Szuka³em ciê, ¶mieciu!'";
            break;
        case 1: message = "$n atakuje $C z szaleñczym wrzaskiem.";
            break;
        case 2: message =
                "$n mówi 'Co taki ¶mierdz±cy, trollowaty pomiot jak ty tu w ogóle robi?'";
            break;
        case 3: message = "$n wy³amuje palce a¿ trzeszcz± i mówi 'My¶lisz, ¿e masz szczê¶cie?'";
            break;
        case 4: message = "$n mówi 'Nie widzê tu stra¿ników którzy mogliby ciê ochroniæ tym razem!'";
            break;
        case 5: message = "$n mówi 'Czas do³±czyæ do swoich durnych braci w za¶wiatach.'";
            break;
        case 6: message = "$n mówi 'I niech gra muzyka...'";
            break;
    }

    if ( message != NULL )
        act( message, ch, NULL, victim, TO_ALL );
    multi_hit( ch, victim, TYPE_UNDEFINED );
    return TRUE;
}
Beispiel #20
0
bool spec_nasty( CHAR_DATA *ch )
{
	CHAR_DATA *victim, *v_next;
	long gold;
 
	if (!IS_AWAKE(ch)) {
	   return FALSE;
	}
 
	if (ch->position != POS_FIGHTING) {
	   for ( victim = ch->in_room->people; victim != NULL; victim = v_next)
	   {
		  v_next = victim->next_in_room;
		  if (!IS_NPC(victim)
			 && (victim->level > ch->level)
			 && (victim->level < ch->level + 10))
		  {
		 do_function(ch, &do_backstab, victim->name);
			 if (ch->position != POS_FIGHTING)
		 {
				 do_function(ch, &do_murder, victim->name);
		 }

			 /* should steal some coins right away? :) */
			 return TRUE;
		  }
	   }
	   return FALSE;    /*  No one to attack */
	}
 
	/* okay, we must be fighting.... steal some coins and flee */
	if ( (victim = ch->fighting) == NULL)
		return FALSE;   /* let's be paranoid.... */
 
	switch ( number_bits(2) )
	{
		case 0:  act( "$n rips apart your coin purse, spilling your gold!",
					 ch, NULL, victim, TO_VICT);
				 act( "You slash apart $N's coin purse and gather his gold.",
					 ch, NULL, victim, TO_CHAR);
				 act( "$N's coin purse is ripped apart!",
					 ch, NULL, victim, TO_NOTVICT);
				 gold = victim->gold / 10;  /* steal 10% of his gold */
				 victim->gold -= gold;
				 ch->gold     += gold;
				 return TRUE;
 
		case 1:  do_function(ch, &do_flee, "");
				 return TRUE;
 
		default: return FALSE;
	}
}
Beispiel #21
0
bool spec_jedi_healer( CHAR_DATA * ch )
{
   CHAR_DATA *victim;
   CHAR_DATA *v_next;

   if( !IS_AWAKE( ch ) )
      return FALSE;

   for( victim = ch->in_room->first_person; victim; victim = v_next )
   {
      v_next = victim->next_in_room;
      if( victim != ch && can_see( ch, victim ) && number_bits( 1 ) == 0 )
         break;
   }

   if( !victim )
      return FALSE;

   switch ( number_bits( 12 ) )
   {
      case 0:
         act( AT_MAGIC, "$n pauses and concentrates for a moment.", ch, NULL, NULL, TO_ROOM );
         spell_smaug( skill_lookup( "armor" ), ch->top_level, ch, victim );
         return TRUE;

      case 1:
         act( AT_MAGIC, "$n pauses and concentrates for a moment.", ch, NULL, NULL, TO_ROOM );
         spell_smaug( skill_lookup( "good fortune" ), ch->top_level, ch, victim );
         return TRUE;

      case 2:
         act( AT_MAGIC, "$n pauses and concentrates for a moment.", ch, NULL, NULL, TO_ROOM );
         spell_cure_blindness( skill_lookup( "cure blindness" ), ch->top_level, ch, victim );
         return TRUE;

      case 3:
         act( AT_MAGIC, "$n pauses and concentrates for a moment.", ch, NULL, NULL, TO_ROOM );
         spell_smaug( skill_lookup( "cure light" ), ch->top_level, ch, victim );
         return TRUE;

      case 4:
         act( AT_MAGIC, "$n pauses and concentrates for a moment.", ch, NULL, NULL, TO_ROOM );
         spell_cure_poison( skill_lookup( "cure poison" ), ch->top_level, ch, victim );
         return TRUE;

      case 5:
         act( AT_MAGIC, "$n pauses and concentrates for a moment.", ch, NULL, NULL, TO_ROOM );
         spell_smaug( skill_lookup( "refresh" ), ch->top_level, ch, victim );
         return TRUE;
   }
   return FALSE;
}
Beispiel #22
0
bool spec_guardian(CHAR_DATA * ch)
{
	char buf[MAX_STRING_LENGTH];
	CHAR_DATA *victim;
	CHAR_DATA *v_next;
	CHAR_DATA *ech;
	char *crime;
	int max_evil;

	if (!IS_AWAKE(ch) || ch->fighting)
		return FALSE;

	max_evil = 300;
	ech = NULL;
	crime = "";

	for (victim = ch->in_room->first_person; victim; victim = v_next) {
		v_next = victim->next_in_room;
		if (victim->fighting
		    && who_fighting(victim) != ch
		    && victim->alignment < max_evil) {
			max_evil = victim->alignment;
			ech = victim;
		}
	}

	if (victim && IS_SET(ch->in_room->room_flags, ROOM_SAFE)) {
		sprintf(buf, "%s is a %s!  As well as a COWARD!", victim->name,
			crime);
		do_yell(ch, buf);
		return TRUE;
	}

	if (victim) {
		sprintf(buf, "%s is a %s!  PROTECT THE INNOCENT!!",
			victim->name, crime);
		do_shout(ch, buf);
		multi_hit(ch, victim, TYPE_UNDEFINED);
		return TRUE;
	}

	if (ech) {
		act(AT_YELL, "$n screams 'PROTECT THE INNOCENT!!",
		    ch, NULL, NULL, TO_ROOM);
		multi_hit(ch, ech, TYPE_UNDEFINED);
		return TRUE;
	}

	return FALSE;
}
Beispiel #23
0
void do_reply( CHAR_DATA *ch, const char *argument )
{
    CHAR_DATA *victim;
    int        position;

    if ( IS_AFFECTED( ch, AFF_MUTE )
        || IS_SET( ch->in_room->room_flags, ROOM_CONE_OF_SILENCE ) )
    {
        send_to_char( "You can't seem to break the silence.\n\r", ch );
        return;
    }

    if ( !( victim = ch->reply ) )
    {
	send_to_char( "They aren't here.\n\r", ch );
	return;
    }

    if ( ( !IS_NPC( ch ) && (   IS_SET( ch->act, PLR_SILENCE )
 			     || IS_SET( ch->act, PLR_NO_TELL ) ) )
	|| IS_SET( victim->in_room->room_flags, ROOM_CONE_OF_SILENCE ) )
    {
	send_to_char( "Your message didn't get through.\n\r", ch );
	return;
    }

    if ( argument[0] == '\0' )
    {
        send_to_char( "Reply what?\n\r", ch );
        return;
    }

    if ( !IS_IMMORTAL( ch ) && !IS_AWAKE( victim ) )
    {
	act( "$E can't hear you.", ch, 0, victim, TO_CHAR );
	return;
    }

    act( "You tell $N '$t'",  ch, argument, victim, TO_CHAR );
    position		= victim->position;
    victim->position	= POS_STANDING;
    act( "$n tells you '$t'", ch, argument, victim, TO_VICT );
    victim->position	= position;
    victim->reply	= ch;

    if ( IS_SET( victim->act, PLR_AFK ) )
        act( "Just so you know, $E is AFK.", ch, NULL, victim, TO_CHAR );

    return;
}
Beispiel #24
0
/*
 * Repopulate areas periodically.
 */
void area_update( void )
{
    AREA_DATA *pArea;

    for ( pArea = area_first; pArea != NULL; pArea = pArea->next )
    {
	CHAR_DATA *pch;

	if ( ++pArea->age < 3 )
	    continue;

	/*
	 * Check for PC's.
	 */
	if ( pArea->nplayer > 0 && pArea->age == 15 - 1 )
	{
	    for ( pch = char_list; pch != NULL; pch = pch->next )
	    {
		if ( !IS_NPC(pch)
		&&   IS_AWAKE(pch)
		&&   pch->in_room != NULL
		&&   pch->in_room->area == pArea )
		{
		    send_to_char( "You hear the patter of little feet.\n\r",
			pch );
		}
	    }
	}

	/*
	 * Check age and reset.
	 * Note: Mud School resets every 3 minutes (not 15).
	 */
	if ( pArea->nplayer == 0 || pArea->age >= 15 )
	{
	    ROOM_INDEX_DATA *pRoomIndex;

	    reset_area( pArea );
	    pArea->age = number_range( 0, 3 );
	    pRoomIndex = get_room_index( ROOM_VNUM_SCHOOL );
	    if ( pRoomIndex != NULL && pArea == pRoomIndex->area )
		pArea->age = 15 - 3;
	}
    }

    return;
}
Beispiel #25
0
char_data* active_shop( char_data* ch )
{
  room_data*    room  = ch->in_room;
  char_data*  keeper;

  if( !is_set( &room->room_flags, RFLAG_PET_SHOP )
    && !is_set( &room->room_flags, RFLAG_SHOP ) ) 
    return NULL;

  for( int i = 0; i < room->contents; i++ )
    if( ( keeper = mob( room->contents[i] ) ) != NULL
      && keeper->pShop != NULL && keeper->pShop->room == room 
      && IS_AWAKE( keeper ) && ch->Seen( keeper ) )
      return keeper;

  return NULL;
}
Beispiel #26
0
void do_tell( CHAR_DATA *ch, char *argument )
{
    char arg[MAX_INPUT_LENGTH];
    CHAR_DATA *victim;
    int position;

    if ( !IS_NPC(ch) && IS_SET(ch->act, PLR_SILENCE) )
    {
	send_to_char( "Your message didn't get through.\n\r", ch );
	return;
    }

    argument = one_argument( argument, arg );

    if ( arg[0] == '\0' || argument[0] == '\0' )
    {
	send_to_char( "Tell whom what?\n\r", ch );
	return;
    }

    /*
     * Can tell to PC's anywhere, but NPC's only in same room.
     * -- Furey
     */
    if ( ( victim = get_char_world( ch, arg ) ) == NULL
    || ( IS_NPC(victim) && victim->in_room != ch->in_room ) )
    {
	send_to_char( "They aren't here.\n\r", ch );
	return;
    }

    if ( !IS_IMMORTAL(ch) && !IS_AWAKE(victim) )
    {
	act( "$E can't hear you.", ch, 0, victim, TO_CHAR );
	return;
    }

    act( "You tell $N '$t'.", ch, argument, victim, TO_CHAR );
    position		= victim->position;
    victim->position	= POS_STANDING;
    act( "$n tells you '$t'.", ch, argument, victim, TO_VICT );
    victim->position	= position;
    victim->reply	= ch;

    return;
}
void do_backstab( CHAR_DATA *ch, char *argument )
{
	char arg[MIL]={'\0'};
	CHAR_DATA *victim;
	/*OBJ_DATA *obj;*/

	one_argument( argument, arg );

	if (IS_NULLSTR(arg))
	{
		send_to_char("Backstab whom?\n\r",ch);
		return;
	}

	if (ch->fighting != NULL)
	{
		send_to_char("You're facing the wrong end.\n\r",ch);
		return;
	}

	else if ((victim = get_char_room(ch,arg)) == NULL)
	{
		send_to_char("They aren't here.\n\r",ch);
		return;
	}

	if ( victim == ch )
	{
		send_to_char( "How can you sneak up on yourself?\n\r", ch );
		return;
	}

	WAIT_STATE( ch, skill_table[gsn_backstab].beats );
	if ( number_percent( ) < get_skill(ch,gsn_backstab)
			|| ( get_skill(ch,gsn_backstab) >= 2 && !IS_AWAKE(victim) ) )
	{
		multi_hit( ch, victim, gsn_backstab );
	}
	else
	{
		damage( ch, victim, 0, gsn_backstab,DAM_NONE,TRUE,0,-1);
	}

	return;
}
Beispiel #28
0
bool spec_thief( CHAR_DATA *ch )
{
    CHAR_DATA *victim;
    CHAR_DATA *v_next;
    int gold, maxgold;

    if ( ch->position != POS_STANDING )
	return FALSE;

    for ( victim = ch->in_room->first_person; victim; victim = v_next )
    {
	v_next = victim->next_in_room;

	if ( IS_NPC(victim)
	||   victim->level >= LEVEL_IMMORTAL
	||   number_bits( 2 ) != 0
	||   !can_see( ch, victim ) )	/* Thx Glop */
	    continue;

	if ( IS_AWAKE(victim) && number_range( 0, ch->level ) == 0 )
	{
	    act( AT_ACTION, "You discover $n's hands in your sack of gold!",
		ch, NULL, victim, TO_VICT );
	    act( AT_ACTION, "$N discovers $n's hands in $S sack of gold!",
		ch, NULL, victim, TO_NOTVICT );
	    return TRUE;
	}
	else
	{
	    maxgold = ch->level * ch->level * 1000;
	    gold = victim->gold
	    	 * number_range( 1, URANGE(2, ch->level/4, 10) ) / 100;
	    ch->gold     += 9 * gold / 10;
	    victim->gold -= gold;
	    if ( ch->gold > maxgold )
	    {
		boost_economy( ch->in_room->area, ch->gold - maxgold/2 );
		ch->gold = maxgold/2;
	    }
	    return TRUE;
	}
    }

    return FALSE;
}
Beispiel #29
0
bool spec_thief( CHAR_DATA *ch )
{
	CHAR_DATA *victim;
	CHAR_DATA *v_next;
	long gold,silver;

	if ( ch->position != POS_STANDING )
	return FALSE;

	for ( victim = ch->in_room->people; victim != NULL; victim = v_next )
	{
	v_next = victim->next_in_room;

	if ( IS_NPC(victim)
	||   victim->level >= LEVEL_IMMORTAL
	||   number_bits( 5 ) != 0 
	||   !can_see(ch,victim))
		continue;

	if ( IS_AWAKE(victim) && number_range( 0, ch->level ) == 0 )
	{
		act( "You discover $n's hands in your wallet!",
		ch, NULL, victim, TO_VICT );
		act( "$N discovers $n's hands in $S wallet!",
		ch, NULL, victim, TO_NOTVICT );
		return TRUE;
	}
	else
	{
		gold = victim->gold * UMIN(number_range(1,20),ch->level / 2) / 100;
		gold = UMIN(gold, ch->level * ch->level * 10 );
		ch->gold     += gold;
		victim->gold -= gold;
		silver = victim->silver * UMIN(number_range(1,20),ch->level/2)/100;
		silver = UMIN(silver,ch->level*ch->level * 25);
		ch->silver	+= silver;
		victim->silver -= silver;
		return TRUE;
	}
	}

	return FALSE;
}
/*
 * Check for dodge.
 */
bool check_dodge( CHAR_DATA *ch, CHAR_DATA *victim )
{
    int chance;

    if ( !IS_AWAKE(victim) )
	return FALSE;

    chance = get_skill(victim,gsn_dodge) / 2;

    if (!can_see(victim,ch))
	chance /= 2;

    if ( dice_rolls(ch,chance,6) >= 1 )
        return FALSE;

    act( "You dodge $n's attack.", ch, NULL, victim, TO_VICT, 1 );
    act( "$N dodges your attack.", ch, NULL, victim, TO_CHAR, 1 );
    return TRUE;
}