How to transfer aggro and threat to NPC in BossAI?


as this is learning project, I am trying to do one little boss script as a fun for fool day which is comming …

I am experiencing problems in my code and that is the part of the “combatstop();” line for players. I need this for players to loose aggro, threat and stop combat for a while with boss but not for boss to reset in his script… I tried to spawn some NPC trigger invisible for players and move there aggro like this:

me->SummonCreature(23472, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 30000);
if(Creature* trigger = me->FindNearestCreature(23472, 100.0f))
me->AddThreat(trigger, 100000000.0f);
But it does not work and when script comes to “player->combatstop();” line - he resets anyway. So I am asking is there any way to completely move aggro to some NPC for a while in script in BossAI scripting? I tried to modify “void UpdateAI(uint32 diff)” and its function “if (!UpdateVictim()) return;” but not worked anyway, so any thoughts about this? This is just “script for fun” and I hope that this is possible to do somwhow so I am aking you - more experience developers for scripts advice. Thank you.

This should have been in the custom code forum.