*Update to Mangos 7125.

--HG--
branch : trunk
This commit is contained in:
megamage committed 2009-01-20 19:59:43 -06:00
1 parent 1bbd896861
commit 68c0bcd069
51 files changed
+1058 -725

No files matched your search

+22 -5
View File
@@ -2479,6 +2479,24 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
if (roll < tmp)
return SPELL_MISS_MISS;
// Chance resist mechanic (select max value from every mechanic spell effect)
int32 resist_mech = 0;
// Get effects mechanic and chance
for(int eff = 0; eff < 3; ++eff)
{
int32 effect_mech = GetEffectMechanic(spell, eff);
if (effect_mech)
{
int32 temp = pVictim->GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_MECHANIC_RESISTANCE, effect_mech);
if (resist_mech < temp*100)
resist_mech = temp*100;
}
}
// Roll chance
tmp += resist_mech;
if (roll < tmp)
return SPELL_MISS_RESIST;
bool canDodge = true;
bool canParry = true;
@@ -8418,8 +8436,7 @@ bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) con
if(itr->type == effect)
return true;
uint32 mechanic = spellInfo->EffectMechanic[index];
if (mechanic)
if(uint32 mechanic = spellInfo->EffectMechanic[index])
{
SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
@@ -8427,14 +8444,14 @@ bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) con
return true;
}
uint32 aura = spellInfo->EffectApplyAuraName[index];
if (aura)
if(uint32 aura = spellInfo->EffectApplyAuraName[index])
{
SpellImmuneList const& list = m_spellImmune[IMMUNITY_STATE];
for(SpellImmuneList::const_iterator itr = list.begin(); itr != list.end(); ++itr)
if(itr->type == aura)
return true;
}
return false;
}
@@ -11311,7 +11328,6 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id)
pet->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
uint32 level = (creatureTarget->getLevel() < (getLevel() - 5)) ? (getLevel() - 5) : creatureTarget->getLevel();
pet->SetFreeTalentPoints(pet->GetMaxTalentPointsForLevel(level));
if(!pet->InitStatsForLevel(level))
{
@@ -11324,6 +11340,7 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id)
// this enables pet details window (Shift+P)
pet->AIM_Initialize();
pet->InitPetCreateSpells();
pet->InitTalentForLevel();
pet->SetHealth(pet->GetMaxHealth());
return pet;