RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Speech Events on NPC`s and NetStates

W

Wasted

Guest
Speech Events on NPC`s and NetStates

Anyway of installing speeches directly on a NPC instead of adding it to keywords.cs?

And what about adding speech events to NetStates, without keywords.cs?
 

krrios

Administrator
NPC heard-speech events will be in the next release.

Attaching a speech event handler specific to one Mobile isn't currently implemented. How would you like to see that done?

Perhaps:

[code:1]...
somePerson.Speech += new SpeechEventHandler( MyMethod );
...
void MyMethod( SpeechEventArgs e )
{
if ( e.HasKeyword( 0x123 ) )
{
...
}
}[/code:1]
 
W

Wasted

Guest
hummmm

perhaps

instead of Keyword stuff, pass a string containing the speech... or an array, just like comman args
 

krrios

Administrator
Furio, keywords are in Speech.mul, you can view that file with ModifyUO.

Wasted, SpeechEventArgs contains:

Mobile (Sender)
string Speech
MessageType Type
int Hue
int[] Keywords
bool Handled
 

Kardall

Wanderer
Well, the weird thing I found is that Mobiles are conglomerated into one massive group. But anyway:

mobile.TriggerArray
where the TriggerArray can be set with up to say 10 triggers with 10 responses.

mobile.ResponseArray
could be the corresponding "speech" or "calls" with the mobile.TriggerArray

Any other comments on it... suggestions...
 

ZenArcher

Wanderer
krrios given that SpeechEventArgs is an array shouldn't you be able to just compare the correct index for the Speech string with the desired string and then call a function.

I'm totally new to the C# side of things, but been scripting on the POL engine for years. I like what you've done so far. I would very much like to see the majority of the things that are currently compiled be brought out to runtime compiled scripts. That would allow for a lot more customization.

Thanks for all the hard work so far.
 
Top