Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 08-06-2009, 04:09 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,450
Default GMSay for quests

Here it is. Requested by Trevius, it sends a message to GMSay in a quest command.


Use:

gmsay("string");

Output:

Zserver GMSAYS, 'string'

Diff:

Code:
Index: parser.cpp
===================================================================
--- parser.cpp	(revision 890)
+++ parser.cpp	(working copy)
@@ -837,6 +837,9 @@
 	else if (!strcmp(command,"shout2")) {
 		quest_manager.shout2(parms.c_str());
 	}
+	else if (!strcmp(command,"gmsay")) {
+		quest_manager.shout2(parms.c_str());
+	}
 	else if (!strcmp(command,"shout")) {
 		quest_manager.shout(parms.c_str());
 	}
Index: perlparser.cpp
===================================================================
--- perlparser.cpp	(revision 890)
+++ perlparser.cpp	(working copy)
@@ -533,6 +533,19 @@
 	XSRETURN_EMPTY;
 }
 
+XS(XS__gmsay)
+{
+	dXSARGS;
+	if (items != 1)
+		Perl_croak(aTHX_ "Usage: gmsay(str)");
+
+	char *		str = (char *)SvPV_nolen(ST(0));
+
+	quest_manager.gmsay(str);
+
+	XSRETURN_EMPTY;
+}
+
 XS(XS__depop);
 XS(XS__depop)
 {
@@ -2802,6 +2815,7 @@
 		newXS(strcpy(buf, "emote"), XS__emote, file);
 		newXS(strcpy(buf, "shout"), XS__shout, file);
 		newXS(strcpy(buf, "shout2"), XS__shout2, file);
+		newXS(strcpy(buf, "gmsay"), XS__gmsay, file);
 		newXS(strcpy(buf, "depop"), XS__depop, file);
 		newXS(strcpy(buf, "settarget"), XS__settarget, file);
 		newXS(strcpy(buf, "follow"), XS__follow, file);
Index: questmgr.cpp
===================================================================
--- questmgr.cpp	(revision 890)
+++ questmgr.cpp	(working copy)
@@ -388,6 +388,10 @@
 	worldserver.SendEmoteMessage(0,0,0,13, "%s shouts, '%s'", owner->GetCleanName(), str);
 }
 
+void QuestManager::gmsay(const char *str) {
+	worldserver.SendChannelMessage(0,0,11,0, 0, "%s", str);
+}
+
 void QuestManager::depop(int npc_type) {
 	if(!owner->IsNPC())
 		return;
Index: questmgr.h
===================================================================
--- questmgr.h	(revision 890)
+++ questmgr.h	(working copy)
@@ -62,6 +62,7 @@
 	void emote(const char *str);
 	void shout(const char *str);
 	void shout2(const char *str);
+	void gmsay(const char *str);
 	void depop(int npc_type = 0);
 	void depopall(int npc_type = 0);
 	void depopzone(bool StartSpawnTimer = true);
Reply With Quote
  #2  
Old 08-06-2009, 05:56 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Simple and sweet. Thanks, Secrets!
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 08-06-2009, 07:30 PM
pfyon's Avatar
pfyon
Discordant
 
Join Date: Mar 2009
Location: Ottawa
Posts: 495
Default

Ultimately, wouldn't it make more sense to have a generic quest::msgchannel() (or the like) that could send a message to any channel id instead of hardcoding it for gm speak?
Reply With Quote
  #4  
Old 08-06-2009, 09:33 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,450
Default

Quote:
Originally Posted by pfyon View Post
Ultimately, wouldn't it make more sense to have a generic quest::msgchannel() (or the like) that could send a message to any channel id instead of hardcoding it for gm speak?
Probably. I don't see the purpose of it, though, as most of the other channels can be messaged with worldemote.
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 08:10 AM.


 

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