Clarifications
The advantage/disadvantage happens when a creature can't be seen - being invisible is one way of doing this but it is not the only way - being hidden or in the dark or having a blinded opponent are other ways. See What advantages does hiding have? Because of this I will use "unseen" when I mean that the creature cannot be seen for any reason and "invisible" when I am talking about having that particular state.
You have used the word "(opportunity)" in a way which makes me think that you are coming from an older version of D&D where casting a spell could trigger an opportunity attack; this does not happen in 5e! The only trigger for an opportunity attack using a reaction is if a seen creature voluntarily moves out of another creatures reach without taking the Disengage action (PHB p. 195).
Answers
Two things to keep in mind:
- The sequence of events goes: attack or cast spells then lose invisibility.
- Each attack occurs at its own time - there are no simultaneous events.
If you keep that in mind then all becomes clear the creature :
- gets advantage if it is unseen when it attacks, and
- causes disadvantage if it is unseen when it is attacked.
Question 1
- The creature gets advantage when it makes an attack while unseen - it then loses invisibility.
- when the creature is attacked disadvantage happens if it is unseen at the time of the attack - this does not cause it to lose invisibility.
- See 1. above. If a creature then attacks again it is no longer invisible (it could still be unseen e.g. a creature with darkvision attacking one without in the dark); so see 1. above.
There are all sorts of sequences that can affect this, for example:
- you are invisible at the start of your turn and can attack twice when using the full attack action and can cast invisibility as a bonus action. I am not aware of any creature that can do this but its theoretically possible.
- You move 10 feet,
- Take the Attack action and attack with advantage because you are unseen,
- turn visible,
- you use your bonus action to turn invisible,
- move 10 feet to another opponent; you do not trigger an Opportunity attack because you are unseen,
- attack then with advantage because you are unseen,
- that opponent has taken the Ready action to "attack the first creature that attacked them", they attack with no advantage or disadvantage as you are now seen.
Question 2
In D&D 5e things do exactly what they say the do; no more, no less. Just because an ability and a spell cause the same effect does not mean they have anything to do with one another beyond that.
Superior Invisibility. As a bonus action, the dragon can
magically turn invisible until its concentration ends (as if
concentrating on a spell).
This does not refer in any way to the spell Invisibility! The limitation on attacking and spell casting applies to the spell; it does not apply to this ability. This ability ends when the faerie dragon stops concentrating - they can otherwise attack and cast spells and remain invisible.
The primary source on Favored Enemy is either Player’s Handbook in the ranger class description, or Rules Compendium if you buy its assertion of primacy. The descriptions in the Invisibility description in Dungeon Master’s Guide, Improved Manyshot in Epic Level Handbook, or even darkness, despite also being in the Player’s Handbook, are definitely not the primary source on Favored Enemy.
Further caveats, limitations, and addenda not mentioned in the primary source description are contradictions with that description. If Favored Enemy had defined itself as precision damage, the primary source on precision damage would apply, but it didn’t, which means that neither the precision damage description nor anywhere else can define it as such.
I would be inclined, in general, to follow contradictory rules as far as they go. Darkness and Invisibility cannot define Favored Enemy as precision damage in general, but it can say Favored Enemy doesn’t work in those conditions. Here, specific-trumps-general: rather than trying to redefine what Favored Enemy is (in which primacy asserts itself), they can define a special case which acceptably contradicts the general rules. So my reading of the rules as written would be that Favored Enemy is not precision damage, but it does fail to work in cases of darkness or Invisibility, and does apply only once to Improved Manyshot.
Ultimately, however, I would mostly ignore any and all rules as written that apply any more needless limitations on Favored Enemy. Of all the iconic core class features,1 Favored Enemy is one of the weakest, and that’s even assuming that it “just works” on any and all attacks against the designated foes (including, therefore, Improved Manyshot).
- Slow fall and wild empathy, if counted as “iconic class features,” are definitely weaker than favored enemy, and smite evil and trapfinding give it a run for its money too. That’s still a small list compared to all of the options.
Best Answer
Yes.
Note that each step along a chain like this may introduce changes. For example, if any details of a spell contradict the details of the condition it's based on, the details of the spell override the details of the condition.
For a trivial example in this case, the invisibility spell adds the information that the condition ends when the subject attacks, while the ability implies that an invisible attacker can stay invisible: the spell overrides that. (And of course, greater invisibility overrides this part of invisibility again, making the subject stay invisible after attacking.) As another example, greater invisibility and invisibility can be detected by detect magic, while the invisibility ability may or may not be so detected, depending on what type of ability it is in the creature description.