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


C++ GetAura函数代码示例

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


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

示例1: CalcSpellMod

        void CalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod, SpellInfo const* /*spellInfo*/, Unit* /*target*/)
        {
            int32 bonus = 0;
            if (Unit* caster = GetCaster())
            {
                if (Player* player = caster->ToPlayer())
                {
                    uint32 maxMana = player->GetMaxPower(POWER_MANA);
                    if (!maxMana)
                        return;
                    uint32 amount = aurEff->GetAmount(); // 150 * mastery / 100
                    float manaPercent = float(player->GetPower(POWER_MANA)) / float(maxMana);
                    //float mastery = player->GetMasteryPoints();
                    bonus = int32(manaPercent * (/*(mastery + 8.0f) **/ amount)/* / 100.0f*/);
                    //if (!spellMod || bonus != spellMod->value)
                    //    sLog->outBasic("Mana Adept : manaPct %.2f, amount %u, bonus %d", manaPercent, amount, bonus);
                }
            }

            if (!spellMod)
                spellMod = new SpellModifier(GetAura(), const_cast<AuraEffect*>(aurEff));

            spellMod->op = SPELLMOD_DAMAGE/*SPELLMOD_ALL_EFFECTS*/;

            spellMod->type = SPELLMOD_PCT;
            spellMod->spellId = aurEff->GetId(); // 12042 Arcane Power : 685904631, 102472, 0
            spellMod->mask = flag96(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);//GetSpellProto()->EffectSpellClassMask[aurEff->GetEffIndex()];
            spellMod->charges = GetAura()->GetCharges();

            //spellMod->spellId = aurEff->GetId(); // 12042
            spellMod->value = bonus;
        }
开发者ID:hodobaj,项目名称:Darkcore,代码行数:32,代码来源:mastery_spells.cpp

示例2: OnPeriodic

            void OnPeriodic(AuraEffect const* /*aurEff*/)
            {
                // Every 5 seconds
                Unit* target = GetTarget();
                Unit* caster = GetCaster();

                // If our player is no longer sit, remove all auras
                if (target->getStandState() != UNIT_STAND_STATE_SIT)
                {
                    target->RemoveAura(GetAura());
                    return;
                }

                target->CastSpell(target, SPELL_BASKET_CHECK, false); // unknown use, it targets Romantic Basket
                target->CastSpell(target, RAND(SPELL_MEAL_EAT_VISUAL, SPELL_DRINK_VISUAL), false);

                bool foundSomeone = false;
                // For nearby players, check if they have the same aura. If so, cast Romantic Picnic (45123)
                // required for "hearts" visual
                std::list<Player*> playerList;
                Trinity::AnyPlayerInObjectRangeCheck checker(target, INTERACTION_DISTANCE*2);
                Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(target, playerList, checker);
                target->VisitNearbyWorldObject(INTERACTION_DISTANCE*2, searcher);
                for (std::list<Player*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
                    if ((*itr) != target && (*itr)->HasAura(GetId())) // && (*itr)->getStandState() == UNIT_STAND_STATE_SIT)
                        foundSomeone = true;
                        // break;
            }
开发者ID:BlackwaterEmu,项目名称:Trinity-Zero,代码行数:28,代码来源:spell_holiday.cpp

示例3: OnApply

    void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
    {
        if (!GetCaster()->HasAura(SPELL_VITAL_SPARK))
        {
            stacks = 0;
            return;
        }

        stacks = GetCaster()->GetAuraCount(SPELL_VITAL_SPARK);
        int32 healingPct = sSpellMgr->AssertSpellInfo(SPELL_VITAL_SPARK)->GetEffect(EFFECT_0)->BasePoints * stacks;

        if (GetAura()->GetEffect(EFFECT_0)->GetAmount() < healingPct)
            GetAura()->GetEffect(EFFECT_0)->SetAmount(healingPct);

        GetCaster()->RemoveAura(SPELL_VITAL_SPARK);
    }
开发者ID:Carbenium,项目名称:TrinityCore,代码行数:16,代码来源:boss_baleroc.cpp

示例4: SetFloatValue

void Player::UpdateMastery()
{
    if (!CanUseMastery())
    {
        SetFloatValue(PLAYER_MASTERY, 0.0f);
        return;
    }

    float value = GetTotalAuraModifier(SPELL_AURA_MASTERY);
    value += GetRatingBonusValue(CR_MASTERY);
    SetFloatValue(PLAYER_MASTERY, value);

    ChrSpecializationEntry const* chrSpec = sChrSpecializationStore.LookupEntry(GetUInt32Value(PLAYER_FIELD_CURRENT_SPEC_ID));
    if (!chrSpec)
        return;

    for (uint32 i = 0; i < MAX_MASTERY_SPELLS; ++i)
    {
        if (Aura* aura = GetAura(chrSpec->MasterySpellID[i]))
        {
            for (SpellEffectInfo const* effect : aura->GetSpellEffectInfos())
            {
                if (!effect)
                    continue;

                float mult = effect->BonusCoefficient;
                if (G3D::fuzzyEq(mult, 0.0f))
                    continue;

                aura->GetEffect(effect->EffectIndex)->ChangeAmount(int32(value * mult));
            }
        }
    }
}
开发者ID:brecky,项目名称:TrinityCore,代码行数:34,代码来源:StatSystem.cpp

示例5: HandlePeriodic

            void HandlePeriodic(constAuraEffectPtr aurEff)
            {
                Unit* caster = GetCaster();
                Unit* target = GetTarget();
                const SpellInfo* spell = GetSpellInfo();
                Player* linkedPlayer = sObjectAccessor->GetPlayer(*target, playerLinkedGuid);

                if (!caster || !target || !spell || !linkedPlayer || !linkedPlayer->isAlive() || !linkedPlayer->HasAura(spell->Id))
                    if (AuraPtr myaura = GetAura())
                    {
                        myaura->Remove();
                        return;
                    }

                if (target->GetDistance(linkedPlayer) > spell->Effects[EFFECT_0].BasePoints)
                {
                    if (AuraPtr aura = target->GetAura(spell->Id))
                    {
                        if (aura->GetStackAmount() >= 15)
                        {
                            aura->Remove();
                            return;
                        }
                    }
                    
                    caster->AddAura(spell->Id, target);
                    target->CastSpell(linkedPlayer, SPELL_JASPER_CHAINS_DAMAGE, true);
                }
                else
                    target->CastSpell(linkedPlayer, SPELL_JASPER_CHAINS_VISUAL, true);
            }
开发者ID:AlucardVoss,项目名称:Patchs,代码行数:31,代码来源:boss_stone_guard.cpp

示例6: HandlePeriodicTick

            void HandlePeriodicTick(AuraEffect const* aurEff)
            {
                if (!GetUnitOwner())
                    return;

                if (Aura* aur = GetAura())
                {
                    if (aur->GetStackAmount() >= 5)
                    {
                        uint32 spellId = SPELL_DEEP_CORRUPTION_DMG;
                        switch (GetCaster()->GetMap()->GetDifficulty())
                        {
                            case RAID_DIFFICULTY_10MAN_NORMAL: spellId = SPELL_DEEP_CORRUPTION_DMG;     break;
                            case RAID_DIFFICULTY_25MAN_NORMAL: spellId = SPELL_DEEP_CORRUPTION_DMG_25;  break;
                            case RAID_DIFFICULTY_10MAN_HEROIC: spellId = SPELL_DEEP_CORRUPTION_DMG_10H; break;
                            case RAID_DIFFICULTY_25MAN_HEROIC: spellId = SPELL_DEEP_CORRUPTION_DMG_25H; break;

							default:                           spellId = SPELL_DEEP_CORRUPTION_DMG;     break;
                        }

                        GetUnitOwner()->CastSpell(GetUnitOwner(), spellId, true);

                        aur->Remove();
                    }
                }
            }
开发者ID:beyourself,项目名称:WoWSCore548,代码行数:26,代码来源:boss_yorsahj_the_unsleeping.cpp

示例7: HandleShatter

 void HandleShatter(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
 {
     //if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL)
     if (GetAura()->GetCharges() <= 1)
         if (GetTarget()->IsAIEnabled)
             GetTarget()->GetAI()->DoAction(ACTION_PROTECTIVE_BUBBLE_SHATTERED);
 }
开发者ID:kemlg,项目名称:trinitycore-conciens,代码行数:7,代码来源:boss_ichoron.cpp

示例8: OnProc

        void OnProc(AuraEffect const* aurEff, Unit* unit, Unit* victim, uint32 damage, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, int32 cooldown)
        {
            PreventDefaultAction();
            if (!(procFlag & PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG))
                return;

            Player* player = unit->ToPlayer();
            if (!player)
                return;

            // custom cooldown processing case
            uint32 auraSpellId = GetAura()->GetId();
            if (cooldown && player->HasSpellCooldown(auraSpellId))
                return;

            uint32 procSpellId = procSpell ? procSpell->Id : 0;
            uint32 spellId = 0;
            switch (procSpellId)
            {
                // Lightning Bolt
                case 403:
                    spellId = 45284;
                    break;
                // Chain Lightning
                case 421:
                    spellId = 45297;
                    break;
                // Lava Burst
                case 51505:
                    spellId = 77451;
                    break;
                default:
                    return;
            }

            //sLog->outDetail("Elemental Overlord : attType %u, damage %u, procSpell %u, chance %d", attType, damage, procSpellId, aurEff->GetAmount());

            // Chain Lightning
            if (procSpell->SpellFamilyFlags[0] & 0x2)
            {
                // Chain lightning has [LightOverload_Proc_Chance] / [Max_Number_of_Targets] chance to proc of each individual target hit.
                // A maxed LO would have a 33% / 3 = 11% chance to proc of each target.
                // LO chance was already "accounted" at the proc chance roll, now need to divide the chance by [Max_Number_of_Targets]
                float chance = 100.0f / procSpell->Effects[EFFECT_0].ChainTarget;
                if (!roll_chance_f(chance))
                    return;

                // Remove cooldown (Chain Lightning - have Category Recovery time)
                player->RemoveSpellCooldown(spellId);
            }

            if (roll_chance_i(aurEff->GetAmount()))
            {
                unit->CastSpell(victim, spellId, true, NULL, aurEff);
                if (cooldown)
                    player->AddSpellCooldown(auraSpellId, 0, time(NULL) + cooldown);
            }
        }
开发者ID:hodobaj,项目名称:Darkcore,代码行数:58,代码来源:mastery_spells.cpp

示例9: GetAura

void Player::UpdateMastery()
{
    if (HasAuraType(SPELL_AURA_MASTERY))
    {
        if(HasAura(76671))
            GetAura(76671)->RecalculateAmountOfEffects();//Paladin Protection Mastery
        if(HasAura(77514))
            GetAura(77514)->RecalculateAmountOfEffects();//DK Frost Mastery
        if(HasAura(48517))
            GetAura(48517)->RecalculateAmountOfEffects();// Druid Balance Mastery
        if(HasAura(48518))
            GetAura(48518)->RecalculateAmountOfEffects();// Druid Balance Mastery
        if(HasAura(76857))
            GetAura(76857)->RecalculateAmountOfEffects();// Warrior Protection Mastery
        SetInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_MASTERY, m_baseRatingValue[CR_MASTERY]);
        SetFloatValue(PLAYER_MASTERY, GetMasteryPoints());
    }
}
开发者ID:Jildor,项目名称:4.3.4-Core,代码行数:18,代码来源:StatSystem.cpp

示例10: HandlePeriodicDummy

            void HandlePeriodicDummy(AuraEffect const* aurEff)
            {
                Unit* target = GetTarget();
				if (target->GetTypeId() == TYPEID_UNIT && GetAura()->GetStackAmount() >= 10)
				{
					target->CastSpell(target, SPELL_OVERCHARGED_BLAST, true);
					target->ToCreature()->DespawnOrUnsummon(500);
				}

				PreventDefaultAction();
            }
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:11,代码来源:boss_emalon.cpp

示例11: GetMasteryBaseAmount

uint32 MasteryScript::GetMasteryBaseAmount()
{
    if (dummyEffectIndex >= 0 && dummyEffectIndex < MAX_SPELL_EFFECTS)
    {
        if (SpellInfo const* spellInfo = GetAura()->GetSpellInfo())
            return spellInfo->Effects[dummyEffectIndex].BasePoints ? spellInfo->Effects[dummyEffectIndex].BasePoints : defaultBaseAmount;
        // if (AuraEffect* effect = GetAura()->GetEffect(dummyEffectIndex))
        //    return effect->GetBaseAmount()/*GetAmount()*/;
    }
    return defaultBaseAmount;
}
开发者ID:hodobaj,项目名称:Darkcore,代码行数:11,代码来源:SpellScript.cpp

示例12: HandleEffectCalcSpellMod

 void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod)
 {
     if (!spellMod)
     {
         spellMod = new SpellModifier(GetAura());
         spellMod->op = SPELLMOD_DOT;
         spellMod->type = SPELLMOD_FLAT;
         spellMod->spellId = GetId();
         spellMod->mask = GetSpellInfo()->Effects[aurEff->GetEffIndex()].SpellClassMask;
     }
     spellMod->value = aurEff->GetAmount() / 7;
 }
