Thanks Gaderian I fixed the issues with the Casting not including a findkind. That was just a bad copy/paste.
I'm often reminded I went to public school to learn math. I had the percentage wrong for Energy Vortex. I found a shorter way of doing the math so that's fixed.
Not sure if you're understanding how lazy I am but I didn't plan on adding any other spells to the script so I don't really need to know all the magery spell mana cost and this is just one calculation no matter what suit or anything else you may or may not have. It casts the spell and based off how much that costs your dude I simply determine the cost of an invisibility spell since it will always be a percentage of the cost of the EV or NF. Going in and doing all the parsing on suit equipment and adding all that up just isn't the lazy way of doing this. I can skip all that and use 1 line of code to figure it out.
I capture the first cast mana cost (EV or NF) and based off that multiply out what percentage your invisibility will cost and have that as a minimum required mana to actually cast another summon and an invisibility after. It's my hope the slop with my dumb timers leaves enough extra mana on the end in the event you have to cast a heal or cure at some point. That is not the most efficient way with the timers, but I keep casting EV's so I'm happy with it like that.
Here is my new math for Summon + Invisibility Cost
if %Cast = 606 ;Natures Fury
set %manarequired %manacost * 184 / 100
if %Cast = 57 ;Energy Vortex
set %manarequired %manacost * 140 / 100
Here is where I'm using that math for summon + Invisibility cost.
Sub Cast
While #FOLLOWERS < %MaxFollowers && #MANA > %ManaRequired ;<---- if I can't cast a summon and Invisibility after I don't cast and stay invis
{
If C in #CHARSTATUS
gosub Cure
If #HITS < %MaxHits
gosub Heal
event macro 15 %Cast
target 4s
If %CastAttempt < 2
{
set #LTARGETX %LTX
set #LTARGETY %LTY
set #LTARGETZ %LTZ
set #LTARGETKIND 2
}
else
{
set #LTARGETX %TempLTX
set #LTARGETY %TempLTY
set #LTARGETZ %LTZ
set #lTARGETKIND 2
}
event macro 22
wait 1s
set %CastAttempt %CastAttempt + 1
}
set %CastAttempt 1
return