Advertisement
Guest User

teste

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