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


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

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


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

示例1: HandleProc

            void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
            {
                PreventDefaultAction();
                SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
                if (!spellInfo)
                    return;

                uint32 spellId;
                int32 chance;

                // Holy Light & Flash of Light
                if (spellInfo->SpellFamilyFlags[0] & 0xC0000000)
                {
                    spellId = SPELL_PALADIN_ENDURING_LIGHT;
                    chance = 15;
                }
                // Judgements
                else if (spellInfo->SpellFamilyFlags[0] & 0x00800000)
                {
                    spellId = SPELL_PALADIN_ENDURING_JUDGEMENT;
                    chance = 50;
                }
                else
                    return;

                if (roll_chance_i(chance))
                    eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), spellId, true);
            }
开发者ID:Regigicas,项目名称:TrinityCore,代码行数:28,代码来源:spell_paladin.cpp

示例2: HandleProc

            void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
            {
                PreventDefaultAction();
                SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
                if (!spellInfo)
                    return;

                uint32 spellId;
                int32 chance;

                // Lesser Healing Wave
                if (spellInfo->SpellFamilyFlags[0] & 0x00000080)
                {
                    spellId = SPELL_SHAMAN_ENERGY_SURGE;
                    chance = 10;
                }
                // Lightning Bolt
                else if (spellInfo->SpellFamilyFlags[0] & 0x00000001)
                {
                    spellId = SPELL_SHAMAN_ENERGY_SURGE;
                    chance = 15;
                }
                // Stormstrike
                else if (spellInfo->SpellFamilyFlags[1] & 0x00000010)
                {
                    spellId = SPELL_SHAMAN_POWER_SURGE;
                    chance = 50;
                }
                else
                    return;

                if (roll_chance_i(chance))
                    eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true);
            }
开发者ID:Lyill,项目名称:TrinityCore,代码行数:34,代码来源:spell_shaman.cpp

示例3: CheckProc

            bool CheckProc(ProcEventInfo& eventInfo)
            {
                if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
                    if (spellInfo->Id == SPELL_MAGE_IGNITE)
                        return true;

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

示例4: HandleProc

        void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
        {
            if (eventInfo.GetSpellInfo() && eventInfo.GetSpellInfo()->Id == 82036)
                return;

            SpellSchoolMask mask = eventInfo.GetDamageInfo()->GetSchoolMask();
            if (mask & SPELL_SCHOOL_MASK_NORMAL)
            {
                int32 damage = QuadraticLinarBenefit(30.0f, 100.0f, eventInfo.GetDamageInfo()->GetDamage());
                if (damage < 1) damage = 1;
                GetCaster()->CastCustomSpell(eventInfo.GetProcTarget(), 82036, &damage, NULL, NULL, true);
            }
            else if (mask & SPELL_SCHOOL_MASK_NATURE)
            {
                int32 damage = CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount());
                GetCaster()->CastCustomSpell(GetCaster(), 82037, &damage, NULL, NULL, true);
            }
        }
开发者ID:update88,项目名称:loa,代码行数:18,代码来源:spell_rogue.cpp

示例5: CheckProc

            bool CheckProc(ProcEventInfo& eventInfo)
            {
                // Growl shares family flags with other spells
                // filter by spellIcon instead
                SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
                if (!spellInfo || spellInfo->SpellIconID != PET_ICON_ID_GROWL)
                    return false;

                return true;
            }
开发者ID:Refuge89,项目名称:TrinityCore,代码行数:10,代码来源:pet_hunter.cpp

示例6: HandleProc

        void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
        {
            PreventDefaultAction();
            SpellInfo const* procSpell = eventInfo.GetSpellInfo();
            if (!procSpell)
                return;

            uint32 mana = procSpell->ManaCost + procSpell->ManaCostPercentage *  GetTarget()->GetCreateMana() / 100;
            int32 basepoint = CalculatePct(int32(mana), aurEff->GetAmount());
            GetTarget()->CastCustomSpell(GetTarget(), SPELL_HUNTER_GLYPH_OF_ARCANE_SHOT, &basepoint, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
        }
开发者ID:AwkwardDev,项目名称:RE,代码行数:11,代码来源:spell_hunter.cpp

示例7: HandleProc

            void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
            {
                PreventDefaultAction();

                Unit* caster = eventInfo.GetActor();
                caster->CastSpell(nullptr, SPELL_PET_GUARD_DOG_HAPPINESS, aurEff);

                Unit* target = eventInfo.GetProcTarget();
                if (!target->CanHaveThreatList())
                    return;
                float addThreat = CalculatePct(ASSERT_NOTNULL(eventInfo.GetSpellInfo())->Effects[EFFECT_0].CalcValue(caster), aurEff->GetAmount());
                target->GetThreatManager().AddThreat(caster, addThreat, GetSpellInfo(), false, true);
            }
开发者ID:Refuge89,项目名称:TrinityCore,代码行数:13,代码来源:pet_hunter.cpp

示例8: HandleCheckProc

        bool HandleCheckProc(ProcEventInfo& eventInfo)
        {
            Unit const* const caster = GetCaster();
            SpellInfo const* const triggerSpell = eventInfo.GetSpellInfo();

            if (triggerSpell)
            {
                // Prevents proc by damage from the spell itself
                if (triggerSpell->Id != GetId())
                    return true;

                // Sanguinary Vein
                if (AuraEffect const* const aurEff = caster->GetAuraEffectOfRankedSpell(SPELL_SANGUINARY_VEIN, EFFECT_1))
                    if (triggerSpell->GetAuraState() == AURA_STATE_BLEEDING && roll_chance_i(aurEff->GetAmount()))
                        return false;
            }

            return true;
        }
开发者ID:Tithand,项目名称:TER-Server,代码行数:19,代码来源:spell_rogue.cpp

示例9: CheckProc

 bool CheckProc(ProcEventInfo& eventInfo)
 {
     return eventInfo.GetSpellInfo() && (eventInfo.GetSpellInfo()->GetAllEffectsMechanicMask() & (1 << MECHANIC_SNARE | 1 << MECHANIC_ROOT | 1 << MECHANIC_FREEZE));
 }
开发者ID:DSlayerMan,项目名称:DraenorCore,代码行数:4,代码来源:spell_dk.cpp


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