From af5d0d1b83b65f38309d7aff7cbf4593d7844208 Mon Sep 17 00:00:00 2001 From: pasdVn Date: Mon, 25 May 2009 21:43:51 +0200 Subject: [PATCH] [8064] Implemented dummy procs for spell 47535 and ranks (cherry picked from commit 80d0367959b110cb3daa0c6dd65022f5ecf84ac5) Signed-off-by: VladimirMangos --- sql/mangos.sql | 6 +- sql/updates/8064_01_mangos_spell_chain.sql | 11 +++ sql/updates/Makefile.am | 2 + src/game/Spell.cpp | 33 ++++---- src/game/SpellAuras.cpp | 125 ++++++++++++++++++++++------- src/shared/revision_nr.h | 2 +- 6 files changed, 133 insertions(+), 46 deletions(-) create mode 100644 sql/updates/8064_01_mangos_spell_chain.sql diff --git a/sql/mangos.sql b/sql/mangos.sql index 67501aa42..325337a14 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `db_version`; CREATE TABLE `db_version` ( `version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL, - `required_8060_01_mangos_spell_pet_auras` bit(1) default NULL + `required_8064_01_mangos_spell_chain` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -16152,6 +16152,10 @@ INSERT INTO spell_chain VALUES (27681,0,27681,1,14752), (32999,27681,27681,2,0), (48074,32999,27681,3,0), +/*Rapture*/ +(47535,0,47535,1,0), +(47536,47535,47535,2,0), +(47537,47536,47535,3,0), /*ShackleUndead*/ (9484,0,9484,1,0), (9485,9484,9484,2,0), diff --git a/sql/updates/8064_01_mangos_spell_chain.sql b/sql/updates/8064_01_mangos_spell_chain.sql new file mode 100644 index 000000000..65df34601 --- /dev/null +++ b/sql/updates/8064_01_mangos_spell_chain.sql @@ -0,0 +1,11 @@ +ALTER TABLE db_version CHANGE COLUMN required_8060_01_mangos_spell_pet_auras required_8064_01_mangos_spell_chain bit; + +DELETE FROM spell_chain WHERE first_spell = 47535; +INSERT INTO spell_chain VALUES +/*------------------ +--(613)Discipline +------------------*/ +/*Rapture*/ +(47535,0,47535,1,0), +(47536,47535,47535,2,0), +(47537,47536,47535,3,0); diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index 53e2d6d78..cffb64068 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -230,6 +230,7 @@ pkgdata_DATA = \ 8050_02_mangos_spell_bonus_data.sql \ 8053_01_mangos_command.sql \ 8060_01_mangos_spell_pet_auras.sql \ + 8064_01_mangos_spell_chain.sql \ README ## Additional files to include when running 'make dist' @@ -440,4 +441,5 @@ EXTRA_DIST = \ 8050_02_mangos_spell_bonus_data.sql \ 8053_01_mangos_command.sql \ 8060_01_mangos_spell_pet_auras.sql \ + 8064_01_mangos_spell_chain.sql \ README diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index f088d3c1d..ad050b127 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2286,41 +2286,46 @@ void Spell::cast(bool skipCheck) { case SPELLFAMILY_GENERIC: { - if (m_spellInfo->Mechanic == MECHANIC_BANDAGE) // Bandages - m_preCastSpell = 11196; // Recently Bandaged - else if(m_spellInfo->SpellIconID == 1662 && m_spellInfo->AttributesEx & 0x20) // Blood Fury (Racial) - m_preCastSpell = 23230; // Blood Fury - Healing Reduction + if (m_spellInfo->Mechanic == MECHANIC_BANDAGE) // Bandages + m_preCastSpell = 11196; // Recently Bandaged + else if(m_spellInfo->SpellIconID == 1662 && m_spellInfo->AttributesEx & 0x20) + // Blood Fury (Racial) + m_preCastSpell = 23230; // Blood Fury - Healing Reduction break; } case SPELLFAMILY_MAGE: { // Ice Block if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000008000000000)) - m_preCastSpell = 41425; // Hypothermia + m_preCastSpell = 41425; // Hypothermia break; } case SPELLFAMILY_PRIEST: { + // Power Word: Shield if (m_spellInfo->Mechanic == MECHANIC_SHIELD && - m_spellInfo->SpellIconID == 566) // Power Word: Shield - m_preCastSpell = 6788; // Weakened Soul - if (m_spellInfo->Id == 47585) // Dispersion (transform) - m_preCastSpell = 60069; // Dispersion (mana regen) + (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000000001))) + m_preCastSpell = 6788; // Weakened Soul + // Dispersion (transform) + if (m_spellInfo->Id == 47585) + m_preCastSpell = 60069; // Dispersion (mana regen) break; } case SPELLFAMILY_PALADIN: { // Divine Shield, Divine Protection or Hand of Protection if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000400080)) - m_preCastSpell = 25771; // Forbearance + m_preCastSpell = 25771; // Forbearance break; } case SPELLFAMILY_SHAMAN: { - if (m_spellInfo->Id == 2825) // Bloodlust - m_preCastSpell = 57724; // Sated - else if (m_spellInfo->Id == 32182) // Heroism - m_preCastSpell = 57723; // Exhaustion + // Bloodlust + if (m_spellInfo->Id == 2825) + m_preCastSpell = 57724; // Sated + // Heroism + else if (m_spellInfo->Id == 32182) + m_preCastSpell = 57723; // Exhaustion break; } default: diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 2caa8b881..5808127e5 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -5656,49 +5656,114 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real) if(!Real) return; + Unit* caster = GetCaster(); + if(!caster) + return; + // prevent double apply bonuses if(apply && (m_target->GetTypeId()!=TYPEID_PLAYER || !((Player*)m_target)->GetSession()->PlayerLoading())) { - if(Unit* caster = GetCaster()) + float DoneActualBenefit = 0.0f; + switch(m_spellProto->SpellFamilyName) { - float DoneActualBenefit = 0.0f; - switch(m_spellProto->SpellFamilyName) + case SPELLFAMILY_PRIEST: + if(m_spellProto->SpellFamilyFlags == 0x1) //PW:S + { + //+30% from +healing bonus + DoneActualBenefit = caster->SpellBaseHealingBonus(GetSpellSchoolMask(m_spellProto)) * 0.3f; + break; + } + break; + case SPELLFAMILY_MAGE: + if (m_spellProto->SpellFamilyFlags == UI64LIT(0x80100) || + m_spellProto->SpellFamilyFlags == UI64LIT(0x8) || + m_spellProto->SpellFamilyFlags == UI64LIT(0x100000000)) + { + //frost ward, fire ward, ice barrier + //+10% from +spd bonus + DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.1f; + break; + } + break; + case SPELLFAMILY_WARLOCK: + if(m_spellProto->SpellFamilyFlags == 0x00) + { + //shadow ward + //+10% from +spd bonus + DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.1f; + break; + } + break; + default: + break; + } + + DoneActualBenefit *= caster->CalculateLevelPenalty(GetSpellProto()); + + m_modifier.m_amount += (int32)DoneActualBenefit; + } + + if (!apply && caster && + // Power Word: Shield + m_spellProto->SpellFamilyName == SPELLFAMILY_PRIEST && m_spellProto->Mechanic == MECHANIC_SHIELD && + (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000001)) && + // completely absorbed or dispelled + ((m_removeMode == AURA_REMOVE_BY_DEFAULT && !m_modifier.m_amount) || m_removeMode == AURA_REMOVE_BY_DISPEL)) + { + Unit::AuraList const& vDummyAuras = caster->GetAurasByType(SPELL_AURA_DUMMY); + for(Unit::AuraList::const_iterator itr = vDummyAuras.begin(); itr != vDummyAuras.end(); itr++) + { + SpellEntry const* vSpell = (*itr)->GetSpellProto(); + + // Rapture (main spell) + if(vSpell->SpellFamilyName == SPELLFAMILY_PRIEST && vSpell->SpellIconID == 2894 && vSpell->Effect[1]) { - case SPELLFAMILY_PRIEST: - if(m_spellProto->SpellFamilyFlags == 0x1) //PW:S + switch((*itr)->GetEffIndex()) + { + case 0: { - //+30% from +healing bonus - DoneActualBenefit = caster->SpellBaseHealingBonus(GetSpellSchoolMask(m_spellProto)) * 0.3f; + // energize caster + int32 manapct1000 = 5 * ((*itr)->GetModifier()->m_amount + spellmgr.GetSpellRank(vSpell->Id)); + int32 basepoints0 = caster->GetMaxPower(POWER_MANA) * manapct1000 / 1000; + caster->CastCustomSpell(caster, 47755, &basepoints0, NULL, NULL, true); break; } - break; - case SPELLFAMILY_MAGE: - if (m_spellProto->SpellFamilyFlags == UI64LIT(0x80100) || - m_spellProto->SpellFamilyFlags == UI64LIT(0x8) || - m_spellProto->SpellFamilyFlags == UI64LIT(0x100000000)) + case 1: { - //frost ward, fire ward, ice barrier - //+10% from +spd bonus - DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.1f; + // energize target + if (!roll_chance_i((*itr)->GetModifier()->m_amount) || caster->HasAura(63853)) + break; + + switch(m_target->getPowerType()) + { + case POWER_RUNIC_POWER: + m_target->CastSpell(m_target, 63652, true, NULL, NULL, m_caster_guid); + break; + case POWER_RAGE: + m_target->CastSpell(m_target, 63653, true, NULL, NULL, m_caster_guid); + break; + case POWER_MANA: + { + int32 basepoints0 = m_target->GetMaxPower(POWER_MANA) * 2 / 100; + m_target->CastCustomSpell(m_target, 63654, &basepoints0, NULL, NULL, true); + break; + } + case POWER_ENERGY: + m_target->CastSpell(m_target, 63655, true, NULL, NULL, m_caster_guid); + break; + default: + break; + } + + //cooldwon aura + caster->CastSpell(caster, 63853, true); break; } - break; - case SPELLFAMILY_WARLOCK: - if(m_spellProto->SpellFamilyFlags == 0x00) - { - //shadow ward - //+10% from +spd bonus - DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.1f; + default: + sLog.outError("Changes in R-dummy spell???: effect 3"); break; - } - break; - default: - break; + } } - - DoneActualBenefit *= caster->CalculateLevelPenalty(GetSpellProto()); - - m_modifier.m_amount += (int32)DoneActualBenefit; } } } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 9e04a3253..0677ac415 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8063" + #define REVISION_NR "8064" #endif // __REVISION_NR_H__ -- 2.11.4.GIT