Advertisement
blackmanos

Untitled

Oct 15th, 2014
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. @@ -6651,51 +6643,35 @@ void Spell::EffectBind(SpellEffIndex effIndex)
  2.  
  3. Player* player = unitTarget->ToPlayer();
  4.  
  5. - uint32 area_id;
  6. - WorldLocation loc;
  7. - if (m_spellInfo->Effects[effIndex].TargetA.GetTarget() == TARGET_DEST_DB || m_spellInfo->Effects[effIndex].TargetB.GetTarget() == TARGET_DEST_DB)
  8. - {
  9. - SpellTargetPosition const* st = sSpellMgr->GetSpellTargetPosition(m_spellInfo->Id);
  10. - if (!st)
  11. - {
  12. - sLog->outError("Spell::EffectBind - unknown teleport coordinates for spell ID %u", m_spellInfo->Id);
  13. - return;
  14. - }
  15. + WorldLocation homeLoc;
  16. + uint32 areaId = player->GetAreaId();
  17.  
  18. - loc.m_mapId = st->target_mapId;
  19. - loc.m_positionX = st->target_X;
  20. - loc.m_positionY = st->target_Y;
  21. - loc.m_positionZ = st->target_Z;
  22. - loc.m_orientation = st->target_Orientation;
  23. - area_id = player->GetAreaId();
  24. - }
  25. + if (m_spellInfo->Effects[effIndex].MiscValue)
  26. + areaId = m_spellInfo->Effects[effIndex].MiscValue;
  27. +
  28. + if (m_targets.HasDst())
  29. + homeLoc.WorldRelocate(*destTarget);
  30. else
  31. - {
  32. - player->GetPosition(&loc);
  33. - area_id = player->GetAreaId();
  34. - }
  35. + homeLoc = player->GetWorldLocation();
  36.  
  37. - player->SetHomebind(loc, area_id);
  38. + player->SetHomebind(homeLoc, areaId);
  39.  
  40. // binding
  41. - WorldPacket data(SMSG_BINDPOINTUPDATE, (4+4+4+4+4));
  42. - data << float(loc.m_positionX);
  43. - data << float(loc.m_positionY);
  44. - data << float(loc.m_positionZ);
  45. - data << uint32(loc.m_mapId);
  46. - data << uint32(area_id);
  47. + WorldPacket data(SMSG_BINDPOINTUPDATE, 4 + 4 + 4 + 4 + 4);
  48. + data << float(homeLoc.GetPositionX());
  49. + data << float(homeLoc.GetPositionY());
  50. + data << float(homeLoc.GetPositionZ());
  51. + data << uint32(homeLoc.GetMapId());
  52. + data << uint32(areaId);
  53. player->SendDirectMessage(&data);
  54.  
  55. - sLog->outStaticDebug("New homebind X : %f", loc.m_positionX);
  56. - sLog->outStaticDebug("New homebind Y : %f", loc.m_positionY);
  57. - sLog->outStaticDebug("New homebind Z : %f", loc.m_positionZ);
  58. - sLog->outStaticDebug("New homebind MapId : %u", loc.m_mapId);
  59. - sLog->outStaticDebug("New homebind AreaId : %u", area_id);
  60. + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "EffectBind: New homebind X: %f, Y: %f, Z: %f, MapId: %u, AreaId: %u",
  61. + homeLoc.GetPositionX(), homeLoc.GetPositionY(), homeLoc.GetPositionZ(), homeLoc.GetMapId(), areaId);
  62.  
  63. // zone update
  64. - data.Initialize(SMSG_PLAYERBOUND, 8+4);
  65. - data << uint64(player->GetGUID());
  66. - data << uint32(area_id);
  67. + data.Initialize(SMSG_PLAYERBOUND, 8 + 4);
  68. + data << uint64(m_caster->GetGUID());
  69. + data << uint32(areaId);
  70. player->SendDirectMessage(&data);
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement