scriptdev2/scriptdev2-cata — pull request #9 by Ulduar (2014-11-27 01:04:09+00:00)
Title: Does not allow to change the instance data , if Event Finished = true. B...

...osses change - Thorim, Algalon and Hodir.
Hopefully pull request is created right?
As I said earlier, one wrong action and battle begins anew.
``` CPP
bool ProcessEventId_event_boss_hodir(uint32 uiEventId, Object* pSource, Object* /*pTarget*/, bool /*bIsStart*/)
{
if (pSource->GetTypeId() == TYPEID_UNIT)
{
instance_ulduar* pInstance = (instance_ulduar*)((Creature*)pSource)->GetInstanceData();
if (!pInstance)
return true;

if (uiEventId == EVENT_ID_SHATTER_CHEST)
{
// Mark hard mode as failed and despawn the Rare cache
pInstance->SetData(TYPE_HODIR_HARD, FAIL);

if (GameObject* pChest = pInstance->GetSingleGameObjectFromStorage(pInstance->instance->IsRegularDifficulty() ? GO_CACHE_OF_RARE_WINTER_10 : GO_CACHE_OF_RARE_WINTER_25))
pChest->SetLootState(GO_JUST_DEACTIVATED);
}
else if (uiEventId == EVENT_ID_ATTACK_START)
{
// Start encounter
if (Creature* pHodir = pInstance->GetSingleCreatureFromStorage(NPC_HODIR))
pHodir->SetInCombatWithZone();
}

return true;
}
```