From 71b33ca2f18095bcec50bb730f94d272f204b82a Mon Sep 17 00:00:00 2001 From: DiSlord Date: Fri, 9 Jan 2009 00:57:27 +0300 Subject: [PATCH] [7056] Proc system add Add use autorepeat flag and set more corect triggers flag for ranged autorepeat spells Restore work paladin 20210 and ranks after client switch Add 6-7 scripted paladin shock spell (also add it in dummy and fix flag) Hidden cooldown and hacky (need more fixes in triggers) fix for 33953 Remove not used code Signed-off-by: DiSlord --- sql/mangos.sql | 15 +++++----- .../7056_01_mangos_spell_proc_event.sql | 25 +++++++++++++++++ sql/updates/Makefile.am | 2 ++ src/game/Player.cpp | 16 +---------- src/game/Player.h | 2 +- src/game/SharedDefines.h | 2 +- src/game/Spell.cpp | 28 ++++++++++++------- src/game/SpellEffects.cpp | 2 ++ src/game/SpellMgr.h | 3 +- src/game/Unit.cpp | 11 +++++--- src/shared/revision_nr.h | 2 +- 11 files changed, 67 insertions(+), 41 deletions(-) create mode 100644 sql/updates/7056_01_mangos_spell_proc_event.sql diff --git a/sql/mangos.sql b/sql/mangos.sql index f3aee2f48..90791f536 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -22,7 +22,7 @@ DROP TABLE IF EXISTS `db_version`; CREATE TABLE `db_version` ( `version` varchar(120) default NULL, - `required_7053_01_mangos_spell_proc_event` bit(1) default NULL + `required_7056_01_mangos_spell_proc_event` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -16272,11 +16272,11 @@ INSERT INTO `spell_proc_event` VALUES (20165, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 20.000000, 0.000000, 0), (20166, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 20.000000, 0.000000, 0), (20182, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0), -(20210, 0x00000000, 10, 0xC0200000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), -(20212, 0x00000000, 10, 0xC0200000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), -(20213, 0x00000000, 10, 0xC0200000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), -(20214, 0x00000000, 10, 0xC0200000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), -(20215, 0x00000000, 10, 0xC0200000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), +(20210, 0x00000000, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), +(20212, 0x00000000, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), +(20213, 0x00000000, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), +(20214, 0x00000000, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), +(20215, 0x00000000, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), (20234, 0x00000000, 10, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (20235, 0x00000000, 10, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (20375, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 7.000000, 0.000000, 0), @@ -16468,6 +16468,7 @@ INSERT INTO `spell_proc_event` VALUES (33881, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), (33882, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), (33883, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), +(33953, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 45), (34080, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0.000000, 0.000000, 0), (34138, 0x00000000, 11, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (34139, 0x00000000, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), @@ -16894,7 +16895,7 @@ INSERT INTO `spell_proc_event` VALUES (60818, 0x00000000, 10, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (60826, 0x00000000, 15, 0x01400000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (61188, 0x00000000, 5, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), -(61324, 0x00000000, 10, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0; +(61324, 0x00000000, 10, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0); /*!40000 ALTER TABLE `spell_proc_event` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/updates/7056_01_mangos_spell_proc_event.sql b/sql/updates/7056_01_mangos_spell_proc_event.sql new file mode 100644 index 000000000..c4788253e --- /dev/null +++ b/sql/updates/7056_01_mangos_spell_proc_event.sql @@ -0,0 +1,25 @@ +ALTER TABLE db_version CHANGE COLUMN required_7053_01_mangos_spell_proc_event required_7056_01_mangos_spell_proc_event bit; + +-- (20210) Illumination (Rank 1) +DELETE FROM `spell_proc_event` WHERE `entry` IN (20210); +INSERT INTO `spell_proc_event` VALUES (20210, 0x00, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0); + +-- (20212) Illumination (Rank 2) +DELETE FROM `spell_proc_event` WHERE `entry` IN (20212); +INSERT INTO `spell_proc_event` VALUES (20212, 0x00, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0); + +-- (20213) Illumination (Rank 3) +DELETE FROM `spell_proc_event` WHERE `entry` IN (20213); +INSERT INTO `spell_proc_event` VALUES (20213, 0x00, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0); + +-- (20214) Illumination (Rank 4) +DELETE FROM `spell_proc_event` WHERE `entry` IN (20214); +INSERT INTO `spell_proc_event` VALUES (20214, 0x00, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0); + +-- (20215) Illumination (Rank 5) +DELETE FROM `spell_proc_event` WHERE `entry` IN (20215); +INSERT INTO `spell_proc_event` VALUES (20215, 0x00, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0); + +-- (33953) Essence of Life () +DELETE FROM `spell_proc_event` WHERE `entry` IN (33953); +INSERT INTO `spell_proc_event` VALUES (33953, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 45); \ No newline at end of file diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index 53f2194cf..b3aa5cd69 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -123,6 +123,7 @@ pkgdata_DATA = \ 7051_01_mangos_spell_proc_event.sql \ 7052_01_mangos_spell_proc_event.sql \ 7053_01_mangos_spell_proc_event.sql \ + 7056_01_mangos_spell_proc_event.sql \ README ## Additional files to include when running 'make dist' @@ -226,4 +227,5 @@ EXTRA_DIST = \ 7051_01_mangos_spell_proc_event.sql \ 7052_01_mangos_spell_proc_event.sql \ 7053_01_mangos_spell_proc_event.sql \ + 7056_01_mangos_spell_proc_event.sql \ README diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 33c6fd816..033769d75 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -4844,22 +4844,8 @@ void Player::UpdateWeaponSkill (WeaponAttackType attType) UpdateAllCritPercentages(); } -void Player::UpdateCombatSkills(Unit *pVictim, WeaponAttackType attType, MeleeHitOutcome outcome, bool defence) +void Player::UpdateCombatSkills(Unit *pVictim, WeaponAttackType attType, bool defence) { -/* Not need, this checked on call this func from trigger system - switch(outcome) - { - case MELEE_HIT_CRIT: - case MELEE_HIT_DODGE: - case MELEE_HIT_PARRY: - case MELEE_HIT_BLOCK: - case MELEE_HIT_BLOCK_CRIT: - return; - - default: - break; - } -*/ uint32 plevel = getLevel(); // if defense than pVictim == attacker uint32 greylevel = MaNGOS::XP::GetGrayLevel(plevel); uint32 moblevel = pVictim->getLevelForTarget(this); diff --git a/src/game/Player.h b/src/game/Player.h index 99f464c12..f844192f7 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1739,7 +1739,7 @@ class MANGOS_DLL_SPEC Player : public Unit void UpdateDefense(); void UpdateWeaponSkill (WeaponAttackType attType); - void UpdateCombatSkills(Unit *pVictim, WeaponAttackType attType, MeleeHitOutcome outcome, bool defence); + void UpdateCombatSkills(Unit *pVictim, WeaponAttackType attType, bool defence); void SetSkill(uint32 id, uint16 currVal, uint16 maxVal); uint16 GetMaxSkillValue(uint32 skill) const; // max + perm. bonus diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 48b45883f..c39b751fa 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -280,7 +280,7 @@ enum ItemQualities #define SPELL_ATTR_EX2_UNK2 0x00000004 // 2 #define SPELL_ATTR_EX2_UNK3 0x00000008 // 3 #define SPELL_ATTR_EX2_UNK4 0x00000010 // 4 -#define SPELL_ATTR_EX2_UNK5 0x00000020 // 5 +#define SPELL_ATTR_EX2_AUTOREPEAT_FLAG 0x00000020 // 5 #define SPELL_ATTR_EX2_UNK6 0x00000040 // 6 #define SPELL_ATTR_EX2_UNK7 0x00000080 // 7 #define SPELL_ATTR_EX2_UNK8 0x00000100 // 8 not set in 3.0.3 diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index f8baab82f..ac2370e9c 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -709,22 +709,30 @@ void Spell::prepareDataForTriggerSystem() m_procVictim = PROC_FLAG_TAKEN_MELEE_SPELL_HIT; break; case SPELL_DAMAGE_CLASS_RANGED: - m_procAttacker = PROC_FLAG_SUCCESSFUL_RANGED_SPELL_HIT; - m_procVictim = PROC_FLAG_TAKEN_RANGED_SPELL_HIT; - break; - default: - if (IsPositiveSpell(m_spellInfo->Id)) // Check for positive spell + // Auto attack + if (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG) { - m_procAttacker = PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL; - m_procVictim = PROC_FLAG_TAKEN_POSITIVE_SPELL; + m_procAttacker = PROC_FLAG_SUCCESSFUL_RANGED_HIT; + m_procVictim = PROC_FLAG_TAKEN_RANGED_HIT; } - // Wands - else if (IsAutoRepeatRangedSpell(m_spellInfo) && m_spellInfo->Id != SPELL_ID_AUTOSHOT) + else // Ranged spell attack { m_procAttacker = PROC_FLAG_SUCCESSFUL_RANGED_SPELL_HIT; m_procVictim = PROC_FLAG_TAKEN_RANGED_SPELL_HIT; } - else + break; + default: + if (IsPositiveSpell(m_spellInfo->Id)) // Check for positive spell + { + m_procAttacker = PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL; + m_procVictim = PROC_FLAG_TAKEN_POSITIVE_SPELL; + } + else if (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG) // Wands auto attack + { + m_procAttacker = PROC_FLAG_SUCCESSFUL_RANGED_HIT; + m_procVictim = PROC_FLAG_TAKEN_RANGED_HIT; + } + else // Negative spell { m_procAttacker = PROC_FLAG_SUCCESSFUL_NEGATIVE_SPELL_HIT; m_procVictim = PROC_FLAG_TAKEN_NEGATIVE_SPELL_HIT; diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index faff6b0e8..8625da213 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -1517,6 +1517,8 @@ void Spell::EffectDummy(uint32 i) case 20930: hurt = 25902; heal = 25903; break; case 27174: hurt = 27176; heal = 27175; break; case 33072: hurt = 33073; heal = 33074; break; + case 48824: hurt = 48822; heal = 48820; break; + case 48825: hurt = 48823; heal = 48821; break; default: sLog.outError("Spell::EffectDummy: Spell %u not handled in HS",m_spellInfo->Id); return; diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index 602beb00b..d92a2cf41 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -417,10 +417,9 @@ inline bool isSpellBreakStealth(SpellEntry const* spellInfo) inline bool IsAutoRepeatRangedSpell(SpellEntry const* spellInfo) { - return (spellInfo->Attributes & SPELL_ATTR_RANGED) && (spellInfo->AttributesEx2 == 0x000020 /*autorepeat*/); + return (spellInfo->Attributes & SPELL_ATTR_RANGED) && (spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG); } - uint8 GetErrorAtShapeshiftedCast (SpellEntry const *spellInfo, uint32 form); inline bool IsChanneledSpell(SpellEntry const* spellInfo) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 64a124e56..557d12bd3 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -5825,8 +5825,8 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB return false; // procspell is triggered spell but we need mana cost of original casted spell uint32 originalSpellId = procSpell->Id; - // Holy Shock - if(procSpell->SpellFamilyFlags & 0x00200000) + // Holy Shock heal + if(procSpell->SpellFamilyFlags & 0x0001000000000000LL) { switch(procSpell->Id) { @@ -5835,6 +5835,8 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB case 25903: originalSpellId = 20930; break; case 27175: originalSpellId = 27174; break; case 33074: originalSpellId = 33072; break; + case 48820: originalSpellId = 48824; break; + case 48821: originalSpellId = 48825; break; default: sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in HShock",procSpell->Id); return false; @@ -5847,7 +5849,8 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB return false; } // percent stored in effect 1 (class scripts) base points - basepoints0 = originalSpell->manaCost*(auraSpellInfo->EffectBasePoints[1]+1)/100; + int32 cost = originalSpell->manaCost + originalSpell->ManaCostPercentage * GetCreateMana() / 100; + basepoints0 = cost*(auraSpellInfo->EffectBasePoints[1]+1)/100; trigger_spell_id = 20272; target = this; } @@ -9816,7 +9819,7 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag if (procExtra&(PROC_EX_NORMAL_HIT|PROC_EX_MISS|PROC_EX_RESIST)) { if (pTarget->GetTypeId() != TYPEID_PLAYER && pTarget->GetCreatureType() != CREATURE_TYPE_CRITTER) - ((Player*)this)->UpdateCombatSkills(pTarget, attType, MELEE_HIT_MISS, isVictim); + ((Player*)this)->UpdateCombatSkills(pTarget, attType, isVictim); } // Update defence if player is victim and parry/dodge/block if (isVictim && procExtra&(PROC_EX_DODGE|PROC_EX_PARRY|PROC_EX_BLOCK)) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 23c3df242..fe01bdea2 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 "7055" + #define REVISION_NR "7056" #endif // __REVISION_NR_H__