aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiberate <none@none>2010-05-26 22:47:47 +0200
committerLiberate <none@none>2010-05-26 22:47:47 +0200
commitc3b480ce81be61f86404dad9cc30fe56d91e3eae (patch)
treecbd131ab9d7de0c0d32648339f5d8bd74689f71f
parent033d688d8e0cd579a0e4288ad3848321e508f66d (diff)
Fixes the Deathbringer's Will Trinket.
This needs DB support so you don't change into a pig instead of a vrykul/taunka. Based on c.j.b's patch. Fixes issue 1933 Fixes issue 1843 --HG-- branch : trunk
-rw-r--r--sql/updates/8312_world_spell_proc_event.sql4
-rw-r--r--src/game/Unit.cpp91
2 files changed, 95 insertions, 0 deletions
diff --git a/sql/updates/8312_world_spell_proc_event.sql b/sql/updates/8312_world_spell_proc_event.sql
new file mode 100644
index 00000000000..775ad64f307
--- /dev/null
+++ b/sql/updates/8312_world_spell_proc_event.sql
@@ -0,0 +1,4 @@
+DELETE FROM `spell_proc_event` WHERE `entry` IN (71519,71562);
+INSERT INTO `spell_proc_event` (`entry`, `Cooldown`) VALUES
+(71519, 105),
+(71562, 105);
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 0b3b075b2b6..c8a00d1afe4 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -5641,6 +5641,97 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
triggered_spell_id = 63321; // Life Tap
break;
}
+ case 71519: // Deathbringer's Will Normal
+ {
+ if (GetTypeId() != TYPEID_PLAYER)
+ return false;
+
+ std::vector<uint32> RandomSpells;
+ switch (getClass())
+ {
+ case CLASS_WARRIOR:
+ case CLASS_PALADIN:
+ case CLASS_DEATH_KNIGHT:
+ RandomSpells.push_back(71484);
+ RandomSpells.push_back(71491);
+ RandomSpells.push_back(71492);
+ break;
+ case CLASS_SHAMAN:
+ case CLASS_ROGUE:
+ RandomSpells.push_back(71486);
+ RandomSpells.push_back(71485);
+ RandomSpells.push_back(71492);
+ break;
+ case CLASS_DRUID:
+ RandomSpells.push_back(71484);
+ RandomSpells.push_back(71485);
+ RandomSpells.push_back(71486);
+ break;
+ case CLASS_HUNTER:
+ RandomSpells.push_back(71486);
+ RandomSpells.push_back(71491);
+ RandomSpells.push_back(71485);
+ break;
+ default:
+ return false;
+ }
+ if (RandomSpells.empty()) //shouldn't happen
+ return false;
+
+ uint8 rand_spell = irand(0,(RandomSpells.size() - 1));
+ CastSpell(target,RandomSpells[rand_spell],true,castItem,triggeredByAura, originalCaster);
+ for (std::vector<uint32>::iterator itr = RandomSpells.begin(); itr != RandomSpells.end(); ++itr)
+ {
+ if (!ToPlayer()->HasSpellCooldown(*itr))
+ ToPlayer()->AddSpellCooldown(*itr,0,time(NULL) + cooldown);
+ }
+ break;
+ }
+ case 71562: // Deahtbringer's Will Heroic
+ {
+ if (GetTypeId() != TYPEID_PLAYER)
+ return false;
+
+ std::vector<uint32> RandomSpells;
+ switch (getClass())
+ {
+ case CLASS_WARRIOR:
+ case CLASS_PALADIN:
+ case CLASS_DEATH_KNIGHT:
+ RandomSpells.push_back(71561);
+ RandomSpells.push_back(71559);
+ RandomSpells.push_back(71560);
+ break;
+ case CLASS_SHAMAN:
+ case CLASS_ROGUE:
+ RandomSpells.push_back(71558);
+ RandomSpells.push_back(71556);
+ RandomSpells.push_back(71560);
+ break;
+ case CLASS_DRUID:
+ RandomSpells.push_back(71561);
+ RandomSpells.push_back(71556);
+ RandomSpells.push_back(71558);
+ break;
+ case CLASS_HUNTER:
+ RandomSpells.push_back(71558);
+ RandomSpells.push_back(71559);
+ RandomSpells.push_back(71556);
+ break;
+ default:
+ return false;
+ }
+ if (RandomSpells.empty()) //shouldn't happen
+ return false;
+
+ uint8 rand_spell = irand(0,(RandomSpells.size() - 1));
+ CastSpell(target,RandomSpells[rand_spell],true,castItem,triggeredByAura, originalCaster);
+ for (std::vector<uint32>::iterator itr = RandomSpells.begin(); itr != RandomSpells.end(); ++itr)
+ {
+ ToPlayer()->AddSpellCooldown(*itr,0,time(NULL) + cooldown);
+ }
+ break;
+ }
}
break;
}