Jump to content

[fix]Curse of Doom summon


Recommended Posts

Posted

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

fixes summon Doomguard for Curse of Doom

For which repository revision was the patch created?

9619

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

https://mangos.lighthouseapp.com/projects/18208/tickets/400-warlock-spell-curse-of-doom

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

me

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 4cbcad5..d0f8465 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -7176,6 +7176,11 @@ void Aura::PeriodicTick()
                procVictim|=PROC_FLAG_TAKEN_ANY_DAMAGE;
            pCaster->ProcDamageAndSpell(m_target, procAttacker, procVictim, PROC_EX_NORMAL_HIT, pdamage, BASE_ATTACK, GetSpellProto());

+            // Curse of Doom summon
+            if (GetSpellProto()->SpellFamilyName==SPELLFAMILY_WARLOCK && GetSpellProto()->SpellFamilyFlags & UI64LIT(0x200000000))
+                if (pCaster->GetTypeId() == TYPEID_PLAYER && m_target->GetHealth() <= pdamage && ((Player*)pCaster)->isHonorOrXPTarget(m_target))
+                    pCaster->CastSpell(m_target, 18662, true);
+
            pCaster->DealDamage(m_target, pdamage, &cleanDamage, DOT, GetSpellSchoolMask(GetSpellProto()), GetSpellProto(), true);
            break;
        }
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 9aff9bd..3cc3e54 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -4236,7 +4236,7 @@ void Spell::DoSummonWild(SpellEffectIndex eff_idx, uint32 forceFaction)
    if (!creature_entry)
        return;

-    uint32 level = m_caster->getLevel();
+    uint32 level = m_spellInfo->Id != 18662 ? m_caster->getLevel() : damage;

    // level of creature summoned using engineering item based at engineering skill level
    if (m_caster->GetTypeId()==TYPEID_PLAYER && m_CastItem)
@@ -4259,7 +4259,7 @@ void Spell::DoSummonWild(SpellEffectIndex eff_idx, uint32 forceFaction)
    int32 duration = GetSpellDuration(m_spellInfo);
    TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_OR_DEAD_DESPAWN;

