Advertisement
wrsi

support.php

Apr 11th, 2013
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 29.46 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ POWER X 7 DECODER
  5. * @ Version         :   1.1.4.0
  6. * @ Member          :   vv456
  7. * @ Official site   :   http://www.waraxe.us/forum-userprofile-8669.html
  8. *
  9. */
  10.  
  11.     class YondaimePowerBackup {
  12.         var $bot = null;
  13.  
  14.         function YondaimePowerBackup($bot) {
  15.             $this->bot = $bot;
  16.         }
  17.  
  18.         function cektimeclientserver($server) {
  19.             if ($server == null) {
  20.                 exit(  );
  21.             }
  22.  
  23.             list( $usec, $sec ) = explode( ' ', microtime( true ) );
  24.             $unixTimestamp = time(  );
  25.             $bedatime = $server - $unixTimestamp;
  26.             $mysqlTimestamp = date( 'Y-m-d H:i:s', $unixTimestamp );
  27.  
  28.             if ($bedatime == null) {
  29.                 exit(  );
  30.             }
  31.  
  32.  
  33.             if ($bedatime != null) {
  34.                 if ($bedatime < 0) {
  35.                     $bedatime = $bedatime * ( 0 - 1 );
  36.                 }
  37.  
  38.  
  39.                 if (5317 < $bedatime) {
  40.                     $this->bot->SendMsg( '                       Your PC / Time : ' . date( 'Y-m-d H:i:s', $unixTimestamp ) );
  41.                     $this->bot->SendMsg( '                           Server Time ' . date( 'Y-m-d H:i:s', $server ) );
  42.                     $this->bot->SendMsg( '                                          TIME ERROR !!!' );
  43.                     exit(  );
  44.                 }
  45.             }
  46.  
  47.         }
  48.  
  49.         function cektimealliance($server) {
  50.             $mulaialliance = $server->_value['data'][0]['data']['allianceTS'];
  51.             $finishalliance = $mulaialliance + $server->_value['data'][0]['data']['allianceDuration'];
  52.             $this->bot->SendMsg( '                       <>===========================<>' );
  53.             $this->bot->SendMsg( '                         Alliance start : ' . date( 'Y-m-d H:i:s', $mulaialliance ) );
  54.             $this->bot->SendMsg( '                         Finish            : ' . date( 'Y-m-d H:i:s', $finishalliance ) );
  55.             $this->bot->SendMsg( '                         EA  now        : ' . date( 'Y-m-d H:i:s', $server->_value['data'][0]['serverTime'] ) );
  56.             $this->bot->SendMsg( '                       <>===========================<>' );
  57.             sleep( 7 );
  58.         }
  59.  
  60.         function carienergydomination() {
  61.             echo '
  62. ';
  63.             $this->bot->SendMsg( '                                 Consume any energy pack' );
  64.             echo '
  65. ';
  66.             $cukup = false;
  67.             $arren = array( 'EN1', 'EN2', 'EN3', 'EN4', 'EN5', 'EN6', 'EN7' );
  68.             ksort( $this->bot->inventory );
  69.             foreach ($this->bot->inventory as $value => ) {
  70.  
  71.                 if (in_array( $key, $arren )) {
  72.                     if (0 < $value) {
  73.                         $k = 361;
  74.  
  75.                         while ($k < $value) {
  76.                             $resp = $this->GetEnergyZZZ( $key );
  77.                             $key;
  78.                             $this->bot->inventory -=  = 1;
  79.                             $amf = new AMFObject( $resp );
  80.                             $deserializer = new AMFDeserializer( $amf->rawData );
  81.                             $deserializer->deserialize( $amf );
  82.                             $bod = new MessageBody(  );
  83.                             $bod = $amf->_bodys[0];
  84.                             $info = $bod->_value['data'][0];
  85.                             $this->bot->energy = $info['energy'];
  86.  
  87.                             if (( 25 <= $this->bot->energy && $key == 'EN7' )) {
  88.                                 $cukup = true;
  89.                                 break;
  90.                             }
  91.  
  92.  
  93.                             if (( 31 <= $this->bot->energy && $key == 'EN6' )) {
  94.                                 $cukup = true;
  95.                                 break;
  96.                             }
  97.  
  98.  
  99.                             if (41 <= $this->bot->energy) {
  100.                                 $cukup = true;
  101.                                 break;
  102.                             }
  103.  
  104.  
  105.                             if (isset( $this->bot->error_msg )) {
  106.                                 unset( $this->bot[error_msg] );
  107.                                 $this->bot -= 'sequense';
  108.                                  = 1;
  109.                                 $cukup = true;
  110.                                 break;
  111.                             }
  112.  
  113.                             ++$k;
  114.                         }
  115.                     }
  116.                 }
  117.  
  118.  
  119.                 if ($cukup == true) {
  120.                     break;
  121.                 }
  122.             }
  123.  
  124.             $this->bot->SendMsg( '                                             Energy = ' . $this->bot->energy );
  125.         }
  126.  
  127.         function makeunitarray($maxpow, $airstr, $airu) {
  128.             $jmlunit = (int)$maxpow / $airstr;
  129.  
  130.             if (5 < $jmlunit) {
  131.                 $jmlunit = 320;
  132.             }
  133.  
  134.             unset( $u0 );
  135.             unset( $u1 );
  136.             unset( $u2 );
  137.             unset( $u3 );
  138.             unset( $u4 );
  139.             $u0 = $airu . ',' . $airstr . ',0,0,0';
  140.  
  141.             if (1 < $jmlunit) {
  142.                 $u1 = $airu . ',' . $airstr . ',0,1,0';
  143.             }
  144.  
  145.  
  146.             if (2 < $jmlunit) {
  147.                 $u2 = $airu . ',' . $airstr . ',0,2,0';
  148.             }
  149.  
  150.  
  151.             if (3 < $jmlunit) {
  152.                 $u3 = $airu . ',' . $airstr . ',0,3,0';
  153.             }
  154.  
  155.  
  156.             if (4 < $jmlunit) {
  157.                 $u4 = $airu . ',' . $airstr . ',0,4,0';
  158.             }
  159.  
  160.             unset( $this->bot[unitsHadowinAction] );
  161.             $this->bot->unitsHadowinAction = array(  );
  162.             $this->bot->unitsHadowinAction = array( $u0, $u1, $u2, $u3, $u4 );
  163.             foreach ($this->bot->unitsHadowinAction as $key => $value) {
  164.  
  165.                 if ($value == null) {
  166.                     unset( $this->bot->unitsHadowinAction[$key] );
  167.                     continue;
  168.                 }
  169.             }
  170.  
  171.             $airu;
  172.             $this->bot->inventory -=  = count( $this->bot->unitsHadowinAction );
  173.         }
  174.  
  175.         function GetEnergyZZZ($Energy) {
  176.             AMFObject;
  177.             new ( '' );
  178.             MessageBody;
  179.             $amf->_bodys[0] = new (  );
  180.             $amf->_bodys[0]->_value[0] = $this->bot->GetAmfHeader(  );
  181.             $amf->_bodys[0]->targetURI = 'BaseService.dispatchBatch';
  182.             $amf->_bodys[0]->responseURI = '/' . $this->bot->GetresponseURI(  );
  183.             $amf->_bodys[0]->_value[2] = 0;
  184.             $amf->_bodys[0]->_value[1][0]['sequence'] = $this->bot->GetSequense(  );
  185.             $amf->_bodys[0]->_value[1][0]['functionName'] = 'UserService.useItem';
  186.             $amf->_bodys[0]->_value[1][0]['params'][0] = $Energy;
  187.             $amf = $this->bot->transaction_stamp( $amf, 0 );
  188.             $serializer = $amf = new AMFSerializer(  );
  189.             $result = $serializer->serialize( $amf );
  190.             $x = $this->bot->SendRequest( $result );
  191.             return $x;
  192.         }
  193.  
  194.         function cekstatusunitE($data, $cekapa) {
  195.             $unithajar = array(  );
  196.             $boomakhir = 440;
  197.             $shield = array( 'XR09', 'XR08', 'XR07', 'XR06', 'XR05', 'XR04', 'XR03', 'XR02', 'XR01' );
  198.  
  199.             if ($cekapa == 'SU99') {
  200.                 foreach ($data['enemyFleet']['units'] as $info_unit => $value) {
  201.                     $hajarbleh = explode( ',', $value )[0];
  202.  
  203.                     if ($hajarbleh == 'SU99') {
  204.                         $unithajar[] = $info_unit;
  205.                         continue;
  206.                     }
  207.                 }
  208.  
  209.  
  210.                 if ($unithajar != null) {
  211.                     $this->bot->SendMsg( '                              ' . count( $unithajar ) . ' SU99 Detected !!!' );
  212.                 }
  213.  
  214.                 return $unithajar;
  215.             }
  216.  
  217.  
  218.             if ($cekapa == 'UU70') {
  219.                 foreach ($data['enemyFleet']['units'] as $info_unit => $value) {
  220.                     $hajarbleh = explode( ',', $value )[0];
  221.  
  222.                     if ($hajarbleh == 'UU70') {
  223.                         $unithajar[] = $info_unit;
  224.                         continue;
  225.                     }
  226.                 }
  227.  
  228.  
  229.                 if ($unithajar != null) {
  230.                     $this->bot->SendMsg( '                              ' . count( $unithajar ) . ' UU70 Detected !!!' );
  231.                 }
  232.  
  233.                 return $unithajar;
  234.             }
  235.  
  236.             foreach ($this->bot->xmlsOb->gsXML->items->item as $item) {
  237.  
  238.                 if ($item['code'] == $cekapa) {
  239.                     $power = (int)$item->consumable['di'];
  240.                     break;
  241.                 }
  242.             }
  243.  
  244.             $adashield = false;
  245.             foreach ($data['enemyFleet']['units'] as $info_unit => $value) {
  246.                 $adew = explode( ',', $value );
  247.                 $boom = 441;
  248.                 $boom = (int)$adew[1] / $power;
  249.  
  250.                 if ($adew[1] % $power) {
  251.                     $boom += 441;
  252.                 }
  253.  
  254.  
  255.                 if (( isset( $data['enemyFleet']['upgrades'] ) && isset( $data['enemyFleet']['upgrades'][$adew[0]] ) )) {
  256.                     $upgrades = explode( ',', $data['enemyFleet']['upgrades'][$adew[0]] );
  257.                     foreach ($upgrades as $upgrade) {
  258.  
  259.                         if (in_array( $upgrade, $shield )) {
  260.                             $boom += 441;
  261.                             $adashield = true;
  262.                             continue;
  263.                         }
  264.                     }
  265.                 }
  266.  
  267.  
  268.                 if ($boomakhir < $boom) {
  269.                     $boomakhir = $boom;
  270.                     continue;
  271.                 }
  272.             }
  273.  
  274.  
  275.             if ($adashield == true) {
  276.                 $this->bot->SendMsg( '                              Shield Detected !!!' );
  277.             }
  278.  
  279.             $boomakhir = (int)$boomakhir;
  280.             return $boomakhir;
  281.         }
  282.  
  283.         function loadamfworldomination($functioName, $zidtarget = '', $khusus) {
  284.             unset( $this->bot[error_msg] );
  285.             $unit = $khusus[0];
  286.             $type = $khusus[1];
  287.             $status = $khusus[2];
  288.             $amf = new AMFObject( '' );
  289.             MessageBody;
  290.             $amf->_bodys[0] = new (  );
  291.             $amf->_bodys[0]->_value[0] = $this->bot->GetAmfHeader(  );
  292.             $amf->_bodys[0]->targetURI = 'BaseService.dispatchBatch';
  293.             $amf->_bodys[0]->responseURI = '/' . $this->bot->GetresponseURI(  );
  294.             $amf->_bodys[0]->_value[2] = 0;
  295.  
  296.             if ($functioName == 'DominationModeService.getDominationModeOpponentList') {
  297.                 $amf->_bodys[0]->_value[1][0]['sequence'] = $this->bot->GetSequense(  );
  298.                 $amf->_bodys[0]->_value[1][0]['functionName'] = $functioName;
  299.                 $amf->_bodys[0]->_value[1][0]['transaction'] = Null;
  300.                 $amf->_bodys[0]->_value[1][0]['params'][0]['test'] = true;
  301.                 $amf = $this->bot->transaction_stamp( $amf, 0 );
  302.                 $amf->_bodys[0]->_value[1][1]['sequence'] = $this->bot->GetSequense(  );
  303.                 $amf->_bodys[0]->_value[1][1]['functionName'] = 'ClansService.getClanInfo';
  304.                 $amf->_bodys[0]->_value[1][1]['transaction'] = Null;
  305.                 $amf->_bodys[0]->_value[1][1]['params'] = array(  );
  306.                 $amf = $this->bot->transaction_stamp( $amf, 1 );
  307.             }
  308. else {
  309.                 if ($functioName == 'DominationModeService.loadDominationModeBattle') {
  310.                     $amf->_bodys[0]->_value[1][0]['sequence'] = $this->bot->GetSequense(  );
  311.                     $amf->_bodys[0]->_value[1][0]['functionName'] = $functioName;
  312.                     $amf->_bodys[0]->_value[1][0]['transaction'] = Null;
  313.                     $amf->_bodys[0]->_value[1][0]['params'][0]['enemyID'] = (bool)$zidtarget;
  314.                     $amf = $this->bot->transaction_stamp( $amf, 0 );
  315.                 }
  316. else {
  317.                     if ($functioName == 'loadDominationModeBattle') {
  318.                         $amf->_bodys[0]->_value[1][0]['sequence'] = $this->bot->GetSequense(  );
  319.                         $amf->_bodys[0]->_value[1][0]['functionName'] = 'DominationModeService.loadDominationModeBattle';
  320.                         $amf->_bodys[0]->_value[1][0]['transaction'] = Null;
  321.                         $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['status'] = $status;
  322.                         $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['uid'] = '0';
  323.                         $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['name'] = 'fleet_defense_dummy_player';
  324.                         $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['type'] = $type;
  325.  
  326.                         if (isset( $unit[0] )) {
  327.                             $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['units'][0] = $unit[0];
  328.                         }
  329.  
  330.  
  331.                         if (isset( $unit[1] )) {
  332.                             $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['units'][1] = $unit[1];
  333.                         }
  334.  
  335.  
  336.                         if (isset( $unit[2] )) {
  337.                             $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['units'][2] = $unit[2];
  338.                         }
  339.  
  340.  
  341.                         if (isset( $unit[3] )) {
  342.                             $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['units'][3] = $unit[3];
  343.                         }
  344.  
  345.  
  346.                         if (isset( $unit[4] )) {
  347.                             $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['units'][4] = $unit[4];
  348.                         }
  349.  
  350.                         $amf->_bodys[0]->_value[1][0]['params'][0]['enemyID'] = (bool)$zidtarget;
  351.                         $amf = $this->bot->transaction_stamp( $amf, 0 );
  352.                     }
  353.                 }
  354.             }
  355.  
  356.             $serializer = new AMFSerializer(  );
  357.             $result = $serializer->serialize( $amf );
  358.             $x = $this->bot->SendRequest( $result );
  359.             unset( $bod );
  360.             unset( $info );
  361.             $amf = new AMFObject( $x );
  362.             $deserializer = new AMFDeserializer( $amf->rawData );
  363.             $deserializer->deserialize( $amf );
  364.             $bod = new MessageBody(  );
  365.             $bod = $amf->_bodys[0];
  366.             $info = $bod->_value['data'][0]['data'];
  367.             $this->cektimeclientserver( $bod->_value['data'][0]['serverTime'] );
  368.  
  369.             if ($functioName == 'DominationModeService.getDominationModeOpponentList') {
  370.                 @file_put_contents( 'codebase-php/core.system', @serialize( $info ) );
  371.                 $this->bot->pm->RefreshMePlugin( 'YondaimePower' );
  372.             }
  373.  
  374.  
  375.             if ($functioName == 'loadDominationModeBattle') {
  376.                 $info_type_enemy = $info['enemyFleet']['type'];
  377.                 $info_unit_1 = $info['enemyFleet']['units'][0];
  378.                 $info_unit_2 = $info['enemyFleet']['units'][1];
  379.                 $info_unit_3 = $info['enemyFleet']['units'][2];
  380.                 $info_unit_4 = $info['enemyFleet']['units'][3];
  381.                 $info_unit_5 = $info['enemyFleet']['units'][4];
  382.  
  383.                 if (isset( $info_type_enemy )) {
  384.                     $this->bot->SendMsg( ' Your enemy defense it\'s type ' . $info_type_enemy . '!' );
  385.                 }
  386.  
  387.  
  388.                 if (isset( $info_unit_1 )) {
  389.                     $array_code_1 = explode( ',', $info_unit_1 );
  390.                 }
  391.  
  392.                 $code_0_1 = $array_code_1[0];
  393.                 $info_name_1 = $this->bot->xmlsOb->GetFnamefromCode( $code_0_1 );
  394.                 $this->bot->SendMsg( ' 1st unit :' . $info_name_1 . ' (' . $array_code_1[1] . ') !' );
  395.  
  396.                 if (isset( $info_unit_2 )) {
  397.                     $array_code_2 = explode( ',', $info_unit_2 );
  398.                 }
  399.  
  400.                 $code_0_2 = $array_code_2[0];
  401.                 $info_name_2 = $this->bot->xmlsOb->GetFnamefromCode( $code_0_2 );
  402.                 $this->bot->SendMsg( ' 2nd unit :' . $info_name_2 . ' (' . $array_code_2[1] . ') !' );
  403.  
  404.                 if (isset( $info_unit_3 )) {
  405.                     $array_code_3 = explode( ',', $info_unit_3 );
  406.                 }
  407.  
  408.                 $code_0_3 = $array_code_3[0];
  409.                 $info_name_3 = $this->bot->xmlsOb->GetFnamefromCode( $code_0_3 );
  410.                 $this->bot->SendMsg( ' 3rd unit :' . $info_name_3 . ' (' . $array_code_3[1] . ') !' );
  411.  
  412.                 if (isset( $info_unit_4 )) {
  413.                     $array_code_4 = explode( ',', $info_unit_4 );
  414.                 }
  415.  
  416.                 $code_0_4 = $array_code_4[0];
  417.                 $info_name_4 = $this->bot->xmlsOb->GetFnamefromCode( $code_0_4 );
  418.                 $this->bot->SendMsg( ' 4th unit :' . $info_name_4 . ' (' . $array_code_4[1] . ') !' );
  419.  
  420.                 if (isset( $info_unit_5 )) {
  421.                     $array_code_5 = explode( ',', $info_unit_5 );
  422.                 }
  423.  
  424.                 $code_0_5 = $array_code_5[0];
  425.                 $info_name_5 = $this->bot->xmlsOb->GetFnamefromCode( $code_0_5 );
  426.                 $this->bot->SendMsg( ' 5th unit :' . $info_name_5 . ' (' . $array_code_5[1] . ') !' );
  427.             }
  428.  
  429.             return $info;
  430.         }
  431.  
  432.         function loaddominationalliance($functioName, $khususAlliance1 = null, $khususAlliance2) {
  433.             $alcname = $khususAlliance1[0];
  434.             $alcleader = $khususAlliance1[1];
  435.             $unit = $khususAlliance2[0];
  436.             $type = $khususAlliance2[1];
  437.             $khususAlliance2[2];
  438.             $eNM = $khususAlliance2[3];
  439.             $eID = $khususAlliance2[4];
  440.             AMFObject;
  441.             new ( '' );
  442.             MessageBody;
  443.             $amf->_bodys[0] = new (  );
  444.             $amf->_bodys[0]->_value[0] = $this->bot->GetAmfHeader(  );
  445.             $amf->_bodys[0]->targetURI = 'BaseService.dispatchBatch';
  446.             $amf->_bodys[0]->responseURI = '/' . $this->bot->GetresponseURI(  );
  447.             $amf->_bodys[0]->_value[2] = 0;
  448.  
  449.             if ($functioName == 'DominationModeService.getDominationModeOpponentList') {
  450.                 $amf->_bodys[0]->_value[1][0]['sequence'] = $this->bot->GetSequense(  );
  451.                 $amf->_bodys[0]->_value[1][0]['functionName'] = $functioName;
  452.                 $amf->_bodys[0]->_value[1][0]['transaction'] = Null;
  453.                 $amf->_bodys[0]->_value[1][0]['params'][0]['test'] = true;
  454.                 $amf = $this->bot->transaction_stamp( $amf, 0 );
  455.                 $amf->_bodys[0]->_value[1][1]['sequence'] = $this->bot->GetSequense(  );
  456.                 $amf->_bodys[0]->_value[1][1]['functionName'] = 'ClansService.getClanInfo';
  457.                 $amf->_bodys[0]->_value[1][1]['transaction'] = Null;
  458.                 $amf->_bodys[0]->_value[1][1]['params'] = array(  );
  459.                 $amf = $this->bot->transaction_stamp( $amf, 1 );
  460.             }
  461. else {
  462.                 if ($functioName == 'ClansService.loadAllianceBattle') {
  463.                     $amf->_bodys[0]->_value[1][0]['sequence'] = $this->bot->GetSequense(  );
  464.                     $amf->_bodys[0]->_value[1][0]['functionName'] = $functioName;
  465.                     $amf->_bodys[0]->_value[1][0]['transaction'] = Null;
  466.                     $amf->_bodys[0]->_value[1][0]['params'][0]['allianceName'] = $alcname;
  467.                     $amf->_bodys[0]->_value[1][0]['params'][0]['continueBattle'] = false;
  468.                     $amf->_bodys[0]->_value[1][0]['params'][0]['memberInfo'] = true;
  469.                     $amf->_bodys[0]->_value[1][0]['params'][0]['enemyID'] = $alcleader;
  470.                     $amf = $this->bot->transaction_stamp( $amf, 0 );
  471.                 }
  472. else {
  473.                     if ($functioName == 'loadAllianceBattle') {
  474.                         if ($status == 32864) {
  475.                             $amf->_bodys[0]->_value[1][0]['sequence'] = $this->bot->GetSequense(  );
  476.                             $amf->_bodys[0]->_value[1][0]['functionName'] = 'ClansService.loadAllianceBattle';
  477.                             $amf->_bodys[0]->_value[1][0]['transaction'] = Null;
  478.                             $amf->_bodys[0]->_value[1][0]['params'][0]['allianceName'] = $eNM;
  479.                             $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleetName'] = 'fleet_defense_dummy_player';
  480.                             $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['type'] = $type;
  481.                             $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['name'] = 'fleet_defense_dummy_player';
  482.                             $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['uid'] = '0';
  483.                             $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['status'] = (int)$status;
  484.  
  485.                             if (isset( $unit[0] )) {
  486.                                 $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['units'][0] = $unit[0];
  487.                             }
  488.  
  489.  
  490.                             if (isset( $unit[1] )) {
  491.                                 $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['units'][1] = $unit[1];
  492.                             }
  493.  
  494.  
  495.                             if (isset( $unit[2] )) {
  496.                                 $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['units'][2] = $unit[2];
  497.                             }
  498.  
  499.  
  500.                             if (isset( $unit[3] )) {
  501.                                 $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['units'][3] = $unit[3];
  502.                             }
  503.  
  504.  
  505.                             if (isset( $unit[4] )) {
  506.                                 $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['units'][4] = $unit[4];
  507.                             }
  508.  
  509.                             $amf->_bodys[0]->_value[1][0]['params'][0]['continueBattle'] = false;
  510.                             $amf->_bodys[0]->_value[1][0]['params'][0]['memberInfo'] = false;
  511.                             $amf->_bodys[0]->_value[1][0]['params'][0]['enemyID'] = $eID;
  512.                             $amf = $this->bot->transaction_stamp( $amf, 0 );
  513.                         }
  514. else {
  515.                             if ($status == 65640) {
  516.                                 $amf->_bodys[0]->_value[1][0]['sequence'] = $this->bot->GetSequense(  );
  517.                                 $amf->_bodys[0]->_value[1][0]['functionName'] = 'ClansService.loadAllianceBattle';
  518.                                 $amf->_bodys[0]->_value[1][0]['transaction'] = Null;
  519.                                 $amf->_bodys[0]->_value[1][0]['params'][0]['allianceName'] = $eNM;
  520.                                 $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleetName'] = 'fleet_domination_alliance_player';
  521.                                 $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['type'] = $type;
  522.                                 $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['name'] = 'fleet_domination_alliance_player';
  523.                                 $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['uid'] = $this->bot->uid;
  524.                                 $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['status'] = (int)$status;
  525.  
  526.                                 if (isset( $unit[0] )) {
  527.                                     $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['units'][0] = $unit[0];
  528.                                 }
  529.  
  530.  
  531.                                 if (isset( $unit[1] )) {
  532.                                     $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['units'][1] = $unit[1];
  533.                                 }
  534.  
  535.  
  536.                                 if (isset( $unit[2] )) {
  537.                                     $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['units'][2] = $unit[2];
  538.                                 }
  539.  
  540.  
  541.                                 if (isset( $unit[3] )) {
  542.                                     $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['units'][3] = $unit[3];
  543.                                 }
  544.  
  545.  
  546.                                 if (isset( $unit[4] )) {
  547.                                     $amf->_bodys[0]->_value[1][0]['params'][0]['playerFleet']['units'][4] = $unit[4];
  548.                                 }
  549.  
  550.                                 $amf->_bodys[0]->_value[1][0]['params'][0]['continueBattle'] = false;
  551.                                 $amf->_bodys[0]->_value[1][0]['params'][0]['memberInfo'] = false;
  552.                                 $amf->_bodys[0]->_value[1][0]['params'][0]['enemyID'] = $eID;
  553.                                 $amf = $this->bot->transaction_stamp( $amf, 0 );
  554.                             }
  555.                         }
  556.                     }
  557.                 }
  558.             }
  559.  
  560.             $serializer = new AMFSerializer(  );
  561.             $result = $status = $serializer->serialize( $amf );
  562.             $x = $this->bot->SendRequest( $result );
  563.             unset( $bod );
  564.             unset( $info );
  565.             unset( $info2 );
  566.             $amf = $amf = new AMFObject( $x );
  567.             $deserializer = new AMFDeserializer( $amf->rawData );
  568.             $deserializer->deserialize( $amf );
  569.             $bod = new MessageBody(  );
  570.             $bod = $amf->_bodys[0];
  571.             $info = $bod->_value['data'][0]['data'];
  572.             $this->cektimeclientserver( $bod->_value['data'][0]['serverTime'] );
  573.  
  574.             if ($functioName == 'DominationModeService.getDominationModeOpponentList') {
  575.                 $this->cektimealliance( $bod );
  576.                 @file_put_contents( 'codebase-php/core.system', @serialize( $info ) );
  577.                 $this->bot->pm->RefreshMePlugin( 'YondaimePower' );
  578.                 $info2 = $bod->_value['data'][1]['data'];
  579.                 $this->bot->SendMsg( 'Your Clan : ' . $info2['name'] . '  Clan health : ' . $info2['health'] . ' Members = ' . count( $info2['members'] ) );
  580.             }
  581.  
  582.  
  583.             if ($functioName == 'loadAllianceBattle') {
  584.                 $info_type_enemy = $info['enemyFleet']['type'];
  585.                 $info_unit_1 = $info['enemyFleet']['units'][0];
  586.                 $info_unit_2 = $info['enemyFleet']['units'][1];
  587.                 $info_unit_3 = $info['enemyFleet']['units'][2];
  588.                 $info_unit_4 = $info['enemyFleet']['units'][3];
  589.                 $info_unit_5 = $info['enemyFleet']['units'][4];
  590.  
  591.                 if (isset( $info_type_enemy )) {
  592.                     $this->bot->SendMsg( ' Your enemy defense it\'s type ' . $info_type_enemy . '!' );
  593.                 }
  594.  
  595.  
  596.                 if (isset( $info_unit_1 )) {
  597.                     $array_code_1 = explode( ',', $info_unit_1 );
  598.                 }
  599.  
  600.                 $code_0_1 = $array_code_1[0];
  601.                 $info_name_1 = $this->bot->xmlsOb->GetFnamefromCode( $code_0_1 );
  602.                 $this->bot->SendMsg( ' 1st unit :' . $info_name_1 . ' (' . $array_code_1[1] . ') !' );
  603.  
  604.                 if (isset( $info_unit_2 )) {
  605.                     $array_code_2 = explode( ',', $info_unit_2 );
  606.                 }
  607.  
  608.                 $code_0_2 = $array_code_2[0];
  609.                 $info_name_2 = $this->bot->xmlsOb->GetFnamefromCode( $code_0_2 );
  610.                 $this->bot->SendMsg( ' 2nd unit :' . $info_name_2 . ' (' . $array_code_2[1] . ') !' );
  611.  
  612.                 if (isset( $info_unit_3 )) {
  613.                     $array_code_3 = explode( ',', $info_unit_3 );
  614.                 }
  615.  
  616.                 $code_0_3 = $array_code_3[0];
  617.                 $info_name_3 = $this->bot->xmlsOb->GetFnamefromCode( $code_0_3 );
  618.                 $this->bot->SendMsg( ' 3rd unit :' . $info_name_3 . ' (' . $array_code_3[1] . ') !' );
  619.  
  620.                 if (isset( $info_unit_4 )) {
  621.                     $array_code_4 = explode( ',', $info_unit_4 );
  622.                 }
  623.  
  624.                 $code_0_4 = $array_code_4[0];
  625.                 $info_name_4 = $this->bot->xmlsOb->GetFnamefromCode( $code_0_4 );
  626.                 $this->bot->SendMsg( ' 4th unit :' . $info_name_4 . ' (' . $array_code_4[1] . ') !' );
  627.  
  628.                 if (isset( $info_unit_5 )) {
  629.                     $array_code_5 = explode( ',', $info_unit_5 );
  630.                 }
  631.  
  632.                 $code_0_5 = $array_code_5[0];
  633.                 $info_name_5 = $this->bot->xmlsOb->GetFnamefromCode( $code_0_5 );
  634.                 $this->bot->SendMsg( ' 5th unit :' . $info_name_5 . ' (' . $array_code_5[1] . ') !' );
  635.  
  636.                 if (isset( $info['playerFleet']['units'] )) {
  637.                     $this->bot->unitsHadowinAction = $info['playerFleet']['units'];
  638.                 }
  639.             }
  640.  
  641.             return $info;
  642.         }
  643.  
  644.         function ResolveBattleDomination($efleet, $pfleet, $id, $akhir) {
  645.             $sialpusing = explode( ',', $this->bot->unitsHadowinAction[0] );
  646.             $sialpusing[3] = (int)$sialpusing[3];
  647.  
  648.             if ($sialpusing[3] == 4) {
  649.                 $add = 897;
  650.             }
  651. else {
  652.                 if ($sialpusing[3] == 2) {
  653.                     $add = 897;
  654.                 }
  655. else {
  656.                     if ($sialpusing[3] == 3) {
  657.                         $add = 896;
  658.                     }
  659.                 }
  660.             }
  661.  
  662.  
  663.             if (isset( $this->bot->error_msg )) {
  664.                 return null;
  665.             }
  666.  
  667.             $sec = explode( ' ', microtime(  ) )[1];
  668.             [0];
  669.             $usec = ;
  670.             $amf = new AMFObject( '' );
  671.             MessageBody;
  672.             $amf->_bodys[0] = new (  );
  673.             $amf->_bodys[0]->_value[0] = $this->bot->GetAmfHeader(  );
  674.             $amf->_bodys[0]->targetURI = 'BaseService.dispatchBatch';
  675.             $amf->_bodys[0]->responseURI = '' . '/' . $rindex . '/onStatus';
  676.             $amf->_bodys[0]->responseIndex = '' . '/' . $rindex;
  677.             ++$rindex;
  678.             $amf->_bodys[0]->_value[2] = 0;
  679.  
  680.             if ($akhir == 'belum') {
  681.                 $amf->_bodys[0]->_value[1][0]['transaction'] = Null;
  682.                 $amf->_bodys[0]->_value[1][0]['stamp'] = (bool)$sec . substr( (bool)$usec, 2, 3 );
  683.                 $amf->_bodys[0]->_value[1][0]['sequence'] = $this->bot->GetSequense(  );
  684.                 $amf->_bodys[0]->_value[1][0]['functionName'] = 'WorldService.resolveBattle';
  685.                 $amf->_bodys[0]->_value[1][0]['params'][0]['map'] = null;
  686.                 $amf->_bodys[0]->_value[1][0]['params'][0]['target'] = $efleet;
  687.                 $amf->_bodys[0]->_value[1][0]['params'][0]['fleet'] = $pfleet;
  688.                 $amf->_bodys[0]->_value[1][0]['params'][0]['id']['0'] = (int)$sialpusing[3];
  689.                 $amf->_bodys[0]->_value[1][0]['params'][0]['id']['1'] = $id;
  690.  
  691.                 if (( $id == 2 || $id == 4 )) {
  692.                     $ch = (int)$this->bot->ch( $amf->_bodys[0]->_value[1][0]['params'][0] ) + 1;
  693.                 }
  694. else {
  695.                     $ch = (int)$this->bot->ch( $amf->_bodys[0]->_value[1][0]['params'][0] );
  696.                 }
  697.  
  698.                 $amf->_bodys[0]->_value[1][0]['params'][0]['ch'] = (int)$ch + $add;
  699.                 $amf->_bodys[0]->_value[1][1]['transaction'] = Null;
  700.                 $amf->_bodys[0]->_value[1][1]['sequence'] = $this->bot->GetSequense(  );
  701.                 $amf->_bodys[0]->_value[1][1]['functionName'] = 'WorldService.resolveBattle';
  702.                 $amf->_bodys[0]->_value[1][1]['params'][0]['map'] = Null;
  703.                 $amf->_bodys[0]->_value[1][1]['params'][0]['target'] = $efleet;
  704.                 $amf->_bodys[0]->_value[1][1]['params'][0]['fleet'] = $pfleet;
  705.                 $amf->_bodys[0]->_value[1][1]['params'][0]['ch'] = (int)$this->bot->ch( $amf->_bodys[0]->_value[1][1]['params'] );
  706.                 $amf->_bodys[0]->_value[1][1]['stamp'] = (bool)$sec . substr( (bool)$usec, 2, 3 );
  707.                 $amf->_bodys[0]->_value[1][2]['sequence'] = $this->bot->GetSequense(  );
  708.                 $amf->_bodys[0]->_value[1][2]['functionName'] = 'WorldService.genericString';
  709.                 $amf = $this->bot->transaction_stamp( $amf, 2 );
  710.                 $amf->_bodys[0]->_value[1][2]['params'][0] = 'ExitBattle';
  711.             }
  712. else {
  713.                 if ($akhir == 'sudah') {
  714.                     $amf->_bodys[0]->_value[1][0]['transaction'] = Null;
  715.                     $amf->_bodys[0]->_value[1][0]['stamp'] = (bool)$sec . substr( (bool)$usec, 2, 3 );
  716.                     $amf->_bodys[0]->_value[1][0]['sequence'] = $this->bot->GetSequense(  );
  717.                     $amf->_bodys[0]->_value[1][0]['functionName'] = 'WorldService.resolveBattle';
  718.                     $amf->_bodys[0]->_value[1][0]['params'][0]['map'] = null;
  719.                     $amf->_bodys[0]->_value[1][0]['params'][0]['target'] = $efleet;
  720.                     $amf->_bodys[0]->_value[1][0]['params'][0]['fleet'] = $pfleet;
  721.                     $amf->_bodys[0]->_value[1][0]['params'][0]['id']['0'] = (int)$sialpusing[3];
  722.                     $amf->_bodys[0]->_value[1][0]['params'][0]['id']['1'] = $id;
  723.  
  724.                     if (( $id == 2 || $id == 4 )) {
  725.                         $ch = (int)$this->bot->ch( $amf->_bodys[0]->_value[1][0]['params'][0] ) + 1;
  726.                     }
  727. else {
  728.                         $ch = (int)$this->bot->ch( $amf->_bodys[0]->_value[1][0]['params'][0] );
  729.                     }
  730.  
  731.                     $amf->_bodys[0]->_value[1][0]['params'][0]['ch'] = (int)$ch + $add;
  732.                     $amf->_bodys[0]->_value[1][1]['sequence'] = $this->bot->GetSequense(  );
  733.                     $amf->_bodys[0]->_value[1][1]['functionName'] = 'WorldService.genericString';
  734.                     $amf = $this->bot->transaction_stamp( $amf, 1 );
  735.                     $amf->_bodys[0]->_value[1][1]['params'][0] = 'ExitBattle';
  736.                 }
  737.             }
  738.  
  739.             $serializer = new AMFSerializer(  );
  740.             $result = $serializer->serialize( $amf );
  741.             $x = $this->bot->SendRequest( $result );
  742.             $amf = new AMFObject( $x );
  743.             $deserializer = new AMFDeserializer( $amf->rawData );
  744.             $deserializer->deserialize( $amf );
  745.             $bod = new MessageBody(  );
  746.             $bod = $amf->_bodys[0];
  747.             $info = $bod->_value['data'][0]['data'];
  748.             $info2 = $bod->_value['data'][1]['data'];
  749.             $this->bot -= 'energy';
  750.              = 1;
  751.             $this->bot->SendMsg( '                               Got hit ..........!!!!! ' );
  752.  
  753.             if ($info2['ps'] == 0) {
  754.                 $this->UnitMokadBattle( $info2['playerUnit'] );
  755.             }
  756.  
  757.         }
  758.  
  759.         function UnitMokadBattle($idunit) {
  760.             $code = explode( ',', $this->bot->unitsHadowinAction[0] );
  761.             foreach ($this->bot->unitsHadowinAction as $key => $val) {
  762.                 $cek = explode( ',', $val );
  763.  
  764.                 if ($cek[3] == $idunit) {
  765.                     unset( $this->bot->unitsHadowinAction[$key] );
  766.                     break;
  767.                 }
  768.             }
  769.  
  770.             unset( $aku );
  771.             $aku = array(  );
  772.             foreach ($this->bot->unitsHadowinAction as $aaaaa) {
  773.                 $aku[] = $aaaaa;
  774.             }
  775.  
  776.             $this->bot->unitsHadowinAction = $aku;
  777.             $this->bot->SendMsg( '   Unit left in battle = ' . count( $this->bot->unitsHadowinAction ) . ' in INVENTORY unit ' . $code[0] . ' Left : ' . $this->bot->inventory[$code[0]] );
  778.         }
  779.  
  780.         function battlenukeend($nukes, $efleet, $nuketarget) {
  781.             if ($nuketarget == 4) {
  782.                 $add = 565;
  783.             }
  784. else {
  785.                 if ($nuketarget == 2) {
  786.                     $add = 564;
  787.                 }
  788. else {
  789.                     if ($nuketarget == 3) {
  790.                         $add = 564;
  791.                     }
  792.                 }
  793.             }
  794.  
  795.             unset( $this->bot[error_msg] );
  796.             $amf = new AMFObject( '' );
  797.             MessageBody;
  798.             $amf->_bodys[0] = new (  );
  799.             $amf->_bodys[0]->_value[0] = $this->bot->GetAmfHeader(  );
  800.             $amf->_bodys[0]->targetURI = 'BaseService.dispatchBatch';
  801.             $amf->_bodys[0]->responseURI = '' . '/' . $rindex . '/onStatus';
  802.             $amf->_bodys[0]->responseIndex = '' . '/' . $rindex;
  803.             ++$rindex;
  804.             $amf->_bodys[0]->_value[2] = 0;
  805.             $amf->_bodys[0]->_value[1][0]['sequence'] = $this->bot->GetSequense(  );
  806.             $amf->_bodys[0]->_value[1][0]['functionName'] = 'WorldService.assignConsumable';
  807.             $amf->_bodys[0]->_value[1][0]['transaction'] = Null;
  808.             $amf->_bodys[0]->_value[1][0]['params'][0]['code'] = $nukes;
  809.             $amf->_bodys[0]->_value[1][0]['params'][0]['fleet'] = Null;
  810.             $amf->_bodys[0]->_value[1][0]['params'][0]['level'] = 0;
  811.             $amf->_bodys[0]->_value[1][0]['params'][0]['name'] = $efleet;
  812.             $amf->_bodys[0]->_value[1][0]['params'][0]['map'] = Null;
  813.             $amf->_bodys[0]->_value[1][0]['params'][0]['id'] = $nuketarget;
  814.             $amf->_bodys[0]->_value[1][0]['params'][0]['ch'] = $this->bot->ch( $amf->_bodys[0]->_value[1][0]['params'][0] ) + $add;
  815.             $usec = $sec = explode( ' ', microtime(  ) )[1];
  816.             $amf->_bodys[0]->_value[1][0]['stamp'] = (bool)$sec . substr( (bool)$usec, 2, 3 );
  817.             $amf->_bodys[0]->_value[1][1]['sequence'] = $this->bot->GetSequense(  );
  818.             $amf->_bodys[0]->_value[1][1]['functionName'] = 'WorldService.genericString';
  819.             $amf = $this->bot->transaction_stamp( $amf, 1 );
  820.             $amf->_bodys[0]->_value[1][1]['params'][0] = 'ExitBattle';
  821.             $serializer = new AMFSerializer(  );
  822.             $result = $serializer->serialize( $amf );
  823.             $x = $this->bot->SendRequest( $result );
  824.             unset( $bod );
  825.             unset( $info );
  826.             AMFObject;
  827.             new ( $x );
  828.             $amf = [0];
  829.             $deserializer = new AMFDeserializer( $amf->rawData );
  830.             $deserializer->deserialize( $amf );
  831.             $bod = new MessageBody(  );
  832.             $bod = $amf->_bodys[0];
  833.             $info = $bod->_value['data'][0];
  834.             $this->cektimeclientserver( $bod->_value['data'][0]['serverTime'] );
  835.  
  836.             if (( $info['energy'] != 0 - 1 && $info['energy'] != null )) {
  837.                 $this->bot->energy = $info['energy'];
  838.             }
  839.  
  840.  
  841.             if (isset( $info['metadata']['dominanceGained'] )) {
  842.                 $this->bot->SendMsg( '                         Dominance Point Gain : ' . $info['metadata']['dominanceGained'] );
  843.             }
  844.  
  845.             return $info;
  846.         }
  847.     }
  848.  
  849. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement