I've created a "Seed Bomb". It's a rocked that plants trees when fired.
The "Basic" version works fine, but then I tried to add a Advanced version that also changes the terrain. (Fertilizes it, before planting the tree.)
This version seems to suck up a lot of CPU power and I was hoping someone could help me optimize the code.
I use the "on_trigger_created_entity" for the Basic ammo, but had to do something different for the Advanced, so I placed a dummy entity that triggered and swamped it out for the same entity as in the Basic version, since I did not know how else to tell the difference between the basic and advanced. I think if there is a way, it would improve performance a lot already.
It's hard to explain, best to load the mod and sheet the Seed Bomb using the rocket launcher.
Pic
I don't think that the trees are actually growing with the Advanced version 
Code