Implementation of attacking by id and type