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

* Support correct aura state at server set for different casters effects
* Correctly check this telent (per caster) aura state at cast
* Correctly show per-caster aura state for cleitns.
This commit is contained in:
VladimirMangos 2009-07-20 11:43:33 +04:00
parent d2dadbcb99
commit 36605805b4
7 changed files with 72 additions and 29 deletions

View file

@ -579,6 +579,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())
@ -589,6 +590,14 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
updateMask->SetBit(GAMEOBJECT_DYNAMIC);
}
}
else if (isType(TYPEMASK_UNIT))
{
if( ((Unit*)this)->HasAuraState(AURA_STATE_CONFLAGRATE))
{
IsPerCasterAuraState = true;
updateMask->SetBit(UNIT_FIELD_AURASTATE);
}
}
}
else // case UPDATETYPE_VALUES
{
@ -601,6 +610,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);
@ -625,6 +642,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)->HasAuraStateForCaster(AURA_STATE_CONFLAGRATE,target->GetGUID()))
*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)
{