was muss man machen, damit bei diablo das TP an Eingang, oder am Star sofort kommt ohne clearen, damit die Helfer auch da direkt reingehen !?! Habe
Der Barb könnte auch nach dem Bo Script gerne mithelfen, wenn das machbar wäre ?!?
Code:
/**
* @filename Diablo.js
* @author kolton
* @desc clear Chaos Sanctuary and kill Diablo
*/
function Diablo() {
// sort functions
this.entranceSort = function (a, b) {
return getDistance(a.x, a.y, 7790, 5544) - getDistance(b.x, b.y, 7790, 5544);
};
this.starSort = function (a, b) {
return getDistance(a.x, a.y, 7774, 5305) - getDistance(b.x, b.y, 7774, 5305);
};
// general functions
this.getLayout = function (seal, value) {
var sealPreset = getPresetUnit(108, 2, seal);
if (!seal) {
throw new Error("Seal preset not found. Can't continue.");
}
if (sealPreset.roomy * 5 + sealPreset.y === value || sealPreset.roomx * 5 + sealPreset.x === value) {
return 1;
}
return 2;
};
this.initLayout = function () {
this.vizLayout = this.getLayout(396, 5275);
this.seisLayout = this.getLayout(394, 7773);
this.infLayout = this.getLayout(392, 7893);
};
this.openSeal = function (classid) {
var i, seal, warn;
switch (classid) {
case 396:
case 394:
case 392:
warn = true;
break;
default:
warn = false;
break;
}
for (i = 0; i < 5; i += 1) {
Pather.moveToPreset(me.area, 2, classid, classid === 394 ? 5 : 2, classid === 394 ? 5 : 0);
seal = getUnit(2, classid);
if (!seal) {
return false;
}
if (seal.mode) { // for pubbies
if (warn) {
say(Config.Diablo.SealWarning);
}
return true;
}
warn = false;
seal.interact();
delay(classid === 394 ? 1000 : 500);
if (!seal.mode) {
if (classid === 394 && Attack.validSpot(seal.x + 15, seal.y)) { // de seis optimization
Pather.moveTo(seal.x + 15, seal.y);
} else {
Pather.moveTo(seal.x - 5, seal.y - 5);
}
delay(500);
} else {
return true;
}
}
return false;
};
this.getBoss = function (name) {
var i, boss,
glow = getUnit(2, 131);
for (i = 0; i < 16; i += 1) {
boss = getUnit(1, name);
if (boss) {
return Attack.clear(40, 0, name);
}
delay(250);
}
return !!glow;
};
this.vizierSeal = function () {
print("Viz layout " + this.vizLayout);
this.followPath(this.vizLayout === 1 ? this.starToVizA : this.starToVizB, this.starSort);
if (!this.openSeal(395) || !this.openSeal(396)) {
throw new Error("Failed to open Vizier seals.");
}
if (this.vizLayout === 1) {
Pather.moveTo(7691, 5292);
} else {
Pather.moveTo(7695, 5316);
}
if (!this.getBoss(getLocaleString(2851))) {
throw new Error("Failed to kill Vizier");
}
return true;
};
this.seisSeal = function () {
print("Seis layout " + this.seisLayout);
this.followPath(this.seisLayout === 1 ? this.starToSeisA : this.starToSeisB, this.starSort);
if (!this.openSeal(394)) {
throw new Error("Failed to open de Seis seal.");
}
if (this.seisLayout === 1) {
Pather.moveTo(7771, 5196);
} else {
Pather.moveTo(7798, 5186);
}
if (!this.getBoss(getLocaleString(2852))) {
throw new Error("Failed to kill de Seis");
}
return true;
};
this.infectorSeal = function () {
print("Inf layout " + this.infLayout);
this.followPath(this.infLayout === 1 ? this.starToInfA : this.starToInfB, this.starSort);
if (!this.openSeal(392)) {
throw new Error("Failed to open Infector seals.");
}
if (this.infLayout === 1) {
delay(1);
} else {
Pather.moveTo(7928, 5295); // temp
}
if (!this.getBoss(getLocaleString(2853))) {
throw new Error("Failed to kill Infector");
}
if (!this.openSeal(393)) {
throw new Error("Failed to open Infector seals.");
}
return true;
};
this.diabloPrep = function () {
var trapCheck,
tick = getTickCount();
while (getTickCount() - tick < 30000) {
if (getTickCount() - tick >= 8000) {
switch (me.classid) {
case 1: // Sorceress
if ([56, 59, 64].indexOf(Config.AttackSkill[1]) > -1) {
if (me.getState(121)) {
delay(500);
} else {
Skill.cast(Config.AttackSkill[1], 0, 7793, 5293);
}
break;
}
delay(500);
break;
case 3: // Paladin
Skill.setSkill(Config.AttackSkill[2]);
Skill.cast(Config.AttackSkill[1], 1);
break;
case 5: // Druid
if (Config.AttackSkill[1] === 245) {
Skill.cast(Config.AttackSkill[1], 0, 7793, 5293);
break;
}
delay(500);
break;
case 6: // Assassin
if (Config.UseTraps) {
trapCheck = ClassAttack.checkTraps({x: 7793, y: 5293});
if (trapCheck) {
ClassAttack.placeTraps({x: 7793, y: 5293, classid: 243}, trapCheck);
break;
}
}
delay(500);
break;
default:
delay(500);
break;
}
} else {
delay(500);
}
if (getUnit(1, 243)) {
return true;
}
}
throw new Error("Diablo not found");
};
this.followPath = function (path, sortfunc) {
var i,
cleared = [];
for (i = 0; i < path.length; i += 2) {
if (cleared.length) {
this.clearStrays(cleared);
}
Pather.moveTo(path[i], path[i + 1]);
Attack.clear(30, 0, false, sortfunc);
// Push cleared positions so they can be checked for strays
cleared.push([path[i], path[i + 1]]);
}
};
this.clearStrays = function (cleared) {
var i,
unit = getUnit(1);
if (unit) {
do {
if (Attack.checkMonster(unit)) {
for (i = 0; i < cleared.length; i += 1) {
if (getDistance(unit, cleared[i][0], cleared[i][1]) < 30 && Attack.validSpot(unit.x, unit.y)) {
//me.overhead("we got a stray");
Pather.moveToUnit(unit);
Attack.clear(30);
break;
}
}
}
} while (unit.getNext());
}
return true;
};
// path coordinates
this.entranceToStar = [7794, 5517, 7791, 5491, 7768, 5459, 7775, 5424, 7817, 5458, 7777, 5408, 7769, 5379, 7777, 5357, 7809, 5359, 7805, 5330, 7780, 5317, 7774, 5305];
this.starToVizA = [7759, 5295, 7734, 5295, 7716, 5295, 7718, 5276, 7697, 5292, 7678, 5293, 7665, 5276, 7662, 5314];
this.starToVizB = [7759, 5295, 7734, 5295, 7716, 5295, 7701, 5315, 7666, 5313, 7653, 5284];
this.starToSeisA = [7781, 5259, 7805, 5258, 7802, 5237, 7776, 5228, 7775, 5205, 7804, 5193, 7814, 5169, 7788, 5153];
this.starToSeisB = [7781, 5259, 7805, 5258, 7802, 5237, 7776, 5228, 7811, 5218, 7807, 5194, 7779, 5193, 7774, 5160, 7803, 5154];
this.starToInfA = [7809, 5268, 7834, 5306, 7852, 5280, 7852, 5310, 7869, 5294, 7895, 5295, 7919, 5290];
this.starToInfB = [7809, 5268, 7834, 5306, 7852, 5280, 7852, 5310, 7869, 5294, 7895, 5274, 7927, 5275, 7932, 5297, 7923, 5313];
// start
Town.doChores();
Pather.useWaypoint(107);
Precast.doPrecast(true);
if (!Pather.moveTo(7790, 5544)) {
throw new Error("Failed to move to Chaos Sanctuary");
}
this.initLayout();
if (Config.Diablo.Entrance) {
Attack.clear(35, 0, false, this.entranceSort);
Pather.moveTo(7790, 5544);
Pather.makePortal();
say(Config.Diablo.EntranceTP);
Precast.doPrecast(true);
this.followPath(this.entranceToStar, this.entranceSort);
} else {
Pather.moveTo(7774, 5305);
Attack.clear(15, 0, false, this.starSort);
}
Pather.moveTo(7774, 5305);
Pather.makePortal();
say(Config.Diablo.StarTP);
Attack.clear(30, 0, false, this.starSort);
this.vizierSeal();
this.seisSeal();
Precast.doPrecast(true);
this.infectorSeal();
Pather.moveTo(7788, 5292);
this.diabloPrep();
Attack.kill(243); // Diablo
Pickit.pickItems();
return true;
}
Wenn man das Vizier script benutzt, killt die Sorc nur den einen Boss und wartet in der Stadt. Aber die anderen Helfer machen danach nicht weiter, kann mann da auch etwas ändern ? Weil die stehen einfach beim Seis Seal und machen nix mehr !
und er crasht das game einfach ! Gold ist ohne Ende vorhanden ! Gamble ist aus !
wenn ich town check auf false stelle, sind nach kurzer Zeit die Tränke leer und er chickt wegen lowlife !!