#!/usr/bin/python
'''
This script is GPLV2
Copyright Gryc Ueusp
Version 1189470955
'''
import random
import string
import uuid
countlowerbound = 300
countupperbound = 500
numberoftrees = random.randrange(countlowerbound, countupperbound)
scalelowerbound = 5
scaleupperbound = 50
template = """118941213402147483647214748364721474836472147483647214748364711894427101189444085702001TreeName2686324920109951162803200025504990000000001600000000AAAAAAAAAACZmQAAAAAABQAAAAAAAAAAgD8AAACAPwAAAAAAAAAAAAAAAAA=AA==Circle"""
#Does LocalID need to be random? Or can it stay as that generic number? Seems OpenSim doesnt care.
trees = []
for i in range(1, numberoftrees):
tree = template
tree = tree.replace("NewUUID", str(uuid.uuid4()))
tree = tree.replace("TreeName", "Tree"+str(i))
tree = tree.replace("NewScaleX", str(random.random()*random.randrange(scalelowerbound, scaleupperbound)))
tree = tree.replace("NewScaleY", str(random.random()*random.randrange(scalelowerbound, scaleupperbound)))
tree = tree.replace("NewScaleZ", str(random.random()*random.randrange(scalelowerbound, scaleupperbound)))
tree = tree.replace("NewRotationX", str(0))
tree = tree.replace("NewRotationY", str(0))
tree = tree.replace("NewRotationZ", str(random.randrange(0, 360)))
#Perhaps start the pos at 128, 128, then add or subtract 0-128 from each. Though this would make it more dense at the center than at the edges. Maybe.
tree = tree.replace("NewPosX", str(random.random()*random.randrange(0, 256)))
tree = tree.replace("NewPosY", str(random.random()*random.randrange(0, 256)))
tree = tree.replace("NewPosZ", str(22)) #Only works with flat terrains, I think?
trees.append(tree)
print("")
print("")
for i in trees:
print(i)
print("")
print("")