Skip to content

Commit

Permalink
[8847] Implement talent 20335 and ranks.
Browse files Browse the repository at this point in the history
Signed-off-by: VladimirMangos <vladimir@getmangos.com>

Also reorder switch cases by case values.
  • Loading branch information
laise authored and VladimirMangos committed Nov 20, 2009
1 parent e27544c commit f4a3b1f
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 72 deletions.
7 changes: 6 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_8841_02_mangos_spell_chain` bit(1) default NULL
`required_8847_02_mangos_spell_chain` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';

--
Expand Down Expand Up @@ -15166,6 +15166,10 @@ INSERT INTO spell_chain VALUES
(27180,24239,24275,4,0),
(48805,27180,24275,5,0),
(48806,48805,24275,6,0),
/*Heart of the Crusader*/
(20335, 0, 20335, 1, 0),
(20336, 20335, 20335, 2, 0),
(20337, 20336, 20335, 3, 0),
/*Retribution Aura*/
(7294,0,7294,1,0),
(10298,7294,7294,2,0),
Expand Down Expand Up @@ -17759,6 +17763,7 @@ INSERT INTO `spell_proc_event` VALUES
(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),
(20335, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000008, 0x00000100, 0x00000000, 0.000000, 100.000000, 0),
(20375, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 7.000000, 0.000000, 0),
(20500, 0x00000000, 4, 0x10000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
(20501, 0x00000000, 4, 0x10000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
Expand Down
7 changes: 7 additions & 0 deletions sql/updates/8847_01_mangos_spell_proc_event.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ALTER TABLE db_version CHANGE COLUMN required_8841_02_mangos_spell_chain required_8847_01_mangos_spell_proc_event bit;

-- (20335) Heart of the Crusader (Rank 1)
DELETE FROM `spell_proc_event` WHERE `entry` IN (20335);
INSERT INTO `spell_proc_event` VALUES
(20335, 0x00, 10, 0x00800000, 0x00000000, 0x00000008, 0x00000100, 0x00000000, 0.000000, 100.000000, 0);

8 changes: 8 additions & 0 deletions sql/updates/8847_02_mangos_spell_chain.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ALTER TABLE db_version CHANGE COLUMN required_8847_01_mangos_spell_proc_event required_8847_02_mangos_spell_chain bit;

DELETE FROM spell_chain WHERE first_spell = 20335;

INSERT INTO spell_chain VALUES
(20335, 0, 20335, 1, 0),
(20336, 20335, 20335, 2, 0),
(20337, 20336, 20335, 3, 0);
4 changes: 4 additions & 0 deletions sql/updates/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ pkgdata_DATA = \
8841_01_mangos_spell_proc_event.sql \
8841_02_mangos_spell_chain.sql \
8843_01_characters.sql \
8847_01_mangos_spell_proc_event.sql \
8847_02_mangos_spell_chain.sql \
README

## Additional files to include when running 'make dist'
Expand Down Expand Up @@ -314,4 +316,6 @@ EXTRA_DIST = \
8841_01_mangos_spell_proc_event.sql \
8841_02_mangos_spell_chain.sql \
8843_01_characters.sql \
8847_01_mangos_spell_proc_event.sql \
8847_02_mangos_spell_chain.sql \
README
3 changes: 2 additions & 1 deletion src/game/SpellMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
if (spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000002190))
return SPELL_HAND;

if ((spellInfo->SpellFamilyFlags & UI64LIT(0x00000820180400)) && (spellInfo->AttributesEx3 & 0x200))
// skip Heart of the Crusader that have also same spell family mask
if ((spellInfo->SpellFamilyFlags & UI64LIT(0x00000820180400)) && (spellInfo->AttributesEx3 & 0x200) && (spellInfo->SpellIconID != 237))
return SPELL_JUDGEMENT;

// only paladin auras have this (for palaldin class family)
Expand Down
148 changes: 80 additions & 68 deletions src/game/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5793,20 +5793,32 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
}
return true;
}
// Judgements of the Wise
case 31876:
case 31877:
case 31878:
// triggered only at casted Judgement spells, not at additional Judgement effects
if(!procSpell || procSpell->Category != 1210)
return false;

// Heart of the Crusader (Rank 1)
case 20335:
triggered_spell_id = 21183;
break;
// Heart of the Crusader (Rank 2)
case 20336:
triggered_spell_id = 54498;
break;
// Heart of the Crusader (Rank 3)
case 20337:
triggered_spell_id = 54499;
break;
case 20911: // Blessing of Sanctuary
case 25899: // Greater Blessing of Sanctuary
{
target = this;
triggered_spell_id = 31930;

// Replenishment
CastSpell(this, 57669, true, NULL, triggeredByAura);
switch (target->getPowerType())
{
case POWER_MANA:
triggered_spell_id = 57319;
break;
default:
return false;
}
break;
}
// Holy Power (Redemption Armor set)
case 28789:
{
Expand Down Expand Up @@ -5838,20 +5850,6 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
}
break;
}
case 25899: // Greater Blessing of Sanctuary
case 20911: // Blessing of Sanctuary
{
target = this;
switch (target->getPowerType())
{
case POWER_MANA:
triggered_spell_id = 57319;
break;
default:
return false;
}
break;
}
// Seal of Vengeance (damage calc on apply aura)
case 31801:
{
Expand All @@ -5875,6 +5873,62 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
CastSpell(target,42463,true,NULL,triggeredByAura);
break;
}
// Judgements of the Wise
case 31876:
case 31877:
case 31878:
// triggered only at casted Judgement spells, not at additional Judgement effects
if(!procSpell || procSpell->Category != 1210)
return false;

target = this;
triggered_spell_id = 31930;

// Replenishment
CastSpell(this, 57669, true, NULL, triggeredByAura);
break;
// Spiritual Attunement
case 31785:
case 33776:
{
// if healed by another unit (pVictim)
if(this == pVictim)
return false;

// heal amount
basepoints0 = triggerAmount*damage/100;
target = this;
triggered_spell_id = 31786;
break;
}
// Paladin Tier 6 Trinket (Ashtongue Talisman of Zeal)
case 40470:
{
if (!procSpell)
return false;

float chance;

// Flash of light/Holy light
if (procSpell->SpellFamilyFlags & UI64LIT(0x00000000C0000000))
{
triggered_spell_id = 40471;
chance = 15.0f;
}
// Judgement (any)
else if (GetSpellSpecific(procSpell->Id)==SPELL_JUDGEMENT)
{
triggered_spell_id = 40472;
chance = 50.0f;
}
else
return false;

if (!roll_chance_f(chance))
return false;

break;
}
// Seal of Corruption (damage calc on apply aura)
case 53736:
{
Expand All @@ -5898,20 +5952,6 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
CastSpell(target,53739,true,NULL,triggeredByAura);
break;
}
// Spiritual Attunement
case 31785:
case 33776:
{
// if healed by another unit (pVictim)
if(this == pVictim)
return false;

// heal amount
basepoints0 = triggerAmount*damage/100;
target = this;
triggered_spell_id = 31786;
break;
}
// Light's Beacon (heal target area aura)
case 53651:
{
Expand Down Expand Up @@ -5947,34 +5987,6 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
beacon->CastCustomSpell(beacon,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura,pVictim->GetGUID());
return true;
}
// Paladin Tier 6 Trinket (Ashtongue Talisman of Zeal)
case 40470:
{
if (!procSpell)
return false;

float chance;

// Flash of light/Holy light
if (procSpell->SpellFamilyFlags & UI64LIT(0x00000000C0000000))
{
triggered_spell_id = 40471;
chance = 15.0f;
}
// Judgement (any)
else if (GetSpellSpecific(procSpell->Id)==SPELL_JUDGEMENT)
{
triggered_spell_id = 40472;
chance = 50.0f;
}
else
return false;

if (!roll_chance_f(chance))
return false;

break;
}
// Glyph of Divinity
case 54939:
{
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 "8846"
#define REVISION_NR "8847"
#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_8843_01_characters"
#define REVISION_DB_MANGOS "required_8841_02_mangos_spell_chain"
#define REVISION_DB_MANGOS "required_8847_02_mangos_spell_chain"
#define REVISION_DB_REALMD "required_8728_01_realmd_account"
#endif // __REVISION_SQL_H__

0 comments on commit f4a3b1f

Please sign in to comment.