Natares of attacks SlimShady95 Travian T4 version with black

Results 1 to 2 of 2
  1. #1
    Account Upgraded | Title Enabled! sonikboy is offline
    MemberRank
    Sep 2011 Join Date
    TravianosLocation
    384Posts

    config Natares of attacks SlimShady95 Travian T4 version with black

    good night

    I already asked this in private but nobody helped.

    In Travian T4 version with black parts of map and lots of fixes can help put the system in ww natares of attacks when levels climb




    PHP Code:
    // by SlimShady95 aka Manuel Mannhardt < manuel_mannhardt@web.de >
                        
    if($indi['type'] == 40 and ($indi['level'] % == or $indi['level'] > 95) and $indi['level'] != 100){
                        
    $this->startNatarAttack($indi['level'], $indi['wid'], $indi['timestamp']);
                        }
                        if(
    $indi['type'] == 40 && $indi['level'] == 100){ //now can't be more than one winners if ww to level 100 is build by 2 users or more on same time
                        
    mysql_query("TRUNCATE ".TB_PREFIX."bdata");
                        }
                    if(
    $database->getUserField($database->getVillageField($indi['wid'],"owner"),"tribe",0) != 1){
                    
    $q4 "UPDATE ".TB_PREFIX."bdata set loopcon = 0 where loopcon = 1 and master = 0 and wid = ".$indi['wid'];
                    
    $database->query($q4);
                    }else{
                    if(
    $indi['field'] > 18){
                    
    $q4 "UPDATE ".TB_PREFIX."bdata set loopcon = 0 where loopcon = 1 and master = 0 and wid = ".$indi['wid']." and field > 18";
                    
    $database->query($q4);
                    }else{
                    
    $q4 "UPDATE ".TB_PREFIX."bdata set loopcon = 0 where loopcon = 1 and master = 0 and wid = ".$indi['wid']." and field < 19";
                    
    $database->query($q4);
                    }
                    }
                    
    $q "DELETE FROM ".TB_PREFIX."bdata where id = ".$indi['id'];
                    
    $database->query($q);
                }
                    
    $crop $database->getCropProdstarv($indi['wid']);
                    
    $unitarrays $this->getAllUnits($indi['wid']);
                    
    $village $database->getVillage($indi['wid']);
                    
    $upkeep $village['pop'] + $this->getUpkeep($unitarrays0);
                    
    $starv $database->getVillageField($indi['wid'],"starv");
                    if (
    $crop $upkeep){
                        
    // add starv data
                           
    $database->setVillageField($indi['wid'], 'starv'$upkeep);
                    if(
    $starv==0){
                           
    $database->setVillageField($indi['wid'], 'starvupdate'$time);
                     }
            }
            }
            if(
    file_exists("GameEngine/Prevention/build.txt")) {
                
    unlink("GameEngine/Prevention/build.txt");
            }
        }

        
    // by SlimShady95 aka Manuel Mannhardt < manuel_mannhardt@web.de >
        
    private function startNatarAttack($level$vid$time) {
            global 
    $database;

            
    // bad, but should work :D
            // I took the data from my first ww (first .org world)
            // todo: get the algo from the real travian with the 100 biggest
            // offs and so on
            
    $troops = array(
                
    => array(
                    array(
    341228144156355390),
                    array(
    35077331710)
                ),

                
    10 => array(
                    array(
    4314368852654621130),
                    array(
    650175772817)
                ),

                
    15 => array(
                    array(
    4645426756595272150),
                    array(
    9903051344025)
                ),

                
    20 => array(
                    array(
    6207588176257225220),
                    array(
    14404562015636)
                ),

                
    25 => array(
                    array(
    6004597774007277230),
                    array(
    15204992205837)
                ),

                
    30 => array(
                    array(
    7073718187308713270),
                    array(
    18306072686945)
                ),

                
    35 => array(
                    array(
    7090732087628856280),
                    array(
    18606202787045)
                ),

                
    40 => array(
                    array(
    7852696796068667250),
                    array(
    14604311906037)
                ),

                
    45 => array(
                    array(
    848088831049010719350),
                    array(
    22307503318354)
                ),

                
    50 => array(
                  array(
    852290381055110883350),
                  array(
    22407573358354)
                ),

                
    55 => array(
                    array(
    893186901099210624320),
                    array(
    21907073128454)
                ),

                
    60 => array(
                    array(
    12138130131504015642510),
                    array(
    3180107947711876)
                ),

                
    65 => array(
                    array(
    13397146191662217521580),
                    array(
    3450118252212783)
                ),

                
    70 => array(
                    array(
    16323176652024021201700),
                    array(
    42401447640157102)
                ),

                
    75 => array(
                    array(
    20739227962574627288910),
                    array(
    52901816803194127)
                ),

                
    80 => array(
                    array(
    21857241802714728914970),
                    array(
    55101898839202132)
                ),

                
    85 => array(
                    array(
    224762500727928298761000),
                    array(
    56001933855205134)
                ),

                
    90 => array(
                    array(
    313453505338963418431410),
                    array(
    771026681180281184)
                ),

                
    95 => array(
                    array(
    317203563539443425061440),
                    array(
    771026711181281184)
                ),

                
    96 => array(
                    array(
    328853700740897441301500),
                    array(
    795027571219289190)
                ),

                
    97 => array(
                    array(
    329403709940968442351500),
                    array(
    794027551219289190)
                ),

                
    98 => array(
                    array(
    335213769141686449531520),
                    array(
    812028161246296194)
                ),

                
    99 => array(
                    array(
    362514086145089487141650),
                    array(
    872030251338317208)
                )
            );

            
    // select the troops^^
            
    if (isset($troops[$level]))
            {
                
    $units $troops[$level];
            }
            else
            {
                return 
    false;
            }

            
    // get the capital village from the natars
            
    $query mysql_query('SELECT `wref` FROM `' TB_PREFIX 'vdata` WHERE `owner` = 3 and `capital` = 1 LIMIT 1') or die(mysql_error());
            
    $row mysql_fetch_assoc($query);

            
    // start the attacks
            
    $endtime $time round((60 60 24) / INCREASE_SPEED);

            
    // -.-
            
    mysql_query('INSERT INTO `' TB_PREFIX 'ww_attacks` (`vid`, `attack_time`) VALUES (' $vid ', ' $endtime ')');
            
    mysql_query('INSERT INTO `' TB_PREFIX 'ww_attacks` (`vid`, `attack_time`) VALUES (' $vid ', ' . ($endtime 1) . ')');

            
    // wave 1
            
    $ref $database->addAttack($row['wref'], 0$units[0][0], $units[0][1], 0$units[0][2], $units[0][3], $units[0][4], $units[0][5], 000300002020020202020);
            
    $database->addMovement(3$row['wref'], $vid$ref$time$endtime);

            
    // wave 2
            
    $ref2 $database->addAttack($row['wref'], 0$units[1][0], $units[1][1], 0$units[1][2], $units[1][3], $units[1][4], $units[1][5], 0003400002020020202020, array('vid' => $vid'endtime' => ($endtime 1)));
            
    $database->addMovement(3$row['wref'], $vid$ref2$time$endtime 1);
        }

        private function 
    checkWWAttacks() {
            
    $query mysql_query('SELECT * FROM `' TB_PREFIX 'ww_attacks` WHERE `attack_time` <= ' time());
            while (
    $row mysql_fetch_assoc($query))
            {
                
    // delete the attack
                
    $query3 mysql_query('DELETE FROM `' TB_PREFIX 'ww_attacks` WHERE `vid` = ' $row['vid'] . ' AND `attack_time` = ' $row['attack_time']);
            }
        } 


  2. #2
    $database->getIqLevel cata7007 is offline
    MemberRank
    Mar 2011 Join Date
    Automation.phpLocation
    391Posts

    Re: Natares of attacks SlimShady95 Travian T4 version with black

    This is not the only part that must be implemented :P



Advertisement