[10052] Camera System

(based on SilverIce's repo commit 4f2f4ab + next 3 more)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
SilverIce 2010-06-12 05:00:09 +04:00 committed by VladimirMangos
parent f520c9b1e0
commit e427ce80cc
27 changed files with 515 additions and 207 deletions

View file

@ -2380,7 +2380,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
(GetSpellProto()->EffectApplyAuraName[EFFECT_INDEX_0] == 1 || GetSpellProto()->EffectApplyAuraName[EFFECT_INDEX_0] == 128)))
{
// spells with SpellEffect=72 and aura=4: 6196, 6197, 21171, 21425
((Player*)target)->SetFarSightGUID(0);
((Player*)target)->GetCamera().ResetView();
WorldPacket data(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, 0);
((Player*)target)->GetSession()->SendPacket(&data);
return;
@ -3543,7 +3543,11 @@ void Aura::HandleBindSight(bool apply, bool /*Real*/)
if(!caster || caster->GetTypeId() != TYPEID_PLAYER)
return;
((Player*)caster)->SetFarSightGUID(apply ? GetTarget()->GetGUID() : 0);
Camera& camera = ((Player*)caster)->GetCamera();
if (apply)
camera.SetView(m_target);
else
camera.ResetView();
}
void Aura::HandleFarSight(bool apply, bool /*Real*/)
@ -3552,7 +3556,11 @@ void Aura::HandleFarSight(bool apply, bool /*Real*/)
if(!caster || caster->GetTypeId() != TYPEID_PLAYER)
return;
((Player*)caster)->SetFarSightGUID(apply ? GetTarget()->GetGUID() : 0);
Camera& camera = ((Player*)caster)->GetCamera();
if (apply)
camera.SetView(GetTarget());
else
camera.ResetView();
}
void Aura::HandleAuraTrackCreatures(bool apply, bool /*Real*/)
@ -3607,7 +3615,7 @@ void Aura::HandleModPossess(bool apply, bool Real)
return;
Player* p_caster = (Player*)caster;
Camera& camera = p_caster->GetCamera();
if( apply )
{
@ -3618,7 +3626,7 @@ void Aura::HandleModPossess(bool apply, bool Real)
p_caster->SetCharm(target);
p_caster->SetFarSightGUID(target->GetGUID());
camera.SetView(target);
p_caster->SetClientControl(target, 1);
p_caster->SetMover(target);
@ -3646,7 +3654,7 @@ void Aura::HandleModPossess(bool apply, bool Real)
p_caster->InterruptSpell(CURRENT_CHANNELED_SPELL); // the spell is not automatically canceled when interrupted, do it now
p_caster->SetCharm(NULL);
p_caster->SetFarSightGUID(0);
camera.ResetView();
p_caster->SetClientControl(target, 0);
p_caster->SetMover(NULL);
@ -3695,13 +3703,19 @@ void Aura::HandleModPossessPet(bool apply, bool Real)
return;
Player* p_caster = (Player*)caster;
Camera& camera = p_caster->GetCamera();
if(apply)
{
pet->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
camera.SetView(pet);
}
else
{
pet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
camera.ResetView();
}
p_caster->SetFarSightGUID(apply ? pet->GetGUID() : 0);
p_caster->SetCharm(apply ? pet : NULL);
p_caster->SetClientControl(pet, apply ? 1 : 0);
((Player*)caster)->SetMover(apply ? pet : NULL);
@ -4182,7 +4196,7 @@ void Aura::HandleInvisibilityDetect(bool apply, bool Real)
target->m_detectInvisibilityMask |= (1 << m_modifier.m_miscvalue);
}
if(Real && target->GetTypeId()==TYPEID_PLAYER)
((Player*)target)->UpdateVisibilityForPlayer();
((Player*)target)->GetCamera().UpdateVisibilityForOwner();
}
void Aura::HandleAuraModRoot(bool apply, bool Real)