scriptdev2 / scriptdev2-cata

ScriptDev2 for Cataclysm

Home Page:http://www.scriptdev2.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Only Hodir issues.

opened this issue · comments

https://github.com/scriptdev2/scriptdev2-cata/blob/master/scripts/northrend/ulduar/ulduar/boss_hodir.cpp
Maybe I'm repeating myself, but still.

  1. Despite the addition of Attack Start return if m_bEventFinished = true.
    Attack he can not, but aggro instance data changes due hodir helper npc.
    They do not care about 35 fractions. They just attack flash freeze, which as you know the attack on him boss enters into battle, instance data changes, the doors close and the script breaks.
    Solution was suggested headache - you said that you will not be added. Okay.
    As far as I've seen on the official server, flash freeze should immediately go into despawned (some visual effect they have)
NPC_DRUID_HORDE_N           = 32941,                    // Tor Greycloud
    NPC_DRUID_HORDE_H           = 33333,                    // Kar Greycloud
    NPC_SHAMAN_HORDE_N          = 32950,                    // Spiritwalker Yona
    NPC_SHAMAN_HORDE_H          = 33332,                    // Spiritwalker Tara
    NPC_MAGE_HORDE_N            = 32946,                    // Veesha Blazeweaver
    NPC_MAGE_HORDE_H            = 33331,                    // Amira Blazeweaver
    NPC_PRIEST_HORDE_N          = 32948,                    // Battle-Priest Eliza
    NPC_PRIEST_HORDE_H          = 33330,                    // Battle-Priest Gina
    NPC_DRUID_ALLIANCE_N        = 32901,                    // Ellie Nightfeather
    NPC_DRUID_ALLIANCE_H        = 33325,                    // Eivi Nightfeather
    NPC_SHAMAN_ALLIANCE_N       = 32900,                    // Elementalist Avuun
    NPC_SHAMAN_ALLIANCE_H       = 33328,                    // Elementalist Mahfuun
    NPC_MAGE_ALLIANCE_N         = 32893,                    // Missy Flamecuffs
    NPC_MAGE_ALLIANCE_H         = 33327,                    // Sissy Flamecuffs
    NPC_PRIEST_ALLIANCE_N       = 32897,                    // Field Medic Penny
    NPC_PRIEST_ALLIANCE_H       = 33326,                    // Field Medic Jessi
    NPC_FLASH_FREEZE                    = 32926,                // entry used during the encounter
    NPC_FLASH_FREEZE_NPC                = 32938,                // entry which stuns the friendly npcs before the actual fight

It is necessary to assign them guid list or something. Flash Freeze too.
Also go into despawned, but not immediately. They rejoice in the release of Hodir and 30 seconds despawned.
When evade Hodir (if m_bEventFinished ! = True)
And Hodir Helper and Flash Freeze must despawned as Hodir himself. Instance script then resummon them.

It is necessary to assign them guid list or something. Flash Freeze too.

Can add to the list guid and send them (without using around) AI Event (AI_EVENT_CUSTOM_A for Flash Freeze(Has SD2) and AI_EVENT_CUSTOM_EVENTAI_A(Has EventAI) for Hodir Helper npc).
If m_bEventFinished = true, Send AI Event.
Or:

