/
rogue24b3/
rogue24b3/data/
/***************************************************************************\
[*]    ___    ____   ____   __   __  ____ [*]   ROGUE: ROM With Attitude  [*]
[*]   /#/ )  /#/  ) /#/  ) /#/  /#/ /#/   [*]    All rights reserved      [*]
[*]  /#/ <  /#/  / /#/ _  /#/  /#/ /#/--  [*]   Copyright(C) 2000-2001    [*]
[*] /#/   \(#(__/ (#(__/ (#(__/#/ (#(___  [*] Kenneth Conley (Mendanbar)  [*]
[*]  Expression of Digital Creativity..   [*]  scmud@mad.scientist.com    [*]
[-]---------------------------------------+-+-----------------------------[-]
[*] File : songs.h                                                        [*]
[*] Usage: New Bard Songs                                                 [*]
\***************************************************************************/

/*
Angel Poem     MP recover
Life Poem      HP recover
Rooters Song   Speed up
Battle Poem    Physical attack up
Magic Power    Magical attack up
Ancestor's     Random positive status (Regene, reraise, shield, protect, haste)
Last Song      Fill CT to 100
-----------------
APPLY_NONE
APPLY_STR
APPLY_DEX
APPLY_INT
APPLY_WIS
APPLY_CON
APPLY_CHA
APPLY_SEX
APPLY_MANA
APPLY_HIT
APPLY_MOVE
APPLY_AC
APPLY_HITROLL
APPLY_DAMROLL
APPLY_SAVES
APPLY_SAVING_PARA
APPLY_SAVING_ROD
APPLY_SAVING_PETRI
APPLY_SAVING_BREATH
APPLY_SAVING_SPELL
*/

#include "merc.h"
#include "songs.h"


void tale_of_champions(int songnum, int level, int worth, CHAR_DATA *ch, OBJ_DATA *inst)
{
    AFFECT_DATA af1;

    af1.where = TO_AFFECTS;
    af1.type = skill_lookup("music");
    af1.level = level;
    af1.duration = 6 + level;
    af1.bitvector = 0;

    worth /= 100;
    af1.modifier = level/8+worth;

    switch(number_range(1,6))
    {
	case 1:
	af1.location = APPLY_STR;
	break;
	case 2:
	af1.location = APPLY_DEX;
	break;
	case 3:
	af1.location = APPLY_INT;
	break;
	case 4:
	af1.location = APPLY_WIS;
	break;
	case 5:
	af1.location = APPLY_CON;
	break;
	case 6:
	af1.location = APPLY_CHA;
	break;
    }

    if (!is_affected( ch, af1.type ))
    {
	act("A white light surrounds $n.",ch,NULL,NULL,TO_ROOM);
	send_to_char("A white light surrounds you.\n\r", ch);
	affect_to_char(ch,&af1);
    }
    return;
}

void hymn_of_thunder( int songnum, int level, int worth, CHAR_DATA *ch, OBJ_DATA *inst )
{
    CHAR_DATA *vch;
    CHAR_DATA *vch_next;
    int dam=0;

    worth /= 100;
    act("A boom of thunder echos from $p.",ch,inst,NULL,TO_ROOM);

    for ( vch = char_list; vch != NULL; vch = vch_next )
    {
	vch_next = vch->next;
	if ( vch->in_room == ch->in_room )
	{
	   if ((vch != ch) && !is_safe_spell(ch,vch,TRUE)
		&& !is_same_group(vch,ch)) 
	    {
		dam = dice(1, 8) + ch->level / 3;
		damage( ch, vch, dam+worth, gsn_music, DAM_SOUND ,TRUE);
	    }
	}
	continue;
    }
    return;
}

