From 6b5d455023054a4533fe743b5effceb10be7b442 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Wed, 13 Jun 2012 14:06:35 +0200 Subject: [PATCH 01/12] Core/Spells: Fix no combo points after Mind Control --- src/server/game/Entities/Unit/Unit.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a99356681e..d8165f3e6c 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16164,12 +16164,16 @@ void Unit::RemoveCharmedBy(Unit* charmer) charmer->ToPlayer()->SetClientControl(charmer, 1); charmer->ToPlayer()->SetViewpoint(this, false); charmer->ToPlayer()->SetClientControl(this, 0); + if (GetTypeId() == TYPEID_PLAYER) + ToPlayer()->SetMover(this); break; case CHARM_TYPE_POSSESS: charmer->ToPlayer()->SetClientControl(charmer, 1); charmer->ToPlayer()->SetViewpoint(this, false); charmer->ToPlayer()->SetClientControl(this, 0); charmer->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + if (GetTypeId() == TYPEID_PLAYER) + ToPlayer()->SetMover(this); break; case CHARM_TYPE_CHARM: if (GetTypeId() == TYPEID_UNIT && charmer->getClass() == CLASS_WARLOCK) From 0e7ed5ec857706f27378b00773aa46b8825c3f27 Mon Sep 17 00:00:00 2001 From: Faq Date: Tue, 18 Sep 2012 23:19:31 +0300 Subject: [PATCH 02/12] Core/Spells: Implementing some hooks for split damage taken, fixes the limitation of dmg such auras can split, for example at Hand of Sacrifice. Might have unexpected results, but they are called unexpected for a reason.. .Author Tibbi closes #6025 Made new one as https://github.com/TrinityCore/TrinityCore/pull/7423/ was closed. --- ...2012_09_18_02_world_spell_script_names.sql | 3 ++ src/server/game/Entities/Unit/Unit.cpp | 11 +++-- src/server/game/Spells/Auras/SpellAuras.cpp | 15 ++++++ src/server/game/Spells/Auras/SpellAuras.h | 2 + src/server/game/Spells/SpellScript.cpp | 18 +++++++ src/server/game/Spells/SpellScript.h | 17 +++++++ src/server/scripts/Spells/spell_paladin.cpp | 49 +++++++++++++++++++ 7 files changed, 111 insertions(+), 4 deletions(-) create mode 100644 sql/updates/world/2012_09_18_02_world_spell_script_names.sql diff --git a/sql/updates/world/2012_09_18_02_world_spell_script_names.sql b/sql/updates/world/2012_09_18_02_world_spell_script_names.sql new file mode 100644 index 0000000000..0073475369 --- /dev/null +++ b/sql/updates/world/2012_09_18_02_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM spell_script_names WHERE spell_id = 6940; +INSERT INTO spell_script_names (spell_id, ScriptName) VALUES +(6940, 'spell_pal_hand_of_sacrifice'); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 6e9ebb38e4..a5ba72cb9b 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1769,8 +1769,10 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe for (AuraEffectList::iterator itr = vSplitDamagePctCopy.begin(), next; (itr != vSplitDamagePctCopy.end()) && (dmgInfo.GetDamage() > 0); ++itr) { // Check if aura was removed during iteration - we don't need to work on such auras - if (!((*itr)->GetBase()->IsAppliedOnTarget(victim->GetGUID()))) + AuraApplication const* aurApp = (*itr)->GetBase()->GetApplicationOfTarget(victim->GetGUID()); + if (!aurApp) continue; + // check damage school mask if (!((*itr)->GetMiscValue() & schoolMask)) continue; @@ -1780,13 +1782,14 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe if (!caster || (caster == victim) || !caster->IsInWorld() || !caster->isAlive()) continue; - int32 splitDamage = CalculatePctN(dmgInfo.GetDamage(), (*itr)->GetAmount()); + uint32 splitDamage = CalculatePctN(dmgInfo.GetDamage(), (*itr)->GetAmount()); + + (*itr)->GetBase()->CallScriptEffectSplitHandlers((*itr), aurApp, dmgInfo, splitDamage); // absorb must be smaller than the damage itself - splitDamage = RoundToInterval(splitDamage, 0, int32(dmgInfo.GetDamage())); + splitDamage = RoundToInterval(splitDamage, uint32(0), uint32(dmgInfo.GetDamage())); dmgInfo.AbsorbDamage(splitDamage); - uint32 splitted = splitDamage; uint32 split_absorb = 0; DealDamageMods(caster, splitted, &split_absorb); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 3de11b98e3..abffc65245 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -2324,6 +2324,21 @@ void Aura::CallScriptEffectAfterManaShieldHandlers(AuraEffect* aurEff, AuraAppli } } +void Aura::CallScriptEffectSplitHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & splitAmount) +{ + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + { + (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_SPLIT, aurApp); + std::list::iterator effEndItr = (*scritr)->OnEffectSplit.end(), effItr = (*scritr)->OnEffectSplit.begin(); + for (; effItr != effEndItr; ++effItr) + { + if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) + (*effItr).Call(*scritr, aurEff, dmgInfo, splitAmount); + } + (*scritr)->_FinishScriptCall(); + } +} + UnitAura::UnitAura(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID) : Aura(spellproto, owner, caster, castItem, casterGUID) { diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index 2f50d47a79..85c8992c59 100755 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -217,6 +217,8 @@ class Aura void CallScriptEffectAfterAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount); void CallScriptEffectManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & defaultPrevented); void CallScriptEffectAfterManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount); + void CallScriptEffectSplitHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & splitAmount); + std::list m_loadedScripts; private: void _DeleteRemovedApplications(); diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 1399934efe..f7ab6e22f2 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -675,6 +675,10 @@ bool AuraScript::_Validate(SpellInfo const* entry) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectManaShield` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); + for (std::list::iterator itr = OnEffectSplit.begin(); itr != OnEffectSplit.end(); ++itr) + if (!(*itr).GetAffectedEffectsMask(entry)) + sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectSplit` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); + return _SpellScript::_Validate(entry); } @@ -803,6 +807,17 @@ void AuraScript::EffectManaShieldHandler::Call(AuraScript* auraScript, AuraEffec (auraScript->*pEffectHandlerScript)(aurEff, dmgInfo, absorbAmount); } +AuraScript::EffectSplitHandler::EffectSplitHandler(AuraEffectSplitFnType _pEffectHandlerScript, uint8 _effIndex) + : AuraScript::EffectBase(_effIndex, SPELL_AURA_SPLIT_DAMAGE_PCT) +{ + pEffectHandlerScript = _pEffectHandlerScript; +} + +void AuraScript::EffectSplitHandler::Call(AuraScript* auraScript, AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& splitAmount) +{ + (auraScript->*pEffectHandlerScript)(aurEff, dmgInfo, splitAmount); +} + bool AuraScript::_Load(Aura* aura) { m_aura = aura; @@ -837,6 +852,7 @@ bool AuraScript::_IsDefaultActionPrevented() case AURA_SCRIPT_HOOK_EFFECT_REMOVE: case AURA_SCRIPT_HOOK_EFFECT_PERIODIC: case AURA_SCRIPT_HOOK_EFFECT_ABSORB: + case AURA_SCRIPT_HOOK_EFFECT_SPLIT: return m_defaultActionPrevented; default: ASSERT(false && "AuraScript::_IsDefaultActionPrevented is called in a wrong place"); @@ -852,6 +868,7 @@ void AuraScript::PreventDefaultAction() case AURA_SCRIPT_HOOK_EFFECT_REMOVE: case AURA_SCRIPT_HOOK_EFFECT_PERIODIC: case AURA_SCRIPT_HOOK_EFFECT_ABSORB: + case AURA_SCRIPT_HOOK_EFFECT_SPLIT: m_defaultActionPrevented = true; break; default: @@ -1033,6 +1050,7 @@ Unit* AuraScript::GetTarget() const case AURA_SCRIPT_HOOK_EFFECT_AFTER_ABSORB: case AURA_SCRIPT_HOOK_EFFECT_MANASHIELD: case AURA_SCRIPT_HOOK_EFFECT_AFTER_MANASHIELD: + case AURA_SCRIPT_HOOK_EFFECT_SPLIT: return m_auraApplication->GetTarget(); default: sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u` AuraScript::GetTarget called in a hook in which the call won't have effect!", m_scriptName->c_str(), m_scriptSpellId); diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index 460a4e20d7..a5d7780673 100755 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -423,6 +423,7 @@ enum AuraScriptHookType AURA_SCRIPT_HOOK_EFFECT_AFTER_ABSORB, AURA_SCRIPT_HOOK_EFFECT_MANASHIELD, AURA_SCRIPT_HOOK_EFFECT_AFTER_MANASHIELD, + AURA_SCRIPT_HOOK_EFFECT_SPLIT, AURA_SCRIPT_HOOK_CHECK_AREA_TARGET, AURA_SCRIPT_HOOK_DISPEL, AURA_SCRIPT_HOOK_AFTER_DISPEL @@ -449,6 +450,7 @@ class AuraScript : public _SpellScript typedef void(CLASSNAME::*AuraEffectCalcPeriodicFnType)(AuraEffect const*, bool &, int32 &); \ typedef void(CLASSNAME::*AuraEffectCalcSpellModFnType)(AuraEffect const*, SpellModifier* &); \ typedef void(CLASSNAME::*AuraEffectAbsorbFnType)(AuraEffect*, DamageInfo &, uint32 &); \ + typedef void(CLASSNAME::*AuraEffectSplitFnType)(AuraEffect*, DamageInfo &, uint32 &); \ AURASCRIPT_FUNCTION_TYPE_DEFINES(AuraScript) @@ -540,6 +542,14 @@ class AuraScript : public _SpellScript private: AuraEffectAbsorbFnType pEffectHandlerScript; }; + class EffectSplitHandler : public EffectBase + { + public: + EffectSplitHandler(AuraEffectSplitFnType _pEffectHandlerScript, uint8 _effIndex); + void Call(AuraScript* auraScript, AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & splitAmount); + private: + AuraEffectSplitFnType pEffectHandlerScript; + }; #define AURASCRIPT_FUNCTION_CAST_DEFINES(CLASSNAME) \ class CheckAreaTargetFunction : public AuraScript::CheckAreaTargetHandler { public: CheckAreaTargetFunction(AuraCheckAreaTargetFnType _pHandlerScript) : AuraScript::CheckAreaTargetHandler((AuraScript::AuraCheckAreaTargetFnType)_pHandlerScript) {} }; \ @@ -552,6 +562,7 @@ class AuraScript : public _SpellScript class EffectApplyHandlerFunction : public AuraScript::EffectApplyHandler { public: EffectApplyHandlerFunction(AuraEffectApplicationModeFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName, AuraEffectHandleModes _mode) : AuraScript::EffectApplyHandler((AuraScript::AuraEffectApplicationModeFnType)_pEffectHandlerScript, _effIndex, _effName, _mode) {} }; \ class EffectAbsorbFunction : public AuraScript::EffectAbsorbHandler { public: EffectAbsorbFunction(AuraEffectAbsorbFnType _pEffectHandlerScript, uint8 _effIndex) : AuraScript::EffectAbsorbHandler((AuraScript::AuraEffectAbsorbFnType)_pEffectHandlerScript, _effIndex) {} }; \ class EffectManaShieldFunction : public AuraScript::EffectManaShieldHandler { public: EffectManaShieldFunction(AuraEffectAbsorbFnType _pEffectHandlerScript, uint8 _effIndex) : AuraScript::EffectManaShieldHandler((AuraScript::AuraEffectAbsorbFnType)_pEffectHandlerScript, _effIndex) {} }; \ + class EffectSplitFunction : public AuraScript::EffectSplitHandler { public: EffectSplitFunction(AuraEffectSplitFnType _pEffectHandlerScript, uint8 _effIndex) : AuraScript::EffectSplitHandler((AuraScript::AuraEffectSplitFnType)_pEffectHandlerScript, _effIndex) {} }; \ #define PrepareAuraScript(CLASSNAME) AURASCRIPT_FUNCTION_TYPE_DEFINES(CLASSNAME) AURASCRIPT_FUNCTION_CAST_DEFINES(CLASSNAME) @@ -676,6 +687,12 @@ class AuraScript : public _SpellScript // where function is: void function (AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount); HookList AfterEffectManaShield; + // executed when the caster of some spell with split dmg aura gets damaged through it + // example: OnEffectSplit += AuraEffectSplitFn(class::function, EffectIndexSpecifier); + // where function is: void function (AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& splitAmount); + HookList OnEffectSplit; + #define AuraEffectSplitFn(F, I) EffectSplitFunction(&F, I) + // AuraScript interface - hook/effect execution manipulators // prevents default action of a hook from being executed (works only while called in a hook which default action can be prevented) diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 0bf2e5664a..43c4dc139a 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -47,6 +47,8 @@ enum PaladinSpells SPELL_FORBEARANCE = 25771, SPELL_AVENGING_WRATH_MARKER = 61987, SPELL_IMMUNE_SHIELD_MARKER = 61988, + + SPELL_HAND_OF_SACRIFICE = 6940, }; // 31850 - Ardent Defender @@ -566,6 +568,52 @@ class spell_pal_exorcism_and_holy_wrath_damage : public SpellScriptLoader } }; +class spell_pal_hand_of_sacrifice : public SpellScriptLoader +{ + public: + spell_pal_hand_of_sacrifice() : SpellScriptLoader("spell_pal_hand_of_sacrifice") { } + + class spell_pal_hand_of_sacrifice_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pal_hand_of_sacrifice_AuraScript); + + uint32 splitPct; + int32 remainingAmount; + Unit* caster; + + bool Load() + { + caster = GetCaster(); + if (!caster) + return false; + remainingAmount = caster->GetMaxHealth(); + splitPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); + return true; + } + + void Split(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & splitAmount) + { + remainingAmount -= splitAmount; + + if (remainingAmount <= 0) + { + Unit* target = GetTarget(); + target->RemoveAura(SPELL_HAND_OF_SACRIFICE); + } + } + + void Register() + { + OnEffectSplit += AuraEffectSplitFn(spell_pal_hand_of_sacrifice_AuraScript::Split, EFFECT_0); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_pal_hand_of_sacrifice_AuraScript(); + } +}; + void AddSC_paladin_spell_scripts() { new spell_pal_ardent_defender(); @@ -579,4 +627,5 @@ void AddSC_paladin_spell_scripts() new spell_pal_lay_on_hands(); new spell_pal_righteous_defense(); new spell_pal_exorcism_and_holy_wrath_damage(); + new spell_pal_hand_of_sacrifice(); } From dc935ef8b14721fba81f9aff4c7190df8de5db09 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 24 Sep 2012 10:37:58 -0400 Subject: [PATCH 03/12] Core/Spells: fix beacon of light being on a non player. --- src/server/game/Entities/Unit/Unit.cpp | 48 +++++++++++++++++--------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 8e18f1de9a..e64afb70d5 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6633,31 +6633,47 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Light's Beacon - Beacon of Light if (dummySpell->Id == 53651) { - if (this->GetTypeId() != TYPEID_PLAYER) + if (!victim) return false; - // Check Party/Raid Group - if (Group *group = this->ToPlayer()->GetGroup()) + triggered_spell_id = 0; + Unit* beaconTarget = NULL; + if (this->GetTypeId() != TYPEID_PLAYER) { - for (GroupReference *itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) + beaconTarget = triggeredByAura->GetBase()->GetCaster(); + if (beaconTarget == this || !(beaconTarget->GetAura(53563, victim->GetGUID()))) + return false; + basepoints0 = int32(damage); + triggered_spell_id = procSpell->IsRankOf(sSpellMgr->GetSpellInfo(365)) ? 53652 : 53654; + } + else + { // Check Party/Raid Group + if (Group *group = this->ToPlayer()->GetGroup()) { - Player* Member = itr->getSource(); - - // check if it was heal by paladin which casted this beacon of light - if (Aura const * aura = Member->GetAura(53563, victim->GetGUID())) + for (GroupReference *itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { - Unit* beaconTarget = Member; + Player* Member = itr->getSource(); - // do not proc when target of beacon of light is healed - if (beaconTarget == this) - return false; + // check if it was heal by paladin which casted this beacon of light + if (Aura const * aura = Member->GetAura(53563, victim->GetGUID())) + { + // do not proc when target of beacon of light is healed + if (Member == this) + return false; - basepoints0 = int32(damage); - triggered_spell_id = 53652; - victim->CastCustomSpell(beaconTarget, triggered_spell_id, &basepoints0, NULL, NULL, true, 0, triggeredByAura); - return true; + beaconTarget = Member; + basepoints0 = int32(damage); + triggered_spell_id = procSpell->IsRankOf(sSpellMgr->GetSpellInfo(365)) ? 53652 : 53654; + break; + } } } } + + if (triggered_spell_id && beaconTarget) + { + victim->CastCustomSpell(beaconTarget, triggered_spell_id, &basepoints0, NULL, NULL, true, 0, triggeredByAura); + return true; + } else return false; } From da4067cb30f3bf45f1456dd1411cf9f4c1df8c5c Mon Sep 17 00:00:00 2001 From: faq Date: Mon, 24 Sep 2012 18:05:00 +0300 Subject: [PATCH 04/12] Implementing split dmg cap to Divine Sacrifice. Author Tibbi +correcting previos sql Closes #6024 --- ...2012_09_18_02_world_spell_script_names.sql | 3 - ...2012_09_24_00_world_spell_script_names.sql | 3 + ...2012_09_24_01_world_spell_script_names.sql | 3 + src/server/scripts/Spells/spell_paladin.cpp | 58 ++++++++++++++++++- 4 files changed, 62 insertions(+), 5 deletions(-) delete mode 100644 sql/updates/world/2012_09_18_02_world_spell_script_names.sql create mode 100644 sql/updates/world/2012_09_24_00_world_spell_script_names.sql create mode 100644 sql/updates/world/2012_09_24_01_world_spell_script_names.sql diff --git a/sql/updates/world/2012_09_18_02_world_spell_script_names.sql b/sql/updates/world/2012_09_18_02_world_spell_script_names.sql deleted file mode 100644 index 0073475369..0000000000 --- a/sql/updates/world/2012_09_18_02_world_spell_script_names.sql +++ /dev/null @@ -1,3 +0,0 @@ -DELETE FROM spell_script_names WHERE spell_id = 6940; -INSERT INTO spell_script_names (spell_id, ScriptName) VALUES -(6940, 'spell_pal_hand_of_sacrifice'); diff --git a/sql/updates/world/2012_09_24_00_world_spell_script_names.sql b/sql/updates/world/2012_09_24_00_world_spell_script_names.sql new file mode 100644 index 0000000000..611325d4b1 --- /dev/null +++ b/sql/updates/world/2012_09_24_00_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=6940; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(6940, 'spell_pal_hand_of_sacrifice'); diff --git a/sql/updates/world/2012_09_24_01_world_spell_script_names.sql b/sql/updates/world/2012_09_24_01_world_spell_script_names.sql new file mode 100644 index 0000000000..e14b6833a0 --- /dev/null +++ b/sql/updates/world/2012_09_24_01_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=64205; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(64205, 'spell_pal_divine_sacrifice'); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 43c4dc139a..ad0ed6a7e2 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -24,6 +24,7 @@ #include "ScriptMgr.h" #include "SpellScript.h" #include "SpellAuraEffects.h" +#include "Group.h" enum PaladinSpells @@ -49,6 +50,7 @@ enum PaladinSpells SPELL_IMMUNE_SHIELD_MARKER = 61988, SPELL_HAND_OF_SACRIFICE = 6940, + SPELL_DIVINE_SACRIFICE = 64205, }; // 31850 - Ardent Defender @@ -577,7 +579,6 @@ class spell_pal_hand_of_sacrifice : public SpellScriptLoader { PrepareAuraScript(spell_pal_hand_of_sacrifice_AuraScript); - uint32 splitPct; int32 remainingAmount; Unit* caster; @@ -587,7 +588,6 @@ class spell_pal_hand_of_sacrifice : public SpellScriptLoader if (!caster) return false; remainingAmount = caster->GetMaxHealth(); - splitPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); return true; } @@ -614,6 +614,59 @@ class spell_pal_hand_of_sacrifice : public SpellScriptLoader } }; +class spell_pal_divine_sacrifice : public SpellScriptLoader +{ + public: + spell_pal_divine_sacrifice() : SpellScriptLoader("spell_pal_divine_sacrifice") { } + + class spell_pal_divine_sacrifice_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pal_divine_sacrifice_AuraScript); + + uint32 splitPct, groupSize, minHpPct; + int32 remainingAmount; + Unit* caster; + + bool Load() + { + caster = GetCaster(); + if (!caster) + return false; + + if (caster->ToPlayer()->GetGroup()) + groupSize = caster->ToPlayer()->GetGroup()->GetMembersCount(); + else + groupSize = 1; + + remainingAmount = (caster->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue(caster)) * groupSize); + splitPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(caster); + minHpPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(caster); + + return true; + } + + void Split(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & splitAmount) + { + splitAmount = CalculatePctN(dmgInfo.GetDamage(), splitPct); + remainingAmount -= splitAmount; + + // break when absorbed everything it could, or if the casters hp drops below 20% + if (remainingAmount <= 0 || (GetCaster()->GetHealthPct() < minHpPct)) + GetCaster()->RemoveAura(SPELL_DIVINE_SACRIFICE); + } + + void Register() + { + OnEffectSplit += AuraEffectSplitFn(spell_pal_divine_sacrifice_AuraScript::Split, EFFECT_0); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_pal_divine_sacrifice_AuraScript(); + } +}; + void AddSC_paladin_spell_scripts() { new spell_pal_ardent_defender(); @@ -628,4 +681,5 @@ void AddSC_paladin_spell_scripts() new spell_pal_righteous_defense(); new spell_pal_exorcism_and_holy_wrath_damage(); new spell_pal_hand_of_sacrifice(); + new spell_pal_divine_sacrifice(); } From 58d3758f4c8913ffd734b2d963a22bccd55b879a Mon Sep 17 00:00:00 2001 From: faq Date: Mon, 24 Sep 2012 18:33:54 +0300 Subject: [PATCH 05/12] Core/Spell: Correcting previos PR. splitamount is already calculated in core and removing not in. variable --- src/server/scripts/Spells/spell_paladin.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index ad0ed6a7e2..e2f449e38a 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -623,7 +623,7 @@ class spell_pal_divine_sacrifice : public SpellScriptLoader { PrepareAuraScript(spell_pal_divine_sacrifice_AuraScript); - uint32 splitPct, groupSize, minHpPct; + uint32 groupSize, minHpPct; int32 remainingAmount; Unit* caster; @@ -639,15 +639,13 @@ class spell_pal_divine_sacrifice : public SpellScriptLoader groupSize = 1; remainingAmount = (caster->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue(caster)) * groupSize); - splitPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(caster); minHpPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(caster); return true; } - void Split(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & splitAmount) + void Split(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & splitAmount) { - splitAmount = CalculatePctN(dmgInfo.GetDamage(), splitPct); remainingAmount -= splitAmount; // break when absorbed everything it could, or if the casters hp drops below 20% From bec67b7acc826ba789fe06296ca4e532295ed77e Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 24 Sep 2012 11:52:50 -0400 Subject: [PATCH 06/12] Bring Down the Warbringer! (10603) quest fix by nelegalno Closes #7840 The Only Prescription (8620) quest fix by nelegalno Closes #6653 Closes #7085 Replace placeholder GO by correct GO and remove placeholder GO quest Thwart the Dark Conclave (10808) by aokromes closes #6773 Blending In (11633) quest fix by nelegalno closes #5980 closes #1004 Cloak of shadow should not provide immunity to Flare Closes #7856 Nergeld (30403) partial npc fix by nelegalno Fix Brann's Communicator Closes #5835 author gecko32 Fix Black Bruise proc Scaling author Vincent-Michael Closes #7040 Fix Warlock Death Coil SP Coeff. Closes #3584 Fix proc for Elemental Focus author Warpten Closes #7769 --- .../world/2012_09_24_02_world_misc.sql | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sql/updates/world/2012_09_24_02_world_misc.sql diff --git a/sql/updates/world/2012_09_24_02_world_misc.sql b/sql/updates/world/2012_09_24_02_world_misc.sql new file mode 100644 index 0000000000..bd97308d7c --- /dev/null +++ b/sql/updates/world/2012_09_24_02_world_misc.sql @@ -0,0 +1,99 @@ +-- Bring Down the Warbringer! (10603) quest fix by nelegalno Closes #7840 +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=-100 WHERE `entry`=21287 AND `item`=30689; -- Razuun's Orders http://old.wowhead.com/item=30689 + +-- The Only Prescription (8620) quest fix by nelegalno +-- Closes #6653 (was changed to reopened but currently treated by github as closed) +-- Closes #7085 + +-- Chapter I: +-- Move Doctor Weavil on top of the bed +UPDATE `creature` SET `position_z` = 34.5277 WHERE `guid`=18614; + +-- Chapter II: +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=6 WHERE (`entry`=8716 AND `item`=21104); +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=10 WHERE (`entry`=8717 AND `item`=21104); +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=4 WHERE (`entry`=12396 AND `item`=21104); + +-- Chapter III: +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=6 WHERE (`entry`=7461 AND `item`=21105); +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=6 WHERE (`entry`=7463 AND `item`=21105); + +-- Chapter IV, V and VII: +DELETE FROM `gameobject` WHERE (`guid`=45065); -- Remove duplicate of GUID=4596 +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (6668,6669,6670) AND `id`=0; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +-- source: https://github.com/TrinityCore/TrinityCore/issues/6653#issuecomment-6956847 ( thanks frostmourne ) + http://thottbot.com/item=21107#comments:id=885246 + http://thottbot.com/item=21106#comments:id=1159575 +(6668,0,0,'',1,1,0,0,0,0,NULL), +(6669,0,0,'',1,1,0,0,0,0,NULL), +(6670,0,0,'',1,1,0,0,0,0,NULL); + +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry` IN (180665,180666,180667); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (180665,180666,180667) AND `source_type`=1; +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`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(180665,1,0,1,62,0,100,0,6669,0,0,0,56,21107,1,0,0,0,0,7,0,0,0,0,0,0,0,'Draconic for Dummies - take book for quest - The Only Prescription'), +(180665,1,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Draconic for Dummies - close gossip'), +(180666,1,0,1,62,0,100,0,6670,0,0,0,56,21106,1,0,0,0,0,7,0,0,0,0,0,0,0,'Draconic for Dummies - take book for quest - The Only Prescription'), +(180666,1,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Draconic for Dummies - close gossip'), +(180667,1,0,1,62,0,100,0,6668,0,0,0,56,21109,1,0,0,0,0,7,0,0,0,0,0,0,0,'Draconic for Dummies - take book for quest - The Only Prescription'), +(180667,1,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Draconic for Dummies - close gossip'); + +-- Chapter VI: +-- Chapter VIII: +DELETE FROM `creature_loot_template` WHERE `entry`=10184 AND `item`=21108; +DELETE FROM `creature_loot_template` WHERE `entry`=11502 AND `item`=21110; +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(10184,21108,100,1,0,1,1), +(11502,21110,100,1,0,1,1); + +-- Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (6668,6669,6670); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=1 AND `SourceGroup`=15552 AND `SourceEntry`=21130 AND `ConditionTypeOrReference`=8 AND `ConditionValue1`=8606; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=1 AND `SourceGroup`=15552 AND `SourceEntry`=21103 AND `ConditionTypeOrReference`=9 AND `ConditionValue1`=8620; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=1 AND `SourceGroup`=10184 AND `SourceEntry`=21108 AND `ConditionTypeOrReference`=9 AND `ConditionValue1`=8620; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=1 AND `SourceGroup`=11502 AND `SourceEntry`=21110 AND `ConditionTypeOrReference`=9 AND `ConditionValue1`=8620; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(1,15552,21130,0,0,8,0,8606,0,0,0,0,'','Diary of Weavil will drop only when a player have Decoy! (8606) quest rewarded'), +(1,15552,21103,0,0,9,0,8620,0,0,0,0,'','Draconic for Dummies Chapter I will drop only when a player have The Only Prescription (8620) in their quest log'), +(1,10184,21108,0,0,9,0,8620,0,0,0,0,'','Draconic for Dummies Chapter VI will drop only when a player have The Only Prescription (8620) in their quest log'), +(1,11502,21110,0,0,9,0,8620,0,0,0,0,'','Draconic for Dummies Chapter VIII will drop only when a player have The Only Prescription (8620) in their quest log'), +(15,6668,0,0,0,9,0,8620,0,0,0,0,'',"Show gossip only if player have taken The Only Prescription (8620) quest"), +(15,6668,0,0,0,2,0,21109,1,1,1,0,'',"Show gossip only if player doesn't have the item"), +(15,6669,0,0,0,9,0,8620,0,0,0,0,'',"Show gossip only if player have taken The Only Prescription (8620) quest"), +(15,6669,0,0,0,2,0,21107,1,1,1,0,'',"Show gossip only if player doesn't have the item"), +(15,6670,0,0,0,9,0,8620,0,0,0,0,'',"Show gossip only if player have taken The Only Prescription (8620) quest"), +(15,6670,0,0,0,2,0,21106,1,1,1,0,'',"Show gossip only if player doesn't have the item"); + +-- Replace placeholder GO by correct GO and remove placeholder GO quest Thwart the Dark Conclave (10808) by aokromes closes #6773 +UPDATE `gameobject` SET `id`=184750 WHERE `guid`=99983; +DELETE FROM `gameobject_template` WHERE `entry`=300121; + +-- Blending In (11633) quest fix by nelegalno closes #5980 closes #1004 +-- Move Spire of Blood Scouted trigger to floor level so it's not outside LoS +UPDATE `creature` SET `position_z` = 131.750 WHERE `guid` = 85206; + +-- Cloak of shadow should not provide immunity to Flare Closes #7856 +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=31224 AND `spell_effect`=-1543 AND `type`=2; + +-- Nergeld (30403) partial npc fix by nelegalno +-- Fix conditions +UPDATE `conditions` SET `ConditionValue1`=4595 WHERE `SourceTypeOrReferenceId`=16 AND `SourceEntry`=30403; +-- NPC Spells +UPDATE `creature_template` SET `spell1` = 56746, `spell2` = 56748, `spell3` = 56747, `spell4` = 60540 WHERE `entry` = 30403; + +-- Fix Brann's Communicator Closes #5835 author gecko32 +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=61122 AND `spell_effect`=55038; +INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES +(61122, 55038, 0, 'Contact Brann'); + +-- Fix Black Bruise proc Scaling author Vincent-Michael Closes #7040 +-- Fix Warlock Death Coil SP Coeff. Closes #3584 +DELETE FROM `spell_bonus_data` WHERE `entry` IN (6489,71878,71879); +INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES +(6489,0.2143,0,0,0,'Spell Power Coeff for Death Coil'), +(71878,0,0,0,0,'Item - Black Bruise: Heroic Necrotic Touch Proc'), +(71879,0,0,0,0,'Item - Black Bruise: Necrotic Touch Proc'); + +-- Fix proc for Elemental Focus author Warpten Closes #7769 +DELETE FROM `spell_proc_event` WHERE `entry`=16164; +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +(16164, 0x1C, 0x0B, 0x98101417, 0x80043000, 0x00002004, 0x00010000, 0x00000002, 0, 100, 0); \ No newline at end of file From 5adc3d28a48a39bd1cff7d79443a9379124ebca3 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 24 Sep 2012 12:08:25 -0400 Subject: [PATCH 07/12] Core/Player: fix teleporting while on vehicle. Closes #7812 thx joschiwald --- src/server/game/Entities/Player/Player.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index c498350c78..68be167f91 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2113,6 +2113,9 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati else sLog->outDebug(LOG_FILTER_MAPS, "Player %s is being teleported to map %u", GetName(), mapid); + if (m_vehicle) + ExitVehicle(); + // reset movement flags at teleport, because player will continue move with these flags after teleport SetUnitMovementFlags(0); DisableSpline(); From 3cf359068ef642ff0959fdf2dc2e29939708b275 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 24 Sep 2012 12:16:37 -0400 Subject: [PATCH 08/12] Core/Spells: Fix things from commit da4067cb30f3bf45f1456dd1411cf9f4c1df8c5c thx dracosvk --- src/server/scripts/Spells/spell_paladin.cpp | 51 +++++++++++---------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index e2f449e38a..0102c3cb1a 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -580,15 +580,15 @@ class spell_pal_hand_of_sacrifice : public SpellScriptLoader PrepareAuraScript(spell_pal_hand_of_sacrifice_AuraScript); int32 remainingAmount; - Unit* caster; bool Load() { - caster = GetCaster(); - if (!caster) - return false; - remainingAmount = caster->GetMaxHealth(); - return true; + if (Unit* caster = GetCaster()) + { + remainingAmount = caster->GetMaxHealth(); + return true; + } + return false; } void Split(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & splitAmount) @@ -597,8 +597,7 @@ class spell_pal_hand_of_sacrifice : public SpellScriptLoader if (remainingAmount <= 0) { - Unit* target = GetTarget(); - target->RemoveAura(SPELL_HAND_OF_SACRIFICE); + GetTarget()->RemoveAura(SPELL_HAND_OF_SACRIFICE); } } @@ -625,32 +624,36 @@ class spell_pal_divine_sacrifice : public SpellScriptLoader uint32 groupSize, minHpPct; int32 remainingAmount; - Unit* caster; bool Load() { - caster = GetCaster(); - if (!caster) - return false; + + if (Unit* caster = GetCaster()) + { + if (caster->GetTypeId() == TYPEID_PLAYER) + { + if (caster->ToPlayer()->GetGroup()) + groupSize = caster->ToPlayer()->GetGroup()->GetMembersCount(); + else + groupSize = 1; + } + else + return false; - if (caster->ToPlayer()->GetGroup()) - groupSize = caster->ToPlayer()->GetGroup()->GetMembersCount(); - else - groupSize = 1; - - remainingAmount = (caster->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue(caster)) * groupSize); - minHpPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(caster); - - return true; + remainingAmount = (caster->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue(caster)) * groupSize); + minHpPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(caster); + return true; + } + return false; } void Split(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & splitAmount) { remainingAmount -= splitAmount; - // break when absorbed everything it could, or if the casters hp drops below 20% - if (remainingAmount <= 0 || (GetCaster()->GetHealthPct() < minHpPct)) - GetCaster()->RemoveAura(SPELL_DIVINE_SACRIFICE); + if (Unit* caster = GetCaster()) + if (remainingAmount <= 0 || (caster->GetHealthPct() < minHpPct)) + caster->RemoveAura(SPELL_DIVINE_SACRIFICE); } void Register() From 1c1405cb25cc9152c1477b9769cf45aa43ba4bc8 Mon Sep 17 00:00:00 2001 From: Xanvial Date: Mon, 24 Sep 2012 12:35:09 -0400 Subject: [PATCH 09/12] Core/Scripts: fix rotface oozes from spawning after death. Closes #7736 --- src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index 5a0560293d..03427a4cfc 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -124,9 +124,9 @@ class boss_rotface : public CreatureScript void JustDied(Unit* /*killer*/) { + instance->DoRemoveAurasDueToSpellOnPlayers(MUTATED_INFECTION); _JustDied(); Talk(SAY_DEATH); - instance->DoRemoveAurasDueToSpellOnPlayers(MUTATED_INFECTION); if (Creature* professor = Unit::GetCreature(*me, instance->GetData64(DATA_PROFESSOR_PUTRICIDE))) professor->AI()->DoAction(ACTION_ROTFACE_DEATH); } From 118825601b101eb6d3b9c1678afed1c405235d8e Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Mon, 24 Sep 2012 12:39:02 -0400 Subject: [PATCH 10/12] Core/Spells: fix misdirection removal on cancel. Closes #7776 --- src/server/scripts/Spells/spell_hunter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index a2ee6c1c3a..e445f68cfb 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -574,7 +574,7 @@ class spell_hun_misdirection : public SpellScriptLoader void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (Unit* caster = GetCaster()) - if (!GetDuration()) + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEFAULT) caster->SetReducedThreatPercent(0, 0); } From 4035738a4a665a057a0d0b43a7587a70ed000562 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 24 Sep 2012 13:27:45 -0400 Subject: [PATCH 11/12] DB/Misc: Molten Core + Ruins of Ahn'Qiraj + Blackwing Lair + Zul'Gurub + Temple of Ahn'Qiraj Boss Respawn Fix author armano2 closes #5883 Fix Fertile Spores Drop Chance authore exodius Closes #7727 Fix quest Gammothra the tormentor author gacko Closes #7770 Disable Unfinished Gordok Business (1318) replaced with Disable Unfinished Gordok Business (7703) fix by nelegalno Closes #7819 Fix Plague Siphon ability (74074) in Lich King encounter in instance Icecrown Citadel, may only target LK (36597) author elron103 Closes #7729 Gurubashi Arena Grand Master (396) achievement fix by nelegalno Closes #7699 Update DisenchantID's to proper values for items from Satchel of Helpful Goods (51999) author Exodius Closes #7572 X Marks... Your Doom! (11166) quest fix by nelegalno Closes #7528 Whitebark's Memory (10166) fix despawn timer author nelegalno Closes #7521 Armor of Darkness (12979) conditions fix by nelegalno Closes #7506 Remove duplicate of Swirling Maelstrom (180669) GO author nelegalno Closes #7498 The Scepter of the Shifting Sands quest chain fix by nelegalno based on http://www.wowwiki.com/The_Scepter_of_the_Shifting_Sands_quest_chain Closes #7473 Hive'Zora Scout Report (8534), Hive'Regal Scout Report (8738) and Hive'Ashi Scout Report (8739) quests fix by Raszagal (Inspired by Justiciar's fix from #3311) Closes #3311 and Closes #7453 --- .../world/2012_09_24_03_world_misc.sql | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 sql/updates/world/2012_09_24_03_world_misc.sql diff --git a/sql/updates/world/2012_09_24_03_world_misc.sql b/sql/updates/world/2012_09_24_03_world_misc.sql new file mode 100644 index 0000000000..3083b3d11f --- /dev/null +++ b/sql/updates/world/2012_09_24_03_world_misc.sql @@ -0,0 +1,125 @@ +-- Molten Core + Ruins of Ahn'Qiraj + Blackwing Lair + Zul'Gurub + Temple of Ahn'Qiraj Boss Respawn Fix author armano2 closes #5883 +UPDATE `creature` SET `spawntimesecs` = 604800 WHERE `Id` IN (12118,11982,12259,12057,12264,12056,11988,12098); +UPDATE `creature` SET `spawntimesecs` = 259200 WHERE `Id` IN (15348,15341,15340,15370,15369,15339); + +-- Fix Fertile Spores Drop Chance authore exodius Closes #7727 +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`= 35 WHERE `item`=24449; + +-- Fix quest Gammothra the tormentor author gacko Closes #7770 +UPDATE `creature_template` SET `minlevel`=71,`maxlevel`=71,`faction_A`=14,`faction_H`=14 WHERE `entry`=25790; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=25789; +DELETE FROM `smart_scripts` WHERE `entryorguid`=25789 AND `source_type`=0; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=25789; +INSERT INTO `smart_scripts`(`entryorguid`,`event_type`,`event_param1`,`action_type`,`action_param1`,`target_type`,`comment`) VALUES +(25789,8,46012,36,25790,1,'Gammothra the Tormentor - On spell hit - Update entry to Weakened Gammothra'); + +-- Disable Unfinished Gordok Business (1318) replaced with Disable Unfinished Gordok Business (7703) fix by nelegalno Closes #7819 +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=1318; +INSERT INTO `disables` (`sourceType`, `entry`, `flags`, `params_0`, `params_1`, `comment`) VALUES +(1,1318,0,'','','Unfinished Gordok Business replaced by 7703'); + +-- Fix Plague Siphon ability (74074) in Lich King encounter in instance Icecrown Citadel, may only target LK (36597) author elron103 Closes #7729 +DELETE FROM `conditions` WHERE `SourceEntry` = 74074 AND `SourceTypeOrReferenceId` = 13; +INSERT INTO `conditions` (SourceTypeOrReferenceId, SourceGroup, SourceEntry, SourceId, ElseGroup, ConditionTypeOrReference, ConditionTarget, ConditionValue1, ConditionValue2, ConditionValue3, NegativeCondition, ErrorTextId, ScriptName, Comment) VALUES +(13, 1, 74074, 0, 0, 31, 0, 3, 36597, 0, 0, 0, '', 'Plague Siphon may only target The Lich King'); + +-- Gurubashi Arena Grand Master (396) achievement fix by nelegalno Closes #7699 +-- Short John Mithril (14508) gossip +UPDATE `creature_template` SET `gossip_menu_id` = 5921 WHERE `entry` = 14508; +DELETE FROM `gossip_menu` WHERE `entry`=5921 AND `text_id`=7074; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES(5921,7074); +-- Arena Master (18706) loot fix +UPDATE `item_template` SET `flagsCustom`=flagsCustom|2 WHERE `entry`=18706; +-- Arena Grandmaster (7838) quest is repeatable (players can get 2x Arena Grand Master trinkets) +-- https://www.youtube.com/watch?v=fkJ3vrwC4q4&feature=player_detailpage#t=170s +UPDATE `quest_template` SET `SpecialFlags` = 1 WHERE `Id` = 7838; + +SET @CGUID:= xxxxx; +-- Spawn Dark Ranger Marrah author Vincent-Michael Closes #7681 +DELETE FROM `creature` WHERE `id` = @ENTRY; +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES +(@CGUID, 24137, 574, 3, 1, 183.8515, -76.50119, 15.84287, 3.455082, 7200, 0, 0); +DELETE FROM `creature_template_addon` WHERE `entry` = @ENTRY; +INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES +(24137, 0, 0x20000, 0x1, '34189'); + +-- Update DisenchantID's to proper values for items from Satchel of Helpful Goods (51999) author Exodius Closes #7572 +UPDATE `item_template` SET `DisenchantID`=41 WHERE `entry` IN (51964, 51968, 51978, 51994); + +-- X Marks... Your Doom! (11166) quest fix by nelegalno Closes #7528 +-- For some reason the script doesn't trigger if `flags_extra` = 128 is set +UPDATE `creature_template` SET `unit_flags` = 33554432, `flags_extra` = 0 WHERE `entry` = 23815; + +-- Whitebark's Memory (10166) fix despawn timer author nelegalno Closes #7521 +-- TODO: Find fix for one-shot kill by high level players +UPDATE `smart_scripts` SET `event_param1`=60000, `event_param2`=60000, `event_param3`=60000, `event_param4`=60000, `comment`="Whitebark's Spirit - after 60sec OOC - despawn" WHERE `entryorguid`=19456 AND `id`=5; + +-- Armor of Darkness (12979) conditions fix by nelegalno Closes #7506 +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=1 AND `SourceGroup`=29380 AND `SourceEntry`=42203; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(1,29380,42203,0,0,9,0,12978,0,0,0,0,'',"Dark Armor Plate drops if Facing the Storm taken"), +(1,29380,42203,0,1,8,0,12978,0,0,0,0,'',"Dark Armor Plate drops if Facing the Storm rewarded"), +(1,29380,42203,0,1,8,0,12979,0,0,1,0,'',"Dark Armor Plate drops if Armor of Darkness isn't rewarded"); + +-- Remove duplicate of Swirling Maelstrom (180669) GO author nelegalno Closes #7498 +UPDATE `gameobject` SET `id` = 180669 WHERE `guid` = 99900; +DELETE FROM `gameobject_template` WHERE `entry`=300057; + +-- The Scepter of the Shifting Sands quest chain fix by nelegalno based on http://www.wowwiki.com/The_Scepter_of_the_Shifting_Sands_quest_chain Closes #7473 +-- What Tomorrow Brings > Only One May Rise +UPDATE `quest_template` SET `NextQuestIdChain` = 8288 WHERE `Id` = 8286; +-- A Pawn on the Eternal Board > The Charge of the Dragonflights +UPDATE `quest_template` SET `NextQuestIdChain` = 8555 WHERE `Id` = 8519; +-- The Nightmare's Corruption > The Nightmare Manifests +UPDATE `quest_template` SET `NextQuestIdChain` = 8736 WHERE `Id` = 8735; +-- Azuregos's Magical Ledger > Translating the Ledger +UPDATE `quest_template` SET `NextQuestIdChain` = 8576 WHERE `Id` = 8575; + +-- Hive'Zora Scout Report (8534), Hive'Regal Scout Report (8738) and Hive'Ashi Scout Report (8739) quests fix by Raszagal (Inspired by Justiciar's fix drom #3311) +-- TODO: Get sniffs for gossip_menu_option placeholder texts +-- Closes #3311 and Closes #7453 + +SET @GOSSIP1 := 6690; -- need confirmation +SET @GOSSIP2 := 6691; -- need confirmation +SET @GOSSIP3 := 6692; -- need confirmation +SET @NPC1 := 15609; +SET @NPC2 := 15610; +SET @NPC3 := 15611; + +-- Update Cenarion Scout Landion's, Azenel's, & Jalia's gossip_menu and AI +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP1 WHERE `entry`=@NPC1; +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP2 WHERE `entry`=@NPC2; +UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP3 WHERE `entry`=@NPC3; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@NPC1,@NPC2,@NPC3); +-- Gossips +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP1 AND `text_id`=8063; +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP2 AND `text_id`=8064; +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP3 AND `text_id`=8065; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(@GOSSIP1,8063), +(@GOSSIP2,8064), +(@GOSSIP3,8065); +-- Gossip Options +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (@GOSSIP1,@GOSSIP2,@GOSSIP3); +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +(@GOSSIP1,0,0,"May I have your report?",1,1,0,0,0,0,''), -- placeholder untill sniffed +(@GOSSIP2,0,0,"May I have your report?",1,1,0,0,0,0,''), -- placeholder untill sniffed +(@GOSSIP3,0,0,"May I have your report?",1,1,0,0,0,0,''); -- placeholder untill sniffed +-- Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (@GOSSIP1,@GOSSIP2,@GOSSIP3); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,@GOSSIP1,0,0,0,2,0,21160,1,0,1,0,'',"Show gossip only if player dosn't have Hive'Regal Scout Report"), +(15,@GOSSIP1,0,0,0,9,0,8738,0,0,0,0,'',"Show gossip only if Hive'Regal Scout Report quest has been taken"), +(15,@GOSSIP2,0,0,0,2,0,21158,1,0,1,0,'',"Show gossip only if player dosn't have Hive'Zora Scout Report"), +(15,@GOSSIP2,0,0,0,9,0,8534,0,0,0,0,'',"Show gossip only if Hive'Zora Scout Report quest has been taken"), +(15,@GOSSIP3,0,0,0,2,0,21161,1,0,1,0,'',"Show gossip only if player dosn't have Hive'Ashi Scout Report"), +(15,@GOSSIP3,0,0,0,9,0,8739,0,0,0,0,'',"Show gossip only if Hive'Ashi Scout Report quest has been taken"); +-- Scripts +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC1,@NPC2,@NPC3) AND source_type=0; +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`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@NPC1,0,0,1,62,0,100,0,@GOSSIP1,0,0,0,11,25847,1,0,0,0,0,7,0,0,0,0,0,0,0,"Cenarion Scout Landion – on gossip option select – cast Create Hive'Regal Scout Report"), +(@NPC1,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Cenarion Scout Landion – Link – close gossip"), +(@NPC2,0,0,1,62,0,100,0,@GOSSIP2,0,0,0,11,25843,1,0,0,0,0,7,0,0,0,0,0,0,0,"Cenarion Scout Azenel – on gossip option select – cast Create Hive'Zora Scout Report"), +(@NPC2,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Cenarion Scout Azenel – Link – close gossip"), +(@NPC3,0,0,1,62,0,100,0,@GOSSIP3,0,0,0,11,25845,1,0,0,0,0,7,0,0,0,0,0,0,0,"Cenarion Scout Jalia – on gossip option select – ast Create Hive'Ashi Scout Report"), +(@NPC3,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Cenarion Scout Jalia – Link – close gossip"); \ No newline at end of file From 1b2a010a70ca4462292168da36466341faa537d7 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 24 Sep 2012 13:31:46 -0400 Subject: [PATCH 12/12] Db/Misc: remove from previous commit --- sql/updates/world/2012_09_24_03_world_misc.sql | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/sql/updates/world/2012_09_24_03_world_misc.sql b/sql/updates/world/2012_09_24_03_world_misc.sql index 3083b3d11f..08d697afac 100644 --- a/sql/updates/world/2012_09_24_03_world_misc.sql +++ b/sql/updates/world/2012_09_24_03_world_misc.sql @@ -34,15 +34,6 @@ UPDATE `item_template` SET `flagsCustom`=flagsCustom|2 WHERE `entry`=18706; -- https://www.youtube.com/watch?v=fkJ3vrwC4q4&feature=player_detailpage#t=170s UPDATE `quest_template` SET `SpecialFlags` = 1 WHERE `Id` = 7838; -SET @CGUID:= xxxxx; --- Spawn Dark Ranger Marrah author Vincent-Michael Closes #7681 -DELETE FROM `creature` WHERE `id` = @ENTRY; -INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES -(@CGUID, 24137, 574, 3, 1, 183.8515, -76.50119, 15.84287, 3.455082, 7200, 0, 0); -DELETE FROM `creature_template_addon` WHERE `entry` = @ENTRY; -INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES -(24137, 0, 0x20000, 0x1, '34189'); - -- Update DisenchantID's to proper values for items from Satchel of Helpful Goods (51999) author Exodius Closes #7572 UPDATE `item_template` SET `DisenchantID`=41 WHERE `entry` IN (51964, 51968, 51978, 51994); @@ -122,4 +113,4 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type (@NPC2,0,0,1,62,0,100,0,@GOSSIP2,0,0,0,11,25843,1,0,0,0,0,7,0,0,0,0,0,0,0,"Cenarion Scout Azenel – on gossip option select – cast Create Hive'Zora Scout Report"), (@NPC2,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Cenarion Scout Azenel – Link – close gossip"), (@NPC3,0,0,1,62,0,100,0,@GOSSIP3,0,0,0,11,25845,1,0,0,0,0,7,0,0,0,0,0,0,0,"Cenarion Scout Jalia – on gossip option select – ast Create Hive'Ashi Scout Report"), -(@NPC3,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Cenarion Scout Jalia – Link – close gossip"); \ No newline at end of file +(@NPC3,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Cenarion Scout Jalia – Link – close gossip");