Poison proc

Currently Poisons are not procing on absorbs for some weird reasons, currently code im using:


void Player::CastItemCombatSpell(Item *item, CalcDamageInfo *damageInfo, ItemPrototype const * proto)

{

    Unit * Target = damageInfo->target;

    WeaponAttackType attType = damageInfo->attackType;


    if (!Target || Target == this )

        return;


    // Can do effect if any damage done to target

    [b]if (damageInfo->procVictim & PROC_FLAG_TAKEN_ANY_DAMAGE || damageInfo->procEx & PROC_EX_ABSORB)[/b]

    {

        for (int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)

        {

            _Spell const& spellData = proto->Spells[i];


            // no spell

            if(!spellData.SpellId )

                continue;


            // wrong triggering type

            if(spellData.SpellTrigger != ITEM_SPELLTRIGGER_CHANCE_ON_HIT)

                continue;


            SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellData.SpellId);

            if(!spellInfo)

            {

                sLog.outError("WORLD: unknown Item spellid %i", spellData.SpellId);

                continue;

            }


            // not allow proc extra attack spell at extra attack

            if( m_extraAttacks && IsSpellHaveEffect(spellInfo,SPELL_EFFECT_ADD_EXTRA_ATTACKS) )

                return;


            float chance = spellInfo->procChance;


            if(spellData.SpellPPMRate)

            {

                uint32 WeaponSpeed = GetAttackTime(attType);

                chance = GetPPMProcChance(WeaponSpeed, spellData.SpellPPMRate);

            }

            else if(chance > 100.0f)

            {

                chance = GetWeaponProcChance();

            }


            if (roll_chance_f(chance))

                CastSpell(Target, spellInfo->Id, true, item);

        }

    }


    // item combat enchantments

    for(int e_slot = 0; e_slot < MAX_ENCHANTMENT_SLOT; ++e_slot)

    {

        uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(e_slot));

        SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);

        if(!pEnchant) continue;

        for (int s = 0; s < 3; ++s)

        {

            if(pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)

            {

                uint32 FTSpellId=0;

                switch(pEnchant->spellid[s])

                {

					// Flametongue Weapon

                    case 10400:  FTSpellId = 8026; break; // Rank 1

                    case 15567: FTSpellId = 8028; break; // Rank 2

                    case 15568: FTSpellId = 8029; break; // Rank 3

                    case 15569: FTSpellId = 10445; break; // Rank 4

                    case 16311: FTSpellId = 16343; break; // Rank 5

                    case 16312: FTSpellId = 16344; break; // Rank 6

                    case 16313: FTSpellId = 25488; break; // Rank 7

                }

                if (FTSpellId)

                    CastSpell(Target, FTSpellId, true, item);

                continue;

            }



            SpellEnchantProcEntry const* entry =  spellmgr.GetSpellEnchantProcEvent(enchant_id);

            if (entry && entry->procEx)

            {

                // Check hit/crit/dodge/parry requirement

                if((entry->procEx & damageInfo->procEx) == 0)

                    continue;

            }

            else

            {

                // Can do effect if any damage done to target or damage is absorbed

                if (!(damageInfo->procVictim & PROC_FLAG_TAKEN_ANY_DAMAGE) || (damageInfo->procEx & PROC_EX_ABSORB))

                    continue;

            }

            SpellEntry const *spellInfo = sSpellStore.LookupEntry(pEnchant->spellid[s]);


            if (!spellInfo)

            {

                sLog.outError("Player::CastItemCombatSpell Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]);

                continue;

            }


            // do not allow proc windfury totem from yellow attacks

            if((damageInfo->procAttacker & PROC_FLAG_SUCCESSFUL_MELEE_SPELL_HIT) && spellInfo->SpellFamilyName == SPELLFAMILY_SHAMAN && spellInfo->SpellFamilyFlags & 0x200000000LL)

                return;


            // not allow proc extra attack spell at extra attack

            if( m_extraAttacks && IsSpellHaveEffect(spellInfo, SPELL_EFFECT_ADD_EXTRA_ATTACKS) )

                return;


            float chance = pEnchant->amount[s] != 0 ? float(pEnchant->amount[s]) : GetWeaponProcChance();


            if (entry && entry->PPMChance)

            {

                uint32 WeaponSpeed = GetAttackTime(attType);

                chance = GetPPMProcChance(WeaponSpeed, entry->PPMChance);

            }

            else if (entry && entry->customChance)

                chance = entry->customChance;


            // Apply spell mods

            ApplySpellMod(pEnchant->spellid[s],SPELLMOD_CHANCE_OF_SUCCESS,chance);


            if (roll_chance_f(chance))

            {

                if(IsPositiveSpell(pEnchant->spellid[s]))

                    CastSpell(this, pEnchant->spellid[s], true, item);

                else

                    CastSpell(Target, pEnchant->spellid[s], true, item);

            }

        }

    }

}

Shouldn’t

if (damageInfo->procVictim & PROC_FLAG_TAKEN_ANY_DAMAGE || damageInfo->procEx & PROC_EX_ABSORB)

fix it? I kinda confused, maybe you guys can help me.

To clear it out, rogue poisons are not procing if victim got a spell wich absrobs the damage e.g priest or mage shields.

greetings

It does proc on absorbs for me at https://github.com/TrinityCore/TrinityCore/commit/2b1f6e29a21b4c32dd666ab6561f67215f5a25c4

I’m using the tbc source there poisons aren’t procing through shields, anyone knows at wich rev this got fixed?

greetings

EDIT: nvm fixed it