Page 1 of 1

Not sure what it's called, but i just need what i like to call a smart cursing system

Posted: Sun Sep 23, 2018 6:24 am
by Guilend
Once again i am in need of some help, I am sure this is possible, and I am even more sure it's complex and complicated. I have been working on it for the past few hours and I am stumped at how to do it. It's late so I decided to ask you all nice folks on here before i get some shuteye.

I want to make an alias that I can just hit and it will cycles through a list of curses, ok this is where it gets complicated. I can read my targets fortune, it doesn't take or need balance/eq to do this and reading their fortune will tell me every curse they have. I want to be able to hit this alias and it read their fortune, then check what curses my target has and then curse a curse they do not have. Let me make it more clear then that.

Here is a list of curses for example

evileye
confusion
badluck

Now i want to keep those curses on the target, and in that order. So if they cure confusion, i want this alias to curse them with confusion, or if they curse evileye and badluck, then it will curse them with evileye.

Now if that's not complicated enough, there are 4 ways I can curse targets. This is the script i am currently using for curses.
Code: [show] | [select all] lua
function CurseStyle(tCurse,CstYle)
 if CstYle == "s" then
  send("far curse " .. target .. " " .. tCurse)
	 elseif CstYle == "p" then
	  send("puppet curse " .. pups .. " " .. target .. " " .. tCurse)
	 else
	   send("curse " .. target .. " " .. tCurse)
	   end
	 end
Now this script is missing the 4th way i can curse, mostly because I have not added it, not even sure how at the moment. The forth way would be like this.
Code: [show] | [select all] lua
send("unwield right;wield " .. lastwax .. " right;image curse " .. tcurse .. ";unwield right")
What I want is to be able to use all 4 ways to curse by using this method that I just explained at the top. I want to be able to check fortune, curse whatever curse is missing from the list and to be able to curse it getting to choose between the 4 methods. The curse commands for all four are:
curse <target> <curse>
far curse <target> <curse>
puppet curse <puppet####> <curse>
image curse <curse>

As for the messages for when I read my targets fortune isn't as simple as, They are cursed with <curse> but i do have a list of each text that each curses shows. Also the command to read their fortune is, FORTUNE <target>.

plagued by the evil eye.-------------------------------Evil Eye
cursed with ill fortune.-------------------------------Badluck
cursed with bad luck in wealth matters.----------------Poverty
cursed with confusion of the mind.---------------------Confusion
afflicted by a tape-worm.------------------------------Tapeworm
beset by the hayfever curse.---------------------------Heyfever
cursed with hypothermia.-------------------------------Hypothermia
cursed with migraine.----------------------------------Migraine
a claustrophobic.--------------------------------------Claustrophobia
extra-ordinarily ugly.---------------------------------Ugliness
cursed with dizziness.---------------------------------Dizziness
affected by a deadly black disease.--------------------Plague
intolerant and brash.----------------------------------Intolorance
afflicted by rampant paranoia.-------------------------Paranoia
unaware of combat damage.------------------------------Quixotism
a parasite to her allies.------------------------------Parasite
affected by anorexia.----------------------------------Anorexia
carrying the disease of the Black Death.---------------Blackdeath
a dunce and has no intellectual curiosity.-------------Dunce
plagued by a slight form of amnesia.-------------------Amnesia
affected by a mental befuddling or clumsiness.---------Clumsiness
bearing the disease of haemophilia.--------------------Haemophilia
cursed with confusion of the mind.---------------------Confusion
cursed with stupidity.---------------------------------Stupidity
pessimistic and depressed.-----------------------------Pessimism
afraid of heights.-------------------------------------Vertigo
slothful and sluggish.---------------------------------Slothful
cursed with insomnia.----------------------------------Insomnia

This is every curse and their message, now at the front of each message it says "She\He is" and there is a message right at the start of fortune that can be triggered from.
Code: [show] | [select all] lua
^You gain an inkling of \w+ fortune\.$
Right now i have each of those messages triggered to delete the line and echo the actual curse, so it's easier to read, but with combat spam it's hard to see it all in time to curse something else before they curse something. I just want to stop wasting eq on a curse they already have. I am sure there will be questions as I am sure I didn't make something clear, or I missed something. Now I don't want this alias to curse all of those curse, just a list that i can just add to different aliases and plug in the curses i want for each alias, so I can change tactics depending on what class i am fighting or what i am going for. I probably add to much info here, but it's better then too little. Thanks ahead of time.

Oh, I think i put this in the correct forum section this time lol.

Re: Not sure what it's called, but i just need what i like to call a smart cursing system

Posted: Sun Sep 23, 2018 11:52 am
by Jor'Mox
Here is a set of functions that you should be able to use to do what you are looking to do. You just need to fill in the curses and curse_priority tables, and make the necessary triggers and aliases to use them.
Code: [show] | [select all] lua
-- smart cursing functions
-- table matching curse messages to curse names
local curses = {["curse message 1"] = "curse name 1", ["curse message 2"] = "curse name 2",}
-- table of curses in order of priority
local curse_priority = {"curse name 1", "curse name 2",}
-- table used to hold curses on target
local target_curses = {}

function curse_reset()
    -- reset list
    target_curses = {}
end

function curse_add(msg)
    -- add curse to list
    if curses[msg] then
        table.insert(target_curses, curses[msg])
    end
end

function apply_curse(style)
    local curse, cmd
    -- find curse to apply
    for _, name in ipairs(curse_priority) do
        if not table.contains(target_curses, name) then
            curse = name
        end
    end
    -- setup command based on chosen cursing method
    if style == "s" then
        cmd = string.format("far curse %s %s", target, curse)
    elseif style == "p" then
        cmd = string.format("puppet curse %s %s %s", pups, target, curse)
    elseif style == "w" then
        cmd = string.format("unwield right;wield %s;image curse %s;unwield right", lastwax, curse)
    else
        cmd = string.format("curse %s %s", target, curse)
    end
    if cmd then
        send(cmd)
    end
end