[8218] Final part of talent 17962 and ranks fixes. Author: VladimirMangos

* Correctly show per-caster aura state for cleitns.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-07-30 10:15:45 +08:00
parent 29e9bc64d1
commit 9bd41d0255
3 changed files with 73 additions and 13 deletions

View File

@@ -465,6 +465,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
return;
bool IsActivateToQuest = false;
bool IsPerCasterAuraState = false;
if (updatetype == UPDATETYPE_CREATE_OBJECT || updatetype == UPDATETYPE_CREATE_OBJECT2)
{
if (isType(TYPEMASK_GAMEOBJECT) && !((GameObject*)this)->IsTransport())
@@ -477,6 +478,14 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
if (((GameObject*)this)->GetGoArtKit())
updateMask->SetBit(GAMEOBJECT_BYTES_1);
}
else if (isType(TYPEMASK_UNIT))
{
if( ((Unit*)this)->HasAuraState(AURA_STATE_CONFLAGRATE))
{
IsPerCasterAuraState = true;
updateMask->SetBit(UNIT_FIELD_AURASTATE);
}
}
}
else // case UPDATETYPE_VALUES
{
@@ -489,6 +498,14 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
updateMask->SetBit(GAMEOBJECT_DYNAMIC);
updateMask->SetBit(GAMEOBJECT_BYTES_1);
}
else if (isType(TYPEMASK_UNIT))
{
if( ((Unit*)this)->HasAuraState(AURA_STATE_CONFLAGRATE))
{
IsPerCasterAuraState = true;
updateMask->SetBit(UNIT_FIELD_AURASTATE);
}
}
}
WPAssert(updateMask && updateMask->GetCount() == m_valuesCount);
@@ -513,6 +530,19 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
*data << uint32(appendValue);
}
else if (index == UNIT_FIELD_AURASTATE)
{
if(IsPerCasterAuraState)
{
// IsPerCasterAuraState set if related pet caster aura state set already
if (((Unit*)this)->HasAuraState(AURA_STATE_CONFLAGRATE, NULL, target))
*data << m_uint32Values[ index ];
else
*data << (m_uint32Values[ index ] & ~(1 << (AURA_STATE_CONFLAGRATE-1)));
}
else
*data << m_uint32Values[ index ];
}
// FIXME: Some values at server stored in float format but must be sent to client in uint32 format
else if(index >= UNIT_FIELD_BASEATTACKTIME && index <= UNIT_FIELD_RANGEDATTACKTIME)
{