diff --git a/sql/migrations/20190519133601_world.sql b/sql/migrations/20190519133601_world.sql new file mode 100644 index 000000000..16a20c7f3 --- /dev/null +++ b/sql/migrations/20190519133601_world.sql @@ -0,0 +1,37 @@ +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`='20190519133601'); +IF v=0 THEN +INSERT INTO `migrations` VALUES ('20190519133601'); +-- Add your query below. + + +-- Events list for Atiesh +DELETE FROM `creature_ai_events` WHERE `creature_id`=16387; +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 (1638701, 16387, 0, 11, 0, 100, 0, 0, 0, 0, 0, 1638701, 0, 0, 'Atiesh - Cast Lightning Visual on Spawn'); +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 (1638702, 16387, 0, 7, 0, 100, 0, 0, 0, 0, 0, 1638702, 0, 0, 'Atiesh - Reset Equipment on Evade'); +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 (1638703, 16387, 0, 34, 0, 100, 0, 67, 0, 0, 0, 1638703, 0, 0, 'Atiesh - Cast Reaper of Souls DND on Disarm'); +DELETE FROM `creature_ai_scripts` WHERE `id`=1638701; +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 (1638701, 0, 39, 16387, 0, 0, 0, 0, 0, 0, 4, 100, 0, 0, 0, 0, 0, 0, 0, 0, 'Atiesh - Cast Lightning Visual'); +DELETE FROM `creature_ai_scripts` WHERE `id`=1638702; +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 (1638702, 0, 19, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Atiesh - Reset Equipment'); +DELETE FROM `creature_ai_scripts` WHERE `id`=1638703; +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 (1638703, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 'Atiesh - Hide Weapon'); +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 (1638703, 0, 15, 28355, 3, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Atiesh - Cast Spell Reaper of Suls DND'); +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 (1638703, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12338, 0, 0, 0, 0, 0, 0, 0, 0, 'Atiesh - Say Text'); +DELETE FROM `event_scripts` WHERE `id`=16387; +INSERT INTO `event_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 (16387, 0, 15, 24240, 3, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Atiesh - Cast Spell Spawn - Red Lightning'); +REPLACE INTO `creature_template_addon` (`entry`, `patch`, `mount`, `bytes1`, `b2_0_sheath`, `b2_1_flags`, `emote`, `moveflags`, `auras`) VALUES (16387, 9, 0, 0, 0, 0, 0, 0, '12787 28340'); +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 (163870, 'Stratholme - Atiesh', 19729, 100, 4, 0, 0, 0, 1, 1, 13, 18, 0, 28352, 100, 0, 0, 0, 0, 15, 15, 15, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); +UPDATE `creature_template` SET `spell_list_id`=163870, `ai_name`='EventAI', `script_name`='' WHERE `entry`=16387; + + +-- End of migration. +END IF; +END?? +delimiter ; +CALL add_migration(); +DROP PROCEDURE IF EXISTS add_migration; diff --git a/src/game/AI/CreatureEventAI.cpp b/src/game/AI/CreatureEventAI.cpp index 04f7bdb9a..fcad0b09b 100644 --- a/src/game/AI/CreatureEventAI.cpp +++ b/src/game/AI/CreatureEventAI.cpp @@ -197,11 +197,11 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction case EVENT_T_EVADE: case EVENT_T_LEAVE_COMBAT: break; - case EVENT_T_SPELLHIT: + case EVENT_T_HIT_BY_SPELL: //Spell hit is special case, param1 and param2 handled within CreatureEventAI::SpellHit //Repeat Timers - pHolder.UpdateRepeatTimer(m_creature, event.spell_hit.repeatMin, event.spell_hit.repeatMax); + pHolder.UpdateRepeatTimer(m_creature, event.hit_by_spell.repeatMin, event.hit_by_spell.repeatMax); break; case EVENT_T_RANGE: //Repeat Timers @@ -375,6 +375,10 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction pHolder.UpdateRepeatTimer(m_creature, event.victim_rooted.repeatMin, event.victim_rooted.repeatMax); break; } + case EVENT_T_HIT_BY_AURA: + //Repeat Timers + pHolder.UpdateRepeatTimer(m_creature, event.hit_by_aura.repeatMin, event.hit_by_aura.repeatMax); + break; default: sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u has invalid Event Type(%u), missing from ProcessEvent() Switch.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type); break; @@ -721,11 +725,25 @@ void CreatureEventAI::SpellHit(Unit* pUnit, const SpellEntry* pSpell) return; for (auto& i : m_CreatureEventAIList) - if (i.Event.event_type == EVENT_T_SPELLHIT) - //If spell id matches (or no spell id) & if spell school matches (or no spell school) - if (!i.Event.spell_hit.spellId || pSpell->Id == i.Event.spell_hit.spellId) - if (GetSchoolMask(pSpell->School) & i.Event.spell_hit.schoolMask) + { + switch (i.Event.event_type) + { + case EVENT_T_HIT_BY_SPELL: + { + //If spell id matches (or no spell id) & if spell school matches (or no spell school) + if (!i.Event.hit_by_spell.spellId || pSpell->Id == i.Event.hit_by_spell.spellId) + if (GetSchoolMask(pSpell->School) & i.Event.hit_by_spell.schoolMask) + ProcessEvent(i, pUnit); + break; + } + case EVENT_T_HIT_BY_AURA: + { + if (!i.Event.hit_by_aura.auraType || pSpell->HasAura(AuraType(i.Event.hit_by_aura.auraType))) ProcessEvent(i, pUnit); + break; + } + } + } } void CreatureEventAI::MovementInform(uint32 type, uint32 id) diff --git a/src/game/AI/CreatureEventAI.h b/src/game/AI/CreatureEventAI.h index 635b03dc6..52ab8431c 100644 --- a/src/game/AI/CreatureEventAI.h +++ b/src/game/AI/CreatureEventAI.h @@ -45,7 +45,7 @@ enum EventAI_Type EVENT_T_KILL = 5, // RepeatMin, RepeatMax, PlayerOnly EVENT_T_DEATH = 6, // NONE EVENT_T_EVADE = 7, // NONE - EVENT_T_SPELLHIT = 8, // SpellID, School, RepeatMin, RepeatMax + EVENT_T_HIT_BY_SPELL = 8, // SpellID, School, RepeatMin, RepeatMax EVENT_T_RANGE = 9, // MinDist, MaxDist, RepeatMin, RepeatMax EVENT_T_OOC_LOS = 10, // NoHostile, MaxRnage, RepeatMin, RepeatMax EVENT_T_SPAWNED = 11, // NONE @@ -71,6 +71,7 @@ enum EventAI_Type EVENT_T_MAP_SCRIPT_EVENT = 31, // Param1 = EventID, Param2 = Data EVENT_T_GROUP_MEMBER_DIED = 32, // Param1 = CreatureId, Param2 = IsLeader EVENT_T_VICTIM_ROOTED = 33, // RepeatMin, RepeatMax + EVENT_T_HIT_BY_AURA = 34, // AuraType, Unused, RepeatMin, RepeatMax EVENT_T_END, }; @@ -133,14 +134,14 @@ struct CreatureEventAI_Event uint32 repeatMax; uint32 playerOnly; } kill; - // EVENT_T_SPELLHIT = 8 + // EVENT_T_HIT_BY_SPELL = 8 struct { uint32 spellId; uint32 schoolMask; // -1 (==0xffffffff) is ok value for full mask, or must be more limited mask like (0 < 1) = 1 for normal/physical school uint32 repeatMin; uint32 repeatMax; - } spell_hit; + } hit_by_spell; // EVENT_T_RANGE = 9 struct { @@ -244,6 +245,14 @@ struct CreatureEventAI_Event uint32 repeatMin; uint32 repeatMax; } victim_rooted; + // EVENT_T_HIT_BY_AURA = 33 + struct + { + uint32 auraType; + uint32 unused; + uint32 repeatMin; + uint32 repeatMax; + } hit_by_aura; // RAW struct { diff --git a/src/game/AI/CreatureEventAIMgr.cpp b/src/game/AI/CreatureEventAIMgr.cpp index b3360897f..80e5abfe4 100644 --- a/src/game/AI/CreatureEventAIMgr.cpp +++ b/src/game/AI/CreatureEventAIMgr.cpp @@ -135,24 +135,24 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Events() temp.event_flags &= ~EFLAG_REPEATABLE; } break; - case EVENT_T_SPELLHIT: - if (temp.spell_hit.spellId) + case EVENT_T_HIT_BY_SPELL: + if (temp.hit_by_spell.spellId) { - SpellEntry const* pSpell = sSpellMgr.GetSpellEntry(temp.spell_hit.spellId); + SpellEntry const* pSpell = sSpellMgr.GetSpellEntry(temp.hit_by_spell.spellId); if (!pSpell) { - sLog.outErrorDb("CreatureEventAI: Creature %u has nonexistent SpellID(%u) defined in event %u.", temp.creature_id, temp.spell_hit.spellId, i); + sLog.outErrorDb("CreatureEventAI: Creature %u has nonexistent SpellID(%u) defined in event %u.", temp.creature_id, temp.hit_by_spell.spellId, i); continue; } - if ((temp.spell_hit.schoolMask & GetSchoolMask(pSpell->School)) != GetSchoolMask(pSpell->School)) - sLog.outErrorDb("CreatureEventAI: Creature %u has param1(spellId %u) but param2 is not -1 and not equal to spell's school mask. Event %u can never trigger.", temp.creature_id, temp.spell_hit.schoolMask, i); + if ((temp.hit_by_spell.schoolMask & GetSchoolMask(pSpell->School)) != GetSchoolMask(pSpell->School)) + sLog.outErrorDb("CreatureEventAI: Creature %u has param1(spellId %u) but param2 is not -1 and not equal to spell's school mask. Event %u can never trigger.", temp.creature_id, temp.hit_by_spell.schoolMask, i); } - if (!temp.spell_hit.schoolMask) - sLog.outErrorDb("CreatureEventAI: Creature %u is using invalid SpellSchoolMask(%u) defined in event %u.", temp.creature_id, temp.spell_hit.schoolMask, i); + if (!temp.hit_by_spell.schoolMask) + sLog.outErrorDb("CreatureEventAI: Creature %u is using invalid SpellSchoolMask(%u) defined in event %u.", temp.creature_id, temp.hit_by_spell.schoolMask, i); - if (temp.spell_hit.repeatMax < temp.spell_hit.repeatMin) + if (temp.hit_by_spell.repeatMax < temp.hit_by_spell.repeatMin) sLog.outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); break; case EVENT_T_RANGE: @@ -297,6 +297,17 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Events() sLog.outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); break; } + case EVENT_T_HIT_BY_AURA: + { + if (temp.hit_by_aura.auraType && (temp.hit_by_aura.auraType >= TOTAL_AURAS)) + { + sLog.outErrorDb("CreatureEventAI: Creature %u has nonexistent AuraType(%u) defined in event %u.", temp.creature_id, temp.hit_by_aura.auraType, i); + continue; + } + if (temp.hit_by_aura.repeatMax < temp.hit_by_aura.repeatMin) + sLog.outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); + break; + } default: sLog.outErrorDb("CreatureEventAI: Creature %u using not checked at load event (%u) in event %u. Need check code update?", temp.creature_id, temp.event_id, i); break; diff --git a/src/game/Objects/Unit.cpp b/src/game/Objects/Unit.cpp index 1efd8b296..4dbb5535b 100644 --- a/src/game/Objects/Unit.cpp +++ b/src/game/Objects/Unit.cpp @@ -772,16 +772,16 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa // Before 1.11 the calculation whether to break fear used base spell damage. // Calling it from spell class for direct spell damage in this case. #if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_10_2 - if (!spellProto || !spellProto->IsAuraAddedBySpell(SPELL_AURA_MOD_FEAR)) + if (!spellProto || !spellProto->HasAura(SPELL_AURA_MOD_FEAR)) #else - if (!spellProto || ((damagetype != SPELL_DIRECT_DAMAGE) && !spellProto->IsAuraAddedBySpell(SPELL_AURA_MOD_FEAR))) + if (!spellProto || ((damagetype != SPELL_DIRECT_DAMAGE) && !spellProto->HasAura(SPELL_AURA_MOD_FEAR))) #endif { if (!(GetTypeId() == TYPEID_UNIT && ((Creature*)this)->IsWorldBoss())) pVictim->RemoveFearEffectsByDamageTaken(cleanDamage->absorb, spellProto ? spellProto->Id : 0, damagetype); } - if (!spellProto || !(spellProto->Mechanic == MECHANIC_ROOT || spellProto->IsAuraAddedBySpell(SPELL_AURA_MOD_ROOT))) + if (!spellProto || !(spellProto->Mechanic == MECHANIC_ROOT || spellProto->HasAura(SPELL_AURA_MOD_ROOT))) pVictim->RemoveSpellbyDamageTaken(SPELL_AURA_MOD_ROOT, cleanDamage->absorb); pVictim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_DAMAGE, spellProto ? spellProto->Id : 0); @@ -802,9 +802,9 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa // Before 1.11 the calculation whether to break fear used base spell damage. // Calling it from spell class for direct spell damage in this case. #if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_10_2 - if (!spellProto || !spellProto->IsAuraAddedBySpell(SPELL_AURA_MOD_FEAR)) + if (!spellProto || !spellProto->HasAura(SPELL_AURA_MOD_FEAR)) #else - if (!spellProto || ((damagetype != SPELL_DIRECT_DAMAGE) && !spellProto->IsAuraAddedBySpell(SPELL_AURA_MOD_FEAR))) + if (!spellProto || ((damagetype != SPELL_DIRECT_DAMAGE) && !spellProto->HasAura(SPELL_AURA_MOD_FEAR))) #endif { if (!(GetTypeId() == TYPEID_UNIT && ((Creature*)this)->IsWorldBoss())) @@ -812,7 +812,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa } // root type spells do not dispel the root effect - if (!spellProto || !(spellProto->Mechanic == MECHANIC_ROOT || spellProto->IsAuraAddedBySpell(SPELL_AURA_MOD_ROOT))) + if (!spellProto || !(spellProto->Mechanic == MECHANIC_ROOT || spellProto->HasAura(SPELL_AURA_MOD_ROOT))) pVictim->RemoveSpellbyDamageTaken(SPELL_AURA_MOD_ROOT, damage); // no xp,health if type 8 /critters/ @@ -870,7 +870,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa } //Get in CombatState if ((pVictim != this) && (damagetype != DOT || (spellProto && !spellProto->IsSpellAppliesPeriodicAura())) && - (!spellProto || !spellProto->IsAuraAddedBySpell(SPELL_AURA_DAMAGE_SHIELD))) + (!spellProto || !spellProto->HasAura(SPELL_AURA_DAMAGE_SHIELD))) { SetInCombatWithVictim(pVictim); pVictim->SetInCombatWithAggressor(this); diff --git a/src/game/Spells/SpellEntry.h b/src/game/Spells/SpellEntry.h index 6482e30a6..f5f9679c9 100644 --- a/src/game/Spells/SpellEntry.h +++ b/src/game/Spells/SpellEntry.h @@ -745,14 +745,6 @@ class SpellEntry return !!(SpellFamilyFlags & BitMask::value); } - bool IsAuraAddedBySpell(uint32 auraType) const - { - for (int i = 0; i < 3; i++) - if (EffectApplyAuraName[i] == auraType) - return true; - return false; - } - uint32 GetAllSpellMechanicMask() const { uint32 mask = 0; diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt index 1d46ef0b8..3574ea40b 100644 --- a/src/scripts/CMakeLists.txt +++ b/src/scripts/CMakeLists.txt @@ -130,7 +130,6 @@ set (SCRIPTS_SRCS eastern_kingdoms/eastern_plaguelands/stratholme/boss_postmaster_malown.cpp eastern_kingdoms/eastern_plaguelands/stratholme/boss_ramstein_the_gorger.cpp eastern_kingdoms/eastern_plaguelands/stratholme/boss_timmy_the_cruel.cpp - eastern_kingdoms/eastern_plaguelands/stratholme/boss_atiesh.cpp eastern_kingdoms/eastern_plaguelands/stratholme/instance_stratholme.cpp eastern_kingdoms/eastern_plaguelands/stratholme/stratholme.cpp eastern_kingdoms/elwynn_forest/elwynn_forest.cpp diff --git a/src/scripts/ScriptLoader.cpp b/src/scripts/ScriptLoader.cpp index 99239e5c7..1b2fd00ed 100644 --- a/src/scripts/ScriptLoader.cpp +++ b/src/scripts/ScriptLoader.cpp @@ -150,7 +150,6 @@ void AddSC_boss_ramstein_the_gorger(); void AddSC_boss_timmy_the_cruel(); void AddSC_boss_postmaster_malown(); void AddSC_boss_dathrohan_balnazzar(); -void AddSC_boss_atiesh(); void AddSC_instance_stratholme(); void AddSC_stratholme(); void AddSC_instance_sunken_temple(); //sunken_temple @@ -410,7 +409,6 @@ void AddScripts() AddSC_boss_timmy_the_cruel(); AddSC_boss_postmaster_malown(); AddSC_boss_dathrohan_balnazzar(); - AddSC_boss_atiesh(); AddSC_instance_stratholme(); AddSC_stratholme(); AddSC_instance_sunken_temple(); //sunken_temple diff --git a/src/scripts/eastern_kingdoms/eastern_plaguelands/stratholme/boss_atiesh.cpp b/src/scripts/eastern_kingdoms/eastern_plaguelands/stratholme/boss_atiesh.cpp deleted file mode 100644 index 96903a8c6..000000000 --- a/src/scripts/eastern_kingdoms/eastern_plaguelands/stratholme/boss_atiesh.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/* Copyright (C) 2017 Light's Hope - * 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 - */ - -#include "scriptPCH.h" - - -enum eSpells -{ - SPELL_THRASH = 12787, // 35% chance on attack. 8876 for 15%, 3417 for 10% - SPELL_SHADOW_BOLT = 19729, - SPELL_UNHOLY_AURA = 28340, - //SPELL_BREATH_OF_SARGERAS = 28342, // Used by SPELL_BREATH_OF_SARGERAS_SCRIPT script-effect - SPELL_BREATH_OF_SARGERAS_SCRIPT = 28352, - SPELL_REAPER_OF_SOULS_DND = 28355, // summon the sword gobj - //SPELL_ANTIMAGIC_PULSE = 29463, // Can't seem to see this being used in any videos -}; - -enum eEvents -{ - EVENT_UNHOLY_AURA = 1, - EVENT_BREATH_OF_SARGERAS, - EVENT_ANTIMAGIC_PULSE, - EVENT_SHADOW_BOLT, -}; - -struct boss_atiesh : public ScriptedAI -{ - EventMap events; - bool hasBeenDisarmed; - bool hasDoneSpawnCast; - - boss_atiesh(Creature* pCreature) : ScriptedAI(pCreature) - { - hasDoneSpawnCast = false; - Reset(); - } - - void Reset() override - { - events.Reset(); - hasBeenDisarmed = false; - m_creature->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, 22738); - } - - void Aggro(Unit* pWho) override - { - events.ScheduleEvent(EVENT_BREATH_OF_SARGERAS, Seconds(15)); - events.ScheduleEvent(EVENT_SHADOW_BOLT, Seconds(1)); - } - - void SpellHit(Unit*, const SpellEntry* spell) override - { - // look for disarm, drop a weapon - if (!hasBeenDisarmed && spell->IsAuraAddedBySpell(SPELL_AURA_MOD_DISARM)) - { - hasBeenDisarmed = true; - // Summon the gobj with the sword - m_creature->CastSpell(m_creature, SPELL_REAPER_OF_SOULS_DND, true); - m_creature->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, 0); - } - } - - void UpdateAI(const uint32 diff) override - { - if (!hasDoneSpawnCast) - { - m_creature->CastSpell(m_creature, 24240, true); - hasDoneSpawnCast = true; - } - - if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) - return; - - if (!m_creature->HasAura(SPELL_UNHOLY_AURA)) - DoCastSpellIfCan(m_creature, SPELL_UNHOLY_AURA); - if (!m_creature->HasAura(SPELL_THRASH)) - DoCastSpellIfCan(m_creature, SPELL_THRASH); - - events.Update(diff); - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_UNHOLY_AURA: - break; - case EVENT_BREATH_OF_SARGERAS: - if (DoCastSpellIfCan(m_creature, SPELL_BREATH_OF_SARGERAS_SCRIPT) == CAST_OK) - events.Repeat(Seconds(urand(15, 25))); - else - events.Repeat(100); - break; - case EVENT_SHADOW_BOLT: - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0, SPELL_SHADOW_BOLT)) - { - if (DoCastSpellIfCan(pTarget, SPELL_SHADOW_BOLT) == CAST_OK) - { - events.Repeat(Seconds(urand(13, 18))); - break; - } - } - events.Repeat(100); - break; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_atiesh(Creature* pCreature) -{ - return new boss_atiesh(pCreature); -} - -void AddSC_boss_atiesh() -{ - Script* newscript; - - newscript = new Script; - newscript->Name = "boss_atiesh"; - newscript->GetAI = &GetAI_boss_atiesh; - newscript->RegisterSelf(); -}