Exemplo n.º 1
0
void PhaseMgr::RegisterPhasingAuraEffect(AuraEffect const* auraEffect)
{
    PhaseInfo phaseInfo;

    if (auraEffect->GetMiscValue())
    {
        _UpdateFlags |= PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED;
        phaseInfo.phasemask = auraEffect->GetMiscValue();
    }
    else
    {
        SpellPhaseStore::const_iterator itr = _SpellPhaseStore->find(auraEffect->GetId());
        if (itr != _SpellPhaseStore->end())
        {
            if (itr->second.phasemask)
            {
                _UpdateFlags |= PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED;
                phaseInfo.phasemask = itr->second.phasemask;
            }

            if (itr->second.terrainswapmap)
                phaseInfo.terrainswapmap = itr->second.terrainswapmap;
        }
    }

    phaseInfo.phaseId = auraEffect->GetMiscValueB();

    if (phaseInfo.NeedsClientSideUpdate())
        _UpdateFlags |= PHASE_UPDATE_FLAG_CLIENTSIDE_CHANGED;

    phaseData.AddAuraInfo(auraEffect->GetId(), phaseInfo);

    Update();
}
Exemplo n.º 2
0
void PhaseMgr::RegisterPhasingAuraEffect(Aura const* auraEffect)
{
    PhaseInfo* phaseInfo = new PhaseInfo();

    if (auraEffect->GetMiscValue())
    {
        _UpdateFlags |= PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED;
        phaseInfo->phasemask = auraEffect->GetMiscValue();
    }
    else
    {
        SpellPhaseStore::const_iterator itr = _SpellPhaseStore->find(auraEffect->GetHolder()->GetId());
        if (itr != _SpellPhaseStore->end())
        {
            if (itr->second->phasemask)
            {
                _UpdateFlags |= PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED;
                phaseInfo->phasemask = itr->second->phasemask;
            }

            if (itr->second->terrainswapmap)
                phaseInfo->terrainswapmap = itr->second->terrainswapmap;
        }
    }

    // this is not Phase.dbc id...
    // phaseInfo->phaseId = auraEffect->GetMiscBValue();

    if (phaseInfo->NeedsClientSideUpdate())
        _UpdateFlags |= PHASE_UPDATE_FLAG_CLIENTSIDE_CHANGED;

    phaseData->AddAuraInfo(auraEffect->GetHolder()->GetId(), phaseInfo);

    Update();
}