Well, you can maybe try this to start with. There's lots of ways to do this, so maybe someone will come up with a more efficient method.
Anyway though, with the script below you'll need to use a trigger and waypoints as I don't know of a way you can select a random location within the boundary of a trigger. The trigger will need to have it's tag changed to Fireball, however I also set it up a couple other examples for having triggers with a different tag play the dispel or horrid wilting VFX. The trigger tag is THE key, and if you want more than just the three examples I setup, you can add them by just following the three examples I have. Put this script in the trigger's OnEnter event.
You will also need to place waypoints with Tags of WP_VFX where you want these random VFX to occur. You don't need to add a number to the end of the tag - just setup the first waypoint with that tag and then copy and paste the waypoint to all the places in the area where you want the VFX to potentially fire.
And that should be about it...
int GetVFX();
void RecurringVFXLoop();
void main()
{
if (!GetLocalInt(OBJECT_SELF, "TotalVFXWaypoints")) { //Only run this once if the trigger has not been setup with VFX waypoints
int i = 1;
int iTotalVFXWayPoints;
string sVFXWaypointTag = "WP_VFX"; //This is the tag of the waypoints where the VFX will occur. Change/update as needed
object oVFXWaypoint = GetNearestObject(OBJECT_TYPE_WAYPOINT, OBJECT_SELF, i);
while (oVFXWaypoint != OBJECT_INVALID) {
if (GetTag(oVFXWaypoint) == sVFXWaypointTag) { //Only bother with waypoints that have the sVFXWaypointTag tag
iTotalVFXWayPoints = iTotalVFXWayPoints+1;
SetLocalObject(OBJECT_SELF, "VFXWaypoint"+IntToString(iTotalVFXWayPoints), oVFXWaypoint); //Set each waypoint as an object on the trigger for random retrieval in the RecurringVFXLoop function
SetLocalInt(OBJECT_SELF, "TotalVFXWaypoints", iTotalVFXWayPoints); //Set the total number of random waypoints on the trigger
}
i = i+1;
oVFXWaypoint = GetNearestObject(OBJECT_TYPE_WAYPOINT, OBJECT_SELF, i);
}
DelayCommand(0.1, RecurringVFXLoop()); //While probably not necessary, delay this just a split second to make sure the waypoints are set on the trigger
}
}
int GetTriggerVFX()
{
string sTag = GetTag(OBJECT_SELF); //You will need to change the tag of the trigger to specify the name of the VFX you want to fire, then set that in the lines below
int iVFX;
if (sTag == "Fireball") iVFX = VFX_FNF_FIREBALL; //Play this VFX if the tag of the trigger is Fireball
else if (sTag == "Dispel") iVFX = VFX_FNF_DISPEL; //Play this VFX if the tag of the trigger is Dispel
else if (sTag == "Wilting") iVFX = VFX_FNF_HORRID_WILTING; //Play this VFX if the tag of the trigger is Wilting
//etc, etc, etc
return iVFX;
}
void RecurringVFXLoop()
{
int iTotalVFXWaypoints = GetLocalInt(OBJECT_SELF, "TotalVFXWaypoints");
if (!iTotalVFXWaypoints) {
PrintString("ERROR: No Random VFX Waypoints were set for a random VFX trigger");
SendMessageToPC(GetFirstPC(), "ERROR: No Random VFX Waypoints were set for a random VFX trigger");
return;
}
object oRandomVFXWaypoint = GetLocalObject(OBJECT_SELF, "VFXWaypoint"+IntToString(Random(iTotalVFXWaypoints)+1)); //Select a random waypoint to play the VFX at
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(GetTriggerVFX()), GetLocation(oRandomVFXWaypoint));
DelayCommand(2.0, RecurringVFXLoop()); //Fire every two seconds. This will fire indefinitely...
}