From 42f94c354f3a47a36bf5674eeb17917e04846d4c Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 12 Feb 2023 01:19:58 -0500 Subject: [PATCH] Core/GameObjects: Fixed the behavior for GAMEOBJECT_TYPE_FISHINGNODE Port From (https://github.com/TrinityCore/TrinityCore/commit/56d0f7a970d24bb71a3e6a27e72fe9bc41eb8246) --- Source/Game/Entities/GameObject/GameObject.cs | 22 ++++++++----------- Source/Game/Handlers/LootHandler.cs | 6 ++++- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Source/Game/Entities/GameObject/GameObject.cs b/Source/Game/Entities/GameObject/GameObject.cs index 54e6c1965..7ea7def8d 100644 --- a/Source/Game/Entities/GameObject/GameObject.cs +++ b/Source/Game/Entities/GameObject/GameObject.cs @@ -306,7 +306,7 @@ namespace Game.Entities SetActive(true); break; case GameObjectTypes.FishingNode: - SetLevel(1); + SetLevel(0); SetGoAnimProgress(255); break; case GameObjectTypes.Trap: @@ -479,18 +479,7 @@ namespace Game.Entities // splash bobber (bobber ready now) Unit caster = GetOwner(); if (caster != null && caster.IsTypeId(TypeId.Player)) - { - SetGoState(GameObjectState.Active); - ReplaceAllFlags(GameObjectFlags.NoDespawn); - - UpdateData udata = new(caster.GetMapId()); - UpdateObject packet; - BuildValuesUpdateBlockForPlayer(udata, caster.ToPlayer()); - udata.BuildPacket(out packet); - caster.ToPlayer().SendPacket(packet); - - SendCustomAnim(GetGoAnimProgress()); - } + SendCustomAnim(0); m_lootState = LootState.Ready; // can be successfully open with some chance } @@ -2005,6 +1994,13 @@ namespace Game.Entities { case LootState.Ready: // ready for loot { + SetLootState(LootState.Activated, player); + + SetGoState(GameObjectState.Active); + ReplaceAllFlags(GameObjectFlags.InMultiUse); + + SendUpdateToPlayer(player); + uint zone, subzone; GetZoneAndAreaId(out zone, out subzone); diff --git a/Source/Game/Handlers/LootHandler.cs b/Source/Game/Handlers/LootHandler.cs index 905aa2d9a..876016522 100644 --- a/Source/Game/Handlers/LootHandler.cs +++ b/Source/Game/Handlers/LootHandler.cs @@ -274,7 +274,11 @@ namespace Game if (loot.IsLooted() || go.GetGoType() == GameObjectTypes.FishingNode || go.GetGoType() == GameObjectTypes.FishingHole) { - if (go.GetGoType() == GameObjectTypes.FishingHole) + if (go.GetGoType() == GameObjectTypes.FishingNode) + { + go.SetLootState(LootState.JustDeactivated); + } + else if (go.GetGoType() == GameObjectTypes.FishingHole) { // The fishing hole used once more go.AddUse(); // if the max usage is reached, will be despawned in next tick if (go.GetUseCount() >= go.GetGoValue().FishingHole.MaxOpens)