Code:
chestnum = 0
spawnduriation =
gameobject id =
function chestevent_spawn(pUnit, event)
chestnum = chestnum + 1
if chestnum == 0 then
pUnit:SpawnGameObject(gameobjectid, x, y, z, o, spawnduriation)
pUnit:RegisterEvent("chestevent_spawn", spawnduriation)
end
if chestnum == 1 then
pUnit:SpawnGameObject(gameobjectid, x, y, z, o, spawnduriation)
pUnit:RegisterEvent("chestevent_spawn", spawnduriation)
end
if chestnum == 2 then
pUnit:SpawnGameObject(gameobjectid, x, y, z, o, spawnduriation)
pUnit:RegisterEvent("chestevent_spawn", spawnduriation)
end
if chestnum == 3 then
pUnit:SpawnGameObject(gameobjectid, x, y, z, o, spawnduriation)
pUnit:RegisterEvent("chestevent_spawn", spawnduriation)
chestnum = 0
end
end
RegisterUnitEvent(mobid, 6, "chestevent_spawn")
You would just have to edit the top where it says
"spawnduriation" (its in ms so 1000 = 1 sec)
"gameobjectid" (the id of your game object)
X (FOR EACH OF THE IF STATMENTS!!)
Y (FOR EACH OF THE IF STATMENTS!!)
Z (FOR EACH OF THE IF STATMENTS!!)
O (FOR EACH OF THE IF STATMENTS!!)
**and you would need to change the RegisterUnitEvent()
inside that event you need to change mobid to the id of the dummy mob that will trigger this event on spawn
Just make the xyzo different for each gameobject spawn....
but there are a few things you must remember
Code:
At the end of the script make sure you put an extra END!
At the end of your last spawn you MUST PUT "STAGE =0" or it WILL NOT repeat the script.
if chestnum == 3 then
pUnit:SpawnGameObject(gameobjectid, x, y, z, o, spawnduriation)
pUnit:RegisterEvent("chestevent_spawn", spawnduriation)
chestnum = 0
end
end
So in summary you could keep calling
Code:
if chestnum == # then
pUnit:SpawnGameObject(gameobjectid, x, y, z, o, spawnduriation)
pUnit:RegisterEvent("chestevent_spawn", spawnduriation)
end
Just change the # to a number, but it has to be consectutive... like...
if your going to put the number 50 in there, the if statment before it has to be 49