diff options
author | click <none@none> | 2010-04-18 23:20:07 +0200 |
---|---|---|
committer | click <none@none> | 2010-04-18 23:20:07 +0200 |
commit | fdd8d2f3cc7108043f6bad036b994770f904866f (patch) | |
tree | 7aa8682b7b19a688120158bf4e2bf3232c2e9aa3 /src/game/Player.cpp | |
parent | f928c04734041f1078af72fe7abf8b2c2022d6a4 (diff) |
Move around and do some changes to homebinding, thanks to Vladimir
* Adds support for spelltarget-positions
* Uses areaname instead of zonename on hearthstone
Add homebind animation to player, with cast from innkeeper
--HG--
branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r-- | src/game/Player.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 60b7252baa8..bb7e0f8157f 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -15484,6 +15484,19 @@ bool Player::LoadPositionFromDB(uint32& mapid, float& x,float& y,float& z,float& return true; } +void Player::SetHomebind(WorldLocation const& loc, uint32 area_id) +{ + m_homebindMapId = GetMapId(); + m_homebindAreaId = GetAreaId(); + m_homebindX = GetPositionX(); + m_homebindY = GetPositionY(); + m_homebindZ = GetPositionZ(); + + // update sql homebind + CharacterDatabase.PExecute("UPDATE character_homebind SET map = '%u', zone = '%u', position_x = '%f', position_y = '%f', position_z = '%f' WHERE guid = '%u'", + m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ, GetGUIDLow()); +} + uint32 Player::GetUInt32ValueFromArray(Tokens const& data, uint16 index) { if (index >= data.size()) @@ -17236,7 +17249,7 @@ bool Player::_LoadHomeBind(QueryResult_AutoPtr result) { Field *fields = result->Fetch(); m_homebindMapId = fields[0].GetUInt32(); - m_homebindZoneId = fields[1].GetUInt16(); + m_homebindAreaId = fields[1].GetUInt16(); m_homebindX = fields[2].GetFloat(); m_homebindY = fields[3].GetFloat(); m_homebindZ = fields[4].GetFloat(); @@ -17254,16 +17267,17 @@ bool Player::_LoadHomeBind(QueryResult_AutoPtr result) if (!ok) { m_homebindMapId = info->mapId; - m_homebindZoneId = info->zoneId; + m_homebindAreaId = info->areaId; m_homebindX = info->positionX; m_homebindY = info->positionY; m_homebindZ = info->positionZ; - CharacterDatabase.PExecute("INSERT INTO character_homebind (guid,map,zone,position_x,position_y,position_z) VALUES ('%u', '%u', '%u', '%f', '%f', '%f')", GetGUIDLow(), m_homebindMapId, (uint32)m_homebindZoneId, m_homebindX, m_homebindY, m_homebindZ); + CharacterDatabase.PExecute("INSERT INTO character_homebind (guid,map,zone,position_x,position_y,position_z) VALUES ('%u', '%u', '%u', '%f', '%f', '%f')", + GetGUIDLow(), m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ); } - DEBUG_LOG("Setting player home position: mapid is: %u, zoneid is %u, X is %f, Y is %f, Z is %f", - m_homebindMapId, m_homebindZoneId, m_homebindX, m_homebindY, m_homebindZ); + DEBUG_LOG("Setting player home position - mapid: %u, areaid: %u, X: %f, Y: %f, Z: %f", + m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ); return true; } @@ -20515,7 +20529,7 @@ void Player::SendInitialPacketsBeforeAddToMap() WorldPacket data(SMSG_BINDPOINTUPDATE, 5*4); data << m_homebindX << m_homebindY << m_homebindZ; data << (uint32) m_homebindMapId; - data << (uint32) m_homebindZoneId; + data << (uint32) m_homebindAreaId; GetSession()->SendPacket(&data); // SMSG_SET_PROFICIENCY |