Logout Successful
You have logged out of your '.htmlspecialchars($config['server']['serverName']).' account. In order to view your account you need to log in again.
'; else { $passB = 'Password:'; $logB = 'Account Name:'; if(isset($isTryingToLogin)) { $main_content .= '
The Following Errors Have Occurred:
'; switch(Visitor::getLoginState()) { case Visitor::LOGINSTATE_NO_ACCOUNT: $main_content .= 'Account with that name doesn\'t exist.
'; $logB = 'Account Name:'; break; case Visitor::LOGINSTATE_WRONG_PASSWORD: $main_content .= 'Wrong password to account.
'; $passB = 'Password:'; break; } $main_content .= '

'; } $main_content .= '
Account Login
'.$logB.'
'.$passB.'

New to '.$config['server']['serverName'].'?

New Player

'.$config['server']['serverName'].'...

... where hardcore gaming meets fantasy.

... where friendships last a lifetime.

... unites adventurers since 1997!

'; } else { $account_id = $account_logged->getId(); if($account_id == 1) die("







This account is blocked for this site.

"); //Here start our new accountmanagement ;D if($action == "") { if($account_logged->getCustomField('vip_time') > 0) $account_statusOver = ' VIP Account '; else $account_statusOver = ' Free Account '; if($account_logged->getCustomField('vip_time') > 0) $account_statusPic = 'free account'; else $account_statusPic = 'free account'; $main_content .= '
Welcome to your account '.$account_logged->getRLName().'!

'; $main_content .= '
Account Status
'.$account_statusPic.' '.$account_statusOver.''; $main_content .= '
Your VIP time expires at '.date('d/m/Y, H:i:s', $account_logged->getCustomField('vip_time')).'
'; $main_content .= '

'; //REGISTRAR $account_reckey = $account_logged->getCustomField("key"); if(empty($account_reckey)) $main_content .= '

Your account is not registered!

You need to click here to register your account and receive your recovery key. Please take carefull your Recovery Key.

In case you have lost your Recovery Key, you can request the new recovery key for your account again.


'; //CHARACTERS $main_content .= '
Characters
'; $account_players = $account_logged->getPlayersList(); $acc_id = $account_logged->getId(); if($acc_id == 1) die("Está conta está BLOQUEADA."); //show list of players on account $var = 0; foreach($account_players as $account_player) { $player_number_counter++; if($var==0) { $preview = ' previewstate="0"'; } else { $preview = ''; } if($var==0) { $display = 'block'; } else { $display = 'none'; } if($var==0) { $displayNum = 'none'; } else { $displayNum = 'inline'; } if($var==0) { $displayBold = 'bold'; } else { $displayBold = 'normal'; } if($var==0) { $displayFont = '13'; } else { $displayFont = '10'; } $main_content .=' '; else $main_content .= 'background-color: #f1e0c6;">'; $main_content .=' '; $var++; } $main_content .='
Name World Status  
'.$player_number_counter.'. '; if($account_player->isDeleted()) { $main_content .= ''; } else { $main_content .= ' '; } $main_content .=' '.htmlspecialchars($account_player->getName()).'
'.htmlspecialchars($vocation_name[$account_player->getPromotion()][$account_player->getVocation()]).' - Level '.$account_player->getLevel().'
'.htmlspecialchars($config['server']['serverName']).' '; if(!$account_player->isOnline()) $main_content .= ''; else $main_content .= 'online'; if($account_player->isDeleted()) { $main_content .= 'deleted'; } $main_content .=' [Edit]'; if($account_player->isDeleted()) { $main_content .= '
[Undelete]'; } else { $main_content .= '
[Delete]'; } $main_content .= '


'; //MIGRATION TOOL ;D if($group_id_of_acc_logged >= $config['site']['access_admin_panel']){ $main_content .= '

Admin Panel

Click here to go your new Admin Panel


'; }else{ $main_content .= '

New Account Management

This is the main page of managing your account, here you will have the key to your account information displayed and updated, enjoy!


'; } } //Here finish our new account management if($action == "manage") { $account_reckey = $account_logged->getCustomField("key"); $dataAtual = time(); $dataProxima = $account_logged->getCustomField('vip_time'); $data1 = $dataProxima - $dataAtual; $dataCerta = $data1 / 86400; if($account_logged->getCustomField('vip_time') > 0) $account_status = 'VIP Account, '. floor($dataCerta) .' days left'; else $account_status = 'Free Account'; if(empty($account_reckey)) $account_registred = 'No'; else if($config['site']['generate_new_reckey'] && $config['site']['send_emails']) $account_registred = 'Yes ( Buy new Rec key )'; else $account_registred = 'Yes'; $account_created = $account_logged->getCreateDate(); $account_email = $account_logged->getEMail(); $account_email_new_time = $account_logged->getCustomField("email_new_time"); if($account_email_new_time > 1) $account_email_new = $account_logged->getCustomField("email_new"); $account_rlname = $account_logged->getRLName(); $account_location = $account_logged->getLocation(); $acc_id = $account_logged->getId(); if($acc_id == 1) die("Está conta está BLOQUEADA."); $main_content .= '

'; $main_content .= '
General Information
Account Name:
'.str_repeat('*', strlen(htmlspecialchars($account_logged->getName()))).'
Email Address:
'.str_repeat('*', strlen(htmlspecialchars($account_email))).'
Created: '.date("M d Y, G:i:s", $account_created).'
Last Login: '.date("M d Y, G:i:s", time()).'
Account Status: '.$account_status; if($account_logged->getCustomField('vip_time') <= time()){ $main_content .= '
(VIP time expired at ' .date('d/m/Y, H:i:s', $account_logged->getCustomField('vip_time')). ')'; }else{ $main_content .= '
(VIP time expires at ' .date('d/m/Y, H:i:s', $account_logged->getCustomField('vip_time')). ')'; } $main_content .= '


'; if($account_email_new_time > 1) if($account_email_new_time < time()) $account_email_change = '
(You can accept '.htmlspecialchars($account_email_new).' as a new email.)'; else { $account_email_change = '
You can accept new e-mail after '.date("j F Y", $account_email_new_time)."."; $main_content .= '
Note: A request has been submitted to change the email address of this account to '.htmlspecialchars($account_email_new).'. After '.date("j F Y, G:i:s", $account_email_new_time).' you can accept the new email address and finish the process. Please cancel the request if you do not want your email address to be changed! Also cancel the request if you have no access to the new email address!


'; } //REGISTRATION $main_content .= '
Registration
Real Name: '.$account_rlname.'
Location: '.$account_location.'

'; } //########### CHANGE PASSWORD ########## if($action == "changepassword") { $new_password = trim($_POST['newpassword']); $new_password2 = trim($_POST['newpassword2']); $old_password = trim($_POST['oldpassword']); if(empty($new_password) && empty($new_password2) && empty($old_password)) { $main_content .= 'Please enter your current password and a new password. For your security, please enter the new password twice.

Change Password
New Password:
New Password Again:
Current Password:

