Use AOE if targeted by multiple mobs

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Mushroomstamp
Posts: 210
Joined: Wed Oct 27, 2010 11:34 am

Use AOE if targeted by multiple mobs

#1 Post by Mushroomstamp » Sun Apr 03, 2011 2:13 am

How can I get the bot to use AOE skills only if I'm targeted by multiple mobs?

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

Re: Use AOE if targeted by multiple mobs

#2 Post by rock5 » Sun Apr 03, 2011 2:31 am

Someone asked something similar recently. I posted a little function that counted the number of mobs that have you targeted. Let me look for it.
http://www.solarstrike.net/phpBB3/viewt ... 759#p19759

As to how you could use it, maybe, in the onPreSkillCast section of your profile, check if you are casting your AOE skill. Is so then count your aggroed targets. If number > n then return true else return false so it can continue attacking with other skills.
  • 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

Auto Pilot
Posts: 24
Joined: Tue Mar 01, 2011 3:23 am

Re: Use AOE if targeted by multiple mobs

#3 Post by Auto Pilot » Sun Apr 03, 2011 6:47 am

Wouldn't it work better to check the mobs that are in AoE range rather than the one targeting you ?

Would just have to replace (in rock5' code linked)

Code: Select all

if pawn.TargetPtr == player.Address then
by

Code: Select all

if 50 > distance(player.X, player.Z, pawn.X, pawn.Z) then
(50 for purgatory fire, change for whatever AoE range is used)

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

Re: Use AOE if targeted by multiple mobs

#4 Post by rock5 » Sun Apr 03, 2011 6:55 am

Good point. I just answered what he asked.
  • 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

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Use AOE if targeted by multiple mobs

#5 Post by lisa » Sun Apr 03, 2011 7:25 am

Auto Pilot wrote:Wouldn't it work better to check the mobs that are in AoE range rather than the one targeting you ?

Would just have to replace (in rock5' code linked)

Code: Select all

if pawn.TargetPtr == player.Address then
by

Code: Select all

if 50 > distance(player.X, player.Z, pawn.X, pawn.Z) then
(50 for purgatory fire, change for whatever AoE range is used)
Trouble with that is it would recognise all mobs not just the ones targeting you, if people are trying to just through areas faster, hence the aoe, then they wouldn't want to stop to aoe in the middle of mobs not agroed on them because it would waste time. An example would be if you use a lvl 50 character to farm FA, you could easily run past a lot of the mobs and they wouldn't even aggro onto you because of the level difference.

Food for thought =)
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Mushroomstamp
Posts: 210
Joined: Wed Oct 27, 2010 11:34 am

Re: Use AOE if targeted by multiple mobs

#6 Post by Mushroomstamp » Sun Apr 03, 2011 12:00 pm

I swear I searched... can't believe I missed that other thread - thanks Rock!

Auto - thanks for the reply but Lisa is right on with what I'm trying to do. =)

Mushroomstamp
Posts: 210
Joined: Wed Oct 27, 2010 11:34 am

Re: Use AOE if targeted by multiple mobs

#7 Post by Mushroomstamp » Fri Apr 08, 2011 8:20 am

I hate to ask but I can't really wrap my mind around the best way to implement this. Best thing I can think of is to change skill priority if multi aggro'd, but that doesn't seem practical. Can someone point me in the right direction?

Code: Select all

function CountAggroTargets()
   local aggrocount = 0

   local objectList = CObjectList();
   objectList:update();
   for i = 0,objectList:size() do
      local obj = objectList:getObject(i);
      if( obj ~= nil ) then
         local pawn = CPawn(obj.Address);

         if pawn.TargetPtr == player.Address then
            aggrocount = aggrocount + 1
         end
      end
   end
   return aggrocount
end

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

Re: Use AOE if targeted by multiple mobs

#8 Post by rock5 » Fri Apr 08, 2011 8:43 am

Like I said, you could use it in the onPreSkillCast section of your profile. It would look something like this.

Code: Select all

<onPreSkillCast>
if arg1.Name == "your aoe skill" then 
    if CountAggroTargets() < 5 then -- Change '5' to how many you want
        return false
    end
end
return true
</onPreSkillCast>
This will only cast your area of effect if more than 4 mobs have you targeted. There is no provision for changing the sequence of skills. If you want to cast the aoe skill as soon as possible, you could cast the aoe after checking CountAggroTargets(). eg.

Code: Select all

if arg1.Name ~= "your aoe skill" and CountAggroTargets() > 5 then -- Change '5' to how many you want
    player:cast("your aoe skill")
end
  • 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

Mushroomstamp
Posts: 210
Joined: Wed Oct 27, 2010 11:34 am

Re: Use AOE if targeted by multiple mobs

#9 Post by Mushroomstamp » Fri Apr 08, 2011 11:08 pm

I'm such a dousche... it was right there in your first reply. New baby = sleep deprivation = fail! >=(

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest