• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Healer.mac Beta (1 Viewer)

Maskoi

old and salty
Joined
Sep 28, 2005
RedCents
82,796¢
** - Beta of Healer.mac v1.1 - POSTED ** 07/05/09

Due to the extensive variable renaming I wanted to post the next version before too many people grabbed ver.1.0. The previous INC file is now obsolete so please use the new ver 1.1. I have added a space into the INC file where I wiil post all all/any new or changed variables so you will not have to completely start over with the spells and custom settings. Any new changes to the inc file you will just be able cut and paste them into the new area, Sorry about the inconvenience if any one started using ver 1.0

Well after about 6 weeks I am finally ready to release the BETA of Healer.mac. Probably works best with clerics level 60+ but should be ok with clerics 39+. Nuke undead and AoE not working so great. This is still a major work in progress but I need to start getting it tested. Post any bugs, etc please. I will write up some help files after the holidays.

Inc settings file and spell_routines.inc in the 2nd post. Enjoy.

Rich (BB code):
| - healer.mac Revised Edition Beta Ver 1.1 07/05/09
| - Revised Edition by Emperor
| - Author: Alatyami NotAddicted.com
| - Original fantum409
| - Major revisions Credits: Crystane
| - This macro made for www.NotAddicted.com
| - Don't steal it or we'll punch your fase!
| - Uses spell_routines.inc
| ------------------------------------------------------------------------------|
#turbo 40

#include spell_routines.inc
#include healer_settings.inc

#event Gift_of_Mana_On		"You have been granted a gift of#*#"
#event Gift_of_Mana_Off		"Your gift of#*#mana fades."
#event Out_of_Food	"You are out of #1#."
#Event Event_Worn_Off		"Your #1# spell has worn off of #2#."
#Event Event_Worn_Off_2		"#*# fades."
#Event Gain_Experience		"You gain#*#experience!#*#"
#Event Hot_on_Inc		"#1# tells you#*#Incoming pull.#*#"
#Event No_Mount    	"#*#You can not summon a mount#*#"
#Event No_Mount     "#*#You can only cast this spell in the outdoors#*#"
#event Gain_Experience		"#*#has been slain#*#"
#Event Zoned 		"LOADING, PLEASE WAIT..."
#Chat Chat
#Chat tell
#Chat group

Sub Main
|----------------------------------------------------------------------------
|   Healing Variables
|----------------------------------------------------------------------------
	/declare complete_heal string outer
	/declare patch_heal string outer
	/declare heal_over_time string outer
	/declare group_heal string outer
	/declare group_heal_use int outer
	/declare remove_curse string outer
	/declare pure_blood string outer
	/declare heal_self_% int outer
	/declare divine_arbitration_interrupt_at_% int outer
	/declare interrupt_heal_self_hp_% int outer
	/declare stop_healing_point_% int outer
	/declare heal_tank_% int outer
	/declare heal_over_time_caster_% int outer
	/declare heal_caster_% int outer
	/declare heal_nec_shm_% int outer
	/declare heal_default_% int outer
    /declare auto_heal_mode int outer
	/declare interrupt_use int outer
	/declare heal_only_while_fd int outer
	/declare interrupt_heal_self int outer
	/declare divine_arbitration_use int outer
	/declare divine_arbitration_heal_% int outer
	/declare divine_arbitration_group_heal_after_use int outer
|----------------------------------------------------------------------------
|   Attack Spell Variables
|----------------------------------------------------------------------------
	/declare hammer_pet 									string outer
		/declare hammer_pet_use 							int outer
		/declare hammer_pet_mob_health_% 					int outer
		/declare hammer_pet_cast_% 							int outer
	/declare reverse_damage_shield  						string outer
		/declare reverse_damage_shield_use 					int outer
		/declare reverse_damage_shield_mob_health_max_% 	int outer
		/declare reverse_damage_shield_mob_health_min_% 	int outer
		/declare reverse_damage_shield_cast_% 				int outer
	/declare direct_damage_magic 							string outer
		/declare direct_damage_magic_use 					int outer
		/declare direct_damage_magic_mob_health_% 			int outer
		/declare direct_damage_magic_cast_% 				int outer
	/declare direct_damage_stun 							string outer
		/declare direct_damage_stun_use 					int outer
		/declare direct_damage_stun_mob_health_% 			int outer
		/declare direct_damage_stun_cast_% 					int outer
	/declare direct_damage_undead 							string outer
		/declare direct_damage_undead_use 					int outer
		/declare direct_damage_undead_mob_health_% 			int outer
		/declare direct_damage_undead_cast_% 				int outer
	/declare direct_damage_AoE 								string outer
	/declare direct_damage_delay 							int outer
	/declare direct_damage_timer 							timer outer
| ----------------------------------------------------------------------------
|   Buff Spell Variables
| ----------------------------------------------------------------------------
	/declare spell_haste_buff string outer
	/declare spell_haste_group_buff string outer
	/declare armor_class_buff string outer
	/declare hit_point_aego_buff string outer
	/declare hit_point_aego_group_buff string outer
	/declare hit_point_symbol_buff string outer
	/declare hit_point_symbol_group_buff string outer
	/declare melee_guard_buff string outer
	/declare melee_guard_group_buff string outer
	/declare healer_buff_use int outer
	/declare healer_rebuff_use int outer 
	/declare healer_rebuff_state int outer
	/declare healer_buff[9] string outer
    /declare TankBufftodo[5] string outer
	/declare clicky_item_use int outer
	/declare clicky_item[5] string outer
	/declare clicky_item_buff[5] string outer
| ----------------------------------------------------------------------------
|  Misc Spells and AA's
| ----------------------------------------------------------------------------
	/declare invulnerability_spell string outer
	/declare yaulp_spell string outer
	/declare aura_spell string outer
	/declare aura_spell_use int outer
	/declare gem_10 string outer
	/declare mount_use int outer
	/declare mount_item_name string outer
	/declare auto_sit int outer
	/declare auto_sit_mob_distance int outer
| ----------------------------------------------------------------------------
|  ChatoMatic Variables
| ----------------------------------------------------------------------------
	/declare announce 									int outer
	/declare my_channel 								string outer
	/declare leave_all_channels_use 					int outer
	/declare say_where 									string outer
	/declare tell_who									string outer
	/declare tank_start_message							string outer
| - Heal Spells
	/declare complete_heal_ChatoMatic 	  				string outer
	/declare patch_heal_ChatoMatic  	  				string outer 
	/declare heal_over_time_ChatoMatic 	  				string outer	 
	/declare group_heal_ChatoMatic  	  				string outer	  
	/declare remove_curse_ChatoMatic  	  				string outer 
	/declare pure_blood_ChatoMatic  	  				string outer
	/declare resurrection_ChatoMatic  	  				string outer	
	/declare divine_arbitration_ChatoMatic  	  		string outer	
| - Attack Spells
	/declare hammer_pet_ChatoMatic 						string outer
	/declare reverse_damage_shield_ChatoMatic 			string outer
	/declare direct_damage_magic_ChatoMatic 			string outer
	/declare direct_damage_stun_ChatoMatic 				string outer
	/declare direct_damage_undead_ChatoMatic 			string outer
| - Buff Spells	
	/declare hit_point_symbol_buff_ChatoMatic 			string outer
	/declare hit_point_symbol_group_buff_ChatoMatic 	string outer
	/declare armor_class_buff_ChatoMatic  				string outer
	/declare hit_point_aego_buff_ChatoMatic 			string outer
	/declare hit_point_aego_group_buff_ChatoMatic 		string outer
	/declare spell_haste_buff_ChatoMatic 				string outer
	/declare spell_haste_group_buff_ChatoMatic			string outer
   	/declare melee_guard_buff_ChatoMatic				string outer
	/declare melee_guard_group_buff_ChatoMatic 			string outer
	/declare debug_ChatoMatic							string outer
	/declare aura_spell_ChatoMatic						string outer	
	/declare announce_ChatoMatic						string outer	
	
	/declare CastoMatic_ON								int outer
	/declare group_heal_over_time_use					int outer

| ----------------------------------------------------------------------------
|  Reporting Variables
| ----------------------------------------------------------------------------
	/declare low_mana_reporting int outer
	/declare out_of_mana_reporting int outer
	/declare no_tank_reporting int outer
	/declare healing_interrupt_reporting int outer 1
	/declare debug int outer 0
| ----- Call user defined INC file
   	/call Healer_Variables
| ----- Load Variables not in INC file
 	/if (${debug})  /echo declaring variables
	/declare epic_timer timer outer 0s
	/declare zoned_timer timer outer 0s
	/declare target_checked int outer
	/declare noInvis int outer 1
	/declare reverse_ds_use_mob int outer 0
	/declare possible_incoming	int outer 0
	/declare interrupt_timer timer outer 0
	/declare complete_heal_timer timer outer
	/declare complete_heal_timer_2 timer outer
	/declare complete_heal_timer_amount int outer
	/declare promised_heal_use int outer 0
	/declare complete_heal_range int outer ${Spell[${complete_heal}].Range}
	/declare patch_heal_range int outer ${Spell[${patch_heal}].Range}
	/declare heal_over_time_range int outer ${Spell[${heal_over_time}].Range}
	/declare group_healrange int outer ${Spell[${group_heal}].AERange}
 	/declare tank_name string outer ${Target.Name}
 	/declare tank_name_id int outer
  	/declare tank_class string outer
	/declare tank_merc int outer
  	/declare default_heal_% int outer
	/if (${Select[${Spawn[${tank_name}].Class},Warrior,Paladin,ShadowKnight]}>=1) /varset default_heal_% 78
	/if (${Select[${Spawn[${tank_name}].Class},Wizard,Druid,Mage]}>=1) {
	/varset default_heal_% 90
	} else /varset default_heal_% 75
	/if (${heal_tank_%}<${default_heal_%}) /varset heal_tank_% ${default_heal_%}
   /declare minor_hurt int outer 0
   /declare major_hurt int outer 0
   /declare most_hurt string outer NULL
   /declare most_hurt_id int outer
   /declare most_hurt_hp int outer 100
   /declare most_hurt_class string outer NULL
   /declare group_member int outer
   /declare spell_to_mem string outer
   /declare find_spell[25] string outer
   /declare heal_over_time_cast_on_1 string outer NULL
   /declare heal_over_time_cast_on_2 string outer NULL
   /declare heal_over_time_cast_on_3 string outer NULL
   /declare following int outer 0
   /declare follow_name string outer NULL
   /declare mount_use_save_var int outer 0
   /declare stop_heals_at int outer ${stop_healing_point_%}
   /declare group_heal_hurt_count int outer 0
   /declare divine_arbitration_OOR int outer 0
   /declare direct_damage_AoE_timer int outer 0
   /declare all_dps_off int outer 0
   /declare gift_of_mana_group_heal_use int outer 1
   /declare gift_of_mana int outer 0
   /declare incoming_cast_timer timer outer
   
| ----- Macro starting statements
   /call ChatoMatic
   /if ((!${Target.ID})||(!${Group.Member[${Target}]})) {
      /echo Target the Tank when you run this macro to designate him as MT
      /echo He needs to be in the group as well.
      /end
   } else {
      /varset tank_name_id ${Target.ID}
      /varset tank_class ${Target.Class.Name}
   }
   /if (${Defined[Param0]}) {
      /varset default_heal_% ${Param0}
   }  else {
   /echo No Heal% specified, defaulting to ${default_heal_%}
   }

   /if (!${Defined[Param1]}) {
      /echo Usage: /mac Healer % heal
      /echo Example: /mac Healer 40 Complete Heal
      /echo Defaulting to ${complete_heal} at ${default_heal_%}%
   }
   /call Memorize_Spells
   /echo AutoHealer Active, running in Autohealmode ${auto_heal_mode}
   /echo Casting ${complete_heal} on ${Spawn[${tank_name}].CleanName} at ${default_heal_%}% HP
   /delay 2s
   /if (${auto_heal_mode}==0) /echo ONLY ${Spawn[${tank_name}].CleanName} will be healed
   /if (${auto_heal_mode}==1) /echo ONLY ${Spawn[${tank_name}].CleanName} and myself will be healed
   /if (${auto_heal_mode}==2) /echo ${Spawn[${tank_name}].CleanName}, myself and my group will be healed
   /if (${auto_heal_mode}==3) /echo ${Spawn[${tank_name}].CleanName} and myself will be healed before the rest of the group
	/if (${Spawn[${Target}].Type.Equal[Mercenary]}) {
	/varset tank_merc 1
	/echo ${Spawn[${tank_name}].CleanName} is a Mercenary setting necessary parameters.
	}
   /call Check_Events
   /echo ${tank_start_message}
	/if (${announce}) /${say_where} ${tank_start_message}

   :tankwatchloop
/if (${debug}) /echo tankwatch begin
	/if (${Spawn[${tank_name_id}].Name.NotEqual[${tank_name}]}) /varset tank_name_id 0
	/if (!${Spawn[${tank_name_id}].ID} && ${Spawn[${tank_name}].ID}) {
			/if (${SpawnCount[${tank_name} ${tank_class}]}==1) {
				/varset tank_name_id ${Spawn[${tank_name} ${tank_class}].ID}
				/echo ${Spawn[${tank_name} ${tank_class}].CleanName} is the designated MT and has ID# ${tank_name_id}
			} else {
				/beep
				/echo Need to restart macro to correctly identify the MT
			}
	}
			/if (${debug}) /echo tankwatch 2
	/if (${Spawn[${tank_name_id}].ID}) {
			/if (${debug}) /echo tankwatch 2 a
		/if (${Spawn[${tank_name_id}].Type.Equal[Corpse]} && (${SpawnCount[${tank_name} ${tank_class}]} == 1) ) {
				/varset tank_name_id ${Spawn[${tank_name} ${tank_class}].ID}
				/echo ${Spawn[${tank_name} ${tank_class}].CleanName} is MT and has ID# ${tank_name_id}. If incorrect, please restart macro
		}
	}		
		/if ((!${Target.ID} || ${Target.ID} != ${tank_name_id} ) && ${Spawn[${tank_name_id}].ID} && ${Spawn[${tank_name_id}].Type.NotEqual[Corpse]}) {
				/if (${debug}) /echo tankwatch 2b
				/target id ${tank_name_id}
				/delay 6 ${Target.ID} == ${tank_name_id}
		 } else {
			
		/if (!${Spawn[${tank_name_id}].ID} && ${no_tank_reporting}) {
		/if (${debug}) /echo tankwatch 2c
			/echo Warning No Designated MT is available
			/timed 300 /varset no_tank_reporting 1
			/varset no_tank_reporting 0
		}
	}
    /doevents Hot_on_Inc
    /call Attack_Spells
	/if ((${mount_use}) && (!${Me.Mount.ID})) /call mount

| ----- Mana watch

	/if (${Me.PctMana}<=50 && ${announce} && ${low_mana_reporting}==1) {
	 /if (${announce}) /${say_where} I have ${Me.PctMana} m
      /timed 300 /varset low_mana_reporting 1
	  /varset low_mana_reporting 0
   }

	/if (${Me.PctMana}<=7 && ${announce} && ${out_of_mana_reporting}==1) {
    	 /if (${announce}) /${say_where} I am Out of Mana going to Med.
	/timed 300 /varset out_of_mana_reporting 1
	/varset out_of_mana_reporting 0
	/call Med_Time
   }
     /if (${GameState.Equal[CHARSELECT]}) /end
   /if (${Target.ID}==${tank_name_id}) {
      /varset stop_heals_at ${Math.Calc[${default_heal_%}*1.1]}
      /if ((${Target.Distance}<=${patch_heal_range})&&(${Target.PctHPs}<=${Math.Calc[0.7*${default_heal_%}]})&&(${Target.PctHPs}>=1)) {
         /if (${announce}) /${say_where}  ${patch_heal} --- %T ---1
		 /if (${debug}) /echo trying to patch heal from tankwatch loop
         /call Cast "${patch_heal}" gem2 1s CheckHP
         /delay 15 ${Me.SpellReady[${patch_heal}]}
      }
      /if ((${Target.Distance}<=${complete_heal_range})&&(${Target.PctHPs}<=${default_heal_%})&&(${Target.PctHPs}>=${Math.Calc[0.7*${default_heal_%}]})&&${complete_heal_timer}<1) {
         /if (${announce}) /${say_where}  ${complete_heal} --- %T --- 1
         /call Cast "${complete_heal}" gem1 1s CheckHP
         /delay 15 ${Me.SpellReady[${complete_heal}]}
	 /if (${promised_heal_use} && ${Macro.Return.Equal[CAST_SUCCESS]}) /varset complete_heal_timer ${complete_heal_timer_amount}
      }
      /varset stop_heals_at ${stop_healing_point_%}
      /call Check_Events
   }
   /if ((${auto_sit}>=1)&&(${Bool[${Me.Sitting}]})&&(!${Window[SpellBookWnd].Open})) {
      /if ((${Me.PctMana}>98)||(${Me.PctHPs}<=90)) /stand
   }
   /if ((${auto_sit}==1)&&(${Bool[${Me.Sitting}]})&&(!${Window[SpellBookWnd].Open})) {
      /if (${NearestSpawn[NPC].Distance}<=${Math.Calc[${NearestSpawn[NPC].MaxRange}+${Math.Calc[${auto_sit_mob_distance}/3]}]}) /stand
   }
   /if (${auto_heal_mode}==0) {
      /call Check_Events
      /goto :tankwatchloop
   }
   /if ((${auto_heal_mode}>=1)&&(${Me.PctHPs}<=${heal_self_%})) /call Heal_Self
   /if (${auto_heal_mode}>=2) {
      /if ((${Target.PctHPs}>${default_heal_%})||(${Target.Distance}>${complete_heal_range})||(${Target.PctHPs}<=1)||(!${Target.ID})||(${Target.ID}!=${tank_name_id}    )) {
         /call Heal_Group
      }
   }
   /if ((${auto_heal_mode}<2)&&(${Me.PctHPs}>${heal_self_%})&&(${Me.PctMana}<=98)) /call Med_Time
   /call Check_Events
   /goto :tankwatchloop
/return

|----------------------------------------------------------------------------
|  SUB: Mem Spells
|----------------------------------------------------------------------------
Sub Memorize_Spells

   /echo Memorizing spells. Hang on.
 /if (${CastoMatic_ON}) {
	/call Assign_Spell_Complete_Heal
	/varset complete_heal ${Me.Gem[1]}
	} else {
   /if ( !${Me.Gem[${complete_heal}]} ) {
	/echo Memorizing Spell ${complete_heal}
	/memspell 1 "${complete_heal}"
	/delay 25
	}
   }
| - Check for complete heal/promised heal then if cleric has Spell Casting Reinforcement AA
	/if (${complete_heal.Find[complete]}) {	 
	   /varset complete_heal_timer_amount 0
	} else {
	   /if (${AltAbility[Spell Casting Reinforcement].ID}) {
	   /varset complete_heal_timer_amount 240
	} else {
	   /varset complete_heal_timer_amount 180
	   }
	   /varset promised_heal_use 1
	}

  /if (${CastoMatic_ON}) {
	/call Assign_Spell_Patch_Heal
		} else {
   /if ( !${Me.Gem[${patch_heal}]} ) {
	/echo Memorizing Spell ${patch_heal}
      /memspell 2 "${patch_heal}"
      /delay 25
	  }
   }
    /if (${CastoMatic_ON}) {
	/call Assign_Spell_Heal_Over_Time
	} else {
   /if ( !${Me.Gem[${heal_over_time}]} ) {
	/echo Memorizing Spell ${heal_over_time}
      /memspell 3 "${heal_over_time}"
      /delay 25
	}
   }
    /if (${CastoMatic_ON} && ${group_heal_over_time_use}) {
	/call Assign_Spell_Group_Heal_Over_Time
	} else {
	/if (${CastoMatic_ON}) /call Assign_Spell_Group_Heal
	} else {
   /if ( !${Me.Gem[${group_heal}]} ) {
	/echo Memorizing Spell ${group_heal}
      /memspell 4 "${group_heal}"
      /delay 25
	}
   }
   /if ( !${Me.Gem[${hammer_pet}]} ) {
	/echo Memorizing Spell ${hammer_pet}
      /memspell 5 "${hammer_pet}"
      /delay 20
   }
   /if ( !${Me.Gem[${direct_damage_magic}]} ) {
	/echo Memorizing Spell ${direct_damage_magic}
      /memspell 6 "${direct_damage_magic}"
      /delay 30
   }
   /if ( !${Me.Gem[${invulnerability_spell}]} ) {
	/echo Memorizing Spell ${invulnerability_spell}
      /memspell 7 "${invulnerability_spell}"
      /delay 20
   }
      /if ( !${Me.Gem[${reverse_damage_shield}]} ) {
	/echo Memorizing Spell ${reverse_damage_shield}
      /memspell 8 "${reverse_damage_shield}"
      /delay 30
   }
   /if ( !${Me.Gem[${direct_damage_stun}]} ) {
	/echo Memorizing Spell ${direct_damage_stun}
      /memspell 9 "${direct_damage_stun}"
      /delay 30
   }
   /if ( !${Me.Gem[${gem_10}]}) {
      /echo Memorizing Spell ${gem_10}
      /memspell 10 "${gem_10}"
      /delay 30
   }

	/echo Spells are memmed.
	/if (${Window[SpellBookWnd].Open}) /cleanup
/return

|----------------------------------------------------------------------------
|  SUB: Heal over Time on INC
|----------------------------------------------------------------------------
Sub Event_Hot_on_Inc(line, SenderName)
	/if (!${Group.Member[${SenderName.Arg[1]}]}) /return
	/if (${Target.ID}!=${Spawn[${tank_name}].ID}) {
		/target ${tank_name}
		/delay 1s ${Target.ID}==${Spawn[${tank_name}].ID}
	}
	/if (${Me.SpellReady[${heal_over_time}]} && !${Me.Casting.ID} && ${Target.Distance}<${Spell[${heal_over_time}].Range}) {
		/call Cast "${heal_over_time}" gem3 5s
	}
/return

|----------------------------------------------------------------------------
| SUB: Attack Spells
|----------------------------------------------------------------------------
Sub Attack_Spells
/if (${Spawn[${tank_name}].PctHPs}>${heal_tank_%} && ${Spawn[${tank_name}].NearestSpawn[npc radius 30 zradius 15].ID}) {
	 	/if (${debug}) /echo Begin Sub Attack_Spells
			/assist ${tank_name}
			/delay 1s
			/call Check_Target
			/if (!${target_checked}) /goto :skip_attack_spells
		/if (${debug}) /echo assisting tank my target is ${Target}

/if (${hammer_pet_use} && !${Me.Pet.ID} && ${Me.PctMana}>=${hammer_pet_cast_%} && ${Target.PctHPs}<${hammer_pet_mob_health_%}) { 
		/if (${debug}) /echo call hammer pet
		/if (${announce}) /${say_where} Casting ${hammer_pet} on ${Spawn[${Target}].CleanName} 
		/call Hammer_Pet_Cast
		/goto :attack_spells_done
		}

		/if (${reverse_damage_shield_use} && ${Me.PctMana}>=${reverse_damage_shield_cast_%} && !${reverse_ds_use_mob} && ${Target.PctHPs}>${reverse_damage_shield_mob_health_min_%}) { 
		/if (${debug}) /echo calling Sub Reverse DS
		/if (${announce}) /${say_where} Casting ${reverse_damage_shield} on ${Spawn[${Target}].CleanName} 
		/call Reverse_Damage_Shield_Cast
		/goto :attack_spells_done
		}

		/if (${direct_damage_magic_use} && !${direct_damage_timer}>0 && ${Me.PctMana}>=${direct_damage_magic_cast_%} && ${Target.PctHPs}<${direct_damage_magic_mob_health_%}) {
		/varset direct_damage_timer  ${direct_damage_delay}s
		/if (${debug}) /echo  Cast direct_damage_magic
		/if (${announce}) /${say_where} Casting ${direct_damage_magic} on ${Spawn[${Target}].CleanName} 
		/call Direct_Damage_Cast "${direct_damage_magic}" 
		/goto :attack_spells_done
		}
		
		/if (${direct_damage_stun_use} && ${Me.PctMana}>=${direct_damage_stun_cast_%} && ${Target.PctHPs}<${direct_damage_stun_mob_health_%}) {
		/if (${debug}) /echo calling Sub Direct_Damage
		/call Direct_Damage_Cast "${direct_damage_stun}" 
		/goto :attack_spells_done
		}
				:attack_spells_done
		/doevents Gift_of_Mana_On
		:skip_attack_spells
				/if (${debug}) /echo Leaving attack spells sub
		/target ${tank_name}
				/if (${debug}) /echo Targeting ${tank_name}
		/delay 1s ${Target.Type.Equal[PC]}
		}
	/return

|----------------------------------------------------------------------------
| SUB: Heal self
|----------------------------------------------------------------------------
Sub Heal_Self
   /if (${Me.PctHPs}>${heal_self_%}) /return
   /varset stop_heals_at ${Math.Calc[${heal_self_%}+5]}
   /if ((!${Target.ID})||(${Target.PctHPs}>=${Math.Calc[1.1*${default_heal_%}]})||(${Target.PctHPs}<=1)||(${Target.ID}!=${tank_name_id})) {
      /if ((${Me.PctHPs}<=${heal_self_%})&&(${Me.PctHPs}>${dacastpoint})) {
         /target myself
         /delay 6 ${Target.Name.Equal[${Me}]}
         /if (${Target.Name.Equal[${Me}]}) {
            /if (${announce}) /${say_where}  (${patch_heal}) --- %T ---2
            /call Cast "${patch_heal}" gem2 1s CheckHP
            /delay 15 ${Me.SpellReady[${patch_heal}]}
         }
      }
   }
   /if (${Me.PctHPs}<=${Math.Calc[${heal_self_%}*0.7]}) {
      /target myself
      /delay 6 ${Target.Name.Equal[${Me}]}
      /if (${Target.Name.Equal[${Me}]}) {
         /if (${announce}) /${say_where}  (${patch_heal}) --- %T ---3
         /varset stop_heals_at ${Math.Calc[${heal_self_%}+5]}
 		 /if (${debug}) /echo trying to patch heal from Sub Heal_Self
         /call Cast "${patch_heal}" gem2 1s CheckHP
         /delay 15 ${Me.SpellReady[${patch_heal}]}
      }
   }
   /varset stop_heals_at ${stop_healing_point_%}
/return

|----------------------------------------------------------------------------
| SUB: Heal Group
|----------------------------------------------------------------------------

Sub Heal_Group
   :healgroup
   /varset most_hurt NULL
   /varset most_hurt_hp 100
   /varset most_hurt_class NULL
   /varset minor_hurt 0
   /varset major_hurt 0
   /varset group_heal_hurt_count 0
   /for group_member 0 to ${Group}
      	/if (${Group.Member[${group_member}].Distance}<=${patch_heal_range} && ${Group.Member[${group_member}].Type.NotEqual[Corpse]}) {
            /if (${Group.Member[${group_member}].PctHPs}<=${most_hurt_hp}) {
				/if (${heal_only_while_fd}==1 && ${Select[${Group.Member[${group_member}].Class.ShortName},NEC,MNK]}>0 && ${Group.Member[${group_member}].State.Equal[feign]}) {
					/call Assign_Most_Hurt
					/goto :heal_FD_class
			}
				/call Assign_Most_Hurt
		}
				:heal_FD_class
	}
      /if ((${Group.Member[${group_member}].Distance}<=${group_healrange})&&(${Group.Member[${group_member}].PctHPs}<=85)) /varcalc group_heal_hurt_count ${group_heal_hurt_count}+1
      /if ((${Group.Member[${group_member}].PctHPs}<=75)&&(${Group.Member[${group_member}].PctHPs}>=55)) /varcalc minor_hurt ${minor_hurt}+1
      /if ((${Group.Member[${group_member}].PctHPs}<=55)&&(${Group.Member[${group_member}].PctHPs}>=1)) /varcalc major_hurt ${major_hurt}+1
   /next group_member
 
  /if (${auto_heal_mode}==3) {
      /if ((!${Target.ID})||(${Target.Name.NotEqual[${tank_name}]})) /if (${Spawn[${tank_name_id}].ID}) {
         /target id ${tank_name_id}
         /delay 6 ${Target.ID}==${tank_name_id}
         /delay 1
         /if ((${Target.ID}==${tank_name_id})&&((${Target.PctHPs}<=${default_heal_%})||(${gift_of_mana}>0))&&(${Target.Distance}<=${complete_heal_range})) /return
      }
      /if (${Me.PctHPs}<=${heal_self_%}) /return
   }
   /if ((${major_hurt}==0)&&(${minor_hurt}==0)&&(${gift_of_mana}==0)) {
      /if (${Spawn[${tank_name_id}].ID}) {
         /target id ${tank_name_id}
         /delay 6 ${Target.ID}==${tank_name_id}
         /delay 1
      }
      /if (((${Target.ID}==${tank_name_id})&&(${Target.PctHPs}>${default_heal_%}))||(!${Spawn[${tank_name_id}].ID})||(${Spawn[${tank_name_id}].Type.Equal[corpse]})) {
         /if (${Me.PctMana}<=98) /call Med_Time
      }
      /call Check_Events
      /return
   }
   /if (${divine_arbitration_use} && ${most_hurt_hp}<=${divine_arbitration_heal_%} && (${Me.AltAbilityReady[divine arbitration]} || (${epic_timer}==0))) /call divine_arbitration_cast
   /if ( ((${Math.Calc[${major_hurt}+${minor_hurt}]}>=3)&&(${group_heal_use}==1))||((${gift_of_mana}==1)&&(${group_heal_use}==1)) ) {
      /if (${announce}) /${say_where}  Inc Grp Heal, get close
      /call Cast "${group_heal}" gem4 1s
      /delay 15 ${Me.SpellReady[${group_heal}]}
      /call Check_Events
      /return
   }
   /if (${most_hurt_id}==${tank_name_id}) /return
   /if (${most_hurt_id}==${Me.ID}) {
      /call Heal_Self
      /call Check_Events
      /return
   }

   /if (${Select[${most_hurt_class},Warrior,Paladin,Shadow Knight]}>0) {
      /if ((${most_hurt_hp}<=${heal_tank_%})&&(${most_hurt_hp}>=${Math.Calc[0.7*${heal_tank_%}]})&&(${major_hurt}<=1)&&(${minor_hurt}<=1)&&${complete_heal_timer_2}<1) {
         /target id ${most_hurt_id}
    /delay 5 ${Target.ID}==${most_hurt_id}
         /if (!${Target.ID} || ${Target.ID}!=${most_hurt_id}) /return
         /varset stop_heals_at ${Math.Calc[${heal_tank_%}+5]}
		/if (${announce}) /${say_where}  ${complete_heal} --- %T --- 2
	/echo Casting ${complete_heal}
         /call Cast "${complete_heal}" gem1 1s CheckHP
         /delay 15 ${Me.SpellReady[${complete_heal}]}
	 /if (${promised_heal_use} && ${Macro.Return.Equal[CAST_SUCCESS]}) /varset complete_heal_timer_2 ${complete_heal_timer_amount}
         /varset stop_heals_at ${stop_healing_point_%}
         /call Check_Events
         /return
      }
      /if (${most_hurt_hp}<=${heal_tank_%}) {
         /target id ${most_hurt_id}
         /delay 5 ${Target.ID}==${most_hurt_id}
         /if (!${Target.ID} || ${Target.ID}!=${most_hurt_id}) /return
         /varset stop_heals_at ${Math.Calc[${heal_tank_%}+5]}
         /if (${announce}) /${say_where}  (${patch_heal}) --- %T ---4
		  /if (${debug}) /echo trying to patch heal from worst hps line 547
         /call Cast "${patch_heal}" gem2 1s CheckHP
         /delay 15 ${Me.SpellReady[${patch_heal}]}
         /varset stop_heals_at ${stop_healing_point_%}
         /call Check_Events
         /return
      }
   } else /if (${Select[${most_hurt_class},Magician,Wizard,Enchanter,Druid]}>0) {
      /if ((${most_hurt_hp}<=${heal_over_time_caster_%})&&(${most_hurt_hp}>${heal_caster_%})) {
         /if (${Select[${most_hurt},${heal_over_time_cast_on_1},${heal_over_time_cast_on_2},${heal_over_time_cast_on_3},${nohotforud}]}>=1) /return
         /if (${Select[${heal_over_time_cast_on_1},NULL]}>=1) {
            /target id ${most_hurt_id}
       /delay 5 ${Target.ID}==${most_hurt_id}
         /if (!${Target.ID} || ${Target.ID}!=${most_hurt_id}) /return
            /varset heal_over_time_cast_on_1 ${Target.Name}
            /if (${announce}) /${say_where}  (${heal_over_time}) --- %T ---
            /varset stop_heals_at ${Math.Calc[${heal_over_time_caster_%}+5]}
            /call Cast "${heal_over_time}" gem3 1s CheckHP
            /timed 200 /varset heal_over_time_cast_on_1 NULL
            /delay 15 ${Me.SpellReady[${heal_over_time}]}
         } else /if (${Select[${heal_over_time_cast_on_2},NULL]}>=1) {
            /target id ${most_hurt_id}
       /delay 5 ${Target.ID}==${most_hurt_id}
         /if (!${Target.ID} || ${Target.ID}!=${most_hurt_id}) /return
       /varset heal_over_time_cast_on_2 ${Target.Name}
            /if (${announce}) /${say_where}  (${heal_over_time}) --- %T ---
            /varset stop_heals_at ${Math.Calc[${heal_over_time_caster_%}+5]}
            /call Cast "${heal_over_time}" gem3 1s CheckHP
            /timed 200 /varset heal_over_time_cast_on_2 NULL
            /delay 15 ${Me.SpellReady[${heal_over_time}]}
         } else /if (${Select[${heal_over_time_cast_on_3},NULL]}>=1) {
            /target id${most_hurt_id}
       /delay 5 ${Target.ID}==${most_hurt_id}
         /if (!${Target.ID} || ${Target.ID}!=${most_hurt_id}) /return
       /varset heal_over_time_cast_on_3 ${Target.Name}
            /if (${announce}) /${say_where}  (${heal_over_time}) --- %T ---
            /varset stop_heals_at ${Math.Calc[${heal_over_time_caster_%}+5]}
            /call Cast "${heal_over_time}" gem3 1s CheckHP
            /timed 200 /varset heal_over_time_cast_on_3 NULL
            /delay 15 ${Me.SpellReady[${heal_over_time}]}
         } else /if (${Select[${nohotforud},NULL]}>=1) {
            /target id ${most_hurt_id}
       /delay 5 ${Target.ID}==${most_hurt_id}
         /if (!${Target.ID} || ${Target.ID}!=${most_hurt_id}) /return
       /varset nohotforud ${Target.Name}
            /if (${announce}) /${say_where}  (${heal_over_time}) --- %T ---
            /varset stop_heals_at ${Math.Calc[${heal_over_time_caster_%}+5]}
            /call Cast "${heal_over_time}" gem3 1s CheckHP
            /timed 200 /varset nohotforud NULL
            /delay 15 ${Me.SpellReady[${heal_over_time}]}
         }
         /varset stop_heals_at ${stop_healing_point_%}
         /call Check_Events
         /return
      }
      /if ((${most_hurt_hp}<=${heal_caster_%})&&(${most_hurt_hp}>=1)) {
         /target id ${most_hurt_id}
    /delay 5 ${Target.ID}==${most_hurt_id}
         /if (!${Target.ID} || ${Target.ID}!=${most_hurt_id}) /return
         /if (${announce}) /${say_where}  (${patch_heal}) --- %T ---5
		  		 /if (${debug}) /echo trying to patch heal from most_hurt_hp caster
        /call Cast "${patch_heal}" gem2 1s CheckHP
         /varset stop_heals_at ${stop_healing_point_%}
         /call Check_Events
         /delay 15 ${Me.SpellReady[${patch_heal}]}
         /return
      }
      /varset stop_heals_at ${stop_healing_point_%}
   } else /if (${Select[${most_hurt_class},Necromancer,Shaman]}>0) {
      /if ((${most_hurt_hp}<=${heal_nec_shm_%})&&(${most_hurt_hp}>=1)) {
		/if (${interrupt_timer}>1) /goto :Skip_FD_Heal
         /target id ${most_hurt_id}
    /delay 5 ${Target.ID}==${most_hurt_id} 
	/if (!${Target.ID} || ${Target.ID}!=${most_hurt_id}) /return
        /varset stop_heals_at ${Math.Calc[${heal_nec_shm_%}+5]}
    /if (${announce}) /${say_where}  (${patch_heal}) --- %T ---6
	/call Cast "${patch_heal}" gem2 1s CheckHP
	/if (${Macro.Return.Equal[CAST_CANCELLED]})	/varset interrupt_timer 600
    /varset stop_heals_at ${stop_healing_point_%}
    /call Check_Events
    /delay 15 ${Me.SpellReady[${patch_heal}]}
	:Skip_FD_Heal
    /return
      }
   } else /if ((${most_hurt_hp}<=${heal_default_%})&&(${most_hurt_hp}>=1)) {
      /target id ${most_hurt_id}
      /delay 5 ${Target.ID}==${most_hurt_id}
      /if (!${Target.ID} || ${Target.ID}!=${most_hurt_id}) /return
      /if (${announce}) /${say_where}  (${patch_heal}) --- %T ---7
      /varset stop_heals_at ${Math.Calc[${heal_default_%}+5]}
	  /call Cast "${patch_heal}" gem2 1s CheckHP
      /varset stop_heals_at ${stop_healing_point_%}
      /call Check_Events
      /delay 15 ${Me.SpellReady[${patch_heal}]}
      /return
   }
   /varset stop_heals_at ${stop_healing_point_%}
/return
|----------------------------------------------------------------------------
|  SUB: Check HP
|----------------------------------------------------------------------------
Sub CheckHP
   /if (!${Window[CastingWindow].Open}) /return
   /if (${debug}) /echo Entering Sub CheckHP
   /if (${interrupt_use} && ${Target.PctHPs}>=${stop_heals_at} && ${Target.Type.Equal[PC]} && !${healer_rebuff_use}) {
      /if (${announce}) {
         /echo Ducking heal on ${Target.Name}
      }
      /call Interrupt
      /return
   }
      /if (${debug}) /echo  Sub CheckHP passing Interrupt 1
   /if (${interrupt_heal_self} && ${Target.Name.NotEqual[${Me}]} && ${Me.PctHPs}<${interrupt_heal_self_hp_%}) {
      /if (${divine_arbitration_use} && ${Me.PctHPs}<=${divine_arbitration_heal_%} && (${Me.AltAbilityReady[Divine Arbitration]} || (${epic_timer}==0))) {
         /call Interrupt
         /call divine_arbitration_cast
         /return
      }
      /if (${announce}) {
         /echo Ducking heal or buffspell on ${Target} so I can heal myself
      }
      /call Interrupt
      /return
   }
         /if (${debug}) /echo  Sub CheckHP passing Interrupt self
		 
   /if (${heal_only_while_fd} && ${Select[${Target.Class.ShortName},NEC,MNK]} && (${Target.Name.NotEqual[${tank_name}]} || ${Target.Type.NotEqual[NPC]}) && ${Target.State.NotEqual[feign]}) {
			/if (${announce} && ${healing_interrupt_reporting}) /${say_where} Ducking heal on ${Target.Name} because they aren't staying FD
			/timed 300 /varset healing_interrupt_reporting 1
			/varset healing_interrupt_reporting 0
			/call Interrupt
			/return
         }
		 
         /if (${debug}) /echo  Sub CheckHP passing Interrupt FD
   /for group_member 0 to ${Group}
   /if (${divine_arbitration_use} && ${Spawn[${Group.Member[${group_member}]}].PctHPs}<=${divine_arbitration_heal_%} && ${Spawn[${Group.Member[${group_member}]}].Distance}<=200 && ${Me.AltAbilityReady[Divine Arbitration]} && ${castEndTime}>=${divine_arbitration_interrupt_at_%}) {
            /call Interrupt
            /call divine_arbitration_cast
            /return
   }
   /next group_member
         /if (${debug}) /echo  Sub CheckHP passing Interrupt group_member
/return

|----------------------------------------------------------------------------
|  SUB: Divine Arbitration
|----------------------------------------------------------------------------
Sub divine_arbitration_cast
      /if (${zoned_timer}>0) /return
   /varset divine_arbitration_OOR 0
   /for group_member 0 to ${Group}
      /if (${Group.Member[${group_member}].Distance}>200) /varcalc divine_arbitration_OOR ${divine_arbitration_OOR}+1
   /next group_member
   /if (${Math.Calc[${Group}-${divine_arbitration_OOR}]}>=2) {
      /if (${announce}) /${say_where}  Inc Divine Arbitration
		/if (${debug}) /echo Start Sub Divine_Arbitration
       /if (${epic_timer}==0) {
	    /if (${debug}) /echo Divine_Arbitration AA
	    /if (!${Me.AltAbilityReady[Divine Arbitration]}) /goto :epic_check_1.5
		/call Cast "Divine Arbitration" alt 2s
		/if (${Macro.Return.Equal[CAST_SUCCESS]}) /goto :divine_arbitration_cast
	  } else {
	     :epic_check_1.5
	     /if (${debug}) /echo Divine_Arbitration epic 1.5
		/call cast "Harmony of the Soul" item
		/if (${Macro.Return.Equal[CAST_UNKNOWNSPELL]}) /goto :epic_check_2.0
		/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
		/varset epic_timer 360s
		/goto :divine_arbitration_cast
		}
      } else {
	    :epic_check_2.0
	     /if (${debug}) /echo Divine_Arbitration epic 2.0
		/call cast "Aegis of Superior Divinity" item
		/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
		/varset epic_timer 180s
		/goto :divine_arbitration_cast
		}
	  }
	  :divine_arbitration_cast
      /if (${divine_arbitration_group_heal_after_use} && ${Me.PctMana}>40 || ${Me.PctMana}>20 && !${gift_of_mana}) {
         /if (${announce}) /${say_where}  Inc Grp Heal, get close
         /call Cast "${group_heal}" gem4 2s
         /delay 15 ${Me.SpellReady[${group_heal}]}
      }
   }
   	     /if (${debug}) /echo Leaving Divine_Arbitration
/return

|----------------------------------------------------------------------------
| SUB: Assign_Most_Hurt
|----------------------------------------------------------------------------
  Sub Assign_Most_Hurt
	/varset most_hurt ${Group.Member[${group_member}].Name}
	/varset most_hurt_id ${Group.Member[${group_member}].ID}
	/varset most_hurt_hp ${Group.Member[${group_member}].PctHPs}
	/varset most_hurt_class ${Group.Member[${group_member}].Class.Name}
/return

|----------------------------------------------------------------------------
|  SUB: Check Events
|----------------------------------------------------------------------------
Sub Check_Events
   /delay 1
   /doevents Gain_Experience
   /doevents Gift_of_Mana_Off
   /doevents Gift_of_Mana_On
   /doevents Chat
   /doevents tell
   /doevents
   /doevents flush
   /call Check_Buffs
   /call Check_Aura
   /call Check_Clicky
/return

|----------------------------------------------------------------------------
|  SUB: Med Time
|----------------------------------------------------------------------------
Sub Med_Time
   :oomwait
   /call Check_Events
   /doevents Hot_on_Inc
   /if ((${mount_use}) && (!${Me.Mount.ID})) /call mount
   /if ((${auto_sit}==1)&&(${Me.PctMana}<=98)&&(!${Me.Casting.ID})) {
      /if ((${Bool[${Me.Standing}]})&&(${NearestSpawn[NPC].Distance}>=${Math.Calc[${NearestSpawn[NPC].MaxRange}+${auto_sit_mob_distance}]})&&(${Me.PctHPs}>90)) /sit
      /if ((${Bool[${Me.Sitting}]})&&(!${Window[SpellBookWnd].Open})&&(${NearestSpawn[NPC].Distance}<=${Math.Calc[${NearestSpawn[NPC].MaxRange}+${Math.Calc[${auto_sit_mob_distance}/3]}]})) /stand
   }
   /if ((${Bool[${Me.Standing}]})&&(${auto_sit}==2)&&(${Me.PctMana}<=98)&&(${Me.PctHPs}>90)&&(!${Me.Casting.ID})) /sit
   /if ((${Bool[${Me.Sitting}]})&&(${auto_sit}>=1)&&(${Me.PctMana}>98)&&(!${Window[SpellBookWnd].Open})) /stand
   /if ((${Bool[${Me.Standing}]})&&(!${Me.Mount.ID})&&(${Me.SpellReady[${yaulp_spell}]})&&(!${Me.Buff[${yaulp_spell}].ID}) && (${Spell[${yaulp_spell}].Stacks})) {
	/call Cast "${yaulp_spell}"
   }
   /if (${Me.PctHPs}<=${heal_self_%}) /return
   /if (${Me.PctMana}<=8) /goto :oomwait
/return

|----------------------------------------------------------------------------
| SUB: Gain Xp
|----------------------------------------------------------------------------
Sub Event_Gain_Experience
/varset reverse_ds_use_mob 0
/return

|----------------------------------------------------------------------------
| SUB: Event_Event_Gift_of_Mana_On
|----------------------------------------------------------------------------
Sub Event_Event_Gift_of_Mana_On
	/varset gift_of_mana 1
	/timed 180 /varset gift_of_mana 0
	/call Heal_Group
/return

|----------------------------------------------------------------------------
| SUB: Event_Gift_of_Mana_Off
|----------------------------------------------------------------------------
Sub Event_Gift_of_Mana_Off
/varset gift_of_mana 0
/return

|----------------------------------------------------------------------------
| SUB: Event Out of Food or Drink
|----------------------------------------------------------------------------
Sub Event_Out_of_Food(Line, MissFoodorDrink)
/if (${NearestSpawn[NPC].Distance}>${Math.Calc[${NearestSpawn[NPC].MaxRange}+${Math.Calc[${auto_sit_mob_distance}/3]}]} && ${Me.PctMana}>40) {
	/if (${MissFoodorDrink.Arg[1].Equal[food]}) {
		/call cast "Abundant Food" gem8 1s
		/delay 5 ${Cursor.ID}
		/if (${Cursor.ID}) /autoinv
	}
	/if (${MissFoodorDrink.Arg[1].Equal[drink]}) {
		/call cast "Abundant Drink" gem8 1s
		/delay 5 ${Cursor.ID}
		/if (${Cursor.ID}) /autoinv
	}
}
/return

|----------------------------------------------------------------------------
| SUB: Event_Zoned
|----------------------------------------------------------------------------
Sub Event_Zoned
/if (${debug}) /echo You have zoned.
/varset zoned_timer 20s
/return

|----------------------------------------------------------------------------
| SUB: Incoming
|----------------------------------------------------------------------------
Sub Incoming
/if (!${Window[CastingWindow].Open}||${incoming_cast_timer}<20) /return
/declare Spawncounter int local
/declare SpawnTempID int local
/for Spawncounter 1 to ${SpawnCount[NPC radius 450 zradius 30]}
/if (${Spawn[${NearestSpawn[${Spawncounter}, NPC]}].Speed}>150) {
	/if (${SpawnTempID}) {
		/if (${Spawn[${NearestSpawn[${Spawncounter}, NPC]}].Distance}<${Spawn[ID ${SpawnTempID}].Distance}) /varset SpawnTempID ${Spawn[${NearestSpawn[${Spawncounter}, NPC]}].ID}
	} else {
		/varset SpawnTempID ${Spawn[${NearestSpawn[${Spawncounter}, NPC]}].ID}
	}
	/varset possible_incoming 1
}
/next Spawncounter
/if (${possible_incoming}) {
	/if (${incoming_cast_timer}>${Math.Calc[${Spawn[ID ${SpawnTempID}].Distance}/10]}) {
		/echo Interrupting cast.
		/call Interrupt
	}
	/varset possible_incoming 0
}
/return

|----------------------------------------------------------------------------
| SUB: Check_Buffs
|----------------------------------------------------------------------------
Sub Check_Buffs
/if (${healer_rebuff_state} && ${healer_buff_use} && ${NearestSpawn[NPC].Distance}>=${auto_sit_mob_distance} && ${Me.PctMana}>50) {
/declare i int local 1
/for i 1 to ${healer_buff.Size}
	/doevents
	/if (${Spell[${healer_buff[${i}]}].Mana}>${Me.CurrentMana}) /goto :skipbuff
	/if (${Me.Book[${healer_buff[${i}]}]}==0) /goto :skipbuff
	/if (!${Me.Buff[${healer_buff[${i}]}].ID} && ${Spell[${healer_buff[${i}]}].Stacks}) {
		/keypress TAB
		/delay 3
		/target myself
		/delay 3
		/varset healer_rebuff_use 1
		/varset incoming_cast_timer ${Math.Calc[${Spell[${healer_buff[${i}]}].MyCastTime}*10]}
		/call cast "${healer_buff[${i}]}" gem8 5s Incoming
		/if (${Macro.Return.Equal[CAST_SUCCESS]}) /varset healer_rebuff_state 0
		/keypress TAB
		/varset healer_rebuff_use 0
	}
   :skipbuff
   /next i
/for i 1 to ${TankBufftodo.Size}
	/doevents
	/if (${Spell[${TankBufftodo[${i}]}].Mana}>${Me.CurrentMana}) /goto :skipbuff2
	/if (${Me.Book[${TankBufftodo[${i}]}]}==0) /goto :skipbuff2
	/if (${tank_buff_worn_off[${i}]}) {
		/target ${tank_name}
		/delay 3
		/varset healer_rebuff_use 1
		/varset incoming_cast_timer ${Math.Calc[${Spell[${TankBufftodo[${i}]}].MyCastTime}*10]}
		/call cast "${TankBufftodo[${i}]}" gem8 5s Incoming
		/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
			/varset tank_buff_worn_off[${i}] 0
			/varset healer_rebuff_state 0
		}
		/varset healer_rebuff_use 0
	} else /varset healer_rebuff_state 0
   :skipbuff2
   /next i
}
/if (${Me.Gem[${reverse_damage_shield}]}!=8) {
	/memspell 8 "${reverse_damage_shield}"
	/delay 4s
}
/return

|----------------------------------------------------------------------------
| SUB: Event_Worn_Off
|----------------------------------------------------------------------------
Sub Event_Worn_Off(string line, TempSpellname, TempName)
/declare i int local 1
/for i 1 to ${TankBufftodo.Size}
/if (${TempSpellname.Equal[${TankBufftodo[${i}]}]} && ${TempName.Equal[${tank_name}]}) {
	/varset healer_rebuff_state 0
	/varset tank_buff_worn_off[${i}] 1
}
/next i
/return

|----------------------------------------------------------------------------
| SUB: Event_Worn_Off_2
|----------------------------------------------------------------------------
Sub Event_Worn_Off_2
/declare i int local 1
/for i 1 to ${healer_buff.Size}
/if (!${Me.Buff[${healer_buff[${i}]}].ID} && ${Spell[${healer_buff[${i}]}].Stacks}) /varset healer_rebuff_state 0
/next i
/return

|----------------------------------------------------------------------------
| SUB: No Mount
|----------------------------------------------------------------------------
	Sub Event_No_Mount
	/declare mount_use int outer 0
	/echo We can't use a mount here
	/return

|----------------------------------------------------------------------------
|  SUB: Mount
|----------------------------------------------------------------------------
Sub Mount
  /if (!${Me.Mount.ID} && ${mount_use} && ${interrupt_timer}<1 && ${NearestSpawn[NPC].Distance}>=${auto_sit_mob_distance}) {
  /call Cast "${mount_item_name}" item
  }
  /return

|----------------------------------------------------------------------------
|  SUB: Hammer Pet
|----------------------------------------------------------------------------
Sub Hammer_Pet_Cast
/if (${Me.Pet.ID}) /return
/if (${debug}) /echo Casting hammer pet
/call cast "${hammer_pet}" gem5 3s
/return

|----------------------------------------------------------------------------
|  SUB: Direct_Damage
|----------------------------------------------------------------------------
Sub Direct_Damage_Cast(string direct_damage_spell)
 	/if (${debug}) /echo Sub Direct_Damage Casting ${direct_damage_spell}
		/call cast "${direct_damage_spell}" gem6 1s
/delay 5
/return

|----------------------------------------------------------------------------
|  SUB: Reverse Damage Shield
|----------------------------------------------------------------------------
Sub Reverse_Damage_Shield_Cast
	/if (${debug}) /echo Casting RevDS
	/call cast "${reverse_damage_shield}" gem8 3s
	/if (${Macro.Return.Equal[CAST_SUCCESS]}) /varset reverse_ds_use_mob 1
/return

|----------------------------------------------------------------------------
| SUB: Check_Clicky
|----------------------------------------------------------------------------
Sub Check_Clicky
/if (!${clicky_item_use}) /return
/declare i int local 1
/for i 1 to ${clicky_item.Size}
	/doevents
		/if (${Spell[${clicky_item_buff[${i}]}].Stacks} && !${Me.Buff[${clicky_item_buff[${i}]}].ID} && ${NearestSpawn[NPC].Distance}>=${auto_sit_mob_distance}) {
		/target myself
		/delay 3
		/call Cast "${clicky_item[${i}]}" item
		}
   /next i

/return

|----------------------------------------------------------------------------
| SUB: Check_Aura
|----------------------------------------------------------------------------
Sub Check_Aura
/if (${aura_spell_use} && ${Me.Aura.ID}==NULL && ${Me.Book[${aura_spell}]}>0  && ${NearestSpawn[NPC].Distance}>=${auto_sit_mob_distance}) {
	/if (${announce}) /${say_where} Casting ${aura_spell}
	/call cast "${aura_spell}" gem8 3s
}
/return

| ----------------------------------------------------------------------------
|  Sub Attack or not 
| ----------------------------------------------------------------------------
Sub Attack_or_Not
/return

| ----------------------------------------------------------------------------
|  Sub ChatoMatic 
| ----------------------------------------------------------------------------
Sub ChatoMatic 
   	/if (${announce} && ${my_channel.Length}>0) {
		/if (${leave_all_channels_use}) {
		/leaveall
		/echo Leaving all channels to reset for chat
		}
		/join "${my_channel}"
	}
    /if (${say_where.Equal[my_channel]}) {
	/varset say_where chat #${my_channel.Arg[1,:]}
	}
	 /if (${say_where.Equal[/tell]}) {
	/varset say_where tell ${tell_who}
	}
	/delay 5
	/return

|----------------------------------------------------------------------------
| SUB: Find Exact Character
|----------------------------------------------------------------------------
Sub FindExactPC(string name)
   /declare nameid int local
   /declare counter int local 1
   :FindNext
   /if (!${NearestSpawn[${counter}, pc ${name}].ID}) /return 2
   /varset nameid ${NearestSpawn[${counter}, pc ${name}].ID}
   /if (${debug}) /echo ${NearestSpawn[${counter}, pc ${name}].ID}
   /if (${Spawn[${nameid}].CleanName.Equal[${name}]}) {
      /target id ${nameid}
      /delay 1s ${Target.ID}==${nameid}
      /if (${Target.ID}==${nameid}) /return 1
   }
   /varcalc counter ${counter}+1
   /if (${NearestSpawn[${counter}, pc ${name}].ID}) /goto :FindNext
/return 2

|----------------------------------------------------------------------------
| SUB: Check Target
|----------------------------------------------------------------------------
Sub Check_Target
/varset target_checked 0
	/if (!${Target.ID}) /return
	/if (${Select[${Target.Type},PC,CORPSE,CHEST,TRIGGER,TRAP,TIMER,ITEM,MOUNT,Mercenary]}) /return
/varset target_checked 1
/return

|----------------------------------------------------------------------------
|  SUB: CastoMatic TM 
|----------------------------------------------------------------------------
Sub CastoMatic(string Sender,string CastoMatic_chat_text,string CastoMatic_spell,string CastoMatic_target,string CastoMatic_spell_type,string CastoMatic_switch)
	/if (!${Group.Member[${Sender}]}) /return
	/call FindExactPC ${Sender}
	/if (${Macro.Return}!=1) /return
| - Send toggle commands to Toggle_It
	/if (${CastoMatic_chat_text.Find[toggle]}) {
	/if (${debug}) /echo  CastoMatic sending ${CastoMatic_switch} to Sub Toggle_It.
	/call Toggle_It ${CastoMatic_switch}
	/return
	}	
| - Looks for the word "them" in chat to target senders target for spell casting.
	/if (${CastoMatic_chat_text.Find[them]}) /varset CastoMatic_target other
	/if (${CastoMatic_target.Equal[other]}) {
	/assist ${Sender}	
	/delay 1s
	}
| - Looks for "attack" key word in spell_type_string to validate targets for attack spells	
	/if (${CastoMatic_spell_type.Equal[attack]}) {
	/call Check_Target
	/if (!${target_checked}) /return
	}
| - Spell casting and message
	/if (${announce}) /${say_where} Casting ${CastoMatic_spell} on ${Spawn[${Target}].CleanName} 
	/call cast "${CastoMatic_spell}" gem8 6s
	/delay 5
/return

|----------------------------------------------------------------------------
| SUB: Toggle it
|----------------------------------------------------------------------------
Sub Toggle_It(string toggle_it_switch)
/if (${Defined[${toggle_it_switch}]}) {
	/if (${${toggle_it_switch}}) {
        /varset ${toggle_it_switch} 0
	    /echo Set ${toggle_it_switch}: ${${toggle_it_switch}}
	/if (${announce}) /${say_where} ${toggle_it_switch} - Off 
      } else {
        /varset ${toggle_it_switch} 1
        /echo Set ${toggle_it_switch}: ${${toggle_it_switch}}
	/if (${announce}) /${say_where} ${toggle_it_switch} - On 
   }
   }
/return

|----------------------------------------------------------------------------
| SUB: Assign_Spell_Complete_Heal
|----------------------------------------------------------------------------
Sub Assign_Spell_Complete_Heal
/varset find_spell[10] 	string outer
/varset	find_spell[1]	Promised Recuperation Rk. III
/varset	find_spell[2]	Promised Recuperation Rk. II
/varset	find_spell[3]	Promised Recuperation
/varset	find_spell[4]	Promised Restoration Rk. III
/varset	find_spell[5]	Promised Restoration Rk. II
/varset	find_spell[6]	Promised Restoration
/varset	find_spell[7]	Promised Renewal Rk. III 
/varset	find_spell[8]	Promised Renewal Rk. II	
/varset	find_spell[9]	Promised Renewal
/varset	find_spell[10]	Complete Heal
/call Find_Memorize_Spell "complete_heal" 1
/return

|----------------------------------------------------------------------------
| SUB: Assign_Spell_Patch_Heal
|----------------------------------------------------------------------------
Sub Assign_Spell_Patch_Heal
/varset find_spell[20] 
/varset	find_spell[1]	Devout Light Rk. III
/varset	find_spell[2]	Devout Light Rk. II
/varset	find_spell[3]	Devout Light
/varset	find_spell[4]	Solemn Light Rk. III
/varset	find_spell[5]	Solemn Light Rk. II
/varset	find_spell[6]	Solemn Light Rk
/varset	find_spell[7]	Sacred Light Rk. III
/varset	find_spell[8]	Sacred Light Rk. II
/varset	find_spell[9]	Sacred Light Rk
/varset	find_spell[10]	Ancient Hallowed Light
/varset	find_spell[11]	Pious Light
/varset	find_spell[12]	Holy Light
/varset	find_spell[13]	Supernal Light
/varset	find_spell[14]	Ethereal Light
/varset	find_spell[15]	Divine Light
/varset	find_spell[16]	Superior Healing
/varset	find_spell[17]	Greater Healing
/varset	find_spell[18]	Healing	
/varset	find_spell[19]	Light Healing
/varset	find_spell[20]	Minor Healing
/call Find_Memorize_Spell "patch_heal" 2
/return

|----------------------------------------------------------------------------
| SUB: Assign_Spell_Heal_Over_Time
|----------------------------------------------------------------------------
Sub Assign_Spell_Heal_Over_Time
/varset find_spell[17] 	string outer
/varset	find_spell[1]	Devout Elixir Rk. III
/varset	find_spell[2]	Devout Elixir Rk. II
/varset	find_spell[3]	Devout Elixir
/varset	find_spell[4]	Solemn Elixir Rk. III
/varset	find_spell[5]	Solemn Elixir Rk. II
/varset	find_spell[6]	Solemn Elixir
/varset	find_spell[7]	Sacred Elixir Rk. III
/varset	find_spell[8]	Sacred Elixir Rk. II
/varset	find_spell[9]	Sacred Elixir
/varset	find_spell[10]	Pious Elixir
/varset	find_spell[11]	Holy Elixir
/varset	find_spell[12]	Supernal Elixir
/varset	find_spell[13]	Ethereal Elixir
/varset	find_spell[14]	Celestial Elixir
/varset	find_spell[15]	Celestial Healing
/varset	find_spell[16]	Celestial Health
/varset	find_spell[17]	Celestial Remedy
/call Find_Memorize_Spell "heal_over_time" 3
/return

|----------------------------------------------------------------------------
| SUB: Assign_Spell_Group_Heal
|----------------------------------------------------------------------------
Sub Assign_Spell_Group_Heal
/varset find_spell[12] 	string outer
/varset	find_spell[1]	Word of Recovery Rk. III
/varset	find_spell[2]	Word of Recovery Rk. II
/varset	find_spell[3]	Word of Recovery
/varset	find_spell[4]	Word of Vivacity Rk. III
/varset	find_spell[5]	Word of Vivacity Rk. II
/varset	find_spell[6]	Word of Vivacity
/varset	find_spell[7]	Word of Vivification
/varset	find_spell[8]	Word of Redemption
/varset	find_spell[9]	Word of Restoration
/varset	find_spell[10]	Word of Vigor
/varset	find_spell[11]	Word of Healing
/varset	find_spell[12]	Word of Health
/call Find_Memorize_Spell "group_heal" 4
/return

|----------------------------------------------------------------------------
| SUB: Assign_Spell_Group_Heal_Over_Time
|----------------------------------------------------------------------------
Sub Assign_Spell_Group_Heal_Over_Time
/varset find_spell[15] 	string outer
/varset	find_spell[1]	Elixir of Expiation Rk. III
/varset	find_spell[2]	Elixir of Expiation Rk. II
/varset	find_spell[3]	Elixir of Expiation
/varset	find_spell[4]	Elixir of Atonement Rk. III
/varset	find_spell[5]	Elixir of Atonement Rk. II
/varset	find_spell[6]	Elixir of Atonement
/varset	find_spell[7]	Elixir of Redemption Rk. III
/varset	find_spell[8]	Elixir of Redemption Rk. II
/varset	find_spell[9]	Elixir of Redemption
/varset	find_spell[10]	Elixir of Divinity
/varset	find_spell[11]	Ethereal Elixir
/varset	find_spell[12]	Word of Restoration
/varset	find_spell[13]	Word of Vigor
/varset	find_spell[14]	Word of Healing
/varset	find_spell[15]	Word of Health
/call Find_Memorize_Spell "group_heal" 4
/return

|----------------------------------------------------------------------------
| SUB: Find_Memorize_Spell
|----------------------------------------------------------------------------
Sub Find_Memorize_Spell(string spell_desc,int spell_gem)
	/declare r int local
	/for r 1 to ${find_spell.Size}
		/if (${Me.Book[${find_spell[${r}]}]}) {
		/varset spell_to_mem ${find_spell[${r}]}
			/if (${Me.Gem[${spell_gem}].Name.NotEqual[${spell_to_mem}]} || ${Me.Gem[${spell_gem}].ID}<1) {
				/echo My ${spell_desc} spell is >> ${spell_to_mem} <<
				/memspell ${spell_gem} "${spell_to_mem}"
			}	
		/delay 25
		/return
		}			
	/next r
/return
|----------------------------------------------------------------------------
| SUB: Event_Chat - commands that can be given to the cleric via chat or tells
|----------------------------------------------------------------------------
Sub Event_Chat(string ChatType,string Sender,string ChatText)
	/if (${debug}) /echo entering Event_Chat
   /if (!${ChatType.Equal[${my_channel.Arg[1,:]}]} &&  !${ChatType.Equal[TELL]} && !${ChatType.Equal[GROUP]}) /return
   /if (!${Spawn[${Sender}].ID}) {
      /echo ${Sender} is not in the zone
      /return
   }
| - Chat Attack Spells --------------------------------------------------------
| ----- Hammer Pet
	/if (${ChatText.Equal[${hammer_pet_ChatoMatic}]}) {
	/pet leave
	/call CastoMatic "${Sender}" "${hammer_pet}" "other" "attack" "hammer_pet_use"
	}
| ----- Reverse DS
/if (${ChatText.Equal[${reverse_damage_shield_ChatoMatic}]}) {
   	/if (${debug}) /echo Event_Chat Reverse DS
      /if (!${Group.Member[${Sender}]}) /return
         /assist ${Sender}
         	/delay 1s
			/call Check_Target
			/if (${target_checked})/call Reverse_Damage_Shield_Cast
	}
| ----- Nuke
   /if (${ChatText.Equal[${direct_damage_magic_ChatoMatic3}]}) {
   	/if (${debug}) /echo Event_Chat nuke
      /if (!${Group.Member[${Sender}]}) /return
         /assist ${Sender}
         	/delay 1s
			/call Check_Target
			/if (${target_checked}) /call Direct_Damage_Cast "${direct_damage_magic}"
      }
| ----- Nuke
/if (${ChatText.Find[${direct_damage_magic_ChatoMatic}]}) /call CastoMatic "${Sender}" "${ChatText}" "${direct_damage_magic}" "other" "attack" "direct_damage_magic_use"
																			
| ----- AoE
   /if (${ChatText.Equal[direct_damage_AoE]}) {
      	/if (${debug}) /echo entering Event_Chat nuke Aoe
      /if (!${Group.Member[${Sender}]}) /return
      /target ${Me.NearestSpawn[npc radius 35 zradius 25]}
      /delay 8
      /if (${Target.Type.NotEqual[NPC]}) {
         /assist ${Sender}
         /delay 8 ${Target.Type.Equal[NPC]}
      }
      /if ((${Target.Type.Equal[NPC]})&&(${Target.PctHPs}<=90)) {
         /if (${Me.SpellReady[${direct_damage_AoE}]}) {
            /if (${announce}) /${say_where} ${Sender} Casting ${direct_damage_AoE} on %T
            /call Cast "${direct_damage_AoE}" spell 3s
         } else /${say_where} ${Sender} ${direct_damage_AoE} not ready.
      } else /${say_where} ${Sender} wrong target (${Target.Type} at ${Target.PctHPs}% HP)
   }
| - Chat Heals ---------------------------------------------------------------

/if (${ChatText.Find[${complete_heal_ChatoMatic}]})				/call CastoMatic "${Sender}" "${ChatText}" "${complete_heal}" "me "heal"
/if (${ChatText.Find[${patch_heal_ChatoMatic}]})				/call CastoMatic "${Sender}" "${ChatText}" "${patch_heal}" "me" "heal"
/if (${ChatText.Find[${heal_over_time_ChatoMatic}]})			/call CastoMatic "${Sender}" "${ChatText}" "${heal_over_time}" "me" "heal"
/if (${ChatText.Find[${group_heal_ChatoMatic}]})				/call CastoMatic "${Sender}" "${ChatText}" "${group_heal}" "me" "heal"
/if (${ChatText.Find[${remove_curse_ChatoMatic}]})				/call CastoMatic "${Sender}" "${ChatText}" "${remove_curse}" "me" "heal"
/if (${ChatText.Find[${pure_blood_ChatoMatic}]})				/call CastoMatic "${Sender}" "${ChatText}" "${pure_blood}" "me" "heal"
/if (${ChatText.Equal[${divine_arbitration_ChatoMatic}]})		/call divine_arbitration_cast

 | ----- gift_of_mana_group_heal_use - toggle group heal on gift of mana
 /if (${ChatText.Equal[gift_of_mana_group_heal_use]}) {
      /if (!${Group.Member[${Sender}]}) /return
      /if (${gift_of_mana_group_heal_use}>0) {
	/varset gift_of_mana_group_heal_use 0
	/echo Grpheal on GoM off!
	/${say_where} ${Sender} Group Heal on GoM off!
      } else /if (${gift_of_mana_group_heal_use}<1) {
	/varset gift_of_mana_group_heal_use 1
	/echo Grpheal on GoM on!
	/${say_where} ${Sender} Group Heal on GoM on!
      }
}
| ----- resurrection
/if (${ChatText.Equal[${resurrection_ChatoMatic}]} && ${Spawn[${Sender}].Type.Find[Corpse]}) {
    /squelch /target ${Sender}'s Corpse
    /if (${Target.ID} && ${Target.Distance}>20) /corpse
    /if (!${Target.ID} && ${Announce}) /${say_where} I can't target ${Sender}'s corpse
    /if (${Target.Type.Equal[Corpse]}) {
      /if (${Announce}) /${say_where} I am attempting to resurrect ${Sender}
      /if (${Me.AltAbility[Blessing of Resurrection]} && ${Me.AltAbilityReady[Blessing of Resurrection]}) {
        /call Cast "Blessing of Resurrection" alt 10s
      } else /if (${FindItem[Water Sprinkler of Nem Ankh].ID}) {
        /call Cast "Water Sprinkler of Nem Ankh" item 6s
      } else {
        /call Cast "Reviviscence" gem8 3s
      }
    }
    /return
  }

| - Chat Buffs -------------------------------------------------------------------

| ----- Group Buffs
| Coming Soon

| ----- Buff me Single Buffs
/if (${ChatText.Equal[buffme]}) {
    /if (!${Group.Member[${Sender}]}) /return
	/call CastoMatic "${Sender}" "${melee_guard_buff}" "me" "buff"
	/call CastoMatic "${Sender}" "${hit_point_aego_buff}" "me" "buff"
	/if (${Select[${Target.Class.ShortName},WAR,BER,BRD,MNK,ROG]}<1) /call CastoMatic "${Sender}" "${spell_haste_buff}" "me" "buff"
 }
 
| ----- Spell Haste
    /if (${ChatText.Equal[BoR now!]}) {
      /if (!${Group.Member[${Sender}]}) /return
      /target myself
      /delay 5 ${Target.Name.Equal[${Me}]}
		/call Cast "${spell_haste_buff}" gem8 5s
      /for group_member 1 to ${Group}
         /target id ${Group.Member[${group_member}].ID}
         /delay 1s ${Target.ID}==${Group.Member[${group_member}].ID}
         /if (${Target.ID}==${Group.Member[${group_member}].ID}) {
		    /if (${Select[!${Target.Class.ShortName},WAR,BER,BRD,MNK,ROG]}) {
			/call Cast "${spell_haste_buff}" gem8 5s
            }
         }
      /next group_member
   }
	/if (${ChatText.Find[${hit_point_symbol_buff_ChatoMatic}]})	 		/call CastoMatic "${Sender}" "${ChatText}" "${hit_point_symbol_group_buff}" "me" "buff"
	/if (${ChatText.Find[${hit_point_symbol_group_buff_ChatoMatic}]})	/call CastoMatic "${Sender}" "${ChatText}" "${hit_point_symbol_group_buff}" "me" "buff"
	/if (${ChatText.Find[${armor_class_buff_ChatoMatic}]}) 				/call CastoMatic "${Sender}" "${ChatText}" "${armor_class_buff}" "me" "buff"
	/if (${ChatText.Find[${hit_point_aego_buff_ChatoMatic}]}) 			/call CastoMatic "${Sender}" "${ChatText}" "${hit_point_aego_buff}" "me" "buff"
	/if (${ChatText.Find[${hit_point_aego_group_buff_ChatoMatic}]}) 	/call CastoMatic "${Sender}" "${ChatText}" "${hit_point_aego_group_buff}" "me" "buff"
	/if (${ChatText.Find[${spell_haste_buff_ChatoMatic}]}) {
	/if (${Select[${Target.Class.ShortName},WAR,BER,BRD,MNK,ROG]}<1)	/call CastoMatic "${Sender}" "${ChatText}" "${spell_haste_buff}" "me" "buff"
	}
	/if (${ChatText.Find[${spell_haste_group_buff_ChatoMatic}]})		/call CastoMatic "${Sender}" "${ChatText}" "${spell_haste_group_buff}" "me" "buff"
   	/if (${ChatText.Find[${melee_guard_buff_ChatoMatic}]})				/call CastoMatic "${Sender}" "${ChatText}" "${melee_guard_buff}" "me" "buff" 
	/if (${ChatText.Find[${melee_guard_group_buff_ChatoMatic}]})		/call CastoMatic "${Sender}" "${ChatText}" "${melee_guard_group_buff}" "me" "buff"
	
| ----- Buff Pet
   /if (${ChatText.Equal[buff pet]}) {
      /if (!${Group.Member[${Sender}]}) /return
      /target ${Spawn[${Sender}].Pet}
      /delay 8
      /target ${Spawn[${Sender}].Pet}
      /call Cast "${armor_class_buff}" gem8 7s
      /call Cast "${hit_point_symbol_buff}" gem8 7s
   }
| ----- DA Pet - requires AA
   /if (${ChatText.Equal[da pet]}) {
      /if (!${Group.Member[${Sender}]}) /return
      /target ${Spawn[${Sender}].Pet}
      /delay 6
      /target ${Spawn[${Sender}].Pet}
      /if (${Me.AltAbilityReady[39]}) /if (${Target.Name}.Equal[${Spawn[${Sender}].Pet.Name}]}) {
         /call Cast "39" alt
      } else {
         /chat #${my_channel} Bestow Divine Aura is not ready, or Target ( %T ) OOR or wrong target
      }
   }
| - Chat Misc --------------------------------------------------------------------
/if (${ChatText.Find[${aura_spell_ChatoMatic}]}) 	/call CastoMatic "${Sender}" "${ChatText}" "${aura_spell}" "me" "buff" "aura_spell_use"
/if (${ChatText.Find[${debug_ChatoMatic}]})  		/call CastoMatic "${Sender}" "${ChatText}" "debug" "me" "buff" "debug"
/if (${ChatText.Find[${announce_ChatoMatic}]}) 		/call CastoMatic "${Sender}" "${ChatText}" "announce" "me" "buff" "announce"
| ----- Command List
/if (${ChatText.Equal[Commands]}) {
/declare temp_announce local ${announce}
/if (!${Group.Member[${Sender}]}) /return
/varset announce 1
/declare temp_say_where local ${say_where}
/varset say_where echo
/if (${announce})  /${say_where}  List of Commands: 
/if (${announce})  /${say_where} - Heals --------------------------------------
/if (${announce})  /${say_where} ${complete_heal} = ${complete_heal_ChatoMatic} 
/if (${announce})  /${say_where} ${patch_heal} = ${patch_heal_ChatoMatic}
/if (${announce})  /${say_where} ${heal_over_time} = ${heal_over_time_ChatoMatic}
/if (${announce})  /${say_where} ${group_heal} = ${group_heal_ChatoMatic}
/if (${announce})  /${say_where} ${remove_curse} = ${remove_curse_ChatoMatic}
/if (${announce})  /${say_where} ${pure_blood} = ${pure_blood_ChatoMatic}
/if (${announce})  /${say_where} Resurrection = ${resurrection_ChatoMatic}
/if (${announce})  /${say_where} Divine Arbitration/Epic = ${divine_arbitration_ChatoMatic}
/if (${announce})  /${say_where} - Attack Spells -------------------------------
/if (${announce})  /${say_where} ${hammer_pet} = ${hammer_pet_ChatoMatic}
/if (${announce})  /${say_where} ${reverse_damage_shield} = ${reverse_damage_shield_ChatoMatic}
/if (${announce})  /${say_where} ${direct_damage_magic} = ${direct_damage_magic_ChatoMatic}
/if (${announce})  /${say_where} ${direct_damage_stun} = ${direct_damage_stun_ChatoMatic}
/if (${announce})  /${say_where} ${direct_damage_undead} = ${direct_damage_undead_ChatoMatic}
/if (${announce})  /${say_where} - Buff Spells ---------------------------------
/if (${announce})  /${say_where} ${hit_point_symbol_buff} = ${hit_point_symbol_buff_ChatoMatic}
/if (${announce})  /${say_where} ${hit_point_symbol_group_buff} = ${hit_point_symbol_group_buff_ChatoMatic}
/if (${announce})  /${say_where} ${armor_class_buff} = ${armor_class_buff_ChatoMatic}
/if (${announce})  /${say_where} ${hit_point_aego_buff} = ${hit_point_aego_buff_ChatoMatic}
/if (${announce})  /${say_where} ${hit_point_aego_group_buff} = ${hit_point_aego_group_buff_ChatoMatic}
/if (${announce})  /${say_where} ${spell_haste_buff} = ${spell_haste_buff_ChatoMatic}
/if (${announce})  /${say_where} ${spell_haste_group_buff} = ${spell_haste_group_buff_ChatoMatic}
/if (${announce})  /${say_where} ${melee_guard_buff} = ${melee_guard_buff_ChatoMatic}
/if (${announce})  /${say_where} ${melee_guard_group_buff} = ${melee_guard_group_buff_ChatoMatic}
/if (${announce})  /${say_where} - Misc ---------------------------------
/if (${announce})  /${say_where} Debug messages = ${debug_ChatoMatic} toggle
/if (${announce})  /${say_where} Aura spell On/Off = ${aura_spell_ChatoMatic} toggle
/if (${announce})  /${say_where} Use Mount = Use Mount 
/if (${announce})  /${say_where} Follow Me On/Off = Follow Me/Stop Follow
/varset announce ${temp_announce}
/varset say_where ${temp_say_where}
}
| ----- Follow Me
   /if (${ChatText.Equal[Follow me]}) {
      /if (!${Group.Member[${Sender}]}) /return
      /delay 5
      /if (!${Spawn[${Sender}].ID}) {
         /echo ${Sender} is not in zone for me to follow!
         /return
      }
      /varset follow_name ${Sender}
      /varset following 1
	  /if (${Me.Mount.ID}) {
	  /dismount
	  /if (${mount_use}) {
	  /varset mount_use 0
	  /varset mount_use_save_var 1
	  }
	  }
      :targetfoll
      /target pc ${follow_name}
      /delay 1s ${Target.Name.Equal[${follow_name}]}
      /if (${Target.Name.Equal[${follow_name}]}) {
         /goto :Loop
      } else /goto :targetfoll
      :Loop
      /face fast
      /if (${Target.Distance}>10) /keypress forward hold
      /if (${Target.Distance}<9) /keypress back
      /if (!${Target.ID}) /varset following 0
      /call Check_Events
      /if ((${Target.Name.Equal[${follow_name}]})&&(${following}>0)) {
         /goto :Loop
      } else {
         /keypress forward
         /keypress back
      }
	  }

| ----- Stop Following
   /if (${ChatText.Equal[Follow off]}) {
      /if (!${Group.Member[${Sender}]}) /return
      /varset following 0
      /keypress forward
      /keypress back
	  /if (${mount_use_save_var}) {
		/varset mount_use 1
		/varset mount_use_save_var 0
	  }

      /timed 50 /face pc ${follow_name}
   }

      /if (${ChatText.Equal[mana check]}) {
      /if (!${Group.Member[${Sender}]}) /return
      /${say_where} ${Sender} Cleric Mana ${Me.PctMana}%
   }
| ----- Slow Camp out of game
   /if (${ChatText.Equal[slowcamp]}) {
      /if (!${Group.Member[${Sender}]}) /return
      /if (${Me.Standing}) /sit
      /delay 5m ${Me.PctMana}>=98
      /camp
      /end
   }
