PDA

View Full Version : Wizard AA: Teleport Bind


Shin Noir
09-21-2009, 10:19 PM
First, this AA is pretty straight forward. From casters realm (link (http://applets.crgaming.com/everquest/abilities/aa_description.php?class=12&era=7&id=414))

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

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
09-21-2009, 10:36 PM
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.

cavedude
09-27-2009, 12:37 PM
Added to revision 995.