コード例 #1
0
ファイル: MoveSplineInit.cpp プロジェクト: Maduse/server
void MoveSplineInit::Move(PathFinder const* pfinder)
{
    MovebyPath(pfinder->getPath());
    if (pfinder->GetTransport())
        SetTransport(pfinder->GetTransport()->GetGUIDLow());
    if (pfinder->getPathType() & PATHFIND_FLYPATH)
        SetFly();
}
コード例 #2
0
ファイル: boss_durumu.cpp プロジェクト: Exodius/JadeCore548
 void init()
 {
     SetFly(true);
     me->SetHomePosition(CenterDurumu);
     me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
     me->SetReactState(REACT_DEFENSIVE);
     me->SetVisible(false);
     me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
 }
コード例 #3
0
ファイル: boss_saviana.cpp プロジェクト: Krath/scriptdev2
    void UpdateAI(const uint32 diff)
    {
        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
            return;

        switch (getStage())
        {
            case 0: //GROUND
                 timedCast(SPELL_FLAME_BREATH, diff);

                 if (m_uiEnrageTimer < diff)
                 {
                     if(DoCastSpellIfCan(m_creature, SPELL_ENRAGE) == CAST_OK)
                     {
                         m_uiEnrageTimer = urand(20000,30000);
                         DoScriptText(SAY_ENRAGE, m_creature);
                     }
                 }
                 else m_uiEnrageTimer -= diff;

                 if (m_uiFlyTimer < diff)
                 {
                     setStage(1);
                     m_uiFlyTimer = 50000;
                 }
                 else m_uiFlyTimer -= diff;
                 DoMeleeAttackIfReady();
                 break;

            case 1: //Air phase start
                 SetCombatMovement(false);
                 m_creature->InterruptNonMeleeSpells(true);
                 SetFly(true);
                 StartMovement(1);
                 setStage(2);
                 break;

            case 2: // Wait for movement
                 if (MovementStarted) return;
                 setStage(3);
                 break;

            case 3: // Beacons
                 doBeacon(true);
                 if (m_uiWaitTimer < diff)
                 {
                     setStage(4);
                     m_uiWaitTimer = 5000;
                 }
                 else m_uiWaitTimer -= diff;
                 break;

            case 4: // Conflagate
                 timedCast(SPELL_FLAME_BREATH, diff);
                 if (conflagated)
                     {
                         doBeacon(false);
                         doCast(SPELL_CONFLAGATION);
                         DoScriptText(SAY_SPECIAL, m_creature);
                         goLand = true;
                     };
                 if (goLand)
                     setStage(5);
                 break;

            case 5: //Air phase end
                 StartMovement(0);
                 setStage(6);
                 break;

            case 6: // Wait for movement
                 if (MovementStarted) return;
                 SetFly(false);
                 SetCombatMovement(true);
                 m_creature->GetMotionMaster()->Clear();
                 m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
                 setStage(0);
                 break;

            default:
                break;
        }
    }