| ----- Use Mount - Toggle mount use
/if (${ChatText.Equal[Use Mount]}) {
      /if (!${Group.Member[${Sender}]}) /return
      /if (${mount_use}) {
	/varset mount_use 0
	/dismount
	/echo I will no longer use my mount!
	/if (${announce})	/${say_where} ${Sender} I will no longer use my mount!
      } else /if (${mount_use}<1) {
	/varset mount_use 1
	/echo I will now use my mount!
	/if (${announce})	/${say_where} ${Sender} I will now use my mount!
      }
	}
/doevents Gift_of_Mana_On
/return
 
Last edited:
This is settings Inc file and the Non VIP spell_routines.inc works with the VIP version too if you have it.

healer_settings.inc

Rich (BB code):
Sub Healer_Variables
| - healer_settings.inc Revised Editon Beta Ver 1.1 07/05/09
| ---DO NOT DELETE THE FIRST OR LAST LINE
| - First Line: Sub Healer_Variables
| - Last Line: /return
| ------------------READ THIS SECTION AND EDIT IF NEEDED------------------------|
| - The following declarations are used to determine spell names and spell
| - ranges for the spells you would like to use.
|----------------------------------------------------------------------------
|   CastoMatic BETA 0=off 1=on switch on or off
|----------------------------------------------------------------------------
| The CastoMatic will memorize and use your highest healing spells automatically.
| Beta currently supports the main healing spell settings 
| 1. Complete Heal 2. Patch Heal 3. Heal over Time and 
| 4. Group Heal - which has a setting to use group heal over time instead of instant.
| - Settings
	/varset CastoMatic_ON	1
	/varset group_heal_over_time_use  1
	
|----------------------------------------------------------------------------
|   Healing Spells and AA's
|----------------------------------------------------------------------------
| - Spells
	/varset complete_heal Complete Heal
	/varset patch_heal  Devout Light Rk. II
	/varset heal_over_time  Devout Elixir Rk. II
	/varset group_heal  Elixir of Atonement
		/varset group_heal_use  1
	/varset remove_curse  Remove Greater Curse
	/varset pure_blood Pure Blood
| - Heal percentages 
	/varset heal_self_%  70
	/varset interrupt_heal_self_hp_%  60
	/varset stop_healing_point_%  85
| - Heal at % for WAR/PAL/SK
	/varset heal_tank_%  69
| - Heal at % for WIZ/MAG/ENC/DRU
	/varset heal_over_time_caster_%  75
	/varset heal_caster_%  55
| - Heal at % for NEC/SHM
	/varset heal_nec_shm_%  45
	/varset heal_only_while_fd  1
| - Heal at % for all other classes
	/varset heal_default_%  60
| - Autohealmode 0 Tank only will be healed
| - Autohealmode 1 Tank and cleric only will be healed
| - Autohealmode 3 Tank and cleric will be healed before the rest of the group
    /varset auto_heal_mode  3
| - Switches 0=OFF 1=ON
	/varset interrupt_use  0
	/varset interrupt_heal_self  1
	/varset divine_arbitration_use  1
	/varset divine_arbitration_heal_%  28
	/varset divine_arbitration_group_heal_after_use 1
	/varset divine_arbitration_interrupt_at_%  26
| ----------------------------------------------------------------------------
|   Damage Spells and AA's
| ----------------------------------------------------------------------------
|   spell_use - 0=off 1=on switch spell use on or off
|	spell_mob_health_% - what percent of mob health to start casting at
|	spell_cast_% - what percent of mana pool to stop casting at

/varset hammer_pet  Indomitable Hammer of Zeal Rk. II
/varset hammer_pet_use  1
/varset hammer_pet_mob_health_%  95
/varset hammer_pet_cast_%  30
/varset reverse_damage_shield   Blood of the Devoted
/varset reverse_damage_shield_use  1
/varset reverse_damage_shield_mob_health_max_%  95
/varset reverse_damage_shield_mob_health_min_%  55
/varset reverse_damage_shield_cast_%  70
/varset direct_damage_magic  Chromassault
/varset direct_damage_magic_use  1
/varset direct_damage_magic_mob_health_%  95
/varset direct_damage_magic_cast_%  70
/varset direct_damage_stun  Reprehend Rk. II
/varset direct_damage_stun_use  0
/varset direct_damage_stun_mob_health_%  95
/varset direct_damage_stun_cast_%  70
/varset direct_damage_undead  Desolate Undead
/varset direct_damage_undead_use  0
/varset direct_damage_undead_mob_health_%  95
/varset direct_damage_undead_cast_%  70
/varset direct_damage_AoE  Calamity
/varset direct_damage_delay 15
| ----------------------------------------------------------------------------
|   Buff Spells and AA's
| ----------------------------------------------------------------------------
| - This are buffs that tank can request via chat
/varset spell_haste_buff  				Blessing of Loyalty Rk. II
/varset spell_haste_group_buff  		Aura of Loyalty Rk. II
/varset armor_class_buff  				Ward of Resolute
/varset hit_point_aego_buff 			Gallantry Rk. II
/varset hit_point_aego_group_buff  		Hand of Teremity
/varset hit_point_symbol_buff  			Symbol of Darianna Rk. II
/varset hit_point_symbol_group_buff  	Kaerra's Mark
/varset melee_guard_buff  				Shield of Vie Rk. II
/varset melee_guard_group_buff  		Rallied Shield of Vie

| - Group and Self Buffs to keep up!
| - Set to 1=On if you want to keep some buffs on ya automatically.
| - Or 0=Off if you want no possible delay in any heals.
/varset healer_buff_use 1
/varset healer_rebuff_use 1
/varset healer_rebuff_state 1
/varset healer_buff[1] Armor of the Solemn
/varset healer_buff[2] Aura of Loyalty Rk. II
/varset healer_buff[3] Gallantry Rk. II
/varset healer_buff[4] Rallied Shield of Vie
/varset healer_buff[5] NULL
/varset healer_buff[6] NULL
/varset healer_buff[7] NULL
/varset healer_buff[8] NULL
/varset healer_buff[9] NULL
| - Keep These buffs up on tank 	
/declare tank_buff_worn_off[5] int outer 0
/varset TankBufftodo[1] Shield of Vie Rk. III
/varset TankBufftodo[2] NULL
/varset TankBufftodo[3] NULL
/varset TankBufftodo[4] NULL
/varset TankBufftodo[5] NULL
| - Use These clickys for Self Buffs
/varset clicky_item_use  1
/varset clicky_item[1] Buckler of Unliving
/varset clicky_item_buff[1] Chaotic Enlightenment
/varset clicky_item[2] Golden Facade
/varset clicky_item_buff[2] Form of Endurance III
/varset clicky_item[3] Chokadai Spinestrip Belt
/varset clicky_item_buff[3] Maelin's Meditation
/varset clicky_item[4] NULL
/varset clicky_item_buff[4] NULL
/varset clicky_item[5] NULL
/varset clicky_item_buff[5] NULL
| ----------------------------------------------------------------------------
|  Misc Spells and AA's
| ----------------------------------------------------------------------------
| - Spells
/varset invulnerability_spell  			Divine Destiny
/varset yaulp_spell  		Yaulp X Rk. II
/varset aura_spell  		Aura of the Pious
/varset aura_spell_use  	1
| - Mount
/varset mount_use  			1
/varset mount_item_name  	Collapsable Roboboar
/varset auto_sit  1
/varset auto_sit_mob_distance  60

| Temporary spell slot until revised
/varset gem_10 Yaulp X Rk. II
| ----------------------------------------------------------------------------
| 	ChatoMatic - Beta settings 0=Off 1=On 
|	The commands sent via my_channel (your chat channel) or /tell will make 
| 	the cleric cast the spell on the appropriate target. These commands
|	will OVERRIDE ALL settings and the force cleric to cast the spell. 
|	You can customize your commands below. 
|
|	For buff/heal commands add the word 'them' to make the healer cast the buff on your target
|	i.e /tell mycleric heal - cleric will target and heal you
|	i.e /tell mycleric bor them  - cleric will assist & cast spell haste on your target
|
|	To switch functions commands on and of use the word 'toggle'
|	i.e /tell mycleric use mount toggle - turn mount on/off
|	i.e /tell mycleric nuke toggle - turn direct damage spell on/off
| ----------------------------------------------------------------------------
	/varset announce  1
| - Chat channel must be in the following Format: Channel:Password
|	/varset my_channel  Channel:Password
	/varset leave_all_channels_use 0
| - say_where will determine where messages go if Announce is on i.e. my_channel /tell 
|	/varset say_where my_channel
	/varset say_where /tell
	/varset tell_who TOONNAMEHERE

| -- Edit this line to change your start message to the say_where channel
/varset tank_start_message Healer alive and awake .. lets kill stuff
/varset low_mana_reporting 1
/varset out_of_mana_reporting 1
/varset no_tank_reporting 1

| - Heal Spells
	/varset complete_heal_ChatoMatic 	  			ch
	/varset patch_heal_ChatoMatic  	  				heal
	/varset heal_over_time_ChatoMatic 	  			hot
	/varset group_heal_ChatoMatic  	  				group heal
	/varset remove_curse_ChatoMatic  	  			rgc	 
	/varset pure_blood_ChatoMatic  	  				pb	
	/varset resurrection_ChatoMatic  	  			rez me
	/varset divine_arbitration_ChatoMatic  	  		divine	
| - Attack Spells
	/varset hammer_pet_ChatoMatic  					hammer time
	/varset reverse_damage_shield_ChatoMatic 		ds
	/varset direct_damage_magic_ChatoMatic  		nuke
	/varset direct_damage_stun_ChatoMatic  			stun
	/varset direct_damage_undead_ChatoMatic  		omg zombies
| - Buff Spells	
	/varset hit_point_symbol_buff_ChatoMatic 		symbol 
	/varset hit_point_symbol_group_buff_ChatoMatic  	symbol group 
	/varset armor_class_buff_ChatoMatic  			wog
	/varset hit_point_aego_buff_ChatoMatic 			aego 
	/varset hit_point_aego_group_buff_ChatoMatic 	aego group 
	/varset spell_haste_buff_ChatoMatic 			bor 
	/varset spell_haste_group_buff_ChatoMatic 		bor group
   	/varset melee_guard_buff_ChatoMatic 			vie 
	/varset melee_guard_group_buff_ChatoMatic 		vie group 

| - Miscellaneous
	/varset aura_spell_ChatoMatic					aura
	/varset debug_ChatoMatic						debug
	/varset announce_ChatoMatic					spam

| ----------------------------------------------------------------------------
|  Variables added for Beta Cut and paste to here
| ----------------------------------------------------------------------------	
| This space reserved for future changes and added variables. New additions are to be
| cut and paste here to cut down on having to redefine spells and settings 
| with each new Beta ver.	

| ----------------------------------------------------------------------------
|	Thing you don't need to worry about
/echo Variables from INC file successfully loaded
/return

spell_routines.inc ** Updated for Gem 10 recast timer **

