From 33d1affcfbaf1d507048556362a8d7d35ca48f7e Mon Sep 17 00:00:00 2001 From: Jeann Sebold Date: Fri, 23 Feb 2024 19:00:07 -0300 Subject: [PATCH 1/4] hot fix for healthbar and maps tracking guild menbers --- src/ClassicUO.Client/Configuration/Profile.cs | 2 ++ src/ClassicUO.Client/Game/UI/Gumps/HealthBarGump.cs | 8 ++++++-- src/ClassicUO.Client/Game/UI/Gumps/OptionsGump.cs | 7 ++++++- src/ClassicUO.Client/Game/UI/Gumps/WorldMapGump.cs | 2 +- src/ClassicUO.Client/Game/World.cs | 3 ++- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/ClassicUO.Client/Configuration/Profile.cs b/src/ClassicUO.Client/Configuration/Profile.cs index efe367a67..d73977a67 100644 --- a/src/ClassicUO.Client/Configuration/Profile.cs +++ b/src/ClassicUO.Client/Configuration/Profile.cs @@ -415,6 +415,8 @@ internal sealed class Profile public bool DrawMobilesWithSurfaceOverhead { get; set; } = false; public bool IgnoreCoTEnabled { get; set; } = false; public bool ShowDeathOnWorldmap { get; set; } = false; + + public bool ShowMapCloseFriend { get; set; } // ## BEGIN - END ## // MISC2 // ## BEGIN - END ## // MACROS public int LastTargetRange { get; set; } diff --git a/src/ClassicUO.Client/Game/UI/Gumps/HealthBarGump.cs b/src/ClassicUO.Client/Game/UI/Gumps/HealthBarGump.cs index 97416f3d8..1fcfbdf2c 100644 --- a/src/ClassicUO.Client/Game/UI/Gumps/HealthBarGump.cs +++ b/src/ClassicUO.Client/Game/UI/Gumps/HealthBarGump.cs @@ -273,11 +273,15 @@ protected override void OnMouseDown(int x, int y, MouseButtonType button) // ## BEGIN - END ## // MISC Entity ent = World.Get(LocalSerial); if (ent == null) + { + TargetManager.LastTargetInfo.Serial = LocalSerial; + TargetManager.CancelTarget(); + } + + else { TargetManager.LastTargetInfo.Serial = LocalEntity.Serial; - GameActions.Print($"Changing last target to {LocalEntity.Name}"); GameActions.Print(World.Player, $"Target: {LocalEntity.Name}"); - TargetManager.CancelTarget(); } // ## BEGIN - END ## // MISC Mouse.LastLeftButtonClickTime = 0; diff --git a/src/ClassicUO.Client/Game/UI/Gumps/OptionsGump.cs b/src/ClassicUO.Client/Game/UI/Gumps/OptionsGump.cs index 8847e56fb..370b67ab7 100644 --- a/src/ClassicUO.Client/Game/UI/Gumps/OptionsGump.cs +++ b/src/ClassicUO.Client/Game/UI/Gumps/OptionsGump.cs @@ -232,7 +232,7 @@ internal class OptionsGump : Gump private InputField _SpecialSetLastTargetClilocText, _blockWoSArt, _blockEnergyFArt; // ## BEGIN - END ## // MISC // ## BEGIN - END ## // MISC2 - private Checkbox _wireframeView, _hueImpassableView, _transparentHouses, _invisibleHouses, _ignoreCoT, _showDeathOnWorldmap, _drawMobilesWithSurfaceOverhead; + private Checkbox _wireframeView, _hueImpassableView, _transparentHouses, _invisibleHouses, _ignoreCoT, _showDeathOnWorldmap, _showMapCloseFriend, _drawMobilesWithSurfaceOverhead; private HSliderBar _transparentHousesZ, _transparentHousesTransparency, _invisibleHousesZ, _dontRemoveHouseBelowZ; // ## BEGIN - END ## // MISC2 // ## BEGIN - END ## // MACROS @@ -4424,6 +4424,10 @@ private void BuildDust() section8.Add(_showDeathOnWorldmap = AddCheckBox(null, "Show death location on world map for 5min:", _currentProfile.ShowDeathOnWorldmap, startX, startY)); startY += _showDeathOnWorldmap.Height + 2; + + section8.Add(_showMapCloseFriend = AddCheckBox(null, "Show closed friend in World Map:", _currentProfile.ShowMapCloseFriend, startX, startY)); + startY += _showMapCloseFriend.Height + 2; + // ## BEGIN - END ## // MISC2 // ## BEGIN - END ## // NAMEOVERHEAD SettingsSection section9 = AddSettingsSection(box, "-----NAMEOVERHEAD-----"); @@ -7821,6 +7825,7 @@ private void Apply() // ## BEGIN - END ## // ONCASTINGGUMP _currentProfile.OnCastingGump = _onCastingGump.IsChecked; _currentProfile.OnCastingGump_hidden = _onCastingGump_hidden.IsChecked; + _currentProfile.ShowMapCloseFriend = _showMapCloseFriend.IsChecked; // ## BEGIN - END ## // ONCASTINGGUMP // ## BEGIN - END ## // MISC3 SHOWALLLAYERS _currentProfile.ShowAllLayers = _showAllLayers.IsChecked; diff --git a/src/ClassicUO.Client/Game/UI/Gumps/WorldMapGump.cs b/src/ClassicUO.Client/Game/UI/Gumps/WorldMapGump.cs index 3f0b663a3..1ef9b4b73 100644 --- a/src/ClassicUO.Client/Game/UI/Gumps/WorldMapGump.cs +++ b/src/ClassicUO.Client/Game/UI/Gumps/WorldMapGump.cs @@ -2448,7 +2448,7 @@ private void DrawAll(UltimaBatcher2D batcher, Rectangle srcRect, int gX, int gY, { if (string.IsNullOrEmpty(wme.Name) && !string.IsNullOrEmpty(partyMember.Name)) { - wme.Name = partyMember.Name; + wme.Name = wme.GetName(partyMember.Serial); } } diff --git a/src/ClassicUO.Client/Game/World.cs b/src/ClassicUO.Client/Game/World.cs index c0d88696d..ac27d75b2 100644 --- a/src/ClassicUO.Client/Game/World.cs +++ b/src/ClassicUO.Client/Game/World.cs @@ -305,7 +305,8 @@ public static void Update() } else { - if (mob.NotorietyFlag == NotorietyFlag.Ally) + WMapEntity wme = WMapManager.GetEntity(mob.Serial); + if (mob.NotorietyFlag == NotorietyFlag.Ally || wme != null && wme.IsGuild) { WMapManager.AddOrUpdate ( From a0ad0ebfd5c9e848bcb1a5c53af7a11c57860e02 Mon Sep 17 00:00:00 2001 From: Jeann Sebold Date: Mon, 26 Feb 2024 13:16:10 -0300 Subject: [PATCH 2/4] fix for proection is on casting --- .../Dust765/External/OnCastingGump.cs | 19 +++++++++++++++++-- .../Dust765/Shared/SpellManager.cs | 14 ++++++++------ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/ClassicUO.Client/Dust765/External/OnCastingGump.cs b/src/ClassicUO.Client/Dust765/External/OnCastingGump.cs index 99def138c..7dcf47415 100644 --- a/src/ClassicUO.Client/Dust765/External/OnCastingGump.cs +++ b/src/ClassicUO.Client/Dust765/External/OnCastingGump.cs @@ -7,6 +7,7 @@ using ClassicUO.Renderer; using ClassicUO.Dust765.Managers; using System; +using ClassicUO.Game.Data; namespace ClassicUO.Dust765.External { @@ -53,6 +54,7 @@ public void Start(uint _spell_id, uint _re = 0) { _startTime = Time.Ticks; uint circle; + System.TimeSpan spellTime; if (!ProfileManager.CurrentProfile.OnCastingGump_hidden) { @@ -60,10 +62,23 @@ public void Start(uint _spell_id, uint _re = 0) } try - { + { SpellAction spell = (SpellAction)_spell_id; circle = (uint)SpellManager.GetCircle(spell); - _endTime = _startTime + 400 + circle * 250 + _re; // (0.5+ 0.25 * circle) * 1000 + uint protection_delay = 0; + if (World.Player.IsBuffIconExists(BuffIconType.Protection)) + { + protection_delay = 1; + if (circle != 9) + { + protection_delay = protection_delay + 2; + } else + { + protection_delay = protection_delay + 5; + circle = circle + 2; + } + } + _endTime = _startTime + 400 + (circle + protection_delay) * 250 + _re; // (0.5+ 0.25 * circle) * 1000 GameActions.iscasting = true; } catch diff --git a/src/ClassicUO.Client/Dust765/Shared/SpellManager.cs b/src/ClassicUO.Client/Dust765/Shared/SpellManager.cs index 012403b4d..aa28cef66 100644 --- a/src/ClassicUO.Client/Dust765/Shared/SpellManager.cs +++ b/src/ClassicUO.Client/Dust765/Shared/SpellManager.cs @@ -36,7 +36,8 @@ public enum SpellCircle Fifth, Sixth, Seventh, - Eighth + Eighth, + Nine } public enum SpellAction : ushort @@ -247,7 +248,6 @@ public static SpellCircle GetCircle(SpellAction spell) case SpellAction.Strength: case SpellAction.CurseWeapon: case SpellAction.PainSpike: - case SpellAction.AttuneWeapon: case SpellAction.CleansebyFire: case SpellAction.Thunderstorm: return SpellCircle.Second; @@ -265,8 +265,6 @@ public static SpellCircle GetCircle(SpellAction spell) case SpellAction.SummonFey: case SpellAction.SummonFiend: case SpellAction.ReaperForm: - case SpellAction.Wildfire: - case SpellAction.EssenceofWind: case SpellAction.DryadAllure: case SpellAction.EtherealVoyage: case SpellAction.WordofDeath: @@ -281,7 +279,6 @@ public static SpellCircle GetCircle(SpellAction spell) case SpellAction.ManaDrain: case SpellAction.Recall: case SpellAction.RemoveCurse: - case SpellAction.GiftofLife: case SpellAction.ArcaneCircle: case SpellAction.HorrificBeast: case SpellAction.Exorcism: @@ -337,8 +334,13 @@ public static SpellCircle GetCircle(SpellAction spell) case SpellAction.EarthElemental: case SpellAction.FireElemental: case SpellAction.WaterElemental: - case SpellAction.GiftofRenewal: return SpellCircle.Eighth; + case SpellAction.GiftofRenewal: + case SpellAction.AttuneWeapon: + case SpellAction.GiftofLife: + case SpellAction.Wildfire: + case SpellAction.EssenceofWind: + return SpellCircle.Nine; } throw new InvalidOperationException(); } From 300b449687b5dcf249949b6c22e79ea049fd2c6a Mon Sep 17 00:00:00 2001 From: Jeann Sebold Date: Mon, 26 Feb 2024 15:47:52 -0300 Subject: [PATCH 3/4] revert spell spellweaving --- .../Dust765/External/OnCastingGump.cs | 10 ++++------ src/ClassicUO.Client/Dust765/Shared/SpellManager.cs | 13 +++++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/ClassicUO.Client/Dust765/External/OnCastingGump.cs b/src/ClassicUO.Client/Dust765/External/OnCastingGump.cs index 7dcf47415..c245f576a 100644 --- a/src/ClassicUO.Client/Dust765/External/OnCastingGump.cs +++ b/src/ClassicUO.Client/Dust765/External/OnCastingGump.cs @@ -54,10 +54,9 @@ public void Start(uint _spell_id, uint _re = 0) { _startTime = Time.Ticks; uint circle; - System.TimeSpan spellTime; if (!ProfileManager.CurrentProfile.OnCastingGump_hidden) - { + {s IsVisible = true; } @@ -69,13 +68,12 @@ public void Start(uint _spell_id, uint _re = 0) if (World.Player.IsBuffIconExists(BuffIconType.Protection)) { protection_delay = 1; - if (circle != 9) + if (circle < 9) { - protection_delay = protection_delay + 2; + protection_delay = protection_delay ; } else { - protection_delay = protection_delay + 5; - circle = circle + 2; + protection_delay = protection_delay + 4; } } _endTime = _startTime + 400 + (circle + protection_delay) * 250 + _re; // (0.5+ 0.25 * circle) * 1000 diff --git a/src/ClassicUO.Client/Dust765/Shared/SpellManager.cs b/src/ClassicUO.Client/Dust765/Shared/SpellManager.cs index aa28cef66..26c930cc8 100644 --- a/src/ClassicUO.Client/Dust765/Shared/SpellManager.cs +++ b/src/ClassicUO.Client/Dust765/Shared/SpellManager.cs @@ -37,7 +37,7 @@ public enum SpellCircle Sixth, Seventh, Eighth, - Nine + Ninth } public enum SpellAction : ushort @@ -268,6 +268,9 @@ public static SpellCircle GetCircle(SpellAction spell) case SpellAction.DryadAllure: case SpellAction.EtherealVoyage: case SpellAction.WordofDeath: + case SpellAction.Wildfire: + case SpellAction.EssenceofWind: + return SpellCircle.Third; case SpellAction.ArchCure: @@ -288,6 +291,8 @@ public static SpellCircle GetCircle(SpellAction spell) case SpellAction.PoisonStrike: case SpellAction.Wither: case SpellAction.MindRot: + case SpellAction.GiftofLife: + case SpellAction.AttuneWeapon: return SpellCircle.Fourth; case SpellAction.BladeSpirits: @@ -336,11 +341,7 @@ public static SpellCircle GetCircle(SpellAction spell) case SpellAction.WaterElemental: return SpellCircle.Eighth; case SpellAction.GiftofRenewal: - case SpellAction.AttuneWeapon: - case SpellAction.GiftofLife: - case SpellAction.Wildfire: - case SpellAction.EssenceofWind: - return SpellCircle.Nine; + return SpellCircle.Ninth; } throw new InvalidOperationException(); } From 6fc127fdf5ac7a98180bfdc998a353cad323d55e Mon Sep 17 00:00:00 2001 From: Jeann Sebold Date: Tue, 27 Feb 2024 07:27:56 -0300 Subject: [PATCH 4/4] fix oncasting --- .../Dust765/External/OnCastingGump.cs | 11 ++--------- src/ClassicUO.Client/Dust765/Shared/SpellManager.cs | 6 ++++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/ClassicUO.Client/Dust765/External/OnCastingGump.cs b/src/ClassicUO.Client/Dust765/External/OnCastingGump.cs index c245f576a..182780eae 100644 --- a/src/ClassicUO.Client/Dust765/External/OnCastingGump.cs +++ b/src/ClassicUO.Client/Dust765/External/OnCastingGump.cs @@ -56,7 +56,7 @@ public void Start(uint _spell_id, uint _re = 0) uint circle; if (!ProfileManager.CurrentProfile.OnCastingGump_hidden) - {s + { IsVisible = true; } @@ -67,14 +67,7 @@ public void Start(uint _spell_id, uint _re = 0) uint protection_delay = 0; if (World.Player.IsBuffIconExists(BuffIconType.Protection)) { - protection_delay = 1; - if (circle < 9) - { - protection_delay = protection_delay ; - } else - { - protection_delay = protection_delay + 4; - } + protection_delay = protection_delay + 4; } _endTime = _startTime + 400 + (circle + protection_delay) * 250 + _re; // (0.5+ 0.25 * circle) * 1000 GameActions.iscasting = true; diff --git a/src/ClassicUO.Client/Dust765/Shared/SpellManager.cs b/src/ClassicUO.Client/Dust765/Shared/SpellManager.cs index 26c930cc8..36022c05b 100644 --- a/src/ClassicUO.Client/Dust765/Shared/SpellManager.cs +++ b/src/ClassicUO.Client/Dust765/Shared/SpellManager.cs @@ -37,7 +37,9 @@ public enum SpellCircle Sixth, Seventh, Eighth, - Ninth + Ninth, + Eleventh, + Twelfth } public enum SpellAction : ushort @@ -341,7 +343,7 @@ public static SpellCircle GetCircle(SpellAction spell) case SpellAction.WaterElemental: return SpellCircle.Eighth; case SpellAction.GiftofRenewal: - return SpellCircle.Ninth; + return SpellCircle.Twelfth; } throw new InvalidOperationException(); }