changed stuffz for majin implementation (also submitted the already changed stuffz)

main
hecht 11 years ago
parent 4228218e0e
commit 89d74eb86a

@ -30,7 +30,10 @@ $row = mysql_fetch_assoc(mysql_query($sql2));
$dlevel = ceil($row['dlevel']); $dlevel = ceil($row['dlevel']);
// do the stuff for the whole exp and money distribution there ;) // do the stuff for the whole exp and money distribution there ;)
$results = generateTournamentResults('gross', 250000, 2000000); //$results = generateTournamentResults('gross', 250000, 2000000);
// Franky && Sinnes request no more money for rounds
$results = generateTournamentResults('gross', 250000, 0);
$rang1 = getChar($results[0][0]); $rang1 = getChar($results[0][0]);
insertIntoHallOfFame('Weltturnier', $rang1['id'], $rang1['besitzer']); insertIntoHallOfFame('Weltturnier', $rang1['id'], $rang1['besitzer']);
@ -54,17 +57,17 @@ $summe = 20000000/(1+exp(5-$dlevel/14));
// Now distribute the shop points ;) // Now distribute the shop points ;)
$prices[] = 100; // 1. $prices[] = 4000000; // 1.
$prices[] = 90; // 2. $prices[] = 3000000; // 2.
$prices[] = 75; // 3. + 4. $prices[] = 2000000; // 3. + 4.
$prices[] = 50; // 5. - 8.
$prices[] = 25; // 9. - 16.
$cprices[] = ceil($summe/2); $cprices[] = ceil($summe/2);
$cprices[] = ceil($summe/4); $cprices[] = ceil($summe/4);
$cprices[] = ceil($summe/8); $cprices[] = ceil($summe/8);
distributeShopPoints($prices, $results, 'Weltturnier'); distributeUserPrices($prices, $results, 'Weltturnier');
#distributeShopPoints($prices, $results, 'Weltturnier');
// clan prices are not distributed anymore!! // clan prices are not distributed anymore!!
//distributeClanPrices($cprices, $results, 'Weltturnier'); //distributeClanPrices($cprices, $results, 'Weltturnier');

