PDA

View Full Version : Fix for bots not holding taunt if you get too close.


zydriaa
04-05-2010, 06:00 AM
I found a fix for tanking bots not holding aggro when you get too close to the mob, with the fix you can leave smartaggro on and still let your tanks hold aggro if you get too close

here's the code...

In hate_list.cpp

find

if(cur->ent->IsClient()){

around line 283 and replace it with

if(cur->ent->IsClient() || cur->ent->IsBot()){

recompile, turn on smartaggro and your bots will now hold aggro...

I haven't tested it myself but if you want your pets to be able to tank for you like this too, you should be able to replace the line above with

if(cur->ent->IsClient() || cur->ent->IsBot() || cur->ent->IsPet()){

gibroni
04-07-2010, 08:50 PM
that is nice, but i think that over does it. now no matter what you do for damage you cant steal agro. i put this in for my pet, as i am a mage, but no matter what i cant take agro from pet. Seems there has to be a way to actually determine taunt amount? as that seems to have no effect at all. in fact taunt for pets just might be not right, as when i hit pet taunt it keeps saying taunting foe, master. it should say " no longer taunting target" when you hit taunt again.

zydriaa
04-08-2010, 11:12 AM
thats strange... I can still steal taunt from my bots... I still havent tested with pets but bots seem to be working as far as I can tell... I will look into pet classes in a little bit and see if it does the same thing for me

Slaintemaith
06-29-2010, 10:58 AM
Any word on this? We're going through a similar dilemma now on our server, and wonder if there's been a confirmed fix.

Katinka
06-29-2010, 11:45 PM
Any word on this? We're going through a similar dilemma now on our server, and wonder if there's been a confirmed fix.

Its simple, Cong needs to put in a Taunt/no tuant toggle for the bots :)

Brewhaus
12-01-2010, 03:32 PM
Does this need to be put in the code submissions forum to get put in the next release?

Caryatis
12-01-2010, 04:30 PM
I dont think this is an elegant enough solution to be put into the main source. I haven't tested it but it seems to not be the best way to accomplish it.

pfyon
12-01-2010, 07:46 PM
I'm not sure what better a solution there is. As I understand, it's just treating bots and pets the same way clients are for hate. I haven't tested it, though.

Brewhaus
12-01-2010, 11:39 PM
Well, the pet part shouldn't be put into it I don't think. Pretty sure pets didn't keep aggro in live.

steve
12-02-2010, 06:07 PM
Well, the pet part shouldn't be put into it I don't think. Pretty sure pets didn't keep aggro in live.

They didn't and still don't.

bad_captain
04-15-2011, 02:53 PM
I'm playing around with this a little. I started up a monk that I can't really play because mobs attack me instead of my warrior bot.

I replaced the code mentioned first, which is comething like

if(cur->ent->IsClient()) {
}


to

if(!cur->ent->IsPet()) {
}


as I don't believe the IsBot() check will compile for non-bot releases.. I have thought about changing this to

if(!cur->ent->IsPet() && !cur->ent->IsNPC()) {
}

but I wasn't sure of the consequences. This would impact npc attacking other npcs, so that they would attack PCs or Bots rather than continuing to attack the NPC which I believe would be more livelike. One situation that I havn't considered too much is npc or pc charming.. I'd have to think about it, or if anyone has any ideas, I would appreciate it. I would not change this myself without the approval of someone a little more familiar with aggro code, etc.

But, in the little bit of testing I did last night.. I went in to attack, and the mob attacked me back. My bots attacked right after me, but the mob continued to attack me until the warrior had a successful taunt, and then he kept the aggro until the mob was dead. This seems to be the behavior I would expect, and I will continue to test this out so maybe it can make it in. I will at least be running it on my private server.

lerxst2112
04-15-2011, 05:03 PM
You could just #ifdef the bot part, although it makes the code kinda fugly.


if(cur->ent->IsClient()
#ifdef BOTS
|| cur->ent->IsBot()
#endif
)
{
...
}


A prettier alternative is something like this...



bool ShouldAttack = cur->ent->IsClient();
#ifdef BOTS
ShouldAttack = (ShouldAttack || cur->ent->IsBot());
#endif
if(ShouldAttack)
{
...
}