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
This commit is contained in:
+20
-6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user