-
Notifications
You must be signed in to change notification settings - Fork 17
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
base: jaenster/autoplay
Are you sure you want to change the base?
Test merc AutoEquip #109
Conversation
Please review, i got this idea to convert the AutoEquip and make a separated merc and player one. Do not merge |
@@ -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)) { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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
No description provided.