Skip to content

Commit

Permalink
Core/Spell: Some random code cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
tobmaps committed Jun 24, 2011
1 parent cf41148 commit 14cb949
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
29 changes: 14 additions & 15 deletions src/server/game/Entities/Unit/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5704,7 +5704,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
{
if (effIndex != 0)
return false;
AuraEffect* counter = triggeredByAura->GetBase()->GetEffect(1);
AuraEffect* counter = triggeredByAura->GetBase()->GetEffect(EFFECT_1);
if (!counter)
return true;

Expand Down Expand Up @@ -6040,7 +6040,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
// regen mana for caster
CastCustomSpell(this, 59117, &basepoints0, NULL, NULL, true, castItem, triggeredByAura);
// 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
if (roll_chance_i(aurEff->GetAmount()))
Expand Down Expand Up @@ -6605,7 +6605,6 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
// This effect only from Rapid Killing (mana regen)
if (!(procSpell->SpellFamilyFlags[1] & 0x01000000))
return false;
triggered_spell_id = 56654;

target = this;

Expand Down Expand Up @@ -6704,8 +6703,9 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
triggered_spell_id = 58597;

// Item - Paladin T8 Holy 4P Bonus
if (AuraEffect* aurEff = GetAuraEffect(64895, 0))
cooldown = aurEff->GetAmount();
if (Unit* caster = triggeredByAura->GetCaster())
if (AuraEffect const* aurEff = caster->GetAuraEffect(64895, 0))
cooldown = aurEff->GetAmount();

target = this;
break;
Expand All @@ -6714,7 +6714,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
if (dummySpell->SpellIconID == 3025)
{
// 4 damage tick
basepoints0 = triggerAmount*damage/400;
basepoints0 = triggerAmount * damage / 400;
triggered_spell_id = 61840;
// Add remaining ticks to damage done
basepoints0 += pVictim->GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE);
Expand All @@ -6724,7 +6724,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
if (dummySpell->SpellIconID == 3030)
{
// 4 healing tick
basepoints0 = triggerAmount*damage/400;
basepoints0 = triggerAmount * damage / 400;
triggered_spell_id = 54203;
break;
}
Expand Down Expand Up @@ -8027,7 +8027,7 @@ bool Unit::HandleAuraProc(Unit* pVictim, uint32 damage, Aura * triggeredByAura,
return false;

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;
}
}
Expand All @@ -8050,7 +8050,7 @@ bool Unit::HandleAuraProc(Unit* pVictim, uint32 damage, Aura * triggeredByAura,
// can't proc from death rune use
if (rune == RUNE_DEATH)
return false;
AuraEffect* aurEff = triggeredByAura->GetEffect(0);
AuraEffect* aurEff = triggeredByAura->GetEffect(EFFECT_0);
if (!aurEff)
return false;
// Reset amplitude - set death rune remove timer to 30s
Expand Down Expand Up @@ -10953,7 +10953,7 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
// Improved Faerie Fire
if (pVictim->HasAuraState(AURA_STATE_FAERIE_FIRE))
if (AuraEffect const* aurEff = GetDummyAuraEffect(SPELLFAMILY_DRUID, 109, 0))
crit_chance+=aurEff->GetAmount();
crit_chance += aurEff->GetAmount();

// cumulative effect - don't break

Expand All @@ -10963,7 +10963,7 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
// Improved Insect Swarm
if (AuraEffect const* aurEff = GetDummyAuraEffect(SPELLFAMILY_DRUID, 1771, 0))
if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x00000002, 0, 0))
crit_chance+=aurEff->GetAmount();
crit_chance += aurEff->GetAmount();
break;
}
break;
Expand All @@ -10977,9 +10977,8 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
if (spellProto->SpellFamilyFlags[0] & 0x40000000)
{
// Sacred Shield
AuraEffect const* aura = pVictim->GetAuraEffect(58597, 1);
if (aura && aura->GetCasterGUID() == GetGUID())
crit_chance+=aura->GetAmount();
if (AuraEffect const* aura = pVictim->GetAuraEffect(58597, 1, GetGUID()))
crit_chance += aura->GetAmount();
break;
}
// Exorcism
Expand Down Expand Up @@ -11852,7 +11851,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att
case 6427: case 6428: // Dirty Deeds
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)
{
sLog->outError("Spell structure of DD (%u) changed.", (*i)->GetId());
Expand Down
4 changes: 2 additions & 2 deletions src/server/worldserver/worldserver.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -1896,11 +1896,11 @@ GM.LowerSecurity = 0
#
# GM.AllowAchievementGain.Level
# Description: Max GM level allowed to obtain achievements.
# Default: 3 - (Players, Moderators, GameMasters, Owners)
# Default: 3 - (Players, Moderators, GameMasters, Admins)
# 0 - (Players)
# 1 - (Players, Moderators)
# 2 - (Players, Moderators, GameMasters)
# 3 - (Players, Moderators, GameMasters, Owners)
# 3 - (Players, Moderators, GameMasters, Admins)

GM.AllowAchievementGain.Level = 3

Expand Down

0 comments on commit 14cb949

Please sign in to comment.