Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Baradin Hold bosses. Currently Argaloth and Alizabal. #33

Open
ghost opened this issue Jun 10, 2015 · 1 comment
Open

Baradin Hold bosses. Currently Argaloth and Alizabal. #33

ghost opened this issue Jun 10, 2015 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 10, 2015

Welcome, EventAI patch for Argaloth and Alizabal in closed issue (why closed?)
All Baradin Hold bosses should despawn on evade (not reached home), because should have correct reset and also should delay before respawn (like Yogg-Saron, Halion and other). Handled in instance script.
#1 (comment) unfortunately does not work until the end.
1)Argaloth problem - at aggro (having 100 percent of health) immediately begins to cast Fel Firestorm - of this should not be.
2)Alizabal - must change speedrate while dance blades - also has a charge on randomly in the enemy plus function movepoint. Also, it must be a sequence of spells (Skewer and Seething Hate). A similar example seen in a script Freya.
If Skewer cast result == CAST_OK. The following must be Seething Hate and vice versa. But Skewer not be thrown twice.It should be the next. If count = 2, reset count. I used the script boss Freya basis. A new instance data is created to Send AI Event. In another, I just do not know how.

commit f4547211396b69c2f223d780e84c936ad111ddec
Author: FollowerAI <FollowerAI@cataclysm.com>
Date:   Wed Jun 10 20:29:19 2015 +0600

    Add support script for Argaloth and Alizabal. Placeholder.

diff --git a/scripts/eastern_kingdoms/baradin_hold/baradin_hold.h b/scripts/eastern_kingdoms/baradin_hold/baradin_hold.h
index 7d4ff04..36d5bef 100644
--- a/scripts/eastern_kingdoms/baradin_hold/baradin_hold.h
+++ b/scripts/eastern_kingdoms/baradin_hold/baradin_hold.h
@@ -7,13 +7,14 @@

 enum
 {
-    MAX_ENCOUNTER               = 3,                        // Argaloth, Occu'tar and Alizabal
+    MAX_ENCOUNTER               = 4,                        // Argaloth, Occu'tar, Alizabal and Alizabal Events.

     TYPE_ARGALOTH               = 0,
     TYPE_OCCUTAR                = 1,
     TYPE_ALIZABAL               = 2,
+    TYPE_ALIZABAL_EVENT         = 3,                        // Alizabal should cast random spells on timer.

-    NPC_ARGALOTH                = 47120,                    // 
+    NPC_ARGALOTH                = 47120,                    
     NPC_OCCUTAR                 = 52363,
     NPC_ALIZABAL                = 55869,

@@ -46,6 +47,12 @@ class instance_baradin_hold : public ScriptedInstance
     private:
         uint32 m_auiEncounter[MAX_ENCOUNTER];
         std::string m_strInstData;
+        
+        uint32 m_uiArgalothRespawnTimer;
+        uint32 m_uiOccutarRespawnTimer;
+        uint32 m_uiAlizabalRespawnTimer;
+        uint32 m_uiAlizabalSendEventOneTimer;
+        uint32 m_uiAlizabalSendEventTwoTimer:
 };

 #endif
diff --git a/scripts/eastern_kingdoms/baradin_hold/boss_alizabal.cpp b/scripts/eastern_kingdoms/baradin_hold/boss_alizabal.cpp
new file mode 100644
index 0000000..aede8f3
--- /dev/null
+++ b/scripts/eastern_kingdoms/baradin_hold/boss_alizabal.cpp
@@ -0,0 +1,286 @@
+/* This file is part of the ScriptDev2 Project. See AUTHORS file for Copyright information
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/* ScriptData
+SDName: Boss_Alizabal
+SD%Complete: 0
+SDComment: Placeholder
+SDCategory: Baradin Hold
+EndScriptData */
+
+#include "precompiled.h"
+#include "baradin_hold.h"
+
+enum
+{   
+    SAY_INTRO                   = -1757000,
+    SAY_AGGRO                   = -1757001,
+    SAY_EVADE                   = -1757002,
+    SAY_DEATH                   = -1757003,
+    SAY_SLAY_1                  = -1757004,
+    SAY_SLAY_2                  = -1757005,
+    SAY_SLAY_3                  = -1757006,
+    SAY_TAUNT_1                 = -1757007,
+    SAY_TAUNT_2                 = -1757008,
+    SAY_WHIRLWIND               = -1757009,
+    
+    EMOTE_GENERIC_BERSERK       = -1000004,
+    
+    SPELL_BLADE_DANCE_DUMMY     = 105828,
+    SPELL_BLADE_DANCE           = 105784,
+    SPELL_SEETHING_HATE         = 105067,
+    SPELL_SKEWER                = 104936,
+    SPELL_BERSERK               = 47008,
+    
+    MAX_RANDOM_SPELLS           = 2,
+};
+
+static const uint32 aAlizabalBattleSpells[MAX_RANDOM_SPELLS] = {SPELL_SEETHING_HATE, SPELL_SKEWER};
+
+/*######
+## boss_alizabal
+######*/
+
+struct boss_alizabalAI : public ScriptedAI
+{
+    boss_alizabalAI(Creature* pCreature) : ScriptedAI(pCreature)
+    {
+        m_pInstance = ((instance_baradin_hold*)pCreature->GetInstanceData());
+        
+        // init the Alizabal Spells.
+        battleSpellsVector.reserve(MAX_RANDOM_SPELLS);
+        for (uint8 i = 0; i < MAX_RANDOM_SPELLS; ++i)
+            battleSpellsVector.push_back(aAlizabalBattleSpells[i]);
+        
+        Reset();
+    }
+
+    instance_baradin_hold* m_pInstance;
+
+    uint32 m_uiBladeDanceTimer;
+    uint32 m_uiChargeTimer;
+    uint32 m_uiStopChargeTimer;
+    uint8 m_uiAlizabalSpellsCount;
+    bool m_bIntro;
+    
+    std::vector<uint32> battleSpellsVector;
+
+    void Reset() override
+    {
+        SetCombatMovement(true);
+        
+        m_uiAlizabalSpellsCount    = 0;
+        m_uiBladeDanceTimer        = 0;
+        m_uiChargeTimer;           = 0;
+        m_uiStopChargeTimer        = 0;
+        m_uiBerserkTimer           = 5 * MINUTE * IN_MILLISECONDS;
+        m_bIntro                   = false;
+        
+        // make the battle spells random
+        std::random_shuffle(battleSpellsVector.begin(), battleSpellsVector.end());
+    }
+
+    void EnterEvadeMode() override
+    {
+        m_creature->RemoveAllAurasOnEvade();
+        m_creature->DeleteThreatList();
+        m_creature->CombatStop(true);
+        m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+        m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE);
+        DoScriptText(SAY_EVADE, m_creature);
+        m_creature->ForcedDespawn(3000);
+        
+        if (m_pInstance->GetData(TYPE_ALIZABAL_EVENT) != NOT_STARTED)
+            m_pInstance->SetData(TYPE_ALIZABAL_EVENT, NOT_STARTED);
+
+        m_creature->SetLootRecipient(NULL);
+
+        Reset();
+    }
+    
+    void Aggro(Unit* /*pWho*/) override
+    {
+        if (m_pInstance)
+            m_pInstance->SetData(TYPE_ALIZABAL_EVENT, IN_PROGRESS);
+    }
+    
+    void KilledUnit(Unit* pVictim) override
+    {
+        if (pVictim->GetTypeId() != TYPEID_PLAYER)
+            return;
+
+        if (urand(0, 2))
+            DoScriptText(urand(0, 2) ? SAY_SLAY_1 : SAY_SLAY_2 : SAY_SLAY_3 m_creature);
+    }
+    
+    void JustDied(Unit* /*pKiller*/) override
+    { 
+       if (m_pInstance->GetData(TYPE_ALIZABAL) == DONE)
+           m_pInstance->SetData(TYPE_ALIZABAL_EVENT, DONE);
+           DoScriptText(SAY_DEATH, m_creature);
+    }
+    
+    void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 /*uiMiscValue*/) override
+    {
+        // handle Alizabal battle spells.
+        if (eventType == AI_EVENT_CUSTOM_A)
+        {
+            // adjust the index to the size of the vector
+            uint8 uiIndex = m_uiAlizabalSpellsCount;
+            if (uiIndex >= MAX_RANDOM_SPELLS)
+                uiIndex = m_uiAlizabalSpellsCount - MAX_RANDOM_SPELLS;
+
+            switch (battleSpellsVector[uiIndex])
+            {
+                case SPELL_SEETHING_HATE:  DoScriptText(SAY_TAUNT_1, m_creature); break;
+                case SPELL_SKEWER:         DoScriptText(SAY_TAUNT_2, m_creature); break;
+            }
+
+            DoCastSpellIfCan(m_creature, battleSpellsVector[uiIndex], CAST_TRIGGERED);
+
+            ++m_uiAlizabalSpellsCount;
+
+            // re-shuffle the spells
+            if (m_uiAlizabalSpellsCount == MAX_RANDOM_SPELLS)
+            {
+                uint32 uiLastSpell = battleSpellsVector[MAX_RANDOM_SPELLS - 1];
+                std::random_shuffle(battleSpellsVector.begin(), battleSpellsVector.end());
+
+                // make sure we won't repeat the last spell
+                while (battleSpellsVector[0] == uiLastSpell)
+                    std::random_shuffle(battleSpellsVector.begin(), battleSpellsVector.end());
+            }
+
+        }
+        // Start the intro event
+        else if (!m_bIntro && eventType == AI_EVENT_CUSTOM_B)
+        {
+            DoScriptText(SAY_INTRO, m_creature);
+            m_bIntro = true;
+        }
+        // Start Whirlwind event.
+        else if (eventType == AI_EVENT_CUSTOM_C)
+        {
+           if (m_pInstance->GetData(TYPE_ALIZABAL_EVENT) != NOT_STARTED)
+               m_pInstance->SetData(TYPE_ALIZABAL_EVENT, NOT_STARTED);
+            
+            // the boss has increased speed for this move; handled as custom
+            float fSpeedRate = m_creature->GetSpeedRate(MOVE_RUN);
+            m_creature->SetWalk(false);
+            m_creature->SetSpeedRate(MOVE_RUN, 4);
+            m_creature->SetSpeedRate(MOVE_RUN, fSpeedRate);
+            SetCombatMovement(false);
+            DoScriptText(SAY_WHIRLWIND, m_creature);
+            m_uiBladeDanceTimer = 1000
+        }
+            
+    }
+    
+    void MovementInform(uint32 uiType, uint32 uiPointId) override
+    {
+        if (uiType != POINT_MOTION_TYPE)
+            return;
+
+        if (uiPointId)
+        {
+           
+           m_uiChargeTimer = 4000;
+           m_uiStopChargeTimer = 13000;
+        }
+    }
+    
+    void DoRemoveCharge()
+    {
+       // Clear All Timer, return standart speed rate and allow instance script inform about timer skewer and seething hate timer.
+       if (m_pInstance->GetData(TYPE_ALIZABAL_EVENT) != IN_PROGRESS)
+           m_pInstance->SetData(TYPE_ALIZABAL_EVENT, IN_PROGRESS);
+           SetCombatMovement(true);
+           m_uiBladeDance = 0;
+           m_uiChargeTimer = 0:
+           m_uiStopChargeTimer = 0:
+           m_uiAlizabalSpellsCount = 0;
+           float fSpeedRate = m_creature->GetSpeedRate(MOVE_RUN);
+           m_creature->SetWalk(false);
+           m_creature->SetSpeedRate(MOVE_RUN, 1.14);
+           m_creature->SetSpeedRate(MOVE_RUN, fSpeedRate);           
+           
+    }  
+    
+    void UpdateAI(const uint32 uiDiff) override
+    {
+        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
+            return;
+        
+        if (m_uiBladeDanceTimer < uiDiff)
+        {
+            if (DoCastSpellIfCan(m_creature, SPELL_BLADE_DANCE) == CAST_OK)
+                m_creature->CastSpell(m_creature, SPELL_BLADE_DANCE_DUMMY, true);
+                m_uiBladeDanceTimer = 0;
+                m_uiChargeTimer = 2000;
+        }
+        else
+            m_uiBladeDanceTimer -= uiDiff;
+        
+        if (m_uiBerserkTimer < uiDiff)
+        {
+            if (DoCastSpellIfCan(m_creature, SPELL_BERSERK) == CAST_OK)
+                DoScriptText(EMOTE_GENERIC_BERSERK, m_creature);
+                m_uiBerserkTimer = 0;
+        }
+        else
+            m_uiBerserkTimer -= uiDiff;
+        
+        // next charge to random enemy
+        if (m_uiChargeTimer < uiDiff)
+        {
+            if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0, uint32(0), SELECT_FLAG_PLAYER))
+            {
+               float fX, fY, fZ;
+               pTarget->GetPosition(fX, fY, fZ);
+               m_creature->GetMotionMaster()->Clear();
+               m_creature->GetMotionMaster()->MovePoint(1, fX, fY, fZ);
+            }
+        }
+          else
+             m_uiChargeTimer -= uiDiff;
+        
+        if (m_uiStopChargeTimer < uiDiff)
+        {
+            DoRemoveCharge();
+        }
+          else
+             m_uiStopChargeTimer -= uiDiff;
+    }
+};
+
+/*######
+## at_alizabal
+######*/
+
+bool AreaTrigger_at_alizabal(Player* pPlayer, AreaTriggerEntry const* /*pAt*/)
+{
+    if (ScriptedInstance* pInstance = (ScriptedInstance*)pPlayer->GetInstanceData())
+    {
+        if (pInstance->GetData(TYPE_ALIZABAL) != DONE)
+        {
+            // Start the intro event
+            if (Creature* pAlizabal = pInstance->GetSingleCreatureFromStorage(NPC_ALIZABAL))
+            {
+                pCreature->AI()->SendAIEvent(AI_EVENT_CUSTOM_B, pPlayer, pCreature);
+            }
+        }
+    }
+
+    return false;
+}
\ No newline at end of file
diff --git a/scripts/eastern_kingdoms/baradin_hold/boss_argaloth.cpp b/scripts/eastern_kingdoms/baradin_hold/boss_argaloth.cpp
new file mode 100644
index 0000000..a337295
--- /dev/null
+++ b/scripts/eastern_kingdoms/baradin_hold/boss_argaloth.cpp
@@ -0,0 +1,155 @@
+/* This file is part of the ScriptDev2 Project. See AUTHORS file for Copyright information
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/* ScriptData
+SDName: Boss_Argaloth
+SD%Complete: 0
+SDComment: Placeholder
+SDCategory: Baradin Hold
+EndScriptData */
+
+#include "precompiled.h"
+#include "baradin_hold.h"
+#include "TemporarySummon.h"
+
+enum
+{   
+    EMOTE_GENERIC_BERSERK       = -1000004,
+    EMOTE_FELFIRESTORM          = -1757010,
+    
+    SPELL_METEOR_SLASH          = 88942,
+    SPELL_CONSUMING_DARKNESS    = 88954,
+    SPELL_FEL_FIRESTORM         = 88972,
+    SPELL_BERSERK               = 47008,
+    SPELL_FEL_FLAME             = 88999,
+    
+    NPC_FEL_FLAME               = 47829,
+};
+
+/*######
+## boss_argaloth
+######*/
+
+struct boss_argalothAI : public ScriptedAI
+{
+    boss_argalothAI(Creature* pCreature) : ScriptedAI(pCreature)
+    {
+        m_pInstance = ((instance_baradin_hold*)pCreature->GetInstanceData());
+        Reset();
+    }
+
+    instance_baradin_hold* m_pInstance;
+
+    uint32 m_uiMeteorSlashTimer;
+    uint32 m_uiConsumingDarknessTimer;
+    uint32 m_uiBerserkTimer;
+    bool m_bIs66FirestomCast;
+    bool m_bIs33FirestomCast;
+
+    void Reset() override
+    {
+        m_uiMeteorSlash            = urand(10000, 15000);
+        m_uiConsumingDarkness      = urand(5000, 7000);
+        m_uiBerserkTimer           = 5 * MINUTE * IN_MILLISECONDS;
+        m_bIs66FirestomCast;       = false;
+        m_bIs33FirestomCast;       = false;
+    }
+
+    void EnterEvadeMode() override
+    {
+        m_creature->RemoveAllAurasOnEvade();
+        m_creature->DeleteThreatList();
+        m_creature->CombatStop(true);
+        m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+        m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE);
+        m_creature->ForcedDespawn(3000);
+
+        m_creature->SetLootRecipient(NULL);
+
+        Reset();
+    }
+    
+    void JustSummoned(Creature* pSummoned) override
+    {
+        if (pSummoned->GetEntry() == NPC_FEL_FLAME)
+        {
+            pSummoned->CastSpell(pSummoned, SPELL_FEL_FLAME, true);
+            pSummoned->ForcedDespawn(30000);
+        }
+    }
+    
+    void UpdateAI(const uint32 uiDiff) override
+    {
+        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
+            return;
+        
+        if (!m_bIs66FirestomCast && m_creature->GetHealthPercent() <= 66.0f)
+        {
+            m_bIs66FirestomCast = true;
+            DoCastSpellIfCan(m_creature, SPELL_FEL_FIRESTORM, CAST_INTERRUPT_PREVIOUS);
+            DoScriptText(EMOTE_FELFIRESTORM, m_creature);
+        }
+        
+        if (!m_bIs33FirestomCast && m_creature->GetHealthPercent() <= 33.0f)
+        {
+            m_bIs33FirestomCast = true;
+            DoCastSpellIfCan(m_creature, SPELL_FEL_FIRESTORM, CAST_INTERRUPT_PREVIOUS);
+            DoScriptText(EMOTE_FELFIRESTORM, m_creature);
+        }
+        
+        if (m_uiMeteorSlash < uiDiff)
+        {
+            if (DoCastSpellIfCan(m_creature, SPELL_METEOR_SLASH) == CAST_OK)
+                m_uiMeteorSlash = urand(15000, 20000);
+        }
+        else
+            m_uiMeteorSlash -= uiDiff;
+        
+        if (m_uiConsumingDarkness < uiDiff)
+        {
+            if (DoCastSpellIfCan(m_creature, SPELL_CONSUMING_DARKNESS) == CAST_OK)
+                m_uiConsumingDarkness = urand(20000, 25000);
+        }
+        else
+            m_uiConsumingDarkness -= uiDiff;
+        
+        if (m_uiBerserkTimer < uiDiff)
+        {
+            if (DoCastSpellIfCan(m_creature, SPELL_BERSERK) == CAST_OK)
+                DoScriptText(EMOTE_GENERIC_BERSERK, m_creature);
+                m_uiBerserkTimer = 0;
+        }
+        else
+            m_uiBerserkTimer -= uiDiff;
+
+        }
+    }
+};
+
+CreatureAI* GetAI_boss_argaloth(Creature* pCreature)
+{
+    return new boss_argalothAI(pCreature);
+}
+
+void AddSC_boss_argaloth()
+{
+    Script* pNewScript;
+
+    pNewScript = new Script;
+    pNewScript->Name = "boss_argaloth";
+    pNewScript->GetAI = &GetAI_boss_argaloth;
+    pNewScript->RegisterSelf();
+}
+    
\ No newline at end of file
diff --git a/scripts/eastern_kingdoms/baradin_hold/instance_baradin_hold.cpp b/scripts/eastern_kingdoms/baradin_hold/instance_baradin_hold.cpp
index 6678204..1239f01 100644
--- a/scripts/eastern_kingdoms/baradin_hold/instance_baradin_hold.cpp
+++ b/scripts/eastern_kingdoms/baradin_hold/instance_baradin_hold.cpp
@@ -25,6 +25,11 @@ EndScriptData */
 #include "baradin_hold.h"

 instance_baradin_hold::instance_baradin_hold(Map* pMap) : ScriptedInstance(pMap)
+    m_uiArgalothRespawnTimer(0),
+    m_uiOccutarRespawnTimer(0),
+    m_uiAlizabalRespawnTimer(0),
+    m_uiAlizabalSendEventOneTimer(0),
+    m_uiAlizabalSendEventTwoTimer(0),
 {
     Initialize();
 }
@@ -110,6 +115,10 @@ void instance_baradin_hold::SetData(uint32 uiType, uint32 uiData)
             // add / remove encounter frames
             if (Creature* pArgaloth = GetSingleCreatureFromStorage(NPC_ARGALOTH))
                 SendEncounterFrame(uiData == IN_PROGRESS ? ENCOUNTER_FRAME_ENGAGE : ENCOUNTER_FRAME_DISENGAGE, pArgaloth->GetObjectGuid());
+            if (uiData == FAIL)
+            {
+                m_uiArgalothRespawnTimer = 20000;
+            }
             break;
         case TYPE_OCCUTAR:
             m_auiEncounter[uiType] = uiData;
@@ -118,6 +127,11 @@ void instance_baradin_hold::SetData(uint32 uiType, uint32 uiData)
             // add / remove encounter frames
             if (Creature* pOccutar = GetSingleCreatureFromStorage(NPC_OCCUTAR))
                 SendEncounterFrame(uiData == IN_PROGRESS ? ENCOUNTER_FRAME_ENGAGE : ENCOUNTER_FRAME_DISENGAGE, pOccutar->GetObjectGuid());
+            if (uiData == FAIL)
+            {
+                m_uiOccutarRespawnTimer = 20000;
+            }
             break;
         case TYPE_ALIZABAL:
             m_auiEncounter[uiType] = uiData;
@@ -126,7 +140,16 @@ void instance_baradin_hold::SetData(uint32 uiType, uint32 uiData)
             // add / remove encounter frames
             if (Creature* pAlizabal = GetSingleCreatureFromStorage(NPC_ALIZABAL))
                 SendEncounterFrame(uiData == IN_PROGRESS ? ENCOUNTER_FRAME_ENGAGE : ENCOUNTER_FRAME_DISENGAGE, pAlizabal->GetObjectGuid());
+            if (uiData == FAIL)
+            {
+                m_uiAlizabalRespawnTimer = 20000;
+            }
             break;
+        case TYPE_ALIZABAL_EVENT:
+            m_auiEncounter[uiType] = uiData;
+            if (uiData == IN_PROGRESS)
+                m_uiAlizabalSendEventOneTimer = 10000;
+                m_uiAlizabalSendEventTwoTimer = 30000;
     }

     if (uiData == DONE)
@@ -134,7 +157,7 @@ void instance_baradin_hold::SetData(uint32 uiType, uint32 uiData)
         OUT_SAVE_INST_DATA;

         std::ostringstream saveStream;
