• 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 Revamp

Joined
Feb 8, 2005
RedCents
8,901¢
I removed hundreds of lines of code on this great healing macro. I revamped all the calls to be based of MQ2Cast plugin instead of the craptastic spell_routines.inc file. This is basically a brand new modern day macro without all the clutter. Its sped up considerably for faster reactions to its predecessors as well. Here is the version history, with detailed modification logs in post below.

v0.5 2-28-2011
v0.6 3-1-2011
v0.7 3-2-2011
v0.8 3-11-2011
v0.9 3-16-2011
v0.91 6-1-2011
v0.92 6-1-2011
v0.93 6-2-2011
v0.94 6-7-2011
v0.95 4-11-2012
v0.99 8-7-2012

Official Release will be v1.0

Healer.mac v0.99 Beta Test in Progress
Things that are still being tested
-Pet Heals
-Auto-Mount

Toggle the options at the start of the macro

Bugs so far:
-Various death bugs, need to work on subs that control when cleric dies and better handling of group member deaths.
 

Attachments

Last edited by a moderator:
Re: Healer.mac Revamp **ALPHA TEST**

Bug Fixes v0.5
-------------
-Buffing set to FALSE, not working correctly
-Aura can get caught in infinite loop if casting

Bug Fixes v0.6
--------------
-Removed all Buffing
-Fixed Divine Arb calls (also added universal epicshield variable for those still using Epic 1.5)
-Fixed spell interrupts (was incorrectly calling a interrupt sub-routine)
-Revamp sit logic to be based off combat state, instead of NPC distance (No more constant standing around Quest NPCs)

Bug Fixes v0.7
--------------
-Removed Aura code that broke on March 9th Patch
-Revamped Group healing for Group Heals only
-Fixed Sit/Stand bug
-Revamped Nukes to ONLY use Heal/Nuke Combos and to only nuke when in combat

Bug Fixes v0.8
--------------
-Added Intelligent use of GoM (Will not Yaulp while GoM active)
-Group Heals fixed with proper delays

Bug Fixes v0.91
---------------
-Aura Fixed
-Removed Targeting (you can now do missions with out stopping macro, saying trigger, starting)
-Reworked group heals
-Re-added some chat triggers to make life easier for boxing

Bug Fixes v0.92
---------------
-Fixed group heals and overall healing of group

Bug Fixes v0.93
---------------
-Fixed Group heal distance error
-Added Burst of life under 35%
-Reworked Divine Arbitration calls
-Removed 3 Sub-Routines (2 not used and divine arb sub)
-Removed ALL spell delays in macro (faster heals, faster AA skills, faster divine arb usage)

Bug Fixes v0.94
---------------
-Fixed a couple bad calls
-Misc. Bug fixes

Bug Fixes v0.95
---------------
-Fixed Food and Drink auto inventory issue
-Removed Chat Tell Events, use MQ2EQBC instead
-Fixed Yaulp Issues
-Extended Target Logic Added for Standing and Sitting

Bug Fixes v0.99
---------------
-Pet Heals re-add by demand
-Re-mount from interrupts
-Plugin Verification Check
-Fixed Merc Death Group Heal Issue
-Check to make sure plugins are loaded
-Direct click added for epic shield
-Mount Options Added

Planned Functionality for Official Release
--------------------------------------
-More intelligent heals for pullers (based off extended target window and puller distance to group)
-Stop heal Point Fix (intelligent interrupts)
-Multiple heal points for different classes in group
 
Last edited:
Re: Healer.mac Revamp **ALPHA TEST**

Sweet a lot of peeps have been asking about a cleric mac. I haven't had any time and kind lost interest in updating my version mine awhile ago. I haven't played my cleric since Sof.

|- Secondary Credits: Alatyami, Crystane, Emperor <-- Thats me lol.

Red Cented for sharing.
 
Ignore my lame post.. I need to read better. I just read the macro itself and it says "Added Emergency Heal Line Functionality (Ex. Eleventh Hour)"


Thanks so much, you're my hero, I'll enjoy my cleric a lot more now not having to babysit the Thirteenth Salve spell gem.
 
Last edited:
Still reworking group heals, it works better now, but haven't put conditional statements in for group heals of different classes... So right now if anyone falls below tankhealpoint or more than 2 people in the group get damaged past the point a group heal goes off. Much better than before, but still needs work.
 
could this be modified to be used with druid or shaman? I notice some code in there for epic shield and yaulp, could we see an option to turn those off?

Using afcleric right now.
 
Probably, but I don't have access to either a Shammy or Druid. My shaman account was banned back in 2005 and again in 2007 so I don't think there is any coming back for it lol.
 
My cleric won't use one aura let alone the two I want him to use. Not sure if you've noticed but it's not doing auras. Anyone else have this problem?
 
Yea, they MQ2 changed up the aura code a month or two back and I need to update it. Definitally planned for the future.
 
I use Maskoi's all the time. I fixed the Aura's in this one.

Just grab the inc from Maskoi's thread.

Rich (BB code):
| - healer.mac Revised Editon Beta V 1.0
| - Revised Edition by Emperor
| - Author: Alatyami NotAddicted.com
| - Original healing code 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 GoMana		"You have been granted a gift of#*#"
#event GoMoff		"Your gift of#*#mana fades."
#event OutofFood	"You are out of #1#."
#Event WornOff		"Your #1# spell has worn off of #2#."
#Event WornOff2		"#*# fades."
#Event GainExp		"You gain#*#experience!#*#"
#Event HotonInc		"#1# tells you#*#Incoming pull.#*#"
#Event nomount    	"#*#You can not summon a mount#*#"
#Event nomount     "#*#You can only cast this spell in the outdoors#*#"
#event GainExp		"#*#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 autohealmode 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 outer
	/declare healer_rebuff_use outer
	/declare healer_rebuff_state 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 daspell string outer
	/declare yaulpspell string outer
	/declare aura_spell string outer
	/declare aura_spell_use int outer
	/declare slot10 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 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 PossibleIncom	outer FALSE
	/declare BigHealtimer timer outer
	/declare BigHealtimer2 timer outer
	/declare Bighealtimeramount int outer
	/declare promised_heal_use int outer 0
	/declare complete_healrange int outer ${Spell[${complete_heal}].Range}
	/declare patch_healrange int outer ${Spell[${patch_heal}].Range}
	/declare heal_over_timerange 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 worst_hurt string outer NULL
   /declare worst_hurtid int outer
   /declare worst_hp int outer 100
   /declare worst_class string outer NULL
   /declare group_member int outer
   /declare spell_to_mem string outer
   /declare Find_Spell[25] string outer
   /declare nohotforua string outer NULL
   /declare nohotforub string outer NULL
   /declare nohotforuc string outer NULL
	
   /declare following int outer 0
   /declare follow_name string outer NULL
   /declare mount_use_save_var int outer 0
   /declare pallycount int outer 0
   /declare stophealpoint int outer ${stop_healing_point_%}
   /declare nomtspam int outer 1
   /declare group_heal_hurt_count int outer 0
   /declare divarboor int outer 0
   /declare aetime int outer 0
   /declare autonuke int outer 1
   /declare GrpHealonGoM int outer 1
   /declare GoMana int outer 0
   /declare Casttimer 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 MemSpells
   /echo AutoHealer Active, running in Autohealmode ${autohealmode}
   /echo Casting ${complete_heal} on ${Spawn[${tank_name}].CleanName} at ${default_heal_%}% HP
   /delay 2s
   /if (${autohealmode}==0) /echo ONLY ${Spawn[${tank_name}].CleanName} will be healed
   /if (${autohealmode}==1) /echo ONLY ${Spawn[${tank_name}].CleanName} and myself will be healed
   /if (${autohealmode}==2) /echo ${Spawn[${tank_name}].CleanName}, myself and my group will be healed
   /if (${autohealmode}==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 CheckEvents
   /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 HotonInc
    /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 MedTime
   }
     /if (${GameState.Equal[CHARSELECT]}) /end
   /if (${Target.ID}==${tank_name_id}) {
      /varset stophealpoint ${Math.Calc[${default_heal_%}*1.1]}
      /if ((${Target.Distance}<=${patch_healrange})&&(${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_healrange})&&(${Target.PctHPs}<=${default_heal_%})&&(${Target.PctHPs}>=${Math.Calc[0.7*${default_heal_%}]})&&${BigHealtimer}<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 BigHealtimer ${Bighealtimeramount}
      }
      /varset stophealpoint ${stop_healing_point_%}
      /call CheckEvents
   }
   /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 (${autohealmode}==0) {
      /call CheckEvents
      /goto :tankwatchloop
   }
   /if ((${autohealmode}>=1)&&(${Me.PctHPs}<=${heal_self_%})) /call Healself
   /if (${autohealmode}>=2) {
      /if ((${Target.PctHPs}>${default_heal_%})||(${Target.Distance}>${complete_healrange})||(${Target.PctHPs}<=1)||(!${Target.ID})||(${Target.ID}!=${tank_name_id}    )) {
         /call Healgroup
      }
   }
   /if ((${autohealmode}<2)&&(${Me.PctHPs}>${heal_self_%})&&(${Me.PctMana}<=98)) /call MedTime
   /call CheckEvents
   /goto :tankwatchloop
