diff --git a/sql/migrations/20201010150010_world.sql b/sql/migrations/20201010150010_world.sql new file mode 100644 index 000000000..f737721a2 --- /dev/null +++ b/sql/migrations/20201010150010_world.sql @@ -0,0 +1,45 @@ +DROP PROCEDURE IF EXISTS add_migration; +delimiter ?? +CREATE PROCEDURE `add_migration`() +BEGIN +DECLARE v INT DEFAULT 1; +SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20201010150010'); +IF v=0 THEN +INSERT INTO `migrations` VALUES ('20201010150010'); +-- Add your query below. + + +-- Tyrande Whisperwind 7999 (add missing cleave and add correct starfall spell) +REPLACE INTO `creature_spells` (`entry`, `name`, `spellId_1`, `probability_1`, `castTarget_1`, `targetParam1_1`, `targetParam2_1`, `castFlags_1`, `delayInitialMin_1`, `delayInitialMax_1`, `delayRepeatMin_1`, `delayRepeatMax_1`, `scriptId_1`, `spellId_2`, `probability_2`, `castTarget_2`, `targetParam1_2`, `targetParam2_2`, `castFlags_2`, `delayInitialMin_2`, `delayInitialMax_2`, `delayRepeatMin_2`, `delayRepeatMax_2`, `scriptId_2`, `spellId_3`, `probability_3`, `castTarget_3`, `targetParam1_3`, `targetParam2_3`, `castFlags_3`, `delayInitialMin_3`, `delayInitialMax_3`, `delayRepeatMin_3`, `delayRepeatMax_3`, `scriptId_3`, `spellId_4`, `probability_4`, `castTarget_4`, `targetParam1_4`, `targetParam2_4`, `castFlags_4`, `delayInitialMin_4`, `delayInitialMax_4`, `delayRepeatMin_4`, `delayRepeatMax_4`, `scriptId_4`, `spellId_5`, `probability_5`, `castTarget_5`, `targetParam1_5`, `targetParam2_5`, `castFlags_5`, `delayInitialMin_5`, `delayInitialMax_5`, `delayRepeatMin_5`, `delayRepeatMax_5`, `scriptId_5`, `spellId_6`, `probability_6`, `castTarget_6`, `targetParam1_6`, `targetParam2_6`, `castFlags_6`, `delayInitialMin_6`, `delayInitialMax_6`, `delayRepeatMin_6`, `delayRepeatMax_6`, `scriptId_6`, `spellId_7`, `probability_7`, `castTarget_7`, `targetParam1_7`, `targetParam2_7`, `castFlags_7`, `delayInitialMin_7`, `delayInitialMax_7`, `delayRepeatMin_7`, `delayRepeatMax_7`, `scriptId_7`, `spellId_8`, `probability_8`, `castTarget_8`, `targetParam1_8`, `targetParam2_8`, `castFlags_8`, `delayInitialMin_8`, `delayInitialMax_8`, `delayRepeatMin_8`, `delayRepeatMax_8`, `scriptId_8`) VALUES (79990, 'Darnassus - Tyrande Whisperwind', 26540, 100, 0, 0, 0, 0, 6, 8, 16, 21, 0, 20690, 100, 4, 0, 0, 0, 9, 12, 17, 22, 0, 20688, 100, 4, 0, 0, 0, 11, 14, 9, 12, 0, 20691, 100, 1, 0, 0, 0, 5, 7, 6, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + +-- High Tinker Mekkatorque 7937 +INSERT INTO `creature_ai_events` (`id`, `creature_id`, `condition_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_script`, `action2_script`, `action3_script`, `comment`) VALUES (793701, 7937, 0, 4, 0, 100, 0, 0, 0, 0, 0, 793701, 0, 0, 'High Tinker Mekkatorque - Play Sound 5897 on Aggro'); +INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (793701, 0, 16, 5897, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'High Tinker Mekkatorque - Play Sound 5897 on Aggro'); +INSERT INTO `creature_ai_events` (`id`, `creature_id`, `condition_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_script`, `action2_script`, `action3_script`, `comment`) VALUES (793702, 7937, 0, 5, 0, 100, 0, 0, 0, 1, 0, 793702, 0, 0, 'High Tinker Mekkatorque - Play Sound 7255 on Player Kill'); +INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (793702, 0, 16, 7255, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'High Tinker Mekkatorque - Play Sound 7255 on Player Kill'); +REPLACE INTO `creature_spells` (`entry`, `name`, `spellId_1`, `probability_1`, `castTarget_1`, `targetParam1_1`, `targetParam2_1`, `castFlags_1`, `delayInitialMin_1`, `delayInitialMax_1`, `delayRepeatMin_1`, `delayRepeatMax_1`, `scriptId_1`, `spellId_2`, `probability_2`, `castTarget_2`, `targetParam1_2`, `targetParam2_2`, `castFlags_2`, `delayInitialMin_2`, `delayInitialMax_2`, `delayRepeatMin_2`, `delayRepeatMax_2`, `scriptId_2`, `spellId_3`, `probability_3`, `castTarget_3`, `targetParam1_3`, `targetParam2_3`, `castFlags_3`, `delayInitialMin_3`, `delayInitialMax_3`, `delayRepeatMin_3`, `delayRepeatMax_3`, `scriptId_3`, `spellId_4`, `probability_4`, `castTarget_4`, `targetParam1_4`, `targetParam2_4`, `castFlags_4`, `delayInitialMin_4`, `delayInitialMax_4`, `delayRepeatMin_4`, `delayRepeatMax_4`, `scriptId_4`, `spellId_5`, `probability_5`, `castTarget_5`, `targetParam1_5`, `targetParam2_5`, `castFlags_5`, `delayInitialMin_5`, `delayInitialMax_5`, `delayRepeatMin_5`, `delayRepeatMax_5`, `scriptId_5`, `spellId_6`, `probability_6`, `castTarget_6`, `targetParam1_6`, `targetParam2_6`, `castFlags_6`, `delayInitialMin_6`, `delayInitialMax_6`, `delayRepeatMin_6`, `delayRepeatMax_6`, `scriptId_6`, `spellId_7`, `probability_7`, `castTarget_7`, `targetParam1_7`, `targetParam2_7`, `castFlags_7`, `delayInitialMin_7`, `delayInitialMax_7`, `delayRepeatMin_7`, `delayRepeatMax_7`, `scriptId_7`, `spellId_8`, `probability_8`, `castTarget_8`, `targetParam1_8`, `targetParam2_8`, `castFlags_8`, `delayInitialMin_8`, `delayInitialMax_8`, `delayRepeatMin_8`, `delayRepeatMax_8`, `scriptId_8`) VALUES (79370, 'Ironforge - High Tinker Mekkatorque', 9143, 100, 5, 0, 0, 0, 3, 5, 15, 18, 0, 22739, 100, 0, 0, 0, 0, 9, 11, 16, 19, 0, 22742, 100, 1, 0, 0, 0, 6, 8, 20, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); +UPDATE `creature_template` SET `spell_list_id` = 79370 WHERE `entry` = 7937; +UPDATE `creature_template` SET `ai_name` = 'EventAI' WHERE `entry` = 7937; + +-- King Magni Bronzebeard 2784 +INSERT INTO `creature_ai_events` (`id`, `creature_id`, `condition_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_script`, `action2_script`, `action3_script`, `comment`) VALUES (278401, 2784, 0, 4, 0, 100, 0, 0, 0, 0, 0, 278401, 0, 0, 'King Magni Bronzebeard - Play Sound 5896 on Aggro'); +INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (278401, 0, 16, 5896, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'King Magni Bronzebeard - Play Sound 5896 on Aggro'); +REPLACE INTO `creature_spells` (`entry`, `name`, `spellId_1`, `probability_1`, `castTarget_1`, `targetParam1_1`, `targetParam2_1`, `castFlags_1`, `delayInitialMin_1`, `delayInitialMax_1`, `delayRepeatMin_1`, `delayRepeatMax_1`, `scriptId_1`, `spellId_2`, `probability_2`, `castTarget_2`, `targetParam1_2`, `targetParam2_2`, `castFlags_2`, `delayInitialMin_2`, `delayInitialMax_2`, `delayRepeatMin_2`, `delayRepeatMax_2`, `scriptId_2`, `spellId_3`, `probability_3`, `castTarget_3`, `targetParam1_3`, `targetParam2_3`, `castFlags_3`, `delayInitialMin_3`, `delayInitialMax_3`, `delayRepeatMin_3`, `delayRepeatMax_3`, `scriptId_3`, `spellId_4`, `probability_4`, `castTarget_4`, `targetParam1_4`, `targetParam2_4`, `castFlags_4`, `delayInitialMin_4`, `delayInitialMax_4`, `delayRepeatMin_4`, `delayRepeatMax_4`, `scriptId_4`, `spellId_5`, `probability_5`, `castTarget_5`, `targetParam1_5`, `targetParam2_5`, `castFlags_5`, `delayInitialMin_5`, `delayInitialMax_5`, `delayRepeatMin_5`, `delayRepeatMax_5`, `scriptId_5`, `spellId_6`, `probability_6`, `castTarget_6`, `targetParam1_6`, `targetParam2_6`, `castFlags_6`, `delayInitialMin_6`, `delayInitialMax_6`, `delayRepeatMin_6`, `delayRepeatMax_6`, `scriptId_6`, `spellId_7`, `probability_7`, `castTarget_7`, `targetParam1_7`, `targetParam2_7`, `castFlags_7`, `delayInitialMin_7`, `delayInitialMax_7`, `delayRepeatMin_7`, `delayRepeatMax_7`, `scriptId_7`, `spellId_8`, `probability_8`, `castTarget_8`, `targetParam1_8`, `targetParam2_8`, `castFlags_8`, `delayInitialMin_8`, `delayInitialMax_8`, `delayRepeatMin_8`, `delayRepeatMax_8`, `scriptId_8`) VALUES (27840, 'Ironforge - King Magni Bronzebeard', 19135, 100, 0, 0, 0, 0, 5, 7, 25, 30, 0, 20686, 100, 1, 0, 0, 0, 8, 10, 20, 30, 0, 20685, 100, 4, 0, 0, 0, 12, 15, 15, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); +UPDATE `creature_template` SET `spell_list_id`=27840, `ai_name`='EventAI', `script_name`='' WHERE `entry`=2784; + +-- Varimathras 2425 +INSERT INTO `creature_ai_events` (`id`, `creature_id`, `condition_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_script`, `action2_script`, `action3_script`, `comment`) VALUES (242501, 2425, 0, 4, 0, 100, 0, 0, 0, 0, 0, 242501, 0, 0, 'Varimathras - Play Sound 5887 on Aggro'); +INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (242501, 0, 16, 5887, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Varimathras - Play Sound 5887 on Aggro'); + +-- Cairne Bloodhoof 3057 +INSERT INTO `creature_ai_events` (`id`, `creature_id`, `condition_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_script`, `action2_script`, `action3_script`, `comment`) VALUES (305700, 3057, 0, 4, 0, 100, 0, 0, 0, 0, 0, 305700, 0, 0, 'Cairne Bloodhoof - Play Sound 5884 on Aggro'); +INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (305700, 0, 16, 5884, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Cairne Bloodhoof - Play Sound 5884 on Aggro'); +UPDATE `creature_template` SET `ai_name` = 'EventAI' WHERE `entry` = 3057; + + +-- End of migration. +END IF; +END?? +delimiter ; +CALL add_migration(); +DROP PROCEDURE IF EXISTS add_migration; diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt index ed916acc4..36c115a34 100644 --- a/src/scripts/CMakeLists.txt +++ b/src/scripts/CMakeLists.txt @@ -133,7 +133,6 @@ set (SCRIPTS_SRCS eastern_kingdoms/elwynn_forest/elwynn_forest.cpp eastern_kingdoms/hillsbrad_foothills/hillsbrad_foothills.cpp eastern_kingdoms/hinterlands/hinterlands.cpp - eastern_kingdoms/ironforge/ironforge.cpp eastern_kingdoms/loch_modan/loch_modan.cpp eastern_kingdoms/redridge_mountains/redridge_mountains.cpp eastern_kingdoms/searing_gorge/searing_gorge.cpp diff --git a/src/scripts/ScriptLoader.cpp b/src/scripts/ScriptLoader.cpp index 52990590d..0c1a3ca03 100644 --- a/src/scripts/ScriptLoader.cpp +++ b/src/scripts/ScriptLoader.cpp @@ -182,7 +182,6 @@ void AddSC_eastern_plaguelands(); void AddSC_elwynn_forest(); void AddSC_hillsbrad_foothills(); void AddSC_hinterlands(); -void AddSC_ironforge(); void AddSC_loch_modan(); void AddSC_redridge_mountains(); void AddSC_searing_gorge(); @@ -437,7 +436,6 @@ void AddScripts() AddSC_elwynn_forest(); AddSC_hillsbrad_foothills(); AddSC_hinterlands(); - AddSC_ironforge(); AddSC_loch_modan(); AddSC_redridge_mountains(); AddSC_searing_gorge(); diff --git a/src/scripts/eastern_kingdoms/ironforge/ironforge.cpp b/src/scripts/eastern_kingdoms/ironforge/ironforge.cpp deleted file mode 100644 index 2122ff64c..000000000 --- a/src/scripts/eastern_kingdoms/ironforge/ironforge.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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: Ironforge -SD%Complete: 100 -SDCategory: Ironforge -EndScriptData */ - -#include "scriptPCH.h" - -enum eSpells -{ - SPELL_STORM_BOLT = 20685, - SPELL_KNOCK_AWAY = 20686, - SPELL_AVATAR = 19135, - SPELL_THUNDER_CLAP = 23931, - SPELL_LAY_ON_HAND = 17233, - SPELL_CHARGE = 22911, -}; - -struct boss_magni_bronzebeardAI : public ScriptedAI -{ -public: - boss_magni_bronzebeardAI(Creature* pCreature) : ScriptedAI(pCreature) - { - Reset(); - } - - void Reset() override - { - m_uiStormBoltTimer = 10000; - m_uiKnockAwayTimer = 20000; - m_uiAvatarTimer= 25000; - m_uiThunderClapTimer = 15000; - m_uiChargeTimer = 10000; - m_bHasUsedLOH = false; - m_bHasStormBolted = false; - } - - void DamageTaken(Unit* /*pDealer*/, uint32& uiDamage) override - { - if (!m_bHasUsedLOH && uiDamage >= m_creature->GetHealth()) - { - if (DoCastSpellIfCan(m_creature, SPELL_LAY_ON_HAND) == CAST_OK) - m_bHasUsedLOH = true; - uiDamage = m_creature->GetHealth() - 1; - } - } - - void SpellHitTarget(Unit* pTarget, SpellEntry const* pSpell) override - { - if (pSpell->Id == SPELL_KNOCK_AWAY) - if (m_creature->GetThreatManager().getThreat(pTarget)) - m_creature->GetThreatManager().modifyThreatPercent(pTarget, -25); - } - - void UpdateAI(uint32 const uiDiff) override - { - if (!m_creature->SelectHostileTarget() || !m_creature->GetVictim()) - return; - - if (m_uiStormBoltTimer <= uiDiff) - { - if (m_bHasStormBolted) - { - if (DoCastSpellIfCan(m_creature->GetVictim(), SPELL_STORM_BOLT) == CAST_OK) - { - m_bHasStormBolted = false; - m_uiStormBoltTimer = 10000; - } - } - else if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1)) - { - if (DoCastSpellIfCan(pTarget, SPELL_STORM_BOLT) == CAST_OK) - { - m_uiStormBoltTimer = 0; - m_bHasStormBolted = true; - } - } - } - else - m_uiStormBoltTimer -= uiDiff; - - if (m_uiKnockAwayTimer <= uiDiff) - { - if (DoCastSpellIfCan(m_creature, SPELL_KNOCK_AWAY) == CAST_OK) - m_uiKnockAwayTimer = 20000; - } - else - m_uiKnockAwayTimer -= uiDiff; - - if (m_uiAvatarTimer <= uiDiff) - { - if (DoCastSpellIfCan(m_creature, SPELL_AVATAR) == CAST_OK) - m_uiAvatarTimer = 25000; - } - else - m_uiAvatarTimer -= uiDiff; - - if (m_uiThunderClapTimer <= uiDiff) - { - if (DoCastSpellIfCan(m_creature, SPELL_THUNDER_CLAP) == CAST_OK) - m_uiThunderClapTimer = 15000; - } - else - m_uiThunderClapTimer -= uiDiff; - - if (m_uiChargeTimer <= uiDiff) - { - if (DoCastSpellIfCan(m_creature->GetVictim(), SPELL_CHARGE) == CAST_OK) - m_uiChargeTimer = 5000; - } - else - m_uiChargeTimer -= uiDiff; - - DoMeleeAttackIfReady(); - EnterEvadeIfOutOfCombatArea(uiDiff); - } - -private: - uint32 m_uiStormBoltTimer; - uint32 m_uiKnockAwayTimer; - uint32 m_uiAvatarTimer; - uint32 m_uiThunderClapTimer; - uint32 m_uiChargeTimer; - bool m_bHasUsedLOH; - bool m_bHasStormBolted; -}; - -CreatureAI* GetAI_boss_magni_bronzebeard(Creature* pCreature) -{ - return new boss_magni_bronzebeardAI(pCreature); -} - -void AddSC_ironforge() -{ - Script* newscript; - - newscript = new Script; - newscript->Name = "boss_magni_bronzebeard"; - newscript->GetAI = &GetAI_boss_magni_bronzebeard; - newscript->RegisterSelf(); -} diff --git a/src/scripts/eastern_kingdoms/undercity/undercity.cpp b/src/scripts/eastern_kingdoms/undercity/undercity.cpp index 8806014c1..544d996b7 100644 --- a/src/scripts/eastern_kingdoms/undercity/undercity.cpp +++ b/src/scripts/eastern_kingdoms/undercity/undercity.cpp @@ -62,6 +62,11 @@ public: m_uiShootTimer = 10000; } + void EnterCombat(Unit* enemy) override + { + me->PlayDistanceSound(5886); + } + void UpdateAI(uint32 const uiDiff) override { if (m_uiFadedTimer) diff --git a/src/scripts/kalimdor/dustwallow_marsh/dustwallow_marsh.cpp b/src/scripts/kalimdor/dustwallow_marsh/dustwallow_marsh.cpp index cb16cbb2d..b9cb6d207 100644 --- a/src/scripts/kalimdor/dustwallow_marsh/dustwallow_marsh.cpp +++ b/src/scripts/kalimdor/dustwallow_marsh/dustwallow_marsh.cpp @@ -923,6 +923,11 @@ struct npc_lady_jaina_proudmooreAI : public ScriptedAI m_uiSpecialTimer = 15000; } + void EnterCombat(Unit* enemy) override + { + me->PlayDistanceSound(5882); + } + void UpdateAI(uint32 const uiDiff) override { if (!m_creature->SelectHostileTarget() || !m_creature->GetVictim() || m_creature->IsNonMeleeSpellCasted())