diff options
| author | tobmaps <spambot42@yandex.ru> | 2011-06-25 00:45:38 +0700 |
|---|---|---|
| committer | tobmaps <spambot42@yandex.ru> | 2011-06-25 00:45:38 +0700 |
| commit | 14cb9496e3254b8a9e45471bcc7b69e5af1dc942 (patch) | |
| tree | b146e9805a4597cc91bd1d2898d2a20b804cb272 /src | |
| parent | cf4114894a92c30fdc7c6011da256379e9b57598 (diff) | |
Core/Spell: Some random code cleanups
Diffstat (limited to 'src')
| -rwxr-xr-x | src/server/game/Entities/Unit/Unit.cpp | 29 | ||||
| -rw-r--r-- | src/server/worldserver/worldserver.conf.dist | 4 |
2 files changed, 16 insertions, 17 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index ab6ce6e4c67..6a8b1b21b6c 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -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; @@ -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())) @@ -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; @@ -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; @@ -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); @@ -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; } @@ -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; } } @@ -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 @@ -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 @@ -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; @@ -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 @@ -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()); diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index c0292786f7b..eb1e33626c6 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -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 |
