daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest Jan 29th, 2018 59 in 19 hours
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $db->onCampDayUp();
  2.  
  3. $jumpers = $db->getJumpersAvailability(0, "oncamp", NULL);
  4.  
  5. foreach ($jumpers as $jumper) {
  6.     $maxes = array($jumper->inrun_max, $jumper->take_off_max, $jumper->flight_max, $jumper->landing_max);
  7.     $skills = array($jumper->inrun, $jumper->take_off, $jumper->flight, $jumper->landing);
  8.     $remain = array($jumper->inrun_remaining, $jumper->takeoff_remaining, $jumper->flight_remaining, $jumper->landing_remaining);
  9.     $changes = array(0, 0, 0, 0, 0);
  10.     $talent = explode("-", $jumper->talent);
  11.  
  12.     echo $jumper->skills . "<br>";
  13.  
  14.     $day = $jumper->day - 1;
  15.     $s = $jumper->skills;
  16.  
  17.     do {
  18.         $day++;
  19.         $i = substr($s, $day - 1, 1) - 1;
  20.         echo $jumper->id_jumper . " " . $i . "<br>";
  21.     } while ($skills[$i] == $maxes[$i] && $day < 7);
  22.  
  23.     if ($day == 7 && $skills[$i] == $maxes[$i]) {
  24.         $db->endCamp($jumper->id_jumper);
  25.         continue;
  26.     }
  27.  
  28.     $remain[$i] -= 6;
  29.     $days = explode(".", $talent [$i]);
  30.     $pot = explode(".", $talent[$i + 4]);
  31.     $pot = refactor($pot);
  32.  
  33.     while ($remain[$i] < 1 && $skills[$i] < $maxes[$i]) {
  34.         $skills[$i] ++;
  35.         $changes[$i] ++;
  36.         $remain[$i] += getRemaining($skills[$i], $days, $pot);
  37.     }
  38.  
  39.     if ($skills[$i] == $maxes[$i]) {
  40.         $remain[$i] = getRemaining($skills[$i], $days, $pot);
  41.     }
  42.  
  43.     if ($day < 6) {
  44.         if ($jumper->form < 100) {
  45.             $changes[4] ++;
  46.         }
  47.     } else {
  48.         if ($jumper->form < 99) {
  49.             $changes[4]+=2;
  50.         } elseif ($jumper->form == 99) {
  51.             $changes[4] ++;
  52.         }
  53.     }
  54.  
  55.     $plus = explode("&", $jumper->plus);
  56.     var_dump($changes);
  57.     $p = array(0, 0, 0, 0, 0);
  58.  
  59.     for ($g = 0; $g < 5; $g++) {
  60.         $p[$g] = $changes[$g] + $plus[$g];
  61.     }
  62.  
  63.     $pe = implode("&", $p);
  64.     echo "<br>" . $pe;
  65.     if ($jumper->day < $day) {
  66.         $db->updateCampDay($day, $jumper->id_jumper);
  67.     }
  68.  
  69.     $db->updateSkills($skills, $remain, $p[0] . '' . $p[1] . '' . $p[2] . '' . $p[3], $jumper->id_jumper);
  70.     $db->onCampLvlUp($pe, $changes[4], $jumper->id_jumper);
  71. }
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top