[C + + help] move area to FFA mode

Hello, here now for many hours as I try to convertire these lines valid for MaNGOS. I’ve tested, this allows to put an area FFA mode via the config file. Here is the part of the script that I can not rewrite of MaNGOS to TrinityCore. I really hope you can help me.

In player.cpp after


if(pvpInfo.inHostileArea) // in hostile area

{

if(!IsPvP() || pvpInfo.endTimer != 0)

UpdatePvP(true, true);

}

else // in friendly area

{

if(IsPvP() && !HasFlag(PLAYER_FLAGS,PLAYER_FLAGS_IN_PVP) && pvpInfo.endTimer == 0)

pvpInfo.endTimer = time(0); // start toggle-off

}

I have script this


int FFaArea = sWorld->getConfig(CONFIG_UINT32_ZONE_FFA_AREA);

if(sWorld->getConfig(CONFIG_BOOL_ZONE_FFA_ACTIVE))

{

if (zone->flags & AREA_FLAG_SANCTUARY || newArea == FFaArea)

{

RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);

SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY);

SetFFAPvP(false);

CombatStopWithPets();

}

}

Can someone point me where is my mistake in my script?