This commit is contained in:
Bouletmarc 2024-04-06 03:04:26 -04:00 committed by GitHub
parent b6772f5635
commit 739ece1338
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
72 changed files with 20682 additions and 0 deletions

6
App.config Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

841
Enums.cs Normal file
View File

@ -0,0 +1,841 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace app
{
public static class Enums
{
public enum UnitType
{
Player = 0,
NPC = 1,
GameObject = 2,
Missile = 3,
Item = 4,
Warp = 5, // Room tile ?
Invalid = 6,
NotApplicable = 0xff,
}
public enum UnitVisibility
{
Invalid = 0, // No longer valid
OnScreen = 1, // Displayed on screen
InSight = 2, // Visible to the character
InProximity = 4, // In 2-4 screen range we get notified about
}
public enum Act
{
ActI = 0,
ActII = 1,
ActIII = 2,
ActIV = 3,
ActV = 4,
}
public static readonly Dictionary<string, int> ActLevels = new Dictionary<string, int>
{
{"ActI", 40},
{"ActII", 75},
{"ActIII", 103},
{"ActIV", 109},
{"ActV", 142},
};
/*public enum Diablo2Version
{
Classic = "Classic",
Resurrected = 'Resurrected',
PathOfDiablo = 'PathOfDiablo',
ProjectDiablo2 = 'ProjectDiablo2',
}*/
public enum WarpType
{
Act1WildernessToCaveCliffL = 0,
Act1WildernessToCaveCliffR = 1,
Act1WildernessToCaveFloorL = 2,
Act1WildernessToCaveFloorR = 3,
Act1CaveUp = 4,
Act1CaveDown = 5,
Act1GraveyardToCrypt1 = 6,
Act1GraveyardToCrypt2 = 7,
Act1CryptUp = 8,
Act1CryptDown = 9,
Act1WildernessToTower = 10,
Act1TowerToWilderness = 11,
Act1TowerToCrypt = 12,
Act1JailUp = 13,
Act1JailDown = 14,
Act1CathedralToCatacombs = 15,
Act1CatacombsToCathedral = 16,
Act1CatacombsUp = 17,
Act1CatacombsDown = 18,
Act2TownToSewerTrap = 19,
Act2TownToSewerDock = 20,
Act2SewerDockToTown = 21,
Act2SewerUp = 22,
Act2SewerDown = 23,
Act2TownToHarem = 24,
Act2HaremToTown = 25,
Act2HaremUp1 = 26,
Act2HaremUp2 = 27,
Act2HaremDown1 = 28,
Act2HaremDown2 = 29,
Act2BasementUp1 = 30,
Act2BasementUp2 = 31,
Act2BasementDown = 32,
Act2DesertToTombL1 = 33,
Act2DesertToTombL2 = 34,
Act2DesertToTombR1 = 35,
Act2DesertToTombR2 = 36,
Act2DesertToTombViper = 37,
Act2DesertToTombTal1 = 38,
Act2DesertToTombTal2 = 39,
Act2DesertToTombTal3 = 40,
Act2DesertToTombTal4 = 41,
Act2DesertToTombTal5 = 42,
Act2DesertToTombTal6 = 43,
Act2DesertToTombTal7 = 44,
Act2TombUp = 45,
Act2TombDown = 46,
Act2DesertToLair = 47,
Act2LairUp = 48,
Act2LairDown = 49,
Act2DesertToSewerTrap = 50,
Act3JungleToSpider = 51,
Act3SpiderToJungle = 52,
Act3JungleToDungeonFort = 53,
Act3JungleToDungeonHole = 54,
Act3DungeonUp = 55,
Act3DungeonDown = 56,
Act3KurastToSewer = 57,
Act3SewerUpL = 58,
Act3SewerUpR = 59,
Act3SewerDown = 60,
Act3KurastToTemple = 61,
Act3TempleUpL = 62,
Act3TempleUpR = 63,
Act3TravincalToMephisto = 64,
Act3MephistoUpL = 65,
Act3MephistoUpR = 66,
Act3MephistoDownL = 67,
Act3MephistoDownR = 68,
Act4MesaToLava = 69,
Act4LavaToMesa = 70,
//Expansion,
Act5BarricadeDownWall = 71,
Act5BarricadeDownFloor = 72,
Act5IceCavesUp = 73,
Act5IceCavesDown = 74,
Act5IceCavesDownFloor = 75,
Act5TempleEntrance = 76,
Act5TempleDown = 77,
Act5TempleUp = 78,
Act5MountainTopToIce = 79,
Act5MountainTopToBaal = 80,
Act5BaalTempleUp = 81,
Act5BaalTempleDown = 82,
}
public enum PlayerClass
{
Amazon = 0,
Sorceress = 1,
Necromancer = 2,
Paladin = 3,
Barbarian = 4,
Druid = 5,
Assassin = 6,
}
public enum NpcFlag
{
None = 0,
SuperUnique = 1 << 1,
Champion = 1 << 2,
Unique = 1 << 3,
Minion = 1 << 4,
Possessed = 1 << 5,
Ghostly = 1 << 6,
Multishot = 1 << 7,
}
/** Extra skills NPC's can have */
public enum NpcEnchant
{
RandomName = 1,
None = 0,
Strong = 5,
Fast = 6,
Cursed = 7,
MagicResist = 8,
Fire = 9,
Lightning = 17,
Cold = 18,
ManaBurn = 25,
Teleport = 26,
Spectral = 27,
StoneSkin = 28,
MultiShot = 29,
Aura = 30,
Quest = 22,
Ai = 34,
}
public enum ItemActionType
{
AddToGround = 0,
GroundToCursor = 1, // only sent if item goes to cursor (GS packet 0x0A removes item from ground)
DropToGround = 2,
OnGround = 3,
PutInContainer = 4,
RemoveFromContainer = 5,
Equip = 6,
/**
*Sent for the equipped item when changing from a two handed weapon to a single handed weapon or vice versa.
*The item must be equiped on the "empty" hand or a regular SwapBodyItem will be sent instead.
*Empty hand meaning left hand if currently wearing a two handed weapon or the empty hand if wearing a single hand item.
*The result will be the new item being equipped and the old going to cursor.
*/
IndirectlySwapBodyItem = 7,
UnEquip = 8,
SwapBodyItem = 9,
AddQuantity = 0x0a,
AddToShop = 0x0b,
RemoveFromShop = 0x0c,
SwapInContainer = 0x0d,
PutInBelt = 0x0e,
RemoveFromBelt = 0x0f,
SwapInBelt = 0x10,
/**
*Sent for the secondary hand's item going to inventory when changing from a dual item setup to a two handed weapon.
*/
AutoUnEquip = 0x11,
RemoveFromHireling = 0x12, // sent along with a 9d 08 packet... Also Item on cursor when entering game ?? MiscToCursor??
ItemInSocket = 0x13,
Unknown1 = 0x14,
UpdateStats = 0x15, // put item in socket; for each potion that drops in belt when lower one is removed...
Unknown2 = 0x16,
WeaponSwitch = 0x17,
Unknown3 = 129,
Unknown4 = 130,
}
public enum ItemCategory
{
Helm = 0,
Armor = 1,
/** Most weapons, including Crossbows */
Weapon = 5,
/** Bows (not crossbows), sometimes shield (if equipped in LeftHand?) */
Weapon2 = 6,
/** Shields can some sometimes be Weapon2... */
Shield = 7,
Unknown8 = 8,
/** Class specific items !? */
Special = 10,
Unknown11 = 11,
Unknown12 = 12,
Unknown13 = 13,
Unknown14 = 14,
/** BaseMiscItems and gloves, boots... */
Misc = 16,
}
public enum ItemDestination
{
Unspecified = 0,
Equipment = 1,
Belt = 2,
Ground = 3,
Cursor = 4,
Item = 6,
}
public enum ItemQuality
{
NotApplicable = 0,
Inferior = 1,
Normal = 2,
Superior = 3,
Magic = 4,
Set = 5,
Rare = 6,
Unique = 7,
Crafted = 8,
}
public enum ItemContainer
{
Equipment = 0x00, // Player or Merc Equipment
Ground = 0x01,
Inventory = 0x02,
TraderOffer = 0x04,
ForTrade = 0x06,
Cube = 0x08,
Stash = 0x0a,
Belt = 0x0c,
Item = 0x0e,
ArmorTab = 0x82,
WeaponTab1 = 0x84,
WeaponTab2 = 0x86,
MiscTab = 0x88,
}
public enum Attribute
{
Strength,
Energy,
Dexterity,
Vitality,
StatPointsRemaining,
SkillPointsRemaining,
Life,
LifeMax,
Mana,
ManaMax,
Stam,
StamMax,
CurrentLevel,
Experience,
GoldInPlayer,
GoldInStash,
EnhancedDefense,
EnhancedDamageMax,
EnhancedDamage,
AttackRating,
ChanceToBlock,
MinDamage,
MaxDamage,
SecondMinDamage,
SecMaxDamage,
DamagePercent,
ManaRecovery,
ManaRecoveryBonus,
StaminaRecoveryBonus,
LastExp,
NextExp,
Defense,
DefenseVsMissiles,
DefenseVsHth,
NormalDamageReduction,
MagicDamageReduction,
DamageReduced,
MagicResist,
MaxMagicResist,
FireResist,
MaxFireResist,
LightningResist,
MaxLightningResist,
ColdResist,
MaxColdResist,
PoisonResist,
MaxPoisonResist,
DamageAura,
FireMinDamage,
FireMaxDamage,
LightningMinDamage,
LightningMaxDamage,
MagicMinDamage,
MagicMaxDamage,
ColdMinDamage,
ColdMaxDamage,
ColdLength,
PoisonMinDamage,
PoisonMaxDamage,
PoisonLength,
LifeSteal,
LifeStealMax,
ManaSteal,
ManaStealMax,
StaminaDrainMinDamage,
StaminaDrainMaxDamage,
StunLength,
VelocityPercent,
AttackRate,
OtherAnimRate,
Quantity,
Value,
Durability,
MaxDurability,
HPRegen,
MaxDurabilityPercent,
MaxHPPercent,
MaxManaPercent,
AttackerTakesDamage,
GoldFind,
MagicFind,
Knockback,
TimeDuration,
AddClassSkills,
Unused84,
AddExperience,
HealAfterKill,
ReducePrices,
DoubleHerbDuration,
LightRadius,
LightColor,
RequirementPercent,
LevelRequire,
IncreasedAttackSpeed,
LevelRequirePercent,
LastBlockFrame,
FasterRunWalk,
NonClassSkill,
State,
FasterHitRecovery,
PlayerCount,
PoisonOverrideLength,
FasterBlockRate,
BypassUndead,
BypassDemons,
FasterCastRate,
BypassBeasts,
SingleSkill,
SlainMonstersRestInPeace,
CurseResistance,
PoisonLengthResist,
NormalDamage,
Howl,
Stupidity,
DamageTakenGoesToMana,
IgnoreTargetsAR,
FractionalTargetAC,
PreventMonsterHeal,
HalfFreezeDuration,
AttackRatingPercent,
DamageTargetAC,
DemonDamagePercent,
UndeadDamagePercent,
DemonAttackRating,
UndeadAttackRating,
Throwable,
ElemSkills,
AllSkills,
AttackerTakesLightDamage,
IronMaidenLevel,
LifeTapLevel,
ThornsPercent,
BoneArmor,
BoneArmorMax,
Freeze,
OpenWounds,
CrushingBlow,
KickDamage,
ManaAfterKill,
HealAfterDemonKill,
ExtraBlood,
DeadlyStrike,
AbsorbFirePercent,
AbsorbFire,
AbsorbLightningPercent,
AbsorbLightning,
AbsorbMagicPercent,
AbsorbMagic,
AbsorbColdPercent,
AbsorbCold,
Slow,
Aura,
Indestructible,
CannotBeFrozen,
StaminaDrainPercent,
Reanimate,
Pierce,
MagicAarow,
ExplosiveAarow,
ThrowMinDamage,
ThrowMaxDamage,
SkillHandofAthena,
SkillStaminaPercent,
SkillPassiveStaminaPercent,
SkillConcentration,
SkillEnchant,
SkillPierce,
SkillConviction,
SkillChillingArmor,
SkillFrenzy,
SkillDecrepify,
SkillArmorPercent,
Alignment,
Target0,
Target1,
GoldLost,
ConverisonLevel,
ConverisonMaxHP,
UnitDooverlay,
AttackVsMonType,
DamageVsMonType,
Fade,
ArmorOverridePercent,
Unused183,
Unused184,
Unused185,
Unused186,
Unused187,
AddSkillTab,
Unused189,
Unused190,
Unused191,
Unused192,
Unused193,
NumSockets,
SkillOnAttack,
SkillOnKill,
SkillOnDeath,
SkillOnHit,
SkillOnLevelUp,
Unused200,
SkillOnGetHit,
Unused202,
Unused203,
ItemChargedSkill,
Unused205,
Unused206,
Unused207,
Unused208,
Unused209,
Unused210,
Unused211,
Unused212,
Unused213,
ArmorPerLevel,
ArmorPercentPerLevel,
LifePerLevel,
ManaPerLevel,
MaxDamagePerLevel,
MaxDamagePercentPerLevel,
StrengthPerLevel,
DexterityPerLevel,
EnergyPerLevel,
VitalityPerLevel,
AttackRatingPerLevel,
AttackRatingPercentPerLevel,
ColdDamageMaxPerLevel,
FireDamageMaxPerLevel,
LightningDamageMaxPerLevel,
PoisonDamageMaxPerLevel,
ResistColdPerLevel,
ResistFirePerLevel,
ResistLightningPerLevel,
ResistPoisonPerLevel,
AbsorbColdPerLevel,
AbsorbFirePerLevel,
AbsorbLightningPerLevel,
AbsorbPoisonPerLevel,
ThornsPerLevel,
FindGoldPerLevel,
MagicFindPerLevel,
RegenStaminaPerLevel,
StaminaPerLevel,
DamageDemonPerLevel,
DamageUndeadPerLevel,
AttackRatingDemonPerLevel,
AttackRatingUndeadPerLevel,
CrushingBlowPerLevel,
OpenWoundsPerLevel,
KickDamagePerLevel,
DeadlyStrikePerLevel,
FindGemsPerLevel,
ReplenishDurability,
ReplenishQuantity,
ExtraStack,
FindItem,
SlashDamage,
SlashDamagePercent,
CrushDamage,
CrushDamagePercent,
ThrustDamage,
ThrustDamagePercent,
AbsorbSlash,
AbsorbCrush,
AbsorbThrust,
AbsorbSlashPercent,
AbsorbCrushPercent,
AbsorbThrustPercent,
ArmorByTime,
ArmorPercentByTime,
LifeByTime,
ManaByTime,
MaxDamageByTime,
MaxDamagePercentByTime,
StrengthByTime,
DexterityByTime,
EnergyByTime,
VitalityByTime,
AttackRatingByTime,
AttackRatingPercentByTime,
ColdDamageMaxByTime,
FireDamageMaxByTime,
LightningDamageMaxByTime,
PoisonDamageMaxByTime,
ResistColdByTime,
ResistFireByTime,
ResistLightningByTime,
ResistPoisonByTime,
AbsorbColdByTime,
AbsorbFireByTime,
AbsorbLightningByTime,
AbsorbPoisonByTime,
FindGoldByTime,
MagicFindByTime,
RegenStaminaByTime,
StaminaByTime,
DamageDemonByTime,
DamageUndeadByTime,
AttackRatingDemonByTime,
AttackRatingUndeadByTime,
CrushingBlowByTime,
OpenWoundsByTime,
KickDamageByTime,
DeadlyStrikeByTime,
FindGemsByTime,
PierceCold,
PierceFire,
PierceLightning,
PiercePoison,
DamageVsMonster,
DamagePercentVsMonster,
AttackRatingVsMonster,
AttackRatingPercentVsMonster,
AcVsMonster,
AcPercentVsMonster,
FireLength,
BurningMin,
BurningMax,
ProgressiveDamage,
ProgressiveSteal,
ProgressiveOther,
ProgressiveFire,
ProgressiveCold,
ProgressiveLightning,
ExtraCharges,
ProgressiveAttackRating,
PoisonCount,
DamageFrameRate,
PierceIdx,
FireSkillDamage,
LightningSkillDamage,
ColdSkillDamage,
PoisonSkillDamage,
EnemyFireResist,
EnemyLightningResist,
EnemyColdResist,
EnemyPoisonResist,
PassiveCriticalStrike,
PassiveDodge,
PassiveAvoid,
PassiveEvade,
PassiveWarmth,
PassiveMasteryMeleeAttackRating,
PassiveMasteryMeleeDamage,
PassiveMasteryMeleeCritical,
PassiveMasteryThrowAttackRating,
PassiveMasteryThrowDamage,
PassiveMasteryThrowCritical,
PassiveWeaponBlock,
SummonResist,
ModifierListSkill,
ModifierListLevel,
LastSentHPPercent,
SourceUnitType,
SourceUnitID,
ShortParam1,
QuestItemDifficulty,
PassiveMagicMastery,
PassiveMagicPierce,
SkillCooldown,
SkillMissileDamageScale,
}
public enum Difficulty
{
Normal = 0,
Nightmare = 1,
Hell = 2,
}
public enum GameObjectMode
{
Neutral,
Operating,
Opened,
OnGround,
InCursor,
Dropping,
Special4,
Special5,
}
public enum GameObjectInteraction
{
GeneralObject = 0x00, // Stash, chests, etc.
Well = 0x01,
HealthShrine = 0x02,
Unknown1 = 0x03,
TrappedChest = 0x05,
MonsterChest = 0x08,
ManaShrine = 0x0d,
StaminaShrine = 0x0e,
ExperienceShrine = 0x0f,
FireShrine = 0x13,
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
}
}
}

128
Form1.Designer.cs generated Normal file
View File

@ -0,0 +1,128 @@
namespace app
{
partial class Form1
{
/// <summary>
/// Variable nécessaire au concepteur.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Nettoyage des ressources utilisées.
/// </summary>
/// <param name="disposing">true si les ressources managées doivent être supprimées ; sinon, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Code généré par le Concepteur Windows Form
/// <summary>
/// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
/// le contenu de cette méthode avec l'éditeur de code.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.button1 = new System.Windows.Forms.Button();
this.colorDialog1 = new System.Windows.Forms.ColorDialog();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.textBoxD2Path = new System.Windows.Forms.TextBox();
this.textBoxCharName = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(113, 55);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(112, 23);
this.button1.TabIndex = 0;
this.button1.Text = "START";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// richTextBox1
//
this.richTextBox1.DetectUrls = false;
this.richTextBox1.Location = new System.Drawing.Point(5, 84);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.ReadOnly = true;
this.richTextBox1.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedVertical;
this.richTextBox1.Size = new System.Drawing.Size(331, 106);
this.richTextBox1.TabIndex = 5;
this.richTextBox1.Text = "";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(2, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(105, 13);
this.label1.TabIndex = 6;
this.label1.Text = "D2-LOD 1.13C Path:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(44, 32);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(63, 13);
this.label2.TabIndex = 7;
this.label2.Text = "Char Name:";
//
// textBoxD2Path
//
this.textBoxD2Path.Location = new System.Drawing.Point(113, 6);
this.textBoxD2Path.Name = "textBoxD2Path";
this.textBoxD2Path.Size = new System.Drawing.Size(223, 20);
this.textBoxD2Path.TabIndex = 8;
//
// textBoxCharName
//
this.textBoxCharName.Location = new System.Drawing.Point(113, 29);
this.textBoxCharName.Name = "textBoxCharName";
this.textBoxCharName.Size = new System.Drawing.Size(223, 20);
this.textBoxCharName.TabIndex = 9;
//
// 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(342, 197);
this.Controls.Add(this.textBoxCharName);
this.Controls.Add(this.textBoxD2Path);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.richTextBox1);
this.Controls.Add(this.button1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "Form1";
this.Text = "D2R - MH";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button1;
private System.Windows.Forms.ColorDialog colorDialog1;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
public System.Windows.Forms.TextBox textBoxD2Path;
public System.Windows.Forms.TextBox textBoxCharName;
}
}

385
Form1.cs Normal file
View File

@ -0,0 +1,385 @@
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using System.Runtime.Remoting;
using System.Security.Cryptography;
using System.Security.Policy;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
using System.Xml.Linq;
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;
namespace app
{
public partial class Form1 : Form
{
public string MHVersion = "V1.0";
public string ThisEndPath = Application.StartupPath + @"\";
public string SettingsFile = Application.StartupPath + @"\Settings.txt";
public int ScreenX = 1920;
public int ScreenY = 1080;
public int CenterX = 0;
public int CenterY = 0;
public int D2Widht = 0;
public int D2Height = 0;
public int ScreenXOffset = 0;
public int ScreenYOffset = 0;
public Process process;
public Dictionary<string, IntPtr> offsets = new Dictionary<string, IntPtr>();
public IntPtr BaseAddress = (IntPtr)0;
public IntPtr processHandle = (IntPtr)0;
public System.Timers.Timer LoopTimer;
public byte[] bufferRead = new byte[] { };
public byte[] buffer = new byte[] { };
public bool Running = false;
public bool HasPointers = false;
public int UnitStrucOffset = -32;
public int hWnd = 0;
public Rectangle D2Rect = new Rectangle();
public bool PrintedGameTime = false;
public int FoundPlayerPointerTryCount = 0;
public Mem Mem_0;
public Form1 Form1_0;
public PatternsScan PatternsScan_0;
public OverlayForm OverlayForm_0;
public MapAreaStruc MapAreaStruc_0;
public PlayerScan PlayerScan_0;
public MobsStruc MobsStruc_0;
public GameStruc GameStruc_0;
public NPCStruc NPCStruc_0;
public ObjectsStruc ObjectsStruc_0;
public Town Town_0;
// REQUIRED CONSTS
const int PROCESS_QUERY_INFORMATION = 0x0400;
const int MEM_COMMIT = 0x00001000;
const int PROCESS_VM_OPERATION = 0x0008;
const int PROCESS_VM_READ = 0x0010;
const int PROCESS_VM_WRITE = 0x0020;
const int SYNCHRONIZE = 0x00100000;
// REQUIRED METHODS
[DllImport("kernel32.dll")]
public static extern IntPtr OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId);
[DllImport("kernel32.dll")]
static extern void GetSystemInfo(out SYSTEM_INFO lpSystemInfo);
[DllImport("user32.dll")]
private static extern int FindWindow(string ClassName, string WindowName);
[DllImport("user32.dll")]
private static extern int GetWindowRect(int hwnd, out Rectangle rect);
// REQUIRED STRUCTS
public struct MEMORY_BASIC_INFORMATION
{
public int BaseAddress;
public int AllocationBase;
public int AllocationProtect;
public int RegionSize;
public int State;
public int Protect;
public int lType;
}
public struct SYSTEM_INFO
{
public ushort processorArchitecture;
ushort reserved;
public uint pageSize;
public IntPtr minimumApplicationAddress;
public IntPtr maximumApplicationAddress;
public IntPtr activeProcessorMask;
public uint numberOfProcessors;
public uint processorType;
public uint allocationGranularity;
public ushort processorLevel;
public ushort processorRevision;
}
public Form1()
{
InitializeComponent();
this.Text = "D2R - MH (" + MHVersion + ") by BMDevs";
Form1_0 = this;
LoopTimer = new System.Timers.Timer(1);
LoopTimer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
PatternsScan_0 = new PatternsScan();
OverlayForm_0 = new OverlayForm(Form1_0);
MapAreaStruc_0 = new MapAreaStruc();
PlayerScan_0 = new PlayerScan();
MobsStruc_0 = new MobsStruc();
GameStruc_0 = new GameStruc();
NPCStruc_0 = new NPCStruc();
ObjectsStruc_0 = new ObjectsStruc();
Town_0 = new Town();
Mem_0 = new Mem();
PatternsScan_0.SetForm1(Form1_0);
MapAreaStruc_0.SetForm1(Form1_0);
PlayerScan_0.SetForm1(Form1_0);
MobsStruc_0.SetForm1(Form1_0);
GameStruc_0.SetForm1(Form1_0);
NPCStruc_0.SetForm1(Form1_0);
ObjectsStruc_0.SetForm1(Form1_0);
Town_0.SetForm1(Form1_0);
Mem_0.SetForm1(Form1_0);
OverlayForm_0.Show();
LoadSettings();
}
public void SaveSettings()
{
string AllTxt = "";
AllTxt += textBoxD2Path.Text + Environment.NewLine;
AllTxt += textBoxCharName.Text + Environment.NewLine;
File.Create(SettingsFile).Dispose();
File.WriteAllText(SettingsFile, AllTxt);
}
public void LoadSettings()
{
if (File.Exists(SettingsFile))
{
string[] AllTxtLine = File.ReadAllLines(SettingsFile);
textBoxD2Path.Text = AllTxtLine[0];
textBoxCharName.Text = AllTxtLine[1];
}
}
public void method_1(string string_3, Color ThisColor)
{
try
{
if (richTextBox1.InvokeRequired)
{
// Call this same method but append THREAD2 to the text
Action safeWrite = delegate { method_1(string_3, ThisColor); };
richTextBox1.Invoke(safeWrite);
}
else
{
//Console.WriteLine(string_3);
richTextBox1.SelectionColor = ThisColor;
richTextBox1.AppendText(string_3 + Environment.NewLine);
Application.DoEvents();
}
}
catch { }
}
public void Startt()
{
try
{
SYSTEM_INFO sys_info = new SYSTEM_INFO();
GetSystemInfo(out sys_info);
Process[] ProcList = Process.GetProcessesByName("D2R");
if (!IsGameRunning())
{
method_1("D2R is not running!", Color.Red);
return;
}
else
{
hWnd = FindWindow(null, "Diablo II: Resurrected");
GetWindowRect(hWnd, out D2Rect);
ScreenX = Screen.PrimaryScreen.Bounds.Width;
ScreenY = Screen.PrimaryScreen.Bounds.Height;
CenterX = ScreenX / 2;
CenterY = ScreenY / 2;
D2Widht = D2Rect.Width;
D2Height = D2Rect.Height;
ScreenXOffset = D2Rect.Location.X;
ScreenYOffset = D2Rect.Location.Y;
method_1("D2R is running...", Color.DarkGreen);
process = Process.GetProcessesByName("D2R")[0];
processHandle = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, false, process.Id);
foreach (ProcessModule module in process.Modules)
{
if (module.ModuleName == "D2R.exe")
{
this.BaseAddress = module.BaseAddress;
method_1("D2R module BaseAddress: 0x" + this.BaseAddress.ToString("X"), Color.Black);
}
}
int bytesRead = 0;
buffer = new byte[0x3FFFFFF];
Mem_0.ReadMemory(BaseAddress, ref buffer, buffer.Length, ref bytesRead);
PatternsScan_0.PatternScan();
buffer = null;
buffer = new byte[0];
LoopTimer.Start();
}
}
catch (Exception message)
{
method_1("Error:" + Environment.NewLine + message, Color.Red);
return;
}
}
void timer_Elapsed(object sender, ElapsedEventArgs e)
{
LoopTimer.Stop();
if (IsGameRunning())
{
bool isInGame = IsInGame();
if (isInGame)
{
if (!HasPointers)
{
PrintedGameTime = false;
PlayerScan_0.scanForPlayer(true);
if (PlayerScan_0.FoundPlayer)
{
HasPointers = true;
}
else
{
//didn't found player pointer
PlayerScan_0.scanForPlayer(false);
if (PlayerScan_0.FoundPlayer)
{
HasPointers = true;
}
else
{
FoundPlayerPointerTryCount++;
if (FoundPlayerPointerTryCount >= 300)
{
method_1("Player pointer not found!", Color.Red);
if (Running) LoopTimer.Start();
return;
}
}
}
}
if (HasPointers)
{
PlayerScan_0.GetPositions();
if (MapAreaStruc_0.AllMapData.Count == 0) MapAreaStruc_0.ScanMapStruc();
OverlayForm_0.SetAllOverlay();
PrintedGameTime = false;
}
}
else
{
if (!PrintedGameTime)
{
FoundPlayerPointerTryCount = 0;
OverlayForm_0.ClearAllOverlay();
Form1_0.method_1("Waiting to be in game!", Color.Red);
PrintedGameTime = true;
}
HasPointers = false;
}
}
if (Running) LoopTimer.Start();
}
public void WaitDelay(int DelayTime)
{
int CurrentWait = 0;
while (CurrentWait < DelayTime)
{
Thread.Sleep(1);
Application.DoEvents();
CurrentWait++;
}
}
public void button1_Click(object sender, EventArgs e)
{
if (!Running)
{
button1.Text = "STOP";
Running = true;
Startt();
}
else
{
button1.Text = "START";
OverlayForm_0.ClearAllOverlay();
Running = false;
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
SaveSettings();
}
public bool IsGameRunning()
{
Process[] ProcList = Process.GetProcessesByName("D2R");
if (ProcList.Length == 0)
{
return false;
}
return true;
}
public bool IsInGame()
{
long baseAddress = (long)Form1_0.BaseAddress + (long)Form1_0.offsets["unitTable"] - 64;
byte[] unitTableBuffer = new byte[1];
Form1_0.Mem_0.ReadRawMemory(baseAddress, ref unitTableBuffer, 1);
if (unitTableBuffer[0] == 0x01)
{
return true;
}
return false;
}
}
}

3824
Form1.resx Normal file

File diff suppressed because it is too large Load Diff

649
MapAreaStruc.cs Normal file
View File

