Hello! I am having a problem with a boss script that I am working on. The problem is that I want my boss to cast a random spell on my target and then cast another spell later at the same target. This is how I was thinking of doing it:
Code:
f (Chain_Visual_One_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
DoCast(pTarget, VISUAL_MEDIUM_THUNDER);
DoCast(pTarget, SPELL_CHAINLIGHTNING);
}
Chain_Visual_One_Timer = 30000;
}
else
Chain_Visual_One_Timer -= diff;
The only thing I haven't been able to figure out is how to add an interval between these two spells. But the solution to this problem would be just to add some kind of timer within the function. Rather like, the real question is: How do I make my boss remember a pTarget once it has been picked? I've been looking at a Mandokir (Zul'Gurub boss) script that have similar idea to mine where he first cast Gaze at a random target then he later uses another spell on the target:
Code:
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
DoScriptText(SAY_GAZE, me, pTarget);
DoCast(pTarget, SPELL_GAZE);
me->MonsterWhisper(SAY_GAZE_WHISPER, pTarget->GetGUID());
GazeTarget = pTarget->GetGUID();
someGazed = true;
endGaze = true;
}
So I tried to copy this in several ways but I haven't gotten it to work. First of if we look at
Code:
GazeTarget = pTarget->GetGUID();
First off, what is GetGUID? Is this some unique ID of the target it choose? I understand that Gazetarget is defined to be the pTarget and that it can be used later by an "if" function. Probably by putting that function within a timed function.
So how should I do it so that my boss cast first one visual at the random, and then after some time a second visual at the same target and then a spell after some seconds at the same target? Any ideas or solution really appreciated. Thanks!