Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Feature Requests

Development::Feature Requests Post suggestions/feature requests here.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-29-2014, 04:17 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default Lua Mob.Say() optional language parameter

A while back an optional Language parameter was added to the Perl function for having an NPC say something, so that NPCs could speak other languages besides common.

When I skimmed over the Lua API reference taking a first look, I didn't see that as an option:

Code:
Mob member functions:

...
Void Say(String message);
...
Would it be possible to add an optional language parameter to the existing Lua function?

Or, alternatively, to add like a SayLang() function that would take a language code as well as the message text?
Reply With Quote
  #2  
Old 08-31-2014, 03:41 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

I'm going to add a way to do this for you.
Reply With Quote
  #3  
Old 08-31-2014, 03:55 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

You ROCK! \m/
Reply With Quote
  #4  
Old 08-31-2014, 11:22 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

As of next release you'll be able to add something like:

Code:
function eq.Say(msg, lang)
	local owner = eq.get_owner();
	if(owner.null) then
		return;
	end
	
	if(lang == nil) then		
		owner:Say(msg);
	else
		local entity_list = eq.get_entity_list();
		
		entity_list:ChannelMessage(owner, 8, lang, msg);
	end
end
in your lua_modules/general_ext.lua

Then you'll be able to use it in scripts like:

Code:
if(e.message:findi("hail")) then
	eq.Say("Test string 1");
elseif(e.message:findi("there")) then
	eq.Say("Test string in thieve's cant.", 10);
end
In the same way quest::say is used in perl more or less.
Reply With Quote
  #5  
Old 08-31-2014, 11:32 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

Perfection. Thanks, KLS.

This can add a very nice level of flavor, and means we won't have to revert to Perl for the functionality.

Thanks a ton for the quick turnaround.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:46 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3