diff options
author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-24 11:31:00 +0200 |
---|---|---|
committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-24 11:31:00 +0200 |
commit | 3ef4975d60a2bad59f3be0d85de68c0482b66111 (patch) | |
tree | 4ebd238ac47a6754bfa9ff5fd76370fcd8266348 | |
parent | 8adad5ebf44a4507ff2870fc32593219bb4e2b39 (diff) |
Core/Spells: Fix death knight "Will of the Necropolis" for 4.3.4
-rw-r--r-- | sql/updates/world/2013_07_24_01_world_spell_misc_434.sql | 10 | ||||
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 4 | ||||
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 9 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_dk.cpp | 55 |
4 files changed, 31 insertions, 47 deletions
diff --git a/sql/updates/world/2013_07_24_01_world_spell_misc_434.sql b/sql/updates/world/2013_07_24_01_world_spell_misc_434.sql new file mode 100644 index 00000000000..933426e6164 --- /dev/null +++ b/sql/updates/world/2013_07_24_01_world_spell_misc_434.sql @@ -0,0 +1,10 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_dk_will_of_the_necropolis'; +DELETE FROM `spell_script_names` WHERE `spell_id`=-52284; +INSERT INTO `spell_script_names`(`spell_id`, `ScriptName`) VALUES +(-52284,'spell_dk_will_of_the_necropolis'); + +DELETE FROM `spell_ranks` WHERE `first_spell_id`=52284; +INSERT INTO `spell_ranks` (`first_spell_id`, `spell_id`, `rank`) VALUES +(52284, 52284, 1), +(52284, 81163, 2), +(52284, 81164, 3); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 72124cd238f..7ed3b9c62ea 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -21798,7 +21798,7 @@ bool Player::BuyCurrencyFromVendorSlot(uint64 vendorGuid, uint32 vendorSlot, uin return false; } - if (iece->RequiredFactionId && GetReputationRank(iece->RequiredFactionId) < iece->RequiredFactionStanding) + if (iece->RequiredFactionId && uint32(GetReputationRank(iece->RequiredFactionId)) < iece->RequiredFactionStanding) { SendBuyError(BUY_ERR_REPUTATION_REQUIRE, creature, currency, 0); return false; @@ -21977,7 +21977,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 return false; } - if (iece->RequiredFactionId && GetReputationRank(iece->RequiredFactionId) < iece->RequiredFactionStanding) + if (iece->RequiredFactionId && uint32(GetReputationRank(iece->RequiredFactionId)) < iece->RequiredFactionStanding) { SendBuyError(BUY_ERR_REPUTATION_REQUIRE, creature, item, 0); return false; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 30a14a80898..1bac09bddff 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -8378,15 +8378,6 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 id, int32 maxcount return false; } - if (vItems->GetItemCount() >= MAX_VENDOR_ITEMS) // FIXME: GetItemCount range 0...255 MAX_VENDOR_ITEMS = 300 - { - if (player) - ChatHandler(player->GetSession()).SendSysMessage(LANG_COMMAND_ADDVENDORITEMITEMS); - else - TC_LOG_ERROR(LOG_FILTER_SQL, "Table `npc_vendor` has too many items (%u >= %i) for vendor (Entry: %u), ignore", vItems->GetItemCount(), MAX_VENDOR_ITEMS, vendor_entry); - return false; - } - return true; } diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 752f3823210..30b93d7aa3c 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -50,10 +50,10 @@ enum DeathKnightSpells SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART = 64962, SPELL_DK_ITEM_T8_MELEE_4P_BONUS = 64736, SPELL_DK_RUNIC_POWER_ENERGIZE = 49088, + SPELL_DK_RUNE_TAP = 48982, SPELL_DK_SCENT_OF_BLOOD = 50422, SPELL_DK_SCOURGE_STRIKE_TRIGGERED = 70890, - SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1 = 49189, - SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1 = 52284, + SPELL_DK_WILL_OF_THE_NECROPOLIS = 96171, SPELL_DK_UNHOLY_PRESENCE = 48265 }; @@ -1095,7 +1095,7 @@ class spell_dk_vampiric_blood : public SpellScriptLoader } }; -// 52284 - Will of the Necropolis +// -52284 - Will of the Necropolis class spell_dk_will_of_the_necropolis : public SpellScriptLoader { public: @@ -1107,53 +1107,36 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader bool Validate(SpellInfo const* spellInfo) OVERRIDE { - SpellInfo const* firstRankSpellInfo = sSpellMgr->GetSpellInfo(SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1); - if (!firstRankSpellInfo) + if (!sSpellMgr->GetSpellInfo(SPELL_DK_WILL_OF_THE_NECROPOLIS)) return false; - - // can't use other spell than will of the necropolis due to spell_ranks dependency - if (!spellInfo->IsRankOf(firstRankSpellInfo)) - return false; - - uint8 rank = spellInfo->GetRank(); - if (!sSpellMgr->GetSpellWithRank(SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank, true)) - return false; - return true; } - uint32 absorbPct; - - bool Load() OVERRIDE + bool CheckProc(ProcEventInfo& eventInfo) { - absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); - return true; - } + //! HACK due to currenct proc system implementation + if (Player* player = GetTarget()->ToPlayer()) + if (player->HasSpellCooldown(GetId())) + return false; - void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) - { - // Set absorbtion amount to unlimited - amount = -1; + return GetTarget()->HealthBelowPctDamaged(30, eventInfo.GetDamageInfo()->GetDamage()); } - void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { - // min pct of hp is stored in effect 0 of talent spell - uint8 rank = GetSpellInfo()->GetRank(); - SpellInfo const* talentProto = sSpellMgr->GetSpellInfo(sSpellMgr->GetSpellWithRank(SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank)); - - int32 remainingHp = int32(GetTarget()->GetHealth() - dmgInfo.GetDamage()); - int32 minHp = int32(GetTarget()->CountPctFromMaxHealth(talentProto->Effects[EFFECT_0].CalcValue(GetCaster()))); + GetTarget()->CastSpell(GetTarget(), SPELL_DK_WILL_OF_THE_NECROPOLIS, true, NULL, aurEff); - // Damage that would take you below [effect0] health or taken while you are at [effect0] - if (remainingHp < minHp) - absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct); + if (Player* player = GetTarget()->ToPlayer()) + { + player->RemoveSpellCooldown(SPELL_DK_RUNE_TAP, true); + player->AddSpellCooldown(GetId(), 0, time(NULL) + 45); + } } void Register() OVERRIDE { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_will_of_the_necropolis_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); - OnEffectAbsorb += AuraEffectAbsorbFn(spell_dk_will_of_the_necropolis_AuraScript::Absorb, EFFECT_0); + DoCheckProc += AuraCheckProcFn(spell_dk_will_of_the_necropolis_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_dk_will_of_the_necropolis_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE); } }; |