kolton / d2bot-with-kolbot

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

Using Dopplezon? #2777

Open croboy opened 4 years ago

croboy commented 4 years ago

Hello

I really want to cast a Decoy when doing Baal runs.

Has anyone been able to do this and can please give me a bit of help?

I can see the skill number is "28 Dopplezon"

But not sure how to cast it

gtoilet commented 4 years ago

try as first attack figure it could be set like paladins HS when it fades it redoes but i dont use zon or play lod

croboy commented 4 years ago

try as first attack figure it could be set like paladins HS when it fades it redoes but i dont use zon or play lod

Hey buddy

I tried it as First Attack, and nothing happened. But even then, it would be casting it quite alot.

I'm just after how I would actually cast this skill?

I've tried the following and still havent even been able to cast it: First attack this.summon(28); this.precastSkill(28); Skill.cast(28, 0);

Can't seem to get it to even work once. If you know how I would get it once, I can add it to my Attack file it work out when/where it cast it, but I cant get it casted at all

Any help would be appreciated

DarkHorseDre commented 4 years ago

I don't play zons but I think you need to cast that at a certain x.y location as you do when you play the game.

Try this, what I use for oak sage (first param (0) is which hand to cast from):

Packet.castSkill(0, me.x, me.y); //cannot be skill.cast

if that doesnt work, you can see in precast.js how Valkyrie is cast as a summon - not sure decoy is the same

croboy commented 4 years ago

I don't play zons but I think you need to cast that at a certain x.y location as you do when you play the game.

Try this, what I use for oak sage (first param (0) is which hand to cast from):

Packet.castSkill(0, me.x, me.y); //cannot be skill.cast

if that doesnt work, you can see in precast.js how Valkyrie is cast as a summon - not sure decoy is the same

Hey buddy, yeah I already tried the way Valkyrie is casted, didn't work.

Where do I put the actual skill number in your code? Or how do I set it to left or right hand?

Assuming 0 =, left and 1 = right

DarkHorseDre commented 4 years ago

damn, I forgot to paste the previous line :)

some casts you can call the skill id when you cast (like in precast.js) and some you set skill and then cast:

Skill.setSkill(28, 0); //0 is right hand, charged skills always right
Packet.castSkill(0, me.x, me.y); //cannot be skill.cast

Mine specified an object to cast from in setskill as 3rd param but iirc you can set as I've shown - lemme know

croboy commented 4 years ago

damn, I forgot to paste the previous line :)

some casts you can call the skill id when you cast (like in precast.js) and some you set skill and then cast:

Skill.setSkill(28, 0); //0 is right hand, charged skills always right
Packet.castSkill(0, me.x, me.y); //cannot be skill.cast

Mine specified an object to cast from in setskill as 3rd param but iirc you can set as I've shown - lemme know

Dude you legend! It works! Now just need to add in into my Baal file to cast in a certain x, y coord.

Do you know an easy way to find map coordinates?

DarkHorseDre commented 4 years ago

np only way i know is to get the x/y of an object: you or a mob

so for you = me.x, me.y

so you could loop a me.overhead in needed area and manually walk to location? cant remember if i did this or something else when i did it

while(me.ingame)
{
    me.overhead("me x/y: "+me.x+", "+me.y);
    delay(1000);
}
DarkHorseDre commented 4 years ago

the problem you may have is that you need to recast the decoy when it dies - so think about the logic and looping you need for it to recast when not there (as in precast.js you check for minions or a state, then recast if not set.. altho you'd need to loop within baal script or from somewhere else)

croboy commented 4 years ago

the problem you may have is that you need to recast the decoy when it dies - so think about the logic and looping you need for it to recast when not there (as in precast.js you check for minions or a state, then recast if not set.. altho you'd need to loop within baal script or from somewhere else)

Yeah, this is what I have so far in my Amazon file, but I think I need to add it somewhere else.

if (!me.getState(63)) { Skill.setSkill(28, 0); Packet.castSkill(0, unit.x, unit.y); }

It casts Decoy onto Andarial (for testing) but I need to make it cast before Diablo spawns and before the Waves spawn, so I will have to set an actual x,y location and hope that !me.getState(63) recognises it is casted?

DarkHorseDre commented 4 years ago

Ha nice! I didnt even know that 63 exsisted! I see in states.txt that should be what you want.. looking at precast.js the druid and assassins summons are checked with getstate, although it uses summon(skillid) instead of castskill so note that. (infact the summon function doesn't accommodate decoy, only valk.. not sure if that is just an omission or there is a reason for it - but continue as you are for now IMO)

The only thing I think you'll need is to ensure that when the decoy is killed (by wave 5 or dia for example) then you need to recast it straight away. If you can't add a loop in baal.js then maybe extend precast.js? (if you're in the areaid of wsk3 or wherever and no decoy getstate then cast at the spawn spot of waves) - I havent looked at baal script yet but remember that it progresses through the waves, so not sure how easy it would be to put a loop in there that checks the state without stopping the baal script.. lemme know if you get stuck

croboy commented 4 years ago

Ha nice! I didnt even know that 63 exsisted! I see in states.txt that should be what you want.. looking at precast.js the druid and assassins summons are checked with getstate, although it uses summon(skillid) instead of castskill so note that. (infact the summon function doesn't accommodate decoy, only valk.. not sure if that is just an omission or there is a reason for it - but continue as you are for now IMO)

The only thing I think you'll need is to ensure that when the decoy is killed (by wave 5 or dia for example) then you need to recast it straight away. If you can't add a loop in baal.js then maybe extend precast.js? (if you're in the areaid of wsk3 or wherever and no decoy getstate then cast at the spawn spot of waves) - I havent looked at baal script yet but remember that it progresses through the waves, so not sure how easy it would be to put a loop in there that checks the state without stopping the baal script.. lemme know if you get stuck

Dude you have been so helpful! I got the X,Y coordinates and can cast Decoy inbetween waves, but the only problem is, it doesnt seem to recognize state 63.

This is my code

// Wave 1 if (me.area == 131) { if (!me.getState(63)) { Skill.setSkill(28, 0); Packet.castSkill(0, 15092, 5020); }

        }

But it keeps casting it over and over until the monsters spawn. Is there another way to check state other than me.getstate?

DarkHorseDre commented 4 years ago

yeah, like my previous post- may be a summon instead (makes sense - decoy isn't an aura or buff like the other skills) - look at precast.js:

        while (me.getMinionCount(minion) < count) {
            rv = true;

            Skill.cast(skillId, 0);
            delay(200);
        }

me.getminioncount needs a minion id - the commandref.htm file provides the list:

Summary: returns the # of minions of this type you currently have
Syntax:
int minionCount = unit.getMinionCount( int minionType );

Here's the ID list taken from PetType table:
pet type        idx
none            0
single        1
valkyrie        2
golem            3
skeleton        4
skeletonmage    5
revive        6
hireable        7
dopplezon        8
invis            9
raven            10
spiritwolf        11
fenris        12
totem            13
vine            14
grizzly        15
shadowwarrior    16
assassintrap    17
pettrap        18
hydra            19

so something like: if(me.getminioncount(8) < 1) {castdashiz};

croboy commented 4 years ago

yeah, like my previous post- may be a summon instead (makes sense - decoy isn't an aura or buff like the other skills) - look at precast.js:

      while (me.getMinionCount(minion) < count) {
          rv = true;

          Skill.cast(skillId, 0);
          delay(200);
      }

me.getminioncount needs a minion id - the commandref.htm file provides the list:

Summary: returns the # of minions of this type you currently have
Syntax:
int minionCount = unit.getMinionCount( int minionType );

Here's the ID list taken from PetType table:
pet type        idx
none            0
single        1
valkyrie        2
golem            3
skeleton        4
skeletonmage    5
revive        6
hireable        7
dopplezon        8
invis            9
raven            10
spiritwolf        11
fenris        12
totem            13
vine            14
grizzly        15
shadowwarrior    16
assassintrap    17
pettrap        18
hydra            19

so something like: if(me.getminioncount(8) < 1) {castdashiz};

Dude, I would never have got this. Thanks so much! I'm out now, but so excited to get home and test this out!

They should add this in kolbot by default so if you have a point in decoy, it gets casted.

Also one last thing. Is there somewhere that tells you what all the character classids are? I know barbarian in 4 because of the precast file. Want to confirm what the Amazon classid number is, I think it's 0 but not sure

DarkHorseDre commented 4 years ago

hey, np, invoice to follow ^^

well I didn't know either - I looked it up ^^

tip: grep all the kolbot files for what you want (e.g. "dopplezone" etc) and you'll find all instances.. commandref.htm and api.htm are out of date but still can help.

I know barbarian in 4 because of the precast file. Want to confirm what the Amazon classid number is, I think it's 0 but not sure

yup that switch statement in precast.js tells you that amazon is 0 - you can see it in the comments!

croboy commented 4 years ago

hey, np, invoice to follow ^^

well I didn't know either - I looked it up ^^

tip: grep all the kolbot files for what you want (e.g. "dopplezone" etc) and you'll find all instances.. commandref.htm and api.htm are out of date but still can help.

I know barbarian in 4 because of the precast file. Want to confirm what the Amazon classid number is, I think it's 0 but not sure

yup that switch statement in precast.js tells you that amazon is 0 - you can see it in the comments!

Noooo buddy, i added this in just now: if(me.area == 131 && me.getminioncount(8) < 1) {

        Skill.setSkill(28, 0);
        Packet.castSkill(0, 15092 + rand(-1, 1), 5020);
    }

and I'm getting this error "me.getminioncount is not a function"

What am i doing wrong?

croboy commented 4 years ago

hey, np, invoice to follow ^^

well I didn't know either - I looked it up ^^

tip: grep all the kolbot files for what you want (e.g. "dopplezone" etc) and you'll find all instances.. commandref.htm and api.htm are out of date but still can help.

I know barbarian in 4 because of the precast file. Want to confirm what the Amazon classid number is, I think it's 0 but not sure

yup that switch statement in precast.js tells you that amazon is 0 - you can see it in the comments!

All good buddy I finally got it :) with some playing around.

I added this to Baal.js

    var decoy
    decoy = me.getMinionCount( 8 );

    if(me.area == 131 && decoy < 1) {

        Skill.setSkill(28, 0);
        Packet.castSkill(0, 15092 + rand(-1, 1), 5020);
        delay(500)
    }
DarkHorseDre commented 4 years ago

sweet!

was it just the capitalisation of getminioncount?