示例#1
0
    void SetData(uint32 id, uint32 value)
    {
        switch (id)
        {
        case DATA_HEIGAN_ERUPT:
            HeiganErupt(value);
            break;
        case DATA_GOTHIK_GATE:
            if (pGothikGate)
                pGothikGate->SetGoState(GOState(value));
            break;

        case DATA_HORSEMEN0:
        case DATA_HORSEMEN1:
        case DATA_HORSEMEN2:
        case DATA_HORSEMEN3:
            if (value == NOT_STARTED)
            {
                minHorsemenDiedTime = 0;
                maxHorsemenDiedTime = 0;
            }
            else if (value == DONE)
            {
                time_t now = time(NULL);

                if (minHorsemenDiedTime == 0)
                    minHorsemenDiedTime = now;

                maxHorsemenDiedTime = now;
            }
            break;
        }
    }
            void SetData(uint32 id, uint32 value) override
            {
                switch (id)
                {
                    case DATA_HEIGAN_ERUPT:
                        HeiganErupt(value);
                        break;
                    case DATA_GOTHIK_GATE:
                        if (GameObject* gate = instance->GetGameObject(GothikGateGUID))
                            gate->SetGoState(GOState(value));
                        break;
                    case DATA_HORSEMEN0:
                    case DATA_HORSEMEN1:
                    case DATA_HORSEMEN2:
                    case DATA_HORSEMEN3:
                        if (value == NOT_STARTED)
                        {
                            minHorsemenDiedTime = 0;
                            maxHorsemenDiedTime = 0;
                        }
                        else if (value == DONE)
                        {
                            time_t now = time(NULL);

                            if (minHorsemenDiedTime == 0)
                                minHorsemenDiedTime = now;

                            maxHorsemenDiedTime = now;
                        }
                        break;
                    case DATA_ABOMINATION_KILLED:
                        AbominationCount = value;
                        break;
                }
            }
示例#3
0
 void SetData(uint32 id, uint32 value)
 {
     switch(id)
     {
         case DATA_HEIGAN_ERUPT:
             HeiganErupt(value);
             break;
     }
 }
示例#4
0
 void SetData(uint32 id, uint32 value)
 {
     switch (id)
     {
         case DATA_HEIGAN_ERUPT:
             HeiganErupt(value);
             break;
         case DATA_GOTHIK_GATE:
             if (pGothikGate)
                 pGothikGate->SetGoState(GOState(value));
             break;
     }
 }
示例#5
0
        void SetData(uint32 type, uint32 data)
        {
            switch (type)
            {
                case DATA_HEIGAN_ERUPT:
                    HeiganErupt(data);
                    break;
                case DATA_GOTHIK_GATE:
                    if (GameObject* gothikGate = instance->GetGameObject(GothikGateGUID))
                        gothikGate->SetGoState(GOState(data));
                    gothikDoorState = GOState(data);
                    break;

                case DATA_HORSEMEN0:
                case DATA_HORSEMEN1:
                case DATA_HORSEMEN2:
                case DATA_HORSEMEN3:
                    if (data == NOT_STARTED)
                    {
                        minHorsemenDiedTime = 0;
                        maxHorsemenDiedTime = 0;
                    }
                    else if (data == DONE)
                    {
                        time_t now = time(NULL);

                        if (minHorsemenDiedTime == 0)
                            minHorsemenDiedTime = now;

                        maxHorsemenDiedTime = now;
                    }
                    break;
                case DATA_ABOMINATION_KILLED:
                    AbominationCount = data;
                    break;
                default:
                    break;
            }
        }
void instance_naxxramas::SetData(uint32 uiType, uint32 uiData)
{
    switch(uiType)
    {
        case TYPE_ANUB_REKHAN:
            m_auiEncounter[0] = uiData;
            DoUseDoorOrButton(m_uiAnubDoorGUID);
            if (uiData == DONE)
                DoUseDoorOrButton(m_uiAnubGateGUID);
            break;
		case DATA_HEIGAN_ERUPT:
            HeiganErupt(uiData);
			break;
		case TYPE_ENR_FAERLINA:
			if(Creature* Faerlina = instance->GetCreature(GetData64(NPC_FAERLINA)))
			{
				Faerlina->RemoveAurasDueToSpell(54100);
				Faerlina->RemoveAurasDueToSpell(28798);
				Faerlina->CastSpell(Faerlina,28732,false);
				break;
			}
        case TYPE_FAERLINA:
            if (uiData == SPECIAL)                          // Used to inform about failed special achievement
            {
                return;
            }
            DoUseDoorOrButton(m_uiFaerWebGUID);
            if (uiData == DONE)
            {
                DoUseDoorOrButton(m_uiFaerDoorGUID);
                DoUseDoorOrButton(m_uiMaexOuterGUID);
            }
            if (uiData == FAIL)
            {
                for (std::list<uint64>::const_iterator itr = m_lFaerlinaAddGUIDs.begin(); itr != m_lFaerlinaAddGUIDs.end(); ++itr)
                {
                    Creature* pAdd = instance->GetCreature(*itr);
                    if (pAdd && !pAdd->isAlive())
                        pAdd->Respawn();
                }
            }
            m_auiEncounter[1] = uiData;
            break;
        case TYPE_MAEXXNA:
            m_auiEncounter[2] = uiData;
            DoUseDoorOrButton(m_uiMaexInnerGUID, uiData);
            if (uiData == DONE)
            {
                DoUseDoorOrButton(m_uiAracEyeRampGUID);
                DoRespawnGameObject(m_uiAracPortalGUID, 30*MINUTE);
                DoTaunt();
            }
            break;
        case TYPE_NOTH:
            m_auiEncounter[3] = uiData;
            DoUseDoorOrButton(m_uiNothEntryDoorGUID);
            if (uiData == DONE)
            {
                DoUseDoorOrButton(m_uiNothExitDoorGUID);
                DoUseDoorOrButton(m_uiHeigEntryDoorGUID);
            }
            break;
        case TYPE_HEIGAN:
            m_auiEncounter[4] = uiData;
            DoUseDoorOrButton(m_uiHeigEntryDoorGUID);
            if (uiData == DONE)
                DoUseDoorOrButton(m_uiHeigExitDoorGUID);
            break;
        case TYPE_LOATHEB:
            m_auiEncounter[5] = uiData;
            DoUseDoorOrButton(m_uiLoathebDoorGUID);
            if (uiData == DONE)
            {
                DoUseDoorOrButton(m_uiPlagEyeRampGUID);
                DoRespawnGameObject(m_uiPlagPortalGUID, 30*MINUTE);
                DoTaunt();
            }
            break;
        case TYPE_RAZUVIOUS:
            m_auiEncounter[6] = uiData;
            break;
        case TYPE_GOTHIK:
            switch(uiData)
            {
                case IN_PROGRESS:
                    DoUseDoorOrButton(m_uiGothikEntryDoorGUID);
                    DoUseDoorOrButton(m_uiGothCombatGateGUID);
                    break;
                case SPECIAL:
                    DoUseDoorOrButton(m_uiGothCombatGateGUID);
                    break;
                case FAIL:
                    if (m_auiEncounter[7] == IN_PROGRESS)
                        DoUseDoorOrButton(m_uiGothCombatGateGUID);

                    DoUseDoorOrButton(m_uiGothikEntryDoorGUID);
                    break;
                case DONE:
                    DoUseDoorOrButton(m_uiGothikEntryDoorGUID);
                    DoUseDoorOrButton(m_uiGothikExitDoorGUID);
                    DoUseDoorOrButton(m_uiHorsemenDoorGUID);
                    break;
            }
            m_auiEncounter[7] = uiData;
            break;
        case TYPE_FOUR_HORSEMEN:
            m_auiEncounter[8] = uiData;
            DoUseDoorOrButton(m_uiHorsemenDoorGUID);
            if (uiData == DONE)
            {
                DoUseDoorOrButton(m_uiMiliEyeRampGUID);
                DoRespawnGameObject(m_uiMiliPortalGUID, 30*MINUTE);
                DoRespawnGameObject(m_uiHorsemenChestGUID, 30*MINUTE);
                DoTaunt();
            }
            break;
        case TYPE_PATCHWERK:
            m_auiEncounter[9] = uiData;
            if (uiData == DONE)
                DoUseDoorOrButton(m_uiPathExitDoorGUID);
            break;
        case TYPE_GROBBULUS:
            m_auiEncounter[10] = uiData;
            break;
        case TYPE_GLUTH:
            m_auiEncounter[11] = uiData;
            if (uiData == DONE)
            {
                DoUseDoorOrButton(m_uiGlutExitDoorGUID);
                DoUseDoorOrButton(m_uiThadDoorGUID);
            }
            break;
        case TYPE_THADDIUS:
            m_auiEncounter[12] = uiData;
            DoUseDoorOrButton(m_uiThadDoorGUID, uiData);
            if (uiData == DONE)
            {
                DoUseDoorOrButton(m_uiConsEyeRampGUID);
                DoRespawnGameObject(m_uiConsPortalGUID, 30*MINUTE);
                DoTaunt();
            }
            break;
        case TYPE_SAPPHIRON:
            m_auiEncounter[13] = uiData;
            if (uiData == DONE)
                DoUseDoorOrButton(m_uiKelthuzadDoorGUID);
            break;
        case TYPE_KELTHUZAD:
            m_auiEncounter[14] = uiData;
            DoUseDoorOrButton(m_uiKelthuzadExitDoorGUID);
            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] << " "
            << m_auiEncounter[9] << " " << m_auiEncounter[10] << " " << m_auiEncounter[11] << " "
            << m_auiEncounter[12] << " " << m_auiEncounter[13] << " " << m_auiEncounter[14];

        strInstData = saveStream.str();

        SaveToDB();
        OUT_SAVE_INST_DATA_COMPLETE;
    }
}