View Single Post
  #1  
Old 09-21-2009, 10:19 PM
Shin Noir's Avatar
Shin Noir
Legendary Member
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 506
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