function Initialise()  
    MyPositions = 0


	lib_SetupMultiplayer()
	SendMessage("WormManager.Reinitialise")


	StartFirstTurn()
    lock, scheme = EditContainer("GM.SchemeData")
    scheme.WeaponChance = 0
    scheme.UtilityChance = 0
    scheme.MysteryChance = 0
    scheme.HealthChance = 0
    CloseContainer(lock)

   local inv = QueryContainer("Inventory.Alliance00")
   mchance = inv.Landmine
   if mchance == 0 then
     mchance = math.random(1,10)
   end
   if mchance == -1 then
     mchance = math.random(1,10)
   end
   if mchance > 10 then
     mchance = math.random(1,10)
   end

	SendMessage("GameLogic.ClearInventories")
	Index = 0
	InventoryName = lib_GetAllianceInventoryName(Index)
	while InventoryName ~= "" do
	 local Lock,Container = EditContainer(InventoryName)
	 Container.Jetpack = 2
	 Container.Parachute = -1
	 Container.PoisonArrow = -1
	 CloseContainer(Lock) 
	 Index = Index + 1
	 InventoryName = lib_GetAllianceInventoryName(Index)
        end

	local ContainerLock, Container = EditContainer("kWeaponPoisonArrow")
        Container.IsPoweredWeapon = "false"
        Container.WormDamageMagnitude = 15
        Container.WormDamageRadius = 45
        Container.ImpulseMagnitude = 0.25
	Container.Scale = 4
	Container.Radius = 4
	Container.BasePower = 0.65
	Container.ImpulseRadius = 69
	Container.ImpulseOffset = -45
	Container.LifeTime = -1
	Container.SinkDepth = 0
        Container.DetonatesOnLandImpact = "true"
        Container.DetonatesOnExpiry = "false"
        Container.DetonatesOnObjectImpact = "true"
	Container.DetonationFx = ""
	Container.StartsArmed = "true"
	Container.ArmOnImpact = "false"
	Container.PreDetonationTime = 0
	Container.SkimsOnWater = "false"
	 CloseContainer(ContainerLock)

end


function TurnStarted()
   local scheme = QueryContainer("GM.SchemeData")
   if scheme.WormSelect == 1 then
      SendMessage("WormSelect.OptionSelected")
   end

   StartTimer("Spawning", 100)
end


function Spawning()
   it = mchance
    repeat 
     SendMessage("GameLogic.CreateRandomMine")
     it = it - 1
     if it == 0 then
        break
     end
    until true
end