Core/GameObjects: Fixed the behavior for GAMEOBJECT_TYPE_FISHINGNODE

Port From (https://github.com/TrinityCore/TrinityCore/commit/56d0f7a970d24bb71a3e6a27e72fe9bc41eb8246)
This commit is contained in:
hondacrx
2023-02-12 01:19:58 -05:00
parent 8d553168e5
commit 42f94c354f
2 changed files with 14 additions and 14 deletions
+9 -13
View File
@@ -306,7 +306,7 @@ namespace Game.Entities
SetActive(true); SetActive(true);
break; break;
case GameObjectTypes.FishingNode: case GameObjectTypes.FishingNode:
SetLevel(1); SetLevel(0);
SetGoAnimProgress(255); SetGoAnimProgress(255);
break; break;
case GameObjectTypes.Trap: case GameObjectTypes.Trap:
@@ -479,18 +479,7 @@ namespace Game.Entities
// splash bobber (bobber ready now) // splash bobber (bobber ready now)
Unit caster = GetOwner(); Unit caster = GetOwner();
if (caster != null && caster.IsTypeId(TypeId.Player)) if (caster != null && caster.IsTypeId(TypeId.Player))
{ SendCustomAnim(0);
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());
}
m_lootState = LootState.Ready; // can be successfully open with some chance m_lootState = LootState.Ready; // can be successfully open with some chance
} }
@@ -2005,6 +1994,13 @@ namespace Game.Entities
{ {
case LootState.Ready: // ready for loot case LootState.Ready: // ready for loot
{ {
SetLootState(LootState.Activated, player);
SetGoState(GameObjectState.Active);
ReplaceAllFlags(GameObjectFlags.InMultiUse);
SendUpdateToPlayer(player);
uint zone, subzone; uint zone, subzone;
GetZoneAndAreaId(out zone, out subzone); GetZoneAndAreaId(out zone, out subzone);
+5 -1
View File
@@ -274,7 +274,11 @@ namespace Game
if (loot.IsLooted() || go.GetGoType() == GameObjectTypes.FishingNode || go.GetGoType() == GameObjectTypes.FishingHole) 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 { // The fishing hole used once more
go.AddUse(); // if the max usage is reached, will be despawned in next tick go.AddUse(); // if the max usage is reached, will be despawned in next tick
if (go.GetUseCount() >= go.GetGoValue().FishingHole.MaxOpens) if (go.GetUseCount() >= go.GetGoValue().FishingHole.MaxOpens)