[Probleme] Summoned creature and waypoint

Hi,
I post here because I have a problem waypoint on npc invoked.

I create an NPC (C++) that every 30 seconds invokes npc with the faction of the alliance and the horde has two different parts of the map (which is a bg).

I create a waypoint. through the table waypoint_data and creature_template_addon. The NPC begin their movement correctly upon invocation, but when they intersect, they do not attack and continue their path waypoint. Once complete their path, they are the attacks.

Why did not they attack you when they intersect?

Here are some parts of my code to help you:

[CODE]case 1:

                    //pop ally

                    me->SummonCreature(NPC_CREEP_CAC_R1_A_TOP, 15087.642578f, 15844.998047f, -0.098039f, 5.562010, TEMPSUMMON_CORPSE_DESPAWN, 0);

                    me->SummonCreature(NPC_CREEP_CAC_R1_A_MID, 15087.642578f, 15844.998047f, -0.098039f, 5.562010, TEMPSUMMON_CORPSE_DESPAWN, 0);

                    me->SummonCreature(NPC_CREEP_CAC_R1_A_BOT, 15087.642578f, 15844.998047f, -0.098039f, 5.562010, TEMPSUMMON_CORPSE_DESPAWN, 0);

                    //pop h2

                    me->SummonCreature(NPC_CREEP_CAC_R1_H_TOP, 15450.724609f, 15486.349609f, -0.098252f, 2.347363, TEMPSUMMON_CORPSE_DESPAWN, 0);

                    me->SummonCreature(NPC_CREEP_CAC_R1_H_MID, 15450.724609f, 15486.349609f, -0.098252f, 2.347363, TEMPSUMMON_CORPSE_DESPAWN, 0);

                    me->SummonCreature(NPC_CREEP_CAC_R1_H_BOT, 15450.724609f, 15486.349609f, -0.098252f, 2.347363, TEMPSUMMON_CORPSE_DESPAWN, 0);

                    break;[/CODE]

[CODE]void JustSummoned(Creature* summon)

    {

        if (!summon)

        {

        

        }

        else

        {

            summon->setActive(true);

        }

    }[/CODE]

I’ve done lots of different tests to try to find the problem but without success…

I need your help, I do not know where to look.

Thank you for reading, and sorry for my bad English.

My core:

TrinityCore rev. 2012-11-14 00:21:37 +0100 (29e20d4c4156+) (Unix, Release) (worldserver-daemon)

Using World DB: TDB 335.49

you sure that factions in db are correct? probably you have to add function like attack if in line of sight or something like this

void JustSummoned(Creature* summon)
        {
            if (!summon)
            {
            
            }
            else
            {
                summon->setActive(true);
                target = SelectNearbyTarget(victim);
            }
        }

thank you for your help I will try.

But the NPC does not intersect directly, but after 30 seconds of walking.

I think the problem is that they are invocations, because when I spawn the NPC myself with “.Npc add” the attacks they correctly.

Finally, I will try as you say, I hope it will work.