Jump to content

[Fix] Mark of Kazzak


Auntie Mangos

Recommended Posts

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

Fix the effect of Mark of Kazzak (http://www.wowhead.com/spell=32960)

For which repository revision was the patch created?

8348++

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

http://www.scriptdev2.com/sd2-development-and-t322.html?t=322&highlight=mark+kazzak

Who has been writing this patch? Please include either forum user names or email addresses.

based on the script of Forusim

http://getmangos.eu/community/showthread.php?13511-[FIX]-Mark-of-Kaz-rogal

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index b7cb5aa..c642293 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -6131,6 +6173,19 @@ void Aura::PeriodicTick()
            // ignore non positive values (can be result apply spellmods to aura damage
            uint32 pdamage = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0;

+            //Mark of Kazzak
+            if (m_spellProto->Id == 32960)
+            {
+                pdamage = m_target->GetMaxPower(POWER_MANA)*0.05;
+                if (m_target->GetPower(POWER_MANA) < pdamage)
+                {
+                    if (m_target && m_target->GetTypeId() == TYPEID_PLAYER && m_target->getPowerType() == POWER_MANA)
+                        m_target->CastSpell(m_target, 32961, true);
+
+                    m_target->RemoveAura(GetId(), GetEffIndex());
+                }
+            }
+
            sLog.outDetail("PeriodicTick: %u (TypeId: %u) power leech of %u (TypeId: %u) for %u dmg inflicted by %u",
                GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId());

thank you Forusim :)

Link to comment
Share on other sites

  • 42 years later...

Might be nice to finally implement these spells..

I am not sure about many details in this code area, hence this rewrite of the patch might be rather bad.

Any input is very welcome!

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index f354cff..ad03a17 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -7420,7 +7420,7 @@ void Aura::PeriodicTick()

            float gain_multiplier = 0;

-            if(pCaster->GetMaxPower(power) > 0)
+            if (pCaster->GetMaxPower(power) > 0)
            {
                gain_multiplier = spellProto->EffectMultipleValue[GetEffIndex()];

@@ -7442,6 +7442,25 @@ void Aura::PeriodicTick()

                target->AddThreat(pCaster, float(gain) * 0.5f, pInfo.critical, GetSpellSchoolMask(spellProto), spellProto);
            }
+
+            // TODO - Other place for this? send-log, do drain?
+            // All power drained, some spells can trigger an additional spell
+            if (target->GetPower(power) == 0)
+            {
+                switch (GetId())
+                {
+                    case 32960:                             // Mark of Kazzak
+                    {
+                        if (target && target->GetTypeId() == TYPEID_PLAYER && target->getPowerType() == POWER_MANA)
+                            target->CastSpell(target, 32961, true, NULL, this);
+                    
+                        // TODO - how?
+                        target->RemoveAura(this);
+                        break;
+                    }
+                }
+            }
+
            break;
        }
        case SPELL_AURA_PERIODIC_ENERGIZE:

Link to comment
Share on other sites

  • 2 weeks later...
Guest
This topic is now closed to further replies.
×
×
  • 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