You need to register 2 events with the appropriate filters then and in your callback functions handle both cases.
e.g. do some pre-checks in your event callback function and then call the same "further stuff" function from it.
Code:
event_combat_event, filter source == player, callback = callback1
event_combat_event, filter target == player, callback = callback2
function callbackEventCombat(caseType, a, b, c, ...)
if caseType == 1 then
elseif caseType == 2 then
end
end
function callback1(a, b, c, source, target, ...)
if target ~= "player" then return end
callbackEventCombat(1, a, b, c, source, target, ...)
end
function callback2(a, b, c, source, target, ...)
if source~= "player" then return end
callbackEventCombat(2, a, b, c, source, target, ...)
end
Something like that perhaps.