@ -117,6 +117,22 @@ function distributeShopPoints(array $prices, array $winners, $reason) {
} }
} }
function distributeUserPrices(array $prices, array $winners, $reason) {
$n = min(count($prices), count($winners));
for($i = 0; $i<$n; $i++) {
$points = $prices[$i];
foreach($winners[$i] as $winner) {
// echo $winner . ' <br>';
$char = getChar($winner); // buffered so will not cause in a sql statement all the time!
$userid = $char['besitzer'];
$sql = 'UPDATE user set geld = geld + '.$points.' WHERE id = '. $userid;
echo $sql . ' <br>';
mysql_query($sql);
insertUserTickerMessage($userid, $points .' Preisgeld durch den '.generateRanglistString($i).' Platz im '.$reason.' erhalten!');
}
}
}
function distributeClanPrices(array $prices, array $results, $reason) { function distributeClanPrices(array $prices, array $results, $reason) {
$n = min(count($prices), count($results)); $n = min(count($prices), count($results));

@ -1,52 +1,57 @@
<?php <?php
/* /*
* *
* @copyright (c) 2010 animegame.eu * @copyright (c) 2009 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
* *
*/ */
####################SSJ SPIELER 1 ####################SSJ SPIELER 1
if($technick1[type] == SSJ) { if ($technick1['type'] == 'SSJ') {
$k_mp[0] = $k_mp[0] - $technick1[mp]; $k_mp[0] = $k_mp[0] - $technick1['mp'];
$k_hp[0] = $k_hp[0] - $technick1['hp'];
if ($k_mp[0] < 0) { if ($k_mp[0] < 0) {
$schaden_1 = "SSJ Verwandlung fehlgeschlagen"; $schaden_1 = 'SSJ Verwandlung fehlgeschlagen';
$aktion_AV1[$x] = "nein"; $aktion_AV1[$x] = 'nein';
$k_mp[0] = 0; $k_mp[0] = 0;
} else { } else {
if (!$ssj_tech_1) { if (!$ssj_tech_1) {
$k_starke[0] = $k_starke[0] * (($technick1[starke]+1) / 2); $k_starke[0] = $k_starke[0] * (($technick1['starke'] + 1) / 2);
$k_speed[0] = $k_speed[0] * (($technick1[speed]+1) / 2); $k_speed[0] = $k_speed[0] * (($technick1['speed'] + 1) / 2);
$k_ver[0] = $k_ver[0] * (($technick1[verteidigung]+1) / 2); $k_ver[0] = $k_ver[0] * (($technick1['verteidigung'] + 1) / 2);
$schaden_1 = "$technick1[name]!!!"; $schaden_1 = $technick1['name'].'!!!';
$aktion_AV1[$x] = "nein"; $aktion_AV1[$x] = 'nein';
$ssj_tech_1=$technick1[level]; $ssj_tech_1 = $technick1['level'];
} }
}} }
}
####################SSJ SPIELER 2 ####################SSJ SPIELER 2
if($technick2[type] == SSJ) { if ($technick2['type'] == 'SSJ') {
$k_mp[1] = $k_mp[1] - $technick2[mp]; $k_mp[1] = $k_mp[1] - $technick2['mp'];
$k_hp[1] = $k_hp[1] - $technick2['hp'];
if ($k_mp[1] < 0) { if ($k_mp[1] < 0) {
$schaden_2 = "SSJ Verwandlung fehlgeschlagen"; $schaden_2 = 'SSJ Verwandlung fehlgeschlagen';
$aktion_AV2[$x] = "nein"; $aktion_AV2[$x] = 'nein';
$k_mp[1] = 0; $k_mp[1] = 0;
} else { } else {
if (!$ssj_tech_2) { if (!$ssj_tech_2) {
$k_starke[1] = $k_starke[1] * (($technick2[starke]+1) / 2); $k_starke[1] = $k_starke[1] * (($technick2['starke'] + 1) / 2);
$k_speed[1] = $k_speed[1] * (($technick2[speed]+1) / 2); $k_speed[1] = $k_speed[1] * (($technick2['speed'] + 1) / 2);
$k_ver[1] = $k_ver[1] * (($technick2[verteidigung]+1) / 2); $k_ver[1] = $k_ver[1] * (($technick2['verteidigung'] + 1) / 2);
$schaden_2 = "$technick2[name]!!!"; $schaden_2 = $technick2['name'].'!!!';
$aktion_AV2[$x] = "nein"; $aktion_AV2[$x] = 'nein';
$ssj_tech_2=$technick2[level]; $ssj_tech_2 = $technick2['level'];
}}} }
}
}
?> ?>

@ -1,4 +1,7 @@
<?php <?php
include_once("path.inc.php");
include_once(ROOT_PATH. "/include/defines.inc.php");
/* /*
* *
* @copyright (c) 2010 animegame.eu * @copyright (c) 2010 animegame.eu

@ -160,12 +160,14 @@ while ($s < 2) {
$k_exp[1] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])); $k_exp[1] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id']));
// $k_exp[1] = (($chara_1[starke] + $chara_1[verteidigung] + $chara_1[speed] + $chara_1[ausdauer] + $chara_1[glueck] + $chara_2[starke] + $chara_2[verteidigung] + $chara_2[speed] + $chara_2[ausdauer] + $chara_2[glueck] * ($x / 4)) / 2) * 5; // $k_exp[1] = (($chara_1[starke] + $chara_1[verteidigung] + $chara_1[speed] + $chara_1[ausdauer] + $chara_1[glueck] + $chara_2[starke] + $chara_2[verteidigung] + $chara_2[speed] + $chara_2[ausdauer] + $chara_2[glueck] * ($x / 4)) / 2) * 5;
$k_geld[1] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])) * ($x / 6); //$k_geld[1] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])) * ($x / 6);
$k_exp[0] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])) * 2.2; $k_exp[0] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])) * 2.2;
// $k_exp[0] = ($chara_1[starke] + $chara_1[verteidigung] + $chara_1[speed] + $chara_1[ausdauer] + $chara_1[glueck] + $chara_2[starke] + $chara_2[verteidigung] + $chara_2[speed] + $chara_2[ausdauer] + $chara_2[glueck] * ($x / 4)) * 5; // $k_exp[0] = ($chara_1[starke] + $chara_1[verteidigung] + $chara_1[speed] + $chara_1[ausdauer] + $chara_1[glueck] + $chara_2[starke] + $chara_2[verteidigung] + $chara_2[speed] + $chara_2[ausdauer] + $chara_2[glueck] * ($x / 4)) * 5;
$k_geld[0] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])) * ($x / 6) * 2; #$k_geld[0] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])) * ($x / 6) * 2;
$k_geld[0] = 0;
$k_geld[1] = 0;
$sieger = $chara_1[id]; $sieger = $chara_1[id];
$verlierer = $chara_2[id]; $verlierer = $chara_2[id];
@ -180,13 +182,14 @@ while ($s < 2) {
$k_exp[1] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])) * 2.2; $k_exp[1] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])) * 2.2;
// $k_exp[1] = ($chara_1[starke] + $chara_1[verteidigung] + $chara_1[speed] + $chara_1[ausdauer] + $chara_1[glueck] + $chara_2[starke] + $chara_2[verteidigung] + $chara_2[speed] + $chara_2[ausdauer] + $chara_2[glueck] * ($x / 4)) * 5; // $k_exp[1] = ($chara_1[starke] + $chara_1[verteidigung] + $chara_1[speed] + $chara_1[ausdauer] + $chara_1[glueck] + $chara_2[starke] + $chara_2[verteidigung] + $chara_2[speed] + $chara_2[ausdauer] + $chara_2[glueck] * ($x / 4)) * 5;
$k_geld[1] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])) * ($x / 6) * 2; //$k_geld[1] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])) * ($x / 6) * 2;
$k_geld[1] = 0;
$k_exp[0] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])); $k_exp[0] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id']));
// $k_exp[0] = (($chara_1[starke] + $chara_1[verteidigung] + $chara_1[speed] + $chara_1[ausdauer] + $chara_1[glueck] + $chara_2[starke] + $chara_2[verteidigung] + $chara_2[speed] + $chara_2[ausdauer] + $chara_2[glueck] * ($x / 4)) / 2) * 5; // $k_exp[0] = (($chara_1[starke] + $chara_1[verteidigung] + $chara_1[speed] + $chara_1[ausdauer] + $chara_1[glueck] + $chara_2[starke] + $chara_2[verteidigung] + $chara_2[speed] + $chara_2[ausdauer] + $chara_2[glueck] * ($x / 4)) / 2) * 5;
$k_geld[0] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])) * ($x / 6); //$k_geld[0] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])) * ($x / 6);
$k_geld[0] = 0;
} }
if ($k_exp[0]) { if ($k_exp[0]) {

@ -60,7 +60,14 @@ function bearbeiteAbgelaufeneAuktion($auktionsid){
$anzahl = $result['anzahl']; $anzahl = $result['anzahl'];
$item_row_name = 'item'; $item_row_name = 'item';
if($result['tablename'] == 'ware'){$item_row_name = 'item_id';} if($result['tablename'] == 'ware'){$item_row_name = 'item_id';}
#database_query('DELETE FROM auktion WHERE auktionsid = '.$auktionsid);
while($anzahl-- > 0){ while($anzahl-- > 0){
if($anzahl > 1000 && $anzahl % 1000 == 0) {
echo date("H:i:s").' Anzahl maxi Auktion '.$anzahl."\n";
}
database_query('INSERT INTO '.$result['tablename'].' ('.$item_row_name.', user) VALUES('.$result['itemid'].','.$itemreceiver.')'); database_query('INSERT INTO '.$result['tablename'].' ('.$item_row_name.', user) VALUES('.$result['itemid'].','.$itemreceiver.')');
} }
@ -155,11 +162,28 @@ function getAveragePrice($itemid, $tablename, $anzahl){
return round($row['average']*$anzahl); return round($row['average']*$anzahl);
} }
// check if this cronjob is already busy!!
$array = array();
exec('pgrep '.$argv[0], $array);
$arrayCpy = array();
foreach($array as $tmp) {
if($tmp != getmypid()) {
$arrayCpy[] = $tmp;
}
}
if(count($arrayCpy)<=1) {
// Starten der Auktionsverteilung // Starten der Auktionsverteilung
$i = bearbeiteAlleAbgelaufenenAuktionen(); $i = bearbeiteAlleAbgelaufenenAuktionen();
//$sql = 'INSERT INTO nachricht(von, besitzer, betreff, text) VALUES (\'GM-INFO\', 3735, \'Cronjob lief!\', \' Der Vierteilstunde-Cronjob wurde ausgefuehrt! Es wurden '.$i.' Anfragen bearbeitet!\')'; //$sql = 'INSERT INTO nachricht(von, besitzer, betreff, text) VALUES (\'GM-INFO\', 3735, \'Cronjob lief!\', \' Der Vierteilstunde-Cronjob wurde ausgefuehrt! Es wurden '.$i.' Anfragen bearbeitet!\')';
//database_query($sql); //database_query($sql);
insertAuktionen(); insertAuktionen();
detectMultiAccounts(); detectMultiAccounts();
}
?> ?>
Loading…
Cancel
Save