This commit is contained in:
Bouletmarc 2024-04-24 19:47:22 -04:00
parent d9f3d05a3c
commit 1331478df6
15 changed files with 157 additions and 199 deletions

View File

@ -346,7 +346,7 @@ namespace app
} }
//STOP CASTING ERROR DETECTING MOBS/BAAL MOVED //STOP CASTING ERROR DETECTING MOBS/BAAL MOVED
if ((DateTime.Now - TimeSinceLastWaveDone).TotalSeconds > 25) /*if ((DateTime.Now - TimeSinceLastWaveDone).TotalSeconds > 25)
{ {
TimeSinceLastWaveDone = DateTime.MaxValue; TimeSinceLastWaveDone = DateTime.MaxValue;
TimeSinceLastWaveSet = false; TimeSinceLastWaveSet = false;
@ -366,7 +366,7 @@ namespace app
CheckingThroneBackMode = 0; CheckingThroneBackMode = 0;
return; return;
} }
} }*/
//STOP CASTING //STOP CASTING
if (Form1_0.MobsStruc_0.GetMobs("", "", true, 30, IgnoredMobs)) if (Form1_0.MobsStruc_0.GetMobs("", "", true, 30, IgnoredMobs))

View File

@ -140,7 +140,7 @@ namespace app
if (CurrentStep == 5) if (CurrentStep == 5)
{ {
//#### //####
if (Form1_0.PlayerScan_0.levelNo == (int)Enums.Area.TowerCellarLevel3) if (Form1_0.PlayerScan_0.levelNo == (int)Enums.Area.TowerCellarLevel4)
{ {
CurrentStep++; CurrentStep++;
return; return;
@ -159,7 +159,7 @@ namespace app
if (CurrentStep == 6) if (CurrentStep == 6)
{ {
//#### //####
if (Form1_0.PlayerScan_0.levelNo == (int)Enums.Area.TowerCellarLevel4) if (Form1_0.PlayerScan_0.levelNo == (int)Enums.Area.TowerCellarLevel5)
{ {
CurrentStep++; CurrentStep++;
return; return;

View File

@ -42,7 +42,7 @@ namespace app
public partial class Form1 : Form public partial class Form1 : Form
{ {
public string BotVersion = "V2.53"; public string BotVersion = "V2.54";
public string D2_LOD_113C_Path = ""; public string D2_LOD_113C_Path = "";
@ -834,6 +834,7 @@ namespace app
ItemsStruc_0.BadItemsOnGroundPointerList = new List<long>(); ItemsStruc_0.BadItemsOnGroundPointerList = new List<long>();
SetDeadCount = false; SetDeadCount = false;
GameStruc_0.ChickenTry = 0; GameStruc_0.ChickenTry = 0;
MercStruc_0.MercOwnerID = 0;
//############################## //##############################
MapAreaStruc_0.ScanMapStruc(); MapAreaStruc_0.ScanMapStruc();
@ -942,10 +943,6 @@ namespace app
//Battle_0.CastSkills(); //Battle_0.CastSkills();
//ItemsStruc_0.GetItems(true); //ItemsStruc_0.GetItems(true);
//if (Running) LoopTimer.Start(); //if (Running) LoopTimer.Start();
//Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, 5260, 2892);
//itemScreenPos = Mover_0.FixMouseYPosition(itemScreenPos);
//Form1_0.KeyMouse_0.MouseMoveTo_RealPos(itemScreenPos["x"], itemScreenPos["y"]);
//return; //return;
if (CharConfig.RunMapHackOnly) if (CharConfig.RunMapHackOnly)

View File

@ -401,22 +401,26 @@ namespace app
DrawString(e, OtherInfosTxt2, drawFontBold, drawBrushWhite, 1360 - (ThisS2.Width * ScaleScreenSizeInverted), 910, true); DrawString(e, OtherInfosTxt2, drawFontBold, drawBrushWhite, 1360 - (ThisS2.Width * ScaleScreenSizeInverted), 910, true);
//Print Merc //Print Merc
/*if (CharConfig.UsingMerc) if (Form1_0.DebugMenuStyle > 0)
{ {
string ThisMercTxt = "Merc not alive"; if (CharConfig.UsingMerc)
if (Form1_0.MercStruc_0.MercAlive)
{ {
string ThisMercTxt = "Merc not alive";
if (Form1_0.MercStruc_0.MercAlive)
{
int PercentMerc = (int)((Form1_0.MercStruc_0.MercHP * 100.0) / Form1_0.MercStruc_0.MercMaxHP); int PercentMerc = (int)((Form1_0.MercStruc_0.MercHP * 100.0) / Form1_0.MercStruc_0.MercMaxHP);
ThisMercTxt = "Merc:" + Form1_0.MercStruc_0.MercHP.ToString() + "/" + Form1_0.MercStruc_0.MercMaxHP.ToString() + " (" + PercentMerc + "%)"; ThisMercTxt = "Merc:" + Form1_0.MercStruc_0.MercHP.ToString() + "/" + Form1_0.MercStruc_0.MercMaxHP.ToString() + " (" + PercentMerc + "%)";
}
ThisS2 = e.Graphics.MeasureString(ThisMercTxt, drawFontBold);
DrawString(e, ThisMercTxt, drawFontBold, drawBrushGreen, 1360 - (ThisS2.Width * ScaleScreenSizeInverted), 860, true);
} }
ThisS2 = e.Graphics.MeasureString(ThisMercTxt, drawFontBold); //if (Form1_0.DebugMenuStyle > 0)
DrawString(e, ThisMercTxt, drawFontBold, drawBrushGreen, 1360 - (ThisS2.Width * ScaleScreenSizeInverted), 860, true); //{
}*/ //Print Units Scanned Count
string UnitsStr = "Units:" + Form1_0.PatternsScan_0.GetUnitsScannedCount().ToString();
//Print Units Scanned Count DrawString(e, UnitsStr, drawFontBold, drawBrushGreen, 560, 885, true);
//string UnitsStr = "Units:" + Form1_0.PatternsScan_0.GetUnitsScannedCount().ToString(); }
//DrawString(e, UnitsStr, drawFontBold, drawBrushGreen, 560, 885, true);
if (CanDisplayOverlay) if (CanDisplayOverlay)
{ {

View File

@ -227,7 +227,7 @@ namespace app
for (int i = 0; i < 40; i++) for (int i = 0; i < 40; i++)
{ {
Form1_0.UIScan_0.OpenUIMenu("invMenu"); Form1_0.UIScan_0.OpenUIMenu("invMenu");
if (CharConfig.InventoryDontCheckItem[i] == 0 && InventoryHasItem[i] >= 1 && InventoryHasItemToID[i] == 0) if (CharConfig.InventoryDontCheckItem[i] == 0 && InventoryHasItem[i] >= 1 && InventoryHasItemToID[i] == 0 && InventoryHasStashItem[i] == 0)
{ {
//pick key item from this slot //pick key item from this slot
Dictionary<string, int> itemScreenPos = Form1_0.InventoryStruc_0.ConvertIndexToXY(i); Dictionary<string, int> itemScreenPos = Form1_0.InventoryStruc_0.ConvertIndexToXY(i);
@ -248,12 +248,9 @@ namespace app
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"]); Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"]);
Form1_0.WaitDelay(12); Form1_0.WaitDelay(12);
Form1_0.KeyMouse_0.MouseClicc_RealPos(Form1_0.CenterX, Form1_0.CenterY); //Form1_0.KeyMouse_0.MouseClicc_RealPos(Form1_0.CenterX, Form1_0.CenterY);
Form1_0.Stash_0.PlaceItem(Form1_0.CenterX, Form1_0.CenterY);
Form1_0.WaitDelay(10); Form1_0.WaitDelay(10);
/*Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"]);
Form1_0.WaitDelay(12);
Form1_0.Stash_0.PlaceItem(Form1_0.CenterX, Form1_0.CenterY);*/
} }
} }
} }

View File

@ -87,53 +87,44 @@ namespace app
{ {
if (Form1_0.ItemsStruc_0.ItemNAAME.ToLower().Replace(" ", "") == Regex.Replace(ThisDir.Key.ToLower().Replace(" ", ""), @"[\d-]", string.Empty) && ThisDir.Value) if (Form1_0.ItemsStruc_0.ItemNAAME.ToLower().Replace(" ", "") == Regex.Replace(ThisDir.Key.ToLower().Replace(" ", ""), @"[\d-]", string.Empty) && ThisDir.Value)
{ {
bool SameQuality = 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 (!Form1_0.ItemsStruc_0.identified)
{ {
bool SameQuality = 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 (!Keeping && SameQuality) return true; if (!Keeping && SameQuality) return true;
} }
else else
{ {
if (Keeping) bool SameFlags = true;
bool SameStats = true;
if (PickItemsNormal_ByName_Flags.ContainsKey(ThisDir.Key))
{ {
bool SameFlags = true; uint TotalFlags = 0;
bool SameQuality = true; foreach (var ThisList in PickItemsNormal_ByName_Flags[ThisDir.Key])
bool SameStats = true;
if (PickItemsNormal_ByName_Flags.ContainsKey(ThisDir.Key))
{ {
uint TotalFlags = 0; TotalFlags += ThisList.Key;
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 (PickItemsNormal_ByName_Quality.ContainsKey(ThisDir.Key)) foreach (var ThisList in PickItemsNormal_ByName_Flags[ThisDir.Key])
{ {
if (Form1_0.ItemsStruc_0.quality != Form1_0.ItemsStruc_0.getQuality(PickItemsNormal_ByName_Quality[ThisDir.Key])) SameQuality = false; SameStats = Form1_0.ItemsFlags_0.IsItemSameFlags(ThisList.Value, TotalFlags, Form1_0.ItemsStruc_0.flags);
} }
if (PickItemsNormal_ByName_Stats.ContainsKey(ThisDir.Key)) //Console.WriteLine(Form1_0.ItemsStruc_0.ItemNAAME + ":" + SameFlags);
{
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;
}
}
if (SameFlags && SameQuality && SameStats) return true;
} }
if (PickItemsNormal_ByName_Stats.ContainsKey(ThisDir.Key))
{
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;
}
}
if (SameFlags && SameQuality && SameStats) return true;
} }
} }
} }
@ -142,51 +133,43 @@ namespace app
{ {
if (IsItemThisType(Regex.Replace(ThisDir.Key.ToLower().Replace(" ", ""), @"[\d-]", string.Empty)) && ThisDir.Value) if (IsItemThisType(Regex.Replace(ThisDir.Key.ToLower().Replace(" ", ""), @"[\d-]", string.Empty)) && ThisDir.Value)
{ {
bool SameQuality = 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 (!Form1_0.ItemsStruc_0.identified)
{ {
bool SameQuality = 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 (!Keeping && SameQuality) return true; if (!Keeping && SameQuality) return true;
} }
else else
{ {
if (Keeping) bool SameFlags = true;
bool SameStats = true;
if (PickItemsNormal_ByType_Flags.ContainsKey(ThisDir.Key))
{ {
bool SameFlags = true; uint TotalFlags = 0;
bool SameQuality = true; foreach (var ThisList in PickItemsNormal_ByType_Flags[ThisDir.Key])
bool SameStats = true;
if (PickItemsNormal_ByType_Flags.ContainsKey(ThisDir.Key))
{ {
uint TotalFlags = 0; TotalFlags += ThisList.Key;
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 (PickItemsNormal_ByType_Quality.ContainsKey(ThisDir.Key)) foreach (var ThisList in PickItemsNormal_ByType_Flags[ThisDir.Key])
{ {
if (Form1_0.ItemsStruc_0.quality != Form1_0.ItemsStruc_0.getQuality(PickItemsNormal_ByType_Quality[ThisDir.Key])) SameQuality = false; SameStats = Form1_0.ItemsFlags_0.IsItemSameFlags(ThisList.Value, TotalFlags, Form1_0.ItemsStruc_0.flags);
} }
if (PickItemsNormal_ByType_Stats.ContainsKey(ThisDir.Key)) //Console.WriteLine(Form1_0.ItemsStruc_0.ItemNAAME + ":" + SameFlags);
{
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 (PickItemsNormal_ByType_Stats.ContainsKey(ThisDir.Key))
{
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;
} }
} }
} }
@ -306,7 +289,8 @@ namespace app
public string GetItemTypeText() public string GetItemTypeText()
{ {
return "[Type] == " + GetItemType(); if (GetItemType() != "") return "[Type] == " + GetItemType();
return "";
} }
public string GetItemType() public string GetItemType()

View File

@ -395,7 +395,7 @@ namespace app
ItemsScanned++; ItemsScanned++;
txtFileNo = BitConverter.ToUInt32(itemdatastruc, 4); txtFileNo = BitConverter.ToUInt32(itemdatastruc, 4);
//uint ItemID = BitConverter.ToUInt32(itemdatastruc, 8); uint ItemID = BitConverter.ToUInt32(itemdatastruc, 8);
ItemNAAME = Form1_0.ItemsNames_0.getItemBaseName(txtFileNo); ItemNAAME = Form1_0.ItemsNames_0.getItemBaseName(txtFileNo);
GetUnitData(); GetUnitData();
GetUnitPathData(); GetUnitPathData();
@ -506,6 +506,14 @@ namespace app
AllItemsEquipped.Add("ID:" + txtFileNo + "(" + ItemNAAME + ") at:" + itemx + ", " + itemy + " - Equipped - " + Form1_0.ItemsAlert_0.GetItemTypeText() + " && " + GetQualityTextString() + " && " + GetAllFlagsFromItem() + " && " + GetAllValuesFromStats()); AllItemsEquipped.Add("ID:" + txtFileNo + "(" + ItemNAAME + ") at:" + itemx + ", " + itemy + " - Equipped - " + Form1_0.ItemsAlert_0.GetItemTypeText() + " && " + GetQualityTextString() + " && " + GetAllFlagsFromItem() + " && " + GetAllValuesFromStats());
} }
} }
else
{
if (dwOwnerId != 0 && Form1_0.MercStruc_0.MercOwnerID == 0)
{
Form1_0.MercStruc_0.MercOwnerID = ItemID;
//Form1_0.method_1("owner: " + dwOwnerId + ", ID: " + ItemID + ", name: " + ItemNAAME + " - at: " + itemx + "," + itemy + " - " + equiploc, Color.DarkGreen);
}
}
} }
if (itemdatastruc[0x0C] == 2) if (itemdatastruc[0x0C] == 2)
{ {

View File

@ -33,6 +33,8 @@ namespace app
public int MercHP = 0; public int MercHP = 0;
public int MercMaxHP = 0; public int MercMaxHP = 0;
public uint MercOwnerID = 0; //set within ItemStrus (equipped item on merc)
public uint statCount = 0; public uint statCount = 0;
public uint statExCount = 0; public uint statExCount = 0;
public long statPtr = 0; public long statPtr = 0;
@ -80,35 +82,42 @@ namespace app
//if (IsMerc((int) txtFileNo)) //if (IsMerc((int) txtFileNo))
if (isUnique == 0 && (txtFileNo == 338) && mode != 0 && mode != 12) if (isUnique == 0 && (txtFileNo == 338) && mode != 0 && mode != 12)
//if (isUnique == 0 && isPlayerMinion && mode == 1) //if (isUnique == 0 && (txtFileNo == 338) && mode == 1)
{ {
if (xPosFinal != 0 && yPosFinal != 0) if (xPosFinal != 0 && yPosFinal != 0)
{ {
//SetHPFromStats(); //Int64 pUnitDataPtr = BitConverter.ToInt64(Mercdatastruc, 0x10);
/*string SavePathh = Form1_0.ThisEndPath + "DumpMercStruc" + MercCount; //uint dwOwnerId = Form1_0.Mem_0.ReadUInt32Raw((IntPtr)(pUnitDataPtr + 0x0c));
File.Create(SavePathh).Dispose(); //uint dwOwnerId = BitConverter.ToUInt32(Mercdatastruc, 8); //Form1_0.Mem_0.ReadUInt32Raw((IntPtr)(pUnitDataPtr + 0x0c)); //GOOD
File.WriteAllBytes(SavePathh, statBuffer);*/
/*byte[] buffff = new byte[144]; //if (dwOwnerId == MercOwnerID && MercOwnerID != 0)
long pStatsListExPtr = BitConverter.ToInt64(Mercdatastruc, 0x10); //{
Form1_0.Mem_0.ReadRawMemory(pStatsListExPtr, ref buffff, 144); //SetHPFromStats();
/*string SavePathh = Form1_0.ThisEndPath + "DumpMercStruc" + MercCount;
File.Create(SavePathh).Dispose();
File.WriteAllBytes(SavePathh, statBuffer);*/
pStatsListExPtr = BitConverter.ToInt64(Mercdatastruc, 0x78); /*byte[] buffff = new byte[144];
Form1_0.Mem_0.ReadRawMemory(pStatsListExPtr, ref buffff, 144); long pStatsListExPtr = BitConverter.ToInt64(Mercdatastruc, 0x10);
//uint dwOwnerId = BitConverter.ToUInt32(buffff, 0x0c); Form1_0.Mem_0.ReadRawMemory(pStatsListExPtr, ref buffff, 144);
//uint flags = BitConverter.ToUInt32(buffff, 0x18);
string SavePathh2 = Form1_0.ThisEndPath + "DumpMercStrucBuf" + MercCount; pStatsListExPtr = BitConverter.ToInt64(Mercdatastruc, 0x78);
File.Create(SavePathh2).Dispose(); Form1_0.Mem_0.ReadRawMemory(pStatsListExPtr, ref buffff, 144);
File.WriteAllBytes(SavePathh2, buffff);*/ //uint dwOwnerId = BitConverter.ToUInt32(buffff, 0x0c);
//uint flags = BitConverter.ToUInt32(buffff, 0x18);
//Console.WriteLine(txtFileNo.ToString() + ", isUnique:" + isUnique + ", isPlayerMinion:" + isPlayerMinion + ", mode:" + mode + ", pos:" + xPosFinal + ", " + yPosFinal); string SavePathh2 = Form1_0.ThisEndPath + "DumpMercStrucBuf" + MercCount;
//Console.WriteLine(flags); File.Create(SavePathh2).Dispose();
//MercCount++; File.WriteAllBytes(SavePathh2, buffff);*/
SetHPFromStats(); //Console.WriteLine(txtFileNo.ToString() + ", isUnique:" + isUnique + ", ownerID:" + dwOwnerId + ", mode:" + mode + ", pos:" + xPosFinal + ", " + yPosFinal);
Form1_0.Grid_SetInfos("Merc", MercHP.ToString() + "/" + MercMaxHP.ToString()); //Console.WriteLine(flags);
return true; //MercCount++;
SetHPFromStats();
Form1_0.Grid_SetInfos("Merc", MercHP.ToString() + "/" + MercMaxHP.ToString());
return true;
//}
} }
} }
} }
@ -177,10 +186,6 @@ namespace app
statCount = Form1_0.Mem_0.ReadUInt32Raw((IntPtr)(pStatsListExPtr + 0x38)); statCount = Form1_0.Mem_0.ReadUInt32Raw((IntPtr)(pStatsListExPtr + 0x38));
statExPtr = Form1_0.Mem_0.ReadInt64Raw((IntPtr)(pStatsListExPtr + 0x88)); statExPtr = Form1_0.Mem_0.ReadInt64Raw((IntPtr)(pStatsListExPtr + 0x88));
statExCount = Form1_0.Mem_0.ReadUInt32Raw((IntPtr)(pStatsListExPtr + 0x90)); statExCount = Form1_0.Mem_0.ReadUInt32Raw((IntPtr)(pStatsListExPtr + 0x90));
//string SavePathh = Form1_0.ThisEndPath + "DumpItempStatBStruc";
//File.Create(SavePathh).Dispose();
//File.WriteAllBytes(SavePathh, pStatB);
} }
public void GetUnitPathData() public void GetUnitPathData()
@ -198,10 +203,6 @@ namespace app
int yPosOffsetPercent = (yPosOffset / 65536); //get percentage int yPosOffsetPercent = (yPosOffset / 65536); //get percentage
xPosFinal = (ushort)(itemx + xPosOffsetPercent); xPosFinal = (ushort)(itemx + xPosOffsetPercent);
yPosFinal = (ushort)(itemy + yPosOffsetPercent); yPosFinal = (ushort)(itemy + yPosOffsetPercent);
//string SavePathh = Form1_0.ThisEndPath + "DumpItempPathStruc";
//File.Create(SavePathh).Dispose();
//File.WriteAllBytes(SavePathh, pPath);
} }
} }
} }

View File

@ -45,6 +45,9 @@ namespace app
public Position LastMobPos = new Position { X = 0, Y = 0 }; public Position LastMobPos = new Position { X = 0, Y = 0 };
public uint LastMobtxtFileNo = 0; public uint LastMobtxtFileNo = 0;
List<EnumsStates.State> MobsStates = new List<EnumsStates.State>();
List<EnumsStates.State> MobsStatesAll = new List<EnumsStates.State>();
public void SetForm1(Form1 form1_1) public void SetForm1(Form1 form1_1)
{ {
Form1_0 = form1_1; Form1_0 = form1_1;
@ -162,6 +165,8 @@ namespace app
Form1_0.Mem_0.ReadRawMemory(MobsPointerLocation + 0x88, ref CurrentPointerBytes, CurrentPointerBytes.Length); Form1_0.Mem_0.ReadRawMemory(MobsPointerLocation + 0x88, ref CurrentPointerBytes, CurrentPointerBytes.Length);
long pStatsListExPtr = BitConverter.ToInt64(CurrentPointerBytes, 0); long pStatsListExPtr = BitConverter.ToInt64(CurrentPointerBytes, 0);
MobsStatesAll = Form1_0.PlayerScan_0.GetStates(pStatsListExPtr);
bool isPlayerMinion = false; bool isPlayerMinion = false;
if (getPlayerMinion((int)txtFileNo2) != "") isPlayerMinion = true; if (getPlayerMinion((int)txtFileNo2) != "") isPlayerMinion = true;
else isPlayerMinion = ((Form1_0.Mem_0.ReadUInt32((IntPtr)(pStatsListExPtr + 0xAC8 + 0xc)) & 31) == 1); //is a revive else isPlayerMinion = ((Form1_0.Mem_0.ReadUInt32((IntPtr)(pStatsListExPtr + 0xAC8 + 0xc)) & 31) == 1); //is a revive
@ -169,6 +174,7 @@ namespace app
if ((Form1_0.NPCStruc_0.HideNPC((int)txtFileNo2) == 0 if ((Form1_0.NPCStruc_0.HideNPC((int)txtFileNo2) == 0
&& Form1_0.NPCStruc_0.getTownNPC((int)txtFileNo2) == "" && Form1_0.NPCStruc_0.getTownNPC((int)txtFileNo2) == ""
&& !isPlayerMinion && !isPlayerMinion
&& !Form1_0.PlayerScan_0.HasState(EnumsStates.State.Revive, MobsStatesAll)
&& !DebuggingMobs) && !DebuggingMobs)
|| DebuggingMobs) || DebuggingMobs)
//&& IsThisMobInBound()) //&& IsThisMobInBound())
@ -230,6 +236,8 @@ namespace app
Form1_0.Mem_0.ReadRawMemory(MobsPointerLocation + 0x88, ref CurrentPointerBytes, CurrentPointerBytes.Length); Form1_0.Mem_0.ReadRawMemory(MobsPointerLocation + 0x88, ref CurrentPointerBytes, CurrentPointerBytes.Length);
long pStatsListExPtr = BitConverter.ToInt64(CurrentPointerBytes, 0); long pStatsListExPtr = BitConverter.ToInt64(CurrentPointerBytes, 0);
MobsStatesAll = Form1_0.PlayerScan_0.GetStates(pStatsListExPtr);
bool isPlayerMinion = false; bool isPlayerMinion = false;
if (getPlayerMinion((int)txtFileNo2) != "") isPlayerMinion = true; if (getPlayerMinion((int)txtFileNo2) != "") isPlayerMinion = true;
else isPlayerMinion = ((Form1_0.Mem_0.ReadUInt32((IntPtr)(pStatsListExPtr + 0xAC8 + 0xc)) & 31) == 1); //is a revive else isPlayerMinion = ((Form1_0.Mem_0.ReadUInt32((IntPtr)(pStatsListExPtr + 0xAC8 + 0xc)) & 31) == 1); //is a revive
@ -237,6 +245,7 @@ namespace app
if ((Form1_0.NPCStruc_0.HideNPC((int)txtFileNo2) == 0 if ((Form1_0.NPCStruc_0.HideNPC((int)txtFileNo2) == 0
&& Form1_0.NPCStruc_0.getTownNPC((int)txtFileNo2) == "" && Form1_0.NPCStruc_0.getTownNPC((int)txtFileNo2) == ""
&& !isPlayerMinion && !isPlayerMinion
&& !Form1_0.PlayerScan_0.HasState(EnumsStates.State.Revive, MobsStatesAll)
&& !DebuggingMobs) && !DebuggingMobs)
|| DebuggingMobs) || DebuggingMobs)
//&& IsThisMobInBound()) //&& IsThisMobInBound())
@ -363,6 +372,8 @@ namespace app
Form1_0.Mem_0.ReadRawMemory(MobsPointerLocation + 0x88, ref CurrentPointerBytes, CurrentPointerBytes.Length); Form1_0.Mem_0.ReadRawMemory(MobsPointerLocation + 0x88, ref CurrentPointerBytes, CurrentPointerBytes.Length);
long pStatsListExPtr = BitConverter.ToInt64(CurrentPointerBytes, 0); long pStatsListExPtr = BitConverter.ToInt64(CurrentPointerBytes, 0);
MobsStates = Form1_0.PlayerScan_0.GetStates(pStatsListExPtr);
bool isPlayerMinion = false; bool isPlayerMinion = false;
if (getPlayerMinion((int)txtFileNo) != "") isPlayerMinion = true; if (getPlayerMinion((int)txtFileNo) != "") isPlayerMinion = true;
else isPlayerMinion = ((Form1_0.Mem_0.ReadUInt32((IntPtr)(pStatsListExPtr + 0xAC8 + 0xc)) & 31) == 1); //is a revive else isPlayerMinion = ((Form1_0.Mem_0.ReadUInt32((IntPtr)(pStatsListExPtr + 0xAC8 + 0xc)) & 31) == 1); //is a revive
@ -371,7 +382,8 @@ namespace app
if (Form1_0.NPCStruc_0.HideNPC((int) txtFileNo) == 0 if (Form1_0.NPCStruc_0.HideNPC((int) txtFileNo) == 0
&& Form1_0.NPCStruc_0.getTownNPC((int)txtFileNo) == "" && Form1_0.NPCStruc_0.getTownNPC((int)txtFileNo) == ""
&& !isPlayerMinion) && !isPlayerMinion
&& !Form1_0.PlayerScan_0.HasState(EnumsStates.State.Revive, MobsStates))
//&& !ShouldBeIgnored(txtFileNo)) //&& !ShouldBeIgnored(txtFileNo))
{ {
GetUnitPathData(); GetUnitPathData();

View File

@ -30,13 +30,12 @@ namespace app
public int[] DontCheckUnitIndexes = new int[] { 0, 0, 0, 0, 1, 1, 0, 0 }; public int[] DontCheckUnitIndexes = new int[] { 0, 0, 0, 0, 1, 1, 0, 0 };
public int[] DontCheckIndexes = new int[0]; public int[] DontCheckIndexes = new int[0];
public long StartIndexItem = long.MaxValue;
public long StartIndexItemLast = long.MaxValue; public long StartIndexItemLast = long.MaxValue;
//public int ScanUnitsNumber = 3000;
public int ScanUnitsNumber = 2600; public int ScanUnitsNumber = 2600;
//public int ScanUnitsNumber = 2200;
//public int ScanUnitsNumber = 6000;
public int ScanUnitsNegativeOffset = 0; public int ScanUnitsNegativeOffset = 0;
public void SetForm1(Form1 form1_1) public void SetForm1(Form1 form1_1)
{ {
Form1_0 = form1_1; Form1_0 = form1_1;
@ -329,13 +328,13 @@ namespace app
//{ //{
// return; // return;
//} //}
} }*/
public int GetUnitsScannedCount() public int GetUnitsScannedCount()
{ {
int UnitsScannedCount = 0; int UnitsScannedCount = 0;
//long CheckThisI = StartIndexItem; long CheckThisI = StartIndexItem;
long CheckThisI -= (0x48 + 0x170) * ScanUnitsNegativeOffset; //offseting in negative here CheckThisI -= (0x48 + 0x170) * ScanUnitsNegativeOffset; //offseting in negative here
UnitBuffer = new byte[9]; UnitBuffer = new byte[9];
//string SavePathh = Form1_0.ThisEndPath + "DumpHexUnits"; //string SavePathh = Form1_0.ThisEndPath + "DumpHexUnits";
@ -372,7 +371,7 @@ namespace app
} }
return UnitsScannedCount; return UnitsScannedCount;
}*/ }
public void scanForUnitsPointer(string SearchUnitsType) public void scanForUnitsPointer(string SearchUnitsType)
{ {
@ -445,50 +444,35 @@ namespace app
if (SearchUnitsType == "objects") AllObjectsPointers = new List<long>(); if (SearchUnitsType == "objects") AllObjectsPointers = new List<long>();
if (SearchUnitsType == "NPC") AllNPCPointers = new List<long>(); if (SearchUnitsType == "NPC") AllNPCPointers = new List<long>();
long StartIndexItem = long.MaxValue; StartIndexItem = long.MaxValue;
long StartIndexPlayer = long.MaxValue;
long StartIndexMobs = long.MaxValue;
long StartIndexNPC = long.MaxValue;
//set start index for searching //set start index for searching
if (SearchUnitsType == "item") if (SearchUnitsType == "item")
{ {
for (int i = 0; i < AllPossibleItemsPointers.Count; i++) for (int i = 0; i < AllPossibleItemsPointers.Count; i++)
{ {
if (AllPossibleItemsPointers[i] < StartIndexItem) if (AllPossibleItemsPointers[i] < StartIndexItem) StartIndexItem = AllPossibleItemsPointers[i];
{
StartIndexItem = AllPossibleItemsPointers[i];
}
} }
} }
if (SearchUnitsType == "player") if (SearchUnitsType == "player")
{ {
for (int i = 0; i < AllPossiblePlayerPointers.Count; i++) for (int i = 0; i < AllPossiblePlayerPointers.Count; i++)
{ {
if (AllPossiblePlayerPointers[i] < StartIndexPlayer) if (AllPossiblePlayerPointers[i] < StartIndexItem) StartIndexItem = AllPossiblePlayerPointers[i];
{
StartIndexPlayer = AllPossiblePlayerPointers[i];
}
} }
} }
if (SearchUnitsType == "objects") if (SearchUnitsType == "objects")
{ {
for (int i = 0; i < AllPossibleObjectsPointers.Count; i++) for (int i = 0; i < AllPossibleObjectsPointers.Count; i++)
{ {
if (AllPossibleObjectsPointers[i] < StartIndexMobs) if (AllPossibleObjectsPointers[i] < StartIndexItem) StartIndexItem = AllPossibleObjectsPointers[i];
{
StartIndexMobs = AllPossibleObjectsPointers[i];
}
} }
} }
if (SearchUnitsType == "NPC") if (SearchUnitsType == "NPC")
{ {
for (int i = 0; i < AllPossibleNPCPointers.Count; i++) for (int i = 0; i < AllPossibleNPCPointers.Count; i++)
{ {
if (AllPossibleNPCPointers[i] < StartIndexNPC) if (AllPossibleNPCPointers[i] < StartIndexItem) StartIndexItem = AllPossibleNPCPointers[i];
{
StartIndexNPC = AllPossibleNPCPointers[i];
}
} }
} }
@ -505,7 +489,7 @@ namespace app
if (DiffVal < 0xFFFFF) //here if (DiffVal < 0xFFFFF) //here
{ {
ScanUnitsNumber += UnitNumberDiff; ScanUnitsNumber += UnitNumberDiff;
Form1_0.method_1("Item start diff: 0x" + (DiffVal).ToString("X") + ", scann for: " + ScanUnitsNumber + " +" + UnitNumberDiff, Color.DarkOrchid); Form1_0.method_1("Units start diff: 0x" + (DiffVal).ToString("X") + ", scann for: " + ScanUnitsNumber + " +" + UnitNumberDiff, Color.DarkOrchid);
} }
else else
{ {
@ -519,30 +503,13 @@ namespace app
//search //search
long CheckThisI = StartIndexItem; long CheckThisI = StartIndexItem;
long CheckThisP = StartIndexPlayer;
long CheckThisM = StartIndexMobs;
long CheckThisN = StartIndexNPC;
UnitBuffer = new byte[9]; UnitBuffer = new byte[9];
CheckThisI -= (0x48 + 0x170) * ScanUnitsNegativeOffset; //offseting in negative here CheckThisI -= (0x48 + 0x170) * ScanUnitsNegativeOffset; //offseting in negative here
for (int i = 0; i < ScanUnitsNumber; i++) for (int i = 0; i < ScanUnitsNumber; i++)
//for (int i = 0; i < 2048; i++)
//for (int i = 0; i < 2500; i++)
{ {
if ((i % 2) == 1) if ((i % 2) == 1) CheckThisI += 0x48;
{ else CheckThisI += 0x170;
CheckThisI += 0x48;
CheckThisP += 0x48;
CheckThisM += 0x48;
CheckThisN += 0x48;
}
else
{
CheckThisI += 0x170;
CheckThisP += 0x170;
CheckThisM += 0x170;
CheckThisN += 0x170;
}
if (SearchUnitsType == "item") if (SearchUnitsType == "item")
{ {
@ -554,22 +521,22 @@ namespace app
if (SearchUnitsType == "player") if (SearchUnitsType == "player")
{ {
ThisCheckbytes = new byte[] { (byte)UnitType.Player, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 }; ThisCheckbytes = new byte[] { (byte)UnitType.Player, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 };
Form1_0.Mem_0.ReadRawMemory(CheckThisP, ref UnitBuffer, UnitBuffer.Length); Form1_0.Mem_0.ReadRawMemory(CheckThisI, ref UnitBuffer, UnitBuffer.Length);
unitPatternScan(CheckThisP, "player"); unitPatternScan(CheckThisI, "player");
} }
if (SearchUnitsType == "objects") if (SearchUnitsType == "objects")
{ {
ThisCheckbytes = new byte[] { (byte)UnitType.GameObject, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 }; ThisCheckbytes = new byte[] { (byte)UnitType.GameObject, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 };
Form1_0.Mem_0.ReadRawMemory(CheckThisM, ref UnitBuffer, UnitBuffer.Length); Form1_0.Mem_0.ReadRawMemory(CheckThisI, ref UnitBuffer, UnitBuffer.Length);
unitPatternScan(CheckThisM, "objects"); unitPatternScan(CheckThisI, "objects");
} }
if (SearchUnitsType == "NPC") if (SearchUnitsType == "NPC")
{ {
ThisCheckbytes = new byte[] { (byte)UnitType.NPC, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 }; ThisCheckbytes = new byte[] { (byte)UnitType.NPC, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 };
Form1_0.Mem_0.ReadRawMemory(CheckThisN, ref UnitBuffer, UnitBuffer.Length); Form1_0.Mem_0.ReadRawMemory(CheckThisI, ref UnitBuffer, UnitBuffer.Length);
unitPatternScan(CheckThisN, "NPC"); unitPatternScan(CheckThisI, "NPC");
} }
} }
} }
@ -578,31 +545,19 @@ namespace app
{ {
if (SearchUnitsType == "item") if (SearchUnitsType == "item")
{ {
for (int i = 0; i < AllPossibleItemsPointers.Count; i++) for (int i = 0; i < AllPossibleItemsPointers.Count; i++) AddPointerToList(AllPossibleItemsPointers[i], "item");
{
AddPointerToList(AllPossibleItemsPointers[i], "item");
}
} }
if (SearchUnitsType == "player") if (SearchUnitsType == "player")
{ {
for (int i = 0; i < AllPlayersPointers.Count; i++) for (int i = 0; i < AllPossiblePlayerPointers.Count; i++) AddPointerToList(AllPossiblePlayerPointers[i], "player");
{
AddPointerToList(AllPlayersPointers[i], "player");
}
} }
if (SearchUnitsType == "objects") if (SearchUnitsType == "objects")
{ {
for (int i = 0; i < AllObjectsPointers.Count; i++) for (int i = 0; i < AllPossibleObjectsPointers.Count; i++) AddPointerToList(AllPossibleObjectsPointers[i], "objects");
{
AddPointerToList(AllObjectsPointers[i], "objects");
}
} }
if (SearchUnitsType == "NPC") if (SearchUnitsType == "NPC")
{ {
for (int i = 0; i < AllNPCPointers.Count; i++) for (int i = 0; i < AllPossibleNPCPointers.Count; i++) AddPointerToList(AllPossibleNPCPointers[i], "NPC");
{
AddPointerToList(AllNPCPointers[i], "NPC");
}
} }
} }

View File

@ -150,7 +150,7 @@ namespace app
statCount = Form1_0.Mem_0.ReadInt32Raw((IntPtr)(pStatsListEx + 0x38)); statCount = Form1_0.Mem_0.ReadInt32Raw((IntPtr)(pStatsListEx + 0x38));
PlayerStates = GetStates(pStatsListEx); PlayerStates = GetStates(pStatsListEx);
HasBattleOrderState = HasState(EnumsStates.State.Battleorders); HasBattleOrderState = HasState(EnumsStates.State.Battleorders, PlayerStates);
byte[] buffer = new byte[statCount * 8]; byte[] buffer = new byte[statCount * 8];
Form1_0.Mem_0.ReadRawMemory(statPtr + 0x2, ref buffer, (int) (statCount * 8)); Form1_0.Mem_0.ReadRawMemory(statPtr + 0x2, ref buffer, (int) (statCount * 8));
@ -808,9 +808,9 @@ namespace app
ManaPercentFromEquippedItems += AddedManaPercent; ManaPercentFromEquippedItems += AddedManaPercent;
} }
public bool HasState(EnumsStates.State state) public bool HasState(EnumsStates.State state, List<EnumsStates.State> ThisStatesList)
{ {
foreach (EnumsStates.State st in PlayerStates) foreach (EnumsStates.State st in ThisStatesList)
{ {
if (st == state) if (st == state)
{ {

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.