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/NPCHandler.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/NPCHandler.cpp')
-rw-r--r-- | src/game/NPCHandler.cpp | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/src/game/NPCHandler.cpp b/src/game/NPCHandler.cpp index f6380016af0..e2ce4652b5b 100644 --- a/src/game/NPCHandler.cpp +++ b/src/game/NPCHandler.cpp @@ -463,43 +463,22 @@ void WorldSession::SendBindPoint(Creature *npc) return; uint32 bindspell = 3286; - uint32 zone_id = _player->GetZoneId(); // 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'", _player->GetMapId(), zone_id, _player->GetPositionX(), _player->GetPositionY(), _player->GetPositionZ(), _player->GetGUIDLow()); + CharacterDatabase.PExecute("UPDATE character_homebind SET map = '%u', zone = '%u', position_x = '%f', position_y = '%f', position_z = '%f' WHERE guid = '%u'", + _player->GetMapId(), _player->GetAreaId(), _player->GetPositionX(), _player->GetPositionY(), _player->GetPositionZ(), _player->GetGUIDLow()); _player->m_homebindMapId = _player->GetMapId(); - _player->m_homebindZoneId = zone_id; + _player->m_homebindAreaId = _player->GetAreaId(); _player->m_homebindX = _player->GetPositionX(); _player->m_homebindY = _player->GetPositionY(); _player->m_homebindZ = _player->GetPositionZ(); - // send spell for bind 3286 bind magic - _player->CastSpell(_player, bindspell, true); + // send spell for homebinding (3286) + npc->CastSpell(_player, bindspell, true); WorldPacket data(SMSG_TRAINER_BUY_SUCCEEDED, (8+4)); - data << npc->GetGUID(); - data << bindspell; - SendPacket(&data); - - // binding - data.Initialize(SMSG_BINDPOINTUPDATE, (4+4+4+4+4)); - data << float(_player->GetPositionX()); - data << float(_player->GetPositionY()); - data << float(_player->GetPositionZ()); - data << uint32(_player->GetMapId()); - data << uint32(zone_id); - SendPacket(&data); - - DEBUG_LOG("New Home Position X is %f",_player->GetPositionX()); - DEBUG_LOG("New Home Position Y is %f",_player->GetPositionY()); - DEBUG_LOG("New Home Position Z is %f",_player->GetPositionZ()); - DEBUG_LOG("New Home MapId is %u",_player->GetMapId()); - DEBUG_LOG("New Home ZoneId is %u",zone_id); - - // zone update - data.Initialize(SMSG_PLAYERBOUND, 8+4); - data << uint64(_player->GetGUID()); - data << uint32(zone_id); + data << uint64(npc->GetGUID()); + data << uint32(bindspell); SendPacket(&data); _player->PlayerTalkClass->CloseGossip(); |