void UpdateAI(const uint32 /*uiDiff*/) override
    {
        // Flash Freeze npcs should be always be summoned
        if (!m_creature->IsTemporarySummon())
            return;

        // do the freezing on the first update tick
        if (!m_bFreezeInit)

        if (m_bEventFinished)
            return;
        {
            // Flash Freeze npc will always stun or kill the summoner
            if (m_creature->GetEntry() == NPC_FLASH_FREEZE_NPC)
            {
                if (DoCastSpellIfCan(m_creature, SPELL_FLASH_FREEZE_AURA_NPC) == CAST_OK)
                    DoCastSpellIfCan(m_creature, SPELL_FLASH_FREEZE_INITIAL, CAST_TRIGGERED);
            }
            else if (m_creature->GetEntry() == NPC_FLASH_FREEZE)
            {
                if (Unit* pSummoner = m_creature->GetMap()->GetUnit(((TemporarySummon*)m_creature)->GetSummonerGuid()))
                {
                    // kill frozen players
                    if (pSummoner->HasAura(SPELL_FREEZE))
                        DoCastSpellIfCan(pSummoner, SPELL_FLASH_FREEZE_KILL);
                    else
                        DoCastSpellIfCan(m_creature, SPELL_FLASH_FREEZE_AURA);

                    if (pSummoner->GetTypeId() == TYPEID_PLAYER && m_pInstance)
                        m_pInstance->SetSpecialAchievementCriteria(TYPE_ACHIEV_CHEESE_FREEZE, false);
                }
            }

            m_bFreezeInit = true;
        }
    }
};
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 (m_bEventFinished)
                return;

            if (Creature* pHodir = pInstance->GetSingleCreatureFromStorage(NPC_HODIR))
                pHodir->SetInCombatWithZone();
        }

        return true;
    }

    return false;
}

Can Boolean variables (m_bEventFinished) add to the script EventId_event_boss_hodir?
If idea add check on m_bEventfinished wrong, maybe add new Hodir data? HODIR_DEFEATED.
On Damage Taken set Data.
In Process Event add Check Instance Data?

Which option is better? Your please tell me, I will try to write a check - if all is well, do push.

Which option is better? Your please tell me, I will try to write a check - if all is well, do push.

I will tell you.
Very busy today and for the weekend. We can work on this on Monday.

Successful weekend!

I still can't find any problem with this script.
Please make sure that you are testing this with a complete party using the latest versions of core, SD2 and DB.

else if (uiEventId == EVENT_ID_ATTACK_START)
        {
            // Start encounter
            if (m_bEventFinished)
                return;

            if (Creature* pHodir = pInstance->GetSingleCreatureFromStorage(NPC_HODIR))
                pHodir->SetInCombatWithZone();
        }

        return true;

And here the database or the core.
pHodir->SetInCombatWithZone();
Please be the boss to 1 percent xn, he becomes friendly, hit the ice and all the flash it again in battle. A Hodir helper ignore fraction killing lump again they are being attacked. Instance data changes, the doors are closed and all - the script bungle.
Cataclysm you did not upgrade. Problem and Wotlk present.
By the way, another problem is when I get into ANTECHAMBER_OF_ULDUAR, it causes aggro on me.

void Aggro(Unit* /*pWho*/) override
    {
       if (m_bEventFinished)
            return;

        if (m_pInstance)
        {
            m_pInstance->SetData(TYPE_HODIR, IN_PROGRESS);
            m_pInstance->SetData(TYPE_HODIR_HARD, DONE);
        }

        DoScriptText(SAY_AGGRO, m_creature);
        DoCastSpellIfCan(m_creature, SPELL_BITTING_COLD, CAST_TRIGGERED);
        DoCastSpellIfCan(m_creature, SPELL_ICICLE_AURA, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT);
        DoCastSpellIfCan(m_creature, SPELL_SHATTER_CHEST, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT);
    }

Or:

void Aggro(Unit* pWho) override
    {
        if (pWho->GetTypeId() != TYPEID_PLAYER)
            return;

        if (m_pInstance)
        {
            m_pInstance->SetData(TYPE_HODIR, IN_PROGRESS);
            m_pInstance->SetData(TYPE_HODIR_HARD, DONE);
        }

        DoScriptText(SAY_AGGRO, m_creature);
        DoCastSpellIfCan(m_creature, SPELL_BITTING_COLD, CAST_TRIGGERED);
        DoCastSpellIfCan(m_creature, SPELL_ICICLE_AURA, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT);
        DoCastSpellIfCan(m_creature, SPELL_SHATTER_CHEST, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT);
    }

A lot of problems will disappear immediately.
Ragnaros in Firelands this example(Although EventAI and db script hacks for interaction will be easier to write for 3-4 hours) here will be required to appear three heroic Archdruid and it should never attack them.

Ok, now I think I understand what are you trying to say.
I will check again.

I hope this will do the job scriptdev2/scriptdev2@db23c6e