public SkillSet(ToonClass @class) { this.@Class = @class; this.ActiveSkillsList = Skills.GetAllActiveSkillsByClass(this.@Class).Take(6).ToArray(); ActiveSkills = new ActiveSkillSavedData[6] { new ActiveSkillSavedData { snoSkill = ActiveSkillsList[0] }, new ActiveSkillSavedData { snoSkill = ActiveSkillsList[1] }, new ActiveSkillSavedData { snoSkill = ActiveSkillsList[2] }, new ActiveSkillSavedData { snoSkill = ActiveSkillsList[3] }, new ActiveSkillSavedData { snoSkill = ActiveSkillsList[4] }, new ActiveSkillSavedData { snoSkill = ActiveSkillsList[5] } }; this.HotBarSkills = new HotbarButtonData[6] { new HotbarButtonData { SNOSkill = ActiveSkills[0].snoSkill, ItemGBId = -1 }, // left-click new HotbarButtonData { SNOSkill = ActiveSkills[1].snoSkill, ItemGBId = -1 }, // right-click //new HotbarButtonData { SNOSkill = ActiveSkills[0].snoSkill, ItemGBId = -1 }, // hidden-bar - left-click switch - which key?? //new HotbarButtonData { SNOSkill = ActiveSkills[1].snoSkill, ItemGBId = -1 }, // hidden-bar - right-click switch (press x ingame) new HotbarButtonData { SNOSkill = ActiveSkills[2].snoSkill, ItemGBId = -1 }, // bar-1 new HotbarButtonData { SNOSkill = ActiveSkills[3].snoSkill, ItemGBId = -1 }, // bar-2 new HotbarButtonData { SNOSkill = ActiveSkills[4].snoSkill, ItemGBId = -1 }, // bar-3 new HotbarButtonData { SNOSkill = ActiveSkills[5].snoSkill, ItemGBId = -1 }, // bar-4 //new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = 0x622256D4 } // bar-5 - potion }; this.PassiveSkills = new int[3] { -1, -1, -1 }; // setting passive skills here crashes the client, need to figure out the reason. /raist. }
/// <summary> /// Re-attunes rune to player's class. Used for favoring. /// </summary> /// <param name="toonClass"></param> public void ReAttuneToClass(ToonClass toonClass) { int PowerSNOId = -1; switch (toonClass) { case ToonClass.Barbarian: PowerSNOId = Mooege.Core.GS.Skills.Skills.Barbarian.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.Barbarian.AllActiveSkillsList.Count)); break; case ToonClass.DemonHunter: PowerSNOId = Mooege.Core.GS.Skills.Skills.DemonHunter.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.DemonHunter.AllActiveSkillsList.Count)); break; case ToonClass.Monk: PowerSNOId = Mooege.Core.GS.Skills.Skills.Monk.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.Monk.AllActiveSkillsList.Count)); break; case ToonClass.WitchDoctor: PowerSNOId = Mooege.Core.GS.Skills.Skills.WitchDoctor.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.WitchDoctor.AllActiveSkillsList.Count)); break; case ToonClass.Wizard: PowerSNOId = Mooege.Core.GS.Skills.Skills.Wizard.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.Wizard.AllActiveSkillsList.Count)); break; } this.Attributes[GameAttribute.Rune_Attuned_Power] = PowerSNOId; }
private void SetFields(string name, int hashCode, ToonClass @class, ToonFlags flags, byte level, Account owner, uint timePlayed) { this.ToonHandle = new ToonHandleHelper(this.PersistentID); this.D3EntityID = this.ToonHandle.ToD3EntityID(); this.BnetEntityID = this.ToonHandle.ToBnetEntityID(); this.Name = name; this.HashCode = hashCode; this.HashCodeString = HashCode.ToString("D3"); this.NameText = D3.Hero.NameText.CreateBuilder().SetName(string.Format("{0}#{1}", this.Name, this.HashCodeString)).Build(); this.Class = @class; this.Flags = flags; this.Level = level; this.Owner = owner; this.TimePlayed = timePlayed; var visualItems = new[] { D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Head D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Chest D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Feet D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Hands D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Weapon (1) D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Weapon (2) D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Shoulders D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Legs }; this.Equipment = D3.Hero.VisualEquipment.CreateBuilder().AddRangeVisualItem(visualItems).Build(); }
private void SetFields(string name, int hashCode, ToonClass @class, ToonFlags flags, byte level, GameAccount owner, uint timePlayed) { //this.BnetEntityID = bnet.protocol.EntityId.CreateBuilder().SetHigh((ulong)EntityIdHelper.HighIdType.ToonId + this.PersistentID).SetLow(this.PersistentID).Build(); this.D3EntityID = D3.OnlineService.EntityId.CreateBuilder().SetIdHigh((ulong)EntityIdHelper.HighIdType.ToonId).SetIdLow(this.PersistentID).Build(); this.Name = name; this.HashCode = hashCode; this.Class = @class; this.Flags = flags; this.Level = level; this.GameAccount = owner; this.TimePlayed = timePlayed; var visualItems = new[] { D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Head D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Chest D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Feet D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Hands D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Weapon (1) D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Weapon (2) D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Shoulders D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Legs }; this.Equipment = D3.Hero.VisualEquipment.CreateBuilder().AddRangeVisualItem(visualItems).Build(); }
public SkillSet(ToonClass @class, Toon toon) { this.@Class = @class; var query = string.Format("SELECT * FROM active_skills WHERE id_toon={0}", toon.PersistentID); var cmd = new SQLiteCommand(query, DBManager.Connection); var reader = cmd.ExecuteReader(); if (!reader.HasRows) { int[] ActiveSkillsList = Skills.GetAllActiveSkillsByClass(this.@Class).Take(1).ToArray(); this.ActiveSkills = new ActiveSkillSavedData[6] { new ActiveSkillSavedData { snoSkill = ActiveSkillsList[0], snoRune = -1 }, new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 }, new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 }, new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 }, new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 }, new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 } }; this.PassiveSkills = new int[3] { -1, -1, -1 }; var insQuery = string.Format("INSERT INTO active_skills (id_toon,"+ "skill_0,skill_1,skill_2,skill_3,skill_4,skill_5,"+ "rune_0,rune_1,rune_2,rune_3,rune_4,rune_5,"+ "passive_0,passive_1,passive_2) VALUES ({0},{1},-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 )", toon.PersistentID, ActiveSkillsList[0]); var insCmd = new SQLiteCommand(insQuery, DBManager.Connection); insCmd.ExecuteNonQuery(); } else { this.ActiveSkills = new ActiveSkillSavedData[6] { new ActiveSkillSavedData { snoSkill = Convert.ToInt32(reader["skill_0"]), snoRune = Convert.ToInt32(reader["rune_0"]) }, new ActiveSkillSavedData { snoSkill = Convert.ToInt32(reader["skill_1"]), snoRune = Convert.ToInt32(reader["rune_1"]) }, new ActiveSkillSavedData { snoSkill = Convert.ToInt32(reader["skill_2"]), snoRune = Convert.ToInt32(reader["rune_2"]) }, new ActiveSkillSavedData { snoSkill = Convert.ToInt32(reader["skill_3"]), snoRune = Convert.ToInt32(reader["rune_3"]) }, new ActiveSkillSavedData { snoSkill = Convert.ToInt32(reader["skill_4"]), snoRune = Convert.ToInt32(reader["rune_4"]) }, new ActiveSkillSavedData { snoSkill = Convert.ToInt32(reader["skill_5"]), snoRune = Convert.ToInt32(reader["rune_5"]) } }; this.PassiveSkills = new int[3] { Convert.ToInt32(reader["passive_0"]), Convert.ToInt32(reader["passive_1"]), Convert.ToInt32(reader["passive_2"]) }; } this.HotBarSkills = new HotbarButtonData[6] { new HotbarButtonData { SNOSkill = ActiveSkills[0].snoSkill, Field1 = -1, ItemGBId = -1 }, // left-click new HotbarButtonData { SNOSkill = ActiveSkills[1].snoSkill, Field1 = -1, ItemGBId = -1 }, // right-click new HotbarButtonData { SNOSkill = ActiveSkills[2].snoSkill, Field1 = -1, ItemGBId = -1 }, // bar-1 new HotbarButtonData { SNOSkill = ActiveSkills[3].snoSkill, Field1 = -1, ItemGBId = -1 }, // bar-2 new HotbarButtonData { SNOSkill = ActiveSkills[4].snoSkill, Field1 = -1, ItemGBId = -1 }, // bar-3 new HotbarButtonData { SNOSkill = ActiveSkills[5].snoSkill, Field1 = -1, ItemGBId = -1 }, // bar-4 }; }
public static List<int> GetPrimarySkillsByClass(ToonClass @class) { switch (@class) { case ToonClass.Barbarian: return Barbarian.FuryGenerators.List; case ToonClass.DemonHunter: return DemonHunter.HatredGenerators.List; case ToonClass.Monk: return Monk.SpiritGenerator.List; case ToonClass.WitchDoctor: return WitchDoctor.PhysicalRealm.List; case ToonClass.Wizard: return Wizard.Signature.List; default: return null; } }
public static List<int> GetAllActiveSkillsByClass(ToonClass @class) { switch (@class) { case ToonClass.Barbarian: return Barbarian.AllActiveSkillsList; case ToonClass.DemonHunter: return DemonHunter.AllActiveSkillsList; case ToonClass.Monk: return Monk.AllActiveSkillsList; case ToonClass.WitchDoctor: return WitchDoctor.AllActiveSkillsList; case ToonClass.Wizard: return Wizard.AllActiveSkillsList; default: return null; } }
public static List<int> GetSecondarySkillsByClass(ToonClass @class) { switch (@class) { case ToonClass.Barbarian: return Barbarian.FurySpenders.List; case ToonClass.DemonHunter: return DemonHunter.HatredSpenders.List; case ToonClass.Monk: return Monk.SpiritSpenders.List; case ToonClass.WitchDoctor: return WitchDoctor.SpiritRealm.List; case ToonClass.Wizard: return Wizard.Offensive.List; default: return null; } }
public Toon(ulong id, string name, ToonClass @class, ToonGender gender, byte level) { this.ID = id; this.ToonHandle = new ToonHandleHelper(id); this.D3EntityID = this.ToonHandle.ToD3EntityID(); this.BnetEntityID = this.ToonHandle.ToBnetEntityID(); this.Name = name; this.Class = @class; this.Gender = gender; this.Level = level; var visualItems = new[] { D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), }; this.Equipment = D3.Hero.VisualEquipment.CreateBuilder().AddRangeVisualItem(visualItems).Build(); this.Digest= D3.Hero.Digest.CreateBuilder().SetVersion(891) .SetHeroId(this.D3EntityID) .SetHeroName(this.Name) .SetGbidClass((int)this.ClassID) .SetPlayerFlags(this.GenderID) .SetLevel(this.Level) .SetVisualEquipment(this.Equipment) .SetLastPlayedAct(0) .SetHighestUnlockedAct(0) .SetLastPlayedDifficulty(0) .SetHighestUnlockedDifficulty(0) .SetLastPlayedQuest(-1) .SetLastPlayedQuestStep(-1) .SetTimePlayed(0) .Build(); }
public SkillSet(ToonClass @class) { this.@Class = @class; // this.ActiveSkills = Skills.GetActiveSkillsByClass(this.@Class).Take(6).ToArray(); - should be normally this way, but as we want a mob-spawn we hack it as below; var hackedSkills = Skills.GetAllActiveSkillsByClass(this.@Class).Take(5).ToList(); hackedSkills.Add((int) Skills.Monk.SpiritSpenders.BlindingFlash); this.ActiveSkills = hackedSkills.ToArray(); this.HotBarSkills = new HotbarButtonData[9] { new HotbarButtonData { SNOSkill = ActiveSkills[4], ItemGBId = -1 }, // left-click new HotbarButtonData { SNOSkill = ActiveSkills[5], ItemGBId = -1 }, // right-click new HotbarButtonData { SNOSkill = ActiveSkills[0], ItemGBId = -1 }, // hidden-bar - left-click switch - which key?? new HotbarButtonData { SNOSkill = ActiveSkills[1], ItemGBId = -1 }, // hidden-bar - right-click switch (press x ingame) new HotbarButtonData { SNOSkill = ActiveSkills[0], ItemGBId = -1 }, // bar-1 new HotbarButtonData { SNOSkill = ActiveSkills[1], ItemGBId = -1 }, // bar-2 new HotbarButtonData { SNOSkill = ActiveSkills[2], ItemGBId = -1 }, // bar-3 new HotbarButtonData { SNOSkill = ActiveSkills[3], ItemGBId = -1 }, // bar-4 new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = 0x622256D4 } // bar-5 - potion }; this.PassiveSkills = new int[3] { -1, -1, -1 }; // setting passive skills here crashes the client, need to figure out the reason. /raist. }
public static List <int> GetPrimarySkillsByClass(ToonClass @class) { switch (@class) { case ToonClass.Barbarian: return(Barbarian.FuryGenerators.List); case ToonClass.DemonHunter: return(DemonHunter.HatredGenerators.List); case ToonClass.Monk: return(Monk.SpiritGenerator.List); case ToonClass.WitchDoctor: return(WitchDoctor.PhysicalRealm.List); case ToonClass.Wizard: return(Wizard.Signature.List); default: return(null); } }
/// <summary> /// Re-attunes rune to player's class. Used for favoring. /// </summary> /// <param name="toonClass"></param> public void ReAttuneToClass(ToonClass toonClass) { int PowerSNOId = -1; switch (toonClass) { case ToonClass.Barbarian: PowerSNOId = Mooege.Core.GS.Skills.Skills.Barbarian.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.Barbarian.AllActiveSkillsList.Count)); break; case ToonClass.DemonHunter: PowerSNOId = Mooege.Core.GS.Skills.Skills.DemonHunter.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.DemonHunter.AllActiveSkillsList.Count)); break; case ToonClass.Monk: PowerSNOId = Mooege.Core.GS.Skills.Skills.Monk.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.Monk.AllActiveSkillsList.Count)); break; case ToonClass.WitchDoctor: PowerSNOId = Mooege.Core.GS.Skills.Skills.WitchDoctor.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.WitchDoctor.AllActiveSkillsList.Count)); break; case ToonClass.Wizard: PowerSNOId = Mooege.Core.GS.Skills.Skills.Wizard.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.Wizard.AllActiveSkillsList.Count)); break; } //this.Attributes[GameAttribute.Rune_Attuned_Power] = PowerSNOId; }
public static List <int> GetSecondarySkillsByClass(ToonClass @class) { switch (@class) { case ToonClass.Barbarian: return(Barbarian.FurySpenders.List); case ToonClass.DemonHunter: return(DemonHunter.HatredSpenders.List); case ToonClass.Monk: return(Monk.SpiritSpenders.List); case ToonClass.WitchDoctor: return(WitchDoctor.SpiritRealm.List); case ToonClass.Wizard: return(Wizard.Offensive.List); default: return(null); } }
public static List <int> GetExtraSkillsByClass(ToonClass @class) { switch (@class) { case ToonClass.Barbarian: return(Barbarian.Situational.List); case ToonClass.DemonHunter: return(DemonHunter.Discipline.List); case ToonClass.Monk: return(Monk.Mantras.List); case ToonClass.WitchDoctor: return(WitchDoctor.Support.List); case ToonClass.Wizard: return(Wizard.Utility.List); default: return(null); } }
public static List <int> GetAllActiveSkillsByClass(ToonClass @class) { switch (@class) { case ToonClass.Barbarian: return(Barbarian.AllActiveSkillsList); case ToonClass.DemonHunter: return(DemonHunter.AllActiveSkillsList); case ToonClass.Monk: return(Monk.AllActiveSkillsList); case ToonClass.WitchDoctor: return(WitchDoctor.AllActiveSkillsList); case ToonClass.Wizard: return(Wizard.AllActiveSkillsList); default: return(null); } }
private void SetFields(string name, ToonClass @class, ToonFlags flags, byte level, Account owner) { this.ToonHandle = new ToonHandleHelper(this.PersistentID); this.D3EntityID = this.ToonHandle.ToD3EntityID(); this.BnetEntityID = this.ToonHandle.ToBnetEntityID(); this.Name = name; this.Class = @class; this.Flags = flags; this.Level = level; this.Owner = owner; var visualItems = new[] { // Head D3.Hero.VisualItem.CreateBuilder() .SetGbid(0) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Chest D3.Hero.VisualItem.CreateBuilder() .SetGbid(0) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Feet D3.Hero.VisualItem.CreateBuilder() .SetGbid(0) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Hands D3.Hero.VisualItem.CreateBuilder() .SetGbid(0) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Weapon (1) D3.Hero.VisualItem.CreateBuilder() .SetGbid(0) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Weapon (2) D3.Hero.VisualItem.CreateBuilder() .SetGbid(0) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Shoulders D3.Hero.VisualItem.CreateBuilder() .SetGbid(0) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Legs D3.Hero.VisualItem.CreateBuilder() .SetGbid(0) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), }; this.Equipment = D3.Hero.VisualEquipment.CreateBuilder().AddRangeVisualItem(visualItems).Build(); this.Digest = D3.Hero.Digest.CreateBuilder().SetVersion(891) .SetHeroId(this.D3EntityID) .SetHeroName(this.Name) .SetGbidClass((int)this.ClassID) .SetPlayerFlags((uint)this.Flags) .SetLevel(this.Level) .SetVisualEquipment(this.Equipment) .SetLastPlayedAct(0) .SetHighestUnlockedAct(0) .SetLastPlayedDifficulty(0) .SetHighestUnlockedDifficulty(0) .SetLastPlayedQuest(-1) .SetLastPlayedQuestStep(-1) .SetTimePlayed(0) .Build(); }
public Toon(ulong id, string name, ToonClass @class, ToonGender gender, byte level, long accountId) { this.ID = id; this.ToonHandle = new ToonHandleHelper(id); this.D3EntityID = this.ToonHandle.ToD3EntityID(); this.BnetEntityID = this.ToonHandle.ToBnetEntityID(); this.Name = name; this.Class = @class; this.Gender = gender; this.Level = level; this.AccountID = accountId; var visualItems = new[] { // Some hack. We should either load strings and then hash it from DB or load hash directly from DB.. // Showing a head and a Wep to show how it works // Head D3.Hero.VisualItem.CreateBuilder() .SetGbid( (int)StringHashHelper.HashString2("Helm_002") ) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Chest D3.Hero.VisualItem.CreateBuilder() .SetGbid(0) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Feet D3.Hero.VisualItem.CreateBuilder() .SetGbid(0) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Hands D3.Hero.VisualItem.CreateBuilder() .SetGbid(0) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Weapon (1) D3.Hero.VisualItem.CreateBuilder() .SetGbid( (int)StringHashHelper.HashString2("Unique_Mace_1H_012") ) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Weapon (2) D3.Hero.VisualItem.CreateBuilder() .SetGbid(0) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Shoulders D3.Hero.VisualItem.CreateBuilder() .SetGbid(0) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Legs D3.Hero.VisualItem.CreateBuilder() .SetGbid(0) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), }; this.Equipment = D3.Hero.VisualEquipment.CreateBuilder().AddRangeVisualItem(visualItems).Build(); this.Digest = D3.Hero.Digest.CreateBuilder().SetVersion(891) .SetHeroId(this.D3EntityID) .SetHeroName(this.Name) .SetGbidClass((int)this.ClassID) .SetPlayerFlags(this.GenderID) .SetLevel(this.Level) .SetVisualEquipment(this.Equipment) .SetLastPlayedAct(0) .SetHighestUnlockedAct(0) .SetLastPlayedDifficulty(0) .SetHighestUnlockedDifficulty(0) .SetLastPlayedQuest(-1) .SetLastPlayedQuestStep(-1) .SetTimePlayed(0) .Build(); }
private void SetFields(string name, ToonClass @class, ToonGender gender, byte level, Account owner) { this.ToonHandle = new ToonHandleHelper(this.PersistentID); this.D3EntityID = this.ToonHandle.ToD3EntityID(); this.BnetEntityID = this.ToonHandle.ToBnetEntityID(); this.Name = name; this.Class = @class; this.Gender = gender; this.Level = level; this.Owner = owner; var itemsGenerator = new Items.ItemTypeGenerator(); var visualItems = new[] { // Head D3.Hero.VisualItem.CreateBuilder() .SetGbid( itemsGenerator.generateRandomElement(Items.ItemType.Helm).Gbid) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Chest D3.Hero.VisualItem.CreateBuilder() .SetGbid(itemsGenerator.generateRandomElement(Items.ItemType.ChestArmor).Gbid) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Feet D3.Hero.VisualItem.CreateBuilder() .SetGbid(itemsGenerator.generateRandomElement(Items.ItemType.Boots).Gbid) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Hands D3.Hero.VisualItem.CreateBuilder() .SetGbid(itemsGenerator.generateRandomElement(Items.ItemType.Gloves).Gbid) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Weapon (1) D3.Hero.VisualItem.CreateBuilder() .SetGbid(itemsGenerator.generateRandomElement(Items.ItemType.Sword_1H).Gbid) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Weapon (2) D3.Hero.VisualItem.CreateBuilder() .SetGbid(itemsGenerator.generateRandomElement(Items.ItemType.Shield).Gbid) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Shoulders D3.Hero.VisualItem.CreateBuilder() .SetGbid(itemsGenerator.generateRandomElement(Items.ItemType.Shoulders).Gbid) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Legs D3.Hero.VisualItem.CreateBuilder() .SetGbid(itemsGenerator.generateRandomElement(Items.ItemType.Pants).Gbid) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), }; this.Equipment = D3.Hero.VisualEquipment.CreateBuilder().AddRangeVisualItem(visualItems).Build(); this.Digest = D3.Hero.Digest.CreateBuilder().SetVersion(891) .SetHeroId(this.D3EntityID) .SetHeroName(this.Name) .SetGbidClass((int)this.ClassID) .SetPlayerFlags(this.GenderID) .SetLevel(this.Level) .SetVisualEquipment(this.Equipment) .SetLastPlayedAct(0) .SetHighestUnlockedAct(0) .SetLastPlayedDifficulty(0) .SetHighestUnlockedDifficulty(0) .SetLastPlayedQuest(-1) .SetLastPlayedQuestStep(-1) .SetTimePlayed(0) .Build(); }
private void SetFields(string name, int hashCode, ToonClass @class, ToonFlags flags, byte level, Account owner,uint timePlayed) { this.ToonHandle = new ToonHandleHelper(this.PersistentID); this.D3EntityID = this.ToonHandle.ToD3EntityID(); this.BnetEntityID = this.ToonHandle.ToBnetEntityID(); this.Name = name; this.HashCode = hashCode; this.HashCodeString = HashCode.ToString("D3"); this.Class = @class; this.Flags = flags; this.Level = level; this.Owner = owner; this.TimePlayed = timePlayed; var visualItems = new[] { D3.Hero.VisualItem.CreateBuilder().SetGbid(0).SetDyeType(0).SetItemEffectType(0).SetEffectLevel(0).Build(), // Head D3.Hero.VisualItem.CreateBuilder().SetGbid(0).SetDyeType(0).SetItemEffectType(0).SetEffectLevel(0).Build(), // Chest D3.Hero.VisualItem.CreateBuilder().SetGbid(0).SetDyeType(0).SetItemEffectType(0).SetEffectLevel(0).Build(), // Feet D3.Hero.VisualItem.CreateBuilder().SetGbid(0).SetDyeType(0).SetItemEffectType(0).SetEffectLevel(0).Build(), // Hands D3.Hero.VisualItem.CreateBuilder().SetGbid(0).SetDyeType(0).SetItemEffectType(0).SetEffectLevel(0).Build(), // Weapon (1) D3.Hero.VisualItem.CreateBuilder().SetGbid(0).SetDyeType(0).SetItemEffectType(0).SetEffectLevel(0).Build(), // Weapon (2) D3.Hero.VisualItem.CreateBuilder().SetGbid(0).SetDyeType(0).SetItemEffectType(0).SetEffectLevel(0).Build(), // Shoulders D3.Hero.VisualItem.CreateBuilder().SetGbid(0).SetDyeType(0).SetItemEffectType(0).SetEffectLevel(0).Build(), // Legs }; this.Equipment = D3.Hero.VisualEquipment.CreateBuilder().AddRangeVisualItem(visualItems).Build(); }
public SkillSet(ToonClass @class, Toon toon) { this.@Class = @class; this.CurrentActiveSkills = Skills.GetAllActiveSkillsByClass(this.@Class).Take(6).ToArray(); var query = string.Format("SELECT * from active_skills WHERE id_toon={0}", toon.D3EntityID.IdLow); var cmd = new SQLiteCommand(query, DBManager.Connection); var reader = cmd.ExecuteReader(); //30592 base attack if (!reader.HasRows) //this is just in case something goes wrong on public void SaveToDB() -> we need to change this name ... { var query_first_insert = string.Format("INSERT INTO active_skills (id_toon,skill_0,skill_1,skill_2,skill_3,skill_4,skill_5) VALUES ({0},{1},{2},{3},{4},{5},{6} )", toon.D3EntityID.IdLow, this.CurrentActiveSkills[0], 30592, Skills.None, Skills.None, Skills.None, Skills.None, Skills.None); var cmd_first_insert = new SQLiteCommand(query_first_insert, DBManager.Connection); cmd_first_insert.ExecuteReader(); Logger.Debug("SkillSet: No Entry for {0}", toon.D3EntityID.IdLow); this.HotBarSkills = new HotbarButtonData[9] { new HotbarButtonData { SNOSkill = this.CurrentActiveSkills[0], ItemGBId = -1 }, // left-click new HotbarButtonData { SNOSkill = 30592, ItemGBId = -1 }, // right-click new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // hidden-bar - left-click switch - which key?? new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // hidden-bar - right-click switch (press x ingame) new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // bar-1 new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // bar-2 new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // bar-3 new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // bar-4 new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = 0x622256D4 } // bar-5 - potion }; } else { this.HotBarSkills = new HotbarButtonData[9] { new HotbarButtonData { SNOSkill = (int)reader["skill_0"], ItemGBId = -1 }, // left-click new HotbarButtonData { SNOSkill = (int)reader["skill_1"], ItemGBId = -1 }, // right-click new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // hidden-bar - left-click switch - which key?? new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // hidden-bar - right-click switch (press x ingame) new HotbarButtonData { SNOSkill = (int)reader["skill_5"], ItemGBId = -1 }, // bar-1 new HotbarButtonData { SNOSkill = (int)reader["skill_4"], ItemGBId = -1 }, // bar-2 new HotbarButtonData { SNOSkill = (int)reader["skill_3"], ItemGBId = -1 }, // bar-3 new HotbarButtonData { SNOSkill = (int)reader["skill_2"], ItemGBId = -1 }, // bar-4 new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = 0x622256D4 } // bar-5 - potion }; } //Current Active Skills part var query_as = string.Format("SELECT * from current_active_skills WHERE id_toon={0}", toon.D3EntityID.IdLow); var cmd_as = new SQLiteCommand(query_as, DBManager.Connection); var reader_as = cmd_as.ExecuteReader(); if (!reader_as.HasRows) { var query_first_insert = string.Format("INSERT INTO current_active_skills (id_toon,a_skill0,a_skill1,a_skill2,a_skill3,a_skill4,a_skill5) VALUES ({0},{1},{2},{3},{4},{5},{6} )", toon.D3EntityID.IdLow, this.CurrentActiveSkills[0], Skills.None, Skills.None, Skills.None, Skills.None, Skills.None, Skills.None); var cmd_first_insert = new SQLiteCommand(query_first_insert, DBManager.Connection); cmd_first_insert.ExecuteReader(); Logger.Debug("SkillSet: Current Active Skill Seen for the First Time Entry for {0}", toon.D3EntityID.IdLow); //Logger.Debug("CurrentActiveSkill {0}",reader_as["id_toon"]); this.ActiveSkills = new int[6] { this.CurrentActiveSkills[0], Skills.None, Skills.None, Skills.None, Skills.None, Skills.None }; } else { this.ActiveSkills = new int[6] { (int)reader_as["a_skill0"], (int)reader_as["a_skill1"], (int)reader_as["a_skill2"], (int)reader_as["a_skill3"], (int)reader_as["a_skill4"], (int)reader_as["a_skill5"] }; Logger.Debug("ActiveSkill {0}", reader_as["a_skill0"]); } this.PassiveSkills = new int[3] { -1, -1, -1 }; // setting passive skills here crashes the client, need to figure out the reason. /raist }
public SkillSet(ToonClass @class, Toon toon) { this.@Class = @class; var dbToon = DBSessions.AccountSession.Get <DBToon>(toon.PersistentID); if (dbToon.DBActiveSkills == null) { int[] ActiveSkillsList = Skills.GetAllActiveSkillsByClass(this.@Class).Take(1).ToArray(); this.ActiveSkills = new ActiveSkillSavedData[6] { new ActiveSkillSavedData { snoSkill = ActiveSkillsList[0], snoRune = -1 }, new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 }, new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 }, new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 }, new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 }, new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 } }; this.PassiveSkills = new int[3] { -1, -1, -1, }; dbToon.DBActiveSkills = new DBActiveSkills { Skill0 = ActiveSkillsList[0], Skill1 = -1, Skill2 = -1, Skill3 = -1, Skill4 = -1, Skill5 = -1, Rune0 = -1, Rune1 = -1, Rune2 = -1, Rune3 = -1, Rune4 = -1, Rune5 = -1, Passive0 = -1, Passive1 = -1, Passive2 = -1 }; DBSessions.AccountSession.SaveOrUpdate(dbToon.DBActiveSkills); DBSessions.AccountSession.Flush(); } else { this.ActiveSkills = new ActiveSkillSavedData[6] { new ActiveSkillSavedData { snoSkill = dbToon.DBActiveSkills.Skill0, snoRune = dbToon.DBActiveSkills.Rune0 }, new ActiveSkillSavedData { snoSkill = dbToon.DBActiveSkills.Skill1, snoRune = dbToon.DBActiveSkills.Rune1 }, new ActiveSkillSavedData { snoSkill = dbToon.DBActiveSkills.Skill2, snoRune = dbToon.DBActiveSkills.Rune2 }, new ActiveSkillSavedData { snoSkill = dbToon.DBActiveSkills.Skill3, snoRune = dbToon.DBActiveSkills.Rune3 }, new ActiveSkillSavedData { snoSkill = dbToon.DBActiveSkills.Skill4, snoRune = dbToon.DBActiveSkills.Rune4 }, new ActiveSkillSavedData { snoSkill = dbToon.DBActiveSkills.Skill5, snoRune = dbToon.DBActiveSkills.Rune5 }, }; this.PassiveSkills = new int[3] { dbToon.DBActiveSkills.Passive0, dbToon.DBActiveSkills.Passive1, dbToon.DBActiveSkills.Passive2, }; } this.HotBarSkills = new HotbarButtonData[6] { new HotbarButtonData { SNOSkill = ActiveSkills[0].snoSkill, Field1 = -1, ItemGBId = -1 }, // left-click new HotbarButtonData { SNOSkill = ActiveSkills[1].snoSkill, Field1 = -1, ItemGBId = -1 }, // right-click new HotbarButtonData { SNOSkill = ActiveSkills[2].snoSkill, Field1 = -1, ItemGBId = -1 }, // bar-1 new HotbarButtonData { SNOSkill = ActiveSkills[3].snoSkill, Field1 = -1, ItemGBId = -1 }, // bar-2 new HotbarButtonData { SNOSkill = ActiveSkills[4].snoSkill, Field1 = -1, ItemGBId = -1 }, // bar-3 new HotbarButtonData { SNOSkill = ActiveSkills[5].snoSkill, Field1 = -1, ItemGBId = -1 }, // bar-4 }; }
public static List<int> GetExtraSkillsByClass(ToonClass @class) { switch (@class) { case ToonClass.Barbarian: return Barbarian.Situational.List; case ToonClass.DemonHunter: return DemonHunter.Discipline.List; case ToonClass.Monk: return Monk.Mantras.List; case ToonClass.WitchDoctor: return WitchDoctor.Support.List; case ToonClass.Wizard: return Wizard.Utility.List; default: return null; } }
public SkillSet(ToonClass @class,Toon toon) { this.@Class = @class; this.CurrentActiveSkills = Skills.GetAllActiveSkillsByClass(this.@Class).Take(6).ToArray(); var query = string.Format("SELECT * from active_skills WHERE id_toon={0}", toon.D3EntityID.IdLow); var cmd = new SQLiteCommand(query, DBManager.Connection); var reader = cmd.ExecuteReader(); //30592 base attack if (!reader.HasRows) //this is just in case something goes wrong on public void SaveToDB() -> we need to change this name ... { var query_first_insert = string.Format("INSERT INTO active_skills (id_toon,skill_0,skill_1,skill_2,skill_3,skill_4,skill_5) VALUES ({0},{1},{2},{3},{4},{5},{6} )", toon.D3EntityID.IdLow, this.CurrentActiveSkills[0], 30592, Skills.None, Skills.None, Skills.None, Skills.None, Skills.None); var cmd_first_insert = new SQLiteCommand(query_first_insert, DBManager.Connection); cmd_first_insert.ExecuteReader(); Logger.Debug("SkillSet: No Entry for {0}", toon.D3EntityID.IdLow); this.HotBarSkills = new HotbarButtonData[9] { new HotbarButtonData { SNOSkill = this.CurrentActiveSkills[0], ItemGBId = -1 }, // left-click new HotbarButtonData { SNOSkill = 30592, ItemGBId = -1 }, // right-click new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // hidden-bar - left-click switch - which key?? new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // hidden-bar - right-click switch (press x ingame) new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // bar-1 new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // bar-2 new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // bar-3 new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // bar-4 new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = 0x622256D4 } // bar-5 - potion }; } else { this.HotBarSkills = new HotbarButtonData[9] { new HotbarButtonData { SNOSkill = (int)reader["skill_0"], ItemGBId = -1 }, // left-click new HotbarButtonData { SNOSkill = (int)reader["skill_1"], ItemGBId = -1 }, // right-click new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // hidden-bar - left-click switch - which key?? new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // hidden-bar - right-click switch (press x ingame) new HotbarButtonData { SNOSkill = (int)reader["skill_5"], ItemGBId = -1 }, // bar-1 new HotbarButtonData { SNOSkill = (int)reader["skill_4"], ItemGBId = -1 }, // bar-2 new HotbarButtonData { SNOSkill = (int)reader["skill_3"], ItemGBId = -1 }, // bar-3 new HotbarButtonData { SNOSkill = (int)reader["skill_2"], ItemGBId = -1 }, // bar-4 new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = 0x622256D4 } // bar-5 - potion }; } //Current Active Skills part var query_as = string.Format("SELECT * from current_active_skills WHERE id_toon={0}", toon.D3EntityID.IdLow); var cmd_as = new SQLiteCommand(query_as, DBManager.Connection); var reader_as = cmd_as.ExecuteReader(); if (!reader_as.HasRows) { var query_first_insert = string.Format("INSERT INTO current_active_skills (id_toon,a_skill0,a_skill1,a_skill2,a_skill3,a_skill4,a_skill5) VALUES ({0},{1},{2},{3},{4},{5},{6} )", toon.D3EntityID.IdLow, this.CurrentActiveSkills[0], Skills.None, Skills.None, Skills.None, Skills.None, Skills.None, Skills.None); var cmd_first_insert = new SQLiteCommand(query_first_insert, DBManager.Connection); cmd_first_insert.ExecuteReader(); Logger.Debug("SkillSet: Current Active Skill Seen for the First Time Entry for {0}", toon.D3EntityID.IdLow); //Logger.Debug("CurrentActiveSkill {0}",reader_as["id_toon"]); this.ActiveSkills = new int[6]{this.CurrentActiveSkills[0],Skills.None,Skills.None,Skills.None,Skills.None,Skills.None}; }else { this.ActiveSkills = new int[6]{(int)reader_as["a_skill0"],(int)reader_as["a_skill1"],(int)reader_as["a_skill2"],(int)reader_as["a_skill3"],(int)reader_as["a_skill4"],(int)reader_as["a_skill5"]}; Logger.Debug("ActiveSkill {0}",reader_as["a_skill0"]); } this.PassiveSkills = new int[3] { -1, -1, -1 }; // setting passive skills here crashes the client, need to figure out the reason. /raist }
public SkillSet(ToonClass @class, Toon toon) { this.@Class = @class; var dbToon = DBSessions.AccountSession.Get<DBToon>(toon.PersistentID); if (dbToon.DBActiveSkills == null) { int[] ActiveSkillsList = Skills.GetAllActiveSkillsByClass(this.@Class).Take(1).ToArray(); this.ActiveSkills = new ActiveSkillSavedData[6] { new ActiveSkillSavedData { snoSkill = ActiveSkillsList[0], snoRune = -1 }, new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 }, new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 }, new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 }, new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 }, new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 } }; this.PassiveSkills = new int[3] { -1,-1,-1, }; dbToon.DBActiveSkills = new DBActiveSkills { Skill0 = ActiveSkillsList[0], Skill1 = -1, Skill2 = -1, Skill3 = -1, Skill4 = -1, Skill5 = -1, Rune0 = -1, Rune1 = -1, Rune2 = -1, Rune3 = -1, Rune4 = -1, Rune5 = -1, Passive0 = -1, Passive1 = -1, Passive2 = -1 }; DBSessions.AccountSession.SaveOrUpdate(dbToon.DBActiveSkills); DBSessions.AccountSession.Flush(); } else { this.ActiveSkills = new ActiveSkillSavedData[6] { new ActiveSkillSavedData { snoSkill = dbToon.DBActiveSkills.Skill0, snoRune = dbToon.DBActiveSkills.Rune0 }, new ActiveSkillSavedData { snoSkill = dbToon.DBActiveSkills.Skill1, snoRune = dbToon.DBActiveSkills.Rune1 }, new ActiveSkillSavedData { snoSkill = dbToon.DBActiveSkills.Skill2, snoRune = dbToon.DBActiveSkills.Rune2 }, new ActiveSkillSavedData { snoSkill = dbToon.DBActiveSkills.Skill3, snoRune = dbToon.DBActiveSkills.Rune3 }, new ActiveSkillSavedData { snoSkill = dbToon.DBActiveSkills.Skill4, snoRune = dbToon.DBActiveSkills.Rune4 }, new ActiveSkillSavedData { snoSkill = dbToon.DBActiveSkills.Skill5, snoRune = dbToon.DBActiveSkills.Rune5 }, }; this.PassiveSkills = new int[3] { dbToon.DBActiveSkills.Passive0, dbToon.DBActiveSkills.Passive1, dbToon.DBActiveSkills.Passive2, }; } this.HotBarSkills = new HotbarButtonData[6] { new HotbarButtonData { SNOSkill = ActiveSkills[0].snoSkill, Field1 = -1, ItemGBId = -1 }, // left-click new HotbarButtonData { SNOSkill = ActiveSkills[1].snoSkill, Field1 = -1, ItemGBId = -1 }, // right-click new HotbarButtonData { SNOSkill = ActiveSkills[2].snoSkill, Field1 = -1, ItemGBId = -1 }, // bar-1 new HotbarButtonData { SNOSkill = ActiveSkills[3].snoSkill, Field1 = -1, ItemGBId = -1 }, // bar-2 new HotbarButtonData { SNOSkill = ActiveSkills[4].snoSkill, Field1 = -1, ItemGBId = -1 }, // bar-3 new HotbarButtonData { SNOSkill = ActiveSkills[5].snoSkill, Field1 = -1, ItemGBId = -1 }, // bar-4 }; }
//<<<<<<< HEAD // public Toon(ulong persistantId, string name, byte @class, byte gender, byte level, long accountId) // Toon with given persistent ID // :base(persistantId) // { // this.SetFields(name, (ToonClass)@class, (ToonFlags)gender, level, AccountManager.GetAccountByPersistantID((ulong)accountId)); // } // public Toon(string name, int classId, ToonFlags flags, byte level, Account account) // Toon with **newly generated** persistent ID // : base(StringHashHelper.HashIdentity(name)) // { // this.SetFields(name, GetClassByID(classId), flags, level, account); // } //======= //>>>>>>> 8574c238179fe15ed89f064963d15f70293617bc private void SetFields(string name, ToonClass @class, ToonFlags flags, byte level, Account owner) { this.ToonHandle = new ToonHandleHelper(this.PersistentID); this.D3EntityID = this.ToonHandle.ToD3EntityID(); this.BnetEntityID = this.ToonHandle.ToBnetEntityID(); this.Name = name; this.Class = @class; this.Flags = flags; this.Level = level; this.Owner = owner; var itemsGenerator = new Items.ItemTypeGenerator(); var visualItems = new[] { // Head D3.Hero.VisualItem.CreateBuilder() .SetGbid(itemsGenerator.generateRandomElement(Items.ItemType.Helm).Gbid) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Chest D3.Hero.VisualItem.CreateBuilder() .SetGbid(itemsGenerator.generateRandomElement(Items.ItemType.ChestArmor).Gbid) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Feet D3.Hero.VisualItem.CreateBuilder() .SetGbid(itemsGenerator.generateRandomElement(Items.ItemType.Boots).Gbid) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Hands D3.Hero.VisualItem.CreateBuilder() .SetGbid(itemsGenerator.generateRandomElement(Items.ItemType.Gloves).Gbid) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Weapon (1) D3.Hero.VisualItem.CreateBuilder() .SetGbid(itemsGenerator.generateRandomElement(Items.ItemType.Sword_1H).Gbid) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Weapon (2) D3.Hero.VisualItem.CreateBuilder() .SetGbid(itemsGenerator.generateRandomElement(Items.ItemType.Shield).Gbid) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Shoulders D3.Hero.VisualItem.CreateBuilder() .SetGbid(itemsGenerator.generateRandomElement(Items.ItemType.Shoulders).Gbid) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), // Legs D3.Hero.VisualItem.CreateBuilder() .SetGbid(itemsGenerator.generateRandomElement(Items.ItemType.Pants).Gbid) .SetDyeType(0) .SetItemEffectType(0) .SetEffectLevel(0) .Build(), }; this.Equipment = D3.Hero.VisualEquipment.CreateBuilder().AddRangeVisualItem(visualItems).Build(); this.Digest = D3.Hero.Digest.CreateBuilder().SetVersion(891) .SetHeroId(this.D3EntityID) .SetHeroName(this.Name) .SetGbidClass((int)this.ClassID) .SetPlayerFlags((uint)this.Flags) .SetLevel(this.Level) .SetVisualEquipment(this.Equipment) .SetLastPlayedAct(0) .SetHighestUnlockedAct(0) .SetLastPlayedDifficulty(0) .SetHighestUnlockedDifficulty(0) .SetLastPlayedQuest(-1) .SetLastPlayedQuestStep(-1) .SetTimePlayed(0) .Build(); }