Asbert75
Enthusiast
So I'm trying to create a bossfight in which there will spawn flames under random players that deals x amount of damage every second the player stand in the flame. So what I've done is I've created a gameobject with the same type as the Campfire flames (6 - Trap) and added my spell to it. The gameobject works perfectly and does damage whenever someone comes into the radius.
The problem I'm having currently is the despawning of the object once the fight is over. It doesn't seem to be working. I have
and then
But it does not seem to be working, only the spawned creatures are despawning, not the gameobjects.
And while I'm making a thread, I might as well ask if anyone has any idea how to select random players that are in combat with the boss and cast this spell on, say, 5 of them at once without having it cast the spell twice on any player, which is what my code is currently doing (sometimes it will cast all 5 fires on one player or 2 on 1 and 3 on another and so on).
What I currently have is:
As you can see there's no check to see if the spell has already been cast on the target, because I have no clue how to do that
Full code for anyone interested:
http://pastebin.com/1B1syb6i
The problem I'm having currently is the despawning of the object once the fight is over. It doesn't seem to be working. I have
Code:
private:
SummonList summons;
Code:
void Reset();
summons.DespawnAll();
But it does not seem to be working, only the spawned creatures are despawning, not the gameobjects.
And while I'm making a thread, I might as well ask if anyone has any idea how to select random players that are in combat with the boss and cast this spell on, say, 5 of them at once without having it cast the spell twice on any player, which is what my code is currently doing (sometimes it will cast all 5 fires on one player or 2 on 1 and 3 on another and so on).
What I currently have is:
Code:
for (uint64 i = 0; i < 5; i = i+1)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
me->SummonGameObject(100050, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0);
}
As you can see there's no check to see if the spell has already been cast on the target, because I have no clue how to do that
Full code for anyone interested:
http://pastebin.com/1B1syb6i
Last edited: