[DiscordArchive] How do I get an NPC within a certain range to cast a spell on themselves? It's simple in SAI, but I'
[DiscordArchive] How do I get an NPC within a certain range to cast a spell on themselves? It's simple in SAI, but I'
Archived author: Crane • Posted: 2025-08-18T12:20:46.271000+00:00
Original source
How do I get an NPC within a certain range to cast a spell on themselves? It's simple in SAI, but I've never done it in C++.
```c++
for (Creature* follower : followers)
{
if (follower && follower->IsAlive())
{
me->CastSpell(follower, 51347, false);
}
}```
Anyone have any ideas?
Archived author: Riztazz • Posted: 2025-08-18T12:35:29.362000+00:00
Original source
timer + GetCreatureList in grid or whatever the function was called
Archived author: Riztazz • Posted: 2025-08-18T12:36:18.326000+00:00
Original source
in ur case u have like 1 mob type ;p maybe u can cache their guids on event start