Skip to content

Commit

Permalink
[9482] Implement 48266, and 50365, 50384, 50391 and ranks.
Browse files Browse the repository at this point in the history
Original patch provided by laise.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
  • Loading branch information
VladimirMangos committed Feb 28, 2010
1 parent 377db32 commit 82d0a43
Show file tree
Hide file tree
Showing 8 changed files with 172 additions and 28 deletions.
3 changes: 2 additions & 1 deletion sql/mangos.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
`version` varchar(120) default NULL,
`creature_ai_version` varchar(120) default NULL,
`cache_id` int(10) default '0',
`required_9477_01_mangos_spell_proc_event` bit(1) default NULL
`required_9482_01_mangos_spell_proc_event` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';

--
Expand Down Expand Up @@ -18667,6 +18667,7 @@ INSERT INTO `spell_proc_event` VALUES
(63320, 0x00000000, 5, 0x00040000, 0x00000000, 0x00008000, 0x00004000, 0x00000001, 0.000000, 0.000000, 0),
(63373, 0x00000000, 11, 0x80000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0.000000, 0.000000, 0),
(63534, 0x00000000, 6, 0x00000040, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
(63611, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00050014, 0x00000000, 0.000000, 0.000000, 0),
(63625, 0x00000000, 6, 0x02000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0.000000, 0.000000, 0),
(63730, 0x00000000, 6, 0x00000800, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
(64928, 0x00000000, 11, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
Expand Down
9 changes: 9 additions & 0 deletions sql/updates/9482_01_mangos_spell_proc_event.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ALTER TABLE db_version CHANGE COLUMN required_9477_01_mangos_spell_proc_event required_9482_01_mangos_spell_proc_event bit;

-- (48266) Blood Presence ()
DELETE FROM `spell_proc_event` WHERE `entry` IN (50689);

-- (63611) Improved Blood Presence ()
DELETE FROM `spell_proc_event` WHERE `entry` IN (63611);
INSERT INTO `spell_proc_event` VALUES
(63611, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00050014, 0x00000000, 0.000000, 0.000000, 0);
2 changes: 2 additions & 0 deletions sql/updates/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ pkgdata_DATA = \
9464_01_mangos_spell_proc_event.sql \
9466_01_mangos_mangos_string.sql \
9477_01_mangos_spell_proc_event.sql \
9482_01_mangos_spell_proc_event.sql \
README

## Additional files to include when running 'make dist'
Expand Down Expand Up @@ -142,4 +143,5 @@ EXTRA_DIST = \
9464_01_mangos_spell_proc_event.sql \
9466_01_mangos_mangos_string.sql \
9477_01_mangos_spell_proc_event.sql \
9482_01_mangos_spell_proc_event.sql \
README
145 changes: 142 additions & 3 deletions src/game/SpellAuras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6295,9 +6295,148 @@ void Aura::HandleSpellSpecificBoosts(bool apply)
switch (GetId())
{
case 49039: spellId1 = 50397; break; // Lichborne
case 48263: spellId1 = 61261; break; // Frost Presence
case 48265: spellId1 = 49772; break; // Unholy Presence move speed
default: return;

case 48263: // Frost Presence
case 48265: // Unholy Presence
case 48266: // Blood Presence
{
// else part one per 3 pair
if (GetId()==48263 || GetId()==48265) // Frost Presence or Unholy Presence
{
// Improved Blood Presence
int32 heal_pct = 0;
if (apply)
{
Unit::AuraList const& bloodAuras = m_target->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator itr = bloodAuras.begin(); itr != bloodAuras.end(); ++itr)
{
// skip same icon
if ((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT &&
(*itr)->GetSpellProto()->SpellIconID == 2636)
{
heal_pct = (*itr)->GetModifier()->m_amount;
break;
}
}
}

if (heal_pct)
m_target->CastCustomSpell(m_target, 63611, &heal_pct, NULL, NULL, true, NULL, this);
else
m_target->RemoveAurasDueToSpell(63611);
}
else
spellId1 = 63611; // Improved Blood Presence, trigger for heal

if (GetId()==48263 || GetId()==48266) // Frost Presence or Blood Presence
{
// Improved Unholy Presence
int32 power_pct = 0;
if (apply)
{
Unit::AuraList const& unholyAuras = m_target->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator itr = unholyAuras.begin(); itr != unholyAuras.end(); ++itr)
{
// skip same icon
if ((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT &&
(*itr)->GetSpellProto()->SpellIconID == 2633)
{
power_pct = (*itr)->GetModifier()->m_amount;
break;
}
}
}

if (power_pct)
m_target->CastCustomSpell(m_target, 65095, &power_pct, NULL, NULL, true, NULL, this);
else
m_target->RemoveAurasDueToSpell(65095);

if (power_pct || !apply)
spellId2 = 49772; // Unholy Presence, speed part
}
else
spellId1 = 49772; // Unholy Presence move speed

if (GetId()==48265 || GetId()==48266) // Unholy Presence or Blood Presence
{
// Improved Frost Presence
int32 stamina_pct = 0;
if (apply)
{
Unit::AuraList const& frostAuras = m_target->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator itr = frostAuras.begin(); itr != frostAuras.end(); ++itr)
{
// skip same icon
if ((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT &&
(*itr)->GetSpellProto()->SpellIconID == 2632)
{
stamina_pct = (*itr)->GetModifier()->m_amount;
break;
}
}
}

if (stamina_pct)
m_target->CastCustomSpell(m_target, 61261, &stamina_pct, NULL, NULL, true, NULL, this);
else
m_target->RemoveAurasDueToSpell(61261);
}
else
spellId1 = 61261; // Frost Presence, stamina
break;
}
}

// Improved Blood Presence
if (GetSpellProto()->SpellIconID == 2632 && GetModifier()->m_auraname==SPELL_AURA_DUMMY)
{
// if presence active: Frost Presence or Unholy Presence
if (apply && (m_target->HasAura(48263) || m_target->HasAura(48265)))
{
int32 bp = GetModifier()->m_amount;
m_target->CastCustomSpell(m_target, 63611, &bp, NULL, NULL, true, NULL, this);
}
else
m_target->RemoveAurasDueToSpell(63611);
return;
}

// Improved Frost Presence
if (GetSpellProto()->SpellIconID == 2636 && GetModifier()->m_auraname==SPELL_AURA_DUMMY)
{
// if presence active: Unholy Presence or Blood Presence
if (apply && (m_target->HasAura(48265) || m_target->HasAura(48266)))
{
int32 bp = GetModifier()->m_amount;
m_target->CastCustomSpell(m_target, 61261, &bp, NULL, NULL, true, NULL, this);
}
else
m_target->RemoveAurasDueToSpell(61261);
return;
}

// Improved Unholy Presence
if (GetSpellProto()->SpellIconID == 2633 && GetModifier()->m_auraname==SPELL_AURA_DUMMY)
{
// if presence active: Frost Presence or Blood Presence
if (apply && (m_target->HasAura(48263) || m_target->HasAura(48266)))
{
int32 bp = GetModifier()->m_amount;
m_target->CastCustomSpell(m_target, 61261, &bp, NULL, NULL, true, NULL, this);

spellId1 = 49772;
}
else
{
m_target->RemoveAurasDueToSpell(61261);

if (!apply)
spellId1 = 49772;
else
return;
}
break;
}
break;
}
Expand Down
10 changes: 7 additions & 3 deletions src/game/SpellMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1743,15 +1743,19 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
if (spellInfo_2->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT)
{
// Lichborne and Lichborne (triggered)
if( spellInfo_1->SpellIconID == 61 && spellInfo_2->SpellIconID == 61 )
if (spellInfo_1->SpellIconID == 61 && spellInfo_2->SpellIconID == 61)
return false;

// Frost Presence and Frost Presence (triggered)
if( spellInfo_1->SpellIconID == 2632 && spellInfo_2->SpellIconID == 2632 )
if (spellInfo_1->SpellIconID == 2632 && spellInfo_2->SpellIconID == 2632)
return false;

// Unholy Presence and Unholy Presence (triggered)
if( spellInfo_1->SpellIconID == 2633 && spellInfo_2->SpellIconID == 2633 )
if (spellInfo_1->SpellIconID == 2633 && spellInfo_2->SpellIconID == 2633)
return false;

// Unholy Presence and Unholy Presence (triggered)
if (spellInfo_1->SpellIconID == 2636 && spellInfo_2->SpellIconID == 2636)
return false;
}
break;
Expand Down
27 changes: 8 additions & 19 deletions src/game/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6886,15 +6886,6 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
}
case SPELLFAMILY_DEATHKNIGHT:
{
// Blood Aura
if (dummySpell->SpellIconID == 2636)
{
if (GetTypeId() != TYPEID_PLAYER || !((Player*)this)->isHonorOrXPTarget(pVictim))
return false;
basepoints[0] = triggerAmount * damage / 100;
triggered_spell_id = 53168;
break;
}
// Butchery
if (dummySpell->SpellIconID == 2664)
{
Expand Down Expand Up @@ -7670,23 +7661,21 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
return false;
}
}
// Blood Presence
else if (auraSpellInfo->Id == 48266)
{
if (GetTypeId() != TYPEID_PLAYER)
return false;
if (!((Player*)this)->isHonorOrXPTarget(pVictim))
return false;
trigger_spell_id = 50475;
basepoints[0] = damage * triggerAmount / 100;
}
// Blade Barrier
else if (auraSpellInfo->SpellIconID == 85)
{
if (GetTypeId() != TYPEID_PLAYER || getClass() != CLASS_DEATH_KNIGHT ||
!((Player*)this)->IsBaseRuneSlotsOnCooldown(RUNE_BLOOD))
return false;
}
// Improved Blood Presence
else if (auraSpellInfo->Id == 63611)
{
if (GetTypeId() != TYPEID_PLAYER || !((Player*)this)->isHonorOrXPTarget(pVictim) || !damage)
return false;
basepoints[0] = triggerAmount * damage / 100;
trigger_spell_id = 50475;
}
break;
}
default:
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9481"
#define REVISION_NR "9482"
#endif // __REVISION_NR_H__
2 changes: 1 addition & 1 deletion src/shared/revision_sql.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef __REVISION_SQL_H__
#define __REVISION_SQL_H__
#define REVISION_DB_CHARACTERS "required_9375_01_characters_character_glyphs"
#define REVISION_DB_MANGOS "required_9477_01_mangos_spell_proc_event"
#define REVISION_DB_MANGOS "required_9482_01_mangos_spell_proc_event"
#define REVISION_DB_REALMD "required_9010_01_realmd_realmlist"
#endif // __REVISION_SQL_H__

0 comments on commit 82d0a43

Please sign in to comment.