void instance_black_temple::SetData(uint32 uiType, uint32 uiData)
{
    debug_log("SD2: Instance Black Temple: SetData received for type %u with data %u",uiType,uiData);

    switch(uiType)
    {
        case TYPE_NAJENTUS:
            m_auiEncounter[uiType] = uiData;
            if (uiData == DONE)
                DoUseDoorOrButton(GO_NAJENTUS_GATE);
            break;
        case TYPE_SUPREMUS:
            m_auiEncounter[uiType] = uiData;
            if (uiData == DONE)
                DoUseDoorOrButton(GO_SUPREMUS_DOORS);
            break;
        case TYPE_SHADE:
        case TYPE_GOREFIEND:
        case TYPE_BLOODBOIL:
        case TYPE_RELIQUIARY:
            m_auiEncounter[uiType] = uiData;
            if (uiData == DONE && CanPreMotherDoorOpen())
                DoUseDoorOrButton(GO_PRE_SHAHRAZ_DOOR);
            break;
        case TYPE_SHAHRAZ:
            if (uiData == DONE)
                DoUseDoorOrButton(GO_POST_SHAHRAZ_DOOR);
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_COUNCIL:
            DoUseDoorOrButton(GO_COUNCIL_DOOR);
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_ILLIDAN:    m_auiEncounter[uiType] = uiData; break;
        default:
            error_log("SD2: Instance Black Temple: ERROR SetData = %u for type %u does not exist/not implemented.", uiType, uiData);
            return;
    }

    if (uiData == DONE)
    {
        OUT_SAVE_INST_DATA;

        std::ostringstream saveStream;
        saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " "
            << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " "
            << m_auiEncounter[6] << " " << m_auiEncounter[7] << " " << m_auiEncounter[8];

        m_strInstData = saveStream.str();

        SaveToDB();
        OUT_SAVE_INST_DATA_COMPLETE;
    }
}
 void OnObjectCreate(GameObject* pGo)
 {
     switch(pGo->GetEntry())
     {
         case 185483:                                    // Gate past Naj'entus (at the entrance to Supermoose's courtyards)
             m_uiNajentusGateGUID = pGo->GetGUID();
             if (m_auiEncounter[0] == DONE)
                 pGo->SetGoState(GO_STATE_ACTIVE);
             break;
         case 185882:                                    // Main Temple Doors - right past Supermoose (Supremus)
             m_uiMainTempleDoorsGUID = pGo->GetGUID();
             if (m_auiEncounter[1] == DONE)
                 pGo->SetGoState(GO_STATE_ACTIVE);
             break;
         case 185478:
             m_uiShadeAkamaDoorGUID = pGo->GetGUID();    // Door close during encounter
             break;
         case 185892:
             m_uiBloodboilPostDoorGUID = pGo->GetGUID(); // Door open after killing Bloodboil
             if (m_auiEncounter[4] == DONE)
                 pGo->SetGoState(GO_STATE_ACTIVE);
             break;
         case 185479:                                    // Door leading to Mother Shahraz
             m_uiShahrazPreDoorGUID = pGo->GetGUID();
             if (CanPreMotherDoorOpen())
                 pGo->SetGoState(GO_STATE_ACTIVE);
             break;
         case 185481:                                    // Door leading to the Council (grand promenade)
             m_uiCouncilDoorGUID = pGo->GetGUID();
             if (m_auiEncounter[6] == DONE)
                 pGo->SetGoState(GO_STATE_ACTIVE);
             break;
         case 185482:                                    // Door after shahraz
             m_uiShahrazPostDoorGUID = pGo->GetGUID();
             if (m_auiEncounter[6] == DONE)
                 pGo->SetGoState(GO_STATE_ACTIVE);
             break;
         case 185905:                                    // Gate leading to Temple Summit
             m_uiIllidanGateGUID = pGo->GetGUID();
             break;
         case 186261:                                    // Right door at Temple Summit
             m_uiIllidanDoorGUID[0] = pGo->GetGUID();
             break;
         case 186262:                                    // Left door at Temple Summit
             m_uiIllidanDoorGUID[1] = pGo->GetGUID();
             break;
     }
 }
void instance_black_temple::OnObjectCreate(GameObject* pGo)
{
    switch(pGo->GetEntry())
    {
        case GO_NAJENTUS_GATE:                              // Gate past Naj'entus (at the entrance to Supermoose's courtyards)
            if (m_auiEncounter[TYPE_NAJENTUS] == DONE)
                pGo->SetGoState(GO_STATE_ACTIVE);
            break;
        case GO_SUPREMUS_DOORS:                             // Main Temple Doors - right past Supermoose (Supremus)
            if (m_auiEncounter[TYPE_SUPREMUS] == DONE)
                pGo->SetGoState(GO_STATE_ACTIVE);
            break;
        case GO_SHADE_OF_AKAMA:                             // Door close during encounter
            break;
        case GO_PRE_SHAHRAZ_DOOR:                           // Door leading to Mother Shahraz
            if (CanPreMotherDoorOpen())
                pGo->SetGoState(GO_STATE_ACTIVE);
            break;
        case GO_POST_SHAHRAZ_DOOR:                           // Door after shahraz
            if (m_auiEncounter[6] == DONE)
                pGo->SetGoState(GO_STATE_ACTIVE);
            break;
        case GO_PRE_COUNCIL_DOOR:                           // Door leading to the Council (grand promenade)
            break;
        case GO_COUNCIL_DOOR:                               // Door leading to the Council (inside)
            break;
        case GO_ILLIDAN_GATE:                               // Gate leading to Temple Summit
            // TODO - dependend on council state
            break;
        case GO_ILLIDAN_DOOR_R:                             // Right door at Temple Summit
        case GO_ILLIDAN_DOOR_L:                             // Left door at Temple Summit
            break;

        default:
            return;
    }
    m_mGoEntryGuidStore[pGo->GetEntry()] = pGo->GetObjectGuid();
}
Пример #4
0
    void SetData(uint32 uiType, uint32 uiData)
    {
        debug_log("SD2: Instance Black Temple: SetData received for type %u with data %u",uiType,uiData);

        switch(uiType)
        {
            case TYPE_NAJENTUS:
                m_auiEncounter[0] = uiData;
                if (uiData == DONE)
                    DoUseDoorOrButton(m_uiNajentusGateGUID);
                break;
            case TYPE_SUPREMUS:
                m_auiEncounter[1] = uiData;
                if (uiData == DONE)
                    DoUseDoorOrButton(m_uiMainTempleDoorsGUID);
                break;
            case TYPE_SHADE:
                m_auiEncounter[2] = uiData;
                if (uiData == DONE && CanPreMotherDoorOpen())
                    DoUseDoorOrButton(m_uiShahrazPreDoorGUID);
                break;
            case TYPE_GOREFIEND:
                m_auiEncounter[3] = uiData;
                if (uiData == DONE && CanPreMotherDoorOpen())
                    DoUseDoorOrButton(m_uiShahrazPreDoorGUID);
                break;
            case TYPE_BLOODBOIL:
                m_auiEncounter[4] = uiData;
                if (uiData == DONE && CanPreMotherDoorOpen())
                    DoUseDoorOrButton(m_uiShahrazPreDoorGUID);
                break;
            case TYPE_RELIQUIARY:
                m_auiEncounter[5] = uiData;
                if (uiData == DONE && CanPreMotherDoorOpen())
                    DoUseDoorOrButton(m_uiShahrazPreDoorGUID);
                break;
            case TYPE_SHAHRAZ:
                if (uiData == DONE)
                {
                    DoUseDoorOrButton(m_uiCouncilDoorGUID);
                    DoUseDoorOrButton(m_uiShahrazPostDoorGUID);
                }
                m_auiEncounter[6] = uiData;
                break;
            case TYPE_COUNCIL:    m_auiEncounter[7] = uiData; break;
            case TYPE_ILLIDAN:    m_auiEncounter[8] = uiData; break;
            default:
                error_log("SD2: Instance Black Temple: ERROR SetData = %u for type %u does not exist/not implemented.",uiType,uiData);
                break;
        }

        if (uiData == DONE)
        {
            OUT_SAVE_INST_DATA;

            std::ostringstream saveStream;
            saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " "
                << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " "
                << m_auiEncounter[6] << " " << m_auiEncounter[7] << " " << m_auiEncounter[8];

            strInstData = saveStream.str();

            SaveToDB();
            OUT_SAVE_INST_DATA_COMPLETE;
        }
    }