hey guys i was wondering if someone with better knowledge of music theory than me can give me some ideas for writing a solo over a riff in this tab (starts bar 127)

staying with one key doesn't seem to be working well

I want it to be a slower, melodic (dark?) type of solo preferably, can anyone help me please?!

see gp5 file attached! thanks!
Shadows Of Avarice (With Drums) GP5.gp5
I'd suggest you to stick to pentatonics, locrian and aeolian mode.
Repeating this descending pattern an octave or two higher would be a nice thing to do, also.

But overall - just imrpovise, listen to what you play and do what you feel .
First some analysis:

You're right, one key would not do the trick here, it's a very dissonant progression. You gotta try to hear where the tonality is and how it changes from one bar to the next. The first bar screams C# phrygian, so see where your F#minor scale wit the raised 7th takes you. Then you bring in that tritone and sort of hint toward a G lydian, but really the C# tonality is too strong so I'd work the C# diminished borrowing a note here or there from the B minor scale (with, or perhaps without, the raised 7th). Then the A hits and now you're fully in the B minor zone. I dont think the B minor pentatonic will sound too good over that though since the rhythm is hitting that C# (the 2) so much, you'll have to think of it as A mixolydian. The last bar you're still in the A mixolydian for the first half anyway. Over the last two notes I'd match it up... maybe play G F# E D over them to harmonize and then land on the C# to end / start the next part.

Now for some ideas

Slow and melodic over this type of dissonant progression means its time to bring out your vibrato and bending A game. Definitely want to be bending that C# up a half step at least a couple times, maybe tap the F as you're bending back, and work the B. Learn some diminished runs to start the second bar and then kick into a full on b minor scale run landing on an A chord tone on bar three. Keep bending that C# and slowly work your way back into dissonance perhaps utilizing the F# as some kind of pivot.

Anyway, all that rambling should give you a few things to experiment with!