Respawn creature - On death
TrueWarlord
Member Posts: 2
Hey guys, any way to respawn a creature on death? I know it is easily done by encounters, but I would like to make a Boss respawn after someone killed him. The problem is, this boss already has a script on his death, a "local var change" used to complete the quest.
Someone mentioned that it is possible to do on the "OnHeartbeat" of the area, can someone add more depth on how to do this?
Thanks o/
Someone mentioned that it is possible to do on the "OnHeartbeat" of the area, can someone add more depth on how to do this?
Thanks o/
0
Comments
Might also be possible add a check to see if a PC Is In the area or not after the time check, so It doesn't spawn the boss, unless a PC Is In the area to help with lag.
Can someone help me? I want it to wait like 30 seconds before it respawns on my Waypoint.
Here is my code:
----
void main()
{
object oPC = GetLastKiller();
if (!GetIsPC(oPC)) return;
int nInt;
nInt = GetLocalInt(oPC, "quest1");
nInt += 1;
SetLocalInt(oPC, "quest1", nInt);
object oTarget;
object oSpawn;
location lTarget;
oTarget = GetWaypointByTag("respawnteste");
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "bosstest", lTarget);
}
----
// Spawns the boss at our waypoint void SpawnBoss() { object oTarget = GetWaypointByTag("respawnteste"); location lTarget = GetLocation(oTarget); CreateObject(OBJECT_TYPE_CREATURE, "bosstest", lTarget); } void main() { object oPC = GetLastKiller(); if (!GetIsPC(oPC)) return; int nInt = GetLocalInt(oPC, "quest1"); SetLocalInt(oPC, "quest1", nInt + 1); AssignCommand(GetModule(), DelayCommand(30.0, SpawnBoss())); }
OnDeath:. Create a spawner object at death location
Spawner: creates the new creature and deletes itself