All pastes #466998 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-05-02 07:38 UTC
rendered paste body
void::breakondamage(damage, aura) {
   float damage_perc = damage/p_maxhp;
   float break_chance = damage_perc/0.75;
   if (break_chance) > 1 {
      break_chance = 1;
   }
   int roll = rand(0,100);
   if ((break_chance x 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)