mystickdreamer

roll_skill

Nov 12th, 2021 (edited)
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. int roll_skill(const struct char_data *actor,int sact, const struct char_data *resistor, int sres)
  2. {
  3.   int roll = 0, i, j, whowin;
  4.   int sktot = 0;
  5.   int restot = 0;
  6.  
  7.   for(i = 0, i < GET_CLASS_RANKS(actor, sact), i++) {
  8.     roll = rand_number(1, 10);
  9.     if (roll > 7)
  10.       sktot += 1;
  11.   }
  12.   for(j = 0, j < GET_CLASS_RANKS(resistor, sres), j++){
  13.     roll = rand_number(1, 10);
  14.     if (roll > 7)
  15.       restot += 1;
  16.   }
  17.   whowin = sktot - restot;
  18.  
  19.   return whowin;
  20.  
  21. }
Add Comment
Please, Sign In to add comment