I believe the case with the goblin is that it sometimes takes a tick (3 seconds for aggro iirc) for the guard to recognize there was a kos npc within range.
Regarding the pirate.. guards often are not kos against humanoid species. Similar to bandits in the karanas, guards are not kos to the pirates.
|