Jaerin Apprentice
Joined: 10 Oct 2000 Posts: 132 Location: USA
|
Posted: Tue Jan 15, 2002 4:59 pm
Script help... |
Okay I have a potentially difficult script that I want to write. I have already started on it and got one major piece out of the way, but I need some help coming up with an elegant way of doing the rest. Here is what I'm trying to do:
I am trying to write a script to automate my summons in combat. Here's how the summoning system works. I cast my summoning spell and a creature out of about 11 possibilities is summoned. Now I can assign them to a group so I don't have to refer to them by the type of creature. I have this part done. So when I summon I will have summon0, summon1, summon2, ect...
Thier status is displayed on my prompt as follows:
Example of a single summon:
--> Shadow:A
Example of 2 summons:
--> Shadow:A, Giant spider:B
I can have many summons, but rarely if ever do I have more than 4 out at any one time. The letter/(plus) afterwards is the HP status which can be (plus),A,B,C,D,E. (Forum doesn't like plus symbols for some reason) I am able to capture that data okay, but here is the problem.
My summons tank mobs for me. I can control which summon is tanking at anytime with the following instructions:
say summon1, defend me
This will cause summon1 to pull the mob off of the summon that is currently tanking. Now the real catch is that it's not immediate. It could be anywhere from 1-3 rounds later. This creates a problem because the summon that was previously tanking could die in the time that the next summon is taking over. If that's the case I need to eliminate the previous summon as a possible future defender.
So with that background here is what I would like to do:
Monitor the status of the currently defending summon, when it drops to or below a certain level (B) then it selects the next most healthy summon and asks it to defend. This isn't too difficult unless one of the summons dies at which point the order of the summons is no longer summon0, summon1, summon2, ect...it would be summon0, summon2, summon3, so I need to be able to associate the HP status with a particular summon not with the place in the hpbar. I don't think I explained that well so I will try to give an example:
--> Giant spider:B, Hell hound:A, Werewolf:A
So with that summon0 would be the Giant spider, summon1 would be the Hell hound, and summon2 would be the Werewolf. The Werewolf is currently defending and eventually drops to C. I need to test all the summons HP's to see who has the highest amount and ask them to defend. In this case the Hell hound has A and therefore should be the next defender. So now we have the following:
--> Giant spider:B, Hell hound:A, Werewolf:C
Now lets say that the Hell hound has dropped below the desired amount and we ask the next highest to defend, Giant spider, but before the Giant spider takes over the Hell hound dies. So we are left with:
--> Giant spider:B, Werewolf:C
With the Giant spider defending. The problem is that now instead of the values coming out being summon0, summon1, summon2 we have hp values that are summon0, summon2. This is important because the summon0/summon2 is the actual term that is used to reference that summon. So all of a sudden it would be putting the Werewolf's HP's into the summon1 variable instead of the summon2. So I need to find a way to dynamically assign the hps to the proper variable if a summon were to die.
I've thought of an idea that may help. Some how tying the variable to the actual name of the summon. There is a catch though you can have multiple summons of the same type, and you can't control specifically what type you are going to summon. If you do have multiples they can be referred to as either A the name that you give them or B by Giant spider 2 for example.
Well I hope I explained the situation with enough detail for you to understand. I'm not necessarily looking for specific code, I'm more interested in ideas on how you think that it can be done.
Thanks
Jaerin |
|