当前位置: 首页>>代码示例>>C++>>正文


C++ DoModifyThreatPercent函数代码示例

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


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

示例1: UpdateAI

    void UpdateAI (const uint32 diff)
    {
        if (!UpdateVictim())
            return;

        if (PhaseTwo)
        {
            me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
            me->setDeathState(JUST_DIED);
            me->SetHealth(0);
            me->GetMotionMaster()->Clear();
            me->clearUnitState(UNIT_STAT_ALL_STATE);
            me->LoadCreaturesAddon(true);
            return;
        }

        if (ZathDead)
            return;

        // Resurrect
        if (ThekalDead || LorkhanDead)
            if (!IsResurrecting && (CheckDeath_Timer - 2000) <= diff)
            {
                if (LorkhanDead)
                    if (Unit* pLorkhan = Unit::GetUnit(*me, LorkhanGUID))
                        pLorkhan->CastSpell(pLorkhan, SPELL_RESURRECT, false, 0, 0, pLorkhan->GetGUID());
                if (ThekalDead)
                    if (Unit* pThekal = Unit::GetUnit(*me, ThekalGUID))
                        pThekal->CastSpell(pThekal, SPELL_RESURRECT, false, 0, 0, pThekal->GetGUID());
                IsResurrecting = true;
            }
            else
            if (LorkhanDead && ThekalDead)
                CheckDeath_Timer -= diff;

        // Sweeping Strikes Timer
        if (SweepingStrikes_Timer <= diff)
        {
            DoCast(me->getVictim(), SPELL_SWEEPINGSTRIKES);
            SweepingStrikes_Timer = 22000 + rand()%4000;
        }
        else
            SweepingStrikes_Timer -= diff;

        // Sinister Strike Timer
        if (SinisterStrike_Timer <= diff)
        {
            DoCast(me->getVictim(), SPELL_SINISTERSTRIKE);
            SinisterStrike_Timer = 8000 + rand()%8000;
        }
        else
            SinisterStrike_Timer -= diff;

        // Gouge Timer
        if (Gouge_Timer <= diff)
        {
            DoCast(me->getVictim(), SPELL_GOUGE);

            if (DoGetThreat(me->getVictim()))
                DoModifyThreatPercent(me->getVictim(), -100);

            Gouge_Timer = 17000 + rand()%10000;
        }
        else
            Gouge_Timer -= diff;

        // Kick Timer
        if (Kick_Timer <= diff)
        {
            DoCast(me->getVictim(), SPELL_KICK);
            Kick_Timer = 15000 + rand()%10000;
        }
        else
            Kick_Timer -= diff;

        // Blind Timer
        if (Blind_Timer <= diff)
        {
            DoCast(me->getVictim(), SPELL_BLIND);
            Blind_Timer = 10000 + rand()%10000;
        }
        else
            Blind_Timer -= diff;

        DoMeleeAttackIfReady();
    }
开发者ID:AwkwardDev,项目名称:Project-WoW,代码行数:86,代码来源:boss_thekal.cpp

示例2: _ResetThreat

 void _ResetThreat(Unit* target)
 {
     DoModifyThreatPercent(target, -100);
     me->AddThreat(target, _tempThreat);
 }
开发者ID:heros,项目名称:LasCore,代码行数:5,代码来源:boss_krickandick.cpp

示例3: UpdateAI

    void UpdateAI(const uint32 diff)
    {
        if(!UpdateVictim())
            return;

        if(!m_creature->HasAura(SPELL_BERSERK, 0))
        {
            if(EnrageTimer < diff)
            {
                DoCast(m_creature, SPELL_BERSERK);
                switch(rand()%2)
                {
                case 0: DoScriptText(SAY_ENRAGE1, m_creature); break;
                case 1: DoScriptText(SAY_ENRAGE2, m_creature); break;
                }
            }else EnrageTimer -= diff;
        }

        if(ArcingSmashTimer < diff)
        {
            DoCast(m_creature->getVictim(),Phase1 ? SPELL_ARCING_SMASH_1 : SPELL_ARCING_SMASH_2);
            ArcingSmashTimer = 10000;
        }else ArcingSmashTimer -= diff;

        if(FelBreathTimer < diff)
        {
            DoCast(m_creature->getVictim(),Phase1 ? SPELL_FELBREATH_1 : SPELL_FELBREATH_2);
            FelBreathTimer = 25000;
        }else FelBreathTimer -= diff;

        if(EjectTimer < diff)
        {
            DoCast(m_creature->getVictim(),Phase1 ? SPELL_EJECT_1 : SPELL_EJECT_2);
            EjectTimer = 15000;
        }else EjectTimer -= diff;


        if(Charge_Timer < diff)
        {
            if(m_creature->GetDistance2d(m_creature->getVictim()) > 15)
                DoCast(m_creature->getVictim(),SPELL_CHARGE);
            Charge_Timer = 10000;
        }else Charge_Timer -= diff;

        if(Phase1)
        {
            if(BewilderingStrikeTimer < diff)
            {
                DoCast(m_creature->getVictim(), SPELL_BEWILDERING_STRIKE);
                BewilderingStrikeTimer = 20000;
            }else BewilderingStrikeTimer -= diff;

            if(BloodboilTimer < diff)
            {
                if(BloodboilCount < 5)                      // Only cast it five times.
                {
                    CastBloodboil(); // Causes issues on windows, so is commented out.
                    //DoCast(m_creature->getVictim(), SPELL_BLOODBOIL);
                    ++BloodboilCount;
                    BloodboilTimer = 10000;
                }
            }else BloodboilTimer -= diff;
        }

        if(!Phase1)
        {
            if(FelGeyserTimer < diff)
            {
                DoCast(m_creature->getVictim(), SPELL_FEL_GEYSER);
                FelGeyserTimer = 30000;
            }else FelGeyserTimer -= diff;

            if(m_creature->getVictim()->IsImmunedToDamage(SPELL_SCHOOL_MASK_ALL,true))
                m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-100);
        }

        if(PhaseChangeTimer < diff)
        {
            if(Phase1)
            {
                Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0,100,true);
                if(target && target->isAlive())
                {
                    Phase1 = false;

                    TargetThreat = DoGetThreat(target);
                    TargetGUID = target->GetGUID();
                    if(DoGetThreat(target))
                        DoModifyThreatPercent(target, -100);
                    m_creature->AddThreat(target, 50000000.0f);
                    target->CastSpell(m_creature, SPELL_TAUNT_GURTOGG, true);
                    m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
                    m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);

                    // If VMaps are disabled, this spell can call the whole instance
                    DoCast(m_creature, SPELL_INSIGNIFIGANCE, true);
                    DoCast(target,SPELL_FEL_RAGE_1, true);
                    DoCast(target,SPELL_FEL_RAGE_2, true);
                    DoCast(target,SPELL_FEL_RAGE_3, true);
                    DoCast(target,SPELL_FEL_RAGE_SCALE, true);
//.........这里部分代码省略.........
开发者ID:Denominator13,项目名称:NeoCore,代码行数:101,代码来源:boss_bloodboil.cpp

示例4: UpdateAI

        void UpdateAI(const uint32 diff)
        {
            if (!UpdateVictim())
                return;

            if (ArcingSmashTimer <= diff)
            {
                DoCast(me->getVictim(), SPELL_ARCING_SMASH);
                ArcingSmashTimer = 10000;
            } else ArcingSmashTimer -= diff;

            if (FelAcidTimer <= diff)
            {
                DoCast(me->getVictim(), SPELL_FEL_ACID);
                FelAcidTimer = 25000;
            } else FelAcidTimer -= diff;

            if (!me->HasAura(SPELL_BERSERK))
            {
                if (EnrageTimer <= diff)
                {
                    DoCast(me, SPELL_BERSERK);
                    DoScriptText(RAND(SAY_ENRAGE1, SAY_ENRAGE2), me);
                } else EnrageTimer -= diff;
            }

            if (Phase1)
            {
                if (BewilderingStrikeTimer <= diff)
                {
                    DoCast(me->getVictim(), SPELL_BEWILDERING_STRIKE);
                    float mt_threat = DoGetThreat(me->getVictim());
                    if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1))
                        me->AddThreat(target, mt_threat);
                    BewilderingStrikeTimer = 20000;
                } else BewilderingStrikeTimer -= diff;

                if (EjectTimer <= diff)
                {
                    DoCast(me->getVictim(), SPELL_EJECT1);
                    DoModifyThreatPercent(me->getVictim(), -40);
                    EjectTimer = 15000;
                } else EjectTimer -= diff;

                if (AcidicWoundTimer <= diff)
                {
                    DoCast(me->getVictim(), SPELL_ACIDIC_WOUND);
                    AcidicWoundTimer = 10000;
                } else AcidicWoundTimer -= diff;

                if (BloodboilTimer <= diff)
                {
                    if (BloodboilCount < 5)                      // Only cast it five times.
                    {
                        //CastBloodboil(); // Causes issues on windows, so is commented out.
                        DoCast(me->getVictim(), SPELL_BLOODBOIL);
                        ++BloodboilCount;
                        BloodboilTimer = 10000*BloodboilCount;
                    }
                } else BloodboilTimer -= diff;
            }

            if (!Phase1)
            {
                if (AcidGeyserTimer <= diff)
                {
                    DoCast(me->getVictim(), SPELL_ACID_GEYSER);
                    AcidGeyserTimer = 30000;
                } else AcidGeyserTimer -= diff;

                if (EjectTimer <= diff)
                {
                    DoCast(me->getVictim(), SPELL_EJECT2);
                    EjectTimer = 15000;
                } else EjectTimer -= diff;
            }

            if (PhaseChangeTimer <= diff)
            {
                if (Phase1)
                {
                    Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
                    if (target && target->isAlive())
                    {
                        Phase1 = false;

                        TargetThreat = DoGetThreat(target);
                        TargetGUID = target->GetGUID();
                        target->CastSpell(me, SPELL_TAUNT_GURTOGG, true);
                        if (DoGetThreat(target))
                            DoModifyThreatPercent(target, -100);
                        me->AddThreat(target, 50000000.0f);
                        me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
                        me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
                                                                // If VMaps are disabled, this spell can call the whole instance
                        DoCast(me, SPELL_INSIGNIFIGANCE, true);
                        DoCast(target, SPELL_FEL_RAGE_TARGET, true);
                        DoCast(target, SPELL_FEL_RAGE_2, true);
                        /* These spells do not work, comment them out for now.
                        DoCast(target, SPELL_FEL_RAGE_2, true);
//.........这里部分代码省略.........
开发者ID:kmN666,项目名称:Leroy,代码行数:101,代码来源:boss_bloodboil.cpp

示例5: UpdateAI


//.........这里部分代码省略.........
                    }
                }

                if (ShadowNovaTimer > 35000)
                    ShadowNovaTimer = EnfeebleTimer + 5000;

                return;
            }

            if (SunderArmorTimer <= diff)
            {
                DoCast(me->getVictim(), SPELL_SUNDER_ARMOR);
                SunderArmorTimer = urand(10000,18000);

            } else SunderArmorTimer -= diff;

            if (Cleave_Timer <= diff)
            {
                DoCast(me->getVictim(), SPELL_CLEAVE);
                Cleave_Timer = urand(6000,12000);

            } else Cleave_Timer -= diff;
        }
        else
        {
            if (AxesTargetSwitchTimer <= diff)
            {
                AxesTargetSwitchTimer = urand(7500,20000);

                if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                {
                    for (uint8 i = 0; i < 2; ++i)
                    {
                        if (Unit *axe = Unit::GetUnit(*me, axes[i]))
                        {
                            if (axe->getVictim())
                                DoModifyThreatPercent(axe->getVictim(), -100);
                            if (pTarget)
                                axe->AddThreat(pTarget, 1000000.0f);
                            //axe->getThreatManager().tauntFadeOut(axe->getVictim());
                            //axe->getThreatManager().tauntApply(pTarget);
                        }
                    }
                }
            } else AxesTargetSwitchTimer -= diff;

            if (AmplifyDamageTimer <= diff)
            {
                if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                    DoCast(pTarget, SPELL_AMPLIFY_DAMAGE);
                AmplifyDamageTimer = urand(20000,30000);
            } else AmplifyDamageTimer -= diff;
        }

        //Time for global and double timers
        if (InfernalTimer <= diff)
        {
            SummonInfernal(diff);
            InfernalTimer = phase == 3 ? 14500 : 44500;    // 15 secs in phase 3, 45 otherwise
        } else InfernalTimer -= diff;

        if (ShadowNovaTimer <= diff)
        {
            DoCast(me->getVictim(), SPELL_SHADOWNOVA);
            ShadowNovaTimer = phase == 3 ? 31000 : uint32(-1);
        } else ShadowNovaTimer -= diff;

        if (phase != 2)
        {
            if (SWPainTimer <= diff)
            {
                Unit *pTarget = NULL;
                if (phase == 1)
                    pTarget = me->getVictim();        // the tank
                else                                          // anyone but the tank
                    pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);

                if (pTarget)
                    DoCast(pTarget, SPELL_SW_PAIN);

                SWPainTimer = 20000;
            } else SWPainTimer -= diff;
        }

        if (phase != 3)
        {
            if (EnfeebleTimer <= diff)
            {
                EnfeebleHealthEffect();
                EnfeebleTimer = 30000;
                ShadowNovaTimer = 5000;
                EnfeebleResetTimer = 9000;
            } else EnfeebleTimer -= diff;
        }

        if (phase == 2)
            DoMeleeAttacksIfReady();
        else
            DoMeleeAttackIfReady();
    }
开发者ID:Agustin1010,项目名称:Oregon-Core,代码行数:101,代码来源:boss_prince_malchezaar.cpp

示例6: UpdateAI


//.........这里部分代码省略.........
                                axe->AddThreat(target, 10000000.0f);
                            }
                        }
                    }

                    if (ShadowNovaTimer > 35000)
                        ShadowNovaTimer = EnfeebleTimer + 5000;

                    return;
                }

                if (SunderArmorTimer <= diff)
                {
                    DoCastVictim(SPELL_SUNDER_ARMOR);
                    SunderArmorTimer = urand(10000, 18000);
                } else SunderArmorTimer -= diff;

                if (Cleave_Timer <= diff)
                {
                    DoCastVictim(SPELL_CLEAVE);
                    Cleave_Timer = urand(6000, 12000);
                } else Cleave_Timer -= diff;
            }
            else
            {
                if (AxesTargetSwitchTimer <= diff)
                {
                    AxesTargetSwitchTimer = urand(7500, 20000);

                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                    {
                        for (uint8 i = 0; i < 2; ++i)
                        {
                            if (Unit* axe = ObjectAccessor::GetUnit(*me, axes[i]))
                            {
                                if (axe->GetVictim())
                                    DoModifyThreatPercent(axe->GetVictim(), -100);
                                if (target)
                                    axe->AddThreat(target, 1000000.0f);
                                //axe->getThreatManager().tauntFadeOut(axe->GetVictim());
                                //axe->getThreatManager().tauntApply(target);
                            }
                        }
                    }
                } else AxesTargetSwitchTimer -= diff;

                if (AmplifyDamageTimer <= diff)
                {
                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                        DoCast(target, SPELL_AMPLIFY_DAMAGE);
                    AmplifyDamageTimer = urand(20000, 30000);
                } else AmplifyDamageTimer -= diff;
            }

            //Time for global and double timers
            if (InfernalTimer <= diff)
            {
                SummonInfernal(diff);
                InfernalTimer = phase == 3 ? 14500 : 44500;    // 15 secs in phase 3, 45 otherwise
            } else InfernalTimer -= diff;

            if (ShadowNovaTimer <= diff)
            {
                DoCastVictim(SPELL_SHADOWNOVA);
                ShadowNovaTimer = phase == 3 ? 31000 : uint32(-1);
            } else ShadowNovaTimer -= diff;

            if (phase != 2)
            {
                if (SWPainTimer <= diff)
                {
                    Unit* target = NULL;
                    if (phase == 1)
                        target = me->GetVictim();        // the tank
                    else                                          // anyone but the tank
                        target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);

                    if (target)
                        DoCast(target, SPELL_SW_PAIN);

                    SWPainTimer = 20000;
                } else SWPainTimer -= diff;
            }

            if (phase != 3)
            {
                if (EnfeebleTimer <= diff)
                {
                    EnfeebleHealthEffect();
                    EnfeebleTimer = 30000;
                    ShadowNovaTimer = 5000;
                    EnfeebleResetTimer = 9000;
                } else EnfeebleTimer -= diff;
            }

            if (phase == 2)
                DoMeleeAttacksIfReady();
            else
                DoMeleeAttackIfReady();
        }
开发者ID:AwkwardDev,项目名称:TinyCore,代码行数:101,代码来源:boss_prince_malchezaar.cpp

示例7: UpdateAI

        void UpdateAI(const uint32 diff)
        {
            // World Notify Cooldown
            if (notifyCooldown >= diff)
                notifyCooldown -= diff;
            else
                notifyCooldown = 0;

            if (!UpdateVictim())
                return;

            // Defender Quest Credit
            if (!defenderCredit)
                if (me->getThreatManager().getThreatList().size() >= 5 && me->GetHealthPct() < 90.f) // Anti-Farming Conditions
                    defenderCredit = true;

            // Boss rescaling
            if (rescaleTimer <= diff)
            {
                HandleScaling();
                rescaleTimer = 10000;
            } else rescaleTimer -= diff;

            events.Update(diff);

            if (me->HasUnitState(UNIT_STATE_CASTING))
                return;

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    case SPELL_BLIZZARD:
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true))
                            DoCast(target, SPELL_BLIZZARD);
                        events.ScheduleEvent(SPELL_BLIZZARD, urand(15000, 18000));
                        break;
                    case SPELL_FIRE_BLAST:
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 20.0f, true))
                            DoCast(target, SPELL_FIRE_BLAST);
                        events.ScheduleEvent(SPELL_FIRE_BLAST, urand(5000, 8000));
                        break;
                    case SPELL_FIREBALL:
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
                            DoCast(target, SPELL_FIREBALL);
                        events.ScheduleEvent(SPELL_FIREBALL, urand(7000, 10000));
                        break;
                    case SPELL_SUMMON_WATER_ELEMENT:
                        if (Summons.size() < 4)
                            DoCast(me, SPELL_SUMMON_WATER_ELEMENT);
                        events.ScheduleEvent(SPELL_SUMMON_WATER_ELEMENT, urand(20000, 30000));
                        break;
                    case SPELL_TELEPORT:
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
                        {
                            DoModifyThreatPercent(target, 100); // Delete Target from Threat List
                            DoCast(target, SPELL_TELEPORT);
                        }
                        events.ScheduleEvent(SPELL_TELEPORT, urand(37000, 52000));
                        break;
                }
            }

            DoMeleeAttackIfReady();
        }
开发者ID:GlobalWoW,项目名称:TrinityCore,代码行数:65,代码来源:zone_dustwallow_marsh.cpp

示例8: UpdateAI

        void UpdateAI(const uint32 diff)
        {
            if (!UpdateVictim())
                return;

            //ArcaneMissiles_Timer
            if (ArcaneMissiles_Timer <= diff)
            {
                DoCast(me->getVictim(), SPELL_ARCANEMISSILES);
                ArcaneMissiles_Timer = 8000;
            }
            else
                ArcaneMissiles_Timer -= diff;

            //ShadowShield_Timer
            if (ShadowShield_Timer <= diff)
            {
                DoCast(me, SPELL_SHADOWSHIELD);
                ShadowShield_Timer = urand(14000, 28000);
            }
            else
                ShadowShield_Timer -= diff;

            //Curse_Timer
            if (Curse_Timer <= diff)
            {
                DoCast(me->getVictim(), SPELL_CURSE);
                Curse_Timer = urand(15000, 27000);
            }
            else
                Curse_Timer -= diff;

            //Teleporting Random Target to one of the six pre boss rooms and spawn 3-4 skeletons near the gamer.
            //We will only telport if gandling has more than 3% of hp so teleported gamers can always loot.
            if (HealthAbovePct(3))
            {
                if (Teleport_Timer <= diff)
                {
                    Unit* target = NULL;
                    target = SelectTarget(SELECT_TARGET_RANDOM, 0);
                    if (target && target->GetTypeId() == TYPEID_PLAYER)
                    {
                        if (DoGetThreat(target))
                            DoModifyThreatPercent(target, -100);

                        Creature* Summoned = NULL;
                        switch (rand()%6)
                        {
                        case 0:
                            DoTeleportPlayer(target, 250.0696f, 0.3921f, 84.8408f, 3.149f);
                            Summoned = me->SummonCreature(16119, 254.2325f, 0.3417f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
                            if (Summoned)
                                Summoned->AI()->AttackStart(target);
                            Summoned = me->SummonCreature(16119, 257.7133f, 4.0226f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
                            if (Summoned)
                                Summoned->AI()->AttackStart(target);
                            Summoned = me->SummonCreature(16119, 258.6702f, -2.60656f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
                            if (Summoned)
                                Summoned->AI()->AttackStart(target);
                            break;
                        case 1:
                            DoTeleportPlayer(target, 181.4220f, -91.9481f, 84.8410f, 1.608f);
                            Summoned = me->SummonCreature(16119, 184.0519f, -73.5649f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
                            if (Summoned)
                                Summoned->AI()->AttackStart(target);
                            Summoned = me->SummonCreature(16119, 179.5951f, -73.7045f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
                            if (Summoned)
                                Summoned->AI()->AttackStart(target);
                            Summoned = me->SummonCreature(16119, 180.6452f, -78.2143f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
                            if (Summoned)
                                Summoned->AI()->AttackStart(target);
                            Summoned = me->SummonCreature(16119, 283.2274f, -78.1518f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
                            if (Summoned)
                                Summoned->AI()->AttackStart(target);
                            break;
                        case 2:
                            DoTeleportPlayer(target, 95.1547f, -1.8173f, 85.2289f, 0.043f);
                            Summoned = me->SummonCreature(16119, 100.9404f, -1.8016f, 85.2289f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
                            if (Summoned)
                                Summoned->AI()->AttackStart(target);
                            Summoned = me->SummonCreature(16119, 101.3729f, 0.4882f, 85.2289f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
                            if (Summoned)
                                Summoned->AI()->AttackStart(target);
                            Summoned = me->SummonCreature(16119, 101.4596f, -4.4740f, 85.2289f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
                            if (Summoned)
                                Summoned->AI()->AttackStart(target);
                            break;
                        case 3:
                            DoTeleportPlayer(target, 250.0696f, 0.3921f, 72.6722f, 3.149f);
                            Summoned = me->SummonCreature(16119, 240.34481f, 0.7368f, 72.6722f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
                            if (Summoned)
                                Summoned->AI()->AttackStart(target);
                            Summoned = me->SummonCreature(16119, 240.3633f, -2.9520f, 72.6722f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
                            if (Summoned)
                                Summoned->AI()->AttackStart(target);
                            Summoned = me->SummonCreature(16119, 240.6702f, 3.34949f, 72.6722f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
                            if (Summoned)
                                Summoned->AI()->AttackStart(target);
                            break;
                        case 4:
//.........这里部分代码省略.........
开发者ID:Grimtonz1337,项目名称:JadeCore,代码行数:101,代码来源:boss_darkmaster_gandling.cpp

示例9: UpdateAI

            void UpdateAI(uint32 diff) override
            {
                if (!UpdateVictim())
                    return;

                if (me->HasUnitState(UNIT_STATE_CASTING))
                    return;

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_POUNDING:
                            DoCastVictim(SPELL_POUNDING);
                            Talk(SAY_POUNDING);
                            events.ScheduleEvent(EVENT_POUNDING, 15000);
                            break;
                        case EVENT_ARCANE_ORB:
                        {
                            Unit* target = NULL;
                            std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
                            std::vector<Unit*> target_list;
                            for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr != t_list.end(); ++itr)
                            {
                                target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
                                if (!target)
                                    continue;
                                // exclude pets & totems, 18 yard radius minimum
                                if (target->GetTypeId() == TYPEID_PLAYER && target->IsAlive() && !target->IsWithinDist(me, 18, false))
                                    target_list.push_back(target);
                                target = NULL;
                            }

                            if (!target_list.empty())
                                target = *(target_list.begin() + rand32() % target_list.size());
                            else
                                target = me->GetVictim();

                            if (target)
                                me->CastSpell(target, SPELL_ARCANE_ORB, false, NULL, NULL);

                            events.ScheduleEvent(EVENT_ARCANE_ORB, 3000);
                            break;
                        }
                        case EVENT_KNOCK_AWAY:
                            DoCastVictim(SPELL_KNOCK_AWAY);
                            // Drop 25% aggro
                            if (DoGetThreat(me->GetVictim()))
                                DoModifyThreatPercent(me->GetVictim(), -25);

                            events.ScheduleEvent(EVENT_KNOCK_AWAY, 30000);
                            break;
                        case EVENT_BERSERK:
                            if (!Enraged)
                            {
                                DoCast(me, SPELL_BERSERK);
                                Enraged = true;
                            }
                            break;
                        default:
                            break;
                    }
                }

                DoMeleeAttackIfReady();

                EnterEvadeIfOutOfCombatArea(diff);
            }
开发者ID:beyourself,项目名称:DeathCore_6.x,代码行数:68,代码来源:boss_void_reaver.cpp

示例10: UpdateAI

    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim() )
            return;

        // Pounding
        if(Pounding_Timer < diff)
        {
            DoCast(m_creature->getVictim(),SPELL_POUNDING);

            switch(rand()%2)
            {
            case 0: DoScriptText(SAY_POUNDING1, m_creature); break;
            case 1: DoScriptText(SAY_POUNDING2, m_creature); break;
            }
             Pounding_Timer = 15000;                         //cast time(3000) + cooldown time(12000)
        }else Pounding_Timer -= diff;

        // Arcane Orb
        if(ArcaneOrb_Timer < diff)
        {
            Unit *target = NULL;
            std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
            std::vector<Unit *> target_list;
            for(std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
            {
                target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
                                                            //18 yard radius minimum
                if(target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive() && target->GetDistance2d(m_creature) >= 18)
                    target_list.push_back(target);
                target = NULL;
            }
            if(target_list.size())
                target = *(target_list.begin()+rand()%target_list.size());

            if (target)
                m_creature->CastSpell(target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(), SPELL_ARCANE_ORB, false);

            ArcaneOrb_Timer = 3000;
        }else ArcaneOrb_Timer -= diff;

        // Single Target knock back, reduces aggro
        if(KnockAway_Timer < diff)
        {
            DoCast(m_creature->getVictim(),SPELL_KNOCK_AWAY);

            //Drop 25% aggro
            if(DoGetThreat(m_creature->getVictim()))
                DoModifyThreatPercent(m_creature->getVictim(),-25);

            KnockAway_Timer = 30000;
        }else KnockAway_Timer -= diff;

        //Berserk
        if(Berserk_Timer < diff && !Enraged)
        {
            DoCast(m_creature,SPELL_BERSERK);
            Enraged = true;
        }else Berserk_Timer -= diff;

        DoMeleeAttackIfReady();
    }
开发者ID:adan830,项目名称:QuaDCore,代码行数:62,代码来源:boss_void_reaver.cpp

示例11: UpdateAI

    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
            return;

        if( m_creature->getVictim() && m_creature->isAlive())
        {
            if (!PhaseTwo && ShadowWordPain_Timer < diff)
            {
                DoCast(m_creature->getVictim(),SPELL_SHADOWWORDPAIN);
                ShadowWordPain_Timer = 15000;
            }else ShadowWordPain_Timer -= diff;

            if (!PhaseTwo && Mark_Timer < diff)
            {
                markedTarget = SelectUnit(SELECT_TARGET_RANDOM,0);

                DoCast(markedTarget,SPELL_MARK);
                Mark_Timer = 15000;
            }else Mark_Timer -= diff;

            if (Summon_Timer < diff && Counter < 31)
            {
                Unit* target = NULL;
                target = SelectUnit(SELECT_TARGET_RANDOM,0);

                Panther = m_creature->SummonCreature(15101,-11532.79980,-1649.6734,41.4800,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);

                if(markedTarget && Panther )
                {
                    DoScriptText(SAY_FEAST_PANTHER, m_creature, markedTarget);
                    Panther ->AI()->AttackStart(markedTarget);
                }else if(Panther && target) Panther ->AI()->AttackStart(target);

                Panther = m_creature->SummonCreature(15101,-11532.9970,-1606.4840,41.2979,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);

                if(markedTarget && Panther )
                    Panther ->AI()->AttackStart(markedTarget);
                else if(Panther && target)
                     Panther ->AI()->AttackStart(target);

                Counter++;
                Summon_Timer = 5000;
            }else Summon_Timer -= diff;

            if (Vanish_Timer < diff)
            {
                //Invisble Model
                m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11686);
                m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                //m_creature->CombatStop();
                DoResetThreat();
                VanishedOnce = true;
                Vanish_Timer = 45000;
                Visible_Timer = 6000;
            }else Vanish_Timer -= diff;

            if (VanishedOnce)
            {
                if(Visible_Timer < diff)
                {
                    Unit* target = NULL;
                    target = SelectUnit(SELECT_TARGET_RANDOM,0);
                    //The Panther Model
                    m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15215);
                    m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);

                    const CreatureInfo *cinfo = m_creature->GetCreatureInfo();
                    m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35)));
                    m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35)));
                    m_creature->UpdateDamagePhysical(BASE_ATTACK);
                    if(target)
                        AttackStart(target);
                    //The Panther Model
                    m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15215);
                    m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                    PhaseTwo = true;
                }else Visible_Timer -= diff;
            }

            //Cleave_Timer
            if(PhaseTwo && Cleave_Timer < diff)
            {
                DoCast(m_creature->getVictim(), SPELL_CLEAVE);
                Cleave_Timer = 16000;
            }Cleave_Timer -=diff;

            //Gouge_Timer
            if(PhaseTwo && Gouge_Timer < diff)
            {
                DoCast(m_creature->getVictim(), SPELL_GOUGE);
                if(DoGetThreat(m_creature->getVictim()))
                    DoModifyThreatPercent(m_creature->getVictim(),-80);

                Gouge_Timer = 17000+rand()%10000;
            }else Gouge_Timer -= diff;

            DoMeleeAttackIfReady();
        }
    }
开发者ID:Zekom,项目名称:NeoCore,代码行数:100,代码来源:boss_arlokk.cpp

示例12: UpdateAI

            void UpdateAI(const uint32 uiDiff)
            {
                if (!UpdateVictim())
                    return;

                if (!m_bIsPhaseTwo)
                {
                    if (m_uiShadowWordPain_Timer <= uiDiff)
                    {
                        DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN);
                        m_uiShadowWordPain_Timer = 15000;
                    }
                    else
                        m_uiShadowWordPain_Timer -= uiDiff;

                    if (m_uiMark_Timer <= uiDiff)
                    {
                        Unit *pMarkedTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);

                        if (pMarkedTarget)
                        {
                            DoCast(pMarkedTarget, SPELL_MARK);
                            MarkedTargetGUID = pMarkedTarget->GetGUID();
                        }
                        else
                            sLog.outError("TSCR: boss_arlokk could not accuire pMarkedTarget.");

                        m_uiMark_Timer = 15000;
                    }
                    else
                        m_uiMark_Timer -= uiDiff;
                }
                else
                {
                    //Cleave_Timer
                    if (m_uiCleave_Timer <= uiDiff)
                    {
                        DoCast(me->getVictim(), SPELL_CLEAVE);
                        m_uiCleave_Timer = 16000;
                    }
                    else
                        m_uiCleave_Timer -= uiDiff;

                    //Gouge_Timer
                    if (m_uiGouge_Timer <= uiDiff)
                    {
                        DoCast(me->getVictim(), SPELL_GOUGE);

                        DoModifyThreatPercent(me->getVictim(), -80);

                        m_uiGouge_Timer = 17000+rand()%10000;
                    }
                    else
                        m_uiGouge_Timer -= uiDiff;
                }

                if (m_uiSummonCount <= 30)
                {
                    if (m_uiSummon_Timer <= uiDiff)
                    {
                        DoSummonPhanters();
                        m_uiSummon_Timer = 5000;
                    }
                    else
                        m_uiSummon_Timer -= uiDiff;
                }

                if (m_uiVanish_Timer <= uiDiff)
                {
                    //Invisble Model
                    me->SetDisplayId(MODEL_ID_BLANK);
                    me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);

                    me->AttackStop();
                    DoResetThreat();

                    m_bIsVanished = true;

                    m_uiVanish_Timer = 45000;
                    m_uiVisible_Timer = 6000;
                }
                else
                    m_uiVanish_Timer -= uiDiff;

                if (m_bIsVanished)
                {
                    if (m_uiVisible_Timer <= uiDiff)
                    {
                        //The Panther Model
                        me->SetDisplayId(MODEL_ID_PANTHER);
                        me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);

                        const CreatureInfo *cinfo = me->GetCreatureInfo();
                        me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35)));
                        me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35)));
                        me->UpdateDamagePhysical(BASE_ATTACK);

                        if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
                            AttackStart(pTarget);

//.........这里部分代码省略.........
开发者ID:CorpVin,项目名称:SkyFireEMU_420,代码行数:101,代码来源:boss_arlokk.cpp

示例13: UpdateAI

        void UpdateAI(const uint32 diff)
        {
            if (!UpdateVictim())
                return;

            //ArcaneMissiles_Timer
            if (ArcaneMissiles_Timer <= diff)
            {
                DoCast(me->getVictim(), SPELL_ARCANEMISSILES);
                ArcaneMissiles_Timer = 8000;
            } else ArcaneMissiles_Timer -= diff;

            //ShadowShield_Timer
            if (ShadowShield_Timer <= diff)
            {
                DoCast(me, SPELL_SHADOWSHIELD);
                ShadowShield_Timer = 14000 + rand()%14000;
            } else ShadowShield_Timer -= diff;

            //Curse_Timer
            if (Curse_Timer <= diff)
            {
                DoCast(me->getVictim(), SPELL_CURSE);
                Curse_Timer = 15000 + rand()%12000;
            } else Curse_Timer -= diff;

            //Teleporting Random Target to one of the six pre boss rooms and spawn 3-4 skeletons near the gamer.
            //We will only telport if gandling has more than 3% of hp so teleported gamers can always loot.
            if (me->GetHealth()*100 / me->GetMaxHealth() > 3)
            {
                if (Teleport_Timer <= diff)
                {
                    Unit *pTarget = NULL;
                    pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
                    if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
                    {
                        if (DoGetThreat(pTarget))
                            DoModifyThreatPercent(pTarget, -100);

                        Creature *Summoned = NULL;
                        switch(rand()%6)
                        {
                            case 0:
                                DoTeleportPlayer(pTarget, 250.0696,0.3921,84.8408,3.149);
                                Summoned = me->SummonCreature(16119,254.2325,0.3417,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
                                if (Summoned)
                                    Summoned->AI()->AttackStart(pTarget);
                                Summoned = me->SummonCreature(16119,257.7133,4.0226,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
                                if (Summoned)
                                    Summoned->AI()->AttackStart(pTarget);
                                Summoned = me->SummonCreature(16119,258.6702,-2.60656,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
                                if (Summoned)
                                    Summoned->AI()->AttackStart(pTarget);
                                break;
                            case 1:
                                DoTeleportPlayer(pTarget, 181.4220,-91.9481,84.8410,1.608);
                                Summoned = me->SummonCreature(16119,184.0519,-73.5649,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
                                if (Summoned)
                                    Summoned->AI()->AttackStart(pTarget);
                                Summoned = me->SummonCreature(16119,179.5951,-73.7045,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
                                if (Summoned)
                                    Summoned->AI()->AttackStart(pTarget);
                                Summoned = me->SummonCreature(16119,180.6452,-78.2143,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
                                if (Summoned)
                                    Summoned->AI()->AttackStart(pTarget);
                                Summoned = me->SummonCreature(16119,283.2274,-78.1518,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
                                if (Summoned)
                                    Summoned->AI()->AttackStart(pTarget);
                                break;
                            case 2:
                                DoTeleportPlayer(pTarget, 95.1547,-1.8173,85.2289,0.043);
                                Summoned = me->SummonCreature(16119,100.9404,-1.8016,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
                                if (Summoned)
                                    Summoned->AI()->AttackStart(pTarget);
                                Summoned = me->SummonCreature(16119,101.3729,0.4882,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
                                if (Summoned)
                                    Summoned->AI()->AttackStart(pTarget);
                                Summoned = me->SummonCreature(16119,101.4596,-4.4740,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
                                if (Summoned)
                                    Summoned->AI()->AttackStart(pTarget);
                                break;
                            case 3:
                                DoTeleportPlayer(pTarget, 250.0696,0.3921,72.6722,3.149);
                                Summoned = me->SummonCreature(16119,240.34481,0.7368,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
                                if (Summoned)
                                    Summoned->AI()->AttackStart(pTarget);
                                Summoned = me->SummonCreature(16119,240.3633,-2.9520,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
                                if (Summoned)
                                    Summoned->AI()->AttackStart(pTarget);
                                Summoned = me->SummonCreature(16119,240.6702,3.34949,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
                                if (Summoned)
                                    Summoned->AI()->AttackStart(pTarget);
                                break;
                            case 4:
                                DoTeleportPlayer(pTarget, 181.4220,-91.9481,70.7734,1.608);
                                Summoned = me->SummonCreature(16119,184.0519,-73.5649,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
                                if (Summoned)
                                    Summoned->AI()->AttackStart(pTarget);
                                Summoned = me->SummonCreature(16119,179.5951,-73.7045,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
                                if (Summoned)
//.........这里部分代码省略.........
开发者ID:InkVisible,项目名称:wow,代码行数:101,代码来源:boss_darkmaster_gandling.cpp

示例14: UpdateAI

        void UpdateAI(const uint32 diff)
        {
            if (Invisible && Invisible_Timer <= diff)
            {
                //Become visible again
                me->setFaction(14);
                me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                me->SetDisplayId(11073);     //Jandice Model
                Invisible = false;
            } else if (Invisible)
            {
                Invisible_Timer -= diff;
                //Do nothing while invisible
                return;
            }

            //Return since we have no target
            if (!UpdateVictim())
                return;

            //CurseOfBlood_Timer
            if (CurseOfBlood_Timer <= diff)
            {
                //Cast
                DoCast(me->getVictim(), SPELL_CURSEOFBLOOD);

                //45 seconds
                CurseOfBlood_Timer = 30000;
            } else CurseOfBlood_Timer -= diff;

            //Illusion_Timer
            if (!Invisible && Illusion_Timer <= diff)
            {
                //Interrupt any spell casting
                me->InterruptNonMeleeSpells(false);
                me->setFaction(35);
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                me->SetDisplayId(11686);  // Invisible Model
                DoModifyThreatPercent(me->getVictim(), -99);

                //Summon 10 Illusions attacking random gamers
                Unit *pTarget = NULL;
                for (uint8 i = 0; i < 10; ++i)
                {
                    pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
                    if (pTarget)
                        SummonIllusions(pTarget);
                }
                Invisible = true;
                Invisible_Timer = 3000;

                //25 seconds until we should cast this agian
                Illusion_Timer = 25000;
            } else Illusion_Timer -= diff;

            //            //Illusion_Timer
            //            if (Illusion_Timer <= diff)
            //            {
            //                  //Cast
            //                DoCast(me->getVictim(), SPELL_ILLUSION);
            //
            //                  //3 Illusion will be summoned
            //                  if (Illusioncounter < 3)
            //                  {
            //                    Illusion_Timer = 500;
            //                    ++Illusioncounter;
            //                  }
            //                  else {
            //                      //15 seconds until we should cast this again
            //                      Illusion_Timer = 15000;
            //                      Illusioncounter = 0;
            //                  }
            //
            //            } else Illusion_Timer -= diff;

            DoMeleeAttackIfReady();
        }
开发者ID:antiker,项目名称:StarGateEmu-Projekt,代码行数:77,代码来源:boss_jandice_barov.cpp

示例15: UpdateAI

            void UpdateAI(uint32 diff)
            {
                if (!UpdateVictim())
                    return;

                events.Update(diff);

                if (me->HasUnitState(UNIT_STATE_CASTING))
                    return;

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_BRAINWASHTOTEM:
                            DoCast(me, SPELL_BRAINWASHTOTEM);
                            events.ScheduleEvent(EVENT_BRAINWASHTOTEM, urand(18000, 26000));
                            break;
                        case EVENT_POWERFULLHEALINGWARD: // HACK
                            //DoCast(me, SPELL_POWERFULLHEALINGWARD);
                            me->SummonCreature(14987, me->GetPositionX()+3, me->GetPositionY()-2, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
                            events.ScheduleEvent(EVENT_POWERFULLHEALINGWARD, urand(14000, 20000));
                            break;
                        case EVENT_HEX:
                            if (Unit* target = me->GetVictim())
                            {
                                DoCast(target, SPELL_HEX, true);
                                if (DoGetThreat(target))
                                    DoModifyThreatPercent(target, -80);
                            }
                            events.ScheduleEvent(EVENT_HEX, urand(12000, 20000));
                            break;
                        case EVENT_DELUSIONSOFJINDO: // HACK
                            // Casting the delusion curse with a shade so shade will attack the same target with the curse.
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                            {
                                DoCast(target, SPELL_DELUSIONSOFJINDO);
                                Creature* Shade = me->SummonCreature(NPC_SHADE_OF_JINDO, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
                                if (Shade)
                                    Shade->AI()->AttackStart(target);
                            }
                            events.ScheduleEvent(EVENT_DELUSIONSOFJINDO, urand(4000, 12000));
                            break;
                        case EVENT_TELEPORT: // Possible HACK
                            // Teleports a random player and spawns 9 Sacrificed Trolls to attack player
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                            {
                                DoTeleportPlayer(target, TeleportLoc.m_positionX, TeleportLoc.m_positionY, TeleportLoc.m_positionZ, TeleportLoc.m_orientation);
                                if (DoGetThreat(me->GetVictim()))
                                    DoModifyThreatPercent(target, -100);
                                Creature* SacrificedTroll;
                                SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX()+2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
                                if (SacrificedTroll)
                                    SacrificedTroll->AI()->AttackStart(target);
                                SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX()-2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
                                if (SacrificedTroll)
                                    SacrificedTroll->AI()->AttackStart(target);
                                SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX()+4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
                                if (SacrificedTroll)
                                    SacrificedTroll->AI()->AttackStart(target);
                                SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX()-4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
                                if (SacrificedTroll)
                                    SacrificedTroll->AI()->AttackStart(target);
                                SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX(), target->GetPositionY()+2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
                                if (SacrificedTroll)
                                    SacrificedTroll->AI()->AttackStart(target);
                                SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX(), target->GetPositionY()-2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
                                if (SacrificedTroll)
                                    SacrificedTroll->AI()->AttackStart(target);
                                SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX(), target->GetPositionY()+4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
                                if (SacrificedTroll)
                                    SacrificedTroll->AI()->AttackStart(target);
                                SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX(), target->GetPositionY()-4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
                                if (SacrificedTroll)
                                    SacrificedTroll->AI()->AttackStart(target);
                                SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX()+3, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
                                if (SacrificedTroll)
                                    SacrificedTroll->AI()->AttackStart(target);
                            }
                            events.ScheduleEvent(EVENT_TELEPORT, urand(15000, 23000));
                            break;
                        default:
                            break;
                    }
                }

                DoMeleeAttackIfReady();
            }
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:88,代码来源:boss_jindo.cpp


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