As the title suggests, i'm hoping some of you fine lads can give me some piece of mind for writing songs on guitars. I've just joined a jam band and i'm wanting to be able to bring riffs or whole songs to the table...

Things im looking for (anything else is still accepted :p):

-What scales, modes, chords...theory type stuff i should learn that'll make the writing a lot easier.
-Good ways of getting inspiration...

Well..things like that...hope you can help in any way, it's well appreciated...cookies for helpers!