*Cleanups, remove obsolete code and minor optimizations in spellauras.cpp and spelleffects.cpp

*Remove GetDummyAura(uint32 spellid) function - it is faster to use GetAuraEffect or GetAura if id is known than iterate threw dummy auras list
*Move Death Strike code from HandleDummyAuraProc to Spell::EffectDummy - original patch by hununza.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-08-08 16:18:05 +02:00
parent 08f1421ae1
commit 6b4772207f
11 changed files with 136 additions and 731 deletions
@@ -129,14 +129,11 @@ struct TRINITY_DLL_DECL npc_captured_rageclawAI : public ScriptedAI
{
if (spell->Id == SPELL_FREE_RAGECLAW)
{
if (m_creature->GetDummyAura(SPELL_LEFT_CHAIN))
m_creature->RemoveAurasDueToSpell(SPELL_LEFT_CHAIN);
if (m_creature->GetDummyAura(SPELL_RIGHT_CHAIN))
m_creature->RemoveAurasDueToSpell(SPELL_RIGHT_CHAIN);
m_creature->RemoveAurasDueToSpell(SPELL_LEFT_CHAIN);
if (m_creature->GetDummyAura(SPELL_KNEEL))
m_creature->RemoveAurasDueToSpell(SPELL_KNEEL);
m_creature->RemoveAurasDueToSpell(SPELL_RIGHT_CHAIN);
m_creature->RemoveAurasDueToSpell(SPELL_KNEEL);
m_creature->setFaction(m_creature->GetCreatureInfo()->faction_H);
+2 -2
View File
@@ -847,7 +847,7 @@ void BattleGround::RewardMark(Player *plr,uint32 count)
void BattleGround::RewardSpellCast(Player *plr, uint32 spell_id)
{
// 'Inactive' this aura prevents the player from gaining honor points and battleground tokens
if (plr->GetDummyAura(SPELL_AURA_PLAYER_INACTIVE))
if (plr->HasAura(SPELL_AURA_PLAYER_INACTIVE))
return;
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id);
@@ -863,7 +863,7 @@ void BattleGround::RewardSpellCast(Player *plr, uint32 spell_id)
void BattleGround::RewardItem(Player *plr, uint32 item_id, uint32 count)
{
// 'Inactive' this aura prevents the player from gaining honor points and battleground tokens
if (plr->GetDummyAura(SPELL_AURA_PLAYER_INACTIVE))
if (plr->HasAura(SPELL_AURA_PLAYER_INACTIVE))
return;
ItemPosCountVec dest;
+4 -4
View File
@@ -6115,7 +6115,7 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor, bool pvpt
}
// 'Inactive' this aura prevents the player from gaining honor points and battleground tokens
if(GetDummyAura(SPELL_AURA_PLAYER_INACTIVE))
if(HasAura(SPELL_AURA_PLAYER_INACTIVE))
return false;
uint64 victim_guid = 0;
@@ -10534,7 +10534,7 @@ uint8 Player::CanUseAmmo( uint32 item ) const
return EQUIP_ERR_CANT_EQUIP_LEVEL_I;
// Requires No Ammo
if(GetDummyAura(46699))
if(HasAura(46699))
return EQUIP_ERR_BAG_FULL6;
return EQUIP_ERR_OK;
@@ -18515,7 +18515,7 @@ void Player::LeaveBattleground(bool teleportToEntryPoint)
bool Player::CanJoinToBattleground() const
{
// check Deserter debuff
if(GetDummyAura(26013))
if(HasAura(26013))
return false;
return true;
@@ -20701,7 +20701,7 @@ void Player::HandleFall(MovementInfo const& movementInfo)
damage = GetMaxHealth();
// Gust of Wind
if (GetDummyAura(43621))
if (HasAura(43621))
damage = GetMaxHealth()/2;
EnvironmentalDamage(DAMAGE_FALL, damage);
+1 -1
View File
@@ -926,7 +926,7 @@ enum AuraState
};
#define PER_CASTER_AURA_STATE_MASK ( \
(1<<(AURA_STATE_CONFLAGRATE-1))|(1<<(AURA_STATE_SWIFTMEND-1))|(1<<(AURA_STATE_DEADLY_POISON-1)))
(1<<(AURA_STATE_CONFLAGRATE-1))|(1<<(AURA_STATE_DEADLY_POISON-1)))
// Spell mechanics
enum Mechanics
+2 -2
View File
@@ -3594,7 +3594,7 @@ void Spell::WriteAmmoToPacket( WorldPacket * data )
ammoInventoryType = pProto->InventoryType;
}
}
else if(m_caster->GetDummyAura(46699)) // Requires No Ammo
else if(m_caster->HasAura(46699)) // Requires No Ammo
{
ammoDisplayID = 5996; // normal arrow
ammoInventoryType = INVTYPE_AMMO;
@@ -5820,7 +5820,7 @@ SpellCastResult Spell::CheckItems()
if(!ammo)
{
// Requires No Ammo
if(m_caster->GetDummyAura(46699))
if(m_caster->HasAura(46699))
break; // skip other checks
return SPELL_FAILED_NO_AMMO;
+49 -610
View File
@@ -74,7 +74,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&Aura::HandleInvisibility, // 18 SPELL_AURA_MOD_INVISIBILITY
&Aura::HandleInvisibilityDetect, // 19 SPELL_AURA_MOD_INVISIBILITY_DETECTION
&Aura::HandleAuraModTotalHealthPercentRegen, // 20 SPELL_AURA_OBS_MOD_HEALTH
&Aura::HandleAuraModTotalEnergyPercentRegen, // 21 SPELL_AURA_OBS_MOD_ENERGY
&Aura::HandleAuraModTotalEnergyPercentRegen, // 21 SPELL_AURA_OBS_MOD_ENERGY
&Aura::HandleAuraModResistance, // 22 SPELL_AURA_MOD_RESISTANCE
&Aura::HandlePeriodicTriggerSpell, // 23 SPELL_AURA_PERIODIC_TRIGGER_SPELL
&Aura::HandlePeriodicEnergize, // 24 SPELL_AURA_PERIODIC_ENERGIZE
@@ -398,7 +398,7 @@ m_auraSlot(MAX_AURAS), m_auraLevel(1), m_procCharges(0), m_stackAmount(1), m_upd
{
// Glyph of Thorns
if (m_target == caster && m_spellProto->SpellFamilyName==SPELLFAMILY_DRUID && m_spellProto->SpellFamilyFlags[0] & 0x100)
if (AuraEffect * aurEff = m_target->GetDummyAura(57862))
if (AuraEffect * aurEff = m_target->GetAuraEffect(57862, 0))
m_maxduration += aurEff->GetAmount() * MINUTE * IN_MILISECONDS;
modOwner->ApplySpellMod(GetId(), SPELLMOD_DURATION, m_maxduration);
@@ -1870,43 +1870,13 @@ void AuraEffect::TriggerSpell()
((Player*)caster)->ApplyEnchantment(item,TEMP_ENCHANTMENT_SLOT,true);
return;
}
// // Periodic Mana Burn
// case 812: break;
// // Polymorphic Ray
// case 6965: break;
// // Fire Nova (1-7 ranks)
// case 8350:
// case 8508:
// case 8509:
// case 11312:
// case 11313:
// case 25540:
// case 25544:
// break;
// Thaumaturgy Channel
case 9712: trigger_spell_id = 21029; break;
// // Egan's Blaster
// case 17368: break;
// // Haunted
// case 18347: break;
// // Ranshalla Waiting
// case 18953: break;
// // Inferno
// case 19695: break;
// // Frostwolf Muzzle DND
// case 21794: break;
// // Alterac Ram Collar DND
// case 21866: break;
// // Celebras Waiting
// case 21916: break;
// Brood Affliction: Bronze
case 23170:
{
m_target->CastSpell(m_target, 23171, true, 0, this);
return;
}
// // Mark of Frost
// case 23184: break;
// Restoration
case 23493:
{
@@ -1921,46 +1891,6 @@ void AuraEffect::TriggerSpell()
}
return;
}
// // Stoneclaw Totem Passive TEST
// case 23792: break;
// // Axe Flurry
// case 24018: break;
// // Mark of Arlokk
// case 24210: break;
// // Restoration
// case 24379: break;
// // Happy Pet
// case 24716: break;
// // Dream Fog
// case 24780: break;
// // Cannon Prep
// case 24832: break;
// // Shadow Bolt Whirl
// case 24834: break;
// // Stink Trap
// case 24918: break;
// // Mark of Nature
// case 25041: break;
// // Agro Drones
// case 25152: break;
// // Consume
// case 25371: break;
// // Pain Spike
// case 25572: break;
// // Rotate 360
// case 26009: break;
// // Rotate -360
// case 26136: break;
// // Consume
// case 26196: break;
// // Berserk
// case 26615: break;
// // Defile
// case 27177: break;
// // Teleport: IF/UC
// case 27601: break;
// // Five Fat Finger Exploding Heart Technique
// case 27673: break;
// Nitrous Boost
case 27746:
{
@@ -1974,8 +1904,6 @@ void AuraEffect::TriggerSpell()
return;
}
} break;
// // Steam Tank Passive
// case 27747: break;
// Frost Blast
case 27808:
caster->CastCustomSpell(29879, SPELLVALUE_BASE_POINT0, (float)m_target->GetMaxHealth()*0.26f, m_target, true, NULL, this);
@@ -1988,49 +1916,13 @@ void AuraEffect::TriggerSpell()
m_target->CastCustomSpell(27820, SPELLVALUE_BASE_POINT0, -mana*4, NULL, true, NULL, this, caster->GetGUID());
}
return;
// // Controller Timer
// case 28095: break;
// // Stalagg Chain
// case 28096: break;
// // Stalagg Tesla Passive
// case 28097: break;
// // Feugen Tesla Passive
// case 28109: break;
// // Feugen Chain
// case 28111: break;
// // Mark of Didier
// case 28114: break;
// // Communique Timer, camp
// case 28346: break;
// // Icebolt
// case 28522: break;
// // Silithyst
// case 29519: break;
// Inoculate Nestlewood Owlkin
case 29528:
if(target->GetTypeId()!=TYPEID_UNIT)// prevent error reports in case ignored player target
return;
break;
// // Overload
// case 29768: break;
// // Return Fire
// case 29788: break;
// // Return Fire
// case 29793: break;
// // Return Fire
// case 29794: break;
// // Guardian of Icecrown Passive
// case 29897: break;
// Feed Captured Animal
case 29917: trigger_spell_id = 29916; break;
// // Flame Wreath
// case 29946: break;
// // Flame Wreath
// case 29947: break;
// // Mind Exhaustion Passive
// case 30025: break;
// // Nether Beam - Serenity
// case 30401: break;
// Extract Gas
case 30427:
{
@@ -2053,19 +1945,6 @@ void AuraEffect::TriggerSpell()
}
// Quake
case 30576: trigger_spell_id = 30571; break;
// // Burning Maul
// case 30598: break;
// // Regeneration
// case 30799:
// case 30800:
// case 30801:
// break;
// // Despawn Self - Smoke cloud
// case 31269: break;
// // Time Rift Periodic
// case 31320: break;
// // Corrupt Medivh
// case 31326: break;
// Doom
case 31347:
{
@@ -2080,20 +1959,6 @@ void AuraEffect::TriggerSpell()
caster->SummonCreature(17870, 0, 0, 0, caster->GetOrientation(), TEMPSUMMON_DEAD_DESPAWN, 0);
return;
}
// // Bloodmyst Tesla
// case 31611: break;
// // Doomfire
// case 31944: break;
// // Teleport Test
// case 32236: break;
// // Earthquake
// case 32686: break;
// // Possess
// case 33401: break;
// // Draw Shadows
// case 33563: break;
// // Murmur's Touch
// case 33711: break;
// Flame Quills
case 34229:
{
@@ -2104,82 +1969,8 @@ void AuraEffect::TriggerSpell()
caster->CastSpell(m_target,spell_id,true, NULL, this);
return;
}
// // Gravity Lapse
// case 34480: break;
// // Tornado
// case 34683: break;
// // Frostbite Rotate
// case 34748: break;
// // Arcane Flurry
// case 34821: break;
// // Interrupt Shutdown
// case 35016: break;
// // Interrupt Shutdown
// case 35176: break;
// // Inferno
// case 35268: break;
// // Salaadin's Tesla
// case 35515: break;
// // Ethereal Channel (Red)
// case 35518: break;
// // Nether Vapor
// case 35879: break;
// // Dark Portal Storm
// case 36018: break;
// // Burning Maul
// case 36056: break;
// // Living Grove Defender Lifespan
// case 36061: break;
// // Professor Dabiri Talks
// case 36064: break;
// // Kael Gaining Power
// case 36091: break;
// // They Must Burn Bomb Aura
// case 36344: break;
// // They Must Burn Bomb Aura (self)
// case 36350: break;
// // Stolen Ravenous Ravager Egg
// case 36401: break;
// // Activated Cannon
// case 36410: break;
// // Stolen Ravenous Ravager Egg
// case 36418: break;
// // Enchanted Weapons
// case 36510: break;
// // Cursed Scarab Periodic
// case 36556: break;
// // Cursed Scarab Despawn Periodic
// case 36561: break;
// // Vision Guide
// case 36573: break;
// // Cannon Charging (platform)
// case 36785: break;
// // Cannon Charging (self)
// case 36860: break;
// Remote Toy
case 37027: trigger_spell_id = 37029; break;
// // Mark of Death
// case 37125: break;
// // Arcane Flurry
// case 37268: break;
// // Spout
// case 37429: break;
// // Spout
// case 37430: break;
// // Karazhan - Chess NPC AI, Snapshot timer
// case 37440: break;
// // Karazhan - Chess NPC AI, action timer
// case 37504: break;
// // Karazhan - Chess: Is Square OCCUPIED aura (DND)
// case 39400: break;
// // Banish
// case 37546: break;
// // Shriveling Gaze
// case 37589: break;
// // Fake Aggro Radius (2 yd)
// case 37815: break;
// // Corrupt Medivh
// case 37853: break;
// Eye of Grillok
case 38495:
{
@@ -2199,93 +1990,18 @@ void AuraEffect::TriggerSpell()
creatureTarget->ForcedDespawn();
return;
}
// // Magic Sucker Device timer
// case 38672: break;
// // Tomb Guarding Charging
// case 38751: break;
// // Murmur's Touch
// case 38794: break;
// // Activate Nether-wraith Beacon (31742 Nether-wraith Beacon item)
// case 39105: break;
// // Drain World Tree Visual
// case 39140: break;
// // Quest - Dustin's Undead Dragon Visual aura
// case 39259: break;
// // Hellfire - The Exorcism, Jules releases darkness, aura
// case 39306: break;
// // Inferno
// case 39346: break;
// // Enchanted Weapons
// case 39489: break;
// // Shadow Bolt Whirl
// case 39630: break;
// // Shadow Bolt Whirl
// case 39634: break;
// // Shadow Inferno
// case 39645: break;
// Tear of Azzinoth Summon Channel - it's not really supposed to do anything,and this only prevents the console spam
case 39857: trigger_spell_id = 39856; break;
// // Soulgrinder Ritual Visual (Smashed)
// case 39974: break;
// // Simon Game Pre-game timer
// case 40041: break;
// // Knockdown Fel Cannon: The Aggro Check Aura
// case 40113: break;
// // Spirit Lance
// case 40157: break;
// // Demon Transform 2
// case 40398: break;
// // Demon Transform 1
// case 40511: break;
// // Ancient Flames
// case 40657: break;
// // Ethereal Ring Cannon: Cannon Aura
// case 40734: break;
// // Cage Trap
// case 40760: break;
// // Random Periodic
// case 40867: break;
// // Prismatic Shield
// case 40879: break;
// Aura of Desire
case 41350:
{
Unit::AuraEffectList const& mMod = m_target->GetAurasByType(SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT);
for(Unit::AuraEffectList::const_iterator i = mMod.begin(); i != mMod.end(); ++i)
{
if ((*i)->GetId() == 41350)
{
(*i)->ApplyModifier(false);
(*i)->SetAmount((*i)->GetAmount()-5);
(*i)->ApplyModifier(true);
break;
}
}
}break;
// // Dementia
// case 41404: break;
// // Chaos Form
// case 41629: break;
// // Alert Drums
// case 42177: break;
// // Spout
// case 42581: break;
// // Spout
// case 42582: break;
// // Return to the Spirit Realm
// case 44035: break;
// // Curse of Boundless Agony
// case 45050: break;
// // Earthquake
// case 46240: break;
// Personalized Weather
AuraEffect * aurEff = GetParentAura()->GetPartAura(1);
aurEff->ApplyModifier(false, false, true);
aurEff->SetAmount(aurEff->GetAmount()-5);
aurEff->ApplyModifier(true, false, true);
break;
}
case 46736: trigger_spell_id = 46737; break;
// // Stay Submerged
// case 46981: break;
// // Dragonblight Ram
// case 47015: break;
// // Party G.R.E.N.A.D.E.
// case 51510: break;
default:
break;
}
@@ -2304,32 +2020,6 @@ void AuraEffect::TriggerSpell()
}
break;
}
// case SPELLFAMILY_WARRIOR:
// {
// switch(auraId)
// {
// // Wild Magic
// case 23410: break;
// // Corrupted Totems
// case 23425: break;
// default:
// break;
// }
// break;
// }
// case SPELLFAMILY_PRIEST:
// {
// switch(auraId)
// {
// // Blue Beam
// case 32930: break;
// // Fury of the Dreghood Elders
// case 35460: break;
// default:
// break;
// }
// break;
// }
case SPELLFAMILY_DRUID:
{
switch(auraId)
@@ -2388,32 +2078,6 @@ void AuraEffect::TriggerSpell()
return;
break;
// //Frost Trap Aura
// case 13810:
// return;
// //Rizzle's Frost Trap
// case 39900:
// return;
// // Tame spells
// case 19597: // Tame Ice Claw Bear
// case 19676: // Tame Snow Leopard
// case 19677: // Tame Large Crag Boar
// case 19678: // Tame Adult Plainstrider
// case 19679: // Tame Prairie Stalker
// case 19680: // Tame Swoop
// case 19681: // Tame Dire Mottled Boar
// case 19682: // Tame Surf Crawler
// case 19683: // Tame Armored Scorpid
// case 19684: // Tame Webwood Lurker
// case 19685: // Tame Nightsaber Stalker
// case 19686: // Tame Strigid Screecher
// case 30100: // Tame Crazed Dragonhawk
// case 30103: // Tame Elder Springpaw
// case 30104: // Tame Mistbat
// case 30647: // Tame Barbed Crawler
// case 30648: // Tame Greater Timberstrider
// case 30652: // Tame Nightstalker
// return;
default:
break;
}
@@ -2427,15 +2091,8 @@ void AuraEffect::TriggerSpell()
case 28820:
{
// Need remove self if Lightning Shield not active
Unit::AuraMap const& auras = target->GetAuras();
for(Unit::AuraMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
SpellEntry const* spell = itr->second->GetSpellProto();
if( spell->SpellFamilyName == SPELLFAMILY_SHAMAN &&
spell->SpellFamilyFlags[0] & 0x400)
return;
}
target->RemoveAurasDueToSpell(28820);
if (!target->GetAura(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN,0x400))
target->RemoveAurasDueToSpell(28820);
return;
}
// Totemic Mastery (Skyshatter Regalia (Shaman Tier 6) - bonus)
@@ -2474,43 +2131,6 @@ void AuraEffect::TriggerSpell()
// Spell exist but require custom code
switch(auraId)
{
// Curse of Idiocy
case 1010:
{
// TODO: spell casted by result in correct way mostly
// BUT:
// 1) target show casting at each triggered cast: target don't must show casting animation for any triggered spell
// but must show affect apply like item casting
// 2) maybe aura must be replace by new with accumulative stat mods instead stacking
// prevent cast by triggered auras
if(GetCasterGUID() == m_target->GetGUID())
return;
// stop triggering after each affected stats lost > 90
int32 intellectLoss = 0;
int32 spiritLoss = 0;
Unit::AuraEffectList const& mModStat = m_target->GetAurasByType(SPELL_AURA_MOD_STAT);
for(Unit::AuraEffectList::const_iterator i = mModStat.begin(); i != mModStat.end(); ++i)
{
if ((*i)->GetId() == 1010)
{
switch((*i)->GetMiscValue())
{
case STAT_INTELLECT: intellectLoss += (*i)->GetAmount(); break;
case STAT_SPIRIT: spiritLoss += (*i)->GetAmount(); break;
default: break;
}
}
}
if(intellectLoss <= -90 && spiritLoss <= -90)
return;
caster = target;
break;
}
// Mana Tide
case 16191:
{
@@ -2649,14 +2269,14 @@ void AuraEffect::HandleAuraDummy(bool apply, bool Real, bool changeAmount)
}
return;
}
case 37096: // Blood Elf Disguise
case 37096: // Blood Elf Illusion
{
if(caster)
{
switch(caster->getGender())
{
case GENDER_FEMALE:
caster->CastSpell(m_target,37095,true,NULL,this);
caster->CastSpell(m_target,37095,true,NULL,this); // Blood Elf Disguise
break;
case GENDER_MALE:
caster->CastSpell(m_target,37093,true,NULL,this);
@@ -3417,12 +3037,12 @@ void AuraEffect::HandleAuraModShapeshift(bool apply, bool Real, bool changeAmoun
case FORM_BEAR:
case FORM_DIREBEAR:
case FORM_CAT:
if(AuraEffect* dummy = m_target->GetDummyAura(37315) )
if(AuraEffect* dummy = m_target->GetAuraEffect(37315, 0) )
m_target->CastSpell(m_target,37316,true,NULL,dummy);
break;
// Nordrassil Regalia - bonus
case FORM_MOONKIN:
if(AuraEffect* dummy = m_target->GetDummyAura(37324) )
if(AuraEffect* dummy = m_target->GetAuraEffect(37324, 0) )
m_target->CastSpell(m_target,37325,true,NULL,dummy);
break;
case FORM_BATTLESTANCE:
@@ -4551,23 +4171,18 @@ void AuraEffect::HandleModMechanicImmunity(bool apply, bool Real, bool /*changeA
m_target->ApplySpellImmune(GetId(),IMMUNITY_MECHANIC,GetMiscValue(),apply);
// Bestial Wrath
if ( GetSpellProto()->SpellFamilyName == SPELLFAMILY_HUNTER && GetSpellProto()->Id == 19574)
if (GetSpellProto()->Id == 19574)
{
// The Beast Within cast on owner if talent present
if ( Unit* owner = m_target->GetOwner() )
{
// Search talent
Unit::AuraEffectList const& m_dummyAuras = owner->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraEffectList::const_iterator i = m_dummyAuras.begin(); i != m_dummyAuras.end(); ++i)
if (owner->GetAuraEffect(34692, 0))
{
if ( (*i)->GetSpellProto()->SpellIconID == 2229 )
{
if (apply)
owner->CastSpell(owner, 34471, true, 0, this);
else
owner->RemoveAurasDueToSpell(34471);
break;
}
if (apply)
owner->CastSpell(owner, 34471, true, 0, this);
else
owner->RemoveAurasDueToSpell(34471);
}
}
}
@@ -4606,7 +4221,7 @@ void AuraEffect::HandleModMechanicImmunity(bool apply, bool Real, bool /*changeA
m_target->ApplySpellImmune(GetId(),IMMUNITY_STATE,SPELL_AURA_MOD_DECREASE_SPEED,apply);
}
// Demonic Circle
else if (m_spellProto->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellProto->SpellIconID == 3221)
else if (GetId() == 48020)
{
if (m_target->GetTypeId() != TYPEID_PLAYER)
return;
@@ -4619,7 +4234,6 @@ void AuraEffect::HandleModMechanicImmunity(bool apply, bool Real, bool /*changeA
}
}
//this method is called whenever we add / remove aura which gives m_target some imunity to some spell effect
void AuraEffect::HandleAuraModEffectImmunity(bool apply, bool Real, bool /*changeAmount*/)
{
// when removing flag aura, handle flag drop
@@ -4818,12 +4432,15 @@ void AuraEffect::HandleAuraPeriodicDummy(bool apply, bool Real, bool changeAmoun
case SPELLFAMILY_HUNTER:
{
// Explosive Shot
if (apply && !loading && caster)
if (apply && !loading && caster && spell->SpellFamilyFlags[1] & 0x80000000)
m_amount += int32(caster->GetTotalAttackPowerValue(RANGED_ATTACK) * 14 / 100);
break;
}
case SPELLFAMILY_DEATHKNIGHT:
{
// Reaping
// Blood of the North
// Death Rune Mastery
if (spell->SpellIconID == 3041 || spell->SpellIconID == 22 || spell->SpellIconID == 2622)
m_amount = 0;
break;
@@ -4851,7 +4468,7 @@ void AuraEffect::HandlePeriodicDamage(bool apply, bool Real, bool changeAmount)
// Curse of Doom
// This is a hack - this aura should be handled by passive aura and proc doomguard spawn on kill, however there is no such aura in dbcs
if(m_spellProto->SpellFamilyName==SPELLFAMILY_WARLOCK && m_spellProto->SpellFamilyFlags.IsEqual(0,0x02,0))
if(m_spellProto->SpellFamilyName==SPELLFAMILY_WARLOCK && m_spellProto->SpellFamilyFlags[1] & 0x02)
{
if (Real && !apply && GetParentAura()->GetRemoveMode()==AURA_REMOVE_BY_DEATH)
{
@@ -4909,7 +4526,7 @@ void AuraEffect::HandlePeriodicDamage(bool apply, bool Real, bool changeAmount)
case SPELLFAMILY_DRUID:
{
// Rip
if (m_spellProto->SpellVisual[0] == 3941)
if (m_spellProto->SpellFamilyFlags[0] & 0x00800000)
{
// 0.01*$AP*cp
if (caster->GetTypeId() != TYPEID_PLAYER)
@@ -4918,15 +4535,9 @@ void AuraEffect::HandlePeriodicDamage(bool apply, bool Real, bool changeAmount)
uint8 cp = ((Player*)caster)->GetComboPoints();
// Idol of Feral Shadows. Cant be handled as SpellMod in SpellAura:Dummy due its dependency from CPs
Unit::AuraEffectList const& dummyAuras = caster->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraEffectList::const_iterator itr = dummyAuras.begin(); itr != dummyAuras.end(); ++itr)
{
if((*itr)->GetId()==34241)
{
m_amount += cp * (*itr)->GetAmount();
break;
}
}
if (AuraEffect const * aurEff = caster->GetAuraEffect(34241,0))
m_amount += cp * aurEff->GetAmount();
m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * cp / 100);
return;
}
@@ -6062,7 +5673,7 @@ void AuraEffect::HandleSchoolAbsorb(bool apply, bool Real, bool changeAmount)
{
case SPELLFAMILY_PRIEST:
// Power Word: Shield
if(m_spellProto->SpellFamilyFlags.IsEqual(0x1, 0, 0x400))
if(m_spellProto->SpellFamilyFlags[0] & 0x1 && m_spellProto->SpellFamilyFlags[2] & 0x400)
{
// +80.68% from sp bonus
DoneActualBenefit = caster->SpellBaseHealingBonus(GetSpellSchoolMask(m_spellProto)) * 0.8068f;
@@ -6070,7 +5681,7 @@ void AuraEffect::HandleSchoolAbsorb(bool apply, bool Real, bool changeAmount)
break;
case SPELLFAMILY_MAGE:
// ice barrier
if(m_spellProto->SpellFamilyFlags.IsEqual(0, 0x1, 0x8))
if(m_spellProto->SpellFamilyFlags[1] & 0x1 && m_spellProto->SpellFamilyFlags[2] & 0x8)
{
// +80.67% from sp bonus
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.8067f;
@@ -6087,7 +5698,7 @@ void AuraEffect::HandleSchoolAbsorb(bool apply, bool Real, bool changeAmount)
break;
case SPELLFAMILY_WARLOCK:
// shadow ward
if(m_spellProto->SpellFamilyFlags.IsEqual(0, 0, 0x40))
if(m_spellProto->SpellFamilyFlags[2]& 0x40)
{
// +30% from sp bonus
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.3f;
@@ -6098,7 +5709,7 @@ void AuraEffect::HandleSchoolAbsorb(bool apply, bool Real, bool changeAmount)
if (m_spellProto->SpellFamilyFlags[1] & 0x80000)
{
// 0.75 from sp bonus
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.75f;
DoneActualBenefit = caster->SpellBaseHealingBonus(GetSpellSchoolMask(m_spellProto)) * 0.75f;
}
break;
default:
@@ -6123,8 +5734,8 @@ void AuraEffect::HandleSchoolAbsorb(bool apply, bool Real, bool changeAmount)
Player *player = ((Player*)caster);
// Glyph of Guardian Spirit
if(AuraEffect * aurEff = player->GetDummyAura(63231))
{
if(AuraEffect * aurEff = player->GetAuraEffect(63231, 0))
{
if (GetParentAura()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
{
if (!player->HasSpellCooldown(47788))
@@ -6132,7 +5743,7 @@ void AuraEffect::HandleSchoolAbsorb(bool apply, bool Real, bool changeAmount)
player->RemoveSpellCooldown(m_spellProto->Id, true);
player->AddSpellCooldown(m_spellProto->Id, 0, uint32(time(NULL) + aurEff->GetAmount()));
WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4+4);
data << uint64(player->GetGUID());
data << uint8(0x0); // flags (0x1, 0x2)
@@ -6172,15 +5783,15 @@ void AuraEffect::PeriodicTick()
{
switch(GetId())
{
case 43093: case 31956: case 38801:
case 35321: case 38363: case 39215:
case 43093: case 31956: case 38801: // Grievous Wound
case 35321: case 38363: case 39215: // Gushing Wound
if(m_target->GetHealth() == m_target->GetMaxHealth() )
{
m_target->RemoveAurasDueToSpell(GetId());
return;
}
break;
case 38772:
case 38772: // Grievous Wound
{
uint32 percent =
GetEffIndex() < 2 && GetSpellProto()->Effect[GetEffIndex()]==SPELL_EFFECT_DUMMY ?
@@ -6193,18 +5804,13 @@ void AuraEffect::PeriodicTick()
}
break;
}
case 41337:// aura of anger
case 41337:// Aura of Anger
{
Unit::AuraEffectList const& mMod = m_target->GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
for(Unit::AuraEffectList::const_iterator i = mMod.begin(); i != mMod.end(); ++i)
if (AuraEffect * aurEff = GetParentAura()->GetPartAura(1))
{
if ((*i)->GetId() == 41337)
{
(*i)->ApplyModifier(false);
(*i)->SetAmount((*i)->GetAmount()+5);
(*i)->ApplyModifier(true);
break;
}
aurEff->ApplyModifier(false, false, true);
aurEff->SetAmount(aurEff->GetAmount()+5);
aurEff->ApplyModifier(true, false, true);
}
m_amount = 100 * m_tickNumber;
break;
@@ -6410,7 +6016,7 @@ void AuraEffect::PeriodicTick()
return;
// heal for caster damage (must be alive)
if(m_target != pCaster && GetSpellProto()->SpellVisual[0]==163 && !pCaster->isAlive())
if(m_target != pCaster && GetSpellProto()->AttributesEx2 & SPELL_ATTR_EX2_HEALTH_FUNNEL && !pCaster->isAlive())
return;
if(GetParentAura()->GetAuraDuration() ==-1 && m_target->GetHealth()==m_target->GetMaxHealth())
@@ -6471,7 +6077,7 @@ void AuraEffect::PeriodicTick()
// Health Funnel
// heal for caster damage
if(m_target!=pCaster && spellProto->SpellVisual[0]==163)
if(m_target!=pCaster && GetSpellProto()->AttributesEx2 & SPELL_ATTR_EX2_HEALTH_FUNNEL)
{
uint32 dmg = spellProto->manaPerSecond;
if(pCaster->GetHealth() <= dmg && pCaster->GetTypeId()==TYPEID_PLAYER)
@@ -6896,165 +6502,10 @@ void AuraEffect::PeriodicDummyTick()
// 7053 Forsaken Skill: Shadow
return;
}
// // Panda
// case 19230: break;
// // Gossip NPC Periodic - Talk
// case 33208: break;
// // Gossip NPC Periodic - Despawn
// case 33209: break;
// // Steal Weapon
// case 36207: break;
// // Simon Game START timer, (DND)
// case 39993: break;
// // Knockdown Fel Cannon: break; The Aggro Burst
// case 40119: break;
// // Old Mount Spell
// case 40154: break;
// // Magnetic Pull
// case 40581: break;
// // Ethereal Ring: break; The Bolt Burst
// case 40801: break;
// // Crystal Prison
// case 40846: break;
// // Copy Weapon
// case 41054: break;
// // Dementia
// case 41404: break;
// // Ethereal Ring Visual, Lightning Aura
// case 41477: break;
// // Ethereal Ring Visual, Lightning Aura (Fork)
// case 41525: break;
// // Ethereal Ring Visual, Lightning Jumper Aura
// case 41567: break;
// // No Man's Land
// case 41955: break;
// // Headless Horseman - Fire
// case 42074: break;
// // Headless Horseman - Visual - Large Fire
// case 42075: break;
// // Headless Horseman - Start Fire, Periodic Aura
// case 42140: break;
// // Ram Speed Boost
// case 42152: break;
// // Headless Horseman - Fires Out Victory Aura
// case 42235: break;
// // Pumpkin Life Cycle
// case 42280: break;
// // Brewfest Request Chick Chuck Mug Aura
// case 42537: break;
// // Squashling
// case 42596: break;
// // Headless Horseman Climax, Head: Periodic
// case 42603: break;
// // Fire Bomb
// case 42621: break;
// // Headless Horseman - Conflagrate, Periodic Aura
// case 42637: break;
// // Headless Horseman - Create Pumpkin Treats Aura
// case 42774: break;
// // Headless Horseman Climax - Summoning Rhyme Aura
// case 42879: break;
// // Tricky Treat
// case 42919: break;
// // Giddyup!
// case 42924: break;
// // Ram - Trot
// case 42992: break;
// // Ram - Canter
// case 42993: break;
// // Ram - Gallop
// case 42994: break;
// // Ram Level - Neutral
// case 43310: break;
// // Headless Horseman - Maniacal Laugh, Maniacal, Delayed 17
// case 43884: break;
// // Wretched!
// case 43963: break;
// // Headless Horseman - Maniacal Laugh, Maniacal, other, Delayed 17
// case 44000: break;
// // Energy Feedback
// case 44328: break;
// // Romantic Picnic
// case 45102: break;
// // Romantic Picnic
// case 45123: break;
// // Looking for Love
// case 45124: break;
// // Kite - Lightning Strike Kite Aura
// case 45197: break;
// // Rocket Chicken
// case 45202: break;
// // Copy Offhand Weapon
// case 45205: break;
// // Upper Deck - Kite - Lightning Periodic Aura
// case 45207: break;
// // Kite -Sky Lightning Strike Kite Aura
// case 45251: break;
// // Ribbon Pole Dancer Check Aura
// case 45390: break;
// // Holiday - Midsummer, Ribbon Pole Periodic Visual
// case 45406: break;
// // Parachute
// case 45472: break;
// // Alliance Flag, Extra Damage Debuff
// case 45898: break;
// // Horde Flag, Extra Damage Debuff
// case 45899: break;
// // Ahune - Summoning Rhyme Aura
// case 45926: break;
// // Ahune - Slippery Floor
// case 45945: break;
// // Ahune's Shield
// case 45954: break;
// // Nether Vapor Lightning
// case 45960: break;
// // Darkness
// case 45996: break;
// // Summon Blood Elves Periodic
// case 46041: break;
// // Transform Visual Missile Periodic
// case 46205: break;
// // Find Opening Beam End
// case 46333: break;
// // Ice Spear Control Aura
// case 46371: break;
// // Hailstone Chill
// case 46458: break;
// // Hailstone Chill, Internal
// case 46465: break;
// // Chill, Internal Shifter
// case 46549: break;
// // Summon Ice Spear Knockback Delayer
// case 46878: break;
// // Burninate Effect
// case 47214: break;
// // Fizzcrank Practice Parachute
// case 47228: break;
// // Send Mug Control Aura
// case 47369: break;
// // Direbrew's Disarm (precast)
// case 47407: break;
// // Mole Machine Port Schedule
// case 47489: break;
// case 47941: break; // Crystal Spike
// case 48200: break; // Healer Aura
// case 48630: break; // Summon Gauntlet Mobs Periodic
// case 49313: break; // Proximity Mine Area Aura
// // Mole Machine Portal Schedule
// case 49466: break;
// case 49555: break; // Corpse Explode
// case 49592: break; // Temporal Rift
// case 49957: break; // Cutting Laser
// case 50085: break; // Slow Fall
// // Listening to Music
// case 50493: break;
// // Love Rocket Barrage
// case 50530: break;
case 58549: // Tenacity
case 59911: // Tenacity (vehicle)
GetParentAura()->RefreshAura();
break;
// Exist more after, need add later
default:
break;
}
@@ -7179,9 +6630,6 @@ void AuraEffect::PeriodicDummyTick()
}
switch (spell->Id)
{
// Harpooner's Mark
// case 40084:
// return;
// Feeding Frenzy Rank 1
case 53511:
if ( m_target->GetHealth() * 100 < m_target->GetMaxHealth() * 35 )
@@ -7236,15 +6684,6 @@ void AuraEffect::PeriodicDummyTick()
// Being pursuaded by Gargoyle - AI related?
// if (spell->SpellFamilyFlags[1] & 0x00000080)
// break;
// Bladed Armor
if (spell->SpellIconID == 2653)
{
// Increases your attack power by $s1 for every $s2 armor value you have.
// Calculate AP bonus (from 1 efect of this spell)
int32 apBonus = m_amount * m_target->GetArmor() / m_target->CalculateSpellDamage(spell, 1, spell->EffectBasePoints[1], m_target);
m_target->CastCustomSpell(m_target, 61217, &apBonus, &apBonus, 0, true, 0, this);
return;
}
// Blood of the North
// Reaping
// Death Rune Mastery
@@ -7319,7 +6758,7 @@ void AuraEffect::HandleManaShield(bool apply, bool Real, bool changeAmount)
switch(m_spellProto->SpellFamilyName)
{
case SPELLFAMILY_MAGE:
if(m_spellProto->SpellFamilyFlags[0] & 0x8000)
if(m_spellProto->SpellFamilyFlags[0] & 0x8000 && m_spellProto->SpellFamilyFlags[2] & 0x8)
{
// Mana Shield
// +50% from +spd bonus
@@ -7585,7 +7024,7 @@ void AuraEffect::HandleAuraSafeFall( bool Apply, bool Real , bool /*changeAmount
{
// implemented in WorldSession::HandleMovementOpcodes
// only special case
// Buffeting Winds of Susurrus - only special case
if(Apply && Real && GetId()==32474 && m_target->GetTypeId()==TYPEID_PLAYER)
((Player*)m_target)->ActivateTaxiPathTo(506,GetId());
}
+62 -64
View File
@@ -446,19 +446,10 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
{
// Incinerate does more dmg (dmg*0.25) if the target have Immolate debuff.
// Check aura state for speed but aura state set not only for Immolate spell
if(unitTarget->HasAuraState(AURA_STATE_CONFLAGRATE, m_spellInfo, m_caster))
if(unitTarget->HasAuraState(AURA_STATE_CONFLAGRATE))
{
Unit::AuraEffectList const& RejorRegr = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraEffectList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i)
{
// Immolate
if((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK &&
((*i)->GetSpellProto()->SpellFamilyFlags[0] & 0x4))
{
damage += damage/4;
break;
}
}
if (unitTarget->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, 0x4))
damage += damage/4;
}
}
// Conflagrate - consumes Immolate or Shadowflame
@@ -540,22 +531,13 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
// consume from stack dozes not more that have combo-points
if(uint32 combo = ((Player*)m_caster)->GetComboPoints())
{
Aura *poison = 0;
// Lookup for Deadly poison (only attacker applied)
Unit::AuraEffectList const& auras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraEffectList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
if( (*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_ROGUE &&
(*itr)->GetSpellProto()->SpellFamilyFlags[0] & 0x10000 &&
(*itr)->GetCasterGUID()==m_caster->GetGUID() )
{
poison = (*itr)->GetParentAura();
break;
}
// count consumed deadly poison doses at target
if (poison)
if (AuraEffect const * aurEff = unitTarget->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x10000, 0, 0, m_caster->GetGUID()))
{
uint32 spellId = poison->GetId();
uint32 doses = poison->GetStackAmount();
// count consumed deadly poison doses at target
Aura *poison = 0;
uint32 spellId = aurEff->GetId();
uint32 doses = aurEff->GetParentAura()->GetStackAmount();
if (doses > combo)
doses = combo;
for (int i=0; i< doses; i++)
@@ -564,7 +546,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
damage += int32(((Player*)m_caster)->GetTotalAttackPowerValue(BASE_ATTACK) * 0.03f * doses);
}
// Eviscerate and Envenom Bonus Damage (item set effect)
if(m_caster->GetDummyAura(37169))
if(m_caster->HasAura(37169))
damage += ((Player*)m_caster)->GetComboPoints()*40;
}
}
@@ -577,7 +559,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
damage += irand(int32(ap * combo * 0.03f), int32(ap * combo * 0.07f));
// Eviscerate and Envenom Bonus Damage (item set effect)
if(m_caster->GetDummyAura(37169))
if(m_caster->HasAura(37169))
damage += combo*40;
}
}
@@ -1351,7 +1333,7 @@ void Spell::EffectDummy(uint32 i)
uint32 rage=0;
// Glyph of Execution bonus
if (AuraEffect *aura = m_caster->GetDummyAura(58367))
if (AuraEffect *aura = m_caster->GetAuraEffect(58367, 0))
rage+=aura->GetAmount();
spell_id = 20647;
@@ -1371,7 +1353,7 @@ void Spell::EffectDummy(uint32 i)
}
bp = damage+int32(rage * m_spellInfo->DmgMultiplier[i] +
m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.2f);
m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.2f);
break;
}
// Concussion Blow
@@ -1587,7 +1569,7 @@ void Spell::EffectDummy(uint32 i)
if(m_caster->GetTypeId()!=TYPEID_PLAYER)
return;
//immediately finishes the cooldown for hunter abilities
// immediately finishes the cooldown on your other Hunter abilities except Bestial Wrath
const SpellCooldowns& cm = ((Player*)m_caster)->GetSpellCooldownMap();
for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();)
{
@@ -1614,15 +1596,15 @@ void Spell::EffectDummy(uint32 i)
}
break;
case SPELLFAMILY_PALADIN:
// Divine Storm
if (m_spellInfo->SpellFamilyFlags[1] & 0x20000 && i == 1)
{
int32 dmg= m_damage * damage /100;
m_caster->CastCustomSpell(unitTarget, 54172, &dmg , 0, 0, true);
return;
}
switch(m_spellInfo->SpellIconID)
{
// Divine Storm
if (m_spellInfo->SpellFamilyFlags[1] & 0x20000)
{
int32 damage=m_currentBasePoints[0] * damage /100;
m_caster->CastCustomSpell(unitTarget, 54172, &damage , 0, 0, true);
return;
}
case 156: // Holy Shock
{
if(!unitTarget)
@@ -1789,10 +1771,12 @@ void Spell::EffectDummy(uint32 i)
}
return;
}
// Cleansing Totem
// Cleansing Totem Pulse
if(m_spellInfo->SpellFamilyFlags[0] & 0x04000000 && m_spellInfo->SpellIconID==1673)
{
m_caster->CastSpell(unitTarget, 52025, true, 0, 0, m_originalCasterGUID);
int32 bp1 = 1;
// Cleansing Totem Effect
m_caster->CastCustomSpell(unitTarget, 52025, NULL, &bp1, NULL, true, NULL, NULL, m_originalCasterGUID);
return;
}
// Healing Stream Totem
@@ -1815,7 +1799,7 @@ void Spell::EffectDummy(uint32 i)
return;
// Glyph of Mana Tide
if(Unit *owner = m_caster->GetOwner())
if (AuraEffect *dummy = owner->GetDummyAura(55441))
if (AuraEffect *dummy = owner->GetAuraEffect(55441, 0))
damage+=dummy->GetAmount();
// Regenerate 6% of Total Mana Every 3 secs
int32 EffectBasePoints0 = unitTarget->GetMaxPower(POWER_MANA) * damage / 100;
@@ -1830,6 +1814,7 @@ void Spell::EffectDummy(uint32 i)
Item *item = ((Player*)m_caster)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
if (item)
{
// Damage is increased by 25% if your off-hand weapon is enchanted with Flametongue.
if (m_caster->GetAura(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0x200000))
{
m_damage += m_damage * damage / 100;
@@ -1839,12 +1824,27 @@ void Spell::EffectDummy(uint32 i)
}
break;
case SPELLFAMILY_DEATHKNIGHT:
// Death strike dummy aura apply
// Used to proc healing later
// Death strike
if (m_spellInfo->SpellFamilyFlags[0] & 0x00000010)
{
spell_id=45469;
m_caster->CastSpell(m_caster,spell_id,true);
uint32 count = 0;
Unit::AuraMap const& auras = unitTarget->GetAuras();
for(Unit::AuraMap::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
{
if(itr->second->GetSpellProto()->Dispel == DISPEL_DISEASE &&
itr->second->GetCasterGUID() == m_caster->GetGUID())
{
++count;
// max. 15%
if(count == 3)
break;
}
}
int32 bp = count * m_caster->GetMaxHealth() * m_spellInfo->DmgMultiplier[0] / 100;
// Improved Death Strike
if (AuraEffect const * aurEff = m_caster->GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_DEATHKNIGHT, 2751, 0))
bp = bp * (m_caster->CalculateSpellDamage(aurEff->GetSpellProto(), 2, aurEff->GetSpellProto()->EffectBasePoints[2], m_caster) + 100.0f) / 100.0f;
m_caster->CastCustomSpell(m_caster, 45470, &bp, NULL, NULL, true);
return;
}
// Scourge Strike
@@ -2070,7 +2070,7 @@ void Spell::EffectTriggerSpell(uint32 i)
case 58832:
{
// Glyph of Mirror Image
if (m_caster->GetDummyAura(63093))
if (m_caster->HasAura(63093))
m_caster->CastSpell(m_caster, 65047, true); // Mirror Image
break;
@@ -2593,12 +2593,11 @@ void Spell::SpellDamageHeal(uint32 /*i*/)
{
// Amount of heal - depends from stacked Holy Energy
int damageAmount = 0;
Unit::AuraEffectList const& mDummyAuras = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraEffectList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
if((*i)->GetId() == 45062)
damageAmount+=(*i)->GetAmount();
if (damageAmount)
if (AuraEffect const * aurEff = m_caster->GetAuraEffect(45062, 0))
{
damageAmount+= aurEff->GetAmount();
m_caster->RemoveAurasDueToSpell(45062);
}
addhealth += damageAmount;
}
@@ -2611,7 +2610,7 @@ void Spell::SpellDamageHeal(uint32 /*i*/)
for(Unit::AuraEffectList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i)
{
if((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID
&& ((*i)->GetSpellProto()->SpellFamilyFlags.IsEqual(0x40) || (*i)->GetSpellProto()->SpellFamilyFlags.IsEqual(0x10)) )
&& (*i)->GetSpellProto()->SpellFamilyFlags[0] & 0x50)
{
if(!targetAura || (*i)->GetParentAura()->GetAuraDuration() < targetAura->GetParentAura()->GetAuraDuration())
targetAura = *i;
@@ -2631,18 +2630,17 @@ void Spell::SpellDamageHeal(uint32 /*i*/)
//It is said that talent bonus should not be included
int32 tickcount = 0;
if(targetAura->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID)
{
switch(targetAura->GetSpellProto()->SpellFamilyFlags[0])
{
case 0x10: tickcount = 4; break; // Rejuvenation
case 0x40: tickcount = 6; break; // Regrowth
}
}
// Rejuvenation
if (targetAura->GetSpellProto()->SpellFamilyFlags[0] & 0x10)
tickcount = 4;
// Regrowth
else // if (targetAura->GetSpellProto()->SpellFamilyFlags[0] & 0x40)
tickcount = 6;
addhealth += tickheal * tickcount;
// Glyph of Swiftmend
if(!caster->GetDummyAura(54824))
if(!caster->HasAura(54824))
unitTarget->RemoveAura(targetAura->GetId(), targetAura->GetCasterGUID());
//addhealth += tickheal * tickcount;
@@ -4286,7 +4284,7 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
break;
int32 count = 1;
// Glyph of Devastate
if (AuraEffect * aurEff = m_caster->GetDummyAura(58388))
if (AuraEffect * aurEff = m_caster->GetAuraEffect(58388, 0))
count += aurEff->GetAmount();
for (;count>0;count--)
m_caster->CastSpell(unitTarget, spellInfo, true);
@@ -4749,7 +4747,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
return;
// Onyxia Scale Cloak
if(unitTarget->GetDummyAura(22683))
if(unitTarget->HasAura(22683))
return;
// Shadow Flame
@@ -5718,7 +5716,7 @@ void Spell::EffectSummonPlayer(uint32 /*i*/)
return;
// Evil Twin (ignore player summon, but hide this for summoner)
if(unitTarget->GetDummyAura(23445))
if(unitTarget->HasAura(23445))
return;
float x, y, z;
-3
View File
@@ -3729,9 +3729,6 @@ void SpellMgr::LoadSpellCustomAttr()
case 51852: // The Eye of Acherus (no spawn in phase 2 in db)
spellInfo->EffectMiscValue[0] |= 1;
break;
case 52025: // Cleansing Totem Effect
spellInfo->EffectDieSides[1] = 1;
break;
case 51904: // Summon Ghouls On Scarlet Crusade (core does not know the triggered spell is summon spell)
spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER;
break;
+8 -33
View File
@@ -6920,21 +6920,6 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
triggered_spell_id = 50526;
break;
}
// Death Strike healing effect
if (dummySpell->Id == 45469)
{
if (!pVictim)
return false;
basepoints0=pVictim->GetDiseasesByCaster(GetGUID()) * GetMaxHealth()* procSpell->DmgMultiplier[0] / 100.0f;
// Do not heal when no diseases on target
if (!basepoints0)
return true;
// Improved Death Strike
if (AuraEffect const * aurEff = GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_DEATHKNIGHT, 2751, 0))
basepoints0 = basepoints0 * (CalculateSpellDamage(aurEff->GetSpellProto(), 2, aurEff->GetSpellProto()->EffectBasePoints[2], this) + 100.0f) / 100.0f;
triggered_spell_id = 45470;
break;
}
// Sudden Doom
if (dummySpell->SpellIconID == 1939 && GetTypeId() == TYPEID_PLAYER)
{
@@ -7613,9 +7598,9 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
// stacking
CastSpell(this, 37658, true, NULL, triggeredByAura);
AuraEffect * dummy = GetDummyAura(37658);
Aura * dummy = GetAura(37658);
// release at 3 aura in stack (cont contain in basepoint of trigger aura)
if(!dummy || dummy->GetParentAura()->GetStackAmount() < triggerAmount)
if(!dummy || dummy->GetStackAmount() < triggerAmount)
return false;
RemoveAurasDueToSpell(37658);
@@ -7631,9 +7616,9 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
CastSpell(this, 54842, true, NULL, triggeredByAura);
// counting
AuraEffect * dummy = GetDummyAura(54842);
Aura * dummy = GetAura(54842);
// release at 3 aura in stack (cont contain in basepoint of trigger aura)
if(!dummy || dummy->GetParentAura()->GetStackAmount() < triggerAmount)
if(!dummy || dummy->GetStackAmount() < triggerAmount)
return false;
RemoveAurasDueToSpell(54842);
@@ -7912,7 +7897,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
case 22959:
{
// Glyph of Improved Scorch
if (AuraEffect * aurEff = GetDummyAura(56371))
if (AuraEffect * aurEff = GetAuraEffect(56371,0))
{
for (int32 count = aurEff->GetAmount();count>0;count--)
CastSpell(pVictim, 22959, true);
@@ -9478,7 +9463,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
if (spellProto->SpellFamilyFlags[0] & 0x800000)
{
// Increase Mind Flay damage
if (AuraEffect * aurEff = GetDummyAura(55687))
if (AuraEffect * aurEff = GetAuraEffect(55687, 0))
// if Shadow Word: Pain present
if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0,0, GetGUID()))
DoneTotalMod *= (aurEff->GetAmount() + 100.0f) / 100.f;
@@ -9532,7 +9517,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
if (pVictim->GetTypeId() == TYPEID_PLAYER)
{
//Cheat Death
if (AuraEffect *dummy = pVictim->GetDummyAura(45182))
if (AuraEffect *dummy = pVictim->GetAuraEffect(45182, 0))
{
float mod = -((Player*)pVictim)->GetRatingBonusValue(CR_CRIT_TAKEN_SPELL)*2*4;
if (mod < dummy->GetAmount())
@@ -9803,7 +9788,7 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
// Sacred Shield
if (spellProto->SpellFamilyFlags[0] & 0x40000000)
{
AuraEffect const* aura = pVictim->GetDummyAura(58597);
AuraEffect const* aura = pVictim->GetAuraEffect(58597,1);
if (aura && aura->GetCasterGUID() == GetGUID())
crit_chance+=aura->GetAmount();
break;
@@ -13617,16 +13602,6 @@ float Unit::GetAPMultiplier(WeaponAttackType attType, bool normalized)
}
}
AuraEffect* Unit::GetDummyAura( uint32 spell_id ) const
{
Unit::AuraEffectList const& mDummy = GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraEffectList::const_iterator itr = mDummy.begin(); itr != mDummy.end(); ++itr)
if ((*itr)->GetId() == spell_id)
return *itr;
return NULL;
}
AuraEffect* Unit::GetAuraEffect(AuraType type, SpellFamilyNames name, uint32 iconId, uint8 effIndex) const
{
Unit::AuraEffectList const& mDummy = GetAurasByType(type);
-1
View File
@@ -1614,7 +1614,6 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
bool HasAura(Aura * aur) const;
bool HasAuraType(AuraType auraType) const;
bool HasAuraTypeWithMiscvalue(AuraType auratype, uint32 miscvalue) const;
AuraEffect* GetDummyAura(uint32 spell_id) const;
inline AuraEffect* GetDummyAura(SpellFamilyNames name, uint32 iconId, uint8 effIndex) const { return GetAuraEffect(SPELL_AURA_DUMMY, name, iconId, effIndex);}
AuraEffect* GetAuraEffect(AuraType type, SpellFamilyNames name, uint32 iconId, uint8 effIndex) const;
uint32 GetDiseasesByCaster(uint64 casterGUID, bool remove = false);
+4 -4
View File
@@ -850,6 +850,10 @@
RelativePath="..\..\src\game\Path.h"
>
</File>
<File
RelativePath="..\..\src\game\pchdef.h"
>
</File>
<File
RelativePath="..\..\src\game\PetHandler.cpp"
>
@@ -1739,10 +1743,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\game\pchdef.h"
>
</File>
</Files>
<Globals>
</Globals>