mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/GameObjects: Fixed the behavior for GAMEOBJECT_TYPE_FISHINGNODE (#28781)
This commit is contained in:
@@ -770,7 +770,7 @@ bool GameObject::Create(uint32 entry, Map* map, Position const& pos, QuaternionD
|
||||
break;
|
||||
}
|
||||
case GAMEOBJECT_TYPE_FISHINGNODE:
|
||||
SetLevel(1);
|
||||
SetLevel(0);
|
||||
SetGoAnimProgress(255);
|
||||
break;
|
||||
case GAMEOBJECT_TYPE_TRAP:
|
||||
@@ -971,18 +971,7 @@ void GameObject::Update(uint32 diff)
|
||||
// splash bobber (bobber ready now)
|
||||
Unit* caster = GetOwner();
|
||||
if (caster && caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
SetGoState(GO_STATE_ACTIVE);
|
||||
ReplaceAllFlags(GO_FLAG_NODESPAWN);
|
||||
|
||||
UpdateData udata(caster->GetMapId());
|
||||
WorldPacket packet;
|
||||
BuildValuesUpdateBlockForPlayer(&udata, caster->ToPlayer());
|
||||
udata.BuildPacket(&packet);
|
||||
caster->ToPlayer()->SendDirectMessage(&packet);
|
||||
|
||||
SendCustomAnim(GetGoAnimProgress());
|
||||
}
|
||||
SendCustomAnim(0);
|
||||
|
||||
m_lootState = GO_READY; // can be successfully open with some chance
|
||||
}
|
||||
@@ -2521,6 +2510,13 @@ void GameObject::Use(Unit* user)
|
||||
{
|
||||
case GO_READY: // ready for loot
|
||||
{
|
||||
SetLootState(GO_ACTIVATED, player);
|
||||
|
||||
SetGoState(GO_STATE_ACTIVE);
|
||||
ReplaceAllFlags(GO_FLAG_IN_MULTI_USE);
|
||||
|
||||
SendUpdateToPlayer(player);
|
||||
|
||||
uint32 zone, subzone;
|
||||
GetZoneAndAreaId(zone, subzone);
|
||||
|
||||
|
||||
@@ -288,7 +288,11 @@ void WorldSession::DoLootRelease(Loot* loot)
|
||||
|
||||
if (loot->isLooted() || go->GetGoType() == GAMEOBJECT_TYPE_FISHINGNODE || go->GetGoType() == GAMEOBJECT_TYPE_FISHINGHOLE)
|
||||
{
|
||||
if (go->GetGoType() == GAMEOBJECT_TYPE_FISHINGHOLE)
|
||||
if (go->GetGoType() == GAMEOBJECT_TYPE_FISHINGNODE)
|
||||
{
|
||||
go->SetLootState(GO_JUST_DEACTIVATED);
|
||||
}
|
||||
else if (go->GetGoType() == GAMEOBJECT_TYPE_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)
|
||||
|
||||
Reference in New Issue
Block a user