Help with Bonesaw and Smith script - nZoner - 03-24-2010
Hey guys, I'm writing a Bonesaw and a Smith script for YAMB 0.9.5.7 d2jsp 0.50.24 (LoD 1.10). Now, I'm quite a noob at this, but I got hold of some of the YAMB scripts and attempted to edit them to suit Smith and Bonesaw. I seem to get some errors, though...
Now with the Smith script: Char goes to Outer cloister wp, correctly travels to the Barracks. But I seem to have problems with finding Smith location, pathing to him and arriving there.
If I use:
Code: commPather.InitType = 0;
commPather.TeleFH = mlFHMANHATTAN;
commPather.GotoDest(Malus.roomx * 5, Malus.roomy * 5);
I get this error: "Error : Smith Exception : name = ArgumentException, message = Pather.FindPath -> Either the start or end coord's are not walkable or out of range"
If I use simply:
Code: commPather.InitType = 1;
DM_MoveTo(Malus.roomx, Malus.roomy);
the char just gets stuck trying to teleport into a wall.
Anyone has ideas what I should write? :D
Below is the complete script:
Code: entryFunc = SmithXP;
function EXP_GoToSmith() {
// Take Outer Cloister WP
DM_UsePortal("Waypoint",0x1b);
XP_Precasts()
commPather.InitType = 1;
commPather.GotoLevel(28,false,false);
DC_DoDel(DC_LagDelay);
var Malus = getPresetUnits(me.area, 2, 108, null)[0]; //<< now this is the tricky part ^_^
//<<
commPather.InitType = 0; //<<
commPather.TeleFH = mlFHMANHATTAN; //<<
commPather.GotoDest(Malus.roomx * 5, Malus.roomy * 5); //<<
delay(500); //<<
for (var i = 0; i < 3; i+=1) {
var target = DC_FindMonster(402,5);
if (target) { break; }
}
if (target) {
if (DA_CheckImmunities(target)) {
DL_AddChicken();
return false;
}
DC_DoDel(20);
me.overhead("Killing Smith...");
XP_BossAttack(target);
me.overhead("Smith !");
DM_MoveTo(target.x,target.y);
DSN_PickItems(YAM_SafeCheck);
delay(1000);
target=false;
} else {
print("Smith not found!! Skip to next boss...");
return false;
}
return true;
}
function SmithXP() {
print("яc4SmithScript");
// Configure Smith specific variables. Those are set in config file, don't change anything here!
if (me.classid == 1) {
if (EXP_SorcSkill.length > 0) { XP_SetSorcSkills(EXP_SorcSkill,Monster_SorcSkill); } else { XP_SetSorcSkills(YAM_SorcSkill,Monster_SorcSkill); }
XP_Static = EXP_Static;
}
XP_SwitchHP = EXP_SwitchHP;
XP_StallHP = EXP_StallHP;
if (me.classid == 3) { XP_KillMinions = false; }
XP_MinionStand = true;
XP_QuitImmune = EXP_QuitImmune;
_XP_UseTeleOnImmune = false;
// Make sure we have teleport
if (!DM_CheckTeleport()) { DC_ThrowException("SmithXP()","You must have a char with teleport to use this script !!"); }
// Do town stuff in the act we are in
YAM_TownManager();
YAM_PathToWayPoint();
// Do precasts after going into the portal
XP_Precasts();
// Go Kill Smith
if (EXP_GoToSmith()) {
DL_AddKill();
DSN_PickItems(YAM_SafeCheck);
}
}
As to the Bonesaw script: I just can't seem to find the object ID of the columns around Bonesaw ... any ideas ?
To those of you wondering why I would try to make such scripts: on the server I play on, The Smith and Bonesaw Breaker are replaced with Uber Diablo every game, so it's quite profitable. :)
P.S. Credits for the scripts go to the writers of YAMB! I merely edit they work.
|