Skip to content

Commit

Permalink
fix map, showhightlight with you use all spells
Browse files Browse the repository at this point in the history
  • Loading branch information
jeannsebold6666 committed Jan 26, 2024
1 parent bd55606 commit 276d390
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 18 deletions.
1 change: 0 additions & 1 deletion src/ClassicUO.Client/Dust765/Dust765/CombatCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,6 @@ public static void SpellCastFromCliloc(string text)
{
if (!GameActions.iscasting)
World.Player.OnCasting.Start((uint)GameActions.LastSpellIndexCursor);
World.Player.Hue = 0x0023;
}
// ## BEGIN - END ## // ONCASTINGGUMP
}
Expand Down
5 changes: 5 additions & 0 deletions src/ClassicUO.Client/Game/GameActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

using System;
using ClassicUO.Configuration;
using ClassicUO.Dust765.Dust765;
using ClassicUO.Game.Data;
using ClassicUO.Game.GameObjects;
using ClassicUO.Game.Managers;
Expand Down Expand Up @@ -720,6 +721,7 @@ public static void CastSpellFromBook(int index, uint bookSerial)
// ## BEGIN - END ## // VISUAL HELPERS
LastSpellIndexCursor = index;
GameCursor._spellTime = 0;

// ## BEGIN - END ## // VISUAL HELPERS
// ## BEGIN - END ## // ONCASTINGGUMP
if (ProfileManager.CurrentProfile.OnCastingGump)
Expand All @@ -741,6 +743,8 @@ public static void CastSpell(int index)
// ## BEGIN - END ## // VISUAL HELPERS
LastSpellIndexCursor = index;
GameCursor._spellTime = 0;
CombatCollection.StartSpelltime();

// ## BEGIN - END ## // VISUAL HELPERS
// ## BEGIN - END ## // ONCASTINGGUMP
if (ProfileManager.CurrentProfile.OnCastingGump)
Expand All @@ -751,6 +755,7 @@ public static void CastSpell(int index)
// ## BEGIN - END ## // ONCASTINGGUMP

LastSpellIndex = index;

Socket.Send_CastSpell(index);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ClassicUO.Client/Game/GameObjects/Views/LandView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public override bool Draw(UltimaBatcher2D batcher, int posX, int posY, float dep
}
if (ProfileManager.CurrentProfile.HighlightTileAtRangeSpell)
{
if (GameCursor._spellTime >= 1 && Distance == ProfileManager.CurrentProfile.HighlightTileAtRangeRangeSpell)
if (GameActions.LastSpellIndexCursor > 0 && Distance == ProfileManager.CurrentProfile.HighlightTileAtRangeRangeSpell)
{
hueVec.X = ProfileManager.CurrentProfile.HighlightTileRangeHueSpell;
hueVec.Y = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/ClassicUO.Client/Game/GameObjects/Views/MultiView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public override bool Draw(UltimaBatcher2D batcher, int posX, int posY, float dep
}
if (ProfileManager.CurrentProfile.HighlightTileAtRangeSpell)
{
if (GameCursor._spellTime >= 1 && Distance == ProfileManager.CurrentProfile.HighlightTileAtRangeRangeSpell)
if (GameActions.LastSpellIndexCursor > 0 && Distance == ProfileManager.CurrentProfile.HighlightTileAtRangeRangeSpell)
{
hueVec.X = ProfileManager.CurrentProfile.HighlightTileRangeHueSpell;
hueVec.Y = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/ClassicUO.Client/Game/GameObjects/Views/StaticView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public override bool Draw(UltimaBatcher2D batcher, int posX, int posY, float dep
}
if (ProfileManager.CurrentProfile.HighlightTileAtRangeSpell)
{
if (GameCursor._spellTime >= 1 && Distance == ProfileManager.CurrentProfile.HighlightTileAtRangeRangeSpell)
if (GameActions.LastSpellIndexCursor > 0 && Distance == ProfileManager.CurrentProfile.HighlightTileAtRangeRangeSpell)
{
hueVec.X = ProfileManager.CurrentProfile.HighlightTileRangeHueSpell;
hueVec.Y = 1;
Expand Down
27 changes: 14 additions & 13 deletions src/ClassicUO.Client/Game/Managers/WorldMapEntityManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
using ClassicUO.Network;
using ClassicUO.Network.Encryption;
using ClassicUO.Utility.Logging;
using static System.Net.Mime.MediaTypeNames;

namespace ClassicUO.Game.Managers
{
Expand All @@ -65,44 +66,44 @@ public string GetName(uint serial)
Entity e = World.Get(serial);


if (mob != null)
if (mob != null && !mob.IsDestroyed)
{
WMapEntity wme = World.WMapManager.GetEntity(mob);

if (wme != null)
{
if (string.IsNullOrEmpty(wme.Name))
{

wme.Name = mob.Name;
Name = wme.Name;
nameCache[serial] = Name;
GameActions.Print("Mob is not null Is wme != null " + wme.Serial + " Name: " + mob.Name + " nameCache: " + nameCache[serial]);
}
}
}
if (e != null && !e.IsDestroyed)
if (e != null)
{
Name = e.Name;
serial = e.Serial;
nameCache[serial] = Name;
GameActions.Print("Entity is not null Is wme != null " + e.Name + " Name: " + mob.Name + " nameCache: " + nameCache[serial]);
}

// Entity e = World.Get(Serial);
// Mobile mob = World.Mobiles.Get(Serial);

// if (e != null && !e.IsDestroyed && !string.IsNullOrEmpty(e.Name) && Name != e.Name)
//{
// Name = e.Name;
//}



if (nameCache.TryGetValue(serial, out string cachedName))
{

var teste = string.IsNullOrEmpty(Name) ? cachedName : Name;
GameActions.Print("Entity is not null Is wme != null " + teste);
return string.IsNullOrEmpty(Name) ? cachedName : Name;
}
else
{
return string.IsNullOrEmpty(Name) ? "Out of range" : Name;
return string.IsNullOrEmpty(Name) ? "<out of range>" : Name;
}




// ## BEGIN - END ## // DUST765 - Fix to use cache for name in Map Gump
}
Expand Down
2 changes: 1 addition & 1 deletion src/ClassicUO.Client/Network/PacketHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1798,7 +1798,7 @@ private static void DeathScreen(ref StackDataReader p)
Map = World.Map.Index,
LastUpdate = Time.Ticks + (1000 * 60 * 5),
IsGuild = false,
Name = $"Your Corpse"
Name = $"YOUR CORPOSE"
};
// ## BEGIN - END ## // TAZUO
}
Expand Down

0 comments on commit 276d390

Please sign in to comment.