當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetOriginalCaster函數代碼示例

本文整理匯總了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());
                }
            }
開發者ID:Matt-One,項目名稱:azerothcore-wotlk,代碼行數:16,代碼來源:zone_wintergrasp.cpp

示例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());
                }
            }
開發者ID:Blackn7g,項目名稱:Voodoo,代碼行數:26,代碼來源:spell_warrior.cpp

示例3: HandleDummy

 void HandleDummy(SpellEffIndex /*effIndex*/)
 {
     if(GetHitCreature())
     {
         GetOriginalCaster()->GetVehicleKit()->GetPassenger(0)->ToPlayer()->KilledMonsterCredit(NPC_WYRMREST_TEMPLE_CREDIT, 0);
     }
 }
開發者ID:GlassFace,項目名稱:MythCore,代碼行數:7,代碼來源:spell_quest.cpp

示例4: CheckDistance

 void CheckDistance()
 {
     if (Unit* caster = GetOriginalCaster())
     {
         if (Unit* target = GetHitUnit())
             target->CastSpell(caster, SPELL_SIPHONED_MIGHT, true);
     }
 }
開發者ID:3kids,項目名稱:TrinityCore,代碼行數:8,代碼來源:boss_baltharus_the_warborn.cpp

示例5: HandleHeal

		void HandleHeal(SpellEffIndex /*effIndex*/)
		{
			if (Unit* caster = GetOriginalCaster())
				if (GetHitUnit()->GetGUID() == caster->GetGUID())
				{
				int32 heal = GetHitHeal() / 2.0f;
				SetHitHeal(heal);
				}
		}
開發者ID:Tithand,項目名稱:TER-Server,代碼行數:9,代碼來源:spell_priest.cpp

示例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);
 }
開發者ID:Helias,項目名稱:azerothcore-wotlk,代碼行數:9,代碼來源:boss_baltharus_the_warborn.cpp

示例7: FilterTargets

        void FilterTargets(std::list<WorldObject*>& targets)
        {
            targets.clear();

            Unit* target = GetOriginalCaster();
            if (!target)
                return;

            targets.push_back(target);
        }
開發者ID:DanielBallaSZTE,項目名稱:TrinityCorePreWOTLK,代碼行數:10,代碼來源:spell_rogue.cpp

示例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);
                }
            }
開發者ID:Faydz,項目名稱:TrinityCore,代碼行數:20,代碼來源:boss_sinestra.cpp

示例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);
         }
     }
 }
開發者ID:Stylerdk,項目名稱:TrinityCore,代碼行數:12,代碼來源:spell_priest.cpp

示例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());
            }
開發者ID:Lyill,項目名稱:TrinityCore,代碼行數:12,代碼來源:spell_shaman.cpp

示例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);
         }
     }
 }
開發者ID:Altair69,項目名稱:SkyFireEMU,代碼行數:12,代碼來源:spell_priest.cpp

示例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);
            }
開發者ID:090809,項目名稱:TrinityCore,代碼行數:15,代碼來源:isle_of_conquest.cpp

示例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); 
                }
            }
開發者ID:AzerothShard-Dev,項目名稱:azerothcore,代碼行數:16,代碼來源:boss_archavon.cpp

示例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);
                }
            }
開發者ID:OniBoov,項目名稱:TCOLD,代碼行數:16,代碼來源:boss_thaddius.cpp

示例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);
                    }
            }
開發者ID:ArbacalTrinty,項目名稱:TrinityCore,代碼行數:19,代碼來源:boss_astromancer.cpp


注:本文中的GetOriginalCaster函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。