[MOD] save-mission

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

    • [MOD] save-mission

      make a file includes\classes\missions\MissionCaseSave.class.php

      PHP Source Code

      1. <?php
      2. class MissionCaseSave extends MissionFunctions implements Mission
      3. {
      4. function __construct($Fleet)
      5. {
      6. $this->_fleet = $Fleet;
      7. }
      8. function TargetEvent()
      9. {
      10. $this->setState(FLEET_RETURN);
      11. $this->SaveFleet();
      12. }
      13. function EndStayEvent()
      14. {
      15. return;
      16. }
      17. function ReturnEvent()
      18. {
      19. $LNG = $this->getLanguage(NULL, $this->_fleet['fleet_owner']);
      20. $fleetArray = FleetFunctions::unserialize($this->_fleet['fleet_array']);
      21. $schiffe = '[' . $this->_fleet['fleet_start_galaxy'] . '.' . $this->_fleet['fleet_start_system'] . '.' . $this->_fleet['fleet_start_planet'] . '] -> [' . $this->_fleet['fleet_end_galaxy'] . '.' . $this->_fleet['fleet_end_system'] . '.' . $this->_fleet['fleet_end_planet'] . ']<br><table style="width: 0;">';
      22. foreach ($fleetArray as $shipId => $shipAmount)
      23. {
      24. $schiffe .= '<tr><td>' . pretty_number($shipAmount) . '</td><td> ' . $LNG['tech'][$shipId] . '</td></tr>';
      25. }
      26. $schiffe .= '</table>';
      27. $Message = sprintf($LNG['sys_stat_mess'] . '<br><br>' . $LNG["type_mission_17"] . '<br>' . $schiffe . '<br>',
      28. GetStartAddressLink($this->_fleet, ''),
      29. pretty_number($this->_fleet['fleet_resource_metal']), $LNG['tech'][901],
      30. pretty_number($this->_fleet['fleet_resource_crystal']), $LNG['tech'][902],
      31. pretty_number($this->_fleet['fleet_resource_deuterium']), $LNG['tech'][903]
      32. );
      33. PlayerUtil::sendMessage($this->_fleet['fleet_owner'], 0, $LNG['sys_mess_tower'], 4, $LNG['sys_mess_fleetback'],
      34. $Message, $this->_fleet['fleet_end_time'], NULL, 1, $this->_fleet['fleet_universe']);
      35. $this->RestoreFleet();
      36. }
      37. }
      Display All

      then add in includes\classes\class.FlyingFleetHandler.php
      line 36

      PHP Source Code

      1. 17 => 'MissionCaseSave',

      then add in includes\classes\class.FleetFunctions.php (this tells that savemission is on your planets or free positions available)
      line 413

      PHP Source Code

      1. if ((!$UsedPlanet || $YourPlanet) && isModuleAvailable(MODULE_MISSION_SAVE)) {
      2. $availableMissions[] = 17;
      3. }
      then add in language\de\custom.php (this step for all languages)
      line 20

      PHP Source Code

      1. $LNG['type_mission_17'] = 'save mission';
      2. $LNG['modul_43'] = 'mission - save';


      replace in includes\constants.php(with this the mission can be activated and deactivated for adminpanel)
      line 160 with the 2 following lines

      PHP Source Code

      1. define('MODULE_AMOUNT', 44);
      2. define('MODULE_MISSION_SAVE', 43);

      includes\pages\game\ShowFleetStep3Page.class.php(this allows you to start save-missions to destroyed planets and free positions)
      replace line 152 with

      PHP Source Code

      1. if ($targetMission == 7 || $targetMission == 15 || $targetMission == 17)

      and
      replace line 212 with

      PHP Source Code

      1. if($targetMission == 7 || $targetMission == 15 || $targetMission == 17)
      replace line 168 till 170 in includes\classes\class.FlyingFleetsTable.php
      with

      PHP Source Code

      1. 17 => 'transport',
      2. );
      3. $GoodMissions = array(3, 5,17);

      then open the db and in it the table uni1_config(this activates the new modul)
      in the field 'modules' add

      Source Code

      1. ;1


      think thats it.
      enjoy :)

      read carful add and replace are different.
    • It is a fleet mission. like attacking or spying.
      free and own positions (planets) can be approached.
      The fleet flies to the target and back again.
      this way you can also secure resources (metal, crystal, deuterium).

      your game:
      good job, by the way. very nice additional features.
      very, very good job.



      그것은 함대 임무입니다. 공격하거나 훔쳐 보는 것과 같습니다.
      자유롭고 자신의 위치 (행성)에 접근 할 수 있습니다.
      함대가 목표물로 날아간 후 다시 돌아옵니다.
      이 방법으로 자원 (금속, 수정, 중수소)을 확보 할 수도 있습니다.

      너의 게임:
      좋은 직장. 아주 좋은 부가 기능.
      아주 잘 했어.

      :)
    • Hellvodoo wrote:

      No available target planet ;(
      oh, i forgot one step
      includes\pages\game\ShowFleetStep3Page.class.php
      replace line 152 with

      PHP Source Code

      1. if ($targetMission == 7 || $targetMission == 15 || $targetMission == 17)

      and
      replace line 212 with

      PHP Source Code

      1. if($targetMission == 7 || $targetMission == 15 || $targetMission == 17)
    • Russoll wrote:

      hey question "then open the db and in it the table uni1_config
      in the field 'modules' add

      Source Code

      1. ;1
      is this done the php admin via uni1_config??
      yes its in php admin via uni1_config
      and don't delete whats inside , just add
      ;1
    • Hellvodoo wrote:

      this is what type of resource extraction :/
      To meet the current mission just be sure to hide your fleet with resources changing in the bunkers. you have to create the code to do an extraction mission
    • Message: Undefined offset: 17
      File: /includes/classes/class.FlyingFleetsTable.php
      Line: 174
      URL: coswars.space/game.php?page=overview
      PHP-Version: 5.6.36
      PHP-API: litespeed
      2Moons Version: 2.0.git
      Debug Backtrace:
      #0 /includes/classes/class.FlyingFleetsTable.php(174): errorHandler(8, 'Undefined offse...', 'FILEPATH ...', 174, Array)
      #1 /includes/classes/class.FlyingFleetsTable.php(141): FlyingFleetsTable->getEventData(Array, 0)
      #2 /includes/classes/class.FlyingFleetsTable.php(94): FlyingFleetsTable->BuildFleetEventTable(Array, 0)
      #3 /includes/pages/game/ShowOverviewPage.class.php(74): FlyingFleetsTable->renderTable()
      #4 /includes/pages/game/ShowOverviewPage.class.php(290): ShowOverviewPage->GetFleets()
      #5 /game.php(57): ShowOverviewPage->show()
      #6 {main}
    • i'm not fully sure, cause i don't use this function in my game
      but i guess it should be enouth to

      replace line 168 till 170 in includes\classes\class.FlyingFleetsTable.php
      with

      PHP Source Code

      1. 17 => 'transport',
      2. );
      3. $GoodMissions = array(3, 5,17);