本文整理汇总了C++中SpellAuraHolder::GetCasterGuid方法的典型用法代码示例。如果您正苦于以下问题:C++ SpellAuraHolder::GetCasterGuid方法的具体用法?C++ SpellAuraHolder::GetCasterGuid怎么用?C++ SpellAuraHolder::GetCasterGuid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpellAuraHolder
的用法示例。
在下文中一共展示了SpellAuraHolder::GetCasterGuid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleCancelAuraOpcode
void WorldSession::HandleCancelAuraOpcode(WorldPacket& recvPacket)
{
uint32 spellId;
recvPacket >> spellId;
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId);
if (!spellInfo)
return;
if (spellInfo->HasAttribute(SPELL_ATTR_CANT_CANCEL))
return;
if (IsPassiveSpell(spellInfo))
return;
if (!IsPositiveSpell(spellId))
{
// ignore for remote control state
if (!_player->IsSelfMover())
{
// except own aura spells
bool allow = false;
for (int k = 0; k < MAX_EFFECT_INDEX; ++k)
{
SpellEffectEntry const* spellEffect = spellInfo->GetSpellEffect(SpellEffectIndex(k));
if (spellEffect && (spellEffect->EffectApplyAuraName == SPELL_AURA_MOD_POSSESS ||
spellEffect->EffectApplyAuraName == SPELL_AURA_MOD_POSSESS_PET))
{
allow = true;
break;
}
}
// this also include case when aura not found
if (!allow)
return;
}
else
return;
}
// channeled spell case (it currently casted then)
if (IsChanneledSpell(spellInfo))
{
if (Spell* curSpell = _player->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
if (curSpell->m_spellInfo->Id == spellId)
_player->InterruptSpell(CURRENT_CHANNELED_SPELL);
return;
}
SpellAuraHolder* holder = _player->GetSpellAuraHolder(spellId);
// not own area auras can't be cancelled (note: maybe need to check for aura on holder and not general on spell)
if (holder && holder->GetCasterGuid() != _player->GetObjectGuid() && HasAreaAuraEffect(holder->GetSpellProto()))
return;
// non channeled case
_player->RemoveAurasDueToSpellByCancel(spellId);
}