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/Dust765/External/OnCastingGump.cs b/src/ClassicUO.Client/Dust765/External/OnCastingGump.cs index 99def138c..182780eae 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 { @@ -60,10 +61,15 @@ 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 = protection_delay + 4; + } + _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..36022c05b 100644 --- a/src/ClassicUO.Client/Dust765/Shared/SpellManager.cs +++ b/src/ClassicUO.Client/Dust765/Shared/SpellManager.cs @@ -36,7 +36,10 @@ public enum SpellCircle Fifth, Sixth, Seventh, - Eighth + Eighth, + Ninth, + Eleventh, + Twelfth } public enum SpellAction : ushort @@ -247,7 +250,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,11 +267,12 @@ 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: + case SpellAction.Wildfire: + case SpellAction.EssenceofWind: + return SpellCircle.Third; case SpellAction.ArchCure: @@ -281,7 +284,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: @@ -291,6 +293,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: @@ -337,8 +341,9 @@ public static SpellCircle GetCircle(SpellAction spell) case SpellAction.EarthElemental: case SpellAction.FireElemental: case SpellAction.WaterElemental: - case SpellAction.GiftofRenewal: return SpellCircle.Eighth; + case SpellAction.GiftofRenewal: + return SpellCircle.Twelfth; } throw new InvalidOperationException(); } 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 (