All pastes #920840 Raw Edit

higi

public text v1 · immutable
#920840 ·published 2008-02-27 17:36 UTC
rendered paste body
Index: src/game/Creature.cpp
===================================================================
--- src/game/Creature.cpp	(revision 5134)
+++ src/game/Creature.cpp	(working copy)
@@ -1233,13 +1233,28 @@
     SetUInt32Value(UNIT_FIELD_FLAGS,cinfo->Flags);
     SetUInt32Value(UNIT_DYNAMIC_FLAGS,cinfo->dynamicflags);
 
+
     SetModifierValue(UNIT_MOD_ARMOR,             BASE_VALUE, float(cinfo->armor));
+	if (cinfo->armor == ULONG_MAX)
+		ApplySpellImmune(0, IMMUNITY_SCHOOL, IMMUNE_SCHOOL_PHYSICAL, true);
     SetModifierValue(UNIT_MOD_RESISTANCE_HOLY,   BASE_VALUE, float(cinfo->resistance1));
+	if (cinfo->resistance1 == ULONG_MAX)
+		ApplySpellImmune(0, IMMUNITY_SCHOOL, IMMUNE_SCHOOL_HOLY, true);
     SetModifierValue(UNIT_MOD_RESISTANCE_FIRE,   BASE_VALUE, float(cinfo->resistance2));
+	if (cinfo->resistance2 == ULONG_MAX)
+		ApplySpellImmune(0, IMMUNITY_SCHOOL, IMMUNE_SCHOOL_FIRE, true);
     SetModifierValue(UNIT_MOD_RESISTANCE_NATURE, BASE_VALUE, float(cinfo->resistance3));
+	if (cinfo->resistance3 == ULONG_MAX)
+		ApplySpellImmune(0, IMMUNITY_SCHOOL, IMMUNE_SCHOOL_NATURE, true);
     SetModifierValue(UNIT_MOD_RESISTANCE_FROST,  BASE_VALUE, float(cinfo->resistance4));
+	if (cinfo->resistance4 == ULONG_MAX)
+		ApplySpellImmune(0, IMMUNITY_SCHOOL, IMMUNE_SCHOOL_FROST, true);
     SetModifierValue(UNIT_MOD_RESISTANCE_SHADOW, BASE_VALUE, float(cinfo->resistance5));
+	if (cinfo->resistance5 == ULONG_MAX)
+		ApplySpellImmune(0, IMMUNITY_SCHOOL, IMMUNE_SCHOOL_SHADOW, true);
     SetModifierValue(UNIT_MOD_RESISTANCE_ARCANE, BASE_VALUE, float(cinfo->resistance6));
+	if (cinfo->resistance6 == ULONG_MAX)
+		ApplySpellImmune(0, IMMUNITY_SCHOOL, IMMUNE_SCHOOL_ARCANE, true);
 
     SetCanModifyStats(true);
     UpdateAllStats();