Guest User

Untitled

a guest
May 27th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.85 KB | None | 0 0
  1. e1.php
  2.  
  3. <?php
  4.  
  5. function probability2a($chance, $out_of = 100)
  6. {
  7. $random = mt_rand(1, $out_of);
  8. if($random <= $chance)
  9. {
  10. function probability3a($chance, $out_of = 100)
  11. {
  12. $random = mt_rand(1, $out_of);
  13. if($random <= $chance)
  14. {
  15. $mrexp=-2*$mHealth;
  16. $mdexp=2*$mHealth;
  17. $mkHealth=$mHealth;
  18. $NewPlayerHealth=0;
  19. $NewEnemyHealth=$eHealth;
  20. $erexp=2*$eexp;
  21. $mWin=0;
  22. $mLoss=1;
  23. $mKill=0;
  24. $mDeath=1;
  25. $eWin=1;
  26. $eLoss=0;
  27. $eKill=1;
  28. $eDeath=0;
  29.  
  30. echo <<<RESULT2
  31. <fieldset style="background-image:url(background.jpg); color:white;">
  32. <legend>
  33. Result
  34. </legend>
  35. RESULT2;
  36. echo "Round 1: You attacked " . $ehero . " and scored a critical hit!";
  37. echo "<br />";
  38. echo "<br />";
  39. echo "Round 2: " . $ehero . " attacked you and scored a death blow! You were slain and lost " . $mdexp . " experience!";
  40. echo "<br />";
  41. echo "<br />";
  42. echo "Final Result: Defeat!";
  43. echo <<<FIELD2
  44. </fieldset>
  45. FIELD2;
  46. }
  47. else
  48. {
  49. function probability4a($chance, $out_of = 100)
  50. {
  51. $random = mt_rand(1, $out_of);
  52. if($random <= $chance)
  53. {
  54. $battleresult2=(3*$eascore)-$mdscore;
  55.  
  56. $mrHealth=floor(($battleresult2*0.05)*$mMax);
  57. $anewPlayerHealth=$mHealth-$mrHealth;
  58.  
  59. if($anewPlayerHealth==0||$anewPlayerHealth<0)
  60. {
  61. $nmHealth=0;
  62. }
  63. else
  64. {
  65. $nmHealth=$anewPlayerHealth;
  66. }
  67.  
  68. if($nmHealth==0)
  69. {
  70. $mrexp=-2*$mHealth;
  71. $mdexp=2*$mHealth;
  72. $mkHealth=$mHealth;
  73. $NewPlayerHealth=0;
  74. $NewEnemyHealth=$eHealth;
  75. $erexp=2*$eexp;
  76. $mWin=0;
  77. $mLoss=1;
  78. $mKill=0;
  79. $mDeath=1;
  80. $eWin=1;
  81. $eLoss=0;
  82. $eKill=1;
  83. $eDeath=0;
  84.  
  85. echo <<<RESULT5
  86. <fieldset style="background-image:url(background.jpg); color:white;">
  87. <legend>
  88. Result
  89. </legend>
  90. RESULT5;
  91. echo "Round 1: You attacked " . $ehero . " and scored a critical hit!";
  92. echo "<br />";
  93. echo "<br />";
  94. echo "Round 2: " . $ehero . " attacked you and scored a critical hit! You were slain and lost " . $mdexp . " experience!";
  95. echo "<br />";
  96. echo "<br />";
  97. echo "Final Result: Defeat!";
  98. echo <<<FIELD5
  99. </fieldset>
  100. FIELD5;
  101. }
  102. else
  103. {
  104. if($battlresult2>0)
  105. {
  106. if($battleresult1>$battleresult2)
  107. {
  108. $mrexp=0.5*$mexp;
  109. $mkHealth=$mrHealth;
  110. $NewPlayerHealth=$nmHealth;
  111. $NewEnemyHealth=$eHealth;
  112. $erexp=0;
  113. $mWin=1;
  114. $mLoss=0;
  115. $mKill=0;
  116. $mDeath=0;
  117. $eWin=0;
  118. $eLoss=1;
  119. $eKill=0;
  120. $eDeath=0;
  121.  
  122. echo <<<RESULT5
  123. <fieldset style="background-image:url(background.jpg); color:white;">
  124. <legend>
  125. Result
  126. </legend>
  127. RESULT5;
  128. echo "Round 1: You attacked " . $ehero . " and scored a critical hit!";
  129. echo "<br />";
  130. echo "<br />";
  131. echo "Round 2: " . $ehero . " attacked you and scored a critical hit, but you prevailed! You defeated " . $ehero . " and gained " . $mrexp . " experience!";
  132. echo "<br />";
  133. echo "<br />";
  134. echo "Final Result: victory!";
  135. echo <<<FIELD5
  136. </fieldset>
  137. FIELD5;
  138. }
  139. else
  140. {
  141. if($battleresult1<$battleresult2)
  142. {
  143. $mrexp=0;
  144. $mkHealth=$mrHealth;
  145. $NewPlayerHealth=$nmHealth;
  146. $NewEnemyHealth=$eHealth;
  147. $erexp=ceil(0.5*$eexp);
  148. $mWin=1;
  149. $mLoss=0;
  150. $mKill=0;
  151. $mDeath=0;
  152. $eWin=0;
  153. $eLoss=1;
  154. $eKill=0;
  155. $eDeath=0;
  156.  
  157. echo <<<RESULT5
  158. <fieldset style="background-image:url(background.jpg); color:white;">
  159. <legend>
  160. Result
  161. </legend>
  162. RESULT5;
  163. echo "Round 1: You attacked " . $ehero . " and scored a critical hit!";
  164. echo "<br />";
  165. echo "<br />";
  166. echo "Round 2: " . $ehero . " attacked you, scored a critical hit and prevailed! You were defeated by " . $ehero . " and lost " . $mkHealth . " health!";
  167. echo "<br />";
  168. echo "<br />";
  169. echo "Final Result: Defeat!";
  170. echo <<<FIELD5
  171. </fieldset>
  172. FIELD5;
  173. }
  174. else
  175. {
  176. $mrexp=0;
  177. $mkHealth=$mrHealth;
  178. $NewPlayerHealth=$nmHealth;
  179. $NewEnemyHealth=$eHealth;
  180. $erexp=0;
  181. $mWin=0;
  182. $mLoss=0;
  183. $mKill=0;
  184. $mDeath=0;
  185. $eWin=0;
  186. $eLoss=0;
  187. $eKill=0;
  188. $eDeath=0;
  189.  
  190. echo <<<RESULT5
  191. <fieldset style="background-image:url(background.jpg); color:white;">
  192. <legend>
  193. Result
  194. </legend>
  195. RESULT5;
  196. echo "Round 1: You attacked " . $ehero . " and scored a critical hit!";
  197. echo "<br />";
  198. echo "<br />";
  199. echo "Round 2: " . $ehero . " attacked you and scored a critical hit, but there was no clear victor! You lost " . $mkHealth . " in the duel!";
  200. echo "<br />";
  201. echo "<br />";
  202. echo "Final Result: Draw!";
  203. echo <<<FIELD5
  204. </fieldset>
  205. FIELD5;
  206. }
  207. }
  208. }
  209. else
  210. {
  211. $mrexp=$mexp;
  212. $mkHealth=0;
  213. $NewPlayerHealth=$mHealth;
  214. $NewEnemyHealth=$eHealth;
  215. $erexp=0;
  216. $mWin=1;
  217. $mLoss=0;
  218. $mKill=0;
  219. $mDeath=0;
  220. $eWin=0;
  221. $eLoss=1;
  222. $eKill=0;
  223. $eDeath=0;
  224.  
  225. echo <<<RESULT5
  226. <fieldset style="background-image:url(background.jpg); color:white;">
  227. <legend>
  228. Result
  229. </legend>
  230. RESULT5;
  231. echo "Round 1: You attacked " . $ehero . " and scored a critical hit!";
  232. echo "<br />";
  233. echo "<br />";
  234. echo "Round 2: " . $ehero . " attacked you and scored a hit, however, you took no damage! You defeated " . $ehero . " and gained " . $mrexp . " experience!";
  235. echo "<br />";
  236. echo "<br />";
  237. echo "Final Result: Victory!";
  238. echo <<<FIELD5
  239. </fieldset>
  240. FIELD5;
  241. }
  242. }
  243. }
  244. else
  245. {
  246. $battleresult2=$eascore-$mdscore;
  247.  
  248. $mrHealth=floor(($battleresult2*0.05)*$mMax);
  249. $anewPlayerHealth=$mHealth-$mrHealth;
  250.  
  251. if($anewPlayerHealth==0||$anewPlayerHealth<0)
  252. {
  253. $nmHealth=0;
  254. }
  255. else
  256. {
  257. $nmHealth=$anewPlayerHealth;
  258. }
  259.  
  260. if($nmHealth==0)
  261. {
  262. $mrexp=-2*$mHealth;
  263. $mdexp=2*$mHealth;
  264. $mkHealth=$mHealth;
  265. $NewPlayerHealth=0;
  266. $NewEnemyHealth=$eHealth;
  267. $erexp=2*$eexp;
  268. $mWin=0;
  269. $mLoss=1;
  270. $mKill=0;
  271. $mDeath=1;
  272. $eWin=1;
  273. $eLoss=0;
  274. $eKill=1;
  275. $eDeath=0;
  276.  
  277. echo <<<RESULT2
  278. <fieldset style="background-image:url(background.jpg); color:white;">
  279. <legend>
  280. Result
  281. </legend>
  282. RESULT2;
  283. echo "Round 1: You attacked " . $ehero . " and scored a critical hit!";
  284. echo "<br />";
  285. echo "<br />";
  286. echo "Round 2: " . $ehero . " attacked you and scored a hit! You were slain and lost " . $mdexp . " experience!";
  287. echo "<br />";
  288. echo "<br />";
  289. echo "Final Result: Defeat!";
  290. echo <<<FIELD2
  291. </fieldset>
  292. FIELD2;
  293. }
  294. else
  295. {
  296. if($battleresult2>0)
  297. {
  298. if($battleresult1>$battleresult2)
  299. {
  300. $mrexp=ceil(0.5*$mexp);
  301. $mkHealth=$mrHealth;
  302. $NewPlayerHealth=$nmHealth;
  303. $NewEnemyHealth=$eHealth;
  304. $erexp=0;
  305. $mWin=1;
  306. $mLoss=0;
  307. $mKill=0;
  308. $mDeath=0;
  309. $eWin=0;
  310. $eLoss=1;
  311. $eKill=0;
  312. $eDeath=0;
  313.  
  314. echo <<<RESULT5
  315. <fieldset style="background-image:url(background.jpg); color:white;">
  316. <legend>
  317. Result
  318. </legend>
  319. RESULT5;
  320. echo "Round 1: You attacked " . $ehero . " and scored a critical hit!";
  321. echo "<br />";
  322. echo "<br />";
  323. echo "Round 2: " . $ehero . " attacked you and scored a hit, but you prevailed! You defeated " . $ehero . " and gained " . $mrexp . " experience and lost " . $mkHealth . " health!";
  324. echo "<br />";
  325. echo "<br />";
  326. echo "Final Result: Victory!";
  327. echo <<<FIELD5
  328. </fieldset>
  329. FIELD5;
  330. }
  331. else
  332. {
  333. if($battleresult1<$battleresult2)
  334. {
  335. $mrexp=0;
  336. $mkHealth=$mrHealth;
  337. $NewPlayerHealth=$nmHealth;
  338. $NewEnemyHealth=$eHealth;
  339. $erexp=ceil(0.5*$eexp);
  340. $mWin=0;
  341. $mLoss=1;
  342. $mKill=0;
  343. $mDeath=0;
  344. $eWin=1;
  345. $eLoss=0;
  346. $eKill=0;
  347. $eDeath=0;
  348.  
  349. echo <<<RESULT5
  350. <fieldset style="background-image:url(background.jpg); color:white;">
  351. <legend>
  352. Result
  353. </legend>
  354. RESULT5;
  355. echo "Round 1: You attacked " . $ehero . " and scored a critical hit!";
  356. echo "<br />";
  357. echo "<br />";
  358. echo "Round 2: " . $ehero . " attacked you, scored a hit and prevailed! You were defeated by " . $ehero . " and lost " . $mkHealth . " health!";
  359. echo "<br />";
  360. echo "<br />";
  361. echo "Final Result: Defeat!";
  362. echo <<<FIELD5
  363. </fieldset>
  364. FIELD5;
  365. }
  366. else
  367. {
  368. $mrexp=0;
  369. $mkHealth=$mrHealth;
  370. $NewPlayerHealth=$nmHealth;
  371. $NewEnemyHealth=$eHealth;
  372. $erexp=0;
  373. $mWin=0;
  374. $mLoss=0;
  375. $mKill=0;
  376. $mDeath=0;
  377. $eWin=0;
  378. $eLoss=0;
  379. $eKill=0;
  380. $eDeath=0;
  381.  
  382. echo <<<RESULT5
  383. <fieldset style="background-image:url(background.jpg); color:white;">
  384. <legend>
  385. Result
  386. </legend>
  387. RESULT5;
  388. echo "Round 1: You attacked " . $ehero . " and scored a critical hit!";
  389. echo "<br />";
  390. echo "<br />";
  391. echo "Round 2: " . $ehero . " attacked you and scored a hit, but there was no clear victor! You lost " . $mkHealth . " in the duel!";
  392. echo "<br />";
  393. echo "<br />";
  394. echo "Final Result: Draw!";
  395. echo <<<FIELD5
  396. </fieldset>
  397. FIELD5;
  398. }
  399. }
  400. }
  401. else
  402. {
  403. $mrexp=$mexp;
  404. $mkHealth=0;
  405. $NewPlayerHealth=$mHealth;
  406. $NewEnemyHealth=$eHealth;
  407. $erexp=0;
  408. $mWin=1;
  409. $mLoss=0;
  410. $mKill=0;
  411. $mDeath=0;
  412. $eWin=0;
  413. $eLoss=1;
  414. $eKill=0;
  415. $eDeath=0;
  416.  
  417. echo <<<RESULT2
  418. <fieldset style="background-image:url(background.jpg); color:white;">
  419. <legend>
  420. Result
  421. </legend>
  422. RESULT2;
  423. echo "Round 1: You attacked " . $ehero . " and scored a critical hit!";
  424. echo "<br />";
  425. echo "<br />";
  426. echo "Round 2: " . $ehero . " attacked you and scored a hit, however, you took no damage! You defeated " . $ehero . " and gained " . $mrexp . " experience!";
  427. echo "<br />";
  428. echo "<br />";
  429. echo "Final Result: Victory!";
  430. echo <<<FIELD2
  431. </fieldset>
  432. FIELD2;
  433. }
  434. }
  435. }
  436. }
  437.  
  438. $ecritchance1=(($eLuck*0.1)*$ebonus)+$ewCrit;;
  439.  
  440. if($ecritchance1<10)
  441. {
  442. $ecritchance2=round($ecritchance1,2);
  443. $ecritchance=$ecritchance2*100;
  444. }
  445. else
  446. {
  447. if($ecritchance1<1)
  448. {
  449. $ecritchance2=round($ecritchance1,1);
  450. $ecritchance=$ecritchance2*100;
  451. }
  452. else
  453. {
  454. if($ecritchance1<0.1)
  455. {
  456. $ecritchance2=round($ecritchance1,0);
  457. $ecritchance=$ecritchance2*100;
  458. }
  459. else
  460. {
  461. $ecritchance2=round($ecritchance1,3);
  462. $ecritchance=$ecritchance2*100;
  463. }
  464. }
  465. }
  466.  
  467. probability4a($ecritchance,10000);
  468. }
  469. }
  470.  
  471. $edeathchance1=($eFocus*0.01)+($ebonus*0.01);
  472.  
  473. if($edeathchance1<10)
  474. {
  475. $edeathchance2=round($edeathchance1,2);
  476. $edeathchance=$edeathchance2*100;
  477. }
  478. else
  479. {
  480. if($edeathchance1<1)
  481. {
  482. $edeathchance2=round($edeathchance1,1);
  483. $edeathchance=$edeathchance2*100;
  484. }
  485. else
  486. {
  487. if($edeathchance1<0.1)
  488. {
  489. $edeathchance2=round($edeathchance1,0);
  490. $edeathchance=$edeathchance2*100;
  491. }
  492. else
  493. {
  494. $edeathchance2=round($edeathchance1,3);
  495. $edeathchance=$edeathchance2*100;
  496. }
  497. }
  498. }
  499.  
  500. probability3a($edeathchance,10000);
  501. }
  502. else
  503. {
  504. $mrexp=$mexp;
  505. $mkHealth=0;
  506. $NewPlayerHealth=$mHealth;
  507. $NewEnemyHealth=$eHealth;
  508. $erexp=0;
  509. $mWin=1;
  510. $mLoss=0;
  511. $mKill=0;
  512. $mDeath=0;
  513. $eWin=0;
  514. $eLoss=1;
  515. $eKill=0;
  516. $eDeath=0;
  517.  
  518. echo <<<RESULT
  519. <fieldset style="background-image:url(background.jpg); color:white;">
  520. <legend>
  521. Result
  522. </legend>
  523. RESULT;
  524. echo "Round 1: You attacked " . $ehero . " and scored a critical hit!";
  525. echo "<br />";
  526. echo "<br />";
  527. echo "Round 2: " . $ehero . " attacked you and missed! You defeated " . $ehero . " and gained " . $mrexp . " experience!";
  528. echo "<br />";
  529. echo "<br />";
  530. echo "Final Result: Victory!";
  531. echo <<<FIELD
  532. </fieldset>
  533. FIELD;
  534. }
  535. }
  536.  
  537. $e1hitchance=$ebonus*100;
  538.  
  539. if($e1hitchance>100)
  540. {
  541. $e1hitchance=100;
  542. }
  543. else
  544. {
  545. $e1hitchance=$ebonus*100;
  546. }
  547.  
  548. $e2hitchance=$e1hitchance+(-10*$mbonus);
  549.  
  550. if($e2hitchance<10)
  551. {
  552. $e3hitchance=round($e2hitchance,2);
  553. $ehitchance=$e3hitchance*100;
  554. }
  555. else
  556. {
  557. if($e2hitchance<1)
  558. {
  559. $e3hitchance=round($e2hitchance,2);
  560. $ehitchance=$e3hitchance*100;
  561. }
  562. else
  563. {
  564. if($e2hitchance<0.1)
  565. {
  566. $e3hitchance=round($e2hitchance,0);
  567. $ehitchance=$e3hitchance*100;
  568. }
  569. else
  570. {
  571. $e3hitchance=round($e2hitchance,3);
  572. $ehitchance=$e3hitchance*100;
  573. }
  574. }
  575. }
  576.  
  577. probability2a($mhitchance,10000);
  578.  
  579. ?>
Add Comment
Please, Sign In to add comment