Register for your free account! | Forgot your password?

Go Back   elitepvpers > Other Online Games > Diablo 2 > Diablo 2 Programming
You last visited: Today at 22:19

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



NTA_ClearPosition() bei D2NT

Discussion on NTA_ClearPosition() bei D2NT within the Diablo 2 Programming forum part of the Diablo 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2010
Posts: 152
Received Thanks: 23
NTA_ClearPosition() bei D2NT

Ich hab mir mal die Funktion angeschaut, denn mir ist aufgefallen, dass mein Hammer zwischen Kills immer wieder auf dieselbe Position telt.
In der Funktion selbst sehe ich nichts, was dafür Grund sein könnte...
Aber eigentlich sollte es auch ohne diese Teleports klappen.
Hat einer ne Ahnung woran das liegt?

Hier mal der Code:
Code:
function NTA_ClearPosition(range, pickitem, safelevel, openchests, usefinditem, spectype)
{
	var _orgx, _orgy;
	var _spectype = [0x0A, 0x0E, 0x01];
	var _skiplist;
	var _attackcount = 0;
	var _target;
	var _distance, _mingid, _mindistance;
	var _mingidPrio, _mindistPrio;
	var _result;
	var _outputType;

	if(NTConfig_AttackSkill[1] < 1 || NTConfig_AttackSkill[3] < 1)
		return false;

	switch(arguments.length)
	{
		case 0:
			range = 20;
		case 1:
			pickitem = false;
		case 2:
			safelevel = 2;
		case 3:
			if(NTConfig_CheckSelfSafe < 0x01 && NTConfig_CheckMercSafe < 0x01)
				safelevel = 0;
			openchests = true;
		case 4: 
			usefinditem = true;
		case 5:
			break;
		default:
			if(spectype > 0x01)
				_spectype = [spectype];
	}
	
	if(_spectype.length == 3 && (me.classid == NTC_CHAR_CLASS_NECROMANCER || me.classid == NTC_CHAR_CLASS_SORCERESS && MWConfig_KeepDistanceToMonsters))
		_spectype = [0x01];

	_orgx = me.x;
	_orgy = me.y;

	for(var i = 0; i < _spectype.length; i++)
	{
		_skiplist = new Array();

		while(_attackcount < (i+1)*100)
		{
			_mindistance = 1E6;
			_mindistPrio = 1E6;

			_target = NTC_FindUnit(NTC_UNIT_MONSTER);

			if(_target)
			{
				do
				{
					if(_skiplist.indexOf(_target.gid) < 0)
					{
						if(_target.IsAttackable() && (_target.spectype & _spectype[i]))
						{
							if(GetDistance(_orgx, _orgy, _target.x, _target.y) <= range && NTA_IsValidMonster(_target))
							{
								_distance = GetDistance(me, _target);

								if(_distance < _mindistance)
								{
									_mingid = _target.gid;
									_mindistance = _distance;
								}
								
								if(MWA_IsPriorityTarget(_target))
								{
									if(_distance < _mindistPrio)
									{
										_mingidPrio = _target.gid;
										_mindistPrio = _distance;
									}
								}
							}
						}
						else
							_skiplist.push(_target.gid);
					}
				} while(_target.GetNext());
			}

			if(_mindistance < 1E6)
			{
				if(_mindistPrio < 1E6)
				{
					_target = NTC_FindUnit(NTC_UNIT_MONSTER, _mingidPrio, 1);
					_outputType = 1;
				}
				else
				{				
					_target = NTC_FindUnit(NTC_UNIT_MONSTER, _mingid, 1);
					_outputType = 0;
				}

				if(_target)
				{
					if(MWConfig_ShowOverheadStatus)
						MWA_PrintAttackStatus(_outputType, _target);

					_result = NTA_Attack(_target, (_attackcount % 30) == 0);
					
					if(MWConfig_ShowOverheadStatus)
						MWA_PrintAttackStatus(_outputType, _target);

					switch(_result)
					{
					case 1:
						_skiplist.push(_mingid);
						break;
					case 2:
					case 3:
						if(MWConfig_PickItemsInstantly && (_target.hp <= 0 || _target.mode == 0 || _target.mode == 12))
							NTSI_PickItems();
						_attackcount++;
						break;
					default:
						return false;
					}
				}
			}
			else
				break;
		}
	}

	if(_attackcount > 2)
	{
		switch(me.classid)
		{
			case NTC_CHAR_CLASS_PALADIN:
				if(parseInt(me.hp * 100 / me.hpmax) < NTConfig_UseRedemptionHP || parseInt(me.mp * 100 / me.mpmax) < NTConfig_UseRedemptionMP)
				{
					if(NTC_PutSkill(MWS_REDEMPTION, NTC_HAND_RIGHT))
						NTC_PingDelay(1000);
				}
				break;
			case NTC_CHAR_CLASS_BARBARIAN:
				if(usefinditem && MWConfig_UseFindItem)
					MWL_FindItem(MWConfig_FindItemRange);
				break;
			case NTC_CHAR_CLASS_NECROMANCER:
				MWA_RaiseMinions();
				break;
		}
	}
	
	if(pickitem && _attackcount > 0)
		NTSI_PickItems();

	if(MWConfig_OpenAllNearbyChests && openchests)
		MWL_OpenNearbyChests(MWConfig_OpenChestsRange);
	
	if(MWConfig_ActivateNearbyShrines)
		MWL_ActivateNearbyShrines();

	switch(safelevel)
	{
		case 1:
			return NTTMGR_CheckSafe(0x00, NTConfig_CheckMercSafe&0x01);
		case 2:
			return NTTMGR_CheckSafe(NTConfig_CheckSelfSafe, NTConfig_CheckMercSafe);
	}

	if(MWConfig_IdentAfterPickup)
		MWL_IDItemsAfterPickup();

	return true;
}
tonk1 is offline  
Old 12/19/2011, 12:17   #2
Administrator
 
