talkchannelstream out;
out << who(ch) << yellow << "You're a noob!" << telnet_eol;
talkchannelstream out;
operator<<(out,who(ch)).operator<<(yellow).operator<<("You're a noob!").operator<<(telnet_eol);
- if ( !IS_AWAKE( to ) )
- continue;
- if ( !IS_AWAKE( to ) )
- continue;
I implemented the two layer word and letter based language translation system. This allows you to have a dictionary of elven words for example that will replace specific words, while also having a letter based translation system that is used on the word when no match in the language dictionary is found. The results are quite nice, perhaps even a bit excessive. Much work was put into making the words have appropriate capitalization, so speakers can YELL PARTICULAR WORDS in a sentence, even in foreign languages. I also implemented drunken speech, on top of the language translation. This means that drunken elves sound like drunken elves and drunken dwarves sound like drunken dwarves.
All channels in act_comm.c (even tell and reply) have been pushed through a common function channel_speech(…), where the content can easily be filtered.
Currently there is no way to specify the language a character is speaking aside from using the wiz command set:
Makes the character kaervos speak elven. The languages defined are common (0), elven (1) and dwarven (2). There are no language comprehension skills implemented, so hearing elven or dwarven always produces a fully foreign translation. Here is what it looks like:
From the speaker:
LOG_AUTH> Caught Kaervos doing set mob kaervos speaking 0
<47hp 130m 280mv> say Ok, this is me speaking common. Everyone can understand this.
You say 'Ok, this is me speaking common. Everyone can understand this.'
<47hp 130m 280mv> set mob kaervos speaking 1
LOG_AUTH> Caught Kaervos doing set mob kaervos speaking 1
<47hp 130m 280mv> say Alright, now I'm speaking in Elven. Words like Midgaard, mithril and Mota still sound familliar.
You say 'Alright, now I'm speaking in Elven. Words like Midgaard, mithril and
Mota still sound familliar.'
<56hp 140m 340mv> say I can also YELL SOME WORDS TO EMPHASIZE!
You say 'I can also YELL SOME WORDS TO EMPHASIZE!'
<65hp 150m 400mv> set mob kaervos speaking 2
LOG_AUTH> Caught Kaervos doing set mob kaervos speaking 2
<65hp 150m 400mv> say Indeed. Now I am speaking in dwarven. Again familliar words may appear.
You say 'Indeed. Now I am speaking in dwarven. Again familliar words may
appear.'
<74hp 160m 454mv> burp
You burp loudly.
<74hp 160m 454mv> mull
You mull over the idea at hand, asking for patience.
<74hp 160m 454mv> drink fire
You can't find it.
<74hp 160m 454mv> load obj 3003
LOG_AUTH> Caught Kaervos doing load obj 3003
Ok.
<74hp 160m 454mv> drink fire
You drink firebreather from a bottle of firebreather.
You are full.
Your thirst is quenched.
<74hp 160m 454mv> drink fire
You drink firebreather from a bottle of firebreather.
You are full.
Your thirst is quenched.
<74hp 160m 454mv> set mob kaervos drunk 10
LOG_AUTH> Caught Kaervos doing set mob kaervos drunk 10
<74hp 160m 454mv> say Indeed. Now I am speaking in dwarven. Again familliar words may appear.
You say 'innDeed. nooow ii am ssPehAhkiinNng Iiin Dwaorvehnnn. ahhhhgaiinNn
faommIiilLiaor WordzzZzssZ mAhY aapPear.'
<74hp 160m 454mv> say YOUR MOTHER HAS NO BEARD!
You say 'yOoouhr mmmmmooothher Has nno bEoard!'
<83hp 170m 454mv> set mob kaervos speaking 1
LOG_AUTH> Caught Kaervos doing set mob kaervos speaking 1
<83hp 170m 454mv> gos You are no match for my DRUNKEN ELF STYLE!
You gossip 'yoUhuhhuh Ahreh nNnooOo MmMawtch ffoooR MmMy DRunNnkENn ehLf
zzZzssZTYLE!'
<92hp 180m 454mv> set mob kaervos drunk 0
LOG_AUTH> Caught Kaervos doing set mob kaervos drunk 0
<92hp 180m 454mv> gos You are no match for my DRUNKEN ELF STYLE!
You gossip 'You are no match for my DRUNKEN ELF STYLE!'
<92hp 180m 454mv>
From the listener:
Kaervos coughs loudly.
<20hp 100m 100mv>
Kaervos says 'Ok, this is me speaking common. Everyone can understand this.'
<20hp 100m 100mv>
Kaervos says 'Ilcmeviran, leam E's latyailnelv aul Acelal. Amemwla cena
Midgaard, mithril ent Mota laanecc laeylw oilsecceilm.'
<20hp 100m 100mv>
Kaervos says 'E nyill ilclae AACC LAESA AMEMWLA NAE ASTYIRILLAEJA!'
<20hp 100m 100mv>
Kaervos says 'Artaat. Rurzh A azl thrhaazgark kurs tzhazhgar. Azkazar
waazlannaazh zhurhtth lazo azrhrhaazh.'
<20hp 100m 100mv>
Kaervos burps loudly.
<20hp 100m 100mv>
Kaervos mulls over the idea at hand. Please be patient.
<20hp 100m 100mv>
Kaervos has created a bottle of firebreather!
<20hp 100m 100mv>
Kaervos drinks firebreather from a bottle of firebreather.
<20hp 100m 100mv>
Kaervos drinks firebreather from a bottle of firebreather.
<20hp 100m 100mv>
Kaervos says 'artaaot. RuhURsZZzh A AhZsszzszl tHhHrhhhAhAzGoaRk KuhUrss
TzhhhahhhhZsszzszhgawR. aZzzZzkaaszzahhhhR waoaozlannnnnoaoazZh Zsszzszhhuhhurhh
hTtHhh LAzZOoo aoZzzZzRHrhhhAahzZHhH.'
<20hp 100m 100mv>
Kaervos says 'ooouhR'h Luhhurk'ah 'AhzZTh maOoosSzzsss grIiM!' <— drunken Dwarven
<20hp 100m 100mv>
Kaervos gossips 'NeHhHehl Iilmmaa nehh ZSssSilanNnnyiiR NesSssh ssA wMmMyLnaoL
KesSzzsssIr laoahNnacoa!' <— drunken Elven
<20hp 100m 100mv>
Kaervos gossips 'Nehel ilma neh silannyir nesh sa WMYLNAL KESIR LAANACA!' <— sober Elven
<20hp 100m 100mv>
Results are nice, I think. Obviously there is more to be done before a proper implementation of languages is complete. The race table needs to have languages in it, language skills need to be added and checked against to provide a % of words in the speech (based on skill) left in common tongue. I suspect one's language skill should be checked against improving everytime the language in question is heard spoken. Obviously a command for users to change currently spoken language is needed as well.
I uploaded a patch to the RaM file area. This patch was made against the most recent SVN version (~5pm EST 01/09/2009), and has been verified as functional.
Definitely let me know your thoughs.