mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[10462] Implement spell 6495
Also implement proper work CMSG_FAR_SIGHT. This packet control switch view point from far sight object to caster and back wihtout modify far sight object seelction.
This commit is contained in:
parent
1341345216
commit
aa90aa8fdf
5 changed files with 51 additions and 22 deletions
|
|
@ -49,11 +49,10 @@ void Camera::UpdateForCurrentViewPoint()
|
||||||
if (GridType* grid = m_source->GetViewPoint().m_grid)
|
if (GridType* grid = m_source->GetViewPoint().m_grid)
|
||||||
grid->AddWorldObject(this);
|
grid->AddWorldObject(this);
|
||||||
|
|
||||||
m_owner.SetUInt64Value(PLAYER_FARSIGHT, (m_source == &m_owner ? 0 : m_source->GetGUID()));
|
|
||||||
UpdateVisibilityForOwner();
|
UpdateVisibilityForOwner();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Camera::SetView(WorldObject *obj)
|
void Camera::SetView(WorldObject *obj, bool update_far_sight_field /*= true*/)
|
||||||
{
|
{
|
||||||
MANGOS_ASSERT(obj);
|
MANGOS_ASSERT(obj);
|
||||||
|
|
||||||
|
|
@ -84,6 +83,9 @@ void Camera::SetView(WorldObject *obj)
|
||||||
|
|
||||||
m_source->GetViewPoint().Attach(this);
|
m_source->GetViewPoint().Attach(this);
|
||||||
|
|
||||||
|
if (update_far_sight_field)
|
||||||
|
m_owner.SetUInt64Value(PLAYER_FARSIGHT, (m_source == &m_owner ? 0 : m_source->GetGUID()));
|
||||||
|
|
||||||
UpdateForCurrentViewPoint();
|
UpdateForCurrentViewPoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -93,9 +95,9 @@ void Camera::Event_ViewPointVisibilityChanged()
|
||||||
ResetView();
|
ResetView();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Camera::ResetView()
|
void Camera::ResetView(bool update_far_sight_field /*= true*/)
|
||||||
{
|
{
|
||||||
SetView(&m_owner);
|
SetView(&m_owner, update_far_sight_field);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Camera::Event_AddedToWorld()
|
void Camera::Event_AddedToWorld()
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,10 @@ class MANGOS_DLL_SPEC Camera
|
||||||
// set camera's view to any worldobject
|
// set camera's view to any worldobject
|
||||||
// Note: this worldobject must be in same map, in same phase with camera's owner(player)
|
// Note: this worldobject must be in same map, in same phase with camera's owner(player)
|
||||||
// client supports only unit and dynamic objects as farsight objects
|
// client supports only unit and dynamic objects as farsight objects
|
||||||
void SetView(WorldObject *obj);
|
void SetView(WorldObject *obj, bool update_far_sight_field = true);
|
||||||
|
|
||||||
// set view to camera's owner
|
// set view to camera's owner
|
||||||
void ResetView();
|
void ResetView(bool update_far_sight_field = true);
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void UpdateVisibilityOf(T * obj, UpdateData &d, std::set<WorldObject*>& vis);
|
void UpdateVisibilityOf(T * obj, UpdateData &d, std::set<WorldObject*>& vis);
|
||||||
|
|
|
||||||
|
|
@ -1287,19 +1287,22 @@ void WorldSession::HandleFarSightOpcode( WorldPacket & recv_data )
|
||||||
DEBUG_LOG("WORLD: CMSG_FAR_SIGHT");
|
DEBUG_LOG("WORLD: CMSG_FAR_SIGHT");
|
||||||
//recv_data.hexlike();
|
//recv_data.hexlike();
|
||||||
|
|
||||||
uint8 unk;
|
uint8 op;
|
||||||
recv_data >> unk;
|
recv_data >> op;
|
||||||
|
|
||||||
switch(unk)
|
WorldObject* obj = _player->GetMap()->GetWorldObject(_player->GetFarSightGuid());
|
||||||
|
if (!obj)
|
||||||
|
return;
|
||||||
|
|
||||||
|
switch(op)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
//WorldPacket data(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, 0)
|
|
||||||
//SendPacket(&data);
|
|
||||||
//_player->SetUInt64Value(PLAYER_FARSIGHT, 0);
|
|
||||||
DEBUG_LOG("Removed FarSight from %s", _player->GetObjectGuid().GetString().c_str());
|
DEBUG_LOG("Removed FarSight from %s", _player->GetObjectGuid().GetString().c_str());
|
||||||
|
_player->GetCamera().ResetView(false);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
DEBUG_LOG("Added FarSight %s to %s", _player->GetFarSightGuid().GetString().c_str(), _player->GetObjectGuid().GetString().c_str());
|
DEBUG_LOG("Added FarSight %s to %s", _player->GetFarSightGuid().GetString().c_str(), _player->GetObjectGuid().GetString().c_str());
|
||||||
|
_player->GetCamera().SetView(obj, false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2089,19 +2089,24 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
|
||||||
}
|
}
|
||||||
case SPELLFAMILY_SHAMAN:
|
case SPELLFAMILY_SHAMAN:
|
||||||
{
|
{
|
||||||
// Tidal Force
|
switch(GetId())
|
||||||
if (GetId() == 55198)
|
|
||||||
{
|
{
|
||||||
// apply max stack bufs
|
case 55198: // Tidal Force
|
||||||
SpellEntry const* buffEntry = sSpellStore.LookupEntry(55166);
|
{
|
||||||
if (!buffEntry)
|
// apply max stack bufs
|
||||||
return;
|
SpellEntry const* buffEntry = sSpellStore.LookupEntry(55166);
|
||||||
|
if (!buffEntry)
|
||||||
|
return;
|
||||||
|
|
||||||
for(uint32 k = 0; k < buffEntry->StackAmount; ++k)
|
for(uint32 k = 0; k < buffEntry->StackAmount; ++k)
|
||||||
target->CastSpell(target, buffEntry, true, NULL, this);
|
target->CastSpell(target, buffEntry, true, NULL, this);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Earth Shield
|
// Earth Shield
|
||||||
else if ((GetSpellProto()->SpellFamilyFlags & UI64LIT(0x40000000000)))
|
if ((GetSpellProto()->SpellFamilyFlags & UI64LIT(0x40000000000)))
|
||||||
{
|
{
|
||||||
// prevent double apply bonuses
|
// prevent double apply bonuses
|
||||||
if (target->GetTypeId() != TYPEID_PLAYER || !((Player*)target)->GetSession()->PlayerLoading())
|
if (target->GetTypeId() != TYPEID_PLAYER || !((Player*)target)->GetSession()->PlayerLoading())
|
||||||
|
|
@ -2621,7 +2626,26 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SPELLFAMILY_SHAMAN:
|
case SPELLFAMILY_SHAMAN:
|
||||||
|
{
|
||||||
|
switch(GetId())
|
||||||
|
{
|
||||||
|
case 6495: // Sentry Totem
|
||||||
|
{
|
||||||
|
if (target->GetTypeId() != TYPEID_PLAYER)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Totem* totem = target->GetTotem(TOTEM_SLOT_AIR);
|
||||||
|
|
||||||
|
if (totem && apply)
|
||||||
|
((Player*)target)->GetCamera().SetView(totem);
|
||||||
|
else
|
||||||
|
((Player*)target)->GetCamera().ResetView(totem);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// pet auras
|
// pet auras
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10461"
|
#define REVISION_NR "10462"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue