示例#1
0
 void JustDied(Unit* killer)
 {
     HandleDoors(true);
     DestroyPortals();
     if (pInstance)
         pInstance->SetData(DATA_NETHERSPITE_EVENT, DONE);
 }
        void Reset() override
        {
            Initialize();

            HandleDoors(true);
            DestroyPortals();
        }
		void Reset() {
			Berserk = false;
			NetherInfusionTimer = 540000;
			VoidZoneTimer = 15000;
			NetherbreathTimer = 3000;

			HandleDoors(true);
			DestroyPortals();
		}
		void SwitchToBanishPhase() {
			me->RemoveAurasDueToSpell(SPELL_EMPOWERMENT);
			me->RemoveAurasDueToSpell(SPELL_NETHERBURN_AURA);
			DoCast(me, SPELL_BANISH_VISUAL, true);
			DoCast(me, SPELL_BANISH_ROOT, true);
			DestroyPortals();
			PhaseTimer = 30000;
			PortalPhase = false;
			DoScriptText(EMOTE_PHASE_BANISH, me);

			for (int i = 0; i < 3; ++i)
				me->RemoveAurasDueToSpell(NetherBuff[i]);
		}
示例#5
0
 void SwitchPhase()
 {
     switch(Active_Phase)
     {
     case NULL_PHASE: //initialize
         Active_Phase = PORTAL_PHASE;
         SpawnPortals();
         AttackStart(me->getVictim());
         DoScriptText(EMOTE_PHASE_PORTAL,me);
         DoCast(me,SPELL_EMPOWERMENT);
         uiTimers[EVENT_ENRAGE] = 540000;
         uiTimers[EVENT_EXHAUST_CHECK] = 2000;
         uiTimers[EVENT_PORTAL_END_TIMER] = 60000;
         uiTimers[EVENT_BEAM_INITIAL] = 10000;
         uiTimers[EVENT_BEAM_PERIODIC] = 0;
         uiTimers[EVENT_NETHERBURN] = 5000;
         uiTimers[EVENT_VOID_ZONE] = 15000;
         break;
     case PORTAL_PHASE:  //enter banish phase
         Active_Phase = BANISH_PHASE;
         me->RemoveAllAuras();
         DoCast(me, SPELL_BANISH_VISUAL, true);
         DoCast(me, SPELL_ROOT, true);
         DoResetThreat();
         DestroyPortals();
         AttackStart(me->getVictim());
         Shuffle_Coordinates();
         DoScriptText(EMOTE_PHASE_BANISH,me);
         uiTimers[EVENT_BANISH_END_TIMER] = 30000;
         uiTimers[EVENT_NETHERBREATH] = 5000;
         break;
     case BANISH_PHASE:  //enter portal phase
         Active_Phase = PORTAL_PHASE;
         me->RemoveAurasDueToSpell(SPELL_ROOT);
         me->RemoveAurasDueToSpell(SPELL_BANISH_VISUAL);
         DoResetThreat();
         SpawnPortals();
         AttackStart(me->getVictim());
         DoScriptText(EMOTE_PHASE_PORTAL,me);
         DoCast(me,SPELL_EMPOWERMENT);
         uiTimers[EVENT_PORTAL_END_TIMER] = 60000;
         uiTimers[EVENT_BEAM_INITIAL] = 10000;
         uiTimers[EVENT_BEAM_PERIODIC] = 0;
         uiTimers[EVENT_NETHERBURN] = 5000;
         uiTimers[EVENT_VOID_ZONE] = 15000;
         break;
     default:
         break;
     }
     Active_Event = NULL_EVENT;
 }
示例#6
0
    void JustDied(Unit* Killer) {
        for(int i=0;i<10;i++) {
            ExhaustCandsDOM[i] = NULL;
            ExhaustCandsSER[i] = NULL;
            ExhaustCandsPER[i] = NULL;
            PERMaxHealth[i] = NULL;
        }
 
        DestroyPortals();
                DestroyVoidZone();
                bReset = true;
 
                GameObject* Door = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GO_MASSIVE_DOOR));
                if(Door)
                        Door->SetGoState(GO_STATE_READY); // open the door
    }
示例#7
0
    void JustDied(Unit* Killer)
    {
        for(int i=0;i<10;i++)
        {
            if(pHealth_Modified[i])
            {
                //pHealth_Modified[i]->GetUInt32Value(UNIT_FIELD_MAXHEALTH) =  pHealth_Modified[i]->GetUInt32Value(UNIT_FIELD_MAXHEALTH) - uiHp_bonus;
                pHealth_Modified[i] = NULL;
            }
        }

        SetInstanceData(TYPE_NETHERSPITE, DONE);

        if (pInstance)
        {
            //door opens
            if (GameObject* pDoor = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GO_MASSIVE_DOOR)))
                pDoor->SetGoState(GO_STATE_ACTIVE);
        }
        else
            return;
        DestroyPortals();
    }
示例#8
0
    void Reset()
    {
        ClearCastQueue();

        Berserk = false;
        NetherInfusionTimer = 540000;
        VoidZoneTimer = 15000;
        NetherbreathTimer = 3000;
        ExhaustCheckTimer = 1000;
        HandleDoors(true);
        DestroyPortals();

        for(int i=0; i<3; ++i)
        {
            PortalGUID[i] = 0;
            BeamTarget[i] = 0;
            BeamerGUID[i] = 0;
        }

        m_creature->GetMotionMaster()->MovePath(NETHER_PATROL_PATH, true);

        if(pInstance && pInstance->GetData(DATA_NETHERSPITE_EVENT) != DONE)
            pInstance->SetData(DATA_NETHERSPITE_EVENT, NOT_STARTED);
    }
示例#9
0
 void JustDied(Unit* /*killer*/)
 {
     HandleDoors(true);
     DestroyPortals();
 }
示例#10
0
    void UpdateAI(const uint32 diff) {
                
        if(!m_creature->SelectHostileTarget())
            return;
 
        GameObject* Door = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GO_MASSIVE_DOOR));
            if(Door)
                Door->SetGoState(GO_STATE_ACTIVE); // open the door
 
        if(!m_creature->getVictim() || !m_creature->isAlive())
                        return;
 
        if(ExhaustCheck_timer < diff) {
            //periodic exhaustion debuff check
            DELExhaustCandDOM();
            DELExhaustCandSER();
            DELExhaustCandPER();
            ExhaustCheck_timer = 2000;
        }else ExhaustCheck_timer -= diff;
 
        if(Enrage_timer < diff) {
            if(!Enraged) {
                DoCast(m_creature,SPELL_ENRAGE);
                Enraged = true;
            }
        }else Enrage_timer -= diff;
 
        if(PortalPhase) {
            if(PortalPhase_timer < diff) {
                m_creature->CastSpell(m_creature, SPELL_BANISH_VISUAL,0);
                //DoScriptText(SAY_BANISH, m_creature);
                BanishPhase = true;
                PortalPhase = false;
                PLRonRedBeam = false;
                DestroyPortals();
                                if(!bReset) {
                                        RandomizeCoords();
                                } else {
                                        memcpy(&RandomedCoords, &BasicCoords, sizeof(BasicCoords)); // copy the basic coords at start
                                        bReset = false;
                                }
                PortalPhase_timer = 60000;
                (*m_creature).GetMotionMaster()->MoveIdle();
            }else PortalPhase_timer -= diff;
 
            if(!HasEmpowered) {
                if(Empowerment_timer < diff) {
                    DoCast(m_creature,SPELL_EMPOWERMENT);
                    HasEmpowered = true;
                }else Empowerment_timer -= diff;
            }
 
            if(!PortalsSpawned) {
                Creature* BeamerD = m_creature->SummonCreature(CREATURE_BLUEPORTAL,RandomedCoords[0][0],RandomedCoords[0][1],RandomedCoords[0][2],0,TEMPSUMMON_CORPSE_DESPAWN,0);
                if(BeamerD) {
                    BeamerGUID[0] = BeamerD->GetGUID();
                    BeamerD->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
                    BeamerD->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                    BeamerD->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                }
 
                Creature* BeamerS = m_creature->SummonCreature(CREATURE_GREENPORTAL,RandomedCoords[1][0],RandomedCoords[1][1],RandomedCoords[1][2],0,TEMPSUMMON_CORPSE_DESPAWN,0);
                if(BeamerS) {
                    BeamerGUID[1] = BeamerS->GetGUID();
                    BeamerS->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
                    BeamerS->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                    BeamerS->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                }
 
                Creature* BeamerP = m_creature->SummonCreature(CREATURE_REDPORTAL,RandomedCoords[2][0],RandomedCoords[2][1],RandomedCoords[2][2],0,TEMPSUMMON_CORPSE_DESPAWN,0);
                if(BeamerP) {
                    BeamerGUID[2] = BeamerP->GetGUID();
                    BeamerP->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
                    BeamerP->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                    BeamerP->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                }
 
                Creature* BeamerDhelp = m_creature->SummonCreature(CREATURE_BLUEPORTAL,RandomedCoords[0][0],RandomedCoords[0][1],RandomedCoords[0][2],0,TEMPSUMMON_CORPSE_DESPAWN,0);
                if(BeamerDhelp) {
                    BeamerhelpGUID[0] = BeamerDhelp->GetGUID();
                    BeamerDhelp->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
                    BeamerDhelp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                    BeamerDhelp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                }
 
                Creature* BeamerShelp = m_creature->SummonCreature(CREATURE_GREENPORTAL,RandomedCoords[1][0],RandomedCoords[1][1],RandomedCoords[1][2],0,TEMPSUMMON_CORPSE_DESPAWN,0);
                if(BeamerShelp) {
                    BeamerhelpGUID[1] = BeamerShelp->GetGUID();
                    BeamerShelp->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
                    BeamerShelp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                    BeamerShelp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                }
 
                Creature* BeamerPhelp = m_creature->SummonCreature(CREATURE_REDPORTAL,RandomedCoords[2][0],RandomedCoords[2][1],RandomedCoords[2][2],0,TEMPSUMMON_CORPSE_DESPAWN,0);
                if(BeamerPhelp) {
                    BeamerhelpGUID[2] = BeamerPhelp->GetGUID();
                    BeamerPhelp->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
                    BeamerPhelp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                    BeamerPhelp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                }
 
                BeamerD = ((Creature*)Unit::GetUnit((*m_creature), BeamerGUID[0]));
                if(BeamerD)
                    BeamerD->CastSpell(BeamerD,BLUE_PORTAL,true);
 
                BeamerS = ((Creature*)Unit::GetUnit((*m_creature), BeamerGUID[1]));
                if(BeamerS)
                    BeamerS->CastSpell(BeamerS,GREEN_PORTAL,true);
 
                BeamerP = ((Creature*)Unit::GetUnit((*m_creature), BeamerGUID[2]));
                if(BeamerP)
                    BeamerP->CastSpell(BeamerP,RED_PORTAL,true);
 
                PortalsSpawned = true;
                //DoScriptText(SAY_PORTAL, m_crature);
            }
 
            if(Beam_initialtimer < diff) {
                if(Beam_periodictimer < diff) {
                    //apply beam buff
                    /*BlueNetherBeam();
                    GreenNetherBeam();
                    RedNetherBeam();*/
                                        NetherBeam(0); // blue
                                        NetherBeam(1); // green
                                        NetherBeam(2); // red
                    Beam_periodictimer = 1000;
                    DoScriptText(EMOTE_PHASE_PORTAL, m_creature);
                }else Beam_periodictimer -= diff;
            }else Beam_initialtimer -= diff;
 
            if(Netherburn_timer < diff) {
                DoCast(m_creature,SPELL_NETHERBURN);
                Netherburn_timer = 5000;
            }else Netherburn_timer -= diff;
 
            if(Voidzone_timer < diff && !BanishPhase) {
                //function for spawning the Void Zones around the position of Netherspite
                voidZones_random = rand()%4;
 
                                float fTmp1 = (rand()%2==0) ? -1 : 1;
                                float fTmp2 = (rand()%2==0) ? -1 : 1;
 
                                ZoneCoords[0]= m_creature->GetPositionX() + 5*fTmp1 + rand()%10;
                                ZoneCoords[1]= m_creature->GetPositionY() + 5*fTmp2 + rand()%10;
 
                /*switch(voidZones_random) {
                case 0 :
                    ZoneCoords[0]= m_creature->GetPositionX() +  5 + rand()%10;
                    ZoneCoords[1]= m_creature->GetPositionY() +  5 + rand()%10;
                    break;
 
                case 1:
                    ZoneCoords[0]= m_creature->GetPositionX() +  5 + rand()%10;
                    ZoneCoords[1]= m_creature->GetPositionY() - (5 + rand()%10);
                    break;
 
                case 2:
                    ZoneCoords[0]= m_creature->GetPositionX() - (5 + rand()%10);
                    ZoneCoords[1]= m_creature->GetPositionY() +  5 + rand()%10;
                    break;
 
                case 3:
                    ZoneCoords[0]= m_creature->GetPositionX() - (5 + rand()%10);
                    ZoneCoords[1]= m_creature->GetPositionY() - (5 + rand()%10);
                    break;
                } */
                                
                                Creature* uVoidZone = m_creature->SummonCreature(CREATURE_VOID_ZONE, ZoneCoords[0], ZoneCoords[1], m_creature->GetPositionZ() , 0 , TEMPSUMMON_CORPSE_DESPAWN, 0);
               
               if(uVoidZone)
                    VoidZone[voidZones_counter++] = uVoidZone->GetGUID();
 
               if(voidZones_counter >= 6)
                   voidZones_counter=0;
 
                           // use this, when the spell is fixed (you've to overwork this then):
                /* Unit* Zonetarget = SelectUnit(SELECT_TARGET_RANDOM,0);       // No longer necessary
                if(Zonetarget)
                    ZonetargetGUID = Zonetarget->GetGUID();
 
                    Zonetarget = Unit::GetUnit((*m_creature), ZonetargetGUID);
 
                if(Zonetarget->IsHostileTo(m_creature))
                    DoCast(Zonetarget,SPELL_VOIDZONE); */
 
                    Voidzone_timer = 15000; 
                
            }else Voidzone_timer -= diff;
        }   
 
        if(BanishPhase) {
            if(BanishPhase_timer < diff) {
                m_creature->RemoveAura(SPELL_BANISH_VISUAL,0);
                PortalPhase = true;
                BanishPhase = false;
                PortalsSpawned = false;
                PLRonRedBeam = false;
                BanishPhase_timer = 30000;
                DoResetThreat();
                (*m_creature).GetMotionMaster()->MoveChase(m_creature->getVictim());
                DoScriptText(EMOTE_PHASE_BANISH, m_creature);
            }else BanishPhase_timer -= diff;
 
            if(Netherbreath_timer < diff) {
                if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
                    DoCast(target, SPELL_NETHERBREATH);
                Netherbreath_timer = 2500;
            }else Netherbreath_timer -= diff;
        }
 
        if(!PLRonRedBeam) {
            DoMeleeAttackIfReady();
                } else {
                        Unit* uTmp = Unit::GetUnit(*m_creature,CandidatesGUID[2]);
                        //if(uTmp && uTmp->IsHostileTo(m_creature))
                                //DoStartAttackAndMovement(uTmp); /* after rev. 698: DoStartMovement() */
                        if (m_creature->Attack(uTmp, true))
                        {
                                m_creature->AddThreat(uTmp, 0.0f);
                                m_creature->SetInCombatWith(uTmp);
                                uTmp->SetInCombatWith(m_creature);
 
                                if (!InCombat)
                                {
                                        InCombat = true;
                                        Aggro(uTmp);
                                }
 
                                DoStartMovement(uTmp);
                        }
        }
    }