I eventually scratched the method of constantly updating a list of what buffs don't stack.
It was nice since it would replace buffs like Spirit of Eagle if you had Spirit of Wolf, but otherwise it was a big inconvenience.
Here's my current source of code in which I just use the .Stacks check, and a refresh option which will cast all buffs regardless of any checks.
Otherwise, it will cast missing buffs, or any buffs with a duration less than 20% (with some smart checks for short buffs).
I've used the ZoneInfo method from the Krust macro which holds all the zones in it's own INI file as to weather each zone allows Run Speed or Levitation buffs.
Requires:
MQ2Cast
MQ2Cast_Spell_Routines.inc
http://macroquest2.com/phpBB2/viewtopic.php?t=12758
To use, add this line to your macro:
/call Init_Buffs
See below for INI example.
Code: Select all
|-- Buff Include
|
| Usage:
| /echo buffs [1|self|2|pet|both] (refresh)
|
| Examples:
|
| Normal call. Cast missing buffs. If pet is up, do the same.
| /echo buffs
|
| Only check missing buffs on self
| /echo buffs 1
|
| Refresh buffs on pet only.
| /echo buffs pet refresh
|
|--
#turbo 40
#define INI_FILE buffs.ini
#include MQ2Cast_Spell_Routines.inc
#Event Buffs "[MQ2] buffs#*#"
Sub Init_Buffs
/declare SelfOnly bool outer false
/declare PetOnly bool outer false
/declare DoRefresh bool outer false
/declare ZoneOutdoors int outer
/declare ZoneLevitate int outer
/return
Sub Event_Buffs(string BuffLine)
/varset BuffLine ${BuffLine.Right[-5]}
/varset SelfOnly false
/varset PetOnly false
/varset DoRefresh false
/varset ZoneOutdoors ${Ini[INI_FILE, ZoneInfo, ${Zone.ShortName}_Outdoors, -1]}
/varset ZoneLevitate ${Ini[INI_FILE, ZoneInfo, ${Zone.ShortName}_Levitate, -1]}
/if (${ZoneOutdoors} == -1) {
/echo FIXME: Zone ${Zone.ShortName} data missing in INI
/ini INI_FILE "ZoneInfo" "${Zone.ShortName}_Outdoors" "???"
/ini INI_FILE "ZoneInfo" "${Zone.ShortName}_Levitate" "???"
/return
}
/if (${BuffLine.Find[1]}||${BuffLine.Find[self]}||!${Me.Pet.ID}) /varset SelfOnly true
/if (${BuffLine.Find[2]}||${BuffLine.Find[pet]}) /varset PetOnly true
/if (${BuffLine.Find[refresh]}) /varset DoRefresh true
/if (${SelfOnly}) {
/echo -Buffing self only.
/call SelfBuffs
} else /if (${PetOnly}) {
/if (!${Me.Pet.ID}) {
/echo -No pet available to buff.
/return
}
/echo -Buffing pet only.
/call PetBuffs
} else {
/echo -Buffing both.
/call SelfBuffs
/call PetBuffs
}
/echo -Buffs complete.
/return
Sub SelfBuffs
/declare NumberOfBuffs int local ${Ini[INI_FILE, ${Me.Name}, SelfBuffCount, NOT_FOUND]}
/declare MyBuffs[${NumberOfBuffs}] string local
/declare n int local
/for n 1 to ${NumberOfBuffs}
/varset MyBuffs[${n}] ${Ini[INI_FILE, ${Me.Name}, SelfBuff${n}, NOT_FOUND]}
/next n
/declare b int local 1
/for b 1 to ${NumberOfBuffs}
/if (${Me.FreeBuffSlots}<1) {
/echo -Buff slots full.
/return
}
/if (${DoRefresh}||(!${Me.Buff[${MyBuffs[${b}]}].ID}&&${Spell[${MyBuffs[${b}]}].Stacks})||(${Me.Buff[${MyBuffs[${b}]}].ID}&&${Spell[${MyBuffs[${b}]}].Duration}*.2>${Me.Buff[${MyBuffs[${b}]}].Duration}&&${Me.Buff[${MyBuffs[${b}]}].Duration}<100)) {
/if (${Select[${MyBuffs[${b}]},Spirit of Wolf,Spirit of Eagle,Flight of Eagles]}&&!${ZoneOutdoors}) {
/echo -Cannot cast ${MyBuffs[${b}]} inside.
/next b
}
/if (${Select[${MyBuffs[${b}]},Spirit of Eagle,Flight of Eagles,Levitate,Levitation,Dead Man Floating,Dead Men Floating]}&&!${ZoneLevitate}) {
/echo -Cannot cast ${MyBuffs[${b}]} here.
/next b
}
/target myself
/call MQ2Cast "${MyBuffs[${b}]}" gem6 NULL -maxtries|6
/doevents
}
/next b
/return
Sub PetBuffs
/declare NumberOfPetBuffs int local ${Ini[INI_FILE, ${Me.Name}, PetBuffCount, NOT_FOUND]}
/declare PetBuffs[${NumberOfPetBuffs}] string local
/declare n int local
/for n 1 to ${NumberOfPetBuffs}
/varset PetBuffs[${n}] ${Ini[INI_FILE, ${Me.Name}, PetBuff${n}, NOT_FOUND]}
/next n
/declare b int local
/for b 1 to ${NumberOfPetBuffs}
/if (${DoRefresh}||(!${Me.PetBuff[${PetBuffs[${b}]}]}&&${Spell[${PetBuffs[${b}]}].StacksPet})) {
/if (${Select[${PetBuffs[${b}]},Spirit of Wolf,Spirit of Eagle,Flight of Eagles]}&&!${ZoneOutdoors}) {
/echo -Cannot cast ${PetBuffs[${b}]} inside.
/next b
}
/if (${Select[${PetBuffs[${b}]},Spirit of Eagle,Flight of Eagles,Levitate,Levitation,Dead Man Floating,Dead Men Floating]}&&!${ZoneLevitate}) {
/echo -Cannot cast ${MyBuffs[${b}]} here.
/next b
}
/target ${Me.Pet.Name}
/call MQ2Cast "${PetBuffs[${b}]}" gem6 NULL -maxtries|6
/doevents
}
/next b
/return
Here's an example INI build in your Buffs.ini
Code: Select all
[Bigbadmage]
SelfBuffCount=3
SelfBuff1=Circle of Magmaskin
SelfBuff2=Phantasmal Warden
SelfBuff3=Prime Shielding
PetBuffCount=1
PetBuff1=Burnout VI
;use ${Zone.ShortName}
;dont bother with mount entry on indoors zones
;NoMount=0 default on outdoor zones, only specify if its 1
;fix-only list indoor and no-levi zones
[ZoneInfo]
Provinggrounds_Outdoors=1
Provinggrounds_Levitate=0
Provinggrounds_NoMount=1
Lavastorm_Outdoors=1
Lavastorm_Levitate=1
delveb_70_Outdoors=0
delveb_70_Levitate=1
PoKnowledge_Outdoors=1
PoKnowledge_Levitate=1
See the Krust macro files for all the [ZoneInfo]:
http://macroquest2.com/phpBB2/viewtopic.php?t=13016