Skip to content

Instantly share code, notes, and snippets.

@Tasssadar
Created October 3, 2010 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tasssadar/608686 to your computer and use it in GitHub Desktop.
Save Tasssadar/608686 to your computer and use it in GitHub Desktop.
bool Unit::IsSpellCrit(...)
{
....
// Creatures cant crit with spells
if (GetTypeId() == TYPEID_UNIT && (((Creature*)this)->GetSubtype() == CREATURE_SUBTYPE_GENERIC // If its normal creature
|| (((Creature*)this)->GetSubtype() == CREATURE_SUBTYPE_TEMPORARY_SUMMON && !((Creature*)this)->GetOwnerGUID())) // or temporary summon without owner, hope this is correct
&& spellProto->DmgClass == SPELL_DAMAGE_CLASS_MAGIC) // Also affect only magic
return false;
....
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment