As far as spawning the creature at a random location when the module loads...why not just place the monster in the toolset(it's going to be there on load anyway) maybe in an inaccessible part of your mod, and then when it (the monster) loads/spawns you just jump him to one of your locations. You would give the monster an OnSpawn script with something like so:
//OnSpawn
void main()
{
int iInt = Random(7) + 1;
object oWP = GetWaypointByTag("wp_boss" + IntToString(iInt);
ActionJumpToObject(oWP);
}
This assumes that your waypoints are numbered 1to 7 (no 0) and no space between "boss" and the number.
And then when you create/spawn him from the delay in the death script, you don't need to jump him to a location, as it will do it again with it's OnSpawn script.
Good luck.
P.S. Could use something like so for the OnDeath:
//OnDeath
void RespawnMe(string sResRef, location lLocation, string sNewTag)
{
CreateObject(OBJECT_TYPE_CREATURE, sResRef, lLocation, FALSE, sNewTag);
}
void main()
{
float fSeconds = 10.0;//Set respawn time in seconds
string sMyResRef = GetResRef(OBJECT_SELF);
location lMyLocation = GetLocation(OBJECT_SELF);
string sMyTag = GetTag(OBJECT_SELF);
AssignCommand(GetArea(OBJECT_SELF), DelayCommand(fSeconds , RespawnMe(sMyResRef, lMyLocation, sMyTag)));
}
Modifié par GhostOfGod, 21 octobre 2010 - 04:42 .