Page 1 of 1

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

Posted: Wed Jul 18, 2012 6:21 am
by CNKTHoward
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...

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

Posted: Thu Jul 19, 2012 9:44 pm
by lisa
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.

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

Posted: Mon Jul 23, 2012 1:07 am
by wilifox
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.