public static GetAllActiveSkillsByClass ( ToonClass @class ) : List |
||
@class | ToonClass | |
return | List |
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. }
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 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 }