'; } else { if(empty($new_password) || empty($new_password2) || empty($old_password)) { $show_msgs[] = "Please fill in form."; } if($new_password != $new_password2) { $show_msgs[] = "The new passwords do not match!"; } if(empty($show_msgs)) { if(!check_password($new_password)) { $show_msgs[] = "New password contains illegal chars (a-z, A-Z and 0-9 only!) or lenght."; } if(!$account_logged->isValidPassword($old_password)) { $show_msgs[] = "Current password is incorrect!"; } } if(!empty($show_msgs)) { //show errors $main_content .= '
The Following Errors Have Occurred:
'; foreach($show_msgs as $show_msg) { $main_content .= '
  • '.$show_msg; } $main_content .= '

  • '; //show form $main_content .= 'Please enter your current password and a new password. For your security, please enter the new password twice.

    Change Password
    New Password:
    New Password Again:
    Current Password:

    '; } else { $org_pass = $new_password; $account_logged->setPassword($new_password); $account_logged->save(); $main_content .= '
    Password Changed
    Your password has been changed.'; if($config['site']['send_emails'] && $config['site']['send_mail_when_change_password']) { $mailBody = '

    Password to account changed!

    You or someone else changed password to your account on server '.htmlspecialchars($config['server']['serverName']).'.

    New password: '.htmlspecialchars($org_pass).'

    '; $mail = new PHPMailer(); if ($config['site']['smtp_enabled']) { $mail->IsSMTP(); $mail->Host = $config['site']['smtp_host']; $mail->Port = (int)$config['site']['smtp_port']; $mail->SMTPAuth = $config['site']['smtp_auth']; $mail->Username = $config['site']['smtp_user']; $mail->Password = $config['site']['smtp_pass']; } else $mail->IsMail(); $mail->IsHTML(true); $mail->From = $config['site']['mail_address']; $mail->AddAddress($account_logged->getEMail()); $mail->Subject = $config['server']['serverName']." - Changed password"; $mail->Body = $mailBody; if($mail->Send()) $main_content .= '
    Your new password were send on email address '.htmlspecialchars($account_logged->getEMail()).'.'; else $main_content .= '
    An error occorred while sending email with password!'; } $main_content .= '

    '; $_SESSION['password'] = $new_password; } } } //############# CHANGE E-MAIL ################### if($action == "changeemail") { $account_email_new_time = $account_logged->getCustomField("email_new_time"); if($account_email_new_time > 10) {$account_email_new = $account_logged->getCustomField("email_new"); } if($account_email_new_time < 10) { if($_POST['changeemailsave'] == 1) { $account_email_new = trim($_POST['new_email']); $post_password = trim($_POST['password']); if(empty($account_email_new)) { $change_email_errors[] = "Please enter your new email address."; } else { if(!check_mail($account_email_new)) { $change_email_errors[] = "E-mail address is not correct."; } } if(empty($post_password)) { $change_email_errors[] = "Please enter password to your account."; } else { if(!$account_logged->isValidPassword($post_password)) { $change_email_errors[] = "Wrong password to account."; } } if(empty($change_email_errors)) { $account_email_new_time = time() + $config['site']['email_days_to_change'] * 24 * 3600; $account_logged->set("email_new", $account_email_new); $account_logged->set("email_new_time", $account_email_new_time); $account_logged->save(); $main_content .= '
    New Email Address Requested
    You have requested to change your email address to '.htmlspecialchars($account_email_new).'. The actual change will take place after '.date("j F Y, G:i:s", $account_email_new_time).', during which you can cancel the request at any time.

    '; } else { //show errors $main_content .= '
    The Following Errors Have Occurred:
    '; foreach($change_email_errors as $change_email_error) { $main_content .= '
  • '.$change_email_error.'
  • '; } $main_content .= '

    '; //show form $main_content .= 'Please enter your password and the new email address. Make sure that you enter a valid email address which you have access to. For security reasons, the actual change will be finalised after a waiting period of '.$config['site']['email_days_to_change'].' days.

    Change Email Address
    New Email Address:
    Password:

    '; } } else { $main_content .= 'Please enter your password and the new email address. Make sure that you enter a valid email address which you have access to. For security reasons, the actual change will be finalised after a waiting period of '.$config['site']['email_days_to_change'].' days.

    Change Email Address
    New Email Address:
    Password:

    '; } } else { if($account_email_new_time < time()) { if($_POST['changeemailsave'] == 1) { $account_logged->set("email_new", ""); $account_logged->set("email_new_time", 0); $account_logged->setEmail($account_email_new); $account_logged->save(); $main_content .= '
    Email Address Change Accepted
    You have accepted '.htmlspecialchars($account_logged->getEmail()).' as your new email adress.

    '; } else { $main_content .= '
    Email Address Change Accepted
    Do you accept '.htmlspecialchars($account_email_new).' as your new email adress?

     
     
    '; } } else { $main_content .= '
    Change of Email Address
    A request has been submitted to change the email address of this account to '.htmlspecialchars($account_email_new).'.
    The actual change will take place on '.date("j F Y, G:i:s", $account_email_new_time).'.
    If you do not want to change your email address, please click on "Cancel".

    '; } } if($_POST['emailchangecancel'] == 1) { $account_logged->set("email_new", ""); $account_logged->set("email_new_time", 0); $account_logged->save(); $main_content = '
    Email Address Change Cancelled
    Your request to change the email address of your account has been cancelled. The email address will not be changed.

    '; } } //########### CHANGE PUBLIC INFORMATION (about account owner) ###################### if($action == "changeinfo") { $new_rlname = htmlspecialchars(trim($_POST['info_rlname'])); $new_location = htmlspecialchars(trim($_POST['info_location'])); if($_POST['changeinfosave'] == 1) { //save data from form $account_logged->set("rlname", $new_rlname); $account_logged->set("location", $new_location); $account_logged->save(); $main_content .= '
    Public Information Changed
    Your public information has been changed.

    '; } else { //show form $account_rlname = $account_logged->getCustomField("rlname"); $account_location = $account_logged->getCustomField("location"); $main_content .= 'Here you can tell other players about yourself. This information will be displayed alongside the data of your characters. If you do not want to fill in a certain field, just leave it blank.

    Change Public Information
    Real Name:
    Location:

    '; } } //############## GENERATE RECOVERY KEY ########### if($action == "registeraccount") { $reg_password = trim($_POST['reg_password']); $old_key = $account_logged->getCustomField("key"); if($_POST['registeraccountsave'] == "1") { if($account_logged->isValidPassword($reg_password)) { if(empty($old_key)) { $dontshowtableagain = 1; $acceptedChars = 'ABCDEFGHIJKLMNPQRSTUVWXYZ123456789'; $max = strlen($acceptedChars)-1; $new_rec_key = NULL; // 10 = number of chars in generated key for($i=0; $i < 10; $i++) { $cnum[$i] = $acceptedChars{mt_rand(0, $max)}; $new_rec_key .= $cnum[$i]; } $account_logged->set("key", $new_rec_key); $account_logged->save(); $main_content .= '
    Account Registered
    Thank you for registering your account! You can now recover your account if you have lost access to the assigned email address by using the following

       Recovery Key: '.htmlspecialchars($new_rec_key).'


    Important:
    • Write down this recovery key carefully.
    • Store it at a safe place!
    • '; if($config['site']['send_emails'] && $config['site']['send_mail_when_generate_reckey']) { $mailBody = '

      New recovery key!

      You or someone else generated recovery key to your account on server '.htmlspecialchars($config['server']['serverName']).'.

      Recovery key: '.htmlspecialchars($new_rec_key).'

      '; $mail = new PHPMailer(); if ($config['site']['smtp_enabled']) { $mail->IsSMTP(); $mail->Host = $config['site']['smtp_host']; $mail->Port = (int)$config['site']['smtp_port']; $mail->SMTPAuth = $config['site']['smtp_auth']; $mail->Username = $config['site']['smtp_user']; $mail->Password = $config['site']['smtp_pass']; } else $mail->IsMail(); $mail->IsHTML(true); $mail->From = $config['site']['mail_address']; $mail->AddAddress($account_logged->getEMail()); $mail->Subject = $config['server']['serverName']." - recovery key"; $mail->Body = $mailBody; if($mail->Send()) $main_content .= '
      Your recovery key were send on email address '.htmlspecialchars($account_logged->getEMail()).'.'; else $main_content .= '
      An error occorred while sending email with recovery key! You will not receive e-mail with this key.'; } $main_content .= '

    '; } else $reg_errors[] = 'Your account is already registred.'; } else $reg_errors[] = 'Wrong password to account.'; } if($dontshowtableagain != 1) { //show errors if not empty if(!empty($reg_errors)) { $main_content .= '
    The Following Errors Have Occurred:
    '; foreach($reg_errors as $reg_error) $main_content .= '
  • '.$reg_error; $main_content .= '

  • '; } //show form $main_content .= 'To generate recovery key for your account please enter your password.

    Generate recovery key
    Password:

    '; } } //############## GENERATE NEW RECOVERY KEY ########### if($action == "newreckey") { $reg_password = trim($_POST['reg_password']); $reckey = $account_logged->getCustomField("key"); if((!$config['site']['generate_new_reckey'] || !$config['site']['send_emails']) || empty($reckey)) $main_content .= 'You cant get new rec key'; else { $points = $account_logged->getCustomField('vip_time'); if($_POST['registeraccountsave'] == "1") { if($account_logged->isValidPassword($reg_password)) { if($points >= $config['site']['generate_new_reckey_price']) { $dontshowtableagain = 1; $acceptedChars = 'ABCDEFGHIJKLMNPQRSTUVWXYZ123456789'; $max = strlen($acceptedChars)-1; $new_rec_key = NULL; // 10 = number of chars in generated key for($i=0; $i < 10; $i++) { $cnum[$i] = $acceptedChars{mt_rand(0, $max)}; $new_rec_key .= $cnum[$i]; } $main_content .= '
    Account Registered
      '; $mailBody = '

      New recovery key!

      You or someone else generated recovery key to your account on server '.htmlspecialchars($config['server']['serverName']).'.

      Recovery key: '.htmlspecialchars($new_rec_key).'

      '; $mail = new PHPMailer(); if ($config['site']['smtp_enabled']) { $mail->IsSMTP(); $mail->Host = $config['site']['smtp_host']; $mail->Port = (int)$config['site']['smtp_port']; $mail->SMTPAuth = $config['site']['smtp_auth']; $mail->Username = $config['site']['smtp_user']; $mail->Password = $config['site']['smtp_pass']; } else $mail->IsMail(); $mail->IsHTML(true); $mail->From = $config['site']['mail_address']; $mail->AddAddress($account_logged->getEMail()); $mail->Subject = $config['server']['serverName']." - new recovery key"; $mail->Body = $mailBody; if($mail->Send()) { $account_logged->set("key", $new_rec_key); $account_logged->set("vip_time", $account_logged->get("vip_time")-$config['site']['generate_new_reckey_price']); $account_logged->save(); $main_content .= '
      Your recovery key were send on email address '.htmlspecialchars($account_logged->getEMail()).' for '.$config['site']['generate_new_reckey_price'].' premium points.'; } else $main_content .= '
      An error occorred while sending email ( '.htmlspecialchars($account_logged->getEMail()).' ) with recovery key! Recovery key not changed. Try again.'; $main_content .= '

    '; } else $reg_errors[] = 'You need '.$config['site']['generate_new_reckey_price'].' premium points to generate new recovery key. You have '.$points.' premium points.'; } else $reg_errors[] = 'Wrong password to account.'; } if($dontshowtableagain != 1) { //show errors if not empty if(!empty($reg_errors)) { $main_content .= '
    The Following Errors Have Occurred:
    '; foreach($reg_errors as $reg_error) $main_content .= '
  • '.$reg_error.'
  • '; $main_content .= '

    '; } //show form $main_content .= 'To generate NEW recovery key for your account please enter your password.
    New recovery key cost '.$config['site']['generate_new_reckey_price'].' Premium Points. You have '.$points.' premium points. You will receive e-mail with this recovery key.
    Generate recovery key
    Password:

    '; } } } //###### CHANGE CHARACTER COMMENT ###### if($action == "changecomment") { $player_name = $_REQUEST['name']; $signature = htmlspecialchars(substr(trim($_POST['signature']),0,2000)); $new_comment = htmlspecialchars(substr(trim($_POST['comment']),0,2000)); $new_hideacc = (int) $_POST['accountvisible']; if(check_name($player_name)) { $player = new Player(); $player->find($player_name); if($player->isLoaded()) { $player_account = $player->getAccount(); if($account_logged->getId() == $player_account->getId()) { if($_POST['changecommentsave'] == 1) { $player->set("hide_char", $new_hideacc); $player->set("comment", $new_comment); $player->set("signature", $signature); $player->save(); $main_content .= '
    Character Information Changed
    The character information has been changed.

    '; } else { $main_content .= ' Here you can see and edit the information about your character.
    If you do not want to specify a certain field, just leave it blank.

    span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" />
    Edit Character Information
    Name: '.htmlspecialchars($player_name).'
    Hide Account:'; if($player->getCustomField("hide_char") == 1) { $main_content .= ' '; } else { $main_content .= ' '; } $main_content .= ' check to hide your account information
    Comment:
    Forum Signature:

    '; } } else { $main_content .= "Error. Character ".htmlspecialchars($player_name)." is not on your account."; } } else { $main_content .= "Error. Character with this name doesn't exist."; } } else { $main_content .= "Error. Name contain illegal characters."; } } //### DELETE character from account ### if($action == "deletecharacter") { $player_name = trim($_POST['delete_name']); $password_verify = trim($_POST['delete_password']); if($_POST['deletecharactersave'] == 1) { if(!empty($player_name) && !empty($password_verify)) { if(check_name($player_name)) { $player = new Player(); $player->find($player_name); if($player->isLoaded()) { $player_account = $player->getAccount(); if($account_logged->getId() == $player_account->getId()) { if($account_logged->isValidPassword($password_verify)) { if(!$player->isOnline()) { //dont show table "delete character" again $dontshowtableagain = 1; //delete player $player->set('deleted', 1); $player->save(); $main_content .= '
    Character Deleted
    The character '.htmlspecialchars($player_name).' has been deleted.

    '; } else $delete_errors[] = 'This character is online.'; } else { $delete_errors[] = 'Wrong password to account.'; } } else { $delete_errors[] = 'Character '.htmlspecialchars($player_name).' is not on your account.'; } } else { $delete_errors[] = 'Character with this name doesn\'t exist.'; } } else { $delete_errors[] = 'Name contain illegal characters.'; } } else { $delete_errors[] = 'Character name or/and password is empty. Please fill in form.'; } } if($dontshowtableagain != 1) { if(!empty($delete_errors)) { $main_content .= '
    The Following Errors Have Occurred:
    '; foreach($delete_errors as $delete_error) { $main_content .= '
  • '.$delete_error; } $main_content .= '

  • '; } $main_content .= 'To delete this character enter your password and click on "Submit". You can undelete the character within the first 2 months (60 days) after the deletion. After this time the character is deleted for good and cannot be restored anymore!.

    Delete Character
    Character Name:

    '.$_GET['name'].'

    Password:

    '; } } //### UNDELETE character from account ### if($action == "undelete") { $player_name = trim($_GET['name']); if(!empty($player_name)) { if(check_name($player_name)) { $player = new Player(); $player->find($player_name); if($player->isLoaded()) { $player_account = $player->getAccount(); if($account_logged->getId() == $player_account->getId()) { if(!$player->isOnline()) { $player->set('deleted', 0); $player->save(); $main_content .= '
    Character Undeleted
    The character '.htmlspecialchars($player_name).' has been undeleted.

    '; } else $delete_errors[] = 'This character is online.'; } else $delete_errors[] = 'Character '.htmlspecialchars($player_name).' is not on your account.'; } else $delete_errors[] = 'Character with this name doesn\'t exist.'; } else $delete_errors[] = 'Name contain illegal characters.'; } } //## CREATE CHARACTER on account ### if($action == "createcharacter") { if(count($config['site']['worlds']) > 1) { if(isset($_REQUEST['world'])) $world_id = (int) $_REQUEST['world']; } else $world_id = 0; if(!isset($world_id)) { $main_content .= 'Before you can create character you must select world: '; foreach($config['site']['worlds'] as $id => $world_n) $main_content .= '
    - '.htmlspecialchars($world_n).''; $main_content .= '

    BACK

    '; } else { $main_content .= ''; $newchar_name = ucwords(strtolower(trim($_POST['newcharname']))); $newchar_sex = $_POST['newcharsex']; $newchar_vocation = $_POST['newcharvocation']; $newchar_town = $_POST['newchartown']; if($_POST['savecharacter'] != 1) { $main_content .= 'Please choose a name'; if(count($config['site']['newchar_vocations'][$world_id]) > 1) $main_content .= ', vocation'; $main_content .= ' and sex for your character.
    In any case the name must not violate the naming conventions stated in the '.htmlspecialchars($config['server']['serverName']).' Rules, or your character might get deleted or name locked.'; if($account_logged->getPlayersList()->count() >= $config['site']['max_players_per_account']) $main_content .= ' You have maximum number of characters per account on your account. Delete one before you make new.'; $main_content .= '

    Create Character


    NameSex

    Please enter your character name.
    '; $main_content .= ' 1 || count($config['site']['newchar_vocations'][$world_id]) > 1) $main_content .= '
    '; if(count($config['site']['newchar_vocations'][$world_id]) > 1) { $main_content .= ''; } if(count($config['site']['newchar_towns'][$world_id]) > 1) { $main_content .= ''; } if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1) $main_content .= '

    Select your vocation:
    '; foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char) { $main_content .= ''; } $main_content .= '

    Select your city:
    '; foreach($config['site']['newchar_towns'][$world_id] as $town_id) { $main_content .= ''; } $main_content .= '
    '; $main_content .= '
    '; } else { if(empty($newchar_name)) $newchar_errors[] = 'Please enter a name for your character!'; if(empty($newchar_sex) && $newchar_sex != "0") $newchar_errors[] = 'Please select the sex for your character!'; if(count($config['site']['newchar_vocations'][$world_id]) > 1) { if(empty($newchar_vocation)) $newchar_errors[] = 'Please select a vocation for your character.'; } else $newchar_vocation = $config['site']['newchar_vocations'][$world_id][0]; if(count($config['site']['newchar_towns'][$world_id]) > 1) { if(empty($newchar_town)) $newchar_errors[] = 'Please select a town for your character.'; } else $newchar_town = $config['site']['newchar_towns'][$world_id][0]; if(empty($newchar_errors)) { if(!check_name_new_char($newchar_name)) $newchar_errors[] = 'This name contains invalid letters, words or format. Please use only a-Z, - , \' and space.'; if($newchar_sex != 1 && $newchar_sex != "0") $newchar_errors[] = 'Sex must be equal 0 (female) or 1 (male).'; if(count($config['site']['newchar_vocations'][$world_id]) > 1) { $newchar_vocation_check = FALSE; foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char) if($newchar_vocation == $char_vocation_key) $newchar_vocation_check = TRUE; if(!$newchar_vocation_check) $newchar_errors[] = 'Unknown vocation. Please fill in form again.'; } else $newchar_vocation = 0; } if(empty($newchar_errors)) { $check_name_in_database = new Player(); $check_name_in_database->find($newchar_name); if($check_name_in_database->isLoaded()) $newchar_errors[] .= 'This name is already used. Please choose another name!'; $number_of_players_on_account = $account_logged->getPlayersList()->count(); if($number_of_players_on_account >= $config['site']['max_players_per_account']) $newchar_errors[] .= 'You have too many characters on your account ('.$number_of_players_on_account.'/'.$config['site']['max_players_per_account'].')!'; } if(empty($newchar_errors)) { $char_to_copy_name = $config['site']['newchar_vocations'][$world_id][$newchar_vocation]; $char_to_copy = new Player(); $char_to_copy->find($char_to_copy_name); if(!$char_to_copy->isLoaded()) $newchar_errors[] .= 'Wrong characters configuration. Try again or contact with admin. ADMIN: Edit file config/config.php and set valid characters to copy names. Character to copy '.htmlspecialchars($char_to_copy_name).' doesn\'t exist.'; } if(empty($newchar_errors)) { // load items and skills of player before we change ID $char_to_copy->getItems()->load(); $char_to_copy->loadSkills(); if($newchar_sex == "0") $char_to_copy->setLookType(136); $char_to_copy->setID(null); // save as new character $char_to_copy->setLastIP(0); $char_to_copy->setLastLogin(0); $char_to_copy->setLastLogout(0); $char_to_copy->setName($newchar_name); $char_to_copy->setAccount($account_logged); $char_to_copy->setSex($newchar_sex); $char_to_copy->setTown($newchar_town); $char_to_copy->setPosX(0); $char_to_copy->setPosY(0); $char_to_copy->setPosZ(0); $char_to_copy->setBalance(0); $char_to_copy->setWorldID((int) $world_id); $char_to_copy->setCreateIP(Visitor::getIP()); $char_to_copy->setCreateDate(time()); $char_to_copy->setSave(); // make character saveable $char_to_copy->save(); // now it will load 'id' of new player if($char_to_copy->isLoaded()) { $char_to_copy->saveItems(); $char_to_copy->saveSkills(); $main_content .= '
    Character Created
    The character '.htmlspecialchars($newchar_name).' has been created.
    Please select the outfit when you log in for the first time.

    See you on '.$config['server']['serverName'].'!
    '; } else { echo "Error. Can\'t create character. Probably problem with database. Try again or contact with admin."; exit; } } else { $main_content .= '
    The Following Errors Have Occurred:
    '; foreach($newchar_errors as $newchar_error) $main_content .= '
  • '.$newchar_error; $main_content .= '

  • '; $main_content .= 'Please choose a name'; if(count($config['site']['newchar_vocations'][$world_id]) > 1) $main_content .= ', vocation'; $main_content .= ' and sex for your character.
    In any case the name must not violate the naming conventions stated in the '.$config['server']['serverName'].' Rules, or your character might get deleted or name locked.

    Create Character

    NameSex

    Please enter your character name.
    '; $main_content .= ' 1 || count($config['site']['newchar_vocations'][$world_id]) > 1) $main_content .= '
    '; if(count($config['site']['newchar_vocations'][$world_id]) > 1) { $main_content .= ''; } if(count($config['site']['newchar_towns'][$world_id]) > 1) { $main_content .= ''; } if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1) $main_content .= '

    Select your vocation:
    '; foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char) { $main_content .= ''; } $main_content .= '

    Select your city:
    '; foreach($config['site']['newchar_towns'][$world_id] as $town_id) { $main_content .= ''; } $main_content .= '
    '; $main_content .= '
    '; } } } } }