Thread: Spells: mez
View Single Post
  #22  
Old 04-22-2013, 08:10 AM
Alecta Alecta is offline
VIP / Contributor


Join Date: Apr 2013
Location: Red '99
Posts: 271
Default

In spells.cpp, in Mob::IsImmuneToSpell add the && and the 3rd line to the condition check.

Code:
		// check max level for spell
		effect_index = GetSpellEffectIndex(spell_id, SE_Mez);
		assert(effect_index >= 0);
		// NPCs get to ignore the max level
		if(((GetLevel() > spells[spell_id].max[effect_index]) &&
			(!caster->IsNPC() || (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity)))) &&
			!(IsClient() && caster->IsClient() )  // Added by Alecta to allow players to bypass mezz level check in pvp.
			)
		{
			mlog(SPELLS__RESISTS, "Our level (%d) is higher than the limit of this Mez spell (%d)", GetLevel(), spells[spell_id].max[effect_index]);
			caster->Message_StringID(MT_Shout, CANNOT_MEZ_WITH_SPELL);
			return true;
		}
	}