All pastes #467220 Raw Edit

Untitled

public text v1 · immutable
·published 2007-05-02 12:03 UTC
rendered paste body
void breakondamage(damage, aura) {
   float damage_perc = damage/p_maxhp;
   float break_chance = damage_perc/0.75f;
   if (break_chance) > 1 {
      break_chance = 1;
   }
   int roll = rand(0,100);
   if ((break_chance * 100) >= roll) {
      removeaura(aura);
   }
}

// This will replace whatever function you have for removeaura() for roots and fear. Also before calling this function for removing roots, the damage type must be checked to not be damage caused by roots (if possible)