Templar Script, based on Karye's Inquisitor.

Status
Not open for further replies.

RogueTexan

Active Member
Templar Routine and Spell List (based on Karye's Inquisitor Script).

Modded shamelessly from Karye's Inquisitor Script.
If anyone has suggestions or requests for the script to do anything, please post here and I will try to accommodate.

Current release : 20060704
EQ2Bot version: 2.40 compatible
Installation:
1. Unzip Templar.zip into your Innerspace directory
2. Download the HO Object Lib @ http://www.isxgames.com/forums/showthread.php?t=68 and unzip it to your innerspace directory. No edits are required to the Templar.iss file

Features:-UI with integation into EQ2Bot via a "Class" tab
-Tuned debuffing and offensive dps
-Advanced Healing algorithm suitable for solo, group and raid play.
-Cures Group members
-Heals group conjuror and necromancer pets
-Custom "engage in melee combat" by using the "Yaulp" AA
-Uses the HO Object lib for Heroic Oportunity participation
-Automatic weapon selection for 2h staff AAs, 1h hammer AAs, 2h hammer AAs, symbols AAs, buckler AAs, Yaulp Meleeing mode.
-On Agro uses Anti agro
-Resses group members
-Uses Racial Mastery Smites
-Toggle casting of offensive spells
-Toggle casting of debuffs
-Toggle Casting of AoE spells
-Toggle Curing
-Toggle the use of "Convert"
-Toggle Casting of pre pull reactive heals


Uses "EQ2Bot Extras"
-UI integation into EQ2Bot via a "Extras" tab
-Alternative Follow method using in game autofollow
-Tank warning when agro
-Conjuror essence shard/ Necro heart request and use.

Version History

20060704
-Initial Release
20060704b
- Minor fixes to script flow, especially order of heals vs cure casting.
 

Attachments

Last edited:

gp1001

Active Member
A couple things I noticed is not matter whats settings you select, the bot will always debuff, and always participate in HO's .
I tried to make the bot only heal but couldnt get it to work.
 

nytor

Active Member
would appreciate the some updates to the templar Routine :p ...... also any specific reason its creating its own folder in the main IS folder and not where the rest of the routines are inside the eq2bot folder?
 

RogueTexan

Active Member
This is way out of date. Would not use it. Been busy rewriting several sections of all my bots and won't be updating this for at least a week.


----
EDIT BY AMADEUS: Official Support Files Updated to this point.
 

Pygar

EQ2Bot Specialist
Any closer RT?

I've got a slightly modified version I can post. Its nothing special, but I fixed a few of the issues in the healing logic where it would step on his own HoT's. The version I'm running now is a little better with mana management as a result, but still lightyears behind the defiler script.
 

Pygar

EQ2Bot Specialist
20070504a
Fixed several bugs in script
Improved heal routine
Updated for eq2bot 2.6
Script still needs serious work, but is functional.
 

cybris

Active Member
Really hope to see this fixed up right.
Here are a few things.
I solo with my templar and while soloing this cast reactive heals way too much evenif checkbox is not checked. It casts AOE's regardless if the checkbox is checked or not.

I basically fight by nuking the mob to death using HO's and cast one or two reactive heals this was chain casting reactive heals and alternating between my smite and beaming faith nukes, Beaming faith is an AE. I was out of power before I could even get the mob in the yellow. I was fighting solo blue and green mobs BTW. My templar is only lvl 32 and doesn't have really good gear.

Thanks for the help in advance.
 

cybris

Active Member
hey all I fixed some tihings in the templar script it will now cast Smite line of spells and celestial strike line of spells if you have the offensive spells selected. I also fixed the AoE issue where it was casting Aoe's even if you had them turned off.

just copy this into the file

Code:
;*************************************************************
;Templar.iss
;version 20060704a
;variation on Inquisitor script for Templar by karye
;*************************************************************
#includeoptional "\\Athena\innerspace\Scripts\EQ2Bot\Class Routines\EQ2BotLib.iss"

#ifndef _Eq2Botlib_
	#include "${LavishScript.HomeDirectory}/Scripts/EQ2Bot/Class Routines/EQ2BotLib.iss"
#endif

function Class_Declaration()
{

	addtrigger IncomingMob "@${Actor[${MainAssist}].ID}@ says to the group,\"MOB Incoming...!!""

	declare OffenseMode bool script
	declare DebuffMode bool script
	declare AoEMode bool script
	declare CureMode bool script
	declare ConvertMode bool script
	declare YaulpMode bool script
	declare FanaticismMode bool script
	declare KeepReactiveUp bool script
	declare MezzMode bool script

	declare EquipmentChangeTimer int script

	declare MainWeapon string script
	declare OffHand string script
	declare OneHandedHammer string script
	declare TwoHandedHammer string script
	declare Symbols string script
	declare Buckler string script
	declare YaulpWeapon string script
	declare TwoHandedStaff string script

	declare Incoming bool script FALSE

	call EQ2BotLib_Init

	OffenseMode:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[Cast Offensive Spells,FALSE]}]
	DebuffMode:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[Cast Debuff Spells,TRUE]}]
	AoEMode:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[Cast AoE Spells,FALSE]}]
	CureMode:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[Cast Cure Spells,FALSE]}]
	ConvertMode:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[Convert Mode,FALSE]}]
	YaulpMode:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[Yaulp Mode,FALSE]}]
	FanaticismMode:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[Fanaticism Mode,FALSE]}]
	KeepReactiveUp:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[KeepReactiveUp,FALSE]}]
	MezzMode:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[Mezz Mode,FALSE]}]

	MainWeapon:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[MainWeapon,]}]
	OffHand:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[OffHand,]}]
	OneHandedHammer:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[WeaponOneHandedHammer,]}]
	TwoHandedHammer:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[WeaponTwoHandedHammer,]}]
	Symbols:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[WeaponSymbols,]}]
	Buckler:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[Buckler,]}]
	YaulpWeapon:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[YaulpWeapon,]}]
	TwoHandedStaff:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[TwoHandedStaff,]}]
}

function Buff_Init()
{

	PreAction[1]:Set[Single_Buff_Conc]
	PreSpellRange[1,1]:Set[35]

	PreAction[2]:Set[Self_Buff]
	PreSpellRange[2,1]:Set[36]

	PreAction[3]:Set[Tank_Buff]
	PreSpellRange[3,1]:Set[42]

	PreAction[4]:Set[Group_Buff_Conc]
	PreSpellRange[4,1]:Set[20]
	PreSpellRange[4,2]:Set[21]

	;PreAction[5]:Set[Group_Buff]
	;PreSpellRange[5,1]:Set[280]
	;PreSpellRange[5,2]:Set[282]

	;PreAction[6]:Set[AA_ShieldAlly]
	;PreSpellRange[6,1]:Set[389]
}

function Combat_Init()
{
	Action[1]:Set[Sign_of_Fraility]
	MobHealth[1,1]:Set[10]
	MobHealth[1,2]:Set[100]
	Power[1,1]:Set[30]
	Power[1,2]:Set[100]
	SpellRange[1,1]:Set[55]

	Action[2]:Set[Spurn]
	MobHealth[2,1]:Set[10]
	MobHealth[2,2]:Set[100]
	Power[2,1]:Set[30]
	Power[2,2]:Set[100]
	SpellRange[2,1]:Set[50]


	Action[3]:Set[Mastery]
	SpellRange[3,1]:Set[360]
	SpellRange[3,2]:Set[379]

	Action[4]:Set[Involuntary_Restoration]
	MobHealth[4,1]:Set[40]
	MobHealth[4,2]:Set[100]
	Power[4,1]:Set[40]
	Power[4,2]:Set[100]
	SpellRange[4,1]:Set[336]

	Action[5]:Set[Warring_Axiom]
	MobHealth[5,1]:Set[10]
	MobHealth[5,2]:Set[100]
	Power[5,1]:Set[40]
	Power[5,2]:Set[100]
	SpellRange[5,1]:Set[70]

	Action[6]:Set[Smite]
	MobHealth[6,1]:Set[10]
	MobHealth[6,2]:Set[100]
	Power[6,1]:Set[40]
	Power[6,2]:Set[100]
	SpellRange[6,1]:Set[61]
	SpellRange[6,2]:Set[62]

	Action[7]:Set[Stifle]
	MobHealth[7,1]:Set[10]
	MobHealth[7,2]:Set[100]
	Power[7,1]:Set[30]
	Power[7,2]:Set[100]
	SpellRange[7,1]:Set[190]

	Action[8]:Set[PreKill]
	MobHealth[8,1]:Set[5]
	MobHealth[8,2]:Set[50]
	Power[8,1]:Set[30]
	Power[8,2]:Set[100]
	SpellRange[8,1]:Set[312]

	Action[9]:Set[AoE]
	MobHealth[9,1]:Set[25]
	MobHealth[9,2]:Set[100]
	Power[9,1]:Set[30]
	Power[9,2]:Set[100]
	SpellRange[9,1]:Set[90]

	Action[10]:Set[AA_DivineCastigation]
	MobHealth[10,1]:Set[1]
	MobHealth[10,2]:Set[100]
	Power[10,1]:Set[30]
	Power[10,2]:Set[100]
	SpellRange[10,1]:Set[395]
}

