void Load(const char* str) override { if (!str) { OUT_LOAD_INST_DATA_FAIL; return; } OUT_LOAD_INST_DATA(str); char dataHead1, dataHead2; std::istringstream loadStream(str); loadStream >> dataHead1 >> dataHead2; if (dataHead1 == 'H' && dataHead2 == 'O') { for (uint32 i = 0; i < EncounterCount; ++i) { uint32 tmpState; loadStream >> tmpState; if (tmpState == IN_PROGRESS || tmpState > SPECIAL) tmpState = NOT_STARTED; SetBossState(i, EncounterState(tmpState)); } uint32 tmp; loadStream >> tmp; IncreaseDeadElementals(tmp); } else
void OnUnitDeath(Unit* unit) override { Creature* creature = unit->ToCreature(); if (!creature) return; switch (creature->GetEntry()) { case NPC_FIRE_WARDEN: case NPC_EARTH_WARDEN: case NPC_WATER_WARDEN: case NPC_AIR_WARDEN: uint32 data = creature->GetEntry() - WARDEN_ENTRY_DATA_DELTA; SetBossState(data, IN_PROGRESS); // Needs to be set to IN_PROGRESS or else the gameobjects state won't be updated SetBossState(data, DONE); IncreaseDeadElementals(1); if (Creature* brann = instance->GetCreature(BrannBronzebeardGUID)) brann->AI()->DoAction(ACTION_ELEMENTAL_DIED); break; } }
void ReadSaveDataMore(std::istringstream& data) override { uint32 deadElementals; data >> deadElementals; IncreaseDeadElementals(deadElementals); }