The Miracle Fighters (1982)
The Miracle Fighters is a 1982 Hong Kong martial arts film directed by Yuen Woo-ping and starring Bryan Leung, Yuen Cheung-yan and Yuen Yat Cho. The film's action sequences features various elements of fantasy which includes magic. It was followed by two sequels, Shaolin Drunkard (1983) and Taoism Drunkard (1984) which are similar style films with different storylines.
More at Wikipedia.