function PostCombat_Init()
{
	PostAction[1]:Set[Resurrection]
	PostSpellRange[1,1]:Set[300]
	PostSpellRange[1,2]:Set[301]
}

function Buff_Routine(int xAction)
{

	declare tempvar int local

	call WeaponChange

	ExecuteAtom CheckStuck

	if ${ShardMode}
	{
		call Shard
	}

	call CheckHeals

	if ${AutoFollowMode}
	{
		ExecuteAtom AutoFollowTank
	}

	;Need to add/write a check for NPCs nearby that might be aggro to stop from buffing like a bot...
	if (${Me.ToActor.Power}>85 && ${KeepReactiveUp} && ${Mob.Detect}) || ${Incoming}
	{
		call CastSpellRange 15
		call CastSpellRange 7 0 0 0 ${Actor[${MainAssist}].ID}
		call CastSpellRange 22 0 0 0 ${Actor[${MainAssist}].ID}
		Incoming:Set[FALSE]
	}

	switch ${PreAction[${xAction}]}
	{
		case Single_Buff_Conc
			if ${Me.UsedConc}<5
			{
				grpcnt:Set[${Me.GroupCount}]
				tempvar:Set[1]
				do
				{
					switch ${Me.Group[${tempvar}].ToActor.Class}
					{
						case berserker
							if ${Me.UsedConc}<5
							{
								call CastSpellRange ${PreSpellRange[${xAction},1]} 0 0 0 ${Me.Group[${tempvar}].ToActor.ID}
								call CastSpellRange 315 0 0 0 ${Me.Group[${tempvar}].ToActor.ID}
							}
						case guardian
							if ${Me.UsedConc}<5
							{
								call CastSpellRange ${PreSpellRange[${xAction},1]} 0 0 0 ${Me.Group[${tempvar}].ToActor.ID}
								call CastSpellRange 315 0 0 0 ${Me.Group[${tempvar}].ToActor.ID}
							}
						case bruiser
						case monk
						case paladin
						case shadowknight
						case swashbuckler
						case brigand
						case troubador
						case dirge
						case ranger
						case assassin

					}
				}
				while ${tempvar:Inc}<${grpcnt}
			}
			break
		call CheckHeals
		case Self_Buff
			if ${ConvertMode}
			{
				call CastSpellRange ${PreSpellRange[${xAction},1]}
			}
			else
			{
				Me.Maintained[${SpellType[${PreSpellRange[${xAction},1]}]}]:Cancel
			}
			break
		case AA_ShieldAlly
		call CheckHeals
		case Tank_Buff
			;If the MA changed during the fight cancel so we can rebuff original MA
			if ${Me.Maintained[${SpellType[${PreSpellRange[${xAction},1]}]}].Target.ID}!=${Actor[${MainAssist}].ID}
			{
				Me.Maintained[${SpellType[${PreSpellRange[${xAction},1]}]}]:Cancel
			}
			call CastSpellRange ${PreSpellRange[${xAction},1]} 0 0 0 ${Actor[${MainAssist}].ID}
			break

		case Group_Buff_Conc
			if ${Me.UsedConc}<5
			{
				call CastSpellRange ${PreSpellRange[${xAction},1]} ${PreSpellRange[${xAction},2]}
			}
			break


		case Group_Buff
			call CastSpellRange ${PreSpellRange[${xAction},1]} ${PreSpellRange[${xAction},2]}
			break

		Default
			xAction:Set[20]
			break
	}
}

function Combat_Routine(int xAction)
{
	AutoFollowingMA:Set[FALSE]
	if ${Me.ToActor.WhoFollowing(exists)}
	{
		EQ2Execute /stopfollow
	}
	call CheckHeals
	if ${DoHOs}
	{
		objHeroicOp:DoHO
	}

	if !${EQ2.HOWindowActive} && ${Me.InCombat}
	{
		call CastSpellRange 303
	}

	if ${Actor[${KillTarget}].Type.Equal[NamedNPC]} || ${Actor[${KillTarget}].IsEpic}
	{
		; Use AA Divine Reovery
		call CastSpellRange 396
	}

	if ${MezzMode}
	{
		call Mezmerise_Targets
	}

	call WeaponChange

	call CheckHeals

	call Yaulp

	if ${ShardMode}
	{
		call Shard
	}

	switch ${Action[${xAction}]}
	{
		case Sign_of_Fraility
			if ${DebuffMode}
			{
				call CheckCondition MobHealth ${MobHealth[${xAction},1]} ${MobHealth[${xAction},2]}
				if ${Return.Equal[OK]}
				{
					call CheckCondition Power ${Power[${xAction},1]} ${Power[${xAction},2]}
					if ${Return.Equal[OK]}
					{
						call CastSpellRange ${SpellRange[${xAction},1]} 0 0 0 ${KillTarget}
					}
				}

			}
			break

		case Spurn
			if ${DebuffMode}
			{
				call CheckCondition MobHealth ${MobHealth[${xAction},1]} ${MobHealth[${xAction},2]}
				if ${Return.Equal[OK]}
				{
					call CheckCondition Power ${Power[${xAction},1]} ${Power[${xAction},2]}
					if ${Return.Equal[OK]}
					{
						call CastSpellRange ${SpellRange[${xAction},1]} 0 0 0 ${KillTarget}
					}
				}

			}
			break

		case Involuntary_Restoration
			if ${DebuffMode}
			{
				call CheckCondition MobHealth ${MobHealth[${xAction},1]} ${MobHealth[${xAction},2]}
				if ${Return.Equal[OK]}
				{
					call CheckCondition Power ${Power[${xAction},1]} ${Power[${xAction},2]}
					if ${Return.Equal[OK]}
					{
						call CastSpellRange ${SpellRange[${xAction},1]} 0 0 0 ${KillTarget}
						call CastSpellRange 313 0 0 0 ${KillTarget}
					}
				}

			}
			break
		case Warring_Axiom
			if ${OffenseMode}
			{
				call CheckCondition MobHealth ${MobHealth[${xAction},1]} ${MobHealth[${xAction},2]}
				if ${Return.Equal[OK]}
				{
					call CheckCondition Power ${Power[${xAction},1]} ${Power[${xAction},2]}
					if ${Return.Equal[OK]}
					{
						call CastSpellRange ${SpellRange[${xAction},1]} 0 0 0 ${KillTarget}
					}
				}

			}
			break
		case Smite
			if ${OffenseMode}
			{
				call CheckCondition MobHealth ${MobHealth[${xAction},1]} ${MobHealth[${xAction},2]}
				if ${Return.Equal[OK]}
				{
					call CheckCondition Power ${Power[${xAction},1]} ${Power[${xAction},2]}
					if ${Return.Equal[OK]}
					{
						call CastSpellRange ${SpellRange[${xAction},1]} ${SpellRange[${xAction},2]} 0 0 0 ${KillTarget}
					}
				}

			}
			break
		call CheckHeals
		case Stifle
			if ${OffenseMode} || ${DebuffMode}
			{
				call CheckCondition MobHealth ${MobHealth[${xAction},1]} ${MobHealth[${xAction},2]}
				if ${Return.Equal[OK]}
				{
					call CheckCondition Power ${Power[${xAction},1]} ${Power[${xAction},2]}
					if ${Return.Equal[OK]}
					{
						call CastSpellRange ${SpellRange[${xAction},1]} 0 0 0 ${KillTarget}
					}
				}

			}
			break

		case AoE
			if ${AoEMode}
			{
				call CheckCondition MobHealth ${MobHealth[${xAction},1]} ${MobHealth[${xAction},2]}
				if ${Return.Equal[OK]}
				{
					call CheckCondition Power ${Power[${xAction},1]} ${Power[${xAction},2]}
					if ${Return.Equal[OK]}
					{
						call CastSpellRange ${SpellRange[${xAction},1]} 0 0 0 ${KillTarget}
					}
				}

			}
			break
		case PreKill
				call CheckCondition MobHealth ${MobHealth[${xAction},1]} ${MobHealth[${xAction},2]}
				if ${Return.Equal[OK]}
				{
					call CheckCondition Power ${Power[${xAction},1]} ${Power[${xAction},2]}
					if ${Return.Equal[OK]}
					{
							call CastSpellRange ${SpellRange[${xAction},1]} 0 0 0 ${KillTarget}
					}
				}
			break
		case AA_DivineCastigation
			if ${OffenseMode} && ${Me.Ability[${SpellType[${SpellRange[${xAction},1]}]}].IsReady}
			{
				call CheckCondition MobHealth ${MobHealth[${xAction},1]} ${MobHealth[${xAction},2]}
				if ${Return.Equal[OK]}
				{
					call CheckCondition Power ${Power[${xAction},1]} ${Power[${xAction},2]}
					if ${Return.Equal[OK]}
					{
						if ${Me.Equipment[1].Name.Equal[${TwoHandedStaff}]}
						{
							call CastSpellRange ${SpellRange[${xAction},1]} 0 0 0 ${KillTarget}
						}
						elseif ${Math.Calc[${Time.Timestamp}-${EquipmentChangeTimer}]}>2
						{
							Me.Inventory[${TwoHandedStaff}]:Equip
							EquipmentChangeTimer:Set[${Time.Timestamp}]
							call CastSpellRange ${SpellRange[${xAction},1]} 0 0 0 ${KillTarget}
						}
					}
				}

			}
			break
		case Mastery
			if ${OffenseMode} || ${DebuffMode}
			{
					if ${Me.Ability[Master's Smite].IsReady}
					{
						Target ${KillTarget}
						Me.Ability[Master's Smite]:Use
					}
			}
			break
		Default
			xAction:Set[40]
			break
	}
}

function Post_Combat_Routine(int xAction)
{

	TellTank:Set[FALSE]
	call CheckHeals
	;turn off Yaulp
	if ${Me.Maintained[${SpellType[385]}](exists)}
	{
		Me.Maintained[${SpellType[385]}]:Cancel
	}

	; turn off auto attack if we were casting while the last mob died
	if ${Me.AutoAttackOn}
	{
		EQ2Execute /toggleautoattack
	}

	switch ${PostAction[${xAction}]}
	{
		case Resurrection
			grpcnt:Set[${Me.GroupCount}]
			tempgrp:Set[1]
			do
			{
				if ${Me.Group[${tempgrp}].ToActor.Health}==-99 && ${Me.Group[${tempgrp}](exists)}
				{
					call CastSpellRange ${PostSpellRange[${xAction},1]} ${PostSpellRange[${xAction},2]} 0 0 ${Me.Group[${tempgrp}].ToActor.ID} 1
				}
			}
			while ${tempgrp:Inc}<${grpcnt}
			break

		Default
			xAction:Set[20]
			break
	}
}

function Have_Aggro()
{

	if !${TellTank} && ${WarnTankWhenAggro}
	{
		eq2execute /tell ${MainTank}  ${Actor[${aggroid}].Name} On Me!
		TellTank:Set[TRUE]
	}

	call CastSpellRange 180 182 0 0 ${aggroid}

}

function CheckHeals()
{
	declare temphl int local
	declare grpheal int local 0
	declare lowest int local 0
	declare grpcure int local 0
	declare mostafflicted int local 0
	declare mostafflictions int local 0
	declare tmpafflictions int local 0
	declare PetToHeal int local 0

	grpcnt:Set[${Me.GroupCount}]
	hurt:Set[FALSE]

	temphl:Set[1]
	grpcure:Set[0]
	lowest:Set[1]

	;Res the MT if they are dead
	if ${Actor[${MainTankPC}].Health}==-99 && ${Actor[${MainTankPC}](exists)}
	{
		call CastSpellRange 300 0 0 0 ${Actor[${MainTankPC}].ID}
	}

	do
	{
		if ${Me.Group[${temphl}].ZoneName.Equal[${Zone.Name}]}
		{

			if ${Me.Group[${temphl}].ToActor.Health}<100 && ${Me.Group[${temphl}].ToActor.Health}>-99 && ${Me.Group[${temphl}](exists)}
			{
				if ${Me.Group[${temphl}].ToActor.Health}<=${Me.Group[${lowest}].ToActor.Health}
				{
					lowest:Set[${temphl}]
				}
			}

			if ${Me.Group[${temphl}].IsAfflicted}

			{
				tmpafflictions:Set[${Math.Calc[${Me.Group[${temphl}].Arcane}+${Me.Group[${temphl}].Trauma}+${Me.Group[${temphl}].Elemental}+${Me.Group[${temphl}].Noxious}]}]

				if ${tmpafflictions}>${mostafflictions}
				{
					mostafflictions:Set[${tmpafflictions}]
					mostafflicted:Set[${temphl}]
				}
			}

			if ${Me.Group[${temphl}].ToActor.Health}>-99 && ${Me.Group[${temphl}].ToActor.Health}<80
			{
				grpheal:Inc
			}

			if ${Me.Group[${temphl}].Arcane} || ${Me.Group[${temphl}].Elemental}
			{
				grpcure:Inc
			}

			if ${Me.Group[${temphl}].Class.Equal[conjuror]}  || ${Me.Group[${temphl}].Class.Equal[necromancer]}
			{
				if ${Me.Group[${temphl}].ToActor.Pet.Health}<60 && ${Me.Group[${temphl}].ToActor.Pet.Health}>0
				{
					PetToHeal:Set[${Me.Group[${temphl}].ToActor.Pet.ID}
				}
			}
		}

	}
	while ${temphl:Inc}<${grpcnt}

	if ${Me.ToActor.Health}<80 && ${Me.ToActor.Health}>-99
	{
		grpheal:Inc
	}

	if ${Me.Arcane} || ${Me.Elemental}
	{
		grpcure:Inc
	}

	;MAINTANK EMERGENCY HEAL
	if ${Me.Group[${lowest}].ToActor.Health}<30 && ${Me.Group[${lowest}].Name.Equal[${MainTankPC}]} && ${Me.Group[${lowest}].ToActor(exists)}
	{
		call EmergencyHeal ${Actor[${MainTankPC}].ID}
	}

	;ME HEALS
	if ${Me.ToActor.Health}<=${Me.Group[${lowest}].ToActor.Health} && ${Me.Group[${lowest}].ToActor(exists)}
	{
		if ${Me.ToActor.Health}<40
		{
			if ${haveaggro}
			{
				call EmergencyHeal ${Me.ID}
			}
			else
			{
				if ${Me.Ability[${SpellType[1]}].IsReady}
				{
					call CastSpellRange 1 0 0 0 ${Me.ID}
				}
				else
				{
					call CastSpellRange 4 0 0 0 ${Me.ID}
				}
			}
			hurt:Set[TRUE]
		}
		else
		{
			if ${Me.ToActor.Health}<85
			{
				if ${haveaggro}
				{
					call CastSpellRange 7 0 0 0 ${Me.ID}
				}

			}
		}
	}
	;MAINTANK HEALS
	if ${Actor[${MainTankPC}].Health} <90 && ${Actor[${MainAssist}](exists)} && ${Actor[${MainTankPC}].InCombatMode} && ${Actor[${MainTankPC}].Health}>-99
	{
		call CastSpellRange 7 0 0 0 ${Actor[${MainTankPC}].ID}
	}

	if ${Actor[${MainAssist}].Health} <90 && ${Actor[${MainTankPC}].Health} >-99 && ${Actor[${MainTankPC}](exists)}
	{
		call CastSpellRange 1 0 0 0 ${Actor[${MainTankPC}].ID}
	}

	;GROUP HEALS
	if ${grpheal}>2
	{
		if ${Me.Ability[${SpellType[10]}].IsReady}
		{
			call CastSpellRange 10
		}
		else
		{
			call CastSpellRange 15
		}
	}

	if ${Me.Group[${lowest}].ToActor.Health}<80 && ${Me.Group[${lowest}].ToActor(exists)}
	{
		if ${Me.Ability[${SpellType[1]}].IsReady} && ${Me.Group[${lowest}].ToActor.Health}>-99 && ${Me.Group[${lowest}].ToActor(exists)}
		{
			call CastSpellRange 1 0 0 0 ${Me.Group[${lowest}].ToActor.ID}

		}
		else
		{
			call CastSpellRange 4 0 0 0 ${Me.Group[${lowest}].ToActor.ID}
		}

		hurt:Set[TRUE]
	}

	;CURES
	if ${grpcure}>2 && ${CureMode}
	{
		call CastSpellRange 181
	}

	if ${Me.IsAfflicted} && ${CureMode}
	{
		call CureMe
	}

	if ${mostafflicted} && ${CureMode}
	{
		call CureGroupMember ${mostafflicted}
	}

	;PET HEALS
	if ${PetToHeal} && ${Actor[${PetToHeal}](exists)}
	{
		if ${Actor[${PetToHeal}].InCombatMode}
		{
			call CastSpellRange 7 0 0 0 ${PetToHeal}
		}
		else
		{
			call CastSpellRange 1 0 0 0 ${PetToHeal}
		}
	}



}

function EmergencyHeal(int healtarget)
{

	call CastSpellRange 316 0 0 0 ${healtarget}

	if ${Me.Ability[${SpellType[335]}].IsReady}
	{
		call CastSpellRange 335 0 0 0 ${healtarget}
	}
	else
	{
		call CastSpellRange 17 0 0 0 ${healtarget}
	}

}

function Lost_Aggro()
{

}

function MA_Lost_Aggro()
{

}

function MA_Dead()
{
	if ${Actor[${MainAssist}].Health}==-99 && ${Actor[${MainTankPC}](exists)}
	{
		call 300 301 0 0 ${Actor[${MainTankPC}].ID} 1
	}
}

function Cancel_Root()
{

}

function CureMe()
{
	if  ${Me.Arcane}>0 && !${Me.ToActor.Effect[Revived Sickness](exists)}
	{
		;call CastSpellRange 326
		if ${Me.Arcane} && !${Me.ToActor.Effect[Revived Sickness](exists)}
		{
			call CastSpellRange 210 0 0 0 ${Me.ID}
			return
		}
	}

	if  ${Me.Noxious}>0
	{
		call CastSpellRange 213 0 0 0 ${Me.ID}
		return
	}

	if  ${Me.Elemental}>0
	{
		call CastSpellRange 211 0 0 0 ${Me.ID}
		return
	}

	if  ${Me.Trauma}>0
	{
		call CastSpellRange 212 0 0 0 ${Me.ID}
		return
	}


}

function CureGroupMember(int gMember)
{
	declare tmpcure int local

	tmpcure:Set[0]
	if !${Me.Group[${gMember}].ZoneName.Equal[${Zone.Name}]}
	{
		return
	}

	do
	{
		if  ${Me.Group[${gMember}].Arcane}>0 && !${Me.Group[${gMember}].ToActor.Effect[Revived Sickness](exists)}
		{
			;call CastSpellRange 326

				if  ${Me.Group[${gMember}].Arcane}>0 && !${Me.Group[${gMember}].ToActor.Effect[Revived Sickness](exists)}
				{
					call CastSpellRange 210 0 0 0 ${Me.Group[${gMember}].ID}
				}
		}

		if  ${Me.Group[${gMember}].Noxious}>0
		{
			call CastSpellRange 213 0 0 0 ${Me.Group[${gMember}].ID}
		}

		if  ${Me.Group[${gMember}].Elemental}>0
		{
			call CastSpellRange 211 0 0 0 ${Me.Group[${gMember}].ID}
		}

		if  ${Me.Group[${gMember}].Trauma}>0
		{
			call CastSpellRange 212 0 0 0 ${Me.Group[${gMember}].ID}
		}
	}
	while ${Me.Group[${gMember}].IsAfflicted} && ${CureMode} && ${tmpcure:Inc}<3
}



; This is not called/active in this script at present since Templar mez is weak at best.
function Mezmerise_Targets()
{
	declare tcount int local 1
	declare tempvar int local
	declare aggrogrp bool local FALSE

	grpcnt:Set[${Me.GroupCount}]

	EQ2:CreateCustomActorArray[byDist,15]

	do
	{
		if (${CustomActor[${tcount}].Type.Equal[NPC]} || ${CustomActor[${tcount}].Type.Equal[NamedNPC]}) && ${CustomActor[${tcount}](exists)} && !${CustomActor[${tcount}].IsLocked} && !${CustomActor[${tcount}].IsEpic}
		{
			if ${Actor[${MainAssist}].Target.ID}==${CustomActor[${tcount}].ID}
			{
				continue
			}

			tempvar:Set[1]
			aggrogrp:Set[FALSE]
			do
			{
				if ${CustomActor[${tcount}].Target.ID}==${Me.Group[${tempvar}].ID}
				{
					aggrogrp:Set[TRUE]
					break
				}
			}
			while ${tempvar:Inc}<${grpcnt}

			if ${CustomActor[${tcount}].Target.ID}==${Me.ID}
			{
				aggrogrp:Set[TRUE]
			}


			if ${aggrogrp}
			{

				if ${Me.AutoAttackOn}
				{
					eq2execute /toggleautoattack
				}

				if ${Me.RangedAutoAttackOn}
				{
					eq2execute /togglerangedattack
				}

				;check for wonderous buckling
				if ${Me.Ability[${SpellType[386]}](exists)}
				{
				;check if we have a our buckler equipped if not equip and cast wonderous buckling
					if ${Me.Equipment[2].Name.Equal[${Buckler}]}
					{
						call CastSpellRange 386 0 1 0 ${CustomActor[${tcount}].ID}
					}
					elseif ${Math.Calc[${Time.Timestamp}-${EquipmentChangeTimer}]}>2
					{
						Me.Inventory[${Buckler}]:Equip
						EquipmentChangeTimer:Set[${Time.Timestamp}]
						call CastSpellRange 386 0 1 0 ${CustomActor[${tcount}].ID}
					}
				}
				aggrogrp:Set[FALSE]
				break

			}


		}
	}
	while ${tcount:Inc}<${EQ2.CustomActorArraySize}

	Target ${MainAssist}
	wait 10 ${Me.ToActor.Target.ID}==${Actor[${MainAssist}].ID}
}

function Yaulp()
{

	if ${YaulpMode} && ${Me.ToActor.Power}>30
	{
		call CastSpellRange 385


		if ${Math.Calc[${Time.Timestamp}-${EquipmentChangeTimer}]}>2  && !${Me.Equipment[1].Name.Equal[${YaulpWeapon}]}
		{
			Me.Inventory[${YaulpWeapon}]:Equip
			EquipmentChangeTimer:Set[${Time.Timestamp}]
		}

		if !${Me.AutoAttackOn}
		{

			EQ2Execute /toggleautoattack
		}

		if  !${Me.CastingSpell}
		{
			Target ${KillTarget}
			call CheckPosition 1 0
		}
	}
	else
	{

		if ${Me.Maintained[${SpellType[385]}](exists)}
		{
			Me.Maintained[${SpellType[385]}]:Cancel
		}

	}
}


function WeaponChange()
{
	if ${YaulpMode}
	{
		if ${Math.Calc[${Time.Timestamp}-${EquipmentChangeTimer}]}>2  && !${Me.Equipment[1].Name.Equal[${YaulpWeapon}]}
		{
			;equip yaulp weapon
			Me.Inventory[${YaulpWeapon}]:Equip
			EquipmentChangeTimer:Set[${Time.Timestamp}]
		}
	}
	else
	{
		;equip main hand
		if ${Math.Calc[${Time.Timestamp}-${EquipmentChangeTimer}]}>2  && !${Me.Equipment[1].Name.Equal[${MainWeapon}]}
		{
			Me.Inventory[${MainWeapon}]:Equip
			EquipmentChangeTimer:Set[${Time.Timestamp}]
		}

		;equip off hand
		if ${Math.Calc[${Time.Timestamp}-${EquipmentChangeTimer}]}>2  && !${Me.Equipment[2].Name.Equal[${OffHand}]} && !${Me.Equipment[1].WieldStyle.Find[Two-Handed]}
		{
			Me.Inventory[${OffHand}]:Equip
			EquipmentChangeTimer:Set[${Time.Timestamp}]
		}
	}
}

function IncomingMob()
{
	Incoming:Set[TRUE]
}
 

crixtoanti

Active Member
Thanks cybris. Any idea how I can get my Templar to stop initiating HOs by casting Divine Providence? Keeps casting it even if offensive spells are turned off and messes up my tanks ability to do HOs.
 
Last edited:

cybris

Active Member
Nothing in this script that I can see is calling Divine Providence it must be coming from the main E2bot side of things and I don't see an option anywhere to turn it off. I'll do some more checking tho.
 

Pygar

EQ2Bot Specialist
Code:
	if !${EQ2.HOWindowActive} && ${Me.InCombat}
	{
		call CastSpellRange 303
	}
Thats casting HO's if in combat and a window not active. All the class files I maintain, I've added a UI toggle for Initiate HO, and added a && ${HoMode} to that if condition.

You absolutely want the ho's in there for solo, or even small group action. But doing them incessantly in a full balanced group is a bad idea. Ideally a scout would be starting ho's anytime no window exists.
 

cybris

Active Member
Thanks Pygar just got thru reading the HO post and figured that out.
This should work much better. I also added in the line of code that was needed to complete HO's

Code:
;*************************************************************
;Templar.iss
;version 20060704a
;variation on Inquisitor script for Templar by karye
;*************************************************************
#include "${LavishScript.HomeDirectory}/Scripts/EQ2HOLib.iss"

#includeoptional "\\Athena\innerspace\Scripts\EQ2Bot\Class Routines\EQ2BotLib.iss"

#ifndef _Eq2Botlib_
	#include "${LavishScript.HomeDirectory}/Scripts/EQ2Bot/Class Routines/EQ2BotLib.iss"
#endif

function Class_Declaration()
{

	addtrigger IncomingMob "@${Actor[${MainAssist}].ID}@ says to the group,\"MOB Incoming...!!""
	
	declare OffenseMode bool script
	declare DebuffMode bool script
	declare AoEMode bool script
	declare CureMode bool script
	declare ConvertMode bool script
	declare YaulpMode bool script
	declare FanaticismMode bool script
	declare KeepReactiveUp bool script
	declare MezzMode bool script

	declare EquipmentChangeTimer int script

	declare MainWeapon string script
	declare OffHand string script
	declare OneHandedHammer string script
	declare TwoHandedHammer string script
	declare Symbols string script
	declare Buckler string script
	declare YaulpWeapon string script
	declare TwoHandedStaff string script

	declare Incoming bool script FALSE

	call EQ2BotLib_Init

	OffenseMode:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[Cast Offensive Spells,FALSE]}]
	DebuffMode:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[Cast Debuff Spells,TRUE]}]
	AoEMode:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[Cast AoE Spells,FALSE]}]
	CureMode:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[Cast Cure Spells,FALSE]}]
	ConvertMode:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[Convert Mode,FALSE]}]
	YaulpMode:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[Yaulp Mode,FALSE]}]
	FanaticismMode:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[Fanaticism Mode,FALSE]}]
	KeepReactiveUp:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[KeepReactiveUp,FALSE]}]
	MezzMode:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[Mezz Mode,FALSE]}]

	MainWeapon:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[MainWeapon,]}]
	OffHand:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[OffHand,]}]
	OneHandedHammer:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[WeaponOneHandedHammer,]}]
	TwoHandedHammer:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[WeaponTwoHandedHammer,]}]
	Symbols:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[WeaponSymbols,]}]
	Buckler:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[Buckler,]}]
	YaulpWeapon:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[YaulpWeapon,]}]
	TwoHandedStaff:Set[${SettingXML[${charfile}].Set[${Me.SubClass}].GetString[TwoHandedStaff,]}]
}

function Buff_Init()
{

	PreAction[1]:Set[Single_Buff_Conc]
	PreSpellRange[1,1]:Set[35]

	PreAction[2]:Set[Self_Buff]
	PreSpellRange[2,1]:Set[36]

	PreAction[3]:Set[Tank_Buff]
	PreSpellRange[3,1]:Set[42]

	PreAction[4]:Set[Group_Buff_Conc]
	PreSpellRange[4,1]:Set[20]
	PreSpellRange[4,2]:Set[21]

	;PreAction[5]:Set[Group_Buff]
	;PreSpellRange[5,1]:Set[280]
	;PreSpellRange[5,2]:Set[282]

	;PreAction[6]:Set[AA_ShieldAlly]
	;PreSpellRange[6,1]:Set[389]
}

function Combat_Init()
{
	Action[1]:Set[Sign_of_Fraility]
	MobHealth[1,1]:Set[10]
	MobHealth[1,2]:Set[100]
	Power[1,1]:Set[30]
	Power[1,2]:Set[100]
	SpellRange[1,1]:Set[55]

	Action[2]:Set[Spurn]
	MobHealth[2,1]:Set[10]
	MobHealth[2,2]:Set[100]
	Power[2,1]:Set[30]
	Power[2,2]:Set[100]
	SpellRange[2,1]:Set[50]


	Action[3]:Set[Mastery]
	SpellRange[3,1]:Set[360]
	SpellRange[3,2]:Set[379]

	Action[4]:Set[Involuntary_Restoration]
	MobHealth[4,1]:Set[40]
	MobHealth[4,2]:Set[100]
	Power[4,1]:Set[40]
	Power[4,2]:Set[100]
	SpellRange[4,1]:Set[336]

	Action[5]:Set[Warring_Axiom]
	MobHealth[5,1]:Set[10]
	MobHealth[5,2]:Set[100]
	Power[5,1]:Set[40]
	Power[5,2]:Set[100]
	SpellRange[5,1]:Set[70]

	Action[6]:Set[Smite]
	MobHealth[6,1]:Set[1]
	MobHealth[6,2]:Set[100]
	Power[6,1]:Set[40]
	Power[6,2]:Set[100]
	SpellRange[6,1]:Set[61]
	SpellRange[6,2]:Set[62]

	Action[7]:Set[Stifle]
	MobHealth[7,1]:Set[10]
	MobHealth[7,2]:Set[100]
	Power[7,1]:Set[30]
	Power[7,2]:Set[100]
	SpellRange[7,1]:Set[190]

	Action[8]:Set[PreKill]
	MobHealth[8,1]:Set[5]
	MobHealth[8,2]:Set[50]
	Power[8,1]:Set[30]
	Power[8,2]:Set[100]
	SpellRange[8,1]:Set[312]

	Action[9]:Set[AoE]
	MobHealth[9,1]:Set[25]
	MobHealth[9,2]:Set[100]
	Power[9,1]:Set[30]
	Power[9,2]:Set[100]
	SpellRange[9,1]:Set[90]

	Action[10]:Set[AA_DivineCastigation]
	MobHealth[10,1]:Set[1]
	MobHealth[10,2]:Set[100]
	Power[10,1]:Set[30]
	Power[10,2]:Set[100]
	SpellRange[10,1]:Set[395]
}

