aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Unit
diff options
context:
space:
mode:
authormik1893 <michele.roscelli@gmail.com>2016-05-13 01:13:19 +0200
committerjoschiwald <joschiwald.trinity@gmail.com>2017-01-08 22:37:18 +0100
commit5a93f2b974bf62d0a0dd741072f5d0032bb0d42d (patch)
treea41d91b23a7c865efb14b54aa9c90d4ee5139a22 /src/server/game/Entities/Unit
parent1c60553df0fc531dbf9e70583f6bf593bfbec41c (diff)
Core/Spells: Proc handler script converions (#17122)
* Blazing Speed (Mage) * Blessed Recovery (Priest) * Druid Forms Trinket * Idol Of Mutilation * Nature's Guardian (Shaman) * Nether Protection (Warlock) * Piercing Shots and Bonus 4P T9 Hunter * Lightning Shield (Shaman) * Acclimation (DK) * Move DK T10 4P Melee Bonus * Move DK Improved Blood Presence triggered heal (DK) * Rogue T10 2P Bonus * Illumination (Paladin) * Soul Preserver * Death Choice trinket * stack trinket scripts (ToC25 Caster Trinket, Lightning Capacitor, Thunder Capacitor) * Battle Experience (ICC - Gunship) * Blood Reserve (enchant proc) * Darkmoon Card Greatness * Charm of the Amani Witch Doctor * Mana Drain (cherry picked from commit 5b8e68ee6335ecbc9fea253eaceecb20c50aa41e)
Diffstat (limited to 'src/server/game/Entities/Unit')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp223
1 files changed, 0 insertions, 223 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index fec094e2458..d8c2f928b45 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -6191,229 +6191,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
Item* castItem = !triggeredByAura->GetBase()->GetCastItemGUID().IsEmpty() && GetTypeId() == TYPEID_PLAYER
? ToPlayer()->GetItemByGuid(triggeredByAura->GetBase()->GetCastItemGUID()) : NULL;
- // Try handle unknown trigger spells
- // triggered spells exists only in serverside spell_dbc
- /// @todo: reverify and move these spells to spellscripts
- {
- switch (auraSpellInfo->SpellFamilyName)
- {
- case SPELLFAMILY_GENERIC:
- switch (auraSpellInfo->Id)
- {
- case 57345: // Darkmoon Card: Greatness
- {
- float stat = 0.0f;
- // strength
- if (GetStat(STAT_STRENGTH) > stat) { trigger_spell_id = 60229;stat = GetStat(STAT_STRENGTH); }
- // agility
- if (GetStat(STAT_AGILITY) > stat) { trigger_spell_id = 60233;stat = GetStat(STAT_AGILITY); }
- // intellect
- if (GetStat(STAT_INTELLECT)> stat) { trigger_spell_id = 60234;stat = GetStat(STAT_INTELLECT);}
- break;
- }
- case 64568: // Blood Reserve
- {
- if (HealthBelowPctDamaged(35, damage))
- {
- CastCustomSpell(this, 64569, &triggerAmount, NULL, NULL, true);
- RemoveAura(64568);
- }
- return false;
- }
- case 67702: // Death's Choice, Item - Coliseum 25 Normal Melee Trinket
- {
- float stat = 0.0f;
- // strength
- if (GetStat(STAT_STRENGTH) > stat) { trigger_spell_id = 67708;stat = GetStat(STAT_STRENGTH); }
- // agility
- if (GetStat(STAT_AGILITY) > stat) { trigger_spell_id = 67703; }
- break;
- }
- case 67771: // Death's Choice (heroic), Item - Coliseum 25 Heroic Melee Trinket
- {
- float stat = 0.0f;
- // strength
- if (GetStat(STAT_STRENGTH) > stat) { trigger_spell_id = 67773;stat = GetStat(STAT_STRENGTH); }
- // agility
- if (GetStat(STAT_AGILITY) > stat) { trigger_spell_id = 67772; }
- break;
- }
- // Mana Drain Trigger
- case 27522:
- case 40336:
- {
- // On successful melee or ranged attack gain $29471s1 mana and if possible drain $27526s1 mana from the target.
- if (IsAlive())
- CastSpell(this, 29471, true, castItem, triggeredByAura);
- if (victim && victim->IsAlive())
- CastSpell(victim, 27526, true, castItem, triggeredByAura);
- return true;
- }
- // Evasive Maneuvers
- case 50240:
- {
- // Remove a Evasive Charge
- Aura* charge = GetAura(50241);
- if (charge && charge->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL))
- RemoveAurasDueToSpell(50240);
- break;
- }
- // Battle Experience
- // already handled in gunship battle script
- case 71201:
- return false;
- }
- break;
- case SPELLFAMILY_DRUID:
- {
- switch (auraSpellInfo->Id)
- {
- // Druid Forms Trinket
- case 37336:
- {
- switch (GetShapeshiftForm())
- {
- case FORM_NONE: trigger_spell_id = 37344; break;
- case FORM_CAT_FORM: trigger_spell_id = 37341; break;
- case FORM_BEAR_FORM: trigger_spell_id = 37340; break;
- case FORM_TREE_OF_LIFE: trigger_spell_id = 37342; break;
- case FORM_MOONKIN_FORM: trigger_spell_id = 37343; break;
- default:
- return false;
- }
- break;
- }
- // Druid T9 Feral Relic (Lacerate, Swipe, Mangle, and Shred)
- case 67353:
- {
- switch (GetShapeshiftForm())
- {
- case FORM_CAT_FORM: trigger_spell_id = 67355; break;
- case FORM_BEAR_FORM: trigger_spell_id = 67354; break;
- default:
- return false;
- }
- break;
- }
- default:
- break;
- }
- break;
- }
- case SPELLFAMILY_HUNTER:
- {
- // Item - Hunter T9 4P Bonus
- if (auraSpellInfo->Id == 67151)
- {
- trigger_spell_id = 68130;
- target = this;
- break;
- }
- break;
- }
- case SPELLFAMILY_PALADIN:
- {
- switch (auraSpellInfo->Id)
- {
- // Soul Preserver
- case 60510:
- {
- switch (getClass())
- {
- case CLASS_DRUID:
- trigger_spell_id = 60512;
- break;
- case CLASS_PALADIN:
- trigger_spell_id = 60513;
- break;
- case CLASS_PRIEST:
- trigger_spell_id = 60514;
- break;
- case CLASS_SHAMAN:
- trigger_spell_id = 60515;
- break;
- }
-
- target = this;
- break;
- }
- case 37657: // Lightning Capacitor
- case 54841: // Thunder Capacitor
- case 67712: // Item - Coliseum 25 Normal Caster Trinket
- case 67758: // Item - Coliseum 25 Heroic Caster Trinket
- {
- if (!victim || !victim->IsAlive() || GetTypeId() != TYPEID_PLAYER)
- return false;
-
- uint32 stack_spell_id = 0;
- switch (auraSpellInfo->Id)
- {
- case 37657:
- stack_spell_id = 37658;
- trigger_spell_id = 37661;
- break;
- case 54841:
- stack_spell_id = 54842;
- trigger_spell_id = 54843;
- break;
- case 67712:
- stack_spell_id = 67713;
- trigger_spell_id = 67714;
- break;
- case 67758:
- stack_spell_id = 67759;
- trigger_spell_id = 67760;
- break;
- }
-
- CastSpell(this, stack_spell_id, true, NULL, triggeredByAura);
-
- Aura* dummy = GetAura(stack_spell_id);
- if (!dummy || dummy->GetStackAmount() < triggerAmount)
- return false;
-
- RemoveAurasDueToSpell(stack_spell_id);
- target = victim;
- break;
- }
- default:
- break;
- }
- break;
- }
- case SPELLFAMILY_DEATHKNIGHT:
- {
- // Item - Death Knight T10 Melee 4P Bonus
- if (auraSpellInfo->Id == 70656)
- {
- if (GetTypeId() != TYPEID_PLAYER || getClass() != CLASS_DEATH_KNIGHT)
- return false;
-
- for (uint8 i = 0; i < MAX_RUNES; ++i)
- if (ToPlayer()->GetRuneCooldown(i) == 0)
- return false;
- }
- break;
- }
- case SPELLFAMILY_ROGUE:
- {
- switch (auraSpellInfo->Id)
- {
- // Rogue T10 2P bonus, should only proc on caster
- case 70805:
- {
- if (victim != this)
- return false;
- break;
- }
- }
- break;
- }
- default:
- break;
- }
- }
-
// All ok. Check current trigger spell
SpellInfo const* triggerEntry = sSpellMgr->GetSpellInfo(trigger_spell_id);
if (triggerEntry == NULL)