Skip to content

Commit

Permalink
Fix MFHelper wrong area and exclude hostile players as potential leader
Browse files Browse the repository at this point in the history
Fixed MFHelper wrong leader area when receiving command.
Fixed AutoBaal detecting hostile player as a leader.
Fixed Wakka detecting hostile player as leader.
  • Loading branch information
ryancrunchi authored and noah- committed Jan 28, 2019
1 parent 5d4a8d5 commit ee24ca5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion d2bs/kolbot/libs/bots/AutoBaal.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function AutoBaal() {
solofail += 1;
}

if (suspect.area === destination) { // first player in our party found in destination area...
if (suspect.area === destination && !getPlayerFlag(me.gid, suspect.gid, 8)) { // first player not hostile found in destination area...
leader = suspect.name; // ... is our leader
print("ÿc4AutoBaal: ÿc0Autodetected " + leader);
return true;
Expand Down
16 changes: 5 additions & 11 deletions d2bs/kolbot/libs/bots/MFHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

function MFHelper() {
var i, player, playerAct, split, area,
var i, player, playerAct, split,
oldCommand = "",
command = "";

Expand Down Expand Up @@ -183,7 +183,6 @@ MainLoop:
print("ÿc4MFHelperÿc0: Kill");

split = command.split("kill ")[1];
area = player.area;

for (i = 0; i < 5; i += 1) {
if (Pather.usePortal(player.area, player.name)) {
Expand All @@ -193,7 +192,7 @@ MainLoop:
delay(1000);
}

if (me.area === area) {
if (me.area === player.area) {
Precast.doPrecast(false);

try {
Expand All @@ -218,8 +217,6 @@ MainLoop:
} else if (command.indexOf("clearlevel") > -1) {
print("ÿc4MFHelperÿc0: Clear Level");

area = player.area;

for (i = 0; i < 5; i += 1) {
if (Pather.usePortal(player.area, player.name)) {
break;
Expand All @@ -228,7 +225,7 @@ MainLoop:
delay(1000);
}

if (me.area === area) {
if (me.area === player.area) {
Precast.doPrecast(false);
Attack.clearLevel(Config.ClearType);
Precast.doPrecast(true);
Expand All @@ -243,7 +240,6 @@ MainLoop:
print("ÿc4MFHelperÿc0: Clear");

split = command.split("clear ")[1];
area = player.area;

for (i = 0; i < 5; i += 1) {
if (Pather.usePortal(player.area, player.name)) {
Expand All @@ -253,7 +249,7 @@ MainLoop:
delay(1000);
}

if (me.area === area) {
if (me.area === player.area) {
Precast.doPrecast(false);

try {
Expand Down Expand Up @@ -301,8 +297,6 @@ MainLoop:
} else if (command.indexOf("council") > -1) {
print("ÿc4MFHelperÿc0: Kill Council");

area = player.area;

for (i = 0; i < 5; i += 1) {
if (Pather.usePortal(player.area, player.name)) {
break;
Expand All @@ -311,7 +305,7 @@ MainLoop:
delay(1000);
}

if (me.area === area) {
if (me.area === player.area) {
Precast.doPrecast(false);
Attack.clearList(Attack.getMob([345, 346, 347], 0, 40));

Expand Down
2 changes: 1 addition & 1 deletion d2bs/kolbot/libs/bots/Wakka.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function Wakka() {
solofail += 1;
}

if (suspect.area === destination) { // first player in our party found in destination area...
if (suspect.area === destination && !getPlayerFlag(me.gid, suspect.gid, 8)) { // first player not hostile found in destination area...
leader = suspect.name; // ... is our leader

if (suspect.area === 131) {
Expand Down

0 comments on commit ee24ca5

Please sign in to comment.