|Buff start
#chat bc
#chat EQBC
#event EQBC "<#1#> #2#"
#event EQBC "[#1#(msg)] #2#"
#event CastSpell "#1# tells the group#*#, '#2# on #3#'"
#event CastSpell "#1# tells the group#*#, '#2#'"
#event CastSpell "#1# tells the fellowship#*#, '#2# on #3#'"
#event CastSpell "#1# tells the fellowship#*#, '#2#'"
#event CastSpell "#1# tells you#*#, '#2# on #3#'"
#event CastSpell "#1# tells you#*#, '#2#'"
#event CastSpell "#1# told you, '#2#'"
#event CastSpell "#1# told you, '#2# on #3#'"
#event InvisOn "#*#invison#*#"
#event InvisUndeadOn "#*#ivuon#*#"
#event InvisOff "#*#invisoff#*#"
#event LevitateOn "#*#levon#*#"
#event LevitateOff "#*#levoff#*#"
#event BuffWornOff "Your #1# spell has worn off of #2#."
Sub BuffLoad
/varset CurrentSub Buff
/if (!${Defined[BuffLoaded]}) /declare BuffLoaded bool outer FALSE
/if (${BuffLoaded}) /return
/call Debug 3 "Entering ${CurrentSub}Load"
/varset BuffLoaded TRUE
/declare i int local 3
/declare b int local
/declare x string local
|** Changed to if/then/else because it can't be all of them. **|
/if (${Select[${Me.Class.ShortName},SHD,MNK,ROG,BER,WAR,NEC]}) {
/varset i 1
} else /if (${Select[${Me.Class.ShortName},SHM,PAL,BST,MAG]}) {
/varset i 7
} else /if (${Select[${Me.Class.ShortName},RNG,CLR,ENC]}) {
/varset i 10
} else /if (${Select[${Me.Class.ShortName},BRD]}) {
/varset i 1
}
/if (!${Defined[BuffXTargets]}) /declare BuffXTargets bool outer ${Ini[MyIni,Buff,BuffXTargets,FALSE]}
/if (!${BuffXTargets}) /mmoini "MyIni" "Buff" "BuffXTargets" "FALSE"
/if (!${Defined[BuffPets]}) /declare BuffPets bool outer ${Ini[MyIni,Buff,BuffPets,FALSE]}
/if (!${BuffPets}) /mmoini "MyIni" "Buff" "BuffPets" "FALSE"
/if (!${Defined[AutoInvis]}) /declare AutoInvis bool outer ${Ini[MyIni,Buff,AutoInvis,FALSE]}
/if (!${AutoInvis}) /mmoini "MyIni" "Buff" "AutoInvis" "FALSE"
/if (!${Defined[AutoBreakInvis]}) /declare AutoBreakInvis bool outer ${Ini[MyIni,Buff,AutoBreakInvis,FALSE]}
/if (!${AutoBreakInvis}) /mmoini "MyIni" "Buff" "AutoBreakInvis" "FALSE"
/varset tempsubtotal ${Ini[MyIni,${CurrentSub},${CurrentSub}Total]}
/if (${NeedLoad} && !${tempsubtotal}) {
/for b 1 to ${AAInvis.Count[|]}
/if (${Me.AltAbility[${AAInvis.Arg[${b},|]}]} && !${Spell[${x}].TargetType.Find[group]}) /varset x ${AAInvis.Arg[${b},|]}
/next b
/if (${x.Length}) /mmoini "MyIni" "${CurrentSub}" "InvisSpell" "${x}"
/if (${x.Length}) /mmoini "MyIni" "${CurrentSub}" "InvisSpellGem" "alt"
/if (!${x.Length}) /mmoini "MyIni" "${CurrentSub}" "InvisSpell"
/if (!${x.Length}) /mmoini "MyIni" "${CurrentSub}" "InvisSpellGem"
/varset x
/for b 1 to ${AAInvisUndead.Count[|]}
/if (${Me.AltAbility[${AAInvisUndead.Arg[${b},|]}]} && !${Spell[${x}].TargetType.Find[group]}) /varset x ${AAInvisUndead.Arg[${b},|]}
/next b
/if (${x.Length}) /mmoini "MyIni" "${CurrentSub}" "InvisUndeadSpell" "${x}"
/if (${x.Length}) /mmoini "MyIni" "${CurrentSub}" "InvisUndeadSpellGem" "alt"
/if (!${x.Length}) /mmoini "MyIni" "${CurrentSub}" "InvisUndeadSpell"
/if (!${x.Length}) /mmoini "MyIni" "${CurrentSub}" "InvisUndeadSpellGem"
/varset x
/for b 1 to ${AALevitate.Count[|]}
/if (${Me.AltAbility[${AALevitate.Arg[${b},|]}]} && !${Spell[${x}].TargetType.Find[group]}) /varset x ${AALevitate.Arg[${b},|]}
/next b
/if (${x.Length}) /mmoini "MyIni" "${CurrentSub}" "LevitateSpell" "${x}"
/if (${x.Length}) /mmoini "MyIni" "${CurrentSub}" "LevitateSpellGem" "alt"
/if (!${x.Length}) /mmoini "MyIni" "${CurrentSub}" "LevitateSpell"
/if (!${x.Length}) /mmoini "MyIni" "${CurrentSub}" "LevitateSpellGem"
/call SpellLoad "${CurrentSub}" ${i} "|1|3|4|5|6|25|24|30|" "|0|TRUE|PH|PH|PH|PH|BER,BRD,BST,CLR,DRU,ENC,MAG,MNK,NEC,PAL,RNG,ROG,SHD,SHM,WAR,WIZ|PH|"
}
/call SpellLoad2 "${CurrentSub}" "3|4|5|6|25|24|30|"
/declare BuffArray[50,2] string outer 0
/declare BuffQueueString string outer
/declare BuffTimerString string outer
/declare MyBuffString string outer
/declare TargetBuff[45,5] string outer
/declare TargetBuffCount int outer
/declare UnknownBuff bool outer
/declare BuffParsePH string outer
/declare MyBuffCount int outer
/declare MyBuff[50,4] string outer
/for i 1 to ${BuffTotal}
/declare BuffType${i} string outer
/if (!${Defined[BuffSpellIcon${i}]}) /declare BuffSpellIcon${i} string outer
/call BuffParse "${BuffSpellIcon${i}}" ${i}
/varset BuffQueueString ${BuffQueueString}${BuffSpellIcon${i}}|
/next i
/if (!${Defined[BuffCheckTimer]}) /declare BuffCheckTimer timer outer 1s
/if (!${Defined[BuffString1]}) /declare BuffString1 string outer
/if (!${Defined[BuffString2]}) /declare BuffString2 string outer
/if (!${Defined[BuffTimerString]}) /declare BuffTimerString string outer
/if (!${Defined[iTargetBuff]}) /declare iTargetBuff int outer
/if (!${Defined[InitialBuffList]}) /declare InitialBuffList string outer
/if (!${Defined[ChatSenderHold]}) /declare ChatSenderHold string outer
/if (!${Defined[SpellHold]}) /declare SpellHold string outer
/if (!${Defined[timehold]}) /declare timehold timer outer
/if (!${Defined[InvisSpell]}) /declare InvisSpell string outer ${Ini[MyIni,${CurrentSub},InvisSpell]}
/if (!${Defined[InvisSpellGem]}) /declare InvisSpellGem string outer ${Ini[MyIni,${CurrentSub},InvisSpellGem]}
/if (!${Defined[InvisUndeadSpell]}) /declare InvisUndeadSpell string outer ${Ini[MyIni,${CurrentSub},InvisUndeadSpell]}
/if (!${Defined[InvisUndeadSpellGem]}) /declare InvisUndeadSpellGem string outer ${Ini[MyIni,${CurrentSub},InvisUndeadSpellGem]}
/if (!${Defined[LevitateSpell]}) /declare LevitateSpell string outer ${Ini[MyIni,${CurrentSub},LevitateSpell]}
/if (!${Defined[LevitateSpellGem]}) /declare LevitateSpellGem string outer ${Ini[MyIni,${CurrentSub},LevitateSpellGem]}
/if (!${Defined[BuffExtension]}) /declare BuffExtension float outer
|** Convert to if else statement, it can't be both, no need to evaluate both every time. Also adjusted for AugSlot2 and Augslot3 to avoid false negative.**|
|** Was using Depreciated syntax, updated from ${InvSlot[back].AugSlot1} to current **|
|** There was no base case (IE: You have neither aug slot or no back item. This is what was making the timer 0.) **|
|** Added a boolean check to see if the back item had a spell on it to avoid a false positive for lower level characters **|
/if (${Bool[${Me.Inventory[back].Spell}]}) {
/if (${Me.Inventory[back].AugSlot1} == 7 || ${Me.Inventory[back].AugSlot2} == 7 || ${Me.Inventory[back].AugSlot3} == 7) {
/varset BuffExtension 1.26
} else /if (${Me.Inventory[back].AugSlot1} == 8 || ${Me.Inventory[back].AugSlot2} == 8 || ${Me.Inventory[back].AugSlot3} == 8) {
/varset BuffExtension 1.35
}
} else {
/varset BuffExtension 1
}
|** Calculate Spell Casting Reinforcement in reverse order in /if then else statements to reduce total needed parses at higher levels **|
/if (${Me.AltAbility[Spell Casting Reinforcement]}>=28) {
/varcalc BuffExtension ${BuffExtension}+.20
} else /if (${Me.AltAbility[Spell Casting Reinforcement]}>=20) {
/varcalc BuffExtension ${BuffExtension}+.20
} else /if (${Me.AltAbility[Spell Casting Reinforcement]}>=12) {
/varcalc BuffExtension ${BuffExtension}+.15
} else /if (${Me.AltAbility[Spell Casting Reinforcement]}>=6) {
/varcalc BuffExtension ${BuffExtension}+.10
} else /if (${Me.AltAbility[Spell Casting Reinforcement]}>=2) {
/varcalc BuffExtension ${BuffExtension}+.05
}
/call Debug 3 "Leaving ${CurrentSub}Load"
/return
Sub Buff
/varset CurrentSub Buff
/call Debug 3 "Entering Sub ${CurrentSub} The real one."
/if (!${Defined[${CurrentSub}Loaded]}) {
/call Debug 3 "${CurrentSub}Loaded not defined, calling BuffLoad"
/call BuffLoad
}
/declare i int local
/declare b int local
/if (!${BuffTotal}||${Me.Hovering}||${Window[tradewnd].Open}||${Window[lootwnd].Open}) /return
/if (${${CurrentSub}Conditions.NotEqual[123456]}) /varset ${CurrentSub}Conditions ${Ini[MyIni,${CurrentSub},${CurrentSub}Conditions,123456]}
/if (!${${CurrentSub}Conditions}) /return
/for b 1 to ${BuffTotal}
/if (!${BuffUse${b}}) /goto :skipbuff
/if (${BuffConditions${b}.NotEqual[123456]}) /varset BuffConditions${b} ${Ini[MyIni,Buff,BuffConditions${b},1]}
/if (!${Defined[${Me.ID}_Buff${b}]}) /declare ${Me.ID}_Buff${b} timer outer 0
/if (!${${Me.ID}_Buff${b}} && ${BuffClasses${b}.Find[${Me.Class.ShortName}]} && (${BuffConditions${b}})) /call BuffQueue ${Me.ID} ${b}
/if (${BuffPets} && ${Me.Pet.ID} && ${BuffClasses${b}.Find[${Me.Pet.Class.ShortName}]} && ${Spawn[${Me.Pet.ID}].Distance}<=100 && (${BuffConditions${b}})) /call BuffQueue ${Me.Pet.ID} ${b}
/if (!${Group}) /goto :skipgroup
/for i 1 to ${Group}
/if (!${Defined[${Group.Member[${i}].ID}_Buff${b}]}) /declare ${Group.Member[${i}].ID}_Buff${b} timer outer 0
/if (!${${Group.Member[${i}].ID}_Buff${b}} && ${BuffClasses${b}.Find[${Group.Member[${i}].Class.ShortName}]} && ${Spawn[${Group.Member[${i}].ID}].Distance}<=100 && (${BuffConditions${b}})) /call BuffQueue ${Group.Member[${i}].ID} ${b}
/if (!${Defined[${Group.Member[${i}].Pet.ID}_Buff${b}]}) /declare ${Group.Member[${i}].Pet.ID}_Buff${b} timer outer 0
/if (${BuffPets} && !${Group.Member[${i}].Pet.Name.Find[Familiar]} && !${Group.Member[${i}].Pet.Name.Find[_pet]} && ${Group.Member[${i}].Pet.ID} && !${${Group.Member[${i}].Pet.ID}_Buff${b}} && ${BuffClasses${b}.Find[${Group.Member[${i}].Pet.Class.ShortName}]} && ${Spawn[${Group.Member[${i}].Pet.ID}].Distance}<=100 && (${BuffConditions${b}})) /call BuffQueue ${Group.Member[${i}].Pet.ID} ${b}
/next i
:skipgroup
/if (!${BuffConditions${b}}) /goto :skipbuff
/for i 2 to ${XTarget.Max}
/if (!${Defined[${Me.XTarget[${i}].ID}_Buff${b}]}) /declare ${Me.XTarget[${i}].ID}_Buff${b} timer outer 0
/if (${BuffXTargets}) {
/if (${Me.XTarget[${i}].ID}) {
/if (!${${Me.XTarget[${i}].ID}_Buff${b}} && (${Select[${Spawn[${Me.XTarget[${i}].ID}].Type},pc,mercenary]}||${Spawn[${Me.XTarget[${i}].ID}].Master.Type.Equal[pc]}) && ${Spawn[${Me.XTarget[${i}].ID}].Distance}<=100 && ${Me.XTarget[${i}].Type.NotEqual[auto hater]} && ${BuffClasses${b}.Find[${Me.XTarget[${i}].Class.ShortName}]} && (${BuffConditions${b}})) /call BuffQueue ${Me.XTarget[${i}].ID} ${b}
}
}
/next i
:skipbuff
/next b
/for i 1 to 50
/if (!${Defined[${BuffArray[${i},1]}_Buff${BuffArray[${i},2]}]}) /declare ${BuffArray[${i},1]}_Buff${BuffArray[${i},2]} timer outer 0
/if (${${BuffArray[${i},1]}_Buff${BuffArray[${i},2]}}) {
/varset BuffArray[${i},1] 0
/varset BuffArray[${i},2] 0
}
/if (${Me.CombatState.Equal[COMBAT]}||${AddCount}) /return
/if (${Spawn[${BuffArray[${i},1]}].ID} && ${Spawn[${BuffArray[${i},1]}].Distance}<100) {
/call Debug 3 "/call BuffList "${BuffArray[${i},1]}" "${BuffArray[${i},2]}""
/call BuffList "${BuffArray[${i},1]}" "${BuffArray[${i},2]}"
}
/next i
/call Debug 3 "Leaving Sub ${CurrentSub}"
/return
Sub BuffList(int TNameID, int iB)
/varset CurrentSub BuffList
/call Debug 3 "Entering Sub ${CurrentSub}"
/call BuffCheck ${TNameID}
/declare i int local
/if (${Me.Book[${BuffSpellName${iB}}]} && !${If[${Me.SpellReady[${BuffSpellName${iB}}]},TRUE,FALSE]} && ${BuffSpellGem${iB}.Find[gem]}) {
/memorize "${BuffSpellName${iB}}" "${BuffSpellGem${iB}}"
:gemwait
/doevents
/if (${Me.CombatState.Equal[COMBAT]}||${AddCount}) /return
/delay 2
/if (!${Me.SpellReady[${BuffSpellName${iB}}]}) /goto :gemwait
}
/if ((${Me.SpellReady[${BuffSpellName${iB}}]}||${Me.AltAbilityReady[${BuffSpellName${iB}}]}||${FindItem[${BuffSpellName${iB}}].ItemSlot} && !${FindItem[${BuffSpellName${iB}}].Timer}) && !${${TNameID}_Buff${iB}}) {
/if (${Spawn[id ${TNameID}].Type.Equal[corpse]}) /return
/if (${Spawn[id ${TNameID}].ID}) /squelch /tar id ${TNameID}
/delay 1s ${Target.ID}==${TNameID}
/call ${EchoSub} "${Pink} ${BuffSpellName${iB}} --> ${White} ${Target.CleanName}"
/if (${Verbose} && ${MyChannel.NotEqual[NULL]}) /docommand /${MyChannel} ${BuffSpellName${iB}} --> ${Target.CleanName}
/if (!${Defined[BuffListAnnounce]}) /declare BuffListAnnounce bool outer FALSE
/if (${BuffListAnnounce} && ${AnnounceChannel.NotEqual[NULL]}) /docommand /${AnnounceChannel} ${BuffSpellName${iB}} --> ${Target.CleanName}
/if (${Spell[${BuffSpellName${iB}}].TargetType.Find[group]} && ${Me.AltAbilityReady[Tranquil Blessings]} && (${Me.CombatState.Equal[Active]}||${Me.CombatState.Equal[RESTING]})) /alt act ${Me.AltAbility[Tranquil Blessings].ID}
/call Cast "${BuffSpellName${iB}}" "${BuffSpellGem${iB}}" 0 CheckStuff
/delay 30s !${Me.Casting.ID}
/if (!${Defined[${TNameID}_Buff${iB}]}) {
/declare ${TNameID}_Buff${iB} timer outer
/call Debug 3 "Defined a new timer for ${TNameID}_Buff${iB} for ${${TNameID}_Buff${iB}}"
}
/if (${Macro.Return.Equal[CAST_NOTHOLD]}||${Macro.Return.Equal[CAST_SUCCESS]}) {
/if (!${Defined[${TNameID}_Buff${iB}]}) /declare ${TNameID}_Buff${iB} timer outer
/varset ${TNameID}_Buff${iB} ${Spell[${BuffSpellName${iB}}].Duration}s
/varset ${TNameID}_Buff${iB} ${Math.Calc[${Spell[${BuffSpellIcon${iB}}].Duration}*60*${BuffExtension}].Int}
/call Debug 3 "${Math.Calc[${${TNameID}_Buff${iB}}/10/60].Int} Minute timer set."
/if (${Spell[${BuffSpellName${iB}}].TargetType.Find[group]} && (${SpawnCount[group ${Target.CleanName}]}||!${Target.ID})) {
/for i 0 to ${Group}
/if (${Group.Member[${i}].Distance}<${Spell[${BuffSpellName${iB}}].AERange}) {
/if (!${Defined[${Group.Member[${i}].ID}_Buff${iB}]}) /declare ${Group.Member[${i}].ID}_Buff${iB} timer outer
/varset ${Group.Member[${i}].ID}_Buff${iB} ${Math.Calc[${Spell[${BuffSpellIcon${iB}}].Duration}*60*${BuffExtension}].Int}
}
/next i
}
}
/call Debug 3 "Leaving Sub ${CurrentSub}"
/call BuffCheck ${TNameID}
}
/return
Sub BuffQueue(buffid,buffnum)
/call Debug 3 "Entering Sub BuffQueue"
/varset CurrentSub BuffQueue
/if (!${Defined[${buffid}BuffCheck]}) {
/call Debug 3 "${buffid}BuffCheck undefined, calling BuffCheck on buffid ${buffid}"
/call BuffCheck ${buffid}
}
/call Debug 3 "BuffQueue ${Spawn[${buffid}]} - ${BuffSpellIcon${buffnum}}"
/declare i int local
/declare j int local
/for i 1 to 50
/if (!${Defined[${BuffArray[${i},1]}_${BuffArray[${i},2]}]}) /declare ${BuffArray[${i},1]}_${BuffArray[${i},2]} timer outer 0
/if (${${BuffArray[${i},1]}_${BuffArray[${i},2]}}) {
/if (${Defined[${BuffArray[${i},1]}_Buff${BuffArray[${i},2]}]}) {
/call BuffList ${BuffArray[${i},1]} ${BuffArray[${i},2]}
}
/call Debug 3 "BuffQueue Removing ${Spawn[${BuffArray[${i},1]}]} ${BuffSpellName${BuffArray[${i},2]}} from BuffQueue"
/varset BuffArray[${i},1] 0
/varset BuffArray[${i},2] 0
}
/if (${BuffArray[${i},1].Equal[${buffid}]} && ${BuffArray[${i},2].Equal[${buffnum}]}) /goto :skipq
/if (${BuffArray[${i},1].Equal[0]} && !${j}) /varset j ${i}
/next i
/varset BuffArray[${j},1] ${buffid}
/varset BuffArray[${j},2] ${buffnum}
:skipq
/call Debug 3 "Leaving BuffQueue"
/return
Sub BuffCheck(int iID)
/call Debug 3 "Entering Sub BuffCheck - iID: ${iID}"
/call Debug 3 "Checking Buff for ${Spawn[${iID}]}"
/varset CurrentSub BuffCheck
/if (!${Defined[${iID}BuffCheck]}) /declare ${iID}BuffCheck int outer 1
/declare x int local
/declare t int local
/declare d int local
/declare b int local
/declare q int local
/declare i int local
/squelch /tar id ${iID}
/delay 1s ${Target.ID}==${iID}
/delay 1s
/declare z int
/for z 1 to 45
/varset TargetBuffCount 0
/if (${Target.BuffDuration[${z}]}) /call BuffParse "${Target.Buff[${z}].Name.Arg[1,Rk.]}"
/for q 1 to ${BuffTotal}
/if (${BuffSpellIcon${q}.Find[${Target.Buff[${z}].Name.Arg[1,Rk.]}]}||${BuffType${q}.Find[${TargetBuff[${x},2]}]}) {
/if (!${Defined[${iID}_Buff${q}]}) /declare ${iID}_Buff${q} timer outer
/varset ${iID}_Buff${q} ${Math.Calc[6*${Target.BuffDuration[${z}]}].Int}
}
/next q
/next z
|** I'm trying to wrap my head about this, but I'm not understanding the point of it ~Chatwiththisname~
** 40oz: not sure, looks like a way to setup timers to hand out buffs,
** but if the timer is never set to a time, it will never do anything
**|
/for i 1 to ${BuffTotal}
/for x 1 to ${BuffType${i}.Count[|]}
/if (${${Target.ID}BuffString.Find[${BuffType${i}.Arg[${x},|]}]}) /goto :skip
/next x
/if (!${Defined[${Target.ID}_Buff${i}]}) /declare ${Target.ID}_Buff${i} timer outer
|/echo ${Target} needs ${BuffSpellIcon${i}}
:skip
/next i
/return
Sub BuffParse(buffname,int mybuff)
/varset CurrentSub BuffParse
/call Debug 3 "Entering Sub ${CurrentSub}"
/declare i int local
/declare icon int local
/varset BuffParsePH ${buffname}
/varset UnknownBuff TRUE
/if (!${Defined[${Target.ID}BuffString]}) /declare ${Target.ID}BuffString string outer
/if (${Spell[${buffname}].Slot[1].Find[Increase Max Hitpoints]}) /call BuffArray Shielding ${Spell[${buffname}].Icon} 1 ${mybuff}
/if (${Spell[${buffname}].Slot[2].Find[Increase Max Hitpoints]}) /call BuffArray ACHP ${Spell[${buffname}].Icon} 2 ${mybuff}
/if (${Spell[${buffname}].Slot[3].Find[Increase Max Hitpoints]}) /call BuffArray Symbol ${Spell[${buffname}].Icon} 3 ${mybuff}
/if (${Spell[${buffname}].Slot[4].Find[Increase Max Hitpoints]}) /call BuffArray HybridHP ${Spell[${buffname}].Icon} 4 ${mybuff}
/if (${Spell[${buffname}].Slot[5].Find[Increase Attack Speed]}) /call BuffArray Haste ${Spell[${buffname}].Icon} 2 ${mybuff}
/if (${Spell[${buffname}].Slot[1].Find[Increase Attack Speed]}) /call BuffArray Haste2 ${Spell[${buffname}].Icon} 1 ${mybuff}
/if (${Spell[${buffname}].Slot[2].Find[Increase Mana by]}) /call BuffArray Clarity ${Spell[${buffname}].Icon} 2 ${mybuff}
/if (${Spell[${buffname}].Slot[1].Find[Increase Hitpoints by]} && ${Spell[${buffname}].Slot[1].Find[per tick]}) /call BuffArray Regen ${Spell[${buffname}].Icon} 1 ${mybuff}
/if (${Spell[${buffname}].Slot[2].Find[Increase ATK by ]}) /call BuffArray Attack ${Spell[${buffname}].Icon} 2 ${mybuff}
/if (${Spell[${buffname}].Slot[2].Find[Increase AC by ]}) /call BuffArray AC1 ${Spell[${buffname}].Icon} 2 ${mybuff}
/if (${Spell[${buffname}].Slot[3].Find[Increase AC by ]}) /call BuffArray AC2 ${Spell[${buffname}].Icon} 3 ${mybuff}
/if (${Spell[${buffname}].Slot[1].Find[Increase Damage Shield by ]}) /call BuffArray DS1 ${Spell[${buffname}].Icon} 1 ${mybuff}
/if (${Spell[${buffname}].Slot[2].Find[Increase Damage Shield by ]}) /call BuffArray DS2 ${Spell[${buffname}].Icon} 2 ${mybuff}
/if (${Spell[${buffname}].Slot[1].Find[Mitigate Melee Damage by ]}) /call BuffArray Mitigate ${Spell[${buffname}].Icon} 1 ${mybuff}
/if (${UnknownBuff} && ${mybuff}) /call BuffArray Unknown ${Spell[${buffname}].Icon} 0 ${mybuff}
/return
Sub BuffArray(buffarrayname,int buffarrayicon,int buffarrayslot,int myarraybuff)
/varset CurrentSub BuffArray
/call Debug 3 "Entering Sub ${CurrentSub}"
/varset UnknownBuff FALSE
/if (!${myarraybuff}) {
/if (!${Defined[${Target.ID}_${Spell[${BuffParsePH}].ID}]}) /declare ${Target.ID}_${Spell[${BuffParsePH}].ID} string outer
/varset ${Target.ID}_${Spell[${BuffParsePH}].ID} ${${Target.ID}_${Spell[${BuffParsePH}].ID}}${buffarrayname}|
/varset ${Target.ID}BuffString ${${Target.ID}BuffString}${buffarrayname}|
/varcalc TargetBuffCount ${TargetBuffCount}+1
/varset TargetBuff[${TargetBuffCount},1] ${Target.CleanName}
/varset TargetBuff[${TargetBuffCount},2] ${buffarrayname}
/varset TargetBuff[${TargetBuffCount},3] ${buffarrayicon}
/varset TargetBuff[${TargetBuffCount},4] ${buffarrayslot}
/varset TargetBuff[${TargetBuffCount},5] ${BuffParsePH}
}
/if (${myarraybuff}) {
/varset MyBuffString ${MyBuffString}${buffarrayname}|
/varcalc MyBuffCount ${MyBuffCount}+1
/varset MyBuff[${MyBuffCount},1] ${BuffSpellIcon${myarraybuff}}
/varset MyBuff[${MyBuffCount},2] ${buffarrayname}
/varset MyBuff[${MyBuffCount},3] ${buffarrayicon}
/varset MyBuff[${MyBuffCount},4] ${buffarrayslot}
/varset BuffType${myarraybuff} ${BuffType${myarraybuff}}${buffarrayname}|
}
/return
Sub Event_BuffWornOff(Line,string SpellWornOff,string ChatSender)
/if (!${Defined[BuffLoaded]}) /call BuffLoad
/varset ChatSenderHold ${Spawn[${ChatSender}].CleanName.Replace[ ,]}
/varset SpellHold ${SpellWornOff}
/declare b int local
/declare bf int local
/for b 1 to ${BuffTotal}
/if (${SpellHold.Find[${BuffSpellIcon${b}}]}||${SpellHold.Find[${BuffSpellName${b}}]}) {
/varset bf ${b}
/goto :buffdetected
}
/next b
/if (!${bf}) /return
:buffdetected
/if (!${Defined[${Spawn[${ChatSender}].ID}_Buff${bf}]}) /declare ${Spawn[${ChatSender}].ID}_Buff${bf} timer outer
/varset ${Spawn[${ChatSender}].ID}_Buff${bf} 0
/return
Sub Event_EQBC(EQBCSay,EQBCSender,EQBCCommand)
/if (!${Defined[BuffLoaded]}) /call BuffLoad
/if (${EQBCCommand.Left[2].Equal[//]}) /return
/if (${EQBCCommand.Left[1].Equal[/]}) {
/docommand ${EQBCCommand}
} else {
/call Event_Chat "EQBC" "${EQBCSender}" "${EQBCCommand}"
}
/return
Sub Event_CastSpell(string line,string ChatSender,string SName,string TName)
/if (!${Defined[BuffLoaded]}) /call BuffLoad
/varset ChatSenderHold ${ChatSender}
/if (${ChatSender.Left[1].Compare[ ]} < 0) /varset ChatSenderHold ${ChatSender.Right[-2].Left[-1]}
/if (!${AuthorizedUsers.Find[${ChatSenderHold}]} && ${AuthorizedUsers.NotEqual[NULL]} && !${Select[${Spawn[${ChatSender}].Type},mercenary,pet]}) {
/echo ${ChatSender} not found on [Settings] AuthorizedUsers list. Ignoring request.
/return
}
/if (${SName.Equal[ivuon]}) {
/call Event_InvisUndeadOn
/return
}
/if (${SName.Equal[invison]}) {
/call Event_InvisOn
/return
}
/if (${SName.Equal[invisoff]}) {
/call Event_InvisOff
/return
}
/if (${SName.Equal[levon]}) {
/call Event_LevitateOn
/return
}
/if (${SName.Equal[levoff]}) {
/call Event_LevitateOff
/return
}
/if (${SName.Equal[${MoveUpCommand}]}) {
/call Event_Follow "${ChatSenderHold}" "1"
/return
}
/if (${SName.Equal[${StopFollowCommand}]}) {
/call Event_StopFollow "${ChatSenderHold}"
/return
}
/if (${SName.Equal[${FollowCommand}]}) {
/call Event_Follow "${ChatSenderHold}" "0"
/return
}
/declare b int local
/for b 1 to ${BuffTotal}
/if (${BuffAlias${b}.Find[|${SName}|]}) {
/if (${TName.Length}) {
/if (${SpawnCount[pc ${TName}]}) /call BuffList "${Spawn[pc ${TName}].ID}" "${b}"
/if (!${SpawnCount[pc ${TName}]}) /call BuffList "${Spawn[${TName}].ID}" "${b}"
} else {
/if (!${line.Find[ on ]}) {
/if (${SpawnCount[pc ${ChatSenderHold}]}) /call BuffList "${Spawn[pc ${ChatSenderHold}].ID}" "${b}"
/if (!${SpawnCount[pc ${ChatSenderHold}]}) /call BuffList "${Spawn[${ChatSenderHold}].ID}" "${b}"
}
/if (${SpawnCount[pc ${ChatSenderHold}]}) /call BuffCheck ${Spawn[pc ${ChatSenderHold}].ID}
/if (!${SpawnCount[pc ${ChatSenderHold}]}) /call BuffCheck ${Spawn[${ChatSenderHold}].ID}
}
}
/next b
/return
Sub Event_InvisOn
/if (!${Defined[BuffLoaded]}) /call BuffLoad
/if (${Me.Book[${InvisSpell}]} || ${InvisSpellGem.Equal[alt]} && ${Me.AltAbilityReady[${InvisSpell}]} || ${InvisSpellGem.Equal[item]} && !${FindItem[${InvisSpell}].Timer}) {
/if (${Spell[${InvisSpell}].TargetType.Equal[Single]}) {
/squelch /target myself
/delay 3s ${Target.ID}==${Me.ID}
}
/if (${InvisSpellGem.Equal[alt]}) /alt act ${Me.AltAbility[${InvisSpell}].ID}
/if (!${InvisSpellGem.Equal[alt]}) /call Cast "${InvisSpell}" ${InvisSpellGem} 5s
/delay 5
}
/return
Sub Event_InvisUndeadOn
/if (!${Defined[BuffLoaded]}) /call BuffLoad
/if (${Me.Book[${InvisUndeadSpell}]} || ${InvisUndeadSpellGem.Equal[alt]} && ${Me.AltAbilityReady[${InvisUndeadSpell}]} || ${InvisUndeadSpellGem.Equal[item]} && !${FindItem[${InvisUndeadSpell}].Timer}) {
/if (${Spell[${InvisUndeadSpell}].TargetType.Equal[Single]}) {
/squelch /target myself
/delay 3s ${Target.ID}==${Me.ID}
}
/if (${InvisUndeadSpellGem.Equal[alt]}) /alt act ${Me.AltAbility[${InvisUndeadSpell}].ID}
/if (!${InvisUndeadSpellGem.Equal[alt]}) /call Cast "${InvisUndeadSpell}" ${InvisUndeadSpellGem} 5s
/delay 5
}
/return
Sub Event_InvisOff
/if (!${Defined[BuffLoaded]}) /call BuffLoad
/declare invisid int local
/if (${Target.ID}) /varset invisid ${Target.ID}
/squelch /tar clear
/squelch /attack on
/delay 1
/squelch /attack off
/if (${invisid} && ${Spawn[${invisid}.Type.NotEqual[corpse]}) /squelch /tar id ${invisid}
/if (${Me.Buff[Shared Camouflage].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Shared Camouflage].ID}-1].Int} leftmouseup
/if (${Me.Buff[Sun Cloak].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Sun Cloak].ID}-1].Int} leftmouseup
/if (${Me.Buff[Sunskin].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Sunskin].ID}-1].Int} leftmouseup
/if (${Me.Buff[Fool the Fallen].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Fool the Fallen].ID}-1].Int} leftmouseup
/if (${Me.Buff[Cloud of Indifference].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Cloud of Indifference].ID}-1].Int} leftmouseup
/if (${Me.Buff[Perfected Invisibility].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Perfected Invisibility].ID}-1].Int} leftmouseup
/if (${Me.Buff[Perfected Invisibility to Undead].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Perfected Invisibility to Undead].ID}-1].Int} leftmouseup
/if (${Me.Buff[Group Perfected Invisibility].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Group Perfected Invisibility].ID}-1].Int} leftmouseup
/if (${Me.Buff[Group Perfected Invisibility to Undead].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Group Perfected Invisibility to Undead].ID}-1].Int} leftmouseup
/if (${Me.Buff[${InvisSpell}].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[${InvisSpell}].ID}-1].Int} leftmouseup
/if (${Me.Buff[${InvisUndeadSpell}].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[${InvisSpell}].ID}-1].Int} leftmouseup
/if (${Me.Buff[Group Silent Presence].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Group Silent Presence].ID}-1].Int} leftmouseup
/if (${Me.Buff[Silent Presence].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Silent Presence].ID}-1].Int} leftmouseup
/if (${Me.Buff[Cloak of Shadows].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Cloak of Shadows].ID}-1].Int} leftmouseup
/if (${Me.Buff[Invisibility of Group Spirit Walk].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Invisibility of Group Spirit Walk].ID}-1].Int} leftmouseup
/if (${Me.Buff[Invisibility of Spirit Walk].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Invisibility of Spirit Walk].ID}-1].Int} leftmouseup
/if (${Me.Buff[Shauri's Sonorous Clouding].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Shauri's Sonorous Clouding].ID}-1].Int} leftmouseup
/return
Sub Event_LevitateOn
/if (${Me.Book[${LevitateSpell}]} || ${LevitateSpellGem.Equal[alt]} && ${Me.AltAbilityReady[${LevitateSpell}]} || ${LevitateSpellGem.Equal[item]} && !${FindItem[${LevitateSpell}].Timer}) {
/if (${Spell[${LevitateSpell}].TargetType.Equal[Single]}) {
/squelch /target myself
/delay 3s ${Target.ID}==${Me.ID}
}
/if (${LevitateSpellGem.Equal[alt]}) /alt act ${Me.AltAbility[${LevitateSpell}].ID}
/if (!${LevitateSpellGem.Equal[alt]}) /call Cast "${LevitateSpell}" ${LevitateSpellGem} 5s
/delay 5
}
/return
Sub Event_LevitateOff
/if (${Me.Buff[Flight of Eagles].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Flight of Eagles].ID}-1].Int} leftmouseup
/if (${Me.Buff[Spirit of Eagle].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Spirit of Eagle].ID}-1].Int} leftmouseup
/if (${Me.Buff[Levitation].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Levitation].ID}-1].Int} leftmouseup
/if (${Me.Buff[Dead Man Floating].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Dead Man Floating].ID}-1].Int} leftmouseup
/if (${Me.Buff[Perfect Dead Man Floating].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Perfected Dead Man Floating].ID}-1].Int} leftmouseup
/if (${Me.Buff[Perfected Levitation].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Perfected Levitation].ID}-1].Int} leftmouseup
/if (${Me.Buff[Group Perfected Levitation].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Group Perfected Levitation].ID}-1].Int} leftmouseup
/if (${Me.Buff[${LevitateSpell}].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[${LevitateSpell}].ID}-1].Int} leftmouseup
/return
Sub Event_Chat(string ChatType,string ChatSender,string ChatText)
/if (!${Defined[BuffLoaded]}) /call BuffLoad
/declare b int local
/declare i int local
/varset ChatSenderHold ${ChatSender}
/if (${ChatSender.Left[1].Compare[ ]} < 0) /varset ChatSenderHold ${ChatSender.Right[-2].Left[-1]}
/if (!${AuthorizedUsers.Find[${ChatSenderHold}]} && ${AuthorizedUsers.NotEqual[NULL]} && !${Select[${Spawn[${ChatSender}].Type},mercenary,pet]}) {
/echo ${ChatSender} not found on [Settings] AuthorizedUsers list. Ignoring request.
/return
}
/if (${ChatText.Equal[${MoveUpCommand}]}) {
/call Event_Follow "${ChatSender}" "1"
/return
}
/if (${ChatText.Equal[${FollowCommand}]}) {
/call Event_Follow "${ChatSender}" "0"
/return
}
/if (${ChatText.Equal[${StopFollowCommand}]}) {
/call Event_StopFollow "${ChatSender}"
/return
}
/if (!${Spawn[pc ${ChatSender}].ID}) {
/return
}
/if (${BuffTotal} && ${ChatSender.NotEqual[${Me.CleanName}]} && ${Spawn[pc ${ChatSender}].ID}) {
/for b 1 to ${BuffTotal}
/if (${BuffAlias${b}.Find[${ChatText}]}) {
/call BuffList "${Spawn[pc ${ChatSender}].ID}" "${b}"
}
/next b
}
/return
|Buff end