diff --git a/data/sql/updates/pending_db_world/rev_1640635780171945100.sql b/data/sql/updates/pending_db_world/rev_1640635780171945100.sql new file mode 100644 index 000000000..8cafcc3ba --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1640635780171945100.sql @@ -0,0 +1,5 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1640635780171945100'); + +DELETE FROM `spell_script_names` WHERE `spell_id`=19574; +INSERT INTO `spell_script_names` VALUES +(19574,'spell_hun_bestial_wrath'); diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 983f178b9..743a62f14 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -1601,10 +1601,12 @@ void Pet::_LoadAuras(PreparedQueryResult result, uint32 timediff) continue; // negative effects should continue counting down after logout - if (remaintime != -1 && !spellInfo->IsPositive()) + if (remaintime != -1 && (!spellInfo->IsPositive() || spellInfo->HasAttribute(SPELL_ATTR4_AURA_EXPIRES_OFFLINE))) { if (remaintime / IN_MILLISECONDS <= int32(timediff)) + { continue; + } remaintime -= timediff * IN_MILLISECONDS; } diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index cea5cc2bf..937788a00 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -7552,6 +7552,12 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->EffectSpellClassMask[EFFECT_1][1] = 0x00020000; }); + // Bestial Wrath + ApplySpellFix({ 19574 }, [](SpellEntry* spellInfo) + { + spellInfo->AttributesEx4 |= SPELL_ATTR4_AURA_EXPIRES_OFFLINE; + }); + for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i) { SpellEntry* spellInfo = (SpellEntry*)sSpellStore.LookupEntry(i); diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 5b8c5b9bb..6560329e3 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -1254,6 +1254,40 @@ class spell_hun_intimidation : public AuraScript } }; +// 19574 - Bestial Wrath +class spell_hun_bestial_wrath : public SpellScript +{ + PrepareSpellScript(spell_hun_bestial_wrath); + + SpellCastResult CheckCast() + { + Unit* caster = GetCaster(); + if (!caster || caster->GetTypeId() != TYPEID_PLAYER) + { + return SPELL_FAILED_NO_VALID_TARGETS; + } + + Pet* pet = caster->ToPlayer()->GetPet(); + if (!pet) + { + return SPELL_FAILED_NO_PET; + } + + if (!pet->IsAlive()) + { + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_PET_IS_DEAD); + return SPELL_FAILED_CUSTOM_ERROR; + } + + return SPELL_CAST_OK; + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_hun_bestial_wrath::CheckCast); + } +}; + void AddSC_hunter_spell_scripts() { RegisterSpellScript(spell_hun_check_pet_los); @@ -1283,4 +1317,5 @@ void AddSC_hunter_spell_scripts() RegisterSpellScript(spell_hun_volley_trigger); RegisterSpellScript(spell_hun_lock_and_load); RegisterSpellScript(spell_hun_intimidation); + RegisterSpellScript(spell_hun_bestial_wrath); }