コード例 #4
0
ファイル: boss_ragefire.cpp プロジェクト: mynew4/ReanEmu
        void UpdateAI(uint32 const diff)
        {
            if (!UpdateVictim())
                return;

            switch (getStage())
            {
            case 0: //GROUND
                if (m_uiFlameBreathTimer <= diff)
                {
                    DoCast(SPELL_FLAME_BREATH);
                    m_uiFlameBreathTimer = urand(5*IN_MILLISECONDS,15*IN_MILLISECONDS);
                } else m_uiFlameBreathTimer -= diff;

                if (m_uiEnrage <= diff)
                {
                    DoCast(SPELL_ENRAGE);
                    m_uiEnrage = urand(20*IN_MILLISECONDS,40*IN_MILLISECONDS);
                    DoScriptText(-1666405,me);
                } else m_uiEnrage -= diff;

                if ( HealthBelowPct(81) ) setStage(1);
                break;

            case 1: //Air phase start
                SetCombatMovement(false);
                me->InterruptNonMeleeSpells(true);
                SetFly(true);
                doBeacon(true);
                StartMovement(1);
                setStage(2);
                break;

            case 2: // Wait for movement
                if (MovementStarted) return;
                DoCast(SPELL_CONFLAGATION);
                DoScriptText(-1666404,me);
                setStage(3);
                break;

            case 3: // Wait for cast finish
                if (!me->IsNonMeleeSpellCasted(false))
                {
                    doBeacon(false);
                    setStage(4);
                }
                break;

            case 4: // Air phase
                if (m_uiFlameBreathTimer <= diff)
                {
                    DoCast(SPELL_FLAME_BREATH);
                    m_uiFlameBreathTimer = urand(5*IN_MILLISECONDS,15*IN_MILLISECONDS);
                } else m_uiFlameBreathTimer -= diff;

                if (m_uiBeakonTimer <= diff)
                {
                    doBeacon(true);
                    DoCast(SPELL_CONFLAGATION);
                    m_uiBeakonTimer = urand(12*IN_MILLISECONDS,22*IN_MILLISECONDS);
                } else m_uiBeakonTimer -= diff;

                if (m_uiConflagrateTimer <= diff)
                {
                    if (conflagated)
                    {
                        //DoCast(SPELL_CONFLAGATION_1);
                        doBeacon(false);
                    }
                    m_uiConflagrateTimer = 5*IN_MILLISECONDS;
                } else m_uiConflagrateTimer -= diff;

                if ( HealthBelowPct(61) ) setStage(5);
                break;

            case 5: //Air phase end
                StartMovement(0);
                setStage(6);
                break;

            case 6: // Wait for movement
                if (MovementStarted) return;
                SetFly(false);
                SetCombatMovement(true);
                me->GetMotionMaster()->Clear();
                me->GetMotionMaster()->MoveChase(me->getVictim());
                setStage(7);
                break;

            case 7: //GROUND
                if (m_uiFlameBreathTimer <= diff)
                {
                    DoCast(SPELL_FLAME_BREATH);
                    m_uiFlameBreathTimer = urand(5*IN_MILLISECONDS,15*IN_MILLISECONDS);
                } else m_uiFlameBreathTimer -= diff;

                if (m_uiEnrage <= diff)
                {
                    DoCast(SPELL_ENRAGE);
                    m_uiEnrage = urand(20*IN_MILLISECONDS,40*IN_MILLISECONDS);
                    DoScriptText(-1666405,me);
                } else m_uiEnrage -= diff;

                if ( HealthBelowPct(41) ) setStage(8);
                break;

            case 8: //Air phase start
                SetCombatMovement(false);
                me->InterruptNonMeleeSpells(true);
                SetFly(true);
                doBeacon(true);
                StartMovement(1);
                setStage(9);
                break;

            case 9: // Wait for movement
                if (MovementStarted) return;
                DoCast(SPELL_CONFLAGATION);
                DoScriptText(-1666404,me);
                setStage(10);
                break;

            case 10: // Wait for cast finish
                if (!me->IsNonMeleeSpellCasted(false))
                {
                    doBeacon(false);
                    setStage(11);
                };
                break;

            case 11: // Air phase
                if (m_uiFlameBreathTimer <= diff)
                {
                    DoCast(SPELL_FLAME_BREATH);
                    m_uiFlameBreathTimer = urand(5*IN_MILLISECONDS,15*IN_MILLISECONDS);
                } else m_uiFlameBreathTimer -= diff;

                if (m_uiBeakonTimer <= diff)
                {
                    doBeacon(true);
                    DoCast(SPELL_CONFLAGATION);
                    m_uiBeakonTimer = urand(12*IN_MILLISECONDS,22*IN_MILLISECONDS);
                } else m_uiBeakonTimer -= diff;

                if (m_uiConflagrateTimer <= diff)
                {
                    if (conflagated)
                    {
                        //DoCast(SPELL_CONFLAGATION_1);
                        doBeacon(false);
                    }
                    m_uiConflagrateTimer = 5*IN_MILLISECONDS;
                } else m_uiConflagrateTimer -= diff;

                if ( HealthBelowPct(21) ) setStage(12);
                break;

            case 12: //Air phase end
                StartMovement(0);
                setStage(13);
                break;

            case 13: // Wait for movement
                if (MovementStarted) return;
                SetFly(false);
                SetCombatMovement(true);
                me->GetMotionMaster()->Clear();
                me->GetMotionMaster()->MoveChase(me->getVictim());
                setStage(14);
                break;

            case 14: //GROUND
                if (m_uiFlameBreathTimer <= diff)
                {
                    DoCast(SPELL_FLAME_BREATH);
                    m_uiFlameBreathTimer = urand(5*IN_MILLISECONDS,15*IN_MILLISECONDS);
                } else m_uiFlameBreathTimer -= diff;

                if (m_uiEnrage <= diff)
                {
                    DoCast(SPELL_ENRAGE);
                    m_uiEnrage = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS);
                    DoScriptText(-1666405,me);
                } else m_uiEnrage -= diff;
                break;

            default:
                break;
            }

            DoMeleeAttackIfReady();
        }
コード例 #5
0
ファイル: boss_saviana.cpp プロジェクト: Ancient/scriptdev2
    void UpdateAI(const uint32 diff)
    {
        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
            return;

        switch (getStage())
        {
            case 0: //GROUND
                 timedCast(SPELL_FLAME_BREATH, diff);
                 timedCast(SPELL_ENRAGE, diff);
                 if ( m_creature->GetHealthPercent() <= 80.0f) setStage(1);
                 break;

            case 1: //Air phase start
                 SetCombatMovement(false);
                 m_creature->InterruptNonMeleeSpells(true);
                 SetFly(true);
                 doBeacon(true);
                 StartMovement(1);
                 setStage(2);
                 break;

            case 2: // Wait for movement
                 if (MovementStarted) return;
                 doCast(SPELL_CONFLAGATION);
                 DoScriptText(-1666404,m_creature);
                 setStage(3);
                 break;

            case 3: // Wait for cast finish
                 if (!m_creature->IsNonMeleeSpellCasted(false))
                 {
                     doBeacon(false);
                     setStage(4);
                 };
                 break;

            case 4: // Air phase
                 timedCast(SPELL_FLAME_BREATH, diff);
                 if (timedQuery(SPELL_BEACON, diff))
                     {
                         doBeacon(true);
                         doCast(SPELL_CONFLAGATION);
                     };
                 if (conflagated && timedQuery(SPELL_CONFLAGATION_1, diff))
                     {
                         doBeacon(false);
                     };
                 if ( m_creature->GetHealthPercent() <= 60.0f) setStage(5);
                 break;

            case 5: //Air phase end
                 StartMovement(0);
                 setStage(6);
                 break;

            case 6: // Wait for movement
                 if (MovementStarted) return;
                 SetFly(false);
                 SetCombatMovement(true);
                 m_creature->GetMotionMaster()->Clear();
                 m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
                 setStage(7);
                 break;

            case 7: //GROUND
                 timedCast(SPELL_FLAME_BREATH, diff);
                 timedCast(SPELL_ENRAGE, diff);
                 if ( m_creature->GetHealthPercent() <= 40.0f) setStage(8);
                 break;

            case 8: //Air phase start
                 SetCombatMovement(false);
                 m_creature->InterruptNonMeleeSpells(true);
                 SetFly(true);
                 doBeacon(true);
                 StartMovement(1);
                 setStage(9);
                 break;

            case 9: // Wait for movement
                 if (MovementStarted) return;
                 doCast(SPELL_CONFLAGATION);
                 DoScriptText(-1666404,m_creature);
                 setStage(10);
                 break;

            case 10: // Wait for cast finish
                 if (!m_creature->IsNonMeleeSpellCasted(false))
                 {
                     doBeacon(false);
                     setStage(11);
                 };
                 break;

            case 11: // Air phase
                 timedCast(SPELL_FLAME_BREATH, diff);
                 if (timedQuery(SPELL_BEACON, diff))
                     {
                         doBeacon(true);
                         doCast(SPELL_CONFLAGATION);
                     };
                 if (conflagated && timedQuery(SPELL_CONFLAGATION_1, diff))
                     {
                         doBeacon(false);
                     };
                 if ( m_creature->GetHealthPercent() <= 20.0f) setStage(12);
                 break;

            case 12: //Air phase end
                 StartMovement(0);
                 setStage(13);
                 break;

            case 13: // Wait for movement
                 if (MovementStarted) return;
                 SetFly(false);
                 SetCombatMovement(true);
                 m_creature->GetMotionMaster()->Clear();
                 m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
                 setStage(14);
                 break;

            case 14: //GROUND
                 timedCast(SPELL_FLAME_BREATH, diff);
                 timedCast(SPELL_ENRAGE, diff*2);
                 break;

            default:
                break;
        }

        DoMeleeAttackIfReady();
    }
コード例 #6
0
        void UpdateAI(const uint32 diff)
        {
            if (!UpdateVictim())
                return;

            switch (getStage())
            {
                case 0: //GROUND
                     if (m_uiFlameBreathTimer <= diff)
                     {
						 if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL || GetDifficulty() == RAID_DIFFICULTY_25MAN_HEROIC)
							DoCast(SPELL_FLAME_BREATH_25);
						 else DoCast(SPELL_FLAME_BREATH_10);
                         m_uiFlameBreathTimer = urand(12*IN_MILLISECONDS,13*IN_MILLISECONDS);
                     } else m_uiFlameBreathTimer -= diff;

                     if (m_uiEnrage <= diff)
                     {
                         DoCast(SPELL_ENRAGE);
                         m_uiEnrage = urand(17*IN_MILLISECONDS,20*IN_MILLISECONDS);
                         DoScriptText(-1666404,me);
                     } else m_uiEnrage -= diff;

					 if (m_uiBeakonTimer <= diff)
                     {
                         doBeacon(true);
                         setStage(1);
                         m_uiBeakonTimer = urand(30*IN_MILLISECONDS,31*IN_MILLISECONDS);
                     } else m_uiBeakonTimer -= diff;

                     break;

                case 1: //Air phase start
                     SetCombatMovement(false);
                     me->InterruptNonMeleeSpells(true);
                     SetFly(true);
                     doBeacon(true);
                     StartMovement(1);
                     setStage(2);
                     break;

                case 2: // Wait for movement
                     if (MovementStarted) return;
                     DoCast(SPELL_CONFLAGATION);
                     DoScriptText(-1666403,me);
                     setStage(3);
                     break;

                case 3: // Wait for cast finish
                     if (!me->IsNonMeleeSpellCasted(false))
                     {
                         doBeacon(false);
                         setStage(4);
                     }
                     break;

                case 4: // Air phase
                    // if (m_uiConflagrateTimer <= diff)
                    // {
                        // if (conflagated)
                       //  { 
                             //DoCast(SPELL_CONFLAGATION_1);
                             doBeacon(false);
                       //  }
						 setStage(5);
                     //    m_uiConflagrateTimer = 5*IN_MILLISECONDS;
                   //  } else m_uiConflagrateTimer -= diff;
                     break;

                case 5: //Air phase end
                     StartMovement(0);
                     setStage(6);
                     break;

                case 6: // Wait for movement
                     if (MovementStarted) return;
                     SetFly(false);
                     SetCombatMovement(true);
                     me->GetMotionMaster()->Clear();
                     me->GetMotionMaster()->MoveChase(me->getVictim());
					 for (std::list<Unit*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
					 {
						 Unit *pTemp = (*itr);
						 me->CastSpell(pTemp, SPELL_CONFLAGATION_2, true);
					 }
					// DoCast(SPELL_CONFLAGATION_2);
					 playerList.clear();
					 setStage(0);
                     break;

                default:
                    break;
            }

            DoMeleeAttackIfReady();
        }