MissionCaseAttack some bug

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

    • MissionCaseAttack some bug

      I think This is a bug.

      Even if the fleet is an attack on planet A and planet A is deleted,
      It becomes a battle.

      Will it be possible to return if there is no planet after arrival?
      How do I edit the file below?

      MissionCaseAttack.php AND MissionCaseDestruction
      --------------------------------------------------------------------------------------
      My version is 2moons 1.3v . :D But all fixed bug and more then mod added.
      diyworld.biz
      Test universe: 1
      ID:2moons pw:1234
    • yo have to change the TargetEvent() function in the missioncasedistruction file

      input something like this:

      PHP Source Code

      1. $sql = "SELECT * FROM %%PLANETS%% WHERE id = :planetId;";//select target planet
      2. $targetPlanet = $db->selectSingle($sql, array(':planetId' => $this->_fleet['fleet_end_id'] ));
      3. if(!isset($targetPlanet['id_owner'])){//if no result write a message to the sender and avoid rest of the function exept last 2 lines
      4. PlayerUtil::sendMessage($this->_fleet['fleet_owner'], 0, 'Flotte', 4, 'no Moon',
      5. 'There is no moon.', $this->_fleet['fleet_start_time'], NULL, 1, $this->_fleet['fleet_universe']);
      6. }else{
      7. //maincode from targetevent() function
      8. }
      9. $this->setState(FLEET_RETURN);
      10. $this->SaveFleet();
      the db request should look a bit different.
      and in the else is what would normaly happend in this.
      the code is from version 1.8 u have to adapt it to 1.3.
    • mimikri wrote:

      yo have to change the TargetEvent() function in the missioncasedistruction file

      input something like this:

      PHP Source Code

      1. $sql = "SELECT * FROM %%PLANETS%% WHERE id = :planetId;";//select target planet
      2. $targetPlanet = $db->selectSingle($sql, array(':planetId' => $this->_fleet['fleet_end_id'] ));
      3. if(!isset($targetPlanet['id_owner'])){//if no result write a message to the sender and avoid rest of the function exept last 2 lines
      4. PlayerUtil::sendMessage($this->_fleet['fleet_owner'], 0, 'Flotte', 4, 'no Moon',
      5. 'There is no moon.', $this->_fleet['fleet_start_time'], NULL, 1, $this->_fleet['fleet_universe']);
      6. }else{
      7. //maincode from targetevent() function
      8. }
      9. $this->setState(FLEET_RETURN);
      10. $this->SaveFleet();
      the db request should look a bit different.
      and in the else is what would normaly happend in this.
      the code is from version 1.8 u have to adapt it to 1.3.

      Let's analyze the code.
      Thanks you. ^^
      --------------------------------------------------------------------------------------
      My version is 2moons 1.3v . :D But all fixed bug and more then mod added.
      diyworld.biz
      Test universe: 1
      ID:2moons pw:1234
    • Looking for good VPS to host your game? Use DigitalOcean and get 100$ bonus credit for 2 months!

      Private project - stellaron.space

      I can build any mod. Need my service? Contact me via PM
    • Thanks you.
      My 2moons(1.3) is outdated, so I changed the code.
      Now it works fine. ^^ ^^

      Maybe, 2moons version 1.7 or less will be applied.


      PHP Source Code

      1. $iGalaxyPlace = $db->countquery("SELECT COUNT(*) FROM ".PLANETS." WHERE `id` = '".$this->_fleet['fleet_end_id']."';");
      2. if ($iGalaxyPlace == 0)
      3. {
      4. $Messageno = sprintf( $LNG['sys_fleet_won_no'], GetStartAdressLink($this->_fleet, '') ); //return message
      5. $this->UpdateFleet('fleet_mess', 1);
      6. $this->SaveFleet();
      7. SendSimpleMessage($this->_fleet['fleet_owner'], 0, $this->_fleet['fleet_start_time'], 3, $LNG['sys_mess_tower'], $LNG['sys_mess_fleetback'], $Messageno);
      8. return;
      9. }
      Display All
      --------------------------------------------------------------------------------------
      My version is 2moons 1.3v . :D But all fixed bug and more then mod added.
      diyworld.biz
      Test universe: 1
      ID:2moons pw:1234