

-------------------------------------------------------------------------
-- Example 1

function Mob_Test()
	sg_mobA_all 	= SGroup_CreateIfNotFound("sg_mobA_all")
	sg_mobA_lead 	= SGroup_CreateIfNotFound("sg_mobA_lead")
	sg_mobA 		= SGroup_CreateTable("sg_mobA%d", 5)
	
	Rule_AddInterval(Mob_Trigger, 120)
end

function Mob_Trigger()
	
	local sgroup = { all = sg_mobA_all, lead = sg_mobA_lead, mob = sg_mobA}
	
	local mType = mobType.V 
	
	local source = {stype = stype.OFFMAP, spawn = mkr_axis_offmap6, rally = mkr_mob1_rally}
	
	local destination = {pace = pace.FAST, count = 0, move = true, way = {mkr_mob1_way1, mkr_mob1_way2, mkr_mob1_way3, mkr_mob1_way4}, capture = nil}

	MobRule_AddMob(player2, sgroup, mType, source, destination)
end



-------------------------------------------------------------------------
-- Example 2
		local sgroup = { all = sg_HQmob_all, lead = sg_HQmob_lead, mob = sg_HQmob}
		
		-- pick a random mob
		local mobs = {mobType.V, mobType.M, mobType.HMG, mobType.V}
		local mType = mobs[World_GetRand(1,4)]
		
		-- pick a random waypoint path
		local paths = {
			{mkr_HQmob_1, mkr_HQmob_2},
			{mkr_HQmob_3, mkr_HQmob_4},
			{mkr_HQmob_5, mkr_HQmob_6},}
		local path = paths[World_GetRand(1,3)]
		
		local destination = {pace = pace.FAST, count = 0, move = true, way = path, capture = nil}
		local source = {stype = stype.BUILD, spawn = eg_axishq_all, rally = mkr_axishq_homel}
		
		-- add mob
		MobRule_AddMob(player2, sgroup, mType, source, destination)