Advertisement
erinx

mod quest

Sep 22nd, 2015
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 96.73 KB | None | 0 0
  1. <?php
  2. header("Content-type: text/html; charset=utf-8");
  3.  
  4. function genImage($knight, $paladin, $sorc, $druid, $beast, $players, $array){
  5.    
  6.   function imagettfstroketext(&$image, $size, $angle, $x, $y, &$textcolor, &$strokecolor, $fontfile, $text, $px){
  7.     for($c1 = ($x-abs($px)); $c1 <= ($x+abs($px)); $c1++)
  8.     for($c2 = ($y-abs($px)); $c2 <= ($y+abs($px)); $c2++)
  9.     $bg = imagettftext($image, $size, $angle, $c1, $c2, $strokecolor, $fontfile, $text);
  10.     return imagettftext($image, $size, $angle, $x, $y, $textcolor, $fontfile, $text);
  11.   }
  12.    
  13.   $imgpath = 'rpgimg/';
  14.  
  15.   $stackpath = 'http://erin.wtf/stacks/';  
  16.  
  17.   if($players > 2){
  18.     $img = imagecreatetruecolor(323, 340);
  19.   }else{
  20.     $img = imagecreatetruecolor(323, 224);  
  21.   }
  22.   imagesavealpha($img, true);
  23.  
  24.   $trans_colour = imagecolorallocatealpha($img, 203, 203, 203, 0);
  25.   $trans_colourb = imagecolorallocatealpha($img, 100, 100, 100, 0);  
  26.  
  27.   $border = imagecolorallocate($img, 40, 40, 40);
  28.  
  29.   $tile = imagecreatefrompng($imgpath . 'tile3.png');
  30.  
  31.   imagesettile($img, $tile);
  32.  
  33.   if($players > 2){
  34.     imagefilledrectangle($img, 2, 2, 319, 336, IMG_COLOR_TILED);
  35.   }else{
  36.     imagefilledrectangle($img, 2, 2, 319, 220, IMG_COLOR_TILED);
  37.   }
  38.  
  39.   $stroke_color = imagecolorallocate($img, 0, 0, 0);
  40.   $text_color = imagecolorallocate($img, 255, 255, 255);
  41.  
  42.   $posY = 16;
  43.  
  44.   if($array[$knight]['hp'] > 0){
  45.     imagettfstroketext($img, 8, 0, 6, $posY, $text_color, $stroke_color, "Tahoma_Bold.ttf", 'Knight ' . $knight . '  HP '. $array[$knight]['hp'] . '/' . $array[$knight]['hp_max'], 1);
  46.     $src = imagecreatefrompng($imgpath . 'knight.png');
  47.     imagecopy($img, $src, 0, $posY - 4, 0, 0, 46, 46);
  48.   }else{
  49.     imagettfstroketext($img, 8, 0, 6, $posY, $text_color, $stroke_color, "Tahoma_Bold.ttf", 'Knight ' . $knight . '  [Dead]', 1);
  50.     $src = imagecreatefrompng($imgpath . 'dead.png');
  51.     imagecopy($img, $src, 16, $posY + 9, 0, 0, 32, 32);  
  52.   }
  53.  
  54.   imagefilledrectangle($img, 54, $posY + 5, 283, $posY + 44, $trans_colourb);
  55.  
  56.   imagefilledrectangle($img, 56, $posY + 7, 91, $posY + 42, $border);
  57.   imagefilledrectangle($img, 58, $posY + 9, 90, $posY + 41, $trans_colourb);  
  58.   $src = imagecreatefrompng($imgpath . $array[$knight]['set'] . '_helmet.png');
  59.   imagecopy($img, $src, 58, $posY + 9, 0, 0, 32, 32);
  60.  
  61.   imagefilledrectangle($img, 94, $posY + 7, 129, $posY + 42, $border);
  62.   imagefilledrectangle($img, 96, $posY + 9, 128, $posY + 41, $trans_colourb);  
  63.   $src = imagecreatefrompng($imgpath . $array[$knight]['set'] . '_armor.png');
  64.   imagecopy($img, $src, 96, $posY + 9, 0, 0, 32, 32);
  65.    
  66.   imagefilledrectangle($img, 132, $posY + 7, 167, $posY + 42, $border);
  67.   imagefilledrectangle($img, 134, $posY + 9, 166, $posY + 41, $trans_colourb);  
  68.   $src = imagecreatefrompng($imgpath . $array[$knight]['set'] . '_legs.png');
  69.   imagecopy($img, $src, 134, $posY + 9, 0, 0, 32, 32);
  70.  
  71.   imagefilledrectangle($img, 170, $posY + 7, 205, $posY + 42, $border);
  72.   imagefilledrectangle($img, 172, $posY + 9, 204, $posY + 41, $trans_colourb);
  73.   $src = imagecreatefrompng($imgpath . $array[$knight]['set'] . '_boots.png');
  74.   imagecopy($img, $src, 172, $posY + 9, 0, 0, 32, 32);
  75.  
  76.   imagefilledrectangle($img, 208, $posY + 7, 243, $posY + 42, $border);
  77.   imagefilledrectangle($img, 210, $posY + 9, 242, $posY + 41, $trans_colourb);
  78.   $src = imagecreatefrompng($imgpath . $array[$knight]['set'] . '_sword.png');
  79.   imagecopy($img, $src, 210, $posY + 9, 0, 0, 32, 32);
  80.  
  81.   imagefilledrectangle($img, 246, $posY + 7, 281, $posY + 42, $border);
  82.   imagefilledrectangle($img, 248, $posY + 9, 280, $posY + 41, $trans_colourb);
  83.   $src = imagecreatefrompng($imgpath . $array[$knight]['set'] . '_shield.png');
  84.   imagecopy($img, $src, 248, $posY + 9, 0, 0, 32, 32);  
  85.  
  86.   $posY += 59;
  87.  
  88.   if($array[$paladin]['hp'] > 0){
  89.     imagettfstroketext($img, 8, 0, 6, $posY, $text_color, $stroke_color, "Tahoma_Bold.ttf", 'Paladin ' . $paladin . '  HP '. $array[$paladin]['hp'] . '/' . $array[$paladin]['hp_max'] . '  Mana '. $array[$paladin]['mana'] . '/' . $array[$paladin]['mana_max'], 1);
  90.     $src = imagecreatefrompng($imgpath . 'paladin.png');
  91.     imagecopy($img, $src, 0, $posY - 4, 0, 0, 46, 46);
  92.   }else{
  93.     imagettfstroketext($img, 8, 0, 6, $posY, $text_color, $stroke_color, "Tahoma_Bold.ttf", 'Paladin ' . $paladin . '  [Dead]', 1);
  94.     $src = imagecreatefrompng($imgpath . 'dead.png');
  95.     imagecopy($img, $src, 16, $posY + 9, 0, 0, 32, 32);
  96.   }
  97.  
  98.   imagefilledrectangle($img, 54, $posY + 5, 283, $posY + 44, $trans_colourb);
  99.  
  100.   imagefilledrectangle($img, 56, $posY + 7, 91, $posY + 42, $border);
  101.   imagefilledrectangle($img, 58, $posY + 9, 90, $posY + 41, $trans_colourb);
  102.   $src = imagecreatefrompng($imgpath . $array[$paladin]['set'] . '_hood.png');
  103.   imagecopy($img, $src, 58, $posY + 9, 0, 0, 32, 32);
  104.  
  105.   imagefilledrectangle($img, 94, $posY + 7, 129, $posY + 42, $border);
  106.   imagefilledrectangle($img, 96, $posY + 9, 128, $posY + 41, $trans_colourb);  
  107.   $src = imagecreatefrompng($imgpath . $array[$paladin]['set'] . '_tunic.png');
  108.   imagecopy($img, $src, 96, $posY + 9, 0, 0, 32, 32);
  109.    
  110.   imagefilledrectangle($img, 132, $posY + 7, 167, $posY + 42, $border);
  111.   imagefilledrectangle($img, 134, $posY + 9, 166, $posY + 41, $trans_colourb);  
  112.   $src = imagecreatefrompng($imgpath . $array[$paladin]['set'] . '_pants.png');
  113.   imagecopy($img, $src, 134, $posY + 9, 0, 0, 32, 32);
  114.  
  115.   imagefilledrectangle($img, 170, $posY + 7, 205, $posY + 42, $border);
  116.   imagefilledrectangle($img, 172, $posY + 9, 204, $posY + 41, $trans_colourb);
  117.   $src = imagecreatefrompng($imgpath . $array[$paladin]['set'] . '_shoes.png');
  118.   imagecopy($img, $src, 172, $posY + 9, 0, 0, 32, 32);
  119.  
  120.   imagefilledrectangle($img, 208, $posY + 7, 243, $posY + 42, $border);
  121.   imagefilledrectangle($img, 210, $posY + 9, 242, $posY + 41, $trans_colourb);
  122.   $src = imagecreatefrompng($imgpath . $array[$paladin]['set'] . '_bow.png');
  123.   imagecopy($img, $src, 210, $posY + 9, 0, 0, 32, 32);
  124.  
  125.   imagefilledrectangle($img, 246, $posY + 7, 281, $posY + 42, $border);
  126.   imagefilledrectangle($img, 248, $posY + 9, 280, $posY + 41, $trans_colourb);
  127.   $src = imagecreatefrompng($imgpath . $array[$paladin]['set'] . '_arrow.png');
  128.   imagecopy($img, $src, 248, $posY + 9, 0, 0, 32, 32);
  129.  
  130.   $posY += 59;  
  131.  
  132.  
  133.   if($players > 2){
  134.  
  135.  
  136.   if($array[$sorc]['hp'] > 0){
  137.     imagettfstroketext($img, 8, 0, 6, $posY, $text_color, $stroke_color, "Tahoma_Bold.ttf", 'Sorcerer ' . $sorc . '  HP '. $array[$sorc]['hp'] . '/' . $array[$sorc]['hp_max'] . '  Mana '. $array[$sorc]['mana'] . '/' . $array[$sorc]['mana_max'], 1);
  138.     $src = imagecreatefrompng($imgpath . 'sorcerer.png');
  139.     imagecopy($img, $src, 0, $posY - 4, 0, 0, 46, 46);
  140.   }else{
  141.     imagettfstroketext($img, 8, 0, 6, $posY, $text_color, $stroke_color, "Tahoma_Bold.ttf", 'Sorcerer ' . $sorc . '  [Dead]', 1);
  142.     $src = imagecreatefrompng($imgpath . 'dead.png');
  143.     imagecopy($img, $src, 16, $posY + 9, 0, 0, 32, 32);
  144.   }
  145.  
  146.   imagefilledrectangle($img, 54, $posY + 5, 283, $posY + 44, $trans_colourb);
  147.  
  148.   imagefilledrectangle($img, 56, $posY + 7, 91, $posY + 42, $border);
  149.   imagefilledrectangle($img, 58, $posY + 9, 90, $posY + 41, $trans_colourb);
  150.   $src = imagecreatefrompng($imgpath . $array[$sorc]['set'] . '_cap.png');
  151.   imagecopy($img, $src, 58, $posY + 9, 0, 0, 32, 32);
  152.  
  153.   imagefilledrectangle($img, 94, $posY + 7, 129, $posY + 42, $border);
  154.   imagefilledrectangle($img, 96, $posY + 9, 128, $posY + 41, $trans_colourb);  
  155.   $src = imagecreatefrompng($imgpath . $array[$sorc]['set'] . '_cape.png');
  156.   imagecopy($img, $src, 96, $posY + 9, 0, 0, 32, 32);
  157.    
  158.   imagefilledrectangle($img, 132, $posY + 7, 167, $posY + 42, $border);
  159.   imagefilledrectangle($img, 134, $posY + 9, 166, $posY + 41, $trans_colourb);  
  160.   $src = imagecreatefrompng($imgpath . $array[$sorc]['set'] . '_shorts.png');
  161.   imagecopy($img, $src, 134, $posY + 9, 0, 0, 32, 32);
  162.  
  163.   imagefilledrectangle($img, 170, $posY + 7, 205, $posY + 42, $border);
  164.   imagefilledrectangle($img, 172, $posY + 9, 204, $posY + 41, $trans_colourb);
  165.   $src = imagecreatefrompng($imgpath . $array[$sorc]['set'] . '_slippers.png');
  166.   imagecopy($img, $src, 172, $posY + 9, 0, 0, 32, 32);
  167.  
  168.   imagefilledrectangle($img, 208, $posY + 7, 243, $posY + 42, $border);
  169.   imagefilledrectangle($img, 210, $posY + 9, 242, $posY + 41, $trans_colourb);
  170.   $src = imagecreatefrompng($imgpath . $array[$sorc]['set'] . '_wand.png');
  171.   imagecopy($img, $src, 210, $posY + 9, 0, 0, 32, 32);
  172.  
  173.   imagefilledrectangle($img, 246, $posY + 7, 281, $posY + 42, $border);
  174.   imagefilledrectangle($img, 248, $posY + 9, 280, $posY + 41, $trans_colourb);
  175.   $src = imagecreatefrompng($imgpath . $array[$sorc]['set'] . '_tome.png');
  176.   imagecopy($img, $src, 248, $posY + 9, 0, 0, 32, 32);
  177.  
  178.   $posY += 59;
  179.  
  180.   if($array[$druid]['hp'] > 0){
  181.     imagettfstroketext($img, 8, 0, 6, $posY, $text_color, $stroke_color, "Tahoma_Bold.ttf", 'Druid ' . $druid . '  HP '. $array[$druid]['hp'] . '/' . $array[$druid]['hp_max'] . '  Mana '. $array[$druid]['mana'] . '/' . $array[$druid]['mana_max'], 1);
  182.     $src = imagecreatefrompng($imgpath . 'druid.png');
  183.     imagecopy($img, $src, 0, $posY - 4, 0, 0, 46, 46);
  184.   }else{
  185.     imagettfstroketext($img, 8, 0, 6, $posY, $text_color, $stroke_color, "Tahoma_Bold.ttf", 'Druid ' . $druid . '  [Dead]', 1);
  186.     $src = imagecreatefrompng($imgpath . 'dead.png');
  187.     imagecopy($img, $src, 16, $posY + 9, 0, 0, 32, 32);
  188.   }
  189.  
  190.   imagefilledrectangle($img, 54, $posY + 5, 283, $posY + 44, $trans_colourb);
  191.  
  192.   imagefilledrectangle($img, 56, $posY + 7, 91, $posY + 42, $border);
  193.   imagefilledrectangle($img, 58, $posY + 9, 90, $posY + 41, $trans_colourb);
  194.   $src = imagecreatefrompng($imgpath . $array[$druid]['set'] . '_hat.png');
  195.   imagecopy($img, $src, 58, $posY + 9, 0, 0, 32, 32);
  196.  
  197.   imagefilledrectangle($img, 94, $posY + 7, 129, $posY + 42, $border);
  198.   imagefilledrectangle($img, 96, $posY + 9, 128, $posY + 41, $trans_colourb);  
  199.   $src = imagecreatefrompng($imgpath . $array[$druid]['set'] . '_robe.png');
  200.   imagecopy($img, $src, 96, $posY + 9, 0, 0, 32, 32);
  201.    
  202.   imagefilledrectangle($img, 132, $posY + 7, 167, $posY + 42, $border);
  203.   imagefilledrectangle($img, 134, $posY + 9, 166, $posY + 41, $trans_colourb);  
  204.   $src = imagecreatefrompng($imgpath . $array[$druid]['set'] . '_kilt.png');
  205.   imagecopy($img, $src, 134, $posY + 9, 0, 0, 32, 32);
  206.  
  207.   imagefilledrectangle($img, 170, $posY + 7, 205, $posY + 42, $border);
  208.   imagefilledrectangle($img, 172, $posY + 9, 204, $posY + 41, $trans_colourb);
  209.   $src = imagecreatefrompng($imgpath . $array[$druid]['set'] . '_sandals.png');
  210.   imagecopy($img, $src, 172, $posY + 9, 0, 0, 32, 32);
  211.  
  212.   imagefilledrectangle($img, 208, $posY + 7, 243, $posY + 42, $border);
  213.   imagefilledrectangle($img, 210, $posY + 9, 242, $posY + 41, $trans_colourb);
  214.   $src = imagecreatefrompng($imgpath . $array[$druid]['set'] . '_rod.png');
  215.   imagecopy($img, $src, 210, $posY + 9, 0, 0, 32, 32);
  216.  
  217.   imagefilledrectangle($img, 246, $posY + 7, 281, $posY + 42, $border);
  218.   imagefilledrectangle($img, 248, $posY + 9, 280, $posY + 41, $trans_colourb);
  219.   $src = imagecreatefrompng($imgpath . $array[$druid]['set'] . '_book.png');
  220.   imagecopy($img, $src, 248, $posY + 9, 0, 0, 32, 32);
  221.  
  222.   $posY += 59;
  223.  
  224.   }
  225.  
  226.   if($players > 2){
  227.     $xPosition = 94;
  228.     $yPosition = 292;
  229.   }else{
  230.     $xPosition = 94;
  231.     $yPosition = 175;
  232.   }
  233.  
  234.   if($array['monsters'][$beast]['hp'] > 0){
  235.     imagettfstroketext($img, 8, 0, 6, $yPosition - 39, $text_color, $stroke_color, "Tahoma_Bold.ttf", 'Monster: ' . ucfirst($beast) . '  HP '. $array['monsters'][$beast]['hp'] . '/' . $array['monsters'][$beast]['hp_max'], 1);
  236.     $src = imagecreatefrompng($imgpath . $array['monsters'][$beast]['img']);
  237.     imagecopy($img, $src, 6, $yPosition - 30, 0, 0, $array['monsters'][$beast]['size'], $array['monsters'][$beast]['size']);    
  238.   }else{
  239.     imagettfstroketext($img, 8, 0, 6, $yPosition - 39, $text_color, $stroke_color, "Tahoma_Bold.ttf", 'Monster: ' . ucfirst($beast) . '  [Dead]', 1);
  240.     $src = imagecreatefrompng($imgpath . "dead_" . $array['monsters'][$beast]['img']);
  241.     imagecopy($img, $src, 6, $yPosition - 30, 0, 0, $array['monsters'][$beast]['size'], $array['monsters'][$beast]['size']);
  242.   }
  243.  
  244.   imagefilledrectangle($img, $xPosition - 2, $yPosition - 32, $xPosition + 75, $yPosition - 1, $trans_colourb);
  245.   imagefilledrectangle($img, $xPosition, $yPosition - 18, $xPosition + 73, $yPosition + 7, $border);
  246.   imagefilledrectangle($img, $xPosition + 2, $yPosition - 16, $xPosition + 72, $yPosition - 4, $trans_colourb);
  247.   imagettfstroketext($img, 8, 0, $xPosition + 15, $yPosition - 21, $text_color, $stroke_color, "Tahoma_Bold.ttf", 'Status', 1);
  248.  
  249.   $statuspos = 98;
  250.  
  251.   if($array['monsters'][$beast]['frozen'] == true){
  252.     $src = imagecreatefrompng($imgpath . "frozen.png");
  253.     imagecopy($img, $src, $statuspos, $yPosition - 15, 0, 0, 11, 11);
  254.     $statuspos = $statuspos + 12;    
  255.   }
  256.  
  257.   if($array['monsters'][$beast]['burned'] == true){
  258.     $src = imagecreatefrompng($imgpath . "burned.png");
  259.     imagecopy($img, $src, $statuspos, $yPosition - 15, 0, 0, 11, 11);
  260.     $statuspos = $statuspos + 12;    
  261.   }
  262.  
  263.   if($array['monsters'][$beast]['poisoned'] == true){
  264.     $src = imagecreatefrompng($imgpath . "poisoned.png");
  265.     imagecopy($img, $src, $statuspos, $yPosition - 15, 0, 0, 11, 11);
  266.     $statuspos = $statuspos + 12;    
  267.   }
  268.  
  269.   $ps = intval(intval($array['monsters'][$beast]['loot'])/100);  
  270.   $gs = intval(intval($array['monsters'][$beast]['loot'])%100);
  271.  
  272.   if($ps >= 1){
  273.     imagefilledrectangle($img, $xPosition - 2, $yPosition - 2, $xPosition + 37, $yPosition + 37, $trans_colourb);
  274.     imagefilledrectangle($img, $xPosition, $yPosition, $xPosition + 35, $yPosition + 35, $border);
  275.     imagefilledrectangle($img, $xPosition + 2, $yPosition + 2, $xPosition + 34, $yPosition + 34, $trans_colourb);
  276.     if($ps >= 50){
  277.       $src = imagecreatefrompng($stackpath . 'p-50-100.png');
  278.       imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
  279.       if($ps == 100){
  280.         imagettfstroketext($img, 8, 0, $xPosition + 11, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $ps, 1);
  281.       }else{
  282.         imagettfstroketext($img, 8, 0, $xPosition + 18, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $ps, 1);
  283.       }
  284.     }else if($ps >= 25){
  285.       $src = imagecreatefrompng($stackpath . 'p-25-49.png');
  286.       imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
  287.       imagettfstroketext($img, 8, 0, $xPosition + 18, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $ps, 1);
  288.     }else if($ps >= 10){
  289.       $src = imagecreatefrompng($stackpath . 'p-10-24.png');
  290.       imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
  291.       imagettfstroketext($img, 8, 0, $xPosition + 18, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $ps, 1);
  292.     }else if($ps >= 5){
  293.       $src = imagecreatefrompng($stackpath . 'p-5-9.png');
  294.       imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
  295.       imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $ps, 1);
  296.     }else if($ps == 4){
  297.       $src = imagecreatefrompng($stackpath . 'p-4.png');
  298.       imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
  299.       imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $ps, 1);
  300.     }else if($ps == 3){
  301.       $src = imagecreatefrompng($stackpath . 'p-3.png');
  302.       imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
  303.       imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $ps, 1);
  304.     }else if($ps == 2){
  305.       $src = imagecreatefrompng($stackpath . 'p-2.png');
  306.       imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
  307.       imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $ps, 1);
  308.     }else if($ps == 1){
  309.       $src = imagecreatefrompng($stackpath . 'p-1.png');
  310.       imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
  311.       imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $ps, 1);
  312.     }
  313.   }
  314.  
  315.   $xPosition += 38;
  316.   imagefilledrectangle($img, $xPosition - 2, $yPosition - 2, $xPosition + 37, $yPosition + 37, $trans_colourb);
  317.   imagefilledrectangle($img, $xPosition, $yPosition, $xPosition + 35, $yPosition + 35, $border);
  318.   imagefilledrectangle($img, $xPosition + 2, $yPosition + 2, $xPosition + 34, $yPosition + 34, $trans_colourb);  
  319.  
  320.   if($gs >= 1){
  321.     if($gs >= 50){
  322.       $src = imagecreatefrompng($stackpath . 'g-50-100.png');
  323.       imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
  324.       if($ps == 100){
  325.         imagettfstroketext($img, 8, 0, $xPosition + 11, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $gs, 1);
  326.       }else{
  327.         imagettfstroketext($img, 8, 0, $xPosition + 18, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $gs, 1);
  328.       }
  329.     }else if($gs >= 25){
  330.       $src = imagecreatefrompng($stackpath . 'g-25-49.png');
  331.       imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
  332.       imagettfstroketext($img, 8, 0, $xPosition + 18, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $gs, 1);
  333.     }else if($gs >= 10){
  334.       $src = imagecreatefrompng($stackpath . 'g-10-24.png');
  335.       imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
  336.       imagettfstroketext($img, 8, 0, $xPosition + 18, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $gs, 1);
  337.     }else if($gs >= 5){
  338.       $src = imagecreatefrompng($stackpath . 'g-5-9.png');
  339.       imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
  340.       imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $gs, 1);
  341.     }else if($gs == 4){
  342.       $src = imagecreatefrompng($stackpath . 'g-4.png');
  343.       imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
  344.       imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $gs, 1);
  345.     }else if($gs == 3){
  346.       $src = imagecreatefrompng($stackpath . 'g-3.png');
  347.       imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
  348.       imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $gs, 1);
  349.     }else if($gs == 2){
  350.       $src = imagecreatefrompng($stackpath . 'g-2.png');
  351.       imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
  352.       imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $gs, 1);
  353.     }else if($gs == 1){
  354.       $src = imagecreatefrompng($stackpath . 'g-1.png');
  355.       imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
  356.       imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $gs, 1);
  357.     }
  358.   }
  359.  
  360.  
  361.   if($players > 2){
  362.     imagettfstroketext($img, 8, 0, 215, 330, $trans_colour, $stroke_color, "Tahoma_Bold.ttf", '/Animus/ Quest', 1);
  363.   }else{
  364.    imagettfstroketext($img, 8, 0, 215, 214, $trans_colour, $stroke_color, "Tahoma_Bold.ttf", '/Animus/ Quest', 1);
  365.   }
  366.  
  367.  
  368.   imagepng($img, "gameimg.png");   
  369.  
  370.  
  371.   imagecolordeallocate($img, $stroke_color);
  372.   imagecolordeallocate($img, $text_color);  
  373.   imagecolordeallocate($img, $trans_colour);
  374.   imagecolordeallocate($img, $trans_colourb);
  375.   imagecolordeallocate($img, $border);
  376.   imagedestroy($img);  
  377.    
  378. }
  379.  
  380. function postComDraw($thisCom, $thread, $oP, $tkey, $postvideo, $tBoard){
  381.   $chanDomain = '8ch.net';
  382.   $output = '';
  383.   if($oP == true){
  384.     $postSub = '[SKYNET 2.1 OP]';
  385.   }else{
  386.     $postSub = '[SKYNET 2.1]';
  387.   }
  388.   if(!$tBoard || $tBoard == false){
  389.     $tBoard = 'animus';
  390.   }
  391.   $ch = curl_init();
  392.   curl_setopt($ch, CURLOPT_URL, "http://" . $chanDomain . "/post.php");
  393.   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  394.   curl_setopt($ch, CURLOPT_POST, true);
  395.   curl_setopt($ch, CURLOPT_REFERER, 'http://' . $chanDomain . '/' . $tBoard . '/res/' . $thread . '.html');
  396.   $data = array(
  397.     'json_response' => '0',
  398.     'post' => 'on',
  399.     'q' => '',
  400.     'board' => $tBoard,
  401.     'name' => "server@erin.wtf ".$tkey,
  402.     'email' => '',
  403.     'password' => '',
  404.     'subject' => $postSub,
  405.     'body' => $thisCom,
  406.   );
  407.  
  408.   if(!$postvideo || $postvideo == false){
  409.     $data['file'] = '@' . realpath('gameimg.png');
  410.   }else{
  411.     $data['embed'] = $postvideo;
  412.   }
  413.  
  414.   if($thread != '0'){
  415.     $data['thread'] = $thread;
  416.   }
  417.   curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  418.   $output .= curl_exec($ch);
  419.   curl_close($ch);
  420.   return $output;
  421. }
  422.  
  423.  
  424.  
  425.  
  426. $moduleText = $post['com'];
  427. $moduleText = strip_tags($moduleText);
  428. $moduleText = explode('skynet.'.$module.': ', $moduleText)[1];
  429. $moduleText = preg_replace('/&gt;/', '>', $moduleText);
  430. $moduleText = preg_replace('/&lt;/', '<', $moduleText);
  431. $moduleText = explode(';', $moduleText)[0];
  432.  
  433. $gamelog = 'skynet_quest.txt';
  434. $currentgame = json_decode(file_get_contents($gamelog), true);
  435.  
  436.  
  437. if($currentgame['knight'] == 'none' && $currentgame['paladin'] == none && $post['trip']){
  438.  
  439.   if($moduleText == 'paladin'){
  440.     $data = array();
  441.     $data['paladin'] = $post['trip'];
  442.     $data['knight'] = 'none';
  443.     file_put_contents($gamelog, json_encode($data));
  444.     $response = postCom(">>" . $post['no'] . PHP_EOL . "Game open." . PHP_EOL . "Please wait for a knight to join.", $net['thread'], false, $net['servKey'], false, false);
  445.   }else if($moduleText == 'knight'){
  446.     $data = array();
  447.     $data['paladin'] = 'none';
  448.     $data['knight'] = $post['trip'];
  449.     file_put_contents($gamelog, json_encode($data));
  450.     $response = postCom(">>" . $post['no'] . PHP_EOL . "Game open." . PHP_EOL . "Please wait for a paladin to join.", $net['thread'], false, $net['servKey'], false, false);
  451.   }else{   
  452.     $response = postCom(">>" . $post['no'] . PHP_EOL . "Please respond with your chosen class." . PHP_EOL . "eg. ''skynet.quest: paladin;'' or ''skynet.quest: knight;''", $net['thread'], false, $net['servKey'], false, false);
  453.   }
  454.        
  455. }else if($currentgame['knight'] == 'none' && $post['trip'] || $currentgame['paladin'] == none && $post['trip']){
  456.    
  457.   if($currentgame['knight'] == 'none' && $post['trip'] != $currentgame['paladin']){
  458.     $currentgame['knight'] = $post['trip'];
  459.     file_put_contents($gamelog, json_encode($currentgame));
  460.   }else if($currentgame['paladin'] == 'none' && $post['trip'] != $currentgame['knight']){
  461.     $currentgame['paladin'] = $post['trip'];
  462.     file_put_contents($gamelog, json_encode($currentgame));
  463.   }else{
  464.     $response = postCom(">>" . $post['no'] . PHP_EOL . "You cannot play both classes.", $net['thread'], false, $net['servKey'], false, false);
  465.   }
  466.  
  467.   if($currentgame['knight'] != 'none' && $currentgame['paladin'] != 'none'){
  468.    
  469.     $data = array();
  470.  
  471.     $palitrip = $currentgame['paladin'];
  472.  
  473.     $knighttrip = $currentgame['knight'];
  474.  
  475.     $data['dead'] = 0;
  476.  
  477.     $data['paladin'] = $palitrip;
  478.  
  479.     $data['knight'] = $knighttrip;
  480.    
  481.     $data['sorcerer'] = 'xa';
  482.  
  483.     $data['druid'] = 'xa';
  484.  
  485.     $data[$palitrip] = array();
  486.       $data[$palitrip]['class'] = 'paladin';
  487.       $data[$palitrip]['hp_max'] = 100;
  488.       $data[$palitrip]['hp'] = 100;
  489.       $data[$palitrip]['mana_max'] = 125;
  490.       $data[$palitrip]['mana'] = 125;
  491.       $data[$palitrip]['set'] = 'basic';
  492.  
  493.     $data[$knighttrip] = array();
  494.       $data[$knighttrip]['class'] = 'knight';
  495.       $data[$knighttrip]['hp_max'] = 140;
  496.       $data[$knighttrip]['hp'] = 140;
  497.       $data[$knighttrip]['mana_max'] = 0;
  498.       $data[$knighttrip]['mana'] = 0;
  499.       $data[$knighttrip]['set'] = 'basic';
  500.      
  501.      
  502.     $data[$sorctrip] = array();
  503.       $data[$sorctrip]['class'] = 'sorcerer';
  504.       $data[$sorctrip]['hp_max'] = 70;
  505.       $data[$sorctrip]['hp'] = 70;
  506.       $data[$sorctrip]['mana_max'] = 250;
  507.       $data[$sorctrip]['mana'] = 250;
  508.       $data[$sorctrip]['set'] = 'basic';
  509.  
  510.     $data[$druidtrip] = array();
  511.       $data[$druidtrip]['class'] = 'druid';
  512.       $data[$druidtrip]['hp_max'] = 70;
  513.       $data[$druidtrip]['hp'] = 70;
  514.       $data[$druidtrip]['mana_max'] = 250;
  515.       $data[$druidtrip]['mana'] = 250;
  516.       $data[$druidtrip]['set'] = 'basic';
  517.    
  518.     $data['sets'] = array();
  519.       $data['sets']['basic'] = array();
  520.       $data['sets']['basic']['damage'] = 10;
  521.       $data['sets']['basic']['defense'] = 10;
  522.       $data['sets']['basic']['cost'] = 0;  
  523.     $data['sets']['good'] = array();
  524.       $data['sets']['good']['damage'] = 15;
  525.       $data['sets']['good']['defense'] = 15;
  526.       $data['sets']['good']['cost'] = 200;  
  527.     $data['sets']['great'] = array();
  528.       $data['sets']['great']['damage'] = 20;
  529.       $data['sets']['great']['defense'] = 20;
  530.       $data['sets']['great']['cost'] = 400;
  531.    
  532.     $data['spells'] = array();
  533.       $data['spells']['frigo'] = array();  
  534.         $data['spells']['frigo']['damage'] = 0;
  535.         $data['spells']['frigo']['status'] = 'frozen';
  536.         $data['spells']['frigo']['mana'] = 25;
  537.         $data['spells']['frigo']['turns'] = 3;
  538.       $data['spells']['gran_frigo'] = array();  
  539.         $data['spells']['gran_frigo']['damage'] = 0;
  540.         $data['spells']['gran_frigo']['status'] = 'frozen';
  541.         $data['spells']['gran_frigo']['mana'] = 40;
  542.         $data['spells']['gran_frigo']['turns'] = 5;
  543.       $data['spells']['exori_frigo'] = array();  
  544.         $data['spells']['exori_frigo']['damage'] = 30;
  545.         $data['spells']['exori_frigo']['status'] = 'frozen';
  546.         $data['spells']['exori_frigo']['mana'] = 40;
  547.         $data['spells']['exori_frigo']['turns'] = 3;
  548.       $data['spells']['flam'] = array();  
  549.         $data['spells']['flam']['damage'] = 0;
  550.         $data['spells']['flam']['status'] = 'burned';
  551.         $data['spells']['flam']['mana'] = 25;
  552.         $data['spells']['flam']['turns'] = 3;
  553.       $data['spells']['gran_flam'] = array();  
  554.         $data['spells']['gran_flam']['damage'] = 0;
  555.         $data['spells']['gran_flam']['status'] = 'burned';
  556.         $data['spells']['gran_flam']['mana'] = 40;
  557.         $data['spells']['gran_flam']['turns'] = 5;
  558.       $data['spells']['exori_flam'] = array();  
  559.         $data['spells']['exori_flam']['damage'] = 30;
  560.         $data['spells']['exori_flam']['status'] = 'burned';
  561.         $data['spells']['exori_flam']['mana'] = 40;
  562.         $data['spells']['exori_flam']['turns'] = 3;
  563.       $data['spells']['pox'] = array();  
  564.         $data['spells']['pox']['damage'] = 0;
  565.         $data['spells']['pox']['status'] = 'poisoned';
  566.         $data['spells']['pox']['mana'] = 25;
  567.         $data['spells']['pox']['turns'] = 3;
  568.       $data['spells']['gran_pox'] = array();  
  569.         $data['spells']['gran_pox']['damage'] = 0;
  570.         $data['spells']['gran_pox']['status'] = 'poisoned';
  571.         $data['spells']['gran_pox']['mana'] = 40;
  572.         $data['spells']['gran_pox']['turns'] = 5;
  573.       $data['spells']['exori_pox'] = array();  
  574.         $data['spells']['exori_pox']['damage'] = 30;
  575.         $data['spells']['exori_pox']['status'] = 'poisoned';
  576.         $data['spells']['exori_pox']['mana'] = 40;
  577.         $data['spells']['exori_pox']['turns'] = 3;    
  578.       $data['spells']['exori'] = array();  
  579.         $data['spells']['exori']['damage'] = 60;
  580.         $data['spells']['exori']['status'] = 'none';
  581.         $data['spells']['exori']['mana'] = 30;
  582.         $data['spells']['exori']['turns'] = 0;
  583.       $data['spells']['exori_mort'] = array();  
  584.         $data['spells']['exori_mort']['damage'] = 100;
  585.         $data['spells']['exori_mort']['status'] = 'none';
  586.         $data['spells']['exori_mort']['mana'] = 80;
  587.         $data['spells']['exori_mort']['turns'] = 0;
  588.       $data['spells']['exura'] = array();  
  589.         $data['spells']['exura']['damage'] = 20;
  590.         $data['spells']['exura']['status'] = 'none';
  591.         $data['spells']['exura']['mana'] = 20;
  592.         $data['spells']['exura']['turns'] = 0;
  593.       $data['spells']['exura_gran'] = array();  
  594.         $data['spells']['exura_gran']['damage'] = 50;
  595.         $data['spells']['exura_gran']['status'] = 'none';
  596.         $data['spells']['exura_gran']['mana'] = 40;
  597.         $data['spells']['exura_gran']['turns'] = 0;
  598.       $data['spells']['exura_mas'] = array();  
  599.         $data['spells']['exura_mas']['damage'] = 50;
  600.         $data['spells']['exura_mas']['status'] = 'none';
  601.         $data['spells']['exura_mas']['mana'] = 60;
  602.         $data['spells']['exura_mas']['turns'] = 0;  
  603.    
  604.  
  605.     $data['monsters'] = array();
  606.       $data['monsters']['dragon'] = array();
  607.         $data['monsters']['dragon']['hp_max'] = 300;
  608.         $data['monsters']['dragon']['hp'] = 300;
  609.         $data['monsters']['dragon']['max_damage'] = 55;
  610.         $data['monsters']['dragon']['min_damage'] = 15;
  611.         $data['monsters']['dragon']['img'] = 'dragon.png';
  612.         $data['monsters']['dragon']['size'] = 64;
  613.         $data['monsters']['dragon']['frozen'] = false;
  614.         $data['monsters']['dragon']['frozen_turns'] = 0;
  615.         $data['monsters']['dragon']['burned'] = false;
  616.         $data['monsters']['dragon']['burned_turns'] = 0;
  617.         $data['monsters']['dragon']['poisoned'] = false;
  618.         $data['monsters']['dragon']['poisoned_turns'] = 0;
  619.         $data['monsters']['dragon']['immune'] = 'burned';
  620.         $data['monsters']['dragon']['dead'] = false;
  621.         $data['monsters']['dragon']['loot_min'] = 400;
  622.         $data['monsters']['dragon']['loot_max'] = 600;
  623.         $data['monsters']['dragon']['loot'] = 0;
  624.       $data['monsters']['demon'] = array();  
  625.         $data['monsters']['demon']['hp_max'] = 400;
  626.         $data['monsters']['demon']['hp'] = 400;
  627.         $data['monsters']['demon']['max_damage'] = 60;
  628.         $data['monsters']['demon']['min_damage'] = 15;
  629.         $data['monsters']['demon']['img'] = 'demon.png';
  630.         $data['monsters']['demon']['size'] = 64;
  631.         $data['monsters']['demon']['frozen'] = false;
  632.         $data['monsters']['demon']['frozen_turns'] = 0;
  633.         $data['monsters']['demon']['burned'] = false;
  634.         $data['monsters']['demon']['burned_turns'] = 0;
  635.         $data['monsters']['demon']['poisoned'] = false;
  636.         $data['monsters']['demon']['poisoned_turns'] = 0;
  637.         $data['monsters']['demon']['immune'] = 'burned';
  638.         $data['monsters']['demon']['dead'] = false;
  639.         $data['monsters']['demon']['loot_min'] = 600;
  640.         $data['monsters']['demon']['loot_max'] = 1300;
  641.         $data['monsters']['demon']['loot'] = 0;        
  642.       $data['monsters']['braindeath'] = array();  
  643.         $data['monsters']['braindeath']['hp_max'] = 350;
  644.         $data['monsters']['braindeath']['hp'] = 350;
  645.         $data['monsters']['braindeath']['max_damage'] = 60;
  646.         $data['monsters']['braindeath']['min_damage'] = 5;
  647.         $data['monsters']['braindeath']['img'] = 'braindeath.png';
  648.         $data['monsters']['braindeath']['size'] = 64;
  649.         $data['monsters']['braindeath']['frozen'] = false;
  650.         $data['monsters']['braindeath']['frozen_turns'] = 0;
  651.         $data['monsters']['braindeath']['burned'] = false;
  652.         $data['monsters']['braindeath']['burned_turns'] = 0;
  653.         $data['monsters']['braindeath']['poisoned'] = false;
  654.         $data['monsters']['braindeath']['poisoned_turns'] = 0;
  655.         $data['monsters']['braindeath']['immune'] = 'poisoned';
  656.         $data['monsters']['braindeath']['dead'] = false;
  657.         $data['monsters']['braindeath']['loot_min'] = 500;
  658.         $data['monsters']['braindeath']['loot_max'] = 800;
  659.         $data['monsters']['braindeath']['loot'] = 0;
  660.       $data['monsters']['firelord'] = array();  
  661.         $data['monsters']['firelord']['hp_max'] = 400;
  662.         $data['monsters']['firelord']['hp'] = 400;
  663.         $data['monsters']['firelord']['max_damage'] = 50;
  664.         $data['monsters']['firelord']['min_damage'] = 15;
  665.         $data['monsters']['firelord']['img'] = 'lavalord.png';
  666.         $data['monsters']['firelord']['size'] = 64;
  667.         $data['monsters']['firelord']['frozen'] = false;
  668.         $data['monsters']['firelord']['frozen_turns'] = 0;
  669.         $data['monsters']['firelord']['burned'] = false;
  670.         $data['monsters']['firelord']['burned_turns'] = 0;
  671.         $data['monsters']['firelord']['poisoned'] = false;
  672.         $data['monsters']['firelord']['poisoned_turns'] = 0;
  673.         $data['monsters']['firelord']['immune'] = 'burned';
  674.         $data['monsters']['firelord']['dead'] = false;
  675.         $data['monsters']['firelord']['loot_min'] = 600;
  676.         $data['monsters']['firelord']['loot_max'] = 1000;
  677.         $data['monsters']['firelord']['loot'] = 0;
  678.       $data['monsters']['golem'] = array();  
  679.         $data['monsters']['golem']['hp_max'] = 250;
  680.         $data['monsters']['golem']['hp'] = 250;
  681.         $data['monsters']['golem']['max_damage'] = 55;
  682.         $data['monsters']['golem']['min_damage'] = 10;
  683.         $data['monsters']['golem']['img'] = 'golem.png';
  684.         $data['monsters']['golem']['size'] = 64;
  685.         $data['monsters']['golem']['frozen'] = false;
  686.         $data['monsters']['golem']['frozen_turns'] = 0;
  687.         $data['monsters']['golem']['burned'] = false;
  688.         $data['monsters']['golem']['burned_turns'] = 0;
  689.         $data['monsters']['golem']['poisoned'] = false;
  690.         $data['monsters']['golem']['poisoned_turns'] = 0;
  691.         $data['monsters']['golem']['immune'] = 'poisoned';
  692.         $data['monsters']['golem']['dead'] = false;
  693.         $data['monsters']['golem']['loot_min'] = 400;
  694.         $data['monsters']['golem']['loot_max'] = 700;
  695.         $data['monsters']['golem']['loot'] = 0;
  696.       $data['monsters']['icelord'] = array();  
  697.         $data['monsters']['icelord']['hp_max'] = 375;
  698.         $data['monsters']['icelord']['hp'] = 375;
  699.         $data['monsters']['icelord']['max_damage'] = 60;
  700.         $data['monsters']['icelord']['min_damage'] = 10;
  701.         $data['monsters']['icelord']['img'] = 'icelord.png';
  702.         $data['monsters']['icelord']['size'] = 64;
  703.         $data['monsters']['icelord']['frozen'] = false;
  704.         $data['monsters']['icelord']['frozen_turns'] = 0;
  705.         $data['monsters']['icelord']['burned'] = false;
  706.         $data['monsters']['icelord']['burned_turns'] = 0;
  707.         $data['monsters']['icelord']['poisoned'] = false;
  708.         $data['monsters']['icelord']['poisoned_turns'] = 0;
  709.         $data['monsters']['icelord']['immune'] = 'frozen';
  710.         $data['monsters']['icelord']['dead'] = false;
  711.         $data['monsters']['icelord']['loot_min'] = 700;
  712.         $data['monsters']['icelord']['loot_max'] = 1200;
  713.         $data['monsters']['icelord']['loot'] = 0;
  714.        
  715.                
  716.      $selectMonster = array('dragon', 'demon', 'braindeath', 'firelord', 'golem', 'icelord');        
  717.      
  718.      $monster = $selectMonster[array_rand($selectMonster)];
  719.        
  720.      $data['monster'] = $monster;
  721.      
  722.      $data['monsters'][$data['monster']]['loot'] = mt_rand($data['monsters'][$data['monster']]['loot_min'], $data['monsters'][$data['monster']]['loot_max']);
  723.  
  724.     file_put_contents($gamelog, json_encode($data));
  725.    
  726.     $currentgame = json_decode(file_get_contents($gamelog), true);
  727.        
  728.     genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  729.    
  730.     $response =  postComDraw(">>" . $post['no'] . PHP_EOL . "The quest has begun!" . PHP_EOL . "Decide who will attack first." . PHP_EOL . "The knight may use ''skynet.quest: attack;'' to attack." . PHP_EOL . "The paladin may use ''skynet.quest: attack;'' to attack, ''skynet.quest: frigo;'' for a freezing spell, or ''skynet.quest: exori;'' for a damage spell." . PHP_EOL . PHP_EOL . "If either player has money with the Bank of /Animus/, they may upgrade their set." . PHP_EOL . "Use ''skynet.quest: good set;'' to buy the good set for ₲" . $currentgame['sets']['good']['cost'] . ", or ''skynet.quest: great set;'' to buy the great set for ₲" . $currentgame['sets']['great']['cost'] . ".", $net['thread'], false, $net['servKey'], false, $getboard);
  731.    
  732.   }
  733.    
  734. }else if(!$post['trip']){
  735.    
  736.   $response = postCom(">>" . $post['no'] . PHP_EOL . "a tripcode is required to play this game.", $net['thread'], false, $net['servKey'], false, false);
  737.  
  738. }else if($currentgame['knight'] == $post['trip']  && $moduleText == 'good set' || $currentgame['paladin'] == $post['trip'] && $moduleText == 'good set'){
  739.    
  740.   if($currentgame[$post['trip']]['set'] == 'basic'){
  741.     $bankapi = json_decode(file_get_contents('http://erin.wtf/securebank?p=&t='.urlencode($post['trip'])), true);
  742.     if(!$bankapi['error'] && $bankapi['balance'] >= $currentgame['sets']['good']['cost']){
  743.       $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $currentgame['sets']['good']['cost'] . "&p=&t=" . urlencode($post['trip']) . "&r=" . urlencode('!Bank..5Wfo')), true);
  744.       if(!$bankapix['error']){
  745.         $currentgame[$post['trip']]['set'] = 'good';
  746.         genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  747.         $response =  postComDraw(">>" . $post['no'] . PHP_EOL . "You bought the good set for " . $bankapix['formatted'] . ".", $net['thread'], false, $net['servKey'], false, $getboard);
  748.         file_put_contents($gamelog, json_encode($currentgame));
  749.       }else{
  750.         genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  751.         $response =  postComDraw(">>" . $post['no'] . PHP_EOL . "There was an error:" . PHP_EOL . $bankapix['error'], $net['thread'], false, $net['servKey'], false, $getboard);
  752.         file_put_contents($gamelog, json_encode($currentgame));
  753.       }
  754.     }else{
  755.       genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  756.       $response =  postComDraw(">>" . $post['no'] . PHP_EOL . "You can not afford this set!", $net['thread'], false, $net['servKey'], false, $getboard);
  757.       file_put_contents($gamelog, json_encode($currentgame));
  758.     }  
  759.   }else{
  760.     genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  761.     $response =  postComDraw(">>" . $post['no'] . PHP_EOL . "This is no better than your current set.", $net['thread'], false, $net['servKey'], false, $getboard);
  762.     file_put_contents($gamelog, json_encode($currentgame));
  763.   }  
  764. }else if($currentgame['knight'] == $post['trip']  && $moduleText == 'great set' || $currentgame['paladin'] == $post['trip'] && $moduleText == 'great set'){
  765.   if($currentgame[$post['trip']]['set'] == 'basic' || $currentgame[$post['trip']]['set'] == 'good'){
  766.     $bankapi = json_decode(file_get_contents('http://erin.wtf/securebank?p=&t='.urlencode($post['trip'])), true);
  767.     if(!$bankapi['error'] && $bankapi['balance'] >= $currentgame['sets']['great']['cost']){
  768.       $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $currentgame['sets']['great']['cost'] . "&p=&t=" . urlencode($post['trip']) . "&r=" . urlencode('!Bank..5Wfo')), true);
  769.       if(!$bankapix['error']){
  770.         $currentgame[$post['trip']]['set'] = 'great';
  771.         genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  772.         $response =  postComDraw(">>" . $post['no'] . PHP_EOL . "You bought the good set for " . $bankapix['formatted'] . ".", $net['thread'], false, $net['servKey'], false, $getboard);
  773.         file_put_contents($gamelog, json_encode($currentgame));
  774.       }else{
  775.         genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  776.         $response =  postComDraw(">>" . $post['no'] . PHP_EOL . "There was an error:" . PHP_EOL . $bankapix['error'], $net['thread'], false, $net['servKey'], false, $getboard);
  777.         file_put_contents($gamelog, json_encode($currentgame));
  778.       }
  779.     }else{
  780.       genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  781.       $response =  postComDraw(">>" . $post['no'] . PHP_EOL . "You can not afford this set!", $net['thread'], false, $net['servKey'], false, $getboard);
  782.       file_put_contents($gamelog, json_encode($currentgame));
  783.     }  
  784.   }else{
  785.     genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  786.     $response =  postComDraw(">>" . $post['no'] . PHP_EOL . "This is no better than your current set.", $net['thread'], false, $net['servKey'], false, $getboard);
  787.     file_put_contents($gamelog, json_encode($currentgame));
  788.   }  
  789.  
  790. }else if($currentgame['knight'] == $post['trip']){
  791.    
  792.   if($currentgame[$currentgame['knight']]['hp'] > 0){
  793.    
  794.     $statusDamage = 0;
  795.     $statusText = '';
  796.     if($currentgame['monsters'][$currentgame['monster']]['burned'] == true){
  797.       $burnDamage = 20;
  798.       $statusDamage += $burnDamage;
  799.       $currentgame['monsters'][$currentgame['monster']]['burned_turns']--;
  800.       $currentgame['monsters'][$currentgame['monster']]['hp'] = $currentgame['monsters'][$currentgame['monster']]['hp'] - $burnDamage;
  801.       $statusText += PHP_EOL . "Burn hurt the " . $currentgame['monster'] . " for " . $burnDamage . ".";
  802.       if($currentgame['monsters'][$currentgame['monster']]['burned_turns'] == 0){
  803.         $currentgame['monsters'][$currentgame['monster']]['burned'] = false;
  804.         $statusText += PHP_EOL . "Burn wore off.";
  805.       }
  806.       file_put_contents($gamelog, json_encode($currentgame));
  807.      
  808.       if($currentgame['monsters'][$currentgame['monster']]['hp'] <= 0){
  809.         genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  810.         $looted = intval($currentgame['monsters'][$currentgame['monster']]['loot']/2);          $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['knight'])), true);
  811.         $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['paladin'])), true);
  812.         $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The quest is over!" . PHP_EOL . "You have defeated the " . $currentgame['monster'] . "!" . PHP_EOL . "Each adventurer looted ₲" . $looted . " from the corpse.", $net['thread'], false, $net['servKey'], false, $getboard);
  813.         $data = array();
  814.         $data['paladin'] = 'none';
  815.         $data['knight'] = 'none';
  816.         file_put_contents($gamelog, json_encode($data));
  817.       }
  818.     }
  819.    
  820.     if($currentgame['monsters'][$currentgame['monster']]['poisoned'] == true){
  821.       $poisonDamage = 10*$currentgame['monsters'][$currentgame['monster']]['poisoned_turns'];
  822.       $statusDamage += $poisonDamage;
  823.       $currentgame['monsters'][$currentgame['monster']]['poisoned_turns']--;
  824.       $currentgame['monsters'][$currentgame['monster']]['hp'] = $currentgame['monsters'][$currentgame['monster']]['hp'] - $poisonDamage;
  825.       $statusText += PHP_EOL . "Poison hurt the " . $currentgame['monster'] . " for " . $poisonDamage . ".";
  826.       if($currentgame['monsters'][$currentgame['monster']]['poisoned_turns'] == 0){
  827.         $currentgame['monsters'][$currentgame['monster']]['poisoned'] = false;
  828.         $statusText += PHP_EOL . "Poison wore off.";
  829.       }
  830.       file_put_contents($gamelog, json_encode($currentgame));
  831.      
  832.       if($currentgame['monsters'][$currentgame['monster']]['hp'] <= 0){
  833.         genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  834.         $looted = intval($currentgame['monsters'][$currentgame['monster']]['loot']/2);          $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['knight'])), true);
  835.         $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['paladin'])), true);
  836.         $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The quest is over!" . PHP_EOL . "You have defeated the " . $currentgame['monster'] . "!" . PHP_EOL . "Each adventurer looted ₲" . $looted . " from the corpse.", $net['thread'], false, $net['servKey'], false, $getboard);
  837.         $data = array();
  838.         $data['paladin'] = 'none';
  839.         $data['knight'] = 'none';
  840.         file_put_contents($gamelog, json_encode($data));
  841.       }  
  842.  
  843.     }
  844.    
  845.     if($currentgame['monsters'][$currentgame['monster']]['hp'] > 0){
  846.     $attackDamage = mt_rand(1, 30) + $currentgame['sets'][$currentgame[$currentgame['knight']]['set']]['damage'];
  847.     $currentgame['monsters'][$currentgame['monster']]['hp'] = $currentgame['monsters'][$currentgame['monster']]['hp'] - $attackDamage;
  848.     if($currentgame['monsters'][$currentgame['monster']]['hp'] <= 0){
  849.       genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  850.       $looted = intval($currentgame['monsters'][$currentgame['monster']]['loot']/2);      $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['knight'])), true);
  851.       $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['paladin'])), true);
  852.       $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The quest is over!" . PHP_EOL . "You have defeated the " . $currentgame['monster'] . "!" . PHP_EOL . "Each adventurer looted ₲" . $looted . " from the corpse.", $net['thread'], false, $net['servKey'], false, $getboard);
  853.       $data = array();
  854.       $data['paladin'] = 'none';
  855.       $data['knight'] = 'none';
  856.       file_put_contents($gamelog, json_encode($data));  
  857.     }else{
  858.       if($currentgame['monsters'][$currentgame['monster']]['frozen'] == false){
  859.         $monsterDamage = mt_rand($currentgame['monsters'][$currentgame['monster']]['min_damage'], $currentgame['monsters'][$currentgame['monster']]['max_damage']) - $currentgame['sets'][$currentgame[$currentgame['knight']]['set']]['defense'];
  860.         if($monsterDamage < 0){
  861.           $monsterDamage = 0;  
  862.         }
  863.         $currentgame[$currentgame['knight']]['hp'] = $currentgame[$currentgame['knight']]['hp'] - $monsterDamage;
  864.         if($currentgame[$currentgame['knight']]['hp'] > 0){
  865.           genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  866.           $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your sword for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage.", $net['thread'], false, $net['servKey'], false, $getboard);
  867.           file_put_contents($gamelog, json_encode($currentgame));
  868.         }else{
  869.           if($currentgame['dead'] == 0){
  870.             genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  871.             $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your sword for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!", $net['thread'], false, $net['servKey'], false, $getboard);
  872.             $currentgame['dead']++;
  873.             file_put_contents($gamelog, json_encode($currentgame));
  874.           }else{
  875.             genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  876.             $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your sword for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!" . PHP_EOL . "Both fighters are dead!" . PHP_EOL . "The quest is over!", $net['thread'], false, $net['servKey'], false, $getboard);
  877.             $data = array();
  878.             $data['paladin'] = 'none';
  879.             $data['knight'] = 'none';
  880.             file_put_contents($gamelog, json_encode($data));
  881.           }
  882.         }      
  883.       }else{
  884.         genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  885.         $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your sword for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " is still frozen.", $net['thread'], false, $net['servKey'], false, $getboard);
  886.         $currentgame['monsters'][$currentgame['monster']]['frozen_turns']--;
  887.         if($currentgame['monsters'][$currentgame['monster']]['frozen_turns'] == 0){
  888.           $currentgame['monsters'][$currentgame['monster']]['frozen'] = false;
  889.           file_put_contents($gamelog, json_encode($currentgame));
  890.           sleep(40);
  891.           genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  892.           $response =  postComDraw("The freezing spell wore off!", $net['thread'], false, $net['servKey'], false, $getboard);
  893.         }
  894.         file_put_contents($gamelog, json_encode($currentgame));
  895.        
  896.       }    
  897.     }  
  898.     }
  899.   }else{
  900.     genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  901.     $response =  postComDraw(">>" . $post['no'] . PHP_EOL . "You are already dead!", $net['thread'], false, $net['servKey'], false, $getboard);
  902.   }
  903. }else if($currentgame['paladin'] == $post['trip']){
  904.        
  905.   if($currentgame[$currentgame['paladin']]['hp'] > 0){
  906.        
  907.     $statusDamage = 0;
  908.     $statusText = '';
  909.     if($currentgame['monsters'][$currentgame['monster']]['burned'] == true){
  910.       $burnDamage = 20;
  911.       $statusDamage += $burnDamage;
  912.       $currentgame['monsters'][$currentgame['monster']]['burned_turns']--;
  913.       $currentgame['monsters'][$currentgame['monster']]['hp'] = $currentgame['monsters'][$currentgame['monster']]['hp'] - $burnDamage;
  914.       $statusText += PHP_EOL . "Burn hurt the " . $currentgame['monster'] . " for " . $burnDamage . ".";
  915.       if($currentgame['monsters'][$currentgame['monster']]['burned_turns'] == 0){
  916.         $currentgame['monsters'][$currentgame['monster']]['burned'] = false;
  917.         $statusText += PHP_EOL . "Burn wore off.";
  918.       }
  919.       file_put_contents($gamelog, json_encode($currentgame));
  920.      
  921.       if($currentgame['monsters'][$currentgame['monster']]['hp'] <= 0){
  922.         genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  923.         $looted = intval($currentgame['monsters'][$currentgame['monster']]['loot']/2);          $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['knight'])), true);
  924.         $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['paladin'])), true);
  925.         $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The quest is over!" . PHP_EOL . "You have defeated the " . $currentgame['monster'] . "!" . PHP_EOL . "Each adventurer looted ₲" . $looted . " from the corpse.", $net['thread'], false, $net['servKey'], false, $getboard);
  926.         $data = array();
  927.         $data['paladin'] = 'none';
  928.         $data['knight'] = 'none';
  929.         file_put_contents($gamelog, json_encode($data));
  930.       }
  931.     }
  932.    
  933.     if($currentgame['monsters'][$currentgame['monster']]['poisoned'] == true){
  934.       $poisonDamage = 10*$currentgame['monsters'][$currentgame['monster']]['poisoned_turns'];
  935.       $statusDamage += $poisonDamage;
  936.       $currentgame['monsters'][$currentgame['monster']]['poisoned_turns']--;
  937.       $currentgame['monsters'][$currentgame['monster']]['hp'] = $currentgame['monsters'][$currentgame['monster']]['hp'] - $poisonDamage;
  938.       $statusText += PHP_EOL . "Poison hurt the " . $currentgame['monster'] . " for " . $poisonDamage . ".";
  939.       if($currentgame['monsters'][$currentgame['monster']]['poisoned_turns'] == 0){
  940.         $currentgame['monsters'][$currentgame['monster']]['poisoned'] = false;
  941.         $statusText += PHP_EOL . "Poison wore off.";
  942.       }
  943.       file_put_contents($gamelog, json_encode($currentgame));
  944.      
  945.       if($currentgame['monsters'][$currentgame['monster']]['hp'] <= 0){
  946.         genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  947.         $looted = intval($currentgame['monsters'][$currentgame['monster']]['loot']/2);          $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['knight'])), true);
  948.         $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['paladin'])), true);
  949.         $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The quest is over!" . PHP_EOL . "You have defeated the " . $currentgame['monster'] . "!" . PHP_EOL . "Each adventurer looted ₲" . $looted . " from the corpse.", $net['thread'], false, $net['servKey'], false, $getboard);
  950.         $data = array();
  951.         $data['paladin'] = 'none';
  952.         $data['knight'] = 'none';
  953.         file_put_contents($gamelog, json_encode($data));
  954.       }  
  955.  
  956.     }
  957.    
  958.     if($moduleText != 'exori' && $moduleText != 'frigo' && $currentgame['monsters'][$currentgame['monster']]['hp'] > 0){
  959.        
  960.       $attackDamage = mt_rand(1, 20) + $currentgame['sets'][$currentgame[$currentgame['paladin']]['set']]['damage'];
  961.       $currentgame['monsters'][$currentgame['monster']]['hp'] = $currentgame['monsters'][$currentgame['monster']]['hp'] - $attackDamage;
  962.       if($currentgame['monsters'][$currentgame['monster']]['hp'] <= 0){
  963.         genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  964.         $looted = intval($currentgame['monsters'][$currentgame['monster']]['loot']/2);
  965.         $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['knight'])), true);
  966.         $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['paladin'])), true);
  967.         $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The quest is over!" . PHP_EOL . "You have defeated the " . $currentgame['monster'] . "!" . PHP_EOL . "Each adventurer looted ₲" . $looted . " from the corpse.", $net['thread'], false, $net['servKey'], false, $getboard);
  968.         $data = array();
  969.         $data['paladin'] = 'none';
  970.         $data['knight'] = 'none';
  971.         file_put_contents($gamelog, json_encode($data));  
  972.       }else{
  973.         if($currentgame['monsters'][$currentgame['monster']]['frozen'] == false){
  974.           $monsterDamage = mt_rand($currentgame['monsters'][$currentgame['monster']]['min_damage'], $currentgame['monsters'][$currentgame['monster']]['max_damage']) - $currentgame['sets'][$currentgame[$currentgame['paladin']]['set']]['defense'];
  975.           if($monsterDamage < 0){
  976.             $monsterDamage = 0;
  977.           }
  978.           $currentgame[$currentgame['paladin']]['hp'] = $currentgame[$currentgame['paladin']]['hp'] - $monsterDamage;
  979.           if($currentgame[$currentgame['paladin']]['hp'] > 0){
  980.             genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  981.             $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your bow for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage.", $net['thread'], false, $net['servKey'], false, $getboard);
  982.             file_put_contents($gamelog, json_encode($currentgame));
  983.           }else{
  984.             if($currentgame['dead'] == 0){
  985.               genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  986.               $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your bow for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!", $net['thread'], false, $net['servKey'], false, $getboard);
  987.               $currentgame['dead']++;
  988.               file_put_contents($gamelog, json_encode($currentgame));
  989.             }else{
  990.               genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  991.               $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your bow for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!" . PHP_EOL . "Both fighters are dead!" . PHP_EOL . "The quest is over!", $net['thread'], false, $net['servKey'], false, $getboard);
  992.               $data = array();
  993.               $data['paladin'] = 'none';
  994.               $data['knight'] = 'none';
  995.               file_put_contents($gamelog, json_encode($data));
  996.             }
  997.           }        
  998.         }else{
  999.           genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1000.           $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your bow for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " is still frozen.", $net['thread'], false, $net['servKey'], false, $getboard);
  1001.           $currentgame['monsters'][$currentgame['monster']]['frozen_turns']--;
  1002.           if($currentgame['monsters'][$currentgame['monster']]['frozen_turns'] == 0){
  1003.             $currentgame['monsters'][$currentgame['monster']]['frozen'] = false;
  1004.             file_put_contents($gamelog, json_encode($currentgame));
  1005.             sleep(40);
  1006.             genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1007.             $response =  postComDraw("The freezing spell wore off!", $net['thread'], false, $net['servKey'], false, $getboard);
  1008.           }
  1009.           file_put_contents($gamelog, json_encode($currentgame));
  1010.        
  1011.         }      
  1012.       }        
  1013.        
  1014.     }else if($moduleText == 'exori' && $currentgame['monsters'][$currentgame['monster']]['hp'] > 0){
  1015.        
  1016.       if($currentgame[$currentgame['paladin']]['mana'] >= $currentgame['spells']['exori']['mana']){
  1017.         $attackDamage = $currentgame['spells']['exori']['damage'];
  1018.         $currentgame['monsters'][$currentgame['monster']]['hp'] = $currentgame['monsters'][$currentgame['monster']]['hp'] - $attackDamage;
  1019.         $currentgame[$currentgame['paladin']]['mana'] = $currentgame[$currentgame['paladin']]['mana'] - $currentgame['spells']['exori']['mana'];
  1020.       }else{
  1021.         $attackDamage = 'low mana';        
  1022.       }
  1023.       if($currentgame['monsters'][$currentgame['monster']]['hp'] <= 0){
  1024.         genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1025.         $looted = intval($currentgame['monsters'][$currentgame['monster']]['loot']/2);
  1026.         $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['knight'])), true);
  1027.         $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['paladin'])), true);
  1028.         $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The quest is over!" . PHP_EOL . "You have defeated the " . $currentgame['monster'] . "!" . PHP_EOL . "Each adventurer looted ₲" . $looted . " from the corpse.", $net['thread'], false, $net['servKey'], false, $getboard);
  1029.         $data = array();
  1030.         $data['paladin'] = 'none';
  1031.         $data['knight'] = 'none';
  1032.         file_put_contents($gamelog, json_encode($data));  
  1033.       }else{
  1034.         if($currentgame['monsters'][$currentgame['monster']]['frozen'] == false){
  1035.           $monsterDamage = mt_rand($currentgame['monsters'][$currentgame['monster']]['min_damage'], $currentgame['monsters'][$currentgame['monster']]['max_damage']) - $currentgame['sets'][$currentgame[$currentgame['paladin']]['set']]['defense'];
  1036.           if($monsterDamage < 0){
  1037.             $monsterDamage = 0;
  1038.           }
  1039.           $currentgame[$currentgame['paladin']]['hp'] = $currentgame[$currentgame['paladin']]['hp'] - $monsterDamage;
  1040.           if($currentgame[$currentgame['paladin']]['hp'] > 0){
  1041.             genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1042.             if($attackDamage != 'low mana'){
  1043.               $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your exori spell for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage.", $net['thread'], false, $net['servKey'], false, $getboard);
  1044.             }else{
  1045.               $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "Your mana was too low to cast!" . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage.", $net['thread'], false, $net['servKey'], false, $getboard);  
  1046.             }
  1047.             file_put_contents($gamelog, json_encode($currentgame));
  1048.           }else{
  1049.             if($currentgame['dead'] == 0){
  1050.               genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1051.               if($attackDamage != 'low mana'){
  1052.                 $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your exori spell for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!", $net['thread'], false, $net['servKey'], false, $getboard);
  1053.               }else{
  1054.                 $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "Your mana was too low to cast!" . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!", $net['thread'], false, $net['servKey'], false, $getboard);                  
  1055.               }
  1056.               $currentgame['dead']++;
  1057.               file_put_contents($gamelog, json_encode($currentgame));
  1058.             }else{
  1059.               genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1060.               if($attackDamage != 'low mana'){
  1061.                 $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your exori spell for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!" . PHP_EOL . "Both fighters are dead!" . PHP_EOL . "The quest is over!", $net['thread'], false, $net['servKey'], false, $getboard);
  1062.               }else{
  1063.                 $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "Your mana was too low to cast!" . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!" . PHP_EOL . "Both fighters are dead!" . PHP_EOL . "The quest is over!", $net['thread'], false, $net['servKey'], false, $getboard);                
  1064.               }
  1065.               $data = array();
  1066.               $data['paladin'] = 'none';
  1067.               $data['knight'] = 'none';
  1068.               file_put_contents($gamelog, json_encode($data));
  1069.             }
  1070.           }        
  1071.         }else{
  1072.           genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1073.           if($attackDamage != 'low mana'){
  1074.             $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your exori spell for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " is still frozen.", $net['thread'], false, $net['servKey'], false, $getboard);
  1075.           }else{
  1076.             $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "Your mana was too low to cast!" . PHP_EOL . "The " . $currentgame['monster'] . " is still frozen.", $net['thread'], false, $net['servKey'], false, $getboard);              
  1077.           }
  1078.           $currentgame['monsters'][$currentgame['monster']]['frozen_turns']--;
  1079.           if($currentgame['monsters'][$currentgame['monster']]['frozen_turns'] == 0){
  1080.             $currentgame['monsters'][$currentgame['monster']]['frozen'] = false;
  1081.             file_put_contents($gamelog, json_encode($currentgame));
  1082.             sleep(40);
  1083.             genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1084.             $response =  postComDraw("The freezing spell wore off!", $net['thread'], false, $net['servKey'], false, $getboard);
  1085.           }
  1086.           file_put_contents($gamelog, json_encode($currentgame));
  1087.        
  1088.         }      
  1089.       }
  1090.    
  1091.        
  1092.     }else if($moduleText == 'frigo' && $currentgame['monsters'][$currentgame['monster']]['hp'] > 0){
  1093.       if($currentgame[$currentgame['paladin']]['mana'] >= $currentgame['spells']['frigo']['mana'] && $currentgame['monsters'][$currentgame['monster']]['immune'] != 'frozen'){
  1094.         $currentgame['monsters'][$currentgame['monster']]['frozen'] = true;
  1095.         $currentgame['monsters'][$currentgame['monster']]['frozen_turns'] = $currentgame['spells']['frigo']['turns'];
  1096.         $currentgame[$currentgame['paladin']]['mana'] = $currentgame[$currentgame['paladin']]['mana'] - $currentgame['spells']['frigo']['mana'];
  1097.         genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1098.         $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You froze the " . $currentgame['monster'] . " with your frigo spell!", $net['thread'], false, $net['servKey'], false, $getboard);        file_put_contents($gamelog, json_encode($currentgame));
  1099.                        
  1100.       }else{
  1101.        
  1102.         $attackDamage = 'low mana';
  1103.        
  1104.         if($currentgame['monsters'][$currentgame['monster']]['frozen'] == false){
  1105.           $monsterDamage = mt_rand($currentgame['monsters'][$currentgame['monster']]['min_damage'], $currentgame['monsters'][$currentgame['monster']]['max_damage']);
  1106.             $currentgame[$currentgame['paladin']]['hp'] = $currentgame[$currentgame['paladin']]['hp'] - $monsterDamage;
  1107.             if($currentgame[$currentgame['paladin']]['hp'] > 0){
  1108.               genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1109.               if($attackDamage != 'low mana'){
  1110.                 $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The " . $currentgame['monster'] . " is immune to freezing!" . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage.", $net['thread'], false, $net['servKey'], false, $getboard);
  1111.               }else{
  1112.                 $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "Your mana was too low to cast!" . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage.", $net['thread'], false, $net['servKey'], false, $getboard);    
  1113.               }
  1114.               file_put_contents($gamelog, json_encode($currentgame));
  1115.             }else{
  1116.               if($currentgame['dead'] == 0){
  1117.                 genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1118.                 if($attackDamage != 'low mana'){
  1119.                   $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The " . $currentgame['monster'] . " is immune to freezing!" . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!", $net['thread'], false, $net['servKey'], false, $getboard);
  1120.                 }else{
  1121.                   $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "Your mana was too low to cast!" . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!", $net['thread'], false, $net['servKey'], false, $getboard);                
  1122.                 }
  1123.                 $currentgame['dead']++;
  1124.                 file_put_contents($gamelog, json_encode($currentgame));
  1125.               }else{
  1126.                 genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1127.                 if($attackDamage != 'low mana'){
  1128.                   $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The " . $currentgame['monster'] . " is immune to freezing!" . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!" . PHP_EOL . "Both fighters are dead!" . PHP_EOL . "The quest is over!", $net['thread'], false, $net['servKey'], false, $getboard);
  1129.                 }else{
  1130.                   $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "Your mana was too low to cast!" . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!" . PHP_EOL . "Both fighters are dead!" . PHP_EOL . "The quest is over!", $net['thread'], false, $net['servKey'], false, $getboard);                  
  1131.                 }
  1132.                 $data = array();
  1133.                 $data['paladin'] = 'none';
  1134.                 $data['knight'] = 'none';
  1135.                 file_put_contents($gamelog, json_encode($data));
  1136.               }
  1137.             }      
  1138.           }else{
  1139.             genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1140.             if($attackDamage != 'low mana'){
  1141.               $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The " . $currentgame['monster'] . " is immune to freezing!" . PHP_EOL . "The " . $currentgame['monster'] . " is still frozen.", $net['thread'], false, $net['servKey'], false, $getboard);
  1142.             }else{
  1143.               $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "Your mana was too low to cast!" . PHP_EOL . "The " . $currentgame['monster'] . " is still frozen.", $net['thread'], false, $net['servKey'], false, $getboard);            
  1144.             }
  1145.             $currentgame['monsters'][$currentgame['monster']]['frozen_turns']--;
  1146.             if($currentgame['monsters'][$currentgame['monster']]['frozen_turns'] == 0){
  1147.               $currentgame['monsters'][$currentgame['monster']]['frozen'] = false;
  1148.               file_put_contents($gamelog, json_encode($currentgame));
  1149.               sleep(40);
  1150.               genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1151.               $response =  postComDraw("The freezing spell wore off!", $net['thread'], false, $net['servKey'], false, $getboard);
  1152.             }
  1153.             file_put_contents($gamelog, json_encode($currentgame));
  1154.        
  1155.           }    
  1156.         }
  1157.        
  1158.       }    
  1159.    
  1160.   }else{
  1161.     genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1162.     $response =  postComDraw(">>" . $post['no'] . PHP_EOL . "You are already dead!", $net['thread'], false, $net['servKey'], false, $getboard);
  1163.   }
  1164.    
  1165.  
  1166. }else if($currentgame['sorcerer'] == $post['trip']){
  1167.        
  1168.   if($currentgame[$currentgame['sorcerer']]['hp'] > 0){
  1169.        
  1170.     $statusDamage = 0;
  1171.     $statusText = '';
  1172.     if($currentgame['monsters'][$currentgame['monster']]['burned'] == true){
  1173.       $burnDamage = 20;
  1174.       $statusDamage += $burnDamage;
  1175.       $currentgame['monsters'][$currentgame['monster']]['burned_turns']--;
  1176.       $currentgame['monsters'][$currentgame['monster']]['hp'] = $currentgame['monsters'][$currentgame['monster']]['hp'] - $burnDamage;
  1177.       $statusText += PHP_EOL . "Burn hurt the " . $currentgame['monster'] . " for " . $burnDamage . ".";
  1178.       if($currentgame['monsters'][$currentgame['monster']]['burned_turns'] == 0){
  1179.         $currentgame['monsters'][$currentgame['monster']]['burned'] = false;
  1180.         $statusText += PHP_EOL . "Burn wore off.";
  1181.       }
  1182.       file_put_contents($gamelog, json_encode($currentgame));
  1183.      
  1184.       if($currentgame['monsters'][$currentgame['monster']]['hp'] <= 0){
  1185.         genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1186.         $looted = intval($currentgame['monsters'][$currentgame['monster']]['loot']/2);          $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['knight'])), true);
  1187.         $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['paladin'])), true);
  1188.         $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The quest is over!" . PHP_EOL . "You have defeated the " . $currentgame['monster'] . "!" . PHP_EOL . "Each adventurer looted ₲" . $looted . " from the corpse.", $net['thread'], false, $net['servKey'], false, $getboard);
  1189.         $data = array();
  1190.         $data['paladin'] = 'none';
  1191.         $data['knight'] = 'none';
  1192.         file_put_contents($gamelog, json_encode($data));
  1193.       }
  1194.     }
  1195.    
  1196.     if($currentgame['monsters'][$currentgame['monster']]['poisoned'] == true){
  1197.       $poisonDamage = 10*$currentgame['monsters'][$currentgame['monster']]['poisoned_turns'];
  1198.       $statusDamage += $poisonDamage;
  1199.       $currentgame['monsters'][$currentgame['monster']]['poisoned_turns']--;
  1200.       $currentgame['monsters'][$currentgame['monster']]['hp'] = $currentgame['monsters'][$currentgame['monster']]['hp'] - $poisonDamage;
  1201.       $statusText += PHP_EOL . "Poison hurt the " . $currentgame['monster'] . " for " . $poisonDamage . ".";
  1202.       if($currentgame['monsters'][$currentgame['monster']]['poisoned_turns'] == 0){
  1203.         $currentgame['monsters'][$currentgame['monster']]['poisoned'] = false;
  1204.         $statusText += PHP_EOL . "Poison wore off.";
  1205.       }
  1206.       file_put_contents($gamelog, json_encode($currentgame));
  1207.      
  1208.       if($currentgame['monsters'][$currentgame['monster']]['hp'] <= 0){
  1209.         genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1210.         $looted = intval($currentgame['monsters'][$currentgame['monster']]['loot']/2);          $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['knight'])), true);
  1211.         $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['paladin'])), true);
  1212.         $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The quest is over!" . PHP_EOL . "You have defeated the " . $currentgame['monster'] . "!" . PHP_EOL . "Each adventurer looted ₲" . $looted . " from the corpse.", $net['thread'], false, $net['servKey'], false, $getboard);
  1213.         $data = array();
  1214.         $data['paladin'] = 'none';
  1215.         $data['knight'] = 'none';
  1216.         file_put_contents($gamelog, json_encode($data));
  1217.       }  
  1218.  
  1219.     }
  1220.    
  1221.     if($moduleText != 'exura' && $moduleText != 'exura gran' && $moduleText != 'exori flam' && $moduleText != 'exori pox' && $moduleText != 'exori mort' && $moduleText != 'exori frigo' && $currentgame['monsters'][$currentgame['monster']]['hp'] > 0){
  1222.        
  1223.       $attackDamage = mt_rand(1, 10) + $currentgame['sets'][$currentgame[$currentgame['sorcerer']]['set']]['damage'];
  1224.       $currentgame['monsters'][$currentgame['monster']]['hp'] = $currentgame['monsters'][$currentgame['monster']]['hp'] - $attackDamage;
  1225.       if($currentgame['monsters'][$currentgame['monster']]['hp'] <= 0){
  1226.         genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1227.         $looted = intval($currentgame['monsters'][$currentgame['monster']]['loot']/2);
  1228.         $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['knight'])), true);
  1229.         $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['paladin'])), true);
  1230.         $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The quest is over!" . PHP_EOL . "You have defeated the " . $currentgame['monster'] . "!" . PHP_EOL . "Each adventurer looted ₲" . $looted . " from the corpse.", $net['thread'], false, $net['servKey'], false, $getboard);
  1231.         $data = array();
  1232.         $data['paladin'] = 'none';
  1233.         $data['knight'] = 'none';
  1234.         file_put_contents($gamelog, json_encode($data));  
  1235.       }else{
  1236.         if($currentgame['monsters'][$currentgame['monster']]['frozen'] == false){
  1237.           $monsterDamage = mt_rand($currentgame['monsters'][$currentgame['monster']]['min_damage'], $currentgame['monsters'][$currentgame['monster']]['max_damage']) - $currentgame['sets'][$currentgame[$currentgame['sorcerer']]['set']]['defense'];
  1238.           if($monsterDamage < 0){
  1239.             $monsterDamage = 0;
  1240.           }
  1241.           $currentgame[$currentgame['sorcerer']]['hp'] = $currentgame[$currentgame['sorcerer']]['hp'] - $monsterDamage;
  1242.           if($currentgame[$currentgame['paladin']]['hp'] > 0){
  1243.             genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1244.             $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your wand for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage.", $net['thread'], false, $net['servKey'], false, $getboard);
  1245.             file_put_contents($gamelog, json_encode($currentgame));
  1246.           }else{
  1247.             if($currentgame['dead'] == 0){
  1248.               genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1249.               $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your wand for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!", $net['thread'], false, $net['servKey'], false, $getboard);
  1250.               $currentgame['dead']++;
  1251.               file_put_contents($gamelog, json_encode($currentgame));
  1252.             }else{
  1253.               genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1254.               $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your wand for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!" . PHP_EOL . "Both fighters are dead!" . PHP_EOL . "The quest is over!", $net['thread'], false, $net['servKey'], false, $getboard);
  1255.               $data = array();
  1256.               $data['paladin'] = 'none';
  1257.               $data['knight'] = 'none';
  1258.               file_put_contents($gamelog, json_encode($data));
  1259.             }
  1260.           }        
  1261.         }else{
  1262.           genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1263.           $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your wand for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " is still frozen.", $net['thread'], false, $net['servKey'], false, $getboard);
  1264.           $currentgame['monsters'][$currentgame['monster']]['frozen_turns']--;
  1265.           if($currentgame['monsters'][$currentgame['monster']]['frozen_turns'] == 0){
  1266.             $currentgame['monsters'][$currentgame['monster']]['frozen'] = false;
  1267.             file_put_contents($gamelog, json_encode($currentgame));
  1268.             sleep(40);
  1269.             genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1270.             $response =  postComDraw("The freezing spell wore off!", $net['thread'], false, $net['servKey'], false, $getboard);
  1271.           }
  1272.           file_put_contents($gamelog, json_encode($currentgame));
  1273.        
  1274.         }      
  1275.       }        
  1276.        
  1277.     }else if($moduleText == 'exori mort' && $currentgame['monsters'][$currentgame['monster']]['hp'] > 0){
  1278.        
  1279.       if($currentgame[$currentgame['sorcerer']]['mana'] >= $currentgame['spells']['exori_mort']['mana']){
  1280.         $attackDamage = $currentgame['spells']['exori_mort']['damage'];
  1281.         $currentgame['monsters'][$currentgame['monster']]['hp'] = $currentgame['monsters'][$currentgame['monster']]['hp'] - $attackDamage;
  1282.         $currentgame[$currentgame['sorcerer']]['mana'] = $currentgame[$currentgame['sorcerer']]['mana'] - $currentgame['spells']['exori_mort']['mana'];
  1283.       }else{
  1284.         $attackDamage = 'low mana';        
  1285.       }
  1286.       if($currentgame['monsters'][$currentgame['monster']]['hp'] <= 0){
  1287.         genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1288.         $looted = intval($currentgame['monsters'][$currentgame['monster']]['loot']/2);
  1289.         $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['knight'])), true);
  1290.         $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['paladin'])), true);
  1291.         $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The quest is over!" . PHP_EOL . "You have defeated the " . $currentgame['monster'] . "!" . PHP_EOL . "Each adventurer looted ₲" . $looted . " from the corpse.", $net['thread'], false, $net['servKey'], false, $getboard);
  1292.         $data = array();
  1293.         $data['paladin'] = 'none';
  1294.         $data['knight'] = 'none';
  1295.         file_put_contents($gamelog, json_encode($data));  
  1296.       }else{
  1297.         if($currentgame['monsters'][$currentgame['monster']]['frozen'] == false){
  1298.           $monsterDamage = mt_rand($currentgame['monsters'][$currentgame['monster']]['min_damage'], $currentgame['monsters'][$currentgame['monster']]['max_damage']) - $currentgame['sets'][$currentgame[$currentgame['sorcerer']]['set']]['defense'];
  1299.           if($monsterDamage < 0){
  1300.             $monsterDamage = 0;
  1301.           }
  1302.           $currentgame[$currentgame['sorcerer']]['hp'] = $currentgame[$currentgame['sorcerer']]['hp'] - $monsterDamage;
  1303.           if($currentgame[$currentgame['sorcerer']]['hp'] > 0){
  1304.             genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1305.             if($attackDamage != 'low mana'){
  1306.               $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your exori mort spell for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage.", $net['thread'], false, $net['servKey'], false, $getboard);
  1307.             }else{
  1308.               $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "Your mana was too low to cast!" . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage.", $net['thread'], false, $net['servKey'], false, $getboard);  
  1309.             }
  1310.             file_put_contents($gamelog, json_encode($currentgame));
  1311.           }else{
  1312.             if($currentgame['dead'] == 0){
  1313.               genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1314.               if($attackDamage != 'low mana'){
  1315.                 $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your exori mort spell for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!", $net['thread'], false, $net['servKey'], false, $getboard);
  1316.               }else{
  1317.                 $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "Your mana was too low to cast!" . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!", $net['thread'], false, $net['servKey'], false, $getboard);                  
  1318.               }
  1319.               $currentgame['dead']++;
  1320.               file_put_contents($gamelog, json_encode($currentgame));
  1321.             }else{
  1322.               genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1323.               if($attackDamage != 'low mana'){
  1324.                 $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your exori mort spell for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!" . PHP_EOL . "Both fighters are dead!" . PHP_EOL . "The quest is over!", $net['thread'], false, $net['servKey'], false, $getboard);
  1325.               }else{
  1326.                 $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "Your mana was too low to cast!" . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!" . PHP_EOL . "Both fighters are dead!" . PHP_EOL . "The quest is over!", $net['thread'], false, $net['servKey'], false, $getboard);                
  1327.               }
  1328.               $data = array();
  1329.               $data['paladin'] = 'none';
  1330.               $data['knight'] = 'none';
  1331.               file_put_contents($gamelog, json_encode($data));
  1332.             }
  1333.           }        
  1334.         }else{
  1335.           genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1336.           if($attackDamage != 'low mana'){
  1337.             $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You attacked the " . $currentgame['monster'] . " with your exori mort spell for " . $attackDamage . " damage." . PHP_EOL . "The " . $currentgame['monster'] . " is still frozen.", $net['thread'], false, $net['servKey'], false, $getboard);
  1338.           }else{
  1339.             $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "Your mana was too low to cast!" . PHP_EOL . "The " . $currentgame['monster'] . " is still frozen.", $net['thread'], false, $net['servKey'], false, $getboard);              
  1340.           }
  1341.           $currentgame['monsters'][$currentgame['monster']]['frozen_turns']--;
  1342.           if($currentgame['monsters'][$currentgame['monster']]['frozen_turns'] == 0){
  1343.             $currentgame['monsters'][$currentgame['monster']]['frozen'] = false;
  1344.             file_put_contents($gamelog, json_encode($currentgame));
  1345.             sleep(40);
  1346.             genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1347.             $response =  postComDraw("The freezing spell wore off!", $net['thread'], false, $net['servKey'], false, $getboard);
  1348.           }
  1349.           file_put_contents($gamelog, json_encode($currentgame));
  1350.        
  1351.         }      
  1352.       }
  1353.    
  1354.        
  1355.     }else if($moduleText == 'exori frigo' && $currentgame['monsters'][$currentgame['monster']]['hp'] > 0){
  1356.       if($currentgame[$currentgame['sorcerer']]['mana'] >= $currentgame['spells']['exori_frigo']['mana'] && $currentgame['monsters'][$currentgame['monster']]['immune'] != 'frozen'){
  1357.         $currentgame['monsters'][$currentgame['monster']]['frozen'] = true;
  1358.         $currentgame['monsters'][$currentgame['monster']]['frozen_turns'] = $currentgame['spells']['exori_frigo']['turns'];
  1359.         $attackDamage = $currentgame['spells']['exori_frigo']['damage'];
  1360.         $currentgame['monsters'][$currentgame['monster']]['hp'] = $currentgame['monsters'][$currentgame['monster']]['hp'] - $attackDamage;
  1361.         $currentgame[$currentgame['sorcerer']]['mana'] = $currentgame[$currentgame['sorcerer']]['mana'] - $currentgame['spells']['exori_frigo']['mana'];
  1362.         if($currentgame['monsters'][$currentgame['monster']]['hp'] > 0){
  1363.          genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1364.          $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "You froze the " . $currentgame['monster'] . " with your exori frigo spell, also doing " . $currentgame['spells']['exori_frigo']['damage'] . " damage!", $net['thread'], false, $net['servKey'], false, $getboard);        file_put_contents($gamelog, json_encode($currentgame));
  1365.         }else{
  1366.           genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1367.           $looted = intval($currentgame['monsters'][$currentgame['monster']]['loot']/2);          $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['knight'])), true);
  1368.           $bankapix = json_decode(file_get_contents("http://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['paladin'])), true);
  1369.           $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The quest is over!" . PHP_EOL . "You have defeated the " . $currentgame['monster'] . "!" . PHP_EOL . "Each adventurer looted ₲" . $looted . " from the corpse.", $net['thread'], false, $net['servKey'], false, $getboard);
  1370.           $data = array();
  1371.           $data['paladin'] = 'none';
  1372.           $data['knight'] = 'none';
  1373.           file_put_contents($gamelog, json_encode($data));
  1374.         }
  1375.                        
  1376.       }else{
  1377.        
  1378.         $attackDamage = 'low mana';
  1379.        
  1380.         if($currentgame['monsters'][$currentgame['monster']]['frozen'] == false){
  1381.           $monsterDamage = mt_rand($currentgame['monsters'][$currentgame['monster']]['min_damage'], $currentgame['monsters'][$currentgame['monster']]['max_damage']);
  1382.             $currentgame[$currentgame['sorcerer']]['hp'] = $currentgame[$currentgame['sorcerer']]['hp'] - $monsterDamage;
  1383.             if($currentgame[$currentgame['sorcerer']]['hp'] > 0){
  1384.               genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1385.               if($attackDamage != 'low mana'){
  1386.                 $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The " . $currentgame['monster'] . " is immune to freezing!" . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage.", $net['thread'], false, $net['servKey'], false, $getboard);
  1387.               }else{
  1388.                 $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "Your mana was too low to cast!" . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage.", $net['thread'], false, $net['servKey'], false, $getboard);    
  1389.               }
  1390.               file_put_contents($gamelog, json_encode($currentgame));
  1391.             }else{
  1392.               if($currentgame['dead'] == 0){
  1393.                 genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1394.                 if($attackDamage != 'low mana'){
  1395.                   $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The " . $currentgame['monster'] . " is immune to freezing!" . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!", $net['thread'], false, $net['servKey'], false, $getboard);
  1396.                 }else{
  1397.                   $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "Your mana was too low to cast!" . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!", $net['thread'], false, $net['servKey'], false, $getboard);                
  1398.                 }
  1399.                 $currentgame['dead']++;
  1400.                 file_put_contents($gamelog, json_encode($currentgame));
  1401.               }else{
  1402.                 genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1403.                 if($attackDamage != 'low mana'){
  1404.                   $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The " . $currentgame['monster'] . " is immune to freezing!" . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!" . PHP_EOL . "Both fighters are dead!" . PHP_EOL . "The quest is over!", $net['thread'], false, $net['servKey'], false, $getboard);
  1405.                 }else{
  1406.                   $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "Your mana was too low to cast!" . PHP_EOL . "The " . $currentgame['monster'] . " attacked you for " . $monsterDamage . " damage, killing you!" . PHP_EOL . "Both fighters are dead!" . PHP_EOL . "The quest is over!", $net['thread'], false, $net['servKey'], false, $getboard);                  
  1407.                 }
  1408.                 $data = array();
  1409.                 $data['paladin'] = 'none';
  1410.                 $data['knight'] = 'none';
  1411.                 file_put_contents($gamelog, json_encode($data));
  1412.               }
  1413.             }      
  1414.           }else{
  1415.             genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1416.             if($attackDamage != 'low mana'){
  1417.               $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "The " . $currentgame['monster'] . " is immune to freezing!" . PHP_EOL . "The " . $currentgame['monster'] . " is still frozen.", $net['thread'], false, $net['servKey'], false, $getboard);
  1418.             }else{
  1419.               $response =  postComDraw(">>" . $post['no'] . $statusText . PHP_EOL . "Your mana was too low to cast!" . PHP_EOL . "The " . $currentgame['monster'] . " is still frozen.", $net['thread'], false, $net['servKey'], false, $getboard);            
  1420.             }
  1421.             $currentgame['monsters'][$currentgame['monster']]['frozen_turns']--;
  1422.             if($currentgame['monsters'][$currentgame['monster']]['frozen_turns'] == 0){
  1423.               $currentgame['monsters'][$currentgame['monster']]['frozen'] = false;
  1424.               file_put_contents($gamelog, json_encode($currentgame));
  1425.               sleep(40);
  1426.               genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1427.               $response =  postComDraw("The freezing spell wore off!", $net['thread'], false, $net['servKey'], false, $getboard);
  1428.             }
  1429.             file_put_contents($gamelog, json_encode($currentgame));
  1430.        
  1431.           }    
  1432.         }
  1433.        
  1434.       }    
  1435.    
  1436.   }else{
  1437.     genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
  1438.     $response =  postComDraw(">>" . $post['no'] . PHP_EOL . "You are already dead!", $net['thread'], false, $net['servKey'], false, $getboard);
  1439.   }
  1440.  
  1441.  
  1442.    
  1443. }else{
  1444.   $response = postCom(">>" . $post['no'] . PHP_EOL . "You are not an adventurer in this encounter.", $net['thread'], false, $net['servKey'], false, false);
  1445. }
  1446.  
  1447. $response = json_decode($response, true);
  1448.  
  1449. $net['log'] = json_decode(file_get_contents($net['logFile']), true);
  1450. $thisLog = array();
  1451. $thisLog['time'] = tSmp();
  1452. $thisLog['no'] = $post['no'];
  1453. $thisLog['thread'] = $net['thread'];
  1454. $thisLog['name'] = $post['name'].$post['trip'];
  1455. $thisLog['command'] = 'skynet.' . $module . ': ' . $moduleText . ';';
  1456. $thisLog['response'] = $response['id'];
  1457. $thisLog['board'] = $getboard;
  1458. $net['log'][$post['no']] = $thisLog;
  1459. file_put_contents($net['logFile'], json_encode($net['log']));
  1460. $net['log'] = json_decode(file_get_contents($net['logFile']), true);
  1461.  
  1462. echo '>>' . $response['id'] . '<br>';
  1463. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement