• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetStackAmount函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: OnApply

 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
 {
     if (Unit* caster = GetCaster())
     {
         int32 damage;
         switch (GetStackAmount())
         {
             case 1:
                 damage = 0;
                 break;
             case 2:
                 damage = 500;
                 break;
             case 3:
                 damage = 1000;
                 break;
             case 4:
                 damage = 1500;
                 break;
             case 5:
                 damage = 4000;
                 break;
             case 6:
                 damage = 12000;
                 break;
             default:
                 damage = 20000 + 1000 * (GetStackAmount() - 7);
                 break;
         }
         if (damage)
             caster->CastCustomSpell(SPELL_MARK_DAMAGE, SPELLVALUE_BASE_POINT0, damage, GetTarget());
     }
 }
开发者ID:AllThing,项目名称:TrinityCore,代码行数:33,代码来源:boss_four_horsemen.cpp


示例2: ExtraEffect

 void ExtraEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
 {
     GetTarget()->CastSpell(GetTarget(), SPELL_INOCULATED, true);
     if (InstanceScript* instance = GetTarget()->GetInstanceScript())
         if (Creature* festergut = ObjectAccessor::GetCreature(*GetTarget(), instance->GetData64(DATA_FESTERGUT)))
             festergut->AI()->SetData(DATA_INOCULATED_STACK, GetStackAmount());
 }
开发者ID:Carbinfibre,项目名称:Script-Land,代码行数:7,代码来源:boss_festergut.cpp


示例3: OnUpdate

		void OnUpdate(uint32 diff, AuraEffectPtr aurEff)
		{
			if (GetCaster())
			{
				if (GetCaster()->HasAura(EYE_OF_THE_EMPRESS))
				{
					if (GetStackAmount() >= 5)
					{
						GetCaster()->RemoveAura(EYE_OF_THE_EMPRESS);
						// transform
						GetCaster()->AddAura(TRANSFORM_AURA, GetCaster());

						if (Creature* boss = GetCaster()->FindNearestCreature(62837, 100.0f, true))
						{
							if (boss_empress_shekzeer::boss_empress_shekzeerAI* linkAI = CAST_AI(boss_empress_shekzeer::boss_empress_shekzeerAI, boss->GetAI()))
							{
								if (!linkAI->SayCharmed)
								{
									linkAI->SayCharmed = true;
								}
							}
						}
					}
				}
			}
		}
开发者ID:Exodius,项目名称:JadeCore548,代码行数:26,代码来源:Grand_Empress_Shekzeer.cpp


示例4: AfterRemove

            void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
            {
                // Final heal only on duration end
                if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
                    return;

                // final heal
                int32 stack = GetStackAmount();
                int32 healAmount = aurEff->GetAmount();
                if (Unit* caster = GetCaster())
                {
                    healAmount = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), healAmount, HEAL, aurEff->GetSpellEffectInfo(), stack);
                    healAmount = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, aurEff->GetSpellEffectInfo(), stack);

                    GetTarget()->CastCustomSpell(GetTarget(), SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());

                    // restore mana
                    std::vector<SpellInfo::CostData> costs = GetSpellInfo()->CalcPowerCost(caster, GetSpellInfo()->GetSchoolMask());
                    auto m = std::find_if(costs.begin(), costs.end(), [](SpellInfo::CostData const& cost) { return cost.Power == POWER_MANA; });
                    if (m != costs.end())
                    {
                        int32 returnMana = m->Amount * stack / 2;
                        caster->CastCustomSpell(caster, SPELL_DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
                    }
                    return;
                }

                GetTarget()->CastCustomSpell(GetTarget(), SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
            }
开发者ID:beyourself,项目名称:DeathCore_6.x,代码行数:29,代码来源:spell_druid.cpp


示例5: OnApply

 void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
 {
     if (GetStackAmount() == 5)
     {
         GetTarget()->CastSpell(GetTarget(), SPELL_HUNTER_FIRE, true, NULL, aurEff);
         GetTarget()->RemoveAura(GetId());
     }
 }
开发者ID:Abrek,项目名称:My-WoDCore-6.x.x,代码行数:8,代码来源:spell_hunter.cpp


示例6: HandlePeriodic

 void HandlePeriodic(AuraEffect const* aurEff)
 {
     PreventDefaultAction();
     if (GetStackAmount() >= 5)
     {
         SetDuration(0);
         GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SNAKE_WRAP, true);
     }
 }
开发者ID:boom8866,项目名称:azerothcore-wotlk,代码行数:9,代码来源:boss_slad_ran.cpp


