本文整理汇总了C++中GetOriginalCaster函数的典型用法代码示例。如果您正苦于以下问题:C++ GetOriginalCaster函数的具体用法?C++ GetOriginalCaster怎么用?C++ GetOriginalCaster使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetOriginalCaster函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleSummon
void HandleSummon(SpellEffIndex effIndex)
{
PreventHitEffect(effIndex);
uint32 entry = GetSpellInfo()->Effects[effIndex].MiscValue;
SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(GetSpellInfo()->Effects[effIndex].MiscValueB);
int32 duration = GetSpellInfo()->GetDuration();
if (!GetOriginalCaster() || !properties)
return;
if (TempSummon* summon = GetCaster()->GetMap()->SummonCreature(entry, *GetHitDest(), properties, duration, GetOriginalCaster(), GetSpellInfo()->Id))
{
summon->SetCreatorGUID(GetOriginalCaster()->GetGUID());
summon->HandleSpellClick(GetCaster());
}
}
示例2: HandleDummy
void HandleDummy(SpellEffIndex effIndex)
{
Unit* caster = GetCaster();
if (Unit* target = GetHitUnit())
{
SpellInfo const* spellInfo = GetSpellInfo();
int32 rageUsed = std::min<int32>(300 - spellInfo->CalcPowerCost(caster, SpellSchoolMask(spellInfo->SchoolMask)), caster->GetPower(POWER_RAGE));
int32 newRage = std::max<int32>(0, caster->GetPower(POWER_RAGE) - rageUsed);
// Sudden Death rage save
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_GENERIC, ICON_ID_SUDDEN_DEATH, EFFECT_0))
{
int32 ragesave = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue() * 10;
newRage = std::max(newRage, ragesave);
}
caster->SetPower(POWER_RAGE, uint32(newRage));
// Glyph of Execution bonus
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_GLYPH_OF_EXECUTION, EFFECT_0))
rageUsed += aurEff->GetAmount() * 10;
int32 bp = GetEffectValue() + int32(rageUsed * spellInfo->Effects[effIndex].DamageMultiplier + caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.2f);
caster->CastCustomSpell(target,SPELL_EXECUTE,&bp,0,0,true,0,0,GetOriginalCaster()->GetGUID());
}
}
示例3: HandleDummy
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if(GetHitCreature())
{
GetOriginalCaster()->GetVehicleKit()->GetPassenger(0)->ToPlayer()->KilledMonsterCredit(NPC_WYRMREST_TEMPLE_CREDIT, 0);
}
}
示例4: CheckDistance
void CheckDistance()
{
if (Unit* caster = GetOriginalCaster())
{
if (Unit* target = GetHitUnit())
target->CastSpell(caster, SPELL_SIPHONED_MIGHT, true);
}
}
示例5: HandleHeal
void HandleHeal(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetOriginalCaster())
if (GetHitUnit()->GetGUID() == caster->GetGUID())
{
int32 heal = GetHitHeal() / 2.0f;
SetHitHeal(heal);
}
}
示例6: CheckDistance
void CheckDistance()
{
if (Unit* caster = GetOriginalCaster())
if (Unit* target = GetHitUnit())
if (target == GetCaster()
// the spell has an unlimited range, so we need this check
&& target->GetDistance2d(caster) <= 12.0f)
target->CastSpell(caster, SPELL_SIPHONED_MIGHT, true);
}
示例7: FilterTargets
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.clear();
Unit* target = GetOriginalCaster();
if (!target)
return;
targets.push_back(target);
}
示例8: Hit
void Hit()
{
if (!GetHitUnit())
return;
if (!GetCaster())
return;
if (!GetOriginalCaster())
return;
if (Aura* debuff = GetOriginalCaster()->AddAura(89421, GetHitUnit()))
{
if (!GetSpellValue())
return;
int32 duration = GetSpellValue()->EffectBasePoints[1];
debuff->SetDuration(duration, false);
}
}
示例9: HandleHeal
void HandleHeal(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetOriginalCaster())
{
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_PRIEST_T9_HEALING_2P, EFFECT_0))
{
int32 heal = GetHitHeal();
AddPct(heal, aurEff->GetAmount());
SetHitHeal(heal);
}
}
}
示例10: SelectTargets
void SelectTargets(std::list<WorldObject*>& targets)
{
targets.remove_if([](WorldObject* target)
{
return !target->ToUnit() || target->ToUnit()->IsFullHealth();
});
Trinity::Containers::RandomResize(targets, 1);
if (targets.empty())
targets.push_back(GetOriginalCaster());
}
示例11: HandleHeal
void HandleHeal(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetOriginalCaster())
{
if (Aura* aur = caster->GetAura(SPELL_T9_HEALING_2_PIECE))
{
int32 heal = GetHitHeal();
AddPctN(heal, aur->GetSpellInfo()->Effects[0].CalcValue());
SetHitHeal(heal);
}
}
}
示例12: HandleAchievementCredit
void HandleAchievementCredit(SpellEffIndex /*effIndex*/)
{
uint32 _creditSpell = 0;
Unit* caster = GetOriginalCaster();
if (!caster)
return;
if (GetSpellInfo()->Id == SPELL_SEAFORIUM_BLAST)
_creditSpell = SPELL_A_BOMB_INABLE_CREDIT;
else if (GetSpellInfo()->Id == SPELL_HUGE_SEAFORIUM_BLAST)
_creditSpell = SPELL_A_BOMB_INATION_CREDIT;
if (GetHitGObj() && GetHitGObj()->IsDestructibleBuilding())
caster->CastSpell(caster, _creditSpell, true);
}
示例13: HandleScript
void HandleScript(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
Unit* target = GetHitUnit();
Unit* caster = GetOriginalCaster();
if (target && caster && caster->GetMap())
{
for (uint32 i = 0; i < 3; ++i)
{
caster->CastSpell(target, 58689, true);
caster->CastSpell(target, 58692, true);
}
caster->CastSpell(target, caster->GetMap()->Is25ManRaid() ? 60883 : 58695, true);
}
}
示例14: HandleDamage
void HandleDamage(SpellEffIndex /*effIndex*/)
{
if (!GetTriggeringSpell())
return;
Unit* target = GetHitUnit();
Unit* caster = GetOriginalCaster();
if (target->HasAura(GetTriggeringSpell()->Id))
SetHitDamage(0);
else
{
if (target->GetTypeId() == TYPEID_PLAYER && caster->IsAIEnabled)
caster->ToCreature()->AI()->SetData(DATA_POLARITY_SWITCH, 1);
}
}
示例15: HandleDummy
void HandleDummy(SpellEffIndex /* effIndex */)
{
if (Unit* caster = GetOriginalCaster())
if (Unit* target = GetHitUnit())
{
if (!target->isAlive() || !_targetCount)
return;
int32 damage = 10000 / _targetCount;
SpellNonMeleeDamage damageInfo(caster, target, GetSpellInfo()->Id, GetSpellInfo()->SchoolMask);
damageInfo.damage = damage;
caster->CalcAbsorbResist(target, GetSpellInfo()->GetSchoolMask(), DOT, damage, &damageInfo.absorb, &damageInfo.resist, GetSpellInfo());
caster->DealDamageMods(target, damageInfo.damage, &damageInfo.absorb);
caster->SendSpellNonMeleeDamageLog(&damageInfo);
caster->DealSpellDamage(&damageInfo, false);
}
}