################
# > Physics Meteorstorm: A realistic meteor storm.
# > How to use: Spawn it and type '!storm' for pure win.
################

@name MeteorStorm by Runeneo
@persist T OwnerProps:array I

runOnChat(1)

# Melon = "models/props_junk/watermelon01.mdl"
# Rock = "models/props_wasteland/rockgranite02c.mdl"
# Baby = "models/props_c17/doll01.mdl"
# Donut = "models/noesis/donut.mdl"
# Banana = "models/props/cs_italy/bananna_bunch.mdl"
# Orange = "models/props/cs_italy/orange.mdl"

Model = "models/props_wasteland/rockgranite02c.mdl"

if (first()) {
    for (I=1,50) {
        concmd("gm_spawn "+Model)
    }
}

findIncludePlayerProps(owner())
findByClass("prop_physics")
OwnerProps=findToArray()

for(Index=1, OwnerProps:count()) {
    
Prop=OwnerProps[Index,entity]

if (owner():lastSaid() == "!storm") {
    concmd("say A strange storm is heading towards "+map()+"! Run for your lives!")
    Prop:setMass(50000)
    Prop:setTrails(20,0,0.5,"trails/smoke",vec(50,50,50),200)
    Prop:applyForce(((Prop:pos()+vec(0,0,10000))-Prop:pos())*20000*Index)
}
}
