diff --git a/.github/actions/linux-build/action.yml b/.github/actions/linux-build/action.yml index 9a7ca0612e74b3..4109f918ca7f99 100644 --- a/.github/actions/linux-build/action.yml +++ b/.github/actions/linux-build/action.yml @@ -25,7 +25,7 @@ runs: using: composite steps: - name: Cache - uses: actions/cache@v3 + uses: actions/cache@v4 if: inputs.pch != 'true' with: path: ${{ github.workspace }}/var/ccache diff --git a/.github/workflows/macos_build.yml b/.github/workflows/macos_build.yml index 2e756dc1b8ff65..2fb927004ef78d 100644 --- a/.github/workflows/macos_build.yml +++ b/.github/workflows/macos_build.yml @@ -26,7 +26,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/Library/Caches/ccache key: ccache:${{ matrix.os }}:${{ github.ref }}:${{ github.sha }} diff --git a/.github/workflows/tools_build.yml b/.github/workflows/tools_build.yml index f7d8a31b99098e..2e1a6a9aff3d72 100644 --- a/.github/workflows/tools_build.yml +++ b/.github/workflows/tools_build.yml @@ -30,7 +30,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Cache - uses: actions/cache@v3 + uses: actions/cache@v4 env: cache-name: cache-tools with: diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml index a93f7584226bc0..fbaaf52d1eafbd 100644 --- a/.github/workflows/windows_build.yml +++ b/.github/workflows/windows_build.yml @@ -25,7 +25,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: ccache - uses: hendrikmuhs/ccache-action@v1.2.9 + uses: hendrikmuhs/ccache-action@v1.2.13 - name: Configure OS shell: bash env: diff --git a/apps/docker/entrypoint.sh b/apps/docker/entrypoint.sh index 5cd7fc28dc342c..ad08fb77e4553b 100644 --- a/apps/docker/entrypoint.sh +++ b/apps/docker/entrypoint.sh @@ -1,14 +1,46 @@ #!/usr/bin/env bash set -euo pipefail +CONF_DIR="${CONF_DIR:-/azerothcore/env/dist/etc}" +LOGS_DIR="${LOGS_DIR:-/azerothcore/env/dist/logs}" + +if ! touch "$CONF_DIR/.write-test" || ! touch "$LOGS_DIR/.write-test"; then + cat < 2024_05_18_00 +UPDATE `creature_text` SET `BroadcastTextId`='32838' WHERE `CreatureID`='32169' AND `GroupID`='0' AND `ID`='0'; diff --git a/data/sql/updates/db_world/2024_05_18_01.sql b/data/sql/updates/db_world/2024_05_18_01.sql new file mode 100644 index 00000000000000..d70abdc0371540 --- /dev/null +++ b/data/sql/updates/db_world/2024_05_18_01.sql @@ -0,0 +1,3 @@ +-- DB update 2024_05_18_00 -> 2024_05_18_01 +-- +UPDATE `acore_string` SET `content_default`='%d - |c%x|Hitem:%d:0:0:0:0:0:0:0:0|h[%s]|h|r ', `locale_deDE`='%d - |c%x|Hitem:%d:0:0:0:0:0:0:0:0|h[%s]|h|r ', `locale_zhCN`='%d - |c%x|Hitem:%d:0:0:0:0:0:0:0:0|h[%s]|h|r' WHERE `entry`=512; diff --git a/data/sql/updates/db_world/2024_05_18_02.sql b/data/sql/updates/db_world/2024_05_18_02.sql new file mode 100644 index 00000000000000..0c2cd10a10cbdf --- /dev/null +++ b/data/sql/updates/db_world/2024_05_18_02.sql @@ -0,0 +1,4 @@ +-- DB update 2024_05_18_01 -> 2024_05_18_02 +-- add missing broadcastID to Elder Clearwater txt lines +UPDATE `creature_text` SET `BroadcastTextId` = '38218' WHERE `CreatureID` = '38294' AND `GroupID` = '1' AND `ID`='0'; +UPDATE `creature_text` SET `BroadcastTextId` = '38222' WHERE `CreatureID` = '38294' AND `GroupID` = '3' AND `ID`='0'; diff --git a/data/sql/updates/db_world/2024_05_19_00.sql b/data/sql/updates/db_world/2024_05_19_00.sql new file mode 100644 index 00000000000000..61bfd30dfbb8b5 --- /dev/null +++ b/data/sql/updates/db_world/2024_05_19_00.sql @@ -0,0 +1,19 @@ +-- DB update 2024_05_18_02 -> 2024_05_19_00 +-- Update gameobject 'Crossroads' Supply Crates' with sniffed values +-- updated spawns +DELETE FROM `gameobject` WHERE (`id` IN (175708)) +AND (`guid` IN (13381, 13382, 13384, 13385)); +INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `ScriptName`, `VerifiedBuild`, `Comment`) VALUES +(13381, 175708, 1, 0, 0, 1, 1, -69.6404571533203125, -3390.967529296875, 92.3358001708984375, 2.617989301681518554, 0, 0, 0.965925216674804687, 0.258821308612823486, 120, 255, 1, "", 45435, NULL), +(13382, 175708, 1, 0, 0, 1, 1, -230.87164306640625, -3307.604248046875, 91.66666412353515625, 1.745326757431030273, 0, 0, 0.766043663024902343, 0.642788589000701904, 120, 255, 1, "", 46902, NULL), +(13384, 175708, 1, 0, 0, 1, 1, -60.1678390502929687, -3398.855712890625, 91.72420501708984375, 5.602506637573242187, 0, 0, -0.33380699157714843, 0.942641437053680419, 120, 255, 1, "", 45435, NULL), +(13385, 175708, 1, 0, 0, 1, 1, -212.19598388671875, -3292.279052734375, 91.66666412353515625, 5.044002056121826171, 0, 0, -0.58070278167724609, 0.814115643501281738, 120, 255, 1, "", 51943, NULL); + +-- new spawns +DELETE FROM `gameobject` WHERE (`id` IN (175708)) +AND (`guid` IN (443, 444, 445, 446)); +INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `ScriptName`, `VerifiedBuild`, `Comment`) VALUES +(443, 175708, 1, 0, 0, 1, 1, -134.407684326171875, -3309.6806640625, 91.66666412353515625, 5.375615119934082031, 0, 0, -0.4383707046508789, 0.898794233798980712, 120, 255, 1, "", 45435, NULL), +(444, 175708, 1, 0, 0, 1, 1, -238.936386108398437, -3337.522705078125, 91.68515777587890625, 1.064649581909179687, 0, 0, 0.507537841796875, 0.861629426479339599, 120, 255, 1, "", 45435, NULL), +(445, 175708, 1, 0, 0, 1, 1, -38.3517112731933593, -3373.55859375, 91.701904296875, 0.767943859100341796, 0, 0, 0.374606132507324218, 0.927184045314788818, 120, 255, 1, "", 46902, NULL), +(446, 175708, 1, 0, 0, 1, 1, -48.2439079284667968, -3403.219482421875, 91.69777679443359375, 2.478367090225219726, 0, 0, 0.94551849365234375, 0.325568377971649169, 120, 255, 1, "", 46902, NULL); diff --git a/data/sql/updates/db_world/2024_05_19_01.sql b/data/sql/updates/db_world/2024_05_19_01.sql new file mode 100644 index 00000000000000..1bc400ef8008a4 --- /dev/null +++ b/data/sql/updates/db_world/2024_05_19_01.sql @@ -0,0 +1,8 @@ +-- DB update 2024_05_19_00 -> 2024_05_19_01 +UPDATE `creature_template` SET `mingold` = 2500000, `maxgold` = 2500000 WHERE `entry` IN (17767, 17808, 17842, 17888, 18805, 18831, 19044, 19514, 19516, 21213, 21214, 21215, 21216, 21217, 22841, 23420, 22871, 22887, 22898, 22947, 22948, 24882, 24892, 25038, 25840); +UPDATE `creature_template` SET `mingold` = 625000, `maxgold` = 625000 WHERE `entry` IN (22949, 22950, 22951, 22952); +UPDATE `creature_template` SET `mingold` = 3000000, `maxgold` = 3000000 WHERE `entry` IN (17968, 19622, 21212, 22917); +UPDATE `creature_template` SET `mingold` = 3500000, `maxgold` = 3500000 WHERE `entry` IN (25165, 25166); +UPDATE `creature_template` SET `mingold` = 5000000, `maxgold` = 5000000 WHERE `entry` = 25315; +-- Values below are entirely guessed, ±25g from Wowhead's ~500g average money drop. +UPDATE `creature_template` SET `mingold` = 4750000, `maxgold` = 5250000 WHERE `entry` IN (17257, 17711, 18728); diff --git a/data/sql/updates/db_world/2024_05_20_00.sql b/data/sql/updates/db_world/2024_05_20_00.sql new file mode 100644 index 00000000000000..f2fe9ffd34225a --- /dev/null +++ b/data/sql/updates/db_world/2024_05_20_00.sql @@ -0,0 +1,5 @@ +-- DB update 2024_05_19_01 -> 2024_05_20_00 +-- +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_anetheron_sleep'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(31298, 'spell_anetheron_sleep'); diff --git a/data/sql/updates/db_world/2024_05_21_00.sql b/data/sql/updates/db_world/2024_05_21_00.sql new file mode 100644 index 00000000000000..19d4bf2c436a50 --- /dev/null +++ b/data/sql/updates/db_world/2024_05_21_00.sql @@ -0,0 +1,9 @@ +-- DB update 2024_05_20_00 -> 2024_05_21_00 +-- +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 18104; +UPDATE `creature_template` SET `ScriptName` = '' WHERE `entry` = 18095; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 18104); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(18104, 0, 0, 0, 60, 0, 100, 512, 1600, 1600, 1600, 1600, 0, 0, 89, 40, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Doomfire Spirit - Update - move to random near position in 40 yards'), +(18104, 0, 1, 0, 60, 0, 100, 512, 1550, 1550, 1600, 1600, 0, 0, 212, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Doomfire Spirit - Update - stop moving'); diff --git a/docker-compose.yml b/docker-compose.yml index cfdfe1a5c2b9a2..8af635419cf0b7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,6 @@ # Don't make changes this file! make a `docker-compose.override.yml` and make your # changes there instead. -version: '3' services: ac-database: container_name: ac-database diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 4b5906437f8408..312b504335df70 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -6731,6 +6731,8 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply statType = proto->ItemStat[i].ItemStatType; val = proto->ItemStat[i].ItemStatValue; + + sScriptMgr->OnApplyItemModsBefore(this, slot, apply, i, statType, val); } if (val == 0) diff --git a/src/server/game/Entities/Player/PlayerStorage.cpp b/src/server/game/Entities/Player/PlayerStorage.cpp index 8cfb382d65d20d..266b12c5811394 100644 --- a/src/server/game/Entities/Player/PlayerStorage.cpp +++ b/src/server/game/Entities/Player/PlayerStorage.cpp @@ -4455,6 +4455,8 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool } } + sScriptMgr->OnApplyEnchantmentItemModsBefore(this, item, slot, apply, enchant_spell_id, enchant_amount); + LOG_DEBUG("entities.player.items", "Adding {} to stat nb {}", enchant_amount, enchant_spell_id); switch (enchant_spell_id) { diff --git a/src/server/game/Scripting/ScriptDefines/PlayerScript.cpp b/src/server/game/Scripting/ScriptDefines/PlayerScript.cpp index 633750fdd52daa..61d6cd18bffe82 100644 --- a/src/server/game/Scripting/ScriptDefines/PlayerScript.cpp +++ b/src/server/game/Scripting/ScriptDefines/PlayerScript.cpp @@ -639,6 +639,16 @@ void ScriptMgr::OnCustomScalingStatValue(Player* player, ItemTemplate const* pro CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_CUSTOM_SCALING_STAT_VALUE, script->OnCustomScalingStatValue(player, proto, statType, val, itemProtoStatNumber, ScalingStatValue, ssv)); } +void ScriptMgr::OnApplyItemModsBefore(Player* player, uint8 slot, bool apply, uint8 itemProtoStatNumber, uint32 statType, int32& val) +{ + CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_APPLY_ITEM_MODS_BEFORE, script->OnApplyItemModsBefore(player, slot, apply, itemProtoStatNumber, statType, val)); +} + +void ScriptMgr::OnApplyEnchantmentItemModsBefore(Player* player, Item* item, EnchantmentSlot slot, bool apply, uint32 enchant_spell_id, uint32& enchant_amount) +{ + CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_APPLY_ENCHANTMENT_ITEM_MODS_BEFORE, script->OnApplyEnchantmentItemModsBefore(player, item, slot, apply, enchant_spell_id, enchant_amount)); +} + bool ScriptMgr::CanArmorDamageModifier(Player* player) { CALL_ENABLED_BOOLEAN_HOOKS(PlayerScript, PLAYERHOOK_CAN_ARMOR_DAMAGE_MODIFIER, !script->CanArmorDamageModifier(player)); diff --git a/src/server/game/Scripting/ScriptDefines/PlayerScript.h b/src/server/game/Scripting/ScriptDefines/PlayerScript.h index 4ef3cd4ba5fb0b..9495c1b5d46420 100644 --- a/src/server/game/Scripting/ScriptDefines/PlayerScript.h +++ b/src/server/game/Scripting/ScriptDefines/PlayerScript.h @@ -146,6 +146,8 @@ enum PlayerHook PLAYERHOOK_ON_VICTIM_REWARD_AFTER, PLAYERHOOK_ON_CUSTOM_SCALING_STAT_VALUE_BEFORE, PLAYERHOOK_ON_CUSTOM_SCALING_STAT_VALUE, + PLAYERHOOK_ON_APPLY_ITEM_MODS_BEFORE, + PLAYERHOOK_ON_APPLY_ENCHANTMENT_ITEM_MODS_BEFORE, PLAYERHOOK_CAN_ARMOR_DAMAGE_MODIFIER, PLAYERHOOK_ON_GET_FERAL_AP_BONUS, PLAYERHOOK_CAN_APPLY_WEAPON_DEPENDENT_AURA_DAMAGE_MOD, @@ -542,6 +544,10 @@ class PlayerScript : public ScriptObject virtual void OnCustomScalingStatValue(Player* /*player*/, ItemTemplate const* /*proto*/, uint32& /*statType*/, int32& /*val*/, uint8 /*itemProtoStatNumber*/, uint32 /*ScalingStatValue*/, ScalingStatValuesEntry const* /*ssv*/) { } + virtual void OnApplyItemModsBefore(Player* /*player*/, uint8 /*slot*/, bool /*apply*/, uint8 /*itemProtoStatNumber*/, uint32 /*statType*/, int32& /*val*/) { } + + virtual void OnApplyEnchantmentItemModsBefore(Player* /*player*/, Item* /*item*/, EnchantmentSlot /*slot*/, bool /*apply*/, uint32 /*enchant_spell_id*/, uint32& /*enchant_amount*/) { } + [[nodiscard]] virtual bool CanArmorDamageModifier(Player* /*player*/) { return true; } virtual void OnGetFeralApBonus(Player* /*player*/, int32& /*feral_bonus*/, int32 /*dpsMod*/, ItemTemplate const* /*proto*/, ScalingStatValuesEntry const* /*ssv*/) { } diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index e11d3b99b5ee6c..e8cba8d18dece7 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -414,6 +414,8 @@ class ScriptMgr void OnVictimRewardAfter(Player* player, Player* victim, uint32& killer_title, uint32& victim_rank, float& honor_f); void OnCustomScalingStatValueBefore(Player* player, ItemTemplate const* proto, uint8 slot, bool apply, uint32& CustomScalingStatValue); void OnCustomScalingStatValue(Player* player, ItemTemplate const* proto, uint32& statType, int32& val, uint8 itemProtoStatNumber, uint32 ScalingStatValue, ScalingStatValuesEntry const* ssv); + void OnApplyItemModsBefore(Player* player, uint8 slot, bool apply, uint8 itemProtoStatNumber, uint32 statType, int32& val); + void OnApplyEnchantmentItemModsBefore(Player* player, Item* item, EnchantmentSlot slot, bool apply, uint32 enchant_spell_id, uint32& enchant_amount); bool CanArmorDamageModifier(Player* player); void OnGetFeralApBonus(Player* player, int32& feral_bonus, int32 dpsMod, ItemTemplate const* proto, ScalingStatValuesEntry const* ssv); bool CanApplyWeaponDependentAuraDamageMod(Player* player, Item* item, WeaponAttackType attackType, AuraEffect const* aura, bool apply); diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index b89506e52cfca0..ac66d0dbacc007 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -33,6 +33,7 @@ EndScriptData */ #include "ReputationMgr.h" #include "SpellInfo.h" #include "SpellMgr.h" +#include "SharedDefines.h" using namespace Acore::ChatCommands; @@ -516,7 +517,7 @@ class lookup_commandscript : public CommandScript if (handler->GetSession()) { - handler->PSendSysMessage(LANG_ITEM_LIST_CHAT, itemTemplate.ItemId, itemTemplate.ItemId, name.c_str()); + handler->PSendSysMessage(LANG_ITEM_LIST_CHAT, itemTemplate.ItemId, ItemQualityColors[itemTemplate.Quality], itemTemplate.ItemId, name.c_str()); } else { @@ -550,7 +551,7 @@ class lookup_commandscript : public CommandScript if (handler->GetSession()) { - handler->PSendSysMessage(LANG_ITEM_LIST_CHAT, itemTemplate.ItemId, itemTemplate.ItemId, name.c_str()); + handler->PSendSysMessage(LANG_ITEM_LIST_CHAT, itemTemplate.ItemId, ItemQualityColors[itemTemplate.Quality], itemTemplate.ItemId, name.c_str()); } else { diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index a6f6e179110eb0..e814cc6074453a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -17,6 +17,8 @@ #include "CreatureScript.h" #include "ScriptedCreature.h" +#include "SpellScript.h" +#include "SpellScriptLoader.h" #include "hyjal.h" enum Spells @@ -58,18 +60,18 @@ struct boss_anetheron : public BossAI scheduler.Schedule(20s, 28s, [this](TaskContext context) { - if (DoCastRandomTarget(SPELL_CARRION_SWARM, 0, 60.f)) + if (DoCastRandomTarget(SPELL_CARRION_SWARM, 0, 60.f) == SPELL_CAST_OK) Talk(SAY_SWARM); context.Repeat(10s, 15s); }).Schedule(25s, 32s, [this](TaskContext context) { - if (DoCastRandomTarget(SPELL_SLEEP)) + if (DoCastRandomTarget(SPELL_SLEEP) == SPELL_CAST_OK) Talk(SAY_SLEEP); context.Repeat(35s, 48s); }).Schedule(30s, 48s, [this](TaskContext context) { - if (DoCastRandomTarget(SPELL_INFERNO)) + if (DoCastRandomTarget(SPELL_INFERNO) == SPELL_CAST_OK) Talk(SAY_INFERNO); context.Repeat(50s, 55s); @@ -138,7 +140,24 @@ struct boss_anetheron : public BossAI }; +class spell_anetheron_sleep : public SpellScript +{ + PrepareSpellScript(spell_anetheron_sleep); + + void FilterTargets(std::list& targets) + { + if (!targets.empty()) + Acore::Containers::RandomResize(targets, 3); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_anetheron_sleep::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + } +}; + void AddSC_boss_anetheron() { RegisterHyjalAI(boss_anetheron); + RegisterSpellScript(spell_anetheron_sleep); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index 0473218b59037b..36b6a393f1cb37 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -144,79 +144,10 @@ struct npc_ancient_wisp : public ScriptedAI return; } - private: InstanceScript* _instance; }; -//TODO: move to db? -struct npc_doomfire : public ScriptedAI -{ - npc_doomfire(Creature* creature) : ScriptedAI(creature), _summons(me) { } - - void Reset() override - { - _summons.DespawnAll(); - } - - void MoveInLineOfSight(Unit* /*who*/) override { } - - void JustEngagedWith(Unit* /*who*/) override { } - - void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override - { - damage = 0; - } - - void JustSummoned(Creature* summoned) override - { - _summons.Summon(summoned); - if (summoned->GetEntry() == CREATURE_DOOMFIRE_SPIRIT) - { - me->GetMotionMaster()->MoveFollow(summoned, 0.0f, 0.0f); - } - } -private: - SummonList _summons; -}; - -struct npc_doomfire_targetting : public ScriptedAI -{ - npc_doomfire_targetting(Creature* creature) : ScriptedAI(creature) { } - - void Reset() override - { - _chaseTarget = nullptr; - ScheduleTimedEvent(5s, [&] - { - if (_chaseTarget) - { - me->GetMotionMaster()->MoveFollow(_chaseTarget, 0.0f, 0.0f); - } - else - { - Position randomPosition = me->GetRandomNearPosition(40.0f); - me->GetMotionMaster()->MovePoint(0, randomPosition); - } - }, 5s); - } - - void MoveInLineOfSight(Unit* who) override - { - if (who->IsPlayer()) - { - _chaseTarget = who; - } - } - - void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override - { - damage = 0; - } -private: - Unit* _chaseTarget; -}; - struct boss_archimonde : public BossAI { boss_archimonde(Creature* creature) : BossAI(creature, DATA_ARCHIMONDE) @@ -256,6 +187,7 @@ struct boss_archimonde : public BossAI } ScheduleHealthCheckEvent(10, [&]{ + scheduler.CancelAll(); me->SetReactState(REACT_PASSIVE); DoCastProtection(); Talk(SAY_ENRAGE); @@ -326,11 +258,11 @@ struct boss_archimonde : public BossAI ScheduleTimedEvent(25s, 35s, [&] { Talk(SAY_AIR_BURST); - DoCastRandomTarget(SPELL_AIR_BURST); + DoCastRandomTarget(SPELL_AIR_BURST, 0, 0.0f, true, false, false); }, 25s, 40s); ScheduleTimedEvent(25s, 35s, [&] { - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, false)) { DoCastDoomFire(target); } @@ -441,18 +373,22 @@ struct boss_archimonde : public BossAI { summoned->AI()->AttackStart(me); } + else if (summoned->GetEntry() == CREATURE_DOOMFIRE) + { + summoned->CastSpell(summoned, SPELL_DOOMFIRE_SPAWN); + summoned->CastSpell(summoned, SPELL_DOOMFIRE, true, 0, 0, me->GetGUID()); + } + else if (summoned->GetEntry() == CREATURE_DOOMFIRE_SPIRIT) + { + Position randomPosition = summoned->GetRandomNearPosition(40.0f); + summoned->GetMotionMaster()->MovePoint(0, randomPosition); + } else { summoned->SetFaction(me->GetFaction()); //remove? summoned->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); summoned->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); } - - if (summoned->GetEntry() == CREATURE_DOOMFIRE) - { - summoned->CastSpell(summoned, SPELL_DOOMFIRE_SPAWN); - summoned->CastSpell(summoned, SPELL_DOOMFIRE, true, 0, 0, me->GetGUID()); - } } void DoCastDoomFire(Unit* target) @@ -461,12 +397,16 @@ struct boss_archimonde : public BossAI Talk(SAY_DOOMFIRE); Position spiritPosition = { target->GetPositionX() + DOOMFIRE_OFFSET, target->GetPositionY() + DOOMFIRE_OFFSET, target->GetPositionZ(), 0.0f }; Position doomfirePosition = { target->GetPositionX() - DOOMFIRE_OFFSET, target->GetPositionY() - DOOMFIRE_OFFSET, target->GetPositionZ(), 0.0f }; - if (Unit* doomfireSpirit = me->SummonCreature(CREATURE_DOOMFIRE_SPIRIT, spiritPosition, TEMPSUMMON_TIMED_DESPAWN, 27000)) + if (Creature* doomfireSpirit = me->SummonCreature(CREATURE_DOOMFIRE_SPIRIT, spiritPosition, TEMPSUMMON_TIMED_DESPAWN, 27000)) { - if (Unit* doomfire = me->SummonCreature(CREATURE_DOOMFIRE, doomfirePosition, TEMPSUMMON_TIMED_DESPAWN, 27000)) + if (Creature* doomfire = me->SummonCreature(CREATURE_DOOMFIRE, doomfirePosition, TEMPSUMMON_TIMED_DESPAWN, 27000)) { doomfireSpirit->SetVisible(false); doomfire->SetVisible(false); + doomfireSpirit->SetWalk(false); + doomfireSpirit->SetReactState(REACT_PASSIVE); + doomfire->SetReactState(REACT_PASSIVE); + doomfire->GetMotionMaster()->MoveFollow(doomfireSpirit, 0.0f, 0.0f); } } } @@ -567,8 +507,6 @@ void AddSC_boss_archimonde() RegisterSpellScript(spell_hand_of_death); RegisterSpellScript(spell_finger_of_death); RegisterHyjalAI(boss_archimonde); - RegisterHyjalAI(npc_doomfire); - RegisterHyjalAI(npc_doomfire_targetting); RegisterHyjalAI(npc_ancient_wisp); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index ab34d8e50d481b..49937582f66f4f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -48,14 +48,19 @@ struct boss_kazrogal : public BossAI public: boss_kazrogal(Creature* creature) : BossAI(creature, DATA_KAZROGAL) { - _recentlySpoken = false; - _markCounter = 0; scheduler.SetValidator([this] { return !me->HasUnitState(UNIT_STATE_CASTING); }); } + void Reset() override + { + _recentlySpoken = false; + _markCounter = 0; + BossAI::Reset(); + } + void JustEngagedWith(Unit * who) override { BossAI::JustEngagedWith(who); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp index f2656eedb01d41..fd5d50672acf08 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp @@ -96,8 +96,6 @@ class instance_hyjal : public InstanceMapScript void Initialize() override { - SetHeaders(DataHeader); - _bossWave = 0; _retreat = 0; trash = 0; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index 809f4d984d02d3..eaa548f81df87a 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -728,6 +728,7 @@ class instance_ulduar : public InstanceMapScript case EVENT_TOWER_OF_FLAMES_DESTROYED: { instance->LoadGrid(364.0f, -16.0f); //make sure leviathan is loaded + instance->LoadGrid(364.0f, 32.0f); //make sure Mimiron's and Thorim's Targetting Crystal are loaded m_leviathanTowers[type - EVENT_TOWER_OF_LIFE_DESTROYED] = data; for (uint8 i = 0; i < 2; ++i) {