All pastes #281775 Raw Edit

Untitled

public c v1 · immutable
#281775 ·published 2006-12-17 01:20 UTC
rendered paste body
#define ROUTINES; What bandaid to use#define BANDAGE "Heavy Silk Bandage"; Where or not to use stealth on npc pull: TRUE or FALSE#define PATROL_STEALTH TRUE; Stealth pull attack; Parameters: "Cheap Shot" - "Ambush" - "Garrote";                100%      -   50%    -    50%    <--- working percent#define STEALTH_PULL "Cheap Shot"; Mainhand poison to use; Parameters: "Exact Name of Poison"#define MHPoison "Instant Poison III"; Offhand poison to use; Parameters: "Exact Name of Poison"#define OHPoison "Instant Poison III"function CombatPrep(){	if PATROL_STEALTH	{		call CastSpell "Stealth"	}	;Reset flag	DoCombatPrep:Set[FALSE]}function Attack(string AttackGUID){	declare SavX float local ${Me.X}	declare SavY float local ${Me.Y}	declare SavZ float local ${Me.Z}	declare BailOut int local ${Math.Calc[${LavishScript.RunningTime}+(1000*${CombatBailout})]}	declare RunToEnemyTime int local 8	declare HavePulled bool local FALSE	declare StuckCheck bool local FALSE	declare StuckCheckTime int local	declare Aggros guidlist local	declare ObstacleCheckTimer bool local TRUE	if ${AttackGUID.Equal[NULL]}||${AttackGUID.Equal[NOTARGET]}	{		call UpdateHudStatus "No target to attack"	}	call UpdateHudStatus "Attacking ${Object[${AttackGUID}].Name}" 	Do	{		SavX:Set[${Me.X}]		SavY:Set[${Me.Y}]		SavZ:Set[${Me.Z}]		; Ensure we are still facing our target loc		call SmartFacePrecision ${Unit[${AttackGUID}].X} ${Unit[${AttackGUID}].Y}		; Check we still have a valid target		if !${Unit[${AttackGUID}](exists)}		{			call UpdateHudStatus "Target lost"			TargetGUID:Set[NOTARGET]			Return		}		; Check if the target is engaged already		if ${Unit[${AttackGUID}].Tapped}		{			call UpdateHudStatus "Target already engaged"			TargetGUID:Set[NOTARGET]			Return					}  		; If we dont have our chosen unit targeted and were in range target it		if !${Target.GUID.Equal[${AttackGUID}]}		{			#ifdef DEBUG			call Debug "Targeting Unit ${Unit[${AttackGUID}].Distance}[${AttackGUID}]"			#endif			Target ${AttackGUID}			waitframe		}		if !${Me.Attacking}&&${Target(exists)}&&!${Me.Buff[Stealth](exists)}		{			WoWScript AttackTarget()		}		; Check we havent picked up aggro		Aggros:Search[-units,-nearest,-aggro,-alive,-range 0-20]		if ${Aggros.Count}>0		{			if ${Aggros.Count}>3			{				RLG:Set[TRUE]				call CastSpell "Vanish"				wait 100				return			}			if ${Aggros.Count}>1&&!${Spell[Evasion].Cooldown}			{				Call CastSpell "Evasion"			}		}		Aggros:Clear		if ${Target.Distance} >= ${CombatMaxDist}		{			RunToEnemyTime:Set[0]			call SmartFacePrecision ${Target.X} ${Target.Y}			move forward			do			{				SavX:Set[${Me.X}]				SavY:Set[${Me.Y}]				call SmartFacePrecision ${Target.X} ${Target.Y}				move forward				wait 5				RunToEnemyTime:Inc			}			while ${Target.Distance}>=${CombatMaxDist} && ${RunToEnemyTime}<=60*2			move -stop forward			;wait for half a second to give our pc a chance to move			wait 5		}		if ${Unit[${AttackGUID}].Distance}<${CombatMinDist}		{			#ifdef DEBUG			call Debug "Too close backing up"			#endif			;press and hold the backward button 			wowpress -release moveforward			wowpress -hold movebackward			wait 20		}		;If we are close enough stop running		if ${Unit[${AttackGUID}].Distance}>=${CombatMinDist}&&${Unit[${AttackGUID}].Distance}<${CombatMaxDist}		{			wowpress -release moveforward			wowpress -release movebackward			StuckCheck:Set[FALSE]		}		if ${Unit[${AttackGUID}].Distance}<5 && ${Me.Buff[Stealth](exists)}		{			wowpress -release moveforward			wowpress -release movebackward			call CastSpell STEALTH_PULL ${Target.GUID}		}		if ${Unit[${AttackGUID}].Distance}<5 && !${Me.Buff[Stealth](exists)}		{			wowpress -release moveforward			wowpress -release movebackward			if ${Target.Casting.ID(exists)} && ${Me.CurrentEnergy}>=25			{				call CastSpell "Kick" ${Target.GUID}			}			if ${Target.Casting.ID(exists)} && ${Me.CurrentEnergy}>=45			{				call CastSpell "Gouge" ${Target.GUID}			}			if ${Me.CurrentEnergy}>10 && ${Spell[Riposte](exists)} && !${Spell[Riposte].Cooldown}			{ 				call CastSpell "Riposte" ${Target.GUID}			}			if ${Target.PctHPs}>=90 && !${Spell[Blade Flurry].Cooldown} && ${Me.CurrentEnergy}>25 && ${Spell[Blade Flurry](exists)}			{				call CastSpell "Blade Flurry"			}			if ${Target.PctHPs}>=90 && !${Spell[Adrenaline Rush].Cooldown} && ${Spell[Adrenaline Rush](exists)}&&${Spell[Blade Flurry].Cooldown}			{				call CastSpell "Adrenaline Rush"			}			if ${WoWScript[GetComboPoints()]}>=5 && !${Spell[Kidney Shot].Cooldown} && ${Me.CurrentEnergy}>=25			{				call CastSpell "Kidney Shot" ${Target.GUID}			}			if ${WoWScript[GetComboPoints()]}>=4 && ${Target.PctHPs}<=40 && !${Spell[Kidney Shot].Cooldown} && ${Me.CurrentEnergy}>=25			{				call CastSpell "Kidney Shot" ${Target.GUID}			}			if ${WoWScript[GetComboPoints()]}>=3 && ${Target.PctHPs}<=30 && !${Spell[Kidney Shot].Cooldown} && ${Me.CurrentEnergy}>=25			{				call CastSpell "Kidney Shot" ${Target.GUID}			}			if ${WoWScript[GetComboPoints()]}>=2 && ${Target.PctHPs}<=20 && !${Spell[Kidney Shot].Cooldown} && ${Me.CurrentEnergy}>=25			{				call CastSpell "Kidney Shot" ${Target.GUID}			}			if ${WoWScript[GetComboPoints()]}>=1 && ${Target.PctHPs}<=10 && !${Spell[Kidney Shot].Cooldown} && ${Me.CurrentEnergy}>=25			{				call CastSpell "Kidney Shot" ${Target.GUID}			}			if ${WoWScript[GetComboPoints()]}<=2 && !${Me.Buff[Slice and Dice](exists)} && ${Me.CurrentEnergy}>=25			{				call CastSpell "Slice and Dice" ${Target.GUID}			}			if ${Me.CurrentEnergy}>=40			{				call CastSpell "Sinister Strike" ${Target.GUID} 			}		}				if ${Unit[${AttackGUID}].Distance}<5&&${Me.PctHPs}<=15&&${Target.PctHPs}>=30		{			RLG:Set[TRUE]			call CastSpell "Vanish"  ${Target.GUID}			wait 200			DoDowntime:Set[TRUE]			return		}		if ${Unit[${AttackGUID}].Distance}<5&&${Me.PctHPs}<=30&&${Target.PctHPs}>=35		{			Item[-exact,"Healing Potion"]:Use		}				if ${Me.HoldingBreath}		{			wowpress JUMP		}				if ${ObstacleCheckTimer}		{			; Check to make sure we have moved since the last check and if not then try and avoid the			; obstacle thats in our path			;if ${Math.Calc[${Me.X}-${SavX}]}<1&&${Math.Calc[${Me.Y}-${SavY}]}<1&&${Unit[${AttackGUID}].Distance}>${CombatMaxDist}			if ${Math.Distance[${Me.X},${Me.Y},${SavX},${SavY}]}<1 && ${Unit[${AttackGUID}].Distance}>${CombatMaxDist}			{				; I think i might be stuck so save off the current time				if !${StuckCheck}				{					#ifdef DEBUG						call Debug "I might be stuck"					#endif					StuckCheck:Set[TRUE]					StuckCheckTime:Set[${LavishScript.RunningTime}]				} 				else				{					; If I am still stuck after 8 seconds then try and avoid the obstacle.					if ${Math.Calc[${LavishScript.RunningTime}-${StuckCheckTime}]}>8000					{						#ifdef DEBUG							call Debug "Yep I am stuck trying to free myself"						#endif						call Obstacle						StuckCheck:Set[FALSE]					}				}			}						; If I have moved away from my saved spot reset my stuck toggle			if ${StuckCheck}&&${Math.Calc[${Me.X}-${SavX}]}>3||${Math.Calc[${Me.Y}-${SavY}]}>3			{				#ifdef DEBUG					call Debug "I am no longer stuck"				#endif				StuckCheck:Set[FALSE]			}					; Check if we have exceeded bail out timer			if ${LavishScript.RunningTime}>${BailOut}			{				GUIDBlacklist:Set[${TargetGUID},AVOID]				call UpdateHudStatus "Combat timeout reached"				TargetGUID:Set[NOTARGET]				return			}						; Store our current position.			SavX:Set[${Me.X}]			SavY:Set[${Me.Y}]						; Set a timer to check our position again in a second or so.			TimedCommand 5 ObstacleCheckTimer:Set[TRUE]		}							}	while !${Unit[${AttackGUID}].Dead}&&!${Me.Dead}	{		; Update stats		if !${Me.Dead}		{			call UpdateStats		}	}	wowpress -release movebackward	wowpress -release moveforward	;Reset flags to do combat prep and downtime if we are not still aggroed	Aggros:Search[-units,-nearest,-aggro,-alive,-range 0-50]	if !${Aggros.Count}	{		call Debug "Resetting Downtime and CombatPrep Flags"		DoDowntime:Set[TRUE]		DoCombatPrep:Set[TRUE]	}	Aggros:Clear}function Downtime(){	if ${Me.Dead} || ${Me.Ghost} || ${Me.InCombat}	{		DoDowntime:Set[FALSE]   		return	}	if ${Me.PctHPs}<${MinHealthPct} && !${Me.InCombat} && !${Me.Dead} && !${Me.Ghost}	{		call CheckDurability		DoDowntime:Set[TRUE]		wowpress -release movebackward		wowpress -release moveforward		if !${Me.Buff[Recently Bandaged](exists)} && ${Item[-exact,BANDAGE](exists)}		{			target ${Me}			Item[-exact,BANDAGE]:Use			wait 100		}		if !${Me.Buff[Food](exists)} && ${Me.PctHPs}<75		{			call Eat			wait 10		}		while ${Me.PctHPs}<95 && !${Me.InCombat} && !${Me.Dead} && !${Me.Ghost}		{			if !${Me.Buff[Stealth](exists)}			{				CastSpell "Stealth"			}			if !${Me.Sitting}			{				wowpress SITORSTAND			}			wait 10		}	}	if ${Me.Sitting}	{		wowpress SITORSTAND	}	; Check for poison on our main hand.	if !${Me.InCombat} && ${Me.Equip[mainhand].Enchantment[MHPoison](exists)} == NULL && ${Item[MHPoison](exists)}	{		call UpdateHudStatus "Applying Mainhand Poison"		Item[-exact,MHPoison]:Use		wait 20		Object[${Me.Equip[mainhand]}]:PickUp		wait 70	}	if !${Me.InCombat} && ${Me.Equip[offhand].Enchantment[OHPoison](exists)} == NULL && ${Item[OHPoison](exists)}	{		call UpdateHudStatus "Applying Offhand Poison"		Item[-exact,OHPoison]:Use		wait 20		Object[${Me.Equip[offhand]}]:PickUp		wait 70	}	; Reset downtime flag	DoDowntime:Set[FALSE]}