• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetHitUnit函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetHitUnit函数的典型用法代码示例。如果您正苦于以下问题:C++ GetHitUnit函数的具体用法?C++ GetHitUnit怎么用?C++ GetHitUnit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetHitUnit函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: HandleScriptEffect

 void HandleScriptEffect(SpellEffIndex /*effIndex*/)
 {
     if (roll_chance_i(chance))
         GetCaster()->CastSpell(GetHitUnit(), SHAMAN_SPELL_EARTHQUAKE_KNOCKDOWN, true);
 }
开发者ID:Everf,项目名称:Dkc,代码行数:5,代码来源:spell_shaman.cpp


示例2: NotifyTargets

 void NotifyTargets()
 {
     if (Creature* caster = GetCaster()->ToCreature())
         if (Unit* target = GetHitUnit())
             caster->AI()->Talk(EMOTE_MUTATED_INFECTION, target->GetGUID());
 }
开发者ID:Arkania,项目名称:ArkCORE4,代码行数:6,代码来源:boss_rotface.cpp


示例3: HandleScript

 void HandleScript(SpellEffIndex effIndex)
 {
     PreventHitDefaultEffect(effIndex);
     if (Unit* target = GetHitUnit())
         target->CastSpell(target, GetEffectValue(), false);
 }
开发者ID:beyourself,项目名称:123,代码行数:6,代码来源:spell_dk.cpp


示例4: HandleScriptEffect

        void HandleScriptEffect(SpellEffIndex /*effIndex*/)
        {
            Unit* caster = GetCaster();
            if (Unit* unitTarget = GetHitUnit())
            {
                uint32 spellId = 0;
                int32 basePoint = 0;
                Unit::AuraApplicationMap& Auras = unitTarget->GetAppliedAuras();
                for (Unit::AuraApplicationMap::iterator i = Auras.begin(); i != Auras.end(); ++i)
                {
                    Aura* aura = i->second->GetBase();
                    if (aura->GetCasterGUID() != caster->GetGUID())
                        continue;

                    // Search only Serpent Sting, Viper Sting, Scorpid Sting auras
                    flag96 familyFlag = aura->GetSpellInfo()->SpellFamilyFlags;
                    if (!(familyFlag[1] & 0x00000080 || familyFlag[0] & 0x0000C000))
                        continue;
                    if (AuraEffect* aurEff = aura->GetEffect(0))
                    {
                        // Serpent Sting - Instantly deals 40% of the damage done by your Serpent Sting.
                        if (familyFlag[0] & 0x4000)
                        {
                            int32 TickCount = aurEff->GetTotalTicks();
                            spellId = SPELL_HUNTER_CHIMERA_SHOT_SERPENT;
                            basePoint = aurEff->GetDamage();
                            ApplyPct(basePoint, TickCount * 40);
                            basePoint = unitTarget->SpellDamageBonusTaken(caster, aura->GetSpellInfo(), basePoint, DOT, aura->GetStackAmount());

                            // Recalculate bonus damage on roll.
                            uint32 damage = std::max(aurEff->GetAmount(), 0);
                            sScriptMgr->ModifyPeriodicDamageAurasTick(unitTarget, caster, damage);
                            aurEff->SetDamage(caster->SpellDamageBonusDone(unitTarget, aurEff->GetSpellInfo(), damage, DOT) * aurEff->GetDonePct());
                        }
                        // Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting.
                        else if (familyFlag[1] & 0x00000080)
                        {
                            int32 TickCount = aura->GetEffect(0)->GetTotalTicks();
                            spellId = SPELL_HUNTER_CHIMERA_SHOT_VIPER;

                            // Amount of one aura tick
                            basePoint = int32(CalculatePct(unitTarget->GetMaxPower(POWER_MANA), aurEff->GetAmount()));
                            int32 casterBasePoint = aurEff->GetAmount() * unitTarget->GetMaxPower(POWER_MANA) / 50; /// @todo WTF? caster uses unitTarget?
                            if (basePoint > casterBasePoint)
                                basePoint = casterBasePoint;
                            ApplyPct(basePoint, TickCount * 60);
                        }
                        // Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute.
                        else if (familyFlag[0] & 0x00008000)
                            spellId = SPELL_HUNTER_CHIMERA_SHOT_SCORPID;
                        // ?? nothing say in spell desc (possibly need addition check)
                        //if (familyFlag & 0x0000010000000000LL || // dot
                        //    familyFlag & 0x0000100000000000LL)   // stun
                        //{
                        //    spellId = 53366; // 53366 Chimera Shot - Wyvern
                        //}

                        // Refresh aura duration
                        aura->RefreshDuration();
                    }
                    break;
                }
                if (spellId)
                    caster->CastCustomSpell(unitTarget, spellId, &basePoint, 0, 0, true);
                if (spellId == SPELL_HUNTER_CHIMERA_SHOT_SCORPID && caster->ToPlayer()) // Scorpid Sting - Add 1 minute cooldown
                    caster->ToPlayer()->AddSpellCooldown(spellId, 0, uint32(time(NULL) + 60));
            }
        }
开发者ID:4jb,项目名称:Trinity,代码行数:68,代码来源:spell_hunter.cpp


示例5: HandleScript

 void HandleScript(SpellEffIndex /*effIndex*/)
 {
     GetCaster()->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true);
 }
开发者ID:Aravu,项目名称:Talador-Project,代码行数:4,代码来源:boss_lord_jaraxxus.cpp


示例6: HandleScriptEffect

 void HandleScriptEffect(SpellEffIndex /*effIndex*/)
 {
     if (Unit* target = GetHitUnit())
         target->GetAI()->DoAction(ACTION_FLY_DOWN);
 }
开发者ID:AzerothShard-Dev,项目名称:azerothcore,代码行数:5,代码来源:boss_vazruden_the_herald.cpp


示例7: HandleScript

 void HandleScript(SpellEffIndex /*effIndex*/)
 {
     if (Unit* target = GetHitUnit())
         target->RemoveAura(SPELL_GIFT_OF_THARON_JA);
 }
开发者ID:125125,项目名称:TrinityCore,代码行数:5,代码来源:boss_tharon_ja.cpp


示例8: HandleScript

 void HandleScript(SpellEffIndex /*effIndex*/)
 {
     Unit* caster = GetCaster();
     if (Unit* target = GetHitUnit())
         caster->CastSpell(target, uint32(GetEffectValue()), true);
 }
开发者ID:Dramacydal,项目名称:Trinitycore-5.3.0,代码行数:6,代码来源:boss_mandokir.cpp


示例9: HandleEffect

 void HandleEffect(SpellEffIndex effIndex)
 {
     PreventHitDefaultEffect(effIndex);
     float curThreat = GetCaster()->getThreatManager().getThreat(GetHitUnit(), true);
     GetCaster()->getThreatManager().addThreat(GetHitUnit(), -curThreat + 50000.0f / std::min(1.0f, GetCaster()->GetDistance(GetHitUnit())));
 }
开发者ID:AtVirus,项目名称:multi_realm_cell,代码行数:6,代码来源:boss_alysrazor.cpp


示例10: TurnBird

 void TurnBird(SpellEffIndex effIndex)
 {
     PreventHitDefaultEffect(effIndex);
     GetHitUnit()->PlayOneShotAnimKit(ANIM_KIT_BIRD_TURN);
 }
开发者ID:AtVirus,项目名称:multi_realm_cell,代码行数:5,代码来源:boss_alysrazor.cpp


示例11: HandleDummy

 void HandleDummy(SpellEffIndex /*effIndex*/)
 {
     Unit* caster = GetCaster();
     if (Unit* unitTarget = GetHitUnit())
         caster->CastSpell(unitTarget, SPELL_ROGUE_SHIV_TRIGGERED, true);
 }
开发者ID:mynew4,项目名称:RE,代码行数:6,代码来源:spell_rogue.cpp


示例12: HandleDummy

        void HandleDummy(SpellEffIndex /*effIndex*/)
        {
            uint32 roll = urand(1, 100);

            uint8 ev;
            if (roll <= 50)
                ev = EVENT_MISS;
            else if (roll <= 83)
                ev = EVENT_HIT;
            else
                ev = EVENT_MISS_BIRD;

            Unit* shooter = GetCaster();
            Creature* wilhelm = GetHitUnit()->ToCreature();
            Creature* apple = shooter->FindNearestCreature(NPC_APPLE, 30);
            Creature* drostan = shooter->FindNearestCreature(NPC_DROSTAN, 30);

            if (!wilhelm || !apple || !drostan)
                return;

            switch (ev)
            {
            case EVENT_MISS_BIRD:
            {
                Creature* crunchy = shooter->FindNearestCreature(NPC_CRUNCHY, 30);
                Creature* bird = shooter->FindNearestCreature(NPC_THICKBIRD, 30);

                if (!bird || !crunchy)
                    ; // fall to EVENT_MISS
                else
                {
                    shooter->CastSpell(bird, SPELL_MISS_BIRD_APPLE);
                    bird->CastSpell(bird, SPELL_BIRD_FALL);
                    wilhelm->AI()->Talk(SAY_WILHELM_MISS);
                    drostan->AI()->Talk(SAY_DROSTAN_REPLY_MISS);

                    bird->Kill(bird);
                    crunchy->GetMotionMaster()->MovePoint(0, bird->GetPositionX(), bird->GetPositionY(),
                                                          bird->GetMap()->GetWaterOrGroundLevel(bird->GetPositionX(), bird->GetPositionY(), bird->GetPositionZ()));
                    /// @todo Make crunchy perform emote eat when he reaches the bird

                    break;
                }
            }
            case EVENT_MISS:
            {
                shooter->CastSpell(wilhelm, SPELL_MISS_APPLE);
                wilhelm->AI()->Talk(SAY_WILHELM_MISS);
                drostan->AI()->Talk(SAY_DROSTAN_REPLY_MISS);
                break;
            }
            case EVENT_HIT:
            {
                shooter->CastSpell(apple, SPELL_HIT_APPLE);
                apple->CastSpell(apple, SPELL_APPLE_FALL);
                wilhelm->AI()->Talk(SAY_WILHELM_HIT);
                if (Player* player = shooter->ToPlayer())
                    player->KilledMonsterCredit(NPC_APPLE);
                apple->DespawnOrUnsummon();

                break;
            }
            }
        }
开发者ID:RafoxSama,项目名称:TrinityCore,代码行数:64,代码来源:zone_sholazar_basin.cpp


示例13: HandleDummy

 void HandleDummy(SpellEffIndex /*effIndex*/)
 {
     if (Unit* unitTarget = GetHitUnit())
         if (SpellInfo const* spell_proto = sSpellMgr->GetSpellInfo(GetEffectValue()))
             GetCaster()->CastSpell(unitTarget, spell_proto, true, NULL);
 }
开发者ID:Stylerdk,项目名称:TrinityCore,代码行数:6,代码来源:spell_paladin.cpp


示例14: HandleDummy

 void HandleDummy(SpellEffIndex effIndex)
 {
     if (Unit *unitTarget = GetHitUnit())
         if (unitTarget->GetTypeId() == TYPEID_UNIT)
             unitTarget->CastSpell(unitTarget, spell_list[urand(0, 5)], true);
 }
开发者ID:Archives,项目名称:ro_core,代码行数:6,代码来源:spell_mage.cpp


示例15: HandleScript

 void HandleScript(SpellEffIndex effIndex)
 {
     PreventHitDefaultEffect(effIndex);
     GetHitUnit()->CastSpell(GetHitUnit(), GetEffectValue(), false);
 }
开发者ID:heros,项目名称:LasCore,代码行数:5,代码来源:wintergrasp.cpp


示例16: HandleDummy

 void HandleDummy(SpellEffIndex /*effIndex*/)
 {
     int32 bp0 = GetEffectValue();
     if (GetHitUnit())
         GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_SLAM, &bp0, NULL, NULL, true, 0);
 }
开发者ID:8Infinity8,项目名称:InfinityCore,代码行数:6,代码来源:spell_warrior.cpp


示例17: HandleDummy

 void HandleDummy(SpellEffIndex /*effIndex*/)
 {
     uint32 spellid = RAND(SPELL_BREW, SPELL_GHOSTLY, RAND(SPELL_HEX1, SPELL_HEX2, SPELL_HEX3), SPELL_GROW, SPELL_LAUNCH);
     if (Unit* target = GetHitUnit())
         GetCaster()->CastSpell(target, spellid, false);
 }
开发者ID:Myst,项目名称:ElunaTrinityCata,代码行数:6,代码来源:zone_durotar.cpp


示例18: HandleEffect

 void HandleEffect(SpellEffIndex effIndex)
 {
     PreventHitDefaultEffect(effIndex);
     GetHitUnit()->CastSpell(GetHitUnit(), SPELL_AURA_OF_FROST, true);
 }
开发者ID:madisodr,项目名称:legacy-core,代码行数:5,代码来源:boss_azuregos.cpp


示例19: RecalculateDamage

 void RecalculateDamage()
 {
     SetHitDamage(GetHitUnit()->CountPctFromMaxHealth(GetHitDamage()));
 }
开发者ID:martial69320,项目名称:cerberus,代码行数:4,代码来源:boss_xt002.cpp


示例20: HandleScriptEffect

 void HandleScriptEffect(SpellEffIndex /*effIndex*/)
 {
     if (Unit* target = GetHitUnit())
         target->CastSpell(GetCaster(), SPELL_BEAM_CHANNEL, true);
 }
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:5,代码来源:boss_novos.cpp



注:本文中的GetHitUnit函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetHmenu函数代码示例发布时间:2022-05-30
下一篇:
C++ GetHitDamage函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap