Update V1.2
This commit is contained in:
parent
29179280e0
commit
d512a04031
|
@ -7,14 +7,22 @@ StartStopKey=101
|
|||
//BOT SETTINGS (USE ONLY CHAOS OR BAAL, NOT BOTH AT SAME TIME)
|
||||
//#######################################
|
||||
MaxGameTime=7
|
||||
RunMephistoScript=false
|
||||
RunAndarielScript=false
|
||||
RunCountessScript=false
|
||||
RunSummonerScript=false
|
||||
RunDurielScript=false
|
||||
RunChaosScript=false
|
||||
RunLowerKurastScript=false
|
||||
RunBaalLeechScript=true
|
||||
RunLowerKurastScript=true
|
||||
RunBaalLeechScript=false
|
||||
RunItemGrabScriptOnly=false
|
||||
|
||||
//#######################################
|
||||
//NOT IN GAME SCRIPT (SEARCH GAMES OR CREATE A NEW GAME)
|
||||
//#######################################
|
||||
RunBaalSearchGameScript=true
|
||||
RunGameMakerScript=false
|
||||
GameName=QCLOWERK
|
||||
GamePass=33
|
||||
RunChaosSearchGameScript=false
|
||||
RunBaalSearchGameScript=false
|
||||
RunGameMakerScript=true
|
||||
GameName=PUTNAMEHERE
|
||||
GamePass=33
|
||||
GameDifficulty=2
|
|
@ -0,0 +1,124 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace app
|
||||
{
|
||||
public class Andariel
|
||||
{
|
||||
Form1 Form1_0;
|
||||
|
||||
public int CurrentStep = 0;
|
||||
public bool ScriptDone = false;
|
||||
|
||||
|
||||
public void SetForm1(Form1 form1_1)
|
||||
{
|
||||
Form1_0 = form1_1;
|
||||
}
|
||||
|
||||
public void ResetVars()
|
||||
{
|
||||
CurrentStep = 0;
|
||||
ScriptDone = false;
|
||||
}
|
||||
|
||||
public void RunScript()
|
||||
{
|
||||
Form1_0.Town_0.ScriptTownAct = 5; //set to town act 5 when running this script
|
||||
|
||||
if (Form1_0.Town_0.GetInTown())
|
||||
{
|
||||
Form1_0.SetGameStatus("GO TO WP");
|
||||
CurrentStep = 0;
|
||||
|
||||
Form1_0.Town_0.GoToWPArea(1, 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CurrentStep == 0)
|
||||
{
|
||||
Form1_0.SetGameStatus("DOING ANDARIEL");
|
||||
Form1_0.Battle_0.CastDefense();
|
||||
Form1_0.WaitDelay(15);
|
||||
|
||||
if ((Enums.Area) Form1_0.PlayerScan_0.levelNo == Enums.Area.CatacombsLevel2)
|
||||
{
|
||||
CurrentStep++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.Town_0.GoToTown();
|
||||
}
|
||||
}
|
||||
|
||||
if (CurrentStep == 1)
|
||||
{
|
||||
Form1_0.MoveToPath_0.MoveToArea(Enums.Area.CatacombsLevel3);
|
||||
Form1_0.MoveToPath_0.MoveToArea(Enums.Area.CatacombsLevel4);
|
||||
CurrentStep++;
|
||||
}
|
||||
|
||||
if (CurrentStep == 2)
|
||||
{
|
||||
/*X: 22561,
|
||||
Y: 9553,*/
|
||||
if (Form1_0.Mover_0.MoveToLocation(22561, 9553))
|
||||
{
|
||||
CurrentStep++;
|
||||
}
|
||||
}
|
||||
|
||||
if (CurrentStep == 3)
|
||||
{
|
||||
Form1_0.Potions_0.CanUseSkillForRegen = false;
|
||||
Form1_0.SetGameStatus("KILLING ANDARIEL");
|
||||
if (Form1_0.MobsStruc_0.GetMobs("getBossName", "Andariel", false, 200, new List<long>()))
|
||||
{
|
||||
if (Form1_0.MobsStruc_0.MobsHP > 0)
|
||||
{
|
||||
Form1_0.Battle_0.RunBattleScriptOnThisMob("getBossName", "Andariel");
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GrabAllItemsForGold();
|
||||
Form1_0.Potions_0.CanUseSkillForRegen = true;
|
||||
|
||||
ScriptDone = true;
|
||||
return;
|
||||
//Form1_0.LeaveGame(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.method_1("Andariel not detected!", Color.Red);
|
||||
|
||||
//baal not detected...
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
if (Form1_0.MobsStruc_0.GetMobs("getBossName", "Andariel", false, 200, new List<long>())) return; //redetect baal?
|
||||
Form1_0.ItemsStruc_0.GrabAllItemsForGold();
|
||||
if (Form1_0.MobsStruc_0.GetMobs("getBossName", "Andariel", false, 200, new List<long>())) return; //redetect baal?
|
||||
Form1_0.Potions_0.CanUseSkillForRegen = true;
|
||||
|
||||
ScriptDone = true;
|
||||
return;
|
||||
//Form1_0.LeaveGame(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
162
Bots/Baal.cs
162
Bots/Baal.cs
|
@ -23,6 +23,7 @@ namespace app
|
|||
public bool SearchSameGamesAsLastOne = false;
|
||||
public bool KillingManually = false;
|
||||
public bool DetectedBaal = false;
|
||||
public bool ScriptDone = false;
|
||||
|
||||
public long LastWave4Pointer = 0;
|
||||
public long LastWave5Pointer = 0;
|
||||
|
@ -33,6 +34,11 @@ namespace app
|
|||
public DateTime StartTimeWhenWaiting = DateTime.Now;
|
||||
public bool SetStartTime = false;
|
||||
public long BaalThronePointer = 0;
|
||||
public DateTime TimeSinceInThrone = DateTime.Now;
|
||||
|
||||
public bool WaitedEnteringPortal = false;
|
||||
|
||||
public bool AddingIgnoredTP_ID = false;
|
||||
|
||||
public void SetForm1(Form1 form1_1)
|
||||
{
|
||||
|
@ -49,7 +55,10 @@ namespace app
|
|||
PrintedInfos = false;
|
||||
KillingManually = false;
|
||||
DetectedBaal = false;
|
||||
ScriptDone = false;
|
||||
SetStartTime = false;
|
||||
AddingIgnoredTP_ID = false;
|
||||
WaitedEnteringPortal = false;
|
||||
StartTimeWhenWaiting = DateTime.Now;
|
||||
Form1_0.PlayerScan_0.LeechPlayerUnitID = 0;
|
||||
Form1_0.PlayerScan_0.LeechPlayerPointer = 0;
|
||||
|
@ -95,6 +104,10 @@ namespace app
|
|||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("cbaal")
|
||||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("help")
|
||||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("walk")
|
||||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("quest")
|
||||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("4 q")
|
||||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("baal4q")
|
||||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("ancient")
|
||||
&& Form1_0.GameStruc_0.AllGamesNames[i] != LastGameName) //not equal last gamename
|
||||
{
|
||||
if (!Form1_0.GameStruc_0.TriedThisGame(Form1_0.GameStruc_0.AllGamesNames[i]))
|
||||
|
@ -118,9 +131,15 @@ namespace app
|
|||
Form1_0.SetGameStatus("SEARCHING:" + Form1_0.GameStruc_0.AllGamesNames[PossibleGamesIndex[i]]);
|
||||
|
||||
Form1_0.GameStruc_0.SelectGame(PossibleGamesIndex[i], false);
|
||||
if (!Form1_0.GameStruc_0.SelectedGameName.Contains(Form1_0.GameStruc_0.AllGamesNames[PossibleGamesIndex[i]]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (Form1_0.GameStruc_0.SelectedGameTime < MaxGameTimeToEnter)
|
||||
{
|
||||
Form1_0.GameStruc_0.SelectGame(PossibleGamesIndex[i], true);
|
||||
Form1_0.SetGameStatus("LOADING GAME");
|
||||
//Form1_0.WaitDelay(300);
|
||||
EnteredGammme = true;
|
||||
break;
|
||||
}
|
||||
|
@ -153,9 +172,17 @@ namespace app
|
|||
CurrentStep = 0;
|
||||
Form1_0.Mover_0.MoveToLocation(5103, 5029); //move to wp spot
|
||||
|
||||
if (AddingIgnoredTP_ID)
|
||||
{
|
||||
IgnoredTPList.Add(Form1_0.Town_0.LastUsedTPID);
|
||||
AddingIgnoredTP_ID = false;
|
||||
}
|
||||
|
||||
if (!SetStartTime)
|
||||
{
|
||||
Form1_0.Town_0.GetCorpse();
|
||||
StartTimeWhenWaiting = DateTime.Now;
|
||||
Form1_0.Battle_0.CastDefense();
|
||||
SetStartTime = true;
|
||||
}
|
||||
|
||||
|
@ -163,6 +190,21 @@ namespace app
|
|||
//if (Form1_0.ObjectsStruc_0.GetObjects("TownPortal", Form1_0.PlayerScan_0.LeechPlayerUnitID))
|
||||
if (Form1_0.ObjectsStruc_0.GetObjects("TownPortal", true, IgnoredTPList))
|
||||
{
|
||||
if (!WaitedEnteringPortal)
|
||||
{
|
||||
if (IsPortalAtGoodLocation())
|
||||
{
|
||||
Form1_0.Battle_0.CastDefense();
|
||||
Form1_0.WaitDelay(600);
|
||||
WaitedEnteringPortal = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.method_1("Added ignored TP ID(possible wrong area): " + Form1_0.ObjectsStruc_0.ObjectUnitID, Color.Red);
|
||||
IgnoredTPList.Add(Form1_0.ObjectsStruc_0.ObjectUnitID);
|
||||
}
|
||||
}
|
||||
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, Form1_0.ObjectsStruc_0.itemx, Form1_0.ObjectsStruc_0.itemy);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.WaitDelay(100);
|
||||
|
@ -192,7 +234,8 @@ namespace app
|
|||
if (TimeWaitedForTP >= MaxTimeWaitedForTP)
|
||||
{
|
||||
Form1_0.method_1("Leaving reason: Waited too long for tp", Color.Red);
|
||||
Form1_0.LeaveGame(false);
|
||||
ScriptDone = true;
|
||||
//Form1_0.LeaveGame(false);
|
||||
}
|
||||
/*else
|
||||
{
|
||||
|
@ -208,7 +251,8 @@ namespace app
|
|||
&& !Form1_0.PlayerScan_0.HasAnyPlayerInArea(131))//throne chamber
|
||||
{
|
||||
Form1_0.method_1("Leaving reason: Nobody seem to baal run", Color.Red);
|
||||
Form1_0.LeaveGame(false);
|
||||
ScriptDone = true;
|
||||
//Form1_0.LeaveGame(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -217,13 +261,21 @@ namespace app
|
|||
{
|
||||
if (CurrentStep == 0)
|
||||
{
|
||||
CastDefense();
|
||||
CastDefense();
|
||||
CastDefense();
|
||||
Form1_0.Battle_0.CastDefense();
|
||||
//CastDefense();
|
||||
//CastDefense();
|
||||
//Form1_0.Town_0.GetCorpse();
|
||||
|
||||
if (Form1_0.ItemsStruc_0.ItemsEquiped <= 2)
|
||||
{
|
||||
Form1_0.Town_0.GoToTown();
|
||||
return;
|
||||
}
|
||||
|
||||
//not correct location check
|
||||
if (Form1_0.PlayerScan_0.levelNo != 131)
|
||||
{
|
||||
|
||||
if (Form1_0.ObjectsStruc_0.GetObjects("TownPortal", true, IgnoredTPList))
|
||||
{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, Form1_0.ObjectsStruc_0.itemx, Form1_0.ObjectsStruc_0.itemy);
|
||||
|
@ -231,12 +283,16 @@ namespace app
|
|||
Form1_0.WaitDelay(100);
|
||||
}
|
||||
|
||||
Form1_0.method_1("Added ignored TP ID: " + LastUsedTP_ID, Color.Red);
|
||||
|
||||
IgnoredTPList.Add(LastUsedTP_ID);
|
||||
Form1_0.Town_0.UseLastTP = false;
|
||||
AddingIgnoredTP_ID = true;
|
||||
Form1_0.Town_0.GoToTown();
|
||||
}
|
||||
else
|
||||
{
|
||||
TimeSinceInThrone = DateTime.Now;
|
||||
CurrentStep++;
|
||||
}
|
||||
}
|
||||
|
@ -247,15 +303,17 @@ namespace app
|
|||
|
||||
//Form1_0.Battle_0.DoBattleScript();
|
||||
|
||||
if (Form1_0.PlayerScan_0.xPosFinal < 15105 - 8
|
||||
|| Form1_0.PlayerScan_0.xPosFinal > 15105 + 8
|
||||
|| Form1_0.PlayerScan_0.yPosFinal < 5026 - 8
|
||||
|| Form1_0.PlayerScan_0.yPosFinal > 5026 + 8)
|
||||
if (Form1_0.PlayerScan_0.xPosFinal < 15110 - 8
|
||||
|| Form1_0.PlayerScan_0.xPosFinal > 15110 + 8
|
||||
|| Form1_0.PlayerScan_0.yPosFinal < 5030 - 8
|
||||
|| Form1_0.PlayerScan_0.yPosFinal > 5030 + 8)
|
||||
{
|
||||
Form1_0.Mover_0.MoveToLocation(15105, 5026); //move to safe spot
|
||||
//Form1_0.Town_0.GetCorpse();
|
||||
Form1_0.Mover_0.MoveToLocation(15110, 5030); //move to safe spot
|
||||
}
|
||||
else
|
||||
{
|
||||
//Form1_0.Town_0.GetCorpse();
|
||||
Form1_0.Battle_0.DoBattleScript(10);
|
||||
}
|
||||
|
||||
|
@ -264,6 +322,7 @@ namespace app
|
|||
{
|
||||
if (Form1_0.MobsStruc_0.MobsHP > 0)
|
||||
{
|
||||
Form1_0.method_1("Wave4 detected, switching to baal script!" + LastUsedTP_ID, Color.Red);
|
||||
LastWave4Pointer = Form1_0.MobsStruc_0.MobsPointerLocation;
|
||||
CurrentStep++;
|
||||
}
|
||||
|
@ -272,6 +331,7 @@ namespace app
|
|||
{
|
||||
if (Form1_0.MobsStruc_0.MobsHP > 0)
|
||||
{
|
||||
Form1_0.method_1("Wave5 detected, switching to baal script!" + LastUsedTP_ID, Color.Red);
|
||||
LastWave5Pointer = Form1_0.MobsStruc_0.MobsPointerLocation;
|
||||
CurrentStep++;
|
||||
}
|
||||
|
@ -292,10 +352,25 @@ namespace app
|
|||
if (Form1_0.MobsStruc_0.xPosFinal != 15087 &&
|
||||
Form1_0.MobsStruc_0.yPosFinal != 5013)
|
||||
{
|
||||
Form1_0.method_1("Baal has moved, switching to baal script!" + LastUsedTP_ID, Color.Red);
|
||||
CurrentStep++;
|
||||
}
|
||||
}
|
||||
|
||||
if (Form1_0.FPS == 0)
|
||||
{
|
||||
Form1_0.method_1("Too low FPS, switching to baal script!" + LastUsedTP_ID, Color.Red);
|
||||
CurrentStep++;
|
||||
}
|
||||
//CurrentStep++;
|
||||
|
||||
//Automaticly jump to next step (baal killing) after 2mins in throne
|
||||
TimeSpan ThisTimeCheckk = DateTime.Now - TimeSinceInThrone;
|
||||
if (ThisTimeCheckk.TotalMinutes > 2)
|
||||
{
|
||||
Form1_0.method_1("More than 2min since in Throne, switching to baal script!" + LastUsedTP_ID, Color.Red);
|
||||
CurrentStep++;
|
||||
}
|
||||
}
|
||||
if (CurrentStep == 2)
|
||||
{
|
||||
|
@ -317,7 +392,7 @@ namespace app
|
|||
&& Form1_0.PlayerScan_0.yPosFinal >= 5880 - 40
|
||||
&& Form1_0.PlayerScan_0.yPosFinal <= 5880 + 40)
|
||||
{
|
||||
CastDefense();
|
||||
Form1_0.Battle_0.CastDefense();
|
||||
CurrentStep++;
|
||||
}
|
||||
else
|
||||
|
@ -339,6 +414,7 @@ namespace app
|
|||
{
|
||||
if (Form1_0.Mover_0.MoveToLocation(15090, 5008))
|
||||
{
|
||||
Form1_0.Battle_0.CastDefense();
|
||||
Form1_0.Mover_0.MoveAcceptOffset = 4;
|
||||
}
|
||||
}
|
||||
|
@ -367,7 +443,7 @@ namespace app
|
|||
{
|
||||
Form1_0.Potions_0.CanUseSkillForRegen = false;
|
||||
Form1_0.SetGameStatus("KILLING BAAL");
|
||||
if (Form1_0.MobsStruc_0.GetMobs("getBossName", "Baal", false, 120, new List<long>()))
|
||||
if (Form1_0.MobsStruc_0.GetMobs("getBossName", "Baal", false, 200, new List<long>()))
|
||||
{
|
||||
if (Form1_0.MobsStruc_0.MobsHP > 0)
|
||||
{
|
||||
|
@ -400,28 +476,66 @@ namespace app
|
|||
Form1_0.Potions_0.CanUseSkillForRegen = true;
|
||||
SearchSameGamesAsLastOne = true;
|
||||
Form1_0.LeaveGame(true);
|
||||
ScriptDone = true;
|
||||
//Form1_0.LeaveGame(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.method_1("Baal not detected!", Color.Red);
|
||||
|
||||
//baal not detected...
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
if (Form1_0.MobsStruc_0.GetMobs("getBossName", "Baal", false, 200, new List<long>())) return; //redetect baal?
|
||||
Form1_0.ItemsStruc_0.GrabAllItemsForGold();
|
||||
if (Form1_0.MobsStruc_0.GetMobs("getBossName", "Baal", false, 200, new List<long>())) return; //redetect baal?
|
||||
Form1_0.Potions_0.CanUseSkillForRegen = true;
|
||||
SearchSameGamesAsLastOne = true;
|
||||
Form1_0.LeaveGame(true);
|
||||
ScriptDone = true;
|
||||
//Form1_0.LeaveGame(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void CastDefense()
|
||||
public bool IsPortalAtGoodLocation()
|
||||
{
|
||||
//cast sacred shield
|
||||
Form1_0.KeyMouse_0.PressKey(CharConfig.KeySkillCastDefense);
|
||||
Form1_0.WaitDelay(5);
|
||||
Form1_0.KeyMouse_0.MouseCliccRight(Form1_0.CenterX, Form1_0.CenterY);
|
||||
Form1_0.WaitDelay(5);
|
||||
//Check for all roster member (party peoples) and see if they are in worldstone area
|
||||
|
||||
bool IsCorrectLocation = false;
|
||||
string StartLeechName = Form1_0.GameStruc_0.GameOwnerName;
|
||||
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < Form1_0.GameStruc_0.AllPlayersNames.Count; i++)
|
||||
{
|
||||
Form1_0.GameStruc_0.GameOwnerName = Form1_0.GameStruc_0.AllPlayersNames[i];
|
||||
GetLeechInfo();
|
||||
if (Form1_0.PlayerScan_0.LeechPlayerPointer == 0 || Form1_0.PlayerScan_0.LeechPlayerUnitID == 0) continue;
|
||||
Form1_0.PlayerScan_0.GetLeechPositions();
|
||||
|
||||
if (!Form1_0.Running || !Form1_0.GameStruc_0.IsInGame())
|
||||
{
|
||||
IsCorrectLocation = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (Form1_0.PlayerScan_0.LeechlevelNo == 131)
|
||||
{
|
||||
IsCorrectLocation = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
IsCorrectLocation = true;
|
||||
}
|
||||
|
||||
Form1_0.GameStruc_0.GameOwnerName = StartLeechName;
|
||||
|
||||
return IsCorrectLocation;
|
||||
}
|
||||
|
||||
public void GetLeechInfo()
|
||||
|
@ -444,6 +558,8 @@ namespace app
|
|||
Form1_0.ItemsStruc_0.GrabAllItemsForGold();
|
||||
SearchSameGamesAsLastOne = true;
|
||||
Form1_0.LeaveGame(true);
|
||||
ScriptDone = true;
|
||||
//Form1_0.LeaveGame(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -457,10 +573,18 @@ namespace app
|
|||
Form1_0.ItemsStruc_0.GrabAllItemsForGold();
|
||||
SearchSameGamesAsLastOne = true;
|
||||
Form1_0.LeaveGame(true);
|
||||
ScriptDone = true;
|
||||
//Form1_0.LeaveGame(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
KillingManually = true;
|
||||
Form1_0.ItemsStruc_0.GrabAllItemsForGold();
|
||||
SearchSameGamesAsLastOne = true;
|
||||
Form1_0.LeaveGame(true);
|
||||
ScriptDone = true;
|
||||
//Form1_0.LeaveGame(false);
|
||||
|
||||
//KillingManually = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
398
Bots/Chaos.cs
398
Bots/Chaos.cs
|
@ -13,10 +13,31 @@ namespace app
|
|||
Form1 Form1_0;
|
||||
|
||||
public int CurrentStep = 0;
|
||||
public int MaxGameTimeToEnter = (6 * 60); //6mins
|
||||
public int MaxGameTimeToEnter = (4 * 60); //6mins
|
||||
public int MaxTimeWaitedForTP = (2 * 60) * 2; //2mins
|
||||
public int TimeWaitedForTP = 0;
|
||||
public bool PrintedInfos = false;
|
||||
public bool ScriptDone = false;
|
||||
|
||||
public bool SearchSameGamesAsLastOne = false;
|
||||
public int SameGameRetry = 0;
|
||||
|
||||
public List<uint> IgnoredTPList = new List<uint>();
|
||||
public uint LastUsedTP_ID = 0;
|
||||
public bool AddingIgnoredTP_ID = false;
|
||||
|
||||
public bool LeechDetectedCorrectly = false;
|
||||
|
||||
//List<Tuple<int, int>> GoodPositions = new List<Tuple<int, int>>();
|
||||
|
||||
public int LastLeechPosX = 0;
|
||||
public int LastLeechPosY = 0;
|
||||
|
||||
List<Tuple<int, int>> LastLeechPositions = new List<Tuple<int, int>>();
|
||||
public int LastLeechPosXNEW = 0;
|
||||
public int LastLeechPosYNEW = 0;
|
||||
|
||||
public bool CastedDefense = false;
|
||||
|
||||
public void SetForm1(Form1 form1_1)
|
||||
{
|
||||
|
@ -27,10 +48,29 @@ namespace app
|
|||
{
|
||||
TimeWaitedForTP = 0;
|
||||
CurrentStep = 0;
|
||||
LastLeechPosX = 0;
|
||||
LastLeechPosY = 0;
|
||||
LastLeechPosXNEW = 0;
|
||||
LastLeechPosYNEW = 0;
|
||||
PrintedInfos = false;
|
||||
CastedDefense = false;
|
||||
//GoodPositions = new List<Tuple<int, int>>();
|
||||
LastLeechPositions = new List<Tuple<int, int>>();
|
||||
Form1_0.PlayerScan_0.LeechPlayerUnitID = 0;
|
||||
Form1_0.PlayerScan_0.LeechPlayerPointer = 0;
|
||||
Form1_0.GameStruc_0.GetAllGamesNames();
|
||||
IgnoredTPList = new List<uint>();
|
||||
LastUsedTP_ID = 0;
|
||||
bool EnteredGammme = false;
|
||||
LeechDetectedCorrectly = false;
|
||||
ScriptDone = false;
|
||||
|
||||
string LastGameName = Form1_0.GameStruc_0.GameName;
|
||||
string SearchSameGame = "";
|
||||
if (LastGameName != "" && SameGameRetry < 20 && SearchSameGamesAsLastOne)
|
||||
{
|
||||
SearchSameGame = LastGameName.Substring(0, LastGameName.Length - 2);
|
||||
}
|
||||
|
||||
if (Form1_0.GameStruc_0.AllGamesNames.Count > 0)
|
||||
{
|
||||
|
@ -38,13 +78,38 @@ namespace app
|
|||
|
||||
for (int i = 0; i < Form1_0.GameStruc_0.AllGamesNames.Count; i++)
|
||||
{
|
||||
if (Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("chaos")
|
||||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("umf")
|
||||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("u-mf")
|
||||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("u mf")
|
||||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("baal"))
|
||||
if (!Form1_0.Running)
|
||||
{
|
||||
PossibleGamesIndex.Add(i);
|
||||
break;
|
||||
}
|
||||
|
||||
if (SearchSameGame != "")
|
||||
{
|
||||
if (Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains(SearchSameGame.ToLower())
|
||||
&& Form1_0.GameStruc_0.AllGamesNames[i] != LastGameName)
|
||||
{
|
||||
PossibleGamesIndex.Add(i);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("chaos")
|
||||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("umf")
|
||||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("u-mf")
|
||||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("u mf")
|
||||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("baal")
|
||||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("umf")
|
||||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("u-mf")
|
||||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("u mf")
|
||||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("help")
|
||||
&& !Form1_0.GameStruc_0.AllGamesNames[i].ToLower().Contains("walk")
|
||||
&& Form1_0.GameStruc_0.AllGamesNames[i] != LastGameName) //not equal last gamename
|
||||
{
|
||||
if (!Form1_0.GameStruc_0.TriedThisGame(Form1_0.GameStruc_0.AllGamesNames[i]))
|
||||
{
|
||||
PossibleGamesIndex.Add(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,14 +118,37 @@ namespace app
|
|||
{
|
||||
for (int i = 0; i < PossibleGamesIndex.Count; i++)
|
||||
{
|
||||
if (!Form1_0.Running)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
Form1_0.SetGameStatus("SEARCHING:" + Form1_0.GameStruc_0.AllGamesNames[PossibleGamesIndex[i]]);
|
||||
|
||||
Form1_0.GameStruc_0.SelectGame(PossibleGamesIndex[i], false);
|
||||
if (!Form1_0.GameStruc_0.SelectedGameName.Contains(Form1_0.GameStruc_0.AllGamesNames[PossibleGamesIndex[i]]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (Form1_0.GameStruc_0.SelectedGameTime < MaxGameTimeToEnter)
|
||||
{
|
||||
Form1_0.GameStruc_0.SelectGame(PossibleGamesIndex[i], true);
|
||||
Form1_0.WaitDelay(300);
|
||||
EnteredGammme = true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.GameStruc_0.AllGamesTriedNames.Add(Form1_0.GameStruc_0.AllGamesNames[PossibleGamesIndex[i]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!EnteredGammme)
|
||||
{
|
||||
if (SearchSameGame != "")
|
||||
{
|
||||
SameGameRetry++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +156,21 @@ namespace app
|
|||
|
||||
public void RunScript()
|
||||
{
|
||||
Form1_0.Town_0.ScriptTownAct = 4; //set to town act 4 when running this script
|
||||
SameGameRetry = 0;
|
||||
GetLeechInfo();
|
||||
if (Form1_0.PlayerScan_0.LeechPlayerPointer == 0 || Form1_0.PlayerScan_0.LeechPlayerUnitID == 0)
|
||||
{
|
||||
ScriptDone = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Form1_0.Running || !Form1_0.GameStruc_0.IsInGame())
|
||||
{
|
||||
ScriptDone = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Form1_0.Town_0.GetInTown())
|
||||
{
|
||||
Form1_0.SetGameStatus("WAITING TP");
|
||||
|
@ -79,7 +181,13 @@ namespace app
|
|||
//if (Form1_0.ObjectsStruc_0.GetObjects("TownPortal", Form1_0.PlayerScan_0.LeechPlayerUnitID))
|
||||
if (Form1_0.ObjectsStruc_0.GetObjects("TownPortal", true))
|
||||
{
|
||||
//CastDefense();
|
||||
if (!CastedDefense)
|
||||
{
|
||||
Form1_0.Battle_0.CastDefense();
|
||||
CastedDefense = true;
|
||||
Form1_0.WaitDelay(30);
|
||||
}
|
||||
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, Form1_0.ObjectsStruc_0.itemx, Form1_0.ObjectsStruc_0.itemy);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.WaitDelay(100);
|
||||
|
@ -104,43 +212,274 @@ namespace app
|
|||
{
|
||||
if (CurrentStep == 0)
|
||||
{
|
||||
CastDefense();
|
||||
Form1_0.Battle_0.CastDefense();
|
||||
CurrentStep++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.SetGameStatus("LEECHING");
|
||||
|
||||
//not correct location check
|
||||
if (Form1_0.PlayerScan_0.levelNo != 108)
|
||||
{
|
||||
|
||||
if (Form1_0.ObjectsStruc_0.GetObjects("TownPortal", true, IgnoredTPList))
|
||||
{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, Form1_0.ObjectsStruc_0.itemx, Form1_0.ObjectsStruc_0.itemy);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.WaitDelay(100);
|
||||
}
|
||||
|
||||
Form1_0.method_1("Added ignored TP ID: " + LastUsedTP_ID, Color.Red);
|
||||
|
||||
IgnoredTPList.Add(LastUsedTP_ID);
|
||||
Form1_0.Town_0.UseLastTP = false;
|
||||
AddingIgnoredTP_ID = true;
|
||||
Form1_0.Town_0.GoToTown();
|
||||
return;
|
||||
}
|
||||
|
||||
Form1_0.PlayerScan_0.GetLeechPositions();
|
||||
|
||||
while (Form1_0.PlayerScan_0.LeechlevelNo != 108 && !LeechDetectedCorrectly)
|
||||
{
|
||||
if (!Form1_0.Running || !Form1_0.GameStruc_0.IsInGame())
|
||||
{
|
||||
ScriptDone = true;
|
||||
return;
|
||||
}
|
||||
|
||||
int PlayerLeechIndex = 1;
|
||||
|
||||
while(true)
|
||||
{
|
||||
Form1_0.GameStruc_0.GameOwnerName = Form1_0.GameStruc_0.AllPlayersNames[PlayerLeechIndex];
|
||||
GetLeechInfo();
|
||||
if (Form1_0.PlayerScan_0.LeechPlayerPointer == 0 || Form1_0.PlayerScan_0.LeechPlayerUnitID == 0) return;
|
||||
Form1_0.PlayerScan_0.GetLeechPositions();
|
||||
|
||||
if (!Form1_0.Running || !Form1_0.GameStruc_0.IsInGame())
|
||||
{
|
||||
ScriptDone = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Form1_0.PlayerScan_0.LeechlevelNo != 108)
|
||||
{
|
||||
PlayerLeechIndex++;
|
||||
if (PlayerLeechIndex > Form1_0.GameStruc_0.AllPlayersNames.Count - 1)
|
||||
{
|
||||
Form1_0.Town_0.GoToTown();
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.method_1("Leecher Changed to: " + Form1_0.GameStruc_0.GameOwnerName, Color.DarkGreen);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LeechDetectedCorrectly = true;
|
||||
SearchSameGamesAsLastOne = false;
|
||||
|
||||
//Form1_0.method_1("Leecher: " + Form1_0.PlayerScan_0.LeechPosX + ", " + Form1_0.PlayerScan_0.LeechPosY);
|
||||
/*if (Form1_0.PlayerScan_0.LeechPosX == 0 && Form1_0.PlayerScan_0.LeechPosY == 0)
|
||||
{
|
||||
//Form1_0.LeaveGame();
|
||||
return;
|
||||
}*/
|
||||
|
||||
List<Tuple<int, int>> monsterPositions = Form1_0.MobsStruc_0.GetAllMobsNearby();
|
||||
|
||||
if (IsMonsterPosition(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, monsterPositions))
|
||||
{
|
||||
int IndexToCheck = LastLeechPositions.Count - 2;
|
||||
if (IndexToCheck >= 0)
|
||||
{
|
||||
|
||||
bool MonsterNearby = IsMonsterPosition(LastLeechPositions[IndexToCheck].Item1, LastLeechPositions[IndexToCheck].Item2, monsterPositions);
|
||||
while (MonsterNearby)
|
||||
{
|
||||
if (!Form1_0.Running || !Form1_0.GameStruc_0.IsInGame())
|
||||
{
|
||||
ScriptDone = true;
|
||||
return;
|
||||
}
|
||||
|
||||
IndexToCheck--;
|
||||
|
||||
if (IndexToCheck >= 0)
|
||||
{
|
||||
//monsterPositions = Form1_0.MobsStruc_0.GetAllMobsNearby();
|
||||
MonsterNearby = IsMonsterPosition(LastLeechPositions[IndexToCheck].Item1, LastLeechPositions[IndexToCheck].Item2, monsterPositions);
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!MonsterNearby)
|
||||
{
|
||||
Form1_0.method_1("Move to Safe Pos: " + LastLeechPositions[IndexToCheck].Item1 + ", " + LastLeechPositions[IndexToCheck].Item2, Color.DarkGreen);
|
||||
Form1_0.Mover_0.MoveToLocation(LastLeechPositions[IndexToCheck].Item1, LastLeechPositions[IndexToCheck].Item2, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Form1_0.PlayerScan_0.GetLeechPositions();
|
||||
if (Form1_0.PlayerScan_0.LeechlevelNo != 108) return;
|
||||
if (Form1_0.PlayerScan_0.LeechPosX == 0 && Form1_0.PlayerScan_0.LeechPosY == 0)
|
||||
{
|
||||
//Form1_0.LeaveGame();
|
||||
return;
|
||||
}
|
||||
|
||||
int DiffXPlayer = Form1_0.PlayerScan_0.LeechPosX - Form1_0.PlayerScan_0.xPos;
|
||||
int DiffYPlayer = Form1_0.PlayerScan_0.LeechPosY - Form1_0.PlayerScan_0.yPos;
|
||||
if (DiffXPlayer < 0) DiffXPlayer = -DiffXPlayer;
|
||||
if (DiffYPlayer < 0) DiffYPlayer = -DiffYPlayer;
|
||||
|
||||
if (DiffXPlayer > 5 || DiffYPlayer > 5)
|
||||
//Move to leecher
|
||||
if (LastLeechPosXNEW != Form1_0.PlayerScan_0.LeechPosX && LastLeechPosYNEW != Form1_0.PlayerScan_0.LeechPosY)
|
||||
{
|
||||
Form1_0.SetGameStatus("LEECHING-MOVE");
|
||||
Form1_0.Mover_0.MoveToLocation(Form1_0.PlayerScan_0.LeechPosX, Form1_0.PlayerScan_0.LeechPosY);
|
||||
LastLeechPositions.Add(Tuple.Create(Form1_0.PlayerScan_0.LeechPosX, Form1_0.PlayerScan_0.LeechPosY));
|
||||
|
||||
LastLeechPosXNEW = Form1_0.PlayerScan_0.LeechPosX;
|
||||
LastLeechPosYNEW = Form1_0.PlayerScan_0.LeechPosY;
|
||||
}
|
||||
|
||||
/*Tuple<int, int> bestPosition = FindBestPosition(Form1_0.PlayerScan_0.LeechPosX, Form1_0.PlayerScan_0.LeechPosY, monsterPositions, 5);
|
||||
|
||||
if (bestPosition.Item1 != 0 && bestPosition.Item2 != 0)
|
||||
{
|
||||
if (bestPosition.Item1 != LastLeechPosX && bestPosition.Item2 != LastLeechPosY)
|
||||
{
|
||||
if (Form1_0.PlayerScan_0.LeechlevelNo != 108) return;
|
||||
|
||||
GoodPositions.Add(Tuple.Create(bestPosition.Item1, bestPosition.Item2));
|
||||
Form1_0.method_1("Move to Leecher Pos: " + bestPosition.Item1 + ", " + bestPosition.Item2, Color.DarkGreen);
|
||||
Form1_0.Mover_0.MoveToLocation(bestPosition.Item1, bestPosition.Item2);
|
||||
|
||||
LastLeechPosX = bestPosition.Item1;
|
||||
LastLeechPosY = bestPosition.Item2;
|
||||
}
|
||||
else
|
||||
{*/
|
||||
int ThisCheckIndex = LastLeechPositions.Count - 1;
|
||||
while (true)
|
||||
{
|
||||
if (!Form1_0.Running || !Form1_0.GameStruc_0.IsInGame())
|
||||
{
|
||||
ScriptDone = true;
|
||||
return;
|
||||
}
|
||||
|
||||
Tuple<int, int> bestPosition = FindBestPosition(LastLeechPositions[ThisCheckIndex].Item1, LastLeechPositions[ThisCheckIndex].Item2, monsterPositions, 4);
|
||||
if (bestPosition.Item1 != 0 && bestPosition.Item2 != 0)
|
||||
{
|
||||
if (bestPosition.Item1 != LastLeechPosX && bestPosition.Item2 != LastLeechPosY)
|
||||
{
|
||||
if (IsMonsterPosition(bestPosition.Item1, bestPosition.Item2, monsterPositions))
|
||||
{
|
||||
ThisCheckIndex--;
|
||||
if (ThisCheckIndex < 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (bestPosition.Item1 - Form1_0.PlayerScan_0.xPosFinal > 300
|
||||
|| bestPosition.Item1 - Form1_0.PlayerScan_0.xPosFinal < -300
|
||||
|| bestPosition.Item2 - Form1_0.PlayerScan_0.yPosFinal > 300
|
||||
|| bestPosition.Item2 - Form1_0.PlayerScan_0.yPosFinal < -300)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (Form1_0.PlayerScan_0.LeechlevelNo != 108) return;
|
||||
|
||||
//GoodPositions.Add(Tuple.Create(bestPosition.Item1, bestPosition.Item2));
|
||||
Form1_0.method_1("Move to Leecher Pos #2: " + bestPosition.Item1 + ", " + bestPosition.Item2, Color.DarkGreen);
|
||||
Form1_0.Mover_0.MoveToLocation(bestPosition.Item1, bestPosition.Item2, true);
|
||||
|
||||
LastLeechPosX = bestPosition.Item1;
|
||||
LastLeechPosY = bestPosition.Item2;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (IsMonsterPosition(LastLeechPosX, LastLeechPosY, monsterPositions))
|
||||
{
|
||||
ThisCheckIndex--;
|
||||
if (ThisCheckIndex < 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void CastDefense()
|
||||
|
||||
static Tuple<int, int> FindBestPosition(int playerX, int playerY, List<Tuple<int, int>> monsterPositions, int maxDisplacement)
|
||||
{
|
||||
//cast sacred shield
|
||||
Form1_0.KeyMouse_0.PressKey(CharConfig.KeySkillCastDefense);
|
||||
Form1_0.WaitDelay(5);
|
||||
Form1_0.KeyMouse_0.MouseCliccRight(Form1_0.CenterX, Form1_0.CenterY);
|
||||
Form1_0.WaitDelay(5);
|
||||
// Create a list to store all possible positions around the player
|
||||
List<Tuple<int, int>> possiblePositions = new List<Tuple<int, int>>();
|
||||
|
||||
// Generate all possible positions within the maximum displacement range
|
||||
for (int x = playerX - maxDisplacement; x <= playerX + maxDisplacement; x++)
|
||||
{
|
||||
for (int y = playerY - maxDisplacement; y <= playerY + maxDisplacement; y++)
|
||||
{
|
||||
// Calculate the distance between the player and the current position
|
||||
double distance = Math.Sqrt(Math.Pow(playerX - x, 2) + Math.Pow(playerY - y, 2));
|
||||
|
||||
// Check if the distance is within the maximum displacement and the position is not occupied by a monster
|
||||
if (distance <= maxDisplacement && !IsMonsterPosition(x, y, monsterPositions))
|
||||
{
|
||||
possiblePositions.Add(Tuple.Create(x, y));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Find the closest position among the possible positions
|
||||
Tuple<int, int> bestPosition = Tuple.Create(playerX, playerY);
|
||||
double closestDistance = double.MaxValue;
|
||||
foreach (var position in possiblePositions)
|
||||
{
|
||||
double distance = Math.Sqrt(Math.Pow(playerX - position.Item1, 2) + Math.Pow(playerY - position.Item2, 2));
|
||||
if (distance < closestDistance)
|
||||
{
|
||||
closestDistance = distance;
|
||||
bestPosition = position;
|
||||
}
|
||||
}
|
||||
|
||||
return bestPosition;
|
||||
}
|
||||
|
||||
static bool IsMonsterPosition(int x, int y, List<Tuple<int, int>> monsterPositions)
|
||||
{
|
||||
foreach (var monsterPosition in monsterPositions)
|
||||
{
|
||||
if (monsterPosition.Item1 >= x - 8
|
||||
&& monsterPosition.Item1 <= x + 8
|
||||
&& monsterPosition.Item2 >= y - 8
|
||||
&& monsterPosition.Item2 <= y + 8)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void GetLeechInfo()
|
||||
|
@ -149,16 +488,21 @@ namespace app
|
|||
|
||||
if (!PrintedInfos)
|
||||
{
|
||||
Form1_0.method_1("Leecher name: " + Form1_0.GameStruc_0.GameOwnerName, Color.Violet);
|
||||
Form1_0.method_1("Leecher pointer: 0x" + Form1_0.PlayerScan_0.LeechPlayerPointer.ToString("X"), Color.Violet);
|
||||
Form1_0.method_1("Leecher unitID: 0x" + Form1_0.PlayerScan_0.LeechPlayerUnitID.ToString("X"), Color.Violet);
|
||||
Form1_0.method_1("Leecher name: " + Form1_0.GameStruc_0.GameOwnerName, Color.DarkTurquoise);
|
||||
Form1_0.method_1("Leecher pointer: 0x" + Form1_0.PlayerScan_0.LeechPlayerPointer.ToString("X"), Color.DarkTurquoise);
|
||||
Form1_0.method_1("Leecher unitID: 0x" + Form1_0.PlayerScan_0.LeechPlayerUnitID.ToString("X"), Color.DarkTurquoise);
|
||||
PrintedInfos = true;
|
||||
}
|
||||
|
||||
//LEECHER NOT IN GAME
|
||||
if (Form1_0.PlayerScan_0.LeechPlayerPointer == 0 || Form1_0.PlayerScan_0.LeechPlayerUnitID == 0)
|
||||
{
|
||||
Form1_0.LeaveGame(true);
|
||||
if (Form1_0.Running && Form1_0.GameStruc_0.IsInGame())
|
||||
{
|
||||
Form1_0.ItemsStruc_0.GrabAllItemsForGold();
|
||||
SearchSameGamesAsLastOne = true;
|
||||
Form1_0.LeaveGame(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,160 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace app
|
||||
{
|
||||
public class Countess
|
||||
{
|
||||
Form1 Form1_0;
|
||||
|
||||
public int CurrentStep = 0;
|
||||
public bool ScriptDone = false;
|
||||
|
||||
|
||||
public void SetForm1(Form1 form1_1)
|
||||
{
|
||||
Form1_0 = form1_1;
|
||||
}
|
||||
|
||||
public void ResetVars()
|
||||
{
|
||||
CurrentStep = 0;
|
||||
ScriptDone = false;
|
||||
}
|
||||
|
||||
public void RunScript()
|
||||
{
|
||||
Form1_0.Town_0.ScriptTownAct = 5; //set to town act 5 when running this script
|
||||
|
||||
if (Form1_0.Town_0.GetInTown())
|
||||
{
|
||||
Form1_0.SetGameStatus("GO TO WP");
|
||||
CurrentStep = 0;
|
||||
|
||||
Form1_0.Town_0.GoToWPArea(1, 4);
|
||||
|
||||
//close to store spot 5078, 5026
|
||||
/*if (Form1_0.Town_0.IsPosCloseTo(5084, 5037, 7))
|
||||
{
|
||||
//move close to tp location
|
||||
Form1_0.Mover_0.MoveToLocation(5103, 5029);
|
||||
}
|
||||
else
|
||||
{
|
||||
//move close to wp location
|
||||
if (Form1_0.Mover_0.MoveToLocation(5119, 5067))
|
||||
{
|
||||
//use wp
|
||||
//if (Form1_0.ObjectsStruc_0.GetObjects("ExpansionWaypoint", false))
|
||||
//{
|
||||
//Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, Form1_0.ObjectsStruc_0.itemx, Form1_0.ObjectsStruc_0.itemy);
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, 5114, 5069);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.Mover_0.FinishMoving();
|
||||
if (Form1_0.UIScan_0.WaitTilUIOpen("waypointMenu"))
|
||||
{
|
||||
Form1_0.KeyMouse_0.MouseClicc(415, 220); //select act3
|
||||
Form1_0.WaitDelay(50);
|
||||
Form1_0.KeyMouse_0.MouseClicc(400, 515); //select kurast wp
|
||||
Form1_0.UIScan_0.WaitTilUIClose("waypointMenu");
|
||||
Form1_0.UIScan_0.WaitTilUIClose("loading");
|
||||
Form1_0.WaitDelay(350);
|
||||
}
|
||||
//}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CurrentStep == 0)
|
||||
{
|
||||
Form1_0.SetGameStatus("DOING COUNTESS");
|
||||
Form1_0.Battle_0.CastDefense();
|
||||
Form1_0.WaitDelay(15);
|
||||
|
||||
if ((Enums.Area) Form1_0.PlayerScan_0.levelNo == Enums.Area.BlackMarsh)
|
||||
{
|
||||
CurrentStep++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.Town_0.GoToTown();
|
||||
}
|
||||
}
|
||||
|
||||
if (CurrentStep == 1)
|
||||
{
|
||||
Form1_0.MoveToPath_0.MoveToArea(Enums.Area.ForgottenTower);
|
||||
Form1_0.MoveToPath_0.MoveToArea(Enums.Area.TowerCellarLevel1);
|
||||
Form1_0.MoveToPath_0.MoveToArea(Enums.Area.TowerCellarLevel2);
|
||||
Form1_0.MoveToPath_0.MoveToArea(Enums.Area.TowerCellarLevel3);
|
||||
Form1_0.MoveToPath_0.MoveToArea(Enums.Area.TowerCellarLevel4);
|
||||
Form1_0.MoveToPath_0.MoveToArea(Enums.Area.TowerCellarLevel5);
|
||||
CurrentStep++;
|
||||
}
|
||||
|
||||
if (CurrentStep == 2)
|
||||
{
|
||||
MapAreaStruc.Position ThisChestPos = Form1_0.MapAreaStruc_0.GetPositionOfObject("object", "GoodChest", 78, new List<int>());
|
||||
|
||||
//Form1_0.ItemsStruc_0.GrabAllItemsForGold();
|
||||
if (Form1_0.Mover_0.MoveToLocation(ThisChestPos.X, ThisChestPos.Y))
|
||||
{
|
||||
CurrentStep++;
|
||||
}
|
||||
}
|
||||
|
||||
if (CurrentStep == 3)
|
||||
{
|
||||
Form1_0.Potions_0.CanUseSkillForRegen = false;
|
||||
Form1_0.SetGameStatus("KILLING COUNTESS");
|
||||
if (Form1_0.MobsStruc_0.GetMobs("getSuperUniqueName", "The Countess", false, 200, new List<long>()))
|
||||
{
|
||||
if (Form1_0.MobsStruc_0.MobsHP > 0)
|
||||
{
|
||||
Form1_0.Battle_0.RunBattleScriptOnThisMob("getSuperUniqueName", "The Countess");
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GrabAllItemsForGold();
|
||||
Form1_0.Potions_0.CanUseSkillForRegen = true;
|
||||
|
||||
ScriptDone = true;
|
||||
return;
|
||||
//Form1_0.LeaveGame(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.method_1("Countess not detected!", Color.Red);
|
||||
|
||||
//baal not detected...
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
if (Form1_0.MobsStruc_0.GetMobs("getSuperUniqueName", "The Countess", false, 200, new List<long>())) return; //redetect baal?
|
||||
Form1_0.ItemsStruc_0.GrabAllItemsForGold();
|
||||
if (Form1_0.MobsStruc_0.GetMobs("getSuperUniqueName", "The Countess", false, 200, new List<long>())) return; //redetect baal?
|
||||
Form1_0.Potions_0.CanUseSkillForRegen = true;
|
||||
|
||||
ScriptDone = true;
|
||||
return;
|
||||
//Form1_0.LeaveGame(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,181 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static app.MapAreaStruc;
|
||||
|
||||
namespace app
|
||||
{
|
||||
public class Duriel
|
||||
{
|
||||
Form1 Form1_0;
|
||||
|
||||
public int CurrentStep = 0;
|
||||
public bool ScriptDone = false;
|
||||
public Position OrificePos = new Position { X = 0, Y = 0 };
|
||||
|
||||
|
||||
public void SetForm1(Form1 form1_1)
|
||||
{
|
||||
Form1_0 = form1_1;
|
||||
}
|
||||
|
||||
public void ResetVars()
|
||||
{
|
||||
CurrentStep = 0;
|
||||
ScriptDone = false;
|
||||
}
|
||||
|
||||
public void RunScript()
|
||||
{
|
||||
Form1_0.Town_0.ScriptTownAct = 5; //set to town act 5 when running this script
|
||||
|
||||
if (Form1_0.Town_0.GetInTown())
|
||||
{
|
||||
Form1_0.SetGameStatus("GO TO WP");
|
||||
CurrentStep = 0;
|
||||
|
||||
Form1_0.Town_0.GoToWPArea(2, 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CurrentStep == 0)
|
||||
{
|
||||
Form1_0.SetGameStatus("DOING DURIEL");
|
||||
Form1_0.Battle_0.CastDefense();
|
||||
Form1_0.WaitDelay(15);
|
||||
|
||||
if ((Enums.Area) Form1_0.PlayerScan_0.levelNo == Enums.Area.CanyonOfTheMagi)
|
||||
{
|
||||
CurrentStep++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.Town_0.GoToTown();
|
||||
}
|
||||
}
|
||||
|
||||
if (CurrentStep == 1)
|
||||
{
|
||||
//id":152, "type":"object", "x":453, "y":258, "name":"orifice", "op":25, "class":"quest"}
|
||||
//Detect the correct tomb where Duriel hide
|
||||
OrificePos = Form1_0.MapAreaStruc_0.GetAreaOfObject("object", "HoradricOrifice", new List<int>(), 65, 72);
|
||||
if (OrificePos.X != 0 && OrificePos.Y != 0)
|
||||
{
|
||||
//"id":71, "type":"exit", "x":214, "y":25, "isGoodExit":true}
|
||||
//Form1_0.method_1("Moving to: " + ((Enums.Area)(Form1_0.MapAreaStruc_0.CurrentObjectAreaIndex + 1)), Color.Red);
|
||||
Position ThisFinalPosition = Form1_0.MapAreaStruc_0.GetPositionOfObject("exit", Form1_0.Town_0.getAreaName((int)Form1_0.MapAreaStruc_0.CurrentObjectAreaIndex + 1), (int) (Form1_0.PlayerScan_0.levelNo - 1), new List<int>() { });
|
||||
if (Form1_0.Mover_0.MoveToLocation(ThisFinalPosition.X, ThisFinalPosition.Y))
|
||||
{
|
||||
int Tryyyy = 0;
|
||||
while (Form1_0.PlayerScan_0.levelNo == 46 && Tryyyy <= 25)
|
||||
{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, ThisFinalPosition.X, ThisFinalPosition.Y);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
Tryyyy++;
|
||||
}
|
||||
//didn't clic correctly on tomb door, substract some pixels
|
||||
Tryyyy = 0;
|
||||
while (Form1_0.PlayerScan_0.levelNo == 46 && Tryyyy <= 25)
|
||||
{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, ThisFinalPosition.X, ThisFinalPosition.Y);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"] - 70, itemScreenPos["y"]);
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
Tryyyy++;
|
||||
}
|
||||
//didn't clic correctly on tomb door, substract some pixels
|
||||
Tryyyy = 0;
|
||||
while (Form1_0.PlayerScan_0.levelNo == 46 && Tryyyy <= 25)
|
||||
{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, ThisFinalPosition.X, ThisFinalPosition.Y);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"] + 70, itemScreenPos["y"]);
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
Tryyyy++;
|
||||
}
|
||||
|
||||
Form1_0.MoveToPath_0.MoveToThisPos(OrificePos); //Move to Orifice
|
||||
|
||||
CurrentStep++;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.method_1("Duriel location not detected!", Color.Red);
|
||||
//ScriptDone = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (CurrentStep == 3)
|
||||
{
|
||||
int Tryyyy = 0;
|
||||
int StartLevel = (int) Form1_0.PlayerScan_0.levelNo;
|
||||
while ((int) Form1_0.PlayerScan_0.levelNo == StartLevel && Tryyyy <= 25)
|
||||
{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, OrificePos.X, OrificePos.Y);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"] - 446, itemScreenPos["y"] - 268);
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
Tryyyy++;
|
||||
}
|
||||
|
||||
if ((Enums.Area)Form1_0.PlayerScan_0.levelNo == Enums.Area.DurielsLair)
|
||||
{
|
||||
CurrentStep++;
|
||||
}
|
||||
}
|
||||
|
||||
if (CurrentStep == 4)
|
||||
{
|
||||
Form1_0.Potions_0.CanUseSkillForRegen = false;
|
||||
Form1_0.SetGameStatus("KILLING DURIEL");
|
||||
if (Form1_0.MobsStruc_0.GetMobs("getBossName", "Duriel", false, 200, new List<long>()))
|
||||
{
|
||||
if (Form1_0.MobsStruc_0.MobsHP > 0)
|
||||
{
|
||||
Form1_0.Battle_0.RunBattleScriptOnThisMob("getBossName", "Duriel");
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GrabAllItemsForGold();
|
||||
Form1_0.Potions_0.CanUseSkillForRegen = true;
|
||||
|
||||
ScriptDone = true;
|
||||
return;
|
||||
//Form1_0.LeaveGame(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.method_1("Duriel not detected!", Color.Red);
|
||||
|
||||
//baal not detected...
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
if (Form1_0.MobsStruc_0.GetMobs("getBossName", "Duriel", false, 200, new List<long>())) return; //redetect baal?
|
||||
Form1_0.ItemsStruc_0.GrabAllItemsForGold();
|
||||
if (Form1_0.MobsStruc_0.GetMobs("getBossName", "Duriel", false, 200, new List<long>())) return; //redetect baal?
|
||||
Form1_0.Potions_0.CanUseSkillForRegen = true;
|
||||
|
||||
ScriptDone = true;
|
||||
return;
|
||||
//Form1_0.LeaveGame(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,15 +12,11 @@ namespace app
|
|||
Form1 Form1_0;
|
||||
|
||||
public int CurrentStep = 0;
|
||||
public int MapStyle = 0;
|
||||
public int WP_X = 0;
|
||||
public int WP_Y = 0;
|
||||
public List<uint> IgnoredChestList = new List<uint>();
|
||||
public List<int> IgnoredChestList = new List<int>();
|
||||
public bool ScriptDone = false;
|
||||
|
||||
public int[] ChestPos1 = new int[2];
|
||||
public int[] ChestPos2 = new int[2];
|
||||
|
||||
public void SetForm1(Form1 form1_1)
|
||||
{
|
||||
Form1_0 = form1_1;
|
||||
|
@ -29,10 +25,9 @@ namespace app
|
|||
public void ResetVars()
|
||||
{
|
||||
CurrentStep = 0;
|
||||
MapStyle = 0;
|
||||
WP_X = 0;
|
||||
WP_Y = 0;
|
||||
IgnoredChestList = new List<uint>();
|
||||
IgnoredChestList = new List<int>();
|
||||
ScriptDone = false;
|
||||
}
|
||||
|
||||
|
@ -45,8 +40,9 @@ namespace app
|
|||
Form1_0.SetGameStatus("GO TO WP");
|
||||
CurrentStep = 0;
|
||||
|
||||
Form1_0.Town_0.GoToWPArea(3, 4);
|
||||
//close to store spot 5078, 5026
|
||||
if (Form1_0.Town_0.IsPosCloseTo(5084, 5037, 7))
|
||||
/*if (Form1_0.Town_0.IsPosCloseTo(5084, 5037, 7))
|
||||
{
|
||||
//move close to tp location
|
||||
Form1_0.Mover_0.MoveToLocation(5103, 5029);
|
||||
|
@ -74,158 +70,59 @@ namespace app
|
|||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CurrentStep == 0)
|
||||
{
|
||||
Form1_0.SetGameStatus("DOING KURAST");
|
||||
CastDefense();
|
||||
Form1_0.Battle_0.CastDefense();
|
||||
Form1_0.WaitDelay(15);
|
||||
|
||||
if (Form1_0.PlayerScan_0.levelNo == 79)
|
||||
{
|
||||
WP_X = Form1_0.PlayerScan_0.xPos - 3;
|
||||
WP_Y = Form1_0.PlayerScan_0.yPos - 3;
|
||||
|
||||
CurrentStep++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.Town_0.GoToTown();
|
||||
}
|
||||
}
|
||||
|
||||
if (CurrentStep == 1)
|
||||
{
|
||||
if (Form1_0.ObjectsStruc_0.GetObjects("Act3TownWaypoint", false))
|
||||
{
|
||||
WP_X = Form1_0.ObjectsStruc_0.itemx;
|
||||
WP_Y = Form1_0.ObjectsStruc_0.itemy;
|
||||
TakeChest();
|
||||
|
||||
if (Form1_0.ObjectsStruc_0.itemx == 5814 && Form1_0.ObjectsStruc_0.itemy == 3134)
|
||||
{
|
||||
MapStyle = 1;
|
||||
ChestPos1 = new int[2] { 5699, 3178 };
|
||||
ChestPos2 = new int[2] { 5663, 3218 };
|
||||
}
|
||||
if (Form1_0.ObjectsStruc_0.itemx == 5334 && Form1_0.ObjectsStruc_0.itemy == 2614)
|
||||
{
|
||||
MapStyle = 2;
|
||||
ChestPos1 = new int[2] { 5423, 2618 };
|
||||
ChestPos2 = new int[2] { 5457, 2576 };
|
||||
}
|
||||
if (Form1_0.ObjectsStruc_0.itemx == 4454 && Form1_0.ObjectsStruc_0.itemy == 2814)
|
||||
{
|
||||
MapStyle = 3;
|
||||
ChestPos1 = new int[2] { 4421, 2896 };
|
||||
ChestPos2 = new int[2] { 4455, 2857 };
|
||||
}
|
||||
if (Form1_0.ObjectsStruc_0.itemx == 5054 && Form1_0.ObjectsStruc_0.itemy == 1934)
|
||||
{
|
||||
MapStyle = 4;
|
||||
ChestPos1 = new int[2] { 5182, 1898 };
|
||||
ChestPos2 = new int[2] { 5217, 1857 };
|
||||
}
|
||||
if (Form1_0.ObjectsStruc_0.itemx == 5014 && Form1_0.ObjectsStruc_0.itemy == 2814)
|
||||
{
|
||||
MapStyle = 5;
|
||||
ChestPos1 = new int[2] { 5063, 2936 };
|
||||
ChestPos2 = new int[2] { 5098, 2897 };
|
||||
}
|
||||
if (Form1_0.ObjectsStruc_0.itemx == 5094 && Form1_0.ObjectsStruc_0.itemy == 2894)
|
||||
{
|
||||
MapStyle = 6;
|
||||
ChestPos1 = new int[2] { 5183, 2856 };
|
||||
ChestPos2 = new int[2] { 5219, 2816 };
|
||||
}
|
||||
if (Form1_0.ObjectsStruc_0.itemx == 5094 && Form1_0.ObjectsStruc_0.itemy == 2934)
|
||||
{
|
||||
MapStyle = 7;
|
||||
ChestPos1 = new int[2] { 5061, 2856 };
|
||||
ChestPos2 = new int[2] { 5098, 2816 };
|
||||
}
|
||||
if (Form1_0.ObjectsStruc_0.itemx == 5614 && Form1_0.ObjectsStruc_0.itemy == 3134)
|
||||
{
|
||||
MapStyle = 8;
|
||||
ChestPos1 = new int[2] { 5544, 3178 };
|
||||
ChestPos2 = new int[2] { 5579, 3137 };
|
||||
}
|
||||
if (Form1_0.ObjectsStruc_0.itemx == 5094 && Form1_0.ObjectsStruc_0.itemy == 3014)
|
||||
{
|
||||
MapStyle = 9;
|
||||
ChestPos1 = new int[2] { 5105, 2895 };
|
||||
ChestPos2 = new int[2] { 5137, 2855 };
|
||||
}
|
||||
}
|
||||
|
||||
if (MapStyle == 0)
|
||||
{
|
||||
Form1_0.method_1("UNKOWN KURAST MAPSTYLE, WP POS: " + Form1_0.ObjectsStruc_0.itemx + ", " + Form1_0.ObjectsStruc_0.itemy, Color.Red);
|
||||
if (WP_X != 0 && WP_Y != 0)
|
||||
{
|
||||
TakeChest();
|
||||
TakeChest();
|
||||
TakeChest();
|
||||
TakeChest();
|
||||
TakeChest();
|
||||
TakeChest();
|
||||
Form1_0.ItemsStruc_0.GrabAllItemsForGold();
|
||||
}
|
||||
CurrentStep += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.method_1("KURAST MAPSTYLE #" + MapStyle, Color.DarkGreen);
|
||||
|
||||
if (Form1_0.Mover_0.MoveToLocation(ChestPos1[0], ChestPos1[1]))
|
||||
{
|
||||
//Form1_0.WaitDelay(250);
|
||||
TakeChest();
|
||||
CurrentStep++;
|
||||
}
|
||||
}
|
||||
CurrentStep++;
|
||||
}
|
||||
|
||||
if (CurrentStep == 2)
|
||||
{
|
||||
if (Form1_0.Mover_0.MoveToLocation(ChestPos2[0], ChestPos2[1]))
|
||||
{
|
||||
//Form1_0.WaitDelay(250);
|
||||
TakeChest();
|
||||
CurrentStep++;
|
||||
}
|
||||
}
|
||||
//Form1_0.ItemsStruc_0.GrabAllItemsForGold();
|
||||
|
||||
if (CurrentStep == 3)
|
||||
{
|
||||
if (WP_X != 0 && WP_Y != 0)
|
||||
//Form1_0.LeaveGame(true);
|
||||
|
||||
if (Form1_0.Mover_0.MoveToLocation(WP_X, WP_Y))
|
||||
{
|
||||
Form1_0.ItemsStruc_0.GrabAllItemsForGold();
|
||||
if (Form1_0.Mover_0.MoveToLocation(WP_X, WP_Y))
|
||||
{
|
||||
//take back wp
|
||||
if (Form1_0.ObjectsStruc_0.GetObjects("Act3TownWaypoint", false))
|
||||
//take back wp
|
||||
//if (Form1_0.ObjectsStruc_0.GetObjects("Act3TownWaypoint", false))
|
||||
//{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, WP_X, WP_Y);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
//Form1_0.Mover_0.FinishMoving();
|
||||
if (Form1_0.UIScan_0.WaitTilUIOpen("waypointMenu"))
|
||||
{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, Form1_0.ObjectsStruc_0.itemx, Form1_0.ObjectsStruc_0.itemy);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.Mover_0.FinishMoving();
|
||||
if (Form1_0.UIScan_0.WaitTilUIOpen("waypointMenu"))
|
||||
{
|
||||
Form1_0.Town_0.SelectTownWP();
|
||||
Form1_0.Town_0.Towning = true;
|
||||
ScriptDone = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.KeyMouse_0.MouseClicc(Form1_0.CenterX, Form1_0.CenterY - 100);
|
||||
Form1_0.Mover_0.FinishMoving();
|
||||
if (Form1_0.UIScan_0.WaitTilUIOpen("waypointMenu"))
|
||||
{
|
||||
Form1_0.Town_0.SelectTownWP();
|
||||
Form1_0.Town_0.Towning = true;
|
||||
ScriptDone = true;
|
||||
Form1_0.Town_0.SelectTownWP();
|
||||
//Form1_0.Town_0.Towning = true;
|
||||
ScriptDone = true;
|
||||
|
||||
Form1_0.WaitDelay(300);
|
||||
Form1_0.UIScan_0.CloseUIMenu("invMenu");
|
||||
}
|
||||
Form1_0.LeaveGame(true); //#####
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -233,14 +130,24 @@ namespace app
|
|||
|
||||
public void TakeChest()
|
||||
{
|
||||
//JungleStashObject2
|
||||
//JungleStashObject3
|
||||
//GoodChest
|
||||
//NotSoGoodChest
|
||||
//DeadVillager1
|
||||
//DeadVillager2
|
||||
//NotSoGoodChest
|
||||
//HollowLog
|
||||
|
||||
//JungleMediumChestLeft ####
|
||||
|
||||
MapAreaStruc.Position ThisChestPos = Form1_0.MapAreaStruc_0.GetPositionOfObject("object", "GoodChest", 78, IgnoredChestList);
|
||||
int Tryy = 0;
|
||||
while (Form1_0.ObjectsStruc_0.GetObjects("JungleMediumChestLeft", true, IgnoredChestList, 400) && Tryy < 30)
|
||||
//while (Form1_0.ObjectsStruc_0.GetObjects("AllChests", true, IgnoredChestList, 300) && Tryy < 30)
|
||||
while (ThisChestPos.X != 0 && ThisChestPos.Y != 0 && Tryy < 30)
|
||||
{
|
||||
if (Form1_0.Mover_0.MoveToLocation(Form1_0.ObjectsStruc_0.itemx, Form1_0.ObjectsStruc_0.itemy))
|
||||
if (Form1_0.Mover_0.MoveToLocation(ThisChestPos.X, ThisChestPos.Y))
|
||||
{
|
||||
Form1_0.ObjectsStruc_0.GetUnitPathData();
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, Form1_0.ObjectsStruc_0.itemx, Form1_0.ObjectsStruc_0.itemy);
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, ThisChestPos.X, ThisChestPos.Y);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.WaitDelay(10);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
|
@ -256,19 +163,75 @@ namespace app
|
|||
Form1_0.Potions_0.CheckIfWeUsePotion();
|
||||
tryy2++;
|
||||
}
|
||||
IgnoredChestList.Add(Form1_0.ObjectsStruc_0.ObjectUnitID);
|
||||
Tryy++;
|
||||
IgnoredChestList.Add(Form1_0.MapAreaStruc_0.CurrentObjectIndex);
|
||||
}
|
||||
|
||||
ThisChestPos = Form1_0.MapAreaStruc_0.GetPositionOfObject("object", "GoodChest", 78, IgnoredChestList);
|
||||
|
||||
Tryy++;
|
||||
}
|
||||
|
||||
//##############
|
||||
/*ThisChestPos = Form1_0.MapAreaStruc_0.GetPositionOfObject("object", "JungleStashObject2", 78, IgnoredChestList);
|
||||
Tryy = 0;
|
||||
while (ThisChestPos.X != 0 && ThisChestPos.Y != 0 && Tryy < 30)
|
||||
{
|
||||
if (Form1_0.Mover_0.MoveToLocation(ThisChestPos.X, ThisChestPos.Y))
|
||||
{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, ThisChestPos.X, ThisChestPos.Y);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.WaitDelay(10);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.WaitDelay(10);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.WaitDelay(10);
|
||||
|
||||
int tryy2 = 0;
|
||||
while (Form1_0.ItemsStruc_0.GetItems(true) && tryy2 < 20)
|
||||
{
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
Form1_0.ItemsStruc_0.GetItems(false);
|
||||
Form1_0.Potions_0.CheckIfWeUsePotion();
|
||||
tryy2++;
|
||||
}
|
||||
IgnoredChestList.Add(Form1_0.MapAreaStruc_0.CurrentObjectIndex);
|
||||
}
|
||||
|
||||
ThisChestPos = Form1_0.MapAreaStruc_0.GetPositionOfObject("object", "JungleStashObject2", 78, IgnoredChestList);
|
||||
|
||||
Tryy++;
|
||||
}
|
||||
//##############
|
||||
ThisChestPos = Form1_0.MapAreaStruc_0.GetPositionOfObject("object", "JungleStashObject3", 78, IgnoredChestList);
|
||||
Tryy = 0;
|
||||
while (ThisChestPos.X != 0 && ThisChestPos.Y != 0 && Tryy < 30)
|
||||
{
|
||||
if (Form1_0.Mover_0.MoveToLocation(ThisChestPos.X, ThisChestPos.Y))
|
||||
{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, ThisChestPos.X, ThisChestPos.Y);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.WaitDelay(10);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.WaitDelay(10);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.WaitDelay(10);
|
||||
|
||||
int tryy2 = 0;
|
||||
while (Form1_0.ItemsStruc_0.GetItems(true) && tryy2 < 20)
|
||||
{
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
Form1_0.ItemsStruc_0.GetItems(false);
|
||||
Form1_0.Potions_0.CheckIfWeUsePotion();
|
||||
tryy2++;
|
||||
}
|
||||
IgnoredChestList.Add(Form1_0.MapAreaStruc_0.CurrentObjectIndex);
|
||||
}
|
||||
|
||||
ThisChestPos = Form1_0.MapAreaStruc_0.GetPositionOfObject("object", "JungleStashObject3", 78, IgnoredChestList);
|
||||
|
||||
Tryy++;
|
||||
}*/
|
||||
}
|
||||
|
||||
public void CastDefense()
|
||||
{
|
||||
//cast sacred shield
|
||||
Form1_0.KeyMouse_0.PressKey(CharConfig.KeySkillCastDefense);
|
||||
Form1_0.WaitDelay(5);
|
||||
Form1_0.KeyMouse_0.MouseCliccRight(Form1_0.CenterX, Form1_0.CenterY);
|
||||
Form1_0.WaitDelay(5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,135 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static app.MapAreaStruc;
|
||||
|
||||
namespace app
|
||||
{
|
||||
public class Mephisto
|
||||
{
|
||||
Form1 Form1_0;
|
||||
|
||||
public int CurrentStep = 0;
|
||||
public bool ScriptDone = false;
|
||||
|
||||
public void SetForm1(Form1 form1_1)
|
||||
{
|
||||
Form1_0 = form1_1;
|
||||
}
|
||||
|
||||
public void ResetVars()
|
||||
{
|
||||
CurrentStep = 0;
|
||||
ScriptDone = false;
|
||||
}
|
||||
|
||||
public void RunScript()
|
||||
{
|
||||
Form1_0.Town_0.ScriptTownAct = 5; //set to town act 5 when running this script
|
||||
|
||||
if (Form1_0.Town_0.GetInTown())
|
||||
{
|
||||
Form1_0.SetGameStatus("GO TO WP");
|
||||
CurrentStep = 0;
|
||||
|
||||
Form1_0.Town_0.GoToWPArea(3, 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CurrentStep == 0)
|
||||
{
|
||||
Form1_0.SetGameStatus("DOING MEPHISTO");
|
||||
Form1_0.Battle_0.CastDefense();
|
||||
Form1_0.WaitDelay(15);
|
||||
|
||||
if ((Enums.Area) Form1_0.PlayerScan_0.levelNo == Enums.Area.DuranceOfHateLevel2)
|
||||
{
|
||||
CurrentStep++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.Town_0.GoToTown();
|
||||
}
|
||||
}
|
||||
|
||||
if (CurrentStep == 1)
|
||||
{
|
||||
Form1_0.MoveToPath_0.MoveToArea(Enums.Area.DuranceOfHateLevel3);
|
||||
CurrentStep++;
|
||||
}
|
||||
|
||||
if (CurrentStep == 2)
|
||||
{
|
||||
/*X: 22561,
|
||||
Y: 9553,*/
|
||||
if (Form1_0.Mover_0.MoveToLocation(17568, 8069))
|
||||
{
|
||||
CurrentStep++;
|
||||
}
|
||||
}
|
||||
|
||||
if (CurrentStep == 3)
|
||||
{
|
||||
Form1_0.Potions_0.CanUseSkillForRegen = false;
|
||||
Form1_0.SetGameStatus("KILLING MEPHISTO");
|
||||
if (Form1_0.MobsStruc_0.GetMobs("getBossName", "Mephisto", false, 200, new List<long>()))
|
||||
{
|
||||
if (Form1_0.MobsStruc_0.MobsHP > 0)
|
||||
{
|
||||
Form1_0.Battle_0.RunBattleScriptOnThisMob("getBossName", "Mephisto");
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GrabAllItemsForGold();
|
||||
Form1_0.Potions_0.CanUseSkillForRegen = true;
|
||||
|
||||
Position ThisFinalPosition = Form1_0.MapAreaStruc_0.GetPositionOfObject("object", "portal", 102 - 1, new List<int>() { });
|
||||
if (Form1_0.Mover_0.MoveToLocation(ThisFinalPosition.X, ThisFinalPosition.Y))
|
||||
{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, ThisFinalPosition.X, ThisFinalPosition.Y);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.Mover_0.FinishMoving();
|
||||
}
|
||||
|
||||
ScriptDone = true;
|
||||
return;
|
||||
//Form1_0.LeaveGame(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.method_1("Mephisto not detected!", Color.Red);
|
||||
|
||||
//baal not detected...
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
if (Form1_0.MobsStruc_0.GetMobs("getBossName", "Mephisto", false, 200, new List<long>())) return; //redetect baal?
|
||||
Form1_0.ItemsStruc_0.GrabAllItemsForGold();
|
||||
if (Form1_0.MobsStruc_0.GetMobs("getBossName", "Mephisto", false, 200, new List<long>())) return; //redetect baal?
|
||||
Form1_0.Potions_0.CanUseSkillForRegen = true;
|
||||
|
||||
ScriptDone = true;
|
||||
return;
|
||||
//Form1_0.LeaveGame(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,115 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static app.MapAreaStruc;
|
||||
|
||||
namespace app
|
||||
{
|
||||
public class Summoner
|
||||
{
|
||||
Form1 Form1_0;
|
||||
|
||||
public int CurrentStep = 0;
|
||||
public bool ScriptDone = false;
|
||||
|
||||
|
||||
public void SetForm1(Form1 form1_1)
|
||||
{
|
||||
Form1_0 = form1_1;
|
||||
}
|
||||
|
||||
public void ResetVars()
|
||||
{
|
||||
CurrentStep = 0;
|
||||
ScriptDone = false;
|
||||
}
|
||||
|
||||
public void RunScript()
|
||||
{
|
||||
Form1_0.Town_0.ScriptTownAct = 5; //set to town act 5 when running this script
|
||||
|
||||
if (Form1_0.Town_0.GetInTown())
|
||||
{
|
||||
Form1_0.SetGameStatus("GO TO WP");
|
||||
CurrentStep = 0;
|
||||
|
||||
Form1_0.Town_0.GoToWPArea(2, 7);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CurrentStep == 0)
|
||||
{
|
||||
Form1_0.SetGameStatus("DOING SUMMONER");
|
||||
Form1_0.Battle_0.CastDefense();
|
||||
Form1_0.WaitDelay(15);
|
||||
|
||||
if ((Enums.Area) Form1_0.PlayerScan_0.levelNo == Enums.Area.ArcaneSanctuary)
|
||||
{
|
||||
CurrentStep++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.Town_0.GoToTown();
|
||||
}
|
||||
}
|
||||
|
||||
if (CurrentStep == 1)
|
||||
{
|
||||
Form1_0.MoveToPath_0.MoveToNPC("Summoner");
|
||||
|
||||
CurrentStep++;
|
||||
}
|
||||
|
||||
if (CurrentStep == 2)
|
||||
{
|
||||
Form1_0.Potions_0.CanUseSkillForRegen = false;
|
||||
Form1_0.SetGameStatus("KILLING SUMMONER");
|
||||
if (Form1_0.MobsStruc_0.GetMobs("getBossName", "Summoner", false, 200, new List<long>()))
|
||||
{
|
||||
if (Form1_0.MobsStruc_0.MobsHP > 0)
|
||||
{
|
||||
Form1_0.Battle_0.RunBattleScriptOnThisMob("getBossName", "Summoner");
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
Form1_0.ItemsStruc_0.GrabAllItemsForGold();
|
||||
Form1_0.Potions_0.CanUseSkillForRegen = true;
|
||||
|
||||
ScriptDone = true;
|
||||
return;
|
||||
//Form1_0.LeaveGame(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.method_1("Summoner not detected!", Color.Red);
|
||||
|
||||
//baal not detected...
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
if (Form1_0.MobsStruc_0.GetMobs("getBossName", "Summoner", false, 200, new List<long>())) return; //redetect baal?
|
||||
Form1_0.ItemsStruc_0.GrabAllItemsForGold();
|
||||
if (Form1_0.MobsStruc_0.GetMobs("getBossName", "Summoner", false, 200, new List<long>())) return; //redetect baal?
|
||||
Form1_0.Potions_0.CanUseSkillForRegen = true;
|
||||
|
||||
ScriptDone = true;
|
||||
return;
|
||||
//Form1_0.LeaveGame(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace app
|
||||
{
|
||||
public static class CharConfig
|
||||
{
|
||||
|
||||
//#######################################
|
||||
//SHORTCUT KEY TO START/STOP BOT
|
||||
//#######################################
|
||||
public static int StartStopKey = 0x65; //numpad5 -> refer to virtual key code (vkcode)
|
||||
|
||||
//#######################################
|
||||
//SHORTCUT KEYS SETTINGS (FOR PALADIN)
|
||||
//#######################################
|
||||
public static System.Windows.Forms.Keys KeySkillAttack = Keys.F1; //hammer
|
||||
public static System.Windows.Forms.Keys KeySkillAura = Keys.F2; //concentration
|
||||
public static System.Windows.Forms.Keys KeySkillfastMoveAtTown = Keys.F7; //vigor
|
||||
public static System.Windows.Forms.Keys KeySkillfastMoveOutsideTown = Keys.F7; //refer to teleport if have teleport else vigor
|
||||
public static System.Windows.Forms.Keys KeySkillDefenseAura = Keys.F6; //defiance
|
||||
public static System.Windows.Forms.Keys KeySkillCastDefense = Keys.F5; //sacred shield
|
||||
public static System.Windows.Forms.Keys KeySkillLifeAura = Keys.F3; //prayer
|
||||
|
||||
//#######################################
|
||||
//BELT AND INVENTORY SETTINGS
|
||||
//#######################################
|
||||
public static int[] BeltPotTypeToHave = new int[4] { 0, 0, 1, 3 }; //HP-HP-MANA-FULL RV -> 0=HP, 1=MANA, 2=RV, 3=FULL RV
|
||||
public static int[] InventoryDontCheckItem = new int[40]
|
||||
{
|
||||
0, 0, 0, 0, 0, 1, 1, 1, 1, 1, //IF EQUAL 0, WE CAN USE THIS SPOT FOR BOT
|
||||
0, 0, 0, 0, 0, 1, 1, 1, 1, 1, //IF EQUAL 0, WE CAN USE THIS SPOT FOR BOT
|
||||
0, 0, 0, 0, 1, 1, 1, 1, 1, 1, //IF EQUAL 0, WE CAN USE THIS SPOT FOR BOT
|
||||
0, 0, 0, 0, 1, 1, 1, 1, 1, 1 //IF EQUAL 0, WE CAN USE THIS SPOT FOR BOT
|
||||
};
|
||||
public static string DummyItemSharedStash1 = "Key"; //PUT THIS DUMMY ITEM IN SHARED STASH1 SO ITEMS DETECTION CORRECTLY APPLY TO THIS STASH
|
||||
public static string DummyItemSharedStash2 = "Scroll of Identify"; //PUT THIS DUMMY ITEM IN SHARED STASH2 SO ITEMS DETECTION CORRECTLY APPLY TO THIS STASH
|
||||
public static string DummyItemSharedStash3 = "Scroll of Town Portal"; //PUT THIS DUMMY ITEM IN SHARED STASH3 SO ITEMS DETECTION CORRECTLY APPLY TO THIS STASH
|
||||
|
||||
//#######################################
|
||||
//PLAYER SETTINGS
|
||||
//#######################################
|
||||
public static string PlayerCharName = ""; //CHAR NAME
|
||||
public static bool UseTeleport = true;
|
||||
public static int ChickenHP = 22; //VALUE IN PERCENT
|
||||
public static int TakeHPPotUnder = 85; //VALUE IN PERCENT
|
||||
public static int TakeRVPotUnder = 35; //VALUE IN PERCENT
|
||||
public static int TakeManaPotUnder = 15; //VALUE IN PERCENT
|
||||
public static int GambleAboveGoldAmount = 500000; //IF GOLD IN STASH EXCEED AMOUNT, WE GAMBLE FOR GOLD
|
||||
public static int GambleUntilGoldAmount = 100000; //GAMBLE UNTIL THIS LOW GOLD AMOUNT IS REACHED
|
||||
public static bool PlayerAttackWithRightHand = true;
|
||||
public static (int, int) KeysLocationInInventory = (8, 0);
|
||||
|
||||
//#######################################
|
||||
//MERC SETTINGS
|
||||
//#######################################
|
||||
public static bool UsingMerc = true;
|
||||
public static int MercTakeHPPotUnder = 40; //NOT YET WORKING
|
||||
|
||||
//#######################################
|
||||
//BOT SETTINGS (USE ONLY CHAOS OR BAAL, NOT BOTH AT SAME TIME)
|
||||
//#######################################
|
||||
public static int MaxGameTime = 7; //9MINS -> TIME IN MINUTES
|
||||
public static bool RunMephistoScript = false;
|
||||
public static bool RunAndarielScript = false;
|
||||
public static bool RunCountessScript = false;
|
||||
public static bool RunSummonerScript = false;
|
||||
public static bool RunDurielScript = false;
|
||||
public static bool RunChaosScript = false; //CHAOS LEECH SCRIPT **NOT FINISHED**
|
||||
public static bool RunLowerKurastScript = false; //LOWER KURAST SCRIPT
|
||||
public static bool RunBaalLeechScript = true; //BAAL LEECH SCRIPT
|
||||
public static bool RunItemGrabScriptOnly = false;
|
||||
//NOT IN GAME SCRIPT (SEARCH GAMES OR CREATE A NEW GAME)
|
||||
public static bool RunChaosSearchGameScript = false; //CHAOS GAMES SEARCHER SCRIPT
|
||||
public static bool RunBaalSearchGameScript = true; //BAAL GAMES SEARCHER SCRIPT
|
||||
public static bool RunGameMakerScript = false; //CREATE NEW GAME SCRIPT
|
||||
public static string GameName = "LOWERKTEST"; //SET GAME NAME, IF USING GAME MAKER
|
||||
public static string GamePass = "33"; //SET GAME PASS, IF USING GAME MAKER
|
||||
public static int GameDifficulty = 2; //0 = normal, 1 = nighmare, 2 = hell
|
||||
|
||||
//#######################################
|
||||
//GAME/PC SCREEN SETTINGS
|
||||
//#######################################
|
||||
//public static int ScreenX = 1920;
|
||||
//public static int ScreenY = 1080;
|
||||
//public static int ScreenYMenu = 180; //REMOVE 180 PIXEL FROM THE BOTTOM SCREEN TO NOT CLIC ANY BOTTOM MENU BUTTONS
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -3,11 +3,11 @@
|
|||
//#######################################
|
||||
KeySkillAttack=F1
|
||||
KeySkillAura=F2
|
||||
KeySkillfastMoveAtTown=F4
|
||||
KeySkillfastMoveOutsideTown=F8
|
||||
KeySkillDefenseAura=F6
|
||||
KeySkillfastMoveAtTown=F9
|
||||
KeySkillfastMoveOutsideTown=F7
|
||||
KeySkillDefenseAura=F7
|
||||
KeySkillCastDefense=F5
|
||||
KeySkillLifeAura=F7
|
||||
KeySkillLifeAura=F4
|
||||
|
||||
//#######################################
|
||||
//BELT SETTINGS HP-HP-MANA-FULL RV -> 0=HP,1=MANA,2=RV,3=FULL RV
|
||||
|
@ -19,10 +19,10 @@ BeltPotTypeToHave=0,0,1,3
|
|||
//#######################################
|
||||
InventoryDontCheckItem=
|
||||
{
|
||||
0,0,0,0,0,1,1,1,1,1,
|
||||
0,0,0,0,0,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,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
|
||||
}
|
||||
|
||||
//#######################################
|
||||
|
@ -35,16 +35,19 @@ DummyItemSharedStash3=Scroll of Town Portal
|
|||
//#######################################
|
||||
//PLAYER SETTINGS
|
||||
//#######################################
|
||||
PlayerCharName=CHARNAME
|
||||
PlayerCharName=YOURCHARNAME
|
||||
UseTeleport=true
|
||||
ChickenHP=22
|
||||
TakeHPPotUnder=85
|
||||
TakeRVPotUnder=35
|
||||
TakeManaPotUnder=15
|
||||
GambleAboveGoldAmount=100000
|
||||
GambleAboveGoldAmount=500000
|
||||
GambleUntilGoldAmount=100000
|
||||
PlayerAttackWithRightHand=true
|
||||
KeysLocationInInventory=8,0
|
||||
|
||||
//#######################################
|
||||
//MERC SETTINGS
|
||||
//#######################################
|
||||
UsingMerc=true
|
||||
UsingMerc=false
|
||||
MercTakeHPPotUnder=40
|
|
@ -33,13 +33,12 @@
|
|||
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colorDialog1 = new System.Windows.Forms.ColorDialog();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.labelStatus = new System.Windows.Forms.Label();
|
||||
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.richTextBox2 = new System.Windows.Forms.RichTextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.labelGames = new System.Windows.Forms.Label();
|
||||
this.button3 = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
|
@ -81,24 +80,6 @@
|
|||
this.Column2.HeaderText = "Values";
|
||||
this.Column2.Name = "Column2";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(65, 5);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(40, 13);
|
||||
this.label1.TabIndex = 3;
|
||||
this.label1.Text = "Status:";
|
||||
//
|
||||
// labelStatus
|
||||
//
|
||||
this.labelStatus.AutoSize = true;
|
||||
this.labelStatus.Location = new System.Drawing.Point(111, 5);
|
||||
this.labelStatus.Name = "labelStatus";
|
||||
this.labelStatus.Size = new System.Drawing.Size(28, 13);
|
||||
this.labelStatus.TabIndex = 4;
|
||||
this.labelStatus.Text = "XXX";
|
||||
//
|
||||
// richTextBox1
|
||||
//
|
||||
this.richTextBox1.DetectUrls = false;
|
||||
|
@ -134,7 +115,7 @@
|
|||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(65, 19);
|
||||
this.label2.Location = new System.Drawing.Point(66, 11);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(43, 13);
|
||||
this.label2.TabIndex = 8;
|
||||
|
@ -143,25 +124,34 @@
|
|||
// labelGames
|
||||
//
|
||||
this.labelGames.AutoSize = true;
|
||||
this.labelGames.Location = new System.Drawing.Point(111, 19);
|
||||
this.labelGames.Location = new System.Drawing.Point(112, 11);
|
||||
this.labelGames.Name = "labelGames";
|
||||
this.labelGames.Size = new System.Drawing.Size(28, 13);
|
||||
this.labelGames.TabIndex = 9;
|
||||
this.labelGames.Text = "XXX";
|
||||
//
|
||||
// button3
|
||||
//
|
||||
this.button3.Image = global::app.Properties.Resources.Application;
|
||||
this.button3.Location = new System.Drawing.Point(254, 6);
|
||||
this.button3.Name = "button3";
|
||||
this.button3.Size = new System.Drawing.Size(26, 23);
|
||||
this.button3.TabIndex = 10;
|
||||
this.button3.UseVisualStyleBackColor = true;
|
||||
this.button3.Click += new System.EventHandler(this.button3_Click);
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.ControlDark;
|
||||
this.ClientSize = new System.Drawing.Size(556, 394);
|
||||
this.Controls.Add(this.button3);
|
||||
this.Controls.Add(this.labelGames);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.richTextBox2);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.richTextBox1);
|
||||
this.Controls.Add(this.labelStatus);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.dataGridView1);
|
||||
this.Controls.Add(this.button1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
|
@ -181,8 +171,6 @@
|
|||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.DataGridView dataGridView1;
|
||||
private System.Windows.Forms.ColorDialog colorDialog1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label labelStatus;
|
||||
private System.Windows.Forms.RichTextBox richTextBox1;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.RichTextBox richTextBox2;
|
||||
|
@ -190,6 +178,7 @@
|
|||
private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label labelGames;
|
||||
private System.Windows.Forms.Button button3;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
288
Form1.cs
288
Form1.cs
|
@ -10,6 +10,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
|
@ -17,6 +18,8 @@ using System.Runtime.Remoting;
|
|||
using System.Security.Cryptography;
|
||||
using System.Security.Policy;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using Newtonsoft.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
@ -24,18 +27,22 @@ using System.Timers;
|
|||
using System.Windows.Forms;
|
||||
using System.Windows.Forms.VisualStyles;
|
||||
using System.Xml.Linq;
|
||||
using static app.Enums;
|
||||
using static app.Form1;
|
||||
using static System.Collections.Specialized.BitVector32;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Button;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.ToolBar;
|
||||
using static app.MapAreaStruc;
|
||||
|
||||
namespace app
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
|
||||
public string BotVersion = "V1.1";
|
||||
public string BotVersion = "V1.2";
|
||||
|
||||
public string D2_LOD_113C_Path = @"C:\Users\boule\OneDrive\Bureau\JEUX\DiabloIICOCO\";
|
||||
|
||||
public Process process;
|
||||
public string ThisEndPath = Application.StartupPath + @"\Extracted\";
|
||||
|
@ -54,6 +61,7 @@ namespace app
|
|||
public DateTime GameStartedTime = new DateTime();
|
||||
public bool CharDied = false;
|
||||
public bool PrintedGameTime = false;
|
||||
public DateTime TimeSinceSearchingForGames = new DateTime();
|
||||
|
||||
public Rectangle D2Rect = new Rectangle();
|
||||
public int ScreenX = 1920;
|
||||
|
@ -71,6 +79,13 @@ namespace app
|
|||
public int CurrentGameNumber = 1;
|
||||
public int CurrentGameNumberFullyDone = 0;
|
||||
public bool SetGameDone = false;
|
||||
public int FoundPlayerPointerTryCount = 0;
|
||||
|
||||
public int CurrentGameNumberSinceStart = 1;
|
||||
|
||||
public bool ForceSwitch2ndPlayer = false;
|
||||
|
||||
public double FPS = 0;
|
||||
|
||||
public ItemsStruc ItemsStruc_0;
|
||||
public Mem Mem_0;
|
||||
|
@ -96,15 +111,22 @@ namespace app
|
|||
public Shop Shop_0;
|
||||
public Repair Repair_0;
|
||||
public Chaos Chaos_0;
|
||||
public Duriel Duriel_0;
|
||||
public Battle Battle_0;
|
||||
public KeyMouse KeyMouse_0;
|
||||
public Summoner Summoner_0;
|
||||
public Baal Baal_0;
|
||||
public Mephisto Mephisto_0;
|
||||
public Andariel Andariel_0;
|
||||
public Countess Countess_0;
|
||||
public MercStruc MercStruc_0;
|
||||
public StashStruc StashStruc_0;
|
||||
public Cubing Cubing_0;
|
||||
public Gamble Gamble_0;
|
||||
public LowerKurast LowerKurast_0;
|
||||
public SettingsLoader SettingsLoader_0;
|
||||
public MapAreaStruc MapAreaStruc_0;
|
||||
public MoveToPath MoveToPath_0;
|
||||
|
||||
// REQUIRED CONSTS
|
||||
const int PROCESS_QUERY_INFORMATION = 0x0400;
|
||||
|
@ -160,7 +182,7 @@ namespace app
|
|||
InitializeComponent();
|
||||
|
||||
this.Text = "D2R - BMBot (" + BotVersion + ")";
|
||||
labelGames.Text = CurrentGameNumber.ToString();
|
||||
labelGames.Text = "";//CurrentGameNumber.ToString();
|
||||
SetGameStatus("STOPPED");
|
||||
Form1_0 = this;
|
||||
richTextBox1.HideSelection = false;//Hide selection so that AppendText will auto scroll to the end
|
||||
|
@ -170,6 +192,16 @@ namespace app
|
|||
LoopTimer = new System.Timers.Timer(1);
|
||||
LoopTimer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
|
||||
|
||||
ScreenX = Screen.PrimaryScreen.Bounds.Width;
|
||||
ScreenY = Screen.PrimaryScreen.Bounds.Height;
|
||||
|
||||
if (Form1_0.D2_LOD_113C_Path == "")
|
||||
{
|
||||
method_1("ERROR: Diablo2 LOD 1.13C Path NOT SET CORRECTLY!", Color.Red);
|
||||
method_1("Clic on the settings button and set the path where Diablo2 1.13c (the old legacy diablo2) is located!", Color.Red);
|
||||
method_1("Make sure the path don't contain any whitespace!", Color.Red);
|
||||
}
|
||||
|
||||
//CenterX = CharConfig.ScreenX / 2;
|
||||
//CenterY = CharConfig.ScreenY / 2;
|
||||
|
||||
|
@ -195,16 +227,23 @@ namespace app
|
|||
Stash_0 = new Stash();
|
||||
Shop_0 = new Shop();
|
||||
Repair_0 = new Repair();
|
||||
Summoner_0 = new Summoner();
|
||||
Chaos_0 = new Chaos();
|
||||
Battle_0 = new Battle();
|
||||
KeyMouse_0 = new KeyMouse();
|
||||
Duriel_0 = new Duriel();
|
||||
Baal_0 = new Baal();
|
||||
Mephisto_0 = new Mephisto();
|
||||
Andariel_0 = new Andariel();
|
||||
Countess_0 = new Countess();
|
||||
MercStruc_0 = new MercStruc();
|
||||
StashStruc_0 = new StashStruc();
|
||||
Cubing_0 = new Cubing();
|
||||
Gamble_0 = new Gamble();
|
||||
LowerKurast_0 = new LowerKurast();
|
||||
SettingsLoader_0 = new SettingsLoader();
|
||||
MapAreaStruc_0 = new MapAreaStruc();
|
||||
MoveToPath_0 = new MoveToPath();
|
||||
|
||||
ItemsStruc_0.SetForm1(Form1_0);
|
||||
Mem_0.SetForm1(Form1_0);
|
||||
|
@ -227,16 +266,23 @@ namespace app
|
|||
Stash_0.SetForm1(Form1_0);
|
||||
Shop_0.SetForm1(Form1_0);
|
||||
Repair_0.SetForm1(Form1_0);
|
||||
Summoner_0.SetForm1(Form1_0);
|
||||
Chaos_0.SetForm1(Form1_0);
|
||||
Duriel_0.SetForm1(Form1_0);
|
||||
Battle_0.SetForm1(Form1_0);
|
||||
KeyMouse_0.SetForm1(Form1_0);
|
||||
Mephisto_0.SetForm1(Form1_0);
|
||||
Baal_0.SetForm1(Form1_0);
|
||||
Andariel_0.SetForm1(Form1_0);
|
||||
Countess_0.SetForm1(Form1_0);
|
||||
MercStruc_0.SetForm1(Form1_0);
|
||||
StashStruc_0.SetForm1(Form1_0);
|
||||
Cubing_0.SetForm1(Form1_0);
|
||||
Gamble_0.SetForm1(Form1_0);
|
||||
LowerKurast_0.SetForm1(Form1_0);
|
||||
SettingsLoader_0.SetForm1(Form1_0);
|
||||
MapAreaStruc_0.SetForm1(Form1_0);
|
||||
MoveToPath_0.SetForm1(Form1_0);
|
||||
|
||||
SettingsLoader_0.LoadSettings();
|
||||
|
||||
|
@ -248,6 +294,7 @@ namespace app
|
|||
//dataGridView1.Rows.Add("---Player---", "---------");
|
||||
dataGridView1.Rows.Add("Pointer", "Unknown");
|
||||
dataGridView1.Rows.Add("Cords", "Unknown"); //
|
||||
dataGridView1.Rows.Add("LeechCords", "Unknown"); //
|
||||
dataGridView1.Rows.Add("Life", "Unknown"); //
|
||||
dataGridView1.Rows.Add("Mana", "Unknown"); //
|
||||
dataGridView1.Rows.Add("Map Level", "Unknown"); //
|
||||
|
@ -342,19 +389,26 @@ namespace app
|
|||
//catch { }
|
||||
}
|
||||
|
||||
public string PreviousStatus = "IDLE";
|
||||
public void SetGameStatus(string string_3)
|
||||
{
|
||||
//try
|
||||
//{
|
||||
if (labelStatus.InvokeRequired)
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
// Call this same method but append THREAD2 to the text
|
||||
Action safeWrite = delegate { SetGameStatus(string_3); };
|
||||
labelStatus.Invoke(safeWrite);
|
||||
this.Invoke(safeWrite);
|
||||
}
|
||||
else
|
||||
{
|
||||
labelStatus.Text = string_3;
|
||||
string RunText = "STOPPED";
|
||||
if (Running) RunText = "RUNNING";
|
||||
|
||||
if (string_3 == "STOPPED") string_3 = PreviousStatus;
|
||||
else PreviousStatus = string_3;
|
||||
|
||||
this.Text = "D2R - BMBot " + BotVersion + " | " + RunText + " | " + string_3;
|
||||
Application.DoEvents();
|
||||
}
|
||||
//}
|
||||
|
@ -396,7 +450,7 @@ namespace app
|
|||
}
|
||||
else
|
||||
{
|
||||
labelGames.Text = CurrentGameNumber.ToString() + " entered. " + CurrentGameNumberFullyDone.ToString() + " fully done";
|
||||
labelGames.Text = CurrentGameNumberSinceStart.ToString() + " entered. " + CurrentGameNumberFullyDone.ToString() + " fully done";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -519,15 +573,22 @@ namespace app
|
|||
|
||||
public void SetNewGame()
|
||||
{
|
||||
Form1_0.SetGameStatus("NEW GAME STARTED");
|
||||
|
||||
PatternsScan_0.StartIndexItemLast = long.MaxValue;
|
||||
PatternsScan_0.ScanUnitsNumber = 2048;
|
||||
PatternsScan_0.ScanUnitsNumber = 2600;
|
||||
Town_0.TriedToShopCount = 0;
|
||||
Town_0.TriedToShopCount2 = 0;
|
||||
Town_0.TriedToMercCount = 0;
|
||||
FoundPlayerPointerTryCount = 0;
|
||||
Town_0.Towning = true;
|
||||
Town_0.IsInTown = true;
|
||||
Town_0.ForcedTowning = false;
|
||||
Town_0.FastTowning = false;
|
||||
PlayerScan_0.GetPositions();
|
||||
ItemsStruc_0.GetItems(false);
|
||||
PlayerScan_0.PlayerHP = PlayerScan_0.PlayerMaxHP;
|
||||
if (PlayerScan_0.PlayerHP == 0) PlayerScan_0.PlayerHP = 100;
|
||||
PlayerScan_0.SetMaxHPAndMana();
|
||||
Shop_0.FirstShopping = true;
|
||||
ItemsStruc_0.dwOwnerId_Shared1 = 0;
|
||||
|
@ -535,9 +596,25 @@ namespace app
|
|||
ItemsStruc_0.dwOwnerId_Shared3 = 0;
|
||||
Potions_0.CanUseSkillForRegen = true;
|
||||
LowerKurast_0.ResetVars();
|
||||
Countess_0.ResetVars();
|
||||
Andariel_0.ResetVars();
|
||||
Mephisto_0.ResetVars();
|
||||
Summoner_0.ResetVars();
|
||||
Duriel_0.ResetVars();
|
||||
Town_0.IgnoredTPList.Clear();
|
||||
Baal_0.IgnoredTPList.Clear();
|
||||
Town_0.FirstTown = true;
|
||||
ForceSwitch2ndPlayer = false;
|
||||
PlayerScan_0.PlayerGoldInventory = 0;
|
||||
SetGameDone = false;
|
||||
BeltStruc_0.ForceMANAPotionQty = 0;
|
||||
BeltStruc_0.ForceHPPotionQty = 0;
|
||||
SetGamesText();
|
||||
CurrentGameNumber++;
|
||||
CurrentGameNumberSinceStart++;
|
||||
|
||||
//##############################
|
||||
MapAreaStruc_0.ScanMapStruc();
|
||||
}
|
||||
|
||||
void timer_Elapsed(object sender, ElapsedEventArgs e)
|
||||
|
@ -547,6 +624,12 @@ namespace app
|
|||
|
||||
if (GameStruc_0.IsGameRunning())
|
||||
{
|
||||
if (Stash_0.StashFull)
|
||||
{
|
||||
StopBot();
|
||||
return;
|
||||
}
|
||||
|
||||
bool isInGame = GameStruc_0.IsInGame();
|
||||
if (isInGame)
|
||||
{
|
||||
|
@ -558,6 +641,8 @@ namespace app
|
|||
{
|
||||
GameStruc_0.SetNewGame();
|
||||
SetNewGame();
|
||||
WaitDelay(400); //wait here because 'loading' menu is not correct
|
||||
Town_0.GetCorpse();
|
||||
HasPointers = true;
|
||||
}
|
||||
else
|
||||
|
@ -568,10 +653,29 @@ namespace app
|
|||
{
|
||||
GameStruc_0.SetNewGame();
|
||||
SetNewGame();
|
||||
WaitDelay(600); //wait here because 'loading' menu is not correct
|
||||
WaitDelay(400); //wait here because 'loading' menu is not correct
|
||||
Town_0.GetCorpse();
|
||||
HasPointers = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
FoundPlayerPointerTryCount++;
|
||||
|
||||
if (FoundPlayerPointerTryCount >= 300)
|
||||
{
|
||||
method_1("Leaving Player pointer not found!", Color.Red);
|
||||
Form1_0.Potions_0.ForceLeave = true;
|
||||
ForceSwitch2ndPlayer = true;
|
||||
Form1_0.Baal_0.SearchSameGamesAsLastOne = false;
|
||||
Form1_0.Chaos_0.SearchSameGamesAsLastOne = false;
|
||||
Form1_0.LeaveGame(false);
|
||||
|
||||
SetProcessingTime();
|
||||
if (Running) LoopTimer.Start();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (HasPointers)
|
||||
|
@ -600,6 +704,12 @@ namespace app
|
|||
}*/
|
||||
//#####
|
||||
|
||||
//LowerKurast_0.TakeChest();
|
||||
//Form1_0.ObjectsStruc_0.GetObjects("JungleMediumChestLeft", true, new List<uint>() { }, 400);
|
||||
|
||||
//MoveToPath_0.MoveToArea(20);
|
||||
//return;
|
||||
|
||||
if (!ItemsStruc_0.GetItems(true))
|
||||
{
|
||||
//BeltStruc_0.CheckForMissingPotions();
|
||||
|
@ -610,25 +720,71 @@ namespace app
|
|||
}
|
||||
else
|
||||
{
|
||||
if (Battle_0.ClearingArea)
|
||||
if (Battle_0.ClearingArea && !CharConfig.RunItemGrabScriptOnly)
|
||||
{
|
||||
Battle_0.RunBattleScript();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CharConfig.RunLowerKurastScript && !LowerKurast_0.ScriptDone)
|
||||
if (CharConfig.RunAndarielScript && !Andariel_0.ScriptDone)
|
||||
{
|
||||
LowerKurast_0.RunScript();
|
||||
Andariel_0.RunScript();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CharConfig.RunChaosScript)
|
||||
if (CharConfig.RunCountessScript && !Countess_0.ScriptDone)
|
||||
{
|
||||
Chaos_0.RunScript();
|
||||
Countess_0.RunScript();
|
||||
}
|
||||
if (CharConfig.RunBaalLeechScript)
|
||||
else
|
||||
{
|
||||
Baal_0.RunScript();
|
||||
if (CharConfig.RunSummonerScript && !Summoner_0.ScriptDone)
|
||||
{
|
||||
Summoner_0.RunScript();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CharConfig.RunDurielScript && !Duriel_0.ScriptDone)
|
||||
{
|
||||
Duriel_0.RunScript();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CharConfig.RunLowerKurastScript && !LowerKurast_0.ScriptDone)
|
||||
{
|
||||
LowerKurast_0.RunScript();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CharConfig.RunMephistoScript && !Mephisto_0.ScriptDone)
|
||||
{
|
||||
Mephisto_0.RunScript();
|
||||
}
|
||||
else
|
||||
{
|
||||
/*if (CharConfig.RunLowerKurastScript && LowerKurast_0.ScriptDone)
|
||||
{
|
||||
LeaveGame(true); //#####
|
||||
}*/
|
||||
if (CharConfig.RunChaosScript && !Chaos_0.ScriptDone)
|
||||
{
|
||||
Chaos_0.RunScript();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CharConfig.RunBaalLeechScript && !Baal_0.ScriptDone)
|
||||
{
|
||||
Baal_0.RunScript();
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.LeaveGame(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -640,7 +796,7 @@ namespace app
|
|||
ObjectsStruc_0.GetObjects("TownPortal", true);
|
||||
}
|
||||
Potions_0.CheckIfWeUsePotion();
|
||||
GameStruc_0.CheckChickenGameTime();
|
||||
if (!CharConfig.RunItemGrabScriptOnly) GameStruc_0.CheckChickenGameTime();
|
||||
|
||||
|
||||
Grid_SetInfos("Scanned", ItemsStruc_0.ItemsScanned.ToString());
|
||||
|
@ -654,12 +810,18 @@ namespace app
|
|||
}
|
||||
else
|
||||
{
|
||||
Potions_0.ForceLeave = false;
|
||||
FoundPlayerPointerTryCount = 0;
|
||||
HasPointers = false;
|
||||
|
||||
if (!PrintedGameTime)
|
||||
{
|
||||
GameStruc_0.LogGameTime();
|
||||
TimeSinceSearchingForGames = DateTime.Now;
|
||||
PrintedGameTime = true;
|
||||
}
|
||||
HasPointers = false;
|
||||
|
||||
ChangeCharScript();
|
||||
|
||||
if (CharConfig.RunGameMakerScript)
|
||||
{
|
||||
|
@ -669,10 +831,29 @@ namespace app
|
|||
else
|
||||
{
|
||||
//Chaos_0.RunScriptNOTInGame();
|
||||
if (CharConfig.RunBaalSearchGameScript)
|
||||
if (CharConfig.RunBaalSearchGameScript && !CharConfig.RunItemGrabScriptOnly)
|
||||
{
|
||||
Form1_0.SetGameStatus("SEARCHING GAMES");
|
||||
Baal_0.RunScriptNOTInGame();
|
||||
|
||||
TimeSpan ThisTimeCheckk = DateTime.Now - TimeSinceSearchingForGames;
|
||||
if (ThisTimeCheckk.TotalMinutes > 8)
|
||||
{
|
||||
LeaveGame(false);
|
||||
TimeSinceSearchingForGames = DateTime.Now;
|
||||
}
|
||||
}
|
||||
else if (CharConfig.RunChaosSearchGameScript && !CharConfig.RunItemGrabScriptOnly)
|
||||
{
|
||||
Form1_0.SetGameStatus("SEARCHING GAMES");
|
||||
Chaos_0.RunScriptNOTInGame();
|
||||
|
||||
TimeSpan ThisTimeCheckk = DateTime.Now - TimeSinceSearchingForGames;
|
||||
if (ThisTimeCheckk.TotalMinutes > 8)
|
||||
{
|
||||
LeaveGame(false);
|
||||
TimeSinceSearchingForGames = DateTime.Now;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -689,6 +870,55 @@ namespace app
|
|||
//LoopDone++;
|
||||
}
|
||||
|
||||
public void ChangeCharScript()
|
||||
{
|
||||
long baseAddr = (long)Form1_0.BaseAddress + (long)Form1_0.offsets["SelectedChar"];
|
||||
byte[] buffer = new byte[16];
|
||||
Form1_0.Mem_0.ReadRawMemory(baseAddr, ref buffer, 16);
|
||||
|
||||
string name = "";
|
||||
for (int i2 = 0; i2 < 16; i2++)
|
||||
{
|
||||
if (buffer[i2] != 0x00)
|
||||
{
|
||||
name += (char)buffer[i2];
|
||||
}
|
||||
}
|
||||
|
||||
if (name != CharConfig.PlayerCharName || ForceSwitch2ndPlayer)
|
||||
{
|
||||
method_1("Changing Char...", Color.Red);
|
||||
|
||||
//Esc
|
||||
Form1_0.KeyMouse_0.PressKey(Keys.Escape);
|
||||
Form1_0.WaitDelay(120);
|
||||
Application.DoEvents();
|
||||
|
||||
//Select Top Char
|
||||
if (!ForceSwitch2ndPlayer)
|
||||
{
|
||||
Form1_0.KeyMouse_0.MouseClicc(1700, 85);
|
||||
Form1_0.WaitDelay(10);
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.KeyMouse_0.MouseClicc(1700, 200);
|
||||
Form1_0.WaitDelay(10);
|
||||
}
|
||||
|
||||
Form1_0.KeyMouse_0.MouseClicc(1190, 990); //clic 'salon' if not in server
|
||||
Form1_0.WaitDelay(10);
|
||||
|
||||
Form1_0.KeyMouse_0.MouseClicc(1415, 65); //clic 'join game' if not in game list area
|
||||
Form1_0.WaitDelay(10);
|
||||
|
||||
Form1_0.KeyMouse_0.MouseClicc(1720, 210); //clic refresh
|
||||
Form1_0.WaitDelay(60);
|
||||
|
||||
ForceSwitch2ndPlayer = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetProcessingTime()
|
||||
{
|
||||
//Get processing time (ex: 1.125s)
|
||||
|
@ -712,7 +942,7 @@ namespace app
|
|||
|
||||
//convert to FPS
|
||||
long TimeMS = testtime.Milliseconds + (testtime.Seconds * 1000);
|
||||
double FPS = 1000.0 / (double)TimeMS;
|
||||
FPS = 1000.0 / (double)TimeMS;
|
||||
|
||||
|
||||
Grid_SetInfos("Processing Time", TimeStr + "-" + FPS.ToString("00") + "FPS");
|
||||
|
@ -721,32 +951,40 @@ namespace app
|
|||
|
||||
public void WaitDelay(int DelayTime)
|
||||
{
|
||||
DateTime TimeStart = DateTime.Now;
|
||||
TimeSpan ThisTime = DateTime.Now - TimeStart;
|
||||
|
||||
int CurrentWait = 0;
|
||||
while (CurrentWait < DelayTime)
|
||||
//while (CurrentWait < DelayTime)
|
||||
while (ThisTime.TotalMilliseconds < (DelayTime * 10))
|
||||
{
|
||||
SetProcessingTime();
|
||||
Thread.Sleep(1);
|
||||
Application.DoEvents();
|
||||
ThisTime = DateTime.Now - TimeStart;
|
||||
CurrentWait++;
|
||||
}
|
||||
}
|
||||
|
||||
public void StopBot()
|
||||
{
|
||||
SetGameStatus("STOPPED");
|
||||
//SetGameStatus("STOPPED");
|
||||
button1.Text = "START";
|
||||
Running = false;
|
||||
HasPointers = false;
|
||||
PlayerScan_0.FoundPlayer = false;
|
||||
LoopDone = 0;
|
||||
Stash_0.StashFull = false;
|
||||
button3.Enabled = true;
|
||||
LoopTimer.Stop();
|
||||
SetGameStatus("STOPPED");
|
||||
}
|
||||
|
||||
public void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!Running)
|
||||
{
|
||||
button3.Enabled = false;
|
||||
button1.Text = "STOP";
|
||||
Running = true;
|
||||
Startt();
|
||||
|
@ -759,6 +997,8 @@ namespace app
|
|||
|
||||
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
SettingsLoader_0.SaveCurrentSettings();
|
||||
SettingsLoader_0.SaveOthersSettings();
|
||||
KeyMouse.UnhookWindowsHookEx(KeyMouse_0.hookID);
|
||||
}
|
||||
|
||||
|
@ -776,5 +1016,11 @@ namespace app
|
|||
}
|
||||
Application.DoEvents();
|
||||
}
|
||||
|
||||
private void button3_Click(object sender, EventArgs e)
|
||||
{
|
||||
FormSettings FormSettings_0 = new FormSettings(Form1_0);
|
||||
FormSettings_0.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,345 @@
|
|||
namespace app
|
||||
{
|
||||
partial class FormSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem("Item Grab ONLY");
|
||||
System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem("Countess");
|
||||
System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem("Andariel");
|
||||
System.Windows.Forms.ListViewItem listViewItem4 = new System.Windows.Forms.ListViewItem("Summoner");
|
||||
System.Windows.Forms.ListViewItem listViewItem5 = new System.Windows.Forms.ListViewItem("Duriel");
|
||||
System.Windows.Forms.ListViewItem listViewItem6 = new System.Windows.Forms.ListViewItem("Lower Kurast");
|
||||
System.Windows.Forms.ListViewItem listViewItem7 = new System.Windows.Forms.ListViewItem("Mephisto");
|
||||
System.Windows.Forms.ListViewItem listViewItem8 = new System.Windows.Forms.ListViewItem("Chaos Leech");
|
||||
System.Windows.Forms.ListViewItem listViewItem9 = new System.Windows.Forms.ListViewItem("Baal Leech");
|
||||
this.listViewRunScripts = new System.Windows.Forms.ListView();
|
||||
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.numericUpDownRunNumber = new System.Windows.Forms.NumericUpDown();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.comboBoxDifficulty = new System.Windows.Forms.ComboBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.textBoxGamePass = new System.Windows.Forms.TextBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.textBoxGameName = new System.Windows.Forms.TextBox();
|
||||
this.numericUpDownMaxTime = new System.Windows.Forms.NumericUpDown();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.comboBoxLobby = new System.Windows.Forms.ComboBox();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.textBoxD2Path = new System.Windows.Forms.TextBox();
|
||||
this.groupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownRunNumber)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaxTime)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// listViewRunScripts
|
||||
//
|
||||
this.listViewRunScripts.CheckBoxes = true;
|
||||
this.listViewRunScripts.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||
this.columnHeader1});
|
||||
this.listViewRunScripts.FullRowSelect = true;
|
||||
this.listViewRunScripts.GridLines = true;
|
||||
this.listViewRunScripts.HideSelection = false;
|
||||
listViewItem1.StateImageIndex = 0;
|
||||
listViewItem2.Checked = true;
|
||||
listViewItem2.StateImageIndex = 1;
|
||||
listViewItem3.StateImageIndex = 0;
|
||||
listViewItem4.StateImageIndex = 0;
|
||||
listViewItem5.StateImageIndex = 0;
|
||||
listViewItem6.StateImageIndex = 0;
|
||||
listViewItem7.StateImageIndex = 0;
|
||||
listViewItem8.StateImageIndex = 0;
|
||||
listViewItem9.StateImageIndex = 0;
|
||||
this.listViewRunScripts.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
|
||||
listViewItem1,
|
||||
listViewItem2,
|
||||
listViewItem3,
|
||||
listViewItem4,
|
||||
listViewItem5,
|
||||
listViewItem6,
|
||||
listViewItem7,
|
||||
listViewItem8,
|
||||
listViewItem9});
|
||||
this.listViewRunScripts.Location = new System.Drawing.Point(12, 132);
|
||||
this.listViewRunScripts.Name = "listViewRunScripts";
|
||||
this.listViewRunScripts.Scrollable = false;
|
||||
this.listViewRunScripts.Size = new System.Drawing.Size(225, 157);
|
||||
this.listViewRunScripts.TabIndex = 0;
|
||||
this.listViewRunScripts.UseCompatibleStateImageBehavior = false;
|
||||
this.listViewRunScripts.View = System.Windows.Forms.View.List;
|
||||
this.listViewRunScripts.SelectedIndexChanged += new System.EventHandler(this.listViewRunScripts_SelectedIndexChanged);
|
||||
//
|
||||
// columnHeader1
|
||||
//
|
||||
this.columnHeader1.Width = 200;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label1.Location = new System.Drawing.Point(54, 108);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(134, 16);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Select Run Scripts";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label2.Location = new System.Drawing.Point(50, 64);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(142, 16);
|
||||
this.label2.TabIndex = 3;
|
||||
this.label2.Text = "Select Lobby Script";
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.button1);
|
||||
this.groupBox1.Controls.Add(this.numericUpDownRunNumber);
|
||||
this.groupBox1.Controls.Add(this.label6);
|
||||
this.groupBox1.Controls.Add(this.label5);
|
||||
this.groupBox1.Controls.Add(this.comboBoxDifficulty);
|
||||
this.groupBox1.Controls.Add(this.label4);
|
||||
this.groupBox1.Controls.Add(this.textBoxGamePass);
|
||||
this.groupBox1.Controls.Add(this.label3);
|
||||
this.groupBox1.Controls.Add(this.textBoxGameName);
|
||||
this.groupBox1.Location = new System.Drawing.Point(3, 328);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(244, 122);
|
||||
this.groupBox1.TabIndex = 4;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Game Maker Settings";
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(180, 65);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(54, 23);
|
||||
this.button1.TabIndex = 8;
|
||||
this.button1.Text = "Reset";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// numericUpDownRunNumber
|
||||
//
|
||||
this.numericUpDownRunNumber.Location = new System.Drawing.Point(85, 67);
|
||||
this.numericUpDownRunNumber.Maximum = new decimal(new int[] {
|
||||
99999,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numericUpDownRunNumber.Minimum = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numericUpDownRunNumber.Name = "numericUpDownRunNumber";
|
||||
this.numericUpDownRunNumber.Size = new System.Drawing.Size(89, 20);
|
||||
this.numericUpDownRunNumber.TabIndex = 7;
|
||||
this.numericUpDownRunNumber.Value = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(9, 69);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(70, 13);
|
||||
this.label6.TabIndex = 6;
|
||||
this.label6.Text = "Run Number:";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(9, 94);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(50, 13);
|
||||
this.label5.TabIndex = 5;
|
||||
this.label5.Text = "Difficulty:";
|
||||
//
|
||||
// comboBoxDifficulty
|
||||
//
|
||||
this.comboBoxDifficulty.FormattingEnabled = true;
|
||||
this.comboBoxDifficulty.Items.AddRange(new object[] {
|
||||
"Normal",
|
||||
"Nightmare",
|
||||
"Hell"});
|
||||
this.comboBoxDifficulty.Location = new System.Drawing.Point(85, 91);
|
||||
this.comboBoxDifficulty.Name = "comboBoxDifficulty";
|
||||
this.comboBoxDifficulty.Size = new System.Drawing.Size(149, 21);
|
||||
this.comboBoxDifficulty.TabIndex = 4;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(9, 46);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(64, 13);
|
||||
this.label4.TabIndex = 3;
|
||||
this.label4.Text = "Game Pass:";
|
||||
//
|
||||
// textBoxGamePass
|
||||
//
|
||||
this.textBoxGamePass.Location = new System.Drawing.Point(85, 43);
|
||||
this.textBoxGamePass.Name = "textBoxGamePass";
|
||||
this.textBoxGamePass.Size = new System.Drawing.Size(149, 20);
|
||||
this.textBoxGamePass.TabIndex = 2;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(9, 20);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(69, 13);
|
||||
this.label3.TabIndex = 1;
|
||||
this.label3.Text = "Game Name:";
|
||||
//
|
||||
// textBoxGameName
|
||||
//
|
||||
this.textBoxGameName.Location = new System.Drawing.Point(85, 17);
|
||||
this.textBoxGameName.Name = "textBoxGameName";
|
||||
this.textBoxGameName.Size = new System.Drawing.Size(149, 20);
|
||||
this.textBoxGameName.TabIndex = 0;
|
||||
//
|
||||
// numericUpDownMaxTime
|
||||
//
|
||||
this.numericUpDownMaxTime.Location = new System.Drawing.Point(162, 299);
|
||||
this.numericUpDownMaxTime.Maximum = new decimal(new int[] {
|
||||
99999,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numericUpDownMaxTime.Name = "numericUpDownMaxTime";
|
||||
this.numericUpDownMaxTime.Size = new System.Drawing.Size(58, 20);
|
||||
this.numericUpDownMaxTime.TabIndex = 10;
|
||||
this.numericUpDownMaxTime.Value = new decimal(new int[] {
|
||||
8,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(27, 301);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(132, 13);
|
||||
this.label7.TabIndex = 9;
|
||||
this.label7.Text = "Max Game Time (minutes):";
|
||||
//
|
||||
// comboBoxLobby
|
||||
//
|
||||
this.comboBoxLobby.FormattingEnabled = true;
|
||||
this.comboBoxLobby.Items.AddRange(new object[] {
|
||||
"Game Create/Maker",
|
||||
"Chaos Search (Leech)",
|
||||
"Baal Search (Leech)"});
|
||||
this.comboBoxLobby.Location = new System.Drawing.Point(12, 83);
|
||||
this.comboBoxLobby.Name = "comboBoxLobby";
|
||||
this.comboBoxLobby.Size = new System.Drawing.Size(226, 21);
|
||||
this.comboBoxLobby.TabIndex = 9;
|
||||
this.comboBoxLobby.SelectedIndexChanged += new System.EventHandler(this.comboBoxLobby_SelectedIndexChanged);
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label8.Location = new System.Drawing.Point(50, 14);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(137, 16);
|
||||
this.label8.TabIndex = 10;
|
||||
this.label8.Text = "D2 LOD 1.13C Path";
|
||||
//
|
||||
// textBoxD2Path
|
||||
//
|
||||
this.textBoxD2Path.Location = new System.Drawing.Point(12, 33);
|
||||
this.textBoxD2Path.Name = "textBoxD2Path";
|
||||
this.textBoxD2Path.Size = new System.Drawing.Size(225, 20);
|
||||
this.textBoxD2Path.TabIndex = 9;
|
||||
//
|
||||
// FormSettings
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.ControlDark;
|
||||
this.ClientSize = new System.Drawing.Size(253, 454);
|
||||
this.Controls.Add(this.label8);
|
||||
this.Controls.Add(this.comboBoxLobby);
|
||||
this.Controls.Add(this.textBoxD2Path);
|
||||
this.Controls.Add(this.numericUpDownMaxTime);
|
||||
this.Controls.Add(this.label7);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.listViewRunScripts);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "FormSettings";
|
||||
this.ShowIcon = false;
|
||||
this.Text = "D2R - BMBot - Settings";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormSettings_FormClosing);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownRunNumber)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaxTime)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.ListView listViewRunScripts;
|
||||
private System.Windows.Forms.ColumnHeader columnHeader1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.ComboBox comboBoxDifficulty;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.TextBox textBoxGamePass;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.TextBox textBoxGameName;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.NumericUpDown numericUpDownRunNumber;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.NumericUpDown numericUpDownMaxTime;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.ComboBox comboBoxLobby;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.TextBox textBoxD2Path;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,101 @@
|
|||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace app
|
||||
{
|
||||
public partial class FormSettings : Form
|
||||
{
|
||||
Form1 Form1_0;
|
||||
|
||||
public FormSettings(Form1 form1_1)
|
||||
{
|
||||
Form1_0 = form1_1;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
LoadSettings();
|
||||
}
|
||||
|
||||
public void LoadSettings()
|
||||
{
|
||||
textBoxD2Path.Text = Form1_0.D2_LOD_113C_Path;
|
||||
numericUpDownMaxTime.Value = CharConfig.MaxGameTime;
|
||||
|
||||
listViewRunScripts.Items[0].Checked = CharConfig.RunItemGrabScriptOnly;
|
||||
listViewRunScripts.Items[1].Checked = CharConfig.RunCountessScript;
|
||||
listViewRunScripts.Items[2].Checked = CharConfig.RunAndarielScript;
|
||||
listViewRunScripts.Items[3].Checked = CharConfig.RunSummonerScript;
|
||||
listViewRunScripts.Items[4].Checked = CharConfig.RunDurielScript;
|
||||
listViewRunScripts.Items[5].Checked = CharConfig.RunLowerKurastScript;
|
||||
listViewRunScripts.Items[6].Checked = CharConfig.RunMephistoScript;
|
||||
listViewRunScripts.Items[7].Checked = CharConfig.RunChaosScript;
|
||||
listViewRunScripts.Items[8].Checked = CharConfig.RunBaalLeechScript;
|
||||
|
||||
if (CharConfig.RunGameMakerScript) comboBoxLobby.SelectedIndex = 0;
|
||||
if (CharConfig.RunChaosSearchGameScript) comboBoxLobby.SelectedIndex = 1;
|
||||
if (CharConfig.RunBaalSearchGameScript) comboBoxLobby.SelectedIndex = 2;
|
||||
|
||||
textBoxGameName.Text = CharConfig.GameName;
|
||||
textBoxGamePass.Text = CharConfig.GamePass;
|
||||
|
||||
comboBoxDifficulty.SelectedIndex = CharConfig.GameDifficulty;
|
||||
|
||||
numericUpDownRunNumber.Value = Form1_0.CurrentGameNumber;
|
||||
|
||||
SetCreateGameGroupbox();
|
||||
}
|
||||
|
||||
public void SetCreateGameGroupbox()
|
||||
{
|
||||
groupBox1.Enabled = (comboBoxLobby.SelectedIndex == 0);
|
||||
}
|
||||
|
||||
public void SaveSettings()
|
||||
{
|
||||
Form1_0.D2_LOD_113C_Path = textBoxD2Path.Text;
|
||||
CharConfig.MaxGameTime = (int) numericUpDownMaxTime.Value;
|
||||
|
||||
CharConfig.RunItemGrabScriptOnly = listViewRunScripts.Items[0].Checked;
|
||||
CharConfig.RunCountessScript = listViewRunScripts.Items[1].Checked;
|
||||
CharConfig.RunAndarielScript = listViewRunScripts.Items[2].Checked;
|
||||
CharConfig.RunSummonerScript = listViewRunScripts.Items[3].Checked;
|
||||
CharConfig.RunDurielScript = listViewRunScripts.Items[4].Checked;
|
||||
CharConfig.RunLowerKurastScript = listViewRunScripts.Items[5].Checked;
|
||||
CharConfig.RunMephistoScript = listViewRunScripts.Items[6].Checked;
|
||||
CharConfig.RunChaosScript = listViewRunScripts.Items[7].Checked;
|
||||
CharConfig.RunBaalLeechScript = listViewRunScripts.Items[8].Checked;
|
||||
|
||||
CharConfig.RunGameMakerScript = (comboBoxLobby.SelectedIndex == 0);
|
||||
CharConfig.RunChaosSearchGameScript = (comboBoxLobby.SelectedIndex == 1);
|
||||
CharConfig.RunBaalSearchGameScript = (comboBoxLobby.SelectedIndex == 2);
|
||||
|
||||
CharConfig.GameName = textBoxGameName.Text;
|
||||
CharConfig.GamePass = textBoxGamePass.Text;
|
||||
|
||||
CharConfig.GameDifficulty = comboBoxDifficulty.SelectedIndex;
|
||||
|
||||
Form1_0.CurrentGameNumber = (int) numericUpDownRunNumber.Value;
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
numericUpDownRunNumber.Value = 1;
|
||||
}
|
||||
|
||||
private void FormSettings_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
SaveSettings();
|
||||
Form1_0.SettingsLoader_0.SaveCurrentSettings();
|
||||
}
|
||||
|
||||
private void comboBoxLobby_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
SetCreateGameGroupbox();
|
||||
}
|
||||
|
||||
private void listViewRunScripts_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -64,7 +64,7 @@ Jewel// #### ID LATER #### -> Rainbow Facet
|
|||
//#######################################
|
||||
//KEYS/GEMS/RUNES ITEMS
|
||||
//#######################################
|
||||
El Rune
|
||||
//El Rune
|
||||
Eld Rune
|
||||
Tir Rune
|
||||
Nef Rune
|
||||
|
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -59,5 +59,15 @@ namespace app.Properties {
|
|||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recherche une ressource localisée de type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Application {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Application", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
|
@ -60,6 +60,7 @@
|
|||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
|
@ -68,9 +69,10 @@
|
|||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
|
@ -85,9 +87,10 @@
|
|||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
|
@ -109,9 +112,13 @@
|
|||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="Application" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Application.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
Binary file not shown.
After Width: | Height: | Size: 914 B |
|
@ -29,6 +29,21 @@ namespace app
|
|||
Form1_0 = form1_1;
|
||||
}
|
||||
|
||||
public void CastDefense()
|
||||
{
|
||||
//cast sacred shield
|
||||
Form1_0.KeyMouse_0.PressKey(CharConfig.KeySkillCastDefense);
|
||||
Form1_0.WaitDelay(5);
|
||||
Form1_0.KeyMouse_0.MouseCliccRight(Form1_0.CenterX, Form1_0.CenterY);
|
||||
Form1_0.WaitDelay(35);
|
||||
|
||||
//cast sacred shield
|
||||
Form1_0.KeyMouse_0.PressKey(CharConfig.KeySkillLifeAura);
|
||||
Form1_0.WaitDelay(5);
|
||||
Form1_0.KeyMouse_0.MouseCliccRight(Form1_0.CenterX, Form1_0.CenterY);
|
||||
Form1_0.WaitDelay(5);
|
||||
}
|
||||
|
||||
public void ClearAreaOfMobs(int ThisX, int ThisY, int ClearSize)
|
||||
{
|
||||
AreaX = ThisX;
|
||||
|
@ -159,13 +174,20 @@ namespace app
|
|||
public void SetSkills()
|
||||
{
|
||||
Form1_0.KeyMouse_0.PressKey(CharConfig.KeySkillAttack);
|
||||
Form1_0.KeyMouse_0.PressKey(CharConfig.KeySkillAura);
|
||||
if (CharConfig.PlayerAttackWithRightHand) Form1_0.KeyMouse_0.PressKey(CharConfig.KeySkillAura);
|
||||
}
|
||||
|
||||
public void CastSkills()
|
||||
{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, Form1_0.MobsStruc_0.xPosFinal, Form1_0.MobsStruc_0.yPosFinal);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
if (!CharConfig.PlayerAttackWithRightHand)
|
||||
{
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.KeyMouse_0.MouseCliccRight(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,19 @@ namespace app
|
|||
return false;
|
||||
}
|
||||
|
||||
public bool CanStillGamble()
|
||||
{
|
||||
if (GambleType == 0)
|
||||
{
|
||||
return (Form1_0.PlayerScan_0.PlayerGoldInStash >= CharConfig.GambleUntilGoldAmount + 50000); //gamble ring
|
||||
}
|
||||
if (GambleType == 1)
|
||||
{
|
||||
return (Form1_0.PlayerScan_0.PlayerGoldInStash >= CharConfig.GambleUntilGoldAmount + 63000); //gamble ammy
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void RunGambleScript()
|
||||
{
|
||||
int tries = 0;
|
||||
|
@ -43,7 +56,7 @@ namespace app
|
|||
//Dictionary<string, int> itemScreenPos = Form1_0.Shop_0.ConvertShopLocToScreenPos(Form1_0.ItemsStruc_0.itemx, Form1_0.ItemsStruc_0.itemy);
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.Shop_0.ConvertShopLocToScreenPos(9, 0);
|
||||
Form1_0.KeyMouse_0.MouseCliccRight(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.WaitDelay(40);
|
||||
Form1_0.WaitDelay(100);
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
Form1_0.ItemsStruc_0.GetItems(false); //get inventory
|
||||
//}
|
||||
|
@ -55,7 +68,7 @@ namespace app
|
|||
//Dictionary<string, int> itemScreenPos = Form1_0.Shop_0.ConvertShopLocToScreenPos(Form1_0.ItemsStruc_0.itemx, Form1_0.ItemsStruc_0.itemy);
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.Shop_0.ConvertShopLocToScreenPos(9, 1);
|
||||
Form1_0.KeyMouse_0.MouseCliccRight(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.WaitDelay(40);
|
||||
Form1_0.WaitDelay(100);
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
Form1_0.ItemsStruc_0.GetItems(false); //get inventory
|
||||
//}
|
||||
|
@ -64,7 +77,7 @@ namespace app
|
|||
GambleType++;
|
||||
if (GambleType == 2) GambleType = 0;
|
||||
|
||||
Gambling = CanGamble();
|
||||
Gambling = CanStillGamble();
|
||||
tries++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -129,6 +129,8 @@ namespace app
|
|||
byte KEYEVENTF_KEYUP = 0x02;
|
||||
byte VK_CONTROL = 0x11;
|
||||
|
||||
keybd_event(VK_CONTROL, 0, 0, 0);
|
||||
Thread.Sleep(1);
|
||||
keybd_event(VK_CONTROL, 0, 0, 0);
|
||||
Thread.Sleep(1);
|
||||
PostMessage((int)Form1_0.hWnd, WM_LBUTTONDOWN, 0x00000001, (IntPtr)0);
|
||||
|
@ -144,6 +146,8 @@ namespace app
|
|||
byte VK_SHIFT = 0x10;
|
||||
//byte VK_RBUTTON = 0x02;
|
||||
|
||||
keybd_event(VK_SHIFT, 0, 0, 0);
|
||||
Thread.Sleep(1);
|
||||
keybd_event(VK_SHIFT, 0, 0, 0);
|
||||
Thread.Sleep(1);
|
||||
//keybd_event(VK_RBUTTON, 0, 0, 0);
|
||||
|
|
|
@ -0,0 +1,267 @@
|
|||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Reflection.Emit;
|
||||
using System.Security.Claims;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml.Linq;
|
||||
using static app.Enums;
|
||||
using static app.MapAreaStruc;
|
||||
using static app.MoveToPath;
|
||||
using System.ComponentModel;
|
||||
using static System.Windows.Forms.AxHost;
|
||||
using System.Security.Cryptography;
|
||||
using static System.Net.WebRequestMethods;
|
||||
|
||||
namespace app
|
||||
{
|
||||
|
||||
public class MoveToPath
|
||||
{
|
||||
Form1 Form1_0;
|
||||
|
||||
public int ThisPlayerAreaID = 0;
|
||||
public Position LastMovingLocation = new Position { X = 0, Y = 0 };
|
||||
public Position ThisFinalPosition = new Position { X = 0, Y = 0 };
|
||||
//public int MoveTry = 0;
|
||||
|
||||
public void SetForm1(Form1 form1_1)
|
||||
{
|
||||
Form1_0 = form1_1;
|
||||
}
|
||||
|
||||
public void MoveToArea(Area ThisID)
|
||||
{
|
||||
if (Form1_0.PlayerScan_0.levelNo == 0) Form1_0.PlayerScan_0.GetPositions();
|
||||
|
||||
ThisPlayerAreaID = (int)Form1_0.PlayerScan_0.levelNo;
|
||||
ThisFinalPosition = Form1_0.MapAreaStruc_0.GetPositionOfObject("exit", Form1_0.Town_0.getAreaName((int) ThisID), ThisPlayerAreaID - 1, new List<int>() { });
|
||||
|
||||
//Console.WriteLine("Going to Pos: " + ThisFinalPosition.X + ", " + ThisFinalPosition.Y);
|
||||
MoveToArea((int) ThisID);
|
||||
}
|
||||
|
||||
public void MoveToNPC(string NPCName)
|
||||
{
|
||||
if (Form1_0.PlayerScan_0.levelNo == 0) Form1_0.PlayerScan_0.GetPositions();
|
||||
|
||||
ThisPlayerAreaID = (int)Form1_0.PlayerScan_0.levelNo;
|
||||
ThisFinalPosition = Form1_0.MapAreaStruc_0.GetPositionOfObject("npc", NPCName, ThisPlayerAreaID - 1, new List<int>() { });
|
||||
|
||||
MoveToArea((int)ThisPlayerAreaID);
|
||||
}
|
||||
|
||||
public void MoveToThisPos(Position ThisPositionn)
|
||||
{
|
||||
if (Form1_0.PlayerScan_0.levelNo == 0) Form1_0.PlayerScan_0.GetPositions();
|
||||
|
||||
ThisPlayerAreaID = (int)Form1_0.PlayerScan_0.levelNo;
|
||||
ThisFinalPosition = ThisPositionn;
|
||||
|
||||
MoveToArea((int)ThisPlayerAreaID);
|
||||
}
|
||||
|
||||
public void MoveToArea(int ThisID)
|
||||
{
|
||||
ThisPlayerAreaID = (int)Form1_0.PlayerScan_0.levelNo;
|
||||
//Console.WriteLine("Going to Pos: " + ThisFinalPosition.X + ", " + ThisFinalPosition.Y);
|
||||
|
||||
List<Room> path = FindShortestPath(Form1_0.MapAreaStruc_0.AllMapData[ThisPlayerAreaID - 1].Rooms, Form1_0.PlayerScan_0.xPos, Form1_0.PlayerScan_0.yPos, ThisFinalPosition.X, ThisFinalPosition.Y);
|
||||
bool IsMovingThruPath = false;
|
||||
int CurrentPathIndex = 0;
|
||||
if (path != null)
|
||||
{
|
||||
IsMovingThruPath = true;
|
||||
while (IsMovingThruPath)
|
||||
{
|
||||
//Console.WriteLine("Pos test: " + path[CurrentPathIndex].X + ", " + path[CurrentPathIndex].Y);
|
||||
if (Form1_0.Mover_0.MoveToLocation(path[CurrentPathIndex].X + (path[CurrentPathIndex].Width / 2), path[CurrentPathIndex].Y + (path[CurrentPathIndex].Height / 2), false, false))
|
||||
{
|
||||
CurrentPathIndex++;
|
||||
if (CurrentPathIndex >= path.Count - 1)
|
||||
{
|
||||
IsMovingThruPath = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (path[CurrentPathIndex].X != LastMovingLocation.X || path[CurrentPathIndex].Y != LastMovingLocation.Y)
|
||||
{
|
||||
LastMovingLocation.X = path[CurrentPathIndex].X;
|
||||
LastMovingLocation.Y = path[CurrentPathIndex].Y;
|
||||
//MoveTry = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
//MoveTry++;
|
||||
//if (MoveTry > 5)
|
||||
//{
|
||||
CurrentPathIndex++;
|
||||
if (CurrentPathIndex >= path.Count - 1)
|
||||
{
|
||||
IsMovingThruPath = false;
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Form1_0.Mover_0.MoveToLocation(ThisFinalPosition.X, ThisFinalPosition.Y);
|
||||
|
||||
int tryyy = 0;
|
||||
while (Form1_0.PlayerScan_0.levelNo == ThisPlayerAreaID && tryyy <= 25)
|
||||
{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, ThisFinalPosition.X, ThisFinalPosition.Y);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
tryyy++;
|
||||
}
|
||||
|
||||
/*Console.WriteLine("Shortest path found:");
|
||||
foreach (Room room in path)
|
||||
{
|
||||
Console.WriteLine($"Room: ({room.X}, {room.Y}) - ({room.Width}, {room.Height})");
|
||||
}*/
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.method_1("No path found.", Color.Red);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<Room> FindShortestPath(List<Room> rooms, int startX, int startY, int destX, int destY)
|
||||
{
|
||||
List<Room> path = new List<Room>();
|
||||
Queue<Room> queue = new Queue<Room>();
|
||||
HashSet<Room> visited = new HashSet<Room>();
|
||||
Dictionary<Room, Room> parent = new Dictionary<Room, Room>();
|
||||
|
||||
Room startRoom = rooms.FirstOrDefault(r => r.Contain(startX, startY));
|
||||
Room destRoom = rooms.FirstOrDefault(r => r.Contain(destX, destY));
|
||||
|
||||
List<Room> roomsOut = rooms;
|
||||
if (destRoom == null)
|
||||
{
|
||||
destRoom = Form1_0.MapAreaStruc_0.AllMapData[ThisPlayerAreaID - 2].Rooms.FirstOrDefault(r => r.Contain(destX, destY));
|
||||
roomsOut = Form1_0.MapAreaStruc_0.AllMapData[ThisPlayerAreaID - 2].Rooms;
|
||||
}
|
||||
if (destRoom == null)
|
||||
{
|
||||
destRoom = Form1_0.MapAreaStruc_0.AllMapData[ThisPlayerAreaID].Rooms.FirstOrDefault(r => r.Contain(destX, destY));
|
||||
roomsOut = Form1_0.MapAreaStruc_0.AllMapData[ThisPlayerAreaID].Rooms;
|
||||
}
|
||||
|
||||
//Console.WriteLine("Start Room: " + startRoom.X + ", " + startRoom.Y);
|
||||
//Console.WriteLine("Dest Room: " + destRoom.X + ", " + destRoom.Y);
|
||||
|
||||
if (startRoom == null || destRoom == null) return null;
|
||||
|
||||
queue.Enqueue(startRoom);
|
||||
visited.Add(startRoom);
|
||||
parent[startRoom] = null;
|
||||
|
||||
while (queue.Count > 0)
|
||||
{
|
||||
Room currentRoom = queue.Dequeue();
|
||||
if (currentRoom == destRoom)
|
||||
{
|
||||
//Console.WriteLine("Path found...");
|
||||
// Reconstruct the path
|
||||
Room node = currentRoom;
|
||||
while (node != null)
|
||||
{
|
||||
path.Insert(0, node);
|
||||
node = parent[node];
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
foreach (Room neighbor in GetNeighbors(currentRoom, rooms, roomsOut))
|
||||
{
|
||||
if (!visited.Contains(neighbor))
|
||||
{
|
||||
queue.Enqueue(neighbor);
|
||||
visited.Add(neighbor);
|
||||
parent[neighbor] = currentRoom;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null; // No path found
|
||||
}
|
||||
|
||||
public static IEnumerable<Room> GetNeighbors(Room room, List<Room> rooms, List<Room> roomsOut)
|
||||
{
|
||||
if (rooms != roomsOut)
|
||||
{
|
||||
foreach (Room otherRoom in roomsOut)
|
||||
{
|
||||
if (room != otherRoom && IsNeighbor(room, otherRoom))
|
||||
{
|
||||
yield return otherRoom;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Room otherRoom in rooms)
|
||||
{
|
||||
if (room != otherRoom && IsNeighbor(room, otherRoom))
|
||||
{
|
||||
yield return otherRoom;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (Room otherRoom in rooms)
|
||||
{
|
||||
//Console.WriteLine("Neighbor test: " + otherRoom.X + ", " + otherRoom.Y + " neighbor of: " + room.X + ", " + room.Y + " | " + IsNeighbor(room, otherRoom));
|
||||
|
||||
if (room != otherRoom && IsNeighbor(room, otherRoom))
|
||||
{
|
||||
//Console.WriteLine("Room: " + otherRoom.X + ", " + otherRoom.Y + " neighbor of: " + room.X + ", " + room.Y);
|
||||
yield return otherRoom;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsNeighbor(Room room1, Room room2)
|
||||
{
|
||||
//Neighbor test: 4640, 5400 neighbor of: 4640, 5440 | False
|
||||
// Check if room2 is a neighbor of room1 based on position and width
|
||||
int neighborX = room1.X - room2.Width;
|
||||
int neighborY = room1.Y - room2.Height; // Assuming rooms are aligned vertically
|
||||
|
||||
bool IsNeighbor = false;
|
||||
if (room1.X < room2.X && room2.X == (room1.X + room1.Width)
|
||||
&& room1.Y == room2.Y) IsNeighbor = true;
|
||||
if (room1.X > room2.X && room2.X == (room1.X - room2.Width)
|
||||
&& room1.Y == room2.Y) IsNeighbor = true;
|
||||
|
||||
if (room1.Y < room2.Y && room2.Y == (room1.Y + room1.Height)
|
||||
&& room1.X == room2.X) IsNeighbor = true;
|
||||
if (room1.Y > room2.Y && room2.Y == (room1.Y - room2.Height)
|
||||
&& room1.X == room2.X) IsNeighbor = true;
|
||||
|
||||
/*if (room1.X < room2.X && room2.X == (room1.X + room1.Width)
|
||||
&& room1.Y > room2.Y && room2.Y == (room1.Y - room2.Height)) IsNeighbor = true;
|
||||
|
||||
if (room1.X > room2.X && room2.X == (room1.X - room2.Width)
|
||||
&& room1.Y < room2.Y && room2.Y == (room1.Y + room1.Height)) IsNeighbor = true;
|
||||
|
||||
if (room1.X > room2.X && room2.X == (room1.X - room2.Width)
|
||||
&& room1.Y > room2.Y && room2.Y == (room1.Y - room2.Height)) IsNeighbor = true;
|
||||
*/
|
||||
|
||||
return IsNeighbor;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -15,12 +15,17 @@ namespace app
|
|||
public int MoveAcceptOffset = 4;
|
||||
public long StartAreaBeforeMoving = 0;
|
||||
|
||||
public bool AllowFastMove = false;
|
||||
|
||||
public DateTime LastTimeSinceTeleport = DateTime.Now;
|
||||
|
||||
public void SetForm1(Form1 form1_1)
|
||||
{
|
||||
Form1_0 = form1_1;
|
||||
}
|
||||
|
||||
public bool MoveToLocation(int ThisX, int ThisY)
|
||||
|
||||
public bool MoveToLocation(int ThisX, int ThisY, bool AllowPickingItem = false, bool AllowMoveSideWay = true)
|
||||
{
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
StartAreaBeforeMoving = Form1_0.PlayerScan_0.levelNo;
|
||||
|
@ -55,10 +60,12 @@ namespace app
|
|||
if (Form1_0.Town_0.GetInTown())
|
||||
{
|
||||
Form1_0.KeyMouse_0.PressKey(CharConfig.KeySkillfastMoveAtTown);
|
||||
AllowFastMove = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.KeyMouse_0.PressKey(CharConfig.KeySkillfastMoveOutsideTown);
|
||||
if (CharConfig.UseTeleport) AllowFastMove = true;
|
||||
}
|
||||
|
||||
//calculate new Y clicking offset, else it will clic on bottom menu items
|
||||
|
@ -81,12 +88,27 @@ namespace app
|
|||
if (CharConfig.UseTeleport && !Form1_0.Town_0.GetInTown())
|
||||
{
|
||||
Form1_0.KeyMouse_0.MouseCliccRight(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.WaitDelay(10);
|
||||
|
||||
//#######
|
||||
if (!AllowFastMove)
|
||||
{
|
||||
LastTimeSinceTeleport = DateTime.Now;
|
||||
TimeSpan ThisTimeCheck = DateTime.Now - LastTimeSinceTeleport;
|
||||
while (Form1_0.PlayerScan_0.xPosFinal == LastX && Form1_0.PlayerScan_0.yPosFinal == LastY && ThisTimeCheck.TotalMilliseconds < 200)
|
||||
{
|
||||
Application.DoEvents();
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
ThisTimeCheck = DateTime.Now - LastTimeSinceTeleport;
|
||||
}
|
||||
}
|
||||
//#######
|
||||
|
||||
//Form1_0.WaitDelay(10);
|
||||
}
|
||||
//Form1_0.WaitDelay(2);
|
||||
Application.DoEvents();
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
if (AllowPickingItem) Form1_0.ItemsStruc_0.GetItems(true); //#############
|
||||
Form1_0.Potions_0.CheckIfWeUsePotion();
|
||||
itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, ThisX, ThisY);
|
||||
Application.DoEvents();
|
||||
|
@ -119,11 +141,13 @@ namespace app
|
|||
}
|
||||
if (TryMove >= MaxMoveTry)
|
||||
{
|
||||
if (!AllowMoveSideWay) return false;
|
||||
|
||||
if (!Form1_0.GameStruc_0.IsInGame() || !Form1_0.Running)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Form1_0.ItemsStruc_0.GetItems(true);
|
||||
if (AllowPickingItem) Form1_0.ItemsStruc_0.GetItems(true); //#############
|
||||
Form1_0.Potions_0.CheckIfWeUsePotion();
|
||||
if (TryMove2 == 0) Form1_0.KeyMouse_0.MouseMoveTo(Form1_0.ScreenX / 2, Form1_0.ScreenY / 2);
|
||||
if (TryMove2 == 1) Form1_0.KeyMouse_0.MouseMoveTo(Form1_0.ScreenX / 2 - 250, Form1_0.ScreenY / 2);
|
||||
|
@ -186,6 +210,7 @@ namespace app
|
|||
bool IsMoving = true;
|
||||
int LastX = Form1_0.PlayerScan_0.xPosFinal;
|
||||
int LastY = Form1_0.PlayerScan_0.yPosFinal;
|
||||
int Triess = 0;
|
||||
|
||||
while (IsMoving)
|
||||
{
|
||||
|
@ -206,6 +231,9 @@ namespace app
|
|||
|
||||
LastX = Form1_0.PlayerScan_0.xPosFinal;
|
||||
LastY = Form1_0.PlayerScan_0.yPosFinal;
|
||||
|
||||
Triess++;
|
||||
if (Triess >= 20) IsMoving = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,11 @@ namespace app
|
|||
public int MercSameHPCount = 0;
|
||||
public bool CanUseSkillForRegen = true;
|
||||
|
||||
public bool ForceLeave = false;
|
||||
|
||||
public DateTime LastTimeSinceUsedHPPot = DateTime.Now;
|
||||
public DateTime LastTimeSinceUsedManaPot = DateTime.Now;
|
||||
|
||||
public void SetForm1(Form1 form1_1)
|
||||
{
|
||||
Form1_0 = form1_1;
|
||||
|
@ -37,14 +42,27 @@ namespace app
|
|||
return;
|
||||
}
|
||||
|
||||
if (Form1_0.Town_0.Towning)
|
||||
if (Form1_0.Town_0.Towning && Form1_0.Town_0.IsInTown)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Form1_0.GameStruc_0.IsInGame()) return;
|
||||
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
CheckHPAndManaMax();
|
||||
|
||||
|
||||
//dead leave game
|
||||
if (Form1_0.PlayerScan_0.PlayerDead || ForceLeave || Form1_0.PlayerScan_0.PlayerHP == 0)
|
||||
{
|
||||
ForceLeave = true;
|
||||
Form1_0.Baal_0.SearchSameGamesAsLastOne = false;
|
||||
Form1_0.LeaveGame(false);
|
||||
return;
|
||||
//Chicken();
|
||||
}
|
||||
|
||||
//take hp
|
||||
if (((Form1_0.PlayerScan_0.PlayerHP * 100) / Form1_0.PlayerScan_0.PlayerMaxHP) <= CharConfig.TakeHPPotUnder)
|
||||
{
|
||||
|
@ -59,11 +77,22 @@ namespace app
|
|||
{
|
||||
TakePotion(0);
|
||||
}
|
||||
//TakePotion(0);
|
||||
}
|
||||
}
|
||||
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
|
||||
//dead leave game
|
||||
if (Form1_0.PlayerScan_0.PlayerDead || ForceLeave)
|
||||
{
|
||||
ForceLeave = true;
|
||||
Form1_0.Baal_0.SearchSameGamesAsLastOne = false;
|
||||
Form1_0.LeaveGame(false);
|
||||
return;
|
||||
//Chicken();
|
||||
}
|
||||
|
||||
//chicken
|
||||
if (((Form1_0.PlayerScan_0.PlayerHP * 100) / Form1_0.PlayerScan_0.PlayerMaxHP) < CharConfig.ChickenHP)
|
||||
{
|
||||
|
@ -82,6 +111,7 @@ namespace app
|
|||
{
|
||||
TakePotion(1);
|
||||
}
|
||||
//TakePotion(1);
|
||||
}
|
||||
|
||||
//Check Merc
|
||||
|
@ -109,18 +139,29 @@ namespace app
|
|||
if (PotToTake == 0)
|
||||
{
|
||||
bool UsedPot = false;
|
||||
for (int i = 0; i < CharConfig.BeltPotTypeToHave.Length; i++)
|
||||
TimeSpan ThisTimeCheck = DateTime.Now - LastTimeSinceUsedHPPot;
|
||||
if (ThisTimeCheck.TotalMilliseconds > 2000)
|
||||
{
|
||||
if (CharConfig.BeltPotTypeToHave[i] == 0) //Type equal 0
|
||||
for (int i = 0; i < CharConfig.BeltPotTypeToHave.Length; i++)
|
||||
{
|
||||
if (Form1_0.BeltStruc_0.BeltHaveItems[i] == 1)
|
||||
if (CharConfig.BeltPotTypeToHave[i] == 0) //Type equal 0
|
||||
{
|
||||
PressPotionKey(i, SendToMerc);
|
||||
UsedPot = true;
|
||||
i = CharConfig.BeltPotTypeToHave.Length;
|
||||
if (Form1_0.BeltStruc_0.BeltHaveItems[i] == 1)
|
||||
{
|
||||
PressPotionKey(i, SendToMerc);
|
||||
UsedPot = true;
|
||||
LastTimeSinceUsedHPPot = DateTime.Now;
|
||||
Form1_0.BeltStruc_0.CheckForMissingPotions();
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
i = CharConfig.BeltPotTypeToHave.Length;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UsedPot = true;
|
||||
}
|
||||
if (!UsedPot)
|
||||
{
|
||||
Form1_0.Town_0.FastTowning = true;
|
||||
|
@ -132,18 +173,29 @@ namespace app
|
|||
if (PotToTake == 1)
|
||||
{
|
||||
bool UsedPot = false;
|
||||
for (int i = 0; i < CharConfig.BeltPotTypeToHave.Length; i++)
|
||||
TimeSpan ThisTimeCheck = DateTime.Now - LastTimeSinceUsedManaPot;
|
||||
if (ThisTimeCheck.TotalMilliseconds > 1200)
|
||||
{
|
||||
if (CharConfig.BeltPotTypeToHave[i] == 1) //Type equal 1
|
||||
for (int i = 0; i < CharConfig.BeltPotTypeToHave.Length; i++)
|
||||
{
|
||||
if (Form1_0.BeltStruc_0.BeltHaveItems[i] == 1)
|
||||
if (CharConfig.BeltPotTypeToHave[i] == 1) //Type equal 1
|
||||
{
|
||||
PressPotionKey(i, SendToMerc);
|
||||
UsedPot = true;
|
||||
i = CharConfig.BeltPotTypeToHave.Length;
|
||||
if (Form1_0.BeltStruc_0.BeltHaveItems[i] == 1)
|
||||
{
|
||||
PressPotionKey(i, SendToMerc);
|
||||
UsedPot = true;
|
||||
LastTimeSinceUsedManaPot = DateTime.Now;
|
||||
Form1_0.BeltStruc_0.CheckForMissingPotions();
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
i = CharConfig.BeltPotTypeToHave.Length;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UsedPot = true;
|
||||
}
|
||||
if (!UsedPot)
|
||||
{
|
||||
Form1_0.Town_0.FastTowning = true;
|
||||
|
@ -163,6 +215,8 @@ namespace app
|
|||
{
|
||||
PressPotionKey(i, SendToMerc);
|
||||
UsedPot = true;
|
||||
Form1_0.BeltStruc_0.CheckForMissingPotions();
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
i = CharConfig.BeltPotTypeToHave.Length;
|
||||
}
|
||||
}
|
||||
|
@ -261,7 +315,7 @@ namespace app
|
|||
//############################
|
||||
if (Form1_0.PlayerScan_0.PlayerHP < PlayerHPLast)
|
||||
{
|
||||
if (CanUseSkillForRegen)
|
||||
if (CanUseSkillForRegen && !CharConfig.RunItemGrabScriptOnly)
|
||||
{
|
||||
Form1_0.KeyMouse_0.PressKey(CharConfig.KeySkillLifeAura);
|
||||
}
|
||||
|
@ -283,7 +337,7 @@ namespace app
|
|||
}
|
||||
else
|
||||
{
|
||||
if (CanUseSkillForRegen)
|
||||
if (CanUseSkillForRegen && !CharConfig.RunItemGrabScriptOnly)
|
||||
{
|
||||
Form1_0.KeyMouse_0.PressKey(CharConfig.KeySkillLifeAura);
|
||||
}
|
||||
|
@ -299,7 +353,7 @@ namespace app
|
|||
//Set Lower HP
|
||||
if (Form1_0.PlayerScan_0.PlayerHP == PlayerHPLast && SameHPCount >= 45)
|
||||
{
|
||||
Form1_0.KeyMouse_0.PressKey(CharConfig.KeySkillDefenseAura);
|
||||
if (!CharConfig.RunItemGrabScriptOnly) Form1_0.KeyMouse_0.PressKey(CharConfig.KeySkillDefenseAura);
|
||||
if (Form1_0.PlayerScan_0.PlayerHP < Form1_0.PlayerScan_0.PlayerMaxHP)
|
||||
{
|
||||
Form1_0.PlayerScan_0.PlayerMaxHP = Form1_0.PlayerScan_0.PlayerHP;
|
||||
|
|
134
Scripts/Shop.cs
134
Scripts/Shop.cs
|
@ -39,7 +39,9 @@ namespace app
|
|||
if (Form1_0.InventoryStruc_0.HasInventoryItems()
|
||||
|| Form1_0.BeltStruc_0.MissingHPPot
|
||||
|| Form1_0.BeltStruc_0.MissingManaPot
|
||||
|| Form1_0.InventoryStruc_0.HUDItems_tpscrolls <= 2)
|
||||
|| Form1_0.InventoryStruc_0.HUDItems_tpscrolls <= 2
|
||||
|| Form1_0.InventoryStruc_0.HUDItems_keys <= 3
|
||||
|| Form1_0.PlayerScan_0.ShouldSeeShopForHP())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -117,13 +119,20 @@ namespace app
|
|||
}
|
||||
|
||||
Form1_0.ItemsStruc_0.GetItems(false); //get inventory again
|
||||
PickItem(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
/*PickItem(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.WaitDelay(10);
|
||||
if (!PlaceItem(555, 465))
|
||||
{
|
||||
Form1_0.WaitDelay(10);
|
||||
PlaceItem(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
//CTRL+Clic to send item into stash
|
||||
Form1_0.KeyMouse_0.SendCTRL_CLICK(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.WaitDelay(5);
|
||||
Form1_0.ItemsStruc_0.GetItems(false); //get inventory again
|
||||
PlaceItem(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
|
||||
//############## OLD CODE
|
||||
//Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
|
@ -192,11 +201,43 @@ namespace app
|
|||
{
|
||||
Dictionary<string, int> itemScreenPos = ConvertShopLocToScreenPos(Form1_0.ItemsStruc_0.itemx, Form1_0.ItemsStruc_0.itemy);
|
||||
|
||||
//Form1_0.SendSHIFT_RIGHTCLICK(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.KeyMouse_0.MouseCliccRight(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.WaitDelay(40);
|
||||
int ShopCount = 4;
|
||||
if (Form1_0.BeltStruc_0.ForceHPPotionQty > 0)
|
||||
{
|
||||
ShopCount = Form1_0.BeltStruc_0.ForceHPPotionQty - Form1_0.BeltStruc_0.HPQuantity;
|
||||
}
|
||||
else
|
||||
{
|
||||
ShopCount = 8 - Form1_0.BeltStruc_0.HPQuantity;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ShopCount; i++)
|
||||
{
|
||||
//Form1_0.SendSHIFT_RIGHTCLICK(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.KeyMouse_0.MouseCliccRight(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.WaitDelay(10);
|
||||
}
|
||||
|
||||
Form1_0.ItemsStruc_0.UsePotionNotInRightSpot = false; //dont use pot if not in correct spot
|
||||
Form1_0.ItemsStruc_0.GetItems(false); //get inventory
|
||||
|
||||
//####
|
||||
if (Form1_0.InventoryStruc_0.HasInventoryItemName("Super Healing Potion") || Form1_0.BeltStruc_0.HasPotInBadSpot)
|
||||
{
|
||||
//Form1_0.method_1("FORCING HP POT QTY: " + Form1_0.BeltStruc_0.HPQuantity, Color.Red);
|
||||
Form1_0.BeltStruc_0.ForceHPPotionQty = Form1_0.BeltStruc_0.HPQuantity; //reset qty in belt
|
||||
if (Form1_0.BeltStruc_0.HasPotInBadSpot)
|
||||
{
|
||||
Form1_0.BeltStruc_0.ForceHPPotionQty -= 1;
|
||||
Form1_0.ItemsStruc_0.UsePotionNotInRightSpot = true;
|
||||
Form1_0.ItemsStruc_0.GetItems(false); //get inventory to use pot in bad spot
|
||||
Form1_0.ItemsStruc_0.GetItems(false); //get inventory to use pot in bad spot
|
||||
}
|
||||
//Form1_0.method_1("FORCING HP POT QTY: " + Form1_0.BeltStruc_0.ForceHPPotionQty, Color.Red);
|
||||
break;
|
||||
}
|
||||
//####
|
||||
|
||||
Form1_0.ItemsStruc_0.UsePotionNotInRightSpot = true;
|
||||
Form1_0.BeltStruc_0.CheckForMissingPotions();
|
||||
}
|
||||
|
@ -207,15 +248,7 @@ namespace app
|
|||
}
|
||||
StartQty = Form1_0.BeltStruc_0.HPQuantity;
|
||||
}
|
||||
|
||||
if (Form1_0.InventoryStruc_0.HasInventoryItemName("Super Healing Potion") || Form1_0.BeltStruc_0.HasPotInBadSpot)
|
||||
{
|
||||
Form1_0.BeltStruc_0.ForceHPPotionQty = Form1_0.BeltStruc_0.HPQuantity; //reset qty in belt
|
||||
if (Form1_0.BeltStruc_0.HasPotInBadSpot)
|
||||
{
|
||||
Form1_0.ItemsStruc_0.GetItems(false); //get inventory to use pot in bad spot
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//buy mana
|
||||
tries = 0;
|
||||
|
@ -231,11 +264,41 @@ namespace app
|
|||
{
|
||||
Dictionary<string, int> itemScreenPos = ConvertShopLocToScreenPos(Form1_0.ItemsStruc_0.itemx, Form1_0.ItemsStruc_0.itemy);
|
||||
|
||||
//Form1_0.SendSHIFT_RIGHTCLICK(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.KeyMouse_0.MouseCliccRight(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.WaitDelay(40);
|
||||
int ShopCount = 4;
|
||||
if (Form1_0.BeltStruc_0.ForceHPPotionQty > 0)
|
||||
{
|
||||
ShopCount = Form1_0.BeltStruc_0.ForceMANAPotionQty - Form1_0.BeltStruc_0.ManyQuantity;
|
||||
}
|
||||
else
|
||||
{
|
||||
ShopCount = 8 - Form1_0.BeltStruc_0.ManyQuantity;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ShopCount; i++)
|
||||
{
|
||||
//Form1_0.SendSHIFT_RIGHTCLICK(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.KeyMouse_0.MouseCliccRight(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.WaitDelay(10);
|
||||
}
|
||||
|
||||
Form1_0.ItemsStruc_0.UsePotionNotInRightSpot = false; //dont use pot if not in correct spot
|
||||
Form1_0.ItemsStruc_0.GetItems(false); //get inventory
|
||||
|
||||
//####
|
||||
if (Form1_0.InventoryStruc_0.HasInventoryItemName("Super Mana Potion") || Form1_0.BeltStruc_0.HasPotInBadSpot)
|
||||
{
|
||||
Form1_0.BeltStruc_0.ForceMANAPotionQty = Form1_0.BeltStruc_0.ManyQuantity; //reset qty in belt
|
||||
if (Form1_0.BeltStruc_0.HasPotInBadSpot)
|
||||
{
|
||||
Form1_0.BeltStruc_0.ForceMANAPotionQty -= 1;
|
||||
Form1_0.ItemsStruc_0.UsePotionNotInRightSpot = true;
|
||||
Form1_0.ItemsStruc_0.GetItems(false); //get inventory to use pot in bad spot
|
||||
Form1_0.ItemsStruc_0.GetItems(false); //get inventory to use pot in bad spot
|
||||
}
|
||||
break;
|
||||
}
|
||||
//####
|
||||
|
||||
Form1_0.ItemsStruc_0.UsePotionNotInRightSpot = true;
|
||||
Form1_0.BeltStruc_0.CheckForMissingPotions();
|
||||
}
|
||||
|
@ -247,14 +310,6 @@ namespace app
|
|||
StartQty = Form1_0.BeltStruc_0.ManyQuantity;
|
||||
}
|
||||
|
||||
if (Form1_0.InventoryStruc_0.HasInventoryItemName("Super Mana Potion") || Form1_0.BeltStruc_0.HasPotInBadSpot)
|
||||
{
|
||||
Form1_0.BeltStruc_0.ForceMANAPotionQty = Form1_0.BeltStruc_0.ManyQuantity; //reset qty in belt
|
||||
if (Form1_0.BeltStruc_0.HasPotInBadSpot)
|
||||
{
|
||||
Form1_0.ItemsStruc_0.GetItems(false); //get inventory to use pot in bad spot
|
||||
}
|
||||
}
|
||||
|
||||
//buy tp
|
||||
tries = 0;
|
||||
|
@ -270,9 +325,13 @@ namespace app
|
|||
{
|
||||
Dictionary<string, int> itemScreenPos = ConvertShopLocToScreenPos(Form1_0.ItemsStruc_0.itemx, Form1_0.ItemsStruc_0.itemy);
|
||||
|
||||
//Form1_0.SendSHIFT_RIGHTCLICK(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.KeyMouse_0.MouseCliccRight(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.WaitDelay(40);
|
||||
int ShopCount = 20 - Form1_0.InventoryStruc_0.HUDItems_tpscrolls;
|
||||
for (int i = 0; i < ShopCount; i++)
|
||||
{
|
||||
//Form1_0.SendSHIFT_RIGHTCLICK(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.KeyMouse_0.MouseCliccRight(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.WaitDelay(10);
|
||||
}
|
||||
Form1_0.ItemsStruc_0.GetItems(false); //get inventory
|
||||
}
|
||||
|
||||
|
@ -297,9 +356,13 @@ namespace app
|
|||
{
|
||||
Dictionary<string, int> itemScreenPos = ConvertShopLocToScreenPos(Form1_0.ItemsStruc_0.itemx, Form1_0.ItemsStruc_0.itemy);
|
||||
|
||||
//Form1_0.SendSHIFT_RIGHTCLICK(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.KeyMouse_0.MouseCliccRight(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.WaitDelay(40);
|
||||
int ShopCount = 20 - Form1_0.InventoryStruc_0.HUDItems_idscrolls;
|
||||
for (int i = 0; i < ShopCount; i++)
|
||||
{
|
||||
//Form1_0.SendSHIFT_RIGHTCLICK(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.KeyMouse_0.MouseCliccRight(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.WaitDelay(10);
|
||||
}
|
||||
Form1_0.ItemsStruc_0.GetItems(false); //get inventory
|
||||
}
|
||||
|
||||
|
@ -311,6 +374,7 @@ namespace app
|
|||
}
|
||||
|
||||
//buy key
|
||||
Form1_0.InventoryStruc_0.VerifyKeysInventory();
|
||||
tries = 0;
|
||||
StartQty = Form1_0.InventoryStruc_0.HUDItems_keys;
|
||||
while (Form1_0.InventoryStruc_0.HUDItems_keys <= 8 && tries < 1)
|
||||
|
@ -324,9 +388,9 @@ namespace app
|
|||
{
|
||||
Dictionary<string, int> itemScreenPos = ConvertShopLocToScreenPos(Form1_0.ItemsStruc_0.itemx, Form1_0.ItemsStruc_0.itemy);
|
||||
|
||||
//Form1_0.SendSHIFT_RIGHTCLICK(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.KeyMouse_0.MouseCliccRight(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.WaitDelay(40);
|
||||
Form1_0.KeyMouse_0.SendSHIFT_RIGHTCLICK(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
//Form1_0.KeyMouse_0.MouseCliccRight(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.WaitDelay(20);
|
||||
Form1_0.ItemsStruc_0.GetItems(false); //get inventory
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@ namespace app
|
|||
public bool StashFull = false;
|
||||
Dictionary<string, int> LastitemScreenPos = new Dictionary<string, int>();
|
||||
|
||||
public int RunningScriptCount = 0;
|
||||
|
||||
public void SetForm1(Form1 form1_1)
|
||||
{
|
||||
Form1_0 = form1_1;
|
||||
|
@ -59,6 +61,7 @@ namespace app
|
|||
Form1_0.ItemsStruc_0.GetItems(false); //get inventory again
|
||||
Form1_0.SetGameStatus("TOWN-STASH-ITEM:" + Form1_0.InventoryStruc_0.InventoryItemNames[i]);
|
||||
PlaceItem(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
PlaceItem(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
|
||||
//item still in inventory
|
||||
if (Form1_0.InventoryStruc_0.InventoryHasStashItem[i] >= 1)
|
||||
|
@ -104,6 +107,8 @@ namespace app
|
|||
}
|
||||
if (TryStashCount >= 4)
|
||||
{
|
||||
RunningScriptCount++;
|
||||
if (RunningScriptCount >= 15) StashFull = true;
|
||||
//StashFull = true; //##################################################
|
||||
i = 40; //stash is full, dont try others items to stash
|
||||
break;
|
||||
|
@ -124,16 +129,21 @@ namespace app
|
|||
}
|
||||
|
||||
//deposit gold
|
||||
Form1_0.KeyMouse_0.MouseClicc(200, 200); //clic stash1
|
||||
|
||||
Form1_0.SetGameStatus("TOWN-STASH-DEPOSIT GOLD");
|
||||
Form1_0.KeyMouse_0.MouseClicc(1450, 790); //clic deposit
|
||||
Form1_0.WaitDelay(25);
|
||||
Form1_0.KeyMouse_0.MouseClicc(820, 580); //clic ok on deposit
|
||||
Form1_0.WaitDelay(25);
|
||||
Form1_0.PlayerScan_0.PlayerGoldInventory = 0;
|
||||
|
||||
//craft/cube item script here ###
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
Form1_0.ItemsStruc_0.GetItems(false);
|
||||
Form1_0.Cubing_0.PerformCubing();
|
||||
|
||||
Form1_0.InventoryStruc_0.VerifyKeysInventory();
|
||||
}
|
||||
|
||||
public bool PlaceItem(int PosX, int PosY)
|
||||
|
|
395
Scripts/Town.cs
395
Scripts/Town.cs
|
@ -5,6 +5,7 @@ using System.Linq;
|
|||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static app.MapAreaStruc;
|
||||
|
||||
namespace app
|
||||
{
|
||||
|
@ -26,6 +27,12 @@ namespace app
|
|||
public int TriedToMercCount = 0;
|
||||
public int TriedToUseTPCount = 0;
|
||||
public int CurrentScript = 0;
|
||||
public int TriedToShopCount2 = 0;
|
||||
|
||||
public uint LastUsedTPID = 0;
|
||||
public int LastUsedTPCount = 0;
|
||||
public List<uint> IgnoredTPList = new List<uint>();
|
||||
public bool FirstTown = true;
|
||||
|
||||
public void SetForm1(Form1 form1_1)
|
||||
{
|
||||
|
@ -41,11 +48,53 @@ namespace app
|
|||
|
||||
Form1_0.SetGameStatus("TOWN");
|
||||
|
||||
//dead leave game
|
||||
if (Form1_0.PlayerScan_0.PlayerDead || Form1_0.Potions_0.ForceLeave)
|
||||
{
|
||||
Form1_0.Potions_0.ForceLeave = true;
|
||||
Form1_0.Baal_0.SearchSameGamesAsLastOne = false;
|
||||
Form1_0.LeaveGame(false);
|
||||
return;
|
||||
}
|
||||
|
||||
//item grab only -> no town
|
||||
if (Towning && CharConfig.RunItemGrabScriptOnly)
|
||||
{
|
||||
CurrentScript = 0;
|
||||
TriedToStashCount = 0;
|
||||
TriedToGambleCount = 0;
|
||||
TriedToShopCount = 0;
|
||||
TriedToShopCount2 = 0;
|
||||
TriedToMercCount = 0;
|
||||
TriedToUseTPCount = 0;
|
||||
Towning = false;
|
||||
FastTowning = false;
|
||||
ForcedTowning = false;
|
||||
UseLastTP = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GetInTown())
|
||||
{
|
||||
Form1_0.SetGameStatus("TOWN-TP TO TOWN");
|
||||
Form1_0.Potions_0.CheckIfWeUsePotion();
|
||||
|
||||
if (FastTowning && !Form1_0.Shop_0.ShouldShop())
|
||||
{
|
||||
CurrentScript = 0;
|
||||
TriedToStashCount = 0;
|
||||
TriedToGambleCount = 0;
|
||||
TriedToShopCount = 0;
|
||||
TriedToShopCount2 = 0;
|
||||
TriedToMercCount = 0;
|
||||
TriedToUseTPCount = 0;
|
||||
Towning = false;
|
||||
FastTowning = false;
|
||||
ForcedTowning = false;
|
||||
UseLastTP = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (TriedToUseTPCount >= 5)
|
||||
{
|
||||
Form1_0.method_1("NO TP FOUND NEAR WHEN TRYING TO TOWN", Color.Red);
|
||||
|
@ -56,17 +105,34 @@ namespace app
|
|||
if (TPSpawned)
|
||||
{
|
||||
//select the spawned TP
|
||||
if (Form1_0.ObjectsStruc_0.GetObjects("TownPortal", true))
|
||||
if (Form1_0.ObjectsStruc_0.GetObjects("TownPortal", true, IgnoredTPList))
|
||||
//if (Form1_0.ObjectsStruc_0.GetObjects("TownPortal", Form1_0.PlayerScan_0.unitId))
|
||||
{
|
||||
if (Form1_0.ObjectsStruc_0.itemx != 0 && Form1_0.ObjectsStruc_0.itemy != 0)
|
||||
{
|
||||
Form1_0.method_1("Trying to use TP ID: " + Form1_0.ObjectsStruc_0.ObjectUnitID, Color.Red);
|
||||
|
||||
if (LastUsedTPID != Form1_0.ObjectsStruc_0.ObjectUnitID)
|
||||
{
|
||||
LastUsedTPID = Form1_0.ObjectsStruc_0.ObjectUnitID;
|
||||
LastUsedTPCount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
LastUsedTPCount++;
|
||||
if (LastUsedTPCount >= 4)
|
||||
{
|
||||
IgnoredTPList.Add(LastUsedTPID);
|
||||
}
|
||||
}
|
||||
|
||||
GetCorpse();
|
||||
CurrentScript = 0;
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, Form1_0.ObjectsStruc_0.itemx, Form1_0.ObjectsStruc_0.itemy);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.WaitDelay(50);
|
||||
Form1_0.Mover_0.FinishMoving();
|
||||
|
||||
//Form1_0.Mover_0.MoveToLocation(5055, 5039); //act4 only
|
||||
}
|
||||
else
|
||||
|
@ -93,6 +159,25 @@ namespace app
|
|||
{
|
||||
if (IsInRightTown())
|
||||
{
|
||||
//Grab Corpse
|
||||
if (Form1_0.ItemsStruc_0.ItemsEquiped <= 2 && FirstTown)
|
||||
{
|
||||
//int Tries = 0;
|
||||
//while (Tries < 5)
|
||||
//{
|
||||
//Console.WriteLine("Corpse found method2");
|
||||
Form1_0.method_1("Grab corpse #3", Color.Red);
|
||||
Form1_0.WaitDelay(100);
|
||||
//Clic corpse
|
||||
FirstTown = false;
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"] - 45, itemScreenPos["y"] - 5);
|
||||
//Form1_0.WaitDelay(100);
|
||||
//Tries++;
|
||||
//}
|
||||
}
|
||||
|
||||
GetCorpse();
|
||||
CurrentScript++;
|
||||
}
|
||||
|
||||
|
@ -101,7 +186,7 @@ namespace app
|
|||
if (!IsInRightTown())
|
||||
{
|
||||
Form1_0.SetGameStatus("TOWN-SWITCH TOWN");
|
||||
GotoTownScriptAct();
|
||||
GoToWPArea();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -175,6 +260,8 @@ namespace app
|
|||
&& TriedToStashCount < 6 && !FastTowning)
|
||||
{
|
||||
//Console.WriteLine(Form1_0.InventoryStruc_0.ContainStashItemInInventory() + "|" + (Form1_0.PlayerScan_0.PlayerGoldInventory >= 35000));
|
||||
|
||||
Form1_0.method_1("Stash: item(" + Form1_0.InventoryStruc_0.ContainStashItemInInventory() + ") | Gold(" + (Form1_0.PlayerScan_0.PlayerGoldInventory >= 35000) + ")", Color.Red);
|
||||
Form1_0.SetGameStatus("TOWN-STASH");
|
||||
MoveToStash(true);
|
||||
TriedToStashCount++;
|
||||
|
@ -217,6 +304,7 @@ namespace app
|
|||
{
|
||||
if (!Form1_0.Shop_0.ShouldShop() || TriedToShopCount >= 6)
|
||||
{
|
||||
//Console.WriteLine("town shop done");
|
||||
CurrentScript++;
|
||||
}
|
||||
|
||||
|
@ -225,8 +313,11 @@ namespace app
|
|||
if (Form1_0.Shop_0.ShouldShop() && TriedToShopCount < 6)
|
||||
{
|
||||
Form1_0.SetGameStatus("TOWN-SHOP");
|
||||
//Console.WriteLine("town moving to shop");
|
||||
MoveToStore();
|
||||
TriedToShopCount++;
|
||||
|
||||
//if (FastTowning) TriedToShopCount = 6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -259,10 +350,12 @@ namespace app
|
|||
if (MoveToTPOrWPSpot())
|
||||
{
|
||||
GetCorpse();
|
||||
Form1_0.Stash_0.RunningScriptCount = 0;
|
||||
CurrentScript = 0;
|
||||
TriedToStashCount = 0;
|
||||
TriedToGambleCount = 0;
|
||||
TriedToShopCount = 0;
|
||||
TriedToShopCount2 = 0;
|
||||
TriedToMercCount = 0;
|
||||
TriedToUseTPCount = 0;
|
||||
Towning = false;
|
||||
|
@ -287,14 +380,14 @@ namespace app
|
|||
return true;
|
||||
}
|
||||
|
||||
public void GotoTownScriptAct()
|
||||
public void GoToWPArea(int SelectActWPIndex = -1, int SelectWPIndex = -1)
|
||||
{
|
||||
if (TownAct == 1)
|
||||
{
|
||||
if (Form1_0.Mover_0.MoveToLocation(4681, 4541))
|
||||
{
|
||||
//if (Form1_0.Mover_0.MoveToLocation(4681, 4541))
|
||||
//{
|
||||
//use wp
|
||||
if (Form1_0.ObjectsStruc_0.GetObjects("WaypointPortal", false))
|
||||
/*if (Form1_0.ObjectsStruc_0.GetObjects("WaypointPortal", false))
|
||||
{
|
||||
if (Form1_0.Mover_0.MoveToLocation(Form1_0.ObjectsStruc_0.itemx, Form1_0.ObjectsStruc_0.itemy))
|
||||
{
|
||||
|
@ -305,16 +398,42 @@ namespace app
|
|||
Form1_0.Mover_0.FinishMoving();
|
||||
if (Form1_0.UIScan_0.WaitTilUIOpen("waypointMenu"))
|
||||
{
|
||||
SelectTownWP();
|
||||
if (SelectWPIndex == -1)
|
||||
{
|
||||
SelectTownWP();
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectThisWPIndex(SelectActWPIndex, SelectWPIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.method_1("NO WP FOUND NEAR IN TOWN", Color.OrangeRed);
|
||||
}
|
||||
}
|
||||
{*/
|
||||
//"id":119, "type":"object", "x":84, "y":69, "name":"Waypoint",
|
||||
Position ThisFinalPosition = Form1_0.MapAreaStruc_0.GetPositionOfObject("object", "WaypointPortal", 1 - 1, new List<int>() { });
|
||||
if (Form1_0.Mover_0.MoveToLocation(ThisFinalPosition.X, ThisFinalPosition.Y))
|
||||
{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, ThisFinalPosition.X, ThisFinalPosition.Y);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.Mover_0.FinishMoving();
|
||||
if (Form1_0.UIScan_0.WaitTilUIOpen("waypointMenu"))
|
||||
{
|
||||
if (SelectWPIndex == -1)
|
||||
{
|
||||
SelectTownWP();
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectThisWPIndex(SelectActWPIndex, SelectWPIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Form1_0.method_1("NO WP FOUND NEAR IN TOWN", Color.OrangeRed);
|
||||
//}
|
||||
//}
|
||||
}
|
||||
/*if (TownAct == 2)
|
||||
{
|
||||
|
@ -326,20 +445,45 @@ namespace app
|
|||
if (Form1_0.Mover_0.MoveToLocation(5154, 5056))
|
||||
{
|
||||
//use wp
|
||||
if (Form1_0.ObjectsStruc_0.GetObjects("Act3TownWaypoint", false))
|
||||
/*if (Form1_0.ObjectsStruc_0.GetObjects("Act3TownWaypoint", false))
|
||||
{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, Form1_0.ObjectsStruc_0.itemx, Form1_0.ObjectsStruc_0.itemy);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.Mover_0.FinishMoving();
|
||||
if (Form1_0.UIScan_0.WaitTilUIOpen("waypointMenu"))
|
||||
{
|
||||
SelectTownWP();
|
||||
if (SelectWPIndex == -1)
|
||||
{
|
||||
SelectTownWP();
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectThisWPIndex(SelectActWPIndex, SelectWPIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.method_1("NO WP FOUND NEAR IN TOWN", Color.OrangeRed);
|
||||
}
|
||||
{*/
|
||||
Position ThisFinalPosition = Form1_0.MapAreaStruc_0.GetPositionOfObject("object", "Act3TownWaypoint", 75 - 1, new List<int>() { });
|
||||
if (Form1_0.Mover_0.MoveToLocation(ThisFinalPosition.X, ThisFinalPosition.Y))
|
||||
{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, ThisFinalPosition.X, ThisFinalPosition.Y);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.Mover_0.FinishMoving();
|
||||
if (Form1_0.UIScan_0.WaitTilUIOpen("waypointMenu"))
|
||||
{
|
||||
if (SelectWPIndex == -1)
|
||||
{
|
||||
SelectTownWP();
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectThisWPIndex(SelectActWPIndex, SelectWPIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Form1_0.method_1("NO WP FOUND NEAR IN TOWN", Color.OrangeRed);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -348,46 +492,113 @@ namespace app
|
|||
if (Form1_0.Mover_0.MoveToLocation(5055, 5039))
|
||||
{
|
||||
//use wp
|
||||
if (Form1_0.ObjectsStruc_0.GetObjects("PandamoniumFortressWaypoint", false))
|
||||
/*if (Form1_0.ObjectsStruc_0.GetObjects("PandamoniumFortressWaypoint", false))
|
||||
{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, Form1_0.ObjectsStruc_0.itemx, Form1_0.ObjectsStruc_0.itemy);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.Mover_0.FinishMoving();
|
||||
if (Form1_0.UIScan_0.WaitTilUIOpen("waypointMenu"))
|
||||
{
|
||||
SelectTownWP();
|
||||
if (SelectWPIndex == -1)
|
||||
{
|
||||
SelectTownWP();
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectThisWPIndex(SelectActWPIndex, SelectWPIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.method_1("NO WP FOUND NEAR IN TOWN", Color.OrangeRed);
|
||||
}
|
||||
{*/
|
||||
Position ThisFinalPosition = Form1_0.MapAreaStruc_0.GetPositionOfObject("object", "PandamoniumFortressWaypoint", 103 - 1, new List<int>() { });
|
||||
if (Form1_0.Mover_0.MoveToLocation(ThisFinalPosition.X, ThisFinalPosition.Y))
|
||||
{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, ThisFinalPosition.X, ThisFinalPosition.Y);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.Mover_0.FinishMoving();
|
||||
if (Form1_0.UIScan_0.WaitTilUIOpen("waypointMenu"))
|
||||
{
|
||||
if (SelectWPIndex == -1)
|
||||
{
|
||||
SelectTownWP();
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectThisWPIndex(SelectActWPIndex, SelectWPIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Form1_0.method_1("NO WP FOUND NEAR IN TOWN", Color.OrangeRed);
|
||||
//}
|
||||
}
|
||||
}
|
||||
if (TownAct == 5)
|
||||
{
|
||||
//move close to stash location
|
||||
if (Form1_0.Mover_0.MoveToLocation(5123, 5065))
|
||||
if (Form1_0.Mover_0.MoveToLocation(5117, 5065))
|
||||
{
|
||||
//use wp
|
||||
if (Form1_0.ObjectsStruc_0.GetObjects("ExpansionWaypoint", false))
|
||||
/*if (Form1_0.ObjectsStruc_0.GetObjects("ExpansionWaypoint", false))
|
||||
{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, Form1_0.ObjectsStruc_0.itemx, Form1_0.ObjectsStruc_0.itemy);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.Mover_0.FinishMoving();
|
||||
if (Form1_0.UIScan_0.WaitTilUIOpen("waypointMenu"))
|
||||
{
|
||||
SelectTownWP();
|
||||
if (SelectWPIndex == -1)
|
||||
{
|
||||
SelectTownWP();
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectThisWPIndex(SelectActWPIndex, SelectWPIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.method_1("NO WP FOUND NEAR IN TOWN", Color.OrangeRed);
|
||||
}
|
||||
{*/
|
||||
Position ThisFinalPosition = Form1_0.MapAreaStruc_0.GetPositionOfObject("object", "ExpansionWaypoint", 109 - 1, new List<int>() { });
|
||||
if (Form1_0.Mover_0.MoveToLocation(ThisFinalPosition.X, ThisFinalPosition.Y))
|
||||
{
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, ThisFinalPosition.X, ThisFinalPosition.Y);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"] - 15);
|
||||
Form1_0.Mover_0.FinishMoving();
|
||||
if (Form1_0.UIScan_0.WaitTilUIOpen("waypointMenu"))
|
||||
{
|
||||
if (SelectWPIndex == -1)
|
||||
{
|
||||
SelectTownWP();
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectThisWPIndex(SelectActWPIndex, SelectWPIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Form1_0.method_1("NO WP FOUND NEAR IN TOWN", Color.OrangeRed);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SelectThisWPIndex(int ThisActIndexx, int ThisIndexx)
|
||||
{
|
||||
//select town
|
||||
if (ThisActIndexx == 1) Form1_0.KeyMouse_0.MouseClicc(235, 220);
|
||||
if (ThisActIndexx == 2) Form1_0.KeyMouse_0.MouseClicc(325, 220);
|
||||
if (ThisActIndexx == 3) Form1_0.KeyMouse_0.MouseClicc(415, 220);
|
||||
if (ThisActIndexx == 4) Form1_0.KeyMouse_0.MouseClicc(500, 220);
|
||||
if (ThisActIndexx == 5) Form1_0.KeyMouse_0.MouseClicc(585, 220);
|
||||
Form1_0.WaitDelay(50);
|
||||
|
||||
//select WP from index
|
||||
Form1_0.KeyMouse_0.MouseClicc(285, 260 + (ThisIndexx * 60));
|
||||
Form1_0.UIScan_0.WaitTilUIClose("waypointMenu");
|
||||
Form1_0.UIScan_0.WaitTilUIClose("loading");
|
||||
Form1_0.WaitDelay(350);
|
||||
}
|
||||
|
||||
public void SelectTownWP()
|
||||
{
|
||||
//select town
|
||||
|
@ -397,9 +608,11 @@ namespace app
|
|||
if (ScriptTownAct == 4) Form1_0.KeyMouse_0.MouseClicc(500, 220);
|
||||
if (ScriptTownAct == 5) Form1_0.KeyMouse_0.MouseClicc(585, 220);
|
||||
Form1_0.WaitDelay(50);
|
||||
|
||||
Form1_0.KeyMouse_0.MouseClicc(285, 270); //select first wp
|
||||
Form1_0.UIScan_0.WaitTilUIClose("waypointMenu");
|
||||
Form1_0.UIScan_0.WaitTilUIClose("loading");
|
||||
Form1_0.WaitDelay(350);
|
||||
}
|
||||
|
||||
public bool ShouldBeInTown()
|
||||
|
@ -461,7 +674,19 @@ namespace app
|
|||
else
|
||||
{
|
||||
Form1_0.method_1(ThisNPC.ToUpper() + " NOT FOUND NEAR", Color.OrangeRed);
|
||||
MoveToStash(false);
|
||||
|
||||
if (ThisNPC == "DeckardCain" && TownAct == 4)
|
||||
{
|
||||
Form1_0.Mover_0.MoveToLocation(5092, 5044);
|
||||
}
|
||||
if (ThisNPC == "Anya" && TownAct == 4)
|
||||
{
|
||||
Form1_0.Mover_0.MoveToLocation(5114, 5059);
|
||||
}
|
||||
else
|
||||
{
|
||||
MoveToStash(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -479,13 +704,18 @@ namespace app
|
|||
bool MovedCorrectly = false;
|
||||
if (TownAct == 4)
|
||||
{
|
||||
if (Form1_0.Mover_0.MoveToLocation(5082, 5043))
|
||||
if (IsPosCloseTo(5082, 5043, 12))
|
||||
{
|
||||
Form1_0.Mover_0.MoveToLocation(5082, 5043);
|
||||
}
|
||||
|
||||
//if (Form1_0.Mover_0.MoveToLocation(5082, 5043))
|
||||
//{
|
||||
if (Form1_0.Mover_0.MoveToLocation(5055, 5039))
|
||||
{
|
||||
MovedCorrectly = true;
|
||||
}
|
||||
}
|
||||
//}
|
||||
}
|
||||
if (TownAct == 5)
|
||||
{
|
||||
|
@ -496,6 +726,20 @@ namespace app
|
|||
Form1_0.Mover_0.MoveToLocation(5078, 5026);
|
||||
}
|
||||
|
||||
//stuck above stash
|
||||
if (IsPosCloseTo(5097, 5042, 4))
|
||||
{
|
||||
//move back to TP
|
||||
Form1_0.Mover_0.MoveToLocation(5104, 5030);
|
||||
}
|
||||
|
||||
//stuck near stash
|
||||
if (IsPosCloseTo(5021, 5056, 4))
|
||||
{
|
||||
//move back to TP
|
||||
Form1_0.Mover_0.MoveToLocation(5108, 5060);
|
||||
}
|
||||
|
||||
if (Form1_0.Mover_0.MoveToLocation(5103, 5029))
|
||||
{
|
||||
MovedCorrectly = true;
|
||||
|
@ -644,6 +888,13 @@ namespace app
|
|||
{
|
||||
CheckForNPCValidPos("Larzuk");
|
||||
|
||||
//close to store spot 5078, 5026
|
||||
if (IsPosCloseTo(5128, 5112, 20))
|
||||
{
|
||||
//move close to corner location
|
||||
Form1_0.Mover_0.MoveToLocation(5128, 5112);
|
||||
}
|
||||
|
||||
//stuck between cain and malah
|
||||
if (IsPosCloseTo(5080, 5054, 10))
|
||||
{
|
||||
|
@ -732,7 +983,14 @@ namespace app
|
|||
|
||||
if (TownAct == 5)
|
||||
{
|
||||
CheckForNPCValidPos("Malah");
|
||||
//CheckForNPCValidPos("Malah");
|
||||
|
||||
//close to store spot 5078, 5026
|
||||
if (IsPosCloseTo(5128, 5112, 20))
|
||||
{
|
||||
//move close to corner location
|
||||
Form1_0.Mover_0.MoveToLocation(5128, 5112);
|
||||
}
|
||||
|
||||
//close to stash spot 5123, 5065
|
||||
if (IsPosCloseTo(5123, 5065, 10))
|
||||
|
@ -740,6 +998,21 @@ namespace app
|
|||
//move close to wp location
|
||||
Form1_0.Mover_0.MoveToLocation(5114, 5059);
|
||||
Form1_0.Mover_0.MoveToLocation(5103, 5029);
|
||||
GetCorpse();
|
||||
}
|
||||
|
||||
//stuck above stash
|
||||
if (IsPosCloseTo(5097, 5042, 6))
|
||||
{
|
||||
//move back to TP
|
||||
Form1_0.Mover_0.MoveToLocation(5104, 5030);
|
||||
}
|
||||
|
||||
//stuck near stash
|
||||
if (IsPosCloseTo(5021, 5056, 6))
|
||||
{
|
||||
//move back to TP
|
||||
Form1_0.Mover_0.MoveToLocation(5108, 5060);
|
||||
}
|
||||
|
||||
//move close to store location
|
||||
|
@ -748,9 +1021,34 @@ namespace app
|
|||
//get store location
|
||||
if (Form1_0.NPCStruc_0.GetNPC("Malah"))
|
||||
{
|
||||
if (Form1_0.Mover_0.MoveToLocation(Form1_0.NPCStruc_0.xPosFinal, Form1_0.NPCStruc_0.yPosFinal))
|
||||
if (Form1_0.NPCStruc_0.xPosFinal != 0 && Form1_0.NPCStruc_0.yPosFinal != 0)
|
||||
{
|
||||
MovedCorrectly = true;
|
||||
if (Form1_0.Mover_0.MoveToLocation(Form1_0.NPCStruc_0.xPosFinal, Form1_0.NPCStruc_0.yPosFinal))
|
||||
{
|
||||
MovedCorrectly = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TriedToShopCount2++;
|
||||
TriedToShopCount--;
|
||||
|
||||
if (TriedToShopCount2 > 50)
|
||||
{
|
||||
CheckForNPCValidPos("Malah");
|
||||
TriedToShopCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TriedToShopCount2++;
|
||||
TriedToShopCount--;
|
||||
|
||||
if (TriedToShopCount2 > 50)
|
||||
{
|
||||
CheckForNPCValidPos("Malah");
|
||||
TriedToShopCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -794,7 +1092,7 @@ namespace app
|
|||
if (TownAct == 4)
|
||||
{
|
||||
//move close to stash location
|
||||
if (Form1_0.Mover_0.MoveToLocation(5023, 5039))
|
||||
if (Form1_0.Mover_0.MoveToLocation(5021, 5034))
|
||||
{
|
||||
MovedCorrectly = true;
|
||||
}
|
||||
|
@ -814,8 +1112,15 @@ namespace app
|
|||
Form1_0.Mover_0.MoveToLocation(5114, 5059);
|
||||
}
|
||||
|
||||
//close to store spot 5078, 5026
|
||||
if (IsPosCloseTo(5128, 5112, 20))
|
||||
{
|
||||
//move close to corner location
|
||||
Form1_0.Mover_0.MoveToLocation(5128, 5112);
|
||||
}
|
||||
|
||||
//stuck above stash
|
||||
if (IsPosCloseTo(5116, 5046, 4))
|
||||
if (IsPosCloseTo(5116, 5046, 6))
|
||||
{
|
||||
//move back inbetween TP and WP location
|
||||
Form1_0.Mover_0.MoveToLocation(5104, 5047);
|
||||
|
@ -856,6 +1161,10 @@ namespace app
|
|||
else
|
||||
{
|
||||
Form1_0.method_1("STASH NOT FOUND NEAR", Color.OrangeRed);
|
||||
if (TownAct == 4)
|
||||
{
|
||||
Form1_0.Mover_0.MoveToLocation(5092, 5044);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1042,6 +1351,16 @@ namespace app
|
|||
|
||||
public void SpawnTP()
|
||||
{
|
||||
//fix when close to RedPortal in Baal
|
||||
if (Form1_0.PlayerScan_0.xPosFinal >= (15090 - 4)
|
||||
&& Form1_0.PlayerScan_0.xPosFinal <= (15090 + 4)
|
||||
&& Form1_0.PlayerScan_0.yPosFinal >= (5008 - 4)
|
||||
&& Form1_0.PlayerScan_0.yPosFinal <= (5008 + 4)
|
||||
&& Form1_0.PlayerScan_0.levelNo == 131)
|
||||
{
|
||||
Form1_0.Mover_0.MoveToLocation(15090, 5008 + 15);
|
||||
}
|
||||
|
||||
//has tp
|
||||
if (Form1_0.InventoryStruc_0.HUDItems_tpscrolls > 0)
|
||||
{
|
||||
|
@ -1060,9 +1379,13 @@ namespace app
|
|||
|
||||
public void GetCorpse()
|
||||
{
|
||||
if (Form1_0.ItemsStruc_0.ItemsEquiped > 2) return;
|
||||
|
||||
//method #1
|
||||
if (Form1_0.NPCStruc_0.GetNPC("DeadCorpse"))
|
||||
{
|
||||
//Console.WriteLine("Corpse found method1");
|
||||
Form1_0.method_1("Grab corpse #1", Color.Red);
|
||||
//Clic corpse
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, Form1_0.NPCStruc_0.xPosFinal, Form1_0.NPCStruc_0.yPosFinal);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
|
@ -1072,6 +1395,8 @@ namespace app
|
|||
int Tries = 0;
|
||||
while (Form1_0.PlayerScan_0.ScanForOthersPlayers(0, CharConfig.PlayerCharName, true) && Tries < 5)
|
||||
{
|
||||
//Console.WriteLine("Corpse found method2");
|
||||
Form1_0.method_1("Grab corpse #2", Color.Red);
|
||||
//Clic corpse
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, Form1_0.PlayerScan_0.xPosFinalOtherP, Form1_0.PlayerScan_0.yPosFinalOtherP);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
|
|
|
@ -0,0 +1,487 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace app
|
||||
{
|
||||
public class SettingsLoader
|
||||
{
|
||||
Form1 Form1_0;
|
||||
|
||||
public string File_CharSettings = Application.StartupPath + @"\CharSettings.txt";
|
||||
public string File_BotSettings = Application.StartupPath + @"\BotSettings.txt";
|
||||
public string File_ItemsSettings = Application.StartupPath + @"\ItemsSettings.txt";
|
||||
public string File_Settings = Application.StartupPath + @"\Settings.txt";
|
||||
string[] AllLines = new string[] { };
|
||||
|
||||
public void SetForm1(Form1 form1_1)
|
||||
{
|
||||
Form1_0 = form1_1;
|
||||
}
|
||||
|
||||
public void LoadSettings()
|
||||
{
|
||||
if (File.Exists(File_CharSettings))
|
||||
{
|
||||
AllLines = File.ReadAllLines(File_CharSettings);
|
||||
LoadCharSettings();
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.method_1("UNABLE TO FIND 'CharSettings.txt' FILE!", Color.Red);
|
||||
}
|
||||
//#####
|
||||
if (File.Exists(File_BotSettings))
|
||||
{
|
||||
AllLines = File.ReadAllLines(File_BotSettings);
|
||||
LoadBotSettings();
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.method_1("UNABLE TO FIND 'BotSettings.txt' FILE!", Color.Red);
|
||||
}
|
||||
//#####
|
||||
if (File.Exists(File_ItemsSettings))
|
||||
{
|
||||
AllLines = File.ReadAllLines(File_ItemsSettings);
|
||||
LoadItemsSettings();
|
||||
}
|
||||
else
|
||||
{
|
||||
Form1_0.method_1("UNABLE TO FIND 'ItemsSettings.txt' FILE!", Color.Red);
|
||||
}
|
||||
//#####
|
||||
if (File.Exists(File_Settings))
|
||||
{
|
||||
AllLines = File.ReadAllLines(File_Settings);
|
||||
LoadOthersSettings();
|
||||
}
|
||||
else
|
||||
{
|
||||
SaveOthersSettings();
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadOthersSettings()
|
||||
{
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < AllLines.Length; i++)
|
||||
{
|
||||
if (AllLines[i].Length > 0)
|
||||
{
|
||||
if (AllLines[i][0] != '/' && AllLines[i][0] != '#')
|
||||
{
|
||||
if (AllLines[i].Contains("="))
|
||||
{
|
||||
string[] Params = AllLines[i].Split('=');
|
||||
|
||||
if (Params[0].Contains("RunNumber"))
|
||||
{
|
||||
Form1_0.CurrentGameNumber = int.Parse(Params[1]);
|
||||
}
|
||||
if (Params[0].Contains("D2_LOD_113C_Path"))
|
||||
{
|
||||
Form1_0.D2_LOD_113C_Path = Params[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Form1_0.method_1("UNABLE TO LOAD 'Settings.txt' FILE!", Color.Red);
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveCurrentSettings()
|
||||
{
|
||||
string[] AllLines = File.ReadAllLines(File_BotSettings);
|
||||
|
||||
for (int i = 0; i < AllLines.Length; i++)
|
||||
{
|
||||
if (AllLines[i].Contains("="))
|
||||
{
|
||||
string[] Splitted = AllLines[i].Split('=');
|
||||
if (Splitted[0] == "MaxGameTime") AllLines[i] = "MaxGameTime=" + CharConfig.MaxGameTime;
|
||||
|
||||
if (Splitted[0] == "RunDurielScript") AllLines[i] = "RunDurielScript=" + CharConfig.RunDurielScript;
|
||||
if (Splitted[0] == "RunSummonerScript") AllLines[i] = "RunSummonerScript=" + CharConfig.RunSummonerScript;
|
||||
if (Splitted[0] == "RunMephistoScript") AllLines[i] = "RunMephistoScript=" + CharConfig.RunMephistoScript;
|
||||
if (Splitted[0] == "RunAndarielScript") AllLines[i] = "RunAndarielScript=" + CharConfig.RunAndarielScript;
|
||||
if (Splitted[0] == "RunCountessScript") AllLines[i] = "RunCountessScript=" + CharConfig.RunCountessScript;
|
||||
if (Splitted[0] == "RunChaosScript") AllLines[i] = "RunChaosScript=" + CharConfig.RunChaosScript;
|
||||
if (Splitted[0] == "RunLowerKurastScript") AllLines[i] = "RunLowerKurastScript=" + CharConfig.RunLowerKurastScript;
|
||||
if (Splitted[0] == "RunBaalLeechScript") AllLines[i] = "RunBaalLeechScript=" + CharConfig.RunBaalLeechScript;
|
||||
if (Splitted[0] == "RunItemGrabScriptOnly") AllLines[i] = "RunItemGrabScriptOnly=" + CharConfig.RunItemGrabScriptOnly;
|
||||
|
||||
if (Splitted[0] == "RunChaosSearchGameScript") AllLines[i] = "RunChaosSearchGameScript=" + CharConfig.RunChaosSearchGameScript;
|
||||
if (Splitted[0] == "RunBaalSearchGameScript") AllLines[i] = "RunBaalSearchGameScript=" + CharConfig.RunBaalSearchGameScript;
|
||||
if (Splitted[0] == "RunGameMakerScript") AllLines[i] = "RunGameMakerScript=" + CharConfig.RunGameMakerScript;
|
||||
if (Splitted[0] == "GameName") AllLines[i] = "GameName=" + CharConfig.GameName;
|
||||
if (Splitted[0] == "GameDifficulty") AllLines[i] = "GameDifficulty=" + CharConfig.GameDifficulty;
|
||||
if (Splitted[0] == "GamePass") AllLines[i] = "GamePass=" + CharConfig.GamePass;
|
||||
}
|
||||
}
|
||||
|
||||
File.Create(File_BotSettings).Dispose();
|
||||
File.WriteAllLines(File_BotSettings, AllLines);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void SaveOthersSettings()
|
||||
{
|
||||
string SaveTxtt = "";
|
||||
SaveTxtt += "RunNumber=" + Form1_0.CurrentGameNumber + Environment.NewLine;
|
||||
SaveTxtt += "D2_LOD_113C_Path=" + Form1_0.D2_LOD_113C_Path + Environment.NewLine;
|
||||
|
||||
File.Create(File_Settings).Dispose();
|
||||
File.WriteAllText(File_Settings, SaveTxtt);
|
||||
}
|
||||
|
||||
public void LoadItemsSettings()
|
||||
{
|
||||
try
|
||||
{
|
||||
bool DoingUnique = false;
|
||||
bool DoingKeysRune = false;
|
||||
bool DoingSet = false;
|
||||
bool DoingNormal = false;
|
||||
|
||||
List<string> AllUnique = new List<string>();
|
||||
List<string> AllKeys = new List<string>();
|
||||
List<string> AllSet = new List<string>();
|
||||
List<string> AllNormal = new List<string>();
|
||||
|
||||
for (int i = 0; i < AllLines.Length; i++)
|
||||
{
|
||||
if (AllLines[i].Length > 0)
|
||||
{
|
||||
if (AllLines[i][0] != '/' && AllLines[i][0] != '#')
|
||||
{
|
||||
string ThisItem = AllLines[i];
|
||||
if (ThisItem.Contains("/"))
|
||||
{
|
||||
ThisItem = ThisItem.Substring(0, ThisItem.IndexOf('/')); //remove description '//'
|
||||
}
|
||||
|
||||
if (DoingUnique) AllUnique.Add(ThisItem);
|
||||
if (DoingKeysRune) AllKeys.Add(ThisItem);
|
||||
if (DoingSet) AllSet.Add(ThisItem);
|
||||
if (DoingNormal) AllNormal.Add(ThisItem);
|
||||
}
|
||||
|
||||
if (AllLines[i].Contains("UNIQUE ITEMS"))
|
||||
{
|
||||
DoingUnique = true;
|
||||
DoingKeysRune = false;
|
||||
DoingSet = false;
|
||||
DoingNormal = false;
|
||||
}
|
||||
if (AllLines[i].Contains("KEYS/GEMS/RUNES ITEMS"))
|
||||
{
|
||||
DoingUnique = false;
|
||||
DoingKeysRune = true;
|
||||
DoingSet = false;
|
||||
DoingNormal = false;
|
||||
}
|
||||
if (AllLines[i].Contains("SET ITEMS"))
|
||||
{
|
||||
DoingUnique = false;
|
||||
DoingKeysRune = false;
|
||||
DoingSet = true;
|
||||
DoingNormal = false;
|
||||
}
|
||||
if (AllLines[i].Contains("NORMAL ITEMS"))
|
||||
{
|
||||
DoingUnique = false;
|
||||
DoingKeysRune = false;
|
||||
DoingSet = false;
|
||||
DoingNormal = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Form1_0.ItemsAlert_0.PickItemsUnique = new string[AllUnique.Count];
|
||||
for (int i = 0; i < AllUnique.Count; i++) Form1_0.ItemsAlert_0.PickItemsUnique[i] = AllUnique[i];
|
||||
|
||||
Form1_0.ItemsAlert_0.PickItemsRunesKeyGems = new string[AllKeys.Count];
|
||||
for (int i = 0; i < AllKeys.Count; i++) Form1_0.ItemsAlert_0.PickItemsRunesKeyGems[i] = AllKeys[i];
|
||||
|
||||
Form1_0.ItemsAlert_0.PickItemsSet = new string[AllSet.Count];
|
||||
for (int i = 0; i < AllSet.Count; i++) Form1_0.ItemsAlert_0.PickItemsSet[i] = AllSet[i];
|
||||
|
||||
//Form1_0.ItemsAlert_0.PickItemsUnique = new string[AllNormal.Count];
|
||||
//for (int i = 0; i < AllNormal.Count; i++) Form1_0.ItemsAlert_0.PickItemsUnique[i] = AllNormal[i];
|
||||
}
|
||||
catch
|
||||
{
|
||||
Form1_0.method_1("UNABLE TO LOAD 'ItemsSettings.txt' FILE!", Color.Red);
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadBotSettings()
|
||||
{
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < AllLines.Length; i++)
|
||||
{
|
||||
if (AllLines[i].Length > 0)
|
||||
{
|
||||
if (AllLines[i][0] != '/' && AllLines[i][0] != '#')
|
||||
{
|
||||
if (AllLines[i].Contains("="))
|
||||
{
|
||||
string[] Params = AllLines[i].Split('=');
|
||||
|
||||
if (Params[0].Contains("MaxGameTime"))
|
||||
{
|
||||
CharConfig.MaxGameTime = int.Parse(Params[1]);
|
||||
}
|
||||
if (Params[0].Contains("RunDurielScript"))
|
||||
{
|
||||
CharConfig.RunDurielScript = bool.Parse(Params[1].ToLower());
|
||||
}
|
||||
if (Params[0].Contains("RunSummonerScript"))
|
||||
{
|
||||
CharConfig.RunSummonerScript = bool.Parse(Params[1].ToLower());
|
||||
}
|
||||
if (Params[0].Contains("RunMephistoScript"))
|
||||
{
|
||||
CharConfig.RunMephistoScript = bool.Parse(Params[1].ToLower());
|
||||
}
|
||||
if (Params[0].Contains("RunAndarielScript"))
|
||||
{
|
||||
CharConfig.RunAndarielScript = bool.Parse(Params[1].ToLower());
|
||||
}
|
||||
if (Params[0].Contains("RunChaosScript"))
|
||||
{
|
||||
CharConfig.RunChaosScript = bool.Parse(Params[1].ToLower());
|
||||
}
|
||||
if (Params[0].Contains("RunCountessScript"))
|
||||
{
|
||||
CharConfig.RunCountessScript = bool.Parse(Params[1].ToLower());
|
||||
}
|
||||
if (Params[0].Contains("RunLowerKurastScript"))
|
||||
{
|
||||
CharConfig.RunLowerKurastScript = bool.Parse(Params[1].ToLower());
|
||||
}
|
||||
if (Params[0].Contains("RunBaalLeechScript"))
|
||||
{
|
||||
CharConfig.RunBaalLeechScript = bool.Parse(Params[1].ToLower());
|
||||
}
|
||||
if (Params[0].Contains("RunItemGrabScriptOnly"))
|
||||
{
|
||||
CharConfig.RunItemGrabScriptOnly = bool.Parse(Params[1].ToLower());
|
||||
}
|
||||
if (Params[0].Contains("RunChaosSearchGameScript"))
|
||||
{
|
||||
CharConfig.RunChaosSearchGameScript = bool.Parse(Params[1].ToLower());
|
||||
}
|
||||
if (Params[0].Contains("RunBaalSearchGameScript"))
|
||||
{
|
||||
CharConfig.RunBaalSearchGameScript = bool.Parse(Params[1].ToLower());
|
||||
}
|
||||
if (Params[0].Contains("RunGameMakerScript"))
|
||||
{
|
||||
CharConfig.RunGameMakerScript = bool.Parse(Params[1].ToLower());
|
||||
}
|
||||
if (Params[0].Contains("GameName"))
|
||||
{
|
||||
CharConfig.GameName = Params[1];
|
||||
}
|
||||
if (Params[0].Contains("GamePass"))
|
||||
{
|
||||
CharConfig.GamePass = Params[1];
|
||||
}
|
||||
if (Params[0].Contains("GameDifficulty"))
|
||||
{
|
||||
CharConfig.GameDifficulty = int.Parse(Params[1]);
|
||||
}
|
||||
//#####
|
||||
if (Params[0].Contains("StartStopKey"))
|
||||
{
|
||||
CharConfig.StartStopKey = int.Parse(Params[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Form1_0.method_1("UNABLE TO LOAD 'BotSettings.txt' FILE!", Color.Red);
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadCharSettings()
|
||||
{
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < AllLines.Length; i++)
|
||||
{
|
||||
if (AllLines[i].Length > 0)
|
||||
{
|
||||
if (AllLines[i][0] != '/' && AllLines[i][0] != '#')
|
||||
{
|
||||
if (AllLines[i].Contains("="))
|
||||
{
|
||||
string[] Params = AllLines[i].Split('=');
|
||||
|
||||
if (Params[0].Contains("KeySkillAttack"))
|
||||
{
|
||||
Enum.TryParse(Params[1], out CharConfig.KeySkillAttack);
|
||||
}
|
||||
if (Params[0].Contains("KeySkillAura"))
|
||||
{
|
||||
Enum.TryParse(Params[1], out CharConfig.KeySkillAura);
|
||||
}
|
||||
if (Params[0].Contains("KeySkillfastMoveAtTown"))
|
||||
{
|
||||
Enum.TryParse(Params[1], out CharConfig.KeySkillfastMoveAtTown);
|
||||
}
|
||||
if (Params[0].Contains("KeySkillfastMoveOutsideTown"))
|
||||
{
|
||||
Enum.TryParse(Params[1], out CharConfig.KeySkillfastMoveOutsideTown);
|
||||
}
|
||||
if (Params[0].Contains("KeySkillDefenseAura"))
|
||||
{
|
||||
Enum.TryParse(Params[1], out CharConfig.KeySkillDefenseAura);
|
||||
}
|
||||
if (Params[0].Contains("KeySkillCastDefense"))
|
||||
{
|
||||
Enum.TryParse(Params[1], out CharConfig.KeySkillCastDefense);
|
||||
}
|
||||
if (Params[0].Contains("KeySkillLifeAura"))
|
||||
{
|
||||
Enum.TryParse(Params[1], out CharConfig.KeySkillLifeAura);
|
||||
}
|
||||
//######
|
||||
if (Params[0].Contains("BeltPotTypeToHave") && Params[1].Contains(","))
|
||||
{
|
||||
string[] NewParams = Params[1].Split(',');
|
||||
if (NewParams.Length >= 4)
|
||||
{
|
||||
CharConfig.BeltPotTypeToHave = new int[4] { int.Parse(NewParams[0]),
|
||||
int.Parse(NewParams[1]),
|
||||
int.Parse(NewParams[2]),
|
||||
int.Parse(NewParams[3]) };
|
||||
}
|
||||
}
|
||||
if (Params[0].Contains("InventoryDontCheckItem"))
|
||||
{
|
||||
string[] NewParams1 = AllLines[i + 2].Split(',');
|
||||
string[] NewParams2 = AllLines[i + 3].Split(',');
|
||||
string[] NewParams3 = AllLines[i + 4].Split(',');
|
||||
string[] NewParams4 = AllLines[i + 5].Split(',');
|
||||
|
||||
if (NewParams1.Length >= 10 && NewParams2.Length >= 10 && NewParams3.Length >= 10 && NewParams4.Length >= 10)
|
||||
{
|
||||
CharConfig.InventoryDontCheckItem = new int[40];
|
||||
for (int k = 0; k < 10; k++)
|
||||
{
|
||||
CharConfig.InventoryDontCheckItem[k] = int.Parse(NewParams1[k]);
|
||||
}
|
||||
for (int k = 0; k < 10; k++)
|
||||
{
|
||||
CharConfig.InventoryDontCheckItem[k + 10] = int.Parse(NewParams2[k]);
|
||||
}
|
||||
for (int k = 0; k < 10; k++)
|
||||
{
|
||||
CharConfig.InventoryDontCheckItem[k + 20] = int.Parse(NewParams3[k]);
|
||||
}
|
||||
for (int k = 0; k < 10; k++)
|
||||
{
|
||||
CharConfig.InventoryDontCheckItem[k + 30] = int.Parse(NewParams4[k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
//#####
|
||||
if (Params[0].Contains("DummyItemSharedStash1"))
|
||||
{
|
||||
CharConfig.DummyItemSharedStash1 = Params[1];
|
||||
}
|
||||
if (Params[0].Contains("DummyItemSharedStash2"))
|
||||
{
|
||||
CharConfig.DummyItemSharedStash2 = Params[1];
|
||||
}
|
||||
if (Params[0].Contains("DummyItemSharedStash3"))
|
||||
{
|
||||
CharConfig.DummyItemSharedStash3 = Params[1];
|
||||
}
|
||||
//#####
|
||||
if (Params[0].Contains("PlayerCharName"))
|
||||
{
|
||||
CharConfig.PlayerCharName = Params[1];
|
||||
}
|
||||
if (Params[0].Contains("UseTeleport"))
|
||||
{
|
||||
CharConfig.UseTeleport = bool.Parse(Params[1].ToLower());
|
||||
}
|
||||
if (Params[0].Contains("ChickenHP"))
|
||||
{
|
||||
CharConfig.ChickenHP = int.Parse(Params[1]);
|
||||
}
|
||||
if (Params[0].Contains("TakeHPPotUnder") && !Params[0].Contains("MercTakeHPPotUnder"))
|
||||
{
|
||||
CharConfig.TakeHPPotUnder = int.Parse(Params[1]);
|
||||
}
|
||||
if (Params[0].Contains("TakeRVPotUnder"))
|
||||
{
|
||||
CharConfig.TakeRVPotUnder = int.Parse(Params[1]);
|
||||
}
|
||||
if (Params[0].Contains("TakeManaPotUnder"))
|
||||
{
|
||||
CharConfig.TakeManaPotUnder = int.Parse(Params[1]);
|
||||
}
|
||||
if (Params[0].Contains("GambleAboveGoldAmount"))
|
||||
{
|
||||
CharConfig.GambleAboveGoldAmount = int.Parse(Params[1]);
|
||||
}
|
||||
if (Params[0].Contains("GambleUntilGoldAmount"))
|
||||
{
|
||||
CharConfig.GambleUntilGoldAmount = int.Parse(Params[1]);
|
||||
}
|
||||
if (Params[0].Contains("PlayerAttackWithRightHand"))
|
||||
{
|
||||
CharConfig.PlayerAttackWithRightHand = bool.Parse(Params[1].ToLower());
|
||||
}
|
||||
if (Params[0].Contains("KeysLocationInInventory"))
|
||||
{
|
||||
//8,0
|
||||
string KeyValue1 = Params[1].ToLower().Substring(0, Params[1].IndexOf(","));
|
||||
string KeyValue2 = Params[1].ToLower().Substring(Params[1].IndexOf(",") + 1);
|
||||
CharConfig.KeysLocationInInventory.Item1 = int.Parse(KeyValue1);
|
||||
CharConfig.KeysLocationInInventory.Item2 = int.Parse(KeyValue2);
|
||||
}
|
||||
//#####
|
||||
if (Params[0].Contains("UsingMerc"))
|
||||
{
|
||||
CharConfig.UsingMerc = bool.Parse(Params[1].ToLower());
|
||||
}
|
||||
if (Params[0].Contains("MercTakeHPPotUnder"))
|
||||
{
|
||||
CharConfig.MercTakeHPPotUnder = int.Parse(Params[1]);
|
||||
}
|
||||
//#####
|
||||
|
||||
//#####
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Form1_0.method_1("UNABLE TO LOAD 'CharSettings.txt' FILE!", Color.Red);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.Design;
|
||||
using System.Linq;
|
||||
|
@ -35,6 +36,22 @@ namespace app
|
|||
|
||||
public bool ItemGrabPotion()
|
||||
{
|
||||
if (CharConfig.RunItemGrabScriptOnly) return false; //item grab only
|
||||
|
||||
//####
|
||||
if (Form1_0.InventoryStruc_0.HasInventoryItemName("Super Healing Potion"))
|
||||
{
|
||||
//Form1_0.method_1("FORCING HP POT QTY: " + Form1_0.BeltStruc_0.HPQuantity, Color.Red);
|
||||
ForceHPPotionQty = HPQuantity; //reset qty in belt
|
||||
MissingHPPot = false;
|
||||
}
|
||||
if (Form1_0.InventoryStruc_0.HasInventoryItemName("Super Mana Potion"))
|
||||
{
|
||||
ForceMANAPotionQty = ManyQuantity; //reset qty in belt
|
||||
MissingManaPot = false;
|
||||
}
|
||||
//####
|
||||
|
||||
if (MissingHPPot || MissingManaPot || MissingRVPot)
|
||||
{
|
||||
ItemIsPotion();
|
||||
|
@ -78,6 +95,8 @@ namespace app
|
|||
}
|
||||
}
|
||||
|
||||
//Form1_0.method_1("HP POT QTY: " + HPQuantity, Color.Red);
|
||||
|
||||
if (MissingHPPot)
|
||||
{
|
||||
if (ForceHPPotionQty != 0)
|
||||
|
|
146
Strucs/Enums.cs
146
Strucs/Enums.cs
|
@ -691,5 +691,151 @@ namespace app
|
|||
Portal = 0x79, // Confirm... Pindle portal at least... red only ?
|
||||
LockedChest = 0x80,
|
||||
}
|
||||
|
||||
public enum Area
|
||||
{
|
||||
Abaddon = 125,
|
||||
AncientTunnels = 65,
|
||||
ArcaneSanctuary = 74,
|
||||
ArreatPlateau = 112,
|
||||
ArreatSummit = 120,
|
||||
Barracks = 28,
|
||||
BlackMarsh = 6,
|
||||
BloodMoor = 2,
|
||||
BloodyFoothills = 110,
|
||||
BurialGrounds = 17,
|
||||
CanyonOfTheMagi = 46,
|
||||
CatacombsLevel1 = 34,
|
||||
CatacombsLevel2 = 35,
|
||||
CatacombsLevel3 = 36,
|
||||
CatacombsLevel4 = 37,
|
||||
Cathedral = 33,
|
||||
CaveLevel1 = 9,
|
||||
CaveLevel2 = 13,
|
||||
ChaosSanctuary = 108,
|
||||
CityOfTheDamned = 106,
|
||||
ClawViperTempleLevel1 = 58,
|
||||
ClawViperTempleLevel2 = 61,
|
||||
ColdPlains = 3,
|
||||
Crypt = 18,
|
||||
CrystallinePassage = 113,
|
||||
DarkWood = 5,
|
||||
DenOfEvil = 8,
|
||||
DisusedFane = 95,
|
||||
DisusedReliquary = 99,
|
||||
DrifterCavern = 116,
|
||||
DryHills = 42,
|
||||
DuranceOfHateLevel1 = 100,
|
||||
DuranceOfHateLevel2 = 101,
|
||||
DuranceOfHateLevel3 = 102,
|
||||
DurielsLair = 73,
|
||||
FarOasis = 43,
|
||||
FlayerDungeonLevel1 = 88,
|
||||
FlayerDungeonLevel2 = 89,
|
||||
FlayerDungeonLevel3 = 91,
|
||||
FlayerJungle = 78,
|
||||
ForgottenReliquary = 96,
|
||||
ForgottenSands = 134,
|
||||
ForgottenTemple = 97,
|
||||
ForgottenTower = 20,
|
||||
FrigidHighlands = 111,
|
||||
FrozenRiver = 114,
|
||||
FrozenTundra = 117,
|
||||
FurnaceOfPain = 135,
|
||||
GlacialTrail = 115,
|
||||
GreatMarsh = 77,
|
||||
HallsOfAnguish = 122,
|
||||
HallsOfPain = 123,
|
||||
HallsOfTheDeadLevel1 = 56,
|
||||
HallsOfTheDeadLevel2 = 57,
|
||||
HallsOfTheDeadLevel3 = 60,
|
||||
HallsOfVaught = 124,
|
||||
HaremLevel1 = 50,
|
||||
HaremLevel2 = 51,
|
||||
Harrogath = 109,
|
||||
HoleLevel1 = 11,
|
||||
HoleLevel2 = 15,
|
||||
IcyCellar = 119,
|
||||
InfernalPit = 127,
|
||||
InnerCloister = 32,
|
||||
JailLevel1 = 29,
|
||||
JailLevel2 = 30,
|
||||
JailLevel3 = 31,
|
||||
KurastBazaar = 80,
|
||||
KurastCauseway = 82,
|
||||
KurastDocks = 75,
|
||||
LostCity = 44,
|
||||
LowerKurast = 79,
|
||||
LutGholein = 40,
|
||||
MaggotLairLevel1 = 62,
|
||||
MaggotLairLevel2 = 63,
|
||||
MaggotLairLevel3 = 64,
|
||||
MatronsDen = 133,
|
||||
Mausoleum = 19,
|
||||
MonasteryGate = 26,
|
||||
MooMooFarm = 39,
|
||||
NihlathaksTemple = 121,
|
||||
None = 0,
|
||||
OuterCloister = 27,
|
||||
OuterSteppes = 104,
|
||||
PalaceCellarLevel1 = 52,
|
||||
PalaceCellarLevel2 = 53,
|
||||
PalaceCellarLevel3 = 54,
|
||||
PitLevel1 = 12,
|
||||
PitLevel2 = 16,
|
||||
PitOfAcheron = 126,
|
||||
PlainsOfDespair = 105,
|
||||
RiverOfFlame = 107,
|
||||
RockyWaste = 41,
|
||||
RogueEncampment = 1,
|
||||
RuinedFane = 98,
|
||||
RuinedTemple = 94,
|
||||
SewersLevel1Act2 = 47,
|
||||
SewersLevel1Act3 = 92,
|
||||
SewersLevel2Act2 = 48,
|
||||
SewersLevel2Act3 = 93,
|
||||
SewersLevel3Act2 = 49,
|
||||
SpiderCave = 84,
|
||||
SpiderCavern = 85,
|
||||
SpiderForest = 76,
|
||||
StonyField = 4,
|
||||
StonyTombLevel1 = 55,
|
||||
StonyTombLevel2 = 59,
|
||||
SwampyPitLevel1 = 86,
|
||||
SwampyPitLevel2 = 87,
|
||||
SwampyPitLevel3 = 90,
|
||||
TalRashasTomb1 = 66,
|
||||
TalRashasTomb2 = 67,
|
||||
TalRashasTomb3 = 68,
|
||||
TalRashasTomb4 = 69,
|
||||
TalRashasTomb5 = 70,
|
||||
TalRashasTomb6 = 71,
|
||||
TalRashasTomb7 = 72,
|
||||
TamoeHighland = 7,
|
||||
TheAncientsWay = 118,
|
||||
ThePandemoniumFortress = 103,
|
||||
TheWorldstoneChamber = 132,
|
||||
TheWorldStoneKeepLevel1 = 128,
|
||||
TheWorldStoneKeepLevel2 = 129,
|
||||
TheWorldStoneKeepLevel3 = 130,
|
||||
ThroneOfDestruction = 131,
|
||||
TowerCellarLevel1 = 21,
|
||||
TowerCellarLevel2 = 22,
|
||||
TowerCellarLevel3 = 23,
|
||||
TowerCellarLevel4 = 24,
|
||||
TowerCellarLevel5 = 25,
|
||||
Travincal = 83,
|
||||
Tristram = 38,
|
||||
UberTristram = 136,
|
||||
UndergroundPassageLevel1 = 10,
|
||||
UndergroundPassageLevel2 = 14,
|
||||
UpperKurast = 81,
|
||||
ValleyOfSnakes = 45,
|
||||
MapsAncientTemple = 137,
|
||||
MapsDesecratedTemple = 138,
|
||||
MapsFrigidPlateau = 139,
|
||||
MapsInfernalTrial = 140,
|
||||
MapsRuinedCitadel = 141
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,8 @@ namespace app
|
|||
public int SelectedGamePlayerCount = 0;
|
||||
public int SelectedGameTime = 0;
|
||||
|
||||
public string SelectedGameName = "";
|
||||
|
||||
public List<string> AllGamesTriedNames = new List<string>();
|
||||
|
||||
[DllImport("user32.dll")] static extern short VkKeyScan(char ch);
|
||||
|
@ -63,6 +65,7 @@ namespace app
|
|||
|
||||
public void CreateNewGame()
|
||||
{
|
||||
Form1_0.SetGameStatus("CREATING GAME");
|
||||
Form1_0.KeyMouse_0.MouseClicc(1190, 990); //clic 'salon' if not in server
|
||||
Form1_0.KeyMouse_0.MouseClicc(1275, 65); //clic 'create game' if not in game create area
|
||||
|
||||
|
@ -98,8 +101,13 @@ namespace app
|
|||
Thread.Sleep(3);
|
||||
}
|
||||
|
||||
//select difficulty
|
||||
Form1_0.KeyMouse_0.MouseClicc(1360 + (100 * CharConfig.GameDifficulty), 375);
|
||||
|
||||
Form1_0.KeyMouse_0.MouseClicc(1470, 670); //clic 'create game'
|
||||
|
||||
Form1_0.SetGameStatus("LOADING GAME");
|
||||
|
||||
|
||||
//###############
|
||||
/*GetAllGamesNames();
|
||||
|
@ -134,7 +142,7 @@ namespace app
|
|||
AllGamesNames.Add(TestName);
|
||||
AllGamesPlayersCount.Add((int) Form1_0.Mem_0.ReadByteRaw((IntPtr) CountOffet));
|
||||
|
||||
//Form1_0.method_1("Game: " + TestName + " - Players: " + ((int)Form1_0.Mem_0.ReadByteRaw((IntPtr)CountOffet)));
|
||||
//Form1_0.method_1("Game: " + TestName + " - Players: " + ((int)Form1_0.Mem_0.ReadByteRaw((IntPtr)CountOffet)), Color.Red);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -179,11 +187,13 @@ namespace app
|
|||
|
||||
public void GetSelectedGameInfo()
|
||||
{
|
||||
if ((int) Form1_0.offsets["GameSelectedOffset"] == 64)
|
||||
if ((int) Form1_0.offsets["GameSelectedOffset"] <= 64)
|
||||
{
|
||||
Form1_0.PatternsScan_0.PatternScan();
|
||||
}
|
||||
|
||||
Form1_0.method_1("------------------------------------------", Color.Black);
|
||||
|
||||
//0x53F or 0x540 size
|
||||
long gameOffset = (long)Form1_0.BaseAddress + (long)Form1_0.offsets["GameSelectedOffset"];
|
||||
long PlayersNamesOffset = gameOffset + 0x138; //then 0x78 offset each others names
|
||||
|
@ -191,6 +201,7 @@ namespace app
|
|||
|
||||
SelectedGamePlayerCount = (int)Form1_0.Mem_0.ReadByteRaw((IntPtr) (gameOffset + 0x108));
|
||||
SelectedGameTime = Form1_0.Mem_0.ReadInt32Raw((IntPtr)(gameOffset + 0xf0));
|
||||
Form1_0.method_1("Player Count: " + SelectedGamePlayerCount, Color.OrangeRed);
|
||||
for (int i = 0; i < SelectedGamePlayerCount; i++)
|
||||
{
|
||||
long NameOffet = PlayersNamesOffset + (i * 0x78);
|
||||
|
@ -199,7 +210,19 @@ namespace app
|
|||
if (TestName != "")
|
||||
{
|
||||
AllPlayersNames.Add(TestName);
|
||||
//Form1_0.method_1("Player Name: " + TestName);
|
||||
Form1_0.method_1("Player Name: " + TestName, Color.OrangeRed);
|
||||
}
|
||||
}
|
||||
|
||||
SelectedGameName = "";
|
||||
byte[] buffer = new byte[16];
|
||||
Form1_0.Mem_0.ReadRawMemory(gameOffset + 0x08, ref buffer, 16);
|
||||
|
||||
for (int i2 = 0; i2 < 16; i2++)
|
||||
{
|
||||
if (buffer[i2] != 0x00)
|
||||
{
|
||||
SelectedGameName += (char)buffer[i2];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -313,7 +336,7 @@ namespace app
|
|||
|
||||
public void SetNewGame()
|
||||
{
|
||||
Form1_0.method_1("------------------------------------------", Color.DarkBlue);
|
||||
//Form1_0.method_1("------------------------------------------", Color.DarkBlue);
|
||||
Form1_0.method_1("New game started: " + GetTimeNow(), Color.DarkBlue);
|
||||
|
||||
Form1_0.GameStartedTime = DateTime.Now;
|
||||
|
@ -322,7 +345,7 @@ namespace app
|
|||
long gameNameAddress = (long)Form1_0.BaseAddress + gameNameOffset;
|
||||
GameName = Form1_0.Mem_0.ReadMemString(gameNameAddress);
|
||||
|
||||
Form1_0.method_1("Entered game: " + GameName, Color.Black);
|
||||
Form1_0.method_1("Entered game: " + GameName, Color.DarkBlue);
|
||||
|
||||
AllGamesTriedNames = new List<string>();
|
||||
}
|
||||
|
@ -330,7 +353,7 @@ namespace app
|
|||
public void LogGameTime()
|
||||
{
|
||||
TimeSpan ThisTimee = DateTime.Now - Form1_0.GameStartedTime;
|
||||
Form1_0.method_1("Game Time: " + ThisTimee.Minutes.ToString("00") + ":" + ThisTimee.Seconds.ToString("00") + ":" + ThisTimee.Milliseconds.ToString("0"), Color.Black);
|
||||
Form1_0.method_1("Game Time: " + ThisTimee.Minutes.ToString("00") + ":" + ThisTimee.Seconds.ToString("00") + ":" + ThisTimee.Milliseconds.ToString("0"), Color.DarkBlue);
|
||||
}
|
||||
|
||||
public Dictionary<string, int> World2Screen(long playerX, long playerY, long targetx, long targety)
|
||||
|
|
|
@ -93,6 +93,63 @@ namespace app
|
|||
return ContainStashItem;
|
||||
}
|
||||
|
||||
public void VerifyKeysInventory()
|
||||
{
|
||||
int thisindex = CharConfig.KeysLocationInInventory.Item1 + (CharConfig.KeysLocationInInventory.Item2 * 10);
|
||||
|
||||
//if its not a key at the key location, relocate the item
|
||||
if (InventoryItemNames[thisindex] != "Key")
|
||||
{
|
||||
int ThisNewIndex = GetNextFreeSpaceInInventory();
|
||||
|
||||
if (ThisNewIndex > -1)
|
||||
{
|
||||
//remove item from this slot
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.InventoryStruc_0.ConvertIndexToXY(thisindex);
|
||||
itemScreenPos = Form1_0.InventoryStruc_0.ConvertInventoryLocToScreenPos(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
|
||||
//Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.Stash_0.PickItem(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.WaitDelay(5);
|
||||
|
||||
//place to next free space
|
||||
itemScreenPos = Form1_0.InventoryStruc_0.ConvertIndexToXY(ThisNewIndex);
|
||||
itemScreenPos = Form1_0.InventoryStruc_0.ConvertInventoryLocToScreenPos(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
|
||||
Form1_0.Stash_0.PlaceItem(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.Stash_0.PlaceItem(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
}
|
||||
}
|
||||
|
||||
//place all keys together
|
||||
for (int i = 0; i < 40; i++)
|
||||
{
|
||||
if (CharConfig.InventoryDontCheckItem[i] == 0 && InventoryHasItem[i] >= 1 && InventoryItemNames[i] == "Key")
|
||||
{
|
||||
//pick key item from this slot
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.InventoryStruc_0.ConvertIndexToXY(i);
|
||||
itemScreenPos = Form1_0.InventoryStruc_0.ConvertInventoryLocToScreenPos(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
|
||||
//Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.Stash_0.PickItem(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.WaitDelay(5);
|
||||
|
||||
//place with other key
|
||||
itemScreenPos = Form1_0.InventoryStruc_0.ConvertIndexToXY(thisindex);
|
||||
itemScreenPos = Form1_0.InventoryStruc_0.ConvertInventoryLocToScreenPos(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
|
||||
if (!Form1_0.Stash_0.PlaceItem(itemScreenPos["x"], itemScreenPos["y"]))
|
||||
{
|
||||
itemScreenPos = Form1_0.InventoryStruc_0.ConvertIndexToXY(i);
|
||||
itemScreenPos = Form1_0.InventoryStruc_0.ConvertInventoryLocToScreenPos(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
|
||||
Form1_0.Stash_0.PlaceItem(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.Stash_0.PlaceItem(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetHUDItem()
|
||||
{
|
||||
if (Form1_0.ItemsStruc_0.statCount > 0)
|
||||
|
@ -169,19 +226,23 @@ namespace app
|
|||
|
||||
public void SetInventoryItem()
|
||||
{
|
||||
int FullIndex = ConvertXYToIndex(Form1_0.ItemsStruc_0.itemx, Form1_0.ItemsStruc_0.itemy);
|
||||
InventoryHasItem[FullIndex] = 1;
|
||||
InventoryItemPointers[FullIndex] = Form1_0.ItemsStruc_0.ItemPointerLocation;
|
||||
InventoryItemNames[FullIndex] = Form1_0.ItemsStruc_0.ItemNAAME;
|
||||
if (Form1_0.ItemsAlert_0.ShouldKeepItem())
|
||||
try
|
||||
{
|
||||
InventoryHasStashItem[FullIndex] = 1;
|
||||
}
|
||||
int FullIndex = ConvertXYToIndex(Form1_0.ItemsStruc_0.itemx, Form1_0.ItemsStruc_0.itemy);
|
||||
InventoryHasItem[FullIndex] = 1;
|
||||
InventoryItemPointers[FullIndex] = Form1_0.ItemsStruc_0.ItemPointerLocation;
|
||||
InventoryItemNames[FullIndex] = Form1_0.ItemsStruc_0.ItemNAAME;
|
||||
if (Form1_0.ItemsAlert_0.ShouldKeepItem())
|
||||
{
|
||||
InventoryHasStashItem[FullIndex] = 1;
|
||||
}
|
||||
|
||||
if (!Form1_0.ItemsStruc_0.identified)
|
||||
{
|
||||
InventoryHasUnidItem[FullIndex] = 1;
|
||||
if (!Form1_0.ItemsStruc_0.identified)
|
||||
{
|
||||
InventoryHasUnidItem[FullIndex] = 1;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
public bool HasUnidItemInInventory()
|
||||
|
@ -196,6 +257,18 @@ namespace app
|
|||
return false;
|
||||
}
|
||||
|
||||
public int GetNextFreeSpaceInInventory()
|
||||
{
|
||||
for (int i = 0; i < 40; i++)
|
||||
{
|
||||
if (CharConfig.InventoryDontCheckItem[i] == 0 && InventoryHasItem[i] == 0)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public bool HasInventoryItems()
|
||||
{
|
||||
for (int i = 0; i < 40; i++)
|
||||
|
|
|
@ -103,20 +103,20 @@ namespace app
|
|||
|
||||
PickItemsRunesKeyGems = new string[]
|
||||
{
|
||||
"El Rune",
|
||||
"Eld Rune",
|
||||
"Tir Rune",
|
||||
"Nef Rune",
|
||||
"Eth Rune",
|
||||
"Ith Rune",
|
||||
"Tal Rune",
|
||||
"Ral Rune",
|
||||
"Ort Rune",
|
||||
"Thul Rune",
|
||||
"Amn Rune",
|
||||
"Sol Rune",
|
||||
"Shael Rune",
|
||||
"Dol Rune",
|
||||
//"El Rune",
|
||||
//"Eld Rune",
|
||||
//"Tir Rune",
|
||||
//"Nef Rune",
|
||||
//"Eth Rune",
|
||||
//"Ith Rune",
|
||||
//"Tal Rune",
|
||||
//"Ral Rune",
|
||||
//"Ort Rune",
|
||||
//"Thul Rune",
|
||||
//"Amn Rune",
|
||||
//"Sol Rune",
|
||||
//"Shael Rune",
|
||||
//"Dol Rune",
|
||||
"Hel Rune",
|
||||
"Io Rune",
|
||||
"Lum Rune",
|
||||
|
@ -154,12 +154,12 @@ namespace app
|
|||
"Chipped Emerald",
|
||||
"Chipped Diamond",
|
||||
|
||||
"Flawed Amethyst",
|
||||
"Flawed Topaz",
|
||||
"Flawed Sapphire",
|
||||
"Flawed Ruby",
|
||||
"Flawed Emerald",
|
||||
"Flawed Diamond",
|
||||
//"Flawed Amethyst",
|
||||
//"Flawed Topaz",
|
||||
//"Flawed Sapphire",
|
||||
//"Flawed Ruby",
|
||||
//"Flawed Emerald",
|
||||
//"Flawed Diamond",
|
||||
|
||||
//"Amethyst",
|
||||
//"Topaz",
|
||||
|
@ -211,6 +211,7 @@ namespace app
|
|||
if (Form1_0.ItemsStruc_0.ItemNAAME.ToLower() == PickItemsRunesKeyGems[i].ToLower())
|
||||
{
|
||||
if (Form1_0.ItemsStruc_0.ItemNAAME.Contains("Chipped") || Form1_0.ItemsStruc_0.ItemNAAME.Contains("Flawed"))
|
||||
//if (Form1_0.ItemsStruc_0.ItemNAAME.Contains("Chipped"))
|
||||
{
|
||||
//pick only chipped and flawed gems if count are bellow 2x
|
||||
if (Form1_0.StashStruc_0.GetStashItemCount(Form1_0.ItemsStruc_0.ItemNAAME) < 2)
|
||||
|
@ -225,6 +226,7 @@ namespace app
|
|||
}
|
||||
}
|
||||
|
||||
//[Name] == GrandCharm && [Quality] == Magic # [ItemAddSkillTab] == 1
|
||||
if (Form1_0.ItemsStruc_0.ItemNAAME.ToLower() == "Small Charm".ToLower()
|
||||
//|| Form1_0.ItemsStruc_0.ItemNAAME.ToLower() == "Large Charm".ToLower()
|
||||
|| Form1_0.ItemsStruc_0.ItemNAAME.ToLower() == "Grand Charm".ToLower())
|
||||
|
@ -237,7 +239,15 @@ namespace app
|
|||
{
|
||||
if (Keeping)
|
||||
{
|
||||
return true;
|
||||
if ((Form1_0.ItemsStruc_0.ItemNAAME.ToLower() == "Grand Charm".ToLower() && Form1_0.ItemsStruc_0.IsItemHaveSameStat("AddSkillTab", 1, "=="))
|
||||
|| (Form1_0.ItemsStruc_0.ItemNAAME.ToLower() == "Small Charm".ToLower() && Form1_0.ItemsStruc_0.IsItemHaveSameStat("LifeMax", 19, ">="))
|
||||
|| (Form1_0.ItemsStruc_0.ItemNAAME.ToLower() == "Small Charm".ToLower() && Form1_0.ItemsStruc_0.IsItemHaveSameStat("PoisonMaxDamage", 50, ">="))
|
||||
|| (Form1_0.ItemsStruc_0.ItemNAAME.ToLower() == "Small Charm".ToLower() && Form1_0.ItemsStruc_0.IsItemHaveSameStat("MagicFind", 6, ">=")))
|
||||
{
|
||||
//Console.WriteLine("Keep charm!");
|
||||
return true;
|
||||
}
|
||||
//return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -187,9 +187,9 @@ namespace app
|
|||
itemx = Form1_0.Mem_0.ReadUInt16Raw((IntPtr)(pPathPtr + 0x10));
|
||||
itemy = Form1_0.Mem_0.ReadUInt16Raw((IntPtr)(pPathPtr + 0x14));
|
||||
|
||||
//string SavePathh = Form1_0.ThisEndPath + "DumpItempPathStruc";
|
||||
//File.Create(SavePathh).Dispose();
|
||||
//File.WriteAllBytes(SavePathh, pPath);
|
||||
/*string SavePathh = Form1_0.ThisEndPath + "DumpItempPathStruc";
|
||||
File.Create(SavePathh).Dispose();
|
||||
File.WriteAllBytes(SavePathh, pPath);*/
|
||||
}
|
||||
|
||||
public void GetItemAtPointer(long AtPointerr)
|
||||
|
@ -248,6 +248,17 @@ namespace app
|
|||
|
||||
public bool GetItems(bool IsPickingItem)
|
||||
{
|
||||
if (!Form1_0.GameStruc_0.IsInGame()) return false;
|
||||
|
||||
//dead leave game
|
||||
if (Form1_0.PlayerScan_0.PlayerDead || Form1_0.Potions_0.ForceLeave)
|
||||
{
|
||||
Form1_0.Potions_0.ForceLeave = true;
|
||||
Form1_0.Baal_0.SearchSameGamesAsLastOne = false;
|
||||
Form1_0.LeaveGame(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
//Form1_0.SetGameStatus("SCANING ITEMS");
|
||||
ItemsScanned = 0;
|
||||
ItemsOnGround = 0;
|
||||
|
@ -374,21 +385,42 @@ namespace app
|
|||
&& (!Form1_0.UIScan_0.leftMenu && !Form1_0.UIScan_0.rightMenu && !Form1_0.UIScan_0.fullMenu)
|
||||
&& IsPickingItem)
|
||||
{
|
||||
//Form1_0.method_1("Name: " + ItemNAAME);
|
||||
if (ItemNAAME == "Perfect Diamond" && (Form1_0.PlayerScan_0.levelNo >= 106 && Form1_0.PlayerScan_0.levelNo < 109)) continue;
|
||||
|
||||
//Form1_0.method_1("Name: " + ItemNAAME, Color.DarkViolet);
|
||||
|
||||
|
||||
//Console.WriteLine("Pointer Addr: " + ItemPointerLocation.ToString("X"));
|
||||
//Console.WriteLine("Path Addr: " + pPathPtr.ToString("X"));
|
||||
|
||||
/*Console.WriteLine("Path Addr: " + Form1_0.Mem_0.ReadByteRaw((IntPtr)(pPathPtr + 0x20)).ToString("X"));
|
||||
|
||||
string SavePathh = Form1_0.ThisEndPath + "DumpItempPathStruc";
|
||||
File.Create(SavePathh).Dispose();
|
||||
File.WriteAllBytes(SavePathh, itemdatastruc);
|
||||
|
||||
SavePathh = Form1_0.ThisEndPath + "DumpItempPathStruc2";
|
||||
File.Create(SavePathh).Dispose();
|
||||
File.WriteAllBytes(SavePathh, pPath);*/
|
||||
|
||||
Dictionary<string, int> itemScreenPos = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, itemx, itemy);
|
||||
if (ShouldPickPos(itemScreenPos))
|
||||
{
|
||||
int DiffXPlayer = itemx - Form1_0.PlayerScan_0.xPosFinal;
|
||||
int DiffYPlayer = itemy - Form1_0.PlayerScan_0.yPosFinal;
|
||||
if (DiffXPlayer < 0) DiffXPlayer = -DiffXPlayer;
|
||||
if (DiffYPlayer < 0) DiffYPlayer = -DiffYPlayer;
|
||||
|
||||
if (DiffXPlayer > 1000 || DiffYPlayer > 1000)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//####
|
||||
if (CharConfig.UseTeleport)
|
||||
{
|
||||
int DiffXPlayer = itemx - Form1_0.PlayerScan_0.xPosFinal;
|
||||
int DiffYPlayer = itemy - Form1_0.PlayerScan_0.yPosFinal;
|
||||
if (DiffXPlayer < 0) DiffXPlayer = -DiffXPlayer;
|
||||
if (DiffYPlayer < 0) DiffYPlayer = -DiffYPlayer;
|
||||
|
||||
if (DiffXPlayer > 5
|
||||
|| DiffYPlayer > 5)
|
||||
if (DiffXPlayer > 4 || DiffYPlayer > 4)
|
||||
{
|
||||
Form1_0.Mover_0.MoveToLocation(itemx, itemy);
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
|
@ -398,12 +430,22 @@ namespace app
|
|||
}
|
||||
//####
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
Form1_0.KeyMouse_0.MouseClicc(itemScreenPos["x"], itemScreenPos["y"]);
|
||||
|
||||
if (ItemNAAME != LastPick)
|
||||
{
|
||||
LastPick = ItemNAAME;
|
||||
Form1_0.method_1_Items("Picked: " + ItemNAAME, GetColorFromQuality((int) itemQuality));
|
||||
|
||||
Form1_0.BeltStruc_0.ItemIsPotion();
|
||||
if (Form1_0.BeltStruc_0.IsItemHPPotion
|
||||
|| Form1_0.BeltStruc_0.IsItemManaPotion
|
||||
|| Form1_0.BeltStruc_0.IsItemRVPotion
|
||||
|| Form1_0.BeltStruc_0.IsItemFullRVPotion)
|
||||
{
|
||||
Form1_0.BeltStruc_0.CheckForMissingPotions();
|
||||
}
|
||||
|
||||
//string SavePathh = Form1_0.ThisEndPath + "DumpItemDataStruc";
|
||||
//File.Create(SavePathh).Dispose();
|
||||
//File.WriteAllBytes(SavePathh, itemdatastruc);
|
||||
|
@ -440,6 +482,11 @@ namespace app
|
|||
string LastGrabbedItem = "";
|
||||
int TryGrabCount = 0;
|
||||
int ItemsGrabbed = 0;
|
||||
|
||||
if (Form1_0.ItemsStruc_0.ItemsEquiped <= 2) return;
|
||||
|
||||
Form1_0.method_1("Grabbing all items for gold", Color.BlueViolet);
|
||||
|
||||
while (true)
|
||||
{
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
|
@ -487,18 +534,30 @@ namespace app
|
|||
itemdatastruc = new byte[144];
|
||||
Form1_0.Mem_0.ReadRawMemory(ItemPointerLocation, ref itemdatastruc, 144);
|
||||
GetStatsAddr();
|
||||
GetUnitPathData();
|
||||
int ItemValue = GetValuesFromStats(Enums.Attribute.Value);
|
||||
|
||||
//; on ground, dropping
|
||||
if (itemdatastruc[0x0C] == 3 || itemdatastruc[0x0C] == 5)
|
||||
{
|
||||
Form1_0.UIScan_0.readUI();
|
||||
if (!Form1_0.UIScan_0.leftMenu && !Form1_0.UIScan_0.rightMenu && !Form1_0.UIScan_0.fullMenu)
|
||||
if (itemx > 0 && itemy > 0)
|
||||
{
|
||||
if (ItemValue >= ItemHighestValue)
|
||||
if (itemx - Form1_0.PlayerScan_0.xPosFinal > 50
|
||||
|| itemx - Form1_0.PlayerScan_0.xPosFinal < -50
|
||||
|| itemy - Form1_0.PlayerScan_0.yPosFinal > 50
|
||||
|| itemy - Form1_0.PlayerScan_0.yPosFinal < -50)
|
||||
{
|
||||
ItemHighestValue = ItemValue;
|
||||
ItemPointMaxValue = ItemPointerLocation;
|
||||
continue;
|
||||
}
|
||||
|
||||
Form1_0.UIScan_0.readUI();
|
||||
if (!Form1_0.UIScan_0.leftMenu && !Form1_0.UIScan_0.rightMenu && !Form1_0.UIScan_0.fullMenu)
|
||||
{
|
||||
if (ItemValue >= ItemHighestValue)
|
||||
{
|
||||
ItemHighestValue = ItemValue;
|
||||
ItemPointMaxValue = ItemPointerLocation;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -528,8 +587,8 @@ namespace app
|
|||
if (DiffXPlayer < 0) DiffXPlayer = -DiffXPlayer;
|
||||
if (DiffYPlayer < 0) DiffYPlayer = -DiffYPlayer;
|
||||
|
||||
if (DiffXPlayer > 5
|
||||
|| DiffYPlayer > 5)
|
||||
if (DiffXPlayer > 4
|
||||
|| DiffYPlayer > 4)
|
||||
{
|
||||
Form1_0.Mover_0.MoveToLocation(itemx, itemy);
|
||||
Form1_0.PlayerScan_0.GetPositions();
|
||||
|
@ -557,7 +616,9 @@ namespace app
|
|||
{
|
||||
if (CharConfig.UseTeleport && !Form1_0.Town_0.GetInTown())
|
||||
{
|
||||
return true;
|
||||
if (itemScreenPos["x"] > 0 && itemScreenPos["y"] > 0) return true;
|
||||
return false;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -762,7 +823,7 @@ namespace app
|
|||
}
|
||||
}
|
||||
|
||||
return true; //no identical stats found, return true by default
|
||||
return false; //no identical stats found, return true by default
|
||||
}
|
||||
|
||||
public int GetStatEnumIndex(string StatNammm)
|
||||
|
|
|
@ -0,0 +1,662 @@
|
|||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Reflection.Emit;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static app.Enums;
|
||||
using static app.MapAreaStruc;
|
||||
|
||||
namespace app
|
||||
{
|
||||
public class MapAreaStruc
|
||||
{
|
||||
Form1 Form1_0;
|
||||
|
||||
public List<ServerLevel> AllMapData = new List<ServerLevel>();
|
||||
public int CurrentObjectIndex = 0;
|
||||
public int CurrentObjectAreaIndex = 0;
|
||||
|
||||
public void SetForm1(Form1 form1_1)
|
||||
{
|
||||
Form1_0 = form1_1;
|
||||
|
||||
_kooloMapPath = Application.StartupPath + @"\map.exe";
|
||||
_d2LoDPath = Form1_0.D2_LOD_113C_Path;
|
||||
}
|
||||
|
||||
public Position GetAreaOfObject(string ObjectType, string ObjectName, List<int> IgnoreTheseIndex, int StartAreaIndexToSearch = 0, int EndAreaIndexToSearch = 1)
|
||||
{
|
||||
Position ThisPos = new Position();
|
||||
ThisPos.X = 0;
|
||||
ThisPos.Y = 0;
|
||||
|
||||
if (StartAreaIndexToSearch == 0 && EndAreaIndexToSearch == 1)
|
||||
{
|
||||
EndAreaIndexToSearch = AllMapData.Count;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
//ExitType = "exit" or "exit_area"
|
||||
|
||||
CurrentObjectIndex = 0;
|
||||
CurrentObjectAreaIndex = 0;
|
||||
|
||||
for (int i = StartAreaIndexToSearch; i < EndAreaIndexToSearch; i++)
|
||||
{
|
||||
//if (AllMapData[i].Objects.Count == 0) ScanMapStruc();
|
||||
for (int k = 0; k < AllMapData[i].Objects.Count; k++)
|
||||
{
|
||||
if (!AvoidThisIndex(k, IgnoreTheseIndex))
|
||||
{
|
||||
if (AllMapData[i].Objects[k].Type == "exit" && ObjectType == "exit")
|
||||
{
|
||||
if (Form1_0.Town_0.getAreaName(int.Parse(AllMapData[i].Objects[k].ID)) == ObjectName)
|
||||
{
|
||||
ThisPos.X = AllMapData[i].Offset.X + AllMapData[i].Objects[k].X;
|
||||
ThisPos.Y = AllMapData[i].Offset.Y + AllMapData[i].Objects[k].Y;
|
||||
CurrentObjectIndex = k;
|
||||
CurrentObjectAreaIndex = i;
|
||||
}
|
||||
}
|
||||
if (AllMapData[i].Objects[k].Type == "exit_area" && ObjectType == "exit_area")
|
||||
{
|
||||
if (Form1_0.Town_0.getAreaName(int.Parse(AllMapData[i].Objects[k].ID)) == ObjectName)
|
||||
{
|
||||
ThisPos.X = AllMapData[i].Offset.X + AllMapData[i].Objects[k].X;
|
||||
ThisPos.Y = AllMapData[i].Offset.Y + AllMapData[i].Objects[k].Y;
|
||||
CurrentObjectIndex = k;
|
||||
CurrentObjectAreaIndex = i;
|
||||
}
|
||||
}
|
||||
if (AllMapData[i].Objects[k].Type == "object" && ObjectType == "object")
|
||||
{
|
||||
//Console.WriteLine(Form1_0.ObjectsStruc_0.getObjectName(int.Parse(AllMapData[i].Objects[k].ID)));
|
||||
if (Form1_0.ObjectsStruc_0.getObjectName(int.Parse(AllMapData[i].Objects[k].ID)) == ObjectName)
|
||||
{
|
||||
ThisPos.X = AllMapData[i].Offset.X + AllMapData[i].Objects[k].X;
|
||||
ThisPos.Y = AllMapData[i].Offset.Y + AllMapData[i].Objects[k].Y;
|
||||
CurrentObjectIndex = k;
|
||||
CurrentObjectAreaIndex = i;
|
||||
}
|
||||
}
|
||||
if (AllMapData[i].Objects[k].Type == "npc" && ObjectType == "npc")
|
||||
{
|
||||
if (Form1_0.NPCStruc_0.getNPC_ID(int.Parse(AllMapData[i].Objects[k].ID)) == ObjectName)
|
||||
{
|
||||
ThisPos.X = AllMapData[i].Offset.X + AllMapData[i].Objects[k].X;
|
||||
ThisPos.Y = AllMapData[i].Offset.Y + AllMapData[i].Objects[k].Y;
|
||||
CurrentObjectIndex = k;
|
||||
CurrentObjectAreaIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Form1_0.method_1("Object: " + ExitName + " found at: "+ ThisPos.X + ", " + ThisPos.Y, Color.Red);
|
||||
|
||||
}
|
||||
catch { }
|
||||
return ThisPos;
|
||||
}
|
||||
|
||||
public Position GetPositionOfObject(string ObjectType, string ObjectName, int AreaID, List<int> IgnoreTheseIndex)
|
||||
{
|
||||
Position ThisPos = new Position();
|
||||
ThisPos.X = 0;
|
||||
ThisPos.Y = 0;
|
||||
|
||||
try
|
||||
{
|
||||
//ExitType = "exit" or "exit_area"
|
||||
|
||||
CurrentObjectIndex = 0;
|
||||
CurrentObjectAreaIndex = 0;
|
||||
|
||||
//for (int i = 0; i < AllMapData.Count; i++)
|
||||
//{
|
||||
int i = AreaID;
|
||||
if (AllMapData[i].Objects.Count == 0) ScanMapStruc();
|
||||
for (int k = 0; k < AllMapData[i].Objects.Count; k++)
|
||||
{
|
||||
if (!AvoidThisIndex(k, IgnoreTheseIndex))
|
||||
{
|
||||
if (AllMapData[i].Objects[k].Type == "exit" && ObjectType == "exit")
|
||||
{
|
||||
if (Form1_0.Town_0.getAreaName(int.Parse(AllMapData[i].Objects[k].ID)) == ObjectName)
|
||||
{
|
||||
ThisPos.X = AllMapData[i].Offset.X + AllMapData[i].Objects[k].X;
|
||||
ThisPos.Y = AllMapData[i].Offset.Y + AllMapData[i].Objects[k].Y;
|
||||
CurrentObjectIndex = k;
|
||||
CurrentObjectAreaIndex = i;
|
||||
}
|
||||
}
|
||||
if (AllMapData[i].Objects[k].Type == "exit_area" && ObjectType == "exit_area")
|
||||
{
|
||||
if (Form1_0.Town_0.getAreaName(int.Parse(AllMapData[i].Objects[k].ID)) == ObjectName)
|
||||
{
|
||||
ThisPos.X = AllMapData[i].Offset.X + AllMapData[i].Objects[k].X;
|
||||
ThisPos.Y = AllMapData[i].Offset.Y + AllMapData[i].Objects[k].Y;
|
||||
CurrentObjectIndex = k;
|
||||
CurrentObjectAreaIndex = i;
|
||||
}
|
||||
}
|
||||
if (AllMapData[i].Objects[k].Type == "object" && ObjectType == "object")
|
||||
{
|
||||
//Console.WriteLine(Form1_0.ObjectsStruc_0.getObjectName(int.Parse(AllMapData[i].Objects[k].ID)));
|
||||
if (Form1_0.ObjectsStruc_0.getObjectName(int.Parse(AllMapData[i].Objects[k].ID)) == ObjectName)
|
||||
{
|
||||
ThisPos.X = AllMapData[i].Offset.X + AllMapData[i].Objects[k].X;
|
||||
ThisPos.Y = AllMapData[i].Offset.Y + AllMapData[i].Objects[k].Y;
|
||||
CurrentObjectIndex = k;
|
||||
CurrentObjectAreaIndex = i;
|
||||
}
|
||||
}
|
||||
if (AllMapData[i].Objects[k].Type == "npc" && ObjectType == "npc")
|
||||
{
|
||||
if (Form1_0.NPCStruc_0.getNPC_ID(int.Parse(AllMapData[i].Objects[k].ID)) == ObjectName)
|
||||
{
|
||||
ThisPos.X = AllMapData[i].Offset.X + AllMapData[i].Objects[k].X;
|
||||
ThisPos.Y = AllMapData[i].Offset.Y + AllMapData[i].Objects[k].Y;
|
||||
CurrentObjectIndex = k;
|
||||
CurrentObjectAreaIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//Form1_0.method_1("Object: " + ExitName + " found at: "+ ThisPos.X + ", " + ThisPos.Y, Color.Red);
|
||||
|
||||
}
|
||||
catch { }
|
||||
return ThisPos;
|
||||
}
|
||||
|
||||
public (LevelData, bool) LevelDataForCoords(Position p, int act)
|
||||
{
|
||||
foreach (var lvl in AllMapData)
|
||||
{
|
||||
var lvlMaxX = lvl.Offset.X + lvl.Size.Width;
|
||||
var lvlMaxY = lvl.Offset.Y + lvl.Size.Height;
|
||||
|
||||
//Console.WriteLine("Act: " + act + " | LVL ID: " + lvl.ID + " " + SameAsTownAct(act, lvl.ID));
|
||||
if (SameAsTownAct(act, lvl.ID) && lvl.Offset.X <= p.X && p.X <= lvlMaxX && lvl.Offset.Y <= p.Y && p.Y <= lvlMaxY)
|
||||
{
|
||||
return (new LevelData
|
||||
{
|
||||
Area = lvl.ID,
|
||||
Name = lvl.Name,
|
||||
Offset = new Position
|
||||
{
|
||||
X = lvl.Offset.X,
|
||||
Y = lvl.Offset.Y
|
||||
},
|
||||
Size = new Position
|
||||
{
|
||||
X = lvl.Size.Width,
|
||||
Y = lvl.Size.Height
|
||||
},
|
||||
CollisionGrid = CollisionGrid((Area)lvl.ID)
|
||||
}, true);
|
||||
}
|
||||
}
|
||||
|
||||
return (new LevelData(), false);
|
||||
}
|
||||
|
||||
public int GetPlayerAct()
|
||||
{
|
||||
int TownAct = 0;
|
||||
if (Form1_0.PlayerScan_0.levelNo >= 1 && Form1_0.PlayerScan_0.levelNo < 40) TownAct = 1;
|
||||
if (Form1_0.PlayerScan_0.levelNo >= 40 && Form1_0.PlayerScan_0.levelNo < 75) TownAct = 2;
|
||||
if (Form1_0.PlayerScan_0.levelNo >= 75 && Form1_0.PlayerScan_0.levelNo < 103) TownAct = 3;
|
||||
if (Form1_0.PlayerScan_0.levelNo >= 103 && Form1_0.PlayerScan_0.levelNo < 109) TownAct = 4;
|
||||
if (Form1_0.PlayerScan_0.levelNo >= 109) TownAct = 5;
|
||||
|
||||
return TownAct;
|
||||
}
|
||||
|
||||
public bool SameAsTownAct(int ThisAct, int ThisMapID)
|
||||
{
|
||||
int TownAct = 0;
|
||||
if (ThisMapID >= 1 && ThisMapID < 40) TownAct = 1;
|
||||
if (ThisMapID >= 40 && ThisMapID < 75) TownAct = 2;
|
||||
if (ThisMapID >= 75 && ThisMapID < 103) TownAct = 3;
|
||||
if (ThisMapID >= 103 && ThisMapID < 109) TownAct = 4;
|
||||
if (ThisMapID >= 109) TownAct = 5;
|
||||
|
||||
if (TownAct == ThisAct) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool AvoidThisIndex(int ThisIndex, List<int> AllIndexToAvoidCheck)
|
||||
{
|
||||
for (int i = 0; i < AllIndexToAvoidCheck.Count; i++)
|
||||
{
|
||||
if (AllIndexToAvoidCheck[i] == ThisIndex) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void ScanMapStruc()
|
||||
{
|
||||
Form1_0.method_1("Seed: " + Form1_0.PlayerScan_0.mapSeedValue.ToString(), Color.DarkBlue);
|
||||
Form1_0.method_1("Difficulty: " + ((Difficulty)Form1_0.PlayerScan_0.difficulty).ToString(), Color.DarkBlue);
|
||||
|
||||
GetMapData(Form1_0.PlayerScan_0.mapSeedValue.ToString(), (Difficulty)Form1_0.PlayerScan_0.difficulty);
|
||||
}
|
||||
|
||||
public string _kooloMapPath;
|
||||
public string _d2LoDPath;
|
||||
|
||||
public void GetMapData(string seed, Difficulty difficulty)
|
||||
{
|
||||
var procStartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = _kooloMapPath,
|
||||
Arguments = $"{_d2LoDPath} -s {seed} -d {GetDifficultyAsNum(difficulty)}",
|
||||
RedirectStandardOutput = true,
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true
|
||||
};
|
||||
|
||||
using (var process = Process.Start(procStartInfo))
|
||||
{
|
||||
if (process == null)
|
||||
throw new Exception("Failed to start the process.");
|
||||
|
||||
var lvls = new List<ServerLevel>();
|
||||
ServerLevel currentLevel = null;
|
||||
|
||||
//#########
|
||||
var stdout = process.StandardOutput.ReadToEnd();
|
||||
var stdoutLines = stdout.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
foreach (var line in stdoutLines)
|
||||
{
|
||||
try
|
||||
{
|
||||
//Form1_0.method_1(line, Color.Red);
|
||||
if (JsonConvert.DeserializeObject<ServerLevel>(line) is ServerLevel lvl && !string.IsNullOrEmpty(lvl.Type) && lvl.Map.Any())
|
||||
{
|
||||
lvls.Add(lvl);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
//#########
|
||||
|
||||
process.WaitForExit();
|
||||
|
||||
/*if (process.ExitCode != 0)
|
||||
{
|
||||
throw new Exception($"Error detected fetching Map Data from Diablo II: LoD 1.13c game, please make sure you have the classic expansion game installed AND config.yaml D2LoDPath is pointing to the correct game path. Error code: {process.ExitCode}");
|
||||
}*/
|
||||
|
||||
//Form1_0.method_1("Count: " + lvls.Count, Color.Red);
|
||||
for (int i = 0; i < lvls.Count; i++)
|
||||
{
|
||||
/*Form1_0.method_1("Name: " + lvls[i].Name + " (ID: " + lvls[i].ID + ")", Color.Red);
|
||||
Form1_0.method_1("Size: " + lvls[i].Size.Width + ", " + lvls[i].Size.Height, Color.Red);
|
||||
Form1_0.method_1("Offset: " + lvls[i].Offset.X + ", " + lvls[i].Offset.Y, Color.Red);
|
||||
|
||||
Form1_0.method_1("Map: " + lvls[i].Map.Count.ToString(), Color.Red);
|
||||
Form1_0.method_1("Rooms: " + lvls[i].Rooms.Count.ToString(), Color.Red);*/
|
||||
|
||||
for (int k = 0; k < lvls[i].Map.Count; k++)
|
||||
{
|
||||
/*for (int m = 0; m < lvls[i].Map[k].Count; m++)
|
||||
{
|
||||
Form1_0.method_1("Map: " + lvls[i].Map[k][m].ToString(), Color.Red);
|
||||
}*/
|
||||
//Form1_0.method_1("Map: " + lvls[i].Map[k].Count.ToString(), Color.Red);
|
||||
}
|
||||
//for (int k = 0; k < lvls[i].Objects.Count; k++) Form1_0.method_1("Objects: " + lvls[i].Objects[k].Name + "(" + lvls[i].Objects[k].X + ", " + lvls[i].Objects[k].Y + ")", Color.Red);
|
||||
for (int k = 0; k < lvls[i].Objects.Count; k++)
|
||||
{
|
||||
/*if (lvls[i].Objects[k].Type == "exit")
|
||||
{
|
||||
Form1_0.method_1("Exit: " + Form1_0.Town_0.getAreaName(int.Parse(lvls[i].Objects[k].ID)) + "(" + lvls[i].Objects[k].X + ", " + lvls[i].Objects[k].Y + ")", Color.Red);
|
||||
}*/
|
||||
/*if (lvls[i].Objects[k].Type == "exit_area")
|
||||
{
|
||||
Form1_0.method_1("Exit_area: " + Form1_0.Town_0.getAreaName(int.Parse(lvls[i].Objects[k].ID)) + "(" + lvls[i].Objects[k].X + ", " + lvls[i].Objects[k].Y + ")", Color.Red);
|
||||
}*/
|
||||
/*if (lvls[i].Objects[k].Type == "object")
|
||||
{
|
||||
Form1_0.method_1("Object: " + Form1_0.ObjectsStruc_0.getObjectName(int.Parse(lvls[i].Objects[k].ID)) + "(" + lvls[i].Objects[k].X + ", " + lvls[i].Objects[k].Y + ")", Color.Red);
|
||||
}*/
|
||||
/*if (lvls[i].Objects[k].Type == "npc")
|
||||
{
|
||||
Form1_0.method_1("NPC: " + Form1_0.Town_0.getAreaName(int.Parse(lvls[i].Objects[k].ID)) + "(" + lvls[i].Objects[k].X + ", " + lvls[i].Objects[k].Y + ")", Color.Red);
|
||||
}*/
|
||||
}
|
||||
//for (int k = 0; k < lvls[i].Rooms.Count; k++) Form1_0.method_1("Rooms: " + lvls[i].Rooms[k].X + ", " + lvls[i].Rooms[k].Y + "(Size: " + lvls[i].Rooms[k].Width + ", " + lvls[i].Rooms[k].Height + ")", Color.Red);
|
||||
|
||||
//Form1_0.method_1("--------------------------", Color.Red);
|
||||
}
|
||||
|
||||
AllMapData = lvls;
|
||||
}
|
||||
}
|
||||
|
||||
public (List<NPC>, List<Level>, List<ObjectS>, List<Room>) NPCsExitsAndObjects(Position areaOrigin, Area a)
|
||||
{
|
||||
var npcs = new List<NPC>();
|
||||
var exits = new List<Level>();
|
||||
var objects = new List<ObjectS>();
|
||||
var rooms = new List<Room>();
|
||||
|
||||
ServerLevel level = GetLevel(a);
|
||||
|
||||
foreach (var r in level.Rooms)
|
||||
{
|
||||
rooms.Add(new Room
|
||||
{
|
||||
X = r.X,
|
||||
Y = r.Y,
|
||||
Width = r.Width,
|
||||
Height = r.Height
|
||||
});
|
||||
}
|
||||
|
||||
foreach (var obj in level.Objects)
|
||||
{
|
||||
switch (obj.Type)
|
||||
{
|
||||
case "npc":
|
||||
var n = new NPC
|
||||
{
|
||||
ID = obj.ID,
|
||||
Name = obj.Name,
|
||||
X = obj.X + areaOrigin.X,
|
||||
Y = obj.Y + areaOrigin.Y
|
||||
};
|
||||
npcs.Add(n);
|
||||
break;
|
||||
case "exit":
|
||||
var lvl = new Level
|
||||
{
|
||||
Area = int.Parse(obj.ID),
|
||||
//X = obj.X + areaOrigin.X,
|
||||
//Y = obj.Y + areaOrigin.Y,
|
||||
Position = new Position
|
||||
{
|
||||
X = obj.X + areaOrigin.X,
|
||||
Y = obj.Y + areaOrigin.Y
|
||||
},
|
||||
IsEntrance = true
|
||||
};
|
||||
exits.Add(lvl);
|
||||
break;
|
||||
case "object":
|
||||
var o = new ObjectS
|
||||
{
|
||||
Name = obj.Name,
|
||||
//Name = (object.Name)obj.ID,
|
||||
//X = obj.X + areaOrigin.X,
|
||||
//Y = obj.Y + areaOrigin.Y
|
||||
Position = new Position
|
||||
{
|
||||
X = obj.X + areaOrigin.X,
|
||||
Y = obj.Y + areaOrigin.Y
|
||||
}
|
||||
};
|
||||
objects.Add(o);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var obj in level.Objects)
|
||||
{
|
||||
switch (obj.Type)
|
||||
{
|
||||
case "exit_area":
|
||||
bool found = false;
|
||||
foreach (var exit in exits)
|
||||
{
|
||||
if (exit.Area == int.Parse(obj.ID))
|
||||
{
|
||||
exit.IsEntrance = false;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
var lvl = new Level
|
||||
{
|
||||
Area = int.Parse(obj.ID),
|
||||
//X = obj.X + areaOrigin.X,
|
||||
//Y = obj.Y + areaOrigin.Y,
|
||||
Position = new Position
|
||||
{
|
||||
X = obj.X + areaOrigin.X,
|
||||
Y = obj.Y + areaOrigin.Y
|
||||
},
|
||||
IsEntrance = false
|
||||
};
|
||||
exits.Add(lvl);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (npcs, exits, objects, rooms);
|
||||
}
|
||||
|
||||
private string GetDifficultyAsNum(Difficulty df)
|
||||
{
|
||||
switch (df)
|
||||
{
|
||||
case Difficulty.Normal:
|
||||
return "0";
|
||||
case Difficulty.Nightmare:
|
||||
return "1";
|
||||
case Difficulty.Hell:
|
||||
return "2";
|
||||
default:
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
|
||||
public List<List<bool>> CollisionGrid(Area area)
|
||||
{
|
||||
ServerLevel level = GetLevel(area);
|
||||
|
||||
List<List<bool>> cg = new List<List<bool>>();
|
||||
|
||||
for (int y = 0; y < level.Size.Height; y++)
|
||||
{
|
||||
List<bool> row = new List<bool>();
|
||||
for (int x = 0; x < level.Size.Width; x++)
|
||||
{
|
||||
row.Add(false);
|
||||
}
|
||||
|
||||
// Documentation about how this works: https://github.com/blacha/diablo2/tree/master/packages/map
|
||||
if (level.Map.Count > y)
|
||||
{
|
||||
List<int> mapRow = level.Map[y];
|
||||
bool isWalkable = false;
|
||||
int xPos = 0;
|
||||
foreach (int xs in mapRow)
|
||||
{
|
||||
if (xs != 0)
|
||||
{
|
||||
for (int xOffset = 0; xOffset < xs; xOffset++)
|
||||
{
|
||||
row[xPos + xOffset] = isWalkable;
|
||||
}
|
||||
}
|
||||
isWalkable = !isWalkable;
|
||||
xPos += xs;
|
||||
}
|
||||
while (xPos < row.Count)
|
||||
{
|
||||
row[xPos] = isWalkable;
|
||||
xPos++;
|
||||
}
|
||||
}
|
||||
|
||||
cg.Add(row);
|
||||
}
|
||||
|
||||
return cg;
|
||||
//return cg.Select(r => r.ToArray()).ToArray();
|
||||
}
|
||||
|
||||
public Position Origin(Area area)
|
||||
{
|
||||
var level = GetLevel(area);
|
||||
|
||||
return new Position
|
||||
{
|
||||
X = level.Offset.X,
|
||||
Y = level.Offset.Y
|
||||
};
|
||||
}
|
||||
|
||||
public (LevelData, bool) GetLevelData(Area id)
|
||||
{
|
||||
foreach (var lvl in AllMapData)
|
||||
{
|
||||
if (lvl.ID == (int)id)
|
||||
{
|
||||
return (new LevelData
|
||||
{
|
||||
Area = lvl.ID,
|
||||
Name = lvl.Name,
|
||||
Offset = new Position
|
||||
{
|
||||
X = lvl.Offset.X,
|
||||
Y = lvl.Offset.Y
|
||||
},
|
||||
Size = new Position
|
||||
{
|
||||
X = lvl.Size.Width,
|
||||
Y = lvl.Size.Height
|
||||
},
|
||||
CollisionGrid = CollisionGrid((Area)lvl.ID)
|
||||
}, true);
|
||||
}
|
||||
}
|
||||
|
||||
return (new LevelData(), false);
|
||||
}
|
||||
|
||||
private ServerLevel GetLevel(Area area)
|
||||
{
|
||||
foreach (var level in AllMapData)
|
||||
{
|
||||
if (level.ID == (int)area)
|
||||
{
|
||||
return level;
|
||||
}
|
||||
}
|
||||
|
||||
return new ServerLevel();
|
||||
}
|
||||
|
||||
public class ServerLevel
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string Name { get; set; }
|
||||
public Size Size { get; set; }
|
||||
public Offset Offset { get; set; }
|
||||
public List<List<int>> Map { get; set; }
|
||||
public List<Room> Rooms { get; set; }
|
||||
public List<MapObject> Objects { get; set; }
|
||||
public string Type { get; set; }
|
||||
}
|
||||
|
||||
public class Offset
|
||||
{
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
}
|
||||
|
||||
public class Size
|
||||
{
|
||||
public int Width { get; set; }
|
||||
public int Height { get; set; }
|
||||
}
|
||||
|
||||
public class Room
|
||||
{
|
||||
public int Area { get; set; }
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
public int Width { get; set; }
|
||||
public int Height { get; set; }
|
||||
public bool Contain(int x, int y)
|
||||
{
|
||||
return x >= X && x < X + Width && y >= Y && y < Y + Height;
|
||||
}
|
||||
}
|
||||
|
||||
public class MapObject
|
||||
{
|
||||
public string Type { get; set; }
|
||||
public string ID { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
}
|
||||
|
||||
public class Position
|
||||
{
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
}
|
||||
|
||||
public class LevelData
|
||||
{
|
||||
public int Area { get; set; }
|
||||
public string Name { get; set; }
|
||||
public Position Offset { get; set; }
|
||||
public Position Size { get; set; }
|
||||
public List<List<bool>> CollisionGrid { get; set; }
|
||||
}
|
||||
|
||||
public class Level
|
||||
{
|
||||
public int Area { get; set; }
|
||||
public string Name { get; set; }
|
||||
//public int X { get; set; }
|
||||
//public int Y { get; set; }
|
||||
public Position Position { get; set; }
|
||||
public bool IsEntrance { get; set; }
|
||||
}
|
||||
|
||||
public class NPC
|
||||
{
|
||||
public string ID { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
}
|
||||
|
||||
public class ObjectS
|
||||
{
|
||||
public string ID { get; set; }
|
||||
public string Name { get; set; }
|
||||
//public int X { get; set; }
|
||||
//public int Y { get; set; }
|
||||
public Position Position { get; set; }
|
||||
}
|
||||
|
||||
public enum ObjectName
|
||||
{
|
||||
// Define your enum members here
|
||||
}
|
||||
}
|
||||
}
|
|
@ -57,6 +57,104 @@ namespace app
|
|||
MobsHP = GetHPFromStats();
|
||||
}
|
||||
|
||||
public List<Tuple<int, int>> GetAllMobsNearby()
|
||||
{
|
||||
Form1_0.PatternsScan_0.scanForUnitsPointer("NPC");
|
||||
|
||||
List<Tuple<int, int>> monsterPositions2 = new List<Tuple<int, int>>();
|
||||
|
||||
for (int i = 0; i < Form1_0.PatternsScan_0.AllNPCPointers.Count; i++)
|
||||
{
|
||||
MobsPointerLocation = Form1_0.PatternsScan_0.AllNPCPointers[i];
|
||||
if (MobsPointerLocation > 0)
|
||||
{
|
||||
mobsdatastruc = new byte[144];
|
||||
Form1_0.Mem_0.ReadRawMemory(MobsPointerLocation, ref mobsdatastruc, 144);
|
||||
txtFileNo = BitConverter.ToUInt32(mobsdatastruc, 4);
|
||||
long pStatsListExPtr = BitConverter.ToInt64(mobsdatastruc, 0x88);
|
||||
|
||||
bool isPlayerMinion = false;
|
||||
string playerMinion = getPlayerMinion((int)txtFileNo);
|
||||
if (playerMinion != "")
|
||||
{
|
||||
isPlayerMinion = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//; is a revive
|
||||
isPlayerMinion = ((Form1_0.Mem_0.ReadUInt32((IntPtr)(pStatsListExPtr + 0xAC8 + 0xc)) & 31) == 1);
|
||||
}
|
||||
|
||||
if (Form1_0.NPCStruc_0.HideNPC((int)txtFileNo) == 0
|
||||
&& Form1_0.NPCStruc_0.getTownNPC((int)txtFileNo) == ""
|
||||
&& !isPlayerMinion)
|
||||
{
|
||||
GetUnitPathData();
|
||||
GetStatsAddr();
|
||||
MobsHP = GetHPFromStats();
|
||||
|
||||
//byte[] RunBuf = BitConverter.GetBytes(709);
|
||||
//Form1_0.Mem_0.WriteRawMemory((IntPtr)(MobsPointerLocation + 0x04), RunBuf, 4);
|
||||
|
||||
//Console.WriteLine("found near mob" + txtFileNo + " at: " + itemx + ", " + itemy);
|
||||
//15089,5012
|
||||
if (xPosFinal != 0 && yPosFinal != 0)
|
||||
{
|
||||
if (MobsHP != 0) monsterPositions2.Add(Tuple.Create((int) xPosFinal, (int) yPosFinal));
|
||||
|
||||
|
||||
//get the mobs by name and type
|
||||
/*if (MobType == "getBossName")
|
||||
{
|
||||
if (getBossName((int)txtFileNo) == MobName)
|
||||
{
|
||||
if (!Nearest)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (MobType == "getPlayerMinion")
|
||||
{
|
||||
if (getPlayerMinion((int)txtFileNo) == MobName)
|
||||
{
|
||||
if (!Nearest)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (MobType == "getSuperUniqueName")
|
||||
{
|
||||
if (getSuperUniqueName((int)txtFileNo) == MobName)
|
||||
{
|
||||
if (!Nearest)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//load nearest mobs
|
||||
/*if (Nearest && NearestMobPointer != 0)
|
||||
{
|
||||
MobsPointerLocation = NearestMobPointer;
|
||||
mobsdatastruc = new byte[144];
|
||||
Form1_0.Mem_0.ReadRawMemory(MobsPointerLocation, ref mobsdatastruc, 144);
|
||||
txtFileNo = BitConverter.ToUInt32(mobsdatastruc, 4);
|
||||
GetUnitPathData();
|
||||
GetStatsAddr();
|
||||
MobsHP = GetHPFromStats();
|
||||
return true;
|
||||
}*/
|
||||
|
||||
return monsterPositions2;
|
||||
}
|
||||
|
||||
public bool GetMobs(string MobType, string MobName, bool Nearest, int MaxMobDistance, List<long> IgnoredListPointers)
|
||||
{
|
||||
txtFileNo = 0;
|
||||
|
|
|
@ -128,6 +128,158 @@ namespace app
|
|||
return "";
|
||||
}
|
||||
|
||||
public string getNPC_ID(int txtFileNo)
|
||||
{
|
||||
switch (txtFileNo)
|
||||
{
|
||||
case 156: return "Andariel";
|
||||
case 211: return "Duriel";
|
||||
case 229: return "Radament";
|
||||
case 242: return "Mephisto";
|
||||
case 243: return "Diablo";
|
||||
case 250: return "Summoner";
|
||||
case 256: return "Izual";
|
||||
case 267: return "Bloodraven";
|
||||
case 333: return "Diabloclone";
|
||||
case 365: return "Griswold";
|
||||
case 526: return "Nihlathak";
|
||||
case 544: return "Baal";
|
||||
case 570: return "Baalclone";
|
||||
case 702: return "BaalThrone";
|
||||
case 704: return "Uber Mephisto";
|
||||
case 705: return "Uber Diablo";
|
||||
case 706: return "Uber Izual";
|
||||
case 707: return "Uber Andariel";
|
||||
case 708: return "Uber Duriel";
|
||||
case 709: return "Uber Baal";
|
||||
|
||||
case 271: return "roguehire";
|
||||
//case 338: return "act2hire";
|
||||
case 359: return "act3hire";
|
||||
case 560: return "act5hire1";
|
||||
case 561: return "act5hire2";
|
||||
case 289: return "ClayGolem";
|
||||
case 290: return "BloodGolem";
|
||||
case 291: return "IronGolem";
|
||||
case 292: return "FireGolem";
|
||||
case 363: return "NecroSkeleton";
|
||||
case 364: return "NecroMage";
|
||||
case 417: return "ShadowWarrior";
|
||||
case 418: return "ShadowMaster";
|
||||
case 419: return "DruidHawk";
|
||||
case 420: return "DruidSpiritWolf";
|
||||
case 421: return "DruidFenris";
|
||||
case 423: return "HeartOfWolverine";
|
||||
case 424: return "OakSage";
|
||||
case 428: return "DruidBear";
|
||||
case 357: return "Valkyrie";
|
||||
//case 359: return "IronWolf";
|
||||
|
||||
case 0: return "Bonebreak";
|
||||
case 5: return "Corpsefire";
|
||||
case 11: return "Pitspawn Fouldog";
|
||||
case 20: return "Rakanishu";
|
||||
case 24: return "Treehead WoodFist";
|
||||
case 31: return "Fire Eye";
|
||||
case 45: return "The Countess";
|
||||
case 47: return "Sarina the Battlemaid";
|
||||
case 62: return "Baal Subject 1";
|
||||
case 66: return "Flamespike the Crawler";
|
||||
case 75: return "Fangskin";
|
||||
case 83: return "Bloodwitch the Wild";
|
||||
case 92: return "Beetleburst";
|
||||
case 97: return "Leatherarm";
|
||||
case 103: return "Ancient Kaa the Soulless";
|
||||
case 105: return "Baal Subject 2";
|
||||
case 120: return "The Tormentor";
|
||||
case 125: return "Web Mage the Burning";
|
||||
case 129: return "Stormtree";
|
||||
case 138: return "Icehawk Riftwing";
|
||||
case 160: return "Coldcrow";
|
||||
case 276: return "Boneash";
|
||||
case 281: return "Witch Doctor Endugu";
|
||||
case 284: return "Coldworm the Burrower";
|
||||
case 299: return "Taintbreeder";
|
||||
case 306: return "Grand Vizier of Chaos";
|
||||
case 308: return "Riftwraith the Cannibal";
|
||||
case 312: return "Lord De Seis";
|
||||
// case 345: return "Council Member";
|
||||
// case 346: return "Council Member";
|
||||
// case 347: return "Council Member";
|
||||
case 362: return "Winged Death";
|
||||
case 402: return "The Smith";
|
||||
case 409: return "The Feature Creep";
|
||||
case 437: return "Bonesaw Breaker";
|
||||
case 440: return "Pindleskin";
|
||||
case 443: return "Threash Socket";
|
||||
case 449: return "Frozenstein";
|
||||
case 453: return "Megaflow Rectifier";
|
||||
case 472: return "Anodized Elite";
|
||||
case 475: return "Vinvear Molech";
|
||||
case 479: return "Siege Boss";
|
||||
case 481: return "Sharp Tooth Sayer";
|
||||
case 494: return "Dac Farren";
|
||||
case 496: return "Magma Torquer";
|
||||
case 501: return "Snapchip Shatter";
|
||||
case 508: return "Axe Dweller";
|
||||
case 529: return "Eyeback Unleashed";
|
||||
case 533: return "Blaze Ripper";
|
||||
case 540: return "Ancient Barbarian 1";
|
||||
case 541: return "Ancient Barbarian 2";
|
||||
case 542: return "Ancient Barbarian 3";
|
||||
case 557: return "Baal Subject 3";
|
||||
case 558: return "Baal Subject 4";
|
||||
case 571: return "Baal Subject 5";
|
||||
case 735: return "The Cow King";
|
||||
case 736: return "Dark Elder";
|
||||
|
||||
case 146: return "DeckardCain";
|
||||
case 154: return "Charsi";
|
||||
case 147: return "Gheed";
|
||||
case 150: return "Kashya";
|
||||
case 155: return "Warriv";
|
||||
case 148: return "Akara";
|
||||
case 244: return "DeckardCain";
|
||||
case 210: return "Meshif";
|
||||
case 175: return "Warriv";
|
||||
case 199: return "Elzix";
|
||||
case 198: return "Greiz";
|
||||
case 177: return "Drognan";
|
||||
case 178: return "Fara";
|
||||
case 201: return "Jerhyn";
|
||||
case 202: return "Lysander";
|
||||
case 176: return "Atma";
|
||||
case 200: return "Geglash";
|
||||
case 331: return "Kaelan";
|
||||
case 245: return "DeckardCain";
|
||||
case 264: return "Meshif";
|
||||
case 255: return "Ormus";
|
||||
case 252: return "Asheara";
|
||||
case 254: return "Alkor";
|
||||
case 253: return "Hratli";
|
||||
case 297: return "Natalya";
|
||||
case 246: return "DeckardCain";
|
||||
case 251: return "Tyrael";
|
||||
case 338: return "DeadCorpse";
|
||||
case 367: return "Tyrael";
|
||||
case 521: return "Tyrael";
|
||||
case 257: return "Halbu";
|
||||
case 405: return "Jamella";
|
||||
case 265: return "DeckardCain";
|
||||
case 520: return "DeckardCain";
|
||||
case 512: return "Anya";
|
||||
case 527: return "Anya";
|
||||
case 515: return "Qual-Kehk";
|
||||
case 513: return "Malah";
|
||||
case 511: return "Larzuk";
|
||||
case 514: return "Nihlathak Town";
|
||||
case 266: return "navi";
|
||||
case 408: return "Malachai";
|
||||
case 406: return "Izual";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/*public bool IsDeadBody(int txtFileNo)
|
||||
{
|
||||
if (txtFileNo == 338)
|
||||
|
|
|
@ -132,9 +132,11 @@ namespace app
|
|||
{
|
||||
if (getObjectName((int)txtFileNo) == ObjectType && !IsIgnoredID(IgnoredIDList))
|
||||
{
|
||||
//Form1_0.method_1("OBJ POS: " + itemx + ", " + itemy + " - " + getObjectName((int)txtFileNo));
|
||||
Form1_0.method_1("OBJ POS: " + itemx + ", " + itemy + " - " + getObjectName((int)txtFileNo), Color.DarkOrchid);
|
||||
if (itemx != 0 && itemy != 0)
|
||||
{
|
||||
//Form1_0.method_1("OBJ POS: " + itemx + ", " + itemy + " - " + getObjectName((int)txtFileNo), Color.DarkOrchid);
|
||||
|
||||
SetNearestObject(Nearest);
|
||||
if (!Nearest)
|
||||
{
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Drawing;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using static app.Enums;
|
||||
|
||||
namespace app
|
||||
|
@ -33,6 +34,7 @@ namespace app
|
|||
//public int ScanUnitsNumber = 3000;
|
||||
public int ScanUnitsNumber = 2600;
|
||||
//public int ScanUnitsNumber = 2200;
|
||||
//public int ScanUnitsNumber = 6000;
|
||||
public int ScanUnitsNegativeOffset = 128;
|
||||
|
||||
public void SetForm1(Form1 form1_1)
|
||||
|
@ -200,9 +202,20 @@ namespace app
|
|||
Form1_0.offsets["rosterOffset"] = rosterOffset;
|
||||
Form1_0.method_1("Roster offset: 0x" + rosterOffset.ToString("X"), Color.Black);
|
||||
|
||||
//#################################################################################################
|
||||
/*All games available offset: 0x2A31EF0
|
||||
Selected game offset: 0x2A40400
|
||||
Selected Char offset: 0x2A2DAD0*/
|
||||
Form1_0.offsets["AllGamesOffset"] = ((IntPtr) 0x2A31EF0);
|
||||
Form1_0.method_1("All games available offset: 0x" + 0x2A31EF0.ToString("X"), Color.Black);
|
||||
Form1_0.offsets["GameSelectedOffset"] = ((IntPtr)0x2A40400);
|
||||
Form1_0.method_1("Selected game offset: 0x" + 0x2A40400.ToString("X"), Color.Black);
|
||||
Form1_0.offsets["SelectedChar"] = ((IntPtr)0x2A2DAD0);
|
||||
Form1_0.method_1("Selected Char offset: 0x" + 0x2A2DAD0.ToString("X"), Color.Black);
|
||||
|
||||
/*
|
||||
//; all games datas
|
||||
pattern = "A8 29 52 8E F7 7F 00";
|
||||
pattern = "F8 1E 8B 9F F7 7F 00";
|
||||
patternAddress = (IntPtr)(modulePatternScan(pattern) + 16);
|
||||
//patternAddress = modulePatternScan(pattern);
|
||||
//IntPtr GameTable = (IntPtr)Form1_0.Mem_0.ReadInt(patternAddress + 6);
|
||||
|
@ -210,14 +223,27 @@ namespace app
|
|||
Form1_0.method_1("All games available offset: 0x" + patternAddress.ToString("X"), Color.Black);
|
||||
|
||||
//; game selected data
|
||||
pattern = "01 8D 14 51 F7 E2 42";
|
||||
patternAddress = modulePatternScan(pattern);
|
||||
IntPtr GameTable = (IntPtr)Form1_0.Mem_0.ReadInt(patternAddress + 7);
|
||||
//pattern = "01 8D 14 51 F7 E2 42";
|
||||
pattern = "08 04 8C 9F F7 7F 00";
|
||||
patternAddress = (IntPtr)(modulePatternScan(pattern) + 16);
|
||||
//patternAddress = modulePatternScan(pattern);
|
||||
//IntPtr GameTable = (IntPtr)Form1_0.Mem_0.ReadInt(patternAddress + 7);
|
||||
//pattern = "50 E4 0F 67 F6 7F 00";
|
||||
//patternAddress = (IntPtr)(modulePatternScan(pattern) + 64);
|
||||
//IntPtr unitTable = (IntPtr)Form1_0.Mem_0.ReadInt(patternAddress + 7);
|
||||
Form1_0.offsets["GameSelectedOffset"] = GameTable + 0x113;
|
||||
Form1_0.method_1("Selected game offset: 0x" + (GameTable + 0x113).ToString("X"), Color.Black);
|
||||
IntPtr GameTable = patternAddress;
|
||||
//Form1_0.offsets["GameSelectedOffset"] = GameTable + 0x113;
|
||||
//Form1_0.method_1("Selected game offset: 0x" + (GameTable + 0x113).ToString("X"), Color.Black);
|
||||
Form1_0.offsets["GameSelectedOffset"] = GameTable;
|
||||
Form1_0.method_1("Selected game offset: 0x" + (GameTable).ToString("X"), Color.Black);
|
||||
|
||||
//; selected char
|
||||
pattern = "D0 DA 8A 9F F7 7F 00";
|
||||
patternAddress = (IntPtr)(modulePatternScan(pattern) + 0x18);
|
||||
//patternAddress = modulePatternScan(pattern);
|
||||
//IntPtr GameTable = (IntPtr)Form1_0.Mem_0.ReadInt(patternAddress + 6);
|
||||
Form1_0.offsets["SelectedChar"] = patternAddress;
|
||||
Form1_0.method_1("Selected Char offset: 0x" + patternAddress.ToString("X"), Color.Black);*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -551,5 +577,5 @@ namespace app
|
|||
if (bytes >= OneTB) return $"{bytes / OneTB}";
|
||||
return "TOO BIG";
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ using System.Threading;
|
|||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml.Linq;
|
||||
using static app.Enums;
|
||||
using static System.Runtime.InteropServices.ComTypes.IStream;
|
||||
using static System.Windows.Forms.AxHost;
|
||||
|
||||
|
@ -31,9 +32,10 @@ namespace app
|
|||
public long mapSeedAddress = 0;
|
||||
public Int64 pathAddress = 0;
|
||||
public bool FoundPlayer = false;
|
||||
public bool PlayerDead = false;
|
||||
|
||||
public long pAct = 0;
|
||||
public uint mapSeed = 0;
|
||||
public uint mapSeedValue = 0;
|
||||
public ushort xPos = 0;
|
||||
public ushort yPos = 0;
|
||||
public ushort xPosOffset = 0;
|
||||
|
@ -85,6 +87,13 @@ namespace app
|
|||
public int HPPercentFromEquippedItems = 0;
|
||||
public int ManaPercentFromEquippedItems = 0;
|
||||
|
||||
public long HPFromPlayer = 0;
|
||||
public long ManaFromPlayer = 0;
|
||||
public long VitalityFromPlayer = 0;
|
||||
public long EnergyFromPlayer = 0;
|
||||
public long HPPercentFromPlayer = 0;
|
||||
public long ManaPercentFromPlayer = 0;
|
||||
|
||||
public int[] RoomExit = new int[2];
|
||||
|
||||
// REQUIRED METHODS
|
||||
|
@ -115,6 +124,20 @@ namespace app
|
|||
byte[] buffer = new byte[statCount * 8];
|
||||
Form1_0.Mem_0.ReadRawMemory(statPtr + 0x2, ref buffer, (int) (statCount * 8));
|
||||
|
||||
if (Form1_0.Town_0.IsInTown)
|
||||
{
|
||||
PlayerHP = PlayerMaxHP;
|
||||
if (PlayerHP == 0) PlayerHP = 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
//reset player hp
|
||||
PlayerHP = 0;
|
||||
|
||||
}
|
||||
|
||||
if (!Form1_0.GameStruc_0.IsInGame()) PlayerHP = PlayerMaxHP;
|
||||
|
||||
for (int i = 0; i < statCount; i++)
|
||||
{
|
||||
int offset = i * 8;
|
||||
|
@ -137,8 +160,41 @@ namespace app
|
|||
{
|
||||
PlayerGoldInStash = statValue;
|
||||
}
|
||||
//#####
|
||||
/*if (statEnum == (ushort)Enums.Attribute.Vitality)
|
||||
{
|
||||
VitalityFromPlayer = statValue;
|
||||
HPFromPlayer = statValue;
|
||||
}
|
||||
if (statEnum == (ushort)Enums.Attribute.LifeMax)
|
||||
{
|
||||
HPFromPlayer = (statValue >> 8);
|
||||
}
|
||||
if (statEnum == (ushort)Enums.Attribute.MaxHPPercent)
|
||||
{
|
||||
HPPercentFromPlayer = statValue;
|
||||
}
|
||||
if (statEnum == (ushort)Enums.Attribute.Energy)
|
||||
{
|
||||
EnergyFromPlayer = statValue;
|
||||
ManaFromPlayer = statValue;
|
||||
}
|
||||
if (statEnum == (ushort)Enums.Attribute.ManaMax)
|
||||
{
|
||||
ManaFromPlayer = (statValue >> 8);
|
||||
}
|
||||
if (statEnum == (ushort)Enums.Attribute.MaxManaPercent)
|
||||
{
|
||||
ManaPercentFromPlayer = statValue;
|
||||
}*/
|
||||
//#####
|
||||
}
|
||||
|
||||
//Console.WriteLine("gold: " + PlayerGoldInventory);
|
||||
|
||||
if (PlayerHP == 0) PlayerDead = true;
|
||||
else PlayerDead = false;
|
||||
|
||||
//; get the level number
|
||||
pRoom1Address = Form1_0.Mem_0.ReadInt64Raw((IntPtr)(pathAddress + 0x20));
|
||||
pRoom2Address = Form1_0.Mem_0.ReadInt64Raw((IntPtr)(pRoom1Address + 0x18));
|
||||
|
@ -154,32 +210,49 @@ namespace app
|
|||
Form1_0.HasPointers = false;
|
||||
}
|
||||
|
||||
//#####################################################################################################
|
||||
//#####################################################################################################
|
||||
//#####################################################################################################
|
||||
//; get the difficulty
|
||||
actAddress = Form1_0.Mem_0.ReadInt64Raw((IntPtr)(PlayerPointer + 0x20));
|
||||
//mapSeedAddress = actAddress + 0x1C;
|
||||
//mapSeed = Form1_0.Mem_0.ReadUInt32Raw((IntPtr)mapSeedAddress);
|
||||
long aActUnk2 = Form1_0.Mem_0.ReadInt64Raw((IntPtr)(actAddress + 0x78));
|
||||
difficulty = Form1_0.Mem_0.ReadUInt16Raw((IntPtr)(aActUnk2 + 0x830));
|
||||
|
||||
//; get the map seed
|
||||
/*long actMiscAddress = Form1_0.Mem_0.ReadInt64Raw((IntPtr)(actAddress + 0x78)); //0x0000023a64ed4780; 2449824630656
|
||||
uint dwInitSeedHash1 = Form1_0.Mem_0.ReadUInt32((IntPtr)(actMiscAddress + 0x840));
|
||||
uint dwInitSeedHash2 = Form1_0.Mem_0.ReadUInt32((IntPtr)(actMiscAddress + 0x844));
|
||||
uint dwEndSeedHash1 = Form1_0.Mem_0.ReadUInt32((IntPtr)(actMiscAddress + 0x868));
|
||||
long actMiscAddress = Form1_0.Mem_0.ReadInt64Raw((IntPtr)(actAddress + 0x78)); //0x0000023a64ed4780; 2449824630656
|
||||
uint dwInitSeedHash1 = Form1_0.Mem_0.ReadUInt32Raw((IntPtr)(actMiscAddress + 0x840));
|
||||
uint dwInitSeedHash2 = Form1_0.Mem_0.ReadUInt32Raw((IntPtr)(actMiscAddress + 0x844));
|
||||
uint dwEndSeedHash1 = Form1_0.Mem_0.ReadUInt32Raw((IntPtr)(actMiscAddress + 0x868));
|
||||
|
||||
if (dwInitSeedHash1 != lastdwInitSeedHash1 || dwInitSeedHash2 != lastdwInitSeedHash2 || mapSeed == 0)
|
||||
/*byte[] buffData = new byte[0x100];
|
||||
Form1_0.Mem_0.ReadRawMemory(actMiscAddress + 0x800, ref buffData, buffData.Length);
|
||||
string SavePathh = Form1_0.ThisEndPath + "DumpHashStruc";
|
||||
File.Create(SavePathh).Dispose();
|
||||
File.WriteAllBytes(SavePathh, buffData);*/
|
||||
|
||||
var mapSeed = GetMapSeed((uint)dwInitSeedHash1, (uint)dwEndSeedHash1);
|
||||
if (!mapSeed.Item2)
|
||||
{
|
||||
mapSeed = calculateMapSeed(dwInitSeedHash1, dwInitSeedHash2, dwEndSeedHash1);
|
||||
lastdwInitSeedHash1 = dwInitSeedHash1;
|
||||
lastdwInitSeedHash2 = dwInitSeedHash2;
|
||||
}*/
|
||||
//; mapSeed = d2rprocess.read(actMiscAddress + 0x840, "UInt")
|
||||
throw new Exception("Error calculating map seed");
|
||||
}
|
||||
|
||||
|
||||
mapSeedValue = mapSeed.Item1;
|
||||
|
||||
//Form1_0.method_1("SEED: " + mapSeed.Item1.ToString(), Color.Red);
|
||||
//Form1_0.method_1("Difficulty: " + ((Difficulty) difficulty).ToString(), Color.Red);
|
||||
//Form1_0.GetMapData(mapSeed.Item1.ToString(), (Difficulty) difficulty);
|
||||
//#####################################################################################################
|
||||
//#####################################################################################################
|
||||
//#####################################################################################################
|
||||
|
||||
//get player name
|
||||
PlayerNamePointer = Form1_0.Mem_0.ReadInt64Raw((IntPtr)(PlayerPointer + 0x10));
|
||||
pName = Form1_0.Mem_0.ReadMemString(PlayerNamePointer);
|
||||
//Form1_0.Potions_0.CheckHPAndManaMax(); //not used here
|
||||
|
||||
SetMaxHPAndMana();
|
||||
|
||||
Form1_0.Grid_SetInfos("Cords", xPosFinal + "," + yPosFinal);
|
||||
Form1_0.Grid_SetInfos("Life", PlayerHP + "/" + PlayerMaxHP);
|
||||
Form1_0.Grid_SetInfos("Mana", PlayerMana + "/" + PlayerMaxMana);
|
||||
|
@ -192,6 +265,57 @@ namespace app
|
|||
//DownloadImage(GetImageURL());
|
||||
}
|
||||
|
||||
private const int MapHashDivisor = 1 << 16;
|
||||
|
||||
// Logic stolen from MapAssist, credits to them
|
||||
public static (uint, bool) GetMapSeed(uint initHashSeed, uint endHashSeed)
|
||||
{
|
||||
uint gameSeedXor = 0;
|
||||
var (seed, found) = ReverseMapSeedHash(endHashSeed);
|
||||
if (found)
|
||||
{
|
||||
gameSeedXor = initHashSeed ^ seed;
|
||||
}
|
||||
|
||||
if (gameSeedXor == 0)
|
||||
{
|
||||
return (0, false);
|
||||
}
|
||||
|
||||
return (seed, true);
|
||||
}
|
||||
|
||||
private static (uint, bool) ReverseMapSeedHash(uint hash)
|
||||
{
|
||||
uint incrementalValue = 1;
|
||||
|
||||
for (uint startValue = 0; startValue < uint.MaxValue; startValue += incrementalValue)
|
||||
{
|
||||
uint seedResult = (startValue * 0x6AC690C5 + 666) & 0xFFFFFFFF;
|
||||
|
||||
if (seedResult == hash)
|
||||
{
|
||||
return (startValue, true);
|
||||
}
|
||||
|
||||
if (incrementalValue == 1 && (seedResult % MapHashDivisor) == (hash % MapHashDivisor))
|
||||
{
|
||||
incrementalValue = (uint)MapHashDivisor;
|
||||
}
|
||||
}
|
||||
|
||||
return (0, false);
|
||||
}
|
||||
|
||||
public bool ShouldSeeShopForHP()
|
||||
{
|
||||
if (((Form1_0.PlayerScan_0.PlayerHP * 100) / Form1_0.PlayerScan_0.PlayerMaxHP) <= 80)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void SetMaxHPAndMana()
|
||||
{
|
||||
byte[] buffer = new byte[statCount * 8];
|
||||
|
@ -219,6 +343,13 @@ namespace app
|
|||
PlayerMaxHP = PlayerMaxHP + HPFromEquippedItems + (VitalityFromEquippedItems * 2) + (int)PercentHPAdd; //might be only for paladin
|
||||
PlayerMaxMana = PlayerMaxMana + ManaFromEquippedItems + (EnergyFromEquippedItems / 2) + (int)PercentManaAdd; //might be only for paladin
|
||||
|
||||
|
||||
/*double PercentHPAdd2 = Math.Ceiling(((double)HPPercentFromPlayer * (double)PlayerMaxHP) / 100);
|
||||
PlayerMaxHP = PlayerMaxHP + (int)PercentHPAdd2;
|
||||
|
||||
double PercentManaAdd2 = Math.Ceiling(((double)ManaPercentFromPlayer * (double)PlayerMaxMana) / 100);
|
||||
PlayerMaxMana = PlayerMaxMana + (int)PercentManaAdd2;*/
|
||||
|
||||
if (PlayerHP > PlayerMaxHP) PlayerMaxHP = PlayerHP;
|
||||
if (PlayerMana > PlayerMaxMana) PlayerMaxMana = PlayerMana;
|
||||
}
|
||||
|
@ -247,6 +378,9 @@ namespace app
|
|||
LeechPosX = (int) Form1_0.Mem_0.ReadUInt32Raw((IntPtr) (LeechPlayerPointer + 0x60));
|
||||
LeechPosY = (int) Form1_0.Mem_0.ReadUInt32Raw((IntPtr) (LeechPlayerPointer + 0x64));
|
||||
LeechlevelNo = Form1_0.Mem_0.ReadUInt16Raw((IntPtr)(LeechPlayerPointer + 0x5C));
|
||||
|
||||
Form1_0.Grid_SetInfos("LeechCords", LeechPosX + "," + LeechPosY);
|
||||
|
||||
//plevel = d2rprocess.read(partyStruct + 0x58, "UShort");
|
||||
//partyId = d2rprocess.read(partyStruct + 0x5A, "UShort");
|
||||
//hostilePtr = d2rprocess.read(partyStruct + 0x70, "Int64");
|
||||
|
@ -262,7 +396,7 @@ namespace app
|
|||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
string name = Form1_0.Mem_0.ReadMemString(partyStruct);
|
||||
if (name == Form1_0.GameStruc_0.GameOwnerName)
|
||||
if (name.ToLower() == Form1_0.GameStruc_0.GameOwnerName.ToLower())
|
||||
{
|
||||
LeechPlayerUnitID = Form1_0.Mem_0.ReadUInt32Raw((IntPtr)(partyStruct + 0x48));
|
||||
LeechPlayerPointer = partyStruct;
|
||||
|
@ -317,7 +451,8 @@ namespace app
|
|||
Form1_0.Mem_0.ReadRawMemory(UnitPointerLocation, ref itemdatastruc, 144);
|
||||
|
||||
// Do ONLY UnitType:0 && TxtFileNo:3
|
||||
if (BitConverter.ToUInt32(itemdatastruc, 0) == 0 && BitConverter.ToUInt32(itemdatastruc, 4) == 3)
|
||||
//if (BitConverter.ToUInt32(itemdatastruc, 0) == 0 && BitConverter.ToUInt32(itemdatastruc, 4) == 3)
|
||||
if (BitConverter.ToUInt32(itemdatastruc, 0) == 0)
|
||||
{
|
||||
PlayerStrucCount++;
|
||||
//Form1_0.method_1("PPointerLocation: 0x" + (UnitPointerLocation).ToString("X"));
|
||||
|
@ -335,7 +470,10 @@ namespace app
|
|||
}
|
||||
}
|
||||
//name = name.Replace("?", "");
|
||||
//Form1_0.method_1("PNAME: " + name);
|
||||
//Form1_0.method_1("PNAME: " + name, Color.Red);
|
||||
|
||||
//Console.WriteLine(BitConverter.ToUInt32(itemdatastruc, 0));
|
||||
//Console.WriteLine(BitConverter.ToUInt32(itemdatastruc, 4));
|
||||
|
||||
long ppath = BitConverter.ToInt64(itemdatastruc, 0x38);
|
||||
byte[] ppathData = new byte[144];
|
||||
|
@ -344,11 +482,12 @@ namespace app
|
|||
//if posX equal not zero
|
||||
if (BitConverter.ToInt16(ppathData, 2) != 0 && name == CharConfig.PlayerCharName)
|
||||
{
|
||||
Form1_0.method_1("------------------------------------------", Color.DarkBlue);
|
||||
PlayerPointer = UnitPointerLocation;
|
||||
Form1_0.Grid_SetInfos("Pointer", "0x" + PlayerPointer.ToString("X"));
|
||||
FoundPlayer = true;
|
||||
unitId = BitConverter.ToUInt32(itemdatastruc, 0x08);
|
||||
Form1_0.method_1("Player ID: 0x" + unitId.ToString("X"), Color.Black);
|
||||
Form1_0.method_1("Player ID: 0x" + unitId.ToString("X"), Color.DarkBlue);
|
||||
|
||||
/*string SavePathh = Form1_0.ThisEndPath + "DumpPlayerStruc";
|
||||
File.Create(SavePathh).Dispose();
|
||||
|
@ -413,6 +552,7 @@ namespace app
|
|||
}
|
||||
}
|
||||
pNameOther = name;
|
||||
|
||||
IsCorpse = false;
|
||||
if (Form1_0.Mem_0.ReadByteRaw((IntPtr)(PlayerPointer + 0x1A6)) == 1)
|
||||
{
|
||||
|
@ -432,6 +572,8 @@ namespace app
|
|||
}
|
||||
if (ThisPlayerName != "")
|
||||
{
|
||||
//Form1_0.method_1("TEST player corpse scan name: " + ThisPlayerName + "|" + IsCorpse, Color.OrangeRed);
|
||||
|
||||
if (pNameOther == ThisPlayerName)
|
||||
{
|
||||
if (!GetCorpseOnly || (GetCorpseOnly && IsCorpse))
|
||||
|
@ -457,6 +599,8 @@ namespace app
|
|||
int AddedHPPercent = 0;
|
||||
int AddedManaPercent = 0;
|
||||
|
||||
//item_maxmana_percent ln34 item_maxhp_percent ln34 skill_staminapercent
|
||||
|
||||
if (Form1_0.ItemsStruc_0.statCount > 0)
|
||||
{
|
||||
for (int i = 0; i < Form1_0.ItemsStruc_0.statCount; i++)
|
||||
|
@ -541,107 +685,5 @@ namespace app
|
|||
ManaPercentFromEquippedItems += AddedManaPercent;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//#####################################################################
|
||||
//#####################################################################
|
||||
//#####################################################################
|
||||
|
||||
/*public void SetPlayerPos(ushort atX, ushort atY)
|
||||
{
|
||||
byte[] bytesposx = BitConverter.GetBytes(atX);
|
||||
byte[] bytesposy = BitConverter.GetBytes(atY);
|
||||
Form1_0.Mem_0.WriteRawMemory((IntPtr)(pathAddress + 0x02), bytesposx, 2);
|
||||
Form1_0.Mem_0.WriteRawMemory((IntPtr)(pathAddress + 0x06), bytesposy, 2);
|
||||
Thread.Sleep(1);
|
||||
}
|
||||
|
||||
public uint calculateMapSeed(uint InitSeedHash1, uint InitSeedHash2, uint EndSeedHash1)
|
||||
{
|
||||
uint mapSeedTest = get_seed(InitSeedHash1, InitSeedHash2, EndSeedHash1);
|
||||
if (mapSeedTest == 0)
|
||||
{
|
||||
Form1_0.method_1("ERRROR: YOU HAVE AN ERROR DEECRYPTING THE MAP SEED, YOUR MAPS WILL EITHER NOT APPEAR OR NOT LINE UP", Color.Red);
|
||||
}
|
||||
return mapSeedTest;
|
||||
}*/
|
||||
|
||||
public string GetImageURL()
|
||||
{
|
||||
string baseUrl = "http://localhost:3002";
|
||||
double wallThickness = 1.2;
|
||||
int serverScale = 3;
|
||||
string imageUrl = baseUrl + "/v1/map/" + mapSeed + "/" + difficulty + "/" + levelNo + "/image?wallthickness=" + wallThickness;
|
||||
imageUrl = imageUrl + "&rotate=true&showTextLabels=false";
|
||||
imageUrl = imageUrl + "&padding=0"; //+ settings["padding"];
|
||||
imageUrl = imageUrl + "&noStitch=true"; //+ settings["padding"];
|
||||
imageUrl = imageUrl + "&edge=true";
|
||||
/*if (settings["showPathFinding"])
|
||||
{
|
||||
if (pathStart && pathEnd)
|
||||
{
|
||||
imageUrl = imageUrl + "&pathFinding=true";
|
||||
imageUrl = imageUrl + "&pathStart=" + pathStart;
|
||||
imageUrl = imageUrl + "&pathEnd=" + pathEnd;
|
||||
imageUrl = imageUrl + "&pathColour=" + settings["pathFindingColour"];
|
||||
}
|
||||
}*/
|
||||
imageUrl = imageUrl + "&serverScale=" + serverScale;
|
||||
imageUrl = imageUrl.Replace(",", ".");
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
public string getFileName()
|
||||
{
|
||||
return Form1_0.ThisEndPath + "\\maps\\" + this.mapSeed + "_" + this.difficulty + "_" + this.levelNo + ".png";
|
||||
}
|
||||
|
||||
//delegate int ReadDelegate(IntPtr pIStream, IntPtr buffer, uint cb, out IntPtr pcbRead);
|
||||
//ReadDelegate Read = (ReadDelegate)Marshal.GetDelegateForFunctionPointer(Marshal.ReadIntPtr(Marshal.GetComInterfaceForObject(pIStream, typeof(IStream)), 0), typeof(ReadDelegate));
|
||||
//IntPtr pcbRead;
|
||||
|
||||
public void DownloadImage(string imageUrl)
|
||||
{
|
||||
int tries = 0;
|
||||
while (tries < 5)
|
||||
{
|
||||
tries++;
|
||||
try
|
||||
{
|
||||
dynamic whr = Activator.CreateInstance(Type.GetTypeFromProgID("WinHttp.WinHttpRequest.5.1"));
|
||||
whr.SetTimeouts(45000, 45000, 45000, 45000);
|
||||
whr.Open("GET", imageUrl, true);
|
||||
whr.Send();
|
||||
whr.WaitForResponse();
|
||||
dynamic vStream = whr.ResponseStream;
|
||||
Console.WriteLine("PASSED");
|
||||
string sFile2 = getFileName();
|
||||
if (vStream.GetType().Equals(typeof(System.Runtime.InteropServices.UnknownWrapper)))
|
||||
{
|
||||
Stream pIStream = vStream.QueryInterface(Type.GetTypeFromCLSID(new Guid("0000000c-0000-0000-C000-000000000046")));
|
||||
using (FileStream oFile = new FileStream(sFile, FileMode.Create))
|
||||
{
|
||||
byte[] buffer = new byte[8192];
|
||||
var br = new BinaryReader(pIStream);
|
||||
buffer = br.ReadBytes((int)br.BaseStream.Length);
|
||||
//buffer = br.ReadBytes((int)buffer.Length);
|
||||
oFile.Write(buffer, 0, buffer.Length);
|
||||
}
|
||||
Marshal.ReleaseComObject(pIStream);
|
||||
}
|
||||
this.sFile = sFile2;
|
||||
//this.ParseHeaders(whr.GetAllResponseHeaders());
|
||||
|
||||
if (!string.IsNullOrEmpty(whr.GetAllResponseHeaders()))
|
||||
{
|
||||
break; // don't retry if headers found
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Form1_0.method_1("ERRROR:" + e.Message, Color.Red);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,29 +73,33 @@ namespace app
|
|||
|
||||
public void AddStashItem(int PosX, int PosY, int StashNumber)
|
||||
{
|
||||
int AtI = ConvertXYToFullIndex(PosX, PosY);
|
||||
if (StashNumber == 1)
|
||||
try
|
||||
{
|
||||
Stash1_ItemTxtNoList[AtI] = Form1_0.ItemsStruc_0.txtFileNo;
|
||||
}
|
||||
if (StashNumber == 2)
|
||||
{
|
||||
Stash2_ItemTxtNoList[AtI] = Form1_0.ItemsStruc_0.txtFileNo;
|
||||
}
|
||||
if (StashNumber == 3)
|
||||
{
|
||||
Stash3_ItemTxtNoList[AtI] = Form1_0.ItemsStruc_0.txtFileNo;
|
||||
}
|
||||
if (StashNumber == 4)
|
||||
{
|
||||
Stash4_ItemTxtNoList[AtI] = Form1_0.ItemsStruc_0.txtFileNo;
|
||||
}
|
||||
int AtI = ConvertXYToFullIndex(PosX, PosY);
|
||||
if (StashNumber == 1)
|
||||
{
|
||||
Stash1_ItemTxtNoList[AtI] = Form1_0.ItemsStruc_0.txtFileNo;
|
||||
}
|
||||
if (StashNumber == 2)
|
||||
{
|
||||
Stash2_ItemTxtNoList[AtI] = Form1_0.ItemsStruc_0.txtFileNo;
|
||||
}
|
||||
if (StashNumber == 3)
|
||||
{
|
||||
Stash3_ItemTxtNoList[AtI] = Form1_0.ItemsStruc_0.txtFileNo;
|
||||
}
|
||||
if (StashNumber == 4)
|
||||
{
|
||||
Stash4_ItemTxtNoList[AtI] = Form1_0.ItemsStruc_0.txtFileNo;
|
||||
}
|
||||
|
||||
if (Form1_0.ItemsStruc_0.ItemNAAME == "Horadric Cube")
|
||||
{
|
||||
CubeIndex = AtI;
|
||||
CubeStashNumber = StashNumber;
|
||||
if (Form1_0.ItemsStruc_0.ItemNAAME == "Horadric Cube")
|
||||
{
|
||||
CubeIndex = AtI;
|
||||
CubeStashNumber = StashNumber;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
32
app.csproj
32
app.csproj
|
@ -53,8 +53,13 @@
|
|||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>.\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
|
@ -66,15 +71,27 @@
|
|||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Bots\Duriel.cs" />
|
||||
<Compile Include="Bots\Summoner.cs" />
|
||||
<Compile Include="Bots\Mephisto.cs" />
|
||||
<Compile Include="Bots\Baal.cs" />
|
||||
<Compile Include="Bots\Chaos.cs" />
|
||||
<Compile Include="Bots\CharConfig.cs" />
|
||||
<Compile Include="CharConfig.cs" />
|
||||
<Compile Include="Bots\Andariel.cs" />
|
||||
<Compile Include="Bots\Countess.cs" />
|
||||
<Compile Include="Bots\LowerKurast.cs" />
|
||||
<Compile Include="Bots\SettingsLoader.cs" />
|
||||
<Compile Include="SettingsLoader.cs" />
|
||||
<Compile Include="FormSettings.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FormSettings.Designer.cs">
|
||||
<DependentUpon>FormSettings.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Scripts\Battle.cs" />
|
||||
<Compile Include="Scripts\Cubing.cs" />
|
||||
<Compile Include="Scripts\Gamble.cs" />
|
||||
<Compile Include="Scripts\KeyMouse.cs" />
|
||||
<Compile Include="Scripts\MoveToPath.cs" />
|
||||
<Compile Include="Scripts\Mover.cs" />
|
||||
<Compile Include="Scripts\Potions.cs" />
|
||||
<Compile Include="Scripts\Repair.cs" />
|
||||
|
@ -105,12 +122,16 @@
|
|||
<Compile Include="Strucs\PlayerScan.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Strucs\MapAreaStruc.cs" />
|
||||
<Compile Include="Strucs\SkillsStruc.cs" />
|
||||
<Compile Include="Strucs\StashStruc.cs" />
|
||||
<Compile Include="Strucs\UIScan.cs" />
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="FormSettings.resx">
|
||||
<DependentUpon>FormSettings.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
|
@ -141,15 +162,10 @@
|
|||
<Content Include="CharSettings.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="ItemsPicker\craft.txt" />
|
||||
<Content Include="ItemsPicker\key.txt" />
|
||||
<Content Include="ItemsPicker\magic_rare.txt" />
|
||||
<Content Include="ItemsPicker\normal.txt" />
|
||||
<Content Include="ItemsPicker\set.txt" />
|
||||
<Content Include="ItemsPicker\unique.txt" />
|
||||
<Content Include="ItemsSettings.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Include="Resources\Application.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,28 @@
|
|||
//#######################################
|
||||
//SHORTCUT KEY TO START/STOP BOT
|
||||
//#######################################
|
||||
StartStopKey=101
|
||||
|
||||
//#######################################
|
||||
//BOT SETTINGS (USE ONLY CHAOS OR BAAL, NOT BOTH AT SAME TIME)
|
||||
//#######################################
|
||||
MaxGameTime=7
|
||||
RunMephistoScript=false
|
||||
RunAndarielScript=false
|
||||
RunCountessScript=false
|
||||
RunSummonerScript=false
|
||||
RunDurielScript=false
|
||||
RunChaosScript=false
|
||||
RunLowerKurastScript=true
|
||||
RunBaalLeechScript=false
|
||||
RunItemGrabScriptOnly=false
|
||||
|
||||
//#######################################
|
||||
//NOT IN GAME SCRIPT (SEARCH GAMES OR CREATE A NEW GAME)
|
||||
//#######################################
|
||||
RunChaosSearchGameScript=false
|
||||
RunBaalSearchGameScript=false
|
||||
RunGameMakerScript=true
|
||||
GameName=PUTNAMEHERE
|
||||
GamePass=33
|
||||
GameDifficulty=2
|
|
@ -0,0 +1,53 @@
|
|||
//#######################################
|
||||
//SKILLS KEYS SETTINGS (FOR PALADIN)
|
||||
//#######################################
|
||||
KeySkillAttack=F1
|
||||
KeySkillAura=F2
|
||||
KeySkillfastMoveAtTown=F9
|
||||
KeySkillfastMoveOutsideTown=F7
|
||||
KeySkillDefenseAura=F7
|
||||
KeySkillCastDefense=F5
|
||||
KeySkillLifeAura=F4
|
||||
|
||||
//#######################################
|
||||
//BELT SETTINGS HP-HP-MANA-FULL RV -> 0=HP,1=MANA,2=RV,3=FULL RV
|
||||
//#######################################
|
||||
BeltPotTypeToHave=0,0,1,3
|
||||
|
||||
//#######################################
|
||||
//INVENTORY SETTINGS -> IF EQUAL 0,WE CAN USE THIS SPOT FOR BOT
|
||||
//#######################################
|
||||
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
|
||||
}
|
||||
|
||||
//#######################################
|
||||
//SHARED STASH DUMMY ITEM -> PUT THIS DUMMY ITEM IN THE SPECIFIC SHARED STASH SO ITEMS DETECTION CORRECTLY APPLY TO THIS SHARED STASH
|
||||
//#######################################
|
||||
DummyItemSharedStash1=Key
|
||||
DummyItemSharedStash2=Scroll of Identify
|
||||
DummyItemSharedStash3=Scroll of Town Portal
|
||||
|
||||
//#######################################
|
||||
//PLAYER SETTINGS
|
||||
//#######################################
|
||||
PlayerCharName=YOURCHARNAME
|
||||
UseTeleport=true
|
||||
ChickenHP=22
|
||||
TakeHPPotUnder=85
|
||||
TakeRVPotUnder=35
|
||||
TakeManaPotUnder=15
|
||||
GambleAboveGoldAmount=500000
|
||||
GambleUntilGoldAmount=100000
|
||||
PlayerAttackWithRightHand=true
|
||||
KeysLocationInInventory=8,0
|
||||
|
||||
//#######################################
|
||||
//MERC SETTINGS
|
||||
//#######################################
|
||||
UsingMerc=false
|
||||
MercTakeHPPotUnder=40
|
|
@ -0,0 +1,155 @@
|
|||
//#######################################
|
||||
//UNIQUE ITEMS
|
||||
//#######################################
|
||||
//HELMS
|
||||
Grim Helm// Vampire Gaze
|
||||
Shako// Harlequin Crest
|
||||
Demonhead// Andariel's Visage
|
||||
Bone Visage// Giant Skull
|
||||
Spired Helm// Nightwing's Veil
|
||||
Corona// Crown of ages
|
||||
|
||||
//ARMORS
|
||||
Serpentskin Armor// Skin of the Vipermagi
|
||||
Mesh Armor// Shaftstop
|
||||
Sacred Armor// Tyrael's Might
|
||||
Dusk Shroud// Ormus' Robes
|
||||
|
||||
//Gloves
|
||||
Chain Gloves// Chance Guards
|
||||
Vampirebone Gloves// Dracul's Grasp
|
||||
Ogre Gauntlets// Steelrend
|
||||
|
||||
//Boots
|
||||
Scarabshell Boots// Sandstorm Trek
|
||||
Boneweave Boots// Marrowwalk
|
||||
War Boots// Gore Rider
|
||||
Myrmidon Greaves// Gore Rider or Shadow Dancer
|
||||
|
||||
//Belts
|
||||
War Belt// Thundergod's Vigor
|
||||
Spiderweb Sash// Arachnid Mesh
|
||||
Vampirefang Belt// Nosferatu's Coil
|
||||
Mithril Coil// Verdungo's Hearty Cord
|
||||
|
||||
//Paladin Shields
|
||||
Gilded Shield// Herald Of Zakarum
|
||||
Zakarum Shield// Herald Of Zakarum
|
||||
|
||||
//Sorceress Orbs
|
||||
Swirling Crystal// The Oculus
|
||||
Eldritch Orb// Eschuta's Temper
|
||||
Dimensional Shard// Death's Fathom
|
||||
|
||||
//Circlets
|
||||
Tiara// Kira's Guardian
|
||||
Diadem// Griffon's Eye
|
||||
|
||||
//Necromancer Shrunken Heads
|
||||
Hierophant Trophy// Homunculus
|
||||
|
||||
//Druid Pelts
|
||||
Totemic Mask// Jalal's Mane
|
||||
|
||||
//Barbarian Helms
|
||||
Slayer Guard// Arreat's Face
|
||||
Guardian Crown// Arreat's Face
|
||||
|
||||
//Others
|
||||
Grand Charm// Possible GHEED
|
||||
Ring// #### ID LATER ####
|
||||
Amulet// #### ID LATER ####
|
||||
Jewel// #### ID LATER #### -> Rainbow Facet
|
||||
|
||||
//#######################################
|
||||
//KEYS/GEMS/RUNES ITEMS
|
||||
//#######################################
|
||||
//El Rune
|
||||
Eld Rune
|
||||
Tir Rune
|
||||
Nef Rune
|
||||
Eth Rune
|
||||
Ith Rune
|
||||
Tal Rune
|
||||
Ral Rune
|
||||
Ort Rune
|
||||
Thul Rune
|
||||
Amn Rune
|
||||
Sol Rune
|
||||
Shael Rune
|
||||
Dol Rune
|
||||
Hel Rune
|
||||
Io Rune
|
||||
Lum Rune
|
||||
Ko Rune
|
||||
Fal Rune
|
||||
Lem Rune
|
||||
Pul Rune
|
||||
Um Rune
|
||||
Mal Rune
|
||||
Ist Rune
|
||||
Gul Rune
|
||||
Vex Rune
|
||||
Ohm Rune
|
||||
Lo Rune
|
||||
Sur Rune
|
||||
Ber Rune
|
||||
Jah Rune
|
||||
Cham Rune
|
||||
Zod Rune
|
||||
// ##### Keys ######################
|
||||
Key of Terror
|
||||
Key of Hate
|
||||
Key of Destruction
|
||||
// ##### Essences ######################
|
||||
Twisted Essence Of Suffering
|
||||
Charged Essence Of Hatred
|
||||
Burning Essence Of Terror
|
||||
Festering Essence Of Destruction
|
||||
Token Of Absolution
|
||||
// ##### Gems ######################
|
||||
Chipped Amethyst
|
||||
Chipped Topaz
|
||||
Chipped Sapphire
|
||||
Chipped Ruby
|
||||
Chipped Emerald
|
||||
Chipped Diamond
|
||||
|
||||
Flawed Amethyst
|
||||
Flawed Topaz
|
||||
Flawed Sapphire
|
||||
Flawed Ruby
|
||||
Flawed Emerald
|
||||
Flawed Diamond
|
||||
|
||||
//Amethyst
|
||||
//Topaz
|
||||
//Sapphire
|
||||
//Ruby
|
||||
//Emerald
|
||||
//Diamond
|
||||
|
||||
Flawless Amethyst
|
||||
Flawless Topaz
|
||||
Flawless Sapphire
|
||||
Flawless Ruby
|
||||
Flawless Emerald
|
||||
Flawless Diamond
|
||||
|
||||
Perfect Amethyst
|
||||
Perfect Topaz
|
||||
Perfect Sapphire
|
||||
Perfect Ruby
|
||||
Perfect Emerald
|
||||
Perfect Diamond
|
||||
|
||||
//#######################################
|
||||
//SET ITEMS
|
||||
//#######################################
|
||||
Lacquered Plate// Tal Rasha's Guardianship
|
||||
Death Mask// Tal Rasha's Horadric Crest
|
||||
Mesh Belt// Tal Rasha's Fine Spun Cloth
|
||||
Sacred Armor// Immortal King
|
||||
Heavy Bracers// Trang-Oul's Claws
|
||||
Winged Helm// Guillaume's Face
|
||||
Russet Armor// Aldur's Advance
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1 @@
|
|||
RunNumber=5
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue