Ok, I have a definitive need to use my Jann's Veil, Personal Hemic Source or Icebound Ulthork and I do not want either the Illusion or the familiars running around on all my toons. So here is a LEM condition to remove the fam/illusion as soon as it is applied. Since I use CWTN/KA, I have them check for the buff, and if not applied, cast the item. Then the LEM takes off the 2nd half of the buff, either the Illusion or the Familiar, leaving the buffs intact. There are some illusions I do want applied from my chanter, which is why I do not have AutoRemoveIllusion checked in CWTN.
Thanks to
@brainiac for providing much needed help. Basically, I had the idea, and while I had code here that did work by running through if statements and redundancy, his solution was very elegant and it is what you see here. TY!
Here you go:
[CODE title="Import String"]cmV0dXJuIHsKIGxvYWQgPSB7CiAgYWx3YXlzID0gZmFsc2UsCiAgY2xhc3MgPSAiIiwKICB6b25lID0gIiIsCiB9LAogY29kZSA9ICJiRzlqWVd3Z2JYRWdQU0J5WlhGMWFYSmxLQ2R0Y1NjcENteHZZMkZzSUd4cFluSmhjbmtnUFNCeVpYRjFhWEpsS0Nkc1pXMHViR2xpY21GeWVTY3BDZ3BzYjJOaGJDQmlkV1ptVEdsemRDQTlJSHNLSUNBZ0lDZFRkVzF0YjI0Z1JtRnRhV3hwWVhJNklGQmxjbk52Ym1Gc0lFaGxiV2xqSUZOdmRYSmpaU2NzQ2lBZ0lDQW5VM1Z0Ylc5dUlFWmhiV2xzYVdGeU9pQkpZMlVnUW05MWJtUWdWV3gwYUc5eWF5Y3NDaUFnSUNBblNXeHNkWE5wYjI0NklFUnFhVzV1SUZOdmJHUnBaWEluTEFwOUNncHNiMk5oYkNCaWRXWm1UbUZ0WlNBOUlHNXBiQW9LTFMwdFFISmxkSFZ5YmlCaWIyOXNaV0Z1SUVCU1pYUjFjbTV6SUhSeWRXVWdhV1lnZEdobElHRmpkR2x2YmlCemFHOTFiR1FnWm1seVpTd2diM1JvWlhKM2FYTmxJR1poYkhObExncHNiMk5oYkNCbWRXNWpkR2x2YmlCamIyNWthWFJwYjI0b0tRb2dJQ0FnWm05eUlGOHNJSFJvWlVKMVptWWdhVzRnYVhCaGFYSnpLR0oxWm1aTWFYTjBLU0JrYndvZ0lDQWdJQ0FnSUdsbUlHMXhMbFJNVHk1TlpTNUNkV1ptS0hSb1pVSjFabVlwS0NrZ2RHaGxiZ29nSUNBZ0lDQWdJQ0FnSUNCaWRXWm1UbUZ0WlNBOUlIUm9aVUoxWm1ZS0lDQWdJQ0FnSUNBZ0lDQWdjbVYwZFhKdUlIUnlkV1VLSUNBZ0lDQWdJQ0JsYm1RS0lDQWdJR1Z1WkFvS0lDQWdJSEpsZEhWeWJpQm1ZV3h6WlFwbGJtUUtDbXh2WTJGc0lHWjFibU4wYVc5dUlHRmpkR2x2YmlncENpQWdJQ0JwWmlCaWRXWm1UbUZ0WlNCMGFHVnVDaUFnSUNBZ0lDQWdiWEV1WTIxa1ppZ25MM0psYlc5MlpXSjFabVlnSWlWeklpY3NJR0oxWm1aT1lXMWxLUW9nSUNBZ1pXNWtDbVZ1WkFvS2NtVjBkWEp1SUh0amIyNWtablZ1WXoxamIyNWthWFJwYjI0c0lHRmpkR2x2Ym1aMWJtTTlZV04wYVc5dWZRPT0iLAogY2F0ZWdvcnkgPSAiQ2hhcmFjdGVyIiwKIHR5cGUgPSAiY29uZGl0aW9ucyIsCiBuYW1lID0gIlJlbW92ZUZhbXMiLAp9[/CODE]
[CODE title="Verbose"]local mq = require('mq')
local mq = require('mq')
local library = require('lem.library')
local buffList = {
'Summon Familiar: Personal Hemic Source',
'Summon Familiar: Ice Bound Ulthork',
'Illusion: Djinn Soldier',
}
local buffName = nil
---@return boolean @Returns true if the action should fire, otherwise false.
local function condition()
for _, theBuff in ipairs(buffList) do
if mq.TLO.Me.Buff(theBuff)() then
buffName = theBuff
return true
end
end
return false
end
local function action()
if buffName then
mq.cmdf('/removebuff "%s"', buffName)
end
end
return {condfunc=condition, actionfunc=action}
[/CODE]