Skip to content

hotfix for healthbar and maps tracking guild members #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/ClassicUO.Client/Configuration/Profile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
19 changes: 17 additions & 2 deletions src/ClassicUO.Client/Dust765/External/OnCastingGump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using ClassicUO.Renderer;
using ClassicUO.Dust765.Managers;
using System;
using ClassicUO.Game.Data;

namespace ClassicUO.Dust765.External
{
Expand Down Expand Up @@ -53,17 +54,31 @@ public void Start(uint _spell_id, uint _re = 0)
{
_startTime = Time.Ticks;
uint circle;
System.TimeSpan spellTime;

if (!ProfileManager.CurrentProfile.OnCastingGump_hidden)
{
IsVisible = true;
}

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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aqui em tese era pra mexer só no protection_delay..

circle = circle + 2;
}
}
_endTime = _startTime + 400 + (circle + protection_delay) * 250 + _re; // (0.5+ 0.25 * circle) * 1000
GameActions.iscasting = true;
}
catch
Expand Down
14 changes: 8 additions & 6 deletions src/ClassicUO.Client/Dust765/Shared/SpellManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public enum SpellCircle
Fifth,
Sixth,
Seventh,
Eighth
Eighth,
Nine
}

public enum SpellAction : ushort
Expand Down Expand Up @@ -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;
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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();
}
Expand Down
8 changes: 6 additions & 2 deletions src/ClassicUO.Client/Game/UI/Gumps/HealthBarGump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion src/ClassicUO.Client/Game/UI/Gumps/OptionsGump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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-----");
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/ClassicUO.Client/Game/UI/Gumps/WorldMapGump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/ClassicUO.Client/Game/World.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
(
Expand Down