Jump to content

[FIX][7881] Add support for spells 59502, 59503, 59504


Recommended Posts

Posted

What bug does the patch fix? What features does the patch add?

This patch will add core/db support for spells 59502, 59503, 59504

For which repository revision was the patch created?

7846

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

Didn't find any.

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index c1cfd68..57b22b3 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -2696,7 +2696,26 @@ void Spell::EffectCreateItem2(uint32 i)
        ((Player*)m_caster)->AutoStoreLoot(m_spellInfo->Id,LootTemplates_Spell);
        return;
    }
-    DoCreateItem(i,m_spellInfo->EffectItemType[i]);
+
+    // Add support for spells that create random loot items
+    switch(m_spellInfo->Id)
+    {
+        case 59502:             // Inscription - Darkmoon Card
+        case 59503:             // Inscription - Greater Darkmoon Card
+        case 59504:             // Inscription - Darkmoon Card of the North
+                {
+                    if(m_caster->GetTypeId()!=TYPEID_PLAYER)
+                        return;
+                    Player* player = (Player*)m_caster;
+
+                    // create some random items
+                    player->AutoStoreLoot(m_spellInfo->Id,LootTemplates_Spell);
+                    return;
+                }
+        default:
+            DoCreateItem(i,m_spellInfo->EffectItemType[i]);
+            return;
+    }
}

void Spell::EffectPersistentAA(uint32 i)

Supportng db code has been generated pending inclusion of code.

Posted

In generic way correct. But need also make support error ouput for DB creators about absent data as done for other cases (IsLootCraftingSpell). And maybe attempt generilize checks for like spells with this effect but random result....

I look at this currently... Bad side, i not see generic check possibility :(

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use