@ -0,0 +1,649 @@
using Newtonsoft.Json;
using System;
using System.IO;
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 bool[,] CurrentAreaCollisionGrid = new bool[0,0];
public string[] MapDataLines = new string[0];
public void SetForm1(Form1 form1_1)
{
Form1_0 = form1_1;
_kooloMapPath = Application.StartupPath + @"\map.exe";
}
public List<Position> GetPositionOfAllExits()
{
List<Position> AllPoss = new List<Position>();
bool[,] ThisColGrid = CollisionGrid((Enums.Area) Form1_0.PlayerScan_0.levelNo);
for (int i = 0; i < ThisColGrid.GetLength(0); i++)
{
if (ThisColGrid[i, 0])
{
AllPoss.Add(new Position { X = AllMapData[(int) Form1_0.PlayerScan_0.levelNo - 1].Offset.X + i, Y = AllMapData[(int)Form1_0.PlayerScan_0.levelNo - 1].Offset.Y });
break;
}
}
for (int i = 0; i < ThisColGrid.GetLength(0); i++)
{
if (ThisColGrid[i, ThisColGrid.GetLength(1) - 1])
{
AllPoss.Add(new Position { X = AllMapData[(int)Form1_0.PlayerScan_0.levelNo - 1].Offset.X + i, Y = AllMapData[(int)Form1_0.PlayerScan_0.levelNo - 1].Offset.Y + AllMapData[(int)Form1_0.PlayerScan_0.levelNo - 1].Size.Height });
break;
}
}
for (int i = 0; i < ThisColGrid.GetLength(1); i++)
{
if (ThisColGrid[0, i])
{
AllPoss.Add(new Position { X = AllMapData[(int)Form1_0.PlayerScan_0.levelNo - 1].Offset.X, Y = AllMapData[(int)Form1_0.PlayerScan_0.levelNo - 1].Offset.Y + i });
break;
}
}
for (int i = 0; i < ThisColGrid.GetLength(1); i++)
{
if (ThisColGrid[ThisColGrid.GetLength(0) - 1, i])
{
AllPoss.Add(new Position { X = AllMapData[(int)Form1_0.PlayerScan_0.levelNo - 1].Offset.X + AllMapData[(int)Form1_0.PlayerScan_0.levelNo - 1].Size.Width, Y = AllMapData[(int)Form1_0.PlayerScan_0.levelNo - 1].Offset.Y + i });
break;
}
}
return AllPoss;
}
public List<Position> GetPositionOfAllObject(string ObjectType, string ObjectName, int AreaID, List<int> IgnoreTheseIndex, bool IgnoreName = false)
{
List<Position> ThisPos = new List<Position>();
//if (AllMapData.Count == 0) return ThisPos;
try
{
//ExitType = "exit" or "exit_area"
int i = AreaID - 1;
if (i > AllMapData.Count - 1) ScanMapStruc();
else 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")
{
//Console.WriteLine(Form1_0.Town_0.getAreaName(int.Parse(AllMapData[i].Objects[k].ID)));
if ((Form1_0.Town_0.getAreaName(int.Parse(AllMapData[i].Objects[k].ID)) == ObjectName && !IgnoreName)
|| IgnoreName)
{
ThisPos.Add(new Position { X = AllMapData[i].Offset.X + AllMapData[i].Objects[k].X, Y = AllMapData[i].Offset.Y + AllMapData[i].Objects[k].Y });
}
}
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 && !IgnoreName)
|| IgnoreName)
{
ThisPos.Add(new Position { X = AllMapData[i].Offset.X + AllMapData[i].Objects[k].X, Y = AllMapData[i].Offset.Y + AllMapData[i].Objects[k].Y });
}
}
if (AllMapData[i].Objects[k].Type == "object" && ObjectType == "object")
{
//Console.WriteLine("Object: " + Form1_0.ObjectsStruc_0.getObjectName(int.Parse(AllMapData[i].Objects[k].ID)));
if (ObjectName == "WaypointPortal")
{
if (Form1_0.ObjectsStruc_0.IsWaypoint(int.Parse(AllMapData[i].Objects[k].ID)))
{
ThisPos.Add(new Position { X = AllMapData[i].Offset.X + AllMapData[i].Objects[k].X, Y = AllMapData[i].Offset.Y + AllMapData[i].Objects[k].Y });
}
}
else
{
if ((Form1_0.ObjectsStruc_0.getObjectName(int.Parse(AllMapData[i].Objects[k].ID)) == ObjectName && !IgnoreName)
|| IgnoreName)
{
ThisPos.Add(new Position { X = AllMapData[i].Offset.X + AllMapData[i].Objects[k].X, Y = AllMapData[i].Offset.Y + AllMapData[i].Objects[k].Y });
}
}
}
if (AllMapData[i].Objects[k].Type == "npc" && ObjectType == "npc")
{
//Console.WriteLine("NPC: " + Form1_0.NPCStruc_0.getNPC_ID(int.Parse(AllMapData[i].Objects[k].ID)));
if ((Form1_0.NPCStruc_0.getNPC_ID(int.Parse(AllMapData[i].Objects[k].ID)) == ObjectName && !IgnoreName)
|| IgnoreName)
{
ThisPos.Add(new Position { X = AllMapData[i].Offset.X + AllMapData[i].Objects[k].X, Y = AllMapData[i].Offset.Y + AllMapData[i].Objects[k].Y });
}
}
}
}
//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()
{
_d2LoDPath = Form1_0.textBoxD2Path.Text;
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);
int tryes = 0;
while (tryes < 3)
{
GetMapData(Form1_0.PlayerScan_0.mapSeedValue.ToString(), (Difficulty)Form1_0.PlayerScan_0.difficulty);
if (AllMapData.Count != 0)
{
tryes = 15;
break;
}
}
}
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();
string SavePathh = Form1_0.ThisEndPath + "DumpMap.txt";
File.Create(SavePathh).Dispose();
File.WriteAllLines(SavePathh, stdoutLines);
MapDataLines = stdoutLines;
if (lvls.Count == 0)
{
Form1_0.method_1("Couldn't get the map data from D2 LOD 1.13C!", Color.Red);
Form1_0.method_1("Check the file 'DumpMap.txt' for more infos", Color.Red);
Form1_0.method_1("Retrying...", Color.Red);
}
/*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}");
}*/
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 bool[,] CollisionGrid(Area area)
{
ServerLevel level = GetLevel(area);
int Tryess = 0;
while (level == null && Tryess < 5)
{
Form1_0.MapAreaStruc_0.GetMapData(Form1_0.PlayerScan_0.mapSeedValue.ToString(), (Difficulty)Form1_0.PlayerScan_0.difficulty);
level = GetLevel(area);
Tryess++;
}
if (level == null)
{
Form1_0.method_1("ERROR Trying to get collision grid!", Color.Red);
return new bool[0, 0];
}
if (level.Size == null)
{
Form1_0.method_1("ERROR Trying to get collision grid!", Color.Red);
return new bool[0, 0];
}
bool[,] cg = new bool[level.Size.Width, level.Size.Height];
for (int y = 0; y < level.Size.Height; y++)
{
for (int x = 0; x < level.Size.Width; x++)
{
cg[x, y] = 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++)
{
cg[xPos + xOffset, y] = isWalkable;
}
}
isWalkable = !isWalkable;
xPos += xs;
}
while (xPos < level.Size.Width)
{
cg[xPos, y] = isWalkable;
xPos++;
}
}
}
// Lut Gholein map is a bit bugged, we should close this fake path to avoid pathing issues
if (area == Enums.Area.LutGholein) cg[13, 210] = false;
// Fix for Summonner map (when the summoner is located in the area that have tons of teleportation pads)
//XX-----XXXXXXXXXXXXXXXXXXXX-----XX
if (area == Enums.Area.ArcaneSanctuary)
{
for (int x = 0; x < cg.GetLength(0) - 35; x++)
{
for (int y = 0; y < cg.GetLength(0); y++)
{
if (!cg[x, y] && !cg[x + 1, y]
&& cg[x + 2, y] && cg[x + 3, y] && cg[x + 4, y] && cg[x + 5, y] && cg[x + 6, y]
&& !cg[x + 7, y] && !cg[x + 8, y] && !cg[x + 9, y] && !cg[x + 10, y] && !cg[x + 11, y] && !cg[x + 12, y] && !cg[x + 13, y] && !cg[x + 14, y] && !cg[x + 15, y] && !cg[x + 16, y]
&& !cg[x + 17, y] && !cg[x + 18, y] && !cg[x + 19, y] && !cg[x + 20, y] && !cg[x + 21, y] && !cg[x + 22, y] && !cg[x + 23, y] && !cg[x + 24, y] && !cg[x + 25, y] && !cg[x + 26, y]
&& cg[x + 27, y] && cg[x + 28, y] && cg[x + 29, y] && cg[x + 30, y] && cg[x + 31, y]
&& !cg[x + 32, y] && !cg[x + 33, y])
{
//Console.WriteLine("CorrectPath1!");
cg[x + 7, y] = true;
cg[x + 26, y] = true;
}
}
}
for (int x = 0; x < cg.GetLength(0); x++)
{
for (int y = 0; y < cg.GetLength(0) - 35; y++)
{
if (!cg[x, y] && !cg[x, y + 1]
&& cg[x, y + 2] && cg[x, y + 3] && cg[x, y + 4] && cg[x, y + 5] && cg[x, y + 6]
&& !cg[x, y + 7] && !cg[x, y + 8] && !cg[x, y + 9] && !cg[x, y + 10] && !cg[x, y + 11] && !cg[x, y + 12] && !cg[x, y + 13] && !cg[x, y + 14] && !cg[x, y + 15] && !cg[x, y + 16]
&& !cg[x, y + 17] && !cg[x, y + 18] && !cg[x, y + 19] && !cg[x, y + 20] && !cg[x, y + 21] && !cg[x, y + 22] && !cg[x, y + 23] && !cg[x, y + 24] && !cg[x, y + 25] && !cg[x, y + 26]
&& cg[x, y + 27] && cg[x, y + 28] && cg[x, y + 29] && cg[x, y + 30] && cg[x, y + 31]
&& !cg[x, y + 32] && !cg[x, y + 33])
{
//Console.WriteLine("CorrectPath2!");
cg[x, y + 7] = true;
cg[x, y + 26] = true;
}
}
}
}
//dump data to txt file
/*string ColisionMapTxt = "";
for (int i = 0; i < cg.GetLength(0); i++)
{
for (int k = 0; k < cg.GetLength(1); k++)
{
if (cg[i, k]) ColisionMapTxt += "-";
if (!cg[i, k]) ColisionMapTxt += "X";
}
ColisionMapTxt += Environment.NewLine;
}
File.Create(Form1_0.ThisEndPath + "CollisionMap.txt").Dispose();
File.WriteAllText(Form1_0.ThisEndPath + "CollisionMap.txt", ColisionMapTxt);*/
return cg;
//return cg.Select(r => r.ToArray()).ToArray();
}
public 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 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
}
}
}

39
OverlayForm.Designer.cs generated Normal file
View File

@ -0,0 +1,39 @@
namespace app
{
partial class OverlayForm
{
/// <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()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "OverlayForm";
}
#endregion
}
}

238
OverlayForm.cs Normal file
View File

@ -0,0 +1,238 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static app.MapAreaStruc;
namespace app
{
public partial class OverlayForm : Form
{
public int Scale = 9;
public Form1 Form1_0;
private Pen redPen = new Pen(Color.FromArgb(150, 255, 0, 0), 2);
private Pen yellowPen = new Pen(Color.FromArgb(150, 255, 255, 0), 2);
private Pen greenPen = new Pen(Color.FromArgb(150, 0, 255, 0), 2);
private Pen orangePen = new Pen(Color.FromArgb(150, 255, 95, 0), 2);
private Pen bluePen = new Pen(Color.FromArgb(150, 0, 0, 255), 2);
private Pen cyanPen = new Pen(Color.FromArgb(150, 0, 255, 255), 2);
public List<System.Drawing.Point> MobsPoints = new List<System.Drawing.Point>();
public List<System.Drawing.Point> GoodChestsPoints = new List<System.Drawing.Point>();
public List<System.Drawing.Point> WPPoints = new List<System.Drawing.Point>();
public List<System.Drawing.Point> ExitPoints = new List<System.Drawing.Point>();
public bool ScanningOverlayItems = true;
public OverlayForm(Form1 form1_1)
{
Form1_0 = form1_1;
InitializeComponent();
// Set up the form as a transparent overlay
this.FormBorderStyle = FormBorderStyle.None;
this.BackColor = Color.LimeGreen;
this.TransparencyKey = Color.LimeGreen;
this.TopMost = true;
this.StartPosition = FormStartPosition.Manual;
this.Location = new System.Drawing.Point(0, 0);
this.ShowInTaskbar = false;
this.Size = new System.Drawing.Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
}
public void SetAllOverlay()
{
if (ScanningOverlayItems)
{
//DateTime StartScanTime = DateTime.Now;
SetAllGoodChestNearby();
SetAllMonsterNearby();
SetAllWPNearby();
SetAllExitNearby();
UpdateOverlay();
//TimeSpan UpdatingDisplayTime = DateTime.Now - StartScanTime;
//stop scanning too much lags!! (->> issue fixed!)
//if (UpdatingDisplayTime.TotalMilliseconds > 160) ScanningOverlayItems = false;
}
else
{
GoodChestsPoints = new List<System.Drawing.Point>();
MobsPoints = new List<System.Drawing.Point>();
WPPoints = new List<System.Drawing.Point>();
ExitPoints = new List<System.Drawing.Point>();
UpdateOverlay();
}
}
public void SetAllGoodChestNearby()
{
GoodChestsPoints = new List<System.Drawing.Point>();
List<Position> AllChestPos = Form1_0.MapAreaStruc_0.GetPositionOfAllObject("object", "GoodChest", (int) Form1_0.PlayerScan_0.levelNo, new List<int>());
foreach (var objectPos in AllChestPos)
{
GoodChestsPoints.Add(new System.Drawing.Point(objectPos.X, objectPos.Y));
}
}
public void SetAllWPNearby()
{
WPPoints = new List<System.Drawing.Point>();
List<Position> AllPos = Form1_0.MapAreaStruc_0.GetPositionOfAllObject("object", "WaypointPortal", (int)Form1_0.PlayerScan_0.levelNo, new List<int>());
foreach (var objectPos in AllPos)
{
WPPoints.Add(new System.Drawing.Point(objectPos.X, objectPos.Y));
}
}
public void SetAllExitNearby()
{
ExitPoints = new List<System.Drawing.Point>();
List<Position> AllPos = Form1_0.MapAreaStruc_0.GetPositionOfAllObject("exit", "", (int)Form1_0.PlayerScan_0.levelNo, new List<int>(), true);
foreach (var objectPos in AllPos)
{
ExitPoints.Add(new System.Drawing.Point(objectPos.X, objectPos.Y));
}
AllPos = Form1_0.MapAreaStruc_0.GetPositionOfAllExits();
foreach (var objectPos in AllPos)
{
ExitPoints.Add(new System.Drawing.Point(objectPos.X, objectPos.Y));
}
}
public void SetAllMonsterNearby()
{
MobsPoints = new List<System.Drawing.Point>();
List<int[]> monsterPositions = Form1_0.MobsStruc_0.GetAllMobsNearby();
foreach (var monsterPosition in monsterPositions)
{
MobsPoints.Add(new System.Drawing.Point(monsterPosition[0], monsterPosition[1]));
}
}
public void ClearAllOverlay()
{
ClearAllOverlayWithoutUpdating();
UpdateOverlay();
}
public void ClearAllOverlayWithoutUpdating()
{
MobsPoints = new List<System.Drawing.Point>();
GoodChestsPoints = new List<System.Drawing.Point>();
WPPoints = new List<System.Drawing.Point>();
ExitPoints = new List<System.Drawing.Point>();
}
public void UpdateOverlay()
{
if (!Form1_0.Running)
{
ClearAllOverlayWithoutUpdating();
}
if (InvokeRequired)
{
Invoke(new MethodInvoker(updateGUI));
}
else
{
updateGUI();
}
}
void updateGUI()
{
this.Refresh();
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
for (int i = 0; i < MobsPoints.Count; i++)
{
Dictionary<string, int> itemScreenPosStart = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, MobsPoints[i].X, MobsPoints[i].Y);
System.Drawing.Point StartPoint = new System.Drawing.Point(itemScreenPosStart["x"], itemScreenPosStart["y"]);
StartPoint = RescaleThisPoint(StartPoint);
DrawCrossAtPoint(e, StartPoint, yellowPen);
}
for (int i = 0; i < GoodChestsPoints.Count; i++)
{
Dictionary<string, int> itemScreenPosStart = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, GoodChestsPoints[i].X, GoodChestsPoints[i].Y);
System.Drawing.Point StartPoint = new System.Drawing.Point(itemScreenPosStart["x"], itemScreenPosStart["y"]);
StartPoint = RescaleThisPoint(StartPoint);
System.Drawing.Point MidPoint = new System.Drawing.Point(Form1_0.CenterX, Form1_0.CenterY);
e.Graphics.DrawLine(greenPen, MidPoint, StartPoint);
DrawCrossAtPoint(e, StartPoint, greenPen);
}
for (int i = 0; i < WPPoints.Count; i++)
{
Dictionary<string, int> itemScreenPosStart = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, WPPoints[i].X, WPPoints[i].Y);
System.Drawing.Point StartPoint = new System.Drawing.Point(itemScreenPosStart["x"], itemScreenPosStart["y"]);
StartPoint = RescaleThisPoint(StartPoint);
System.Drawing.Point MidPoint = new System.Drawing.Point(Form1_0.CenterX, Form1_0.CenterY);
e.Graphics.DrawLine(bluePen, MidPoint, StartPoint);
DrawCrossAtPoint(e, StartPoint, bluePen);
}
for (int i = 0; i < ExitPoints.Count; i++)
{
Dictionary<string, int> itemScreenPosStart = Form1_0.GameStruc_0.World2Screen(Form1_0.PlayerScan_0.xPosFinal, Form1_0.PlayerScan_0.yPosFinal, ExitPoints[i].X, ExitPoints[i].Y);
System.Drawing.Point StartPoint = new System.Drawing.Point(itemScreenPosStart["x"], itemScreenPosStart["y"]);
StartPoint = RescaleThisPoint(StartPoint);
System.Drawing.Point MidPoint = new System.Drawing.Point(Form1_0.CenterX, Form1_0.CenterY);
e.Graphics.DrawLine(cyanPen, MidPoint, StartPoint);
DrawCrossAtPoint(e, StartPoint, cyanPen);
}
}
public void DrawCrossAtPoint(PaintEventArgs e, System.Drawing.Point ThisP, Pen ThisPenColor)
{
System.Drawing.Point ThisPoint1 = new System.Drawing.Point(ThisP.X - 5, ThisP.Y - 5);
System.Drawing.Point ThisPoint2 = new System.Drawing.Point(ThisP.X + 5, ThisP.Y + 5);
System.Drawing.Point ThisPoint3 = new System.Drawing.Point(ThisP.X - 5, ThisP.Y + 5);
System.Drawing.Point ThisPoint4 = new System.Drawing.Point(ThisP.X + 5, ThisP.Y - 5);
// Draw a X red cross
e.Graphics.DrawLine(ThisPenColor, ThisPoint1, ThisPoint2);
e.Graphics.DrawLine(ThisPenColor, ThisPoint3, ThisPoint4);
}
public System.Drawing.Point RescaleThisPoint(System.Drawing.Point ThisssPoint)
{
ThisssPoint.X = ((ThisssPoint.X - Form1_0.CenterX) / Scale) + Form1_0.CenterX;
ThisssPoint.Y = ((ThisssPoint.Y - Form1_0.CenterY) / Scale) + Form1_0.CenterY;
return ThisssPoint;
}
}
}

271
PlayerScan.cs Normal file
View File

@ -0,0 +1,271 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using System.Runtime.Remoting;
using System.Security.Claims;
using System.Security.Cryptography;
using System.Security.Policy;
using System.Text;
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;
namespace app
{
public class PlayerScan
{
Form1 Form1_0;
public long PlayerPointer = 0;
public long PlayerNamePointer = 0;
public long actAddress = 0;
public long mapSeedAddress = 0;
public Int64 pathAddress = 0;
public bool FoundPlayer = false;
public long pAct = 0;
public uint mapSeedValue = 0;
public ushort xPos = 0;
public ushort yPos = 0;
public ushort xPosOffset = 0;
public ushort yPosOffset = 0;
public int xPosOffsetPercent = 0;
public int yPosOffsetPercent = 0;
public ushort xPosFinal = 0;
public ushort yPosFinal = 0;
public string pName = "";
public long pRoom1Address = 0;
public long pRoom2Address = 0;
public long pLevelAddress = 0;
public long levelNo = 0;
public ushort difficulty = 0;
public uint lastdwInitSeedHash1 = 0;
public uint lastdwInitSeedHash2 = 0;
public string sFile = "";
public uint unitId = 0;
public string pNameOther = "";
public uint unitIdOther = 0;
public void SetForm1(Form1 form1_1)
{
Form1_0 = form1_1;
}
public void GetPositions()
{
pathAddress = Form1_0.Mem_0.ReadInt64Raw((IntPtr) (PlayerPointer + 0x38));
xPos = Form1_0.Mem_0.ReadUInt16Raw((IntPtr) (pathAddress + 0x02));
yPos = Form1_0.Mem_0.ReadUInt16Raw((IntPtr) (pathAddress + 0x06));
xPosOffset = Form1_0.Mem_0.ReadUInt16Raw((IntPtr) (pathAddress + 0x00));
yPosOffset = Form1_0.Mem_0.ReadUInt16Raw((IntPtr) (pathAddress + 0x04));
xPosOffsetPercent = (xPosOffset / 65536); //get percentage
yPosOffsetPercent = (yPosOffset / 65536); //get percentage
xPosFinal = (ushort)(xPos + xPosOffsetPercent);
yPosFinal = (ushort)(yPos + yPosOffsetPercent);
//; get the level number
pRoom1Address = Form1_0.Mem_0.ReadInt64Raw((IntPtr)(pathAddress + 0x20));
pRoom2Address = Form1_0.Mem_0.ReadInt64Raw((IntPtr)(pRoom1Address + 0x18));
pLevelAddress = Form1_0.Mem_0.ReadInt64Raw((IntPtr)(pRoom2Address + 0x90));
levelNo = Form1_0.Mem_0.ReadUInt32Raw((IntPtr)(pLevelAddress + 0x1F8));
//; get/check for bad pointer
if (levelNo == 0 && xPosFinal == 0 && yPosFinal == 0)
{
Form1_0.HasPointers = false;
}
//#####################################################################################################
//#####################################################################################################
//#####################################################################################################
//; get the difficulty
actAddress = Form1_0.Mem_0.ReadInt64Raw((IntPtr)(PlayerPointer + 0x20));
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.ReadUInt32Raw((IntPtr)(actMiscAddress + 0x840));
uint dwInitSeedHash2 = Form1_0.Mem_0.ReadUInt32Raw((IntPtr)(actMiscAddress + 0x844));
uint dwEndSeedHash1 = Form1_0.Mem_0.ReadUInt32Raw((IntPtr)(actMiscAddress + 0x868));
/*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)
{
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);
}
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 void scanForPlayer(bool QuickScan) //scanning for self
{
FoundPlayer = false;
int SizeArray = 0;
int SizeIncrement = 0;
byte[] unitTableBufferT = new byte[] { };
if (QuickScan)
{
SizeArray = (128 + 516) * 8;
SizeIncrement = 8;
unitTableBufferT = new byte[SizeArray];
long UnitOffset = (long)Form1_0.BaseAddress + (long)Form1_0.offsets["unitTable"] + Form1_0.UnitStrucOffset;
Form1_0.Mem_0.ReadRawMemory(UnitOffset, ref unitTableBufferT, SizeArray);
}
else
{
Form1_0.PatternsScan_0.scanForUnitsPointer("player");
SizeArray = Form1_0.PatternsScan_0.AllPlayersPointers.Count;
SizeIncrement = 1;
}
for (int i = 0; i < SizeArray; i += SizeIncrement)
{
long UnitPointerLocation = 0;
if (QuickScan)
{
UnitPointerLocation = BitConverter.ToInt64(unitTableBufferT, i);
}
else
{
UnitPointerLocation = Form1_0.PatternsScan_0.AllPlayersPointers[i];
}
if (UnitPointerLocation > 0)
{
byte[] itemdatastruc = new byte[144];
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)
{
//Form1_0.method_1("PPointerLocation: 0x" + (UnitPointerLocation).ToString("X"));
long pUnitDataPtr = BitConverter.ToInt64(itemdatastruc, 0x10);
byte[] pUnitData = new byte[144];
Form1_0.Mem_0.ReadRawMemory(pUnitDataPtr, ref pUnitData, 144);
string name = "";
for (int i2 = 0; i2 < 16; i2++)
{
if (pUnitData[i2] != 0x00)
{
name += (char)pUnitData[i2];
}
}
//name = name.Replace("?", "");
//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];
Form1_0.Mem_0.ReadRawMemory(ppath, ref ppathData, 144);
//if posX equal not zero
if (BitConverter.ToInt16(ppathData, 2) != 0 && name == Form1_0.textBoxCharName.Text)
{
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.DarkBlue);
/*string SavePathh = Form1_0.ThisEndPath + "DumpPlayerStruc";
File.Create(SavePathh).Dispose();
File.WriteAllBytes(SavePathh, itemdatastruc);
SavePathh = Form1_0.ThisEndPath + "DumpPlayerUnitData";
File.Create(SavePathh).Dispose();
File.WriteAllBytes(SavePathh, pUnitData);
SavePathh = Form1_0.ThisEndPath + "DumpPlayerPath";
File.Create(SavePathh).Dispose();
File.WriteAllBytes(SavePathh, ppathData);*/
return;
}
}
}
}
}
}
}

22
Program.cs Normal file
View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace app
{
internal static class Program
{
/// <summary>
/// Point d'entrée principal de l'application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Les informations générales relatives à un assembly dépendent de
// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
// associées à un assembly.
[assembly: AssemblyTitle("app")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("app")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly
// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de
// COM, affectez la valeur true à l'attribut ComVisible sur ce type.
[assembly: ComVisible(false)]
// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
[assembly: Guid("9f07a94f-efc7-4e4b-807a-83f884ee0b44")]
// Les informations de version pour un assembly se composent des quatre valeurs suivantes :
//
// Version principale
// Version secondaire
// Numéro de build
// Révision
//
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
// en utilisant '*', comme indiqué ci-dessous :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

63
Properties/Resources.Designer.cs generated Normal file
View File

@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Ce code a été généré par un outil.
// Version du runtime :4.0.30319.42000
//
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
// le code est régénéré.
// </auto-generated>
//------------------------------------------------------------------------------
namespace app.Properties {
using System;
/// <summary>
/// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées.
/// </summary>
// Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder
// à l'aide d'un outil, tel que ResGen ou Visual Studio.
// Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen
// avec l'option /str ou régénérez votre projet VS.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Retourne l'instance ResourceManager mise en cache utilisée par cette classe.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("app.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Remplace la propriété CurrentUICulture du thread actuel pour toutes
/// les recherches de ressources à l'aide de cette classe de ressource fortement typée.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

117
Properties/Resources.resx Normal file
View File

@ -0,0 +1,117 @@
<?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.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: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" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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=2.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>
</resheader>
</root>

26
Properties/Settings.Designer.cs generated Normal file
View File

@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Ce code a été généré par un outil.
// Version du runtime :4.0.30319.42000
//
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
// le code est régénéré.
// </auto-generated>
//------------------------------------------------------------------------------
namespace app.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

100
Strucs/GameStruc.cs Normal file
View File

@ -0,0 +1,100 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Runtime.Remoting;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Collections.Specialized.BitVector32;
using static System.Windows.Forms.AxHost;
using System.Threading;
using static app.Enums;
namespace app
{
public class GameStruc
{
Form1 Form1_0;
public string GameName = "";
public string GameDifficulty = "";
public string GameOwnerName = "";
public List<string> AllGamesNames = new List<string>();
public List<int> AllGamesPlayersCount = new List<int>();
public List<string> AllPlayersNames = new List<string>();
public int SelectedGamePlayerCount = 0;
public int SelectedGameTime = 0;
public string SelectedGameName = "";
public List<string> AllGamesTriedNames = new List<string>();
public bool AlreadyChickening = false;
[DllImport("user32.dll")] static extern short VkKeyScan(char ch);
[StructLayout(LayoutKind.Explicit)]
struct Helper
{
[FieldOffset(0)] public short Value;
[FieldOffset(0)] public byte Low;
[FieldOffset(1)] public byte High;
}
public void SetForm1(Form1 form1_1)
{
Form1_0 = form1_1;
}
public Dictionary<string, int> World2Screen(long playerX, long playerY, long targetx, long targety)
{
//; scale = 27
//double scale = Form1_0.centerModeScale * Form1_0.renderScale * 100;
double scale = 40.8;
long xdiff = targetx - playerX;
long ydiff = targety - playerY;
double angle = 0.785398; //45 deg
double x = xdiff * Math.Cos(angle) - ydiff * Math.Sin(angle);
double y = xdiff * Math.Sin(angle) + ydiff * Math.Cos(angle);
int xS = (int) (Form1_0.CenterX + (x * scale));
//int yS = (int) (Form1_0.CenterY + (y * scale * 0.5) - 10);
int yS = (int)(Form1_0.CenterY + (y * scale * 0.5) - 30);
Dictionary<string, int> NewDict = new Dictionary<string, int>();
NewDict["x"] = xS;
NewDict["y"] = yS;
return NewDict;
}
public bool IsGameRunning()
{
Process[] ProcList = Process.GetProcessesByName("D2R");
if (ProcList.Length == 0)
{
return false;
}
return true;
}
public bool IsInGame()
{
long baseAddress = (long)Form1_0.BaseAddress + (long)Form1_0.offsets["unitTable"] - 64;
byte[] unitTableBuffer = new byte[1];
Form1_0.Mem_0.ReadRawMemory(baseAddress, ref unitTableBuffer, 1);
//Console.WriteLine(unitTableBuffer[0]);
if (unitTableBuffer[0] == 0x01)
{
return true;
}
return false;
}
}
}

249
Strucs/Mem.cs Normal file
View File

@ -0,0 +1,249 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace app
{
public class Mem
{
Form1 Form1_0;
[DllImport("kernel32.dll")]
public static extern bool ReadProcessMemory(int hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, int dwSize, ref int lpNumberOfBytesRead);
[DllImport("kernel32.dll", SetLastError = true)]
public static extern bool WriteProcessMemory(int hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, int nSize, ref int lpNumberOfBytesWritten);
public void SetForm1(Form1 Form1_1)
{
Form1_0 = Form1_1;
}
Dictionary<string, int> aTypeSize = new Dictionary<string, int>
{
{"UChar", 1}, {"Char", 1},
{"UShort", 2}, {"Short", 2},
{"UInt", 4}, {"Int", 4},
{"UFloat", 4}, {"Float", 4},
{"Int64", 8}, {"Double", 8}
};
public void WriteRawMemory(IntPtr address, byte[] buffer, int writesize)
{
int pBytesWrite = 0;
WriteProcessMemory((int)Form1_0.processHandle, address, buffer, writesize, ref pBytesWrite);
}
public void ReadMemory(IntPtr address, ref byte[] buffer, int bytes, ref int pBytesRead)
{
ReadProcessMemory((int)Form1_0.processHandle, address, buffer, bytes, ref pBytesRead);
}
public void ReadRawMemory(long address, ref byte[] buffer, int bytes = 4, params int[] aOffsets)
{
buffer = new byte[bytes];
int pBytesRead = 0;
/*if (aOffsets.Length > 0)
{
address = this.GetAddressFromOffsets(address, aOffsets);
}*/
ReadProcessMemory((int) Form1_0.processHandle, (IntPtr)address, buffer, bytes, ref pBytesRead);
}
public string ReadMemString(long TPoint)
{
string name = "";
for (int i2 = 0; i2 < 16; i2++)
{
if (ReadByteRaw((IntPtr)(TPoint + i2)) != 0x00)
{
name += ReadUCharRaw((IntPtr)(TPoint + i2));
}
else
{
break;
}
}
return name;
}
public int ReadInt(IntPtr ThisAd)
{
int bytesRead = 0;
Form1_0.bufferRead = new byte[aTypeSize["Int"]];
ReadProcessMemory((int)Form1_0.processHandle, (IntPtr)((long)Form1_0.BaseAddress + (long)ThisAd), Form1_0.bufferRead, aTypeSize["Int"], ref bytesRead);
if (bytesRead > 0)
{
return BitConverter.ToInt32(Form1_0.bufferRead, 0);
}
return 0;
}
public UInt16 ReadUInt16(IntPtr ThisAd)
{
int bytesRead = 0;
Form1_0.bufferRead = new byte[aTypeSize["Short"]];
ReadProcessMemory((int)Form1_0.processHandle, (IntPtr)((long)Form1_0.BaseAddress + (long)ThisAd), Form1_0.bufferRead, aTypeSize["Short"], ref bytesRead);
if (bytesRead > 0)
{
return BitConverter.ToUInt16(Form1_0.bufferRead, 0);
}
return 0;
}
public UInt32 ReadUInt32(IntPtr ThisAd)
{
int bytesRead = 0;
Form1_0.bufferRead = new byte[aTypeSize["Int"]];
ReadProcessMemory((int)Form1_0.processHandle, (IntPtr)((long)Form1_0.BaseAddress + (long)ThisAd), Form1_0.bufferRead, aTypeSize["Int"], ref bytesRead);
if (bytesRead > 0)
{
return BitConverter.ToUInt32(Form1_0.bufferRead, 0);
}
return 0;
}
public Int32 ReadInt32(IntPtr ThisAd)
{
int bytesRead = 0;
Form1_0.bufferRead = new byte[aTypeSize["Int"]];
ReadProcessMemory((int)Form1_0.processHandle, (IntPtr)((long)Form1_0.BaseAddress + (long)ThisAd), Form1_0.bufferRead, aTypeSize["Int"], ref bytesRead);
if (bytesRead > 0)
{
return BitConverter.ToInt32(Form1_0.bufferRead, 0);
}
return 0;
}
public Int64 ReadInt64(IntPtr ThisAd)
{
int bytesRead = 0;
Form1_0.bufferRead = new byte[aTypeSize["Int64"]];
ReadProcessMemory((int)Form1_0.processHandle, (IntPtr)((long)Form1_0.BaseAddress + (long)ThisAd), Form1_0.bufferRead, aTypeSize["Int64"], ref bytesRead);
if (bytesRead > 0)
{
return BitConverter.ToInt64(Form1_0.bufferRead, 0);
}
return 0;
}
public char ReadUChar(IntPtr ThisAd)
{
int bytesRead = 0;
Form1_0.bufferRead = new byte[aTypeSize["UChar"]];
ReadProcessMemory((int)Form1_0.processHandle, (IntPtr)((long)Form1_0.BaseAddress + (long)ThisAd), Form1_0.bufferRead, aTypeSize["UChar"], ref bytesRead);
if (bytesRead > 0)
{
return (char) Form1_0.bufferRead[0];
}
return '\0';
}
//###################################################################################################
public byte ReadByteRaw(IntPtr ThisAd)
{
int bytesRead = 0;
Form1_0.bufferRead = new byte[1];
ReadProcessMemory((int)Form1_0.processHandle, ThisAd, Form1_0.bufferRead, 1, ref bytesRead);
if (bytesRead > 0)
{
return Form1_0.bufferRead[0];
}
return 0;
}
public int ReadIntRaw(IntPtr ThisAd)
{
int bytesRead = 0;
Form1_0.bufferRead = new byte[aTypeSize["Int"]];
ReadProcessMemory((int)Form1_0.processHandle, ThisAd, Form1_0.bufferRead, aTypeSize["Int"], ref bytesRead);
if (bytesRead > 0)
{
return BitConverter.ToInt32(Form1_0.bufferRead, 0);
}
return 0;
}
public UInt16 ReadUInt16Raw(IntPtr ThisAd)
{
int bytesRead = 0;
Form1_0.bufferRead = new byte[aTypeSize["Short"]];
ReadProcessMemory((int)Form1_0.processHandle, ThisAd, Form1_0.bufferRead, aTypeSize["Short"], ref bytesRead);
if (bytesRead > 0)
{
return BitConverter.ToUInt16(Form1_0.bufferRead, 0);
}
return 0;
}
public UInt32 ReadUInt32Raw(IntPtr ThisAd)
{
int bytesRead = 0;
Form1_0.bufferRead = new byte[aTypeSize["Int"]];
ReadProcessMemory((int)Form1_0.processHandle, ThisAd, Form1_0.bufferRead, aTypeSize["Int"], ref bytesRead);
if (bytesRead > 0)
{
return BitConverter.ToUInt32(Form1_0.bufferRead, 0);
}
return 0;
}
public Int32 ReadInt32Raw(IntPtr ThisAd)
{
int bytesRead = 0;
Form1_0.bufferRead = new byte[aTypeSize["Int"]];
ReadProcessMemory((int)Form1_0.processHandle, ThisAd, Form1_0.bufferRead, aTypeSize["Int"], ref bytesRead);
if (bytesRead > 0)
{
return BitConverter.ToInt32(Form1_0.bufferRead, 0);
}
return 0;
}
public Int64 ReadInt64Raw(IntPtr ThisAd)
{
int bytesRead = 0;
Form1_0.bufferRead = new byte[aTypeSize["Int64"]];
ReadProcessMemory((int)Form1_0.processHandle, ThisAd, Form1_0.bufferRead, aTypeSize["Int64"], ref bytesRead);
if (bytesRead > 0)
{
try
{
return BitConverter.ToInt64(Form1_0.bufferRead, 0);
}
catch { }
}
return 0;
}
public char ReadUCharRaw(IntPtr ThisAd)
{
int bytesRead = 0;
Form1_0.bufferRead = new byte[aTypeSize["UChar"]];
ReadProcessMemory((int)Form1_0.processHandle, ThisAd, Form1_0.bufferRead, aTypeSize["UChar"], ref bytesRead);
if (bytesRead > 0)
{
return (char)Form1_0.bufferRead[0];
}
return '\0';
}
}
}

337
Strucs/MobsStruc.cs Normal file
View File

@ -0,0 +1,337 @@
using System;
using System.Drawing;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
using static System.Windows.Forms.AxHost;
using static app.MapAreaStruc;
namespace app
{
public class MobsStruc
{
Form1 Form1_0;
public long MobsPointerLocation = 0;
public long LastMobsPointerLocation = 0;
public string MobsName = "";
//public byte[] mobsdatastruc = new byte[144];
public uint txtFileNo = 0;
public int MobsHP = 0;
public long pPathPtr = 0;
private ushort itemx = 0;
private ushort itemy = 0;
public ushort xPosFinal = 0;
public ushort yPosFinal = 0;
public byte[] pPath = new byte[144];
public uint statCount = 0;
//public uint statExCount = 0;
public long statPtr = 0;
//public long statExPtr = 0;
public byte[] pStatB = new byte[180];
public byte[] statBuffer = new byte[] { };
public byte[] CurrentPointerBytes = new byte[8];
public Position LastMobPos = new Position { X = 0, Y = 0 };
public uint LastMobtxtFileNo = 0;
public void SetForm1(Form1 form1_1)
{
Form1_0 = form1_1;
}
public List<int[]> GetAllMobsNearby()
{
Form1_0.PatternsScan_0.scanForUnitsPointer("NPC");
List<int[]> monsterPositions2 = new List<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);
//uint FirrstName = txtFileNo;
CurrentPointerBytes = new byte[4];
Form1_0.Mem_0.ReadRawMemory(MobsPointerLocation + 4, ref CurrentPointerBytes, CurrentPointerBytes.Length);
txtFileNo = BitConverter.ToUInt32(CurrentPointerBytes, 0);
//long pStatsListExPtr = BitConverter.ToInt64(mobsdatastruc, 0x88);
CurrentPointerBytes = new byte[8];
Form1_0.Mem_0.ReadRawMemory(MobsPointerLocation + 0x88, ref CurrentPointerBytes, CurrentPointerBytes.Length);
long pStatsListExPtr = BitConverter.ToInt64(CurrentPointerBytes, 0);
bool isPlayerMinion = false;
if (getPlayerMinion((int)txtFileNo) != "") isPlayerMinion = true;
else isPlayerMinion = ((Form1_0.Mem_0.ReadUInt32((IntPtr)(pStatsListExPtr + 0xAC8 + 0xc)) & 31) == 1); //is a revive
if (Form1_0.NPCStruc_0.HideNPC((int)txtFileNo) == 0
&& Form1_0.NPCStruc_0.getTownNPC((int)txtFileNo) == ""
&& !isPlayerMinion)
//&& IsThisMobInBound())
//&& !ShouldBeIgnored(txtFileNo))
{
GetUnitPathData();
GetStatsAddr();
MobsHP = GetHPFromStats();
//Console.WriteLine("found near mob " + Form1_0.NPCStruc_0.getNPC_ID((int)txtFileNo) + " at: " + xPosFinal + ", " + yPosFinal + " HP:" + MobsHP);
if (xPosFinal != 0 && yPosFinal != 0)
{
//if (MobsHP != 0) monsterPositions2.Add(Tuple.Create((int) xPosFinal, (int) yPosFinal));
if (MobsHP != 0) monsterPositions2.Add(new int[2] { (int)xPosFinal, (int)yPosFinal });
}
}
}
}
return monsterPositions2;
}
public bool IsIgnored(List<long> IgnoredListPointers)
{
if (IgnoredListPointers.Count > 0)
{
for (int i = 0; i < IgnoredListPointers.Count; i++)
{
if (IgnoredListPointers[i] == MobsPointerLocation)
{
return true;
}
}
}
return false;
}
public void GetStatsAddr()
{
//long pStatsListExPtr = BitConverter.ToInt64(mobsdatastruc, 0x88);
CurrentPointerBytes = new byte[8];
Form1_0.Mem_0.ReadRawMemory(MobsPointerLocation + 0x88, ref CurrentPointerBytes, CurrentPointerBytes.Length);
try
{
long pStatsListExPtr = BitConverter.ToInt64(CurrentPointerBytes, 0);
/*pStatB = new byte[180];
Form1_0.Mem_0.ReadRawMemory(pStatsListExPtr, ref pStatB, 180);
statPtr = BitConverter.ToInt64(pStatB, 0x30);
statCount = BitConverter.ToUInt32(pStatB, 0x38);
statExPtr = BitConverter.ToInt64(pStatB, 0x88);
statExCount = BitConverter.ToUInt32(pStatB, 0x90);*/
statPtr = Form1_0.Mem_0.ReadInt64Raw((IntPtr)(pStatsListExPtr + 0x30));
statCount = Form1_0.Mem_0.ReadUInt32Raw((IntPtr)(pStatsListExPtr + 0x38));
//statExPtr = Form1_0.Mem_0.ReadInt64Raw((IntPtr)(pStatsListExPtr + 0x88));
//statExCount = Form1_0.Mem_0.ReadUInt32Raw((IntPtr)(pStatsListExPtr + 0x90));
//string SavePathh = Form1_0.ThisEndPath + "DumpItempStatBStruc";
//File.Create(SavePathh).Dispose();
//File.WriteAllBytes(SavePathh, pStatB);
}
catch { }
}
public void GetUnitPathData()
{
//pPathPtr = BitConverter.ToInt64(mobsdatastruc, 0x38);
CurrentPointerBytes = new byte[8];
Form1_0.Mem_0.ReadRawMemory(MobsPointerLocation + 0x38, ref CurrentPointerBytes, CurrentPointerBytes.Length);
pPathPtr = BitConverter.ToInt64(CurrentPointerBytes, 0);
//pPath = new byte[144];
pPath = new byte[0x08];
Form1_0.Mem_0.ReadRawMemory(pPathPtr, ref pPath, pPath.Length);
itemx = BitConverter.ToUInt16(pPath, 0x02);
itemy = BitConverter.ToUInt16(pPath, 0x06);
ushort xPosOffset = BitConverter.ToUInt16(pPath, 0x00);
ushort yPosOffset = BitConverter.ToUInt16(pPath, 0x04);
int xPosOffsetPercent = (xPosOffset / 65536); //get percentage
int yPosOffsetPercent = (yPosOffset / 65536); //get percentage
xPosFinal = (ushort)(itemx + xPosOffsetPercent);
yPosFinal = (ushort)(itemy + yPosOffsetPercent);
//string SavePathh = Form1_0.ThisEndPath + "DumpItempPathStruc";
//File.Create(SavePathh).Dispose();
//File.WriteAllBytes(SavePathh, pPath);
}
public int GetHPFromStats()
{
//try
//{
if (this.statCount < 100)
{
Form1_0.Mem_0.ReadRawMemory(this.statPtr, ref statBuffer, (int)(this.statCount * 10));
for (int i = 0; i < this.statCount; i++)
{
int offset = i * 8;
short statLayer = BitConverter.ToInt16(statBuffer, offset);
ushort statEnum = BitConverter.ToUInt16(statBuffer, offset + 0x2);
int statValue = BitConverter.ToInt32(statBuffer, offset + 0x4);
if (statEnum == 6)
{
//byte[] RunBuf = new byte[4];
//Form1_0.Mem_0.WriteRawMemory((IntPtr)(this.statPtr + offset + 0x4), RunBuf, 4);
return statValue;
}
}
}
/*if (this.statExCount < 100)
{
Form1_0.Mem_0.ReadRawMemory(this.statExPtr, ref statBuffer, (int)(this.statExCount * 10));
for (int i = 0; i < this.statExCount; i++)
{
int offset = i * 8;
short statLayer = BitConverter.ToInt16(statBuffer, offset);
ushort statEnum = BitConverter.ToUInt16(statBuffer, offset + 0x2);
int statValue = BitConverter.ToInt32(statBuffer, offset + 0x4);
if (statEnum == 6)
{
//byte[] RunBuf = new byte[4];
//Form1_0.Mem_0.WriteRawMemory((IntPtr)(this.statExPtr + offset + 0x4), RunBuf, 4);
return statValue;
}
}
}
else
{
Console.WriteLine("statExCount too long > 100: " + this.statExCount);
}*/
//}
//catch { }
return 0; // or some other default value
}
public string getBossName(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"; //543
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";
}
return "";
}
public string getPlayerMinion(int txtFileNo)
{
switch (txtFileNo)
{
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";
}
return "";
}
public string getSuperUniqueName(int txtFileNo)
{
switch (txtFileNo)
{
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 310: return "Infector of Souls";
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 "Eldritch"; //Eldritch //Megaflow Rectifier
case 472: return "Anodized Elite";
case 475: return "Vinvear Molech";
case 479: return "Shenk"; //Overseer //Shenk //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";
}
return "";
}
}
}

324
Strucs/NPCStruc.cs Normal file
View File

@ -0,0 +1,324 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace app
{
public class NPCStruc
{
Form1 Form1_0;
public void SetForm1(Form1 form1_1)
{
Form1_0 = form1_1;
}
public string getTownNPC(int txtFileNo)
{
switch (txtFileNo)
{
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 string getNPC_ID(int txtFileNo)
{
switch (txtFileNo)
{
case 156: return "Andariel";
case 211: return "Duriel";
case 229: return "Radament";
case 744: return "Radament2";
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 745: return "CubeNPC";
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)
{
return true;
}
return false;
}*/
// certain NPCs we don't want to see such as mercs
public int HideNPC(int txtFileNo)
{
switch (txtFileNo)
{
case 0: return 1; //UNKOWN
case 149: return 1; //Chicken
case 151: return 1; //Rat
case 152: return 1; //Rogue
case 153: return 1; //HellMeteor
case 157: return 1; //Bird
case 158: return 1; //Bird2
case 159: return 1; //Bat
case 194: return 1; //Hadriel
case 195: return 1; //Act2Male
case 196: return 1; //Act2Female
case 197: return 1; //Act2Child
case 179: return 1; //Cow
case 185: return 1; //Camel
case 203: return 1; //Act2Guard
case 204: return 1; //Act2Vendor
case 205: return 1; //Act2Vendor2
case 227: return 1; //Maggot
case 268: return 1; //Bug
case 269: return 1; //Scorpion
// case 271: return 1; //Rogue2
case 272: return 1; //Rogue3
case 283: return 1; //Larva
case 293: return 1; //Familiar
case 294: return 1; //Act3Male
// case 289: return 1; //ClayGolem
// case 290: return 1; //BloodGolem
// case 291: return 1; //IronGolem
// case 292: return 1; //FireGolem
case 296: return 1; //Act3Female
case 318: return 1; //Snake
case 319: return 1; //Parrot
case 320: return 1; //Fish
case 321: return 1; //EvilHole
case 322: return 1; //EvilHole2
case 323: return 1; //EvilHole3
case 324: return 1; //EvilHole4
case 325: return 1; //EvilHole5
case 326: return 1; //FireboltTrap
case 327: return 1; //HorzMissileTrap
case 328: return 1; //VertMissileTrap
case 329: return 1; //PoisonCloudTrap
case 330: return 1; //LightningTrap
case 332: return 1; //InvisoSpawner
// case 338: return 1; //Guard or DEAD BODY!!!
case 339: return 1; //MiniSpider
case 344: return 1; //BoneWall
case 351: return 1; //Hydra
case 352: return 1; //Hydra2
case 353: return 1; //Hydra3
case 355: return 1; //SevenTombs
// case 357: return 1; //Valkyrie
// case 359: return 1; //IronWolf
// case 363: return 1; //NecroSkeleton
// case 364: return 1; //NecroMage
case 366: return 1; //CompellingOrb},
case 370: return 1; //SpiritMummy
case 377: return 1; //Act2Guard4
case 378: return 1; //Act2Guard5
case 392: return 1; //Window
case 393: return 1; //Window2
case 401: return 1; //MephistoSpirit
case 410: return 1; //WakeOfDestruction
case 411: return 1; //ChargedBoltSentry
case 412: return 1; //LightningSentry
case 414: return 1; //InvisiblePet
case 415: return 1; //InfernoSentry
case 416: return 1; //DeathSentry
// case 417: return 1; //ShadowWarrior
// case 418: return 1; //ShadowMaster
// case 419: return 1; //DruidHawk
// case 420: return 1; //DruidSpiritWolf
// case 421: return 1; //DruidFenris
// case 423: return 1; //HeartOfWolverine
// case 424: return 1; //OakSage
// case 428: return 1; //DruidBear
case 543: return 1; //BaalThrone
case 567: return 1; //InjuredBarbarian
case 568: return 1; //InjuredBarbarian2
case 569: return 1; //InjuredBarbarian3
case 711: return 1; //DemonHole
}
return 0;
}
}
}

769
Strucs/ObjectsStruc.cs Normal file
View File

@ -0,0 +1,769 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace app
{
public class ObjectsStruc
{
Form1 Form1_0;
public void SetForm1(Form1 form1_1)
{
Form1_0 = form1_1;
}
public string getObjectName(int txtFileNo)
{
switch (txtFileNo)
{
case 1: return "Casket5";
case 2: return "Shrine";
case 3: return "Casket6";
case 4: return "LargeUrn1";
case 5: return "LargeChestRight";
case 6: return "LargeChestLeft";
case 7: return "Barrel";
case 8: return "TowerTome";
case 9: return "Urn2";
case 10: return "Bench";
case 11: return "BarrelExploding";
case 12: return "RogueFountain";
case 13: return "DoorGateLeft";
case 14: return "DoorGateRight";
case 15: return "DoorWoodenLeft";
case 16: return "DoorWoodenRight";
case 17: return "CairnStoneAlpha";
case 18: return "CairnStoneBeta";
case 19: return "CairnStoneGamma";
case 20: return "CairnStoneDelta";
case 21: return "CairnStoneLambda";
case 22: return "CairnStoneTheta";
case 23: return "DoorCourtyardLeft";
case 24: return "DoorCourtyardRight";
case 25: return "DoorCathedralDouble";
case 26: return "CainGibbet";
case 27: return "DoorMonasteryDoubleRight";
case 28: return "HoleAnim";
case 29: return "Brazier";
case 30: return "InifussTree";
case 31: return "Fountain";
case 32: return "Crucifix";
case 33: return "Candles1";
case 34: return "Candles2";
case 35: return "Standard1";
case 36: return "Standard2";
case 37: return "Torch1Tiki";
case 38: return "Torch2Wall";
case 39: return "RogueBonfire";
case 40: return "River1";
case 41: return "River2";
case 42: return "River3";
case 43: return "River4";
case 44: return "River5";
case 45: return "AmbientSoundGenerator";
case 46: return "Crate";
case 47: return "AndarielDoor";
case 48: return "RogueTorch1";
case 49: return "RogueTorch2";
case 50: return "CasketR";
case 51: return "CasketL";
case 52: return "Urn3";
case 53: return "Casket";
case 54: return "RogueCorpse1";
case 55: return "RogueCorpse2";
case 56: return "RogueCorpseRolling";
case 57: return "CorpseOnStick1";
case 58: return "CorpseOnStick2";
case 59: return "TownPortal";
case 60: return "PermanentTownPortal";
case 61: return "InvisibleObject";
case 62: return "DoorCathedralLeft";
case 63: return "DoorCathedralRight";
case 64: return "DoorWoodenLeft2";
case 65: return "InvisibleRiverSound1";
case 66: return "InvisibleRiverSound2";
case 67: return "Ripple1";
case 68: return "Ripple2";
case 69: return "Ripple3";
case 70: return "Ripple4";
case 71: return "ForestNightSound1";
case 72: return "ForestNightSound2";
case 73: return "YetiDung";
case 74: return "TrappDoor";
case 75: return "DoorByAct2Dock";
case 76: return "SewerDrip";
case 77: return "HealthOrama";
case 78: return "InvisibleTownSound";
case 79: return "Casket3";
case 80: return "Obelisk";
case 81: return "ForestAltar";
case 82: return "BubblingPoolOfBlood";
case 83: return "HornShrine";
case 84: return "HealingWell";
case 85: return "BullHealthShrine";
case 86: return "SteleDesertMagicShrine";
case 87: return "TombLargeChestL";
case 88: return "TombLargeChestR";
case 89: return "Sarcophagus";
case 90: return "DesertObelisk";
case 91: return "TombDoorLeft";
case 92: return "TombDoorRight";
case 93: return "InnerHellManaShrine";
case 94: return "LargeUrn4";
case 95: return "LargeUrn5";
case 96: return "InnerHellHealthShrine";
case 97: return "InnerHellShrine";
case 98: return "TombDoorLeft2";
case 99: return "TombDoorRight2";
case 100: return "DurielsLairPortal";
case 101: return "Brazier3";
case 102: return "FloorBrazier";
case 103: return "Flies";
case 104: return "ArmorStandRight";
case 105: return "ArmorStandLeft";
case 106: return "WeaponRackRight";
case 107: return "WeaponRackLeft";
case 108: return "Malus";
case 109: return "PalaceHealthShrine";
case 110: return "Drinker";
case 111: return "Fountain1";
case 112: return "Gesturer";
case 113: return "DesertFountain";
case 114: return "Turner";
case 115: return "Fountain3";
case 116: return "SnakeWomanShrine";
case 117: return "JungleTorch";
case 118: return "Fountain4";
case 119: return "WaypointPortal";
case 120: return "DungeonHealthShrine";
case 121: return "JerhynPlaceHolder1";
case 122: return "JerhynPlaceHolder2";
case 123: return "InnerHellShrine2";
case 124: return "InnerHellShrine3";
case 125: return "InnerHellHiddenStash";
case 126: return "InnerHellSkullPile";
case 127: return "InnerHellHiddenStash2";
case 128: return "InnerHellHiddenStash3";
case 129: return "SecretDoor1";
case 130: return "Act1WildernessWell";
case 131: return "VileDogAfterglow";
case 132: return "CathedralWell";
case 133: return "ArcaneSanctuaryShrine";
case 134: return "DesertShrine2";
case 135: return "DesertShrine3";
case 136: return "DesertShrine1";
case 137: return "DesertWell";
case 138: return "CaveWell";
case 139: return "Act1LargeChestRight";
case 140: return "Act1TallChestRight";
case 141: return "Act1MediumChestRight";
case 142: return "DesertJug1";
case 143: return "DesertJug2";
case 144: return "Act1LargeChest1";
case 145: return "InnerHellWaypoint";
case 146: return "Act2MediumChestRight";
case 147: return "Act2LargeChestRight";
case 148: return "Act2LargeChestLeft";
case 149: return "TaintedSunAltar";
case 150: return "DesertShrine5";
case 151: return "DesertShrine4";
case 152: return "HoradricOrifice";
case 153: return "TyraelsDoor";
case 154: return "GuardCorpse";
case 155: return "HiddenStashRock";
case 156: return "Act2Waypoint";
case 157: return "Act1WildernessWaypoint";
case 158: return "SkeletonCorpseIsAnOxymoron";
case 159: return "HiddenStashRockB";
case 160: return "SmallFire";
case 161: return "MediumFire";
case 162: return "LargeFire";
case 163: return "Act1CliffHidingSpot";
case 164: return "ManaWell1";
case 165: return "ManaWell2";
case 166: return "ManaWell3";
case 167: return "ManaWell4";
case 168: return "ManaWell5";
case 169: return "HollowLog";
case 170: return "JungleHealWell";
case 171: return "SkeletonCorpseIsStillAnOxymoron";
case 172: return "DesertHealthShrine";
case 173: return "ManaWell7";
case 174: return "LooseRock";
case 175: return "LooseBoulder";
case 176: return "MediumChestLeft";
case 177: return "LargeChestLeft2";
case 178: return "GuardCorpseOnAStick";
case 179: return "Bookshelf1";
case 180: return "Bookshelf2";
case 181: return "JungleChest";
case 182: return "TombCoffin";
case 183: return "JungleMediumChestLeft";
case 184: return "JungleShrine2";
case 185: return "JungleStashObject1";
case 186: return "JungleStashObject2";
case 187: return "JungleStashObject3";
case 188: return "JungleStashObject4";
case 189: return "DummyCainPortal";
case 190: return "JungleShrine3";
case 191: return "JungleShrine4";
case 192: return "TeleportationPad1";
case 193: return "LamEsensTome";
case 194: return "StairsL";
case 195: return "StairsR";
case 196: return "FloorTrap";
case 197: return "JungleShrine5";
case 198: return "TallChestLeft";
case 199: return "MephistoShrine1";
case 200: return "MephistoShrine2";
case 201: return "MephistoShrine3";
case 202: return "MephistoManaShrine";
case 203: return "MephistoLair";
case 204: return "StashBox";
case 205: return "StashAltar";
case 206: return "MafistoHealthShrine";
case 207: return "Act3WaterRocks";
case 208: return "Basket1";
case 209: return "Basket2";
case 210: return "Act3WaterLogs";
case 211: return "Act3WaterRocksGirl";
case 212: return "Act3WaterBubbles";
case 213: return "Act3WaterLogsX";
case 214: return "Act3WaterRocksB";
case 215: return "Act3WaterRocksGirlC";
case 216: return "Act3WaterRocksY";
case 217: return "Act3WaterLogsZ";
case 218: return "WebCoveredTree1";
case 219: return "WebCoveredTree2";
case 220: return "WebCoveredTree3";
case 221: return "WebCoveredTree4";
case 222: return "Pillar";
case 223: return "Cocoon";
case 224: return "Cocoon2";
case 225: return "SkullPileH1";
case 226: return "OuterHellShrine";
case 227: return "Act3WaterRocksGirlW";
case 228: return "Act3BigLog";
case 229: return "SlimeDoor1";
case 230: return "SlimeDoor2";
case 231: return "OuterHellShrine2";
case 232: return "OuterHellShrine3";
case 233: return "PillarH2";
case 234: return "Act3BigLogC";
case 235: return "Act3BigLogD";
case 236: return "HellHealthShrine";
case 237: return "Act3TownWaypoint";
case 238: return "WaypointH";
case 239: return "BurningBodyTown";
case 240: return "Gchest1L";
case 241: return "Gchest2R";
case 242: return "Gchest3R";
case 243: return "GLchest3L";
case 244: return "SewersRatNest";
case 245: return "BurningBodyTown2";
case 246: return "SewersRatNest2";
case 247: return "Act1BedBed1";
case 248: return "Act1BedBed2";
case 249: return "HellManaShrine";
case 250: return "ExplodingCow";
case 251: return "GidbinnAltar";
case 252: return "GidbinnAltarDecoy";
case 253: return "DiabloRightLight";
case 254: return "DiabloLeftLight";
case 255: return "DiabloStartPoint";
case 256: return "Act1CabinStool";
case 257: return "Act1CabinWood";
case 258: return "Act1CabinWood2";
case 259: return "HellSkeletonSpawnNW";
case 260: return "Act1HolyShrine";
case 261: return "TombsFloorTrapSpikes";
case 262: return "Act1CathedralShrine";
case 263: return "Act1JailShrine1";
case 264: return "Act1JailShrine2";
case 265: return "Act1JailShrine3";
case 266: return "MaggotLairGooPile";
case 267: return "Bank";
case 268: return "WirtCorpse";
case 269: return "GoldPlaceHolder";
case 270: return "GuardCorpse2";
case 271: return "DeadVillager1";
case 272: return "DeadVillager2";
case 273: return "DummyFlameNoDamage";
case 274: return "TinyPixelShapedThingie";
case 275: return "CavesHealthShrine";
case 276: return "CavesManaShrine";
case 277: return "CaveMagicShrine";
case 278: return "Act3DungeonManaShrine";
case 279: return "Act3SewersMagicShrine1";
case 280: return "Act3SewersHealthWell";
case 281: return "Act3SewersManaWell";
case 282: return "Act3SewersMagicShrine2";
case 283: return "Act2BrazierCeller";
case 284: return "Act2TombAnubisCoffin";
case 285: return "Act2Brazier";
case 286: return "Act2BrazierTall";
case 287: return "Act2BrazierSmall";
case 288: return "Act2CellerWaypoint";
case 289: return "HarumBedBed";
case 290: return "IronGrateDoorLeft";
case 291: return "IronGrateDoorRight";
case 292: return "WoodenGrateDoorLeft";
case 293: return "WoodenGrateDoorRight";
case 294: return "WoodenDoorLeft";
case 295: return "WoodenDoorRight";
case 296: return "TombsWallTorchLeft";
case 297: return "TombsWallTorchRight";
case 298: return "ArcaneSanctuaryPortal";
case 299: return "Act2HaramMagicShrine1";
case 300: return "Act2HaramMagicShrine2";
case 301: return "MaggotHealthWell";
case 302: return "MaggotManaWell";
case 303: return "ArcaneSanctuaryMagicShrine";
case 304: return "TeleportationPad2";
case 305: return "TeleportationPad3";
case 306: return "TeleportationPad4";
case 307: return "DummyArcaneThing1";
case 308: return "DummyArcaneThing2";
case 309: return "DummyArcaneThing3";
case 310: return "DummyArcaneThing4";
case 311: return "DummyArcaneThing5";
case 312: return "DummyArcaneThing6";
case 313: return "DummyArcaneThing7";
case 314: return "HaremDeadGuard1";
case 315: return "HaremDeadGuard2";
case 316: return "HaremDeadGuard3";
case 317: return "HaremDeadGuard4";
case 318: return "HaremEunuchBlocker";
case 319: return "ArcaneHealthWell";
case 320: return "ArcaneManaWell";
case 321: return "TestData2";
case 322: return "Act2TombWell";
case 323: return "Act2SewerWaypoint";
case 324: return "Act3TravincalWaypoint";
case 325: return "Act3SewerMagicShrine";
case 326: return "Act3SewerDeadBody";
case 327: return "Act3SewerTorch";
case 328: return "Act3KurastTorch";
case 329: return "MafistoLargeChestLeft";
case 330: return "MafistoLargeChestRight";
case 331: return "MafistoMediumChestLeft";
case 332: return "MafistoMediumChestRight";
case 333: return "SpiderLairLargeChestLeft";
case 334: return "SpiderLairTallChestLeft";
case 335: return "SpiderLairMediumChestRight";
case 336: return "SpiderLairTallChestRight";
case 337: return "SteegStone";
case 338: return "GuildVault";
case 339: return "TrophyCase";
case 340: return "MessageBoard";
case 341: return "MephistoBridge";
case 342: return "HellGate";
case 343: return "Act3KurastManaWell";
case 344: return "Act3KurastHealthWell";
case 345: return "HellFire1";
case 346: return "HellFire2";
case 347: return "HellFire3";
case 348: return "HellLava1";
case 349: return "HellLava2";
case 350: return "HellLava3";
case 351: return "HellLightSource1";
case 352: return "HellLightSource2";
case 353: return "HellLightSource3";
case 354: return "HoradricCubeChest";
case 355: return "HoradricScrollChest";
case 356: return "StaffOfKingsChest";
case 357: return "YetAnotherTome";
case 358: return "HellBrazier1";
case 359: return "HellBrazier2";
case 360: return "DungeonRockPile";
case 361: return "Act3DungeonMagicShrine";
case 362: return "Act3DungeonBasket";
case 363: return "OuterHellHungSkeleton";
case 364: return "GuyForDungeon";
case 365: return "Act3DungeonCasket";
case 366: return "Act3SewerStairs";
case 367: return "Act3SewerStairsToLevel3";
case 368: return "DarkWandererStartPosition";
case 369: return "TrappedSoulPlaceHolder";
case 370: return "Act3TownTorch";
case 371: return "LargeChestR";
case 372: return "InnerHellBoneChest";
case 373: return "HellSkeletonSpawnNE";
case 374: return "Act3WaterFog";
case 375: return "DummyNotUsed";
case 376: return "HellForge";
case 377: return "GuildPortal";
case 378: return "HratliStartPosition";
case 379: return "HratliEndPosition";
case 380: return "BurningTrappedSoul1";
case 381: return "BurningTrappedSoul2";
case 382: return "NatalyaStartPosition";
case 383: return "StuckedTrappedSoul1";
case 384: return "StuckedTrappedSoul2";
case 385: return "CainStartPosition";
case 386: return "StairSR";
case 387: return "ArcaneLargeChestLeft";
case 388: return "ArcaneCasket";
case 389: return "ArcaneLargeChestRight";
case 390: return "ArcaneSmallChestLeft";
case 391: return "ArcaneSmallChestRight";
case 392: return "DiabloSeal1";
case 393: return "DiabloSeal2";
case 394: return "DiabloSeal3";
case 395: return "DiabloSeal4";
case 396: return "DiabloSeal5";
case 397: return "SparklyChest";
case 398: return "PandamoniumFortressWaypoint";
case 399: return "InnerHellFissure";
case 400: return "HellMesaBrazier";
case 401: return "Smoke";
case 402: return "ValleyWaypoint";
case 403: return "HellBrazier3";
case 404: return "CompellingOrb";
case 405: return "KhalimChest1";
case 406: return "KhalimChest2";
case 407: return "KhalimChest3";
case 408: return "SiegeMachineControl";
case 409: return "PotOTorch";
case 410: return "PyoxFirePit";
case 413: return "ExpansionChestRight";
case 414: return "ExpansionWildernessShrine1";
case 415: return "ExpansionWildernessShrine2";
case 416: return "ExpansionHiddenStash";
case 417: return "ExpansionWildernessFlag";
case 418: return "ExpansionWildernessBarrel";
case 419: return "ExpansionSiegeBarrel";
case 420: return "ExpansionWoodChestLeft";
case 421: return "ExpansionWildernessShrine3";
case 422: return "ExpansionManaShrine";
case 423: return "ExpansionHealthShrine";
case 424: return "BurialChestLeft";
case 425: return "BurialChestRight";
case 426: return "ExpansionWell";
case 427: return "ExpansionWildernessShrine4";
case 428: return "ExpansionWildernessShrine5";
case 429: return "ExpansionWaypoint";
case 430: return "ExpansionChestLeft";
case 431: return "ExpansionWoodChestRight";
case 432: return "ExpansionSmallChestLeft";
case 433: return "ExpansionSmallChestRight";
case 434: return "ExpansionTorch1";
case 435: return "ExpansionCampFire";
case 436: return "ExpansionTownTorch";
case 437: return "ExpansionTorch2";
case 438: return "ExpansionBurningBodies";
case 439: return "ExpansionBurningPit";
case 440: return "ExpansionTribalFlag";
case 441: return "ExpansionTownFlag";
case 442: return "ExpansionChandelier";
case 443: return "ExpansionJar1";
case 444: return "ExpansionJar2";
case 445: return "ExpansionJar3";
case 446: return "ExpansionSwingingHeads";
case 447: return "ExpansionWildernessPole";
case 448: return "AnimatedSkullAndRockPile";
case 449: return "ExpansionTownGate";
case 450: return "SkullAndRockPile";
case 451: return "SiegeHellGate";
case 452: return "EnemyCampBanner1";
case 453: return "EnemyCampBanner2";
case 454: return "ExpansionExplodingChest";
case 455: return "ExpansionSpecialChest";
case 456: return "ExpansionDeathPole";
case 457: return "ExpansionDeathPoleLeft";
case 458: return "TempleAltar";
case 459: return "DrehyaTownStartPosition";
case 460: return "DrehyaWildernessStartPosition";
case 461: return "NihlathakTownStartPosition";
case 462: return "NihlathakWildernessStartPosition";
case 463: return "IceCaveHiddenStash";
case 464: return "IceCaveHealthShrine";
case 465: return "IceCaveManaShrine";
case 466: return "IceCaveEvilUrn";
case 467: return "IceCaveJar1";
case 468: return "IceCaveJar2";
case 469: return "IceCaveJar3";
case 470: return "IceCaveJar4";
case 471: return "IceCaveJar5";
case 472: return "IceCaveMagicShrine";
case 473: return "CagedWussie";
case 474: return "AncientStatue3";
case 475: return "AncientStatue1";
case 476: return "AncientStatue2";
case 477: return "DeadBarbarian";
case 478: return "ClientSmoke";
case 479: return "IceCaveMagicShrine2";
case 480: return "IceCaveTorch1";
case 481: return "IceCaveTorch2";
case 482: return "ExpansionTikiTorch";
case 483: return "WorldstoneManaShrine";
case 484: return "WorldstoneHealthShrine";
case 485: return "WorldstoneTomb1";
case 486: return "WorldstoneTomb2";
case 487: return "WorldstoneTomb3";
case 488: return "WorldstoneMagicShrine";
case 489: return "WorldstoneTorch1";
case 490: return "WorldstoneTorch2";
case 491: return "ExpansionSnowyManaShrine1";
case 492: return "ExpansionSnowyHealthShrine";
case 493: return "ExpansionSnowyWell";
case 494: return "WorldstoneWaypoint";
case 495: return "ExpansionSnowyMagicShrine2";
case 496: return "ExpansionWildernessWaypoint";
case 497: return "ExpansionSnowyMagicShrine3";
case 498: return "WorldstoneWell";
case 499: return "WorldstoneMagicShrine2";
case 500: return "ExpansionSnowyObject1";
case 501: return "ExpansionSnowyWoodChestLeft";
case 502: return "ExpansionSnowyWoodChestRight";
case 503: return "WorldstoneMagicShrine3";
case 504: return "ExpansionSnowyWoodChest2Left";
case 505: return "ExpansionSnowyWoodChest2Right";
case 506: return "SnowySwingingHeads";
case 507: return "SnowyDebris";
case 508: return "PenBreakableDoor";
case 509: return "ExpansionTempleMagicShrine1";
case 510: return "ExpansionSnowyPoleMR";
case 511: return "IceCaveWaypoint";
case 512: return "ExpansionTempleMagicShrine2";
case 513: return "ExpansionTempleWell";
case 514: return "ExpansionTempleTorch1";
case 515: return "ExpansionTempleTorch2";
case 516: return "ExpansionTempleObject1";
case 517: return "ExpansionTempleObject2";
case 518: return "WorldstoneMrBox";
case 519: return "IceCaveWell";
case 520: return "ExpansionTempleMagicShrine";
case 521: return "ExpansionTempleHealthShrine";
case 522: return "ExpansionTempleManaShrine";
case 523: return "BlacksmithForge";
case 524: return "WorldstoneTomb1Left";
case 525: return "WorldstoneTomb2Left";
case 526: return "WorldstoneTomb3Left";
case 527: return "IceCaveBubblesU";
case 528: return "IceCaveBubblesS";
case 529: return "RedBaalsLairTomb1";
case 530: return "RedBaalsLairTomb1Left";
case 531: return "RedBaalsLairTomb2";
case 532: return "RedBaalsLairTomb2Left";
case 533: return "RedBaalsLairTomb3";
case 534: return "RedBaalsLairTomb3Left";
case 535: return "RedBaalsLairMrBox";
case 536: return "RedBaalsLairTorch1";
case 537: return "RedBaalsLairTorch2";
case 538: return "CandlesTemple";
case 539: return "TempleWaypoint";
case 540: return "ExpansionDeadPerson1";
case 541: return "TempleGroundTomb";
case 542: return "LarzukGreeting";
case 543: return "LarzukStandard";
case 544: return "TempleGroundTombLeft";
case 545: return "ExpansionDeadPerson2";
case 546: return "AncientsAltar";
case 547: return "ArreatSummitDoorToWorldstone";
case 548: return "ExpansionWeaponRackRight";
case 549: return "ExpansionWeaponRackLeft";
case 550: return "ExpansionArmorStandRight";
case 551: return "ExpansionArmorStandLeft";
case 552: return "ArreatsSummitTorch2";
case 553: return "ExpansionFuneralSpire";
case 554: return "ExpansionBurningLogs";
case 555: return "IceCaveSteam";
case 556: return "ExpansionDeadPerson3";
case 557: return "BaalsLair";
case 558: return "FrozenAnya";
case 559: return "BBQBunny";
case 560: return "BaalTorchBig";
case 561: return "InvisibleAncient";
case 562: return "InvisibleBase";
case 563: return "BaalsPortal";
case 564: return "ArreatSummitDoor";
case 565: return "LastPortal";
case 566: return "LastLastPortal";
case 567: return "ZooTestData";
case 568: return "KeeperTestData";
case 569: return "BaalsPortal2";
case 570: return "FirePlaceGuy";
case 571: return "DoorBlocker1";
case 572: return "DoorBlocker2";
case 580: return "GoodChest";
case 581: return "NotSoGoodChest";
}
return "";
}
public bool IsWaypoint(int txtFileNo)
{
switch (txtFileNo)
{
case 539: return true;
case 511: return true;
case 496: return true;
case 494: return true;
case 429: return true;
case 402: return true;
case 398: return true;
case 323: return true;
case 324: return true;
case 288: return true;
case 237: return true;
case 238: return true;
case 156: return true;
case 157: return true;
case 145: return true;
case 119: return true;
default: return false;
}
}
public int isChest(int txtFileNo)
{
switch (txtFileNo)
{
case 1: return 1; //";Casket5";
case 3: return 1; //";Casket6";
case 5: return 1; //";LargeChestRight";
case 6: return 1; //";LargeChestLeft";
case 50: return 1; //";CasketR";
case 51: return 1; //";CasketL";
case 53: return 1; //";Casket";
case 54: return 1; //";RogueCorpse1";
case 55: return 1; //";RogueCorpse2";
case 56: return 1; //";RogueCorpseRolling";
case 57: return 1; //";CorpseOnStick1";
case 58: return 1; //";CorpseOnStick2";
case 79: return 1; //";Casket3";
case 87: return 1; //";TombLargeChestL";
case 88: return 1; //";TombLargeChestR";
case 89: return 1; //";Sarcophagus";
case 125: return 1; //";InnerHellHiddenStash";
case 126: return 1; //";InnerHellSkullPile";
case 127: return 1; //";InnerHellHiddenStash2";
case 128: return 1; //";InnerHellHiddenStash3";
case 139: return 1; //";Act1LargeChestRight";
case 140: return 1; //";Act1TallChestRight";
case 141: return 1; //";Act1MediumChestRight";
case 144: return 1; //";Act1LargeChest1";
case 146: return 1; //";Act2MediumChestRight";
case 147: return 1; //";Act2LargeChestRight";
case 148: return 1; //";Act2LargeChestLeft";
case 154: return 1; //";GuardCorpse";
case 155: return 1; //";HiddenStashRock";
case 158: return 1; //";SkeletonCorpseIsAnOxymoron";
case 159: return 1; //";HiddenStashRockB";
case 169: return 1; //";HollowLog";
case 171: return 1; //";SkeletonCorpseIsStillAnOxymoron";
case 174: return 1; //";LooseRock";
case 175: return 1; //";LooseBoulder";
case 176: return 1; //";MediumChestLeft";
case 177: return 1; //";LargeChestLeft2";
case 178: return 1; //";GuardCorpseOnAStick";
case 181: return 1; //";JungleChest";
case 182: return 1; //";TombCoffin";
case 183: return 1; //";JungleMediumChestLeft";
case 185: return 1; //";JungleStashObject1";
case 186: return 1; //";JungleStashObject2";
case 187: return 1; //";JungleStashObject3";
case 188: return 1; //";JungleStashObject4";
case 198: return 1; //";TallChestLeft";
case 203: return 1; //";MephistoLair";
case 204: return 1; //";StashBox";
case 205: return 1; //";StashAltar";
case 223: return 1; //";Cocoon";
case 224: return 1; //";Cocoon2";
case 225: return 1; //";SkullPileH1";
case 240: return 1; //";Gchest1L";
case 241: return 1; //";Gchest2R";
case 242: return 1; //";Gchest3R";
case 243: return 1; //";GLchest3L";
case 244: return 1; //";SewersRatNest";
case 247: return 1; //";Act1BedBed1";
case 248: return 1; //";Act1BedBed2";
case 266: return 1; //";MaggotLairGooPile";
case 268: return 1; //";WirtCorpse";
case 270: return 1; //";GuardCorpse2";
case 271: return 1; //";DeadVillager1";
case 272: return 1; //";DeadVillager2";
case 274: return 1; //";TinyPixelShapedThingie";
case 284: return 1; //";Act2TombAnubisCoffin";
case 314: return 1; //";HaremDeadGuard1";
case 315: return 1; //";HaremDeadGuard2";
case 316: return 1; //";HaremDeadGuard3";
case 317: return 1; //";HaremDeadGuard4";
case 326: return 1; //";Act3SewerDeadBody";
case 329: return 1; //";MafistoLargeChestLeft";
case 330: return 1; //";MafistoLargeChestRight";
case 331: return 1; //";MafistoMediumChestLeft";
case 332: return 1; //";MafistoMediumChestRight";
case 333: return 1; //";SpiderLairLargeChestLeft";
case 334: return 1; //";SpiderLairTallChestLeft";
case 335: return 1; //";SpiderLairMediumChestRight";
case 336: return 1; //";SpiderLairTallChestRight";
case 354: return 1; //";HoradricCubeChest";
case 355: return 1; //";HoradricScrollChest";
case 356: return 1; //";StaffOfKingsChest";
case 360: return 1; //";DungeonRockPile";
case 371: return 1; //";LargeChestR";
case 372: return 1; //";InnerHellBoneChest";
case 380: return 1; //";BurningTrappedSoul1";
case 381: return 1; //";BurningTrappedSoul2";
case 383: return 1; //";StuckedTrappedSoul1";
case 384: return 1; //";StuckedTrappedSoul2";
case 387: return 1; //";ArcaneLargeChestLeft";
case 388: return 1; //";ArcaneCasket";
case 389: return 1; //";ArcaneLargeChestRight";
case 390: return 1; //";ArcaneSmallChestLeft";
case 391: return 1; //";ArcaneSmallChestRight";
case 397: return 1; //";SparklyChest";
case 405: return 1; //";KhalimChest1";
case 406: return 1; //";KhalimChest2";
case 407: return 1; //";KhalimChest3";
case 413: return 1; //";ExpansionChestRight";
case 416: return 1; //";ExpansionHiddenStash";
case 420: return 1; //";ExpansionWoodChestLeft";
case 424: return 1; //";BurialChestLeft";
case 425: return 1; //";BurialChestRight";
case 430: return 1; //";ExpansionChestLeft";
case 431: return 1; //";ExpansionWoodChestRight";
case 432: return 1; //";ExpansionSmallChestLeft";
case 433: return 1; //";ExpansionSmallChestRight";
case 454: return 1; //";ExpansionExplodingChest";
case 455: return 1; //";ExpansionSpecialChest";
case 463: return 1; //";IceCaveHiddenStash";
case 466: return 1; //";IceCaveEvilUrn";
case 485: return 1; //";WorldstoneTomb1";
case 486: return 1; //";WorldstoneTomb2";
case 487: return 1; //";WorldstoneTomb3";
case 501: return 1; //";ExpansionSnowyWoodChestLeft";
case 502: return 1; //";ExpansionSnowyWoodChestRight";
case 504: return 1; //";ExpansionSnowyWoodChest2Left";
case 505: return 1; //";ExpansionSnowyWoodChest2Right";
case 518: return 1; //";WorldstoneMrBox";
case 524: return 1; //";WorldstoneTomb1Left";
case 525: return 1; //";WorldstoneTomb2Left";
case 526: return 1; //";WorldstoneTomb3Left";
case 529: return 1; //";RedBaalsLairTomb1";
case 530: return 1; //";RedBaalsLairTomb1Left";
case 531: return 1; //";RedBaalsLairTomb2";
case 532: return 1; //";RedBaalsLairTomb2Left";
case 533: return 1; //";RedBaalsLairTomb3";
case 534: return 1; //";RedBaalsLairTomb3Left";
case 535: return 1; //";RedBaalsLairMrBox";
case 540: return 1; //";ExpansionDeadPerson1";
case 541: return 1; //";TempleGroundTomb";
case 544: return 1; //";TempleGroundTombLeft";
case 545: return 1; //";ExpansionDeadPerson2";
case 556: return 1; //";ExpansionDeadPerson3";
case 580: return 1; //";GoodChest";
case 581: return 1; //";NotSoGoodChest
default: return 0;
}
}
}
}

493
Strucs/PatternsScan.cs Normal file
View File

@ -0,0 +1,493 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using static app.Enums;
namespace app
{
public class PatternsScan
{
Form1 Form1_0;
public byte[] UnitBuffer = new byte[] { };
public List<long> AllItemsPointers = new List<long>();
public List<long> AllObjectsPointers = new List<long>(); //->refer to all gameobjects
public List<long> AllPlayersPointers = new List<long>();
public List<long> AllNPCPointers = new List<long>();
public List<long> AllPossibleItemsPointers = new List<long>();
public List<long> AllPossiblePlayerPointers = new List<long>();
public List<long> AllPossibleObjectsPointers = new List<long>();
public List<long> AllPossibleNPCPointers = new List<long>();
//"04 00 00 00 ?? ?? 00 00";
byte[] ThisCheckbytes = new byte[] { 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 };
public int[] DontCheckUnitIndexes = new int[] { 0, 0, 0, 0, 1, 1, 0, 0 };
public int[] DontCheckIndexes = new int[0];
public long StartIndexItemLast = long.MaxValue;
//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)
{
Form1_0 = form1_1;
}
IntPtr modulePatternScan(string Tpattern)
{
IntPtr ThisAddr = (IntPtr)0;
//method_1("Patterns: " + Tpattern);
byte[] ThisCheckbytes = StringToByteArray(Tpattern.Replace(" ", ""));
long ThisAddrF = Search(Form1_0.buffer, ThisCheckbytes, 0, "pattern");
if (ThisAddrF > 0)
{
return (IntPtr)ThisAddrF;
}
return ThisAddr;
}
public byte[] StringToByteArray(string hex)
{
DontCheckIndexes = new int[hex.Length / 2];
int Inddd = 0;
for (int i = 0; i < hex.Length; i++)
{
if (hex[i] == '?')
{
DontCheckIndexes[Inddd] = 1;
}
else
{
DontCheckIndexes[Inddd] = 0;
}
Inddd++;
i++;
}
hex = hex.Replace("??", "00");
return Enumerable.Range(0, hex.Length)
.Where(x => x % 2 == 0)
.Select(x => Convert.ToByte(hex.Substring(x, 2), 16))
.ToArray();
}
public long Search(byte[] arrayToSearchThrough, byte[] patternToFind, long StartOffset, string SearchType)
{
if (patternToFind.Length > arrayToSearchThrough.Length) return -1;
int DontCheckCount = 0;
for (long i = StartOffset; i < arrayToSearchThrough.Length - patternToFind.Length; i++)
{
bool found = true;
for (long j = 0; j < patternToFind.Length; j++)
{
int DontChh = 0;
if (SearchType == "item" || SearchType == "player" || SearchType == "objects" || SearchType == "NPC")
{
DontChh = DontCheckUnitIndexes[j];
}
else
{
DontChh = DontCheckIndexes[j];
}
if (DontChh == 0)
{
if (arrayToSearchThrough[i + j] != patternToFind[j])
{
found = false;
break;
}
}
//check if TxtFileNo are within range
if (SearchType == "item")
{
if (DontChh == 1)
{
//not higher than 0x02 (0x2FF)
if (DontCheckCount == 1 && arrayToSearchThrough[i + j] > 0x02)
{
found = false;
break;
}
DontCheckCount++;
}
}
}
if (found)
{
return i;
}
}
return -1;
}
public void PatternScan()
{
//SetFormat, Integer, Hex
//; unit table
string pattern = "48 03 C7 49 8B 8C C6";
IntPtr patternAddress = modulePatternScan(pattern);
IntPtr unitTable = (IntPtr)Form1_0.Mem_0.ReadInt(patternAddress + 7);
Form1_0.offsets["unitTable"] = unitTable;
Form1_0.method_1("UnitTable offset: 0x" + unitTable.ToString("X"), Color.Black);
//; game data(IP and name)
//pattern = "44 88 25 ?? ?? ?? ?? 66 44 89 25 ?? ?? ?? ??";
pattern = "44 88 25 ?? ?? ?? ?? 66 44 89 25";
patternAddress = modulePatternScan(pattern);
IntPtr offsetBuffer = (IntPtr)Form1_0.Mem_0.ReadInt(patternAddress + 0x3);
//IntPtr gameDataOffset = (IntPtr) (((Int64) patternAddress - (Int64) BaseAddress) - 0x121 + (Int64) offsetBuffer);
IntPtr gameDataOffset = (IntPtr)(((Int64)patternAddress) - 0x121 + (Int64)offsetBuffer);
Form1_0.offsets["gameDataOffset"] = gameDataOffset;
Form1_0.method_1("Game data offset: 0x" + gameDataOffset.ToString("X"), Color.Black);
}
public void scanForUnitsPointer(string SearchUnitsType)
{
long UnitOffset = (long)Form1_0.BaseAddress + (long)Form1_0.offsets["unitTable"] + Form1_0.UnitStrucOffset;
if (SearchUnitsType == "item") AllPossibleItemsPointers = new List<long>();
if (SearchUnitsType == "player") AllPossiblePlayerPointers = new List<long>();
if (SearchUnitsType == "objects") AllPossibleObjectsPointers = new List<long>();
if (SearchUnitsType == "NPC") AllPossibleNPCPointers = new List<long>();
for (int i = 0; i < ((128 + 516) * 10); i += 8)
{
long UnitPointerLocation = Form1_0.Mem_0.ReadInt64Raw((IntPtr)(UnitOffset + i));
if (UnitPointerLocation > 0)
{
uint UnitTypeT = Form1_0.Mem_0.ReadUInt32Raw((IntPtr)(UnitPointerLocation));
uint TxtFileNoT = Form1_0.Mem_0.ReadUInt32Raw((IntPtr)(UnitPointerLocation + 4));
// Do ONLY UnitType:4 && TxtFileNo:!3
if (SearchUnitsType == "item")
{
if (UnitTypeT == (int)UnitType.Item && TxtFileNoT != 3)
{
AllPossibleItemsPointers.Add(UnitPointerLocation);
}
}
if (SearchUnitsType == "player")
{
if (UnitTypeT == (int)UnitType.Player)
{
AllPossiblePlayerPointers.Add(UnitPointerLocation);
}
}
if (SearchUnitsType == "objects")
{
if (UnitTypeT == (int)UnitType.GameObject)
{
AllPossibleObjectsPointers.Add(UnitPointerLocation);
}
}
if (SearchUnitsType == "NPC")
{
if (UnitTypeT == (int)UnitType.NPC)
{
AllPossibleNPCPointers.Add(UnitPointerLocation);
}
}
}
}
UnitPatternScan(SearchUnitsType);
checkForMissingPointers(SearchUnitsType);
}
public void UnitPatternScan(string SearchUnitsType)
{
if (SearchUnitsType == "item") AllItemsPointers = new List<long>();
if (SearchUnitsType == "player") AllPlayersPointers = new List<long>();
if (SearchUnitsType == "objects") AllObjectsPointers = new List<long>();
if (SearchUnitsType == "NPC") AllNPCPointers = new List<long>();
long StartIndexItem = long.MaxValue;
long StartIndexPlayer = long.MaxValue;
long StartIndexMobs = long.MaxValue;
long StartIndexNPC = long.MaxValue;
//set start index for searching
if (SearchUnitsType == "item")
{
for (int i = 0; i < AllPossibleItemsPointers.Count; i++)
{
if (AllPossibleItemsPointers[i] < StartIndexItem)
{
StartIndexItem = AllPossibleItemsPointers[i];
}
}
}
if (SearchUnitsType == "player")
{
for (int i = 0; i < AllPossiblePlayerPointers.Count; i++)
{
if (AllPossiblePlayerPointers[i] < StartIndexPlayer)
{
StartIndexPlayer = AllPossiblePlayerPointers[i];
}
}
}
if (SearchUnitsType == "objects")
{
for (int i = 0; i < AllPossibleObjectsPointers.Count; i++)
{
if (AllPossibleObjectsPointers[i] < StartIndexMobs)
{
StartIndexMobs = AllPossibleObjectsPointers[i];
}
}
}
if (SearchUnitsType == "NPC")
{
for (int i = 0; i < AllPossibleNPCPointers.Count; i++)
{
if (AllPossibleNPCPointers[i] < StartIndexNPC)
{
StartIndexNPC = AllPossibleNPCPointers[i];
}
}
}
//######
if (StartIndexItem < StartIndexItemLast)
{
//0xD87F7298
//0x31F38
//0x4830
if (StartIndexItemLast != long.MaxValue)
{
long DiffVal = (StartIndexItemLast - StartIndexItem);
int UnitNumberDiff = (int)(DiffVal) / (0x48 + 0x170);
if (DiffVal < 0xFFFFF) //here
{
ScanUnitsNumber += UnitNumberDiff;
Form1_0.method_1("Item start diff: 0x" + (DiffVal).ToString("X") + ", scann for: " + ScanUnitsNumber + " +" + UnitNumberDiff, Color.DarkOrchid);
}
else
{
StartIndexItem = StartIndexItemLast; //correct the pointer
//Form1_0.method_1("BAD Item start diff: 0x" + (DiffVal).ToString("X") + ", scann for: " + ScanUnitsNumber + " +" + UnitNumberDiff, Color.Red);
}
}
StartIndexItemLast = StartIndexItem;
}
//######
//search
long CheckThisI = StartIndexItem;
long CheckThisP = StartIndexPlayer;
long CheckThisM = StartIndexMobs;
long CheckThisN = StartIndexNPC;
UnitBuffer = new byte[9];
CheckThisI -= (0x48 + 0x170) * ScanUnitsNegativeOffset; //offseting in negative here
for (int i = 0; i < ScanUnitsNumber; i++)
//for (int i = 0; i < 2048; i++)
//for (int i = 0; i < 2500; i++)
{
if ((i % 2) == 1)
{
CheckThisI += 0x48;
CheckThisP += 0x48;
CheckThisM += 0x48;
CheckThisN += 0x48;
}
else
{
CheckThisI += 0x170;
CheckThisP += 0x170;
CheckThisM += 0x170;
CheckThisN += 0x170;
}
if (SearchUnitsType == "item")
{
ThisCheckbytes = new byte[] { (byte)UnitType.Item, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 };
Form1_0.Mem_0.ReadRawMemory(CheckThisI, ref UnitBuffer, UnitBuffer.Length);
unitPatternScan(CheckThisI, "item");
}
if (SearchUnitsType == "player")
{
ThisCheckbytes = new byte[] { (byte)UnitType.Player, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 };
Form1_0.Mem_0.ReadRawMemory(CheckThisP, ref UnitBuffer, UnitBuffer.Length);
unitPatternScan(CheckThisP, "player");
}
if (SearchUnitsType == "objects")
{
ThisCheckbytes = new byte[] { (byte)UnitType.GameObject, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 };
Form1_0.Mem_0.ReadRawMemory(CheckThisM, ref UnitBuffer, UnitBuffer.Length);
unitPatternScan(CheckThisM, "objects");
}
if (SearchUnitsType == "NPC")
{
ThisCheckbytes = new byte[] { (byte)UnitType.NPC, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 };
Form1_0.Mem_0.ReadRawMemory(CheckThisN, ref UnitBuffer, UnitBuffer.Length);
unitPatternScan(CheckThisN, "NPC");
}
}
}
public void checkForMissingPointers(string SearchUnitsType)
{
if (SearchUnitsType == "item")
{
for (int i = 0; i < AllPossibleItemsPointers.Count; i++)
{
AddPointerToList(AllPossibleItemsPointers[i], "item");
}
}
if (SearchUnitsType == "player")
{
for (int i = 0; i < AllPlayersPointers.Count; i++)
{
AddPointerToList(AllPlayersPointers[i], "player");
}
}
if (SearchUnitsType == "objects")
{
for (int i = 0; i < AllObjectsPointers.Count; i++)
{
AddPointerToList(AllObjectsPointers[i], "objects");
}
}
if (SearchUnitsType == "NPC")
{
for (int i = 0; i < AllNPCPointers.Count; i++)
{
AddPointerToList(AllNPCPointers[i], "NPC");
}
}
}
public void unitPatternScan(long AtPoiinter, string SearchType)
{
long SearchOffset = 0;
long ThisAddrF = Search(UnitBuffer, ThisCheckbytes, SearchOffset, SearchType);
//while (ThisAddrF >= 0)
if (ThisAddrF >= 0)
{
AddPointerToList(AtPoiinter + ThisAddrF, SearchType);
}
}
public void AddPointerToList(long TPoiinter, string SearchType)
{
if (SearchType == "item")
{
if (AllItemsPointers.Count > 0)
{
for (int i = 0; i < AllItemsPointers.Count; i++)
{
if (AllItemsPointers[i] == TPoiinter)
{
return;
}
}
AllItemsPointers.Add(TPoiinter);
}
else
{
AllItemsPointers.Add(TPoiinter);
}
}
if (SearchType == "player")
{
if (AllPlayersPointers.Count > 0)
{
for (int i = 0; i < AllPlayersPointers.Count; i++)
{
if (AllPlayersPointers[i] == TPoiinter)
{
return;
}
}
AllPlayersPointers.Add(TPoiinter);
}
else
{
AllPlayersPointers.Add(TPoiinter);
}
}
if (SearchType == "objects")
{
if (AllObjectsPointers.Count > 0)
{
for (int i = 0; i < AllObjectsPointers.Count; i++)
{
if (AllObjectsPointers[i] == TPoiinter)
{
return;
}
}
AllObjectsPointers.Add(TPoiinter);
}
else
{
AllObjectsPointers.Add(TPoiinter);
}
}
if (SearchType == "NPC")
{
if (AllNPCPointers.Count > 0)
{
for (int i = 0; i < AllNPCPointers.Count; i++)
{
if (AllNPCPointers[i] == TPoiinter)
{
return;
}
}
AllNPCPointers.Add(TPoiinter);
}
else
{
AllNPCPointers.Add(TPoiinter);
}
}
}
/*public const long OneKB = 1024;
public const long OneMB = OneKB * OneKB;
public const long OneGB = OneMB * OneKB;
public const long OneTB = OneGB * OneKB;
public string BytesToHumanReadable(long bytes)
{
if (bytes < 0) return "ERROR";
if (bytes < OneKB) return $"{bytes}B";
if (bytes >= OneKB && bytes < OneMB) return $"{bytes / OneKB}KB";
if (bytes >= OneMB && bytes < OneGB) return $"{bytes / OneMB}MB";
if (bytes >= OneGB && bytes < OneTB) return $"{bytes / OneMB}GB";
if (bytes >= OneTB) return $"{bytes / OneTB}";
return "TOO BIG";
}*/
}
}

166
Strucs/Town.cs Normal file
View File

@ -0,0 +1,166 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using static app.MapAreaStruc;
namespace app
{
public class Town
{
Form1 Form1_0;
public void SetForm1(Form1 form1_1)
{
Form1_0 = form1_1;
}
public string getAreaName(int areaNum)
{
switch (areaNum)
{
case 1: return "Rogue Encampment";
case 2: return "Blood Moor";
case 3: return "Cold Plains";
case 4: return "Stony Field";
case 5: return "Dark Wood";
case 6: return "Black Marsh";
case 7: return "Tamoe Highland";
case 8: return "Den of Evil";
case 9: return "Cave Level 1";
case 10: return "Underground Passage Level 1";
case 11: return "Hole Level 1";
case 12: return "Pit Level 1";
case 13: return "Cave Level 2";
case 14: return "Underground Passage Level 2";
case 15: return "Hole Level 2";
case 16: return "Pit Level 2";
case 17: return "Burial Grounds";
case 18: return "Crypt";
case 19: return "Mausoleum";
case 20: return "Forgotten Tower";
case 21: return "Tower Cellar Level 1";
case 22: return "Tower Cellar Level 2";
case 23: return "Tower Cellar Level 3";
case 24: return "Tower Cellar Level 4";
case 25: return "Tower Cellar Level 5";
case 26: return "Monastery Gate";
case 27: return "Outer Cloister";
case 28: return "Barracks";
case 29: return "Jail Level 1";
case 30: return "Jail Level 2";
case 31: return "Jail Level 3";
case 32: return "Inner Cloister";
case 33: return "Cathedral";
case 34: return "Catacombs Level 1";
case 35: return "Catacombs Level 2";
case 36: return "Catacombs Level 3";
case 37: return "Catacombs Level 4";
case 38: return "Tristram";
case 39: return "Moo Moo Farm";
case 40: return "Lut Gholein";
case 41: return "Rocky Waste";
case 42: return "Dry Hills";
case 43: return "Far Oasis";
case 44: return "Lost City";
case 45: return "Valley of Snakes";
case 46: return "Canyon of the Magi";
case 47: return "Sewers Level 1";
case 48: return "Sewers Level 2";
case 49: return "Sewers Level 3";
case 50: return "Harem Level 1";
case 51: return "Harem Level 2";
case 52: return "Palace Cellar Level 1";
case 53: return "Palace Cellar Level 2";
case 54: return "Palace Cellar Level 3";
case 55: return "Stony Tomb Level 1";
case 56: return "Halls of the Dead Level 1";
case 57: return "Halls of the Dead Level 2";
case 58: return "Claw Viper Temple Level 1";
case 59: return "Stony Tomb Level 2";
case 60: return "Halls of the Dead Level 3";
case 61: return "Claw Viper Temple Level 2";
case 62: return "Maggot Lair Level 1";
case 63: return "Maggot Lair Level 2";
case 64: return "Maggot Lair Level 3";
case 65: return "Ancient Tunnels";
case 66: return "Tal Rasha's Tomb #1";
case 67: return "Tal Rasha's Tomb #2";
case 68: return "Tal Rasha's Tomb #3";
case 69: return "Tal Rasha's Tomb #4";
case 70: return "Tal Rasha's Tomb #5";
case 71: return "Tal Rasha's Tomb #6";
case 72: return "Tal Rasha's Tomb #7";
case 73: return "Duriel's Lair";
case 74: return "Arcane Sanctuary";
case 75: return "Kurast Docktown";
case 76: return "Spider Forest";
case 77: return "Great Marsh";
case 78: return "Flayer Jungle";
case 79: return "Lower Kurast";
case 80: return "Kurast Bazaar";
case 81: return "Upper Kurast";
case 82: return "Kurast Causeway";
case 83: return "Travincal";
case 84: return "Arachnid Lair";
case 85: return "Spider Cavern";
case 86: return "Swampy Pit Level 1";
case 87: return "Swampy Pit Level 2";
case 88: return "Flayer Dungeon Level 1";
case 89: return "Flayer Dungeon Level 2";
case 90: return "Swampy Pit Level 3";
case 91: return "Flayer Dungeon Level 3";
case 92: return "Sewers Level 1";
case 93: return "Sewers Level 2";
case 94: return "Ruined Temple";
case 95: return "Disused Fane";
case 96: return "Forgotten Reliquary";
case 97: return "Forgotten Temple";
case 98: return "Ruined Fane";
case 99: return "Disused Reliquary";
case 100: return "Durance of Hate Level 1";
case 101: return "Durance of Hate Level 2";
case 102: return "Durance of Hate Level 3";
case 103: return "Pandemonium Fortress";
case 104: return "Outer Steppes";
case 105: return "Plains of Despair";
case 106: return "City of the Damned";
case 107: return "River of Flame";
case 108: return "Chaos Sanctuary";
case 109: return "Harrogath";
case 110: return "Bloody Foothills";
case 111: return "Frigid Highlands";
case 112: return "Arreat Plateau";
case 113: return "Crystalline Passage";
case 114: return "Frozen River";
case 115: return "Glacial Trail";
case 116: return "Drifter Cavern";
case 117: return "Frozen Tundra";
case 118: return "Ancients' Way";
case 119: return "Icy Cellar";
case 120: return "Arreat Summit";
case 121: return "Nihlathaks Temple";
case 122: return "Halls of Anguish";
case 123: return "Halls of Death's Calling";
case 124: return "Halls of Vaught";
case 125: return "Abaddon";
case 126: return "Pit of Acheron";
case 127: return "Infernal Pit";
case 128: return "Worldstone Keep Level 1";
case 129: return "Worldstone Keep Level 2";
case 130: return "Worldstone Keep Level 3";
case 131: return "Throne of Destruction";
case 132: return "Worldstone Chamber";
case 133: return "Pandemonium Run 1";
case 134: return "Pandemonium Run 2";
case 135: return "Pandemonium Run 3";
case 136: return "Tristram";
}
return "";
}
}
}

127
app.csproj Normal file
View File

@ -0,0 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{9F07A94F-EFC7-4E4B-807A-83F884EE0B44}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>app</RootNamespace>
<AssemblyName>D2RMH</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>d2r-lod-regred - Copy.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath>..\D2R-BMBot-main\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Enums.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="MapAreaStruc.cs" />
<Compile Include="OverlayForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="OverlayForm.Designer.cs" />
<Compile Include="PlayerScan.cs" />
<Compile Include="Strucs\GameStruc.cs" />
<Compile Include="Strucs\Mem.cs" />
<Compile Include="Strucs\MobsStruc.cs" />
<Compile Include="Strucs\NPCStruc.cs" />
<Compile Include="Strucs\ObjectsStruc.cs" />
<Compile Include="Strucs\PatternsScan.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Strucs\Town.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Content Include="d2r-lod-regred - Copy.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

31
app.sln Normal file
View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32929.385
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "app", "app.csproj", "{9F07A94F-EFC7-4E4B-807A-83F884EE0B44}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9F07A94F-EFC7-4E4B-807A-83F884EE0B44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9F07A94F-EFC7-4E4B-807A-83F884EE0B44}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9F07A94F-EFC7-4E4B-807A-83F884EE0B44}.Debug|x64.ActiveCfg = Debug|x64
{9F07A94F-EFC7-4E4B-807A-83F884EE0B44}.Debug|x64.Build.0 = Debug|x64
{9F07A94F-EFC7-4E4B-807A-83F884EE0B44}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9F07A94F-EFC7-4E4B-807A-83F884EE0B44}.Release|Any CPU.Build.0 = Release|Any CPU
{9F07A94F-EFC7-4E4B-807A-83F884EE0B44}.Release|x64.ActiveCfg = Release|x64
{9F07A94F-EFC7-4E4B-807A-83F884EE0B44}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AC5CF14D-A182-4045-B849-D44BFE870A91}
EndGlobalSection
EndGlobal

BIN
bin/Debug/D2RMH.exe Normal file

Binary file not shown.

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

BIN
bin/Debug/D2RMH.pdb Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

11363
bin/Debug/Newtonsoft.Json.xml Normal file

File diff suppressed because it is too large Load Diff

BIN
bin/Debug/handle64.exe Normal file

Binary file not shown.

BIN
bin/Debug/map.exe Normal file

Binary file not shown.

BIN
d2r-lod-regred - Copy.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

BIN
d2r-lod-regred - Copy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
8069502011d0681850e57a53d5a1673222f430a6

View File

@ -0,0 +1,11 @@
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\bin\Debug\BMDevsMem.exe.config
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\bin\Debug\BMDevsMem.exe
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\bin\Debug\BMDevsMem.pdb
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\Debug\BMDevsMem.csproj.AssemblyReference.cache
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\Debug\BMDevsMem.csproj.SuggestedBindingRedirects.cache
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\Debug\BMDevsMem.Form1.resources
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\Debug\BMDevsMem.Properties.Resources.resources
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\Debug\BMDevsMem.csproj.GenerateResource.cache
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\Debug\BMDevsMem.csproj.CoreCompileInputs.cache
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\Debug\BMDevsMem.exe
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\Debug\BMDevsMem.pdb

Binary file not shown.

