It triggers the event, and in $spell_id (in Perl) you get the ID of the spell the NPC has been hit with. If you need more info about the spell you have to query for it (dunno if/how it can be done from Perl, possibly). The event is fired whether or not the NPC resists, is immune etc. It means the Spell is on the target.
Here is how you will be able to use it once KLS commits the missing part, to update a quest globals when a specific NPC is hit by a Courage (context : a cleric guildmaster quested the player with buffing this guard, the event sets the globals, and the NPC checks the globals before rewarding the PC for his action :
Code:
sub EVENT_CAST_ON
{
if($spell_id == 202) # Courage
{
quest::say("Bzzzzt !");
quest::setglobal("A_Bit_of_Clericing", "Guard Buffed", 5, "F");
}
}