bugs in the destroyer officer

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • bugs in the destroyer officer

      Hola tengo un problema el oficial destructor deveria funcionar hacer 2 estrella de la muerte por el precio de 1 y resulta que no esta pinchando. saludos, veron 1.8 en adelante

      The post was edited 2 times, last by yamilrh ().

    • not on 2moons. this feature never existed, maybe on 1.3 below, but for ages destroyer never had this feature.
      Looking for good VPS to host your game? Use DigitalOcean and get 100$ bonus credit for 2 months!

      Check my mods here - stellaron.space/index.php?page=2Moons

      I can build any mod. Need my service? Contact me via PM
    • you can edit 'public static function getElementPrice'(line65) in includes\classes\class.BuildFunctions.php

      after line 99($price[$resType] *= $elementLevel;) you can add something like this.
      if($Element == 218 && $USER['rpg_destructeur'] > 0){
      $price[$resType] = $price[$resType] * 0.5;
      }

      this tests if the element ist the deathstar and if the destroyer is more then level 0. then it makes the price the half.
    • Gracias mister ahora viene lo otro, faltaría el código para que cuando tu cancelaras te descuente el 60% de los recursos, porque de lo contrario crea un bug y te duplica el doble de los recursos. saludos y gracias

      The post was edited 1 time, last by yamilrh ().

    • puso el código como me dijo así

      PHP Source Code

      1. if($forLevel && (in_array($Element, $reslist['fleet']) || in_array($Element, $reslist['defense']) || in_array($Element, $reslist['missile']))) {
      2. $price[$resType] *= $elementLevel;
      3. if($Element == 218 && $USER['rpg_destructeur'] > 0){
      4. $price[$resType] = $price[$resType] * 0.5;
      5. }
      6. }
      y no hace nada
    • Why not using the BuildAuftr method in shipyard file?

      You could easily do something like

      if($USER[‘nameOfOfficer’] > 0 && $shipId == 218) and if it’s true you double the build amount before serializing the array to b_hangar_id in planets database table.

      I could not test it because I’m not home yet but but I’m pretty sure it’s working
    • yamilrh wrote:

      Gracias mister ahora viene lo otro, faltaría el código para que cuando tu cancelaras te descuente el 60% de los recursos, porque de lo contrario crea un bug y te duplica el doble de los recursos. saludos y gracias
      this is already included

      canceling shipbuild deathstar ->
      (ShowShipyardPage.class.php)2moons requests the price of the deathstar->
      (class.BuildFunctions.php)the price is halfed cause of the officer ->
      (ShowShipyardPage.class.php)then the haled price is reduced to 60% of itself.
    • mimikri wrote:

      change 218 to 214
      Esto es lo que tengo en esas lineas

      PHP Source Code

      1. if(in_array($Element, $reslist['one'])) {
      2. $maxElement[] = 1;
      3. }
      4. return min($maxElement);

      deberia quedar algo asi?

      PHP Source Code

      1. $price[$resType] *= $elementLevel;
      2. if($Element == 218 && $USER['rpg_destructeur'] > 0){
      3. $price[$resType] = $price[$resType] * 0.5;
      4. }
    • cambiando de la 214 -218 me dio este error cuando visite el hangar

      Source Code

      1. Message: Undefined variable: resType
      2. File: /includes/classes/class.BuildFunctions.php
      3. Line: 214
      4. URL: https://dominio/xnova/game.php?page=shipyard&mode=fleet
      5. PHP-Version: 7.2.10
      6. PHP-API: fpm-fcgi
      7. 2Moons Version: 1.8.git
      8. Debug Backtrace:
      9. #0 /includes/classes/class.BuildFunctions.php(214): errorHandler(8, 'Undefined varia...', 'FILEPATH ...', 214, Array)
      10. #1 /includes/pages/game/ShowShipyardPage.class.php(240): BuildFunctions::getMaxConstructibleElements(Array, Array, '202', Array)
      11. #2 /game.php(57): ShowShipyardPage->show()
      12. #3 {main}
      Display All
    • replace

      PHP Source Code: includes\classes\class.BuildFunctions.php

      1. if($forLevel && (in_array($Element, $reslist['fleet']) || in_array($Element, $reslist['defense']) || in_array($Element, $reslist['missile']))) {
      2. $price[$resType] *= $elementLevel;
      3. }

      with

      PHP Source Code: includes\classes\class.BuildFunctions.php

      1. if($forLevel && (in_array($Element, $reslist['fleet']) || in_array($Element, $reslist['defense']) || in_array($Element, $reslist['missile']))) {
      2. $price[$resType] *= $elementLevel;
      3. if($Element == 214 && $USER['rpg_destructeur'] > 0){
      4. $price[$resType] = $price[$resType] * 0.5;
      5. }
      6. }
    • Perfecto, eres un dios xD!!... se puediera hacer para que mostrará el precio correcto o sea la mitad del original si tienes el destructor y si no lo tiene que muestre el precio original... disculpa las molestias