function RefreshPower()
{
declare tempvar int local
declare MemberLowestPower int local
;Check Main Tanks power and Mana Cloak if < 80
if ${Actor[${MainTankID}].Power}<80 && ${Me.InCombat}
call CastSpellRange 354 0 0 0 ${Actor[PC,ExactName,${MainTankPC}].ID}
;Transference line out of Combat
if ${Me.ToActor.Health}>50 && ${Me.ToActor.Power}<50 && !${Me.InCombat}
call CastSpellRange 309
;Transference Line in Combat
if ${Me.ToActor.Health}>60 && ${Me.ToActor.Power}<45 && ${Me.InCombat}
call CastSpellRange 309
if ${Me.Group}
{
tempvar:Set[1]
MemberLowestPower:Set[0]
do
{
if ${Me.Group[${tempvar}].ToActor.Power}<100 && ${Me.Group[${tempvar}].ToActor.Distance}<30 && ${Me.Group[${tempvar}].ToActor(exists)}
{
if ${Me.Group[${tempvar}].ToActor.Power}<=${Me.Group[${MemberLowestPower}].ToActor.Power}
MemberLowestPower:Set[${tempvar}]
}
}
while ${tempvar:Inc}<=${Me.GroupCount}
}
;Channel if group member is below 30 and we are in combat and manaflow isnt ready and it isn't the MT
if ${Me.Grouped} && ${Me.InCombat} && ${Me.Group[${MemberLowestPower}].ToActor.Power}<30 && ${Me.Group[${MemberLowestPower}].ToActor.Distance}<30
{
if ${Me.Group[${MemberLowestPower}].ToActor.ID}!=${Actor[pc,ExactName,${MainTankPC}].ID} && !${Me.Ability[${SpellType[310]}].IsReady}
call CastSpellRange 310 0 0 0 ${Me.ID}
}
;;;; Mana Flow
if ${Me.Grouped} && ${Me.Group[${MemberLowestPower}].ToActor.Power}<60 && ${Me.Group[${MemberLowestPower}].ToActor.Distance}<30
call CastSpellRange 390 0 0 0 ${Me.Group[${MemberLowestPower}].ToActor.ID}
;;;; Canabalize Thoughts
;if ${Me.Grouped} && ${Me.InCombat} && ${Me.Group[${MemberLowestPower}].ToActor.Power}<90
;call CastSpellRange 51 0 0 0 ${KillTarget}
call CommonPower
}