As longĪs you wear this amulet, the timer for the next vampire attack willĬontinuously set to the far future. The mod will add an amulet called 'Ancient Vampire Repellent'. This is a quick fix for the annoying vampire attacks killing the I found a mod that stops the vampire attacks on the cities and villages altogether: No Random Vampire Attacks for Dawnguard (PC) It's not a 100% guarantee that NPCs won't die, but it drastically improves their survival rate, and you don't have to walk around town applying essential commands to every NPC. Personally, I would go with the mod iber provided.
More info on using that command can be found here: In Skyrim, the console command to set a follower as essential is not working.
If you don't want to mod your game, you can set individual NPCs essential using setessential 1 I found the 'When Vampires Attack' mod which should help people with similar issues.