Premonition in Lua Affliction Tracking
Hi Everyone,
I put together my aff tracking by looking at other people's code, writing my own, and using snippets and converting the syntax to fit MUSH (as well as writing some of my own). That means, that, while I understand what I've now got, I'm not that great at adding in additional functionality.
Right now, my aff tracking doesn't take into account if they have premonition or not. Does anyone have a moment to take a look at my code, and give me some hints on how I could add in a check for premonition?
Thanks in advance!
(It's in pastebin because the new forums hate me, and quotes, spoilers etc. don't seem to work)
0
Comments
(this is out of my mudlet system)
------------------------------------------------------------
function TrackingFocus()
for _,v in ipairs(EnemyFocusOrder) do
if combat.afflictions[v] then
combat.afflictions[v] = false
echo("\nENEMY CURED " .. string.upper(v))end
end
refreshEnemy()
end
EnemyFocusOrder = {
"stupidity",
"anorexia",
"epilepsy",
"paranoia",
"hallucinations",
"shyness",
"stuttering",
"dizziness",
"indifference",
"berserking ",
"pacifism",
"lovers",
"hatred",
"generosity",
"claustrophobia",
"vertigo",
"loneliness",
"agoraphobia",
"masochism",
"recklessness",
"weariness",
"confusion",
"dementia",
"premonition",
}
it was just an example...
function ECC(aff)
if enemyAfflictionList[aff] then
return true
else
return false
end
end
function ERM(aff)
enemyAfflictionList[aff]=nil
end
For the main example of what the cure would be
elseif plantEaten=="ash" or plantEaten=="whatever" then
for _, key in ipairs(ginseng) do
if key~="blighted" and ECC(key) and enemyCanHerb then
ERM(key)
enemyCanHerb=false
tempTimer(1.2, [[enemyCanHerb=true]])
elseif key=="blighted" and ECC(key) then
if ECC("premonitions") then
enemyCanHerb=false
tempTimer(1.2, [[enemyCanHerb=true]])
else
ERM(key)
enemyCanHerb=false
tempTimer(1.2, [[enemyCanHerb=true]])
end
end
end
end
end
end
Technically the most efficient way to do this would be to convert undead cures to living cures before this, but it's a neglible increase.