本文整理汇总了C++中GetSpellProto函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSpellProto函数的具体用法?C++ GetSpellProto怎么用?C++ GetSpellProto使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetSpellProto函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
bool Load() {
absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(),
EFFECT_0, GetCaster());
hpPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(),
EFFECT_1, GetCaster());
return true;
}
示例2: Load
bool Load() {
healPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(),
EFFECT_1);
absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(),
EFFECT_0);
return GetUnitOwner()->ToPlayer();
}
示例3: Load
bool Load ()
{
absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster());
if (GetCaster()->HasSpell(49224))
absorbPct += 8;
if (GetCaster()->HasSpell(49610))
absorbPct += 16;
if (GetCaster()->HasSpell(49611))
absorbPct += 25;
hpPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1, GetCaster());
return true;
}
示例4: PeriodicTick
void PeriodicTick(AuraEffect const* /*aurEff*/)
{
PreventDefaultAction();
uint32 triggerSpellId = GetSpellProto()->EffectTriggerSpell[0];
if (Unit* caster = GetCaster())
caster->CastCustomSpell(triggerSpellId, SPELLVALUE_MAX_TARGETS, irand(1, 2), caster, true);
}
示例5: CalcAbsorbAmount
int32 CalcAbsorbAmount()
{
Player* caster = GetPlayerCaster();
if(caster != NULL)
return caster->GetMaxHealth() * (GetSpellProto()->EffectBasePoints[1] + 1) / 100;
else
return mod->m_amount;
}
示例6: HandleTriggerSpell
void HandleTriggerSpell(AuraEffect const* aurEff)
{
PreventDefaultAction();
Unit* target = GetTarget();
uint32 triggerSpellId = GetSpellProto()->EffectTriggerSpell[aurEff->GetEffIndex()];
target->CastSpell(target, triggerSpellId, true);
if (Unit* caster = GetCaster())
if (target->GetDistance(caster) <= 12.0f)
target->CastSpell(caster, SPELL_SIPHONED_MIGHT, true);
}
示例7: AbsorbDamage
uint32 AbsorbDamage(uint32 School, uint32* dmg)
{
// Checking for 1 min cooldown
if(dSpell == NULL || ! p_target->Cooldown_CanCast(dSpell))
return 0;
// Check for proc chance
if(RandomFloat(100.0f) > GetSpellProto()->EffectBasePoints[0] + 1)
return 0;
// Check if damage will kill player.
uint32 cur_hlth = p_target->GetHealth();
if((*dmg) < cur_hlth)
return 0;
uint32 max_hlth = p_target->GetMaxHealth();
uint32 min_hlth = max_hlth / 10;
/*
looks like the following lines are not so good, we check and cast on spell id 31231_
and adding the cooldown to it, but it looks like this spell is useless(all it's doing is_
casting 45182, so we can do all this stuff on 45182 at first place), BUT_
as long as proceeding cheat death is not so height (how many rogue at the same time_
gonna get to this point?) so it's better to use it because we wont lose anything!!
*/
p_target->CastSpell(p_target->GetGUID(), dSpell, true);
// set dummy effect,
// this spell is used to procced the post effect of cheat death later.
// Move next line to SPELL::SpellEffectDummy ?!! well it's better in case of dbc changing!!
p_target->CastSpell(p_target->GetGUID(), 45182, true);
// Better to add custom cooldown procedure then fucking with entry, or not!!
dSpell->RecoveryTime = 60000;
p_target->Cooldown_Add(dSpell, NULL);
// Calc abs and applying it
uint32 real_dmg = (cur_hlth > min_hlth ? cur_hlth - min_hlth : 0);
uint32 absorbed_dmg = *dmg - real_dmg;
*dmg = real_dmg;
return absorbed_dmg;
}
示例8: AbsorbDamage
uint32 AbsorbDamage(uint32 School, uint32* dmg)
{
Unit* caster = GetUnitCaster();
if(caster == NULL)
return 0;
int health_pct = caster->GetHealthPct();
uint32 cur_health = caster->GetHealth();
uint32 max_health = caster->GetMaxHealth();
uint32 new_health_pct = (cur_health - *dmg) * 100 / max_health;
// "Damage that would take you below $s1% health or taken while you are at $s1% health is reduced by $52284s1%."
if((health_pct > 35 && new_health_pct < 35) || health_pct == 35)
{
uint32 dmg_absorbed = *dmg * (GetSpellProto()->EffectBasePoints[0] + 1) / 100;
*dmg -= dmg_absorbed;
return dmg_absorbed;
}
else
return 0;
}
示例9: Load
bool Load()
{
healPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1);
return true;
}
示例10: Load
bool Load()
{
absorbChance = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0);
return GetUnitOwner()->ToPlayer();
}
示例11: Load
bool Load() {
// Max absorb stored in 1 dummy effect
limit = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(),
EFFECT_1);
return true;
}
示例12: CalcPctDamage
int32 CalcPctDamage()
{
return GetSpellProto()->EffectBasePoints[0] + 1;
}