Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header("Content-type: text/html; charset=utf-8");
- function genImage($knight, $paladin, $sorc, $druid, $beast, $players, $array){
- function imagettfstroketext(&$image, $size, $angle, $x, $y, &$textcolor, &$strokecolor, $fontfile, $text, $px){
- for($c1 = ($x-abs($px)); $c1 <= ($x+abs($px)); $c1++)
- for($c2 = ($y-abs($px)); $c2 <= ($y+abs($px)); $c2++)
- $bg = imagettftext($image, $size, $angle, $c1, $c2, $strokecolor, $fontfile, $text);
- return imagettftext($image, $size, $angle, $x, $y, $textcolor, $fontfile, $text);
- }
- $imgpath = 'rpgimg/';
- $stackpath = 'http://erin.wtf/stacks/';
- if($players > 2){
- $img = imagecreatetruecolor(323, 340);
- }else{
- $img = imagecreatetruecolor(323, 224);
- }
- imagesavealpha($img, true);
- $trans_colour = imagecolorallocatealpha($img, 203, 203, 203, 0);
- $trans_colourb = imagecolorallocatealpha($img, 100, 100, 100, 0);
- $border = imagecolorallocate($img, 40, 40, 40);
- $tile = imagecreatefrompng($imgpath . 'tile3.png');
- imagesettile($img, $tile);
- if($players > 2){
- imagefilledrectangle($img, 2, 2, 319, 336, IMG_COLOR_TILED);
- }else{
- imagefilledrectangle($img, 2, 2, 319, 220, IMG_COLOR_TILED);
- }
- $stroke_color = imagecolorallocate($img, 0, 0, 0);
- $text_color = imagecolorallocate($img, 255, 255, 255);
- $posY = 16;
- if($array[$knight]['hp'] > 0){
- imagettfstroketext($img, 8, 0, 6, $posY, $text_color, $stroke_color, "Tahoma_Bold.ttf", 'Knight ' . $knight . ' HP '. $array[$knight]['hp'] . '/' . $array[$knight]['hp_max'], 1);
- $src = imagecreatefrompng($imgpath . 'knight.png');
- imagecopy($img, $src, 0, $posY - 4, 0, 0, 46, 46);
- }else{
- imagettfstroketext($img, 8, 0, 6, $posY, $text_color, $stroke_color, "Tahoma_Bold.ttf", 'Knight ' . $knight . ' [Dead]', 1);
- $src = imagecreatefrompng($imgpath . 'dead.png');
- imagecopy($img, $src, 16, $posY + 9, 0, 0, 32, 32);
- }
- imagefilledrectangle($img, 54, $posY + 5, 283, $posY + 44, $trans_colourb);
- imagefilledrectangle($img, 56, $posY + 7, 91, $posY + 42, $border);
- imagefilledrectangle($img, 58, $posY + 9, 90, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$knight]['set'] . '_helmet.png');
- imagecopy($img, $src, 58, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 94, $posY + 7, 129, $posY + 42, $border);
- imagefilledrectangle($img, 96, $posY + 9, 128, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$knight]['set'] . '_armor.png');
- imagecopy($img, $src, 96, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 132, $posY + 7, 167, $posY + 42, $border);
- imagefilledrectangle($img, 134, $posY + 9, 166, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$knight]['set'] . '_legs.png');
- imagecopy($img, $src, 134, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 170, $posY + 7, 205, $posY + 42, $border);
- imagefilledrectangle($img, 172, $posY + 9, 204, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$knight]['set'] . '_boots.png');
- imagecopy($img, $src, 172, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 208, $posY + 7, 243, $posY + 42, $border);
- imagefilledrectangle($img, 210, $posY + 9, 242, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$knight]['set'] . '_sword.png');
- imagecopy($img, $src, 210, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 246, $posY + 7, 281, $posY + 42, $border);
- imagefilledrectangle($img, 248, $posY + 9, 280, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$knight]['set'] . '_shield.png');
- imagecopy($img, $src, 248, $posY + 9, 0, 0, 32, 32);
- $posY += 59;
- if($array[$paladin]['hp'] > 0){
- 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);
- $src = imagecreatefrompng($imgpath . 'paladin.png');
- imagecopy($img, $src, 0, $posY - 4, 0, 0, 46, 46);
- }else{
- imagettfstroketext($img, 8, 0, 6, $posY, $text_color, $stroke_color, "Tahoma_Bold.ttf", 'Paladin ' . $paladin . ' [Dead]', 1);
- $src = imagecreatefrompng($imgpath . 'dead.png');
- imagecopy($img, $src, 16, $posY + 9, 0, 0, 32, 32);
- }
- imagefilledrectangle($img, 54, $posY + 5, 283, $posY + 44, $trans_colourb);
- imagefilledrectangle($img, 56, $posY + 7, 91, $posY + 42, $border);
- imagefilledrectangle($img, 58, $posY + 9, 90, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$paladin]['set'] . '_hood.png');
- imagecopy($img, $src, 58, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 94, $posY + 7, 129, $posY + 42, $border);
- imagefilledrectangle($img, 96, $posY + 9, 128, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$paladin]['set'] . '_tunic.png');
- imagecopy($img, $src, 96, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 132, $posY + 7, 167, $posY + 42, $border);
- imagefilledrectangle($img, 134, $posY + 9, 166, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$paladin]['set'] . '_pants.png');
- imagecopy($img, $src, 134, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 170, $posY + 7, 205, $posY + 42, $border);
- imagefilledrectangle($img, 172, $posY + 9, 204, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$paladin]['set'] . '_shoes.png');
- imagecopy($img, $src, 172, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 208, $posY + 7, 243, $posY + 42, $border);
- imagefilledrectangle($img, 210, $posY + 9, 242, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$paladin]['set'] . '_bow.png');
- imagecopy($img, $src, 210, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 246, $posY + 7, 281, $posY + 42, $border);
- imagefilledrectangle($img, 248, $posY + 9, 280, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$paladin]['set'] . '_arrow.png');
- imagecopy($img, $src, 248, $posY + 9, 0, 0, 32, 32);
- $posY += 59;
- if($players > 2){
- if($array[$sorc]['hp'] > 0){
- 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);
- $src = imagecreatefrompng($imgpath . 'sorcerer.png');
- imagecopy($img, $src, 0, $posY - 4, 0, 0, 46, 46);
- }else{
- imagettfstroketext($img, 8, 0, 6, $posY, $text_color, $stroke_color, "Tahoma_Bold.ttf", 'Sorcerer ' . $sorc . ' [Dead]', 1);
- $src = imagecreatefrompng($imgpath . 'dead.png');
- imagecopy($img, $src, 16, $posY + 9, 0, 0, 32, 32);
- }
- imagefilledrectangle($img, 54, $posY + 5, 283, $posY + 44, $trans_colourb);
- imagefilledrectangle($img, 56, $posY + 7, 91, $posY + 42, $border);
- imagefilledrectangle($img, 58, $posY + 9, 90, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$sorc]['set'] . '_cap.png');
- imagecopy($img, $src, 58, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 94, $posY + 7, 129, $posY + 42, $border);
- imagefilledrectangle($img, 96, $posY + 9, 128, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$sorc]['set'] . '_cape.png');
- imagecopy($img, $src, 96, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 132, $posY + 7, 167, $posY + 42, $border);
- imagefilledrectangle($img, 134, $posY + 9, 166, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$sorc]['set'] . '_shorts.png');
- imagecopy($img, $src, 134, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 170, $posY + 7, 205, $posY + 42, $border);
- imagefilledrectangle($img, 172, $posY + 9, 204, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$sorc]['set'] . '_slippers.png');
- imagecopy($img, $src, 172, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 208, $posY + 7, 243, $posY + 42, $border);
- imagefilledrectangle($img, 210, $posY + 9, 242, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$sorc]['set'] . '_wand.png');
- imagecopy($img, $src, 210, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 246, $posY + 7, 281, $posY + 42, $border);
- imagefilledrectangle($img, 248, $posY + 9, 280, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$sorc]['set'] . '_tome.png');
- imagecopy($img, $src, 248, $posY + 9, 0, 0, 32, 32);
- $posY += 59;
- if($array[$druid]['hp'] > 0){
- 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);
- $src = imagecreatefrompng($imgpath . 'druid.png');
- imagecopy($img, $src, 0, $posY - 4, 0, 0, 46, 46);
- }else{
- imagettfstroketext($img, 8, 0, 6, $posY, $text_color, $stroke_color, "Tahoma_Bold.ttf", 'Druid ' . $druid . ' [Dead]', 1);
- $src = imagecreatefrompng($imgpath . 'dead.png');
- imagecopy($img, $src, 16, $posY + 9, 0, 0, 32, 32);
- }
- imagefilledrectangle($img, 54, $posY + 5, 283, $posY + 44, $trans_colourb);
- imagefilledrectangle($img, 56, $posY + 7, 91, $posY + 42, $border);
- imagefilledrectangle($img, 58, $posY + 9, 90, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$druid]['set'] . '_hat.png');
- imagecopy($img, $src, 58, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 94, $posY + 7, 129, $posY + 42, $border);
- imagefilledrectangle($img, 96, $posY + 9, 128, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$druid]['set'] . '_robe.png');
- imagecopy($img, $src, 96, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 132, $posY + 7, 167, $posY + 42, $border);
- imagefilledrectangle($img, 134, $posY + 9, 166, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$druid]['set'] . '_kilt.png');
- imagecopy($img, $src, 134, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 170, $posY + 7, 205, $posY + 42, $border);
- imagefilledrectangle($img, 172, $posY + 9, 204, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$druid]['set'] . '_sandals.png');
- imagecopy($img, $src, 172, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 208, $posY + 7, 243, $posY + 42, $border);
- imagefilledrectangle($img, 210, $posY + 9, 242, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$druid]['set'] . '_rod.png');
- imagecopy($img, $src, 210, $posY + 9, 0, 0, 32, 32);
- imagefilledrectangle($img, 246, $posY + 7, 281, $posY + 42, $border);
- imagefilledrectangle($img, 248, $posY + 9, 280, $posY + 41, $trans_colourb);
- $src = imagecreatefrompng($imgpath . $array[$druid]['set'] . '_book.png');
- imagecopy($img, $src, 248, $posY + 9, 0, 0, 32, 32);
- $posY += 59;
- }
- if($players > 2){
- $xPosition = 94;
- $yPosition = 292;
- }else{
- $xPosition = 94;
- $yPosition = 175;
- }
- if($array['monsters'][$beast]['hp'] > 0){
- 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);
- $src = imagecreatefrompng($imgpath . $array['monsters'][$beast]['img']);
- imagecopy($img, $src, 6, $yPosition - 30, 0, 0, $array['monsters'][$beast]['size'], $array['monsters'][$beast]['size']);
- }else{
- imagettfstroketext($img, 8, 0, 6, $yPosition - 39, $text_color, $stroke_color, "Tahoma_Bold.ttf", 'Monster: ' . ucfirst($beast) . ' [Dead]', 1);
- $src = imagecreatefrompng($imgpath . "dead_" . $array['monsters'][$beast]['img']);
- imagecopy($img, $src, 6, $yPosition - 30, 0, 0, $array['monsters'][$beast]['size'], $array['monsters'][$beast]['size']);
- }
- imagefilledrectangle($img, $xPosition - 2, $yPosition - 32, $xPosition + 75, $yPosition - 1, $trans_colourb);
- imagefilledrectangle($img, $xPosition, $yPosition - 18, $xPosition + 73, $yPosition + 7, $border);
- imagefilledrectangle($img, $xPosition + 2, $yPosition - 16, $xPosition + 72, $yPosition - 4, $trans_colourb);
- imagettfstroketext($img, 8, 0, $xPosition + 15, $yPosition - 21, $text_color, $stroke_color, "Tahoma_Bold.ttf", 'Status', 1);
- $statuspos = 98;
- if($array['monsters'][$beast]['frozen'] == true){
- $src = imagecreatefrompng($imgpath . "frozen.png");
- imagecopy($img, $src, $statuspos, $yPosition - 15, 0, 0, 11, 11);
- $statuspos = $statuspos + 12;
- }
- if($array['monsters'][$beast]['burned'] == true){
- $src = imagecreatefrompng($imgpath . "burned.png");
- imagecopy($img, $src, $statuspos, $yPosition - 15, 0, 0, 11, 11);
- $statuspos = $statuspos + 12;
- }
- if($array['monsters'][$beast]['poisoned'] == true){
- $src = imagecreatefrompng($imgpath . "poisoned.png");
- imagecopy($img, $src, $statuspos, $yPosition - 15, 0, 0, 11, 11);
- $statuspos = $statuspos + 12;
- }
- $ps = intval(intval($array['monsters'][$beast]['loot'])/100);
- $gs = intval(intval($array['monsters'][$beast]['loot'])%100);
- if($ps >= 1){
- imagefilledrectangle($img, $xPosition - 2, $yPosition - 2, $xPosition + 37, $yPosition + 37, $trans_colourb);
- imagefilledrectangle($img, $xPosition, $yPosition, $xPosition + 35, $yPosition + 35, $border);
- imagefilledrectangle($img, $xPosition + 2, $yPosition + 2, $xPosition + 34, $yPosition + 34, $trans_colourb);
- if($ps >= 50){
- $src = imagecreatefrompng($stackpath . 'p-50-100.png');
- imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
- if($ps == 100){
- imagettfstroketext($img, 8, 0, $xPosition + 11, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $ps, 1);
- }else{
- imagettfstroketext($img, 8, 0, $xPosition + 18, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $ps, 1);
- }
- }else if($ps >= 25){
- $src = imagecreatefrompng($stackpath . 'p-25-49.png');
- imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
- imagettfstroketext($img, 8, 0, $xPosition + 18, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $ps, 1);
- }else if($ps >= 10){
- $src = imagecreatefrompng($stackpath . 'p-10-24.png');
- imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
- imagettfstroketext($img, 8, 0, $xPosition + 18, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $ps, 1);
- }else if($ps >= 5){
- $src = imagecreatefrompng($stackpath . 'p-5-9.png');
- imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
- imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $ps, 1);
- }else if($ps == 4){
- $src = imagecreatefrompng($stackpath . 'p-4.png');
- imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
- imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $ps, 1);
- }else if($ps == 3){
- $src = imagecreatefrompng($stackpath . 'p-3.png');
- imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
- imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $ps, 1);
- }else if($ps == 2){
- $src = imagecreatefrompng($stackpath . 'p-2.png');
- imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
- imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $ps, 1);
- }else if($ps == 1){
- $src = imagecreatefrompng($stackpath . 'p-1.png');
- imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
- imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $ps, 1);
- }
- }
- $xPosition += 38;
- imagefilledrectangle($img, $xPosition - 2, $yPosition - 2, $xPosition + 37, $yPosition + 37, $trans_colourb);
- imagefilledrectangle($img, $xPosition, $yPosition, $xPosition + 35, $yPosition + 35, $border);
- imagefilledrectangle($img, $xPosition + 2, $yPosition + 2, $xPosition + 34, $yPosition + 34, $trans_colourb);
- if($gs >= 1){
- if($gs >= 50){
- $src = imagecreatefrompng($stackpath . 'g-50-100.png');
- imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
- if($ps == 100){
- imagettfstroketext($img, 8, 0, $xPosition + 11, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $gs, 1);
- }else{
- imagettfstroketext($img, 8, 0, $xPosition + 18, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $gs, 1);
- }
- }else if($gs >= 25){
- $src = imagecreatefrompng($stackpath . 'g-25-49.png');
- imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
- imagettfstroketext($img, 8, 0, $xPosition + 18, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $gs, 1);
- }else if($gs >= 10){
- $src = imagecreatefrompng($stackpath . 'g-10-24.png');
- imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
- imagettfstroketext($img, 8, 0, $xPosition + 18, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $gs, 1);
- }else if($gs >= 5){
- $src = imagecreatefrompng($stackpath . 'g-5-9.png');
- imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
- imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $gs, 1);
- }else if($gs == 4){
- $src = imagecreatefrompng($stackpath . 'g-4.png');
- imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
- imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $gs, 1);
- }else if($gs == 3){
- $src = imagecreatefrompng($stackpath . 'g-3.png');
- imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
- imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $gs, 1);
- }else if($gs == 2){
- $src = imagecreatefrompng($stackpath . 'g-2.png');
- imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
- imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $gs, 1);
- }else if($gs == 1){
- $src = imagecreatefrompng($stackpath . 'g-1.png');
- imagecopy($img, $src, $xPosition + 2, $yPosition + 2, 0, 0, 32, 32);
- imagettfstroketext($img, 8, 0, $xPosition + 25, $yPosition + 32, $text_color, $stroke_color, "Tahoma_Bold.ttf", $gs, 1);
- }
- }
- if($players > 2){
- imagettfstroketext($img, 8, 0, 215, 330, $trans_colour, $stroke_color, "Tahoma_Bold.ttf", '/Animus/ Quest', 1);
- }else{
- imagettfstroketext($img, 8, 0, 215, 214, $trans_colour, $stroke_color, "Tahoma_Bold.ttf", '/Animus/ Quest', 1);
- }
- imagepng($img, "gameimg.png");
- imagecolordeallocate($img, $stroke_color);
- imagecolordeallocate($img, $text_color);
- imagecolordeallocate($img, $trans_colour);
- imagecolordeallocate($img, $trans_colourb);
- imagecolordeallocate($img, $border);
- imagedestroy($img);
- }
- function postComDraw($thisCom, $thread, $oP, $tkey, $postvideo, $tBoard){
- $chanDomain = '8ch.net';
- $output = '';
- if($oP == true){
- $postSub = '[SKYNET 2.1 OP]';
- }else{
- $postSub = '[SKYNET 2.1]';
- }
- if(!$tBoard || $tBoard == false){
- $tBoard = 'animus';
- }
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "https://" . $chanDomain . "/post.php");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_REFERER, 'https://' . $chanDomain . '/' . $tBoard . '/res/' . $thread . '.html');
- $data = array(
- 'json_response' => '0',
- 'post' => 'on',
- 'q' => '',
- 'board' => $tBoard,
- 'name' => "server@erin.wtf ".$tkey,
- 'email' => '',
- 'password' => '',
- 'subject' => $postSub,
- 'body' => $thisCom,
- );
- if(!$postvideo || $postvideo == false){
- $data['file'] = '@' . realpath('gameimg.png');
- }else{
- $data['embed'] = $postvideo;
- }
- if($thread != '0'){
- $data['thread'] = $thread;
- }
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
- $output .= curl_exec($ch);
- curl_close($ch);
- return $output;
- }
- $moduleText = $post['com'];
- $moduleText = strip_tags($moduleText);
- $moduleText = explode('skynet.'.$module.': ', $moduleText)[1];
- $moduleText = preg_replace('/>/', '>', $moduleText);
- $moduleText = preg_replace('/</', '<', $moduleText);
- $moduleText = explode(';', $moduleText)[0];
- $gamelog = 'skynet_quest.txt';
- $currentgame = json_decode(file_get_contents($gamelog), true);
- if($currentgame['knight'] == 'none' && $currentgame['paladin'] == none && $post['trip']){
- if($moduleText == 'paladin'){
- $data = array();
- $data['paladin'] = $post['trip'];
- $data['knight'] = 'none';
- file_put_contents($gamelog, json_encode($data));
- $response = postCom(">>" . $post['no'] . PHP_EOL . "Game open." . PHP_EOL . "Please wait for a knight to join.", $net['thread'], false, $net['servKey'], false, false);
- }else if($moduleText == 'knight'){
- $data = array();
- $data['paladin'] = 'none';
- $data['knight'] = $post['trip'];
- file_put_contents($gamelog, json_encode($data));
- $response = postCom(">>" . $post['no'] . PHP_EOL . "Game open." . PHP_EOL . "Please wait for a paladin to join.", $net['thread'], false, $net['servKey'], false, false);
- }else{
- $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);
- }
- }else if($currentgame['knight'] == 'none' || $currentgame['paladin'] == none && $post['trip']){
- if($currentgame['knight'] == 'none' && $post['trip'] != $currentgame['paladin']){
- $currentgame['knight'] = $post['trip'];
- file_put_contents($gamelog, json_encode($currentgame));
- }else if($currentgame['paladin'] == 'none' && $post['trip'] != $currentgame['knight']){
- $currentgame['paladin'] = $post['trip'];
- file_put_contents($gamelog, json_encode($currentgame));
- }else{
- $response = postCom(">>" . $post['no'] . PHP_EOL . "You cannot play both classes.", $net['thread'], false, $net['servKey'], false, false);
- }
- if($currentgame['knight'] != 'none' && $currentgame['paladin'] != 'none'){
- $data = array();
- $palitrip = $currentgame['paladin'];
- $knighttrip = $currentgame['knight'];
- $data['dead'] = 0;
- $data['paladin'] = $palitrip;
- $data['knight'] = $knighttrip;
- $data['sorcerer'] = 'xa';
- $data['druid'] = 'xa';
- $data[$palitrip] = array();
- $data[$palitrip]['class'] = 'paladin';
- $data[$palitrip]['hp_max'] = 100;
- $data[$palitrip]['hp'] = 100;
- $data[$palitrip]['mana_max'] = 125;
- $data[$palitrip]['mana'] = 125;
- $data[$palitrip]['set'] = 'basic';
- $data[$knighttrip] = array();
- $data[$knighttrip]['class'] = 'knight';
- $data[$knighttrip]['hp_max'] = 140;
- $data[$knighttrip]['hp'] = 140;
- $data[$knighttrip]['mana_max'] = 0;
- $data[$knighttrip]['mana'] = 0;
- $data[$knighttrip]['set'] = 'basic';
- $data[$sorctrip] = array();
- $data[$sorctrip]['class'] = 'sorcerer';
- $data[$sorctrip]['hp_max'] = 70;
- $data[$sorctrip]['hp'] = 70;
- $data[$sorctrip]['mana_max'] = 250;
- $data[$sorctrip]['mana'] = 250;
- $data[$sorctrip]['set'] = 'basic';
- $data[$druidtrip] = array();
- $data[$druidtrip]['class'] = 'druid';
- $data[$druidtrip]['hp_max'] = 70;
- $data[$druidtrip]['hp'] = 70;
- $data[$druidtrip]['mana_max'] = 250;
- $data[$druidtrip]['mana'] = 250;
- $data[$druidtrip]['set'] = 'basic';
- $data['sets'] = array();
- $data['sets']['basic'] = array();
- $data['sets']['basic']['damage'] = 10;
- $data['sets']['basic']['defense'] = 10;
- $data['sets']['basic']['cost'] = 0;
- $data['sets']['good'] = array();
- $data['sets']['good']['damage'] = 15;
- $data['sets']['good']['defense'] = 15;
- $data['sets']['good']['cost'] = 200;
- $data['sets']['great'] = array();
- $data['sets']['great']['damage'] = 20;
- $data['sets']['great']['defense'] = 20;
- $data['sets']['great']['cost'] = 400;
- $data['spells'] = array();
- $data['spells']['frigo'] = array();
- $data['spells']['frigo']['damage'] = 0;
- $data['spells']['frigo']['status'] = 'frozen';
- $data['spells']['frigo']['mana'] = 25;
- $data['spells']['exori'] = array();
- $data['spells']['exori']['damage'] = 50;
- $data['spells']['exori']['status'] = 'none';
- $data['spells']['exori']['mana'] = 30;
- $data['monsters'] = array();
- $data['monsters']['dragon'] = array();
- $data['monsters']['dragon']['hp_max'] = 300;
- $data['monsters']['dragon']['hp'] = 300;
- $data['monsters']['dragon']['max_damage'] = 55;
- $data['monsters']['dragon']['min_damage'] = 15;
- $data['monsters']['dragon']['img'] = 'dragon.png';
- $data['monsters']['dragon']['size'] = 64;
- $data['monsters']['dragon']['frozen'] = false;
- $data['monsters']['dragon']['frozen_turns'] = 0;
- $data['monsters']['dragon']['burned'] = false;
- $data['monsters']['dragon']['burned_turns'] = 0;
- $data['monsters']['dragon']['poisoned'] = false;
- $data['monsters']['dragon']['poisoned_turns'] = 0;
- $data['monsters']['dragon']['immune'] = 'burned';
- $data['monsters']['dragon']['dead'] = false;
- $data['monsters']['dragon']['loot_min'] = 400;
- $data['monsters']['dragon']['loot_max'] = 600;
- $data['monsters']['dragon']['loot'] = 0;
- $data['monsters']['demon'] = array();
- $data['monsters']['demon']['hp_max'] = 400;
- $data['monsters']['demon']['hp'] = 400;
- $data['monsters']['demon']['max_damage'] = 60;
- $data['monsters']['demon']['min_damage'] = 15;
- $data['monsters']['demon']['img'] = 'demon.png';
- $data['monsters']['demon']['size'] = 64;
- $data['monsters']['demon']['frozen'] = false;
- $data['monsters']['demon']['frozen_turns'] = 0;
- $data['monsters']['demon']['burned'] = false;
- $data['monsters']['demon']['burned_turns'] = 0;
- $data['monsters']['demon']['poisoned'] = false;
- $data['monsters']['demon']['poisoned_turns'] = 0;
- $data['monsters']['demon']['immune'] = 'burned';
- $data['monsters']['demon']['dead'] = false;
- $data['monsters']['demon']['loot_min'] = 600;
- $data['monsters']['demon']['loot_max'] = 1300;
- $data['monsters']['demon']['loot'] = 0;
- $data['monsters']['braindeath'] = array();
- $data['monsters']['braindeath']['hp_max'] = 350;
- $data['monsters']['braindeath']['hp'] = 350;
- $data['monsters']['braindeath']['max_damage'] = 60;
- $data['monsters']['braindeath']['min_damage'] = 5;
- $data['monsters']['braindeath']['img'] = 'braindeath.png';
- $data['monsters']['braindeath']['size'] = 64;
- $data['monsters']['braindeath']['frozen'] = false;
- $data['monsters']['braindeath']['frozen_turns'] = 0;
- $data['monsters']['braindeath']['burned'] = false;
- $data['monsters']['braindeath']['burned_turns'] = 0;
- $data['monsters']['braindeath']['poisoned'] = false;
- $data['monsters']['braindeath']['poisoned_turns'] = 0;
- $data['monsters']['braindeath']['immune'] = 'poisoned';
- $data['monsters']['braindeath']['dead'] = false;
- $data['monsters']['braindeath']['loot_min'] = 500;
- $data['monsters']['braindeath']['loot_max'] = 800;
- $data['monsters']['braindeath']['loot'] = 0;
- $data['monsters']['firelord'] = array();
- $data['monsters']['firelord']['hp_max'] = 400;
- $data['monsters']['firelord']['hp'] = 400;
- $data['monsters']['firelord']['max_damage'] = 50;
- $data['monsters']['firelord']['min_damage'] = 15;
- $data['monsters']['firelord']['img'] = 'lavalord.png';
- $data['monsters']['firelord']['size'] = 64;
- $data['monsters']['firelord']['frozen'] = false;
- $data['monsters']['firelord']['frozen_turns'] = 0;
- $data['monsters']['firelord']['burned'] = false;
- $data['monsters']['firelord']['burned_turns'] = 0;
- $data['monsters']['firelord']['poisoned'] = false;
- $data['monsters']['firelord']['poisoned_turns'] = 0;
- $data['monsters']['firelord']['immune'] = 'burned';
- $data['monsters']['firelord']['dead'] = false;
- $data['monsters']['firelord']['loot_min'] = 600;
- $data['monsters']['firelord']['loot_max'] = 1000;
- $data['monsters']['firelord']['loot'] = 0;
- $data['monsters']['golem'] = array();
- $data['monsters']['golem']['hp_max'] = 250;
- $data['monsters']['golem']['hp'] = 250;
- $data['monsters']['golem']['max_damage'] = 55;
- $data['monsters']['golem']['min_damage'] = 10;
- $data['monsters']['golem']['img'] = 'golem.png';
- $data['monsters']['golem']['size'] = 64;
- $data['monsters']['golem']['frozen'] = false;
- $data['monsters']['golem']['frozen_turns'] = 0;
- $data['monsters']['golem']['burned'] = false;
- $data['monsters']['golem']['burned_turns'] = 0;
- $data['monsters']['golem']['poisoned'] = false;
- $data['monsters']['golem']['poisoned_turns'] = 0;
- $data['monsters']['golem']['immune'] = 'poisoned';
- $data['monsters']['golem']['dead'] = false;
- $data['monsters']['golem']['loot_min'] = 400;
- $data['monsters']['golem']['loot_max'] = 700;
- $data['monsters']['golem']['loot'] = 0;
- $data['monsters']['icelord'] = array();
- $data['monsters']['icelord']['hp_max'] = 375;
- $data['monsters']['icelord']['hp'] = 375;
- $data['monsters']['icelord']['max_damage'] = 60;
- $data['monsters']['icelord']['min_damage'] = 10;
- $data['monsters']['icelord']['img'] = 'icelord.png';
- $data['monsters']['icelord']['size'] = 64;
- $data['monsters']['icelord']['frozen'] = false;
- $data['monsters']['icelord']['frozen_turns'] = 0;
- $data['monsters']['icelord']['burned'] = false;
- $data['monsters']['icelord']['burned_turns'] = 0;
- $data['monsters']['icelord']['poisoned'] = false;
- $data['monsters']['icelord']['poisoned_turns'] = 0;
- $data['monsters']['icelord']['immune'] = 'frozen';
- $data['monsters']['icelord']['dead'] = false;
- $data['monsters']['icelord']['loot_min'] = 700;
- $data['monsters']['icelord']['loot_max'] = 1200;
- $data['monsters']['icelord']['loot'] = 0;
- $selectMonster = array('dragon', 'demon', 'braindeath', 'firelord', 'golem', 'icelord');
- $monster = $selectMonster[array_rand($selectMonster)];
- $data['monster'] = $monster;
- $data['monsters'][$data['monster']]['loot'] = mt_rand($data['monsters'][$data['monster']]['loot_min'], $data['monsters'][$data['monster']]['loot_max']);
- file_put_contents($gamelog, json_encode($data));
- $currentgame = json_decode(file_get_contents($gamelog), true);
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $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);
- }
- }else if(!$post['trip']){
- $response = postCom(">>" . $post['no'] . PHP_EOL . "a tripcode is required to play this game.", $net['thread'], false, $net['servKey'], false, false);
- }else if($currentgame['knight'] == $post['trip'] && $moduleText == 'good set' || $currentgame['paladin'] == $post['trip'] && $moduleText == 'good set'){
- if($currentgame[$post['trip']]['set'] == 'basic'){
- $bankapi = json_decode(file_get_contents('https://erin.wtf/securebank?p=&t='.urlencode($post['trip'])), true);
- if(!$bankapi['error'] && $bankapi['balance'] >= $currentgame['sets']['good']['cost']){
- $bankapix = json_decode(file_get_contents("https://erin.wtf/securetransfer?m=true&a=" . $currentgame['sets']['good']['cost'] . "&p=&t=" . urlencode($post['trip']) . "&r=" . urlencode('!Bank..5Wfo')), true);
- if(!$bankapix['error']){
- $currentgame[$post['trip']]['set'] = 'good';
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $response = postComDraw(">>" . $post['no'] . PHP_EOL . "You bought the good set for " . $bankapix['formatted'] . ".", $net['thread'], false, $net['servKey'], false, $getboard);
- file_put_contents($gamelog, json_encode($currentgame));
- }else{
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $response = postComDraw(">>" . $post['no'] . PHP_EOL . "There was an error:" . PHP_EOL . $bankapix['error'], $net['thread'], false, $net['servKey'], false, $getboard);
- file_put_contents($gamelog, json_encode($currentgame));
- }
- }else{
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $response = postComDraw(">>" . $post['no'] . PHP_EOL . "You can not afford this set!", $net['thread'], false, $net['servKey'], false, $getboard);
- file_put_contents($gamelog, json_encode($currentgame));
- }
- }else{
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $response = postComDraw(">>" . $post['no'] . PHP_EOL . "This is no better than your current set.", $net['thread'], false, $net['servKey'], false, $getboard);
- file_put_contents($gamelog, json_encode($currentgame));
- }
- }else if($currentgame['knight'] == $post['trip'] && $moduleText == 'great set' || $currentgame['paladin'] == $post['trip'] && $moduleText == 'great set'){
- if($currentgame[$post['trip']]['set'] == 'basic' || $currentgame[$post['trip']]['set'] == 'good'){
- $bankapi = json_decode(file_get_contents('https://erin.wtf/securebank?p=&t='.urlencode($post['trip'])), true);
- if(!$bankapi['error'] && $bankapi['balance'] >= $currentgame['sets']['great']['cost']){
- $bankapix = json_decode(file_get_contents("https://erin.wtf/securetransfer?m=true&a=" . $currentgame['sets']['great']['cost'] . "&p=&t=" . urlencode($post['trip']) . "&r=" . urlencode('!Bank..5Wfo')), true);
- if(!$bankapix['error']){
- $currentgame[$post['trip']]['set'] = 'great';
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $response = postComDraw(">>" . $post['no'] . PHP_EOL . "You bought the good set for " . $bankapix['formatted'] . ".", $net['thread'], false, $net['servKey'], false, $getboard);
- file_put_contents($gamelog, json_encode($currentgame));
- }else{
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $response = postComDraw(">>" . $post['no'] . PHP_EOL . "There was an error:" . PHP_EOL . $bankapix['error'], $net['thread'], false, $net['servKey'], false, $getboard);
- file_put_contents($gamelog, json_encode($currentgame));
- }
- }else{
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $response = postComDraw(">>" . $post['no'] . PHP_EOL . "You can not afford this set!", $net['thread'], false, $net['servKey'], false, $getboard);
- file_put_contents($gamelog, json_encode($currentgame));
- }
- }else{
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $response = postComDraw(">>" . $post['no'] . PHP_EOL . "This is no better than your current set.", $net['thread'], false, $net['servKey'], false, $getboard);
- file_put_contents($gamelog, json_encode($currentgame));
- }
- }else if($currentgame['knight'] == $post['trip']){
- if($currentgame[$currentgame['knight']]['hp'] > 0){
- $statusDamage = 0;
- $statusText = '';
- if($currentgame['monsters'][$currentgame['monster']]['burned'] == true){
- $burnDamage = 20;
- $statusDamage += $burnDamage;
- $currentgame['monsters'][$currentgame['monster']]['burned_turns']--;
- $currentgame['monsters'][$currentgame['monster']]['hp'] = $currentgame['monsters'][$currentgame['monster']]['hp'] - $burnDamage;
- $statusText += PHP_EOL . "Burn hurt the " . $currentgame['monster'] . " for " . $burnDamage . ".";
- if($currentgame['monsters'][$currentgame['monster']]['burned_turns'] == 0){
- $currentgame['monsters'][$currentgame['monster']]['burned'] = false;
- $statusText += PHP_EOL . "Burn wore off.";
- }
- file_put_contents($gamelog, json_encode($currentgame));
- if($currentgame['monsters'][$currentgame['monster']]['hp'] <= 0){
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $looted = intval($currentgame['monsters'][$currentgame['monster']]['loot']/2); $bankapix = json_decode(file_get_contents("https://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['knight'])), true);
- $bankapix = json_decode(file_get_contents("https://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['paladin'])), true);
- $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);
- $data = array();
- $data['paladin'] = 'none';
- $data['knight'] = 'none';
- file_put_contents($gamelog, json_encode($data));
- }
- }
- if($currentgame['monsters'][$currentgame['monster']]['poisoned'] == true){
- $poisonDamage = 10*$currentgame['monsters'][$currentgame['monster']]['poisoned_turns'];
- $statusDamage += $poisonDamage;
- $currentgame['monsters'][$currentgame['monster']]['poisoned_turns']--;
- $currentgame['monsters'][$currentgame['monster']]['hp'] = $currentgame['monsters'][$currentgame['monster']]['hp'] - $poisonDamage;
- $statusText += PHP_EOL . "Poison hurt the " . $currentgame['monster'] . " for " . $poisonDamage . ".";
- if($currentgame['monsters'][$currentgame['monster']]['poisoned_turns'] == 0){
- $currentgame['monsters'][$currentgame['monster']]['poisoned'] = false;
- $statusText += PHP_EOL . "Poison wore off.";
- }
- file_put_contents($gamelog, json_encode($currentgame));
- if($currentgame['monsters'][$currentgame['monster']]['hp'] <= 0){
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $looted = intval($currentgame['monsters'][$currentgame['monster']]['loot']/2); $bankapix = json_decode(file_get_contents("https://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['knight'])), true);
- $bankapix = json_decode(file_get_contents("https://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['paladin'])), true);
- $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);
- $data = array();
- $data['paladin'] = 'none';
- $data['knight'] = 'none';
- file_put_contents($gamelog, json_encode($data));
- }
- }
- if($currentgame['monsters'][$currentgame['monster']]['hp'] > 0){
- $attackDamage = mt_rand(1, 30) + $currentgame['sets'][$currentgame[$currentgame['knight']]['set']]['damage'];
- $currentgame['monsters'][$currentgame['monster']]['hp'] = $currentgame['monsters'][$currentgame['monster']]['hp'] - $attackDamage;
- if($currentgame['monsters'][$currentgame['monster']]['hp'] <= 0){
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $looted = intval($currentgame['monsters'][$currentgame['monster']]['loot']/2); $bankapix = json_decode(file_get_contents("https://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['knight'])), true);
- $bankapix = json_decode(file_get_contents("https://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['paladin'])), true);
- $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);
- $data = array();
- $data['paladin'] = 'none';
- $data['knight'] = 'none';
- file_put_contents($gamelog, json_encode($data));
- }else{
- if($currentgame['monsters'][$currentgame['monster']]['frozen'] == false){
- $monsterDamage = mt_rand($currentgame['monsters'][$currentgame['monster']]['min_damage'], $currentgame['monsters'][$currentgame['monster']]['max_damage']) - $currentgame['sets'][$currentgame[$currentgame['knight']]['set']]['defense'];
- if($monsterDamage < 0){
- $monsterDamage = 0;
- }
- $currentgame[$currentgame['knight']]['hp'] = $currentgame[$currentgame['knight']]['hp'] - $monsterDamage;
- if($currentgame[$currentgame['knight']]['hp'] > 0){
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $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);
- file_put_contents($gamelog, json_encode($currentgame));
- }else{
- if($currentgame['dead'] == 0){
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $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);
- $currentgame['dead']++;
- file_put_contents($gamelog, json_encode($currentgame));
- }else{
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $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);
- $data = array();
- $data['paladin'] = 'none';
- $data['knight'] = 'none';
- file_put_contents($gamelog, json_encode($data));
- }
- }
- }else{
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $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);
- $currentgame['monsters'][$currentgame['monster']]['frozen_turns']--;
- if($currentgame['monsters'][$currentgame['monster']]['frozen_turns'] == 0){
- $currentgame['monsters'][$currentgame['monster']]['frozen'] = false;
- file_put_contents($gamelog, json_encode($currentgame));
- sleep(20);
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $response = postComDraw("The freezing spell wore off!", $net['thread'], false, $net['servKey'], false, $getboard);
- }
- file_put_contents($gamelog, json_encode($currentgame));
- }
- }
- }
- }else{
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $response = postComDraw(">>" . $post['no'] . PHP_EOL . "You are already dead!", $net['thread'], false, $net['servKey'], false, $getboard);
- }
- }else if($currentgame['paladin'] == $post['trip']){
- if($currentgame[$currentgame['paladin']]['hp'] > 0){
- $statusDamage = 0;
- $statusText = '';
- if($currentgame['monsters'][$currentgame['monster']]['burned'] == true){
- $burnDamage = 20;
- $statusDamage += $burnDamage;
- $currentgame['monsters'][$currentgame['monster']]['burned_turns']--;
- $currentgame['monsters'][$currentgame['monster']]['hp'] = $currentgame['monsters'][$currentgame['monster']]['hp'] - $burnDamage;
- $statusText += PHP_EOL . "Burn hurt the " . $currentgame['monster'] . " for " . $burnDamage . ".";
- if($currentgame['monsters'][$currentgame['monster']]['burned_turns'] == 0){
- $currentgame['monsters'][$currentgame['monster']]['burned'] = false;
- $statusText += PHP_EOL . "Burn wore off.";
- }
- file_put_contents($gamelog, json_encode($currentgame));
- if($currentgame['monsters'][$currentgame['monster']]['hp'] <= 0){
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $looted = intval($currentgame['monsters'][$currentgame['monster']]['loot']/2); $bankapix = json_decode(file_get_contents("https://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['knight'])), true);
- $bankapix = json_decode(file_get_contents("https://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['paladin'])), true);
- $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);
- $data = array();
- $data['paladin'] = 'none';
- $data['knight'] = 'none';
- file_put_contents($gamelog, json_encode($data));
- }
- }
- if($currentgame['monsters'][$currentgame['monster']]['poisoned'] == true){
- $poisonDamage = 10*$currentgame['monsters'][$currentgame['monster']]['poisoned_turns'];
- $statusDamage += $poisonDamage;
- $currentgame['monsters'][$currentgame['monster']]['poisoned_turns']--;
- $currentgame['monsters'][$currentgame['monster']]['hp'] = $currentgame['monsters'][$currentgame['monster']]['hp'] - $poisonDamage;
- $statusText += PHP_EOL . "Poison hurt the " . $currentgame['monster'] . " for " . $poisonDamage . ".";
- if($currentgame['monsters'][$currentgame['monster']]['poisoned_turns'] == 0){
- $currentgame['monsters'][$currentgame['monster']]['poisoned'] = false;
- $statusText += PHP_EOL . "Poison wore off.";
- }
- file_put_contents($gamelog, json_encode($currentgame));
- if($currentgame['monsters'][$currentgame['monster']]['hp'] <= 0){
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $looted = intval($currentgame['monsters'][$currentgame['monster']]['loot']/2); $bankapix = json_decode(file_get_contents("https://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['knight'])), true);
- $bankapix = json_decode(file_get_contents("https://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['paladin'])), true);
- $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);
- $data = array();
- $data['paladin'] = 'none';
- $data['knight'] = 'none';
- file_put_contents($gamelog, json_encode($data));
- }
- }
- if($moduleText != 'exori' && $moduleText != 'frigo' && $currentgame['monsters'][$currentgame['monster']]['hp'] > 0){
- $attackDamage = mt_rand(1, 20) + $currentgame['sets'][$currentgame[$currentgame['paladin']]['set']]['damage'];
- $currentgame['monsters'][$currentgame['monster']]['hp'] = $currentgame['monsters'][$currentgame['monster']]['hp'] - $attackDamage;
- if($currentgame['monsters'][$currentgame['monster']]['hp'] <= 0){
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $looted = intval($currentgame['monsters'][$currentgame['monster']]['loot']/2);
- $bankapix = json_decode(file_get_contents("https://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['knight'])), true);
- $bankapix = json_decode(file_get_contents("https://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['paladin'])), true);
- $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);
- $data = array();
- $data['paladin'] = 'none';
- $data['knight'] = 'none';
- file_put_contents($gamelog, json_encode($data));
- }else{
- if($currentgame['monsters'][$currentgame['monster']]['frozen'] == false){
- $monsterDamage = mt_rand($currentgame['monsters'][$currentgame['monster']]['min_damage'], $currentgame['monsters'][$currentgame['monster']]['max_damage']) - $currentgame['sets'][$currentgame[$currentgame['paladin']]['set']]['defense'];
- if($monsterDamage < 0){
- $monsterDamage = 0;
- }
- $currentgame[$currentgame['paladin']]['hp'] = $currentgame[$currentgame['paladin']]['hp'] - $monsterDamage;
- if($currentgame[$currentgame['paladin']]['hp'] > 0){
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $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);
- file_put_contents($gamelog, json_encode($currentgame));
- }else{
- if($currentgame['dead'] == 0){
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $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);
- $currentgame['dead']++;
- file_put_contents($gamelog, json_encode($currentgame));
- }else{
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $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);
- $data = array();
- $data['paladin'] = 'none';
- $data['knight'] = 'none';
- file_put_contents($gamelog, json_encode($data));
- }
- }
- }else{
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $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);
- $currentgame['monsters'][$currentgame['monster']]['frozen_turns']--;
- if($currentgame['monsters'][$currentgame['monster']]['frozen_turns'] == 0){
- $currentgame['monsters'][$currentgame['monster']]['frozen'] = false;
- file_put_contents($gamelog, json_encode($currentgame));
- sleep(20);
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $response = postComDraw("The freezing spell wore off!", $net['thread'], false, $net['servKey'], false, $getboard);
- }
- file_put_contents($gamelog, json_encode($currentgame));
- }
- }
- }else if($moduleText == 'exori' && $currentgame['monsters'][$currentgame['monster']]['hp'] > 0){
- if($currentgame[$currentgame['paladin']]['mana'] >= $currentgame['spells']['exori']['mana']){
- $attackDamage = $currentgame['spells']['exori']['damage'];
- $currentgame['monsters'][$currentgame['monster']]['hp'] = $currentgame['monsters'][$currentgame['monster']]['hp'] - $attackDamage;
- $currentgame[$currentgame['paladin']]['mana'] = $currentgame[$currentgame['paladin']]['mana'] - $currentgame['spells']['exori']['mana'];
- }else{
- $attackDamage = 'low mana';
- }
- if($currentgame['monsters'][$currentgame['monster']]['hp'] <= 0){
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $looted = intval($currentgame['monsters'][$currentgame['monster']]['loot']/2);
- $bankapix = json_decode(file_get_contents("https://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['knight'])), true);
- $bankapix = json_decode(file_get_contents("https://erin.wtf/securetransfer?m=true&a=" . $looted . "&p=&t=" . urlencode('!Bank..5Wfo') . "&r=" . urlencode($currentgame['paladin'])), true);
- $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);
- $data = array();
- $data['paladin'] = 'none';
- $data['knight'] = 'none';
- file_put_contents($gamelog, json_encode($data));
- }else{
- if($currentgame['monsters'][$currentgame['monster']]['frozen'] == false){
- $monsterDamage = mt_rand($currentgame['monsters'][$currentgame['monster']]['min_damage'], $currentgame['monsters'][$currentgame['monster']]['max_damage']) - $currentgame['sets'][$currentgame[$currentgame['paladin']]['set']]['defense'];
- if($monsterDamage < 0){
- $monsterDamage = 0;
- }
- $currentgame[$currentgame['paladin']]['hp'] = $currentgame[$currentgame['paladin']]['hp'] - $monsterDamage;
- if($currentgame[$currentgame['paladin']]['hp'] > 0){
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- if($attackDamage != 'low mana'){
- $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);
- }else{
- $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);
- }
- file_put_contents($gamelog, json_encode($currentgame));
- }else{
- if($currentgame['dead'] == 0){
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- if($attackDamage != 'low mana'){
- $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);
- }else{
- $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);
- }
- $currentgame['dead']++;
- file_put_contents($gamelog, json_encode($currentgame));
- }else{
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- if($attackDamage != 'low mana'){
- $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);
- }else{
- $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);
- }
- $data = array();
- $data['paladin'] = 'none';
- $data['knight'] = 'none';
- file_put_contents($gamelog, json_encode($data));
- }
- }
- }else{
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- if($attackDamage != 'low mana'){
- $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);
- }else{
- $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);
- }
- $currentgame['monsters'][$currentgame['monster']]['frozen_turns']--;
- if($currentgame['monsters'][$currentgame['monster']]['frozen_turns'] == 0){
- $currentgame['monsters'][$currentgame['monster']]['frozen'] = false;
- file_put_contents($gamelog, json_encode($currentgame));
- sleep(20);
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $response = postComDraw("The freezing spell wore off!", $net['thread'], false, $net['servKey'], false, $getboard);
- }
- file_put_contents($gamelog, json_encode($currentgame));
- }
- }
- }else if($moduleText == 'frigo' && $currentgame['monsters'][$currentgame['monster']]['hp'] > 0){
- if($currentgame[$currentgame['paladin']]['mana'] >= $currentgame['spells']['frigo']['mana'] && $currentgame['monsters'][$currentgame['monster']]['immune'] != 'frozen'){
- $currentgame['monsters'][$currentgame['monster']]['frozen'] = true;
- $currentgame['monsters'][$currentgame['monster']]['frozen_turns'] = 3;
- $currentgame[$currentgame['paladin']]['mana'] = $currentgame[$currentgame['paladin']]['mana'] - $currentgame['spells']['frigo']['mana'];
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $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));
- }else{
- $attackDamage = 'low mana';
- if($currentgame['monsters'][$currentgame['monster']]['frozen'] == false){
- $monsterDamage = mt_rand($currentgame['monsters'][$currentgame['monster']]['min_damage'], $currentgame['monsters'][$currentgame['monster']]['max_damage']);
- $currentgame[$currentgame['paladin']]['hp'] = $currentgame[$currentgame['paladin']]['hp'] - $monsterDamage;
- if($currentgame[$currentgame['paladin']]['hp'] > 0){
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- if($attackDamage != 'low mana'){
- $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);
- }else{
- $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);
- }
- file_put_contents($gamelog, json_encode($currentgame));
- }else{
- if($currentgame['dead'] == 0){
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- if($attackDamage != 'low mana'){
- $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);
- }else{
- $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);
- }
- $currentgame['dead']++;
- file_put_contents($gamelog, json_encode($currentgame));
- }else{
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- if($attackDamage != 'low mana'){
- $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);
- }else{
- $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);
- }
- $data = array();
- $data['paladin'] = 'none';
- $data['knight'] = 'none';
- file_put_contents($gamelog, json_encode($data));
- }
- }
- }else{
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- if($attackDamage != 'low mana'){
- $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);
- }else{
- $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);
- }
- $currentgame['monsters'][$currentgame['monster']]['frozen_turns']--;
- if($currentgame['monsters'][$currentgame['monster']]['frozen_turns'] == 0){
- $currentgame['monsters'][$currentgame['monster']]['frozen'] = false;
- file_put_contents($gamelog, json_encode($currentgame));
- sleep(20);
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $response = postComDraw("The freezing spell wore off!", $net['thread'], false, $net['servKey'], false, $getboard);
- }
- file_put_contents($gamelog, json_encode($currentgame));
- }
- }
- }
- }else{
- genImage($currentgame['knight'], $currentgame['paladin'], 'xa', 'xb', $currentgame['monster'], 2, $currentgame);
- $response = postComDraw(">>" . $post['no'] . PHP_EOL . "You are already dead!", $net['thread'], false, $net['servKey'], false, $getboard);
- }
- }else{
- $response = postCom(">>" . $post['no'] . PHP_EOL . "You are not an adventurer in this encounter.", $net['thread'], false, $net['servKey'], false, false);
- }
- $response = json_decode($response, true);
- $net['log'] = json_decode(file_get_contents($net['logFile']), true);
- $thisLog = array();
- $thisLog['time'] = tSmp();
- $thisLog['no'] = $post['no'];
- $thisLog['thread'] = $net['thread'];
- $thisLog['name'] = $post['name'].$post['trip'];
- $thisLog['command'] = 'skynet.' . $module . ': ' . $moduleText . ';';
- $thisLog['response'] = $response['id'];
- $thisLog['board'] = $getboard;
- $net['log'][$post['no']] = $thisLog;
- file_put_contents($net['logFile'], json_encode($net['log']));
- $net['log'] = json_decode(file_get_contents($net['logFile']), true);
- echo '>>' . $response['id'] . '<br>';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement