Jump to content

[fix]Deadly Poison(5 stack part)


Auntie Mangos

Recommended Posts

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

fixes offhand poison apply for Deadly Poison

For which repository revision was the patch created?

9609

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

http://getmangos.eu/community/showthread.php?12829-[9286]Deadly-Poison-5-stacks-bugged-effect

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

me

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 8990035..2a9a809 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -6173,6 +6173,49 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
                    break;
                }
            }
+            // Deadly Poison
+            if (dummySpell->SpellIconID == 513)
+            {
+                if (pVictim->GetTypeId() != TYPEID_PLAYER)
+                    return false;
+
+                if (triggeredByAura->GetStackAmount() < dummySpell->StackAmount)
+                    return false;
+
+                Player *pCaster = ((Player*)pVictim);
+
+                Item* castItem = triggeredByAura->GetCastItemGUID() ? pCaster->GetItemByGuid(triggeredByAura->GetCastItemGUID()) : NULL;
+                
+                if (!castItem)
+                    return false;
+
+                Item *item = pCaster->GetWeaponForAttack(castItem->GetSlot() == EQUIPMENT_SLOT_MAINHAND ? OFF_ATTACK : BASE_ATTACK);
+                if (!item)
+                    return false;
+
+                // all poison enchantments is temporary
+                uint32 enchant_id = item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT);
+                if (!enchant_id)
+                    return false;
+
+                SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
+                if (!pEnchant)
+                    return false;
+
+                for (int s = 0; s < 3; ++s)
+                {
+                    if (pEnchant->type[s]!=ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
+                        continue;
+
+                    SpellEntry const* combatEntry = sSpellStore.LookupEntry(pEnchant->spellid[s]);
+                    if (!combatEntry || combatEntry->Dispel != DISPEL_POISON)
+                        continue;
+
+                    pVictim->CastSpell(this, combatEntry, true, item);
+                }
+
+                return true;
+            }
            // Cut to the Chase
            if (dummySpell->SpellIconID == 2909)
            {
@@ -12939,6 +12982,7 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
            }
            case SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN:
            case SPELL_AURA_MOD_DAMAGE_PERCENT_DONE:
+            case SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE:
            case SPELL_AURA_MANA_SHIELD:
            case SPELL_AURA_OBS_MOD_MANA:
            case SPELL_AURA_MOD_STUN:
@@ -13828,7 +13872,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry con
    }
    // Aura added by spell can`t trogger from self (prevent drop charges/do triggers)
    // But except periodic triggers (can triggered from self)
-    if(procSpell && procSpell->Id == spellProto->Id && !(spellProto->procFlags & PROC_FLAG_ON_TAKE_PERIODIC))
+    if(procSpell && procSpell->Id == spellProto->Id && !(spellProto->procFlags & PROC_FLAG_ON_TAKE_PERIODIC) && aura->GetModifier()->m_auraname != SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE)
        return false;

    // Check if current equipment allows aura to proc

mostly based on Shiv offhand poison apply

DELETE FROM `spell_proc_event` WHERE `entry` IN (2818);
INSERT INTO `spell_proc_event` VALUES
(2818, 0x00, 8, 0x00010000, 0x00000000, 0x00000000, 0x00020000, 0x00000000, 0.000000, 0.000000, 0);
INSERT INTO `spell_chain` VALUES 
(2818, 0, 2818, 1, 0), 
(2819, 2818, 2818, 2, 0),
(11353, 2819, 2818, 3, 0),
(11354, 11353, 2818, 4, 0),
(25349, 11354, 2818, 5, 0),
(26968, 25349, 2818, 6, 0),
(27187, 26968, 2818, 7, 0),
(57969, 27187, 2818, 8, 0),
(57970, 57969, 2818, 9, 0);

Link to comment
Share on other sites

  • 40 years later...
hey laise, thanks for the patch, its working!

But there is still 1 major problem.

for example, 2rogues use Deadlypoison on a Boss, sometimes stacks goes down to 1... so this fix could only help for 1rogue atm, would be cool if you can try to take a look on it :P

was it caused by this patch or unrelated? also should poisons from diff casters stack?

Link to comment
Share on other sites

was it caused by this patch or unrelated? also should poisons from diff casters stack?

its unrelated, and poisons from diff casters SHOULD stack, except woundpoison n stuff, only Deadlypoison does stack :P, but problem si that if 2people use it, BOTHstacks sometimes randomly resett

Link to comment
Share on other sites

Nice work on patch Laise, however, in proccing version, You cannot get from which wepaon it procced, so Your version works only to proc offhand weapon poison, what if Deadly Poison is on offhand ? It should proc mainhand weapon poison

This version works for having Deadly Poison on either Main Hand or Offhand weapon,

Your patch looks a lot cleaner and generic so this is just an idea prolly to rewrite :)

diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 77cf7cd..e47cb10 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -7452,7 +7452,57 @@ void Player::CastItemCombatSpell(Unit* Target, WeaponAttackType attType)
                if(IsPositiveSpell(pEnchant->spellid[s]))
                    CastSpell(this, pEnchant->spellid[s], true, item);
                else
+                {
                    CastSpell(Target, pEnchant->spellid[s], true, item);
+
+                    // Deadly Poison effect of applying second item poison
+                    if(pEnchant->aura_id == 26)
+                    {
+                        SpellEntry const * pSpellEntry = sSpellStore.LookupEntry(pEnchant->spellid[s]);
+                        if(!pSpellEntry || pSpellEntry->EffectApplyAuraName[0] != SPELL_AURA_PERIODIC_DAMAGE)
+                            return;
+
+                        Aura *poison = 0;
+                        // Lookup for Deadly poison (only attacker applied)
+                        Unit::AuraList const& auras = Target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
+                        for(Unit::AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
+                            if( (*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_ROGUE &&
+                                ((*itr)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x10000)) &&
+                                (*itr)->GetCasterGUID()== GetGUID() )
+                            {
+                                poison = *itr;
+                                break;
+                            }
+
+                        if(poison && poison->GetStackAmount() >= 5)
+                        {
+                            Item *item = GetWeaponForAttack(attType == BASE_ATTACK ? OFF_ATTACK : BASE_ATTACK );
+                            if (!item)
+                                return;
+
+                            // all poison enchantments is temporary
+                            uint32 enchant_id = item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT);
+                            if (!enchant_id)
+                                return;
+
+                            SpellItemEnchantmentEntry const *pSecondEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
+                            if (!pSecondEnchant)
+                                return;
+
+                            for (uint8 s = 0; s < 3; ++s)
+                            {
+                                if (pSecondEnchant->type[s]!=ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
+                                    continue;
+
+                                SpellEntry const* combatEntry = sSpellStore.LookupEntry(pSecondEnchant->spellid[s]);
+                                if (!combatEntry || combatEntry->Dispel != DISPEL_POISON)
+                                    continue;
+
+                                    CastSpell(Target, combatEntry, true, item);
+                            }
+                        }
+                    }
+                }
            }
        }
    }

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 months later...
  • 3 weeks later...
hey laise, thanks for the patch, its working!

But there is still 1 major problem.

for example, 2rogues use Deadlypoison on a Boss, sometimes stacks goes down to 1... so this fix could only help for 1rogue atm, would be cool if you can try to take a look on it :P

2DeadlyPoison user not stacking true till wotlk starts :D really hard to dominate other rogues to do NOT use deadlypoi while im in raid :P pls try to solve this

it never goes x5-Deadly and x5-Deadly stack from different Deadlypoi userse on same target its circleing like (x1 + x4) (x3 + x2) ( x5 + x1)

yea x5 stack from me and x1 stack from other rouge brokes equal 5 stack rule like

x1 + x4 = x5 / x3 + x2 = x5 anyway pls have a look on this major disgusting bug

i know no one likes rogues class but we need help

Link to comment
Share on other sites

  • 6 months later...

Accepted in [11198] after updating code to new aura system.

After a lot of thinking I went with maly32167's approach because there really doesn't seem to be any secondary spell that could be procced by deadly poison to handle the effect, and bending the spell system to allow self-proc for this case isn't really a very clear way, this effect really seems a unique thing not fitting in any existing mechanic.

So handled right inside weapon enchant proc code for now...but it's never too late for some brilliant ideas ;)

Link to comment
Share on other sites

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