本文整理汇总了C++中Aura::GetSpellId方法的典型用法代码示例。如果您正苦于以下问题:C++ Aura::GetSpellId方法的具体用法?C++ Aura::GetSpellId怎么用?C++ Aura::GetSpellId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aura
的用法示例。
在下文中一共展示了Aura::GetSpellId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
}
}
}
示例2: SpellStealAuras
void AuraInterface::SpellStealAuras(Unit* caster, int32 MaxSteals)
{
Aura* aur = NULL;
int32 spells_to_steal = MaxSteals > 1 ? MaxSteals : 1;
for(uint32 x = 0; x < MAX_POSITIVE_AURAS; x++)
{
if(m_auras.find(x) != m_auras.end())
{
aur = m_auras.at(x);
if(aur != NULL && aur->GetSpellId() != 15007 && !aur->IsPassive() && aur->IsPositive()) //Nothing can dispel resurrection sickness
{
if(aur->GetSpellProto()->DispelType == DISPEL_MAGIC && aur->GetDuration() > 0)
{
WorldPacket data(SMSG_SPELLDISPELLOG, 16);
data << caster->GetNewGUID();
data << m_Unit->GetNewGUID();
data << uint32(1);
data << aur->GetSpellId();
caster->SendMessageToSet(&data,true);
Aura* aura = new Aura(aur->GetSpellProto(), (aur->GetDuration()>120000) ? 120000 : aur->GetDuration(), caster, caster);
aura->stackSize = aur->stackSize;
// copy the mods across
for( uint32 m = 0; m < aur->GetModCount(); ++m )
{
Modifier *mod = aur->GetMod(m);
aura->AddMod(mod->m_type, mod->m_baseAmount, mod->m_miscValue, mod->i);
}
caster->AddAura(aura);
RemoveAuraBySlot(x);
if( --spells_to_steal <= 0 )
break; //exit loop now
}
}
}
}
}
示例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: AddAura
void AuraInterface::AddAura(Aura* aur)
{
uint32 x,delslot = 0;
Unit* pCaster = NULLUNIT;
if(aur->GetUnitTarget() != NULL)
pCaster = aur->GetUnitCaster();
else if( aur->GetCasterGUID() == m_Unit->GetGUID() )
pCaster = m_Unit;
else if( m_Unit->GetMapMgr() && aur->GetCasterGUID())
pCaster = m_Unit->GetMapMgr()->GetUnit( aur->GetCasterGUID());
if(pCaster == NULL)
return;
if( !aur->IsPassive() )
{
uint32 maxStack = aur->GetSpellProto()->maxstack;
if( m_Unit->IsPlayer() && TO_PLAYER(m_Unit)->stack_cheat )
maxStack = 255;
SpellEntry * info = aur->GetSpellProto();
bool deleteAur = false;
Aura* curAura = NULLAURA;
//check if we already have this aura by this caster -> update duration
// Nasty check for Blood Fury debuff (spell system based on namehashes is bs anyways)
if( !info->always_apply )
{
for( x = 0; x < MAX_AURAS; x++ )
{
if(m_auras.find(x) == m_auras.end())
continue;
curAura = m_auras.at(x);
if( curAura != NULL && !curAura->m_deleted )
{
if( curAura->GetSpellProto()->Id != aur->GetSpellId() &&
( aur->pSpellId != curAura->GetSpellProto()->Id )) //if this is a proc spell then it should not remove it's mother : test with combustion later
{
if( info->buffType > 0 && m_auras.at(x)->GetSpellProto()->buffType > 0 && (info->buffType & m_auras.at(x)->GetSpellProto()->buffType) )
{
if( m_auras.at(x)->GetSpellProto()->buffType & SPELL_TYPE_BLESSING )
{
// stupid blessings
// if you have better idea correct
bool ispair = false;
switch( info->NameHash )
{
case SPELL_HASH_BLESSING_OF_MIGHT:
case SPELL_HASH_GREATER_BLESSING_OF_MIGHT:
{
if( m_auras.at(x)->GetSpellProto()->NameHash == SPELL_HASH_BLESSING_OF_MIGHT ||
m_auras.at(x)->GetSpellProto()->NameHash == SPELL_HASH_GREATER_BLESSING_OF_MIGHT )
ispair = true;
}break;
case SPELL_HASH_BLESSING_OF_WISDOM:
case SPELL_HASH_GREATER_BLESSING_OF_WISDOM:
{
if( m_auras.at(x)->GetSpellProto()->NameHash == SPELL_HASH_BLESSING_OF_WISDOM ||
m_auras.at(x)->GetSpellProto()->NameHash == SPELL_HASH_GREATER_BLESSING_OF_WISDOM )
ispair = true;
}break;
case SPELL_HASH_BLESSING_OF_KINGS:
case SPELL_HASH_GREATER_BLESSING_OF_KINGS:
{
if( m_auras.at(x)->GetSpellProto()->NameHash == SPELL_HASH_BLESSING_OF_KINGS ||
m_auras.at(x)->GetSpellProto()->NameHash == SPELL_HASH_GREATER_BLESSING_OF_KINGS )
ispair = true;
}break;
case SPELL_HASH_BLESSING_OF_SANCTUARY:
case SPELL_HASH_GREATER_BLESSING_OF_SANCTUARY:
{
if( m_auras.at(x)->GetSpellProto()->NameHash == SPELL_HASH_BLESSING_OF_SANCTUARY ||
m_auras.at(x)->GetSpellProto()->NameHash == SPELL_HASH_GREATER_BLESSING_OF_SANCTUARY )
ispair = true;
}break;
}
if( m_auras.at(x)->GetUnitCaster() == aur->GetUnitCaster() || ispair )
{
RemoveAuraBySlot(x);
continue;
}
}
else if( m_auras.at(x)->GetSpellProto()->buffType & SPELL_TYPE_AURA )
{
if( m_auras.at(x)->GetUnitCaster() == aur->GetUnitCaster() || m_auras.at(x)->GetSpellProto()->NameHash == info->NameHash )
{
RemoveAuraBySlot(x);
continue;
}
}
else
{
RemoveAuraBySlot(x);
continue;
}
}
else if( info->poison_type > 0 && m_auras.at(x)->GetSpellProto()->poison_type == info->poison_type )
{
if( m_auras.at(x)->GetSpellProto()->RankNumber < info->RankNumber || maxStack == 0)
//.........这里部分代码省略.........
示例5: SaveAuras
void AuraInterface::SaveAuras(stringstream& ss)
{
for(uint32 x = 0; x < MAX_AURAS; x++) // Crow: Changed to max auras in r1432, since we skip passive auras.
{
if(m_auras.find(x) != m_auras.end())
{
Aura* aur = m_auras.at(x);
// skipped spells due to bugs
switch(aur->m_spellProto->Id)
{
case 642:
case 1020: // Divine Shield
case 11129: // Combustion
case 12043: // Presence of mind
case 16188: // Natures Swiftness
case 17116: // Natures Swiftness
case 23333: // WSG
case 23335: // WSG
case 28682: // Combustion proc
case 31665: // Master of Subtlety (buff)
case 32724: // Gold Team
case 32725: // Green Team
case 32727: // Arena Preparation
case 32728: // Arena Preparation
case 32071: // Hellfire Superority
case 32049: // Hellfire Superority
case 34936: // Backlash
case 35076: // Blessing of A'dal
case 35774: // Gold Team
case 35775: // Green Team
case 44521: // Preparation?
case 44683: // Team A
case 44684: // Team B
case 45438: // Ice Block
case 48418: // Master Shapeshifter Damage (buff)
case 48420: // Master Shapeshifter Critical Strike (buff)
case 48421: // Master Shapeshifter Spell Damage (buff)
case 48422: // Master Shapeshifter Healing (buff)
continue;
break;
}
bool stop = false;
for(uint32 i = 0; i < 3; i++)
{
if(!stop)
{
if((aur->m_spellProto->Effect[i] == SPELL_EFFECT_APPLY_AREA_AURA && aur->GetCasterGUID() != m_Unit->GetGUID()) ||
aur->m_spellProto->Effect[i] == SPELL_EFFECT_APPLY_AURA_128 ||
aur->m_spellProto->Effect[i] == SPELL_EFFECT_ADD_FARSIGHT)
{
stop = true;
break;
}
}
}
if(stop)
continue;
// We are going to cast passive spells anyway on login so no need to save auras for them
if( aur->IsPassive() || aur->m_spellProto->c_is_flags & SPELL_FLAG_IS_EXPIREING_WITH_PET || aur->m_spellProto->AuraInterruptFlags & AURA_INTERRUPT_ON_STAND_UP )
continue; // To prevent food/drink bug
ss << aur->GetSpellId() << "," << aur->GetTimeLeft() << ",";
}
}
}
示例6: JudgementLightWisdomJustice
bool JudgementLightWisdomJustice(uint32 i, Spell* pSpell)
{
Unit* target = pSpell->GetUnitTarget();
if(target == NULL)
return true;
Player* caster = pSpell->p_caster;
if(caster == NULL)
return true;
// Search for a previous judgement casted by this caster. He can have only 1 judgement active at a time
uint32 index = 0;
uint32 judgements[] = { SPELL_HASH_JUDGEMENT_OF_LIGHT, SPELL_HASH_JUDGEMENT_OF_WISDOM, SPELL_HASH_JUDGEMENT_OF_JUSTICE,
SPELL_HASH_JUDGEMENT_OF_VENGEANCE, SPELL_HASH_JUDGEMENT_OF_CORRUPTION, SPELL_HASH_JUDGEMENT_OF_RIGHTEOUSNESS, 0
};
uint64 prev_target = caster->GetCurrentUnitForSingleTargetAura(judgements, &index);
if(prev_target)
{
Unit* t = caster->GetMapMgr()->GetUnit(prev_target);
if(t != NULL)
t->RemoveAllAuraByNameHash(judgements[index]);
caster->RemoveCurrentUnitForSingleTargetAura(judgements[index]);
}
// Search for seal to unleash its energy
uint32 seals[] = { 20375, 20165, 20164, 21084, 31801, 53736, 20166, 0 };
Aura* aura = caster->FindAura(seals);
if(aura == NULL)
return true;
uint32 id = 0;
switch(aura->GetSpellId())
{
case 20375:
id = 20467;
break;
case 20165:
id = 54158;
break;
case 20164:
id = 54158;
break;
case 21084:
id = 20187;
break;
case 31801:
id = aura->GetSpellProto()->EffectBasePoints[2];
break;
case 53736:
id = aura->GetSpellProto()->EffectBasePoints[2];
break;
case 20166:
id = 54158;
break;
}
caster->CastSpell(target, id, true);
// Cast judgement spell
switch(pSpell->GetProto()->NameHash)
{
case SPELL_HASH_JUDGEMENT_OF_JUSTICE:
id = 20184;
break;
case SPELL_HASH_JUDGEMENT_OF_LIGHT:
id = 20185;
break;
case SPELL_HASH_JUDGEMENT_OF_WISDOM:
id = 20186;
break;
}
caster->CastSpell(target, id, true);
caster->SetCurrentUnitForSingleTargetAura(pSpell->GetProto(), target->GetGUID());
return true;
}