Jump to content
Daxter

How to add respawn in timed spawns (like CA)?

Recommended Posts

Hi,

 

I'm working on a map with a timed spawn cycle, like in CA:

 

function map_copy_run_special_garner2( map_copy ) 
	local HowManyNoDead = GetMapActivePlayer(map_copy)
	Notice("Chaos Argent still have survivor: "..HowManyNoDead.." player(s)")
	Every_5_minute = Every_5_minute+1
	if Every_5_minute == 2 then -- 初级宝箱
		local Monster2 = CreateChaEx(859, 6352, 3558, 145, 60,map_copy)
		local Monster3 = CreateChaEx(859, 6761, 13062, 145, 60,map_copy)
(...)
		SetChaLifeTime(Monster2,299050)
		SetChaLifeTime(Monster3,299100)
(...)

	end

However, and different from CA, I want to have waves where the mobs respawn until the next wave is summoned (at which time the mobs from the previous wave would disappear and stop respawning).

Any suggestions?

Share this post


Link to post
Share on other sites

i think u can use the same function, just changing the mobs respawn, in CA respawn every 60 seconds, if u want to kill x mob and didnt respawn, 
something like:
function map_copy_run_special_MapName( map_copy )

Every_5_minute = Every_5_minute+1

if Every_5_minute == 2 then -- Time for spawn mobs when maze open (in this case when have past 2 mins)

local Monster2 = CreateChaEx(MobID, XX00, YY00, 180, RespawnTime,map_copy)

SetChaLifeTime(Monster2,299050)

if Every_5_minute == 3 then

local Monster3 = CreateChaEx(MobID, XX00, YY00, 180, RespawnTime,map_copy)

SetChaLifeTime(Monster3,299050)

if Every_5_minute == 4 then

local Monster4 = CreateChaEx(MobID, XX00, YY00, 180, RespawnTime,map_copy)

SetChaLifeTime(Monster4,299050)

end
this funcion make the previous wave disappear and stop respawning, or idk what u want to do, just have to change the map name and adding to the file ctrl.lua of that map

  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...