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

Reply
 
Thread Tools Display Modes
  #1  
Old 08-12-2009, 12:12 AM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default

Diff @ r921

Code:
Index: perlparser.cpp
===================================================================
--- perlparser.cpp	(revision 921)
+++ perlparser.cpp	(working copy)
@@ -547,6 +547,24 @@
 	XSRETURN_EMPTY;
 }
 
+XS(XS__voicetell);
+XS(XS__voicetell)
+{
+	dXSARGS;
+	if (items != 4)
+		Perl_croak(aTHX_ "Usage: voicetell(clientname, type, race, gender)");
+
+	char *	str = (char *)SvPV_nolen(ST(0));
+	int	macronum = (int)SvIV(ST(1));
+	int	racenum = (int)SvIV(ST(2));
+	int	gendernum = (int)SvIV(ST(3));
+
+	quest_manager.voicetell(str, macronum, racenum, gendernum);
+
+	XSRETURN_EMPTY;
+}
+
+
 XS(XS__depop);
 XS(XS__depop)
 {
@@ -2817,6 +2835,7 @@
 		newXS(strcpy(buf, "shout"), XS__shout, file);
 		newXS(strcpy(buf, "shout2"), XS__shout2, file);
 		newXS(strcpy(buf, "gmsay"), XS__gmsay, file);
+		newXS(strcpy(buf, "voicetell"), XS__voicetell, 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 921)
+++ questmgr.cpp	(working copy)
@@ -392,6 +392,10 @@
 	worldserver.SendChannelMessage(0,0,11,0, 0, "%s", str);
 }
 
+void QuestManager::voicetell(char *str, int macronum, int racenum, int gendernum) {
+	worldserver.SendVoiceMacroFromMob(owner,1,str,macronum, racenum, gendernum);
+}
+
 void QuestManager::depop(int npc_type) {
 	if(!owner->IsNPC())
 		return;
Index: questmgr.h
===================================================================
--- questmgr.h	(revision 921)
+++ questmgr.h	(working copy)
@@ -63,6 +63,7 @@
 	void shout(const char *str);
 	void shout2(const char *str);
 	void gmsay(const char *str);
+	void voicetell(char *str, int macronum, int racenum, int gendernum);
 	void depop(int npc_type = 0);
 	void depopall(int npc_type = 0);
 	void depopzone(bool StartSpawnTimer = true);
Index: worldserver.cpp
===================================================================
--- worldserver.cpp	(revision 921)
+++ worldserver.cpp	(working copy)
@@ -1507,6 +1507,39 @@
 	return Ret;
 }
 
+bool WorldServer::SendVoiceMacroFromMob(Mob* From, int32 Type, char* Target, int32 MacroNumber, int16 racenum, int8 gendernum) {
+
+	if(!worldserver.Connected())
+		return false;
+	
+	ServerPacket* pack = new ServerPacket(ServerOP_VoiceMacro, sizeof(ServerVoiceMacro_Struct));
+
+	ServerVoiceMacro_Struct* svm = (ServerVoiceMacro_Struct*) pack->pBuffer;
+	
+	if(!From){
+		strcpy(svm->From, "A Mysterious Voice");
+	}
+	else {
+	strcpy(svm->From, From->GetCleanName());
+	}
+
+	strcpy(svm->To, Target);
+
+	svm->Type = 1;
+
+	svm->Voice = (racenum * 2) + gendernum;
+
+	svm->MacroNumber = MacroNumber;
+
+	pack->Deflate();
+
+	bool Ret = SendPacket(pack);
+
+	safe_delete(pack);
+
+	return Ret;
+}
+
 bool WorldServer::RezzPlayer(EQApplicationPacket* rpack,int32 rezzexp, int16 opcode) {
 	_log(SPELLS__REZ, "WorldServer::RezzPlayer rezzexp is %i (0 is normal for RezzComplete", rezzexp);
 	ServerPacket* pack = new ServerPacket(ServerOP_RezzPlayer, sizeof(RezzPlayer_Struct));
Index: worldserver.h
===================================================================
--- worldserver.h	(revision 921)
+++ worldserver.h	(working copy)
@@ -39,6 +39,7 @@
 	bool SendEmoteMessage(const char* to, int32 to_guilddbid, int32 type, const char* message, ...);
 	bool SendEmoteMessage(const char* to, int32 to_guilddbid, sint16 to_minstatus, int32 type, const char* message, ...);
 	bool SendVoiceMacro(Client* From, int32 Type, char* Target, int32 MacroNumber, int32 GroupOrRaidID = 0);
+	bool SendVoiceMacroFromMob(Mob* From, int32 Type, char* Target, int32 MacroNumber, int16 racenum, int8 gendernum);
 	void SetZone(int32 iZoneID, int32 iInstanceID = 0);
 	int32 SendGroupIdRequest();
 	bool RezzPlayer(EQApplicationPacket* rpack,int32 rezzexp, int16 opcode);
Reply With Quote
  #2  
Old 08-12-2009, 02:04 PM
RichardoX
Hill Giant
 
Join Date: Dec 2004
Location: in your closet....
Posts: 169
Default

Do you have a list of voice emotes?
__________________
a hill giant slashes YOU for 25 points of damage!
You have been slain!
LOADING, PLEASE WAIT...
Reply With Quote
  #3  
Old 08-12-2009, 07:46 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default

Quote:
Originally Posted by RichardoX View Post
Do you have a list of voice emotes?
Yes. Open up the voice window in-game for clients, the IDs are there.
Reply With Quote
  #4  
Old 08-15-2009, 03:56 AM
RichardoX
Hill Giant
 
Join Date: Dec 2004
Location: in your closet....
Posts: 169
Default

Quote:
Originally Posted by Secrets View Post
Yes. Open up the voice window in-game for clients, the IDs are there.
Very awesome creation Secrets!
__________________
a hill giant slashes YOU for 25 points of damage!
You have been slain!
LOADING, PLEASE WAIT...
Reply With Quote
  #5  
Old 01-27-2010, 12:17 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default

Should this be moved to custom code, or is it good enough to commit it?

I've been using this and the only thing it needs is a null pointer check for (!Target), incase of invis GMs. Other than that, it works fine.
Reply With Quote
  #6  
Old 01-27-2010, 01:10 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

I'll commit it shortly.
Reply With Quote
  #7  
Old 01-27-2010, 01:34 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Just looking at it now, do we really need the ability to send the VoiceTell from a quest to a player in another zone ?

If not, then we can just do an entity_list.GetClientByName and send an OP_VoiceMacroOut directly to them in the current zone, rather than shipping a packet off to world.
Reply With Quote
Reply

Thread Tools
Display Modes

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