Defining if an NPC killed is a certain NPC?

I am trying to check whether the player kills a certain npc

I am not sure where to start besides something like this:


function KillCheck( victim, inflictor, attacker )
    if ( attacker:Quest() == "Slay a wild beast" && victim != attacker ) then
       QuestComplete(attacker, 1)
    end
	if( attacker:Quest() == "Slay a mythical beast" && victim == "npc_carnophage")then
		QuestComplete(attacker, 3)
	end
end
hook.Add("OnNPCKilled","KillCounter", KillCheck)

The line in question:


if( attacker:Quest() == "Slay a mythical beast" && victim == "npc_carnophage")then

Is there a way to check the victim’s ent class instead of this? Because I’m sure this doesn’t work.

Thanks in advance and sorry for my frequent most likely stupid posts…

Cough Found it myself…sorry.