BIN
obj/Debug/BMDevsMem.exe Normal file

Binary file not shown.

BIN
obj/Debug/BMDevsMem.pdb Normal file

Binary file not shown.

BIN
obj/Debug/D2RMH.exe Normal file

Binary file not shown.

BIN
obj/Debug/D2RMH.pdb Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
0ac21cffc7c7cdb5eabec632e9a6fc20406541e98f24ad38ef4b75f0c53697ba

View File

@ -0,0 +1,14 @@
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\bin\Debug\D2RMH.exe.config
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\bin\Debug\D2RMH.exe
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\bin\Debug\D2RMH.pdb
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\bin\Debug\Newtonsoft.Json.dll
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\bin\Debug\Newtonsoft.Json.pdb
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\bin\Debug\Newtonsoft.Json.xml
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\obj\Debug\app.csproj.AssemblyReference.cache
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\obj\Debug\app.Form1.resources
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\obj\Debug\app.Properties.Resources.resources
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\obj\Debug\app.csproj.GenerateResource.cache
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\obj\Debug\app.csproj.CoreCompileInputs.cache
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\obj\Debug\app.csproj.Up2Date
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\obj\Debug\D2RMH.exe
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\obj\Debug\D2RMH.pdb

Binary file not shown.

View File

Binary file not shown.

View File

@ -0,0 +1 @@
069cd7e82596e845d5de9e0565c4b38d5d9bb462

View File

@ -0,0 +1,11 @@
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\x64\Debug\BMDevsMem.csproj.AssemblyReference.cache
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\x64\Debug\BMDevsMem.csproj.SuggestedBindingRedirects.cache
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\x64\Debug\BMDevsMem.csproj.GenerateResource.cache
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\x64\Debug\BMDevsMem.csproj.CoreCompileInputs.cache
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\x64\Debug\app.Properties.Resources.resources
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\bin\x64\Debug\app.exe.config
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\bin\x64\Debug\app.exe
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\bin\x64\Debug\app.pdb
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\x64\Debug\app.Form1.resources
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\x64\Debug\app.exe
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\x64\Debug\app.pdb

Binary file not shown.

BIN
obj/x64/Debug/D2RMH.exe Normal file

Binary file not shown.

BIN
obj/x64/Debug/D2RMH.pdb Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
d8537c35c917401dfa76146a117bd967ee2a01590e5c8cc9a0e36af912090e5d

View File

@ -0,0 +1,25 @@
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\bin\x64\Debug\app.exe.config
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\bin\x64\Debug\app.exe
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\bin\x64\Debug\app.pdb
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\x64\Debug\app.csproj.AssemblyReference.cache
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\x64\Debug\app.csproj.SuggestedBindingRedirects.cache
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\x64\Debug\app.Form1.resources
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\x64\Debug\app.Properties.Resources.resources
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\x64\Debug\app.csproj.GenerateResource.cache
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\x64\Debug\app.csproj.CoreCompileInputs.cache
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\x64\Debug\app.exe
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\BMDevsMem\obj\x64\Debug\app.pdb
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\obj\x64\Debug\app.csproj.AssemblyReference.cache
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\obj\x64\Debug\app.Form1.resources
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\obj\x64\Debug\app.Properties.Resources.resources
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\obj\x64\Debug\app.csproj.GenerateResource.cache
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\obj\x64\Debug\app.csproj.CoreCompileInputs.cache
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\bin\x64\Debug\D2RMH.exe.config
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\bin\x64\Debug\D2RMH.exe
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\bin\x64\Debug\D2RMH.pdb
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\obj\x64\Debug\D2RMH.exe
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\obj\x64\Debug\D2RMH.pdb
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\bin\x64\Debug\Newtonsoft.Json.dll
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\bin\x64\Debug\Newtonsoft.Json.pdb
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\bin\x64\Debug\Newtonsoft.Json.xml
C:\Users\boule\OneDrive\Documents\Visual Studio 2022\Projects\D2R_MH\obj\x64\Debug\app.csproj.Up2Date

Binary file not shown.

View File