kolton / d2bot-with-kolbot

d2bot game manager by D3STROY3R with kolbot libs by kolton for d2bs
346 stars 333 forks source link

How to change range from Holy bolt? #539

Open Druxlolz opened 6 years ago

Druxlolz commented 6 years ago

Hello.

Baal run wave 2 is immune to hammer, and therefor we change to holy bolt but it keeps a long distance and follower have trouble getting to the mob in time before the bot uses teleport again to a new far away distance.

So im asking is there a way to change range for holy bolt so it stands right up at them and cast holy bolt?

vibeD2 commented 6 years ago

I've been using this program for 3-5 days so dont think im an expert by ANY means but ive gotten a little used to looking at it. ok so i looked around a little and in your common folder you have attack.js now want i want you to do is copy it and name the second attack(original) i believe it wont screw up the bot but you can make sure by making a folder completely separate from kolbot and put it there for safe keeping. But open up that file and go down to lines 295 and 296 they say if (range === undefined) { range = 25; now idk if holy bolt is specified range havent dug that far into it yet, but try halving that and see if it helps you out if it screws up reset it to 25 or delete the file and replace it with the original. let me know how this works.

EDIT: there is also starting at line 1390 an optimal attack position and moving/walking to it. If someone with a bit more knowledge could help with this that would be nice.

DarkHorseDre commented 6 years ago

Do you have telestomp enabled in your char config? Bot should tele and use bots attack to kill (as long as not physical immune) 'config.TeleStomp = true; // Use merc to attack bosses if they're immune to attacks, but not to physical damage'

Druxlolz commented 6 years ago

Hello @DarkHorseDre i don't think paladin has the option to use TeleStomp. Which is abit sad since it would be very useful i think :s

DarkHorseDre commented 6 years ago

Hey, sorry bro i mustve been drunk :)

That said, with a bit of work, I'm sure we could enable telestomp for pala! but, that is probably more work than trying what VibeD2 suggested. Give it a go - I have a similar issue with soso in that she dances around when she should just keep her ass still and let merc attack (if shes not being hit).

Try changing the range so the bot attacks from closer - the issue may be that it still keeps teleporting to maintain the optimum attack position and I dont know how/where to fix that completely (the code isnt commented very well and I dont like to change things randomly :( )

Update: I just searched the paladin.js and it has these lines: case 2: // Try to telestomp if (Config.TeleStomp && Attack.checkResist(unit, "physical") && !!me.getMerc()) { while (Attack.checkMonster(unit)) { if (getDistance(me, unit) > 3) { Pather.moveToUnit(unit); }

Seems to me (no expert tho!) that the paladin script checks for telestomp and uses it if the monster isnt physical immune!

copy the config line from the sorceress script and see if it works! if it does, I'd set it to see if the merc will kill via stomp!

EmKayEye commented 5 years ago

There are multiple bugs in Paladin.js in the attacks config:

Line 64: case 2: // Try to telestomp

That case cannot occur as doCast in Paladin.js does not return(2).

It does in other character configs but does not indicate that the monster is immune.

From Sorceress.js

// No valid skills can be found if (timedSkill < 0 && untimedSkill < 0) { return 2; }

Line 70 in Paladin.js does not make sense either but it doesn't matter since the program will never flow there.

The logic starting on line 144 for holy bolt does not make complete sense for wave 2 of Baal.

Some tips would be that if the character is built properly, only a single point of holy shield is needed and the remaining points after blessed hammer, blessed aim, concentration aura, and vigor can all be dumped into holy bolt. I also do not use redemption aura and use nature's peace ring. For immunes I use holy bolt and concentration aura.

My attack config is as follows:

Config.AttackSkill[0] = -1; // Preattack skill. Config.AttackSkill[1] = 112; // Primary skill to bosses. Config.AttackSkill[2] = 113; // Primary aura to bosses Config.AttackSkill[3] = 112; // Primary skill to others. Config.AttackSkill[4] = 113; // Primary aura to others. Config.AttackSkill[5] = 101; // Secondary skill if monster is immune to primary. Config.AttackSkill[6] = 113; // Secondary aura.

The following solution is not perfect by any means but does dramatically improve speed on wave2.

Note: In Misc.js, holybolt is range 10 and there are potentially more improvements that can be made by tweaking the distance in both get distance condition and the call to getIntoPosition (both occur twice in the original sequence.) The sequence should stomp, fire (this will likely colide with merc), move, fire, and then fire again.

My solution requires two modifications; first add the following line somewhere the character's config:

Config.Wave2Fix = true; //Wrecklessly use HolyBoly on Wave 2 of Baal

Then replace lines 144 through 167 in libs/common/attacks/Paladin.js (not the character config) with the following code below:

    case 101:
        if (Config.Wave2Fix && me.area == 131){
            //wet solution for baal wave 2 & holy bolt
            if (getDistance(me, unit) > 5 || CollMap.checkColl(me, unit, 0x4)) {
                if (!Attack.getIntoPosition(unit, 0, 0x4)) {
                    return 0;
                }
            }

            CollMap.reset();

            if (getDistance(me, unit) > 0 || CollMap.checkColl(me, unit, 0x2004, 2)) {
                if (!Attack.getIntoPosition(unit, 5, 0x2004, true)) {
                    return 0;
                }
            }

            if (!unit.dead) {
                if (aura > -1) {
                    Skill.setSkill(aura, 0);
                }
                Skill.cast(attackSkill, Skill.getHand(attackSkill), unit);
            }

            return 1;

        }
        else
        {
            //normal attack config for holy bolt
            if (getDistance(me, unit) > Skill.getRange(attackSkill) + 3 || CollMap.checkColl(me, unit, 0x4)) {
                if (!Attack.getIntoPosition(unit, Skill.getRange(attackSkill), 0x4)) {
                    return 0;
                }
            }

            CollMap.reset();

            if (getDistance(me, unit) > Skill.getRange(attackSkill) || CollMap.checkColl(me, unit, 0x2004, 2)) {
                if (!Attack.getIntoPosition(unit, Skill.getRange(attackSkill), 0x2004, true)) {
                    return 0;
                }
            }

            if (!unit.dead) {
                if (aura > -1) {
                    Skill.setSkill(aura, 0);
                }

                Skill.cast(attackSkill, Skill.getHand(attackSkill), unit);
            }

        return 1;

        }

For reference: here is the original code:

    case 101:
        if (getDistance(me, unit) > Skill.getRange(attackSkill) + 3 || CollMap.checkColl(me, unit, 0x4)) {
            if (!Attack.getIntoPosition(unit, Skill.getRange(attackSkill), 0x4)) {
                return 0;
            }
        }

        CollMap.reset();

        if (getDistance(me, unit) > Skill.getRange(attackSkill) || CollMap.checkColl(me, unit, 0x2004, 2)) {
            if (!Attack.getIntoPosition(unit, Skill.getRange(attackSkill), 0x2004, true)) {
                return 0;
            }
        }

        if (!unit.dead) {
            if (aura > -1) {
                Skill.setSkill(aura, 0);
            }

            Skill.cast(attackSkill, Skill.getHand(attackSkill), unit);
        }

            return 1;

Edits: bugs/typos.

ghost commented 4 years ago

Had the same Problem with Tornado Druid and found the Solution. The File "Misc". =)

if u open it it starts with the "get range" - function. Find ur skill (245 for Tornado in my case) and change the range as u like (3 seems to be the range for close attacks since blessed hammer(112) has range 3 aswell).

works as i intended =)

Fa-b commented 4 years ago

@DarkHorseDre: I have a similar issue with soso in that she dances around when she should just keep her ass still and let merc attack (if shes not being hit).

That sounds very much like you have Config.Dodge set true but Config.DodgeHPset to 100. Try reducing that to 85-90 in order for your your sorc to stay calm unless shes being hit.

ustal445 commented 4 years ago

I created an account on the forum specifically to help people who had a problem with the 2nd wave on the baal. I was thinking about this topic for 5 hours and to my surprise the solution was more banal than I thought.

Go to ---> bot \ d2bs \ kolbot \ libs \ config \ "your profile name" -> edit it and on line 510 (at least for me) there is the line:

Config.DodgeHP = 100; // Dodge only if HP percent is less than or equal to Config.DodgeHP. 100 = always dodge.

If you change the value from 100 to 60, your character will fight until his life drops below 60%, and then he will dodge. For me, it works great everywhere not only on the baal :) I hope I helped. (I will only add that I do not use the holy bullet as someone recommended only all the time hammer because it cleans skeletons better and killing the inmmunes is a job for a merc)

I apologize for the poor English but I don't use it often.