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

Reply
 
Thread Tools Display Modes
  #1  
Old 07-30-2011, 02:29 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default COMMITTED: $client->Freeze(); $client->UnFreeze();

Very simple implementation of the already #command made function.

All it is, is a appearance packet setting anim to 102 completely freezing the client, keeping it from targeting or doing anything. I am using this for cut scene purposes and you can easily implement this into events to keep players from doing anything. You will need to UnFreeze them.

I thought about merging it into one object but thought it would be less confusing this way.

Code:
Index: EQEmuServer/zone/perl_client.cpp
===================================================================
--- EQEmuServer/zone/perl_client.cpp	(revision 1989)
+++ EQEmuServer/zone/perl_client.cpp	(working copy)
@@ -4813,6 +4813,53 @@
 	XSRETURN_EMPTY;
 }
 
+
+XS(XS_Client_Freeze);
+XS(XS_Client_Freeze)
+{
+	dXSARGS;
+	if (items != 1)
+		Perl_croak(aTHX_ "Usage: Client:Freeze(THIS)");
+	{
+		Client *	THIS;
+
+		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.");
+
+		THIS->SendAppearancePacket(AT_Anim, ANIM_FREEZE);
+	}
+	XSRETURN_EMPTY;
+}
+
+XS(XS_Client_UnFreeze);
+XS(XS_Client_UnFreeze)
+{
+	dXSARGS;
+	if (items != 1)
+		Perl_croak(aTHX_ "Usage: Client:UnFreeze(THIS)");
+	{
+		Client *	THIS;
+
+		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.");
+
+		THIS->SendAppearancePacket(AT_Anim, ANIM_STAND);
+	}
+	XSRETURN_EMPTY;
+}
+
 XS(XS_Client_GetFreeSpellBookSlot); /* prototype to pass -Wmissing-prototypes */
 XS(XS_Client_GetFreeSpellBookSlot)
 {
@@ -5328,6 +5375,8 @@
 		newXSproto(strcpy(buf, "GetAALevel"), XS_Client_GetAALevel, file, "$$");
 		newXSproto(strcpy(buf, "MarkCompassLoc"), XS_Client_MarkCompassLoc, file, "$$$$");
 		newXSproto(strcpy(buf, "ClearCompassMark"), XS_Client_ClearCompassMark, file, "$");
+		newXSproto(strcpy(buf, "Freeze"), XS_Client_Freeze, file, "$");
+		newXSproto(strcpy(buf, "UnFreeze"), XS_Client_UnFreeze, file, "$");
 		newXSproto(strcpy(buf, "GetFreeSpellBookSlot"), XS_Client_GetFreeSpellBookSlot, file, "$;$");
 		newXSproto(strcpy(buf, "GetSpellBookSlotBySpellID"), XS_Client_GetSpellBookSlotBySpellID, file, "$$");
 		newXSproto(strcpy(buf, "UpdateTaskActivity"), XS_Client_UpdateTaskActivity, file, "$$$$");
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 12:21 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