本文整理汇总了C++中GetStackAmount函数的典型用法代码示例。如果您正苦于以下问题:C++ GetStackAmount函数的具体用法?C++ GetStackAmount怎么用?C++ GetStackAmount使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetStackAmount函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
}
示例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());
}
示例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;
}
}
}
}
}
}
}
示例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());
}
示例5: OnApply
void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (GetStackAmount() == 5)
{
GetTarget()->CastSpell(GetTarget(), SPELL_HUNTER_FIRE, true, NULL, aurEff);
GetTarget()->RemoveAura(GetId());
}
}
示例6: HandlePeriodic
void HandlePeriodic(AuraEffect const* aurEff)
{
PreventDefaultAction();
if (GetStackAmount() >= 5)
{
SetDuration(0);
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SNAKE_WRAP, true);
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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();
}
}
示例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);
}
示例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);
}
}
示例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();
}
}
示例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;
}
}