languages.txt
snippets · 2.1 KB · 2010-03-30
Language code by Doug Araya (Whiplash), 4-12-96.
Download « Back to the snippets list
From: Whiplash <whiplash@armory.com>
/*
* Language code written by Doug Araya (whiplash@tft.nacs.net) 4-12-96
* if you use the code, it'd be nice to mention me in the changes, or help.
* (There's no excuses here if this code isn't wonderful, I wasn't tired, or
* trying to recall this all from memory, or drunk, it's normal code me)
* ---------------------------------------------------------------------------
* I'm not detailing the entry to const.c for this skill, use whatever level
* you want for this skill, and make it available to whoever, we don't use
* classes, our skills, and magic are available based on race and diety, so
* I don't have a stock example to give for normal ROM muds.
*/
/* === in db.c among all the gsn's add === */
sh_int gsn_dwarvish;
/* === in merc.h among all the gsn's add === */
extern sh_int gsn_dwarvish;
/* === in interp.c among all the commands add === */
{ "dwarvish", do_dwarvish, POS_RESTING, LOG_NORMAL, 1 },
/* === in interp.h add === */
DECLARE_DO_FUN( do_dwarvish );
/* === Dwarf Language ======================== */
void do_dwarvish( CHAR_DATA *ch, char *argument)
{
CHAR_DATA *och;
int chance;
int chance2;
if((chance = get_skill(ch,gsn_dwarvish)) == 0)
{
send_to_char("You don't know how to speak Dwarvish.\n\r",ch);
return;
}
if(argument[0] == '\0')
{
send_to_char("Say WHAT in Dwarvish?\n\r",ch);
return;
}
if(number_percent( ) < chance )
{
act("In Dwarvish, you say '$t'",ch,argument,NULL,TO_CHAR);
for(och = ch->in_room->people; och != NULL; och = och->next_in_room )
if((chance2 = get_skill(och,gsn_dwarvish)) == 0)
{
act("$n says something in a strange tongue.",ch,NULL,och,TO_VICT);
}
if(number_percent( ) < chance2)
{
act("In Dwarvish, $n says '$t'",ch,argument,och,TO_VICT);
check_improve(ch,gsn_dwarvish,TRUE,4);
}
}
check_improve(ch,gsn_dwarvish,FALSE,4);
}
/* === End of Dwarvish Language ===== */