示例#1
0
文件: special.c 项目: bkero/Smaug
/*
 * Core procedure for dragons.
 */
bool dragon( CHAR_DATA *ch, char *spell_name )
{
    CHAR_DATA *victim;
    CHAR_DATA *v_next;
    int sn;

    if ( ch->position != POS_FIGHTING
       && ch->position !=  POS_EVASIVE
       && ch->position !=  POS_DEFENSIVE
       && ch->position !=  POS_AGGRESSIVE
       && ch->position !=  POS_BERSERK
    )
	return FALSE;

    for ( victim = ch->in_room->first_person; victim; victim = v_next )
    {
	v_next = victim->next_in_room;
	if ( who_fighting( victim ) == ch && number_bits( 2 ) == 0 )
	    break;
    }

    if ( !victim )
	return FALSE;

    if ( ( sn = skill_lookup( spell_name ) ) < 0 )
	return FALSE;
    (*skill_table[sn]->spell_fun) ( sn, ch->level, ch, victim );
    return TRUE;
}
示例#2
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;

}
示例#3
0
文件: special.c 项目: bkero/Smaug
bool spec_cast_cleric( CHAR_DATA *ch )
{
    CHAR_DATA *victim;
    CHAR_DATA *v_next;
    char *spell;
    int sn;

    summon_if_hating( ch );

    if ( ch->position != POS_FIGHTING
       && ch->position !=  POS_EVASIVE
       && ch->position !=  POS_DEFENSIVE
       && ch->position !=  POS_AGGRESSIVE
       && ch->position !=  POS_BERSERK
    )
	return FALSE;

    for ( victim = ch->in_room->first_person; victim; victim = v_next )
    {
	v_next = victim->next_in_room;
	if ( who_fighting( victim ) == ch && number_bits( 2 ) == 0 )
	    break;
    }

    if ( !victim || victim == ch )
	return FALSE;

    for ( ;; )
    {
	int min_level;

	switch ( number_bits( 4 ) )
	{
	case  0: min_level =  0; spell = "cause light";    break;
	case  1: min_level =  3; spell = "cause serious";  break;
	case  2: min_level =  6; spell = "earthquake";     break;
	case  3: min_level =  7; spell = "blindness";	   break;
	case  4: min_level =  9; spell = "cause critical"; break;
	case  5: min_level = 10; spell = "dispel evil";    break;
	case  6: min_level = 12; spell = "curse";          break;
	case  7: min_level = 13; spell = "flamestrike";    break;
	case  8: 
	case  9:
	case 10: min_level = 15; spell = "harm";           break;
	default: min_level = 16; spell = "dispel magic";   break;
	}

	if ( ch->level >= min_level )
	    break;
    }

    if ( ( sn = skill_lookup( spell ) ) < 0 )
	return FALSE;
    (*skill_table[sn]->spell_fun) ( sn, ch->level, ch, victim );
    return TRUE;
}
示例#4
0
文件: special.c 项目: bkero/Smaug
bool spec_cast_mage( CHAR_DATA *ch )
{
    CHAR_DATA *victim;
    CHAR_DATA *v_next;
    char *spell;
    int sn;

    summon_if_hating( ch );

    if ( ch->position != POS_FIGHTING
       && ch->position !=  POS_EVASIVE
       && ch->position !=  POS_DEFENSIVE
       && ch->position !=  POS_AGGRESSIVE
       && ch->position !=  POS_BERSERK
    )
	return FALSE;

    for ( victim = ch->in_room->first_person; victim; victim = v_next )
    {
	v_next = victim->next_in_room;
	if ( who_fighting( victim ) && number_bits( 2 ) == 0 )
	    break;
    }

    if ( !victim || victim == ch )
	return FALSE;

    for ( ;; )
    {
	int min_level;

	switch ( number_bits( 4 ) )
	{
	case  0: min_level =  0; spell = "black hand";	   break;
	case  1: min_level =  3; spell = "chill touch";    break;
	case  2: min_level =  7; spell = "weaken";         break;
	case  3: min_level =  8; spell = "galvanic whip";  break;
	case  4: min_level = 11; spell = "colour spray";   break;
	case  5: min_level = 12; spell = "weaken";	   break;
	case  6: min_level = 13; spell = "energy drain";   break;
	case  7: min_level = 14; spell = "spectral furor"; break;
	case  8:
	case  9: min_level = 15; spell = "fireball";       break;
	default: min_level = 20; spell = "acid blast";     break;
	}

	if ( ch->level >= min_level )
	    break;
    }

    if ( ( sn = skill_lookup( spell ) ) < 0 )
	return FALSE;
    (*skill_table[sn]->spell_fun) ( sn, ch->level, ch, victim );
    return TRUE;
}
示例#5
0
文件: special.c 项目: bkero/Smaug
bool spec_cast_undead( CHAR_DATA *ch )
{
    CHAR_DATA *victim;
    CHAR_DATA *v_next;
    char *spell;
    int sn;

    summon_if_hating( ch );

    if ( ch->position != POS_FIGHTING
       && ch->position !=  POS_EVASIVE
       && ch->position !=  POS_DEFENSIVE
       && ch->position !=  POS_AGGRESSIVE
       && ch->position !=  POS_BERSERK
    )
	return FALSE;

    for ( victim = ch->in_room->first_person; victim; victim = v_next )
    {
	v_next = victim->next_in_room;
	if ( who_fighting( victim ) == ch && number_bits( 2 ) == 0 )
	    break;
    }

    if ( !victim || victim == ch )
	return FALSE;

    for ( ;; )
    {
	int min_level;

	switch ( number_bits( 4 ) )
	{
	case  0: min_level =  0; spell = "chill touch";    break;
	case  1: min_level = 11; spell = "weaken";         break;
	case  2: min_level = 12; spell = "curse";          break;
	case  3: min_level = 13; spell = "blindness";      break;
	case  4: min_level = 14; spell = "poison";         break;
	case  5: min_level = 15; spell = "energy drain";   break;
	case  6: min_level = 18; spell = "harm";           break;
	default: min_level = 40; spell = "gate";           break;
	}

	if ( ch->level >= min_level )
	    break;
    }

    if ( ( sn = skill_lookup( spell ) ) < 0 )
	return FALSE;
    (*skill_table[sn]->spell_fun) ( sn, ch->level, ch, victim );
    return TRUE;
}
示例#6
0
bool spec_poison( CHAR_DATA * ch )
{
   CHAR_DATA *victim;

   if( ch->position != POS_FIGHTING || ( victim = who_fighting( ch ) ) == NULL || number_percent(  ) > 2 * ch->top_level )
      return FALSE;

   act( AT_HIT, "You bite $N!", ch, NULL, victim, TO_CHAR );
   act( AT_ACTION, "$n bites $N!", ch, NULL, victim, TO_NOTVICT );
   act( AT_POISON, "$n bites you!", ch, NULL, victim, TO_VICT );
   spell_poison( gsn_poison, ch->top_level, ch, victim );
   return TRUE;
}
示例#7
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;
}
示例#8
0
/*
 * Procedura centrale per i dragoni.
 */