Rich (BB code):
| spell_routines.inc
|
| Written by Rusty~
| Last Modified 07/05/2009
|
| Features:
| - Casts spells, clicks items, or uses AA abilities for you
| - Allows back to back casting without waiting on spell gems to pop all the way up
| - Will interrupt spell if target dies while casting. If on a mount, it will dismount and duck if the time left
|   is greater than 7 seconds, else it will move forward a bit to interrupt, then move you back
|    ** IMPORTANT: if you don't want to interrupt a spell while mounted, put this at the top of your macro: **
|    **   /declare noInterrupt int outer 1                                                                  **
| - Allows you to use items in bags. Equips item, clicks it, then returns it to its previous location
| - Lets you set how long you want to keep trying to cast the spell (defaults to 0)
|   If the spell is interrupted before the given time, it will recast, else it will return CAST_INTERRUPTED
| - Lets you call a custom subroutine while waiting for spell to finish casting
|   Try to keep custom subroutines very small. A common use would be to interrupt the spell if a certain condition is true
| - This file also includes a sub named Interrupt. You can call this to interrupt any spell you're casting instantly.
| - You can also use the SwapItem sub included in this to swap items to certain slots
| - Added EquipItem sub to easily equip items in your main Inventory slots.
| - Note: if you don't want this to cast spells while you're invis, in your main macro have this at the top:
|      /declare noInvis int outer 1
|   This will make it return CAST_INVIS if you're invis
|
|  Below is a list of outer scope variables you can access in your macros:
|      refreshTime        - How much time is left till you're done recovering from casting
|      castEndTime        - How much time left till you're done casting the current spell... usable in custom spell Subs
|      spellNotHold       - 1 if your last spell didn't take hold, 0 otherwise
|      spellRecastTime1-10 - How much time left till that spell is back up
|
|======================================================================================================================
|  EquipItem:  An easier way to equip items you have in bags ( useful for weapons or focus items )
|              slot name is optional. If not given, it will equip it in the first possible spot
|
|    Usage:   
|        /call EquipItem "item name|slotname"
|
|        Returns: "old item name|slotname"
|    Examples:
|   
|    To Equip Sharp Ended Broken Lever when you have Serpent of Vindication equiped:
|        /call EquipItem "Sharp Ended Broken Lever"
|    It will return "Staff of Vindication|mainhand"
|    To reequip the original item, you can save the return in a variable, and then use it later like this:
|       /varset oldPrimary ${Macro.Return}
|       | ... do stuff here with your new item equiped
|       /call EquipItem ${oldPrimary}
|
|======================================================================================================================
|  SwapItem:  a subroutine which is used in the Cast sub itself. You don't need to do this to cast an item in a bag
|             but you can call it in your macro to SwapItems (such as weapons or focus items)
|    Usage:   
|        /call SwapItem "item name" slotname|slotID
|    Examples:
|   
|    To swap Darkblade of the Warlord to your main hand:
|        /call SwapItem "Darkblade of the Warlord" mainhand
|
|    To swap stat food in one bag with other food in another bag:
|        /call SwapItem "Bristlebanes Party Platter" ${FindItem[halas 10lb meat pie].InvSlot}
|
|======================================================================================================================
|  Cast: the main subroutine that casts spells or items for you
|     Usage:
|        /call Cast "spellname|itemname|AAname|AA#" [item|alt|gem#] [give up time][s|m] [custom subroutine name]
|     Examples:
|
|     To cast Howl of Tashan and mem it in slot 3 if not memmed:
|       /call Cast "Howl of Tashan" gem3
|
|     To cast Arcane Rune and keep trying for 7 seconds, in case of interrupts.
|       /call Cast "Arcane Rune" gem5 7s
|
|     To click Grim Aura earring that's in a bag:
|       /call Cast "Shrunken Goblin Skull Earring" item
|
|     To use AA ability Eldritch Rune:
|       /call Cast "Eldritch Rune" alt
|         or
|       /call Cast "173" alt
|
|     To call a subroutine that interrupts CH if target gets healed before it lands:
|       /call Cast "Complete Healing" gem1 0 CheckHP
|     Then in your macro have somewhere:
|       Sub CheckHP
|          /if ( ${Target.PctHPs}>=80 ) /call Interrupt
|       /return
|
| Returns these values:
|----------------------+----------------------------------------------------------------------+
| CAST_CANCELLED       | Spell was cancelled by ducking (either manually or because mob died) |
| CAST_CANNOTSEE       | You can't see your target                                            |
| CAST_IMMUNE          | Target is immune to this spell                                       |
| CAST_INTERRUPTED     | Casting was interrupted and exceeded the given time limit            |
| CAST_INVIS           | You were invis, and noInvis is set to true                           |
| CAST_NOTARGET        | You don't have a target selected for this spell                      |
| CAST_NOTMEMMED       | Spell is not memmed and you gem to mem was not specified             |
| CAST_NOTREADY        | AA ability or spell is not ready yet                                 |
| CAST_OUTOFMANA       | You don't have enough mana for this spell!                           |
| CAST_OUTOFRANGE      | Target is out of range                                               |
| CAST_RESISTED        | Your spell was resisted!                                             |
| CAST_SUCCESS         | Your spell was cast successfully! (yay)                              |
| CAST_UNKNOWNSPELL    | Spell/Item/Ability was not found                                     |
|----------------------+----------------------------------------------------------------------+

#event BeginCast "You begin casting#*#"
#event Collapse "Your gate is too unstable, and collapses.#*#"
#event FDFail "#1# has fallen to the ground.#*#"
#event Fizzle "Your spell fizzles#*#"
#event Immune "Your target is immune to changes in its attack speed#*#"
#event Immune "Your target is immune to changes in its run speed#*#"
#event Immune "Your target cannot be mesmerized#*#"
#event Interrupt "Your casting has been interrupted#*#"
#event Interrupt "Your spell is interrupted#*#"
#event NoHold "Your spell did not take hold#*#"
#event NoLOS "You cannot see your target.#*#"
#event NoTarget "You must first select a target for this spell!#*#"
#event NotReady "Spell recast time not yet met.#*#"
#event OutOfMana "Insufficient Mana to cast this spell!#*#"
#event OutOfRange "Your target is out of range, get closer!#*#"
#event Recover "You haven't recovered yet...#*#"
#event Recover "Spell recovery time not yet met#*#"
#event Resisted "Your target resisted the #1# spell#*#"
#event Resisted2 "You resist the #1# spell#*#"
#event Standing "You must be standing to cast a spell#*#"
#event Stunned "You are stunned#*#"
#event Stunned "You can't cast spells while stunned!#*#"
#event Stunned "You *CANNOT* cast spells, you have been silenced!#*#"
#event NoMount "#*#You can not summon a mount here.#*#"

Sub Cast(string spellName,string spellType,timer giveUpTimer,string mySub)
   /declare castTime float local
   /if ( ${spellType.Equal[item]} ) {
      /varset castTime ${FindItem[${spellName}].CastTime}
   } else /if ( ${spellType.Equal[alt]} ) {
      /varset castTime ${AltAbility[${spellName}].Spell.MyCastTime}
   } else {
      /varset castTime ${Spell[${spellName}].MyCastTime}
   }
   /if ( ${Me.Invis} && ${noInvis} ) {
      /return
   }
   :wait_for_stop
   /if ( !${Defined[spellType]} ) /declare spellType string local spell
   /if ( ${Me.Casting.ID} ) {
      /if ( ${Defined[mySub]} ) /call ${mySub}
      /goto :wait_for_stop
   } 
   /if ( ${Me.Speed} ) {
   :wait_for_stop2
      /if ( ${Defined[mySub]} ) /call ${mySub}
      /if ( ${Me.Moving} && ${castTime}>0.1 ) /goto :wait_for_stop2
   }
   /if ( !${Defined[giveUpTimer]} ) /declare giveUpTimer timer local 0
   /if ( !${Defined[spellRecastTime1]} ) {
      /if ( !${Defined[noInterrupt]} ) /declare noInterrupt int outer 0
      /declare moveBack bool outer false
      /declare selfResist int outer
      /declare selfResistSpell string outer
      /declare castEndTime timer outer
      /declare refreshTime timer outer 0
      /declare itemRefreshTime float outer 0
      /declare startCastingLoc string outer
      /declare i int local
      /declare castReturn string outer
      /declare spellNotHold string outer
      /delay 5
      /for i 1 to 10
         /declare spellRecastTime${i} timer outer
         /if ( ${Me.SpellReady[${i}]} ) {
            /varset spellRecastTime${i} 0
         } else {
            /varcalc spellRecastTime${i} 10*${Me.Gem[${i}].RecastTime}
         }
      /next i
   }
   /varset spellNotHold 0
   /varset selfResist 0
   /declare delayTime timer local
   /declare swapItemBack bool local false
   /declare slotName int local
   /declare oldItemName string local
   /declare slotID int local
   /declare oldSlotID int local
   /declare spellID int local
   /declare charges int local

   /if ( ${Window[SpellBookWnd].Open} ) /keypress spellbook
   /if ( ${Me.Ducking} ) /keypress duck
   /if ( !${Me.Standing} ) /stand

   /doevents Recover
   /doevents BeginCast
   /doevents Fizzle
   /doevents Interrupt
   /doevents Standing
   /doevents FDFail
   /doevents OutOfRange
   /doevents OutOfMana
   /doevents NoLOS
   /doevents Resisted2
   /doevents Resisted
   /doevents Immune
   /doevents Stunned
   /doevents Collapse
   /doevents NoTarget
   /doevents NotReady
   /varset castReturn CAST_SUCCESS
   
      /if ( ${spellType.Equal[item]} ) /goto :cast_item
   /if ( ${spellType.Equal[alt]} ) /goto :cast_alt

:cast_spell
   /if ( !${Int[${Me.Book[${spellName}]}]} ) {
      /echo Spell: "${spellName}" was not found in your book
      /return CAST_UNKNOWNSPELL
   }
   /if ( !${Me.Gem[${spellName}]} ) {
   :mem_spell
      /if ( ${Cursor.ID} ) {
         /autoinventory
         /delay 5
         /goto :mem_spell 
      }
      /if ( ${spellType.Left[3].Equal[gem]} ) {
         /memspell ${spellType.Right[1]} "${spellName}"
      } else {
         /return CAST_NOTMEMMED
      }
      /delay 6s ${Me.Gem[${spellName}]}
      /if ( !${Me.Gem[${spellName}]} ) {
         /echo Spell mem interrupted...
         /return CAST_INTERRUPTED
      }
      :wait_for_mem
     
      /delay 15s ${Me.SpellReady[${spellName}]}
      /if ( !${Me.SpellReady[${spellName}]} ) {
         /if ( ${giveUpTimer} ) /goto :wait_for_mem
         /return CAST_NOTREADY
      }
   }
   /varset spellType spell
   /if ( ${spellName.Find[illusion: ]} && ${Me.AltAbilityReady[project illusion]} ) /call Cast "project illusion" alt

   /varset giveUpTimer ${giveUpTimer.OriginalValue}
   /declare recoverWaitTime timer local 30

:cast_spell_loop
:wait_for_spell
   /if ( ${Me.SpellReady[${spellName}]} ) {
      /varset spellRecastTime${Me.Gem[${spellName}]} 0
      /goto :skip_delay 
   }
   /if ( ${spellRecastTime${Me.Gem[${spellName}]}}  ) {
      /if ( !${giveUpTimer} ) /return CAST_NOTREADY
      /if ( ${Defined[mySub]} ) /call ${mySub}
      /goto :wait_for_spell
   }
   /if ( !${refreshTime} ) /goto :skip_delay
:wait_on_refresh
   /if ( ${Me.SpellReady[${spellName}]} ) /varset refreshTime 0
   /if ( ${refreshTime}>0 ) {
      /if ( ${Defined[mySub]} ) /call ${mySub}
      /goto :wait_on_refresh
   }
   /varcalc delayTime 10*(1.5-${Spell[${spellName}].MyCastTime})
:cast_delay_loop
   /if ( ${delayTime}>0 ) {
      /if ( ${Defined[mySub]} ) /call ${mySub}
      /goto :cast_delay_loop
   }
:skip_delay
   /varset startCastingLoc ${Me.X} ${Me.Y} ${Me.Z}
   /cast "${spellName}"

   /if ( ${Me.Casting.ID} ) {
      /varset spellID ${Me.Casting.ID}
      /varcalc castEndTime ${Me.Casting.MyCastTime}*10
      /if ( ${castEndTime}<${Math.Calc[${Me.Casting.CastTime}*5]} ) /varcalc castEndTime ${Me.Casting.CastTime}*5
      /echo Casting: ${Me.Casting.Name}${If[!${Me.Casting.TargetType.Equal[PB AE]} && !${Me.Casting.TargetType.Equal[self]} && ${Target.ID}, on >> ${Target.CleanName} <<,]}
   }

   /varset moveBack false

   /call WaitCast ${mySub}

   /if ( ${moveBack} ) {
      /keypress back hold
      /delay 4
      /keypress back
      /delay 15 !${Me.Moving}
   }

   /if ( ${castReturn.Equal[CAST_CANCELLED]} ) {
      /echo Spell was cancelled...
      /return CAST_CANCELLED
   }

   /doevents Recover
   /doevents BeginCast
   /doevents Fizzle
   /doevents Interrupt
   /doevents Standing
   /doevents FDFail
   /doevents OutOfRange
   /doevents OutOfMana
   /doevents NoLOS
   /doevents Resisted2
   /doevents Resisted
   /doevents Immune
   /doevents Stunned
   /doevents Collapse
   /doevents NoTarget
   /doevents NotReady
   
   /if ( !${spellID} ) /varset spellID ${Spell[${spellName}].ID}
   /if ( !${castReturn.Equal[CAST_SUCCESS]} ) {
      /if ( ${castReturn.Equal[CAST_NOTREADY]} ) /return CAST_NOTREADY
      /if ( ${castReturn.Equal[CAST_FIZZLE]} ) {
         /echo Spell Fizzled. Recasting...
         /goto :cast_spell_loop
      }
      /if ( ${castReturn.Equal[CAST_RECOVER]} ) {
         /if ( !${recoverWaitTime} ) {
            /varcalc spellRecastTime${Me.Gem[${spellName}]} 10*${Spell[${spellID}].RecastTime}
            /if ( !${giveUpTimer} ) /return CAST_NOTREADY
         }
         /goto :cast_spell_loop
      }
      /if ( ${castReturn.Equal[CAST_RESTART]} ) /goto :cast_spell_loop
      /if ( ${castReturn.Equal[CAST_STUNNED]} ) {
         /if ( ${Me.Stunned} ) {
            /delay 3s !${Me.Stunned}
         } else {
            /delay 7
         }
         /goto :cast_spell_loop
      }
      /if ( ${castReturn.Equal[CAST_INTERRUPTED]} ) {
         /if ( ${giveUpTimer} ) {
            /echo Spell was interrupted. Recasting...
            /goto :cast_spell_loop
         }
         /echo Spell was interrupted...
         /return CAST_INTERRUPTED
      }
   }
   /if ( !${castReturn.Equal[CAST_CANNOTSEE]} && !${castReturn.Equal[CAST_OUTOFRANGE]} && !${castReturn.Equal[CAST_OUTOFMANA]} && !${castReturn.Equal[CAST_NOTARGET]} ) {
      /varcalc refreshTime 10*${Spell[${spellID}].RecoveryTime}
      /varcalc spellRecastTime${Me.Gem[${spellName}]} 10*${Spell[${spellID}].RecastTime}
   }
   /if ( ${castReturn.Equal[CAST_COLLAPSE]} ) {
      /varset giveUpTimer 200
      /goto :cast_spell_loop
   }
/return ${castReturn}


:cast_item
   /if ( !${FindItem[${spellName}].InvSlot} ) {
      /echo Cannot find item: ${spellName}
      /return CAST_UNKNOWNSPELL
   } 
   /if ( ${FindItem[${spellName}].InvSlot}>22 ) {
      /varset swapItemBack true
      /if ( ${FindItem[${spellName}].WornSlot[1]} && ${FindItem[${spellName}].EffectType.Find[worn]} ) {
         /varset slotName ${FindItem[${spellName}].WornSlot[1]}
      } else /if ( ${FindItem[${spellName}].InvSlot}>30 ) {
         /varset slotName 30
      } else {
         /varset slotName ${FindItem[${spellName}].InvSlot}
      }
      /varset slotID ${InvSlot[${slotName}].ID}     
      /varset oldSlotID ${FindItem[${spellName}].InvSlot.ID}
      /varset oldItemName ${InvSlot[${slotID}].Item.Name}
      /call SwapItem "${spellName}" ${slotID}
   }
:cast_item_loop
:wait_item_loop
   /if ( ${itemRefreshTime} > ${MacroQuest.Running} ) {
      /delay 1
      /goto :wait_item_loop
   }
   /varset itemRefreshTime ${Math.Calc[${MacroQuest.Running}+000]}
   /varset charges ${FindItem[${spellName}].Charges}
   /varset startCastingLoc ${Me.X} ${Me.Y} ${Me.Z}
   /cast item "${spellName}"
   /if ( ${Me.Casting.ID} ) {
      /varcalc castEndTime ${FindItem[${spellName}].CastTime}*10
      /echo Casting: ${FindItem[${spellName}].Spell.Name}${If[!${FindItem[${spellName}].Spell.TargetType.Equal[PB AE]} && !${FindItem[${spellName}].Spell.TargetType.Equal[self]} && ${Target.ID}, on >> ${Target.CleanName} <<,]}
   }
   /if ( ${charges}>0 ) /delay 1s ${FindItem[${spellName}].Charges}!=${charges}

   /call WaitCast ${mySub}
   
   /if ( ${swapItemBack} ) {
      /if ( ${FindItem[${spellName}].ID} ) {
         /call SwapItem "${spellName}" ${oldSlotID}
      } else /if ( ${FindItem[${oldItemName}].ID} ) {
         /call SwapItem "${oldItemName}" ${slotID}         
      }
      /if ( ${Cursor.Container} ) /autoinventory
   }

   /if ( ${castReturn.Equal[CAST_CANCELLED]} ) {
      /echo Spell was cancelled...
      /return CAST_CANCELLED
   }

   /doevents BeginCast
   /doevents Interrupt
   /doevents Standing
   /doevents FDFail
   /doevents OutOfRange
   /doevents NoLOS
   /doevents Resisted2
   /doevents Resisted
   /doevents Immune
   /doevents Stunned
   /doevents Collapse
   /doevents NoTarget
   /doevents NotReady

   /if ( !${castReturn.Equal[CAST_SUCCESS]} ) {
      /if ( ${castReturn.Equal[CAST_NOTREADY]} ) /return CAST_NOTREADY
      /if ( ${castReturn.Equal[CAST_RESTART]} ) /goto :cast_item
      /if ( ${castReturn.Equal[CAST_STUNNED]} ) {
         /if ( ${Me.Stunned} ) {
            /delay 3s !${Me.Stunned}
         } else {
            /delay 7
         }
         /goto :cast_item
      }
      /if ( ${castReturn.Equal[CAST_INTERRUPTED]} ) {
         /if ( ${giveUpTimer} ) {
            /echo Spell was interrupted. Recasting...
            /goto :cast_item
         }
         /echo Spell was interrupted...
         /return CAST_INTERRUPTED
      }
   }
   /if ( ${castReturn.Equal[CAST_COLLAPSE]} ) {
      /varset giveUpTimer 200
      /goto :cast_item
   }
/return ${castReturn}


:cast_alt
   /if ( !${Me.AltAbilityReady[${spellName}]} ) /return CAST_NOTREADY
   /echo Using AA Ability: ${AltAbility[${spellName}].Name}
   /alt activate ${AltAbility[${spellName}].ID}
   /if ( ${AltAbility[${spellName}].Spell.MyCastTime}>=0.5 ) /delay 1s ${Me.Casting.ID}
   /call WaitCast ${mySub}
   
   /if ( ${castReturn.Equal[CAST_CANCELLED]} ) {
      /echo Spell was cancelled...
      /return CAST_CANCELLED
   }
   
   /doevents BeginCast
   /doevents Interrupt
   /doevents Standing
   /doevents FDFail
   /doevents OutOfRange
   /doevents NoLOS
   /doevents Resisted2
   /doevents Resisted
   /doevents Immune
   /doevents Stunned
   /doevents NoTarget
     
   /if ( !${castReturn.Equal[CAST_SUCCESS]} ) {
      /if ( ${castReturn.Equal[CAST_RESTART]} ) /goto :cast_alt
      /if ( ${castReturn.Equal[CAST_STUNNED]} ) {
         /if ( ${Me.Stunned} ) {
            /delay 3s !${Me.Stunned}
         } else {
            /delay 7
         }
         /goto :cast_alt
      }
      /if ( ${castReturn.Equal[CAST_INTERRUPTED]} ) {
         /if ( ${giveUpTimer} ) {
            /echo Spell was interrupted. Recasting...
            /goto :cast_alt
         }
         /echo Spell was interrupted...
         /return CAST_INTERRUPTED
      }
   }
/return ${castReturn}


Sub EquipItem(string WhatWhere)
   /declare DestName string local
   /declare ItemName string local ${String[${WhatWhere}].Arg[1,|]}
   /declare SlotName string local ${String[${WhatWhere}].Arg[2,|]}
   /if (${SlotName.Equal[NULL]}) /varset SlotName ${InvSlot[${FindItem[=${ItemName}].WornSlot[1]}].Name}
   /if (${FindItem[=${ItemName}].InvSlot}<23 || !${FindItem[=${ItemName}].WornSlot[${SlotName}]}) /return
   /if (!${InvSlot[${SlotName}].Item.Name.Equal[NULL]}) /varset DestName "${InvSlot[${SlotName}].Item.Name}|${SlotName}"
   /call SwapItem "${ItemName}" "${SlotName}"
/return ${DestName}

| Sub EquipItem(string itemName,string slotName)
   /if ( !${Defined[slotName]} ) /declare slotName string local ${FindItem[${itemName}].WornSlot[1]}
   /declare oldItem string local ${Me.Inventory[${slotName}].Name}
   /call SwapItem "${itemName}" ${slotName}
/return "${oldItem}" ${slotName}

Sub SwapItem(string itemName,string slotName)
   /if ( ${InvSlot[${slotName}].Item.Name.Equal[${itemName}]} ) /return
   /declare slotID int local
   /declare oldSlotID int local
   /declare oldItem string local
   /declare i int local
   /varset slotID ${InvSlot[${slotName}].ID}           | slotID = slot you're swapping item to
   /varset oldSlotID ${FindItem[${itemName}].InvSlot.ID} | oldSlotID = slot the item was originally in
   /varset oldItem ${InvSlot[${slotName}].Item.Name}     | oldItem = name of item in the slot you're swapping WITH
   /if ( !${slotID} ) {
      /echo Invalid slot name: ${slotName}
      /return
   }
   /if ( !${oldSlotID} ) {
      /echo Could not find item ${itemName}
      /return
   }
:auto_inv
   /if ( ${Cursor.ID} && !${Cursor.Name.Equal[${itemName}]} ) {
      /if ( ${Cursor.Container} ) {
         /for i 1 to 8
            /if ( !${InvSlot[pack${i}].Item.Container} ) {
               /nomodkey /itemnotify pack${i} leftmouseup
            }
         /next i
      } else {
         /autoinventory
      }
      /goto :auto_inv
   }
   

:pick_up_item
 | if the item is in a bag and it's not open, then open it!
   /if ( ${InvSlot[${oldSlotID}].Pack} && !${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup

 | if the slot you're putting it in is inside a bag and it's not open, then open it!
   /if ( ${InvSlot[${slotID}].Pack} && !${Window[${InvSlot[${slotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${slotID}].Pack} rightmouseup

 | ok.. pick up the item now!
   /squelch /nomodkey /shiftkey /itemnotify ${InvSlot[${oldSlotID}]} leftmouseup

 | if item isn't on your cursor, try again!
   /if ( !${Cursor.Name.Equal[${itemName}]} ) {
      /if ( ${Cursor.ID} && !${Cursor.Container} ) /autoinventory
      /goto :pick_up_item
   }
:exchange_items
   /if ( ${InvSlot[${oldSlotID}].Pack} && !${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup
   /if ( ${InvSlot[${slotID}].Pack} && !${Window[${InvSlot[${slotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${slotID}].Pack} rightmouseup

 | put the item in the new slot, and pick up whatever item was there
   /squelch /nomodkey /shiftkey /itemnotify ${slotID} leftmouseup

 | if it didnt get exchanged, try again!
   /if ( ${Cursor.ID} && !${Cursor.Name.Equal[${oldItem}]} && !${Cursor.Name.Equal[${itemName}]} && !${Cursor.Container} ) /autoinventory
   /if ( !${InvSlot[${slotID}].Item.Name.Equal[${itemName}]} ) /goto :exchange_items
:drop_item
   /if ( !${Cursor.Container} || ( ${InvSlot[${oldSlotID}]}<30 && ${InvSlot[${oldSlotID}]}>=23 ) ) {
      /if ( ${InvSlot[${oldSlotID}].Pack} && !${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup
      /if ( ${InvSlot[${slotID}].Pack} && !${Window[${InvSlot[${slotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${slotID}].Pack} rightmouseup
      /squelch /nomodkey /itemnotify ${oldSlotID} leftmouseup
      /if ( ${Cursor.ID} ) {
         /if ( !${Cursor.Name.Equal[${oldItem}]} ) /autoinventory
         /goto :drop_item
      }
   }
:close_pack
   /if ( ${InvSlot[${oldSlotID}].Pack} && ${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} && ( ${Cursor.Name.Equal[${itemName}]} || ${FindItem[${itemName}].ID} ) ) {
      /squelch /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup
      /goto :close_pack
   }
   /if ( ${InvSlot[${slotID}].Pack} && ${Window[${InvSlot[${slotID}].Pack.Name}].Open} && ( ${Cursor.Name.Equal[${itemName}]} || ${FindItem[${itemName}].ID} ) ) {
      /squelch /nomodkey /itemnotify ${InvSlot[${slotID}].Pack} rightmouseup
      /goto :close_pack
   }
/return

Sub Interrupt
   /if ( ${Me.Mount.ID} ) /dismount
   /stopcast
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_CANCELLED
/return ${Macro.Return}


Sub WaitCast(string mySub)
   /declare currentTarget int local ${Target.ID}
   /declare currentTargetType string local ${Target.Type}
:wait_cast_loop
   /if ( ${Bool[${mySub}]} ) /call ${mySub}
   /if ( ${Me.Casting.ID} ) {
      /if ( ${currentTarget} && !${Spawn[${currentTarget}].Type.Equal[${currentTargetType}]} ) {
         /if ( !${Me.Casting.TargetType.Equal[PB AE]} && !${Me.Casting.TargetType.Equal[self]} && !${moveBack} && ( !${Me.Mount.ID} || !${noInterrupt} ) ) {
            /if ( !${Me.Mount.ID} || ${castEndTime}>70 ) {
               /call Interrupt
            } else /if ( ${Me.Casting.RecastTime}>3 ) {
               /varset castReturn CAST_CANCELLED
               /keypress forward hold
               /delay 6
               /keypress forward
               /varset moveBack true
            }
         }
      }
      /if ( ${Me.State.Equal[DUCK]} ) /varset castReturn CAST_CANCELLED
      /delay 1
      /goto :wait_cast_loop
   }
/return

Sub Event_Fizzle
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_FIZZLE
/return

Sub Event_Resisted(string line,string name)
   /if ( ${selfResist} && ${name.Equal[${selfResistSpell}]} ) {
      /varset selfResist 0
      /return   
   }
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_RESISTED
/return

Sub Event_Resisted2(string line,string name)
   /if ( ${Defined[selfResist]} ) {
      /varset selfResist 1
      /varset selfResistSpell ${name}
   }
/return

Sub Event_Interrupt
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_INTERRUPTED
/return

Sub Event_Recover
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_RECOVER
/return

Sub Event_Immune
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_IMMUNE
/return

Sub Event_Stunned
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_STUNNED
/return

Sub Event_NoLOS
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_CANNOTSEE
/return

Sub Event_Standing
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_RESTART
/return

Sub Event_Collapse
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_COLLAPSE
/return

Sub Event_OutOfMana
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_OUTOFMANA
/return

Sub Event_OutOfRange
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_OUTOFRANGE
/return

Sub Event_NoTarget
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_NOTARGET
/return

Sub Event_NotReady
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_NOTREADY
/return

Sub Event_NoHold
   /if ( ${Defined[spellNotHold]} ) /varset spellNotHold 1
/return

Sub Event_BeginCast
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_SUCCESS
/return

Sub Event_FDFail(string line,string name)
   /if ( ${name.Equal[${Me.Name}]} && ${Defined[castReturn]} ) {
      /if ( !${Me.Standing} ) /stand
      /varset castReturn CAST_RESTART
   }
/return 

Sub Event_NoMount
/return CAST_NOMOUNT

If you are using the NON_VIP Spell_Routines.inc

Change the following for spell gem 10 support. Old code line 168 ish in red new code in blue.
Fixes - /varset failed. variable 'spellRecastTime10' not found - error. Fix included in above file.

FROM
Rich (BB code):
     /for i 1 to 9  
         /declare spellRecastTime${i} timer outer
         /if ( ${Me.SpellReady[${i}]} ) {
            /varset spellRecastTime${i} 0
         } else {
            /varcalc spellRecastTime${i} 10*${Me.Gem[${i}].RecastTime}
         }
      /next i
   }
TO
Rich (BB code):
     /for i 1 to 10  
         /declare spellRecastTime${i} timer outer
         /if ( ${Me.SpellReady[${i}]} ) {
            /varset spellRecastTime${i} 0
         } else {
            /varcalc spellRecastTime${i} 10*${Me.Gem[${i}].RecastTime}
         }
      /next i
 
Last edited:
|--- Changes from Original Healer.mac

[05-18-2009]
- Quick fix to be able to select Merc as MT
- Implemented Promised heal feature to include new expansions Promised Renewal@73 Promised Restoration@78 Promised Recuperation@83
- Changed recast time to 24 secs instead of 18 secs since Extended Spell Duration AAs affect PRHeal line of spells

[06-03-2009]
- Adjusted GoMana event to recognize all Gift of Mana AA messages
- Added Cleric Aura feature

[06-14-2009]
- Separated Nuke/DS/HammerPet into individual variables. Removed Autonuke feature that all these were grouped under previously.
- Removed the hard coded buff beg section was obsolete.
- Reorganized all Variables/spells into 4 areas Healing/Damage/Buffs/Misc for simplification
- Started to label/comment all subroutines for simplification and debugging
- Revised PRenewal timer to recognize if cleric has Spell Casting Reinforcement AA's.
- Removed nuke 2 and stun 2
- Will now dismount and turn off mount when using "Follow Me" command and reactivate mount with "Stop follow" command if to use mount is on.
- Added Mercenary recognition to turn off tells if Mercenary is MT
- Fixed Chat event channel wasn't recognizing requests from chat channel if active.

[06-23-2009]
- Added Clicky Support
- Reset all Gem9 code to Gem8
- Added "Use Mount" Chat/Tell Command to toggle mount usage on and off

[06-26-2009]
- Rewrote most of Nuke/DS/HammerPet section. Added a better targeting subroutine. All damage spells can be customized. % mana, % mob health, turn on/off, chat commands
- Added Epic 1.5 and epic 2.0 support under Divine arbitration. (Thanks to alt228's suggestion)
- Added Zoning protection to Divine Arbitration/Epics to prevent them from firing after cleric zones. (Thanks to alt228's suggestion)
- Added a chat/tell to activate Divine Arbitration/Epics
- Separated Variables into an INC not an ini file but it works. (I blame alt228)

[06-27-2009]
- Total rewrite of the :tankwatchloop tank targeting loop by Alatyami. (Thanks so much)
- Added resurrection support to chat request function

[06-29-2009]
- Sycn'd up help function with current spell casting commands
- Automatic recognition of complete heal vs promised heal line.
- Add timer to prevent over nuking

[7-2-2009]
- CastoMatic beta added for heal spells. Will find and memorize your highest level heal spells
- Sync'd up a bunch of misc mob distance for buffs to ${auto_sit_mob_distance} variable
-** Beta of Healer.mac Released **

[7-5-2009]
- Beta of Healer.mac v1.1 - ** POSTED **
- Finished renaming all variables and subs for clarity and consistency
- Yanked old group buff chat routine that was really Pally/Symbol happy
- Revised heal when FD only group and interrupt codes. `
- Fixed a nasty loop with mount/announce/interrupt with cleric trying to heal with FD switch on.
- Fixed various misspellings.

[7-9-2009]
- Tweaked CastoMatic auto find/mem spells loop


*** Preview of new settings file with renamed variables at the bottom of page ***

|--- Working on currently
- Syncing, rewriting, and cleaning up chat commands for buffs, nukes, and toggles
- writing in macro help function/command list
- Rewriting the spell mem routines and gem 9/10 support.


|--- To Do List
- Add Spell Gem 9 and 10 recognition
- Add recognition for PoK, PoT, Baz, GH and GL so macro goes into Chat command mode only
- Reconcile Hot Key parameters with CastoMatic settings
- Match up GoM AA level with Group Heal.
- Add better HoT support i.e. hot tank automatically on inc.
- Define GoMana Event better code from my previous quick fix
- Add Divine Intervention support - Buffs Section
- Further definition of Mercenary recognition
- Add secondary tank recognition
- Add pet as main tank recognition
- Add pet healing option
- Separate out main tank as controller functionality since MT can be mercenaries.
- Add a PL mode for recognizing tanks out of group (suggestion by Alatyami)
- Add Autohealmode 4 - Tank, cleric and my group will be healed but not manasponge merc warriors.

|--- Wish List
- Macro to search spell book and add predefined spell sets according to cleric level and settings
- Add chat recognition from healer mercs to prevent over healing`
 
Last edited:
This post is the logic I am using, brief history and the road map for healer.mac. This macro was originally adapted by Alatyami from a version of afcleric about 4-5 years. It worked much better that the original afcleric IMO I used it for years. The macro was limited after The Serpents Spine came out and the Promised Reneawal line of spells was introduced. Crystane modified the macro after to use the Promised Renewal line, Gift of Mana and some and some other other stuff. This made it usable again. Alatyami even posted a version after tha twith Slot 10 gem support in it. The macro hasn't been updated in a few years with the new levels of Promised heals, GoM, Mercs Etc. I am going to try and revise and update the macro for SoD.

Main Goals

1. Rewrite healer.mac keeping the original functions and ideas intact while updating it for current EQ and MQ2.

2. Use as few plugins as possible
a. Macro will based on spell_routines.inc

3. Base logic on cleric level progression and role in group settings
a. Example a level 30 cleric will only have 8 spells slots, Spell gems 9 and 10 aren't even available until level 55 and 75.

4. Make macro settings intuitive and easy to use.
a. Lots of documentation and no obscure ini files with 500 settings only the original programmer understands

5 Make macro scalable for future expansions
a. Spell gem 11 and 12 lol?

What this macro won't do.

1. Run your cleric as a faceless box on raids in ch rotations.
2. Run your cleric around soloing acting a main tank or battle cleric
3. Run your shammy or druid or any other class.

Here are my ideas about basing the variables and spells on the game itself and level progression. For my first example I am only using healing spells and all that covers. This would be the core for the macro's base healing logic and routines. To start and to keep it simple stupid (KISS) items and AA's will be added later and only where they can replace or fit into these healing categories. i.e. Resurrection 96% - level 56 > Epic 1.0 - Level 46 > Blessing of Resurrection - level 65

Heals
Heal - level 1
Duration Heal - level 19
Heal Group - level 30
Heal Complete - level 39
Duration Heal Group - level 44
Quick Heal - level 51
Delayed Heal - level 73

Cures
Cure Poison - level 1
Cure Blindness - level 2
Cure Disease - level 4
Cure Curse - level 23
Cure Group - level 51 poison/disease
Cure Corruption - level 74

Resurrection
Resurrection 0% - level 12
Resurrection 96% - level 56

Realistically most people will power level their cleric to make them useful. The initial spell gems will be based on a 60 level cleric with no AA's or only 8 spell gems keeping the macro compatible with a lv 1 cleric. This line up in my experience is a good start allowing the cleric to heal and dps with a minimum of swapping spells in and out. I have left out DA initially because in my experience of a macro'd cleric it made little difference overall and the gem slot was better utilized for dps but it will be interesting to hear thoughts on leaving DA out.

Spell Gem 1 Heal/Quick Heal
Spell Gem 2 Heal Complete - CH
Spell Gem 3 Duration Heal - HoT
Spell Gem 4 Heal Group/Duration Heal Group
Spell Gem 5 Direct Damage - Nuke
Spell Gem 6 Pet
Spell Gem 7 Damage Shield/DA/DI
Spell Gem 8 Stun/Buffs/Misc/Cure/Resurrection/Pacify

Please post your ideas and comments. I am open to criticism if it is constructive and will help improve the macro.
 
Last edited:
[Bus Reported]
- Keeps trying to cast Aura while dead and floating.
 
Last edited:
Looks like you've really put some time in here, gonna try it out tonight

Thanks
 
Healer.mac Beta

Users who are viewing this thread

Back
Top
Cart