开发者ID:Hlkz2,项目名称:ACoreOld,代码行数:12,代码来源:spell_druid.cpp

示例13: GetTarget

void SpellValanarKineticBombAuraScript::HandleDummyTick(AuraEffect const* /*aurEff*/)
{
    Unit* target = GetTarget();
    if (target->GetTypeId() != TYPEID_UNIT)
        return;

    if (Creature* bomb = target->FindNearestCreature(NPC_KINETIC_BOMB, 0.1f, true))
    {
        bomb->CastSpell(bomb, SPELL_KINETIC_BOMB_EXPLOSION, true);
        bomb->RemoveAurasDueToSpell(SPELL_KINETIC_BOMB_VISUAL);
        target->RemoveAura(GetAura());
        bomb->AI()->DoAction(SPELL_KINETIC_BOMB_EXPLOSION);
    }
}
开发者ID:Allowed,项目名称:Strawberry335,代码行数:14,代码来源:Spell_KineticBomb.cpp

示例14: HandlePeriodicTick

            void HandlePeriodicTick(constAuraEffectPtr /*aurEff*/)
            {
                if (!GetUnitOwner())
                    return;

                if (AuraEffectPtr aurEff = GetAura()->GetEffect(EFFECT_0))
                {
                    int32 oldamount = GetUnitOwner()->GetPower(POWER_ALTERNATE_POWER);
                    int32 newamount = oldamount + 5;
                    if (newamount > 100)
                        newamount = 100;
                    if (newamount == oldamount)
                        return;

                    if (oldamount < 100 && newamount == 100)
                    {
                        GetUnitOwner()->RemoveAura(SPELL_EPIC_CONCENTRATION);
                        GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_LEGENDARY_CONCENTRATION, true);
                    }
                    else if (oldamount < 75 && newamount >= 75)
                    {
                        GetUnitOwner()->RemoveAura(SPELL_RARE_CONCENTRATION);
                        GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_EPIC_CONCENTRATION, true);
                    }
                    else if (oldamount < 50 && newamount >= 50)
                    {
                        GetUnitOwner()->RemoveAura(SPELL_UNCOMMON_CONCENTRATION);
                        GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_RARE_CONCENTRATION, true);
                    }
                    else if (oldamount < 25 && newamount >= 25)
                    {
                        GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_UNCOMMON_CONCENTRATION, true);
                    }
                    else if (newamount < 25)
                    {
                        GetUnitOwner()->RemoveAura(SPELL_LEGENDARY_CONCENTRATION);
                        GetUnitOwner()->RemoveAura(SPELL_EPIC_CONCENTRATION);
                        GetUnitOwner()->RemoveAura(SPELL_RARE_CONCENTRATION);
                        GetUnitOwner()->RemoveAura(SPELL_UNCOMMON_CONCENTRATION);
                    }
                    GetUnitOwner()->SetPower(POWER_ALTERNATE_POWER, newamount);
                }
            }
开发者ID:UnstableZero,项目名称:AnotherMoPCore,代码行数:43,代码来源:boss_majordomo_staghelm.cpp

示例15: SetFloatValue

void Player::UpdateMastery()
{
    if (!IsMasteryLearned())
    {
        SetFloatValue(PLAYER_MASTERY, 0.0f);
        return;
    }

    TalentTabEntry const* talentTab = sTalentTabStore.LookupEntry(GetPrimaryTalentTree(GetActiveSpec()));
    if (!talentTab)
    {
        SetFloatValue(PLAYER_MASTERY, 0.0f);
        return;
    }

    float value = GetTotalAuraModifier(SPELL_AURA_MASTERY);
    value += GetRatingBonusValue(CR_MASTERY);
    SetFloatValue(PLAYER_MASTERY, value);

    for (uint32 i = 0; i < MAX_MASTERY_SPELLS; ++i)
    {
        if (!talentTab->MasterySpells[i])
            continue;

        if (Aura* aura = GetAura(talentTab->MasterySpells[i]))
        {
            for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
            {
                if (!aura->HasEffect(j))
                    continue;

                if (aura->GetSpellInfo()->Effects[j].BasePoints == 0)
                    aura->GetEffect(j)->ChangeAmount(int32(value * aura->GetSpellInfo()->Effects[j].BonusMultiplier));
            }
        }
    }
}
开发者ID:xIchigox,项目名称:SoDCore.434,代码行数:37,代码来源:StatSystem.cpp


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