Misc (or not very misc) BaalAssistant improvements

Please, if possible, help me with this task, I need to do it VERY-VERY MUCH.

FIRST QUESTION IS KEEP DISTANCE FROM BAAL.

So. What’s the deal:
Let’s say we do/did BaalRun.
Party killed 5 waves.
Exp-gainer character took exp shrine.
Exp-gainer character came back to Throne / Worldstone Chamber.

I’d wish him to keep distance from Baal.
I have to do it by 2 reasons:

  1. Baal is oftenly teleporting away (in any direction) from his spawning spot (so we can’t just declare fixed coords to get nice result) – so we have to chase him, but not to get too close to him, because obviously he can curse us.
  2. I found part of code (from BaalAssistant.js) that answering for bot’s “behavior” at this part of baalrun (in Worldstone Chamber):

Pay attention to:

I tried to change it to:

But in such way I got problem, that delay doesn’t check Baal for his life/death – so even after killing Baal bot is simply infinitely standing.

I found that there’s at least 3 possible scenarios of interacting with Baal('s death):

  1. We enter chamber when Baal is live.
  2. Baal is getting killed (for example by party) when we are in chamber.
  3. We enter chamber when Baal is dead – this seems “undetectable” by bot.

But that’s half of the problem.
The other part of problem is as I mentioned at begining of message is to keep distance from Baal.
I have some suggestions on it, but I need your help.

I suppose to use dodge for keeping distance from Baal.
I looked for dodge in Attack.js and I didn’t find dodge as function in Attack.js.
But I found some deploy function, that seems answers for / contains dodge.

It’s start looks like so:

I tried to change

to

In BaalAssistant.js

I specified all the properties (maybe in some wrong way) – I set “random” parameters meaning that bot should keep distance from Baal 25 yards, but I got error “reference to undefined property unit.y”:

That’s all info I can give you about this question, because I don’t have better ideas to get expected/same result.

SECOND QUESTION is a lot smaller.

Sometimes (often) bot teleports to (top left) corner of Throne of Destruction at about 2–3 wave of BaalRun (especially it’s annoying if monsters are nasty).

I’d like to remove it.

But i can’t find part of code that is answering for this.
I commented different parts in

I commented these parts with “corner” word because seems that they are answering for main action, but no success.

And little subquestion.
Is it possible to SEE (the best variant will be in real time) / LOG ALL ACTIONS PERFORMED BY BOT?
I found ScriptErrorLog in KolBot’s folder and it’s very useful.
But it works only with errors.
Is there a way to see/log all normal actions performed by bot?
Sometimes it’s really necessary.

Thanks.

Seems that I almost have success, but I still need your help.

I “made” (copied and renamed kill function – so it’s based on kill function) kill2 function in Attack.js.

I included such part of code into it:

I also inserted:

Of course also I inserted some necessary code into config file:

And I replaced

with

In BaalAssistant.js

The problem is that now hammerdin “telestomping” on Baal with this quasi-dodge BaalDistance.
– he keeps on distance from Baal, but when he attack Baal, he teleports to Baal.
So my suggestion is that we have to fix something and I see at least two variants:

  1. “Simple” way is to change:

    // CUSTOM ATTACK // Format: “Monster Name”: [attack skill id, aura skill id]
    Config.CustomAttack = { // Multiple entries are separated by commas
    “Baal”: [-1, 113]
    };

– I tried, but paly becames just standing (I need that pal move with Baal).

  1. Some fix in kill2 in Attack.js

I tried to comment:

	//	result = ClassAttack.doAttack(target, attackCount % 15 === 0);

But I expectedly got errors about attack skill is not specified.