I didn't feel like trying to figure out why the conversion of ObjectGuid to a UINT32 and then back to an ObjectGuid doesn't work, so instead I just modified this line:
ai->ReceiveAIEvent(AI_EVENT_CUSTOM_C, (Creature *)pGo, pPlayer, pGo->GetGUIDLow());
And this case statement:
case AI_EVENT_CUSTOM_C: // notify me; @TODO inplement normal ObjectGuid transfer between scripts
{
if(GameObject *pGo = (GameObject*)sender)
NotifyMe(invoker, pGo);
/*ObjectGuid guid = ObjectGuid(HIGHGUID_GAMEOBJECT, 0, data);
if (GameObject *pGo = this->m_creature->GetMap()->GetGameObject(guid))
NotifyMe(invoker, pGo);*/
break;
}
Now it works.