-        saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3];
+        saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4];

         m_strInstData = saveStream.str();

@@ -151,6 +174,68 @@ uint32 instance_baradin_hold::GetData(uint32 uiType) const
     return 0;
 }

+void instance_baradin_hold::Update(uint32 uiDiff)
+{
+    if (m_uiArgalothRespawnTimer)
+    {
+        if (m_uiArgalothRespawnTimer <= uiDiff)
+        {
+            if (Creature* pArgaloth = GetSingleCreatureFromStorage(NPC_ARGALOTH))
+                pArgaloth->Respawn();
+            m_uiArgalothRespawnTimer = 0;
+        }
+        else
+            m_uiArgalothRespawnTimer -= uiDiff;
+    }
+    
+    if (m_uiOccutarRespawnTimer)
+    {
+        if (m_uiOccutarRespawnTimer <= uiDiff)
+        {
+            if (Creature* pOccutar = GetSingleCreatureFromStorage(NPC_OCCUTAR))
+                pOccutar->Respawn();
+            m_uiOccutarRespawnTimer = 0;
+        }
+        else
+            m_uiOccutarRespawnTimer -= uiDiff;
+    }
+    
+    if (m_uiAlizabalRespawnTimer)
+    {
+        if (m_uiAlizabalRespawnTimer <= uiDiff)
+        {
+            if (Creature* pAlizabal = GetSingleCreatureFromStorage(NPC_ALIZABAL))
+                pAlizabal->Respawn();
+            m_uiAlizabalRespawnTimer = 0;
+        }
+        else
+            m_uiAlizabalRespawnTimer -= uiDiff;
+    }
+    
+    if (m_uiAlizabalSendEventOneTimer)
+    {
+        if (m_uiAlizabalSendEventOneTimer <= uiDiff)
+        {
+            if (Creature* pAlizabal = GetSingleCreatureFromStorage(NPC_ALIZABAL))
+                pAlizabal->AI()->SendAIEvent(AI_EVENT_CUSTOM_A, pAlizabal, pAlizabal);
+            m_uiAlizabalSendEventOneTimer = 10000;
+        }
+        else
+            m_uiAlizabalSendEventOneTimer -= uiDiff;
+    }
+    
+    if (m_uiAlizabalSendEventTwoTimer)
+    {
+        if (m_uiAlizabalSendEventTwoTimer <= uiDiff)
+        {
+            if (Creature* pAlizabal = GetSingleCreatureFromStorage(NPC_ALIZABAL))
+                pAlizabal->AI()->SendAIEvent(AI_EVENT_CUSTOM_C, pAlizabal, pAlizabal);
+            m_uiAlizabalSendEventTwoTimer = 0;
+        }
+        else
+            m_uiAlizabalSendEventTwoTimer -= uiDiff;
+    }
+}
 void instance_baradin_hold::Load(const char* chrIn)
 {
     if (!chrIn)
@@ -162,7 +247,7 @@ void instance_baradin_hold::Load(const char* chrIn)
     OUT_LOAD_INST_DATA(chrIn);

     std::istringstream loadStream(chrIn);
-    loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2];
+    loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3];

     for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
     {
diff --git a/sql/mangos_scriptname_full.sql b/sql/mangos_scriptname_full.sql
index 8ec9046..e543827 100644
--- a/sql/mangos_scriptname_full.sql
+++ b/sql/mangos_scriptname_full.sql
@@ -94,6 +94,8 @@ INSERT INTO scripted_areatrigger VALUES
 (5716, 'at_hot_on_the_trail');
 DELETE FROM scripted_areatrigger WHERE entry=3587;
 INSERT INTO scripted_areatrigger VALUES (3587,'at_ancient_leaf');
+DELETE FROM scripted_areatrigger WHERE entry=7246;
+INSERT INTO scripted_areatrigger VALUES (7246,'at_alizabal');


 /* BATTLEGROUNDS */
@@ -278,6 +280,9 @@ UPDATE creature_template SET ScriptName='npc_magwin' WHERE entry=17312;

 /* BARADIN HOLD */
 UPDATE instance_template SET ScriptName='instance_baradin_hold' WHERE map=757;
+UPDATE creature_template SET ScriptName='boss_argaloth' WHERE entry = 47120;
+UPDATE creature_template SET ScriptName='boss_alizabal' WHERE entry = 55869;
+

 /* BARRENS */
 UPDATE creature_template SET ScriptName='npc_beaten_corpse' WHERE entry=10668;
diff --git a/sql/scriptdev2_script_full.sql b/sql/scriptdev2_script_full.sql
index a394318..ddc5365 100644
--- a/sql/scriptdev2_script_full.sql
+++ b/sql/scriptdev2_script_full.sql
@@ -4985,6 +4985,20 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen
 (-1724037,'Your companions\' efforts force Halion further into the physical realm!',0,3,0,0,'halion EMOTE_INTO_PHYSICAL'),
 (-1724038,'Without pressure in both realms %s begins to regenerate.',0,3,0,0,'halion EMOTE_REGENERATE');

+- 1 757 000 BARADIN_HOLD
+INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
+(-1757000,'How I HATE this place. My captors may be long-dead, but don\'t think I won\'t take it all out on you miserable treasure-hunters.',25779,1,0,0,'Alizabal SAY_INTRO'),
+(-1757001,'I hate adventurers.',25777,1,0,0,'Alizabal SAY_AGGRO'),
+(-1757002,'I hate incompetent raiders.',25780,1,0,0,'Alizabal SAY_EVADE'),
+(-1757003,'I hate... every one of you...',25778,1,0,0,'Alizabal SAY_DEATH'),
+(-1757004,'I still hate you.',25781,1,0,0,'Alizabal SAY_SLAY_1'),
+(-1757005,'Do you hate me? Good.',25782,1,0,0,'Alizabal SAY_SLAY_2'),
+(-1757006,'I hate mercy.',25783,1,0,0,'Alizabal SAY_SLAY_3'),
+(-1757007,'I hate armor.',25785,1,0,0,'Alizabal SAY_TAUNT_1'),
+(-1757008,'I hate martyrs.',25786,1,0,0,'Alizabal SAY_TAUNT_2'),
+(-1757009,'I hate you all!',25790,1,0,0,'Alizabal SAY_WHIRLWIND'),
+(-1757010,'%s begins to cast Fel Firestorm!',0,3,0,0,'Argaloth EMOTE_FELFIRESTORM');
+
 -- -1 999 900 EXAMPLE TEXT
 INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
 (-1999900,'Let the games begin.',8280,1,0,0,'example_creature SAY_AGGRO'),
diff --git a/sql/updates/r3102_mangos.sql b/sql/updates/r3102_mangos.sql
index 212d673..01a32a2 100644
--- a/sql/updates/r3102_mangos.sql
+++ b/sql/updates/r3102_mangos.sql
@@ -1 +1,4 @@
-UPDATE creature_template SET ScriptName='npc_black_knight_ghoul' WHERE entry IN (35545,35564,35590);
+UPDATE creature_template SET ScriptName='boss_argaloth' WHERE entry = 47120;
+UPDATE creature_template SET ScriptName='boss_alizabal' WHERE entry = 55869;
+DELETE FROM scripted_areatrigger WHERE entry=7246;
+INSERT INTO scripted_areatrigger VALUES (7246,'at_alizabal');
\ No newline at end of file
diff --git a/sql/updates/r3142_scriptdev2.sql b/sql/updates/r3142_scriptdev2.sql
new file mode 100644
index 0000000..4cf0beb
--- /dev/null
+++ b/sql/updates/r3142_scriptdev2.sql
@@ -0,0 +1,13 @@
+DELETE FROM script_texts WHERE entry BETWEEN -1757000 AND -1757010;
+INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
+(-1757000,'How I HATE this place. My captors may be long-dead, but don\'t think I won\'t take it all out on you miserable treasure-hunters.',25779,1,0,0,'Alizabal SAY_INTRO'),
+(-1757001,'I hate adventurers.',25777,1,0,0,'Alizabal SAY_AGGRO'),
+(-1757002,'I hate incompetent raiders.',25780,1,0,0,'Alizabal SAY_EVADE'),
+(-1757003,'I hate... every one of you...',25778,1,0,0,'Alizabal SAY_DEATH'),
+(-1757004,'I still hate you.',25781,1,0,0,'Alizabal SAY_SLAY_1'),
+(-1757005,'Do you hate me? Good.',25782,1,0,0,'Alizabal SAY_SLAY_2'),
+(-1757006,'I hate mercy.',25783,1,0,0,'Alizabal SAY_SLAY_3'),
+(-1757007,'I hate armor.',25785,1,0,0,'Alizabal SAY_TAUNT_1'),
+(-1757008,'I hate martyrs.',25786,1,0,0,'Alizabal SAY_TAUNT_2'),
+(-1757009,'I hate you all!',25790,1,0,0,'Alizabal SAY_WHIRLWIND'),
+(-1757010,'%s begins to cast Fel Firestorm!',0,3,0,0,'Argaloth EMOTE_FELFIRESTORM');

It Placeholder, maybe somebody can supplement it better. Thanks in advance!
Regarding Occutar - I do not know how scripted the vehicle. Sorry.

@xfurry
Copy link
Member

xfurry commented Jun 11, 2015

Looks good.
will push soonish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant