diff --git a/MHFZ_Overlay/Models/Addresses/AddressModelHGE.cs b/MHFZ_Overlay/Models/Addresses/AddressModelHGE.cs index 91461b21..2fa294c0 100644 --- a/MHFZ_Overlay/Models/Addresses/AddressModelHGE.cs +++ b/MHFZ_Overlay/Models/Addresses/AddressModelHGE.cs @@ -527,6 +527,60 @@ public AddressModelHGE(Mem m) /// public override int HalkFullness() => this.M.ReadByte("mhfo-hd.dll+ED3C123"); + /// + public override int HalkLevel() => this.M.ReadByte("mhfo-hd.dll+ED3C124"); + + /// + public override int HalkIntimacy() => this.M.ReadByte("mhfo-hd.dll+ED3C125"); + + /// + public override int HalkHealth() => this.M.ReadByte("mhfo-hd.dll+ED3C126"); + + /// + public override int HalkAttack() => this.M.ReadByte("mhfo-hd.dll+ED3C127"); + + /// + public override int HalkDefense() => this.M.ReadByte("mhfo-hd.dll+ED3C128"); + + /// + public override int HalkIntelligence() => this.M.ReadByte("mhfo-hd.dll+ED3C129"); + + /// + public override int HalkSkill1() => this.M.ReadByte("mhfo-hd.dll+ED3C12A"); + + /// + public override int HalkSkill2() => this.M.ReadByte("mhfo-hd.dll+ED3C12B"); + + /// + public override int HalkSkill3() => this.M.ReadByte("mhfo-hd.dll+ED3C12C"); + + /// + public override int HalkElementNone() => this.M.ReadByte("mhfo-hd.dll+ED3C12E"); + + /// + public override int HalkFire() => this.M.ReadByte("mhfo-hd.dll+ED3C12F"); + + /// + public override int HalkThunder() => this.M.ReadByte("mhfo-hd.dll+ED3C130"); + + /// + public override int HalkWater() => this.M.ReadByte("mhfo-hd.dll+ED3C131"); + + /// + public override int HalkIce() => this.M.ReadByte("mhfo-hd.dll+ED3C132"); + + /// + public override int HalkDragon() => this.M.ReadByte("mhfo-hd.dll+ED3C133"); + + /// + public override int HalkSleep() => this.M.ReadByte("mhfo-hd.dll+ED3C134"); + + /// + public override int HalkParalysis() => this.M.ReadByte("mhfo-hd.dll+ED3C135"); + + /// + public override int HalkPoison() => this.M.ReadByte("mhfo-hd.dll+ED3C136"); + /// public override int RankBand() => this.M.ReadByte("mhfo-hd.dll+2AFA788"); @@ -1790,4 +1844,44 @@ public AddressModelHGE(Mem m) /// //public override int DivaPrayerGemStart() => this.M.ReadInt("mhfo-hd.dll+E820DF8"); + + /// + public override int GuildPoogie1Skill() => this.M.ReadByte("mhfo-hd.dll+E76BBDB"); + + /// + public override int GuildPoogie2Skill() => this.M.ReadByte("mhfo-hd.dll+E76BBEB"); + + /// + public override int GuildPoogie3Skill() => this.M.ReadByte("mhfo-hd.dll+E76BBFB"); + + /// + public override int DivaPrayerGemRedSkill() => this.M.Read2Byte("mhfo-hd.dll+E6CCF14"); + + /// + public override int DivaPrayerGemRedLevel() => this.M.Read2Byte("mhfo-hd.dll+E6CCF16"); + + /// + public override int DivaPrayerGemYellowSkill() => this.M.Read2Byte("mhfo-hd.dll+E6CCF18"); + + /// + public override int DivaPrayerGemYellowLevel() => this.M.Read2Byte("mhfo-hd.dll+E6CCF1A"); + + /// + public override int DivaPrayerGemGreenSkill() => this.M.Read2Byte("mhfo-hd.dll+E6CCF1C"); + + /// + public override int DivaPrayerGemGreenLevel() => this.M.Read2Byte("mhfo-hd.dll+E6CCF1E"); + + /// + public override int DivaPrayerGemBlueSkill() => this.M.Read2Byte("mhfo-hd.dll+E6CCF20"); + + /// + public override int DivaPrayerGemBlueLevel() => this.M.Read2Byte("mhfo-hd.dll+E6CCF22"); + + /// + public override bool HalkOn() => this.M.ReadByte("mhfo-hd.dll+E7FE233") > 0 ? true : false; + + /// + public override bool HalkPotEffectOn() => this.M.ReadByte("mhfo-hd.dll+DC6C524") > 0 ? true : false; + } diff --git a/MHFZ_Overlay/Models/Addresses/AddressModelNotHGE.cs b/MHFZ_Overlay/Models/Addresses/AddressModelNotHGE.cs index ecd66db8..d47b75f7 100644 --- a/MHFZ_Overlay/Models/Addresses/AddressModelNotHGE.cs +++ b/MHFZ_Overlay/Models/Addresses/AddressModelNotHGE.cs @@ -442,6 +442,60 @@ public AddressModelNotHGE(Mem m) /// public override int HalkFullness() => this.M.ReadByte("mhfo.dll+6101983"); + /// + public override int HalkLevel() => this.M.ReadByte("mhfo.dll+6101984"); + + /// + public override int HalkIntimacy() => this.M.ReadByte("mhfo.dll+6101985"); + + /// + public override int HalkHealth() => this.M.ReadByte("mhfo.dll+6101986"); + + /// + public override int HalkAttack() => this.M.ReadByte("mhfo.dll+6101987"); + + /// + public override int HalkDefense() => this.M.ReadByte("mhfo.dll+6101988"); + + /// + public override int HalkIntelligence() => this.M.ReadByte("mhfo.dll+6101989"); + + /// + public override int HalkSkill1() => this.M.ReadByte("mhfo.dll+610198A"); + + /// + public override int HalkSkill2() => this.M.ReadByte("mhfo.dll+610198B"); + + /// + public override int HalkSkill3() => this.M.ReadByte("mhfo.dll+610198C"); + + /// + public override int HalkElementNone() => this.M.ReadByte("mhfo.dll+610198E"); + + /// + public override int HalkFire() => this.M.ReadByte("mhfo.dll+610198F"); + + /// + public override int HalkThunder() => this.M.ReadByte("mhfo.dll+6101990"); + + /// + public override int HalkWater() => this.M.ReadByte("mhfo.dll+6101991"); + + /// + public override int HalkIce() => this.M.ReadByte("mhfo.dll+6101992"); + + /// + public override int HalkDragon() => this.M.ReadByte("mhfo.dll+6101993"); + + /// + public override int HalkSleep() => this.M.ReadByte("mhfo.dll+6101994"); + + /// + public override int HalkParalysis() => this.M.ReadByte("mhfo.dll+6101995"); + + /// + public override int HalkPoison() => this.M.ReadByte("mhfo.dll+6101996"); + /// public override int RankBand() => this.M.ReadByte("mhfo.dll+28C2BD8"); @@ -1710,4 +1764,42 @@ public AddressModelNotHGE(Mem m) /// //public override int DivaPrayerGemStart() => this.M.ReadInt("mhfo.dll+5BE91C8"); + /// + public override int GuildPoogie1Skill() => this.M.ReadByte("mhfo.dll+5B33FB3"); + + /// + public override int GuildPoogie2Skill() => this.M.ReadByte("mhfo.dll+5B33FC3"); + + /// + public override int GuildPoogie3Skill() => this.M.ReadByte("mhfo.dll+5B33FD3"); + + /// + public override int DivaPrayerGemRedSkill() => this.M.Read2Byte("mhfo.dll+5A95354"); + + /// + public override int DivaPrayerGemRedLevel() => this.M.Read2Byte("mhfo.dll+5A95356"); + + /// + public override int DivaPrayerGemYellowSkill() => this.M.Read2Byte("mhfo.dll+5A95358"); + + /// + public override int DivaPrayerGemYellowLevel() => this.M.Read2Byte("mhfo.dll+5A9535A"); + + /// + public override int DivaPrayerGemGreenSkill() => this.M.Read2Byte("mhfo.dll+5A9535C"); + + /// + public override int DivaPrayerGemGreenLevel() => this.M.Read2Byte("mhfo.dll+5A9535E"); + + /// + public override int DivaPrayerGemBlueSkill() => this.M.Read2Byte("mhfo.dll+5A95360"); + + /// + public override int DivaPrayerGemBlueLevel() => this.M.Read2Byte("mhfo.dll+5A95362"); + + /// + public override bool HalkOn() => this.M.ReadByte("mhfo.dll+5BC6603") > 0 ? true : false; + + /// + public override bool HalkPotEffectOn() => this.M.ReadByte("mhfo.dll+5034964") > 0 ? true : false; } diff --git a/MHFZ_Overlay/Models/Collections/Monsters.cs b/MHFZ_Overlay/Models/Collections/Monsters.cs index ea0d4b54..0c69119d 100644 --- a/MHFZ_Overlay/Models/Collections/Monsters.cs +++ b/MHFZ_Overlay/Models/Collections/Monsters.cs @@ -47,7 +47,7 @@ public static class Monsters { 29, "Rocks" }, { 30, "Ioprey" }, { 31, "Iodrome" }, - { 32, "Pugis" }, + { 32, "Poogies" }, { 33, "Kirin" }, { 34, "Cephalos" }, { 35, "Giaprey / Giadrome" }, diff --git a/MHFZ_Overlay/Models/QuestsActiveFeature.cs b/MHFZ_Overlay/Models/QuestsActiveFeature.cs new file mode 100644 index 00000000..1a037d7c --- /dev/null +++ b/MHFZ_Overlay/Models/QuestsActiveFeature.cs @@ -0,0 +1,17 @@ +// © 2023 The mhfz-overlay developers. +// Use of this source code is governed by a MIT license that can be +// found in the LICENSE file. + +namespace MHFZ_Overlay.Models; + +using System; + +// TODO: ORM +public sealed class QuestsActiveFeature +{ + public long? QuestsActiveFeatureID { get; set; } + + public long? ActiveFeature { get; set; } + + public long? RunID { get; set; } +} diff --git a/MHFZ_Overlay/Models/QuestsCourse.cs b/MHFZ_Overlay/Models/QuestsCourse.cs new file mode 100644 index 00000000..baca0c85 --- /dev/null +++ b/MHFZ_Overlay/Models/QuestsCourse.cs @@ -0,0 +1,17 @@ +// © 2023 The mhfz-overlay developers. +// Use of this source code is governed by a MIT license that can be +// found in the LICENSE file. + +namespace MHFZ_Overlay.Models; + +using System; + +// TODO: ORM +public sealed class QuestsCourse +{ + public long? QuestsCourseID { get; set; } + + public long? Rights { get; set; } + + public long? RunID { get; set; } +} diff --git a/MHFZ_Overlay/Models/QuestsDiva.cs b/MHFZ_Overlay/Models/QuestsDiva.cs new file mode 100644 index 00000000..7e8fed87 --- /dev/null +++ b/MHFZ_Overlay/Models/QuestsDiva.cs @@ -0,0 +1,23 @@ +// © 2023 The mhfz-overlay developers. +// Use of this source code is governed by a MIT license that can be +// found in the LICENSE file. + +namespace MHFZ_Overlay.Models; + +using System; + +// TODO: ORM +public sealed class QuestsDiva +{ + public long? QuestsDivaID { get; set; } + public bool? DivaSongBuffOn { get; set; } + public long? DivaPrayerGemRedSkill { get; set; } + public long? DivaPrayerGemRedLevel { get; set; } + public long? DivaPrayerGemYellowSkill { get; set; } + public long? DivaPrayerGemYellowLevel { get; set; } + public long? DivaPrayerGemGreenSkill { get; set; } + public long? DivaPrayerGemGreenLevel { get; set; } + public long? DivaPrayerGemBlueSkill { get; set; } + public long? DivaPrayerGemBlueLevel { get; set; } + public long? RunID { get; set; } +} diff --git a/MHFZ_Overlay/Models/QuestsGuildPoogie.cs b/MHFZ_Overlay/Models/QuestsGuildPoogie.cs new file mode 100644 index 00000000..0cca5513 --- /dev/null +++ b/MHFZ_Overlay/Models/QuestsGuildPoogie.cs @@ -0,0 +1,21 @@ +// © 2023 The mhfz-overlay developers. +// Use of this source code is governed by a MIT license that can be +// found in the LICENSE file. + +namespace MHFZ_Overlay.Models; + +using System; + +// TODO: ORM +public sealed class QuestsGuildPoogie +{ + public long? QuestsGuildPoogieID { get; set; } + + public long? GuildPoogie1Skill { get; set; } + + public long? GuildPoogie2Skill { get; set; } + + public long? GuildPoogie3Skill { get; set; } + + public long? RunID { get; set; } +} diff --git a/MHFZ_Overlay/Models/QuestsHalk.cs b/MHFZ_Overlay/Models/QuestsHalk.cs new file mode 100644 index 00000000..1b8e7032 --- /dev/null +++ b/MHFZ_Overlay/Models/QuestsHalk.cs @@ -0,0 +1,57 @@ +// © 2023 The mhfz-overlay developers. +// Use of this source code is governed by a MIT license that can be +// found in the LICENSE file. + +namespace MHFZ_Overlay.Models; + +using System; + +// TODO: ORM +public sealed class QuestsHalk +{ + public long? QuestsHalkID { get; set; } + + public bool? HalkOn { get; set; } + + public bool? HalkPotEffectOn { get; set; } + + public long? HalkFullness { get; set; } + + public long? HalkLevel { get; set; } + + public long? HalkIntimacy { get; set; } + + public long? HalkHealth { get; set; } + + public long? HalkAttack { get; set; } + + public long? HalkDefense { get; set; } + + public long? HalkIntelligence { get; set; } + + public long? HalkSkill1 { get; set; } + + public long? HalkSkill2 { get; set; } + + public long? HalkSkill3 { get; set; } + + public long? HalkElementNone { get; set; } + + public long? HalkFire { get; set; } + + public long? HalkThunder { get; set; } + + public long? HalkWater { get; set; } + + public long? HalkIce { get; set; } + + public long? HalkDragon { get; set; } + + public long? HalkSleep { get; set; } + + public long? HalkParalysis { get; set; } + + public long? HalkPoison { get; set; } + + public long? RunID { get; set; } +} diff --git a/MHFZ_Overlay/Models/Structures/Bitfields.cs b/MHFZ_Overlay/Models/Structures/Bitfields.cs index 94dcd955..1cc7a570 100644 --- a/MHFZ_Overlay/Models/Structures/Bitfields.cs +++ b/MHFZ_Overlay/Models/Structures/Bitfields.cs @@ -425,22 +425,24 @@ public enum RunBuff : uint [DefaultValue(None)] None = 0, Halk = 1, - PugiItem = 2, + PoogieItem = 2, DivaSong = 4, - HalkPot = 8, - LoginBoost = 16, - Bento = 32, - GuildPugi = 64, - ActiveFeature = 128, - GuildFood = 256, - DivaSkill = 512, - SecretTechnique = 1024, - DivaPrayerGem = 2048, - HunterSupportCourse = 4096, + HalkPotEffect = 8, + Bento = 16, + GuildPoogie = 32, + ActiveFeature = 64, + GuildFood = 128, + DivaSkill = 256, + SecretTechnique = 512, + DivaPrayerGem = 1024, + /// + /// Can come from hunter aid/support course. + /// + CourseAttackBoost = 2048, // old categories - TimeAttack = PugiItem | DivaSong | Bento, - FreestyleNoSecretTech = Halk | PugiItem | DivaSong | Bento | GuildPugi | ActiveFeature | GuildFood | DivaSkill | DivaPrayerGem, + TimeAttack = PoogieItem | DivaSong | Bento, + FreestyleNoSecretTech = Halk | PoogieItem | DivaSong | Bento | GuildPoogie | ActiveFeature | GuildFood | DivaSkill | DivaPrayerGem, FreestyleWithSecretTech = FreestyleNoSecretTech | SecretTechnique, } diff --git a/MHFZ_Overlay/Services/DatabaseService.cs b/MHFZ_Overlay/Services/DatabaseService.cs index 20c3a56c..572a9d25 100644 --- a/MHFZ_Overlay/Services/DatabaseService.cs +++ b/MHFZ_Overlay/Services/DatabaseService.cs @@ -1869,6 +1869,156 @@ FinalTimeValue ASC } Logger.Debug("Inserted into QuestsActiveFeature table"); + + sql = @"INSERT INTO QuestsGuildPoogie ( + GuildPoogie1Skill, + GuildPoogie2Skill, + GuildPoogie3Skill, + RunID + ) VALUES ( + @GuildPoogie1Skill, + @GuildPoogie2Skill, + @GuildPoogie3Skill, + @RunID + )"; + + using (var cmd = new SQLiteCommand(sql, conn)) + { + cmd.Parameters.AddWithValue("@GuildPoogie1Skill", model.GuildPoogie1Skill()); + cmd.Parameters.AddWithValue("@GuildPoogie2Skill", model.GuildPoogie2Skill()); + cmd.Parameters.AddWithValue("@GuildPoogie3Skill", model.GuildPoogie3Skill()); + cmd.Parameters.AddWithValue("@RunID", runID); + cmd.ExecuteNonQuery(); + } + + Logger.Debug("Inserted into QuestsGuildPoogie table"); + + sql = @"INSERT INTO QuestsHalk ( + HalkOn, + HalkPotEffectOn, + HalkFullness, + HalkLevel, + HalkIntimacy, + HalkHealth, + HalkAttack, + HalkDefense, + HalkIntelligence, + HalkSkill1, + HalkSkill2, + HalkSkill3, + HalkElementNone, + HalkFire, + HalkThunder, + HalkWater, + HalkIce, + HalkDragon, + HalkSleep, + HalkParalysis, + HalkPoison, + RunID + ) VALUES ( + @HalkOn, + @HalkPotEffectOn, + @HalkFullness, + @HalkLevel, + @HalkIntimacy, + @HalkHealth, + @HalkAttack, + @HalkDefense, + @HalkIntelligence, + @HalkSkill1, + @HalkSkill2, + @HalkSkill3, + @HalkElementNone, + @HalkFire, + @HalkThunder, + @HalkWater, + @HalkIce, + @HalkDragon, + @HalkSleep, + @HalkParalysis, + @HalkPoison, + @RunID + )"; + + using (var cmd = new SQLiteCommand(sql, conn)) + { + cmd.Parameters.AddWithValue("@HalkOn", model.HalkOn()); + cmd.Parameters.AddWithValue("@HalkPotEffectOn", model.HalkPotEffectOn()); + cmd.Parameters.AddWithValue("@HalkFullness", model.HalkFullness()); + cmd.Parameters.AddWithValue("@HalkLevel", model.HalkLevel()); + cmd.Parameters.AddWithValue("@HalkIntimacy", model.HalkIntimacy()); + cmd.Parameters.AddWithValue("@HalkHealth", model.HalkHealth()); + cmd.Parameters.AddWithValue("@HalkAttack", model.HalkAttack()); + cmd.Parameters.AddWithValue("@HalkDefense", model.HalkDefense()); + cmd.Parameters.AddWithValue("@HalkIntelligence", model.HalkIntelligence()); + cmd.Parameters.AddWithValue("@HalkSkill1", model.HalkSkill1()); + cmd.Parameters.AddWithValue("@HalkSkill2", model.HalkSkill2()); + cmd.Parameters.AddWithValue("@HalkSkill3", model.HalkSkill3()); + cmd.Parameters.AddWithValue("@HalkElementNone", model.HalkElementNone()); + cmd.Parameters.AddWithValue("@HalkFire", model.HalkFire()); + cmd.Parameters.AddWithValue("@HalkThunder", model.HalkThunder()); + cmd.Parameters.AddWithValue("@HalkWater", model.HalkWater()); + cmd.Parameters.AddWithValue("@HalkIce", model.HalkIce()); + cmd.Parameters.AddWithValue("@HalkDragon", model.HalkDragon()); + cmd.Parameters.AddWithValue("@HalkSleep", model.HalkSleep()); + cmd.Parameters.AddWithValue("@HalkParalysis", model.HalkParalysis()); + cmd.Parameters.AddWithValue("@HalkPoison", model.HalkPoison()); + cmd.Parameters.AddWithValue("@RunID", runID); + + cmd.ExecuteNonQuery(); + } + + Logger.Debug("Inserted into QuestsHalk table"); + + sql = @"INSERT INTO QuestsDiva ( + DivaSongBuffOn, + DivaPrayerGemRedSkill, + DivaPrayerGemRedLevel, + DivaPrayerGemYellowSkill, + DivaPrayerGemYellowLevel, + DivaPrayerGemGreenSkill, + DivaPrayerGemGreenLevel, + DivaPrayerGemBlueSkill, + DivaPrayerGemBlueLevel, + RunID + ) VALUES ( + @DivaSongBuffOn, + @DivaPrayerGemRedSkill, + @DivaPrayerGemRedLevel, + @DivaPrayerGemYellowSkill, + @DivaPrayerGemYellowLevel, + @DivaPrayerGemGreenSkill, + @DivaPrayerGemGreenLevel, + @DivaPrayerGemBlueSkill, + @DivaPrayerGemBlueLevel, + @RunID + )"; + + using (var cmd = new SQLiteCommand(sql, conn)) + { + cmd.Parameters.AddWithValue("@DivaSongBuffOn", !model.DivaSongEnded); + cmd.Parameters.AddWithValue("@DivaPrayerGemRedSkill", model.DivaPrayerGemRedSkill()); + cmd.Parameters.AddWithValue("@DivaPrayerGemRedLevel", model.DivaPrayerGemRedLevel()); + cmd.Parameters.AddWithValue("@DivaPrayerGemYellowSkill", model.DivaPrayerGemYellowSkill()); + cmd.Parameters.AddWithValue("@DivaPrayerGemYellowLevel", model.DivaPrayerGemYellowLevel()); + cmd.Parameters.AddWithValue("@DivaPrayerGemGreenSkill", model.DivaPrayerGemGreenSkill()); + cmd.Parameters.AddWithValue("@DivaPrayerGemGreenLevel", model.DivaPrayerGemGreenLevel()); + cmd.Parameters.AddWithValue("@DivaPrayerGemBlueSkill", model.DivaPrayerGemBlueSkill()); + cmd.Parameters.AddWithValue("@DivaPrayerGemBlueLevel", model.DivaPrayerGemBlueLevel()); + cmd.Parameters.AddWithValue("@RunID", runID); + cmd.ExecuteNonQuery(); + } + + Logger.Debug("Inserted into QuestsDiva table"); + + + + + + + + // TODO more tables @@ -2771,6 +2921,86 @@ AFTER DELETE ON QuestsOverlayHash cmd.ExecuteNonQuery(); } + using (var cmd = new SQLiteCommand(conn)) + { + cmd.CommandText = @"CREATE TRIGGER IF NOT EXISTS prevent_quests_diva_updates + AFTER UPDATE ON QuestsDiva + BEGIN + SELECT RAISE(ROLLBACK, 'Updating rows is not allowed. Keep in mind that all attempted modifications are logged into the central database.'); + END;"; + cmd.ExecuteNonQuery(); + } + + using (var cmd = new SQLiteCommand(conn)) + { + cmd.CommandText = @"CREATE TRIGGER IF NOT EXISTS prevent_quests_diva_deletion + AFTER DELETE ON QuestsDiva + BEGIN + SELECT RAISE(ROLLBACK, 'Updating rows is not allowed. Keep in mind that all attempted modifications are logged into the central database.'); + END;"; + cmd.ExecuteNonQuery(); + } + + using (var cmd = new SQLiteCommand(conn)) + { + cmd.CommandText = @"CREATE TRIGGER IF NOT EXISTS prevent_quests_halk_updates + AFTER UPDATE ON QuestsHalk + BEGIN + SELECT RAISE(ROLLBACK, 'Updating rows is not allowed. Keep in mind that all attempted modifications are logged into the central database.'); + END;"; + cmd.ExecuteNonQuery(); + } + + using (var cmd = new SQLiteCommand(conn)) + { + cmd.CommandText = @"CREATE TRIGGER IF NOT EXISTS prevent_quests_halk_deletion + AFTER DELETE ON QuestsHalk + BEGIN + SELECT RAISE(ROLLBACK, 'Updating rows is not allowed. Keep in mind that all attempted modifications are logged into the central database.'); + END;"; + cmd.ExecuteNonQuery(); + } + + using (var cmd = new SQLiteCommand(conn)) + { + cmd.CommandText = @"CREATE TRIGGER IF NOT EXISTS prevent_quests_active_feature_updates + AFTER UPDATE ON QuestsActiveFeature + BEGIN + SELECT RAISE(ROLLBACK, 'Updating rows is not allowed. Keep in mind that all attempted modifications are logged into the central database.'); + END;"; + cmd.ExecuteNonQuery(); + } + + using (var cmd = new SQLiteCommand(conn)) + { + cmd.CommandText = @"CREATE TRIGGER IF NOT EXISTS prevent_quests_active_feature_deletion + AFTER DELETE ON QuestsActiveFeature + BEGIN + SELECT RAISE(ROLLBACK, 'Updating rows is not allowed. Keep in mind that all attempted modifications are logged into the central database.'); + END;"; + cmd.ExecuteNonQuery(); + } + + using (var cmd = new SQLiteCommand(conn)) + { + cmd.CommandText = @"CREATE TRIGGER IF NOT EXISTS prevent_quests_guild_poogie_updates + AFTER UPDATE ON QuestsGuildPoogie + BEGIN + SELECT RAISE(ROLLBACK, 'Updating rows is not allowed. Keep in mind that all attempted modifications are logged into the central database.'); + END;"; + cmd.ExecuteNonQuery(); + } + + using (var cmd = new SQLiteCommand(conn)) + { + cmd.CommandText = @"CREATE TRIGGER IF NOT EXISTS prevent_quests_guild_poogie_deletion + AFTER DELETE ON QuestsGuildPoogie + BEGIN + SELECT RAISE(ROLLBACK, 'Updating rows is not allowed. Keep in mind that all attempted modifications are logged into the central database.'); + END;"; + cmd.ExecuteNonQuery(); + } + // TODO run buffs using (var cmd = new SQLiteCommand(conn)) @@ -5396,6 +5626,69 @@ FOREIGN KEY(RunID) REFERENCES Quests(RunID) cmd.ExecuteNonQuery(); } + sql = @"CREATE TABLE IF NOT EXISTS QuestsGuildPoogie( + QuestsGuildPoogieID INTEGER PRIMARY KEY AUTOINCREMENT, + GuildPoogie1Skill INTEGER NOT NULL DEFAULT 0, + GuildPoogie2Skill INTEGER NOT NULL DEFAULT 0, + GuildPoogie3Skill INTEGER NOT NULL DEFAULT 0, + RunID INTEGER NOT NULL, + FOREIGN KEY(RunID) REFERENCES Quests(RunID) + )"; + using (var cmd = new SQLiteCommand(sql, conn)) + { + cmd.ExecuteNonQuery(); + } + + sql = @"CREATE TABLE IF NOT EXISTS QuestsHalk( + QuestsHalkID INTEGER PRIMARY KEY AUTOINCREMENT, + HalkOn INTEGER NOT NULL DEFAULT 0, + HalkPotEffectOn INTEGER NOT NULL DEFAULT 0, + HalkFullness INTEGER NOT NULL DEFAULT 0, + HalkLevel INTEGER NOT NULL DEFAULT 0, + HalkIntimacy INTEGER NOT NULL DEFAULT 0, + HalkHealth INTEGER NOT NULL DEFAULT 0, + HalkAttack INTEGER NOT NULL DEFAULT 0, + HalkDefense INTEGER NOT NULL DEFAULT 0, + HalkIntelligence INTEGER NOT NULL DEFAULT 0, + HalkSkill1 INTEGER NOT NULL DEFAULT 0, + HalkSkill2 INTEGER NOT NULL DEFAULT 0, + HalkSkill3 INTEGER NOT NULL DEFAULT 0, + HalkElementNone INTEGER NOT NULL DEFAULT 0, + HalkFire INTEGER NOT NULL DEFAULT 0, + HalkThunder INTEGER NOT NULL DEFAULT 0, + HalkWater INTEGER NOT NULL DEFAULT 0, + HalkIce INTEGER NOT NULL DEFAULT 0, + HalkDragon INTEGER NOT NULL DEFAULT 0, + HalkSleep INTEGER NOT NULL DEFAULT 0, + HalkParalysis INTEGER NOT NULL DEFAULT 0, + HalkPoison INTEGER NOT NULL DEFAULT 0, + RunID INTEGER NOT NULL, + FOREIGN KEY(RunID) REFERENCES Quests(RunID) + )"; + using (var cmd = new SQLiteCommand(sql, conn)) + { + cmd.ExecuteNonQuery(); + } + + sql = @"CREATE TABLE IF NOT EXISTS QuestsDiva( + QuestsDivaID INTEGER PRIMARY KEY AUTOINCREMENT, + DivaSongBuffOn INTEGER NOT NULL DEFAULT 0, + DivaPrayerGemRedSkill INTEGER NOT NULL DEFAULT 0, + DivaPrayerGemRedLevel INTEGER NOT NULL DEFAULT 0, + DivaPrayerGemYellowSkill INTEGER NOT NULL DEFAULT 0, + DivaPrayerGemYellowLevel INTEGER NOT NULL DEFAULT 0, + DivaPrayerGemGreenSkill INTEGER NOT NULL DEFAULT 0, + DivaPrayerGemGreenLevel INTEGER NOT NULL DEFAULT 0, + DivaPrayerGemBlueSkill INTEGER NOT NULL DEFAULT 0, + DivaPrayerGemBlueLevel INTEGER NOT NULL DEFAULT 0, + RunID INTEGER NOT NULL, + FOREIGN KEY(RunID) REFERENCES Quests(RunID) + )"; + using (var cmd = new SQLiteCommand(sql, conn)) + { + cmd.ExecuteNonQuery(); + } + // TODO extra tables // a mh game but like a MUD. hunt in-game to get many kinds of points for this game. hunt and tame monsters. challenge other CPU players/monsters. diff --git a/MHFZ_Overlay/Services/DiscordService.cs b/MHFZ_Overlay/Services/DiscordService.cs index 39607a17..d0f6c145 100644 --- a/MHFZ_Overlay/Services/DiscordService.cs +++ b/MHFZ_Overlay/Services/DiscordService.cs @@ -392,7 +392,7 @@ public void UpdateDiscordRPC(DataLoader dataLoader) stateString = string.Format(CultureInfo.InvariantCulture, "GR: {0} | GCP: {1} | Guild Food: {2} | Poogie Item: {3}", dataLoader.Model.GRankNumber(), dataLoader.Model.GCP(), ViewModels.Windows.AddressModel.GetArmorSkill(dataLoader.Model.GuildFoodSkill()), ViewModels.Windows.AddressModel.GetItemName(dataLoader.Model.PoogieItemUseID())); PresenceTemplate.State = stateString.Length <= MaxDiscordRPCStringLength ? stateString : string.Concat(stateString.AsSpan(0, MaxDiscordRPCStringLength - 3), "..."); break; - case 205: // Pugi Farm + case 205: // Poogie Farm stateString = string.Format(CultureInfo.InvariantCulture, "GR: {0} | Poogie Points: {1} | Poogie Clothes: {2} | Poogie Item: {3}", dataLoader.Model.GRankNumber(), dataLoader.Model.PoogiePoints(), ViewModels.Windows.AddressModel.GetPoogieClothes(dataLoader.Model.PoogieCostume()), ViewModels.Windows.AddressModel.GetItemName(dataLoader.Model.PoogieItemUseID())); PresenceTemplate.State = stateString.Length <= MaxDiscordRPCStringLength ? stateString : string.Concat(stateString.AsSpan(0, MaxDiscordRPCStringLength - 3), "..."); break; diff --git a/MHFZ_Overlay/ViewModels/Windows/AddressModel.cs b/MHFZ_Overlay/ViewModels/Windows/AddressModel.cs index c18e737e..8cce32bc 100644 --- a/MHFZ_Overlay/ViewModels/Windows/AddressModel.cs +++ b/MHFZ_Overlay/ViewModels/Windows/AddressModel.cs @@ -332,6 +332,42 @@ 21747 or public abstract int HalkFullness(); + public abstract int HalkLevel(); + + public abstract int HalkIntimacy(); + + public abstract int HalkHealth(); + + public abstract int HalkAttack(); + + public abstract int HalkDefense(); + + public abstract int HalkIntelligence(); + + public abstract int HalkSkill1(); + + public abstract int HalkSkill2(); + + public abstract int HalkSkill3(); + + public abstract int HalkElementNone(); + + public abstract int HalkFire(); + + public abstract int HalkThunder(); + + public abstract int HalkWater(); + + public abstract int HalkIce(); + + public abstract int HalkDragon(); + + public abstract int HalkSleep(); + + public abstract int HalkParalysis(); + + public abstract int HalkPoison(); + public abstract int RankBand(); public abstract int PartnyaRankPoints(); @@ -1290,8 +1326,16 @@ 21747 or public abstract int ActiveFeature1(); + /// + /// Alternative. + /// + /// public abstract int ActiveFeature2(); + /// + /// Alternative. + /// + /// public abstract int ActiveFeature3(); /// @@ -1303,19 +1347,43 @@ 21747 or public abstract int GuildFoodStart(); public abstract int DivaSongStart(); - + + public abstract int GuildPoogie1Skill(); + + public abstract int GuildPoogie2Skill(); + + public abstract int GuildPoogie3Skill(); + + public abstract int DivaPrayerGemRedSkill(); + + public abstract int DivaPrayerGemRedLevel(); + + public abstract int DivaPrayerGemYellowSkill(); + + public abstract int DivaPrayerGemYellowLevel(); + + public abstract int DivaPrayerGemGreenSkill(); + + public abstract int DivaPrayerGemGreenLevel(); + + public abstract int DivaPrayerGemBlueSkill(); + + public abstract int DivaPrayerGemBlueLevel(); + + public abstract bool HalkOn(); + + public abstract bool HalkPotEffectOn(); /// /// [] Not Done /// [X] Done /// [O] WIP - /// [] Prayer gems, /// [] bento, /// [] sharpness table, /// [] pvp, - /// [] zenith in road, guild pugi, gear rarity colors. - /// [] Database would store prayer gems, bento, sharpness table, pvp, guild pugi. Should i use separate table? + /// [] zenith in road, gear rarity colors. + /// [] Database would store bento, sharpness table, pvp. Should i use separate table? /// public bool HasMonster2 @@ -2542,7 +2610,7 @@ public bool DivaSongEnded var expiry = DivaSongStart() + (60 * 90); double secondsLeft = expiry - ServerHeartbeat(); - return secondsLeft <= 0; + return (QuestID() <= 0 && secondsLeft <= 0); } } @@ -2574,7 +2642,7 @@ public bool GuildFoodEnded var expiry = GuildFoodStart() + (60 * 90); double secondsLeft = expiry - ServerHeartbeat(); - return secondsLeft <= 0; + return (QuestID() <= 0 && secondsLeft <= 0); } } diff --git a/MHFZ_Overlay/Views/Windows/ConfigWindow.xaml.cs b/MHFZ_Overlay/Views/Windows/ConfigWindow.xaml.cs index 8c244435..2e29717b 100644 --- a/MHFZ_Overlay/Views/Windows/ConfigWindow.xaml.cs +++ b/MHFZ_Overlay/Views/Windows/ConfigWindow.xaml.cs @@ -126,7 +126,7 @@ public partial class ConfigWindow : FluentWindow new MonsterLog(29, "Rocks", @"pack://application:,,,/MHFZ_Overlay;component/Assets/Icons/png/monster/random.png", 0), new MonsterLog(30, "Ioprey", @"pack://application:,,,/MHFZ_Overlay;component/Assets/Icons/png/monster/ioprey.png", 0), new MonsterLog(31, "Iodrome", @"pack://application:,,,/MHFZ_Overlay;component/Assets/Icons/png/monster/iodrome.png", 0, true), - new MonsterLog(32, "Pugis", @"pack://application:,,,/MHFZ_Overlay;component/Assets/Icons/png/monster/random.png", 0), + new MonsterLog(32, "Poogies", @"pack://application:,,,/MHFZ_Overlay;component/Assets/Icons/png/monster/random.png", 0), new MonsterLog(33, "Kirin", @"pack://application:,,,/MHFZ_Overlay;component/Assets/Icons/png/monster/kirin.png", 0, true), new MonsterLog(34, "Cephalos", @"pack://application:,,,/MHFZ_Overlay;component/Assets/Icons/png/monster/cephalos.png", 0), new MonsterLog(35, "Giaprey / Giadrome", @"pack://application:,,,/MHFZ_Overlay;component/Assets/Icons/png/monster/giaprey.png", 0),