Not attacking mobs due to: "check if aggro before attacking"

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
CNKTHoward
Posts: 32
Joined: Thu Jul 12, 2012 8:31 am

Not attacking mobs due to: "check if aggro before attacking"

#1 Post by CNKTHoward » Wed Jul 18, 2012 6:21 am

Hi

As the topic subject says, there is a problem with a character not attacking a mob (that is f.e. spawning next to us and attacking us).
If the mob spawns, we get immediate aggro, the mob runs to us and is attacking us. The following code (in the player.lua) PREVENTS us from killing the mob before it is hitting us.

Code: Select all

		-- check if aggro before attacking
		if( self.Battling == true  and				-- we have aggro
		    target.HP/target.MaxHP*100 > 90 and		-- target is alive and no attacking us
	-- Fix: there is a special dog mob 'Tatus', he switch from red to green at about 90%
	-- there seems to be a bug, so that sometimes Tatus don't have us into the target but still attacking us
	-- to prevent from skipping him while he is still attacking us, we do that special fix
			target.Name ~= "Tatus"	and
		    target.TargetPtr ~= self.Address and
			target.TargetPtr ~= self.Pet.Address and
			CPawn(target.TargetPtr).InParty ~= true ) then	-- but not from that mob
			cprintf(cli.green, language[36], target.Name);
			self:clearTarget();
			break_fight = true;
			break;
		end;
Is there a workaround for that problem? I want my character to actually fight back when it gets attacked...

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

Re: Not attacking mobs due to: "check if aggro before attack

#2 Post by lisa » Thu Jul 19, 2012 9:44 pm

CNKTHoward wrote:
target.TargetPtr ~= self.Address and
target.TargetPtr ~= self.Pet.Address and
CPawn(target.TargetPtr).InParty ~= true
This part checks if the mob is attacking something other than you, party member or pet, so if this is the part of the code stopping the bot from attacking it means the target is attacking something else.
CNKTHoward wrote:the mob runs to us and is attacking us.
You said the mob is attacking you though so that can't be the part of code stopping bot attacking mob.

So I don't know what to say, might need more info on what is happening.
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

wilifox
Posts: 86
Joined: Tue Jul 26, 2011 6:00 pm

Re: Not attacking mobs due to: "check if aggro before attack

#3 Post by wilifox » Mon Jul 23, 2012 1:07 am

As I can kill a mob that already has the aggro other mobs? Thank you very much, I think it has to do what you are writing but do not quite understand. Thank you.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest