Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test merc AutoEquip #109

Open
wants to merge 2 commits into
base: jaenster/autoplay
Choose a base branch
from
Open

Test merc AutoEquip #109

wants to merge 2 commits into from

Conversation

jaenster
Copy link
Owner

@jaenster jaenster commented Sep 7, 2020

No description provided.

@jaenster jaenster marked this pull request as draft September 7, 2020 21:05
@jaenster jaenster marked this pull request as ready for review September 7, 2020 21:05
@jaenster jaenster marked this pull request as draft September 7, 2020 21:05
@jaenster jaenster marked this pull request as ready for review September 7, 2020 21:05
@jaenster
Copy link
Owner Author

jaenster commented Sep 7, 2020

@dzik87 / @ryancrunchi

Please review, i got this idea to convert the AutoEquip and make a separated merc and player one.

Do not merge

d2bs/kolbot/libs/modules/AutoEquip.js Show resolved Hide resolved
@@ -363,7 +102,7 @@
if (item.identified) {

// no point in wanting items we cant equip
if (item.getStat(sdk.stats.Levelreq) > me.getStat(sdk.stats.Level) || item.dexreq > me.getStat(sdk.stats.Dexterity) || item.strreq > me.getStat(sdk.stats.Strength)) {
if (item.getStat(sdk.stats.Levelreq) > this.reference.getStat(sdk.stats.Level) || item.dexreq > this.reference.getStat(sdk.stats.Dexterity) || item.strreq > this.reference.getStat(sdk.stats.Strength)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we need to add extra check if item what we want replace doesn't give us bonus str/dex so we end up beign unable to equip new item.

When extra bonus stats from items are super handy i suggest to go with raw stats.


// no quest items
if (['msf','vip'].includes(item.code)) return false;
if (['msf', 'vip'].includes(item.code)) return false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we might also want to add Khalims Will

return false;
}

if (hasDependency(item)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can check do we have dependency item before excluding it ?

@@ -21,7 +24,7 @@ Unit.prototype.equip = function (destLocation = undefined) {
};

// Not an item, or unidentified, or not enough stats
if (this.type !== 4 || !this.getFlag(0x10) || this.getStat(sdk.stats.Levelreq) > me.getStat(sdk.stats.Level) || this.dexreq > me.getStat(sdk.stats.Dexterity) || this.strreq > me.getStat(sdk.stats.Strength)) {
if (this.type !== 4 || !this.getFlag(0x10) || this.getStat(sdk.stats.Levelreq) > onWho.getStat(sdk.stats.Level) || this.dexreq > onWho.getStat(sdk.stats.Dexterity) || this.strreq > onWho.getStat(sdk.stats.Strength)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: check vs raw stats or take into consideration bonuses from item we want to replace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants