If I know there is a creature in range under the greater invisibility effect, can I do the ready action to cast dispel magic on the invisibility effect when the invisible creature reveals his position with attacks, spells or in any other way?
[RPG] How to dispel greater invisibility
- The spell greater invisibility says its effect is just like the spell invisibility.
- The spell invisibility says it makes you invisible, the condition.
- The condition "invisible" says to see the ability "invisible".
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.
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).
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.
- 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.
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.
You can target invisible creatures
Given that you don't need line of sight to target the invisible creature with dispel magic, you can target the creature even when invisible.
Dispel magic (PHB, pg. 234) says:
It doesn't say anything about "that you can see", meaning that you don't need to be able to see the invisible creature to attempt to dispel the effect.
This means you don't need to use your action to ready the spell, you can just cast the spell (unless you aren't sure they're within range, in which case you could ready the spell to be released upon the invisible enemy revealing their position when they attack, etc).
See also: What happens when an invisible creature is detected?, How does an NPC guess where an invisible PC is when attacking?