Ok, Heres where I am at now... in the player.cpp file there is this section...(was gonna post the whole thing but thats not gonna work...lol)
Code:
void Player::RepopAtGraveyard()
{
// note: this can be called also when the player is alive
// for example from WorldSession::HandleMovementOpcodes
AreaTableEntry const *zone = GetAreaEntryByAreaID(GetAreaId());
// Such zones are considered unreachable as a ghost and the player must be automatically revived
if ((!isAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY) || GetTransport() || GetPositionZ() < -500.0f)
{
ResurrectPlayer(0.5f);
SpawnCorpseBones();
}
WorldSafeLocsEntry const *ClosestGrave = NULL;
// Special handle for battleground maps
if (Battleground *bg = GetBattleground())
ClosestGrave = bg->GetClosestGraveYard(this);
else
ClosestGrave = sObjectMgr->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam());
// stop countdown until repop
m_deathTimer = 0;
// if no grave found, stay at the current location
// and don't show spirit healer location
if (ClosestGrave)
{
TeleportTo(ClosestGrave->map_id, ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, GetOrientation());
if (isDead()) // not send if alive, because it used in TeleportTo()
{
WorldPacket data(SMSG_DEATH_RELEASE_LOC, 4*4); // show spirit healer position on minimap
data << ClosestGrave->map_id;
data << ClosestGrave->x;
data << ClosestGrave->y;
data << ClosestGrave->z;
GetSession()->SendPacket(&data);
}
}
else if (GetPositionZ() < -500.0f)
TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, GetOrientation());
}
Now if I add this line to that section of code
Code:
// 4boltmain Hyjal Grave added line
if (GetZoneId() == 616) TeleportTo(1, 4981.97f, -2857.31f, 1452.67f, 5.36318f);
// 4boltmain Hyjal Grave added line
I am ported to the grave position when I click the release button but when I die my corpse is up in the air off the ground.
I cant figure out why my corpse is up in the air when I die. Ive tried changing both GetPositionZ() < -500.0f to simply 0.5f but that has no effect...but anyway, I know shouldnt even be editing this file at all I was experimenting for testing purposes.
How would I make a custom script to reference this section to have the player ported to the graveyard coordinates?