当前位置: 首页>>代码示例>>C++>>正文


C++ DamageInfo::GetSpellInfo方法代码示例

本文整理汇总了C++中DamageInfo::GetSpellInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ DamageInfo::GetSpellInfo方法的具体用法?C++ DamageInfo::GetSpellInfo怎么用?C++ DamageInfo::GetSpellInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DamageInfo的用法示例。


在下文中一共展示了DamageInfo::GetSpellInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CheckProc

            bool CheckProc(ProcEventInfo& eventInfo)
            {
                DamageInfo* damageInfo = eventInfo.GetDamageInfo();
                if (!damageInfo || !damageInfo->GetSpellInfo())
                    return false;

                return true;
            }
开发者ID:kemlg,项目名称:trinitycore-conciens,代码行数:8,代码来源:spell_mage.cpp

示例2: Absorb

            void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & /*absorbAmount*/)
            {
                if (Unit* owner = GetUnitOwner())
                {
                    if (dmgInfo.GetSpellInfo())
                    {
                        if (urand(0, 99) < 5)
                            GetTarget()->CastSpell(GetTarget(), spellId, true);

                        // Twin Vortex part
                        uint32 lightVortex = SPELL_LIGHT_VORTEX_DAMAGE;
                        uint32 darkVortex = SPELL_DARK_VORTEX_DAMAGE;
                        int32 stacksCount = dmgInfo.GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue() / 1000 - 1;

                        if (lightVortex && darkVortex && stacksCount)
                        {
                            if (dmgInfo.GetSpellInfo()->Id == darkVortex || dmgInfo.GetSpellInfo()->Id == lightVortex)
                            {
                                Aura* pAura = owner->GetAura(SPELL_POWERING_UP);
                                if (pAura)
                                {
                                    pAura->ModStackAmount(stacksCount);
                                    owner->CastSpell(owner, SPELL_POWERING_UP, true);
                                }
                                else
                                {
                                    owner->CastSpell(owner, SPELL_POWERING_UP, true);
                                    if (Aura* pTemp = owner->GetAura(SPELL_POWERING_UP))
                                        pTemp->ModStackAmount(stacksCount);
                                }
                            }
                        }

                        // Picking floating balls
                        uint32 unleashedDark = SPELL_UNLEASHED_DARK;
                        uint32 unleashedLight = SPELL_UNLEASHED_LIGHT;

                        if (unleashedDark && unleashedLight)
                        {
                            if (dmgInfo.GetSpellInfo()->Id == unleashedDark || dmgInfo.GetSpellInfo()->Id == unleashedLight)
                            {
                                // need to do the things in this order, else players might have 100 charges of Powering Up without anything happening
                                Aura* pAura = owner->GetAura(SPELL_POWERING_UP);
                                if (pAura)
                                {
                                    // 2 lines together add the correct amount of buff stacks
                                    pAura->ModStackAmount(stacksCount);
                                    owner->CastSpell(owner, SPELL_POWERING_UP, true);
                                }
                                else
                                {
                                    owner->CastSpell(owner, SPELL_POWERING_UP, true);
                                    if (Aura* pTemp = owner->GetAura(SPELL_POWERING_UP))
                                        pTemp->ModStackAmount(stacksCount);
                                }
                            }
                        }
                    }
                }
            }
开发者ID:GlassFace,项目名称:LegacyCore_6.x.x,代码行数:60,代码来源:boss_twin_valkyr.cpp


注:本文中的DamageInfo::GetSpellInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。