mob array and /target radius question

Maskoi

New member
Joined
Mar 28, 2009
Messages
410
Reaction score
0
Points
0
Location
Dalls, TX
I am modifying a puller mac to ignore mobs out of my Line of Sight within my pull radius. It kind of f works but its not totally ignoring the mobs added to the array and I can't figure out why. Posted below are the main chunks of code I wrote trying to accomplish this. Any help is greatly appreciated. The array is suppose to drop mobs after it gathers 10 but the macro tries to pull mobs in the array with like 3 entries and no other mobs are up within the pull radius.

Basically he puller runs up to the mob say behind a wall when it can't reach it it adds that mob to the array so it won't try and pul it again.

Code:
|--------------------------------------------------------------------------------
| SUB: AquireTarget
|--------------------------------------------------------------------------------
Sub GetTarget
   /doevents
  /declare j int local
   /declare CurrentRadius   int local
   /declare TargetSub       int local
   /echo Looking for Close Range Mobs
   :Acquire
      /doevents
      /for CurrentRadius ${Min_Radius} to ${MaxRadius} step 5
    /for j 1 to 10   
      /squelch /target radius ${CurrentRadius} npc notid ${LoSSkip[${j}]}
     /if (${LoSSkip[${j}]}>=1) /echo Skipping ${Spawn[${LoSSkip[${j}]}].CleanName} ID ${LoSSkip[${j}]}
   /next j
      /varset MyTargetID ${Target.ID}
      /varset MyTargetDead 0
      /if (${Target.ID}) {
      /call Check_Target
      /if (!${target_checked}) {
            /call ResetSub
            /goto :Acquire
         }
         /varset HasTarget 1
         /varset MyTargetName ${Target.Name}
         /echo Acquired ${Spawn[${MyTargetName}].CleanName} at range ${Int[${Target.Distance}]}
         /return
      }
     | Reset search radius if it gets larger that MaxRadius
     /if (${Min_Radius}>=${MaxRadius}) {
     /varset MinRadius 50
     }
      /next CurrentRadius
      /goto :Acquire
/return


| - this is in the move to mob part
/if (!${Target.LineOfSight}) /varcalc LoSCount ${LoSCount}+1
/if (${LoSCount}>=50) /call LoSSkipMob


Sub LoSSkipMob
  /declare i int local
  /for i 10 downto 2
  /varset LoSSkip[${i}] ${LoSSkip[${Math.Calc[${i}-1]}]}
  /next i
  /varset LoSSkip[1] ${Target.ID}
  /varset LoSCount 0
  /return
 
Honestly here is where I would use a alert list instead. IE out of my current puller:

Code:
/target radius ${int_MAXRadius} npc noalert 1
|--filters for this mob... if it passes, pull it... eg:
/if ( (${Target.ID})) {
		
 /if (!${Target.LineOfSight}){
  /echo Mob is out of LOS!
  /alert add 1 id ${Target.ID}
  /varcalc int_alertCount ${int_alertCount}+1 
  /call ResetSub 
  /goto :Acquire
 }   
 /varset RV_MyTargetID ${Target.ID} 
 /varset RV_MyTargetDead 0 
 /varset RV_HasTarget 1 
 /varset RV_MyTargetName ${Target.Name} 
 /echo Acquired ${Target.Name} at range ${Int[${Target.Distance}]}
 /return 
 }  else {
     /delay 10s
    /echo Acquire Loop failed to produce a valid target.
 }
/goto :Acquire