How to aggro mob, but not kill, instead use item on it?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Cindy
Posts: 237
Joined: Fri Sep 28, 2012 4:23 pm

How to aggro mob, but not kill, instead use item on it?

#1 Post by Cindy » Sun Apr 28, 2013 2:31 am

I am doing a WP for a daily, and one of the quests requires me to walk up to a mob, get aggro, and then use the item. How do I use the item instead of kill it?

Here is the code:

Code: Select all

	<!-- # 21 --><waypoint x="a" z="b" y="c">
		-- Need to target mob, preferably with non arggroed char, and cast rune, then kill
		target_NPC(killmob; yrest(500)
		inventory:useItem(item2use);	
	</waypoint>
	<!-- # 22 --><waypoint x="neara" z="nearb" y="nearc">		-- previous wp, 22, drag back here, friendly npcs will take aggro
	</waypoint>
And here is the clever part. Nearby there are some friendly npc's, if I can drag my killmob to them, they will attack it, mob will aggro them, instead of me, thereby allowing me to complete casting the rune without interruption. Thats what WP22 is for... Now, how do I get this done?

(I have ideas about other quests in other zones, which is similar, except mob must be dpsed down to less than 50%, but that plan builds on this one, will still need to figure that out too.)

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: How to aggro mob, but not kill, instead use item on it?

#2 Post by rock5 » Sun Apr 28, 2013 6:14 am

Well if you set the waypoint type as "TRAVEL" then it shouldn't auto attack. Then get aggro manually, "player:tareget_NPC(killmob) yrest(500)" might work. If it doesn't, try following it with an "Attack()". Now do you want to use the rune when you aggro it or when you get to the npc?
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Cindy
Posts: 237
Joined: Fri Sep 28, 2012 4:23 pm

Re: How to aggro mob, but not kill, instead use item on it?

#3 Post by Cindy » Sun Apr 28, 2013 6:21 pm

Ideally when I get to the friendly npcs, because if i try to use it while the mob has me targetted, it seems to interrupt my cast every time.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: How to aggro mob, but not kill, instead use item on it?

#4 Post by rock5 » Mon Apr 29, 2013 1:08 am

I'm assuming you need to have the mob targeted when you use the item and if you head to the npc the bot will "cleartarget" so I think you need to "remember" the target so you can retarget it at the npc. Also I'm going to assume the mob moves around and may not always be present.

Code: Select all

-- Change to "TRAVEL" if it isn't already
__WPL:setForcedWaypointType("TRAVEL")

-- Find the mob
local mob
repeat
   mob = player:findEnemy(false, killmob_Id, evalTargetDefault)
   yrest(1000)
until mob

-- Target mob and get aggro
player:target(mob.Address)
repeat
   Attack()
   yrest(2000)
   mob:update()
until mob.Targetptr == player.Address
That should do it for the mob aggro wp. You'll need to use the mob Id with "findEnemy". Now the code for near the npc.

Code: Select all

-- wait till mob catches up
repeat 
   yrest(1000)
   mob:update()
until 50 > distance(player, mob)

-- Target mob
player:target(mob.Address)

-- Use item
repeat
   inventory:useItem(item2use)
   repeat
      yrest(1000)
      player:update()
   until player.Casting == false
until .........
I'm not sure what to check on the last "until". What changes when you use the item? Does the quest become complete or do you only satisfy 1 requirement? Does the item disappear or change? Does the mob change.

If you have problems with other players killing your mob on the way to the npc or just loosing the mob then some extra code will probably be needed.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 5 guests