Core/Spell: Some random code cleanups

This commit is contained in:
tobmaps
2011-06-25 00:45:38 +07:00
parent cf4114894a
commit 14cb9496e3
2 changed files with 16 additions and 17 deletions
+14 -15
View File
@@ -5704,7 +5704,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
{ {
if (effIndex != 0) if (effIndex != 0)
return false; return false;
AuraEffect* counter = triggeredByAura->GetBase()->GetEffect(1); AuraEffect* counter = triggeredByAura->GetBase()->GetEffect(EFFECT_1);
if (!counter) if (!counter)
return true; return true;
@@ -6040,7 +6040,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
// regen mana for caster // regen mana for caster
CastCustomSpell(this, 59117, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); CastCustomSpell(this, 59117, &basepoints0, NULL, NULL, true, castItem, triggeredByAura);
// Get second aura of spell for replenishment effect on party // Get second aura of spell for replenishment effect on party
if (AuraEffect const* aurEff = (*i)->GetBase()->GetEffect(1)) if (AuraEffect const* aurEff = (*i)->GetBase()->GetEffect(EFFECT_1))
{ {
// Replenishment - roll chance // Replenishment - roll chance
if (roll_chance_i(aurEff->GetAmount())) if (roll_chance_i(aurEff->GetAmount()))
@@ -6605,7 +6605,6 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
// This effect only from Rapid Killing (mana regen) // This effect only from Rapid Killing (mana regen)
if (!(procSpell->SpellFamilyFlags[1] & 0x01000000)) if (!(procSpell->SpellFamilyFlags[1] & 0x01000000))
return false; return false;
triggered_spell_id = 56654;
target = this; target = this;
@@ -6704,8 +6703,9 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
triggered_spell_id = 58597; triggered_spell_id = 58597;
// Item - Paladin T8 Holy 4P Bonus // Item - Paladin T8 Holy 4P Bonus
if (AuraEffect* aurEff = GetAuraEffect(64895, 0)) if (Unit* caster = triggeredByAura->GetCaster())
cooldown = aurEff->GetAmount(); if (AuraEffect const* aurEff = caster->GetAuraEffect(64895, 0))
cooldown = aurEff->GetAmount();
target = this; target = this;
break; break;
@@ -6714,7 +6714,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
if (dummySpell->SpellIconID == 3025) if (dummySpell->SpellIconID == 3025)
{ {
// 4 damage tick // 4 damage tick
basepoints0 = triggerAmount*damage/400; basepoints0 = triggerAmount * damage / 400;
triggered_spell_id = 61840; triggered_spell_id = 61840;
// Add remaining ticks to damage done // Add remaining ticks to damage done
basepoints0 += pVictim->GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE); basepoints0 += pVictim->GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE);
@@ -6724,7 +6724,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
if (dummySpell->SpellIconID == 3030) if (dummySpell->SpellIconID == 3030)
{ {
// 4 healing tick // 4 healing tick
basepoints0 = triggerAmount*damage/400; basepoints0 = triggerAmount * damage / 400;
triggered_spell_id = 54203; triggered_spell_id = 54203;
break; break;
} }
@@ -8027,7 +8027,7 @@ bool Unit::HandleAuraProc(Unit* pVictim, uint32 damage, Aura * triggeredByAura,
return false; return false;
int32 bp0 = int32(CalculatePctN(GetCreateMana(), SpellMgr::CalculateSpellEffectAmount(spInfo, 0))); int32 bp0 = int32(CalculatePctN(GetCreateMana(), SpellMgr::CalculateSpellEffectAmount(spInfo, 0)));
CastCustomSpell(this, 67545, &bp0, NULL, NULL, true, NULL, triggeredByAura->GetEffect(0), GetGUID()); CastCustomSpell(this, 67545, &bp0, NULL, NULL, true, NULL, triggeredByAura->GetEffect(EFFECT_0), GetGUID());
return true; return true;
} }
} }
@@ -8050,7 +8050,7 @@ bool Unit::HandleAuraProc(Unit* pVictim, uint32 damage, Aura * triggeredByAura,
// can't proc from death rune use // can't proc from death rune use
if (rune == RUNE_DEATH) if (rune == RUNE_DEATH)
return false; return false;
AuraEffect* aurEff = triggeredByAura->GetEffect(0); AuraEffect* aurEff = triggeredByAura->GetEffect(EFFECT_0);
if (!aurEff) if (!aurEff)
return false; return false;
// Reset amplitude - set death rune remove timer to 30s // Reset amplitude - set death rune remove timer to 30s
@@ -10953,7 +10953,7 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
// Improved Faerie Fire // Improved Faerie Fire
if (pVictim->HasAuraState(AURA_STATE_FAERIE_FIRE)) if (pVictim->HasAuraState(AURA_STATE_FAERIE_FIRE))
if (AuraEffect const* aurEff = GetDummyAuraEffect(SPELLFAMILY_DRUID, 109, 0)) if (AuraEffect const* aurEff = GetDummyAuraEffect(SPELLFAMILY_DRUID, 109, 0))
crit_chance+=aurEff->GetAmount(); crit_chance += aurEff->GetAmount();
// cumulative effect - don't break // cumulative effect - don't break
@@ -10963,7 +10963,7 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
// Improved Insect Swarm // Improved Insect Swarm
if (AuraEffect const* aurEff = GetDummyAuraEffect(SPELLFAMILY_DRUID, 1771, 0)) if (AuraEffect const* aurEff = GetDummyAuraEffect(SPELLFAMILY_DRUID, 1771, 0))
if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x00000002, 0, 0)) if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x00000002, 0, 0))
crit_chance+=aurEff->GetAmount(); crit_chance += aurEff->GetAmount();
break; break;
} }
break; break;
@@ -10977,9 +10977,8 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
if (spellProto->SpellFamilyFlags[0] & 0x40000000) if (spellProto->SpellFamilyFlags[0] & 0x40000000)
{ {
// Sacred Shield // Sacred Shield
AuraEffect const* aura = pVictim->GetAuraEffect(58597, 1); if (AuraEffect const* aura = pVictim->GetAuraEffect(58597, 1, GetGUID()))
if (aura && aura->GetCasterGUID() == GetGUID()) crit_chance += aura->GetAmount();
crit_chance+=aura->GetAmount();
break; break;
} }
// Exorcism // Exorcism
@@ -11852,7 +11851,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att
case 6427: case 6428: // Dirty Deeds case 6427: case 6428: // Dirty Deeds
if (pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, spellProto, this)) if (pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, spellProto, this))
{ {
AuraEffect* eff0 = (*i)->GetBase()->GetEffect(0); AuraEffect* eff0 = (*i)->GetBase()->GetEffect(EFFECT_0);
if (!eff0 || (*i)->GetEffIndex() != 1) if (!eff0 || (*i)->GetEffIndex() != 1)
{ {
sLog->outError("Spell structure of DD (%u) changed.", (*i)->GetId()); sLog->outError("Spell structure of DD (%u) changed.", (*i)->GetId());
+2 -2
View File
@@ -1896,11 +1896,11 @@ GM.LowerSecurity = 0
# #
# GM.AllowAchievementGain.Level # GM.AllowAchievementGain.Level
# Description: Max GM level allowed to obtain achievements. # Description: Max GM level allowed to obtain achievements.
# Default: 3 - (Players, Moderators, GameMasters, Owners) # Default: 3 - (Players, Moderators, GameMasters, Admins)
# 0 - (Players) # 0 - (Players)
# 1 - (Players, Moderators) # 1 - (Players, Moderators)
# 2 - (Players, Moderators, GameMasters) # 2 - (Players, Moderators, GameMasters)
# 3 - (Players, Moderators, GameMasters, Owners) # 3 - (Players, Moderators, GameMasters, Admins)
GM.AllowAchievementGain.Level = 3 GM.AllowAchievementGain.Level = 3