src/magic.c
/*
 * Utter mystical words for an sn.
 */
Utter mystical words for an sn.
Utter mystical words for an sn .
void say_spell( CHAR_DATA *ch, int sn )
{
    char buf  [MAX_STRING_LENGTH];
    char buf2 [MAX_STRING_LENGTH];
    CHAR_DATA *rch;
    char *pName;
    int iSyl;
    int length;
    struct syl_type
    {
	char *	old;
	char *	new;
    };
    static const struct syl_type syl_table[] =
    {
	{ " ",		" "		},
	{ "ar",		"abra"		},
	{ "au",		"kada"		},
	{ "bless",	"fido"		},
	{ "blind",	"nose"		},
	{ "bur",	"mosa"		},
	{ "cu",		"judi"		},
	{ "de",		"oculo"		},
	{ "en",		"unso"		},
	{ "light",	"dies"		},
	{ "lo",		"hi"		},
	{ "mor",	"zak"		},
	{ "move",	"sido"		},
	{ "ness",	"lacri"		},
	{ "ning",	"illa"		},
	{ "per",	"duda"		},
	{ "ra",		"gru"		},
	{ "fresh",	"ima"		},
	{ "re",		"candus"	},
	{ "son",	"sabru"		},
	{ "tect",	"infra"		},
	{ "tri",	"cula"		},
	{ "ven",	"nofo"		},
	{ "a", "a" }, { "b", "b" }, { "c", "q" }, { "d", "e" },
	{ "e", "z" }, { "f", "y" }, { "g", "o" }, { "h", "p" },
	{ "i", "u" }, { "j", "y" }, { "k", "t" }, { "l", "r" },
	{ "m", "w" }, { "n", "i" }, { "o", "a" }, { "p", "s" },
	{ "q", "d" }, { "r", "f" }, { "s", "g" }, { "t", "h" },
	{ "u", "j" }, { "v", "z" }, { "w", "x" }, { "x", "n" },
	{ "y", "l" }, { "z", "k" },
	{ "", "" }
    };
    buf[0]	= '\0';
    for ( pName = skill_table[sn].name; *pName != '\0'; pName += length )
    {
	for ( iSyl = 0; (length = strlen(syl_table[iSyl].old)) != 0; iSyl++ )
	{
	    if ( !str_prefix( syl_table[iSyl].old, pName ) )
	    {
		strcat( buf, syl_table[iSyl].new );
		break;
	    }
	}
	if ( length == 0 )
	    length = 1;
    }
    sprintf( buf2, "$n utters the words, '%s'.", buf );
    sprintf( buf,  "$n utters the words, '%s'.", skill_table[sn].name );
    for ( rch = ch->in_room->people; rch; rch = rch->next_in_room )
    {
	if ( rch != ch )
	    act((!IS_NPC(rch) && ch->class==rch->class) ? buf : buf2,
	        ch, NULL, rch, TO_VICT );
    }
    return;
}
void say_spell ( CHAR_DATA * ch , int sn ) { char buf [ MAX_STRING_LENGTH ] ; char buf2 [ MAX_STRING_LENGTH ] ; CHAR_DATA * rch ; char * pName ; int iSyl ; int length ; struct syl_type { char * old ; char * new ; } ; static const struct syl_type syl_table [ ] = { { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } } ; buf [ 0 ] = ' \0 ' ; for ( pName = skill_table [ sn ] . name ; * pName != ' \0 ' ; pName += length ) { for ( iSyl = 0 ; ( length = strlen ( syl_table [ iSyl ] . old ) ) != 0 ; iSyl ++ ) { if ( ! str_prefix ( syl_table [ iSyl ] . old , pName ) ) { strcat ( buf , syl_table [ iSyl ] . new ) ; break ; } } if ( length == 0 ) length = 1 ; } sprintf ( buf2 , " " , buf ) ; sprintf ( buf , " " , skill_table [ sn ] . name ) ; for ( rch = ch -> in_room -> people ; rch ; rch = rch -> next_in_room ) { if ( rch != ch ) act ( ( ! IS_NPC ( rch ) && ch -> class == rch -> class ) ? buf : buf2 , ch , NULL , rch , TO_VICT ) ; } return ; }
Utter mystical words for an sn.
Utter mystical words for an sn .