Muddy Waters's Avatar
 
elite*gold: 41624
Join Date: Jan 2010
Posts: 22,728
Received Thanks: 12,654
Das wird vermutlich nicht an der Funktion liegen, sondern an der Funktion NTM_MoveTo(), wobei eigentlich wieder an der Core Funktion zur Pfadberechnung.

Ich meine D2NT hat dort keinen Workaround für in der Nähe befindliche Positionen eingebaut. Wenn du mir mal deine NTM_MoveTo() Funktion zeigst, kann ich dir genau sagen, was ich meine.

LG
Muddy
Muddy Waters is offline  
Reply


Similar Threads Similar Threads
NTA_ClearPosition() range?
12/13/2013 - Diablo 2 Programming - 5 Replies
Hi, ich hatte mich gefragt, wie die range bei NTA_ClearPosition() funktioniert. NTA_ClearPosition(20): wofür steht die 20? Wie kann ich sehen, welcher Bereich mit NTA_ClearPosition() abgedeckt ist? Wie kann ich mir das vorstellen, wenn ich an nem Quelltext sitze?
Muddy's D2NT mit 1.13d D2NT.dll + Neuer D2NT Etal
01/06/2012 - Diablo 2 - 474 Replies
Damit hier mal langsam Ruhe einkehrt lade ich jetzt den Muddy's D"NT mit der D2NT.dll für 1.13d hoch. Die Grundlage ist die Rev3 vom Bot. Hier ist ganz klar zu sagen, dass der Dank für den Bot an Muddy_Waters geht Das hier ist kein Fragethread. Ich habe selber keine Ahnung wie mögliche Bugs, die von der neuen dll kommen gefixt werden können. Wenn ihr Bugs entdeckt und diese fixxen könnt dürft ihr gerne das ganze posten. So kann man schnell für Probleme Lösungen finden. Bei anderen...
D2nt (3.1) mit mudys d2nt.dll hdin macht baaluns nicht fertig
11/10/2011 - Diablo 2 - 12 Replies
wie im topic beschrieben seitdem ich die neue dll verwende(n muss) macht mein hdin beim baalrun nachdem er lister der Quäler besiegt hat einfach das spiel zu und d2nt startet neu meine soso macht den ganz normal fertig und killt auch baal? jemand anderes auch so ein problm und ggf ne Lösung?
D2NT Muddys d2nt problem x,x
11/06/2011 - Diablo 2 - 1 Replies
hi leute habe muddys d2nt schon ca seid 3 tagen mir wurde gesagt ich soll mir ihre FAQ etc... durchlesen habe ich bion nicht schlauer geworden habe alles eingestellt nur wenn der bot game aufmacht kommt ingame lagg und er macht nix? wenn bot auf pause ist gibts kein lagg ??
d2nt leech bot einstellen... d2nt config error..
07/09/2010 - Diablo 2 Programming - 2 Replies
hey mein bot zeigt mir die ganze zeit ein error und habe die einstellungen in der anleitung genauso... was tun? habe leader acc/ char name eingetragen. beide flistet. die eine datei aus baalleech rausgeholt und umbenannt und die // weg genommen habe beim manager auch auf d2nt leech eingestelln



All times are GMT +1. The time now is 22:19.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.