bool dragon( CHAR_DATA *ch, char *spell_name )
{
	CHAR_DATA *victim;
	CHAR_DATA *v_next;
	int		   sn;

	if ( ch->position != POSITION_FIGHT
	  && ch->position != POSITION_EVASIVE
	  && ch->position != POSITION_DEFENSIVE
	  && ch->position != POSITION_AGGRESSIVE
	  && ch->position != POSITION_BERSERK )
	{
		return FALSE;
	}

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

		if ( who_fighting(victim) != ch )	continue;
		if ( number_bits(2) )				continue;

		if ( IS_PG(victim) )
			break;
		if ( IS_MOB(victim) && HAS_BIT(victim->affected_by, AFFECT_CHARM) )
			break;
	}

	if ( !victim )
		return FALSE;

	sn = skill_lookup( spell_name );
	if ( sn < 0 )
		return FALSE;

	(*table_skill[sn]->spell_fun) ( sn, get_level(ch)/2, ch, victim );
	return TRUE;
}
示例#9
0
SPEC_RET spec_poison( CHAR_DATA *ch )
{
	CHAR_DATA *victim;

	if ( ch->position != POSITION_FIGHT
	  && ch->position != POSITION_EVASIVE
	  && ch->position != POSITION_DEFENSIVE
	  && ch->position != POSITION_AGGRESSIVE
	  && ch->position != POSITION_BERSERK )
	{
		return FALSE;
	}

	victim = who_fighting( ch );
	if ( !victim )								return FALSE;
	if ( number_percent() > get_level(ch)/2 )	return FALSE;

	act( AT_HIT,	"Mordi $N!",	ch, NULL, victim, TO_CHAR );
	act( AT_ACTION, "$n morde $N!", ch, NULL, victim, TO_NOVICT );
	act( AT_POISON, "$n ti morde!", ch, NULL, victim, TO_VICT );

	spell_poison( gsn_poison, get_level(ch)/2, ch, victim );
	return TRUE;
}
示例#10
0
SPEC_RET spec_guard( CHAR_DATA *ch )
{
	CHAR_DATA	*victim;
	CHAR_DATA	*v_next;
	CHAR_DATA	*ech;
	char		*crime;
	char		 buf[MSL];
	int			 max_evil;

	if ( !is_awake(ch) )	return FALSE;
	if ( 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 )			continue;
		if ( who_fighting(victim) == ch )	continue;

		if ( IS_PG(victim) && HAS_BIT_PLR(victim, PLAYER_KILLER) )
		{
			crime = "assassino";
			break;
		}

		if ( IS_PG(victim) && HAS_BIT_PLR(victim, PLAYER_THIEF) )
		{
			crime = "ladro";
			break;
		}

		if ( victim->alignment < max_evil )
		{
			max_evil = victim->alignment;
			ech	  = victim;
		}
	}

	if ( victim && HAS_BIT(ch->in_room->flags, ROOM_SAFE) )
	{
		sprintf( buf, "yell codardo di un %s!", crime );	/* (GR) articolo */
		send_command( ch, buf, CO );
		return TRUE;
	}

	if ( victim )
	{
		sprintf( buf, "yell Proteggiamo l'innocente dal %s!!", crime );	/* (GR) articolo dal dall' */
		send_command( ch, buf, CO );
		multi_hit( ch, victim, TYPE_UNDEFINED );
		return TRUE;
	}

	if ( ech )
	{
		act( AT_YELL, "$n urla 'Proteggiamo l'innocente!'", ch, NULL, NULL, TO_ROOM );
		multi_hit( ch, ech, TYPE_UNDEFINED );
		return TRUE;
	}

	return FALSE;
}
示例#11
0
SPEC_RET spec_cast_undead( CHAR_DATA *ch )
{
	CHAR_DATA *victim;
	CHAR_DATA *v_next;
	char	  *spell;
	int		   sn;

	summon_if_hating( ch );

	if ( ch->position != POSITION_FIGHT
	  && ch->position != POSITION_EVASIVE
	  && ch->position != POSITION_DEFENSIVE
	  && ch->position != POSITION_AGGRESSIVE
	  && ch->position != POSITION_BERSERK )
	{
		return FALSE;
	}

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

		if ( who_fighting(victim) != ch )	continue;
		if ( number_bits(2) == 0 )			continue;

		if ( IS_PG(victim) )
			break;
		if ( IS_MOB(victim) && HAS_BIT(victim->affected_by, AFFECT_CHARM) )
			break;
	}

	if ( !victim )		return FALSE;
	if ( victim == ch )	return FALSE;

	for ( ; ; )
	{
		int min_level;

		switch ( number_bits(4) )
		{
		  case  0:	min_level =  1;		spell = "chill touch";		break;
		  case  1:	min_level = 22;		spell = "weaken";			break;
		  case  2:	min_level = 24;		spell = "curse";			break;
		  case  3:	min_level = 26;		spell = "blindness";		break;
		  case  4:	min_level = 28;		spell = "poison";			break;
		  case  5:	min_level = 30;		spell = "energy drain";		break;
		  case  6:	min_level = 36;		spell = "harm";				break;
		  default:	min_level = 80;		spell = "gate";				break;
		}

		if ( get_level(ch) >= min_level )
			break;
	}

	sn = skill_lookup( spell );
	if ( sn < 0 )
		return FALSE;

	(*table_skill[sn]->spell_fun) ( sn, get_level(ch)/2, ch, victim );
	return TRUE;
}
示例#12
0
SPEC_RET spec_cast_mage( CHAR_DATA *ch )
{
	CHAR_DATA *victim;
	CHAR_DATA *v_next;
	char	  *spell;
	int		   sn;

	summon_if_hating( ch );

	if ( ch->position != POSITION_FIGHT
	  && ch->position != POSITION_EVASIVE
	  && ch->position != POSITION_DEFENSIVE
	  && ch->position != POSITION_AGGRESSIVE
	  && ch->position != POSITION_BERSERK )
	{
		return FALSE;
	}

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

		if ( who_fighting(victim) != ch )	continue;
		if ( number_bits(2) )				continue;

		if ( IS_PG(victim) )
			break;
		if ( IS_MOB(victim) && HAS_BIT(victim->affected_by, AFFECT_CHARM) )
			break;
	}

	if ( !victim )		return FALSE;
	if ( victim == ch )	return FALSE;

	for ( ; ; )
	{
		int min_level;

		switch ( number_bits(4) )
		{
		  case  0:	min_level =  1;		spell = "magic missile";	break;
		  case  1:	min_level =  6;		spell = "chill touch";		break;
		  case  2:	min_level = 14;		spell = "weaken";			break;
		  case  3:	min_level = 16;		spell = "galvanic whip";	break;
		  case  4:	min_level = 22;		spell = "colour spray";		break;
		  case  5:	min_level = 24;		spell = "weaken";			break;
		  case  6:	min_level = 26;		spell = "energy drain";		break;
		  case  7:	min_level = 28;		spell = "spectral furor";	break;
		  case  8:
		  case  9:	min_level = 30;		spell = "fireball";			break;
		  default:	min_level = 40;		spell = "acid blast";		break;
		}

		if ( get_level(ch) >= min_level )
			break;
	}

	sn = skill_lookup( spell );
	if ( sn < 0 )
		return FALSE;

	(*table_skill[sn]->spell_fun) ( sn, get_level(ch)/2, ch, victim );
	return TRUE;
}
示例#13
0
SPEC_RET spec_cast_cleric( CHAR_DATA *ch )
{
	CHAR_DATA *victim;
	CHAR_DATA *v_next;
	char	  *spell;
	int		   sn;

	summon_if_hating( ch );

	if ( ch->position != POSITION_FIGHT
	  && ch->position != POSITION_EVASIVE
	  && ch->position != POSITION_DEFENSIVE
	  && ch->position != POSITION_AGGRESSIVE
	  && ch->position != POSITION_BERSERK )
	{
		return FALSE;
	}

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

		if ( who_fighting(victim) != ch )	continue;
		if ( number_bits(2) )				continue;

		if ( IS_PG(victim) )
			break;
		if ( IS_MOB(victim) && HAS_BIT(victim->affected_by, AFFECT_CHARM) )
			break;
	}

	if ( !victim  )		return FALSE;
	if ( victim == ch )	return FALSE;

	for ( ; ; )
	{
		int min_level;

		/* (FF) (LV) questi min_level forse sono da tarare */
		switch ( number_bits(4) )
		{
		  case  0:	min_level =  1;		spell = "cause light";		break;
		  case  1:	min_level =  6;		spell = "cause serious";	break;
		  case  2:	min_level = 12;		spell = "earthquake";		break;
		  case  3:	min_level = 14;		spell = "blindness";		break;
		  case  4:	min_level = 18;		spell = "cause critical";	break;
		  case  5:	min_level = 20;		spell = "dispel evil";		break;
		  case  6:	min_level = 24;		spell = "curse";			break;
		  case  7:	min_level = 26;		spell = "flamestrike";		break;
		  case  8:
		  case  9:
		  case 10:	min_level = 30;		spell = "harm";				break;
		  default:	min_level = 32;		spell = "dispel magic";		break;
		}

		if ( get_level(ch) >= min_level )
			break;
	}

	sn = skill_lookup( spell );
	if ( sn < 0 )
		return FALSE;

	(*table_skill[sn]->spell_fun) ( sn, get_level(ch)/2, ch, victim );
	return TRUE;
}
示例#14
0
bool spec_dark_jedi(CHAR_DATA * ch)
{
	CHAR_DATA *victim;
	CHAR_DATA *v_next;
	char *spell;
	int sn;

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

	for (victim = ch->in_room->first_person; victim; victim = v_next) {
		v_next = victim->next_in_room;
		if (who_fighting(victim) && number_bits(2) == 0)
			break;
	}

	if (!victim || victim == ch)
		return FALSE;

	for (;;) {
		int min_level;

		switch (number_bits(4)) {
		case 0:
			min_level = 5;
			spell = "blindness";
			break;
		case 1:
			min_level = 5;
			spell = "fingers of the force";
			break;
		case 2:
			min_level = 9;
			spell = "choke";
			break;
		case 3:
			min_level = 8;
			spell = "invade essence";
			break;
		case 4:
			min_level = 11;
			spell = "force projectile";
			break;
		case 6:
			min_level = 13;
			spell = "drain essence";
			break;
		case 7:
			min_level = 4;
			spell = "force whip";
			break;
		case 8:
			min_level = 13;
			spell = "harm";
			break;
		case 9:
			min_level = 9;
			spell = "force bolt";
			break;
		case 10:
			min_level = 1;
			spell = "force spray";
			break;
		default:
			return FALSE;
		}

		if (ch->top_level >= min_level)
			break;
	}

	if ((sn = skill_lookup(spell)) < 0)
		return FALSE;
	(*skill_table[sn]->spell_fun) (sn, ch->top_level, ch, victim);
	return TRUE;
}