ski
Well-Known Member
- Joined
- Feb 12, 2010
- Messages
- 3,720
After looking through a bunch of other CC's, I notice most (all that I saw, actually) of them use sequential-based spell casting.
What I mean by that is, as Combat() is run through, each spell has its own separate If(conditions) statement before being cast.
I see a problem with this - it makes your CC not able to react quick enough to situations in game. Take the following sequence for example:
In this example, if I'm at 75% health when Combat() is entered, it will skip death coil and begin casting the rest of the spells. Now if I get hit after the corruption and end up at 30% health, instead of Death Coiling, it will finish out Combat() by casting UA, then Shadowbolt. Only after both of those are done will it start again and use the death coil (at which point I'll likely be dead already).
What I'd LIKE to use, is some sort of priority-based spell casting where each cast is decided upon in real time. In the example above, I would like it to see that after casting Corruption my health is low, and use Death Coil.
I tried implementing something like this, but it seems that the code while running is too slow and there is a few seconds in between each cast:
In this case, it should run through Combat() for each spell, letting it choose based on which needs to be cast first. Only problem is Combat() wasn't being called fast enough for it to be efficient.
So I tried something like this:
I ran into the same issue with long times between spell casts and I'm not entirely sure why.
What I'd like to know from the other developers is how (or if) you have implemented priority-based spell casting that chooses each spell for each cast, as opposed to just running through every spell before looping again.
What I mean by that is, as Combat() is run through, each spell has its own separate If(conditions) statement before being cast.
Code:
if (useSpellA == true) {useSpellA();}
if (useSpellB == true) {useSpellB();}
if (useSpellC == true) {useSpellC();}
etc
I see a problem with this - it makes your CC not able to react quick enough to situations in game. Take the following sequence for example:
Code:
Combat(){
if (health < 50) {deathcoil();}
if (useCorruption) {corruption();}
if (useUA) {ua();}
if (useShadowbolt) {shadowbolt();}
}
In this example, if I'm at 75% health when Combat() is entered, it will skip death coil and begin casting the rest of the spells. Now if I get hit after the corruption and end up at 30% health, instead of Death Coiling, it will finish out Combat() by casting UA, then Shadowbolt. Only after both of those are done will it start again and use the death coil (at which point I'll likely be dead already).
What I'd LIKE to use, is some sort of priority-based spell casting where each cast is decided upon in real time. In the example above, I would like it to see that after casting Corruption my health is low, and use Death Coil.
I tried implementing something like this, but it seems that the code while running is too slow and there is a few seconds in between each cast:
Code:
Combat(){
if (health < 50) {deathcoil();}
else if (useCorruption) {corruption();}
else if (useUA) {ua();}
else if (useShadowbolt) {shadowbolt();}
}
In this case, it should run through Combat() for each spell, letting it choose based on which needs to be cast first. Only problem is Combat() wasn't being called fast enough for it to be efficient.
So I tried something like this:
Code:
Combat(){
While(!Target.IsDead && Me.HaveTarget){
if (health < 50) {deathcoil(); break;}
else if (useCorruption) {corruption() break;;}
else if (useUA) {ua(); break;}
else if (useShadowbolt) {shadowbolt(); break;}
}
I ran into the same issue with long times between spell casts and I'm not entirely sure why.
What I'd like to know from the other developers is how (or if) you have implemented priority-based spell casting that chooses each spell for each cast, as opposed to just running through every spell before looping again.
Last edited: