Exemplo n.º 1
0
 void Aggro(Unit* who)
 {
     switch(rand()%4)
     {
         case 0:
             DoYell(THRALL_RANDOM_AGGRO1,LANG_UNIVERSAL,NULL);
             DoPlaySoundToSet(m_creature,SOUND_RANDOM_AGGRO1);
             break;
         case 1:
             DoYell(THRALL_RANDOM_AGGRO2,LANG_UNIVERSAL,NULL);
             DoPlaySoundToSet(m_creature,SOUND_RANDOM_AGGRO2);
             break;
         case 2:
             DoYell(THRALL_RANDOM_AGGRO3,LANG_UNIVERSAL,NULL);
             DoPlaySoundToSet(m_creature,SOUND_RANDOM_AGGRO3);
             break;
         case 3:
             DoYell(THRALL_RANDOM_AGGRO4,LANG_UNIVERSAL,NULL);
             DoPlaySoundToSet(m_creature,SOUND_RANDOM_AGGRO4);
             break;
     }
     if( m_creature->IsMounted() )
     {
         DoUnmount();
         HadMount = true;
     }
 }
Exemplo n.º 2
0
    void UpdateAI(const uint32 diff)
    {
        npc_escortAI::UpdateAI(diff);

        if( InCombat && m_creature->getVictim() )
        {
            //add his abilities'n-crap here

            if( !LowHp && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) )
            {
                switch(rand()%2)
                {
                    case 0:
                        DoYell(THRALL_RANDOM_LOW_HP1,LANG_UNIVERSAL,NULL);
                        DoPlaySoundToSet(m_creature,SOUND_RANDOM_LOW_HP1);
                        break;
                    case 1:
                        DoYell(THRALL_RANDOM_LOW_HP2,LANG_UNIVERSAL,NULL);
                        DoPlaySoundToSet(m_creature,SOUND_RANDOM_LOW_HP2);
                        break;
                }
                LowHp = true;
            }
        }
    }
Exemplo n.º 3
0
    void CastShootOrMultishot()
    {
        switch(rand()%2)
        {
            case 0:
                //Shoot
                //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage.
                DoCast(m_creature->getVictim(), SPELL_SHOOT);
                break;
            case 1:
                //Multishot
                //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage.
                DoCast(m_creature->getVictim(), SPELL_MULTI_SHOT);
                break;
        }

        if(rand()%3)
        {
            switch(rand()%2)
            {
                case 0:
                    DoPlaySoundToSet(m_creature, SOUND_BOWSHOT1);
                    DoYell(SAY_BOWSHOT1, LANG_UNIVERSAL, NULL);
                    break;
                case 1:
                    DoPlaySoundToSet(m_creature, SOUND_BOWSHOT2);
                    DoYell(SAY_BOWSHOT2, LANG_UNIVERSAL, NULL);
                    break;
            }
        }
    }
Exemplo n.º 4
0
    void AttackStart(Unit *who)
    {
        if (!who)
            return;

        if (who->isTargetableForAttack() && who!= m_creature)
        {
            DoStartMeleeAttack(who);
            InCombat = true;
            
            //Switch between 3 different aggro saying
            switch (rand()%3)
                {
                case 0:
                    DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
                    break;

                case 1:
                    DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
                    break;

                case 2:
                    DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL);
                    break;
                }
        }
    }
Exemplo n.º 5
0
    void StartEvent()
    {
        switch(rand()%4)
        {
            case 0:
                DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
                DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
                break;
            case 1:
                DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
                DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
                break;
            case 2:
                DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
                DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
                break;
            case 3:
                DoPlaySoundToSet(m_creature, SOUND_AGGRO4);
                DoYell(SAY_AGGRO4, LANG_UNIVERSAL, NULL);
                break;
        }

        Phase = 1;

        if(pInstance)
            pInstance->SetData(DATA_LADYVASHJEVENT, 1);
    }
Exemplo n.º 6
0
    void UpdateAI(const uint32 diff)
    {
        // we're still doing awaken animation
        if (wakingUp && Awaken_Timer >= 0) {
            Awaken_Timer -= diff;
            return;        // dont do anything until we are done
        } else if (wakingUp && Awaken_Timer <= 0) {
            wakingUp = false;
            AttackStart(Unit::GetUnit(*m_creature, pInstance->GetData64(0)));
            return;     // dont want to continue until we finish the AttackStart method
        }

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


        // wake a wall minion
        if (WallMinionTimer < diff) {
            pInstance->SetData (NULL, 2);

            WallMinionTimer = 10000;
        } else WallMinionTimer -= diff;

        //If we are <66 summon the guardians
        if ( !guardiansAwake && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 66) {
            ActivateMinion(pInstance->GetData64(5),true);   // EarthenGuardian1
            ActivateMinion(pInstance->GetData64(6),true);   // EarthenGuardian2
            ActivateMinion(pInstance->GetData64(7),true);   // EarthenGuardian3
            ActivateMinion(pInstance->GetData64(8),true);   // EarthenGuardian4
            ActivateMinion(pInstance->GetData64(9),true);   // EarthenGuardian5
            ActivateMinion(pInstance->GetData64(10),false); // EarthenGuardian6
            DoYell(SAY_SUMMON,LANG_UNIVERSAL, NULL);
            DoPlaySoundToSet(m_creature, SOUND_SUMMON);
            guardiansAwake = true;
        }

        //If we are <33 summon the vault walkers
        if ( !vaultWalkersAwake && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 33) {
            ActivateMinion(pInstance->GetData64(1),true);    // VaultWalker1
            ActivateMinion(pInstance->GetData64(2),true);    // VaultWalker2
            ActivateMinion(pInstance->GetData64(3),true);    // VaultWalker3
            ActivateMinion(pInstance->GetData64(4),false);    // VaultWalker4
            DoYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL);
            DoPlaySoundToSet(m_creature, SOUND_SUMMON2);
            vaultWalkersAwake = true;
        }


        if (Tremor_Timer < diff)
        {
            //Cast
            DoCast(m_creature->getVictim(),SPELL_GROUND_TREMOR);

            //45 seconds until we should cast this agian
            Tremor_Timer  = 45000;
        }else Tremor_Timer  -= diff;

        DoMeleeAttackIfReady();
    }
Exemplo n.º 7
0
 void EnterPhase(PhaseHalazzi NextPhase)
 {
     switch(NextPhase)
     {
     case PHASE_LYNX:
     case PHASE_ENRAGE:
         if(Phase == PHASE_MERGE)
         {
             m_creature->CastSpell(m_creature, SPELL_TRANSFORM_MERGE, true);
             m_creature->Attack(m_creature->getVictim(), true);
             m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
         }
         if(Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID))
         {
             Lynx->SetVisibility(VISIBILITY_OFF);
             Lynx->setDeathState(JUST_DIED);
         }
         m_creature->SetMaxHealth(600000);
         m_creature->SetHealth(600000 - 150000 * TransformCount);
         FrenzyTimer = 16000;
         SaberlashTimer = 20000;
         ShockTimer = 10000;
         TotemTimer = 12000;
         break;
     case PHASE_SPLIT:
         DoYell(YELL_SPLIT, LANG_UNIVERSAL, NULL);
         DoPlaySoundToSet(m_creature, SOUND_SPLIT);
         m_creature->CastSpell(m_creature, SPELL_TRANSFORM_SPLIT, true);
         break;
     case PHASE_HUMAN:
         //DoCast(m_creature, SPELL_SUMMON_LYNX, true);
         DoSpawnCreature(MOB_SPIRIT_LYNX, 5,5,0,0, TEMPSUMMON_CORPSE_DESPAWN, 0);
         m_creature->SetMaxHealth(400000);
         m_creature->SetHealth(400000);
         ShockTimer = 10000;
         TotemTimer = 12000;
         break;
     case PHASE_MERGE:
         if(Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID))
         {
             DoYell(YELL_MERGE, LANG_UNIVERSAL, NULL);
             DoPlaySoundToSet(m_creature, SOUND_MERGE);
             Lynx->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
             Lynx->GetMotionMaster()->Clear();
             Lynx->GetMotionMaster()->MoveFollow(m_creature, 0, 0);
             m_creature->GetMotionMaster()->Clear();
             m_creature->GetMotionMaster()->MoveFollow(Lynx, 0, 0);
             TransformCount++;
         }break;
     default:
         break;
     }
     Phase = NextPhase;
 }
Exemplo n.º 8
0
    void UpdateAI(const uint32 diff)
    {
        //Return since we have no target
        if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
            return;

        if(FrostArmorTimer < diff)
        {
            DoCast(m_creature, SPELL_FROST_ARMOR);
            FrostArmorTimer = 40000+rand()%20000;
        }else FrostArmorTimer -= diff;
        if(DecayTimer < diff)
        {
            DoCast(m_creature->getVictim(), SPELL_DEATH_AND_DECAY);
            DecayTimer = 60000+rand()%20000;
            switch(rand()%2)
            {
                case 0:
                    DoPlaySoundToSet(m_creature, SOUND_DECAY1);
                    DoYell(SAY_DECAY1, LANG_UNIVERSAL, NULL);
                    break;
                case 1:
                    DoPlaySoundToSet(m_creature, SOUND_DECAY2);
                    DoYell(SAY_DECAY2, LANG_UNIVERSAL, NULL);
                    break;        
            }    
        }else DecayTimer -= diff;
        if(NovaTimer < diff)
        {
            DoCast(m_creature->getVictim(), SPELL_FROST_NOVA);
            NovaTimer = 30000+rand()%15000;
            switch(rand()%2)
            {
                case 0:
                    DoPlaySoundToSet(m_creature, SOUND_NOVA1);
                    DoYell(SAY_NOVA1, LANG_UNIVERSAL, NULL);
                    break;
                case 1:
                    DoPlaySoundToSet(m_creature, SOUND_NOVA2);
                    DoYell(SAY_NOVA2, LANG_UNIVERSAL, NULL);
                    break;        
            }
        }else NovaTimer -= diff;
        if(IceboltTimer < diff)
        {
            DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_ICEBOLT);
            IceboltTimer = 11000+rand()%20000;
        }else IceboltTimer -= diff;

        DoMeleeAttackIfReady();
    }
Exemplo n.º 9
0
void flesh_tentacleAI::JustDied(Unit* killer)
{
    if (!Parent)
    {
        DoYell("Error: No Parent variable", LANG_UNIVERSAL, NULL);
        return;
    }

    Creature* Cthun = Unit::GetCreature(*m_creature, Parent);

    if (Cthun)
        ((cthunAI*)(Cthun->AI()))->FleshTentcleKilled();
    else DoYell("Error: No Cthun", LANG_UNIVERSAL, NULL);
}
Exemplo n.º 10
0
 void KilledUnit()
 {
     switch(rand()%2)
     {
         case 0:
             DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
             DoPlaySoundToSet(me,SOUND_SLAY1);
             break;
         case 1:
             DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
             DoPlaySoundToSet(me,SOUND_SLAY2);
             break;
     }
 }
Exemplo n.º 11
0
    void UpdateAI(const uint32 diff)
    {
        //Return since we have no target
        if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
            return;

        //Sand Breath
        if( SandBreath_Timer < diff )
        {
            if( m_creature->IsNonMeleeSpellCasted(false) )
                m_creature->InterruptNonMeleeSpells(false);

            DoCast(m_creature->getVictim(),SPELL_SAND_BREATH);

            switch(rand()%2)
            {
                case 0:
                    DoYell(SAY_BREATH1,LANG_UNIVERSAL,NULL);
                    DoPlaySoundToSet(m_creature, SOUND_BREATH1);
                    break;
                case 1:
                    DoYell(SAY_BREATH2,LANG_UNIVERSAL,NULL);
                    DoPlaySoundToSet(m_creature, SOUND_BREATH2);
                    break;
            }

            SandBreath_Timer = 25000+rand()%5000;
        }else SandBreath_Timer -= diff;

        if( ImpendingDeath_Timer < diff )
        {
            DoCast(m_creature->getVictim(),SPELL_IMPENDING_DEATH);
            ImpendingDeath_Timer = 30000+rand()%5000;
        }else ImpendingDeath_Timer -= diff;

        if( WingBuffet_Timer < diff )
        {
            if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
                DoCast(target,SPELL_WING_BUFFET);
            WingBuffet_Timer = 25000+rand()%10000;
        }else WingBuffet_Timer -= diff;

        if( Mda_Timer < diff )
        {
            DoCast(m_creature,SPELL_MAGIC_DISRUPTION_AURA);
            Mda_Timer = 15000;
        }else Mda_Timer -= diff;

        DoMeleeAttackIfReady();
    }
Exemplo n.º 12
0
 void Aggro(Unit *who)
 {
     switch(rand()%2)
     {
         case 0:
             DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
             DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
             break;
         case 1:
             DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
             DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
             break;
     }
 }
Exemplo n.º 13
0
 void KilledUnit(Unit* victim)
 {
     switch(rand()%2)
     {
     case 0:
         DoYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
         DoPlaySoundToSet(m_creature, SOUND_ONSLAY1);
         break;
     case 1:
         DoYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
         DoPlaySoundToSet(m_creature, SOUND_ONSLAY2);
         break;
     }
 }
Exemplo n.º 14
0
 void KilledUnit(Unit* victim)
 {
     switch(rand()%2)
     {
     case 0:
         DoYell(YELL_KILL1,LANG_UNIVERSAL, NULL);
         DoPlaySoundToSet(m_creature, SOUND_KILL1);
         break;
     case 1:
         DoYell(YELL_KILL2,LANG_UNIVERSAL, NULL);
         DoPlaySoundToSet(m_creature, SOUND_KILL2);
         break;
     }
 }
Exemplo n.º 15
0
    void UpdateAI(const uint32 diff)
    {
        //Return since we have no target
        if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
            return;

        //Check if we have a current target
        if( m_creature->getVictim() && m_creature->isAlive())
        {

            //Attack Haste
            if (Haste_Timer < diff)
            {
                DoCast(m_creature, SPELL_HASTE);
                Haste_Timer = 20000+rand()%5000;
            }else Haste_Timer -= diff;

            //Spell Reflection
            if (SpellReflection_Timer < diff)
            {
                DoYell(SAY_BANISH, LANG_UNIVERSAL, NULL);
                DoPlaySoundToSet(m_creature, SOUND_BANISH);

                DoCast(m_creature, SPELL_REFLECT);
                SpellReflection_Timer = 40000+rand()%10000;
            }else SpellReflection_Timer -= diff;

            DoMeleeAttackIfReady();

        }
    }
    void MoveInLineOfSight(Unit *who)
    {
        if (!who || m_creature->getVictim())
            return;

        if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
        {
            float attackRadius = m_creature->GetAttackDistance(who);
            if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE)
            {
                if(who->HasStealthAura())
                    who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);

                if (!HasYelled)
                {
                    DoYell(SAY_LIVING,LANG_UNIVERSAL,NULL);
                    DoPlaySoundToSet(m_creature,SOUND_FLYIN);
                    m_creature->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
                    HasYelled = true;
                }

                //Begin melee attack if we are within range
                DoStartMeleeAttack(who);
                InCombat = true;
            }
        }
    }
Exemplo n.º 17
0
    void MoveInLineOfSight(Unit *who)
    {
        if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
        {
            //not sure about right radius
            if(!Intro && m_creature->IsWithinDistInMap(who, 50))
            {
                DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
                DoPlaySoundToSet(m_creature, SOUND_INTRO);
                DoCast(m_creature, SPELL_VOID_PORTAL_A,true);
                m_creature->SummonCreature(ENTRY_VOID_PORTAL,-262.40,-229.57,17.08,0,TEMPSUMMON_CORPSE_DESPAWN,0);
                m_creature->SummonCreature(ENTRY_VOID_PORTAL,-260.35,-297.56,17.08,0,TEMPSUMMON_CORPSE_DESPAWN,0);
                m_creature->SummonCreature(ENTRY_VOID_PORTAL,-292.05,-270.37,12.68,0,TEMPSUMMON_CORPSE_DESPAWN,0);
                m_creature->SummonCreature(ENTRY_VOID_PORTAL,-301.64,-255.97,12.68,0,TEMPSUMMON_CORPSE_DESPAWN,0);
                Intro = true;
            }

            if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
                return;

            float attackRadius = m_creature->GetAttackDistance(who);
            if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
            {
                DoStartAttackAndMovement(who);
                who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);

                if (!InCombat)
                {
                    InCombat = true;
                    Aggro(who);
                }
            }
        }
    }
Exemplo n.º 18
0
    void Aggro(Unit* pWho) 
    { 
        m_creature->SetInCombatWithZone(); 

        DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL); 
        DoPlaySoundToSet(m_creature, 8272); 
    } 
Exemplo n.º 19
0
 void JustDied(Unit* Killer)
 {
     DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
     DoPlaySoundToSet(m_creature,SOUND_DEATH);
     if( pInstance )
         pInstance->SetData(TYPE_HARBINGERSKYRISS,DONE);
 }
Exemplo n.º 20
0
    void UpdateAI(const uint32 diff)
    {
        if (real_event_started)
        {
            if (initial_movement)
            {
                DoYell(SAY_BEGIN, LANG_UNIVERSAL, NULL);
                initial_movement = false;
            }

            Player* player = GetPlayerForEscort();
            if (player)
            {
                if(player->isDead())
                {
                    player->FailQuest(QUEST_PROTECT_DAPHNE);
                    SetVariables();
                }

                if(m_creature->isDead() && player)
                    player->FailQuest(QUEST_PROTECT_DAPHNE);
            }

            UpdateEvent(diff);
        }

        npc_escortAI::UpdateAI(diff);
    }
Exemplo n.º 21
0
 void JustDied(Unit *victim)
 {
     DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
     DoPlaySoundToSet(m_creature, SOUND_DEATH);
     if( pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS )
         pInstance->SetData(TYPE_THRALL_PART1, DONE);
 }
Exemplo n.º 22
0
    void Aggro(Unit *who)
    {
        DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
        DoPlaySoundToSet(m_creature,SOUND_AGGRO);
		if(pInstance)
			pInstance->SetData(DATA_KAELTHAS_EVENT, IN_PROGRESS);
    }
Exemplo n.º 23
0
    void JustDied(Unit* Killer)
    {
        DoYell(SAY_DEAD, LANG_UNIVERSAL, NULL);
        DoPlaySoundToSet(m_creature,SOUND_DEAD);

        if( pInstance ) pInstance->SetData(TYPE_HYDROMANCER_THESPIA, DONE);
    }
Exemplo n.º 24
0
 void Aggro(Unit *who)
 {    
     if(pInstance && IsEvent)
         pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, IN_PROGRESS);
     DoPlaySoundToSet(m_creature, SOUND_ONAGGRO);
     DoYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
 }
Exemplo n.º 25
0
 void EnterCombat(Unit *who)
 {
     if(pInstance && IsEvent)
         pInstance->SetData(DATA_KAZROGALEVENT, IN_PROGRESS);
     DoPlaySoundToSet(m_creature, SOUND_ONAGGRO);
     DoYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
 }
Exemplo n.º 26
0
 void JustDied(Unit *victim)
 {
     if(pInstance && IsEvent)
         pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, DONE);
     DoPlaySoundToSet(m_creature, SOUND_ONDEATH);
     DoYell(SAY_ONDEATH, LANG_UNIVERSAL, NULL);
 }
Exemplo n.º 27
0
    void EnterCombat(Unit *who)
    {
        if(pInstance)
            pInstance->SetData(DATA_NIGHTBANE_EVENT, IN_PROGRESS);

        HandleTerraceDoors(false);
        DoYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
    }
Exemplo n.º 28
0
 void JustDied(Unit* Killer)
 {
     DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
     DoPlaySoundToSet(m_creature,SOUND_DEATH);
     ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL;
     if(pInstance)
         pInstance->SetData(DATA_MARLI_DEATH, 0);
 }
Exemplo n.º 29
0
 void JustDied(Unit* Killer)
 {
     DoYell(SAY_ONDEATH,LANG_UNIVERSAL,NULL);
     DoPlaySoundToSet(m_creature, SOUND_ONDEATH);
     if(pInstance)
         pInstance->SetData(DATA_AKILZONEVENT, DONE);
     DespawnSummons();
 }
Exemplo n.º 30
0
    void JustDied(Unit* Killer)
    {
        if(pInstance)
            pInstance->SetData(DATA_HALAZZIEVENT, DONE);

        DoYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
        DoPlaySoundToSet(m_creature, SOUND_DEATH);
    }