function PostCombat_Init()
{
	PostAction[1]:Set[Resurrection]
	PostSpellRange[1,1]:Set[300]
	PostSpellRange[1,2]:Set[301]
}

function Buff_Routine(int xAction)
{

	declare tempvar int local

	call WeaponChange

	ExecuteAtom CheckStuck

	if ${ShardMode}
	{
		call Shard
	}

	call CheckHeals

	if ${AutoFollowMode}
	{
		ExecuteAtom AutoFollowTank
	}

	;Need to add/write a check for NPCs nearby that might be aggro to stop from buffing like a bot...
	if (${Me.ToActor.Power}>85 && ${KeepReactiveUp} && ${Mob.Detect}) || ${Incoming}
	{
		call CastSpellRange 15
		call CastSpellRange 7 0 0 0 ${Actor[${MainAssist}].ID}
		call CastSpellRange 22 0 0 0 ${Actor[${MainAssist}].ID}
		Incoming:Set[FALSE]
	}

	switch ${PreAction[${xAction}]}
	{
		case Single_Buff_Conc
			if ${Me.UsedConc}<5
			{
				grpcnt:Set[${Me.GroupCount}]
				tempvar:Set[1]
				do
				{
					switch ${Me.Group[${tempvar}].ToActor.Class}
					{
						case berserker
							if ${Me.UsedConc}<5
							{
								call CastSpellRange ${PreSpellRange[${xAction},1]} 0 0 0 ${Me.Group[${tempvar}].ToActor.ID}
								call CastSpellRange 315 0 0 0 ${Me.Group[${tempvar}].ToActor.ID}
							}
						case guardian
							if ${Me.UsedConc}<5
							{
								call CastSpellRange ${PreSpellRange[${xAction},1]} 0 0 0 ${Me.Group[${tempvar}].ToActor.ID}
								call CastSpellRange 315 0 0 0 ${Me.Group[${tempvar}].ToActor.ID}
							}
						case bruiser
						case monk
						case paladin
						case shadowknight
						case swashbuckler
						case brigand
						case troubador
						case dirge
						case ranger
						case assassin

					}
				}
				while ${tempvar:Inc}<${grpcnt}
			}
			break
		call CheckHeals
		case Self_Buff
			if ${ConvertMode}
			{
				call CastSpellRange ${PreSpellRange[${xAction},1]}
			}
			else
			{
				Me.Maintained[${SpellType[${PreSpellRange[${xAction},1]}]}]:Cancel
			}
			break
		case AA_ShieldAlly
		call CheckHeals
		case Tank_Buff
			;If the MA changed during the fight cancel so we can rebuff original MA
			if ${Me.Maintained[${SpellType[${PreSpellRange[${xAction},1]}]}].Target.ID}!=${Actor[${MainAssist}].ID}
			{
				Me.Maintained[${SpellType[${PreSpellRange[${xAction},1]}]}]:Cancel
			}
			call CastSpellRange ${PreSpellRange[${xAction},1]} 0 0 0 ${Actor[${MainAssist}].ID}
			break

		case Group_Buff_Conc
			if ${Me.UsedConc}<5
			{
				call CastSpellRange ${PreSpellRange[${xAction},1]} ${PreSpellRange[${xAction},2]}
			}
			break


		case Group_Buff
			call CastSpellRange ${PreSpellRange[${xAction},1]} ${PreSpellRange[${xAction},2]}
			break

		Default
			xAction:Set[20]
			break
	}
}

