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


C++ GetSpellInfo函数代码示例

本文整理汇总了C++中GetSpellInfo函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSpellInfo函数的具体用法?C++ GetSpellInfo怎么用?C++ GetSpellInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: Load

 bool Load()
 {
     healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
     return true;
 }
开发者ID:Altair69,项目名称:SkyFireEMU,代码行数:5,代码来源:spell_priest.cpp

示例2: Load

 bool Load()
 {
     // Max absorb stored in 1 dummy effect
     limit = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
     return true;
 }
开发者ID:Sania001,项目名称:ALiveCoreRC2,代码行数:6,代码来源:spell_generic.cpp

示例3: HandleDummyLaunch

 void HandleDummyLaunch(SpellEffIndex /*effIndex*/)
 {
     sLog->outString("Spell %u with SPELL_EFFECT_DUMMY is just launched!", GetSpellInfo()->Id);
 }
开发者ID:FirstCore,项目名称:FunCore,代码行数:4,代码来源:example_spell.cpp

示例4: HandleDummyHit

 void HandleDummyHit(SpellEffIndex /*effIndex*/)
 {
     sLog->outString("Spell %u with SPELL_EFFECT_DUMMY has hit!", GetSpellInfo()->Id);
 }
开发者ID:FirstCore,项目名称:FunCore,代码行数:4,代码来源:example_spell.cpp

示例5: HandleDummy

 void HandleDummy(SpellEffIndex /*effIndex*/)
 {
     if (Unit* unitTarget = GetHitUnit())
     {
         int32 bp0 = 0;
         int32 bp1 = 0;
         // Living ghoul as a target
         if (unitTarget->isAlive())
         {
             bp0 = int32(unitTarget->CountPctFromMaxHealth(25));
             bp1 = int32(unitTarget->CountPctFromMaxHealth(200));
             unitTarget->CastCustomSpell(unitTarget, DK_SPELL_PET_EXPLODE, &bp0, &bp1, NULL, false);
         }
         // Some corpse
         else
         {
             bp0 = GetEffectValue();
             GetCaster()->CastCustomSpell(unitTarget, SpellMgr::CalculateSpellEffectAmount(GetSpellInfo(), 1), &bp0, NULL, NULL, true);
             // Set corpse look
             unitTarget->SetDisplayId(DISPLAY_GHOUL_CORPSE + urand(0, 3));
         }
     }
 }
开发者ID:Sharki,项目名称:TC,代码行数:23,代码来源:spell_dk.cpp

示例6: HandleEffectRemove

 void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
 {
     if (Player* player = GetTarget()->ToPlayer())
         if (AuraEffect const* glyph = player->GetAuraEffect(SPELL_DK_GLYPH_OF_REGENERATIVE_MAGIC, EFFECT_0)) // reduce cooldown of AMS if player has glyph
         {
             // Cannot reduce cooldown by more than 50%
             int32 val = std::min(glyph->GetAmount(), int32(absorbedAmount) * 100 / maxHealth);
             player->GetSpellHistory()->ModifyCooldown(GetId(), -int32(player->GetSpellHistory()->GetRemainingCooldown(GetSpellInfo()) * val / 100));
         }
 }
开发者ID:DSlayerMan,项目名称:DraenorCore,代码行数:10,代码来源:spell_dk.cpp

示例7: CheckCast

 SpellCastResult CheckCast()
 {
     if (int32(GetCaster()->GetHealth()) > int32(GetCaster()->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue())))
         return SPELL_CAST_OK;
     return SPELL_FAILED_FIZZLE;
 }
开发者ID:BlackWolfsDen,项目名称:Cataclysm,代码行数:6,代码来源:spell_warlock.cpp

示例8: CalculateAmount

 void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
 {
     if (AuraEffect* aurEff = GetUnitOwner()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_PET, GetSpellInfo()->SpellIconID, EFFECT_0))
         AddPct(amount, aurEff->GetAmount());
 }
开发者ID:AzerothShard-Dev,项目名称:azerothcore,代码行数:5,代码来源:spell_hunter.cpp

示例9: HandleHit

 void HandleHit(SpellEffIndex /*effIndex*/)
 {
     if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffect(SPELL_WARLOCK_IMMOLATE, EFFECT_2, GetCaster()->GetGUID()))
         SetHitDamage(CalculatePct(aurEff->GetAmount(), GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster())));
 }
开发者ID:BlackWolfsDen,项目名称:Cataclysm,代码行数:5,代码来源:spell_warlock.cpp

示例10: CheckCast

 SpellCastResult CheckCast()
 {
     if ((int32(GetCaster()->GetHealth()) > int32(GetSpellInfo()->Effects[EFFECT_0].CalcValue() + (6.3875 * GetSpellInfo()->BaseLevel))))
         return SPELL_CAST_OK;
     return SPELL_FAILED_FIZZLE;
 }
开发者ID:Shutok,项目名称:WingsEMU,代码行数:6,代码来源:spell_warlock.cpp

示例11: HandleEffectBearProc

            void HandleEffectBearProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
            {
                PreventDefaultAction();
                if (GetTarget()->GetShapeshiftForm() != FORM_BEAR || eventInfo.GetDamageInfo()->GetSpellInfo()->Id != SPELL_DRUID_FERAL_CHARGE_BEAR)
                    return;

                GetTarget()->CastSpell(GetTarget(), sSpellMgr->GetSpellWithRank(SPELL_DRUID_STAMPEDE_BAER_RANK_1, GetSpellInfo()->GetRank()), true, NULL, aurEff);
            }
开发者ID:Nightprince,项目名称:SkyFire.548,代码行数:8,代码来源:spell_druid.cpp

示例12: HandleEnergize

        void HandleEnergize(SpellEffIndex effIndex)
        {
            Player* caster = GetCaster()->ToPlayer();

            // No boomy, no deal.
            if (caster->GetPrimaryTalentTree(caster->GetActiveSpec()) != TALENT_TREE_DRUID_BALANCE)
                return;

            switch(GetSpellInfo()->Id)
            {
                case SPELL_DRUID_WRATH:
                {
                    energizeAmount = -GetSpellInfo()->Effects[effIndex].BasePoints; // -13
                    // If we are set to fill the lunar side or we've just logged in with 0 power..
                    if ((!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER))
                        || caster->GetPower(POWER_ECLIPSE) == 0)
                    {
                        caster->CastCustomSpell(caster,SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE,&energizeAmount,0,0,true);
                        // If the energize was due to 0 power, cast the eclipse marker aura
                        if (!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER))
                            caster->CastSpell(caster,SPELL_DRUID_LUNAR_ECLIPSE_MARKER,true);
                    }
                    // The energizing effect brought us out of the solar eclipse, remove the aura
                    if (caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) <= 0)
                        caster->RemoveAurasDueToSpell(SPELL_DRUID_SOLAR_ECLIPSE);
                    break;
                }
                case SPELL_DRUID_STARFIRE:
                {
                    energizeAmount = GetSpellInfo()->Effects[effIndex].BasePoints; // 20
                    // If we are set to fill the solar side or we've just logged in with 0 power..
                    if ((!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER))
                        || caster->GetPower(POWER_ECLIPSE) == 0)
                    {
                        caster->CastCustomSpell(caster,SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE,&energizeAmount,0,0,true);
                        // If the energize was due to 0 power, cast the eclipse marker aura
                        if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER))
                            caster->CastSpell(caster,SPELL_DRUID_SOLAR_ECLIPSE_MARKER,true);
                    }
                    // The energizing effect brought us out of the lunar eclipse, remove the aura
                    if (caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) >= 0)
                        caster->RemoveAura(SPELL_DRUID_LUNAR_ECLIPSE);
                    break;
                }
                case SPELL_DRUID_STARSURGE:
                {
                    // If we are set to fill the solar side or we've just logged in with 0 power (confirmed with sniffs)
                    if ((!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER))
                        || caster->GetPower(POWER_ECLIPSE) == 0)
                    {
                        energizeAmount = GetSpellInfo()->Effects[effIndex].BasePoints; // 15
                        caster->CastCustomSpell(caster,SPELL_DRUID_STARSURGE_ENERGIZE,&energizeAmount,0,0,true);

                        // If the energize was due to 0 power, cast the eclipse marker aura
                        if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER))
                            caster->CastSpell(caster,SPELL_DRUID_SOLAR_ECLIPSE_MARKER,true);
                    }
                    else if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER))
                    {
                        energizeAmount = -GetSpellInfo()->Effects[effIndex].BasePoints; // -15
                        caster->CastCustomSpell(caster,SPELL_DRUID_STARSURGE_ENERGIZE,&energizeAmount,0,0,true);
                    }
                    // The energizing effect brought us out of the lunar eclipse, remove the aura
                    if (caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) >= 0)
                        caster->RemoveAura(SPELL_DRUID_LUNAR_ECLIPSE);
                    // The energizing effect brought us out of the solar eclipse, remove the aura
                    else if (caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) <= 0)
                        caster->RemoveAura(SPELL_DRUID_SOLAR_ECLIPSE);
                    break;
                }
            }
        }
开发者ID:SgT-Fatality,项目名称:PandarenCore,代码行数:72,代码来源:spell_druid.cpp

示例13: HandlePeriodic

 void HandlePeriodic(AuraEffect const* aurEff)
 {
     PreventDefaultAction();
     if (aurEff->GetAmount() <= 0)
     {
         Unit* target = GetTarget();
         uint32 spellId = SPELL_HUNTER_SNIPER_TRAINING_BUFF_R1 + GetId() - SPELL_HUNTER_SNIPER_TRAINING_R1;
         target->CastSpell(target, spellId, true, 0, aurEff);
         if (Player* playerTarget = GetUnitOwner()->ToPlayer())
         {
             int32 baseAmount = aurEff->GetBaseAmount();
             int32 amount = playerTarget->CalculateSpellDamage(playerTarget, GetSpellInfo(), aurEff->GetEffIndex(), &baseAmount);
             GetEffect(EFFECT_0)->SetAmount(amount);
         }
     }
 }
开发者ID:AwkwardDev,项目名称:TinyCore,代码行数:16,代码来源:spell_hunter.cpp

示例14: Load

 bool Load() override
 {
     absorbChance = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
     return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER;
 }
开发者ID:DanielBallaSZTE,项目名称:TrinityCorePreWOTLK,代码行数:5,代码来源:spell_rogue.cpp

示例15: Load

 bool Load()
 {
     chance = GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster());
     return true;
 }
开发者ID:Eralan,项目名称:Darkcore,代码行数:5,代码来源:spell_shaman.cpp


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