Advertisement
Guest User

ddsgdsf

a guest
Oct 23rd, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.94 KB | None | 0 0
  1. <?php
  2. if (!$logged){
  3. include ('login.php');
  4. }
  5. if ($logged)
  6. if($player->isOnline()) {
  7. $main_content .= 'You need must be offline to reset your level.';
  8. }
  9. if ($action == ''){
  10. $main_content .='
  11. Para resetar o personagem escolha o personagem e digite sua senha para confirmação.<br>
  12. Ao resetar seu personagem, o personagem vai para level 8 mantendo o restante dos atributos.<br/><br/>
  13. <form action="?subtopic=resets&action=resets" method="post" >
  14. <div class="TableContainer" >
  15. <table class="Table1" cellpadding="0" cellspacing="0" >
  16. <div class="CaptionContainer" >
  17. <div class="CaptionInnerContainer" >
  18. <span class="CaptionEdgeLeftTop" style="background-image:url(layouts/tibiacom/images/content/box-frame-edge.gif);"
  19.  
  20. /></span>
  21. <span class="CaptionEdgeRightTop" style="background-image:url(layouts/tibiacom/images/content/box-frame-edge.gif);"
  22.  
  23. /></span>
  24. <span class="CaptionBorderTop" style="background-image:url(layouts/tibiacom/images/content/table-headline-border.gif);"
  25.  
  26. ></span>
  27. <span class="CaptionVerticalLeft" style="background-image:url(layouts/tibiacom/images/content/box-frame-vertical.gif);"
  28.  
  29. /></span>
  30. <div class="Text" >Resetar personagem</div>
  31. <span class="CaptionVerticalRight" style="background-image:url(layouts/tibiacom/images/content/box-frame-vertical.gif);"
  32.  
  33. /></span>
  34. <span class="CaptionBorderBottom" style="background-image:url(layouts/tibiacom/images/content/table-headline-border.gif);"
  35.  
  36. ></span>
  37. <span class="CaptionEdgeLeftBottom" style="background-image:url(layouts/tibiacom/images/content/box-frame-edge.gif);"
  38.  
  39. /></span>
  40. <span class="CaptionEdgeRightBottom" style="background-image:url(layouts/tibiacom/images/content/box-frame-edge.gif);"
  41.  
  42. /></span>
  43. </div>
  44. </div>
  45. <tr>
  46. <td>
  47. <div class="InnerTableContainer" >
  48. <table style="width:100%;" >
  49. <tr>
  50. <td class="LabelV" ><span >Nome do personagem:</td>
  51. <td style="width:90%;" >
  52. <select name="reset_name">';
  53. $players_from_logged_acc = $account_logged->getPlayersList();
  54. if(count($players_from_logged_acc) > 0) {
  55. $players_from_logged_acc->orderBy('name');
  56. foreach($players_from_logged_acc as $player) {
  57. $main_content .= '<option value="'.$player->getName().'">'.$player->getName().'</option>';
  58. }
  59. } else {
  60. $main_content .= 'You don\'t have any character on your account.';
  61. }
  62. $main_content .='
  63. </select>
  64. </td>
  65. </tr>
  66. <!--tr>
  67. <td class="LabelV" >
  68. <span >Account Name:</td><td><input type="password" name="reset_acc" size="30" maxlength="29" ></td></tr-->
  69. </table>
  70. </div>
  71. </table>
  72. </div>
  73. </td>
  74. </tr>
  75. <br/>
  76. <table style="width:100%" >
  77. <tr align="center" >
  78. <td>
  79. <table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" >
  80. <div class="BigButton" style="background-image:url(layouts/tibiacom/images/buttons/sbutton.gif)" ><div
  81.  
  82. onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver"
  83.  
  84. style="background-image:url(layouts/tibiacom/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText"
  85.  
  86. type="image" name="Submit" alt="Submit" src="layouts/tibiacom/images/buttons/_sbutton_submit.gif"
  87.  
  88. ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?
  89.  
  90. subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-
  91.  
  92. image:url(layouts/tibiacom/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);"
  93.  
  94. onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url
  95.  
  96. (layouts/tibiacom/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back"
  97.  
  98. src="layouts/tibiacom/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>
  99. ';
  100. }
  101. if ($action == 'resets'){
  102. $reset_name = stripslashes(ucwords(strtolower(trim($_REQUEST['reset_name']))));
  103. if(check_name($reset_name)) {
  104. $player = $ots->createObject('Player');
  105. $player->find($reset_name);
  106. if($player->isLoaded()) {
  107.  
  108. $PlayerLevel = $player->getLevel();
  109. $PlayerReset = $player->getCustomField('resets');
  110. $PlayerResetNow = $player->getCustomField('resets') + 1;
  111. $ResetTable = array (
  112. 0 => 350,
  113. 1 => 350,
  114. 2 => 350,
  115. 3 => 350,
  116. 4 => 350,
  117.  
  118. 5 => 355,
  119. 6 => 355,
  120. 7 => 355,
  121. 8 => 355,
  122. 9 => 355,
  123.  
  124. 10 => 360,
  125. 11 => 360,
  126. 12 => 360,
  127. 13 => 360,
  128. 14 => 360,
  129.  
  130. 15 => 365,
  131. 16 => 365,
  132. 17 => 365,
  133. 18 => 365,
  134. 19 => 365,
  135.  
  136. 20 => 380,
  137. 21 => 380,
  138. 22 => 380,
  139. 23 => 380,
  140. 24 => 380,
  141.  
  142. 25 => 390,
  143. 26 => 390,
  144. 27 => 390,
  145. 28 => 390,
  146. 29 => 390,
  147.  
  148. 30 => 410,
  149. 31 => 410,
  150. 32 => 410,
  151. 33 => 410,
  152. 34 => 410,
  153.  
  154. 35 => 430,
  155. 36 => 430,
  156. 37 => 430,
  157. 38 => 430,
  158. 39 => 430,
  159.  
  160. 40 => 450,
  161. 41 => 450,
  162. 42 => 450,
  163. 43 => 450,
  164. 44 => 450,
  165.  
  166. 45 => 480,
  167. 46 => 480,
  168. 47 => 480,
  169. 48 => 480,
  170. 49 => 480,
  171.  
  172. 50 => 510,
  173. 51 => 510,
  174. 52 => 510,
  175. 53 => 510,
  176. 54 => 510,
  177.  
  178. 55 => 550,
  179. 56 => 550,
  180. 57 => 550,
  181. 58 => 550,
  182. 59 => 550,
  183. );
  184. $LevelLeft = $ResetTable[$PlayerReset] - $PlayerLevel;
  185. if ($PlayerLevel >= $ResetTable[$PlayerReset]){
  186. $SQL->query ("UPDATE `players` SET `resets` = `resets` + '1', level = 8 WHERE `players`.`id` = '".$player->getId()."'
  187.  
  188. LIMIT 1 ;");
  189. $main_content .= '
  190. <div class="reset_class">
  191. Personagem '.$player->getName().' estava level '.$PlayerLevel.' e foi resetado com sucesso.<br />
  192. Agora o personagem tem '.$PlayerResetNow.' reset(s).
  193. </div>
  194. <br />
  195. <table border="0" cellpadding="0" cellspacing="0" align="center">
  196. <tbody>
  197. <tr>
  198. <td style="border: 0px none;">
  199. <div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">
  200. <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver"
  201.  
  202. style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>
  203. <form action="?subtopic=resets" method="post">
  204. <input class="ButtonText" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" type="image">
  205. </form>
  206. </div>
  207. </div>
  208. </td>
  209. </tr>
  210. </tbody>
  211. </table>
  212. ';
  213. }
  214. else {
  215. $main_content .= '
  216. <div class="reset_class">
  217. Você tem '.$PlayerReset.' resets.<br />
  218. Você reseta level '.$ResetTable[$PlayerReset].'.<br />
  219. <span style="color: red;">Faltam '.$LevelLeft.' level(s).</span>
  220. </div>
  221. <br />
  222. <table border="0" cellpadding="0" cellspacing="0" align="center">
  223. <tbody>
  224. <tr>
  225. <td style="border: 0px none;">
  226. <div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">
  227. <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver"
  228.  
  229. style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>
  230. <form action="?subtopic=resets" method="post">
  231. <input class="ButtonText" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_back.gif"
  232.  
  233. type="image">
  234. </form>
  235. </div>
  236. </div>
  237. </td>
  238. </tr>
  239. </tbody>
  240. </table>
  241. ';
  242. }
  243.  
  244.  
  245. /**********************************************/
  246. } // Carregar modulos
  247. } // Checar Player Existente
  248. } // Fim page
  249. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement