Page 1 of 1
checking mobs by loc
Posted: Sun Aug 15, 2004 3:02 pm
by NobodyImportant
I spent several hours browsing the forums to find nothing, i was wondering if there was a way to check spawns by loc, and not name, like there is a room full of froglocks, all named the same, but only 1 is a PH, if I find the 1, take down its loc, and then check what mob is at that loc, i can effectively know when the mob spawns.
The closest thing i have come up with on my own is something like ...
Code: Select all
/for counter 0 to ${SpawnCount}
/if (${Spawn[${counter}].X}==PHlocX) /if (${Spawn[${counter}].Y}==PHlocY) /if (${Spawn[${counter}].Z}==PHlocZ) /echo PH IS UP
/next counter
This just seems to... ugly I guess, I was wondering if there was a way to check spawns by loc without actually having the target or ID.
Thanks in advance, if im being a dumbass and not see'ing something, go ahead with the flames.
Posted: Sun Aug 15, 2004 11:49 pm
by eqjoe
If you know the name of the PH, create an array of all the mobs in zone with that name. Then check the location of each mob in your array.
In the macros forum there are several examples on how to do this stuff.
-j
Posted: Mon Aug 16, 2004 6:01 am
by SukMage
If you know where it spawns and it's name, you could /mapf custom <PH name> and look on the map in the designated spot. I believe your way would work or you can /who npc <name> and superwho will give you the location of each spawn. Compare the superwho loc with the loc you have written down. those methods might not be as easy for ya though.
Posted: Mon Aug 16, 2004 2:36 pm
by blueninja
This is from my root/dot macro. Gets the ID of a mob within a radius of 10 from the specified loc. If a mob is there the ID will be nonzero. Might want to lower the radius a bit depending on your situation.
Code: Select all
/varset MobID ${Spawn[loc ${MobX} ${MobY} radius 10 npc].ID}
Posted: Mon Aug 16, 2004 3:52 pm
by Night Hawk
I'm trying to work something out similar for a pull routine. Where tehre's 4 mobs (random type of mob at each spot), and they can all be single pulled if done in the right order. Anyhow...
something like this:
/echo ${Spawn[loc 100 -50 radius 10 npc]}
Won't work if there is a mob right on 100 -50
But if I take out the radius part, this works:
/echo ${Spawn[loc 100 -50 npc]}
The problem for me is this will show if that 1 mob is up, but if it's not, it will or may be finding one of the other 3. How could I resolve this problem? I just want to check an exact loc, and to return NULL if nothing is there. Seems simple, but I can't figure it out /boggle
Posted: Mon Aug 16, 2004 4:08 pm
by Fippy
well if you use that and then once you have a spawn ID check the spawns loc to see if it really is the mob you want.
Posted: Tue Aug 17, 2004 2:36 am
by Night Hawk
I think there's something screwed up with ${Spawn}
I thought I had it working, and I noticed no matter what the parameters, as long as it has npc in there, it would just be targeting the cloest npc... not what I want.
${Spawn[npc loc -475 1020]}
will target the same mob as:
${Spawn[npc loc 10 10]}
That mob being the closest one to me.
I was looking in the readme and I thought my problem was in the ${Spawn} filters, x comes before y, but it didn't make a difference.
Any ideas?
Posted: Tue Aug 17, 2004 10:37 am
by Fippy
deleted cause I was talking crap.
Posted: Tue Aug 17, 2004 11:09 am
by Night Hawk
Got it to work. but only with the use of radius.
Posted: Tue Aug 17, 2004 11:19 am
by Fippy
Doh didnt spot you hadn't put radius on. In the code if your spawn is not at the exact loc it then checks the radius to see if its within that radius so if you dont have a radius defined it would probably just ignore the loc argument altogether.
Posted: Tue Aug 17, 2004 11:52 am
by Sman
just some food for thought...back in the day when I was playing EQ and using MQ1, I was writing a pullling routine and found out some useful information....
if a mob gets aggro'd and moves from his spawn point, when he returns, he doesn't not return to the exact spot he spawned in, so you do need to use a radius to check, just in case the mob has been aggro'd.
Hope this is useful here.
Posted: Tue Aug 17, 2004 12:55 pm
by Night Hawk
Not posting my macro, but here's a small snippet :)
Code: Select all
/varset Spawn1ID ${Spawn[npc loc ${Spawn1X} ${Spawn1Y} radius ${R}].ID}
/varset Spawn2ID ${Spawn[npc loc ${Spawn2X} ${Spawn2Y} radius ${R}].ID}
/varset Spawn3ID ${Spawn[npc loc ${Spawn3X} ${Spawn3Y} radius ${R}].ID}
/varset Spawn4ID ${Spawn[npc loc ${Spawn4X} ${Spawn4Y} radius ${R}].ID}
/target id ${Spawn1ID}
/if (${Spawn1ID.NotEqual["NULL"]}) {
/varset MobToPull 1
/goto :TargetAquired
}
/target id ${Spawn2ID}
/if (${Spawn2ID.NotEqual["NULL"]}) {
/varset MobToPull 2
/goto :TargetAquired
}
/target id ${Spawn3ID}
/if (${Spawn3ID.NotEqual["NULL"]}) {
/varset MobToPull 3
/goto :TargetAquired
}
/target id ${Spawn4ID}
/if (${Spawn4ID.NotEqual["NULL"]}) {
/varset MobToPull 4
/goto :TargetAquired
}
Using a radius of 10 works and has been working perfectly for me.
Posted: Tue Aug 17, 2004 1:15 pm
by blueninja
Seems a bit unnessecary to store an id as a string when it's an int.
Posted: Tue Aug 17, 2004 3:37 pm
by Night Hawk
As the fact that you don't have the rest of the macro in front of you, then you would be right.