case FALL_GUY_LEVEL_8: $_SESSION['fallguy_level'] = 8; User::updateAchievementRank("fall_guy_level", $user->getID()); break; default: if (isset($_SESSION['fallguy_level'])) { unset($_SESSION['fallguy_level']); } } //$cashLost = 0; $cashLost = calculateMoneyLoss($user->getCash(), $user->getLevel()); $otherUser->updateUserCash($cashLost); $user->updateUserCash($cashLost * -1); $user->battleHistory($id, $_SESSION['otherUserID'], $looserDemage, 0, $cashLost); unset($_SESSION['bounty']); } } $_SESSION['userUsedItems'] = $userUsedItems; $_SESSION['otherUserUsedItems'] = $otherUserUsedItems; // Level up check $skillPointsGained = checkLevelUp($user); if ($skillPointsGained > 0) { $_SESSION['levelUp'] = 1; $_SESSION['newLevel'] = $user->getLevel(); $_SESSION['skillPointsGained'] = $skillPointsGained; } //include_once 'classes/ConnectionFactory.php'; //ConnectionFactory::printLog(); //$winnerDemage $looserDemage header("Location: {$serverRoot}battle.php?attack_type=" . $attack_type . "&cash_lost={$cashLost}&winner_demage={$winnerDemage}&looser_demage={$looserDemage}"); exit;
public static function updateFirstBattleData($userID, $cash, $winner_demage, $points, $fistBattleVal = 0, $next_level_experince_points = 0) { $user = User::getUser($userID); //die($user->getAgencySize()); $agency_params = array(); //echo "OLD CASH = ".$user->getCash(); $user->setUserCash($cash); //echo "NEW CASH = ".$user->getCash(); $user->setUserExp($points); $agency_params['cash'] = $user->getCash(); $agency_params['health'] = $user->getHealth() + $winner_demage; $agency_params['experience'] = $user->getExperience(); if ($fistBattleVal == 1) { $agency_params['is_first_battle'] = 1; checkLevelUp($user); /*if($user->getLevel()<4){ $agency_params['experience'] = $user->getExperience() + $points; $agency_params['level'] = $user->getLevel() + 1; $agency_params['next_level_experince_points'] = $next_level_experince_points; } else { }*/ } $conditions = array(); $conditions['id'] = $user->getID(); $success = ConnectionFactory::updateTableRowAbsoluteBasic("users", $agency_params, $conditions); return $points; }