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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-06-2009, 04:09 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
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
 


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 04:30 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3