示例7: HandleRemove

 void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes mode)
 {
     PreventDefaultAction();
     Aura* aura = aurEff->GetBase();
     if (aura->GetStackAmount() == 1)
         aura->Remove(AURA_REMOVE_BY_DEFAULT);
     else
         aura->SetStackAmount(GetStackAmount() - 1);
 }
开发者ID:update88,项目名称:loa,代码行数:9,代码来源:spell_rogue.cpp


示例8: HandleAfterEffectApply

				void HandleAfterEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
				 {
				Unit* target = GetTarget();
				if (target->GetTypeId() == TYPEID_PLAYER)
					 if (GetStackAmount() == GetSpellInfo()->StackAmount)
					 {
					Remove();
					target->CastSpell(target, SPELL_WORGENS_CALL, true);
					}
				}
开发者ID:ter884,项目名称:TER-Server,代码行数:10,代码来源:zone_grizzly_hills.cpp


示例9: HandlePeriodicTick

 void HandlePeriodicTick(AuraEffect const* /*aurEff*/)
 {
     if (GetStackAmount() < 2)
         return;
     Unit* caster = GetCaster();
     /// @todo the caster should be boss but not the player
     if (!caster || !caster->GetAI())
         return;
     caster->GetAI()->SetGUID(GetTarget()->GetGUID(), DATA_INTENSE_COLD);
 }
开发者ID:Carbenium,项目名称:TrinityCore,代码行数:10,代码来源:boss_keristrasza.cpp


示例10: HandleEffectApply

 void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
 {
     if (Unit* caster = GetCaster())
     {
         int32 mana = int32(aurEff->GetAmount() * std::pow(2.0f, GetStackAmount())); // mana restore - bp * 2^stackamount
         int32 damage = mana * 2;
         caster->CastCustomSpell(GetTarget(), SPELL_SARONITE_VAPORS_ENERGIZE, &mana, NULL, NULL, true);
         caster->CastCustomSpell(GetTarget(), SPELL_SARONITE_VAPORS_DAMAGE, &damage, NULL, NULL, true);
     }
 }
开发者ID:blitztech,项目名称:TrinityCore,代码行数:10,代码来源:boss_general_vezax.cpp


示例11: OnStackChange

 void OnStackChange(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
 {
     if (GetStackAmount() == 15)
     {
         Unit* target = GetTarget(); // store target because aura gets removed
         target->CastSpell(target, SPELL_EXPLOSIVE_BARRAGE_DAMAGE, false);
         target->RemoveAurasDueToSpell(SPELL_HASTY_GROW);
         target->RemoveAurasDueToSpell(SPELL_AUTO_GROW);
         target->RemoveAurasDueToSpell(SPELL_EXPLODING_ORB);
         if (Creature* creature = target->ToCreature())
             creature->DespawnOrUnsummon();
     }
 }
开发者ID:heros,项目名称:LasCore,代码行数:13,代码来源:boss_krickandick.cpp


示例12: HandleEffectPeriodic

        void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
        {
            Unit* caster = GetCaster();
            if (!caster)
                return;

            int32 damage = int32(200 * std::pow(2.0f, GetStackAmount()));
            CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
            args.AddSpellBP0(damage);
            caster->CastSpell(caster, SPELL_BITING_COLD_DAMAGE, args);

            if (caster->isMoving())
                caster->RemoveAuraFromStack(SPELL_BITING_COLD_TRIGGERED);
        }
开发者ID:lasyan3,项目名称:TrinityCore,代码行数:14,代码来源:boss_hodir.cpp


示例13: OnApply

            void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
            {
                Unit* target = GetTarget();

                if (GetStackAmount() == 101)
                {
                    target->RemoveAura(SPELL_RAM_LEVEL_NEUTRAL);
                    target->RemoveAura(SPELL_RAM_TROT);
                    target->RemoveAura(SPELL_RAM_CANTER);
                    target->RemoveAura(SPELL_RAM_GALLOP);
                    target->RemoveAura(SPELL_GIDDYUP);

                    target->CastSpell(target, SPELL_EXHAUSTED_RAM, true);
                }
            }
开发者ID:Brokentrojan,项目名称:ngen,代码行数:15,代码来源:spell_holiday.cpp


示例14: HandleEffectApply

            void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
            {
                Player* player = GetTarget()->ToPlayer();
                if (!player)
                    return;

                if ((player->HasAura(SPELL_TORCH_TOSSING_TRAINING) && GetStackAmount() == 8) || (player->HasAura(SPELL_TORCH_TOSSING_PRACTICE) && GetStackAmount() == 20))
                {
                    if (player->GetTeam() == ALLIANCE)
                        player->CastSpell(player, SPELL_TORCH_TOSSING_TRAINING_SUCCESS_ALLIANCE, true);
                    else if (player->GetTeam() == HORDE)
                        player->CastSpell(player, SPELL_TORCH_TOSSING_TRAINING_SUCCESS_HORDE, true);
                    Remove();
                }
            }
开发者ID:AwkwardDev,项目名称:RE,代码行数:15,代码来源:spell_holiday.cpp


示例15: OnStackChange

 void OnStackChange(AuraEffect const* /*aurEff*/, AuraApplication const* aurApp, AuraEffectHandleModes /*mode*/)
 {
     Unit* target = aurApp->GetTarget();
     if (!target)
         return;
     switch (GetStackAmount())
     {
         case 1:
             target->CastSpell(target, SPELL_SHADOWMOURNE_VISUAL_LOW, true);
             break;
         case 6:
             target->RemoveAurasDueToSpell(SPELL_SHADOWMOURNE_VISUAL_LOW);
             target->CastSpell(target, SPELL_SHADOWMOURNE_VISUAL_HIGH, true);
             break;
         case 10:
             target->RemoveAurasDueToSpell(SPELL_SHADOWMOURNE_VISUAL_HIGH);
             target->CastSpell(target, SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF, true);
             break;
     }
 }
开发者ID:Bootz,项目名称:S6.RO.WoW,代码行数:20,代码来源:spell_item.cpp


示例16: OnChange

            void OnChange(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
            {
                Unit* target = GetTarget();
                if (!target->HasAura(SPELL_RENTAL_RACING_RAM))
                {
                    target->RemoveAura(GetId());
                    return;
                }

                if (target->HasAura(SPELL_EXHAUSTED_RAM))
                    return;

                switch (GetStackAmount())
                {
                    case 1: // green
                        target->RemoveAura(SPELL_RAM_LEVEL_NEUTRAL);
                        target->RemoveAura(SPELL_RAM_CANTER);
                        target->CastSpell(target, SPELL_RAM_TROT, true);
                        break;
                    case 6: // yellow
                        target->RemoveAura(SPELL_RAM_TROT);
                        target->RemoveAura(SPELL_RAM_GALLOP);
                        target->CastSpell(target, SPELL_RAM_CANTER, true);
                        break;
                    case 11: // red
                        target->RemoveAura(SPELL_RAM_CANTER);
                        target->CastSpell(target, SPELL_RAM_GALLOP, true);
                        break;
                    default:
                        break;
                }

                if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEFAULT)
                {
                    target->RemoveAura(SPELL_RAM_TROT);
                    target->CastSpell(target, SPELL_RAM_LEVEL_NEUTRAL, true);
                }
            }
开发者ID:Brokentrojan,项目名称:ngen,代码行数:38,代码来源:spell_holiday.cpp


示例17: AfterRemove

            void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
            {
                // Final heal only on duration end
                if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
                    return;

                // final heal
                int32 stack = GetStackAmount();
                int32 healAmount = aurEff->GetAmount();
                if (Unit* caster = GetCaster())
                {
                    healAmount = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), healAmount, HEAL, stack);
                    healAmount = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, stack);

                    GetTarget()->CastCustomSpell(GetTarget(), SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());

                    // restore mana
                    int32 returnMana = CalculatePct(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2;
                    caster->CastCustomSpell(caster, SPELL_DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
                    return;
                }

                GetTarget()->CastCustomSpell(GetTarget(), SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
            }
开发者ID:Hlkz2,项目名称:ACoreOld,代码行数:24,代码来源:spell_druid.cpp


示例18: HandleEffectApply

		void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
		{
			if (GetStackAmount() == GetSpellInfo()->StackAmount)
				GetTarget()->CastSpell(GetTarget(), 93683, true);
		}
开发者ID:Tithand,项目名称:TER-Server,代码行数:5,代码来源:spell_priest.cpp


示例19: HandleProc

    void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
    {
        PreventDefaultAction();
        Unit* healer = eventInfo.GetProcTarget();
        if (healer->HasAura(SPELL_VITAL_FLAME))
            return;

        bool is25ManHeroic = healer->GetMap()->IsHeroic() && healer->GetMap()->Is25ManRaid();
        uint32 stacks = healer->GetAuraCount(SPELL_VITAL_SPARK) + std::min(uint8(ceil(GetStackAmount() / (is25ManHeroic ? 5.0 : 3.0))), uint8(255));

        healer->SetAuraStack(SPELL_VITAL_SPARK, healer, stacks);
        if (Aura* aura = healer->GetAura(SPELL_VITAL_SPARK))
            aura->RefreshDuration();
    }
开发者ID:Carbenium,项目名称:TrinityCore,代码行数:14,代码来源:boss_baleroc.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetStartAddr函数代码示例发布时间:2022-05-30
下一篇:
C++ GetSquared函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap