本文整理汇总了C++中GetSpellInfo函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSpellInfo函数的具体用法?C++ GetSpellInfo怎么用?C++ GetSpellInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetSpellInfo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
bool Load()
{
healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
return true;
}
示例2: Load
bool Load()
{
// Max absorb stored in 1 dummy effect
limit = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
return true;
}
示例3: HandleDummyLaunch
void HandleDummyLaunch(SpellEffIndex /*effIndex*/)
{
sLog->outString("Spell %u with SPELL_EFFECT_DUMMY is just launched!", GetSpellInfo()->Id);
}
示例4: HandleDummyHit
void HandleDummyHit(SpellEffIndex /*effIndex*/)
{
sLog->outString("Spell %u with SPELL_EFFECT_DUMMY has hit!", GetSpellInfo()->Id);
}
示例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));
}
}
}
示例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));
}
}
示例7: CheckCast
SpellCastResult CheckCast()
{
if (int32(GetCaster()->GetHealth()) > int32(GetCaster()->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue())))
return SPELL_CAST_OK;
return SPELL_FAILED_FIZZLE;
}
示例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());
}
示例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())));
}
示例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;
}
示例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);
}
示例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;
}
}
}
示例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);
}
}
}
示例14: Load
bool Load() override
{
absorbChance = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER;
}
示例15: Load
bool Load()
{
chance = GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster());
return true;
}