• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

WW Natars Attack

Status
Not open for further replies.
Junior Spellweaver
Joined
Mar 29, 2011
Messages
119
Reaction score
56
Hello guys,
I just finished the attacks for alle fifth stages and all stages above 95 like in real travian. I took the numbers of units from my first ww on the first .org world, so the could be not the best, but I don't care (I will look for getting the algo for the real calculation with the 100 best offs or whatever is was).

IT'S BASED ON yi12345's VERSION!!!

SlimShady95 - WW Natars Attack - RaGEZONE Forums

First wave

SlimShady95 - WW Natars Attack - RaGEZONE Forums

Second wave

open GameEngine/Automation.php and go in the function "buildComplete". Search for something like:
PHP:
                if ($indi['type'] == 39)
                {
                    $max = $database->getVillageField($indi['wid'], "maxcrop");
                    if ($level == '1' && $max == STORAGE_BASE)
                    {
                        $max = STORAGE_BASE;
                    }
                    if ($level != 1)
                    {
                        $max -= $bid39[$level - 1]['attri'] * STORAGE_MULTIPLIER;
                        $max += $bid39[$level]['attri'] * STORAGE_MULTIPLIER;
                    }
                    else
                    {
                        $max = $bid39[$level]['attri'] * STORAGE_MULTIPLIER;
                    }
                    $database->setVillageField($indi['wid'], "maxcrop", $max);
                }
and add after this:
PHP:
                // by SlimShady95 aka Manuel Mannhardt < manuel_mannhardt@web.de >
                if ($indi['type'] == 40 and ($indi['level'] % 5 == 0 or $indi['level'] > 95) and $indi['level'] != 100)
                {
                    $this->startNatarAttack($indi['level'], $indi['wid']);
                }

then you only have to add the function "startNatarAttack":
PHP:
    // by SlimShady95 aka Manuel Mannhardt < manuel_mannhardt@web.de >
    private function startNatarAttack($level, $vid)
    {
        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(
            5 => array(
                array(3412, 2814, 4156, 3553, 9, 0),
                array(35, 0, 77, 33, 17, 10)
            ),
            
            10 => array(
                array(4314, 3688, 5265, 4621, 13, 0),
                array(65, 0, 175, 77, 28, 17)
            ),
            
            15 => array(
                array(4645, 4267, 5659, 5272, 15, 0),
                array(99, 0, 305, 134, 40, 25)
            ),
            
            20 => array(
                array(6207, 5881, 7625, 7225, 22, 0),
                array(144, 0, 456, 201, 56, 36)
            ),
            
            25 => array(
                array(6004, 5977, 7400, 7277, 23, 0),
                array(152, 499, 220, 58, 37)
            ),
            
            30 => array(
                array(7073, 7181, 8730, 8713, 27, 0),
                array(183, 0, 607, 268, 69, 45)
            ),
            
            35 => array(
                array(7090, 7320, 8762, 8856, 28, 0),
                array(186, 0, 620, 278, 70, 45)
            ),
            
            40 => array(
                array(7852, 6967, 9606, 8667, 25, 0),
                array(146, 0, 431, 190, 60, 37)            
            ),
            
            45 => array(
                array(8480, 8883, 10490, 10719, 35, 0),
                array(223, 0, 750, 331, 83, 54)
            ),
            
            50 => array(
              array(8522, 9038, 10551, 10883, 35, 0),
              array(224, 0, 757, 335, 83, 54)
            ),
            
            55 => array(
                array(8931, 8690, 10992, 10624, 32, 0),
                array(219, 0, 707, 312, 84, 54)
            ),
            
            60 => array(
                array(12138, 13013, 15040, 15642, 51, 0),
                array(318, 0, 1079, 477, 118, 76)
            ),
            
            65 => array(
                array(13397, 14619, 16622, 17521, 58, 0),
                array(345, 0, 1182, 522, 127, 83)
            ),
                        
            70 => array(
                array(16323, 17665, 20240, 21201, 70, 0),
                array(424, 0, 1447, 640, 157, 102)
            ),

            75 => array(
                array(20739, 22796, 25746, 27288, 91, 0),
                array(529, 0, 1816, 803, 194, 127)
            ),
            
            80 => array(
                array(21857, 24180, 27147, 28914, 97, 0),
                array(551, 0, 1898, 839, 202, 132)
            ),
            
            85 => array(
                array(22476, 25007, 27928, 29876, 100, 0),
                array(560, 0, 1933, 855, 205, 134)
            ),
            
            90 => array(
                array(31345, 35053, 38963, 41843, 141, 0),
                array(771, 0, 2668, 1180, 281, 184)
            ),
            
            95 => array(
                array(31720, 35635, 39443, 42506, 144, 0),
                array(771, 0, 2671, 1181, 281, 184)
            ),
            
            96 => array(
                array(32885, 37007, 40897, 44130, 150, 0),
                array(795, 0, 2757, 1219, 289, 190)
            ),
            
            97 => array(
                array(32940, 37099, 40968, 44235, 150, 0),
                array(794, 0, 2755, 1219, 289, 190)
            ),
            
            98 => array(
                array(33521, 37691, 41686, 44953, 152, 0),
                array(812, 0, 2816, 1246, 296, 194)
            ),
            
            99 => array(
                array(36251, 40861, 45089, 48714, 165, 0),
                array(872, 0, 3025, 1338, 317, 208)
            )
        );
        
        // 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) / SPEED);
        $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], 0, 0, 0, 3, 0, 0, 0, 0, 20, 20, 0, 20, 20, 20, 20);
        $database->addMovement(3, $row['wref'], $vid, $ref, time(), $endtime);
        
        $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], 0, 0, 0, 3, 40, 0, 0, 0, 20, 20, 0, 20, 20, 20, 20);
        $database->addMovement(3, $row['wref'], $vid, $ref2, time(), $endtime + 1);        
    }

@yi12345: It would be nice, if you could add this to your version :)

Todo:
- show the attacks in the ww ranking (I´ll do this, after I slept)
- do something against killing the whole ww (the seconde wave of the natar attacks have catapults, so they can destroy the ww. If the ww get destroyed, it dissapears and you only can build it again, when you edit something in the database)

hope you have fun with this :)

(sorry for my bad english, I´m from germany)

regards,
overtired procoder <3
Manni
 
Last edited:
Junior Spellweaver
Joined
Mar 29, 2011
Messages
119
Reaction score
56
^.^
My todo-list for today (after sleeping :D):
- finish the natars attacking
- add code for the artefact, that makes you build troops faster

The other artefacts I will think about, but I can promise anything. What have to be done else?

regards,
I´m very hungry
 
Junior Spellweaver
Joined
Feb 25, 2012
Messages
172
Reaction score
21
Nicely done.
Just make the artefacts complete.

Hello guys,
I just finished the attacks for alle fifth stages and all stages above 95 like in real travian. I took the numbers of units from my first ww on the first .org world, so the could be not the best, but I don't care (I will look for getting the algo for the real calculation with the 100 best offs or whatever is was).

IT'S BASED ON yi12345's VERSION!!!

SlimShady95 - WW Natars Attack - RaGEZONE Forums

First wave

SlimShady95 - WW Natars Attack - RaGEZONE Forums

Second wave

open GameEngine/Automation and go in the function "buildComplete". Search for something like:
PHP:
                if ($indi['type'] == 39)
                {
                    $max = $database->getVillageField($indi['wid'], "maxcrop");
                    if ($level == '1' && $max == STORAGE_BASE)
                    {
                        $max = STORAGE_BASE;
                    }
                    if ($level != 1)
                    {
                        $max -= $bid39[$level - 1]['attri'] * STORAGE_MULTIPLIER;
                        $max += $bid39[$level]['attri'] * STORAGE_MULTIPLIER;
                    }
                    else
                    {
                        $max = $bid39[$level]['attri'] * STORAGE_MULTIPLIER;
                    }
                    $database->setVillageField($indi['wid'], "maxcrop", $max);
                }
and add after this:
PHP:
                // by SlimShady95 aka Manuel Mannhardt < manuel_mannhardt@web.de >
                if ($indi['type'] == 40 and ($indi['level'] % 5 == 0 or $indi['level'] > 95) and $indi['level'] != 100)
                {
                    $this->startNatarAttack($indi['level'], $indi['wid']);
                }

then you only have to add the function "startNatarAttack":
PHP:
    // by SlimShady95 aka Manuel Mannhardt < manuel_mannhardt@web.de >
    private function startNatarAttack($level, $vid)
    {
        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(
            5 => array(
                array(3412, 2814, 4156, 3553, 9, 0),
                array(35, 0, 77, 33, 17, 10)
            ),
            
            10 => array(
                array(4314, 3688, 5265, 4621, 13, 0),
                array(65, 0, 175, 77, 28, 17)
            ),
            
            15 => array(
                array(4645, 4267, 5659, 5272, 15, 0),
                array(99, 0, 305, 134, 40, 25)
            ),
            
            20 => array(
                array(6207, 5881, 7625, 7225, 22, 0),
                array(144, 0, 456, 201, 56, 36)
            ),
            
            25 => array(
                array(6004, 5977, 7400, 7277, 23, 0),
                array(152, 499, 220, 58, 37)
            ),
            
            30 => array(
                array(7073, 7181, 8730, 8713, 27, 0),
                array(183, 0, 607, 268, 69, 45)
            ),
            
            35 => array(
                array(7090, 7320, 8762, 8856, 28, 0),
                array(186, 0, 620, 278, 70, 45)
            ),
            
            40 => array(
                array(7852, 6967, 9606, 8667, 25, 0),
                array(146, 0, 431, 190, 60, 37)            
            ),
            
            45 => array(
                array(8480, 8883, 10490, 10719, 35, 0),
                array(223, 0, 750, 331, 83, 54)
            ),
            
            50 => array(
              array(8522, 9038, 10551, 10883, 35, 0),
              array(224, 0, 757, 335, 83, 54)
            ),
            
            55 => array(
                array(8931, 8690, 10992, 10624, 32, 0),
                array(219, 0, 707, 312, 84, 54)
            ),
            
            60 => array(
                array(12138, 13013, 15040, 15642, 51, 0),
                array(318, 0, 1079, 477, 118, 76)
            ),
            
            65 => array(
                array(13397, 14619, 16622, 17521, 58, 0),
                array(345, 0, 1182, 522, 127, 83)
            ),
                        
            70 => array(
                array(16323, 17665, 20240, 21201, 70, 0),
                array(424, 0, 1447, 640, 157, 102)
            ),

            75 => array(
                array(20739, 22796, 25746, 27288, 91, 0),
                array(529, 0, 1816, 803, 194, 127)
            ),
            
            80 => array(
                array(21857, 24180, 27147, 28914, 97, 0),
                array(551, 0, 1898, 839, 202, 132)
            ),
            
            85 => array(
                array(22476, 25007, 27928, 29876, 100, 0),
                array(560, 0, 1933, 855, 205, 134)
            ),
            
            90 => array(
                array(31345, 35053, 38963, 41843, 141, 0),
                array(771, 0, 2668, 1180, 281, 184)
            ),
            
            95 => array(
                array(31720, 35635, 39443, 42506, 144, 0),
                array(771, 0, 2671, 1181, 281, 184)
            ),
            
            96 => array(
                array(32885, 37007, 40897, 44130, 150, 0),
                array(795, 0, 2757, 1219, 289, 190)
            ),
            
            97 => array(
                array(32940, 37099, 40968, 44235, 150, 0),
                array(794, 0, 2755, 1219, 289, 190)
            ),
            
            98 => array(
                array(33521, 37691, 41686, 44953, 152, 0),
                array(812, 0, 2816, 1246, 296, 194)
            ),
            
            99 => array(
                array(36251, 40861, 45089, 48714, 165, 0),
                array(872, 0, 3025, 1338, 317, 208)
            )
        );
        
        // 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) / SPEED);
        $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], 0, 0, 0, 3, 0, 0, 0, 0, 20, 20, 0, 20, 20, 20, 20);
        $database->addMovement(3, $row['wref'], $vid, $ref, time(), $endtime);
        
        $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], 0, 0, 0, 3, 40, 0, 0, 0, 20, 20, 0, 20, 20, 20, 20);
        $database->addMovement(3, $row['wref'], $vid, $ref2, time(), $endtime + 1);        
    }

@yi12345: It would be nice, if you could add this to your version :)

Todo:
- show the attacks in the ww ranking (I´ll do this, after I slept)
- do something against killing the whole ww (the seconde wave of the natar attacks have catapults, so they can destroy the ww. If the ww get destroyed, it dissapears and you only can build it again, when you edit something in the database)

hope you have fun with this :)

(sorry for my bad english, I´m from germany)

regards,
overtired procoder <3
Manni

Where to put the php code ?
Because I cannot find the php code in ../GameEngine/Automation.php ?

Greets
 
Newbie Spellweaver
Joined
Mar 1, 2011
Messages
32
Reaction score
0
@SlimShady95

Does this works for art also?
I mean, when you steal the art, would Natars attack you?
 
Junior Spellweaver
Joined
Feb 25, 2012
Messages
172
Reaction score
21
No, natars will not attack you, also in the original version, no natar attack if you claim the arte.
 
Junior Spellweaver
Joined
Mar 29, 2011
Messages
119
Reaction score
56
hmm...update the ww statistic --> it need the column for incomming natars attacks,after Level column and continue with artefacts:D



Are you hungry of php codes? You eat travian?:)):lol::lol:
I meant this, with the column :p


Yeah, I ate all PHP Code xD

regards,
woken up bitches, go to smoke, then start working ;)
 
Skilled Illusionist
Joined
Sep 5, 2011
Messages
360
Reaction score
14
Well this works even here the images

atak_natar - WW Natars Attack - RaGEZONE Forums atak_natar1 - WW Natars Attack - RaGEZONE Forums atak_natar2 - WW Natars Attack - RaGEZONE Forums

Now we have a situation that the WW changes the name right at the first level and should be in 10 can confirm this

Thank you and continues

we need people with you
 

Attachments

