Skocz do zawartości

Dołącz do społeczności!

👋 Witaj na MPCForum!

Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

  • ✅ Pełny dostęp do działów i ukrytych treści
  • ✅ Możliwość pisania i odpowiadania w tematach
  • ✅ System prywatnych wiadomości
  • ✅ Zbieranie reputacji i rozwijanie swojego profilu
  • ✅ Członkostwo w jednej z największych społeczności graczy

👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

Zarejestruj się teraz

Nowe Epiki - Mini Poradnik

Rekomendowane odpowiedzi

Opublikowano

Taki tam maly poradnik jak miec nowe epiki ( halloween oraz christmas )

 

Wystarczy podmnienic ;

if ($shop == 0) {
		while ( $class != 1 && $type == 2 )
			$type = rand ( 1, 7 );
		
		$item ['item_type'] = $type;
		$random = rand ( 1, $shakes_item_ids [$class - 1] [$type - 1] );
		if ($epicRand == 1){
			if ($class == 3){
				if ($type == 1 or $type == 2)
				{
					$item ['item_id'] = rand(2050, 2063);
				}
				else
				{
					$item ['item_id'] = rand(2050, 2063);
                    while($item['item_id'] == 2059 || $item ['item_id'] == 2060) {
                    $item ['item_id'] = rand(2050, 2063);
                    }
				}
			}
			if ($class == 2){
				if ($type == 1 or $type == 2)
				{
					$item ['item_id'] = rand(1050, 1063) ;
				}
				else
				{
					$item ['item_id'] = rand(1063, 1064);
                    while($item['item_id'] == 1059 || $item ['item_id'] == 1060) {
                    $item ['item_id'] = rand(1063, 1064);
                    }
				}
			}
			if ($class == 1){
				if ($type == 1 or $type == 2)
				{
					$item ['item_id'] = rand(50, 63);
				}
				else
				{
					$item ['item_id'] = rand(50, 63);;
                    while($item['item_id'] == 59 || $item ['item_id'] == 60) {
                  $item ['item_id'] = rand(50, 63);
					
					$item ['item_id'] = rand(50, 63);
                    }
				}
			}
		} else {
		$item ['item_id'] = $random + (($class - 1) * 1000);
		}
		
		if ($type == 1) {
			$class_weap_multiplier = array (
					1.2,
					4,
					2.1 
			);
			
			$m = mt_rand ( 900, 1100 ) / 1000;
			$avg = round($lvl * '1.3' * $class_weap_multiplier [$class - 1]);
			
			$minmax_m = round(mt_rand(750, 1000) / 1000);
			
			
			
			$item ['dmg_min'] = round($avg * $minmax_m);
			$item ['dmg_max'] = round($avg * ($minmax_m + '0.25') + rand (1, 50));
		} else {
			if ($type == 2){
				if ($lvl < 1){
				$shieldNumber = 2;
				}
				if ($lvl < 5 and $lvl > 10){
				$shieldNumber = 6;
				}
				if ($lvl < 9 and $lvl > 10){
				$shieldNumber = 10;
				}
				if ($lvl < 14 and $lvl > 10){
				$shieldNumber = 15;
				}
				if ($lvl < 20 and $lvl > 10){
				$shieldNumber = 20;
				}
				if ($lvl > 35){
				$shieldNumber = 25;
				}
			$item ['dmg_min'] = $shieldNumber;
			} else {
			$item ['dmg_min'] = $lvl * 2 * rand(1.51, 1.74) + rand(1, 6);
			}
		}
	} else {
		$item ['dmg_min'] = 0;
		$item ['item_type'] = $type;
		if ($epicRand == 1){
		$item ['item_id'] = rand (50, 63);
		} else {
		$item ['item_id'] = rand ( 1, $fidget_item_ids [$type - 8] );
		}
	}

+ Przy okazji dobre ustawienie na DMG dla kazdej z klas :)

Najlepszy prywatny serwer w Europie!

Opublikowano

Generują się także "epiki widmo"?

Chyba nie, jednak nie za bardzo rozumiem po co te while.

Opublikowano

Ehh, boles, strasznie pomieszany ten kod. Tyle udziwnień dodane, wgl nie potrzebne. Cóż. Mam swoje, wszystko śmiga.

 

Zamiast dodawać masę while i if'ów wystarczy zmienić 3 cyferki. xD

Edytowane przez FidgetPL

Opublikowano
  • Autor

Ehh, boles, strasznie pomieszany ten kod. Tyle udziwnień dodane, wgl nie potrzebne. Cóż. Mam swoje, wszystko śmiga.

 

