If Orim's Thunder is kicked, but the artifact or enchantment is an illegal target as Orim's Thunder tries to resolve, Orim's Thunder won't be able to determine the artifact or enchantment's mana value. No damage will be dealt to the target creature, even if it remained a legal target. If only the creature has become an illegal target, the artifact or enchantment will still be destroyed. (If both targets become illegal, Orim's Thunder won't resolve at all.)