You are not logged in.

Applications: [GameMaster: OPEN] | [Volunteer Testers: OPEN]


This forum will be permanently shut down on Friday 13.07.2018
Please copy or save all important information from old forum before they will be deactivated
We have moved to new board. https://forum.runesofmagic.gameforge.com/Come join us.

ruisen2000

not a wallet warrior

  • "ruisen2000" started this thread

Posts: 4,052

Location: here

Mood: Blink

  • Send private message

1

Saturday, April 4th 2015, 7:05pm

Modifying target player macro to not target dead players

Hello,
For the macro

/run if UnitIsUnit("player", "target") or UnitIsDeadOrGhost("target") then TargetUnit("") end
/run for i=1,10 do TargetNearestEnemy() if UnitIsPlayer("target") then break end end
/run if not UnitIsPlayer("target") then TargetUnit("") end



If I don't want it to target players that are already dead, or ghost players (which I'm assuming are players just as they rez out), how do I modify it?


Do I change the third line to
/run if not UnitIsPlayer("target") or UnitIsDeadOrGhost("target") then TargetUnit("") end
or just have a 4th line with
/run if not UnitIsDeadOrGhost("target") then TargetUnit("") end

Or are neither of these correct?Thanks.
Noblewarrior
lv 98/98/89/60 M/W/P/K
Kikosi 98/50/60 Wl/Ch/M
the fail clothie tank~

Inactive

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

2

Sunday, April 5th 2015, 2:43am

Hello,
For the macro

/run if UnitIsUnit("player", "target") or UnitIsDeadOrGhost("target") then TargetUnit("") end
/run for i=1,10 do TargetNearestEnemy() if UnitIsPlayer("target") then break end end
/run if not UnitIsPlayer("target") then TargetUnit("") end



If I don't want it to target players that are already dead, or ghost players (which I'm assuming are players just as they rez out), how do I modify it?


Do I change the third line to
/run if not UnitIsPlayer("target") or UnitIsDeadOrGhost("target") then TargetUnit("") end
or just have a 4th line with
/run if not UnitIsDeadOrGhost("target") then TargetUnit("") end

Or are neither of these correct?Thanks.


You can always look at the health value of the target. If above 0 then it isn't dead. UnitHealth() will return the real health value for players (it returns a percentage for mobs and NPCs). So, you could modify the macro like this:

Source code

1
2
3
run if UnitIsUnit("player", "target") or UnitIsDeadOrGhost("target") then TargetUnit("") end
/run for i=1,10 do TargetNearestEnemy() if UnitIsPlayer("target") and UnitHealth("target") > 0 then break end end
/run if not UnitIsPlayer("target") then TargetUnit("") end


The and UnitHealth("target") > 0 in the for loop's if statement will force it to keep looking if the target has no health. You could replace UnitHeath() with UnitIsDeadOrGhost(), but IIRC UnitHealth is more reliable.
2013... The year from hell....

ruisen2000

not a wallet warrior

  • "ruisen2000" started this thread

Posts: 4,052

Location: here

Mood: Blink

  • Send private message

3

Sunday, April 5th 2015, 7:51am

Would that target players rezzing out as well? One of the problems I have with the current macros is during large battles, it becomes really difficult to target players, because I'd always target players that are dead, or players in the middle of rezzing out.
Noblewarrior
lv 98/98/89/60 M/W/P/K
Kikosi 98/50/60 Wl/Ch/M
the fail clothie tank~

Inactive

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

4

Sunday, April 5th 2015, 11:45am

I have no idea. You'll have to try it out. Though it will certainly work for dead players, those that are "rezzing out" well I don't know. That would depend if the game considers them alive or dead and what the state of their health is.
2013... The year from hell....

ruisen2000

not a wallet warrior

  • "ruisen2000" started this thread

Posts: 4,052

Location: here

Mood: Blink

  • Send private message

5

Sunday, April 5th 2015, 5:26pm

I'm assuming UnitIsDeadOrGhost("target") will check for both dead and rezzing (ghost), but I'm not familiar with the syntax for macros and I'm not sure how to incorporate it into the line /run if not UnitIsPlayer("target") then TargetUnit("") end
Noblewarrior
lv 98/98/89/60 M/W/P/K
Kikosi 98/50/60 Wl/Ch/M
the fail clothie tank~

Inactive

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

6

Monday, April 6th 2015, 2:52am

You can do pretty much the same as the first line of your macro

Source code

1
/run if not UnitIsPlayer("target") or UnitIsDeadOrGhost("target") then TargetUnit("") end

This will also clear your current target if you are currently targeting a dead mob though. If this is a problem, you can rewrite it as

Source code

1
/run if not UnitIsPlayer("target") or (UnitIsPlayer("target") and  UnitIsDeadOrGhost("target")) then TargetUnit("") end
2013... The year from hell....

ruisen2000

not a wallet warrior

  • "ruisen2000" started this thread

Posts: 4,052

Location: here

Mood: Blink

  • Send private message

7

Monday, April 6th 2015, 5:37am

Ah, thanks!
Noblewarrior
lv 98/98/89/60 M/W/P/K
Kikosi 98/50/60 Wl/Ch/M
the fail clothie tank~

Inactive