|
You last visited: Today at 23:57
Advertisement
[Release] Muddy's D2NT
Discussion on [Release] Muddy's D2NT within the Diablo 2 Programming forum part of the Diablo 2 category.
05/09/2011, 22:10
|
#1816
|
elite*gold: 0
Join Date: Dec 2009
Posts: 23
Received Thanks: 0
|
Kann man eig. abstellen das der Bot beim Kampf (z.b. vs Seis --> Merc wird angegriffen und bekommt erstmal pots und stadtdessen das der Bot auch angreifen soll, sammelt er gemütlich erstmal pots auf und der merc wird die ganze zeit angegriffen)??
|
|
|
05/09/2011, 23:03
|
#1817
|
elite*gold: 0
Join Date: Oct 2010
Posts: 211
Received Thanks: 44
|
Quote:
Originally Posted by Knurrhuhn
joo, das pit-skript scheint dahingehend sehr anfällig zu sein. ich habs mittlerweile rausgenommen. hatte sowohl mit ner light-sorc als auch mit ner fo/fb-sorc ~50% restarts.
ohne pit unter 5%
|
Das kann ich aber entkräften, am PitScript ist alles wunderbar
jeder der 4 Chars macht Pit
|
|
|
05/09/2011, 23:13
|
#1818
|
elite*gold: 0
Join Date: Mar 2009
Posts: 382
Received Thanks: 45
|
ich hab bei meiner sorc es über memory (also keinen gesetzten punkt) ... nun wollte ich eigentlich das der bot es beim precast mit einbezieht und castet, ... macht er aber nicht
jmd ne idee wo man das einstellen kann ?
|
|
|
05/09/2011, 23:51
|
#1819
|
elite*gold: 0
Join Date: Oct 2010
Posts: 211
Received Thanks: 44
|
Müsste wohl das hier sein
Code:
// Set this to true if you would like to switch slots right after casting BC, BO and Shout. If set to false, your char will remain with the BO Slot until the whole precast procedure is done.
MWConfig_SwitchSlotsAfterBoPrecast = true;
in der Charconfig unter deinen "Was soll ich 'PreCasten'" Einstellungen
|
|
|
05/10/2011, 00:36
|
#1820
|
elite*gold: 0
Join Date: Aug 2004
Posts: 233
Received Thanks: 39
|
kann mir jemand mal attak einstellungen für ne light soso posten?
Meine combat einstellungen sind:
Hab relativ viele chickens und wollt mal schauen obs vll daran liegt.
Code:
//------------------------------------------------------------------------------
// Attack Configuration
//------------------------------------------------------------------------------
// Specify your attack skills below. NOTE: Constants for all skill ids can be found in "scripts\libs\common\MWSkills.ntl".
NTConfig_AttackSkill[0] = MWS_THUNDER_STORM; // This skill is used once whenever attacking a new target. Set to 0 to deactivate.
NTConfig_AttackSkill[1] = MWS_LIGHTNING // Primary skill to bosses.
NTConfig_AttackSkill[2] = 0; // Primary untimed skill to boss. Set to 0 to deactivate.
NTConfig_AttackSkill[3] = MWS_CHAIN_LIGHTNING; // Primary skill to others.
NTConfig_AttackSkill[4] = 0; // Primary untimed skill to others. Set to 0 to deactivate.
NTConfig_AttackSkill[5] = MWS_CHAIN_LIGHTNING; // Secondary skill in case monster is immune to primary skill. Set to 0 to deactivate.
NTConfig_AttackSkill[6] = 0; // Secondary untimed skill. Set to 0 to deactivate.
NTConfig_AttackSkill[7] = 0; // Alternative untimed skill which is used if the target is immune to your untimed skill - mostly useful for FB/FO/Meteor sorcs or other sorcs that are using the same untimed skills. Set to 0 to deactivate.
// Set to true if you want to clear area after killing boss. NOTE: This only affects a few botscripts.
NTConfig_ClearPosition = true;
// Set to true to clear area when killing a boss and the position is crowded by monsters. NOTE: Setting this to true may cause NTA_KillMonster() to fail way more often.
MWConfig_ClearBossPosition = false;
// This is the number of attacks to be performed before the the character tries to move to another position. Set to 0 not to reposition.
MWConfig_AttacksBeforeRepositioning = 5;
// Define a time limit for your attacks for each type of monster.
MWConfig_AttackTimeLimit[0] = 20; // Maximum time in seconds to attack a normal monster
MWConfig_AttackTimeLimit[1] = 120; // Maximum time in seconds to attack a super unique monster
MWConfig_AttackTimeLimit[2] = 30; // Maximum time in seconds to attack a champion
MWConfig_AttackTimeLimit[3] = 120; // Maximum time in seconds to attack a bosse
MWConfig_AttackTimeLimit[4] = 30; // Maximum time in seconds to attack a minion
// Define when a monster is considered immune by entering the index of one or more of your attack skills. As an example: [1, 3] means that a monster is considered immune if it is immune to both NTConfig_AttackSkill[1] and NTConfig_AttackSkill[3], whatever those may be.
MWConfig_CheckImmunitySkills = [0, 1];
// Select the behaviour of your character when encountering a monsters that is considered immune referring to the definition above.
// 0: Don't do anything. (D2NT default)
// 1: Get close to the monster, use static field if the monster is not immune to lightning.
// 2: Skip the monster.
// 3: Attack the monster using NTConfig_AttackSkill[8] and NTConfig_AttackSkill[9]
NTConfig_BehaviourOnImmuneMonster = 3;
NTConfig_AttackSkill[8] = MWS_CHAIN_LIGHTNING; // Skill to be used against user defined immunes.
NTConfig_AttackSkill[9] = MWS_CHAIN_LIGHTNING; // Untimed Skill to be used against user defined immunes.
// Always check if monsters are closing in and back off, in case they get too close. NOTE: You should at least have 105FCR in order to make this work smoothly.
MWConfig_KeepDistanceToMonsters = true;
// If you don't wish to evade monsters in a certain area, add it's areaid as an exception below. NOTE: All areaids can be found in "sdk\areas.txt".
// MWConfig_EvasionExceptions.push(<areaid1>, <areaid2>, <areaidn>);
// Check self safe in field (NOT in town). Set to 0 if you won't.
// 0x01 : Potion
// 0x02 : Poison
// 0x04 : Amplify Damage
// 0x08 : Weaken
// 0x10 : Iron Maiden
// 0x20 : Decrepify
// 0x40 : Lower Resist
NTConfig_CheckSelfSafe = 0;
//NTConfig_CheckSelfSafe = 0x04|0x40;
// Check merc's safe in field (NOT in town). Set to 0 if you won't.
// 0x01 : Death
// 0x02 : Poison
// 0x04 : Amplify Damage
// 0x08 : Weaken
// 0x10 : Iron Maiden
// 0x20 : Decrepify
// 0x40 : Lower Resist
NTConfig_CheckMercSafe = 0x01;
//NTConfig_CheckMercSafe = 0x01|0x04|0x10|0x40;
// Cast Static Field until monster's HP lower below this percentage. Set to 100 not to use static field.
NTConfig_CastStatic = 60;
// Select the monsters you with to attack using static field. NOTE: If you do not add any monsters, static will be used against all monsters.
MWConfig_StaticTargets.push(156); // Andariel
MWConfig_StaticTargets.push(211); // Duriel
MWConfig_StaticTargets.push(242); // Mephisto
MWConfig_StaticTargets.push(243); // Diablo
MWConfig_StaticTargets.push(544); // Baal
MWConfig_StaticTargets.push(GetLocaleString(22500)); // Eldritch The Rectifier
MWConfig_StaticTargets.push(GetLocaleString(22435)); // Shenk The Overseer
|
|
|
05/10/2011, 01:05
|
#1821
|
Administrator
elite*gold: 41364
Join Date: Jan 2010
Posts: 22,727
Received Thanks: 12,652
|
Quote:
Originally Posted by -Nemesis1337-
@Muddy:
Also die Erweiterung mit Print(Selling) klappt super 
Wills nurnoch für alle lesbar schreiben, damit die leecher wissen wanns nen Unique im Shop zu kaufen gibt.
Code:
if(item.quality == 7)
Print("Selling " + NTC_ItemQualityToD2Color[MWC_GetItemColorInt(item)] + item.name.split("\n")[0]);
Say("Selling " + NTC_ItemQualityToD2Color[MWC_GetItemColorInt(item)] + item.name.split("\n")[0]);
Klappt net, weils wahrscheinlich net möglich is in Farben puplic zu schreiben, wie muss ich des abändern damits geht?
Achja wo stehen eig. die Itemcodes? 7= Unique? Was is dann Set usw.?
|
Im Zweifel immer zuerst in die ItemAlias library schauen:
Code:
var _NTIPAliasQuality = new Array();
_NTIPAliasQuality["lowquality"]=1;
_NTIPAliasQuality["normal"]=2;
_NTIPAliasQuality["superior"]=3;
_NTIPAliasQuality["magic"]=4;
_NTIPAliasQuality["set"]=5;
_NTIPAliasQuality["rare"]=6;
_NTIPAliasQuality["unique"]=7;
_NTIPAliasQuality["crafted"]=8;
Zu deinem Code: das geht so nicht, die geschweiften Klammern bei einer if-Anweisung dürfen nur weggelassen werden, wenn nur eine einzige Anweisung folgt, ansonsten müssen Klammern gesetzt werden.
Die Ausgabe sollte ausserdem funktionieren, wenn du die Farben rausnimmst:
Code:
if(item.quality == 7)
{
Print("Selling " + NTC_ItemQualityToD2Color[MWC_GetItemColorInt(item)] + item.name.split("\n")[0]);
Say("Selling " + item.name.split("\n")[0]);
}
Quote:
Originally Posted by Energie[Russ]
Kann man eig. abstellen das der Bot beim Kampf (z.b. vs Seis --> Merc wird angegriffen und bekommt erstmal pots und stadtdessen das der Bot auch angreifen soll, sammelt er gemütlich erstmal pots auf und der merc wird die ganze zeit angegriffen)??
|
Ich habe den Satz jetzt 3 mal gelesen und verstehe die Aussage trotzdem nicht. Wenn es geht, bitte etwas aufgeräumter.
Quote:
Originally Posted by GruenerApfel
ich hab bei meiner sorc es über memory (also keinen gesetzten punkt) ... nun wollte ich eigentlich das der bot es beim precast mit einbezieht und castet, ... macht er aber nicht
jmd ne idee wo man das einstellen kann ?
|
Code:
//------------------------------------------------------------------------------
// Precast Configuration
//------------------------------------------------------------------------------
// Your precast skills can be defined in the array below. NOTE: Battle Command, Battle Orders and Shout will be cast automatically. Constants for all skill ids can be found in "scripts\libs\common\MWSkills.ntl".
MWConfig_PrecastSkills = [MWS_SHIVER_ARMOR, MWS_ENCHANT, MWS_ENERGY_SHIELD];
// Set this to true if you would like to switch slots right after casting BC, BO and Shout. If set to false, your char will remain with the BO Slot until the whole precast procedure is done.
MWConfig_SwitchSlotsAfterBoPrecast = false;
Sollte so an sich funktionieren.
LG
Muddy
|
|
|
05/10/2011, 01:43
|
#1822
|
elite*gold: 0
Join Date: Mar 2010
Posts: 87
Received Thanks: 1
|
Ich frag nochmal, kann man bei Nihla einstellen dass er ihn skippt wenn er light immun is? hab das gefunden -- >
|
|
|
05/10/2011, 09:51
|
#1823
|
Administrator
elite*gold: 41364
Join Date: Jan 2010
Posts: 22,727
Received Thanks: 12,652
|
Quote:
Originally Posted by 19Miami
Ich frag nochmal, kann man bei Nihla einstellen dass er ihn skippt wenn er light immun is? hab das gefunden -- > 
|
Finde ich etwas unsauber, versuch es mal so:
Code:
/**
* This file was modified by
* Check the programming section for updates and further scripts
* Last Update: 09:50 10.05.2011
*/
var _NTNihlathak_Locations = new Array(8, 4);
_NTNihlathak_Locations[0] = [12519, 5203, 12522, 5227]; // Top Left
_NTNihlathak_Locations[1] = [12704, 5019, 12692, 5022]; // Top Right
_NTNihlathak_Locations[2] = [12705, 5391, 12723, 5413]; // Bottom Right
_NTNihlathak_Locations[3] = [12889, 5206, 12898, 5228]; // Bottom Left
_NTNihlathak_Locations[4] = [12519, 5203, 12522, 5196]; // Top Left
_NTNihlathak_Locations[5] = [12704, 5019, 12692, 5413]; // Top Right
_NTNihlathak_Locations[6] = [12705, 5391, 12727, 5022]; // Bottom Right
_NTNihlathak_Locations[7] = [12889, 5206, 12898, 5192]; // Bottom Left
const _NTN_DAMAGE_TYPE = NTA_DAMAGE_LIGHTNING;
const _NTN_MAX_RESISTANCE = 99;
function NTMain()
{
Include("libs/common/NTCommon.ntl");
NTC_IncludeLibs();
NTC_IncludeConfig("NTBot/char_configs");
NT_LoadConfig();
NTSI_LoadNIPFiles("NTBot/item_configs");
MWC_Initialize();
var _location, _nihla;
if(!NTTM_CheckAct(me.act, true))
{
NTC_SendMsgToScript("MWBotGame.ntj", NTTM_CheckAct, 31, me.act, true);
return;
}
NTTMGR_TownManager();
if(!NTTM_TownMove("waypoint"))
{
NTC_SendMsgToScript("MWBotGame.ntj", NTTM_TownMove, 39, "waypoint");
return;
}
if(!NTM_TakeWaypoint(123))
{
NTC_SendMsgToScript("MWBotGame.ntj", NTM_TakeWaypoint, 45, 123);
return;
}
NTP_DoPrecast(true);
if(!NTM_MoveToStair(me.areaid, 124))
{
NTC_SendMsgToScript("MWBotGame.ntj", NTM_MoveToStair, 53, me.areaid, 124);
return;
}
if(!NTM_TakeStair(124))
{
NTC_SendMsgToScript("MWBotGame.ntj", NTM_TakeStair, 59, 124);
return;
}
if(!MWConfig_SkipOnTombVipers || !NTC_FindUnit(NTC_UNIT_MONSTER, 597))
{
_location = NT_FindNihlathakInt();
if(_location == -1)
{
NTC_SendMsgToScript("MWBotGame.ntj", NT_FindNihlathakInt, 67);
return;
}
if(!NTM_MoveTo(me.areaid, _NTNihlathak_Locations[_location][2], _NTNihlathak_Locations[_location][3]))
{
NTC_SendMsgToScript("MWBotGame.ntj", NTM_MoveTo, 75, me.areaid, _NTNihlathak_Locations[_location][2], _NTNihlathak_Locations[_location][3]);
return;
}
if(!NTTMGR_CheckSafe(NTConfig_CheckSelfSafe, NTConfig_CheckMercSafe))
{
NTC_SendMsgToScript("MWBotGame.ntj", NTTMGR_CheckSafe, 81, NTConfig_CheckSelfSafe, NTConfig_CheckMercSafe);
return;
}
_nihla = NTC_FindUnit(NTC_UNIT_MONSTER, 526, 3);
if(_nihla && NTA_GetResistance(_nihla, _NTN_DAMAGE_TYPE) <= _NTN_MAX_RESISTANCE)
{
Print("˙c1Skipping Nihlatak due to immunity...");
_nihla = null;
}
if(_nihla && NTA_KillMonster(526))
{
if(NTConfig_ClearPosition)
NTA_ClearPosition();
NTSI_PickItems();
}
else if(!NTConfig_PindleskinExtension)
{
NTC_SendMsgToScript("MWBotGame.ntj", NTA_KillMonster, 94, 526);
return;
}
}
else
Print("˙c1Tomb Vipers detected - Skipping Nihlatak...");
if(NTConfig_PindleskinExtension)
{
for(var i = 0; i < 2; i++)
{
if(!NTM_MoveToStair(me.areaid, 123 - i))
{
NTC_SendMsgToScript("MWBotGame.ntj", NTM_MoveToStair, 107, me.areaid, 123 - i);
return;
}
if(!NTM_TakeStair(123 - i))
{
NTC_SendMsgToScript("MWBotGame.ntj", NTM_TakeStair, 113, 123 - i);
return;
}
}
if(!NTM_MoveToStair(me.areaid, 121))
{
NTC_SendMsgToScript("MWBotGame.ntj", NTM_MoveToStair, 120, me.areaid, 121);
return;
}
if(!NTTMGR_CheckSafe(NTConfig_CheckSelfSafe, NTConfig_CheckMercSafe))
{
NTC_SendMsgToScript("MWBotGame.ntj", NTTMGR_CheckSafe, 126, NTConfig_CheckSelfSafe, NTConfig_CheckMercSafe);
return;
}
NTP_DoPrecast(false);
if(!NTM_TakeStair(121))
{
NTC_SendMsgToScript("MWBotGame.ntj", NTM_TakeStair, 134, 121);
return;
}
if(!NTM_MoveTo(me.areaid, 10061, 13234))
{
NTC_SendMsgToScript("MWBotGame.ntj", NTM_MoveTo, 140, me.areaid, 10061, 13234);
return;
}
if(!NTA_KillMonster(GetLocaleString(22497)))
{
NTC_SendMsgToScript("MWBotGame.ntj", NTA_KillMonster, 146, GetLocaleString(22497));
return;
}
if(NTConfig_ClearPosition)
NTA_ClearPosition();
NTSI_PickItems();
MWL_FindItem();
}
NTC_SendMsgToScript("MWBotGame.ntj", "SCRIPT_END");
}
// Internal function
function NT_FindNihlathakInt()
{
var i, x, y;
var _nihlathak;
var _mindist = 999999;
var _currdist;
var _location = -1;
_nihlathak = GetPresetUnits(me.areaid, NTC_UNIT_OBJECT, 462);
if(!_nihlathak || _nihlathak.length < 1)
return _location;
x = _nihlathak[0].roomx*5 + _nihlathak[0].x;
y = _nihlathak[0].roomy*5 + _nihlathak[0].y;
for(i = 0 ; i < 8 ; i++)
{
_currdist = GetDistance(_NTNihlathak_Locations[i][0], _NTNihlathak_Locations[i][1], x, y);
if(_currdist < _mindist)
{
_mindist = _currdist;
_location = i;
}
}
return _location;
}
LG
Muddy
|
|
|
05/10/2011, 10:48
|
#1824
|
elite*gold: 0
Join Date: Mar 2009
Posts: 382
Received Thanks: 45
|
Quote:
Originally Posted by Muddy_Waters
Code:
//------------------------------------------------------------------------------
// Precast Configuration
//------------------------------------------------------------------------------
// Your precast skills can be defined in the array below. NOTE: Battle Command, Battle Orders and Shout will be cast automatically. Constants for all skill ids can be found in "scripts\libs\common\MWSkills.ntl".
MWConfig_PrecastSkills = [MWS_SHIVER_ARMOR, MWS_ENCHANT, MWS_ENERGY_SHIELD];
// Set this to true if you would like to switch slots right after casting BC, BO and Shout. If set to false, your char will remain with the BO Slot until the whole precast procedure is done.
MWConfig_SwitchSlotsAfterBoPrecast = false;
Sollte so an sich funktionieren.
LG
Muddy
|
hatte ich gehabt bzw hab ich immernoch, aber sie castet weder ench noch es ... liegt es vielleicht daran das ich n memory im cta slot habe und weder es noch ench geskillt is ?
|
|
|
05/10/2011, 10:58
|
#1825
|
Administrator
elite*gold: 41364
Join Date: Jan 2010
Posts: 22,727
Received Thanks: 12,652
|
Quote:
Originally Posted by GruenerApfel
hatte ich gehabt bzw hab ich immernoch, aber sie castet weder ench noch es ... liegt es vielleicht daran das ich n memory im cta slot habe und weder es noch ench geskillt is ?
|
Ja, liegt es. Da ich gerade keine Lust habe das ordentlich umzusetzen, hier mal die schnelle Variante; ändere einfach den case NTC_CHAR_CLASS_SORCERESS innerhalb der NTP_DoPrecast() Funktion wie folgt:
Code:
case NTC_CHAR_CLASS_SORCERESS:
if(refresh)
NTC_SwapWeapons();
// Thunder Storm
if(MWConfig_PrecastSkills.indexOf(MWS_THUNDER_STORM) > -1 && (refresh || !me.GetState(38)))
NTC_CastSkill(MWS_THUNDER_STORM, NTC_HAND_RIGHT);
// Energy Shield
if(refresh && MWConfig_PrecastSkills.indexOf(MWS_ENERGY_SHIELD) > -1)
NTC_CastSkill(MWS_ENERGY_SHIELD, NTC_HAND_RIGHT);
// Shiver Armor
if(MWConfig_PrecastSkills.indexOf(MWS_SHIVER_ARMOR) > -1 && (refresh || !me.GetState(88)))
NTC_CastSkill(MWS_SHIVER_ARMOR, NTC_HAND_RIGHT);
// Chilling Armor
else if(MWConfig_PrecastSkills.indexOf(MWS_CHILLING_ARMOR) > -1 && (refresh || !me.GetState(20)))
NTC_CastSkill(MWS_CHILLING_ARMOR, NTC_HAND_RIGHT);
// Frozen Armor
else if(MWConfig_PrecastSkills.indexOf(MWS_FROZEN_ARMOR) > -1 && (refresh || !me.GetState(10)))
NTC_CastSkill(MWS_FROZEN_ARMOR, NTC_HAND_RIGHT);
// Enchant
if(MWConfig_PrecastSkills.indexOf(MWS_ENCHANT) > -1)
{
_merc = NTC_GetMerc();
if(_merc && !_merc.GetState(16))
NTC_CastSkill(MWS_ENCHANT, NTC_HAND_RIGHT, _merc);
if(!me.GetState(16))
NTC_CastSkill(MWS_ENCHANT, NTC_HAND_RIGHT);
}
if(refresh)
NTC_SwapWeapons();
break;
LG
Muddy
|
|
|
05/10/2011, 12:18
|
#1826
|
elite*gold: 0
Join Date: Mar 2009
Posts: 382
Received Thanks: 45
|
und dann is mir noch aufgefallen das er obwohl "ident @ cain" auf true steht das er net immer bei cain die sachen idendifiziert ... und da dann stellenweise items unid sellt, obwohl sie in der pick it stehen (zumeist rares logischerweise) und nicht moneymakeritems sind
ich geh mal davon aus das er, wenns nur ein zwei items sind, zwecks schnelleren runs, net extra zu cain rennt sonder halt eigentlich via ident scroll idendifiziert und da dann irgendwie das ganze net sauber durchführt und nein am lag kanns net liegen da es bei mir auch auftritt wenn nur ein einzelner bot an ist
und beim  hat sich noch nix geändert oder .. also immer beim mulen die alten ungecrafteten items rauswerfen und neue suchen lassen wenn ich den bot neu starte ??
|
|
|
05/10/2011, 12:32
|
#1827
|
Administrator
elite*gold: 41364
Join Date: Jan 2010
Posts: 22,727
Received Thanks: 12,652
|
Kann es sein, dass dein Char keinen Tome bei sich trägt? Wenn ja, liegt das sehr wahrscheinlich daran.
Zum Craften:
Das reicht eventuell, wenn du den überflüssigen Initialisierungsaufruf aus der TownManager library entfernst.
Da ich gerade nicht mehr weiss, wo der genau stand, hier die ganze library:
Code:
/**
* This file was modified by
* Check the programming section for updates and further scripts
* Last Update: 12:26 10.05.2011
*/
var _NTTMGR_BuyPots;
var _NTTMGR_BuyTP;
var _NTTMGR_BuyKey;
var _NTTMGR_DoHeal;
var _NTTMGR_DoID;
var _NTTMGR_DoRepair;
var _NTTMGR_DoRevive;
var _NTTMGR_RemoveCurse;
var _MWTMGR_SellTrash;
var _MWTMGR_VisitMerchantForSelling;
function NTTMGR_TownManager(simple)
{
var _cubing, _trash;
if(arguments.length < 1)
simple = false;
NTC_ClearCursor();
NTT_CleanPotions();
_NTTMGR_BuyPots = NTT_CheckBelt();
_NTTMGR_BuyTP = (NTTMGR_CheckScrolls(1) < 5);
_NTTMGR_BuyKey = (MWConfig_CarryKeys && MWTMGR_GetKeyQuantity() <= 10);
_NTTMGR_DoHeal = NTT_CheckHeal();
_NTTMGR_DoID = NTT_CheckUnids();
_NTTMGR_DoRepair = (NTT_CheckRepair(40) && MWT_CheckRepairCost());
_NTTMGR_DoRevive = NTT_CheckMerc();
_trash = MWT_GetTrashItems();
_MWTMGR_SellTrash = (_trash && _trash.length > 0);
_MWTMGR_VisitMerchantForSelling = (MWConfig_AlwaysSellTrashItems && _MWTMGR_SellTrash && !(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID || _NTTMGR_DoRepair || _NTTMGR_DoRevive && me.act == 3 || _NTTMGR_RemoveCurse || _NTTMGR_DoHeal));
_NTTMGR_RemoveCurse = NTTMGR_CheckCurse(MWConfig_CheckSelfSafeTown, MWConfig_CheckMercSafeTown);
_MWTMGR_VisitCain = (MWConfig_IdentAtCain && !MWT_CarryForcedUnids() && _NTTMGR_DoID);
if(me.classid == NTC_CHAR_CLASS_PALADIN)
NTC_PutSkill(MWS_VIGOR, NTC_HAND_RIGHT);
else if(me.classid == NTC_CHAR_CLASS_ASSASSIN && !me.GetState(157))
NTC_CastSkill(MWS_BURST_OF_SPEED, NTC_HAND_RIGHT);
if(_MWTMGR_VisitCain && ([COLOR="Red"]_NTTMGR_DoID > 1[/COLOR] || me.act == 2))
MWTMGR_VisitCain();
switch(me.act)
{
case 1:
if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID || _MWTMGR_VisitMerchantForSelling)
NTTMGR_VisitAkara();
if(_NTTMGR_DoRevive)
NTTMGR_VisitKashya();
if(_NTTMGR_DoRepair)
NTTMGR_VisitCharsi();
break;
case 2:
if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_DoRepair || _MWTMGR_VisitMerchantForSelling)
NTTMGR_VisitFara();
if(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID)
NTTMGR_VisitDrognan();
if(_NTTMGR_DoRevive)
NTTMGR_VisitGreiz();
break;
case 3:
if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID || _MWTMGR_VisitMerchantForSelling)
NTTMGR_VisitOrmus();
if(_NTTMGR_DoRevive)
NTTMGR_VisitAsheara();
if(_NTTMGR_DoRepair)
NTTMGR_VisitHratli();
break;
case 4:
if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID || _MWTMGR_VisitMerchantForSelling)
NTTMGR_VisitJamella(false);
if(_NTTMGR_DoRevive)
NTTMGR_VisitTyrael();
if(_NTTMGR_DoRepair)
NTTMGR_VisitHalbu();
break;
case 5:
if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID)
NTTMGR_VisitMalah();
if(_NTTMGR_DoRevive)
NTTMGR_VisitQualKehk();
if(_NTTMGR_DoRepair || _MWTMGR_VisitMerchantForSelling)
NTTMGR_VisitLarzuk();
break;
}
_cubing = (!simple && NTCU_CheckCubing());
if(_cubing || NTT_CheckInventory() && NTT_CheckStash() || NTC_MyGoldCarry() > NTConfig_MinGoldToStash)
NTTMGR_VisitStash(_cubing);
if(!simple && NTConfig_Gamble && NTC_MyGold() > NTConfig_GambleStartGold)
{
switch(me.act)
{
case 1:
NTTMGR_VisitGheed();
break;
case 2:
NTTMGR_VisitElzix();
break;
case 3:
NTTMGR_VisitAlkor();
break;
case 4:
NTTMGR_VisitJamella(true);
break;
case 5:
NTTMGR_VisitAnya();
break;
}
_cubing = (!simple && NTCU_CheckCubing());
if(_cubing || NTT_CheckInventory() && NTT_CheckStash())
NTTMGR_VisitStash(_cubing);
}
_trash = MWT_GetTrashItems(false);
if(_trash && _trash.length > 0)
NTT_ClearInventory();
}
function NTTMGR_VisitTown()
{
var _prearea = me.areaid;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Town...");
if(!NTTM_CheckAct())
return false;
NTTMGR_TownManager(true);
if(!NTTM_TownMove("portalspot"))
return false;
if(!NTM_UsePortal("BluePortal", _prearea))
return false;
if(NTConfig_PublicMode)
NTM_MakeTP();
return true;
}
function NTTMGR_VisitStash(cubing)
{
var _stash;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Stash...");
if(!cubing && !NTT_CheckStash() && NTC_StashGoldFull())
return;
_stash = NTC_FindUnit(NTC_UNIT_OBJECT, NTC_UNIT_STASH);
if(!_stash || GetDistance(me, _stash) > 3)
NTTM_TownMove("stash");
if(!_stash)
_stash = NTC_FindUnit(NTC_UNIT_OBJECT, NTC_UNIT_STASH);
if(_stash)
{
if(NTT_DoInteract(_stash))
{
if(!cubing)
NTT_ManageStash();
if(cubing)
{
NTCU_DoCubing();
if(NTT_DoInteract(_stash))
NTT_ManageStash();
me.Cancel(1);
NTT_ClearInventory();
}
else
me.Cancel(1);
}
}
}
function NTTMGR_VisitAkara()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Akara...");
NTTM_TownMove("akara");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_AKARA, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_BuyKey || _NTTMGR_DoID || _MWTMGR_SellTrash)
{
if(NTT_DoTrade(_npc))
{
if(_NTTMGR_DoID)
NTTMGR_IDItems(_npc);
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_BuyPots)
MWT_FillBelt(_npc);
if(_NTTMGR_BuyTP)
NTT_FillTome(_npc, 1);
if(_NTTMGR_BuyKey)
NTT_FillKey(_npc);
}
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitKashya()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Kashya...");
NTTM_TownMove("kashya");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_KASHYA, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoInteract(_npc))
{
NTT_ReviveMerc();
me.Cancel(1);
}
}
}
}
function NTTMGR_VisitCharsi()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Charsi...");
NTTM_TownMove("charsi");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_CHARSI, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
{
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_DoRepair)
NTT_RepairItems(_npc);
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitGheed()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Gheed...");
NTTM_TownMove("gheed");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_GHEED, 5);
if(_npc)
MWTMGR_DoGambling(_npc);
}
function NTTMGR_VisitFara()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Fara...");
NTTM_TownMove("fara");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_FARA, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(_NTTMGR_DoRepair || _MWTMGR_SellTrash)
{
if(NTT_DoTrade(_npc))
{
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_DoRepair)
NTT_RepairItems(_npc);
}
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitDrognan()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Drognan...");
NTTM_TownMove("drognan");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_DROGNAN, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
{
if(_NTTMGR_DoID)
NTTMGR_IDItems(_npc);
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_BuyPots)
MWT_FillBelt(_npc);
if(_NTTMGR_BuyTP)
NTT_FillTome(_npc, 1);
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitLysander()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Lysander...");
NTTM_TownMove("lysander");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_LYSANDER, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
{
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_BuyKey)
NTT_FillKey(_npc);
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitGreiz()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Greiz...");
NTTM_TownMove("greiz");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_GREIZ, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
NTT_ReviveMerc();
me.Cancel(1);
}
}
}
function NTTMGR_VisitElzix()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Elzix...");
NTTM_TownMove("elzix");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ELZIX, 5);
if(_npc)
MWTMGR_DoGambling(_npc);
}
function NTTMGR_VisitOrmus()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Ormus...");
NTTM_TownMove("ormus");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ORMUS, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID || _MWTMGR_SellTrash)
{
if(NTT_DoTrade(_npc))
{
if(_NTTMGR_DoID)
NTTMGR_IDItems(_npc);
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_BuyPots)
MWT_FillBelt(_npc);
if(_NTTMGR_BuyTP)
NTT_FillTome(_npc, 1);
}
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitAsheara()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Asheara...");
NTTM_TownMove("asheara");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ASHEARA, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(_MWTMGR_SellTrash)
{
if(NTT_DoTrade(_npc))
{
MWTMGR_SellTrashItems(_npc);
me.Cancel(1);
}
}
NTT_ReviveMerc();
me.Cancel(1);
}
}
}
function NTTMGR_VisitHratli()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Hratli...");
NTTM_TownMove("hratli");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_HRATLI, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
{
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_DoRepair)
NTT_RepairItems(_npc);
if(_NTTMGR_BuyKey)
NTT_FillKey(_npc);
}
me.Cancel(1);
}
}
else
{
NTTM_TownMove("meshif");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_HRATLI, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
{
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_DoRepair)
NTT_RepairItems(_npc);
if(_NTTMGR_BuyKey)
NTT_FillKey(_npc);
}
me.Cancel(1);
}
}
}
}
function NTTMGR_VisitAlkor()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Alkor...");
NTTM_TownMove("alkor");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ALKOR, 5);
if(_npc)
MWTMGR_DoGambling(_npc);
}
function NTTMGR_VisitJamella(gamble)
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Jamella...");
NTTM_TownMove("jamella");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_JAMELLA, 5);
if(_npc)
{
if(gamble)
MWTMGR_DoGambling(_npc);
else
{
if(NTT_DoInteract(_npc))
{
if(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_BuyKey || _NTTMGR_DoID || _MWTMGR_SellTrash)
{
if(NTT_DoTrade(_npc))
{
if(_NTTMGR_DoID)
NTTMGR_IDItems(_npc);
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_BuyPots)
MWT_FillBelt(_npc);
if(_NTTMGR_BuyTP)
NTT_FillTome(_npc, 1);
if(_NTTMGR_BuyKey)
NTT_FillKey(_npc);
}
}
me.Cancel(1);
}
}
}
}
function NTTMGR_VisitHalbu()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Halbu...");
NTTM_TownMove("halbu");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_HALBU, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
{
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_DoRepair)
NTT_RepairItems(_npc);
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitTyrael()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Tyrael...");
NTTM_TownMove("tyrael");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_TYRAEL_ACT_4, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
NTT_ReviveMerc();
me.Cancel(1);
}
}
}
function NTTMGR_VisitMalah()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Malah...");
NTTM_TownMove("malah");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_MALAH, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_BuyKey || _NTTMGR_DoID || _MWTMGR_SellTrash)
{
if(NTT_DoTrade(_npc))
{
if(_NTTMGR_DoID)
NTTMGR_IDItems(_npc);
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_BuyPots)
MWT_FillBelt(_npc);
if(_NTTMGR_BuyTP)
NTT_FillTome(_npc, 1);
if(_NTTMGR_BuyKey)
NTT_FillKey(_npc);
}
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitLarzuk()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Larzuk...");
NTTM_TownMove("larzuk");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_LARZUK, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
{
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_DoRepair)
NTT_RepairItems(_npc);
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitQualKehk()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Qual-Khek...");
NTTM_TownMove("qual-kehk");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_QUALKEHK, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
NTT_ReviveMerc();
me.Cancel(1);
}
}
}
function NTTMGR_VisitAnya()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Anya...");
NTTM_TownMove("anya");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ANYA_TOWN, 5);
if(_npc)
MWTMGR_DoGambling(_npc);
}
function MWTMGR_VisitCain()
{
var _npc, _unids;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Cain...");
NTTM_TownMove("cain");
switch(me.act)
{
case 1:
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_CAIN_ACT_1);
break;
case 2:
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_CAIN_ACT_2, 5);
break;
case 3:
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_CAIN_ACT_3, 5);
break;
case 4:
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_CAIN_ACT_4, 5);
break;
case 5:
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_CAIN_ACT_5, 5);
break;
}
if(_npc)
{
if(NTT_DoInteract(_npc))
{
_unids = NTT_GetUnidItems();
for(var i = 0; i <= 4; i++)
{
if(i % 2 == 0)
me.SelectNPCMenu(0x0FB4);
NTC_Delay(500);
if(!NTT_CheckUnids())
break;
}
for(var i = 0; i < _unids.length; i++)
{
if(NTSI_CheckItem(_unids[i], true) == 1)
MWI_WriteManagerLog(_unids[i], 0, true);
}
me.Cancel(1);
_NTTMGR_DoID = NTT_CheckUnids();
if(!(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID || _NTTMGR_DoRepair || _NTTMGR_DoRevive && me.act == 3 || _NTTMGR_RemoveCurse || _NTTMGR_DoHeal))
{
if(!MWConfig_AlwaysSellTrashItems)
{
NTT_ClearInventory();
_MWTMGR_VisitMerchantForSelling = false;
}
else
_MWTMGR_VisitMerchantForSelling = true;
}
_MWTMGR_SellTrash = (MWT_GetTrashItems().length > 0);
}
}
}
function NTTMGR_CheckScrolls(scrolltype)
{
var _tome = NTT_GetTome(scrolltype);
if(_tome)
return _tome.GetStat(70);
return 0;
}
function MWTMGR_GetKeyQuantity()
{
var _keys, _count;
if(me.classid == NTC_CHAR_CLASS_ASSASSIN)
return 12;
_keys = MWC_GetItems(MWC_LOC_INVENTORY, 0, 543);
_count = 0;
if(_keys)
{
for(var i = 0; i < _keys.length; i++)
_count += _keys[i].GetStat(70);
}
return _count;
}
function MWTMGR_SellTrashItems(npc)
{
var _items, _retValue;
_items = MWT_GetTrashItems();
_retValue = true;
for(var i = 0; i < _items.length; i++)
{
if(MWConfig_UseXMLItemlog)
MWI_WriteLog(_items[i], 1);
if(MWConfig_LogSoldItems)
MWI_WriteManagerLog(_items[i], 3);
if(!NTT_ShopItem(_items[i], npc, 1))
_retValue = false;
}
return _retValue;
}
function NTTMGR_IDItems(npc)
{
var _tome, _scroll;
var _result, _check;
var _items = NTT_GetUnidItems();
if(!_items || _items.length < 1)
return;
_tome = NTT_GetTome();
if(_tome && _tome.GetStat(70) < _items.length)
NTT_FillTome(npc);
for(var i = 0 ; i < _items.length ; i++)
{
switch(NTSI_CheckItem(_items[i], true))
{
case 1:
MWI_WriteManagerLog(_items[i], 0, true);
case 2:
break;
case 0:
if(_items[i].GetItemCost(1) >= 35E3)
break;
case -1:
if(_tome)
_result = NTT_IdItem(_tome, _items[i]);
else
{
_scroll = NTT_GetScroll();
if(!_scroll)
{
NTT_BuyScrolls(npc);
_scroll = NTT_GetScroll();
}
_result = NTT_IdItem(_scroll, _items[i]);
}
if(!_result)
break;
_check = NTSI_CheckItem(_items[i], true);
if(_check == 1)
MWI_WriteManagerLog(_items[i], 0, true);
else if(_check == 0 || _check == 3)
{
if(MWConfig_UseXMLItemlog)
MWI_WriteLog(_items[i], 1);
if(MWConfig_LogSoldItems)
MWI_WriteManagerLog(_items[i], 3, true);
NTT_ShopItem(_items[i], npc, 1);
}
break;
}
}
}
function MWTMGR_DoGambling(npc)
{
var _logString, _date, _deltaTime, _timeString, _gamblingData, _time;
if(arguments.length < 1 || !npc)
return false;
_gamblingData = new Array();
_gamblingData["itemsgambled"] = 0;
_gamblingData["itemskept"] = 0;
_gamblingData["goldmax"] = NTC_MyGold() - NTConfig_GambleStopGold;
_gamblingData["goldspent"] = 0;
_gamblingData["abort"] = false;
while(NTC_MyGold() > NTConfig_GambleStopGold)
{
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Gambling (" + (_gamblingData["goldspent"] / _gamblingData["goldmax"] * 100.0).toFixed(1) + "%)");
if(NTT_DoInteract(npc))
{
if(NTT_DoTrade(npc, 1))
_gamblingData = NTT_GambleIt(npc, _gamblingData);
me.Cancel(1);
if(_gamblingData["abort"])
break;
}
else
break;
}
_logString = "˙008040Gambling completed!;";
_logString += "˙c0Items Gambled:˙c8 " + _gamblingData["itemsgambled"] + " [" + _gamblingData["itemskept"] + "]";
_logString += "\n˙c0Gold Spent:˙c8 " + MWC_InsertDigitSeperator(_gamblingData["goldspent"]);
_logString += "\n˙c0Total Items Gambled:˙c8 " + MWC_InsertDigitSeperator(MWI_GetGamblingData("total")) + " [" + MWC_InsertDigitSeperator(MWI_GetGamblingData("kept")) + "]";
_logString += "\n˙c0Total Gold Spent:˙c8 " + MWC_InsertDigitSeperator(MWI_GetGamblingData("gold"));
_logString += "\n˙c0Gambling Sessions:˙c8 " + (MWI_GetGamblingData("sessions") + 1);
_date = new Date();
if(_date)
{
_deltaTime = _date.getTime() - MWI_GetGamblingData("lastupdate");
_timeString = "";
_date = new Date(MWI_GetGamblingData("lastupdate"));
if(!isNaN(_deltaTime) && _date)
{
// Days passed
_time = parseInt(_deltaTime / 864E5);
if(_time > 0)
{
_timeString += _time + " Day";
if(_time > 1)
_timeString += "s ";
else
_timeString += " ";
}
_timeString += MWC_ConvertTicksToTimeString(_deltaTime);
_logString += "\n˙c0Last Session:˙c8 " + _date.toLocaleFormat("%a %m/%d/%y %H:%M:%S") + " [-" + _timeString + "]";
}
}
_date = new Date(MWI_GetGamblingData("creation"));
if(_date)
_logString += "\n˙c0Logfile Created:˙c8 " + _date.toLocaleFormat("%a %m/%d/%y %H:%M:%S");
NTC_SendLogToOOG(NTC_LOG_COMMON, _logString);
SetStatusText("˙c8Gambling completed!");
NTC_SendMsgToScript("MWBotGame.ntj", "RESET_TICKS");
NTC_SendMsgToScript("MWBotGame.ntj", "SET_DEFAULT_STATUS");
MWI_WriteGamblingData(0, new Array(0, 0), true, true);
return true;
}
// mask - 0x02 : Poison, 0x04 : Amplify Damage, 0x08 : Weaken, 0x10 : Iron Maiden, 0x20 : Decrepify, 0x40 : Lower Resist
function NTTMGR_CheckCurse(selfmask, mercmask)
{
if(selfmask > 0x01)
{
if((selfmask&0x02) && me.GetState(2))
return true;
if((selfmask&0x04) && me.GetState(9))
return true;
if((selfmask&0x08) && me.GetState(19))
return true;
if((selfmask&0x10) && me.GetState(55))
return true;
if((selfmask&0x20) && me.GetState(60))
return true;
if((selfmask&0x40) && me.GetState(61))
return true;
}
if(mercmask > 0x01)
{
var _merc = NTC_GetMerc();
if(_merc)
{
if((mercmask&0x02) && _merc.GetState(2))
return true;
if((mercmask&0x04) && _merc.GetState(9))
return true;
if((mercmask&0x08) && _merc.GetState(19))
return true;
if((mercmask&0x10) && _merc.GetState(55))
return true;
if((mercmask&0x20) && _merc.GetState(60))
return true;
if((mercmask&0x40) && _merc.GetState(61))
return true;
}
}
return false;
}
// self - 0x01 : Potion
// merc - 0x01 : Death
// common - 0x02 : Poison, 0x04 : Amplify Damage, 0x08 : Weaken, 0x10 : Iron Maiden, 0x20 : Decrepify, 0x40 : Lower Resist
function NTTMGR_CheckSafe(selfmask, mercmask)
{
if(((selfmask&0x01) && NTT_CheckBelt()) || ((mercmask&0x01) && NTT_CheckMerc()) || NTTMGR_CheckCurse(selfmask, mercmask))
return NTTMGR_VisitTown();
return true;
}
Ich habe dir auch mal den Part hervorgehoben, der dafür sorgt, dass Cain erst ab 2 Items aufgesucht wird, kannst du ja ändern, wenn du magst.
Auch wenn Cain durchaus auch ausgelassen werden kann, wenn dein Char forced Unids bei sich trägt, somit bietet sich ein ID Tome dennoch an.
LG
Muddy
|
|
|
05/10/2011, 13:41
|
#1828
|
elite*gold: 0
Join Date: Mar 2009
Posts: 382
Received Thanks: 45
|
Quote:
Originally Posted by Muddy_Waters
Kann es sein, dass dein Char keinen Tome bei sich trägt? Wenn ja, liegt das sehr wahrscheinlich daran.
Zum Craften:
Das reicht eventuell, wenn du den überflüssigen Initialisierungsaufruf aus der TownManager library entfernst.
Da ich gerade nicht mehr weiss, wo der genau stand, hier die ganze library:
Code:
/**
* This file was modified by
* Check the programming section for updates and further scripts
* Last Update: 12:26 10.05.2011
*/
var _NTTMGR_BuyPots;
var _NTTMGR_BuyTP;
var _NTTMGR_BuyKey;
var _NTTMGR_DoHeal;
var _NTTMGR_DoID;
var _NTTMGR_DoRepair;
var _NTTMGR_DoRevive;
var _NTTMGR_RemoveCurse;
var _MWTMGR_SellTrash;
var _MWTMGR_VisitMerchantForSelling;
function NTTMGR_TownManager(simple)
{
var _cubing, _trash;
if(arguments.length < 1)
simple = false;
NTC_ClearCursor();
NTT_CleanPotions();
_NTTMGR_BuyPots = NTT_CheckBelt();
_NTTMGR_BuyTP = (NTTMGR_CheckScrolls(1) < 5);
_NTTMGR_BuyKey = (MWConfig_CarryKeys && MWTMGR_GetKeyQuantity() <= 10);
_NTTMGR_DoHeal = NTT_CheckHeal();
_NTTMGR_DoID = NTT_CheckUnids();
_NTTMGR_DoRepair = (NTT_CheckRepair(40) && MWT_CheckRepairCost());
_NTTMGR_DoRevive = NTT_CheckMerc();
_trash = MWT_GetTrashItems();
_MWTMGR_SellTrash = (_trash && _trash.length > 0);
_MWTMGR_VisitMerchantForSelling = (MWConfig_AlwaysSellTrashItems && _MWTMGR_SellTrash && !(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID || _NTTMGR_DoRepair || _NTTMGR_DoRevive && me.act == 3 || _NTTMGR_RemoveCurse || _NTTMGR_DoHeal));
_NTTMGR_RemoveCurse = NTTMGR_CheckCurse(MWConfig_CheckSelfSafeTown, MWConfig_CheckMercSafeTown);
_MWTMGR_VisitCain = (MWConfig_IdentAtCain && !MWT_CarryForcedUnids() && _NTTMGR_DoID);
if(me.classid == NTC_CHAR_CLASS_PALADIN)
NTC_PutSkill(MWS_VIGOR, NTC_HAND_RIGHT);
else if(me.classid == NTC_CHAR_CLASS_ASSASSIN && !me.GetState(157))
NTC_CastSkill(MWS_BURST_OF_SPEED, NTC_HAND_RIGHT);
if(_MWTMGR_VisitCain && ([COLOR="Red"]_NTTMGR_DoID > 1[/COLOR] || me.act == 2))
MWTMGR_VisitCain();
switch(me.act)
{
case 1:
if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID || _MWTMGR_VisitMerchantForSelling)
NTTMGR_VisitAkara();
if(_NTTMGR_DoRevive)
NTTMGR_VisitKashya();
if(_NTTMGR_DoRepair)
NTTMGR_VisitCharsi();
break;
case 2:
if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_DoRepair || _MWTMGR_VisitMerchantForSelling)
NTTMGR_VisitFara();
if(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID)
NTTMGR_VisitDrognan();
if(_NTTMGR_DoRevive)
NTTMGR_VisitGreiz();
break;
case 3:
if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID || _MWTMGR_VisitMerchantForSelling)
NTTMGR_VisitOrmus();
if(_NTTMGR_DoRevive)
NTTMGR_VisitAsheara();
if(_NTTMGR_DoRepair)
NTTMGR_VisitHratli();
break;
case 4:
if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID || _MWTMGR_VisitMerchantForSelling)
NTTMGR_VisitJamella(false);
if(_NTTMGR_DoRevive)
NTTMGR_VisitTyrael();
if(_NTTMGR_DoRepair)
NTTMGR_VisitHalbu();
break;
case 5:
if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID)
NTTMGR_VisitMalah();
if(_NTTMGR_DoRevive)
NTTMGR_VisitQualKehk();
if(_NTTMGR_DoRepair || _MWTMGR_VisitMerchantForSelling)
NTTMGR_VisitLarzuk();
break;
}
_cubing = (!simple && NTCU_CheckCubing());
if(_cubing || NTT_CheckInventory() && NTT_CheckStash() || NTC_MyGoldCarry() > NTConfig_MinGoldToStash)
NTTMGR_VisitStash(_cubing);
if(!simple && NTConfig_Gamble && NTC_MyGold() > NTConfig_GambleStartGold)
{
switch(me.act)
{
case 1:
NTTMGR_VisitGheed();
break;
case 2:
NTTMGR_VisitElzix();
break;
case 3:
NTTMGR_VisitAlkor();
break;
case 4:
NTTMGR_VisitJamella(true);
break;
case 5:
NTTMGR_VisitAnya();
break;
}
_cubing = (!simple && NTCU_CheckCubing());
if(_cubing || NTT_CheckInventory() && NTT_CheckStash())
NTTMGR_VisitStash(_cubing);
}
_trash = MWT_GetTrashItems(false);
if(_trash && _trash.length > 0)
NTT_ClearInventory();
}
function NTTMGR_VisitTown()
{
var _prearea = me.areaid;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Town...");
if(!NTTM_CheckAct())
return false;
NTTMGR_TownManager(true);
if(!NTTM_TownMove("portalspot"))
return false;
if(!NTM_UsePortal("BluePortal", _prearea))
return false;
if(NTConfig_PublicMode)
NTM_MakeTP();
return true;
}
function NTTMGR_VisitStash(cubing)
{
var _stash;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Stash...");
if(!cubing && !NTT_CheckStash() && NTC_StashGoldFull())
return;
_stash = NTC_FindUnit(NTC_UNIT_OBJECT, NTC_UNIT_STASH);
if(!_stash || GetDistance(me, _stash) > 3)
NTTM_TownMove("stash");
if(!_stash)
_stash = NTC_FindUnit(NTC_UNIT_OBJECT, NTC_UNIT_STASH);
if(_stash)
{
if(NTT_DoInteract(_stash))
{
if(!cubing)
NTT_ManageStash();
if(cubing)
{
NTCU_DoCubing();
if(NTT_DoInteract(_stash))
NTT_ManageStash();
me.Cancel(1);
NTT_ClearInventory();
}
else
me.Cancel(1);
}
}
}
function NTTMGR_VisitAkara()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Akara...");
NTTM_TownMove("akara");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_AKARA, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_BuyKey || _NTTMGR_DoID || _MWTMGR_SellTrash)
{
if(NTT_DoTrade(_npc))
{
if(_NTTMGR_DoID)
NTTMGR_IDItems(_npc);
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_BuyPots)
MWT_FillBelt(_npc);
if(_NTTMGR_BuyTP)
NTT_FillTome(_npc, 1);
if(_NTTMGR_BuyKey)
NTT_FillKey(_npc);
}
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitKashya()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Kashya...");
NTTM_TownMove("kashya");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_KASHYA, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoInteract(_npc))
{
NTT_ReviveMerc();
me.Cancel(1);
}
}
}
}
function NTTMGR_VisitCharsi()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Charsi...");
NTTM_TownMove("charsi");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_CHARSI, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
{
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_DoRepair)
NTT_RepairItems(_npc);
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitGheed()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Gheed...");
NTTM_TownMove("gheed");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_GHEED, 5);
if(_npc)
MWTMGR_DoGambling(_npc);
}
function NTTMGR_VisitFara()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Fara...");
NTTM_TownMove("fara");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_FARA, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(_NTTMGR_DoRepair || _MWTMGR_SellTrash)
{
if(NTT_DoTrade(_npc))
{
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_DoRepair)
NTT_RepairItems(_npc);
}
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitDrognan()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Drognan...");
NTTM_TownMove("drognan");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_DROGNAN, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
{
if(_NTTMGR_DoID)
NTTMGR_IDItems(_npc);
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_BuyPots)
MWT_FillBelt(_npc);
if(_NTTMGR_BuyTP)
NTT_FillTome(_npc, 1);
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitLysander()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Lysander...");
NTTM_TownMove("lysander");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_LYSANDER, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
{
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_BuyKey)
NTT_FillKey(_npc);
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitGreiz()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Greiz...");
NTTM_TownMove("greiz");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_GREIZ, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
NTT_ReviveMerc();
me.Cancel(1);
}
}
}
function NTTMGR_VisitElzix()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Elzix...");
NTTM_TownMove("elzix");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ELZIX, 5);
if(_npc)
MWTMGR_DoGambling(_npc);
}
function NTTMGR_VisitOrmus()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Ormus...");
NTTM_TownMove("ormus");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ORMUS, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID || _MWTMGR_SellTrash)
{
if(NTT_DoTrade(_npc))
{
if(_NTTMGR_DoID)
NTTMGR_IDItems(_npc);
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_BuyPots)
MWT_FillBelt(_npc);
if(_NTTMGR_BuyTP)
NTT_FillTome(_npc, 1);
}
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitAsheara()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Asheara...");
NTTM_TownMove("asheara");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ASHEARA, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(_MWTMGR_SellTrash)
{
if(NTT_DoTrade(_npc))
{
MWTMGR_SellTrashItems(_npc);
me.Cancel(1);
}
}
NTT_ReviveMerc();
me.Cancel(1);
}
}
}
function NTTMGR_VisitHratli()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Hratli...");
NTTM_TownMove("hratli");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_HRATLI, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
{
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_DoRepair)
NTT_RepairItems(_npc);
if(_NTTMGR_BuyKey)
NTT_FillKey(_npc);
}
me.Cancel(1);
}
}
else
{
NTTM_TownMove("meshif");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_HRATLI, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
{
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_DoRepair)
NTT_RepairItems(_npc);
if(_NTTMGR_BuyKey)
NTT_FillKey(_npc);
}
me.Cancel(1);
}
}
}
}
function NTTMGR_VisitAlkor()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Alkor...");
NTTM_TownMove("alkor");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ALKOR, 5);
if(_npc)
MWTMGR_DoGambling(_npc);
}
function NTTMGR_VisitJamella(gamble)
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Jamella...");
NTTM_TownMove("jamella");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_JAMELLA, 5);
if(_npc)
{
if(gamble)
MWTMGR_DoGambling(_npc);
else
{
if(NTT_DoInteract(_npc))
{
if(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_BuyKey || _NTTMGR_DoID || _MWTMGR_SellTrash)
{
if(NTT_DoTrade(_npc))
{
if(_NTTMGR_DoID)
NTTMGR_IDItems(_npc);
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_BuyPots)
MWT_FillBelt(_npc);
if(_NTTMGR_BuyTP)
NTT_FillTome(_npc, 1);
if(_NTTMGR_BuyKey)
NTT_FillKey(_npc);
}
}
me.Cancel(1);
}
}
}
}
function NTTMGR_VisitHalbu()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Halbu...");
NTTM_TownMove("halbu");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_HALBU, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
{
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_DoRepair)
NTT_RepairItems(_npc);
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitTyrael()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Tyrael...");
NTTM_TownMove("tyrael");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_TYRAEL_ACT_4, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
NTT_ReviveMerc();
me.Cancel(1);
}
}
}
function NTTMGR_VisitMalah()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Malah...");
NTTM_TownMove("malah");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_MALAH, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_BuyKey || _NTTMGR_DoID || _MWTMGR_SellTrash)
{
if(NTT_DoTrade(_npc))
{
if(_NTTMGR_DoID)
NTTMGR_IDItems(_npc);
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_BuyPots)
MWT_FillBelt(_npc);
if(_NTTMGR_BuyTP)
NTT_FillTome(_npc, 1);
if(_NTTMGR_BuyKey)
NTT_FillKey(_npc);
}
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitLarzuk()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Larzuk...");
NTTM_TownMove("larzuk");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_LARZUK, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
{
if(_MWTMGR_SellTrash)
MWTMGR_SellTrashItems(_npc);
if(_NTTMGR_DoRepair)
NTT_RepairItems(_npc);
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitQualKehk()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Qual-Khek...");
NTTM_TownMove("qual-kehk");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_QUALKEHK, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
NTT_ReviveMerc();
me.Cancel(1);
}
}
}
function NTTMGR_VisitAnya()
{
var _npc;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Anya...");
NTTM_TownMove("anya");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ANYA_TOWN, 5);
if(_npc)
MWTMGR_DoGambling(_npc);
}
function MWTMGR_VisitCain()
{
var _npc, _unids;
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Visiting Cain...");
NTTM_TownMove("cain");
switch(me.act)
{
case 1:
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_CAIN_ACT_1);
break;
case 2:
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_CAIN_ACT_2, 5);
break;
case 3:
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_CAIN_ACT_3, 5);
break;
case 4:
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_CAIN_ACT_4, 5);
break;
case 5:
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_CAIN_ACT_5, 5);
break;
}
if(_npc)
{
if(NTT_DoInteract(_npc))
{
_unids = NTT_GetUnidItems();
for(var i = 0; i <= 4; i++)
{
if(i % 2 == 0)
me.SelectNPCMenu(0x0FB4);
NTC_Delay(500);
if(!NTT_CheckUnids())
break;
}
for(var i = 0; i < _unids.length; i++)
{
if(NTSI_CheckItem(_unids[i], true) == 1)
MWI_WriteManagerLog(_unids[i], 0, true);
}
me.Cancel(1);
_NTTMGR_DoID = NTT_CheckUnids();
if(!(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID || _NTTMGR_DoRepair || _NTTMGR_DoRevive && me.act == 3 || _NTTMGR_RemoveCurse || _NTTMGR_DoHeal))
{
if(!MWConfig_AlwaysSellTrashItems)
{
NTT_ClearInventory();
_MWTMGR_VisitMerchantForSelling = false;
}
else
_MWTMGR_VisitMerchantForSelling = true;
}
_MWTMGR_SellTrash = (MWT_GetTrashItems().length > 0);
}
}
}
function NTTMGR_CheckScrolls(scrolltype)
{
var _tome = NTT_GetTome(scrolltype);
if(_tome)
return _tome.GetStat(70);
return 0;
}
function MWTMGR_GetKeyQuantity()
{
var _keys, _count;
if(me.classid == NTC_CHAR_CLASS_ASSASSIN)
return 12;
_keys = MWC_GetItems(MWC_LOC_INVENTORY, 0, 543);
_count = 0;
if(_keys)
{
for(var i = 0; i < _keys.length; i++)
_count += _keys[i].GetStat(70);
}
return _count;
}
function MWTMGR_SellTrashItems(npc)
{
var _items, _retValue;
_items = MWT_GetTrashItems();
_retValue = true;
for(var i = 0; i < _items.length; i++)
{
if(MWConfig_UseXMLItemlog)
MWI_WriteLog(_items[i], 1);
if(MWConfig_LogSoldItems)
MWI_WriteManagerLog(_items[i], 3);
if(!NTT_ShopItem(_items[i], npc, 1))
_retValue = false;
}
return _retValue;
}
function NTTMGR_IDItems(npc)
{
var _tome, _scroll;
var _result, _check;
var _items = NTT_GetUnidItems();
if(!_items || _items.length < 1)
return;
_tome = NTT_GetTome();
if(_tome && _tome.GetStat(70) < _items.length)
NTT_FillTome(npc);
for(var i = 0 ; i < _items.length ; i++)
{
switch(NTSI_CheckItem(_items[i], true))
{
case 1:
MWI_WriteManagerLog(_items[i], 0, true);
case 2:
break;
case 0:
if(_items[i].GetItemCost(1) >= 35E3)
break;
case -1:
if(_tome)
_result = NTT_IdItem(_tome, _items[i]);
else
{
_scroll = NTT_GetScroll();
if(!_scroll)
{
NTT_BuyScrolls(npc);
_scroll = NTT_GetScroll();
}
_result = NTT_IdItem(_scroll, _items[i]);
}
if(!_result)
break;
_check = NTSI_CheckItem(_items[i], true);
if(_check == 1)
MWI_WriteManagerLog(_items[i], 0, true);
else if(_check == 0 || _check == 3)
{
if(MWConfig_UseXMLItemlog)
MWI_WriteLog(_items[i], 1);
if(MWConfig_LogSoldItems)
MWI_WriteManagerLog(_items[i], 3, true);
NTT_ShopItem(_items[i], npc, 1);
}
break;
}
}
}
function MWTMGR_DoGambling(npc)
{
var _logString, _date, _deltaTime, _timeString, _gamblingData, _time;
if(arguments.length < 1 || !npc)
return false;
_gamblingData = new Array();
_gamblingData["itemsgambled"] = 0;
_gamblingData["itemskept"] = 0;
_gamblingData["goldmax"] = NTC_MyGold() - NTConfig_GambleStopGold;
_gamblingData["goldspent"] = 0;
_gamblingData["abort"] = false;
while(NTC_MyGold() > NTConfig_GambleStopGold)
{
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Gambling (" + (_gamblingData["goldspent"] / _gamblingData["goldmax"] * 100.0).toFixed(1) + "%)");
if(NTT_DoInteract(npc))
{
if(NTT_DoTrade(npc, 1))
_gamblingData = NTT_GambleIt(npc, _gamblingData);
me.Cancel(1);
if(_gamblingData["abort"])
break;
}
else
break;
}
_logString = "˙008040Gambling completed!;";
_logString += "˙c0Items Gambled:˙c8 " + _gamblingData["itemsgambled"] + " [" + _gamblingData["itemskept"] + "]";
_logString += "\n˙c0Gold Spent:˙c8 " + MWC_InsertDigitSeperator(_gamblingData["goldspent"]);
_logString += "\n˙c0Total Items Gambled:˙c8 " + MWC_InsertDigitSeperator(MWI_GetGamblingData("total")) + " [" + MWC_InsertDigitSeperator(MWI_GetGamblingData("kept")) + "]";
_logString += "\n˙c0Total Gold Spent:˙c8 " + MWC_InsertDigitSeperator(MWI_GetGamblingData("gold"));
_logString += "\n˙c0Gambling Sessions:˙c8 " + (MWI_GetGamblingData("sessions") + 1);
_date = new Date();
if(_date)
{
_deltaTime = _date.getTime() - MWI_GetGamblingData("lastupdate");
_timeString = "";
_date = new Date(MWI_GetGamblingData("lastupdate"));
if(!isNaN(_deltaTime) && _date)
{
// Days passed
_time = parseInt(_deltaTime / 864E5);
if(_time > 0)
{
_timeString += _time + " Day";
if(_time > 1)
_timeString += "s ";
else
_timeString += " ";
}
_timeString += MWC_ConvertTicksToTimeString(_deltaTime);
_logString += "\n˙c0Last Session:˙c8 " + _date.toLocaleFormat("%a %m/%d/%y %H:%M:%S") + " [-" + _timeString + "]";
}
}
_date = new Date(MWI_GetGamblingData("creation"));
if(_date)
_logString += "\n˙c0Logfile Created:˙c8 " + _date.toLocaleFormat("%a %m/%d/%y %H:%M:%S");
NTC_SendLogToOOG(NTC_LOG_COMMON, _logString);
SetStatusText("˙c8Gambling completed!");
NTC_SendMsgToScript("MWBotGame.ntj", "RESET_TICKS");
NTC_SendMsgToScript("MWBotGame.ntj", "SET_DEFAULT_STATUS");
MWI_WriteGamblingData(0, new Array(0, 0), true, true);
return true;
}
// mask - 0x02 : Poison, 0x04 : Amplify Damage, 0x08 : Weaken, 0x10 : Iron Maiden, 0x20 : Decrepify, 0x40 : Lower Resist
function NTTMGR_CheckCurse(selfmask, mercmask)
{
if(selfmask > 0x01)
{
if((selfmask&0x02) && me.GetState(2))
return true;
if((selfmask&0x04) && me.GetState(9))
return true;
if((selfmask&0x08) && me.GetState(19))
return true;
if((selfmask&0x10) && me.GetState(55))
return true;
if((selfmask&0x20) && me.GetState(60))
return true;
if((selfmask&0x40) && me.GetState(61))
return true;
}
if(mercmask > 0x01)
{
var _merc = NTC_GetMerc();
if(_merc)
{
if((mercmask&0x02) && _merc.GetState(2))
return true;
if((mercmask&0x04) && _merc.GetState(9))
return true;
if((mercmask&0x08) && _merc.GetState(19))
return true;
if((mercmask&0x10) && _merc.GetState(55))
return true;
if((mercmask&0x20) && _merc.GetState(60))
return true;
if((mercmask&0x40) && _merc.GetState(61))
return true;
}
}
return false;
}
// self - 0x01 : Potion
// merc - 0x01 : Death
// common - 0x02 : Poison, 0x04 : Amplify Damage, 0x08 : Weaken, 0x10 : Iron Maiden, 0x20 : Decrepify, 0x40 : Lower Resist
function NTTMGR_CheckSafe(selfmask, mercmask)
{
if(((selfmask&0x01) && NTT_CheckBelt()) || ((mercmask&0x01) && NTT_CheckMerc()) || NTTMGR_CheckCurse(selfmask, mercmask))
return NTTMGR_VisitTown();
return true;
}
Ich habe dir auch mal den Part hervorgehoben, der dafür sorgt, dass Cain erst ab 2 Items aufgesucht wird, kannst du ja ändern, wenn du magst.
Auch wenn Cain durchaus auch ausgelassen werden kann, wenn dein Char forced Unids bei sich trägt, somit bietet sich ein ID Tome dennoch an.
LG
Muddy
|
ne ofc trägt er keinen folianten zu identen dabei wenn er zu cain rennt... war aber imo auch net das problem da er sich ne scroll kauft und dann identen will aber irgendwie führt er das net sauber aus und sellt die items dann einfach
da ich keine sachen unid lasse stört mich das mit cain eher weniger, werds also dahingehend ändern das er bei jedem item
if(_MWTMGR_VisitCain && (_NTTMGR_DoID > 0
cain benutzt... sollte das problem dahingehend auch lösen imo
|
|
|
05/10/2011, 13:58
|
#1829
|
elite*gold: 0
Join Date: Dec 2009
Posts: 23
Received Thanks: 0
|
Quote:
Originally Posted by GruenerApfel
ne ofc trägt er keinen folianten zu identen dabei wenn er zu cain rennt... war aber imo auch net das problem da er sich ne scroll kauft und dann identen will aber irgendwie führt er das net sauber aus und sellt die items dann einfach
da ich keine sachen unid lasse stört mich das mit cain eher weniger, werds also dahingehend ändern das er bei jedem item
if(_MWTMGR_VisitCain && (_NTTMGR_DoID > 0
cain benutzt... sollte das problem dahingehend auch lösen imo
|
war auch bei mir so.. kauft sich ident scroll.. verkauft item ohne zu iden. und schmeißt scroll weg --> einfach ident tomb kaufen und prob gelöst
|
|
|
05/10/2011, 14:33
|
#1830
|
Administrator
elite*gold: 41364
Join Date: Jan 2010
Posts: 22,727
Received Thanks: 12,652
|
Alternativ kann man auch einfach die Funktion ausbessern, die das Problem auslöst.
Das würde dann so aussehen:
Code:
function NTT_GetScroll(type)
{
var _items;
var i, j;
if(arguments.length < 1)
type = 0;
for(i = 0; i < 5; i++)
{
if(i > 0)
NTC_PingDelay(200);
if(type)
_items = me.GetItems(529);
else
_items = me.GetItems(530);
if(_items)
{
for(j = 0; j < _items.length; j++)
{
if(_items[j].mode == 0 && _items[j].itemloc == MWC_LOC_INVENTORY)
return _items[j];
}
}
}
return null;
}
LG
Muddy
|
|
|
 |
|
Similar Threads
|
[Release] D2NT 3.1 1.13c
07/17/2016 - Diablo 2 - 91 Replies
hi,
hab eben den d2nt3.1 gefunden. ein neues baba script is dabei.
release thread eon
D2NT3.1
|
[Realease] Muddy's Waypoint Catcher
08/21/2013 - Diablo 2 Programming - 46 Replies
Moin zusammen,
hier mal die erste Release Version eines kleinen Scripts genannt Waypoint Catcher. Das ganze ist jetzt nichtmal 24h alt, dementsprechend sind vermutlich noch einige Bugs vorhanden. Hinweise dazu nehme ich gerne entgegen. ;)
Features:
- Suchen sämtlicher Wegpunkte mit Ausnahme, wobei in Akt ein durch Probleme im Jail Bereich nach dem Wegpunkt Outer Cloister abgebrochen wird
- Wahlweise auch mit TP an jedem gefundenen Wp, sodass man damit auch anderen (nicht-Bots) die...
|
[D2NT] Long Dia Release
05/10/2011 - Diablo 2 Programming - 28 Replies
Ein kleines Script für diablo, es startet beim eingang macht ein tp cleart den weg zum star macht am star noch ein tp dann läufts wie das normale nur cleart es schöner :)
hoffe euch gefällts ich habs noch nicht wirklich getestet (2-3 runs) bugs können gerne hier gepostet werden verbesserungs vorschläge auch :D
installation:
1.)Script in den Bot ordner kopieren
2.)Script im editor oder vergleichbaren öffnen
3.) Msg´s anpassen (ist nicht schwer)
4.) in der char config die zeile...
|
D2NT 3.0 Pickit release
10/22/2010 - Diablo 2 - 77 Replies
edit
|
Muddy's D2NT Help
07/29/2010 - Diablo 2 - 3 Replies
hi i just started to use the bot it work's great.
how do i set up the skill's i use on my Sorc and pick up itme's?
.....
if you reply to this post please use english
|
All times are GMT +1. The time now is 23:58.
|
|