Ok, but what if they have the first affliction in the list? What it seems to me you may want is something like the following:
local aff1 = {
"anorexia",
"stupidity",
"loneliness",
"recklessness",
"masochism",
}
local aff2 = {
"anorexia",
"stupidity",
"impatience",
"vertigo",
"confusion",
}
for _,flicted in ipairs(aff2) do
if not table.contains(combat.afflictions, flicted) then
whisperone = flicted
break
end
end
for _,flicted in ipairs(aff1) do
if not table.contains(combat.afflictions, flicted) and not whisperone == flicted then
whispertwo = flicted
break
end
end
if combat.enemy.afflictions.rebounding then
send("frenzy " .. god.target)
end
send("Dwhisper " .. whisperone .. " " .. whispertwo .. " " .. god.target)
It should be noted that this could lead to some interesting results for some cases. Such as them having all the affs in aff2, at which point it will likely repeat whatever whisperone was previously. You may want to work some guards in against that sort of thing, but this should hopefully set you in the right direction.