View Single Post
  #1  
Old 05-09-2009, 02:27 PM
realityincarnate
Developer
 
Join Date: Dec 2007
Posts: 122
Default Quest::say with languages

I added the ability to have npcs speak in different languages to the quest::say function. The original function is unchanged, but a language number can now be added as a second parameter.

I also added a new quest variable, $langid, which is exported to the perl say events (EVENT_SAY, EVENT_AGGRO_SAY, and EVENT_PROXIMITY_SAY). This holds the number corresponding to the language spoken to trigger the event and can be used to make npcs only respond to things said in certain languages.

Example use:
Code:
sub EVENT_SAY {
  if ($langid == 9) {
    quest::say("Welcome to Rivervale, friend", 9);
  }
  else {
    quest::say("Don't speak your outsider tongue to me!");
  }
}
Reply With Quote