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

Reply
 
Thread Tools Display Modes
  #1  
Old 09-21-2009, 10:19 PM
Shin Noir's Avatar
Shin Noir
Legendary Member
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 502
Default Wizard AA: Teleport Bind

First, this AA is pretty straight forward. From casters realm (link)

When activated, this ability will teleport the wizards entire group to the wizards bind point.

Since the bind point info is private data on the client and there are no ways to get bind info, I just wrote some new functions. Technically these functions could take an argument since multiple binds are possible, but for now I default to 0. Also when I do the MovePC() function I default to instance 0, that may be problematic if you can bind into an instance.

Feel free to clean this up and do it another way, but from my bit of testing it seemed to work. Which is a huge improvement of what it was before. :P

Code:
Index: client.h
===================================================================
--- client.h	(revision 9)
+++ client.h	(working copy)
@@ -451,6 +451,11 @@
 	void	SetBindPoint(int to_zone = -1, float new_x = 0.0f, float new_y = 0.0f, float new_z = 0.0f);
 	void	SetStartZone(uint32 zoneid, float x = 0.0f, float y =0.0f, float z = 0.0f);
 	uint32	GetStartZone(void);
+	inline const float	GetBindX() const		{ return m_pp.binds[0].x; }
+	inline const float	GetBindY() const		{ return m_pp.binds[0].y; }
+	inline const float	GetBindZ() const		{ return m_pp.binds[0].z; }
+	inline const float	GetBindHeading() const	{ return m_pp.binds[0].heading; }
+	inline const float	GetBindZoneId() const	{ return m_pp.binds[0].zoneId; }
 	void	MovePC(const char* zonename, float x, float y, float z, float heading, int8 ignorerestrictions = 0, ZoneMode zm = ZoneSolicited);
 	void	MovePC(int32 zoneID, float x, float y, float z, float heading, int8 ignorerestrictions = 0, ZoneMode zm = ZoneSolicited);
 	void	MovePC(float x, float y, float z, float heading, int8 ignorerestrictions = 0, ZoneMode zm = ZoneSolicited);
Index: spell_effects.cpp
===================================================================
--- spell_effects.cpp	(revision 984)
+++ spell_effects.cpp	(working copy)
@@ -392,6 +388,7 @@
 
 				break;
 			}
+			case SE_YetAnotherGate: //Shin: Used on Teleport Bind.
 			case SE_Teleport:	// gates, rings, circles, etc
 			case SE_Teleport2:
 			{
@@ -422,6 +419,16 @@
 						}
 					}
 				}
+				if (effect == SE_YetAnotherGate && caster->IsClient())
+				{ //Shin: Teleport Bind uses caster's bind point
+					x = caster->CastToClient()->GetBindX();
+					y = caster->CastToClient()->GetBindY();
+					z = caster->CastToClient()->GetBindZ();
+					heading = caster->CastToClient()->GetBindHeading();
+					//target_zone = caster->CastToClient()->GetBindZoneId(); target_zone doesn't work due to const char
+					CastToClient()->MovePC(caster->CastToClient()->GetBindZoneId(), 0, x, y, z, heading);
+					break;
+				}
 
 #ifdef SPELL_EFFECT_SPAM
 				const char *efstr = "Teleport";
__________________

~Shin Noir
DungeonEQ.com
Reply With Quote
  #2  
Old 09-21-2009, 10:36 PM
Shin Noir's Avatar
Shin Noir
Legendary Member
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 502
Default

Also GetBindZoneId shouldn't be an inline const float, instead an int32. May want to fix it's spelling to GetBindZoneID, etc..
I don't really optimize code since I'm not sure what you guys are after yet anyways.
__________________

~Shin Noir
DungeonEQ.com
Reply With Quote
  #3  
Old 09-27-2009, 12:37 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

Added to revision 995.
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 03:17 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