I'm watching a Mario RPG translation video: https://www.youtube.com/watch?v=WRBRLmhFy-4
What I think I understand so far is: ながい おつきあいなだけに、= "Given that I've known you a long time,"
Question 1: なにがあったか = "What happened..."
I think this is correct? However, I have been reading about か and I cannot understand what it's function is here. I would like to know its purpose please.
Question 2: 気付いてしまいました！ = "...I realize!" or "...now I realize!"
I am very unsure about my translation of this part. I think 気づいて is て form. しまいました is confusing to me though. Does しま = polite affirmative する? Also いました, I'm not sure about this. Is this supposed to be 今 past tense or いる past tense?