function Combat_Routine(int xAction)
{
	objHeroicOp:DoHO
	if !${EQ2.HOWindowActive} && ${Me.InCombat}
	{
		call CastSpellRange 303
	}
	AutoFollowingMA:Set[FALSE]
	if ${Me.ToActor.WhoFollowing(exists)}
	{
		EQ2Execute /stopfollow
	}
	call CheckHeals
	if ${DoHOs}
	{
		objHeroicOp:DoHO
	}

	if !${EQ2.HOWindowActive} && ${Me.InCombat}
	{
		call CastSpellRange 303
	}

	if ${Actor[${KillTarget}].Type.Equal[NamedNPC]} || ${Actor[${KillTarget}].IsEpic}
	{
		; Use AA Divine Reovery
		call CastSpellRange 396
	}

	if ${MezzMode}
	{
		call Mezmerise_Targets
	}

	call WeaponChange

	call CheckHeals

	call Yaulp

	if ${ShardMode}
	{
		call Shard
	}

	switch ${Action[${xAction}]}
	{
		case Sign_of_Fraility
			if ${DebuffMode}
			{
				call CheckCondition MobHealth ${MobHealth[${xAction},1]} ${MobHealth[${xAction},2]}
				if ${Return.Equal[OK]}
				{
					call CheckCondition Power ${Power[${xAction},1]} ${Power[${xAction},2]}
					if ${Return.Equal[OK]}
					{
						call CastSpellRange ${SpellRange[${xAction},1]} 0 0 0 ${KillTarget}
					}
				}

			}
			break

		case Spurn
			if ${DebuffMode}
			{
				call CheckCondition MobHealth ${MobHealth[${xAction},1]} ${MobHealth[${xAction},2]}
				if ${Return.Equal[OK]}
				{
					call CheckCondition Power ${Power[${xAction},1]} ${Power[${xAction},2]}
					if ${Return.Equal[OK]}
					{
						call CastSpellRange ${SpellRange[${xAction},1]} 0 0 0 ${KillTarget}
					}
				}

			}
			break

		case Involuntary_Restoration
			if ${DebuffMode}
			{
				call CheckCondition MobHealth ${MobHealth[${xAction},1]} ${MobHealth[${xAction},2]}
				if ${Return.Equal[OK]}
				{
					call CheckCondition Power ${Power[${xAction},1]} ${Power[${xAction},2]}
					if ${Return.Equal[OK]}
					{
						call CastSpellRange ${SpellRange[${xAction},1]} 0 0 0 ${KillTarget}
						call CastSpellRange 313 0 0 0 ${KillTarget}
					}
				}

			}
			break
		case Warring_Axiom
			if ${OffenseMode}
			{
				call CheckCondition MobHealth ${MobHealth[${xAction},1]} ${MobHealth[${xAction},2]}
				if ${Return.Equal[OK]}
				{
					call CheckCondition Power ${Power[${xAction},1]} ${Power[${xAction},2]}
					if ${Return.Equal[OK]}
					{
						call CastSpellRange ${SpellRange[${xAction},1]} 0 0 0 ${KillTarget}
					}
				}

			}
			break
		case Smite
			if ${OffenseMode}
			{
				call CheckCondition MobHealth ${MobHealth[${xAction},1]} ${MobHealth[${xAction},2]}
				if ${Return.Equal[OK]}
				{
					call CheckCondition Power ${Power[${xAction},1]} ${Power[${xAction},2]}
					if ${Return.Equal[OK]}
					{
						call CastSpellRange ${SpellRange[${xAction},1]} ${SpellRange[${xAction},2]} 0 0 0 ${KillTarget}
					}
				}

			}
			break
		call CheckHeals
		case Stifle
			if ${OffenseMode} || ${DebuffMode}
			{
				call CheckCondition MobHealth ${MobHealth[${xAction},1]} ${MobHealth[${xAction},2]}
				if ${Return.Equal[OK]}
				{
					call CheckCondition Power ${Power[${xAction},1]} ${Power[${xAction},2]}
					if ${Return.Equal[OK]}
					{
						call CastSpellRange ${SpellRange[${xAction},1]} 0 0 0 ${KillTarget}
					}
				}

			}
			break

		case AoE
			if ${AoEMode}
			{
				call CheckCondition MobHealth ${MobHealth[${xAction},1]} ${MobHealth[${xAction},2]}
				if ${Return.Equal[OK]}
				{
					call CheckCondition Power ${Power[${xAction},1]} ${Power[${xAction},2]}
					if ${Return.Equal[OK]}
					{
						call CastSpellRange ${SpellRange[${xAction},1]} 0 0 0 ${KillTarget}
					}
				}

			}
			break
		case PreKill
				call CheckCondition MobHealth ${MobHealth[${xAction},1]} ${MobHealth[${xAction},2]}
				if ${Return.Equal[OK]}
				{
					call CheckCondition Power ${Power[${xAction},1]} ${Power[${xAction},2]}
					if ${Return.Equal[OK]}
					{
							call CastSpellRange ${SpellRange[${xAction},1]} 0 0 0 ${KillTarget}
					}
				}
			break
		case AA_DivineCastigation
			if ${OffenseMode} && ${Me.Ability[${SpellType[${SpellRange[${xAction},1]}]}].IsReady}
			{
				call CheckCondition MobHealth ${MobHealth[${xAction},1]} ${MobHealth[${xAction},2]}
				if ${Return.Equal[OK]}
				{
					call CheckCondition Power ${Power[${xAction},1]} ${Power[${xAction},2]}
					if ${Return.Equal[OK]}
					{
						if ${Me.Equipment[1].Name.Equal[${TwoHandedStaff}]}
						{
							call CastSpellRange ${SpellRange[${xAction},1]} 0 0 0 ${KillTarget}
						}
						elseif ${Math.Calc[${Time.Timestamp}-${EquipmentChangeTimer}]}>2
						{
							Me.Inventory[${TwoHandedStaff}]:Equip
							EquipmentChangeTimer:Set[${Time.Timestamp}]
							call CastSpellRange ${SpellRange[${xAction},1]} 0 0 0 ${KillTarget}
						}
					}
				}

			}
			break
		case Mastery
			if ${OffenseMode} || ${DebuffMode}
			{
					if ${Me.Ability[Master's Smite].IsReady}
					{
						Target ${KillTarget}
						Me.Ability[Master's Smite]:Use
					}
			}
			break
		Default
			xAction:Set[40]
			break
	}
}

function Post_Combat_Routine(int xAction)
{

	TellTank:Set[FALSE]
	call CheckHeals
	;turn off Yaulp
	if ${Me.Maintained[${SpellType[385]}](exists)}
	{
		Me.Maintained[${SpellType[385]}]:Cancel
	}

	; turn off auto attack if we were casting while the last mob died
	if ${Me.AutoAttackOn}
	{
		EQ2Execute /toggleautoattack
	}

	switch ${PostAction[${xAction}]}
	{
		case Resurrection
			grpcnt:Set[${Me.GroupCount}]
			tempgrp:Set[1]
			do
			{
				if ${Me.Group[${tempgrp}].ToActor.Health}==-99 && ${Me.Group[${tempgrp}](exists)}
				{
					call CastSpellRange ${PostSpellRange[${xAction},1]} ${PostSpellRange[${xAction},2]} 0 0 ${Me.Group[${tempgrp}].ToActor.ID} 1
				}
			}
			while ${tempgrp:Inc}<${grpcnt}
			break

		Default
			xAction:Set[20]
			break
	}
}

function Have_Aggro()
{

	if !${TellTank} && ${WarnTankWhenAggro}
	{
		eq2execute /tell ${MainTank}  ${Actor[${aggroid}].Name} On Me!
		TellTank:Set[TRUE]
	}

	call CastSpellRange 180 182 0 0 ${aggroid}

}

function CheckHeals()
{
	declare temphl int local
	declare grpheal int local 0
	declare lowest int local 0
	declare grpcure int local 0
	declare mostafflicted int local 0
	declare mostafflictions int local 0
	declare tmpafflictions int local 0
	declare PetToHeal int local 0

	grpcnt:Set[${Me.GroupCount}]
	hurt:Set[FALSE]

	temphl:Set[1]
	grpcure:Set[0]
	lowest:Set[1]

	;Res the MT if they are dead
	if ${Actor[${MainTankPC}].Health}==-99 && ${Actor[${MainTankPC}](exists)}
	{
		call CastSpellRange 300 0 0 0 ${Actor[${MainTankPC}].ID}
	}

	do
	{
		if ${Me.Group[${temphl}].ZoneName.Equal[${Zone.Name}]}
		{

			if ${Me.Group[${temphl}].ToActor.Health}<100 && ${Me.Group[${temphl}].ToActor.Health}>-99 && ${Me.Group[${temphl}](exists)}
			{
				if ${Me.Group[${temphl}].ToActor.Health}<=${Me.Group[${lowest}].ToActor.Health}
				{
					lowest:Set[${temphl}]
				}
			}

			if ${Me.Group[${temphl}].IsAfflicted}

			{
				tmpafflictions:Set[${Math.Calc[${Me.Group[${temphl}].Arcane}+${Me.Group[${temphl}].Trauma}+${Me.Group[${temphl}].Elemental}+${Me.Group[${temphl}].Noxious}]}]

				if ${tmpafflictions}>${mostafflictions}
				{
					mostafflictions:Set[${tmpafflictions}]
					mostafflicted:Set[${temphl}]
				}
			}

			if ${Me.Group[${temphl}].ToActor.Health}>-99 && ${Me.Group[${temphl}].ToActor.Health}<80
			{
				grpheal:Inc
			}

			if ${Me.Group[${temphl}].Arcane} || ${Me.Group[${temphl}].Elemental}
			{
				grpcure:Inc
			}

			if ${Me.Group[${temphl}].Class.Equal[conjuror]}  || ${Me.Group[${temphl}].Class.Equal[necromancer]}
			{
				if ${Me.Group[${temphl}].ToActor.Pet.Health}<60 && ${Me.Group[${temphl}].ToActor.Pet.Health}>0
				{
					PetToHeal:Set[${Me.Group[${temphl}].ToActor.Pet.ID}
				}
			}
		}

	}
	while ${temphl:Inc}<${grpcnt}

	if ${Me.ToActor.Health}<80 && ${Me.ToActor.Health}>-99
	{
		grpheal:Inc
	}

	if ${Me.Arcane} || ${Me.Elemental}
	{
		grpcure:Inc
	}

	;MAINTANK EMERGENCY HEAL
	if ${Me.Group[${lowest}].ToActor.Health}<30 && ${Me.Group[${lowest}].Name.Equal[${MainTankPC}]} && ${Me.Group[${lowest}].ToActor(exists)}
	{
		call EmergencyHeal ${Actor[${MainTankPC}].ID}
	}

	;ME HEALS
	if ${Me.ToActor.Health}<=${Me.Group[${lowest}].ToActor.Health} && ${Me.Group[${lowest}].ToActor(exists)}
	{
		if ${Me.ToActor.Health}<40
		{
			if ${haveaggro}
			{
				call EmergencyHeal ${Me.ID}
			}
			else
			{
				if ${Me.Ability[${SpellType[1]}].IsReady}
				{
					call CastSpellRange 1 0 0 0 ${Me.ID}
				}
				else
				{
					call CastSpellRange 4 0 0 0 ${Me.ID}
				}
			}
			hurt:Set[TRUE]
		}
		else
		{
			if ${Me.ToActor.Health}<85
			{
				if ${haveaggro}
				{
					call CastSpellRange 7 0 0 0 ${Me.ID}
				}

			}
		}
	}
	;MAINTANK HEALS
	if ${Actor[${MainTankPC}].Health} <90 && ${Actor[${MainAssist}](exists)} && ${Actor[${MainTankPC}].InCombatMode} && ${Actor[${MainTankPC}].Health}>-99
	{
		call CastSpellRange 7 0 0 0 ${Actor[${MainTankPC}].ID}
	}

	if ${Actor[${MainAssist}].Health} <50 && ${Actor[${MainTankPC}].Health} >-99 && ${Actor[${MainTankPC}](exists)}
	{
		call CastSpellRange 1 0 0 0 ${Actor[${MainTankPC}].ID}
	}

	;GROUP HEALS
	if ${grpheal}>2
	{
		if ${Me.Ability[${SpellType[10]}].IsReady}
		{
			call CastSpellRange 10
		}
		else
		{
			call CastSpellRange 15
		}
	}

	if ${Me.Group[${lowest}].ToActor.Health}<80 && ${Me.Group[${lowest}].ToActor(exists)}
	{
		if ${Me.Ability[${SpellType[1]}].IsReady} && ${Me.Group[${lowest}].ToActor.Health}>-99 && ${Me.Group[${lowest}].ToActor(exists)}
		{
			call CastSpellRange 1 0 0 0 ${Me.Group[${lowest}].ToActor.ID}

		}
		else
		{
			call CastSpellRange 4 0 0 0 ${Me.Group[${lowest}].ToActor.ID}
		}

		hurt:Set[TRUE]
	}

	;CURES
	if ${grpcure}>2 && ${CureMode}
	{
		call CastSpellRange 181
	}

	if ${Me.IsAfflicted} && ${CureMode}
	{
		call CureMe
	}

	if ${mostafflicted} && ${CureMode}
	{
		call CureGroupMember ${mostafflicted}
	}

	;PET HEALS
	if ${PetToHeal} && ${Actor[${PetToHeal}](exists)}
	{
		if ${Actor[${PetToHeal}].InCombatMode}
		{
			call CastSpellRange 7 0 0 0 ${PetToHeal}
		}
		else
		{
			call CastSpellRange 1 0 0 0 ${PetToHeal}
		}
	}



}

function EmergencyHeal(int healtarget)
{

	call CastSpellRange 316 0 0 0 ${healtarget}

	if ${Me.Ability[${SpellType[335]}].IsReady}
	{
		call CastSpellRange 335 0 0 0 ${healtarget}
	}
	else
	{
		call CastSpellRange 17 0 0 0 ${healtarget}
	}

}

function Lost_Aggro()
{

}

function MA_Lost_Aggro()
{

}

function MA_Dead()
{
	if ${Actor[${MainAssist}].Health}==-99 && ${Actor[${MainTankPC}](exists)}
	{
		call 300 301 0 0 ${Actor[${MainTankPC}].ID} 1
	}
}

function Cancel_Root()
{

}

function CureMe()
{
	if  ${Me.Arcane}>0 && !${Me.ToActor.Effect[Revived Sickness](exists)}
	{
		;call CastSpellRange 326
		if ${Me.Arcane} && !${Me.ToActor.Effect[Revived Sickness](exists)}
		{
			call CastSpellRange 210 0 0 0 ${Me.ID}
			return
		}
	}

	if  ${Me.Noxious}>0
	{
		call CastSpellRange 213 0 0 0 ${Me.ID}
		return
	}

	if  ${Me.Elemental}>0
	{
		call CastSpellRange 211 0 0 0 ${Me.ID}
		return
	}

	if  ${Me.Trauma}>0
	{
		call CastSpellRange 212 0 0 0 ${Me.ID}
		return
	}


}

function CureGroupMember(int gMember)
{
	declare tmpcure int local

	tmpcure:Set[0]
	if !${Me.Group[${gMember}].ZoneName.Equal[${Zone.Name}]}
	{
		return
	}

	do
	{
		if  ${Me.Group[${gMember}].Arcane}>0 && !${Me.Group[${gMember}].ToActor.Effect[Revived Sickness](exists)}
		{
			;call CastSpellRange 326

				if  ${Me.Group[${gMember}].Arcane}>0 && !${Me.Group[${gMember}].ToActor.Effect[Revived Sickness](exists)}
				{
					call CastSpellRange 210 0 0 0 ${Me.Group[${gMember}].ID}
				}
		}

		if  ${Me.Group[${gMember}].Noxious}>0
		{
			call CastSpellRange 213 0 0 0 ${Me.Group[${gMember}].ID}
		}

		if  ${Me.Group[${gMember}].Elemental}>0
		{
			call CastSpellRange 211 0 0 0 ${Me.Group[${gMember}].ID}
		}

		if  ${Me.Group[${gMember}].Trauma}>0
		{
			call CastSpellRange 212 0 0 0 ${Me.Group[${gMember}].ID}
		}
	}
	while ${Me.Group[${gMember}].IsAfflicted} && ${CureMode} && ${tmpcure:Inc}<3
}



; This is not called/active in this script at present since Templar mez is weak at best.
function Mezmerise_Targets()
{
	declare tcount int local 1
	declare tempvar int local
	declare aggrogrp bool local FALSE

	grpcnt:Set[${Me.GroupCount}]

	EQ2:CreateCustomActorArray[byDist,15]

	do
	{
		if (${CustomActor[${tcount}].Type.Equal[NPC]} || ${CustomActor[${tcount}].Type.Equal[NamedNPC]}) && ${CustomActor[${tcount}](exists)} && !${CustomActor[${tcount}].IsLocked} && !${CustomActor[${tcount}].IsEpic}
		{
			if ${Actor[${MainAssist}].Target.ID}==${CustomActor[${tcount}].ID}
			{
				continue
			}

			tempvar:Set[1]
			aggrogrp:Set[FALSE]
			do
			{
				if ${CustomActor[${tcount}].Target.ID}==${Me.Group[${tempvar}].ID}
				{
					aggrogrp:Set[TRUE]
					break
				}
			}
			while ${tempvar:Inc}<${grpcnt}

			if ${CustomActor[${tcount}].Target.ID}==${Me.ID}
			{
				aggrogrp:Set[TRUE]
			}


			if ${aggrogrp}
			{

				if ${Me.AutoAttackOn}
				{
					eq2execute /toggleautoattack
				}

				if ${Me.RangedAutoAttackOn}
				{
					eq2execute /togglerangedattack
				}

				;check for wonderous buckling
				if ${Me.Ability[${SpellType[386]}](exists)}
				{
				;check if we have a our buckler equipped if not equip and cast wonderous buckling
					if ${Me.Equipment[2].Name.Equal[${Buckler}]}
					{
						call CastSpellRange 386 0 1 0 ${CustomActor[${tcount}].ID}
					}
					elseif ${Math.Calc[${Time.Timestamp}-${EquipmentChangeTimer}]}>2
					{
						Me.Inventory[${Buckler}]:Equip
						EquipmentChangeTimer:Set[${Time.Timestamp}]
						call CastSpellRange 386 0 1 0 ${CustomActor[${tcount}].ID}
					}
				}
				aggrogrp:Set[FALSE]
				break

			}


		}
	}
	while ${tcount:Inc}<${EQ2.CustomActorArraySize}

	Target ${MainAssist}
	wait 10 ${Me.ToActor.Target.ID}==${Actor[${MainAssist}].ID}
}

function Yaulp()
{

	if ${YaulpMode} && ${Me.ToActor.Power}>30
	{
		call CastSpellRange 385


		if ${Math.Calc[${Time.Timestamp}-${EquipmentChangeTimer}]}>2  && !${Me.Equipment[1].Name.Equal[${YaulpWeapon}]}
		{
			Me.Inventory[${YaulpWeapon}]:Equip
			EquipmentChangeTimer:Set[${Time.Timestamp}]
		}

		if !${Me.AutoAttackOn}
		{

			EQ2Execute /toggleautoattack
		}

		if  !${Me.CastingSpell}
		{
			Target ${KillTarget}
			call CheckPosition 1 0
		}
	}
	else
	{

		if ${Me.Maintained[${SpellType[385]}](exists)}
		{
			Me.Maintained[${SpellType[385]}]:Cancel
		}

	}
}


function WeaponChange()
{
	if ${YaulpMode}
	{
		if ${Math.Calc[${Time.Timestamp}-${EquipmentChangeTimer}]}>2  && !${Me.Equipment[1].Name.Equal[${YaulpWeapon}]}
		{
			;equip yaulp weapon
			Me.Inventory[${YaulpWeapon}]:Equip
			EquipmentChangeTimer:Set[${Time.Timestamp}]
		}
	}
	else
	{
		;equip main hand
		if ${Math.Calc[${Time.Timestamp}-${EquipmentChangeTimer}]}>2  && !${Me.Equipment[1].Name.Equal[${MainWeapon}]}
		{
			Me.Inventory[${MainWeapon}]:Equip
			EquipmentChangeTimer:Set[${Time.Timestamp}]
		}

		;equip off hand
		if ${Math.Calc[${Time.Timestamp}-${EquipmentChangeTimer}]}>2  && !${Me.Equipment[2].Name.Equal[${OffHand}]} && !${Me.Equipment[1].WieldStyle.Find[Two-Handed]}
		{
			Me.Inventory[${OffHand}]:Equip
			EquipmentChangeTimer:Set[${Time.Timestamp}]
		}
	}
}

function IncomingMob()
{
	Incoming:Set[TRUE]
}
 
Last edited:

Cr4zyb4rd

Active Member
Forum Rules and Procedures
The EQ2Bot forum is a subforum of Script Releases and inherits most of the rules and procedures associated with that forum. Here, users may post finished support files for the EQ2Bot script written by Blazer. Threads should only contain postings by the contributor.

Also, I would ask that threads be distinguished by the class for which the support files are designed. For example, if you are contributing 'dirge' support files, please include it in the 'dirge routine and spell list' that is already posted on this forum.

Discussion and questions regarding EQ2Bot should be posted in the General Discussion forum.
Clean it up, guys.

cybris, you might just want to make a new thread if you're going to be posting full releases rather than just patches. at any rate, the discussion doesn't belong here.
 
Status
Not open for further replies.
Top Bottom