I couldnt figure out why nested for/next would fail so I just did the group part the way I did. Make your own suggestions I just wanted this idea out there.
I used afnuke's Junk routines for the idea
Needs spell_routines.inc
Code: Select all
|-shaman.ini
|-This file is from /declare inifile filename.ini outer elsewhere and can be shared with other ini files.
|-DoT_#=Name of the spell you want cured
|-Cure_#=The spell to cast (Or Ability)
|-CureType_#=Type of spell (aa, single, self, group)
| Single will do each member of your party
| Self will do yourself only
| AA will use an ability (Radiant Cure)
| Group will assume the spell is a group and is there so you can add /gsay Cure inc
[Cures]
DoT_0=Turgur's Insects
Cure_0=Blood of Nadox
CureType_0=group
DoT_1=Malos
Cure_1=Radiant Cure
CureType_1=aa
Code: Select all
Sub Cures
/declare Category string local
/declare EachDoT int local
/declare DoT string local
/declare Cure string local
/declare CureType string local
/varset Category Cures
/if (${String["${Ini[${IniFile},${Category},-1,NOTFOUND]}"].Find["NOTFOUND"]}) {
/return
}
|- Set line to 0, and search ailments list until no more found looping to :Nextcure...
/varset EachDoT 0
:NextCure
/varset DoT ${Ini[${IniFile},${Category},DoT_${Int[${EachDoT}]},NOTFOUND]}
/if (${DoT.Equal["NOTFOUND"]}) {
|- Were done, leave subroutine
/return
}
|- Loop all buff slots and check for the current ailment in $DoT...
/for m 1 to 20
/if (${Me.Buff[${m}].ID}>0) {
|- We have a buff in this slot, check it against ini file for cures
/if (${Me.Buff[${m}].Name.Find["${DoT}"]}) {
|- We have a match, look for a cure
/varset Cure ${Ini[${IniFile},${Category},Cure_${Int[${EachDoT}]},NOTFOUND]}
/varset CureType ${Ini[${IniFile},${Category},CureType_${Int[${EachDoT}]},NOTFOUND]}
/if (${Cure.Equal["NOTFOUND"]}) {
/echo No Cure Found for ${DoT}...
/goto :curenext
}
/if (${CureType.Equal["NOTFOUND"]}) {
/echo No Cure Type defined, assuming group spell...
/varset CureType group
}
/echo ${DoT} needs ${Cure}, a ${CureType} target spell for my group...
|-----------CURE STARTS HERE-----------------------
/if (${CureType.Equal["AA"]}) {
/target myself
/delay 1s
/call Cast "${Cure}" alt
}
/if (${CureType.Equal["self"]}) {
/target myself
/delay 1s
/call Cast "${Cure}" gem6
}
/if (${CureType.Equal["group"]}) {
/target myself
/delay 1s
/call Cast "${Cure}" gem6
}
/if (${CureType.Equal["single"]}) {
/target myself
/delay 1s
/call Cast "${Cure}" gem6
/if (${Group[1].ID}) {
/target id ${Group[1].ID}
/delay 1s ${Target.ID}==${Group[1].ID}
/call Cast "${Cure}" gem6 7s
}
/if (${Group[2].ID}) {
/target id ${Group[2].ID}
/delay 1s ${Target.ID}==${Group[2].ID}
/call Cast "${Cure}" gem6 7s
}
/if (${Group[3].ID}) {
/target id ${Group[3].ID}
/delay 1s ${Target.ID}==${Group[3].ID}
/call Cast "${Cure}" gem6 7s
}
/if (${Group[4].ID}) {
/target id ${Group[4].ID}
/delay 1s ${Target.ID}==${Group[4].ID}
/call Cast "${Cure}" gem6 7s
}
/if (${Group[5].ID}) {
/target id ${Group[5].ID}
/delay 1s ${Target.ID}==${Group[5].ID}
/call Cast "${Cure}" gem6 7s
}
}
|-----------CURE ENDS HERE-------------------------
}
}
/next m
:curenext
/varset EachDoT ${Math.Calc[${EachDoT}+1]}
/goto :NextCure
/return