-    int32 amount = damage > 0 ? damage : 1;
+    int32 amount = damage > 0 && m_spellInfo->Id != 18662 ? damage : 1;

    for(int32 count = 0; count < amount; ++count)
    {

I'm not sure if pCaster should cast on target =\\ and maybe the only summon spell that has level as basepoints

Posted

hello, sarjuuk and me did some stuff to make it work with mangos-0.12

and at first test it seems to work ok..

we had to remove your change about the summonlevel, else the creature got always a different level.. then we added a 10% chance that doomguard get's summoned (was changed with wotlk)

and then tempsummons shouldn't despawn when creature is enslaved (not sure if this is valid for all tempsummon-types)

edit: we changed the summoner to ptarget.. not sure if it's right, maybe i will edit this post later ;)

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 57d483a..c97bcb0 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -5923,6 +5923,12 @@ void Aura::PeriodicTick()
            SpellPeriodicAuraLogInfo pInfo(this, pdamage, absorb, resist, 0.0f);
            m_target->SendPeriodicAuraLog(&pInfo);

+            // Curse of Doom summon
+            if (GetSpellProto()->SpellFamilyName==SPELLFAMILY_WARLOCK && GetSpellProto()->SpellFamilyFlags & UI64LIT(0x200000000))
+                if (pCaster->GetTypeId() == TYPEID_PLAYER && m_target->GetHealth() <= pdamage && ((Player*)pCaster)->isHonorOrXPTarget(m_target))
+                    if (roll_chance_i(10))
+                        m_target->CastSpell(m_target, 18662, true);
+
            pCaster->DealDamage(m_target, (pdamage <= absorb+resist) ? 0 : (pdamage-absorb-resist), &cleanDamage, DOT, GetSpellSchoolMask(GetSpellProto()), GetSpellProto(), true);

            pCaster->ProcDamageAndSpell(m_target, PROC_FLAG_PERIODIC_TICK, PROC_FLAG_TAKE_DAMAGE, (pdamage <= absorb+resist) ? 0 : (pdamage-absorb-resist), GetSpellSchoolMask(GetSpellProto()), GetSpellProto());
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index c70ddfc..adb05bd 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -3489,7 +3489,7 @@ void Spell::DoSummonWild(SpellEffectIndex eff_idx, uint32 forceFaction)
    int32 duration = GetSpellDuration(m_spellInfo);
    TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_OR_DEAD_DESPAWN;

-    int32 amount = damage > 0 ? damage : 1;
+    int32 amount = damage > 0 && m_spellInfo->Id != 18662 ? damage : 1;

    for(int32 count = 0; count < amount; ++count)
    {
diff --git a/src/game/TemporarySummon.cpp b/src/game/TemporarySummon.cpp
index 09c0661..2197c15 100644
--- a/src/game/TemporarySummon.cpp
+++ b/src/game/TemporarySummon.cpp
@@ -34,6 +34,10 @@ void TemporarySummon::Update( uint32 diff )
            break;
        case TEMPSUMMON_TIMED_DESPAWN:
        {
+            // if creature is enslaved it won't get unsummoned
+            if (GetCharmerGUID())
+                break;
+
            if (m_timer <= diff)
            {
                UnSummon();
@@ -45,6 +49,10 @@ void TemporarySummon::Update( uint32 diff )
        }
        case TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT:
        {
+            // if creature is enslaved it won't get unsummoned
+            if (GetCharmerGUID())
+                break;
+
            if (!isInCombat())
            {
                if (m_timer <= diff)
@@ -63,6 +71,10 @@ void TemporarySummon::Update( uint32 diff )

        case TEMPSUMMON_CORPSE_TIMED_DESPAWN:
        {
+            // if creature is enslaved it won't get unsummoned
+            if (GetCharmerGUID())
+                break;
+
            if ( m_deathState == CORPSE)
            {
                if (m_timer <= diff)
@@ -77,6 +89,10 @@ void TemporarySummon::Update( uint32 diff )
        }
        case TEMPSUMMON_CORPSE_DESPAWN:
        {
+            // if creature is enslaved it won't get unsummoned
+            if (GetCharmerGUID())
+                break;
+
            // if m_deathState is DEAD, CORPSE was skipped
            if ( m_deathState == CORPSE || m_deathState == DEAD)
            {
@@ -88,6 +104,10 @@ void TemporarySummon::Update( uint32 diff )
        }
        case TEMPSUMMON_DEAD_DESPAWN:
        {
+            // if creature is enslaved it won't get unsummoned
+            if (GetCharmerGUID())
+                break;
+
            if ( m_deathState == DEAD )
            {
                UnSummon();
@@ -97,6 +117,10 @@ void TemporarySummon::Update( uint32 diff )
        }
        case TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN:
        {
+            // if creature is enslaved it won't get unsummoned
+            if (GetCharmerGUID())
+                break;
+
            // if m_deathState is DEAD, CORPSE was skipped
            if ( m_deathState == CORPSE || m_deathState == DEAD)
            {
@@ -120,6 +144,10 @@ void TemporarySummon::Update( uint32 diff )
        }
        case TEMPSUMMON_TIMED_OR_DEAD_DESPAWN:
        {
+            // if creature is enslaved it won't get unsummoned
+            if (GetCharmerGUID())
+                break;
+
            // if m_deathState is DEAD, CORPSE was skipped
            if (m_deathState == DEAD)
            {
@@ -127,6 +155,10 @@ void TemporarySummon::Update( uint32 diff )
                return;
            }

+            // if creature is enslaved it won't get unsummoned
+            if (GetCharmerGUID())
+                return;
+
            if (!isInCombat() && isAlive() )
            {
                if (m_timer <= diff)

edit2: i've mixed this patch with another one.. this time i've edited a clean version of mangos-0.12 diff :)

×
×
  • 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