void aegis_legend( int songnum, int level, int worth, CHAR_DATA *ch, OBJ_DATA *inst )
{
    OBJ_DATA *obj, *obj_next;
    AFFECT_DATA af;

    worth /= 100;

    af.where	= TO_OBJECT;
    af.type	= skill_lookup("music");
    af.level	= level+worth;
    af.duration	= 6 + level+worth;
    af.bitvector= ITEM_MUSIC;

    for ( obj = ch->carrying; obj != NULL; obj = obj_next )
    {
        obj_next = obj->next_content;
        if (number_percent() <= 50 && !IS_OBJ_STAT(obj,ITEM_MUSIC))
        {
	switch(number_range(1,18))
	{
	case 1:
	af.location = APPLY_STR;
	af.modifier = 1+worth;
	break;
	case 2:
	af.location = APPLY_DEX;
	af.modifier = 1+worth;
	break;
	case 3:
	af.location = APPLY_INT;
	af.modifier = 1+worth;
	break;
	case 4:
	af.location = APPLY_WIS;
	af.modifier = 1+worth;
	break;
	case 5:
	af.location = APPLY_CON;
	af.modifier = 1+worth;
	break;
	case 6:
	af.location = APPLY_CHA;
	af.modifier = 1+worth;
	case 7:
	af.location = APPLY_SAVING_SPELL;
	af.modifier = -(1+worth);
	break;
	case 8:
	af.location = APPLY_MANA;
	af.modifier = 10+worth;
	break;
	case 9:
	af.location = APPLY_HIT;
	af.modifier = 10+worth;
	break;
	case 10:
	af.location = APPLY_MOVE;
	af.modifier = 10+worth;
	break;
	case 11:
	af.location = APPLY_AC;
	af.modifier = -(20+worth);
	break;
	case 12:
	af.location = APPLY_HITROLL;
	af.modifier = 1+worth;
	break;
	case 13:
	af.location = APPLY_DAMROLL;
	af.modifier = 1+worth;
	break;
	case 14:
	af.location = APPLY_SAVES;
	af.modifier = -(1+worth);
	break;
	case 15:
	af.location = APPLY_SAVING_PARA;
	af.modifier = -(1+worth);
	break;
	case 16:
	af.location = APPLY_SAVING_ROD;
	af.modifier = -(1+worth);
	break;
	case 17:
	af.location = APPLY_SAVING_PETRI;
	af.modifier = -(1+worth);
	break;
	case 18:
	af.location = APPLY_SAVING_BREATH;
	af.modifier = -(1+worth);
	break;
	default:
	af.location = APPLY_NONE;
	af.modifier = 0;
	break;
	}

	act("$p gains a musical aura.",ch,obj,NULL, TO_CHAR);
	act("$p on $n gains a musical aura.",ch,obj,NULL, TO_ROOM);
	affect_to_obj(obj,&af);
	}
	continue;
    }
    return;
}

void song_charm( int songnum, int level, int worth, CHAR_DATA *ch, OBJ_DATA *inst) {
	CHAR_DATA *rch, *rch_next;
	AFFECT_DATA af;

    if (IS_SET(ch->in_room->room_flags, ROOM_LAW)) {
	send_to_char("You cannot do that here.\r\n", ch);
	return;
    }
    if (AFF_FLAGGED(ch, AFF_CHARM)) {
	send_to_char("You cannot do that while charmed.\r\n", ch);
	return;
    }
    worth /= 100;
    for (rch = char_list; rch != NULL; rch = rch_next) {
	rch_next = rch->next;
	if (ch->in_room != rch->in_room)
		continue;
	if ((rch == ch) || is_same_group(ch, rch) || is_safe(ch, rch))
		continue;
	if (IS_SET(rch->imm_flags,IMM_CHARM) || AFF_FLAGGED(rch, AFF_CHARM))
		continue;
	if ((get_curr_stat(rch, STAT_CHA)+rch->level) > (get_curr_stat(ch,STAT_CHA)+ch->level+worth))
		continue;

	if (rch->master)
		stop_follower(rch);
	add_follower(rch, ch);
	rch->leader = ch;
	af.where	= TO_AFFECTS;
	af.type		= skill_lookup("music");
	af.level	= level+worth;
	af.duration	= number_fuzzy(level / 4);
	af.location	= 0;
	af.modifier	= 0;
	af.bitvector	= AFF_CHARM;
	affect_to_char(rch, &af);
	act("$n charms you with his music.", ch, NULL, rch, TO_VICT);
	act("$N looks at you with adoring eyes.",ch,NULL,rch,TO_CHAR);
    }
}