Replaced achievement function with custom event triggering.