/return

|----------------------------------------------------------------------------
|  SUB: Mem Spells
|----------------------------------------------------------------------------
Sub MemSpells

   /echo Memming spells. Hang on.
 /if (${CastoMatic_ON}) {
	/call Assign_Spell_Complete_Heal
	/varset complete_heal ${Me.Gem[1]}
	} else {
   /if ( !${Me.Gem[${complete_heal}]} ) {
	/echo Memming 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 Bighealtimeramount 0
	} else {
	   /if (${AltAbility[Spell Casting Reinforcement].ID}) {
	   /varset Bighealtimeramount 240
	} else {
	   /varset Bighealtimeramount 180
	   }
	   /varset promised_heal_use 1
	}

  /if (${CastoMatic_ON}) {
	/call Assign_Spell_Patch_Heal
		} else {
   /if ( !${Me.Gem[${patch_heal}]} ) {
	/echo Memming 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 Memming 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 Memming Spell ${group_heal}
      /memspell 4 "${group_heal}"
      /delay 25
	}
   }
   /if ( !${Me.Gem[${hammer_pet}]} ) {
	/echo Memming Spell ${hammer_pet}
      /memspell 5 "${hammer_pet}"
      /delay 20
   }
   /if ( !${Me.Gem[${direct_damage_magic}]} ) {
	/echo Memming Spell ${direct_damage_magic}
      /memspell 6 "${direct_damage_magic}"
      /delay 30
   }
   /if ( !${Me.Gem[${daspell}]} ) {
	/echo Memming Spell ${daspell}
      /memspell 7 "${daspell}"
      /delay 20
   }
      /if ( !${Me.Gem[${reverse_damage_shield}]} ) {
	/echo Memming Spell ${reverse_damage_shield}
      /memspell 8 "${reverse_damage_shield}"
      /delay 30
   }
   /if ( !${Me.Gem[${direct_damage_stun}]} ) {
	/echo Memming Spell ${direct_damage_stun}
      /memspell 9 "${direct_damage_stun}"
      /delay 30
   }
   /if ( !${Me.Gem[${slot10}]} ) {
      /echo Memming Spell ${slot10}
      /memspell 10 "${slot10}"
      /delay 30
   }

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

|----------------------------------------------------------------------------
|  SUB: Heal over Time on INC
|----------------------------------------------------------------------------
Sub Event_HotonInc(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 GoMana
		: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 Healself
   /if (${Me.PctHPs}>${heal_self_%}) /return
   /varset stophealpoint ${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 stophealpoint ${Math.Calc[${heal_self_%}+5]}
 		 /if (${debug}) /echo trying to patch heal from Sub Healself
         /call Cast "${patch_heal}" gem2 1s CheckHP
         /delay 15 ${Me.SpellReady[${patch_heal}]}
      }
   }
   /varset stophealpoint ${stop_healing_point_%}
/return

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

Sub Healgroup
   :healgroup
   /varset worst_hurt NULL
   /varset worst_hp 100
   /varset worst_class NULL
   /varset minor_hurt 0
   /varset major_hurt 0
   /varset group_heal_hurt_count 0
   /for group_member 0 to ${Group}
      /if (${heal_only_while_fd}==0) {
         /if (${Group.Member[${group_member}].Distance}<=${patch_healrange} && ${Group.Member[${group_member}].Type.NotEqual[Corpse]}) {
            /if (${Group.Member[${group_member}].PctHPs}<=${worst_hp}) {
               /varset worst_hurt ${Group.Member[${group_member}].Name}
               /varset worst_hurtid ${Group.Member[${group_member}].ID}
               /varset worst_hp ${Group.Member[${group_member}].PctHPs}
               /varset worst_class ${Group.Member[${group_member}].Class.Name}
            }
         }
      }
      /if (${heal_only_while_fd}==1) {
         /if (${Group.Member[${group_member}].Distance}<=${patch_healrange} && ${Group.Member[${group_member}].Type.NotEqual[Corpse]}) {
            /if ((${Group.Member[${group_member}].Class.Name.NotEqual[Monk]})&&(${Group.Member[${group_member}].Class.Name.NotEqual[Necromancer]})&&(${Group.Member[${group_member}].PctHPs}<=${worst_hp})) {
               /varset worst_hurt ${Group.Member[${group_member}].Name}
               /varset worst_hurtid ${Group.Member[${group_member}].ID}
               /varset worst_hp ${Group.Member[${group_member}].PctHPs}
               /varset worst_class ${Group.Member[${group_member}].Class.Name}
            }
            /if ((${Group.Member[${group_member}].Class.Name.Equal[Monk]})||(${Group.Member[${group_member}].Class.Name.Equal[Necromancer]})) {
               /if ((${Group.Member[${group_member}].State.Equal[feign]})&&(${Group.Member[${group_member}].PctHPs}<=${worst_hp})) {
                  /varset worst_hurt ${Group.Member[${group_member}].Name}
                  /varset worst_hurtid ${Group.Member[${group_member}].ID}
                  /varset worst_hp ${Group.Member[${group_member}].PctHPs}
                  /varset worst_class ${Group.Member[${group_member}].Class.Name}
               }
            }
         }
      }
      /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 (${autohealmode}==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_%})||(${GoMana}>0))&&(${Target.Distance}<=${complete_healrange})) /return
      }
      /if (${Me.PctHPs}<=${heal_self_%}) /return
   }
   /if ((${major_hurt}==0)&&(${minor_hurt}==0)&&(${GoMana}==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 MedTime
      }
      /call CheckEvents
      /return
   }
   /if (${divine_arbitration_use} && ${worst_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))||((${GoMana}==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 CheckEvents
      /return
   }
   /if (${worst_hurtid}==${tank_name_id}) /return
   /if (${worst_hurtid}==${Me.ID}) {
      /call Healself
      /call CheckEvents
      /return
   }

   /if (${Select[${worst_class},Warrior,Paladin,Shadow Knight]}>0) {
      /if ((${worst_hp}<=${heal_tank_%})&&(${worst_hp}>=${Math.Calc[0.7*${heal_tank_%}]})&&(${major_hurt}<=1)&&(${minor_hurt}<=1)&&${BigHealtimer2}<1) {
         /target id ${worst_hurtid}
| /echo ${worst_class}
    /delay 5 ${Target.ID}==${worst_hurtid}
         /if (!${Target.ID}) /return
         /if (${Target.ID}!=${worst_hurtid}) /return
| /echo ${Target.Name}
         /varset stophealpoint ${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 BigHealtimer2 ${Bighealtimeramount}
         /varset stophealpoint ${stop_healing_point_%}
         /call CheckEvents
         /return
      }
      /if (${worst_hp}<=${heal_tank_%}) {
         /target id ${worst_hurtid}
         /delay 5 ${Target.ID}==${worst_hurtid}
         /if (!${Target.ID}) /return
         /if (${Target.ID}!=${worst_hurtid}) /return
         /varset stophealpoint ${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 stophealpoint ${stop_healing_point_%}
         /call CheckEvents
         /return
      }
   } else /if (${Select[${worst_class},Magician,Wizard,Enchanter,Druid]}>0) {
      /if ((${worst_hp}<=${heal_over_time_caster_%})&&(${worst_hp}>${heal_caster_%})) {
         /if (${Select[${worst_hurt},${nohotforua},${nohotforub},${nohotforuc},${nohotforud}]}>=1) /return
         /if (${Select[${nohotforua},NULL]}>=1) {
            /target id ${worst_hurtid}
       /delay 5 ${Target.ID}==${worst_hurtid}
       /if (!${Target.ID}) /return
            /if (${Target.ID}!=${worst_hurtid}) /return
            /varset nohotforua ${Target.Name}
            /if (${announce}) /${say_where}  (${heal_over_time}) --- %T ---
            /varset stophealpoint ${Math.Calc[${heal_over_time_caster_%}+5]}
            /call Cast "${heal_over_time}" gem3 1s CheckHP
            /timed 200 /varset nohotforua NULL
            /delay 15 ${Me.SpellReady[${heal_over_time}]}
         } else /if (${Select[${nohotforub},NULL]}>=1) {
            /target id ${worst_hurtid}
       /delay 5 ${Target.ID}==${worst_hurtid}
       /if (!${Target.ID}) /return
            /if (${Target.ID}!=${worst_hurtid}) /return
       /varset nohotforub ${Target.Name}
            /if (${announce}) /${say_where}  (${heal_over_time}) --- %T ---
            /varset stophealpoint ${Math.Calc[${heal_over_time_caster_%}+5]}
            /call Cast "${heal_over_time}" gem3 1s CheckHP
            /timed 200 /varset nohotforub NULL
            /delay 15 ${Me.SpellReady[${heal_over_time}]}
         } else /if (${Select[${nohotforuc},NULL]}>=1) {
            /target id${worst_hurtid}
       /delay 5 ${Target.ID}==${worst_hurtid}
       /if (!${Target.ID}) /return
            /if (${Target.ID}!=${worst_hurtid}) /return
       /varset nohotforuc ${Target.Name}
            /if (${announce}) /${say_where}  (${heal_over_time}) --- %T ---
            /varset stophealpoint ${Math.Calc[${heal_over_time_caster_%}+5]}
            /call Cast "${heal_over_time}" gem3 1s CheckHP
            /timed 200 /varset nohotforuc NULL
            /delay 15 ${Me.SpellReady[${heal_over_time}]}
         } else /if (${Select[${nohotforud},NULL]}>=1) {
            /target id ${worst_hurtid}
       /delay 5 ${Target.ID}==${worst_hurtid}
       /if (!${Target.ID}) /return
            /if (${Target.ID}!=${worst_hurtid}) /return
       /varset nohotforud ${Target.Name}
            /if (${announce}) /${say_where}  (${heal_over_time}) --- %T ---
            /varset stophealpoint ${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 stophealpoint ${stop_healing_point_%}
         /call CheckEvents
         /return
      }
      /if ((${worst_hp}<=${heal_caster_%})&&(${worst_hp}>=1)) {
         /target id ${worst_hurtid}
    /delay 5 ${Target.ID}==${worst_hurtid}
	/if (!${Target.ID}) /return
         /if (${Target.ID}!=${worst_hurtid}) /return
         /if (${announce}) /${say_where}  (${patch_heal}) --- %T ---5
		  		 /if (${debug}) /echo trying to patch heal from worst_hp caster
        /call Cast "${patch_heal}" gem2 1s CheckHP
         /varset stophealpoint ${stop_healing_point_%}
         /call CheckEvents
         /delay 15 ${Me.SpellReady[${patch_heal}]}
         /return
      }
      /varset stophealpoint ${stop_healing_point_%}
   } else /if (${Select[${worst_class},Necromancer,Shaman]}>0) {
      /if ((${worst_hp}<=${heal_nec_shm_%})&&(${worst_hp}>=1)) {
         /target id ${worst_hurtid}
    /delay 5 ${Target.ID}==${worst_hurtid}
	/if (!${Target.ID}) /return
         /if (${Target.ID}!=${worst_hurtid}) /return
         /varset stophealpoint ${Math.Calc[${heal_nec_shm_%}+5]}
         /if (${announce}) /${say_where}  (${patch_heal}) --- %T ---6
	/call Cast "${patch_heal}" gem2 1s CheckHP
    /varset stophealpoint ${stop_healing_point_%}
    /call CheckEvents
    /delay 15 ${Me.SpellReady[${patch_heal}]}
    /return
      }
   } else /if ((${worst_hp}<=${heal_default_%})&&(${worst_hp}>=1)) {
      /target id ${worst_hurtid}
      /delay 5 ${Target.ID}==${worst_hurtid}
	/if (!${Target.ID}) /return
      /if (${Target.ID}!=${worst_hurtid}) /return
      /if (${announce}) /${say_where}  (${patch_heal}) --- %T ---7
      /varset stophealpoint ${Math.Calc[${heal_default_%}+5]}
	  /call Cast "${patch_heal}" gem2 1s CheckHP
      /varset stophealpoint ${stop_healing_point_%}
      /call CheckEvents
      /delay 15 ${Me.SpellReady[${patch_heal}]}
      /return
   }
   /varset stophealpoint ${stop_healing_point_%}
/return

|----------------------------------------------------------------------------
|  SUB: Divine Arbitration
|----------------------------------------------------------------------------
Sub divine_arbitration_cast
      /if (${zoned_timer}>0) /return
   /varset divarboor 0
   /for group_member 0 to ${Group}
      /if (${Group.Member[${group_member}].Distance}>200) /varcalc divarboor ${divarboor}+1
   /next group_member
   /if (${Math.Calc[${Group}-${divarboor}]}>=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 && !${GoMana}) {
         /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: Check Events
|----------------------------------------------------------------------------
Sub CheckEvents
   /delay 1
   /doevents GainExp
   /doevents GoMoff
   /doevents GoMana
   /doevents Chat
   /doevents tell
   /doevents
   /doevents flush
   /call Checkbuffs
   /call CheckAura
   /call Check_Clicky
/return

|----------------------------------------------------------------------------
|  SUB: Med Time
|----------------------------------------------------------------------------
Sub MedTime
   :oomwait
   /call CheckEvents
   /doevents HotonInc
   /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[${yaulpspell}]})&&(!${Me.Buff[${yaulpspell}].ID}) && (${Spell[${yaulpspell}].Stacks})) {
	/call Cast "${yaulpspell}"
   }
   /if (${Me.PctHPs}<=${heal_self_%}) /return
   /if (${Me.PctMana}<=8) /goto :oomwait
/return
|----------------------------------------------------------------------------
|  SUB: Check HP
|----------------------------------------------------------------------------
Sub CheckHP
   /if (!${Window[CastingWindow].Open}) /return
   /if (${debug}) /echo Entering Sub CheckHP
   /if (${interrupt_use} && ${Target.PctHPs}>=${stophealpoint} && ${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}) {

      /if (${Select[${Target.Class.ShortName},NEC,MNK]} && (${Target.Name.NotEqual[${tank_name}]} || ${Target.Type.NotEqual[NPC]})) {
         /if (${Target.State.NotEqual[feign]}) {
            /if (${announce}) {
               /echo Ducking heal on ${Target.Name} because he isn't staying FD
            }
            /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: 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

 | ----- GrpHealonGoM - toggle group heal on gift of mana
 /if (${ChatText.Equal[GrpHealonGoM]}) {
      /if (!${Group.Member[${Sender}]}) /return
      /if (${GrpHealonGoM}>0) {
	/varset GrpHealonGoM 0
	/echo Grpheal on GoM off!
	/${say_where} ${Sender} Group Heal on GoM off!
      } else /if (${GrpHealonGoM}<1) {
	/varset GrpHealonGoM 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
/if (${ChatText.Equal[Gbuff now!]}) {
      /if (!${Group.Member[${Sender}]}) /return
      /varset pallycount 0
      /target myself
      /call Cast "${armor_class_buff}" gem8 7s
      /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 (${Target.Class.Name.NotEqual[Paladin]}) /call Cast "${hit_point_aego_buff}" gem8 7s
            /if (${Target.Class.Name.Equal[Paladin]}) {
               /call Cast "${hit_point_aego_buff}" gem8 10s
               /varcalc pallycount ${pallycount}+1
            }
            /if ((${Target.Class.Name.NotEqual[Warrior]})&&(${Target.Class.Name.NotEqual[Monk]})&&(${Target.Class.Name.NotEqual[Rogue]})&&(${Target.Class.Name.NotEqual[Berserker]})&&(${Target.Class.Name.NotEqual[Bard]})) {

                /call Cast "${spell_haste_buff}" gem8 5s
            }
         }
      /next group_member
      /if ((${Math.Calc[${Group}-${pallycount}]}>=2)&&(!${Bool[${hit_point_symbo_groupl_buff}]})) /call Cast "${hit_point_symbo_groupl_buff}" gem8 10s
      /if ((${Math.Calc[${Group}-${pallycount}]}<2)||(${Bool[${hit_point_symbo_groupl_buff}]})) {
         /for group_member 0 to ${Group}
            /target id ${Group.Member[${group_member}].ID}
            /delay 1s ${Target.ID}==${Group.Member[${group_member}].ID}
            /if (${Target.Class.Name.NotEqual[Paladin]}) /call Cast "${hit_point_symbol_buff}" gem8 7s
         /next group_member
      }
   }
| ----- 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 CheckEvents
      /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 GoMana
/return

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

|----------------------------------------------------------------------------
| SUB: Event_GoMan
|----------------------------------------------------------------------------
Sub Event_GoMana
	/varset GoMana 1
	/timed 180 /varset GoMana 0
	/call Healgroup
/return

|----------------------------------------------------------------------------
| SUB: Event Out of Food or Drink
|----------------------------------------------------------------------------
Sub Event_OutofFood(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_GoMoff
|----------------------------------------------------------------------------
Sub Event_GoMoff
/varset GoMana 0
/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}||${Casttimer}<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 PossibleIncom TRUE
}
/next Spawncounter
/if (${PossibleIncom}) {
	/if (${CastTimer}>${Math.Calc[${Spawn[ID ${SpawnTempID}].Distance}/10]}) {
		/echo Interrupting cast.
		/call Interrupt
	}
	/varset PossibleIncom FALSE
}
/return

|----------------------------------------------------------------------------
| SUB: CheckBuffs
|----------------------------------------------------------------------------
Sub CheckBuffs
/if (${healer_rebuff_state} && ${healer_buff_use} && ${NearestSpawn[NPC].Distance}>=75 && ${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 TRUE
		/varset Casttimer ${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 FALSE
		/keypress TAB
		/varset healer_rebuff_use FALSE
	}
   :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 (${TankWornOff[${i}]}) {
		/target ${tank_name}
		/delay 3
		/varset healer_rebuff_use TRUE
		/varset Casttimer ${Math.Calc[${Spell[${TankBufftodo[${i}]}].MyCastTime}*10]}
		/call cast "${TankBufftodo[${i}]}" gem8 5s Incoming
		/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
			/varset TankWornOff[${i}] FALSE
			/varset healer_rebuff_state FALSE
		}
		/varset healer_rebuff_use FALSE
	} else /varset healer_rebuff_state FALSE
   :skipbuff2
   /next i
}
/if (${Me.Gem[${reverse_damage_shield}]}!=8) {
	/memspell 8 "${reverse_damage_shield}"
	/delay 4s
}
/return

|----------------------------------------------------------------------------
| SUB: Event_WornOff
|----------------------------------------------------------------------------
Sub Event_WornOff(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 TRUE
	/varset TankWornOff[${i}] TRUE
}
/next i
/return

|----------------------------------------------------------------------------
| SUB: Event_WornOff2
|----------------------------------------------------------------------------
Sub Event_WornOff2
/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 TRUE
/next i
/return

|----------------------------------------------------------------------------
| SUB: No Mount
|----------------------------------------------------------------------------
	Sub Event_nomount
	/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} && ${NearestSpawn[NPC].Distance}>=75) {
  /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}>=75) {
		/target myself
		/delay 3
		/call Cast "${clicky_item[${i}]}" item
		}
   /next i

/return

|----------------------------------------------------------------------------
| SUB: CheckAura
|----------------------------------------------------------------------------
Sub CheckAura
/if (${aura_spell_use} && ${Me.Aura.Length}==NULL && ${Me.Book[${aura_spell}]}>0  && ${NearestSpawn[NPC].Distance}>=75) {
	/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 19
/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 r
	/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
 
Its so funny you still use that. I got farther into but stopped after I quit playing my cleric. I am hoping eventually kissassist will be good enough to replace my older revamped healer.mac.
 
*shrug* it works flawlessly. I use kiss for all my melee but my rogue. Well, I use Nytes Sk mac which also works flawlessly.
 
Thanks for awesome macro, wish you didnt turn the pet healing off tho, running 3 necros and those pets tend to catch a slap or two!
 
Same thought on pet healing. Its a shame that isnt in its something i really need.
 
i attempted to use this and it just wouldnt run? everything failed when it attempted to do something would just say docommand wouldnt parse /memorize /heal so on and so forth .... am i missing something?
 
eh i decided to look into kissassist and set up her file for it works quite affectively i was really impressed just a matter of getting the percentages to the point i want them now and figuring out why the auras arent casting
 
With F2P I started up another Cleric again. He is level 80 with only 1000 AAs, might buy more, but with not sign up for monthly gold membership. I'll start working on this macro again once mq2 is back up.
 
The thing I like about this mac is it is quicker with DA's epic and other stuff like yaulp. kiss will only yaulp when it's gotten around to it, not when it drops every time it drops. Also kiss will target mobs even if you turn dps/melee off. The only thing I dislike about healermac is that I can't choose to keep him on a mount like kiss. I always have issues with the cleric dismounting. It's either use kiss and have less responsiveness, and less yaulp, but 2 auras.. or use healer and deal with buggy issues. Have problems where he will be healing fine, but then starts a heal but then interrupting instantly and just getting stuck in that loop and it kills people. Or when someone does die, he will get stuck in a group heal loop and ignore his duties to whoever is taking currently. would love to see some major updates to this mac because it's still my choice over kiss because it's a dedicated class specific mac.

Thanks for all your hard work and I look forward to seeing an update.
 
Working on this now, fixed quite a few issues so far. I'll release a new version this week with a variety of the fixes.
 
Awesome job on updating a Redguides/NotAddicted classic macro . Red cented and post stickied
 
Went ahead and pushed up some fixes and threw up v0.95. I'm still working on gutting out all the clutter and adding more features. I will be redoing all variables for v1.0 and removing quite a bit of useless code.
 
Still having hangup issues, not sure what to attribute it to. will target my toon and cast fourteenth over and over while the tank is the one who needs it. Tank dies. I restarted mac about 5 times and hung up every time within minutes last night. was working great for a while, but always seems to start hanging at a certain point. this is on a 95 cleric.
 
this happens with two different tanks, both are warriors. It seems like every time I have a real warrior in group it hangs constantly. I can run it all night with my tank merc it seems, as I did last night. I don't think it's just that though, I swear I've had issues even using tank merc. But the past two days the majority of problems arise when I had a real tank in group. Other than that, group looks like this, bst, wiz, rng, clr and sometimes a mage. Forgot to mention sometimes a clr merc is used also for named that are extremely difficult.
 
I bet you some old code is causing this. I'm gonna start ripping out all the old crap and putting in the new shinny stuff ;)
 
Ok, touched literally every single line of code in the macro and removed tons of old variables. Its ready to go into testing when ever EQ and MQ2 come back up.

Couple features added
-Aura
-Faster Heals
-Divine Aura spell line should work properly now
 
Ok, Releasing a bunch of additions to this macro, that I'm sure will have some bugs. Please re-download and start testing. I'm working on testing as well.
 
Awesome! This has to be one of the oldest and most revamped mac on the site. I'll help test it later today for a few hours.
 
Disclaimer: These are just notes and observations. No way am I flaming or dissing Noob's healer mac so please take as they are meant as constructive criticism.

First notes and impressions on mac.
1. No rez capability. Auto or commands. Previous had option to rez with tells I think.
2. No spell spam hard to tell if its casting or whats it casting so not even sure its working. This is a big deal for me personally.
3. 2nd aura would be nice but no biggie there.
4. No buffs? Did you strip this done to rebuild or is just pure heals?
 
Yep, I stripped a ton of stuff out and reworked it for heal optimization because it would hang in spots. After working on this again after a couple months off, I've decided to scrap the whole thing and start over. This time I'm putting it together with mq2cast from the start no ghetto conversion from spellroutines.inc like I did here. I'm taking some pieces of your kissassist and implementing them, Buffs, Rezing, EQBC, and INI Support.

Here is the roadmap to next release:
-No /target in the macro at all... I mean NONE! /casting "${healspell}" -targetid|${Me.ID} will be the new way of casting.
-EQBC/Rez Support/Buffs/2nd Aura
-INI Support
-Interrupts will fire to the millisecond for Burst of Life, Divine Arbitration, and Epic Click
-Breaking code into Subs and removing redundancy you see in here

So far I've finished the first draft of it with about 5 hours of testing in. Works really really fast. Not laggy like every heal macro out there, and already got the AA abilities working like a champ.

Love the feedback ;) I'm gonna make a new thread for the next macro, once I've got about 20 hours logged for internal testing with all new features in and its ready for public release. My Goal is to make the macro a huge step above Kissassist for Clerics! Considering how awesome KissAssist is, its gonna be hard to do, but I'm confident I'll get there ;)
 
Sounds great. Please put in /echo casting messages lol. Its hard to evaluate other wise I have had it running for a few hours without any issues but in fairly safe area. So I haven't stress tested it yet. I will be interested to see if you get your interrupts working well when you are farther long.

Coding my generic heal theme in my ini file for Kissassist has its advantages and disadvantages. Also I invented my own healing system which I tweak about every 4 months. It works but since it all class all level it can't out perform class type macros. I am just getting back into EQ this week and my first priority is my writing my new rebuff system for Kiss.
 
Yea, I saw your shambot macro rework on the VIP Macroquest2 forums. It looks pretty sweet as well, and stole some ideas from it too.
 
Healer.mac Revamp

Users who are viewing this thread

Back
Top
Cart