This commit is contained in:
Bouletmarc 2024-04-25 01:47:05 -04:00
parent 2515966e3d
commit d3d7e72f78
18 changed files with 137 additions and 87 deletions

View File

@ -42,7 +42,7 @@ namespace app
public partial class Form1 : Form
{
public string BotVersion = "V2.57";
public string BotVersion = "V2.6";
public string D2_LOD_113C_Path = "";
@ -943,6 +943,8 @@ namespace app
//Battle_0.CastSkills();
//ItemsStruc_0.GetItems(true);
//if (Running) LoopTimer.Start();
//ItemsStruc_0.GetItems(false);
//InventoryStruc_0.DumpBadItemsOnGround();
//return;
if (CharConfig.RunMapHackOnly)

View File

@ -423,6 +423,8 @@ namespace app
}
else
{
Form1_0.MobsStruc_0.xPosFinal = 0;
Form1_0.MobsStruc_0.yPosFinal = 0;
if (CharConfig.RunBaalScript && !Form1_0.Baal_0.ScriptDone && Form1_0.Baal_0.Wave5Detected) Form1_0.Baal_0.Wave5Cleared = true;
TriedToMoveToMobsCount = 0;
DoingBattle = false;
@ -472,6 +474,8 @@ namespace app
return true;
}
Form1_0.MobsStruc_0.xPosFinal = 0;
Form1_0.MobsStruc_0.yPosFinal = 0;
if (CharConfig.RunBaalScript && !Form1_0.Baal_0.ScriptDone && Form1_0.Baal_0.Wave5Detected) Form1_0.Baal_0.Wave5Cleared = true;
TriedToMoveToMobsCount = 0;
DoingBattle = false;
@ -519,6 +523,8 @@ namespace app
}
else
{
Form1_0.MobsStruc_0.xPosFinal = 0;
Form1_0.MobsStruc_0.yPosFinal = 0;
if (CharConfig.RunBaalScript && !Form1_0.Baal_0.ScriptDone && Form1_0.Baal_0.Wave5Detected) Form1_0.Baal_0.Wave5Cleared = true;
TriedToMoveToMobsCount = 0;
DoingBattle = false;

View File

@ -72,7 +72,7 @@ namespace app
//fix town act5 stuck near bolder
if (Form1_0.Town_0.GetInTown() && IsPositionNearOf(5093, 5034, 2))
{
MoveToLocationAttack(5096, 5024);
MoveToLocationAttack(5098, 5022);
}
int TryMove = 0;

View File

@ -14,11 +14,11 @@
//#######################################
KeySkillAttack=F1
KeySkillAura=F2
KeySkillfastMoveAtTown=F9
KeySkillfastMoveAtTown=F8
KeySkillfastMoveOutsideTown=F7
KeySkillDefenseAura=F7
KeySkillDefenseAura=F6
KeySkillCastDefense=F5
KeySkillLifeAura=F4
KeySkillLifeAura=F3
PlayerAttackWithRightHand=false
@ -32,10 +32,10 @@ BeltPotTypeToHave=0,0,1,3
//#######################################
InventoryDontCheckItem=
{
0,0,0,0,0,0,0,1,1,1,
0,0,0,0,0,0,0,1,1,1,
0,0,0,0,0,0,0,1,1,1,
0,0,0,0,0,0,0,1,1,1
0,0,0,0,1,1,1,1,1,1,
0,0,0,0,1,1,1,1,1,1,
0,0,0,0,1,1,1,1,1,1,
0,0,0,0,1,1,1,1,1,1
}
//#######################################
@ -66,5 +66,5 @@ GambleGold=true
//#######################################
//MERC SETTINGS
//#######################################
UsingMerc=false
UsingMerc=true
MercTakeHPPotUnder=40

View File

@ -979,7 +979,7 @@ Perfect Diamond
[Name] == SmallCharm && [Quality] == magic && [ManaMax] >= 17
//[Name] == SmallCharm && [Quality] == magic && [FasterHitRecovery] >= 5
[Name] == SmallCharm && [Quality] == magic && [LifeMax]+[ManaMax] >= 20
[Name] == SmallCharm && [Quality] == magic && [PoisonMindamage] >= 100
[Name] == SmallCharm && [Quality] == magic && [PoisonMinDamage] >= 100
[Name] == SmallCharm && [Quality] == magic && [FireResist] >= 5
[Name] == SmallCharm && [Quality] == magic && [LightningResist] >= 5

View File

@ -228,6 +228,7 @@ namespace app
//place all bad items on ground
for (int i = 0; i < 40; i++)
{
//Console.WriteLine("toID: " + InventoryHasItemToID[i] + ", tostash: " + InventoryHasStashItem[i]);
Form1_0.UIScan_0.OpenUIMenu("invMenu");
if (CharConfig.InventoryDontCheckItem[i] == 0 && InventoryHasItem[i] >= 1 && InventoryHasItemToID[i] == 0 && InventoryHasStashItem[i] == 0)
{

View File

@ -80,6 +80,8 @@ namespace app
{
return true;
}
break;
}
}
@ -89,45 +91,49 @@ namespace app
if (ItemName == Regex.Replace(ThisDir.Key, @"[\d-]", string.Empty) && ThisDir.Value)
{
bool SameQuality = true;
bool SameFlags = true;
if (PickItemsNormal_ByName_Quality.ContainsKey(ThisDir.Key))
{
if (Form1_0.ItemsStruc_0.quality != Form1_0.ItemsStruc_0.getQuality(PickItemsNormal_ByName_Quality[ThisDir.Key])) SameQuality = false;
}
if (!Form1_0.ItemsStruc_0.identified)
if (PickItemsNormal_ByName_Flags.ContainsKey(ThisDir.Key))
{
if (!Keeping && SameQuality) return true;
uint TotalFlags = 0;
foreach (var ThisList in PickItemsNormal_ByName_Flags[ThisDir.Key])
{
TotalFlags += ThisList.Key;
}
foreach (var ThisList in PickItemsNormal_ByName_Flags[ThisDir.Key])
{
SameFlags = Form1_0.ItemsFlags_0.IsItemSameFlags(ThisList.Value, TotalFlags, Form1_0.ItemsStruc_0.flags);
}
//Console.WriteLine(Form1_0.ItemsStruc_0.ItemNAAME + ":" + SameFlags);
}
else
if (SameQuality && SameFlags)
{
bool SameFlags = true;
bool SameStats = true;
if (PickItemsNormal_ByName_Flags.ContainsKey(ThisDir.Key))
if (!Form1_0.ItemsStruc_0.identified)
{
uint TotalFlags = 0;
foreach (var ThisList in PickItemsNormal_ByName_Flags[ThisDir.Key])
{
TotalFlags += ThisList.Key;
}
foreach (var ThisList in PickItemsNormal_ByName_Flags[ThisDir.Key])
{
SameStats = Form1_0.ItemsFlags_0.IsItemSameFlags(ThisList.Value, TotalFlags, Form1_0.ItemsStruc_0.flags);
}
//Console.WriteLine(Form1_0.ItemsStruc_0.ItemNAAME + ":" + SameFlags);
if (!Keeping) return true;
}
if (PickItemsNormal_ByName_Stats.ContainsKey(ThisDir.Key))
else
{
foreach (var ThisDir2 in PickItemsNormal_ByName_Stats[ThisDir.Key])
bool SameStats = true;
if (PickItemsNormal_ByName_Stats.ContainsKey(ThisDir.Key))
{
//Console.WriteLine(Form1_0.ItemsStruc_0.ItemNAAME + ":" + ThisDir2.Key + "=" + ThisDir2.Value);
if (!Form1_0.ItemsStruc_0.IsItemHaveSameStatMultiCheck(ThisDir2.Key, ThisDir2.Value, PickItemsNormal_ByName_Operators[ThisDir.Key][ThisDir2.Key])) SameStats = false;
foreach (var ThisDir2 in PickItemsNormal_ByName_Stats[ThisDir.Key])
{
//Console.WriteLine(Form1_0.ItemsStruc_0.ItemNAAME + ":" + ThisDir2.Key + "=" + ThisDir2.Value);
if (!Form1_0.ItemsStruc_0.IsItemHaveSameStatMultiCheck(ThisDir2.Key, ThisDir2.Value, PickItemsNormal_ByName_Operators[ThisDir.Key][ThisDir2.Key])) SameStats = false;
}
}
}
//Console.WriteLine("---------------------");
//Console.WriteLine("---------------------");
if (SameFlags && SameQuality && SameStats) return true;
if (SameStats) return true;
}
}
//break;
}
}
//###############
@ -136,43 +142,47 @@ namespace app
if (IsItemThisType(Regex.Replace(ThisDir.Key, @"[\d-]", string.Empty)) && ThisDir.Value)
{
bool SameQuality = true;
bool SameFlags = true;
if (PickItemsNormal_ByType_Quality.ContainsKey(ThisDir.Key))
{
if (Form1_0.ItemsStruc_0.quality != Form1_0.ItemsStruc_0.getQuality(PickItemsNormal_ByType_Quality[ThisDir.Key])) SameQuality = false;
}
if (!Form1_0.ItemsStruc_0.identified)
if (PickItemsNormal_ByType_Flags.ContainsKey(ThisDir.Key))
{
if (!Keeping && SameQuality) return true;
uint TotalFlags = 0;
foreach (var ThisList in PickItemsNormal_ByType_Flags[ThisDir.Key])
{
TotalFlags += ThisList.Key;
}
foreach (var ThisList in PickItemsNormal_ByType_Flags[ThisDir.Key])
{
SameFlags = Form1_0.ItemsFlags_0.IsItemSameFlags(ThisList.Value, TotalFlags, Form1_0.ItemsStruc_0.flags);
}
//Console.WriteLine(Form1_0.ItemsStruc_0.ItemNAAME + ":" + SameFlags);
}
else
if (SameQuality && SameFlags)
{
bool SameFlags = true;
bool SameStats = true;
if (PickItemsNormal_ByType_Flags.ContainsKey(ThisDir.Key))
if (!Form1_0.ItemsStruc_0.identified)
{
uint TotalFlags = 0;
foreach (var ThisList in PickItemsNormal_ByType_Flags[ThisDir.Key])
{
TotalFlags += ThisList.Key;
}
foreach (var ThisList in PickItemsNormal_ByType_Flags[ThisDir.Key])
{
SameStats = Form1_0.ItemsFlags_0.IsItemSameFlags(ThisList.Value, TotalFlags, Form1_0.ItemsStruc_0.flags);
}
//Console.WriteLine(Form1_0.ItemsStruc_0.ItemNAAME + ":" + SameFlags);
if (!Keeping) return true;
}
if (PickItemsNormal_ByType_Stats.ContainsKey(ThisDir.Key))
else
{
foreach (var ThisDir2 in PickItemsNormal_ByType_Stats[ThisDir.Key])
bool SameStats = true;
if (PickItemsNormal_ByType_Stats.ContainsKey(ThisDir.Key))
{
if (!Form1_0.ItemsStruc_0.IsItemHaveSameStatMultiCheck(ThisDir2.Key, ThisDir2.Value, PickItemsNormal_ByType_Operators[ThisDir.Key][ThisDir2.Key])) SameStats = false;
foreach (var ThisDir2 in PickItemsNormal_ByType_Stats[ThisDir.Key])
{
if (!Form1_0.ItemsStruc_0.IsItemHaveSameStatMultiCheck(ThisDir2.Key, ThisDir2.Value, PickItemsNormal_ByType_Operators[ThisDir.Key][ThisDir2.Key])) SameStats = false;
}
}
}
if (SameFlags && SameQuality && SameStats) return true;
if (SameStats) return true;
}
}
//break;
}
}
//###############

View File

@ -9,6 +9,7 @@ using System.Runtime.InteropServices;
using System.Runtime.Remoting.Metadata.W3cXsd2001;
using System.Security.Policy;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
@ -80,9 +81,10 @@ namespace app
public List<long> BadItemsOnCursorIDList = new List<long>();
public bool HasGotTheBadItemOnCursor = false;
public List<long> BadItemsOnGroundPointerList = new List<long>();
public List<long> AvoidItemsOnGroundPointerList = new List<long>();
public void SetForm1(Form1 Form1_1)
{
Form1_0 = Form1_1;
@ -401,6 +403,8 @@ namespace app
GetUnitPathData();
GetStatsAddr();
if (IsIncludedInList(AvoidItemsOnGroundPointerList, ItemPointerLocation)) continue;
//Form1_0.method_1("ItemType: " + BitConverter.ToUInt32(itemdatastruc, 0).ToString() + ", TxtFileNo: " + BitConverter.ToUInt32(itemdatastruc, 4).ToString() + ", Name: " + ItemNAAME + ", Location: " + GetItemLocation(itemdatastruc[0x0C]));
//; itemLoc - 0 in inventory, 1 equipped, 2 in belt, 3 on ground, 4 cursor, 5 dropping, 6 socketed
@ -653,6 +657,13 @@ namespace app
return true;
}
}
else
{
if (!IsItemPickingPotion() && !IsIncludedInList(AvoidItemsOnGroundPointerList, ItemPointerLocation))
{
AvoidItemsOnGroundPointerList.Add(ItemPointerLocation);
}
}
}
}
}
@ -662,6 +673,27 @@ namespace app
return false;
}
public bool IsItemPickingPotion()
{
bool IsItemPickingPotion = false;
string ThisItemName = Form1_0.ItemsStruc_0.ItemNAAME.Replace(" ", "");
foreach (var ThisDir in Form1_0.ItemsAlert_0.PickItemsPotions)
{
if (ThisItemName == Regex.Replace(ThisDir.Key.Replace(" ", ""), @"[\d-]", string.Empty) && ThisDir.Value)
{
if (ThisItemName.Contains("Healing")) IsItemPickingPotion = true;
if (ThisItemName.Contains("Mana")) IsItemPickingPotion = true;
if (ThisItemName.Contains("Rejuvenation")) IsItemPickingPotion = true;
if (ThisItemName.Contains("FullRejuvenation")) IsItemPickingPotion = true;
if (IsItemPickingPotion) break;
}
}
return IsItemPickingPotion;
}
public bool IsIncludedInList(List<long> IgnoredIDList, long ThisID)
{
if (IgnoredIDList != null)

View File

@ -11,6 +11,7 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using static app.Enums;
using static app.MapAreaStruc;
using System.Text.RegularExpressions;
namespace app
{
@ -95,8 +96,7 @@ namespace app
}
if (AllMapData[i].Objects[k].Type == "npc" && ObjectType == "npc")
{
//if (((EnumsMobsNPC.MonsterType)(int.Parse(AllMapData[i].Objects[k].ID))).ToString().Contains(ObjectName))
if (((EnumsMobsNPC.MonsterType)(int.Parse(AllMapData[i].Objects[k].ID))).ToString() == ObjectName)
if (Regex.Replace(((EnumsMobsNPC.MonsterType)(int.Parse(AllMapData[i].Objects[k].ID))).ToString(), @"[\d-]", string.Empty) == ObjectName)
{
ThisPos.X = AllMapData[i].Offset.X + AllMapData[i].Objects[k].X;
ThisPos.Y = AllMapData[i].Offset.Y + AllMapData[i].Objects[k].Y;
@ -191,9 +191,8 @@ namespace app
}
if (AllMapData[i].Objects[k].Type == "npc" && ObjectType == "npc")
{
//Console.WriteLine("NPC: " + Form1_0.NPCStruc_0.getNPC_ID(int.Parse(AllMapData[i].Objects[k].ID)));
//if ((((EnumsMobsNPC.MonsterType)(int.Parse(AllMapData[i].Objects[k].ID))).ToString().Contains(ObjectName) && !IgnoreName)
if ((((EnumsMobsNPC.MonsterType)(int.Parse(AllMapData[i].Objects[k].ID))).ToString() == ObjectName && !IgnoreName)
//Console.WriteLine("NPC: " + ((EnumsMobsNPC.MonsterType)(int.Parse(AllMapData[i].Objects[k].ID))).ToString());
if ((Regex.Replace(((EnumsMobsNPC.MonsterType)(int.Parse(AllMapData[i].Objects[k].ID))).ToString(), @"[\d-]", string.Empty) == ObjectName && !IgnoreName)
|| IgnoreName)
{
ThisPos.X = AllMapData[i].Offset.X + AllMapData[i].Objects[k].X;
@ -302,9 +301,7 @@ namespace app
}
if (AllMapData[i].Objects[k].Type == "npc" && ObjectType == "npc")
{
//Console.WriteLine("NPC: " + Form1_0.NPCStruc_0.getNPC_ID(int.Parse(AllMapData[i].Objects[k].ID)));
//if ((((EnumsMobsNPC.MonsterType)(int.Parse(AllMapData[i].Objects[k].ID))).ToString().Contains(ObjectName) && !IgnoreName)
if ((((EnumsMobsNPC.MonsterType)(int.Parse(AllMapData[i].Objects[k].ID))).ToString() == ObjectName && !IgnoreName)
if ((Regex.Replace(((EnumsMobsNPC.MonsterType)(int.Parse(AllMapData[i].Objects[k].ID))).ToString(), @"[\d-]", string.Empty) == ObjectName && !IgnoreName)
|| IgnoreName)
{
ThisPos.Add(new Position { X = AllMapData[i].Offset.X + AllMapData[i].Objects[k].X, Y = AllMapData[i].Offset.Y + AllMapData[i].Objects[k].Y });

View File

@ -33,6 +33,8 @@ namespace app
public uint statCountAll = 0;
public long statPtrAll = 0;
public byte[] statBufferAll = new byte[] { };
public byte[] pPathAll = new byte[144];
public long pPathPtrAll = 0;
public uint statCount = 0;
//public uint statExCount = 0;
@ -285,15 +287,15 @@ namespace app
//pPathPtr = BitConverter.ToInt64(mobsdatastruc, 0x38);
CurrentPointerBytes = new byte[8];
Form1_0.Mem_0.ReadRawMemory(MobsPointerLocation + 0x38, ref CurrentPointerBytes, CurrentPointerBytes.Length);
pPathPtr = BitConverter.ToInt64(CurrentPointerBytes, 0);
pPathPtrAll = BitConverter.ToInt64(CurrentPointerBytes, 0);
//pPath = new byte[144];
pPath = new byte[0x08];
Form1_0.Mem_0.ReadRawMemory(pPathPtr, ref pPath, pPath.Length);
pPathAll = new byte[0x08];
Form1_0.Mem_0.ReadRawMemory(pPathPtrAll, ref pPathAll, pPathAll.Length);
ushort itemx2 = BitConverter.ToUInt16(pPath, 0x02);
ushort itemy2 = BitConverter.ToUInt16(pPath, 0x06);
ushort xPosOffset = BitConverter.ToUInt16(pPath, 0x00);
ushort yPosOffset = BitConverter.ToUInt16(pPath, 0x04);
ushort itemx2 = BitConverter.ToUInt16(pPathAll, 0x02);
ushort itemy2 = BitConverter.ToUInt16(pPathAll, 0x06);
ushort xPosOffset = BitConverter.ToUInt16(pPathAll, 0x00);
ushort yPosOffset = BitConverter.ToUInt16(pPathAll, 0x04);
int xPosOffsetPercent = (xPosOffset / 65536); //get percentage
int yPosOffsetPercent = (yPosOffset / 65536); //get percentage
xPosFinalAll = (ushort)(itemx2 + xPosOffsetPercent);

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static app.EnumsMobsNPC;
using static System.Diagnostics.DebuggableAttribute;
@ -114,9 +115,7 @@ namespace app
GetUnitPathData();
//Console.WriteLine((int)txtFileNo + " at: " + xPosFinal + ", " + yPosFinal);
//if (((EnumsMobsNPC.MonsterType)((int)txtFileNo)).ToString().ToLower().Contains(MobName.ToLower()))
if (((EnumsMobsNPC.MonsterType)((int)txtFileNo)).ToString() == MobName)
if (Regex.Replace(((EnumsMobsNPC.MonsterType)((int)txtFileNo)).ToString(), @"[\d-]", string.Empty) == MobName)
{
if (xPosFinal != 0 && yPosFinal != 0)
{

View File

@ -33,6 +33,7 @@ namespace app
public long StartIndexItem = long.MaxValue;
public long StartIndexItemLast = long.MaxValue;
public int ScanUnitsNumber = 2600;
//public int ScanUnitsNumber = 2048;
public int ScanUnitsNegativeOffset = 0;

View File

@ -14,11 +14,11 @@
//#######################################
KeySkillAttack=F1
KeySkillAura=F2
KeySkillfastMoveAtTown=F9
KeySkillfastMoveAtTown=F8
KeySkillfastMoveOutsideTown=F7
KeySkillDefenseAura=F7
KeySkillDefenseAura=F6
KeySkillCastDefense=F5
KeySkillLifeAura=F4
KeySkillLifeAura=F3
PlayerAttackWithRightHand=false
@ -32,10 +32,10 @@ BeltPotTypeToHave=0,0,1,3
//#######################################
InventoryDontCheckItem=
{
0,0,0,0,0,0,0,1,1,1,
0,0,0,0,0,0,0,1,1,1,
0,0,0,0,0,0,0,1,1,1,
0,0,0,0,0,0,0,1,1,1
0,0,0,0,1,1,1,1,1,1,
0,0,0,0,1,1,1,1,1,1,
0,0,0,0,1,1,1,1,1,1,
0,0,0,0,1,1,1,1,1,1
}
//#######################################
@ -66,5 +66,5 @@ GambleGold=true
//#######################################
//MERC SETTINGS
//#######################################
UsingMerc=false
UsingMerc=true
MercTakeHPPotUnder=40

View File

@ -979,7 +979,7 @@ Perfect Diamond
[Name] == SmallCharm && [Quality] == magic && [ManaMax] >= 17
//[Name] == SmallCharm && [Quality] == magic && [FasterHitRecovery] >= 5
[Name] == SmallCharm && [Quality] == magic && [LifeMax]+[ManaMax] >= 20
[Name] == SmallCharm && [Quality] == magic && [PoisonMindamage] >= 100
[Name] == SmallCharm && [Quality] == magic && [PoisonMinDamage] >= 100
[Name] == SmallCharm && [Quality] == magic && [FireResist] >= 5
[Name] == SmallCharm && [Quality] == magic && [LightningResist] >= 5

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.