All pastes #625027 Raw Edit

Mine

public text v1 · immutable
·published 2007-07-18 18:15 UTC
rendered paste body
	if ${TravelState} == SELLING
	{
		call CheckHostileList
		if ${Return.Find[HOSTILENEAR]}
		{
			TargetGUID:Set[${HostileList[0]}]
			HeartBeat:Inc
			echo "Selling, hostile near, kicking its ass"
			NoTargetCount:Set[0]
			return
		}
		echo "Selling, no hostiles near, continuing on my way"
		NoTargetCount:Set[4]
		return
	}
	if ${Questing}
	{
		call CheckQuestmobList
		if ${Return.Find[MOBNEAR]}
		{
			TargetGUID:Set[${QuestmobList[0]}]
			HeartBeat:Inc
			echo "Questing, quest mob near, kicking its ass"
			NoTargetCount:Set[0]
			return
		}
		echo "${Return} Questmob Return Check"
		call CheckHostileList
		if ${Return.Find[HOSTILENEAR]}
		{
			TargetGUID:Set[${HostileList[0]}]
			HeartBeat:Inc
			echo "Questing, no quest mob near, hostile near, kicking its ass"
			NoTargetCount:Set[0]
			return
		}
		echo "${Return} Hostile Return Check"
		echo "Questing, no questmobs avail, no hostiles, continuing my patrol"
		NoTargetCount:Set[4]
		return
	}
	if (${Leveling}||${Chaining}) && !${Questing}
	{
		call CheckHostileList
		if ${Return.Find[HOSTILENEAR]}
		{
			TargetGUID:Set[${HostileList[0]}]
			HeartBeat:Inc
			echo "Need skills or chaining, but hostile near, kicking its ass"
			NoTargetCount:Set[0]
			return
		}
		echo "Leveled and need skills or chaining, no hostiles near, continuing to move"
		NoTargetCount:Set[4]
		return
	}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Passive Hostile GUIDList populate and check, used for efficiency in
; C Stealthy 2007				targeting and movement
; 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
function CheckHostileList()
{
	;Clear the GUIDList since it's a declare instead of variable
	if ${HostileList.Count} >= 1
		HostileList:Clear

	;Populate the GUIDlist
	HostileList:Search[-units,-hostile,-range 0-15]

	;Check through it
	if ${HostileList.Count} > 0
	{
		;If there are any results, there's a hostile near and it's unsafe to proceed without risking aggro
		return "HOSTILENEAR"
	}
	if ${HostileList.Count} == 0
	{
		return "NOHOSTILE"
	}
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Passive QuestMob GUIDList populate and check, used for targeting period
; C Stealthy 2007
; 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
function CheckQuestmobList()
{
	variable int Indexx = 1

	;Clear the GUIDList since it's a declare instead of a variable
	if ${QuestmobList.Count} >= 1
		QuestmobList:Clear
	
	;Populate the GUIDList

	do
	{
		QuestmobList:Search[-range 0-25,-units,${questing.QuestMobName[${questing.CurrentQuest},${Indexx}]}]
		echo "Current Quest Mob Target: ${questing.QuestMobName[${questing.CurrentQuest},${Indexx}]}"
		echo "Current Quest Mob Count: ${QuestmobList.Count}"
		Indexx:Inc
	}
	while !${questing.QuestMobName[${questing.CurrentQuest},${Indexx}].Equal[NULL]}
	;Check it
	if ${QuestmobList.Count} >= 1
	{
		;Return that there's a quest mob near
		return "MOBNEAR"
	}
	if ${QuesTMob.Count} == 0
	{
		;Return that I'm a stuipd SOB and no mobs are near
		return "NOMOB"
	}
}