Quest Lord Illidan Stormrage

Issue #1178 new
AlphaFox
created an issue

Illidan come and remove your Maskarade and the orks is killing you

Need for Netherwing Drake quest chain

http://www.wowhead.com/quest=11108/lord-illidan-stormrage

Comments (6)

  1. Areradon
    /*####
    # npc_overlord_morghor
    ####*/
    
    #define QUEST_LORD_ILLIDAN_STORMRAGE 11108
    
    #define C_ILLIDAN 22083
    #define C_YARZILL 23141
    
    #define SPELL_ONE 39990 // Red Lightning Bolt
    #define SPELL_TWO 41528 // Mark of Stormrage
    #define SPELL_THREE 40216 // Dragonaw Faction
    #define SPELL_FOUR 42016 // Dragonaw Trasform
    
    #define OVERLORD_SAY_1 -1000206
    #define OVERLORD_SAY_2 -1000207
    #define OVERLORD_SAY_3 -1000208
    #define OVERLORD_SAY_4 -1000209
    #define OVERLORD_SAY_5 -1000210
    #define OVERLORD_SAY_6 -1000211
    
    #define OVERLORD_YELL_1 -1000212
    #define OVERLORD_YELL_2 -1000213
    
    #define LORD_ILLIDAN_SAY_1 -1000214
    #define LORD_ILLIDAN_SAY_2 -1000215
    #define LORD_ILLIDAN_SAY_3 -1000216
    #define LORD_ILLIDAN_SAY_4 -1000217
    #define LORD_ILLIDAN_SAY_5 -1000218
    #define LORD_ILLIDAN_SAY_6 -1000219
    #define LORD_ILLIDAN_SAY_7 -1000220
    
    #define YARZILL_THE_MERC_SAY -1000221
    
    struct npc_overlord_morghorAI : public ScriptedAI
    {
        npc_overlord_morghorAI(Creature *c) : ScriptedAI(c) {}
    
        uint64 PlayerGUID;
        uint64 IllidanGUID;
    
        uint32 ConversationTimer;
        uint32 Step;
        uint32 resetTimer;
    
        bool Event;
    
        void Reset()
        {
            PlayerGUID = 0;
            IllidanGUID = 0;
    
            ConversationTimer = 0;
            Step = 0;
    
            resetTimer = 180000;
    
            Event = false;
            m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 2);
        }
    
        void StartEvent()
        {
            m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0);
            m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
            Unit* Illidan = m_creature->SummonCreature(C_ILLIDAN, -5107.83, 602.584, 85.2393, 4.92598, TEMPSUMMON_CORPSE_DESPAWN, 0);
            if(Illidan)
            {
                IllidanGUID = Illidan->GetGUID();
                Illidan->SetVisibility(VISIBILITY_OFF);
            }
            if(PlayerGUID)
            {
                Player* player = Unit::GetPlayer(PlayerGUID);
                if(player)
                    DoScriptText(OVERLORD_SAY_1, m_creature, player);
            }
            ConversationTimer = 4200;
            Step = 0;
            Event = true;
        }
    
        uint32 NextStep(uint32 Step)
        {
            Player* plr = Unit::GetPlayer(PlayerGUID);
    
            Creature* Illi = Unit::GetCreature((*m_creature), IllidanGUID);
    
            if(!plr || (!Illi && Step < 23))
            {
                EnterEvadeMode();
                return 0;
            }
    
            switch(Step)
            {
            case 0: return 0; break;
            case 1: m_creature->GetMotionMaster()->MovePoint(0, -5104.41, 595.297, 85.6838); return 9000; break;
            case 2: DoScriptText(OVERLORD_YELL_1, m_creature, plr); return 4500; break;
            case 3: m_creature->SetInFront(plr); return 3200;  break;
            case 4: DoScriptText(OVERLORD_SAY_2, m_creature, plr); return 2000; break;
            case 5: Illi->SetVisibility(VISIBILITY_ON);
                 Illi->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); return 350; break;
            case 6:
                Illi->CastSpell(Illi, SPELL_ONE, true);
                Illi->SetSelection(m_creature->GetGUID());
                m_creature->SetSelection(IllidanGUID);
                return 2000; break;
            case 7: DoScriptText(OVERLORD_YELL_2, m_creature); return 4500; break;
            case 8: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); return 2500; break;
            case 9: DoScriptText(OVERLORD_SAY_3, m_creature); return 6500; break;
            case 10: DoScriptText(LORD_ILLIDAN_SAY_1, Illi); return 5000;  break;
            case 11: DoScriptText(OVERLORD_SAY_4, m_creature, plr); return 6000; break;
            case 12: DoScriptText(LORD_ILLIDAN_SAY_2, Illi); return 5500; break;
            case 13: DoScriptText(LORD_ILLIDAN_SAY_3, Illi); return 4000; break;
            case 14: Illi->SetSelection(PlayerGUID); return 1500; break;
            case 15: DoScriptText(LORD_ILLIDAN_SAY_4, Illi); return 1500; break;
            case 16:
                if (plr)
                {
                    Illi->CastSpell(plr, SPELL_TWO, true);
                    plr->RemoveAurasDueToSpell(SPELL_THREE);
                    plr->RemoveAurasDueToSpell(SPELL_FOUR);
                    return 5000;
                }
                else
                {
                 // if !plr we can't do that!
                 //   plr->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE);
                    Step = 30; return 100;
                }
                break;
            case 17: DoScriptText(LORD_ILLIDAN_SAY_5, Illi); return 5000; break;
            case 18: DoScriptText(LORD_ILLIDAN_SAY_6, Illi); return 5000; break;
            case 19: DoScriptText(LORD_ILLIDAN_SAY_7, Illi); return 5000; break;
            case 20:
                Illi->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
                Illi->SetLevitate(true);
                return 500; break;
            case 21: DoScriptText(OVERLORD_SAY_5, m_creature); return 500; break;
            case 22:
                Illi->SetVisibility(VISIBILITY_OFF);
                Illi->setDeathState(JUST_DIED);
                return 1000; break;
            case 23: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); return 2000; break;
            case 24: m_creature->SetSelection(PlayerGUID); return 5000; break;
            case 25: DoScriptText(OVERLORD_SAY_6, m_creature); return 2000; break;
            case 26:
                if(plr)
                    plr->GroupEventHappens(QUEST_LORD_ILLIDAN_STORMRAGE, m_creature);
                return 6000; break;
            case 27:
                {
                Unit* Yarzill = FindCreature(C_YARZILL, 50, m_creature);
                if (Yarzill)
                    Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID);
                return 500; }break;
            case 28:
                plr->RemoveAurasDueToSpell(SPELL_TWO);
                plr->RemoveAurasDueToSpell(41519);
                plr->CastSpell(plr, SPELL_THREE, true);
                plr->CastSpell(plr, SPELL_FOUR, true);
                return 1000; break;
            case 29:
                {
                Unit* Yarzill = FindCreature(C_YARZILL, 50, m_creature);
                if(Yarzill)
                    DoScriptText(YARZILL_THE_MERC_SAY, Yarzill, plr);
                return 5000; }break;
            case 30:
                {
                Unit* Yarzill = FindCreature(C_YARZILL, 50, m_creature);
                if (Yarzill)
                    Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, 0);
                return 5000; }break;
            case 31:
                {
                Unit* Yarzill = FindCreature(C_YARZILL, 50, m_creature);
                if (Yarzill)
                    Yarzill->CastSpell(plr, 41540, true);
                return 1000;}break;
            case 32: m_creature->GetMotionMaster()->MovePoint(0, -5085.77, 577.231, 86.6719); return 5000; break;
            case 33: EnterEvadeMode(); return 100; break;
    
            default : return 0;
            }
        }
    
        void UpdateAI(const uint32 diff)
        {
            if(!ConversationTimer)
                return;
    
            if(ConversationTimer <= diff)
            {
                if(Event && IllidanGUID && PlayerGUID)
                {
                    ConversationTimer = NextStep(++Step);
                }
            }else ConversationTimer -= diff;
        }
    };
    
    CreatureAI* GetAI_npc_overlord_morghorAI(Creature *_Creature)
    {
    return new npc_overlord_morghorAI(_Creature);
    }
    
    bool QuestAccept_npc_overlord_morghor(Player *player, Creature *_Creature, const Quest *_Quest )
    {
        if(_Quest->GetQuestId() == QUEST_LORD_ILLIDAN_STORMRAGE)
        {
            ((npc_overlord_morghorAI*)_Creature->AI())->PlayerGUID = player->GetGUID();
            ((npc_overlord_morghorAI*)_Creature->AI())->StartEvent();
            return true;
        }
        return false;
    }
    
  2. Log in to comment