Aasan Dar
I have a script that does something similar to what you want.
I do not know whom to credit with the writing of it but it's called Censor. I looked through the Distro scripts and couldn't find it. It is on our shard, Hope Lives, and what it does is turn the player to a slime of a random colour.
I will post all you need to implement it here as it's a small set of scripts.
First you'll need to create a package folder for it. I suggest in \pol\pkg\items
create a folder there called censor. Now paste the following into your text editor and save it as itemdesc.cfg in the above folder.
Code:
Item 0xA403
{
Name censor
Desc censor
DecayTime 0
ControlScript censor
graphic 0x1ea7
}
Now copy the following to your editoir and save it as censor.src in the same folder.
Code:
use os;
use uo;
include "include/eventid";
// To add to the list, just put new elements into the array.
var profanity :=
// insert here in quotes the "nasty words" you wish to monitor
// The list contained herein was modified for reason's of decency
// All except the last entry.
{
"poop",
"coitus",
"donkeypit",
"deitycondemn",
"urine",
"bigfemaleinsult",
"Sigismund rules"
};
program censor(me)
var x, i;
RegisterForSpeechEvents(me, 50);
EnableEvents(EVID_SPEECH,5);
var ev;
while (1)
ev := os::wait_for_event( 5 );
if (ev)
case (ev.type)
EVID_SPEECH:
foreach x in profanity
if (ev.text[x]);
DisableEvents(EVID_SPEECH);
i := ev.source;
start_script("punishment", i);
EnableEvents(EVID_SPEECH,5);
endif
endforeach
endcase
endif
endwhile
endprogram
Now the punishment script that ac tually does the deed. Paste this and save it as punishment.src in the folder.
Code:
use uo;
use os;
use util;
program punishment(who)
PrintTextAbove(who, "The gods do not tolerate such foolishness.");
PlaySoundEffect(who, 0x002a);
PlayLightningBoltEffect(who);
who.graphic := 0x33;
who.color := RandomInt(200) + 1;
endprogram
The first file that you made defined our device, the censor.
The first script, censor.src, is the "control" script. This script "lives" and is running for each censor you create. It does the necessary housekeeping to register the device for listening (speech events) and then executes the "punishement" script when it "hears" a bad word. Note the word list near the beginning. I edited all but the last entry for purposes of decency. You can figure out what the original words were I suppose.
*grins*
Oh yes and the last entry is the way I got the script so I think someone other than Sigismund must have written it.
The last script, punishment.src, changes the graphic to 0x33 which is a slime and then colours it a random colour. This script lacks the ability to change the character back however so the person stays that way until a GM can "fix" them. It should be fairly straightforward to edit the script to move the character to your jail location.
Hope this helps.
BTW welcome to the bestest mostest versatile UO emulator on the scene. I admit RunUO has a lot of momentum behind it but POL has the versatility and the long track record.