Skocz do zawartoś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

SFGame Priv. - Portal [UPDATE] !


BoB`EK

Rekomendowane odpowiedzi

Opublikowano

70%? Śmieszne. Dużo pisania? Wątpie. Wystarczy skopiować np. skrypt walki w wiezy i wrzucic do $ACT_PORTAL_FIGHT. Ustawic portwory. Tyle :|

Opublikowano

Ta?

Wystarczy dodać:

case $ACT_PORTAL_FIGHT_SINGLE :
//portal 
 
$db_data = loadDefaultData ();
 
// STRUCTURE
//$ret [0] = '3215216960/7103/1791/1770/4384/3909/25172784/2473/5947/2464/5763/3930;4655420/0/0/25172784/561540/3/4405539/0/2/25172784/249880/0/4153589/0/2/25172784/251950/0/3787388/936784/3/24236000/366200/0/2288974/1346645/3/22889354/1498414/3/1706694/765428/0/22123926/582280/0/151549/883898/0/21240028/1555145/3/-661731/1047733/0/20192294/813280/0/;' . $db_data ['user_name'] . '/237/0/0/1/-391/0/0/0/0/0/0/0/0/0/37/272/0/0/3/-436/0/0/0/0/0/0/0/0/0;1/57/458/646/1/4/5/328/328/328/0/0/1/2003/455/909/0/0/0/0/0/0/0/0;0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;2;0;0;0;-1;;36;37ǭ1/2/3/' . $db_data ['user_name'] . '///-1/////DZ191428/1528/1511/6632/2503/3746/25172784/2473/5947/2464/5763/3930;695733/0/0/20192294/495694/0/25093/1744524/3/18447770/670640/0/-946245/2487723/3/15960047/971338/3/;' . $db_data ['user_name'] . '/237/0/0/2/-392/0/0/0/0/0/0/0/0/0/37/272/0/0/3/-436/0/0/0/0/0/0/0/0/0;1/1009/819/1467/3/1/2/986/0/0/22997039/0/1/2003/455/909/0/0/0/0/0/0/0/0;0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;2;0;0;0;-1;;36;37ǭ1/3/' . $db_data ['user_name'] . '////20192294/////Ǵ363968/1528/6323/1508/4584/3565/25172784/2473/5947/2464/5763/3930;4128753/357705/3/15602342/235215/0/4128753/0/2/15602342/0/2/3783833/296818/0/15305524/344920/0/3783833/0/2/15305524/0/2/3783833/0/2/15305524/0/2/3144072/427037/0/14878487/639761/3/2733022/0/2/14878487/411049/0/2733022/0/2/14878487/0/2/2222398/0/2/14878487/510624/0/1531360/609312/0/14269175/691038/0/1531360/0/2/14269175/0/2/232841/0/2/14269175/1298519/3/232841/787640/0/13481535/0/2/232841/864448/0/12617087/0/2/232841/0/2/12617087/0/2/-1730563/1884610/3/10732477/1963404/3/;' . $db_data ['user_name'] . '/237/0/0/3/-393/0/0/0/0/0/0/0/0/0/37/272/0/0/3/-436/0/0/0/0/0/0/0/0/0;1/2056/600/644/2/4/5/588/588/588/0/0/1/2003/455/909/0/0/0/0/0/0/0/0;0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;2;0;0;0;-1;;36;37ǭ1/' . $db_data ['user_name'] . '/////15960047/////DZ082424/961/1005/6661/2274/2125/25172784/2473/5947/2464/5763/3930;166101/1403916/3/9328561/916323/3/-632401/995043/0/8333517/798503/0/;' . $db_data ['user_name'] . '/237/1/1/2/2/103/102/2/109/3/2/15/1/0/37/272/0/0/3/-436/0/0/0/0/0/0/0/0/0;1/1009/1046/1410/3/4/5/1064/0/0/18758009/0/1/2003/455/909/0/0/0/0/0/0/0/0;0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;2;0;0;0;-1;;36;37ǭ1//////10732477/////ǻ0;-1;0;0;0DZ264302793/92087/1397866973/1301994663/841267025/22/0/237/111298869/123996780/96905/933/-1/65338476/0/1338/1324/2/103/102/2/109/3/2/15/1/0/1/257/2/961/804/1950/1791/1700/0/201/4711/483/425/870/709/1848/1697/1602/0/1/0/1023410182/656368/443/0/3/4/2/492/0/0/11048178/0/3/1008/783/0/3/2/1/539/0/0/17891075/0/855638021/66546/532/0/3/4/5/532/0/0/9488487/0/687865860/1967089/437/0/3/2/1/500/0/0/6277787/0/1358954504/655369/0/0/3/1/5/528/0/0/7667088/0/1191182343/66544/622/0/3/2/4/512/0/0/8327251/0/1526726665/655368/0/0/4/1/5/483/0/0/0/0/1694498826/1310746/0/0/3/2/1/544/0/0/8864890/0/184549377/328689/1046/1410/3/4/5/1064/0/0/18758009/0/0/0/0/0/0/0/0/0/0/0/0/0/8/19/0/0/1/5/3/571/0/0/29292628/0/0/1008/532/0/4/3/1/548/0/0/0/0/0/2010/2154/0/1/2/3/295/269/0/0/0/0/15/0/0/11/5/0/72/25/0/1852482/0/0/1/0/0/1/5/3/304/248/0/0/0/0/237/237/237/5/4/1/-90/-93/-80/17/8/2/720/720/960/0/1010/718/0/4/1/5/295/269/0/27657353/0/0/1008/743/0/4/3/2/332/242/0/30570794/0/0/19/0/0/1/5/3/571/0/0/29292628/0/234800/839600/340000/28276200/10709600/34308500/2359298/1397782503/5/1008/579/0/3/1/5/552/0/0/40004185/0/3/1009/676/0/4/5/3/283/283/0/52922554/10/5/1009/411/0/5/4/2/289/267/0/55685219/10/5/1008/827/0/1/2/4/316/260/0/41133282/1/1/1008/809/1739/2/5/4/1120/0/0/99431632/0/1/1009/1160/1378/1/3/5/634/458/0/158498908/10/1397782757/8/7/0/0/1/3/2/342/224/0/21909165/10/12/16/0/0/11/12/0/168/25/0/3087470/15/9/5/0/0/5/4/2/557/0/0/39474100/0/8/5/0/0/1/4/2/340/224/0/10585665/1/9/14/0/0/1/5/3/350/218/0/12332167/1/8/12/0/0/4/3/5/552/0/0/37778355/0/37/0/829/3/272/10968/921711/1357235982/12/10/1391589443/0/0/1/2817/1046/1410/0/1398880351/3/0/0/1397866956/6000/0/100/1397870573/1397859709/146/146/1/1356631675/237/100/5192/9239/8082/1000000000/102529/2/1362/83/0/0/4/1397866973/5/12/12/12/12/12/12/12/12/12/12/120/16/485/15/12/0/1398042462/1398040963/0/25/25/0/0/304900910/304900910/304900910/1/1368876356/0/1596/1397866973';
//break;
 
// check time restrictions
$time = new DateTime ();
$time = $time->getTimestamp ();
if ($time < $db_data ['dungeon_time']) {
if ($db_data ['mushroom'] <= 0) {
// TODO throw error
break;
}
$db_data ['mushroom'] = $db_data ['mushroom'] - 1;
$time = $db_data ['dungeon_time'];
} else {
$time = $time + 1800;
}
 
 
$stage = $db_data['portal_level'];
 
$OP = getPortalMonster ( $stage, $db_data );
$p = new Char ( $db_data );
 
// response
$t_ret = array ();
 
// player stats
array_push ( $t_ret, "122" . $p->getHP (), $p->getStr (), $p->getDex (), $p->getInt (), $p->getWit (), $p->getLuck () );
 
// mob stats
array_push ( $t_ret, $OP->getHP (), $OP->getStr (), $OP->getDex (), $OP->getInt (), $OP->getWit (), $OP->getLuck () . ";" ); // . $p->getHp () );
                                                                                                                            
// simulation
$sim = SF_Calc::calculateWin ( $p, $OP );
 
$win = $sim [count ( $sim ) - 1] [0] <= 0 ? true : false;
 
 
// if win -> update exp, lvl, etc...
if ($win) {
// increment stage lvl
$stage ++;
 
// add gained exp & gold
$db_data ['exp'] = ( int ) $db_data ['exp'] + $OP->getExp ();
$db_data ['silver'] = ( int ) $db_data ['silver'] + $OP->getGold ();
   $db_data ['potion_value1'] = $db_data ['potion_value1'] + 1;
 
// add item rewards
 
$lvl = $db_data ['lvl'];
$class = $db_data ['class'];
$shop = rand(0, 1);
 
$item = genItem ($lvl, $class, $shop, 'dungeon');
 
 
$qry = $db->prepare ( "SELECT slot FROM items WHERE slot = 10 AND owner_id = " . $db_data['user_id'] );  
$qry->execute ();
if ($qry->rowCount () < 1) {
$item ['slot'] = 10;
} else {
$qry = $db->prepare ( "SELECT slot FROM items WHERE slot = 11 AND owner_id = " . $db_data['user_id'] );  
$qry->execute ();
if ($qry->rowCount () < 1) {
$item ['slot'] = 11;
} else {
$qry = $db->prepare ( "SELECT slot FROM items WHERE slot = 12 AND owner_id = " . $db_data['user_id'] );  
$qry->execute ();
if ($qry->rowCount () < 1) {
$item ['slot'] = 12;
} else {
$qry = $db->prepare ( "SELECT slot FROM items WHERE slot = 13 AND owner_id = " . $db_data['user_id']);  
$qry->execute ();
if ($qry->rowCount () < 1) {
$item ['slot'] = 13;
} else {
$qry = $db->prepare ( "SELECT slot FROM items WHERE slot = 14 AND owner_id = " . $db_data['user_id'] );  
$qry->execute ();
if ($qry->rowCount () < 1) {
$item ['slot'] = 14;
} else {
$ret = array (
$ERR_INVENTORY_FULL
);
break;
}
}
}
}
}
 
 
$qry = $db->prepare ( 'INSERT INTO items(item_type, item_id, dmg_min, dmg_max, atr_type_1, atr_type_2, atr_type_3, atr_val_1, atr_val_2, atr_val_3, gold, mush, slot, owner_id) 
VALUES(' . $item ['item_type'] . ',' . $item ['item_id'] . ',' . $item ['dmg_min'] . ',' . $item ['dmg_max'] . ',
' . $item ['atr_type_1'] . ',' . $item ['atr_type_2'] . ',' . $item ['atr_type_3'] . ',' . $item ['atr_val_1'] . ',' . $item ['atr_val_2'] . ',
' . $item ['atr_val_3'] . ',' . $item ['gold'] . ',' . $item ['mush'] . ',' . $item ['slot'] . ',' . $db_data['user_id'] . ')' );   
$qry->execute ();
 
 
// lvl up
while ( $db_data ['exp'] > $LEVELS [$db_data ['lvl']] ) {
$db_data ['exp'] -= $LEVELS [$db_data ['lvl']];
$db_data ['lvl'] = ( int ) $db_data ['lvl'] + 1;
}
}
//
$db_data ['portal_bonus'] = $stage ;
//
 
// update database
$qry_str = "UPDATE user_data SET 
exp = :exp, 
lvl = :lvl, 
silver = :silver, 
mushroom = :shroom, 
dungeon_time = :time,
potion_value1 = :potion_value1,
portal_level = :portal_level";
$qry_str .= " WHERE ssid = :ssid";
$qry = $db->prepare ( $qry_str );
$qry->bindParam ( ':exp', $db_data ['exp'] );
$qry->bindParam ( ':lvl', $db_data ['lvl'] );
$qry->bindParam ( ':silver', $db_data ['silver'] );
$qry->bindParam ( ':shroom', $db_data ['mushroom'] );
$qry->bindParam ( ':time', $time );
$qry->bindParam ( ':potion_value1', $db_data ['potion_value1'] );
$qry->bindParam ( ':portal_level', $stage );
$qry->bindParam ( ':ssid', $SSID );
$qry->execute ();
 
$t_ret [count ( $t_ret ) - 1] .= $sim [0] [0];
 
// ---logs----
// first 3, one in previous index, separated by semicolon
array_push ( $t_ret, $sim [0] [1], $sim [0] [2] );
 
for($i = 1; $i < count ( $sim ); $i ++) {
array_push ( $t_ret, $sim [$i] [0], $sim [$i] [1], $sim [$i] [2] );
// echo $sim [$i][0]."/".$sim [$i][1]."/".$sim [$i][2]."/";
}
 
// looks
array_push ( $t_ret, ";" . $db_data ['user_name'], $p->getLvl (), $db_data ['race'], $db_data ['gender'], $db_data ['class'] );
// faces
for($i = 1; $i <= 9; $i ++) {
$t_ret [] = $db_data ['face' . $i];
}
 
// mob looks, lvl, weapon
array_push ( $t_ret, "0", "0", $OP->getLvl (), "0", "0", "1", "-" . $OP->getId (), "0", "0", "0", "0", "0", "0", "0", "0", "0;" . $p->hasWeapon () );
 
// weapon info - player
$weap = $p->getWeapon ();
array_push ( $t_ret, $weap ['item_id'], $weap ['dmg_min'], $weap ['dmg_max'], $weap ['atr_type_1'], $weap ['atr_type_2'], $weap ['atr_type_3'], $weap ['atr_val_1'], $weap ['atr_val_2'], $weap ['atr_val_3'], $weap ['gold'], $weap ['mush'] );
 
// weapon info - mob
$weap = $OP->getWeapon ();
array_push ( $t_ret, $OP->hasWeapon (), $weap ['item_id'], $weap ['dmg_min'], $weap ['dmg_max'], $weap ['atr_type_1'], $weap ['atr_type_2'], $weap ['atr_type_3'], $weap ['atr_val_1'], $weap ['atr_val_2'], $weap ['atr_val_3'], $weap ['gold'], $weap ['mush'] . ";" . $p->hasShield () );
 
// shields
$sh = $p->getShield ();
array_push ( $t_ret, $sh ['item_id'], $sh ['dmg_min'], $sh ['dmg_max'], $sh ['atr_type_1'], $sh ['atr_type_2'], $sh ['atr_type_3'], $sh ['atr_val_1'], $sh ['atr_val_2'], $sh ['atr_val_3'], $sh ['gold'], $sh ['mush'] );
$sh = $OP->getShield ();
array_push ( $ret, $OP->hasShield (), $sh ['item_id'], $sh ['dmg_min'], $sh ['dmg_max'], $sh ['atr_type_1'], $sh ['atr_type_2'], $sh ['atr_type_3'], $sh ['atr_val_1'], $sh ['atr_val_2'], $sh ['atr_val_3'], $sh ['gold'] );
// ?;?;?;exp;silver;win?
$t_ret [] = $sh ['mush'] . ";3;0;" . $OP->getExp () . ";" . $OP->getGold () . ";-1;";
 
// rest is default data
$t_ret [count ( $t_ret ) - 1] .= $ret [0];
 
// set dungeon time left
$ret [$SF_DUNGEON_ENDTIME] = $time;
 
for($i = 1; $i < count ( $ret ); $i ++) {
$t_ret [] = $ret [$i];
}
 
exit ( join ( "/", $t_ret ) );
 
break;
 
W request, oczywiście również act:
$ACT_PORTAL_FIGT = '358';
$ACT_PORTAL_FIGHT_SINGLE = '360';
 
$ERR_PORTAL_FOUGHT_ALREADY = '-106';
$ERR_PORTAL_MEMBERSHIP_TOO_SHORT = '-107';
 
$RESP_PORTAL_fIGHT = 359;
$RESP_PORTAL_FIGHT_SINGLE = 361;
 
 
Pod mobami z wieży:
 
function getPortalMonster($stage, $db_data) {
switch ($stage) {
                case 1 :
return new Monster ( 400, 1, 17570, 12655, 12630, 17290, 11716, 1365356, 1548792, 112976200, 115087, 500, 178017293, -1);
case 2 :
return new Monster ( 360, 2, 1970, 1990, 8000, 7560, 2838, 881901, 1323252, 5458320, 3060, 501, 191202824, 1003 );
}
}
 
I w database:
 

`portal_level` tinyint(4) NOT NULL DEFAULT '1',

 

I tyle

Opublikowano

Ta?

Wystarczy dodać:

case $ACT_PORTAL_FIGHT_SINGLE :
//portal 
 
$db_data = loadDefaultData ();
 
// STRUCTURE
//$ret [0] = '3215216960/7103/1791/1770/4384/3909/25172784/2473/5947/2464/5763/3930;4655420/0/0/25172784/561540/3/4405539/0/2/25172784/249880/0/4153589/0/2/25172784/251950/0/3787388/936784/3/24236000/366200/0/2288974/1346645/3/22889354/1498414/3/1706694/765428/0/22123926/582280/0/151549/883898/0/21240028/1555145/3/-661731/1047733/0/20192294/813280/0/;' . $db_data ['user_name'] . '/237/0/0/1/-391/0/0/0/0/0/0/0/0/0/37/272/0/0/3/-436/0/0/0/0/0/0/0/0/0;1/57/458/646/1/4/5/328/328/328/0/0/1/2003/455/909/0/0/0/0/0/0/0/0;0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;2;0;0;0;-1;;36;37ǭ1/2/3/' . $db_data ['user_name'] . '///-1/////DZ191428/1528/1511/6632/2503/3746/25172784/2473/5947/2464/5763/3930;695733/0/0/20192294/495694/0/25093/1744524/3/18447770/670640/0/-946245/2487723/3/15960047/971338/3/;' . $db_data ['user_name'] . '/237/0/0/2/-392/0/0/0/0/0/0/0/0/0/37/272/0/0/3/-436/0/0/0/0/0/0/0/0/0;1/1009/819/1467/3/1/2/986/0/0/22997039/0/1/2003/455/909/0/0/0/0/0/0/0/0;0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;2;0;0;0;-1;;36;37ǭ1/3/' . $db_data ['user_name'] . '////20192294/////Ǵ363968/1528/6323/1508/4584/3565/25172784/2473/5947/2464/5763/3930;4128753/357705/3/15602342/235215/0/4128753/0/2/15602342/0/2/3783833/296818/0/15305524/344920/0/3783833/0/2/15305524/0/2/3783833/0/2/15305524/0/2/3144072/427037/0/14878487/639761/3/2733022/0/2/14878487/411049/0/2733022/0/2/14878487/0/2/2222398/0/2/14878487/510624/0/1531360/609312/0/14269175/691038/0/1531360/0/2/14269175/0/2/232841/0/2/14269175/1298519/3/232841/787640/0/13481535/0/2/232841/864448/0/12617087/0/2/232841/0/2/12617087/0/2/-1730563/1884610/3/10732477/1963404/3/;' . $db_data ['user_name'] . '/237/0/0/3/-393/0/0/0/0/0/0/0/0/0/37/272/0/0/3/-436/0/0/0/0/0/0/0/0/0;1/2056/600/644/2/4/5/588/588/588/0/0/1/2003/455/909/0/0/0/0/0/0/0/0;0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;2;0;0;0;-1;;36;37ǭ1/' . $db_data ['user_name'] . '/////15960047/////DZ082424/961/1005/6661/2274/2125/25172784/2473/5947/2464/5763/3930;166101/1403916/3/9328561/916323/3/-632401/995043/0/8333517/798503/0/;' . $db_data ['user_name'] . '/237/1/1/2/2/103/102/2/109/3/2/15/1/0/37/272/0/0/3/-436/0/0/0/0/0/0/0/0/0;1/1009/1046/1410/3/4/5/1064/0/0/18758009/0/1/2003/455/909/0/0/0/0/0/0/0/0;0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;2;0;0;0;-1;;36;37ǭ1//////10732477/////ǻ0;-1;0;0;0DZ264302793/92087/1397866973/1301994663/841267025/22/0/237/111298869/123996780/96905/933/-1/65338476/0/1338/1324/2/103/102/2/109/3/2/15/1/0/1/257/2/961/804/1950/1791/1700/0/201/4711/483/425/870/709/1848/1697/1602/0/1/0/1023410182/656368/443/0/3/4/2/492/0/0/11048178/0/3/1008/783/0/3/2/1/539/0/0/17891075/0/855638021/66546/532/0/3/4/5/532/0/0/9488487/0/687865860/1967089/437/0/3/2/1/500/0/0/6277787/0/1358954504/655369/0/0/3/1/5/528/0/0/7667088/0/1191182343/66544/622/0/3/2/4/512/0/0/8327251/0/1526726665/655368/0/0/4/1/5/483/0/0/0/0/1694498826/1310746/0/0/3/2/1/544/0/0/8864890/0/184549377/328689/1046/1410/3/4/5/1064/0/0/18758009/0/0/0/0/0/0/0/0/0/0/0/0/0/8/19/0/0/1/5/3/571/0/0/29292628/0/0/1008/532/0/4/3/1/548/0/0/0/0/0/2010/2154/0/1/2/3/295/269/0/0/0/0/15/0/0/11/5/0/72/25/0/1852482/0/0/1/0/0/1/5/3/304/248/0/0/0/0/237/237/237/5/4/1/-90/-93/-80/17/8/2/720/720/960/0/1010/718/0/4/1/5/295/269/0/27657353/0/0/1008/743/0/4/3/2/332/242/0/30570794/0/0/19/0/0/1/5/3/571/0/0/29292628/0/234800/839600/340000/28276200/10709600/34308500/2359298/1397782503/5/1008/579/0/3/1/5/552/0/0/40004185/0/3/1009/676/0/4/5/3/283/283/0/52922554/10/5/1009/411/0/5/4/2/289/267/0/55685219/10/5/1008/827/0/1/2/4/316/260/0/41133282/1/1/1008/809/1739/2/5/4/1120/0/0/99431632/0/1/1009/1160/1378/1/3/5/634/458/0/158498908/10/1397782757/8/7/0/0/1/3/2/342/224/0/21909165/10/12/16/0/0/11/12/0/168/25/0/3087470/15/9/5/0/0/5/4/2/557/0/0/39474100/0/8/5/0/0/1/4/2/340/224/0/10585665/1/9/14/0/0/1/5/3/350/218/0/12332167/1/8/12/0/0/4/3/5/552/0/0/37778355/0/37/0/829/3/272/10968/921711/1357235982/12/10/1391589443/0/0/1/2817/1046/1410/0/1398880351/3/0/0/1397866956/6000/0/100/1397870573/1397859709/146/146/1/1356631675/237/100/5192/9239/8082/1000000000/102529/2/1362/83/0/0/4/1397866973/5/12/12/12/12/12/12/12/12/12/12/120/16/485/15/12/0/1398042462/1398040963/0/25/25/0/0/304900910/304900910/304900910/1/1368876356/0/1596/1397866973';
//break;
 
// check time restrictions
$time = new DateTime ();
$time = $time->getTimestamp ();
if ($time < $db_data ['dungeon_time']) {
if ($db_data ['mushroom'] <= 0) {
// TODO throw error
break;
}
$db_data ['mushroom'] = $db_data ['mushroom'] - 1;
$time = $db_data ['dungeon_time'];
} else {
$time = $time + 1800;
}
 
 
$stage = $db_data['portal_level'];
 
$OP = getPortalMonster ( $stage, $db_data );
$p = new Char ( $db_data );
 
// response
$t_ret = array ();
 
// player stats
array_push ( $t_ret, "122" . $p->getHP (), $p->getStr (), $p->getDex (), $p->getInt (), $p->getWit (), $p->getLuck () );
 
// mob stats
array_push ( $t_ret, $OP->getHP (), $OP->getStr (), $OP->getDex (), $OP->getInt (), $OP->getWit (), $OP->getLuck () . ";" ); // . $p->getHp () );
                                                                                                                            
// simulation
$sim = SF_Calc::calculateWin ( $p, $OP );
 
$win = $sim [count ( $sim ) - 1] [0] <= 0 ? true : false;
 
 
// if win -> update exp, lvl, etc...
if ($win) {
// increment stage lvl
$stage ++;
 
// add gained exp & gold
$db_data ['exp'] = ( int ) $db_data ['exp'] + $OP->getExp ();
$db_data ['silver'] = ( int ) $db_data ['silver'] + $OP->getGold ();
   $db_data ['potion_value1'] = $db_data ['potion_value1'] + 1;
 
// add item rewards
 
$lvl = $db_data ['lvl'];
$class = $db_data ['class'];
$shop = rand(0, 1);
 
$item = genItem ($lvl, $class, $shop, 'dungeon');
 
 
$qry = $db->prepare ( "SELECT slot FROM items WHERE slot = 10 AND owner_id = " . $db_data['user_id'] );  
$qry->execute ();
if ($qry->rowCount () < 1) {
$item ['slot'] = 10;
} else {
$qry = $db->prepare ( "SELECT slot FROM items WHERE slot = 11 AND owner_id = " . $db_data['user_id'] );  
$qry->execute ();
if ($qry->rowCount () < 1) {
$item ['slot'] = 11;
} else {
$qry = $db->prepare ( "SELECT slot FROM items WHERE slot = 12 AND owner_id = " . $db_data['user_id'] );  
$qry->execute ();
if ($qry->rowCount () < 1) {
$item ['slot'] = 12;
} else {
$qry = $db->prepare ( "SELECT slot FROM items WHERE slot = 13 AND owner_id = " . $db_data['user_id']);  
$qry->execute ();
if ($qry->rowCount () < 1) {
$item ['slot'] = 13;
} else {
$qry = $db->prepare ( "SELECT slot FROM items WHERE slot = 14 AND owner_id = " . $db_data['user_id'] );  
$qry->execute ();
if ($qry->rowCount () < 1) {
$item ['slot'] = 14;
} else {
$ret = array (
$ERR_INVENTORY_FULL
);
break;
}
}
}
}
}
 
 
$qry = $db->prepare ( 'INSERT INTO items(item_type, item_id, dmg_min, dmg_max, atr_type_1, atr_type_2, atr_type_3, atr_val_1, atr_val_2, atr_val_3, gold, mush, slot, owner_id) 
VALUES(' . $item ['item_type'] . ',' . $item ['item_id'] . ',' . $item ['dmg_min'] . ',' . $item ['dmg_max'] . ',
' . $item ['atr_type_1'] . ',' . $item ['atr_type_2'] . ',' . $item ['atr_type_3'] . ',' . $item ['atr_val_1'] . ',' . $item ['atr_val_2'] . ',
' . $item ['atr_val_3'] . ',' . $item ['gold'] . ',' . $item ['mush'] . ',' . $item ['slot'] . ',' . $db_data['user_id'] . ')' );   
$qry->execute ();
 
 
// lvl up
while ( $db_data ['exp'] > $LEVELS [$db_data ['lvl']] ) {
$db_data ['exp'] -= $LEVELS [$db_data ['lvl']];
$db_data ['lvl'] = ( int ) $db_data ['lvl'] + 1;
}
}
//
$db_data ['portal_bonus'] = $stage ;
//
 
// update database
$qry_str = "UPDATE user_data SET 
exp = :exp, 
lvl = :lvl, 
silver = :silver, 
mushroom = :shroom, 
dungeon_time = :time,
potion_value1 = :potion_value1,
portal_level = :portal_level";
$qry_str .= " WHERE ssid = :ssid";
$qry = $db->prepare ( $qry_str );
$qry->bindParam ( ':exp', $db_data ['exp'] );
$qry->bindParam ( ':lvl', $db_data ['lvl'] );
$qry->bindParam ( ':silver', $db_data ['silver'] );
$qry->bindParam ( ':shroom', $db_data ['mushroom'] );
$qry->bindParam ( ':time', $time );
$qry->bindParam ( ':potion_value1', $db_data ['potion_value1'] );
$qry->bindParam ( ':portal_level', $stage );
$qry->bindParam ( ':ssid', $SSID );
$qry->execute ();
 
$t_ret [count ( $t_ret ) - 1] .= $sim [0] [0];
 
// ---logs----
// first 3, one in previous index, separated by semicolon
array_push ( $t_ret, $sim [0] [1], $sim [0] [2] );
 
for($i = 1; $i < count ( $sim ); $i ++) {
array_push ( $t_ret, $sim [$i] [0], $sim [$i] [1], $sim [$i] [2] );
// echo $sim [$i][0]."/".$sim [$i][1]."/".$sim [$i][2]."/";
}
 
// looks
array_push ( $t_ret, ";" . $db_data ['user_name'], $p->getLvl (), $db_data ['race'], $db_data ['gender'], $db_data ['class'] );
// faces
for($i = 1; $i <= 9; $i ++) {
$t_ret [] = $db_data ['face' . $i];
}
 
// mob looks, lvl, weapon
array_push ( $t_ret, "0", "0", $OP->getLvl (), "0", "0", "1", "-" . $OP->getId (), "0", "0", "0", "0", "0", "0", "0", "0", "0;" . $p->hasWeapon () );
 
// weapon info - player
$weap = $p->getWeapon ();
array_push ( $t_ret, $weap ['item_id'], $weap ['dmg_min'], $weap ['dmg_max'], $weap ['atr_type_1'], $weap ['atr_type_2'], $weap ['atr_type_3'], $weap ['atr_val_1'], $weap ['atr_val_2'], $weap ['atr_val_3'], $weap ['gold'], $weap ['mush'] );
 
// weapon info - mob
$weap = $OP->getWeapon ();
array_push ( $t_ret, $OP->hasWeapon (), $weap ['item_id'], $weap ['dmg_min'], $weap ['dmg_max'], $weap ['atr_type_1'], $weap ['atr_type_2'], $weap ['atr_type_3'], $weap ['atr_val_1'], $weap ['atr_val_2'], $weap ['atr_val_3'], $weap ['gold'], $weap ['mush'] . ";" . $p->hasShield () );
 
// shields
$sh = $p->getShield ();
array_push ( $t_ret, $sh ['item_id'], $sh ['dmg_min'], $sh ['dmg_max'], $sh ['atr_type_1'], $sh ['atr_type_2'], $sh ['atr_type_3'], $sh ['atr_val_1'], $sh ['atr_val_2'], $sh ['atr_val_3'], $sh ['gold'], $sh ['mush'] );
$sh = $OP->getShield ();
array_push ( $ret, $OP->hasShield (), $sh ['item_id'], $sh ['dmg_min'], $sh ['dmg_max'], $sh ['atr_type_1'], $sh ['atr_type_2'], $sh ['atr_type_3'], $sh ['atr_val_1'], $sh ['atr_val_2'], $sh ['atr_val_3'], $sh ['gold'] );
// ?;?;?;exp;silver;win?
$t_ret [] = $sh ['mush'] . ";3;0;" . $OP->getExp () . ";" . $OP->getGold () . ";-1;";
 
// rest is default data
$t_ret [count ( $t_ret ) - 1] .= $ret [0];
 
// set dungeon time left
$ret [$SF_DUNGEON_ENDTIME] = $time;
 
for($i = 1; $i < count ( $ret ); $i ++) {
$t_ret [] = $ret [$i];
}
 
exit ( join ( "/", $t_ret ) );
 
break;
 
W request, oczywiście również act:
$ACT_PORTAL_FIGT = '358';
$ACT_PORTAL_FIGHT_SINGLE = '360';
 
$ERR_PORTAL_FOUGHT_ALREADY = '-106';
$ERR_PORTAL_MEMBERSHIP_TOO_SHORT = '-107';
 
$RESP_PORTAL_fIGHT = 359;
$RESP_PORTAL_FIGHT_SINGLE = 361;
 
 
Pod mobami z wieży:
 
function getPortalMonster($stage, $db_data) {
switch ($stage) {
                case 1 :
return new Monster ( 400, 1, 17570, 12655, 12630, 17290, 11716, 1365356, 1548792, 112976200, 115087, 500, 178017293, -1);
case 2 :
return new Monster ( 360, 2, 1970, 1990, 8000, 7560, 2838, 881901, 1323252, 5458320, 3060, 501, 191202824, 1003 );
}
}
 
I w database:
 

`portal_level` tinyint(4) NOT NULL DEFAULT '1',

 

I tyle

Stuktura nie potrzebna.

Opublikowano

Pro elo koderzy, ale po co zaśmiecacie skrypt tym "//$ret [0] = '3215216960/7103/1791/1770/4384/3909/25172784/2473/5947/2464/5763/3930;4655420/0/0/25172784/561540/3/4405539/0/2/25172784/249880/0/4153589/0/2/25172784/251950/0/3787388/936784/3/24236000/366200/0/2288974/1346645/3/22889354/1498414/3/1706694/765428/0/22123926/582280/0/151549/883898/0/21240028/1555145/3/-661731/1047733/0/20192294/813280/0/;' . $db_data ['user_name'] . '/237/0/0/1/-391/0/0/0/0/0/0/0/0/0/37/272/0/0/3/-436/0/0/0/0/0/0/0/0/0;1/57/458/646/1/4/5/328/328/328/0/0/1/2003/455/909/0/0/0/0/0/0/0/0;0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;2;0;0;0;-1;;36;37ǭ1/2/3/' . $db_data ['user_name'] . '///-1/////DZ191428/1528/1511/6632/2503/3746/25172784/2473/5947/2464/5763/3930;695733/0/0/20192294/495694/0/25093/1744524/3/18447770/670640/0/-946245/2487723/3/15960047/971338/3/;' . $db_data ['user_name'] . '/237/0/0/2/-392/0/0/0/0/0/0/0/0/0/37/272/0/0/3/-436/0/0/0/0/0/0/0/0/0;1/1009/819/1467/3/1/2/986/0/0/22997039/0/1/2003/455/909/0/0/0/0/0/0/0/0;0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;2;0;0;0;-1;;36;37ǭ1/3/' . $db_data ['user_name'] . '////20192294/////Ǵ363968/1528/6323/1508/4584/3565/25172784/2473/5947/2464/5763/3930;4128753/357705/3/15602342/235215/0/4128753/0/2/15602342/0/2/3783833/296818/0/15305524/344920/0/3783833/0/2/15305524/0/2/3783833/0/2/15305524/0/2/3144072/427037/0/14878487/639761/3/2733022/0/2/14878487/411049/0/2733022/0/2/14878487/0/2/2222398/0/2/14878487/510624/0/1531360/609312/0/14269175/691038/0/1531360/0/2/14269175/0/2/232841/0/2/14269175/1298519/3/232841/787640/0/13481535/0/2/232841/864448/0/12617087/0/2/232841/0/2/12617087/0/2/-1730563/1884610/3/10732477/1963404/3/;' . $db_data ['user_name'] . '/237/0/0/3/-393/0/0/0/0/0/0/0/0/0/37/272/0/0/3/-436/0/0/0/0/0/0/0/0/0;1/2056/600/644/2/4/5/588/588/588/0/0/1/2003/455/909/0/0/0/0/0/0/0/0;0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;2;0;0;0;-1;;36;37ǭ1/' . $db_data ['user_name'] . '/////15960047/////DZ082424/961/1005/6661/2274/2125/25172784/2473/5947/2464/5763/3930;166101/1403916/3/9328561/916323/3/-632401/995043/0/8333517/798503/0/;' . $db_data ['user_name'] . '/237/1/1/2/2/103/102/2/109/3/2/15/1/0/37/272/0/0/3/-436/0/0/0/0/0/0/0/0/0;1/1009/1046/1410/3/4/5/1064/0/0/18758009/0/1/2003/455/909/0/0/0/0/0/0/0/0;0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;2;0;0;0;-1;;36;37ǭ1//////10732477/////ǻ0;-1;0;0;0DZ264302793/92087/1397866973/1301994663/841267025/22/0/237/111298869/123996780/96905/933/-1/65338476/0/1338/1324/2/103/102/2/109/3/2/15/1/0/1/257/2/961/804/1950/1791/1700/0/201/4711/483/425/870/709/1848/1697/1602/0/1/0/1023410182/656368/443/0/3/4/2/492/0/0/11048178/0/3/1008/783/0/3/2/1/539/0/0/17891075/0/855638021/66546/532/0/3/4/5/532/0/0/9488487/0/687865860/1967089/437/0/3/2/1/500/0/0/6277787/0/1358954504/655369/0/0/3/1/5/528/0/0/7667088/0/1191182343/66544/622/0/3/2/4/512/0/0/8327251/0/1526726665/655368/0/0/4/1/5/483/0/0/0/0/1694498826/1310746/0/0/3/2/1/544/0/0/8864890/0/184549377/328689/1046/1410/3/4/5/1064/0/0/18758009/0/0/0/0/0/0/0/0/0/0/0/0/0/8/19/0/0/1/5/3/571/0/0/29292628/0/0/1008/532/0/4/3/1/548/0/0/0/0/0/2010/2154/0/1/2/3/295/269/0/0/0/0/15/0/0/11/5/0/72/25/0/1852482/0/0/1/0/0/1/5/3/304/248/0/0/0/0/237/237/237/5/4/1/-90/-93/-80/17/8/2/720/720/960/0/1010/718/0/4/1/5/295/269/0/27657353/0/0/1008/743/0/4/3/2/332/242/0/30570794/0/0/19/0/0/1/5/3/571/0/0/29292628/0/234800/839600/340000/28276200/10709600/34308500/2359298/1397782503/5/1008/579/0/3/1/5/552/0/0/40004185/0/3/1009/676/0/4/5/3/283/283/0/52922554/10/5/1009/411/0/5/4/2/289/267/0/55685219/10/5/1008/827/0/1/2/4/316/260/0/41133282/1/1/1008/809/1739/2/5/4/1120/0/0/99431632/0/1/1009/1160/1378/1/3/5/634/458/0/158498908/10/1397782757/8/7/0/0/1/3/2/342/224/0/21909165/10/12/16/0/0/11/12/0/168/25/0/3087470/15/9/5/0/0/5/4/2/557/0/0/39474100/0/8/5/0/0/1/4/2/340/224/0/10585665/1/9/14/0/0/1/5/3/350/218/0/12332167/1/8/12/0/0/4/3/5/552/0/0/37778355/0/37/0/829/3/272/10968/921711/1357235982/12/10/1391589443/0/0/1/2817/1046/1410/0/1398880351/3/0/0/1397866956/6000/0/100/1397870573/1397859709/146/146/1/1356631675/237/100/5192/9239/8082/1000000000/102529/2/1362/83/0/0/4/1397866973/5/12/12/12/12/12/12/12/12/12/12/120/16/485/15/12/0/1398042462/1398040963/0/25/25/0/0/304900910/304900910/304900910/1/1368876356/0/1596/1397866973';

//break;
" skoro jest "//" to oznacza komentarz czyli linijkę wyłączoną....
Opublikowano

Ludzie wy i tak nic nie potraficie :P

 

Ja już mam portal gotowy w 98% portal gracza w 100% lochy gildijne w 60% karczma 100% arena 100% wieza 100% warta w 100% wiedzma 100% epiki itp wszystko w 100% bugi ogarniete w 95 ... wiec sie nie odzywać :) Bym cos tu napisał ale ponoć sprzedawać niewolno to sie nie odzywam.

Opublikowano

Ludzie wy i tak nic nie potraficie :P

 

Ja już mam portal gotowy w 98% portal gracza w 100% lochy gildijne w 60% karczma 100% arena 100% wieza 100% warta w 100% wiedzma 100% epiki itp wszystko w 100% bugi ogarniete w 95 ... wiec sie nie odzywać :) Bym cos tu napisał ale ponoć sprzedawać niewolno to sie nie odzywam.

HaHa. Jak jesteś takim geniuszem, to podrzuć jakieś ss albo filmik. Jakoś mi się wierzyć nie chce.

Opublikowano

Spoko nakrece filmik specjalnie z dedykacją :)

 

Ja mam lochy gildijne gracze na potwory ale nie dokonczone bo niemam tyle czasu na dopisanie reszty .. wieze mam z pomocnikami 

Opublikowano

Spoko nakrece filmik specjalnie z dedykacją :)

 

Ja mam lochy gildijne gracze na potwory ale nie dokonczone bo niemam tyle czasu na dopisanie reszty .. wieze mam z pomocnikami 

Czekam. Jak to się okaże prawdą to #Respect dla Ciebie  :) Jeżeli nie to będzie tak jak myślałem :P

Opublikowano

Spoko nakrece filmik specjalnie z dedykacją :)

 

Ja mam lochy gildijne gracze na potwory ale nie dokonczone bo niemam tyle czasu na dopisanie reszty .. wieze mam z pomocnikami 

Coś nie widać tego filmiku xD

Opublikowano

Dobra jestem zaraz nakrece i podam link bo tak jak mówilem czasu niemialem .. 

No czekam, czekam  :ninja:

Opublikowano

Dobra łap troche minelo ale cały czas cos mam na głowie xD i wlasnie znowu wychodze jak cos pisać :P

 

 

 

https://www.youtube.com/watch?v=_VPA-5e3RuA&feature=youtu.be

No ok. Tylko coś mi tu nie pasuje. W pierwszym momencie jesteś 1 w rankingu, nagle stajesz się 4360 jak to możliwe? :) No i te podejrzane przejścia między scenami. Czyżby fejk? :>

Zarchiwizowany

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

×
×
  • Dodaj nową pozycję...