normal pickit aus sonst kauft er alles voll mit tränke ^^ kann auch bissel dauern manchmal heute habe ich nur 2 lps gefunden sonst nix
Pick add
dürfte normal passen habes jetzt noch net getestet und für Lowlvlpvp habe ich die andern schielder nur mit // versehen
und noch nen link der dir vll hilft wo du es findest [Only registered and activated users can see links. Click Here To Register...]
in cl shopt man die bei Drognan aber glauber der hat nur die 3 felder großen
mir is aufgefallen das es öffter mal zu problemen kommt wenn man frw speed gleich auf 255 setz
also habe ich nocht etwas modefizirt!
Erklärung: ich habe ihm gesagt das er Erst zum NPC geht(frw nur von items)dann 1milli sec pause und dann sagt er .fws 255 (so setz RV frw auf 255) sag er aber jedes mal bevor er den NPC anspricht! (nur bei anya getestet)
Shopbot.ntj
und da ich grade dabei war habe ich die Teleport Flicht mal mit raus genommen
Erklärung: Schritt 1:Öffne D2NT\scripts\NTBot\char_configs\NTConfig.ntl
füge "var NTConfig_IsLeecher;" einfach unten ein!Ohne ""
Schritt: Öffne D2NT\scripts\NTBot\char_configs\NTConfig_Class_Cha rname.ntj
füge "NTConfig_IsLeecher = true" (Ohne "")ein. (true=keine eni false=mit eni)
am besten bei einstellungen da wo auch publimode steht)
Schritt 3:Öffne D2NT\scripts\libs\common\NTMove.ntl und ersetze alle was da drin steht durch:
NTMove.ntl
das mit dem Enitelepot bug ausschalten ist von Hadin84`s [Only registered and activated users can see links. Click Here To Register...]
habe es nur in die ShopBot Char datei mit eingefügt.
Und zu guter letzt noch der GatewaySwitcher
[Only registered and activated users can see links. Click Here To Register...]
Pick add
Code:
[Type] == Shield && [Class] == elite && [Quality] == Magic && [Flag] != ethereal # [Sockets] >= 3 && [FBR] == 30 [Type] == HandToHand && [Class] >= exceptional && [Quality] == Magic # [ItemToHitPerLevel] >= 1 && [AssassinSkills]+[TrapsSkillTab]+[SkillLightningSentry] >= 3 [Type] == HandToHand && [Class] == elite && [Quality] == Magic # [ItemToHitPerLevel] >= 1 && [IAS] >= 20
dürfte normal passen habes jetzt noch net getestet und für Lowlvlpvp habe ich die andern schielder nur mit // versehen
sry ganz übersehen werde morgen mal an zepter setzen!Quote:
wo shopt man denn 2 pala 10 fc 3 foh/ 3 conv szepter ? bzw das selbe mit 4 sockel ?
+ son hammerdin szepter ? danke schonmal :D
und wie sieht der code dafür aus ^^ ?
[Type] == scepter && [Quality] == magic # [fcr] >=10 && [SkillFistOfTheHeavens]+[SkillConviction] >= 5 && ( [PaladinSkills] == 2 || [Sockets] >= 3 || [PaliCombatSkillTab] >= 2 )
wäre das so richtig ? bzw die fcr auch wechlassen ( :
und noch nen link der dir vll hilft wo du es findest [Only registered and activated users can see links. Click Here To Register...]
in cl shopt man die bei Drognan aber glauber der hat nur die 3 felder großen
mir is aufgefallen das es öffter mal zu problemen kommt wenn man frw speed gleich auf 255 setz
also habe ich nocht etwas modefizirt!
Erklärung: ich habe ihm gesagt das er Erst zum NPC geht(frw nur von items)dann 1milli sec pause und dann sagt er .fws 255 (so setz RV frw auf 255) sag er aber jedes mal bevor er den NPC anspricht! (nur bei anya getestet)
Shopbot.ntj
Code:
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// //
// ShopBot Script For D2NT 2.1 //
// Edit BY Lamobchan 2010/1/20 //
// Change For D2NT 3.1 2010/4/27 //
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 如果你不是很熟悉的话,请不要改动,因为现在这里没啥要设置的!
// if u don't know the javascript codes, do not edit this!
// lambochan
// 下列的物品忽略...
var shop_ignoreList = "aqv,cqv,key,tbk,ibk,tsc,isc,yps,vps,wms,hp1,hp2,hp3,hp4,hp5,mp1,mp2,mp3,mp4,mp5";
// kill再生尸,不用设置
var killUndear = false;
// anya红门坐标,不必理会
var anyaTPX = 10068;
var anyaTPY = 13308;
// 发生错误的情况(用来监控是否退出)
var errorMode = -1;
var sameErrorCount = 0;
function NTMain()
{
// 初始化
Include("libs/common/NTCommon.ntl");
NTC_IncludeLibs();
NTC_IncludeConfig("NTShop/char_configs");
NT_LoadConfig();
NTSI_LoadNIPFiles("NTShop/item_configs");
NTA_Initialize();
NTTMGR_TownManager();
NTC_Delay( 2000 );
NT_Shoping_OverHead( "Now begin shoping..." );
// shoping
NT_Shoping();
// over.
NT_Shoping_Msg( "SCRIPT_END" );
}
function NT_Shoping()
{
var npcName = new Array( "akara", "charsi", "gheed", /* act1 */
"drognan", "fara", "elzix", /* act2 */
"ormus", "hratli", "asheara", /* act3 */
"jamella", "halbu" ); /* act4 */
// "anya", "larzuk", "malah" ); /* act5 */
if( !is_D2C ){ // d2x, need add act5 npc name
npcName.push( "anya" );
npcName.push( "larzuk" );
npcName.push( "malah" );
}
var npcID = [NTC_NPC_ID_AKARA, NTC_NPC_ID_CHARSI, NTC_NPC_ID_GHEED,
NTC_NPC_ID_DROGNAN, NTC_NPC_ID_FARA, NTC_NPC_ID_ELZIX,
NTC_NPC_ID_ORMUS, NTC_NPC_ID_HRATLI, NTC_NPC_ID_ASHEARA,
NTC_NPC_ID_JAMELLA, NTC_NPC_ID_HALBU,
NTC_NPC_ID_ANYA_TOWN, NTC_NPC_ID_LARZUK, NTC_NPC_ID_MALAH];
var j;
var num;
var npc;
var npcCount;
var shopItems;
var shopRush = 0;
var buyItems = new Array();
var showItems = new Array();
if( shop_npcNumber.length <= 0 ){
NT_Shoping_Msg( "have not npc list for shoping, plz check it!" );
return;
}
for( ; ; ){
num = 0;
npcCount = shop_npcNumber.length;
do{
if( shopRush++ > 30 ){
RunGC();
shopRush = 0;
}
if( NTTMGR_CheckScrolls( 1 ) < 4 )
NTTMGR_TownManager();
if( !NT_Shoping_CheckACT( shop_npcNumber[num] ) ){
NT_Shoping_Msg( "NT_Shoping_CheckACT()", 1 );
break;
}
if( !NTTM_TownMove( npcName[shop_npcNumber[num] - 1] ) ){
NT_Shoping_Msg( "NTTM_TownMove()", 2 );
break;
}
NTC_Delay( 1 );
Say(".fws 255");
npc = NTC_FindUnit( NTC_UNIT_NPC, npcID[shop_npcNumber[num] - 1], 2 );
if( npc ){
if( !NTT_DoInteract( npc ) ){
NT_Shoping_Msg( "NTT_DoInteract()", 3 );
break;
}
if( !NTT_DoTrade( npc ) ){
NT_Shoping_CancelMenu();
NT_Shoping_Msg( "!NTT_DoTrade()", 4 );
break;
}
shopItems = npc.GetItems();
if( shopItems ){
for( j = 0; j < shopItems.length; ++j ){
if( shop_ignoreList.indexOf( shopItems[j] ) == -1 ){
if( NTIPCheckItem( shopItems[j] ) == 1 ){
buyItems.push( shopItems[j] );
var mark = new markItems( shopItems[j].quality, shopItems[j].name, shopItems[j].itemdesc );
showItems.push( mark );
}
}
}
} // end if(shopItems)
if( buyItems.length > 0 ){
for( j = 0; j < buyItems.length; ++j ){
if( buyItems[j].GetItemCost( 0, npcID[shop_npcNumber[num] - 1] ) > NTC_MyGold() ){
NT_Shoping_CancelMenu();
NT_Shoping_Loop( "have not money buy an item now." );
}
if( NTT_CheckSpace( buyItems[j].xsize, buyItems[j].ysize ) ){
if( !NTT_ShopItem( buyItems[j], npc, 2 ) ){
NT_Shoping_CancelMenu();
NT_Shoping_Loop( "have an item can not buy it." );
}
} // end if(NTT_Ch
else {
NT_Shoping_CancelMenu();
NTTMGR_VisitStash();
if( !NTT_CheckSpace( buyItems[j].xsize, buyItems[j].ysize ) ){
NT_Shoping_Loop( "have not space save items, and have an item can not buy it." );
}
if( !NTTM_TownMove( npcName[shop_npcNumber[num] - 1] ) ){
NT_Shoping_Loop( "have an item can not buy it." );
}
if( !NTT_DoInteract( npc ) ){
NT_Shoping_Loop( "have an item can not buy it." );
}
if( !NTT_DoTrade( npc ) ){
NT_Shoping_CancelMenu();
NT_Shoping_Loop( "have an item can not buy it." );
}
if( !NTT_ShopItem( buyItems[j], npc, 2 ) ){
NT_Shoping_CancelMenu();
NT_Shoping_Loop( "have an item can not buy it." );
}
} // end else
NTC_SendLogToOOG( NTC_LOG_ITEM, "Buy " + NTC_ItemQualityToMGRColor[showItems[j].quality] + "[" + showItems[j].name + "] " + ";" + showItems[j].itemdesc +
" [" + npcName[shop_npcNumber[num] - 1].charAt( 0 ).toUpperCase() +
npcName[shop_npcNumber[num] - 1].substring( 1 ) + "]" );
} // end for( j
buyItems.length = 0;
showItems.length = 0;
}
// 关闭菜单
NT_Shoping_CancelMenu();
} // end if(npc)
// 出城
if( !NT_Shoping_InOutTown(shop_npcNumber[num], num ) ){
NT_Shoping_Msg( "NT_Shoping_InOutTown()", 5 );
break;
}
// next npc
num++;
} while( --npcCount );
}
}
function NT_Shoping_InOutTown(num, count)
{
if( shop_npcNumber.length > 1 ){ // shop几个
var outTown = NT_Shoping_GoNextNpc(num, count); // 看看要不要出城,因为要刷新npc必须在该act出城..
if( !outTown ) // 不用。
return true;
}
if( num == 12 && !anyaGoWp ){ // anya go red tp
if( !NTTM_TownMove( "portal" ) ){
NT_Shoping_Msg( "NTTM_TownMove()", 6 );
return false;
}
if( !NT_Shoping_UsePortal( "Portal", 121 ) ){
NT_Shoping_Msg( "NT_Shoping_UsePortal()", 7 );
return false;
}
// kill再生尸
if( autoClear ){
killUndear = true;
NTP_DoPrecast();
// 有“吸星大法”和TP的话,先吸掉一些......
if( NTC_GetSkillLevel( 124 ) && NTC_GetSkillLevel( 54 ) ){
if( !NTM_MoveTo( me.areaid, 10069, 13293 ) )
return false;
NTC_PutSkill( 124, NTC_HAND_RIGHT );
NTC_PingDelay( 2000 );
if( !NTM_MoveTo( me.areaid, me.x - 15, me.y - 15 ) )
return false;
} // end if( NTC_Ch
if( NT_Shoping_CheckUndear( 20 ) ){
if( NTA_ClearPosition( 20 ) )
NTSI_PickItems();
if( NTC_GetSkillLevel( 124 ) && NT_Shoping_CheckCorpses( 8 ) ){
NTC_PutSkill( 124, NTC_HAND_RIGHT );
NTC_PingDelay( 2000 );
}
NTC_PutSkill( 115, NTC_HAND_RIGHT );
}
if( !NTM_MoveTo( me.areaid, anyaTPX, anyaTPY ) )
return false;
autoClear = false;
}
// 门口有怪的话,必须杀光
if( killUndear && NT_Shoping_CheckUndear( 20 ) ){
if( NTA_ClearPosition( 20 ) )
NTSI_PickItems();
if( NTC_GetSkillLevel( 124 ) && NT_Shoping_CheckCorpses( 8 ) ){
NTC_PutSkill( 124, NTC_HAND_RIGHT );
NTC_PingDelay( 2000 );
}
if( !NTM_MoveTo( me.areaid, anyaTPX, anyaTPY ) )
return false;
NTC_PutSkill( 115, NTC_HAND_RIGHT );
}
// 走人回act5 town
if( !NT_Shoping_UsePortal( "Portal", 109 ) ){
NT_Shoping_Msg( "NT_Shoping_UsePortal()", 8 );
return NT_Shoping_CheckACT();
}
} else {
var ok = false;
if( !NTTM_TownMove( "waypoint" ) ){
NT_Shoping_Msg( "NTTM_TownMove()", 9 );
return false;
}
switch( me.act ){
case 1 :
if( !NT_Shoping_TakeWaypoint( 35 ) )
return false;
ok = NT_Shoping_TakeWaypoint( 1 );
break;
case 2 :
if( !NT_Shoping_TakeWaypoint( 48 ) ){
return false;
}
ok = NT_Shoping_TakeWaypoint( 40 );
break;
case 3 :
if( !NT_Shoping_TakeWaypoint( 101 ) )
return false;
ok = NT_Shoping_TakeWaypoint( 75 );
break;
case 4 :
if( !NT_Shoping_TakeWaypoint( 107 ) )
return false;
ok = NT_Shoping_TakeWaypoint( 103 );
break;
case 5 :
if( !NT_Shoping_TakeWaypoint( 129 ) )
return false;
ok = NT_Shoping_TakeWaypoint( 109 );
break;
}
if( !ok ){ // give a chance do it again..
return NT_Shoping_CheckACT();
}
}
return true;
}
function NT_Shoping_CheckMonster( target )
{
return ( target.hp > 0 && target.mode != 0 && target.mode != 12 && GetDistance( me, target ) != -1 );
}
function NT_Shoping_CheckCorpses( range )
{
var undear = NTC_FindUnit( NTC_UNIT_MONSTER, 438, 2 );
if( undear ){
do{
if( !NT_Shoping_CheckMonster( undear ) && GetDistance( me, undear ) < range )
return true;
} while( undear.GetNext() );
}
return false;
}
function NT_Shoping_CheckUndear( range )
{
var undear = NTC_FindUnit( NTC_UNIT_MONSTER, 438, 2 );
if( undear ){
do{
if( GetDistance( me, undear ) < range )
return true;
} while( undear.GetNext() );
}
return false;
}
function NT_Shoping_Loop( str )
{
var hi = "NTShopbot.ntj : " + str;
NTC_SendLogToOOG( hi );
var tempX = me.x;
var tempY = me.y;
for( ; ; ){
for( var i = 0; i < 20; ++i ){
NT_Shoping_OverHead( str );
var xx = Random( -3, 3 );
var yy = Random( -3, 3 );
NTC_DoClick( NTC_CLICK_LDOWN, NTC_SHIFT_NONE, xx, yy );
NTC_Delay(500);
NTC_Delay( 3000 );
NTC_DoClick( NTC_CLICK_LDOWN, NTC_SHIFT_NONE, tempX, tempY );
NTC_Delay(500);
}
}
}
function NT_Shoping_Msg( str, em )
{
errorGoQuitGame ? NTC_SendMsgToScript( "NTBotGame.ntj", str ) :
( NT_Shoping_CheckError( em ) ? NTC_SendMsgToScript( "NTBotGame.ntj", str ) :
NTC_SendLogToOOG( NTC_LOG_COMMON, "ÿE00000" + str ) );
}
function NT_Shoping_CheckError( em )
{
if( errorMode == em ){
sameErrorCount++;
if( sameErrorCount >= 5 )
return true;
} else {
errorMode = em;
sameErrorCount = 0;
}
if( em == 3 ){ // maybe mouse lock
// don't know how to fix now....
}
return false;
}
function NT_Shoping_CheckACT(npcNum)
{
var townid = [1,40,75,103,109];
if( !NTC_InTown() ){
if( !NT_Shoping_MakeTP( townid[me.act-1] ) )
return false;
}
if( arguments.length < 1 )
return true;
var act = NT_Shoping_CheckNPC( npcNum );
if( act == 0 )
return false;
if( act != me.act ){
if( !NTTM_TownMove( "waypoint" ) )
return false;
if( !NT_Shoping_TakeWaypoint( townid[act-1] ) )
return false;
}
return true;
}
function NT_Shoping_GoNextNpc(npcNum, count)
{
var cur = NT_Shoping_CheckNPC(npcNum);
var next = NT_Shoping_CheckNPC(shop_npcNumber[count+1]);
return ( next == cur ? false : true ); // 相等就不用出城
}
function NT_Shoping_CheckNPC( npcNum )
{
if( is_D2C && npcNum > 11 )
return 0;
switch( npcNum ){
case 1 :
case 2 :
case 3 :
return 1;
case 4 :
case 5 :
case 6 :
return 2;
case 7 :
case 8 :
case 9 :
return 3;
case 10:
case 11:
return 4;
case 12:
case 13:
case 14:
return 5;
}
return 0;
}
function NT_Shoping_OverHead( str )
{
Say( "!" + str );
NTC_Delay( 200 );
}
// 函数关闭打开的菜单
function NT_Shoping_CancelMenu()
{
var i;
while (GetUIState(0x01) ||
GetUIState(0x08) ||
GetUIState(0x0C) ||
GetUIState(0x17) ||
GetUIState(0x19) ||
GetUIState(0x1A) ||
GetUIState(0x24)){
for( i = 0; i < 40; ++i ){
if( ( i % 20 ) == 0 )
me.Cancel(1);
NTC_Delay( 200 );
if( !GetUIState(0x01) &&
!GetUIState(0x08) &&
!GetUIState(0x0C) &&
!GetUIState(0x17) &&
!GetUIState(0x19) &&
!GetUIState(0x1A) &&
!GetUIState(0x24)){
NTC_PingDelay(500);
break;
}
}
}
NTC_PingDelay( 500 );
}
function markItems( quality, name, itemdesc )
{
this.quality = quality;
this.name = name;
this.itemdesc = itemdesc;
}
function NT_Shoping_TakeWaypoint( areaid )
{
var _unit;
if( me.areaid == areaid )
return true;
_unit = NTM_GetWaypointInt();
if( !_unit )
return false;
if( NTC_InTown() )
me.Cancel( 1 );
for( var i = 0 ; i < 20 ; ++i ){
if( ( i % 10 ) == 0 ){
NTC_DoClick( NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _unit );
}
NTC_Delay(200);
if( GetUIState( 0x14 ) ){
if( me.TakeWaypoint( areaid ) ){
NTC_PingDelay( NTConfig_AreaDelay );
return true;
}
break;
}
}
return false;
}
function NT_Shoping_UsePortal( how, dest, ownername, portal )
{
if( me.areaid == dest )
return true;
if( NTC_InTown() )
me.Cancel( 1 );
if( NT_Shoping_ChangeAreaInt( how, dest, ownername, portal ) ){
NTC_PingDelay( NTConfig_AreaDelay );
return true;
}
return false;
}
function NT_Shoping_ChangeAreaInt( how, dest, ownername, myportal )
{
var _portal;
var _playerportal = false;
var _prearea;
if( how == "BluePortal" ){
if( !ownername )
ownername = me.name;
_playerportal = true;
}
if( arguments.length > 3 && myportal )
_portal = myportal;
else {
_portal = NTM_FindCorrectPortalInt( _playerportal, ownername );
if( _portal < 0 )
_portal = NTM_FindPortalAreaInt( dest );
if( _portal == -1 )
return false;
}
if( !_portal )
return false;
_prearea = me.areaid;
for( var i = 0 ; i < 20 ; ++i ){
if( ( i % 5 ) == 0 ){
// if( i == 10 )
// NTM_MoveTo( _prearea, me.x + 6, me.y + 6 );
NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _portal);
}
NTC_Delay(200);
if( me.areaid != _prearea )
break;
}
while( me.areaid == 0 )
NTC_Delay(200);
return ( me.areaid == dest );
}
function NT_Shoping_MakeTP(dest)
{
var _usetp = true;
var _portal;
var _portalname;
if( NTC_InTown() )
return true;
if( arguments.length < 1 )
_usetp = false;
if( !NTC_CastSkill( 220, NTC_HAND_RIGHT ) )
return false;
NTC_PingDelay( 500 );
_portalname = GetLocaleString( 3226 );
for( var i = 0 ; i <= 2 ; ++i ){
_portal = NTC_FindUnit( NTC_UNIT_OBJECT, _portalname );
if( _portal ){
do{
if( _portal.mode == 2 && NTC_CheckOwner( _portal ) ){
if( _usetp )
return NT_Shoping_UsePortal( "BluePortal", dest, me.name, _portal );
return true;
}
} while( _portal.GetNext() );
}
if( i < 2 )
NTC_Delay(500);
}
return false;
}
und da ich grade dabei war habe ich die Teleport Flicht mal mit raus genommen
Erklärung: Schritt 1:Öffne D2NT\scripts\NTBot\char_configs\NTConfig.ntl
füge "var NTConfig_IsLeecher;" einfach unten ein!Ohne ""
Schritt: Öffne D2NT\scripts\NTBot\char_configs\NTConfig_Class_Cha rname.ntj
füge "NTConfig_IsLeecher = true" (Ohne "")ein. (true=keine eni false=mit eni)
am besten bei einstellungen da wo auch publimode steht)
Schritt 3:Öffne D2NT\scripts\libs\common\NTMove.ntl und ersetze alle was da drin steht durch:
NTMove.ntl
Code:
function NTM_MoveTo(areaid, x, y, retry, clearpath)
{
var i, n;
var _teleport;
var _path;
var _retry = 0;
if(x == me.x && y == me.y)
return true;
if(arguments.length < 4)
retry = 3;
if(arguments.length < 5)
clearpath = false;
if(NTC_InTown())
_teleport = false;
else
_teleport = true;
if(NTC_GetSkillLevel(54) < 1 && !NTConfig_IsLeecher)
{
NTC_SendLogToOOG(NTC_LOG_COMMON, "ÿc8" + "Enigmabug - quit game");
ExitGame();
}
_path = GetPath(areaid, me.x, me.y, x, y, _teleport);
if(!_path)
return false;
for(i = 0 ; i < _path.length ; i++)
{
for(n = 0 ; n < 2 ; n++)
{
if(_teleport)
{
if(NTM_TeleportTo(_path[i][0]+Random(-n, n), _path[i][1]+Random(-n, n)))
break;
}
else
{
if(NTC_InTown()) {
if(NTM_WalkTo(_path[i][0], _path[i][1]))
break;
}
else if (!NTConfig_IsLeecher){
NTC_SendLogToOOG(NTC_LOG_COMMON, "ÿc8" + "Enigmabug - quit game");
ExitGame();
}
}
}
if(n < 2)
{
if(clearpath)
{
if(!NTA_ClearPosition(20, true, 2))
return false;
NTP_DoPrecast(false);
NTM_MoveTo(me.areaid, _path[i][0], _path[i][1], 1);
}
}
else if(_retry < retry)
{
_path = GetPath(areaid, me.x, me.y, x, y, _teleport);
if(!_path)
return false;
i = -1;
_retry++;
}
else
return false;
}
return true;
}
function NTM_MoveToPresetUnit(areaid, unittype, classid, offsetx, offsety, clearpath)
{
var i, n;
var _unit;
if(arguments.length < 4)
{
offsetx = 0;
offsety = 0;
}
if(arguments.length < 6)
clearpath = false;
for(i = 0 ; i <= 2 ; i++)
{
_unit = GetPresetUnits(areaid, unittype);
if(_unit)
{
for(n = 0 ; n < _unit.length ; n++)
{
if(_unit[n].id == classid)
return NTM_MoveTo(areaid, _unit[n].roomx*5+_unit[n].x+offsetx, _unit[n].roomy*5+_unit[n].y+offsety, 3, clearpath);
}
}
if(i < 2)
NTC_Delay(500);
}
return false;
}
function NTM_MoveToStair(areaid, subareaid, offsetx, offsety, clearpath)
{
var i, n;
var _unit;
if(arguments.length < 3)
{
offsetx = 0;
offsety = 0;
}
if(arguments.length < 5)
clearpath = false;
for(i = 0 ; i <= 2 ; i++)
{
_unit = GetPresetUnits(areaid, NTC_UNIT_TILE);
if(_unit)
{
for(n = 0 ; n < _unit.length ; n++)
{
if(_unit[n].subareaid == subareaid)
return NTM_MoveTo(areaid, _unit[n].roomx*5+_unit[n].x+offsetx, _unit[n].roomy*5+_unit[n].y+offsety, 3, clearpath);
}
}
if(i < 2)
NTC_Delay(500);
}
return false;
}
function NTM_TeleportTo(x, y)
{
NTC_CastSkill(54, NTC_HAND_RIGHT, x, y);
for(var i = 0 ; i < 15 ; i++)
{
if(Math.abs(me.x-x) < 4 && Math.abs(me.y-y) < 4)
return true;
NTC_Delay(NTC_DELAY_FRAME);
}
return false;
}
function NTM_WalkTo(x, y)
{
var i;
var _prex1, _prey1;
var _prex2, _prey2;
if(me.runwalk == 0)
me.runwalk = 1;
for(i = 0 ; i < 480 ; i++)
{
if((i % 10) == 0)
{
if((i % 60) == 0)
{
_prex1 = me.x;
_prey1 = me.y;
if((i % 120) == 0)
{
_prex2 = me.x;
_prey2 = me.y;
}
}
ClickMap(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, x, y);
}
NTC_Delay(NTC_DELAY_FRAME);
if(Math.abs(me.x-x) < 2 && Math.abs(me.y-y) < 2)
break;
if((i % 10) == 9)
{
ClickMap(NTC_CLICK_LUP, NTC_SHIFT_NONE, null);
NTC_Delay(NTC_DELAY_FRAME);
if((i % 60) == 59)
{
if(me.x == _prex1 && me.y == _prey1 && !NTC_InTown())
{
NTA_ClearPosition(2);
NTP_DoPrecast(false);
}
if((i % 120) == 119 && me.x == _prex2 && me.y == _prey2)
return false;
}
}
}
ClickMap(NTC_CLICK_LUP, NTC_SHIFT_NONE, null);
NTC_Delay(NTC_DELAY_FRAME);
return (i < 480);
}
function NTM_TakeUnit(unittype, classid)
{
var _unit;
var _prearea;
_unit = NTC_FindUnit(unittype, classid, 5);
if(!_unit)
return false;
_prearea = me.areaid;
for(var i = 0 ; i < 20 ; i++)
{
if((i % 5) == 0)
{
if(i == 10)
NTM_MoveTo(_prearea, me.x+6, me.y+6);
if(NTM_GetCloserInt(_unit))
NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _unit);
}
NTC_Delay(200);
if(me.areaid != _prearea)
break;
}
while(me.areaid == 0)
NTC_Delay(200);
if(me.areaid == _prearea)
return false;
NTC_PingDelay(NTConfig_AreaDelay);
return true;
}
function NTM_TakeStair(areaid)
{
var _unit;
var _prearea;
_unit = NTM_GetStairInt(areaid);
if(!_unit)
return false;
_prearea = me.areaid;
for(var i = 0 ; i < 20 ; i++)
{
if((i % 5) == 0)
{
if(i == 10)
NTM_MoveTo(_prearea, me.x+6, me.y+6);
if(NTM_GetCloserInt(_unit))
NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _unit);
}
NTC_Delay(200);
if(me.areaid != _prearea)
break;
}
while(me.areaid == 0)
NTC_Delay(200);
if(me.areaid == _prearea)
return false;
NTC_PingDelay(NTConfig_AreaDelay);
return true;
}
function NTM_TakeWaypoint(areaid)
{
var _unit;
if(me.areaid == areaid)
return true;
_unit = NTM_GetWaypointInt();
if(!_unit)
return false;
if(NTC_InTown())
me.Cancel(1);
for(var i = 0 ; i < 30 ; i++)
{
if((i % 10) == 0)
{
if(NTM_GetCloserInt(_unit))
NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _unit);
}
NTC_Delay(500);
if(GetUIState(0x14))
{
if(me.TakeWaypoint(areaid))
{
NTC_PingDelay(NTConfig_AreaDelay);
return true;
}
break;
}
}
return false;
}
function NTM_UsePortal(how, dest, ownername, portal)
{
if(me.areaid == dest)
return true;
if(NTC_InTown())
me.Cancel(1);
if(NTM_ChangeAreaInt(how, dest, ownername, portal))
{
NTC_PingDelay(NTConfig_AreaDelay);
return true;
}
return false;
}
function NTM_MakeTP(dest)
{
var _usetp = true;
var _portal;
var _portalname;
if(NTC_InTown())
return true;
if(arguments.length < 1)
_usetp = false;
if(!NTC_CastSkill(220, NTC_HAND_RIGHT))
return false;
NTC_PingDelay(500);
_portalname = GetLocaleString(3226);
for(var i = 0 ; i <= 2 ; i++)
{
_portal = NTC_FindUnit(NTC_UNIT_OBJECT, _portalname);
if(_portal)
{
do
{
if(_portal.mode == 2 && NTC_CheckOwner(_portal))
{
if(_usetp)
return NTM_UsePortal("BluePortal", dest, me.name, _portal);
return true;
}
} while(_portal.GetNext());
}
if(i < 2)
NTC_Delay(500);
}
return false;
}
// Internal function
function NTM_GetStairInt(areaid)
{
var _tile;
for(var i = 0 ; i <= 2 ; i++)
{
_tile = NTC_FindUnit(NTC_UNIT_TILE);
if(_tile)
{
do
{
if(!areaid || _tile.subareaid == areaid)
return _tile;
} while(_tile.GetNext());
}
if(i < 2)
NTC_Delay(500);
}
return null;
}
function NTM_GetWaypointInt()
{
var _waypoint;
var _classid;
for(var i = 0 ; i <= 2 ; i++)
{
_waypoint = NTC_FindUnit(NTC_UNIT_OBJECT);
if(_waypoint)
{
do
{
_classid = _waypoint.classid;
if(_classid == 119 || _classid == 145 || _classid == 156 || _classid == 157
|| _classid == 237 || _classid == 238 || _classid == 288 || _classid == 323
|| _classid == 324 || _classid == 398 || _classid == 402 || _classid == 429
|| _classid == 494 || _classid == 496 || _classid == 511 || _classid == 539)
return _waypoint;
} while(_waypoint.GetNext());
}
if(i < 2)
NTC_Delay(500);
}
return null;
}
function NTM_ChangeAreaInt(how, dest, ownername, myportal)
{
var _portal;
var _playerportal = false;
var _prearea;
if(how == "BluePortal")
{
if(!ownername)
ownername = me.name;
_playerportal = true;
}
if(arguments.length > 3 && myportal)
_portal = myportal;
else
{
_portal = NTM_FindCorrectPortalInt(_playerportal, ownername);
if(_portal < 0)
_portal = NTM_FindPortalAreaInt(dest);
if(_portal == -1)
return false;
}
if(!_portal)
return false;
_prearea = me.areaid;
for(var i = 0 ; i < 20 ; i++)
{
if((i % 5) == 0)
{
if(i == 10)
NTM_MoveTo(_prearea, me.x+6, me.y+6);
if(NTM_GetCloserInt(_portal))
NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _portal);
}
NTC_Delay(200);
if(me.areaid != _prearea)
break;
}
while(me.areaid == 0)
NTC_Delay(200);
return (me.areaid == dest);
}
function NTM_FindCorrectPortalInt(blueportal, ownername)
{
var _portal;
var _portalname;
_portalname = GetLocaleString(3226);
if(blueportal)
{
for(var i = 0 ; i <= 2 ; i++)
{
_portal = NTC_FindUnit(NTC_UNIT_OBJECT, _portalname);
if(_portal)
{
do
{
if(_portal.mode == 2 && NTC_CheckOwner(_portal, ownername) && GetDistance(me, _portal) <= 30)
return _portal;
} while(_portal.GetNext());
}
if(i < 2)
NTC_Delay(500);
}
return -2;
}
else
{
for(var i = 0 ; i <= 2 ; i++)
{
_portal = NTC_FindUnit(NTC_UNIT_OBJECT, _portalname);
if(_portal)
{
do
{
if(_portal.mode == 2 && !_portal.GetParent())
return _portal;
} while(_portal.GetNext());
}
if(i < 2)
NTC_Delay(500);
}
}
return -3;
}
function NTM_FindPortalAreaInt(dest)
{
var _portal;
var _portalname;
_portalname = GetLocaleString(3226);
for(var i = 0 ; i <= 2 ; i++)
{
_portal = NTC_FindUnit(NTC_UNIT_OBJECT, _portalname);
if(_portal)
{
do
{
if(_portal.mode == 2 && _portal.subareaid == dest)
{
if(_portal.GetParent())
{
if(NTC_CheckOwner(_portal) || NTC_InMyParty(_portal.GetParent()))
return _portal;
}
else
return _portal;
}
} while(_portal.GetNext());
}
if(i < 2)
NTC_Delay(500);
}
return -1;
}
function NTM_GetCloserInt(unit)
{
if(GetDistance(me, unit) > 2)
return NTM_MoveTo(unit.areaid, unit.x, unit.y);
return true;
}
// vector class
function vector()
{
if(arguments.length == 2)
{
this.x = arguments[0];
this.y = arguments[1];
}
else if(arguments.length == 1)
{
this.x = arguments[0].x;
this.y = arguments[0].y;
}
else
{
this.x = 0;
this.y = 0;
}
this.rotate = vector_rotate;
this.normalize = vector_normalize;
this.length = vector_length;
this.setlength = vector_setlength;
this.toString = vector_toString;
this.set = vector_set;
this.angle = vector_angle;
}
function vector_rotate(degree)
{
if(!degree)
return true;
l = this.length();
if(!l)
return false;
this.normalize();
rad = degree * (Math.PI/180);
nx = this.x * Math.cos(rad) - this.y * Math.sin(rad);
ny = this.x * Math.sin(rad) + this.y * Math.cos(rad);
this.x = nx;
this.y = ny;
this.normalize();
if(l != 1)
this.setlength(l);
return true;
}
function vector_angle(v)
{
rad_degree = 180 / Math.PI;
return Math.acos((this.x*v.x) + (this.y*v.y)) * rad_degree;
}
function vector_length()
{
return Math.sqrt((this.x*this.x) + (this.y*this.y));
}
function vector_setlength(length)
{
this.normalize();
this.x *= length;
this.y *= length;
}
function vector_normalize()
{
l = this.length();
if(!l)
return false;
this.x /= l;
this.y /= l;
return true;
}
function vector_toString()
{
str = "(";
str += Math.round(this.x*1000)/1000;
str += " , ";
str += Math.round(this.y*1000)/1000;
str += ") : ";
str += Math.round(this.length()*1000)/1000;
return str;
}
function vector_set(tx, ty)
{
if(arguments.length == 1)
{
this.x = tx.x;
this.y = tx.y;
}
else if(arguments.length == 2)
{
this.x = tx;
this.y = ty;
}
}
// coord class
function coord()
{
this.data = null;
if(arguments.length == 3)
{
this.x = arguments[0];
this.y = arguments[1];
this.data = arguments[2];
}
else if(arguments.length == 2)
{
this.x = arguments[0];
this.y = arguments[1];
}
else if(arguments.length == 1)
{
this.x = arguments[0].x;
this.y = arguments[0].y;
}
else
{
this.x = 0;
this.y = 0;
}
this.dist = coord_dist;
this.dist2 = coord_dist2;
this.dir = coord_dir;
this.move = coord_move;
this.set = coord_set;
this.toString = coord_toString;
}
function coord_set(tx, ty, d)
{
if(arguments.length == 1)
{
this.x = tx.x;
this.y = tx.y;
if(tx.data)
this.data = tx.data;
else
this.data = null;
}
else if(arguments.length == 2)
{
this.x = tx;
this.y = ty;
this.data = null;
}
else if(arguments.length == 3)
{
this.x = tx;
this.y = ty;
this.data = d;
}
}
function coord_dist(tx, ty)
{
if(arguments.length == 1)
{
vx = this.x - tx.x;
vy = this.y - tx.y;
return Math.round(Math.sqrt((vx*vx) + (vy*vy)));
}
else if(arguments.length == 2)
{
vx = this.x - tx;
vy = this.y - ty;
return Math.round(Math.sqrt((vx*vx) + (vy*vy)));
}
}
function coord_dist2(tx, ty)
{
if(arguments.length == 1)
{
vx = this.x - tx.x;
vy = this.y - tx.y;
return Math.floor((vx*vx) + (vy*vy));
}
else if(arguments.length == 2)
{
vx = this.x - tx;
vy = this.y - ty;
return Math.floor((vx*vx) + (vy*vy));
}
}
function coord_dir(tx, ty)
{
if(arguments.length == 1)
{
v = new vector(tx.x-this.x, tx.y-this.y);
v.normalize();
return v;
}
else if(arguments.length == 2)
{
v = new vector(tx-this.x, ty-this.y);
v.normalize();
return v;
}
}
function coord_move(vec, d)
{
if(d)
{
this.x += Math.round(vec.x*d);
this.y += Math.round(vec.y*d);
return true;
}
else if(vec.length())
{
this.x += Math.round(vec.x);
this.y += Math.round(vec.y);
return true;
}
return false;
}
function coord_toString()
{
return "( " + this.x + " , " + this.y + " ) " + this.data;
}
das mit dem Enitelepot bug ausschalten ist von Hadin84`s [Only registered and activated users can see links. Click Here To Register...]
habe es nur in die ShopBot Char datei mit eingefügt.
Und zu guter letzt noch der GatewaySwitcher
[Only registered and activated users can see links. Click Here To Register...]