本文整理汇总了C++中Aura::GetUnitCaster方法的典型用法代码示例。如果您正苦于以下问题:C++ Aura::GetUnitCaster方法的具体用法?C++ Aura::GetUnitCaster怎么用?C++ Aura::GetUnitCaster使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aura
的用法示例。
在下文中一共展示了Aura::GetUnitCaster方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AIUpdate
void AIUpdate()
{
// Let's see if we are netted
Aura* a = _unit->getAuraWithId(51959);
if(a != NULL)
{
Unit* Caster = a->GetUnitCaster();
if (Caster == nullptr)
return;
if(Caster->IsPlayer())
{
QuestLogEntry* qle = static_cast<Player*>(Caster)->GetQuestLogForEntry(12532);
if(qle == NULL)
qle = static_cast<Player*>(Caster)->GetQuestLogForEntry(12702);
if(qle != NULL)
{
// casting the spell that will create the item for the player
_unit->CastSpell(Caster, 51037, true);
_unit->Despawn(1000, 360000);
}
}
}
}
示例2: MassDispel
void AuraInterface::MassDispel(Unit* caster, uint32 index, SpellEntry* Dispelling, uint32 MaxDispel, uint8 start, uint8 end)
{
WorldPacket data(SMSG_SPELLDISPELLOG, 16);
Aura* aur = NULL;
for(uint32 x = start; x < end; x++)
{
if(m_auras.find(x) != m_auras.end())
{
aur = m_auras.at(x);
//Nothing can dispel resurrection sickness;
if(aur != NULL && !aur->IsPassive() && !(aur->GetSpellProto()->Attributes & ATTRIBUTES_IGNORE_INVULNERABILITY))
{
int32 resistchance = 0;
Unit* caster = aur->GetUnitCaster();
if( caster )
SM_FIValue(caster->SM[SMT_RESIST_DISPEL][0], &resistchance, aur->GetSpellProto()->SpellGroupType);
if( !Rand(resistchance) )
{
if(Dispelling->DispelType == DISPEL_ALL)
{
m_Unit->HandleProc( PROC_ON_DISPEL_AURA_VICTIM, NULL, caster, Dispelling, aur->GetSpellId() );
data.clear();
data << caster->GetNewGUID();
data << m_Unit->GetNewGUID();
data << (uint32)1;//probably dispel type
data << aur->GetSpellId();
caster->SendMessageToSet(&data,true);
aur->AttemptDispel( caster );
if(!--MaxDispel)
return;
}
else if(aur->GetSpellProto()->DispelType == Dispelling->EffectMiscValue[index])
{
if( (aur->GetSpellProto()->NameHash != SPELL_HASH_ICE_BARRIER &&
aur->GetSpellProto()->NameHash != SPELL_HASH_DIVINE_SHIELD)
|| Dispelling->NameHash == SPELL_HASH_MASS_DISPEL )
{
m_Unit->HandleProc( PROC_ON_DISPEL_AURA_VICTIM, NULL, caster, Dispelling, aur->GetSpellId() );
data.clear();
data << caster->GetNewGUID();
data << m_Unit->GetNewGUID();
data << (uint32)1;
data << aur->GetSpellId();
caster->SendMessageToSet(&data,true);
aur->AttemptDispel( caster );
if(!--MaxDispel)
return;
}
}
}
else if( !--MaxDispel )
return;
}
}
}
}
示例3: BuildAuraUpdateAllPacket
bool AuraInterface::BuildAuraUpdateAllPacket(WorldPacket* data)
{
if(!m_auras.size())
return false;
bool res = false;
Aura* aur = NULL;
for (uint32 i=0; i<MAX_AURAS; i++)
{
if(m_auras.find(i) != m_auras.end())
{
res = true;
aur = m_auras.at(i);
aur->BuildAuraUpdate();
uint8 flags = aur->GetAuraFlags();
*data << uint8(aur->m_auraSlot);
int32 stack = aur->stackSize;
if(aur->procCharges > stack && stack != 0)
stack = aur->procCharges;
if(stack < 0)
{
*data << uint32(0);
continue;
}
*data << uint32(aur->GetSpellId());
*data << uint8(flags);
*data << uint8(aur->GetUnitCaster() ? aur->GetUnitCaster()->getLevel() : 0);
*data << uint8(stack);
if(!(flags & AFLAG_NOT_GUID))
FastGUIDPack(*data, aur->GetCasterGUID());
if(flags & AFLAG_HAS_DURATION)
{
*data << aur->GetDuration();
*data << aur->GetTimeLeft();
}
}
}
return res;
}
示例4: SpellTargetDummyTarget
/// Spell Target Handling for type 38: Dummy Target (Server-side script effect)
void Spell::SpellTargetDummyTarget(uint32 i, uint32 j)
{
//TargetsList *tmpMap=&m_targetUnits[i];
if( m_spellInfo->Id == 51699 )
{
if( p_caster )
{
Aura* aur = p_caster->FindAura( 52916 );
if( aur && aur->GetUnitCaster() )
{
_AddTargetForced(aur->GetUnitCaster()->GetGUID(), i);
return;
}
}
}
else if( m_spellInfo->Id == 12938 )
{
//FIXME:this ll be immortal targets
FillAllTargetsInArea(i,m_targets.m_destX,m_targets.m_destY,m_targets.m_destZ,GetDBCCastTime(i));
}
_AddTargetForced(m_caster->GetGUID(), i);
}
示例5: AIUpdate
void AIUpdate()
{
// Let's see if we are netted
Aura* a = _unit->FindAura(38177);
if(a != NULL)
{
Unit* Caster = a->GetUnitCaster();
if(Caster->IsPlayer())
{
QuestLogEntry* qle = TO_PLAYER(Caster)->GetQuestLogForEntry(10747);
if(qle != NULL)
{
// casting the spell that will create the item for the player
_unit->CastSpell(Caster, 38178, true);
_unit->Despawn(1000, 360000);
}
}
}
}