Accessing Areatrigger from code

Hello, I’d like to ask if it is possible to access areatigger from code and (de)activate it, I am working on areatrigger tha should be activated after a boss dies. I tried this

ObjectAccessor::GetAreaTrigger(*me, (uint64)5873)->setActive(true(false));

But it makes the server crash on dungeons loading. So is using ObjectAccessor the best practice and is this possible? Thanks for help.

setActive does not do what you want, it’s related to the grid system AFAIK. Not sure what you want to do, areatriggers do not “(de) activate” on their own, I’d suggest taking a look at some AreaTriggerScript

Ok, I’d like my areatrigger to be able to trigger only when I tell him to from my instance/boss script. I will take a look at some code.