Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. case 'playeradventurefinished':
  2. $acc = new Account(null, null, false, true);
  3.  
  4. // Fix by Greg
  5. if ($acc->data['status_extra'] == 0)
  6. exit_fixed();
  7.  
  8. //see if skipped, take mushrooms
  9. if($args[0] == 1)
  10. if($acc->data['status_time'] > time() && $acc->data['mush'] <= 0)
  11. exit_fixed('Error:need more coins');
  12. else if($args[0] == 2)
  13. if($acc->data['status_time'] > time() && $acc->data['hg'] <= 0)
  14. exit_fixed('Error:need more coins');
  15.  
  16. // Fix by MDMB hourglass with - number
  17. if($args[0] == 2){
  18. if ($acc->data['hg'] < 1){
  19. exit_fixed('mdmb tu byl');
  20. }
  21. }
  22. // Fix by MDMB missions 0 sec
  23. if($args[0] == 1){
  24. if($time < $acc->data['status_time']){
  25. exit_fixed('mdmb tu byl');
  26. }
  27. }
  28.  
  29. switch($acc->data['class']) {
  30. case "1" :
  31. $w = $acc->data['str'];
  32. break;
  33. case "2" :
  34. $w = $acc->data['dex'];
  35. break;
  36. case "3" :
  37. $w = $acc->data['intel'];
  38. break;
  39. case "4" :
  40. $w = $acc->data['dex'];
  41. break;
  42. case "5" :
  43. $w = $acc->data['str'];
  44. break;
  45. case "6" :
  46. $w = $acc->data['str'];
  47. break;
  48. }
  49.  
  50. $dmg_min = 2 * $w;
  51. $dmg_max = intval(strval(2.1 * $w));
  52. $hp = intval(strval( ($acc->data['wit'] / 10) * 4 * ($acc->data['lvl'] + 1) ));
  53.  
  54. $mob_c = rand(1, 2);
  55. if ($mob_c == 2)
  56. $mob_c = 3;
  57.  
  58. //TODO: generate this somewhere
  59. // ($lvl, $class, $str, $agi, $int, $wit, $luck, $dmg_min, $dmg_max, $hp, $armor, $id, $exp, $weapon_id, $shield_id = 0)
  60. $monsterID = ($acc->data['quest_exp'.$acc->data['status_extra']] % 163) + 1;
  61. $monster = new Monster($acc->data['lvl'], $mob_c, ($acc->data['str'] / 2), ($acc->data['dex'] / 2), ($acc->data['intel'] / 2), ($acc->data['wit'] / 2), ($acc->data['luck'] / 2), $dmg_min, $dmg_max, $hp, 1, -$monsterID, 1, 10);
  62.  
  63. //$bg = rand(11,21);
  64. $extra = $acc->data["status_extra"];
  65. $bg = $acc->questBackground($acc->data['quest_exp'.$extra]);
  66. $ret[] = "fightheader.fighters:1/0/0/".$bg."/0/".$acc->getFightHeader().$monster->getFightHeader();
  67.  
  68. $simulation = new Simulation($acc, $monster);
  69. $simulation->simulate();
  70.  
  71. $win = $simulation->winnerID == $acc->data['ID'];
  72.  
  73.  
  74.  
  75. $ret[] = "fight.r:".$simulation->fightLog;
  76. $ret[] = "winnerid:".$simulation->winnerID;
  77. $ret[] = "fightresult.battlereward:".$acc->questFinish($win, $monsterID, $args[0]);
  78. $ret[] = "Success:";
  79.  
  80. if (isset($RENEW))
  81. $acc = new Account(null, null, false, true);
  82.  
  83. $ret[] = "ownplayersave.playerSave:".$acc->getPlayerSave();
  84. if($acc->hasAlbum())
  85. $ret[] = "achievement(140):".$acc->getAchievements();
  86. $ret[] = "timestamp:".time();
  87.  
  88. if(($fortressBackpackSize = $acc->getFortressBackpackSize()) > 0)
  89. $ret[] = "fortresschest.item(".$fortressBackpackSize."):".$acc->getFortressBackpackSave();
  90.  
  91. break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement