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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-04-2009, 02:07 PM
realityincarnate
Developer
 
Join Date: Dec 2007
Posts: 122
Default Title suffix quest command [Committed in Rev420]

There was a thread not too long ago talking about using quest commands to add titles. There didn't seem to be any way to access the suffix part through the perl scripting, so I added one.

Syntax: $client->SetTitleSuffix(title)

Code:
Index: zone/perl_client.cpp
===================================================================
--- zone/perl_client.cpp	(revision 403)
+++ zone/perl_client.cpp	(working copy)
@@ -3524,6 +3524,32 @@
 	XSRETURN_EMPTY;
 }
 
+XS(XS_Client_SetTitleSuffix);
+XS(XS_Client_SetTitleSuffix) {
+	dXSARGS;
+	if (items != 2)
+		Perl_croak(aTHX_ "Usage: Client::SetTitleSuffix(THIS, txt)");
+	{
+		Client *		THIS;
+		char *		txt = (char *)SvPV_nolen(ST(1));
+
+		if (sv_derived_from(ST(0), "Client")) {
+			IV tmp = SvIV((SV*)SvRV(ST(0)));
+			THIS = INT2PTR(Client *,tmp);
+		}
+		else
+			Perl_croak(aTHX_ "THIS is not of type Client");
+		if(THIS == NULL)
+			Perl_croak(aTHX_ "THIS is NULL, avoiding crash.");
+
+		if(strlen(txt) > 31) 
+			Perl_croak(aTHX_ "Title must be 31 characters or less");
+
+		THIS->SetTitleSuffix(txt);
+	}
+	XSRETURN_EMPTY;
+}
+
 #ifdef __cplusplus
 extern "C"
 #endif
@@ -3675,6 +3701,7 @@
 		newXSproto(strcpy(buf, "SendZoneFlagInfo"), XS_Client_SendZoneFlagInfo, file, "$$");
 		newXSproto(strcpy(buf, "LoadZoneFlags"), XS_Client_LoadZoneFlags, file, "$");
 		newXSproto(strcpy(buf, "SetAATitle"), XS_Client_SetAATitle, file, "$$");
+		newXSproto(strcpy(buf, "SetTitleSuffix"), XS_Client_SetTitleSuffix, file, "$$");
 	XSRETURN_YES;
 }

Last edited by Derision; 04-10-2009 at 09:13 PM.. Reason: [Committed in Rev420]
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 05:08 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