这篇教程C++ GetAura函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetAura函数的典型用法代码示例。如果您正苦于以下问题:C++ GetAura函数的具体用法?C++ GetAura怎么用?C++ GetAura使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetAura函数的23个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: CalcSpellMod void CalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod, SpellInfo const* /*spellInfo*/, Unit* /*target*/) { int32 bonus = 0; if (Unit* caster = GetCaster()) { if (Player* player = caster->ToPlayer()) { uint32 maxMana = player->GetMaxPower(POWER_MANA); if (!maxMana) return; uint32 amount = aurEff->GetAmount(); // 150 * mastery / 100 float manaPercent = float(player->GetPower(POWER_MANA)) / float(maxMana); //float mastery = player->GetMasteryPoints(); bonus = int32(manaPercent * (/*(mastery + 8.0f) **/ amount)/* / 100.0f*/); //if (!spellMod || bonus != spellMod->value) // sLog->outBasic("Mana Adept : manaPct %.2f, amount %u, bonus %d", manaPercent, amount, bonus); } } if (!spellMod) spellMod = new SpellModifier(GetAura(), const_cast<AuraEffect*>(aurEff)); spellMod->op = SPELLMOD_DAMAGE/*SPELLMOD_ALL_EFFECTS*/; spellMod->type = SPELLMOD_PCT; spellMod->spellId = aurEff->GetId(); // 12042 Arcane Power : 685904631, 102472, 0 spellMod->mask = flag96(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);//GetSpellProto()->EffectSpellClassMask[aurEff->GetEffIndex()]; spellMod->charges = GetAura()->GetCharges(); //spellMod->spellId = aurEff->GetId(); // 12042 spellMod->value = bonus; }
开发者ID:hodobaj,项目名称:Darkcore,代码行数:32,
示例2: OnPeriodic void OnPeriodic(AuraEffect const* /*aurEff*/) { // Every 5 seconds Unit* target = GetTarget(); Unit* caster = GetCaster(); // If our player is no longer sit, remove all auras if (target->getStandState() != UNIT_STAND_STATE_SIT) { target->RemoveAura(GetAura()); return; } target->CastSpell(target, SPELL_BASKET_CHECK, false); // unknown use, it targets Romantic Basket target->CastSpell(target, RAND(SPELL_MEAL_EAT_VISUAL, SPELL_DRINK_VISUAL), false); bool foundSomeone = false; // For nearby players, check if they have the same aura. If so, cast Romantic Picnic (45123) // required for "hearts" visual std::list<Player*> playerList; Trinity::AnyPlayerInObjectRangeCheck checker(target, INTERACTION_DISTANCE*2); Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(target, playerList, checker); target->VisitNearbyWorldObject(INTERACTION_DISTANCE*2, searcher); for (std::list<Player*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr) if ((*itr) != target && (*itr)->HasAura(GetId())) // && (*itr)->getStandState() == UNIT_STAND_STATE_SIT) foundSomeone = true; // break; }
开发者ID:BlackwaterEmu,项目名称:Trinity-Zero,代码行数:28,
示例3: OnApply void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (!GetCaster()->HasAura(SPELL_VITAL_SPARK)) { stacks = 0; return; } stacks = GetCaster()->GetAuraCount(SPELL_VITAL_SPARK); int32 healingPct = sSpellMgr->AssertSpellInfo(SPELL_VITAL_SPARK)->GetEffect(EFFECT_0)->BasePoints * stacks; if (GetAura()->GetEffect(EFFECT_0)->GetAmount() < healingPct) GetAura()->GetEffect(EFFECT_0)->SetAmount(healingPct); GetCaster()->RemoveAura(SPELL_VITAL_SPARK); }
开发者ID:Carbenium,项目名称:TrinityCore,代码行数:16,
示例4: SetFloatValuevoid Player::UpdateMastery(){ if (!CanUseMastery()) { SetFloatValue(PLAYER_MASTERY, 0.0f); return; } float value = GetTotalAuraModifier(SPELL_AURA_MASTERY); value += GetRatingBonusValue(CR_MASTERY); SetFloatValue(PLAYER_MASTERY, value); ChrSpecializationEntry const* chrSpec = sChrSpecializationStore.LookupEntry(GetUInt32Value(PLAYER_FIELD_CURRENT_SPEC_ID)); if (!chrSpec) return; for (uint32 i = 0; i < MAX_MASTERY_SPELLS; ++i) { if (Aura* aura = GetAura(chrSpec->MasterySpellID[i])) { for (SpellEffectInfo const* effect : aura->GetSpellEffectInfos()) { if (!effect) continue; float mult = effect->BonusCoefficient; if (G3D::fuzzyEq(mult, 0.0f)) continue; aura->GetEffect(effect->EffectIndex)->ChangeAmount(int32(value * mult)); } } }}
开发者ID:brecky,项目名称:TrinityCore,代码行数:34,
示例5: HandlePeriodic void HandlePeriodic(constAuraEffectPtr aurEff) { Unit* caster = GetCaster(); Unit* target = GetTarget(); const SpellInfo* spell = GetSpellInfo(); Player* linkedPlayer = sObjectAccessor->GetPlayer(*target, playerLinkedGuid); if (!caster || !target || !spell || !linkedPlayer || !linkedPlayer->isAlive() || !linkedPlayer->HasAura(spell->Id)) if (AuraPtr myaura = GetAura()) { myaura->Remove(); return; } if (target->GetDistance(linkedPlayer) > spell->Effects[EFFECT_0].BasePoints) { if (AuraPtr aura = target->GetAura(spell->Id)) { if (aura->GetStackAmount() >= 15) { aura->Remove(); return; } } caster->AddAura(spell->Id, target); target->CastSpell(linkedPlayer, SPELL_JASPER_CHAINS_DAMAGE, true); } else target->CastSpell(linkedPlayer, SPELL_JASPER_CHAINS_VISUAL, true); }
开发者ID:AlucardVoss,项目名称:Patchs,代码行数:31,
示例6: HandlePeriodicTick void HandlePeriodicTick(AuraEffect const* aurEff) { if (!GetUnitOwner()) return; if (Aura* aur = GetAura()) { if (aur->GetStackAmount() >= 5) { uint32 spellId = SPELL_DEEP_CORRUPTION_DMG; switch (GetCaster()->GetMap()->GetDifficulty()) { case RAID_DIFFICULTY_10MAN_NORMAL: spellId = SPELL_DEEP_CORRUPTION_DMG; break; case RAID_DIFFICULTY_25MAN_NORMAL: spellId = SPELL_DEEP_CORRUPTION_DMG_25; break; case RAID_DIFFICULTY_10MAN_HEROIC: spellId = SPELL_DEEP_CORRUPTION_DMG_10H; break; case RAID_DIFFICULTY_25MAN_HEROIC: spellId = SPELL_DEEP_CORRUPTION_DMG_25H; break; default: spellId = SPELL_DEEP_CORRUPTION_DMG; break; } GetUnitOwner()->CastSpell(GetUnitOwner(), spellId, true); aur->Remove(); } } }
开发者ID:beyourself,项目名称:WoWSCore548,代码行数:26,
示例7: HandleShatter void HandleShatter(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { //if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL) if (GetAura()->GetCharges() <= 1) if (GetTarget()->IsAIEnabled) GetTarget()->GetAI()->DoAction(ACTION_PROTECTIVE_BUBBLE_SHATTERED); }
开发者ID:kemlg,项目名称:trinitycore-conciens,代码行数:7,
示例8: OnProc void OnProc(AuraEffect const* aurEff, Unit* unit, Unit* victim, uint32 damage, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, int32 cooldown) { PreventDefaultAction(); if (!(procFlag & PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG)) return; Player* player = unit->ToPlayer(); if (!player) return; // custom cooldown processing case uint32 auraSpellId = GetAura()->GetId(); if (cooldown && player->HasSpellCooldown(auraSpellId)) return; uint32 procSpellId = procSpell ? procSpell->Id : 0; uint32 spellId = 0; switch (procSpellId) { // Lightning Bolt case 403: spellId = 45284; break; // Chain Lightning case 421: spellId = 45297; break; // Lava Burst case 51505: spellId = 77451; break; default: return; } //sLog->outDetail("Elemental Overlord : attType %u, damage %u, procSpell %u, chance %d", attType, damage, procSpellId, aurEff->GetAmount()); // Chain Lightning if (procSpell->SpellFamilyFlags[0] & 0x2) { // Chain lightning has [LightOverload_Proc_Chance] / [Max_Number_of_Targets] chance to proc of each individual target hit. // A maxed LO would have a 33% / 3 = 11% chance to proc of each target. // LO chance was already "accounted" at the proc chance roll, now need to divide the chance by [Max_Number_of_Targets] float chance = 100.0f / procSpell->Effects[EFFECT_0].ChainTarget; if (!roll_chance_f(chance)) return; // Remove cooldown (Chain Lightning - have Category Recovery time) player->RemoveSpellCooldown(spellId); } if (roll_chance_i(aurEff->GetAmount())) { unit->CastSpell(victim, spellId, true, NULL, aurEff); if (cooldown) player->AddSpellCooldown(auraSpellId, 0, time(NULL) + cooldown); } }
开发者ID:hodobaj,项目名称:Darkcore,代码行数:58,
示例9: GetAuravoid Player::UpdateMastery(){ if (HasAuraType(SPELL_AURA_MASTERY)) { if(HasAura(76671)) GetAura(76671)->RecalculateAmountOfEffects();//Paladin Protection Mastery if(HasAura(77514)) GetAura(77514)->RecalculateAmountOfEffects();//DK Frost Mastery if(HasAura(48517)) GetAura(48517)->RecalculateAmountOfEffects();// Druid Balance Mastery if(HasAura(48518)) GetAura(48518)->RecalculateAmountOfEffects();// Druid Balance Mastery if(HasAura(76857)) GetAura(76857)->RecalculateAmountOfEffects();// Warrior Protection Mastery SetInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_MASTERY, m_baseRatingValue[CR_MASTERY]); SetFloatValue(PLAYER_MASTERY, GetMasteryPoints()); }}
开发者ID:Jildor,项目名称:4.3.4-Core,代码行数:18,
示例10: HandlePeriodicDummy void HandlePeriodicDummy(AuraEffect const* aurEff) { Unit* target = GetTarget(); if (target->GetTypeId() == TYPEID_UNIT && GetAura()->GetStackAmount() >= 10) { target->CastSpell(target, SPELL_OVERCHARGED_BLAST, true); target->ToCreature()->DespawnOrUnsummon(500); } PreventDefaultAction(); }
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:11,
示例11: GetMasteryBaseAmountuint32 MasteryScript::GetMasteryBaseAmount(){ if (dummyEffectIndex >= 0 && dummyEffectIndex < MAX_SPELL_EFFECTS) { if (SpellInfo const* spellInfo = GetAura()->GetSpellInfo()) return spellInfo->Effects[dummyEffectIndex].BasePoints ? spellInfo->Effects[dummyEffectIndex].BasePoints : defaultBaseAmount; // if (AuraEffect* effect = GetAura()->GetEffect(dummyEffectIndex)) // return effect->GetBaseAmount()/*GetAmount()*/; } return defaultBaseAmount;}
开发者ID:hodobaj,项目名称:Darkcore,代码行数:11,
示例12: HandleEffectCalcSpellMod void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod) { if (!spellMod) { spellMod = new SpellModifier(GetAura()); spellMod->op = SPELLMOD_DOT; spellMod->type = SPELLMOD_FLAT; spellMod->spellId = GetId(); spellMod->mask = GetSpellInfo()->Effects[aurEff->GetEffIndex()].SpellClassMask; } spellMod->value = aurEff->GetAmount() / 7; }
开发者ID:Hlkz2,项目名称:ACoreOld,代码行数:12,
示例13: GetTargetvoid SpellValanarKineticBombAuraScript::HandleDummyTick(AuraEffect const* /*aurEff*/){ Unit* target = GetTarget(); if (target->GetTypeId() != TYPEID_UNIT) return; if (Creature* bomb = target->FindNearestCreature(NPC_KINETIC_BOMB, 0.1f, true)) { bomb->CastSpell(bomb, SPELL_KINETIC_BOMB_EXPLOSION, true); bomb->RemoveAurasDueToSpell(SPELL_KINETIC_BOMB_VISUAL); target->RemoveAura(GetAura()); bomb->AI()->DoAction(SPELL_KINETIC_BOMB_EXPLOSION); }}
开发者ID:Allowed,项目名称:Strawberry335,代码行数:14,
示例14: HandlePeriodicTick void HandlePeriodicTick(constAuraEffectPtr /*aurEff*/) { if (!GetUnitOwner()) return; if (AuraEffectPtr aurEff = GetAura()->GetEffect(EFFECT_0)) { int32 oldamount = GetUnitOwner()->GetPower(POWER_ALTERNATE_POWER); int32 newamount = oldamount + 5; if (newamount > 100) newamount = 100; if (newamount == oldamount) return; if (oldamount < 100 && newamount == 100) { GetUnitOwner()->RemoveAura(SPELL_EPIC_CONCENTRATION); GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_LEGENDARY_CONCENTRATION, true); } else if (oldamount < 75 && newamount >= 75) { GetUnitOwner()->RemoveAura(SPELL_RARE_CONCENTRATION); GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_EPIC_CONCENTRATION, true); } else if (oldamount < 50 && newamount >= 50) { GetUnitOwner()->RemoveAura(SPELL_UNCOMMON_CONCENTRATION); GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_RARE_CONCENTRATION, true); } else if (oldamount < 25 && newamount >= 25) { GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_UNCOMMON_CONCENTRATION, true); } else if (newamount < 25) { GetUnitOwner()->RemoveAura(SPELL_LEGENDARY_CONCENTRATION); GetUnitOwner()->RemoveAura(SPELL_EPIC_CONCENTRATION); GetUnitOwner()->RemoveAura(SPELL_RARE_CONCENTRATION); GetUnitOwner()->RemoveAura(SPELL_UNCOMMON_CONCENTRATION); } GetUnitOwner()->SetPower(POWER_ALTERNATE_POWER, newamount); } }
开发者ID:UnstableZero,项目名称:AnotherMoPCore,代码行数:43,
示例15: SetFloatValuevoid Player::UpdateMastery(){ if (!IsMasteryLearned()) { SetFloatValue(PLAYER_MASTERY, 0.0f); return; } TalentTabEntry const* talentTab = sTalentTabStore.LookupEntry(GetPrimaryTalentTree(GetActiveSpec())); if (!talentTab) { SetFloatValue(PLAYER_MASTERY, 0.0f); return; } float value = GetTotalAuraModifier(SPELL_AURA_MASTERY); value += GetRatingBonusValue(CR_MASTERY); SetFloatValue(PLAYER_MASTERY, value); for (uint32 i = 0; i < MAX_MASTERY_SPELLS; ++i) { if (!talentTab->MasterySpells[i]) continue; if (Aura* aura = GetAura(talentTab->MasterySpells[i])) { for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j) { if (!aura->HasEffect(j)) continue; if (aura->GetSpellInfo()->Effects[j].BasePoints == 0) aura->GetEffect(j)->ChangeAmount(int32(value * aura->GetSpellInfo()->Effects[j].BonusMultiplier)); } } }}
开发者ID:xIchigox,项目名称:SoDCore.434,代码行数:37,
示例16: OnPeriodic void OnPeriodic(AuraEffect const* aurEff) { if (aurEff->GetTickNumber() > 1 && aurEff->GetTickNumber()%5 == 1) GetAura()->GetEffect(aurEff->GetEffIndex())->SetAmount(aurEff->GetAmount()*2); }
开发者ID:Cryostorm,项目名称:SunwellCore,代码行数:5,
示例17: UpdateAmount void UpdateAmount(AuraEffect* /*aurEff*/) { if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_1)) effect->ChangeAmount(effect->GetAmount() - 5); }
开发者ID:lasyan3,项目名称:TrinityCore,代码行数:5,
示例18: OnApply void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { // Remove all auras with spell id 46221, except the one currently being applied while (Aura* aur = GetUnitOwner()->GetOwnedAura(SPELL_ANIMAL_BLOOD, 0, 0, 0, GetAura())) GetUnitOwner()->RemoveOwnedAura(aur); }
开发者ID:Bootz,项目名称:T-Core,代码行数:6,
示例19: OnPeriodic void OnPeriodic(AuraEffect const* /*aurEff*/) { if (Unit* caster = GetCaster()) if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_0)) effect->RecalculateAmount(caster); }
开发者ID:Carbinfibre,项目名称:Script-Land,代码行数:6,
示例20: OnTick void OnTick(AuraEffect const* aurEff) { if (Unit* player = GetTarget()) if (player->GetHealthPct() <= 50.0f) player->RemoveAura(GetAura()); }
开发者ID:ChipLeo,项目名称:SkyFire_5xx,代码行数:6,
示例21: OnApply void OnApply(AuraEffect const* auraEffect, AuraEffectHandleModes) { GetAura()->GetEffect(auraEffect->GetEffIndex())->SetPeriodicTimer(_delay); }
开发者ID:AzerothShard-Dev,项目名称:azerothcore,代码行数:4,
示例22: HandleApply void HandleApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { // first tick after 10 seconds GetAura()->GetEffect(aurEff->GetEffIndex())->SetPeriodicTimer(10000); }
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:5,
示例23: HandleEffectRemove void HandleEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { Unit* target = GetTarget(); target->CastSpell(target, uint32(GetAura()->GetSpellEffectInfo(EFFECT_2)->CalcValue()), true, nullptr, aurEff, GetCasterGUID()); }
开发者ID:DSlayerMan,项目名称:DraenorCore,代码行数:5,
注:本文中的GetAura函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetAuraEffectsByType函数代码示例 C++ GetAuctionsMap函数代码示例 |