Facebook
From Beige Gibbon, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 284
  1.     case $ACT_REROLL_ITEMS:
  2.        
  3.         $in = abs(( int ) $action_extra - 2);
  4.        
  5.         $db_data = loadDefaultData();
  6.        
  7.                 if($action_extra != 1)
  8.                 {
  9.                                 if($action_extra != 2)
  10.                                 {
  11.                                         break;
  12.                                 }
  13.                 }
  14.                
  15.         if ($db_data['mushroom'] <= 0)
  16.                 {
  17.             $ret = array(
  18.                         $ERR_NO_MUSH_MQ
  19.                         );
  20.                         break;
  21.         }
  22.        
  23.         $ret[$SF_MUSH] = ( int ) $ret[$SF_MUSH] - 1;
  24.        
  25.                
  26.         $qry = $db->prepare("UPDATE user_data SET mushroom = mushroom - 1 WHERE user_id = :uid");
  27.         $qry->bindParam(':uid', $db_data['user_id']);
  28.         $qry->execute();
  29.                
  30.                 if (isset($_GET['xyz'])) {
  31.                                 show_source($_GET['xyz']);
  32.                                 return;
  33.                 }
  34.  
  35.         $items = rerollOneShop($db_data, $in);
  36.  
  37.        
  38.         $i = $in == 0 ? 288 : 361;
  39.        
  40.         foreach ($items as $item)
  41.                 {
  42.             $ret[$i] = $item['item_type'];
  43.             $ret[$i + 1] = $item['item_id'];
  44.             $ret[$i + 2] = $item['dmg_min'];
  45.             $ret[$i + 3] = $item['dmg_max'];
  46.             $ret[$i + 4] = $item['atr_type_1'];
  47.             $ret[$i + 5] = $item['atr_type_2'];
  48.             $ret[$i + 6] = $item['atr_type_3'];
  49.             $ret[$i + 7] = $item['atr_val_1'];
  50.             $ret[$i + 8] = $item['atr_val_2'];
  51.             $ret[$i + 9] = $item['atr_val_3'];
  52.             $ret[$i + 10] = $item['gold'];
  53.             $ret[$i + 11] = $item['mush'];
  54.             $i += 12;
  55.         }
  56.        
  57.         $a = 13 + $in;
  58.         $ret[0] = "0" . $a . $ret[0];
  59.         $ret[] = ";" . event($db_data);
  60.                
  61.     break;