TargetCasting always equals None

bowie

Senior Member
So I am trying to write assist code for my warrior. I have most of it working great. However, I want him to interrupt casters when they start to cast. This is what I am using:

Code:
		if ${Me.InCombat}
			{	
				
				
				if !${Me.TargetCasting.Equal[None]}
				{
				
					echo ${Me.TargetCasting}
				
					if ${Me.Endurance}>20 && ${Me.Ability[${Kick}].IsReady}
					{
					Me.Ability[${Kick}]:Use
					call MeCasting
					call CheckForChain
					}
					
					if (${Me.Endurance}<20 || !${Me.Ability[Kick I].IsReady}) && ${Me.Ability[${Stun}].IsReady}
					{
					Me.Ability[${Stun}]:Use
					call MeCasting
					call CheckForChain
					}
				}
				
			}
However, ${Me.TargetCasting.Equal[None]} always returns TRUE even when the target is obviously casting!

So is it broken or, more likely, is my syntax screwy??
 

Kazman420

Active Member
At first glance I don't see anything wrong with your syntax. The "TargetCasting" member of the Character datatype will only display the name of the spell if YOU recognize it. You need the "Spell Identification" skill for it to return anything besides "none". So in other words, the check you have will only work as a Offensive Caster (and I think Blood Mage's get Spell Counters and Spell Identification).

I believe in order to achieve what you seek, Amadeus would need to fix the TargetCasting member to show either TRUE / FALSE / SPELLNAME (should you be able to identify it), or add the "IsCasting" member to the Pawn datatype. Then you could do something like; echo ${Pawn[id,${Me.Target.ID}].IsCasting} for a TRUE or FALSE.

There could very well be another way of doing this, but I am unaware of such a method if it exists.


Oh, and just from my own personal experience, I personally stopped using EndurancePct in my scripts, and check the abilities endurance cost itself.. Something like;

Code:
if (${Me.Endurance} >= ${Me.Ability[Kick I].EnduranceCost})
or if you want to "reserve" some endurance;
Code:
if (${Me.Endurance} >= ${Math.Calc[${Me.Ability[Kick I].EnduranceCost} + ${Me.Ability[Taunt].EnduranceCost}]})
This way, my script will ALWAYS reserve enough endurance for a taunt (or whatever else you would want.. My monk script reserves enough for a FD). Its also better to use EnduranceCost because it scales accordingly if you have endurance cost reducing buffs/stances.


Hopefully Amadeus can help us out with this, because I would also like the ability to see if my target is casting a spell (regardless if I can identify it or not).
 
Top Bottom