TrinityCore icon indicating copy to clipboard operation
TrinityCore copied to clipboard

[3.3.5] Death Knight - Raise Dead (Ghoul) - Eternal CD

Open Demonid opened this issue 12 years ago • 35 comments

1- Use [Raise Dead] 2- Kill or Sacrifice the Ghoul 3- Wait for your cooldown to reset... wait a little more, maybe some more time... noup, it doesn't reset.

Proof: http://www.youtube.com/watch?v=jR5WGpi8GdI

[Raise Dead] was "Working" decently before acd46085d1f496657e27e0d5f823f53d466702dc, now it gets bugged every time the Ghoul it's killed.

Rev: a242662ae6fd424928c3972de1232b43e7164457 DB: Fresh TDB 52 with all updates

Demonid avatar Jan 31 '14 12:01 Demonid

the problem is the cooldownevent, on tc there is only send 1, but on retail there are 2

hackfix: add this line in spell_dk_raise_dead_SpellScript::HandleRaiseDead before casting the summon spell GetCaster()->ToPlayer()->RemoveSpellCooldown(GetSpellInfo()->Id, true);

joschiwald avatar Jan 31 '14 15:01 joschiwald

can anyone test this code?

diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -21850,6 +21863,35 @@ void Player::SendCooldownEvent(SpellInfo const* spellInfo, uint32 itemId /*= 0*/
     data << uint32(spellInfo->Id);
     data << uint64(GetGUID());
     SendDirectMessage(&data);
+
+    uint32 cat = spellInfo->GetCategory();
+    uint32 catRec = spellInfo->CategoryRecoveryTime;
+    if (cat && catRec)
+    {
+        SpellCategoryStore::const_iterator ct = sSpellsByCategoryStore.find(cat);
+        if (ct != sSpellsByCategoryStore.end())
+        {
+            SpellCategorySet const& catSet = ct->second;
+            for (SpellCooldowns::const_iterator i = m_spellCooldowns.begin(); i != m_spellCooldowns.end(); ++i)
+            {
+                if (i->first == spellInfo->Id) // skip main spell, already handled above
+                    continue;
+
+                SpellInfo const* spellInfo2 = sSpellMgr->GetSpellInfo(i->first);
+                if (!spellInfo2->IsCooldownStartedOnEvent())
+                    continue;
+
+                if (catSet.find(i->first) != catSet.end())
+                {
+                    // Send activate cooldown timer (possible 0) at client side
+                    WorldPacket data(SMSG_COOLDOWN_EVENT, 4 + 8);
+                    data << uint32(i->first);
+                    data << uint64(GetGUID());
+                    SendDirectMessage(&data);
+                }
+            }
+        }
+    }
 }

 void Player::UpdatePotionCooldown(Spell* spell)

joschiwald avatar Jan 31 '14 15:01 joschiwald

@joschiwald Seems to work good ^^

Demonid avatar Jan 31 '14 19:01 Demonid

my patch is incorrect or incomplete, it's the only one spell that sends 2 cooldown events at same time, base spell and triggered summon spell

joschiwald avatar Feb 03 '14 21:02 joschiwald

@joschiwald it crashes the server: GetCaster()->ToPlayer()->RemoveSpellCooldown(GetSpellInfo()->Id, true);

digz6666 avatar Feb 09 '14 05:02 digz6666

@joschiwald Your 2nd patch is working good.

digz6666 avatar Feb 09 '14 06:02 digz6666

Confirmed, But the patch not working for me :C Anyone else test it?

xlain avatar Feb 13 '14 04:02 xlain

@xlain It worked for me.

digz6666 avatar Feb 13 '14 04:02 digz6666

seems to be working ok for me

w1sht0l1v3 avatar Feb 13 '14 17:02 w1sht0l1v3

TrinityCore rev. 87b973c2806f same problem by killed ghoul or clicked to let go

XJIOP avatar Aug 20 '14 12:08 XJIOP

anyone any idea on fixing this properly?

w1sht0l1v3 avatar Aug 26 '14 20:08 w1sht0l1v3

@joschiwald second code works perfectly :+1:

ccrs avatar Aug 27 '14 10:08 ccrs

@ those of you above who posted "worked for me": is your OS Windows or Linux? (I can only remember @digz6666 using Windows 2012 Server x64). Just so we can compare your test result replies.

ghost avatar Aug 27 '14 10:08 ghost

@tkrokli Yes I use Windows Server 2012 x64 and 64bit compiler.

digz6666 avatar Aug 27 '14 10:08 digz6666

@tkrokli this issue and patch dont depend on which os we use ;)

ccrs avatar Aug 27 '14 11:08 ccrs

OK, I just thought maybe it could be related to the crash logs issue that seem to afflict Linux most. Edit: (seeing that the suggested patch works for some people and not work for others).

ghost avatar Aug 27 '14 11:08 ghost

after some digging around it seems it crashes on linux on some occasions...least for me...somethign about IsCooldownStartedOnEvent

w1sht0l1v3 avatar Aug 27 '14 15:08 w1sht0l1v3

Why its closed?

digz6666 avatar Jan 01 '15 03:01 digz6666

Yeah still bugged https://github.com/TrinityCore/TrinityCore/commit/8197da743cd5a9a2c4df73e53b9f9dc44cbec1d5

Raydor avatar Jan 16 '15 18:01 Raydor

I will test the suggested second patch by @joschiwald , adding it to the current 3.3.5 branch of today (8197da743cd5a9a2c4df73e53b9f9dc44cbec1d5). In the whole year that has passed, the line numbers in Player.cpp has increased quite a bit. Don't use diff, it could very well misplace the inserted code. If you add it manually, the original lines

     void Player::SendCooldownEvent(SpellInfo const* spellInfo, uint32 itemId /*= 0*/
     data << uint32(spellInfo->Id);
     data << uint64(GetGUID());
     SendDirectMessage(&data);

is not found on the lines numbered 21850-21863, but on the lines numbered 22130-22141 as well as have changed a bit in content. The current code, leading up to the point where you can insert @joschiwald's suggested fix, looks like this:

void Player::SendCooldownEvent(SpellInfo const* spellInfo, uint32 itemId /*= 0*/, Spell* spell /*= NULL*/, bool setCooldown /*= true*/)
{
    // start cooldowns at server side, if any
    if (setCooldown)
        AddSpellAndCategoryCooldowns(spellInfo, itemId, spell);

    // Send activate cooldown timer (possible 0) at client side
    WorldPacket data(SMSG_COOLDOWN_EVENT, 4 + 8);
    data << uint32(spellInfo->Id);
    data << uint64(GetGUID());
    SendDirectMessage(&data);
}

To be honest, I don't know why this issue got closed without explanation, I can only guess. My guess is that there has not happened anything productive here in a year, as well as 3.3.5 being replaced by 6.x as the main branch of TrinityCore, thus 3.3.5 getting lower priority than 6.x. The only way to get this issue back in the works is to come up with some productive feedback and results.

15>------ Build started: Project: INSTALL, Configuration: Release Win32 ------
15>  -- Install configuration: "Release"
15>  -- Installing: C:/Program Files (x86)/TrinityCore/authserver.exe
15>  -- Installing: C:/Program Files (x86)/TrinityCore/authserver.conf.dist
15>  -- Installing: C:/Program Files (x86)/TrinityCore/worldserver.exe
15>  -- Installing: C:/Program Files (x86)/TrinityCore/worldserver.conf.dist
========== Build: 15 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Edit: Preparing to test with commit 32a728b33162d5f2a0f0f4b648e1a25b886544a2 .

ghost avatar Jan 16 '15 20:01 ghost