You must be registered for see attachments list
Junior Spellweaver
Joined
Jan 7, 2012
Messages
147
Reaction score
100
Nice work, I have some more data from natars in endgame that may be some use (2x speed rounds (aux5 and aux6 (which we won :blushing:) one is t3, one t4) maybe could add random numbers instead.

here is the download


Good luck!
 
Junior Spellweaver
Joined
Feb 25, 2012
Messages
172
Reaction score
21
@SlimShady95

Can you tell where exactly put the code ?
Or upload the php files please ?

So I can put it in the files.
 
Junior Spellweaver
Joined
Mar 29, 2011
Messages
119
Reaction score
56
I think, I explained it best as I can. I won't upload any file, because my files are under development -> unstable.

regards,
I go to shower now and then I´ll code ;))
 
Newbie Spellweaver
Joined
Jul 20, 2011
Messages
8
Reaction score
0
private function startNatarAttack($level, $vid)
{
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(
5 => array(
array(3412, 2814, 4156, 3553, 9, 0),
array(35, 0, 77, 33, 17, 10)
),

10 => array(
array(4314, 3688, 5265, 4621, 13, 0),
array(65, 0, 175, 77, 28, 17)
),

15 => array(
array(4645, 4267, 5659, 5272, 15, 0),
array(99, 0, 305, 134, 40, 25)
),

20 => array(
array(6207, 5881, 7625, 7225, 22, 0),
array(144, 0, 456, 201, 56, 36)
),

25 => array(
array(6004, 5977, 7400, 7277, 23, 0),
array(152, 499, 220, 58, 37)
),

30 => array(
array(7073, 7181, 8730, 8713, 27, 0),
array(183, 0, 607, 268, 69, 45)
),

35 => array(
array(7090, 7320, 8762, 8856, 28, 0),
array(186, 0, 620, 278, 70, 45)
),

40 => array(
array(7852, 6967, 9606, 8667, 25, 0),
array(146, 0, 431, 190, 60, 37)
),

45 => array(
array(8480, 8883, 10490, 10719, 35, 0),
array(223, 0, 750, 331, 83, 54)
),

50 => array(
array(8522, 9038, 10551, 10883, 35, 0),
array(224, 0, 757, 335, 83, 54)
),

55 => array(
array(8931, 8690, 10992, 10624, 32, 0),
array(219, 0, 707, 312, 84, 54)
),

60 => array(
array(12138, 13013, 15040, 15642, 51, 0),
array(318, 0, 1079, 477, 118, 76)
),

65 => array(
array(13397, 14619, 16622, 17521, 58, 0),
array(345, 0, 1182, 522, 127, 83)
),

70 => array(
array(16323, 17665, 20240, 21201, 70, 0),
array(424, 0, 1447, 640, 157, 102)
),

75 => array(
array(20739, 22796, 25746, 27288, 91, 0),
array(529, 0, 1816, 803, 194, 127)
),

80 => array(
array(21857, 24180, 27147, 28914, 97, 0),
array(551, 0, 1898, 839, 202, 132)
),

85 => array(
array(22476, 25007, 27928, 29876, 100, 0),
array(560, 0, 1933, 855, 205, 134)
),

90 => array(
array(31345, 35053, 38963, 41843, 141, 0),
array(771, 0, 2668, 1180, 281, 184)
),

95 => array(
array(31720, 35635, 39443, 42506, 144, 0),
array(771, 0, 2671, 1181, 281, 184)
),

96 => array(
array(32885, 37007, 40897, 44130, 150, 0),
array(795, 0, 2757, 1219, 289, 190)
),

97 => array(
array(32940, 37099, 40968, 44235, 150, 0),
array(794, 0, 2755, 1219, 289, 190)
),

98 => array(
array(33521, 37691, 41686, 44953, 152, 0),
array(812, 0, 2816, 1246, 296, 194)
),

99 => array(
array(36251, 40861, 45089, 48714, 165, 0),
array(872, 0, 3025, 1338, 317, 208)
)
);

// 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) / SPEED);
$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], 0, 0, 0, 3, 0, 0, 0, 0, 20, 20, 0, 20, 20, 20, 20);
$database->addMovement(3, $row['wref'], $vid, $ref, time(), $endtime);

$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], 0, 0, 0, 3, 40, 0, 0, 0, 20, 20, 0, 20, 20, 20, 20);
$database->addMovement(3, $row['wref'], $vid, $ref2, time(), $endtime + 1);
}

Where does this go?
Thanks
 
Newbie Spellweaver
Joined
Sep 14, 2012
Messages
9
Reaction score
0
can you explain where can we put the last code? please
 
Junior Spellweaver
Joined
Mar 29, 2011
Messages
119
Reaction score
56
Download the release from yi12345, there is this plugin already included :)

regards,
just me <3
 
Status
Not open for further replies.
Back
Top