bool SetBossState(uint32 type, EncounterState state) override
        {
            if (!InstanceScript::SetBossState(type, state))
                return false;

            switch (type)
            {
                case DATA_OPERA_PERFORMANCE:
                    if (state == DONE)
                    {
                        HandleGameObject(StageDoorLeftGUID, true);
                        HandleGameObject(StageDoorRightGUID, true);
                        if (GameObject* sideEntrance = instance->GetGameObject(SideEntranceDoor))
                            sideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
                        UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, 16812, NULL);
                    }
                    break;
                case DATA_CHESS:
                    if (state == DONE)
                        DoRespawnGameObject(DustCoveredChest, DAY);
                    break;
                default:
                    break;
            }

            return true;
        }
Пример #2
0
        void SetData(uint32 type, uint32 Data)
        {
            switch (type)
            {
                case TYPE_ATTUMEN:              Encounter[0] = Data; break;
                case TYPE_MOROES:
                    if (Encounter[1] == DONE)
                        break;
                    Encounter[1] = Data;
                    break;
                case TYPE_MAIDEN:               Encounter[2] = Data; break;
                case TYPE_OPTIONAL_BOSS:        Encounter[3] = Data; break;
                case TYPE_OPERA:
                    Encounter[4] = Data;
                    if (Data == DONE)
                        UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, 16812, NULL);
                    break;
                case TYPE_CURATOR:              Encounter[5] = Data; break;
                case TYPE_ARAN:                 Encounter[6] = Data; break;
                case TYPE_TERESTIAN:            Encounter[7] = Data; break;
                case TYPE_NETHERSPITE:          Encounter[8] = Data; break;
                case TYPE_CHESS:
                    if (Data == DONE)
                        DoRespawnGameObject(DustCoveredChest, DAY);
                    Encounter[9]  = Data;
                    break;
                case TYPE_MALCHEZZAR:           Encounter[10] = Data; break;
                case TYPE_NIGHTBANE:
                    if (Encounter[11] != DONE)
                        Encounter[11] = Data;
                    break;
                case DATA_OPERA_OZ_DEATHCOUNT:
                    if (Data == SPECIAL)
                        ++OzDeathCount;
                    else if (Data == IN_PROGRESS)
                        OzDeathCount = 0;
                    break;
            }

            if (Data == DONE)
            {
                OUT_SAVE_INST_DATA;

                std::ostringstream saveStream;
                saveStream << Encounter[0] << ' ' << Encounter[1] << ' ' << Encounter[2] << ' '
                    << Encounter[3] << ' ' << Encounter[4] << ' ' << Encounter[5] << ' ' << Encounter[6] << ' '
                    << Encounter[7] << ' ' << Encounter[8] << ' ' << Encounter[9] << ' ' << Encounter[10] << ' ' << Encounter[11];

                strSaveData = saveStream.str();

                SaveToDB();
                OUT_SAVE_INST_DATA_COMPLETE;
            }
        }
Пример #3
0
 void SetData(uint32 type, uint32 data)
 {
     switch (type)
     {
         case DATA_1ST_BOSS_EVENT:
             UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, CREATURE_EREKEM, NULL);
             m_auiEncounter[0] = data;
             if (data == DONE)
                 SaveToDB();
             break;
         case DATA_2ND_BOSS_EVENT:
             UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, CREATURE_MORAGG, NULL);
             m_auiEncounter[1] = data;
             if (data == DONE)
                 SaveToDB();
             break;
         case DATA_CYANIGOSA_EVENT:
             m_auiEncounter[2] = data;
             if (data == DONE)
             {
                 SaveToDB();
                 uiMainEventPhase = DONE;
                 if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor))
                     pMainDoor->SetGoState(GO_STATE_ACTIVE);
             }
             break;
         case DATA_WAVE_COUNT:
             uiWaveCount = data;
             bActive = true;
             break;
         case DATA_REMOVE_NPC:
             uiRemoveNpc = data;
             break;
         case DATA_PORTAL_LOCATION:
             uiLocation = (uint8)data;
             break;
         case DATA_DOOR_INTEGRITY:
             uiDoorIntegrity = data;
             defenseless = false;
             DoUpdateWorldState(WORLD_STATE_VH_PRISON_STATE, uiDoorIntegrity);
             break;
         case DATA_NPC_PRESENCE_AT_DOOR_ADD:
             NpcAtDoorCastingList.push_back(data);
             break;
         case DATA_NPC_PRESENCE_AT_DOOR_REMOVE:
             if (!NpcAtDoorCastingList.empty())
                 NpcAtDoorCastingList.pop_back();
             break;
         case DATA_MAIN_DOOR:
             if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor))
             {
                 switch (data)
                 {
                     case GO_STATE_ACTIVE:
                         pMainDoor->SetGoState(GO_STATE_ACTIVE);
                         break;
                     case GO_STATE_READY:
                         pMainDoor->SetGoState(GO_STATE_READY);
                         break;
                     case GO_STATE_ACTIVE_ALTERNATIVE:
                         pMainDoor->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE);
                         break;
                 }
             }
             break;
         case DATA_START_BOSS_ENCOUNTER:
             switch (uiWaveCount)
             {
                 case 6:
                     StartBossEncounter(uiFirstBoss);
                     break;
                 case 12:
                     StartBossEncounter(uiSecondBoss);
                     break;
             }
             break;
         case DATA_ACTIVATE_CRYSTAL:
             ActivateCrystal();
             break;
         case DATA_MAIN_EVENT_PHASE:
             uiMainEventPhase = data;
             if (data == IN_PROGRESS) // Start event
             {
                 if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor))
                     pMainDoor->SetGoState(GO_STATE_READY);
                 uiWaveCount = 1;
                 bActive = true;
                 uiRemoveNpc = 0; // might not have been reset after a wipe on a boss.
             }
             break;
     }
 }
        void SetData(uint32 type, uint32 data)
        {
            switch (type)
            {
            case DATA_MOVEMENT_DONE:
                movementDone = data;
                if (movementDone == 3)
                {
                    if (Creature* announcer = instance->GetCreature(announcerGUID))
                        announcer->AI()->SetData(DATA_IN_POSITION, 0);
                }
                break;
            case BOSS_GRAND_CHAMPIONS:
                if (data == IN_PROGRESS)
                {
                    m_auiEncounter[0] = data;
                    for (std::list<uint64>::const_iterator itr = vehicleList.begin(); itr != vehicleList.end(); ++itr)
                        if (Creature* summon = instance->GetCreature(*itr))
                            summon->RemoveFromWorld();
                }
                else if (data == DONE)
                {
                    ++grandChampionsDeaths;
                    if (grandChampionsDeaths >= 3)
                    {
                        for (uint8 i = 0; i < 3; ++i)
                            if (Creature* GrandChampion = instance->GetCreature(GetData64(DATA_GRAND_CHAMPION_1 + i)))
                                GrandChampion->AI()->SetData(11, 0);

                        UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, SPELL_GRAND_CHAMPION_CREDIT, NULL);

                        if (Creature* announcer = instance->GetCreature(announcerGUID))
                        {
                            m_auiEncounter[0] = data;
                            announcer->CastSpell(announcer, SPELL_GRAND_CHAMPION_CREDIT, true);
                            announcer->GetMotionMaster()->MovePoint(0, 748.309f, 619.487f, 411.171f);
                            announcer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                            announcer->SummonGameObject(instance->IsHeroic() ? GO_CHAMPIONS_LOOT_H : GO_CHAMPIONS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, 0, 0, 0, 0, 90000000);
                            BindPlayersToInstance(announcer);
                        }
                    }
                }
                break;
            case DATA_ARGENT_SOLDIER_DEFEATED:
                argentSoldierDeaths = data;
                if (argentSoldierDeaths == 9)
                {
                    if (Creature* boss = instance->GetCreature(argentChampionGUID))
                    {
                        boss->GetMotionMaster()->MovePoint(0, 746.88f, 618.74f, 411.06f);
                        boss->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
                        boss->SetReactState(REACT_AGGRESSIVE);
                        boss->setFaction(16);
                    }
                }
                break;
            case BOSS_ARGENT_CHALLENGE_E:
                m_auiEncounter[1] = data;
                if (data == IN_PROGRESS)
                {
                    for (std::list<uint64>::const_iterator itr = vehicleList.begin(); itr != vehicleList.end(); ++itr)
                        if (Creature* summon = instance->GetCreature(*itr))
                            summon->RemoveFromWorld();
                }
                else if (data == DONE)
                {
                    UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, SPELL_ARGENT_CREDIT, NULL);

                    if (Creature* announcer = instance->GetCreature(announcerGUID))
                    {
                        announcer->GetMotionMaster()->MovePoint(0, 748.309f, 619.487f, 411.171f);
                        announcer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                        announcer->SummonGameObject(instance->IsHeroic() ? GO_EADRIC_LOOT_H : GO_EADRIC_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, 0, 0, 0, 0, 90000000);
                        BindPlayersToInstance(announcer);
                    }
                }
                break;
            case BOSS_ARGENT_CHALLENGE_P:
                m_auiEncounter[2] = data;
                if (data == IN_PROGRESS)
                {
                    for (std::list<uint64>::const_iterator itr = vehicleList.begin(); itr != vehicleList.end(); ++itr)
                        if (Creature* summon = instance->GetCreature(*itr))
                            summon->RemoveFromWorld();
                }
                else if (data == DONE)
                {
                    UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, SPELL_ARGENT_CREDIT, NULL);

                    if (Creature* announcer = instance->GetCreature(announcerGUID))
                    {
                        announcer->GetMotionMaster()->MovePoint(0, 748.309f, 619.487f, 411.171f);
                        announcer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                        announcer->SummonGameObject(instance->IsHeroic() ? GO_PALETRESS_LOOT_H : GO_PALETRESS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, 0, 0, 0, 0, 90000000);
                        BindPlayersToInstance(announcer);
                    }
                }
                break;
            case BOSS_BLACK_KNIGHT:
                m_auiEncounter[3] = data;
                if (data == DONE)
                    UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, SPELL_BLACK_KNIGHT_CREDIT, NULL);
                break;
            case DATA_GRAND_CHAMPION_ENTRY:
                for (uint8 i = 0; i < 3; ++i)
                {
                    if (grandChampionEntry[i] == 0)
                    {
                        grandChampionEntry[i] = data;
                        return;
                    }
                }
                break;
            case DATA_MEMORY_ENTRY:
                memoryEntry = data;
                break;
            }

            if (data == DONE)
                SaveToDB();
        }
Пример #5
0
void InstanceScript::UpdateEncounterStateForSpellCast(uint32 spellId, Unit* source)
{
    UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, spellId, source);
}
Пример #6
0
void InstanceScript::UpdateEncounterStateForKilledCreature(uint32 creatureId, Unit* source)
{
    UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, creatureId, source);
}