Zamiast dodawać masę while i if'ów wystarczy zmienić 3 cyferki. xD

U mnie wszystko smiga ;) Dodalem while oraz if aby nie miec pustych okienek bo przed tym mialem teraz wszystko dziala bez bledow :)

 

 

 

Powiedzmy że działa, nie licząc tego, że jest widmowy set i że generują się wyłącznie świąteczne itemy :D

 

Nowe Epiki - Mini Poradnik - obraz 2

 

Nie wiem co masz ale cos raczej ty nie tak zrobiles w kodzie u mnie wszystko jest git. ;)

 

Jezeli chcesz miec ity ale z widmami bez wiekszych zmian kodu wystarczy to:

 

$item ['item_id'] = rand(2050, 2063);

+ Dodam caly skrypt zeby nie bylo problemow ;) Zobacz @her0es

function genNewItem($lvl, $class, $shop, $slot, $itemid) {
	global $db;
	$item = genItem ( $lvl, $class, $shop );
	
	$table = $shop == 0 ? "items_shakes" : "items_fidget";
	
	$qry = $db->prepare ( 'UPDATE ' . $table . ' SET 
			item_type = ' . $item ['item_type'] . ', 
			item_id = ' . $item ['item_id'] . ',
			dmg_min = ' . $item ['dmg_min'] . ',
			dmg_max = ' . $item ['dmg_max'] . ',
			atr_type_1 = ' . $item ['atr_type_1'] . ',
			atr_type_2 = ' . $item ['atr_type_2'] . ',
			atr_type_3 = ' . $item ['atr_type_3'] . ',
			atr_val_1 = ' . $item ['atr_val_1'] . ',
			atr_val_2 = ' . $item ['atr_val_2'] . ',
			atr_val_3 = ' . $item ['atr_val_3'] . ',
			gold = ' . $item ['gold'] . ',
			mush = ' . $item ['mush'] . ' 
			WHERE id = ' . $itemid . ';' );
	if (! $qry->execute ()) {
		// var_dump($qry -> errorInfo());
	}
}
function genItem($lvl, $class, $shop, $option, $db_data) {
	global $shakes_item_ids, $fidget_item_ids;
	
	if ($shop == 0) {
		$type = rand ( 1, 7 );
	} else {
		if ($option == "toilet" or $option == "dungeon"){
			$type = rand ( 8, 10); //toilet, and dungeon isn't giving out keys or potions
		} elseif ($option == "tavern") {
			$type = rand ( 8, 11); //11 is keys, 12 is potions
		} else {
			$type = rand ( 8, 12); //11 is keys, 12 is potions
		}
		
		if ($type == 11 and $option != "tavern"){
			$type = rand ( 8, 10);
		}
	}
	
	if ($option == "toilet"){
		$epicRand = rand(1, 2); //if toilet
	} elseif ($option == "dungeon") {
		$epicRand = rand(1, 4); //if dungeon
	} elseif ($option == "tavern" and $lvl > 25) {
		$epicRand = rand(1, 15); //if tavern
	} elseif ($lvl > 25) {
		$epicRand = rand(1, 2); //if shop
	} else {
		$epicRand = -1;
	}
	
	// if epic event or chirstmas
	if (event () == 2 or event () == 5){
		if ($option == "toilet"){
			$epicRand = 1; //if toilet
		} elseif ($option == "dungeon") {
			$epicRand = rand(1, 3); //if dungeon
		} elseif ($option == "tavern") {
			$epicRand = rand(1, 10); //if tavern
		} else {
			$epicRand = rand(1, 2); //if shop
		}
	}
		
		
	$statNumRand = rand(1, 7);
	
	if ($shop == 1 and $type == 12){
		if ($lvl < 10){ //if level < 10 then shop gives only small potions
			$potionIDRand = rand (1, 5);
		} elseif ($lvl < 25 and $lvl > 9) { //if level < 25 then shop gives small potions and medium potions
			$potionIDRand = rand (1, 10);
		} elseif ($lvl > 24) { //if level > 24 then shop gives small, medium and big potions + Potion of the Eternal Life
			$potionIDRand = rand (1, 16);
		}
	}
	
	$itemMush = 0;
	
	if ($type == 1){ // if weapon item
	$itemGold = rand($lvl * $lvl * ($lvl * 4 + 10), $lvl * $lvl * ($lvl * 5 + 12));
	} else { // if normal item
	$itemGold = rand($lvl * $lvl * ($lvl * 3 + 10), $lvl * $lvl * ($lvl * 5 + 12)) / 2;
	}
	
	// potions - shop 2
	if ($potionIDRand > 0 and $potionIDRand < 6 and $type == 12){ // if small potions
		$itemGold = rand($lvl * $lvl * ($lvl * 5 + 10), $lvl * $lvl * ($lvl * 6 + 12)) / 20;
	} elseif ($potionIDRand > 5 and $potionIDRand < 11 and $type == 12){ // if medium potions
		$itemGold = rand($lvl * $lvl * ($lvl * 5 + 10), $lvl * $lvl * ($lvl * 6 + 12)) / 15;
	} elseif ($potionIDRand > 10 and $potionIDRand < 16 and $type == 12){ // if big potions
		$itemGold = rand($lvl * $lvl * ($lvl * 5 + 10), $lvl * $lvl * ($lvl * 6 + 12)) / 10;
	} elseif ($potionIDRand == 16 and $type == 12){ // if life potions
		$itemGold = rand($lvl * $lvl * ($lvl * 5 + 10), $lvl * $lvl * ($lvl * 6 + 12)) / 10;
	}
	
	if ($option == 'tavern' or $option == 'dungeon' or $option == 'toilet'){ // items - tavern, dungeon, toilet
	$itemGold = rand($lvl * $lvl * ($lvl * 5 + 10), $lvl * $lvl * ($lvl * 6 + 12)) / 5;
	}
	
	if ($type == 11){
	$itemGold = 10000000;
	}
	
	if ($epicRand == 1 and $type < 11){
		$itemMush = 15;
	} elseif ($statNumRand == 1 and $type < 11) { // if normal items with 2 stats
		$itemMush = 6;
	} elseif ($type == 12 and $potionIDRand == 16) { // if life potion
		$itemMush = 15;
	} else {
		$itemMush = 0;
	}
	
	if ($option == "toilet" or $option == "dungeon" or $option == "tavern"){
	$itemMush = 0;
	}
	
	$item = array (
			"item_type" => "1",
			"item_id" => "1005",
			"dmg_min" => "1",
			"dmg_max" => "0",
			"atr_type_1" => "0",
			"atr_type_2" => "0",
			"atr_type_3" => "0",
			"atr_val_1" => "0",
			"atr_val_2" => "0",
			"atr_val_3" => "0",
			"gold" => $itemGold,
			"mush" => $itemMush,
			"slot" => "0",
			"owner_id" => $itemOwner
	);
	
	if ($shop == 0) {
		while ( $class != 1 && $type == 2 )
			$type = rand ( 1, 7 );
		
		$item ['item_type'] = $type;
		$random = rand ( 1, $shakes_item_ids [$class - 1] [$type - 1] );
		if ($epicRand == 1){
			if ($class == 3){
				if ($type == 1 or $type == 2)
				{
					$item ['item_id'] = rand(2050, 2063);
				}
				else
				{
					$item ['item_id'] = rand(2050, 2063);
                    while($item['item_id'] == 2059 || $item ['item_id'] == 2060) {
                    $item ['item_id'] = rand(2050, 2063);
                    }
				}
			}
			if ($class == 2){
				if ($type == 1 or $type == 2)
				{
					$item ['item_id'] = rand(1050, 1063) ;
				}
				else
				{
					$item ['item_id'] = rand(1063, 1064);
                    while($item['item_id'] == 1059 || $item ['item_id'] == 1060) {
                    $item ['item_id'] = rand(1063, 1064);
                    }
				}
			}
			if ($class == 1){
				if ($type == 1 or $type == 2)
				{
					$item ['item_id'] = rand(50, 63);
				}
				else
				{
					$item ['item_id'] = rand(50, 63);;
                    while($item['item_id'] == 59 || $item ['item_id'] == 60) {
                  $item ['item_id'] = rand(50, 63);
					
					$item ['item_id'] = rand(50, 63);
                    }
				}
			}
		} else {
		$item ['item_id'] = $random + (($class - 1) * 1000);
		}
		
		if ($type == 1) {
			$class_weap_multiplier = array (
					1.2,
					4,
					2.1 
			);
			
			$m = mt_rand ( 900, 1100 ) / 1000;
			$avg = round($lvl * '1.3' * $class_weap_multiplier [$class - 1]);
			
			$minmax_m = round(mt_rand(750, 1000) / 1000);
			
			
			
			$item ['dmg_min'] = round($avg * $minmax_m);
			$item ['dmg_max'] = round($avg * ($minmax_m + '0.25') + rand (1, 50));
		} else {
			if ($type == 2){
				if ($lvl < 1){
				$shieldNumber = 2;
				}
				if ($lvl < 5 and $lvl > 10){
				$shieldNumber = 6;
				}
				if ($lvl < 9 and $lvl > 10){
				$shieldNumber = 10;
				}
				if ($lvl < 14 and $lvl > 10){
				$shieldNumber = 15;
				}
				if ($lvl < 20 and $lvl > 10){
				$shieldNumber = 20;
				}
				if ($lvl > 35){
				$shieldNumber = 25;
				}
			$item ['dmg_min'] = $shieldNumber;
			} else {
			$item ['dmg_min'] = $lvl * 2 * rand(1.51, 1.74) + rand(1, 6);
			}
		}
	} else {
		$item ['dmg_min'] = 0;
		$item ['item_type'] = $type;
		if ($epicRand == 1){
		$item ['item_id'] = rand (50, 63);
		} else {
		$item ['item_id'] = rand ( 1, $fidget_item_ids [$type - 8] );
		}
	}
	
	if ($class == 1){
	$classStat = 1;
	}
	if ($class == 2){
	$classStat = 3;
	}
	if ($class == 3){
	$classStat = 2;
	}
	if ($epicRand == 1){
		if (rand(1, 2) == 1){ //epic item with 3 stats
			$stat_type2 = 4;
			$stat_type3 = 5;
			$m = mt_rand ( 850, 1300 ) / rand(850, 1000) * rand(1.4, 1.5);
			$stat_val1 = round ( $lvl * $m );
			$stat_val2 = round ( $lvl * $m );
			$stat_val3 = round ( $lvl * $m );
			
			$item ['atr_type_1'] = $classStat;
			$item ['atr_val_1'] = $stat_val1;
			$item ['atr_type_2'] = $stat_type2;
			$item ['atr_val_2'] = $stat_val2;
			$item ['atr_type_3'] = $stat_type3;
			$item ['atr_val_3'] = $stat_val3;
		} else { //epic item with all stat
			$stat_type = 6;
			$m = mt_rand ( 850, 1300 ) / rand(850, 1000) * rand(1.1, 1.2);
			$stat_val = round ( $lvl * $m );
			
			$item ['atr_type_1'] = $stat_type;
			$item ['atr_val_1'] = $stat_val;
		}
	} else {
		if ($statNumRand == 1){ //normal item with 2 stats
			$stat_type1 = rand ( 1, 5 );
			$stat_type2 = rand ( 1, 5 );
			if ($stat_type2 == $stat_type1){
				if ($stat_type1 < 2){
					$stat_type2 = $stat_type1 + 1;
				} else {
					$stat_type2 = $stat_type1 - 1;
				}
			}
			$m1 = mt_rand ( 850, 1300 ) / rand(850, 1000);
			$m2 = mt_rand ( 850, 1300 ) / rand(850, 1000);
			$stat_val1 = round ( $lvl * rand(1.3, 1.6) * $m1 );
			$stat_val2 = round ( $lvl * rand(1.2, 1.4) * $m2 );
			
			$item ['atr_type_1'] = $stat_type1;
			$item ['atr_val_1'] = $stat_val1;
			$item ['atr_type_2'] = $stat_type2;
			$item ['atr_val_2'] = $stat_val2;
		} else { //normal item with 1 stat
			$stat_type = rand ( 1, 5 );
			$m = mt_rand ( 850, 1300 ) / rand(850, 1000);
			$stat_val = round ( $lvl * rand(2, 2.2) * $m );
		
			$item ['atr_type_1'] = $stat_type;
			$item ['atr_val_1'] = $stat_val;
		}
	}
	
	if ($type == 11){ //if key then
		$item ['item_id'] = -1; // default value
		if ($option == 'tavern'){
		
			
		//	if (rand (1, 2) == 1 and $lvl > 50 and $db_data ['magic_mirror'] == 0){
		//		$item ['item_id'] = 21; // magic mirror key ?? what's this?
		//	}
			
		//	if (rand (1, 50) == 1){
		//		$item ['item_id'] = rand(22, 24); // eggs ?? what's this?
		//	}
			
			if (rand (1, 3) == 1 and $lvl > 50 and $db_data ['magic_mirror'] == 0 and $db_data ['magic_mirror_shard'] < 43){
				$item ['item_id'] = $db_data['magic_mirror_shard']; // magic mirrors
			}
		
			if (rand (1, 2) == 1 and $lvl > 99 and $db_data ['toilet'] == 0){
				$item ['item_id'] = 20; // toilet key
			}
			
			if ($item ['item_id'] == -1){
				if ($db_data ['dungeon_1'] == 0 and $lvl > 9){
					$item ['item_id'] = 1;
				} elseif ($db_data ['dungeon_2'] == 0 and $lvl > 19){
					$item ['item_id'] = 2;
				} elseif ($db_data ['dungeon_3'] == 0 and $lvl > 29){
					$item ['item_id'] = 3;
				} elseif ($db_data ['dungeon_4'] == 0 and $lvl > 39){
					$item ['item_id'] = 4;
				} elseif ($db_data ['dungeon_5'] == 0 and $lvl > 49){
					$item ['item_id'] = 5;
				} elseif ($db_data ['dungeon_6'] == 0 and $lvl > 59){
					$item ['item_id'] = 6;
				} elseif ($db_data ['dungeon_7'] == 0 and $lvl > 59){
					$item ['item_id'] = 7;
				} elseif ($db_data ['dungeon_8'] == 0 and $lvl > 69){
					$item ['item_id'] = 8;
				} elseif ($db_data ['dungeon_9'] == 0 and $lvl > 79){
					$item ['item_id'] = 9;
				} else {
					return ('0/0/0/0/0/0/0/0/0/0/0/0');
					break;
				}
			}
			
		} else {
		$item ['item_id'] = rand (1, 9);
		}
	$item ['dmg_min'] = 0;
	$item ['atr_type_1'] = 0;
	$item ['atr_val_1'] = 0;
	$item ['atr_type_2'] = 0;
	$item ['atr_val_2'] = 0;
	$item ['atr_type_3'] = 0;
	$item ['atr_val_3'] = 0;
	}
	
	if ($type == 12){
	$item ['item_id'] = $fidget_item_ids [$type - 8] + $potionIDRand;
	
	switch ($potionIDRand) {
	case 1:
        $potionAtr_type = 1;
		$potionAtr_val = 5;
		break;
	case 2:
        $potionAtr_type = 2;
		$potionAtr_val = 5;
		break;
	case 3:
        $potionAtr_type = 3;
		$potionAtr_val = 5;
		break;
	case 4:
        $potionAtr_type = 4;
		$potionAtr_val = 5;
		break;
	case 5:
        $potionAtr_type = 5;
		$potionAtr_val = 5;
		break;
	case 6:
        $potionAtr_type = 1;
		$potionAtr_val = 15;
		break;
	case 7:
        $potionAtr_type = 2;
		$potionAtr_val = 15;
		break;
	case 8:
        $potionAtr_type = 3;
		$potionAtr_val = 15;
		break;
	case 9:
        $potionAtr_type = 4;
		$potionAtr_val = 15;
		break;
	case 10:
        $potionAtr_type = 5;
		$potionAtr_val = 15;
		break;
	case 11:
        $potionAtr_type = 1;
		$potionAtr_val = 25;
		break;
	case 12:
        $potionAtr_type = 2;
		$potionAtr_val = 25;
		break;
	case 13:
        $potionAtr_type = 3;
		$potionAtr_val = 25;
		break;
	case 14:
        $potionAtr_type = 4;
		$potionAtr_val = 25;
		break;
	case 15:
        $potionAtr_type = 5;
		$potionAtr_val = 25;
		break;
	case 16:
		$potionAtr_type = 12;
		$potionAtr_val = 25;
		break;
	}
	$item ['atr_type_1'] = $potionAtr_type;
	$item ['atr_val_1'] = $potionAtr_val;
	$item ['dmg_min'] = 0;
	$item ['atr_type_2'] = 0;
	$item ['atr_val_2'] = 0;
	$item ['atr_type_3'] = 0;
	$item ['atr_val_3'] = 0;
	}
	
	return $item;
}
// returns items array

Edytowane przez Boles0012310

Najlepszy prywatny serwer w Europie!

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

Ostatnio przeglądający 0

  • Brak zarejestrowanych użytkowników przeglądających tę stronę.

Konto

Nawigacja

Skonfiguruj powiadomienia push w przeglądarce

Chrome (Android)
  1. Stuknij ikonę kłódki obok paska adresu.
  2. Stuknij Uprawnienia → Powiadomienia.
  3. Dostosuj swoje ustawienie.
Chrome (Komputer)
  1. Kliknij ikonę kłódki na pasku adresu.
  2. Wybierz Ustawienia witryny.
  3. Znajdź Powiadomienia i dostosuj swoje ustawienie.