[MOD] Race/Class mod

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

    • [MOD] Race/Class mod

      !!! this mod needs a rework for language and css, if u use it, it won't be multilingual!!!


      hi.
      for version 1.8.1 i think^^
      the mod is not perfect but it shows u how to integrate a race. we may make it better together :)

      1.open ur db.

      insert this
      Display Spoiler

      REPLACE INTO `uni1_vars` VALUES (802, 'miner', 900, '', 0, 1.00, 2, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0.00, 0.30, 0.00, -0.15, 0.00, 0.00, 0.00, 0.20, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
      REPLACE INTO `uni1_vars` VALUES (803, 'krieger', 900, '', 0, 1.00, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0.30, 0.30, 0.30, 0.10, 0.10, 0.30, 0.00, -0.20, -0.20, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, '', '', '', '', '', '', '', '');
      REPLACE INTO `uni1_vars` VALUES (801, 'forscher', 900, '', 0, 1.00, 2, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0.00, 0.00, 0.30, 0.00, -0.20, 0.00, 0.00, 0.00, 0.20, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
      REPLACE INTO `uni1_vars` VALUES (804, 'haendler', 900, '', 0, 1.00, 2, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0.00, 0.00, 0.00, 0.05, 0.05, -0.30, 0.00, 0.00, 0.10, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);


      and
      this
      Display Spoiler

      ALTER TABLE `uni1_users` ADD(
      `race` TINYINT(4) NULL DEFAULT '0',
      `forscher` SMALLINT(6) NULL DEFAULT '0',
      `miner` SMALLINT(6) NULL DEFAULT '0',
      `krieger` SMALLINT(6) NULL DEFAULT '0',
      `haendler` SMALLINT(6) NULL DEFAULT '0',
      `race_date` INT(10) NULL DEFAULT '0'
      )



      this made ur races/classes

      2.copy the php file into
      includes/pages/game/

      3.open
      languages/de/TECH.php and add
      Display Spoiler

      800 => 'Klassen',
      802 => 'Miner',
      803 => 'Krieger',
      801 => 'Forscher',
      804 => 'Händler',


      to line 182

      this has to be done for all languages

      4.copy pictures to folder styles/themes/gow/img/

      thats ist
      the choosing page can be reached under game.php?page=race
      u can use this link in the gamemenu
      this can be find under styles/templates/game/main.navigation.tpl
      Display Spoiler
      <li><a href="game.php?page=race">{$LNG['tech'][800]}</a></li>




      thats it. its a quick and dirty. this mod is no beauty, but its working, have wirtten it for an older system once.
      there should be a language integration as well as css, this will be fixed later. untill that, this mod is monolanguage^^


      if u wish to add the racechoice to the registry i mad a little hack for it. the 2 php files from the zip called login have to be copied in includes/pages/login/
      pls make copies of the originales befor.
      this calls the choose race page directly after the registration of an new user
      Files
      • racemod.zip

        (51.42 kB, downloaded 689 times, last: )
      • login.zip

        (4.42 kB, downloaded 670 times, last: )
    • Великолепно. Но чуть позже выложу свой все равно, я немного другим путем пошел, думаю будет не безинтересно подискутировать по поводу плюсов и минусов )
      Кто к нам с чем зачем, тот от того и того! :D
    • this may fix ur problem, i guess its cause u use xterium, and have some other colums in the table
      Display Spoiler

      REPLACE INTO `uni1_vars` (`elementID`, `name`, `class`, `onPlanetType`, `onePerPlanet`, `factor`, `maxLevel`, `cost901`, `cost902`, `cost903`, `cost911`, `cost921`, `consumption1`, `consumption2`, `speedTech`, `speed1`, `speed2`, `speed2Tech`, `speed2onLevel`, `speed3Tech`, `speed3onLevel`, `capacity`, `attack`, `defend`, `timeBonus`, `bonusAttack`, `bonusDefensive`, `bonusShield`, `bonusBuildTime`, `bonusResearchTime`, `bonusShipTime`, `bonusDefensiveTime`, `bonusResource`, `bonusEnergy`, `bonusResourceStorage`, `bonusShipStorage`, `bonusFlyTime`, `bonusFleetSlots`, `bonusPlanets`, `bonusSpyPower`, `bonusExpedition`, `bonusGateCoolTime`, `bonusMoreFound`, `bonusAttackUnit`, `bonusDefensiveUnit`, `bonusShieldUnit`, `bonusBuildTimeUnit`, `bonusResearchTimeUnit`, `bonusShipTimeUnit`, `bonusDefensiveTimeUnit`, `bonusResourceUnit`, `bonusEnergyUnit`, `bonusResourceStorageUnit`, `bonusShipStorageUnit`, `bonusFlyTimeUnit`, `bonusFleetSlotsUnit`, `bonusPlanetsUnit`, `bonusSpyPowerUnit`, `bonusExpeditionUnit`, `bonusGateCoolTimeUnit`, `bonusMoreFoundUnit`, `speedFleetFactor`, `production901`, `production902`, `production903`, `production911`, `production921`, `storage901`, `storage902`, `storage903`) VALUES (802, 'miner', 900, '', 0, 1.00, 2, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0.00, 0.30, 0.00, -0.15, 0.00, 0.00, 0.00, 0.20, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
      REPLACE INTO `uni1_vars` (`elementID`, `name`, `class`, `onPlanetType`, `onePerPlanet`, `factor`, `maxLevel`, `cost901`, `cost902`, `cost903`, `cost911`, `cost921`, `consumption1`, `consumption2`, `speedTech`, `speed1`, `speed2`, `speed2Tech`, `speed2onLevel`, `speed3Tech`, `speed3onLevel`, `capacity`, `attack`, `defend`, `timeBonus`, `bonusAttack`, `bonusDefensive`, `bonusShield`, `bonusBuildTime`, `bonusResearchTime`, `bonusShipTime`, `bonusDefensiveTime`, `bonusResource`, `bonusEnergy`, `bonusResourceStorage`, `bonusShipStorage`, `bonusFlyTime`, `bonusFleetSlots`, `bonusPlanets`, `bonusSpyPower`, `bonusExpedition`, `bonusGateCoolTime`, `bonusMoreFound`, `bonusAttackUnit`, `bonusDefensiveUnit`, `bonusShieldUnit`, `bonusBuildTimeUnit`, `bonusResearchTimeUnit`, `bonusShipTimeUnit`, `bonusDefensiveTimeUnit`, `bonusResourceUnit`, `bonusEnergyUnit`, `bonusResourceStorageUnit`, `bonusShipStorageUnit`, `bonusFlyTimeUnit`, `bonusFleetSlotsUnit`, `bonusPlanetsUnit`, `bonusSpyPowerUnit`, `bonusExpeditionUnit`, `bonusGateCoolTimeUnit`, `bonusMoreFoundUnit`, `speedFleetFactor`, `production901`, `production902`, `production903`, `production911`, `production921`, `storage901`, `storage902`, `storage903`) VALUES (803, 'krieger', 900, '', 0, 1.00, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0.30, 0.30, 0.30, 0.10, 0.10, 0.30, 0.00, -0.20, -0.20, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, '', '', '', '', '', '', '', '');
      REPLACE INTO `uni1_vars` (`elementID`, `name`, `class`, `onPlanetType`, `onePerPlanet`, `factor`, `maxLevel`, `cost901`, `cost902`, `cost903`, `cost911`, `cost921`, `consumption1`, `consumption2`, `speedTech`, `speed1`, `speed2`, `speed2Tech`, `speed2onLevel`, `speed3Tech`, `speed3onLevel`, `capacity`, `attack`, `defend`, `timeBonus`, `bonusAttack`, `bonusDefensive`, `bonusShield`, `bonusBuildTime`, `bonusResearchTime`, `bonusShipTime`, `bonusDefensiveTime`, `bonusResource`, `bonusEnergy`, `bonusResourceStorage`, `bonusShipStorage`, `bonusFlyTime`, `bonusFleetSlots`, `bonusPlanets`, `bonusSpyPower`, `bonusExpedition`, `bonusGateCoolTime`, `bonusMoreFound`, `bonusAttackUnit`, `bonusDefensiveUnit`, `bonusShieldUnit`, `bonusBuildTimeUnit`, `bonusResearchTimeUnit`, `bonusShipTimeUnit`, `bonusDefensiveTimeUnit`, `bonusResourceUnit`, `bonusEnergyUnit`, `bonusResourceStorageUnit`, `bonusShipStorageUnit`, `bonusFlyTimeUnit`, `bonusFleetSlotsUnit`, `bonusPlanetsUnit`, `bonusSpyPowerUnit`, `bonusExpeditionUnit`, `bonusGateCoolTimeUnit`, `bonusMoreFoundUnit`, `speedFleetFactor`, `production901`, `production902`, `production903`, `production911`, `production921`, `storage901`, `storage902`, `storage903`) VALUES (801, 'forscher', 900, '', 0, 1.00, 2, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0.00, 0.00, 0.30, 0.00, -0.20, 0.00, 0.00, 0.00, 0.20, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
      REPLACE INTO `uni1_vars` (`elementID`, `name`, `class`, `onPlanetType`, `onePerPlanet`, `factor`, `maxLevel`, `cost901`, `cost902`, `cost903`, `cost911`, `cost921`, `consumption1`, `consumption2`, `speedTech`, `speed1`, `speed2`, `speed2Tech`, `speed2onLevel`, `speed3Tech`, `speed3onLevel`, `capacity`, `attack`, `defend`, `timeBonus`, `bonusAttack`, `bonusDefensive`, `bonusShield`, `bonusBuildTime`, `bonusResearchTime`, `bonusShipTime`, `bonusDefensiveTime`, `bonusResource`, `bonusEnergy`, `bonusResourceStorage`, `bonusShipStorage`, `bonusFlyTime`, `bonusFleetSlots`, `bonusPlanets`, `bonusSpyPower`, `bonusExpedition`, `bonusGateCoolTime`, `bonusMoreFound`, `bonusAttackUnit`, `bonusDefensiveUnit`, `bonusShieldUnit`, `bonusBuildTimeUnit`, `bonusResearchTimeUnit`, `bonusShipTimeUnit`, `bonusDefensiveTimeUnit`, `bonusResourceUnit`, `bonusEnergyUnit`, `bonusResourceStorageUnit`, `bonusShipStorageUnit`, `bonusFlyTimeUnit`, `bonusFleetSlotsUnit`, `bonusPlanetsUnit`, `bonusSpyPowerUnit`, `bonusExpeditionUnit`, `bonusGateCoolTimeUnit`, `bonusMoreFoundUnit`, `speedFleetFactor`, `production901`, `production902`, `production903`, `production911`, `production921`, `storage901`, `storage902`, `storage903`) VALUES (804, 'haendler', 900, '', 0, 1.00, 2, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0.00, 0.00, 0.00, 0.05, 0.05, -0.30, 0.00, 0.00, 0.10, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

    • thank you it worked for the sql........when i load the race i get this

      Undefined index: race_date
      File: /includes/pages/game/class.ShowRacePage.php (Line 55)

      on line 55---- $seite .= "<div style=\"height: 100vh; text-align:center;\";>Wähle mit bedacht, die Klasse kann nur alle 3 Monate gewechselt werden.<br>"; if(($USER['race_date']) > time()){ $seite .= "Die Klasse kann ab dem " . date( 'd.m.Y , H:i:s' ,($USER['race_date'])) . " wieder gewechselt werden.<br>"; } $seite .= "

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

    • oh didnt read carfully enout u forgot the second part of the sql.
      Display Spoiler

      ALTER TABLE `uni1_users` ADD(
      `race` TINYINT(4) NULL DEFAULT '0',
      `forscher` SMALLINT(6) NULL DEFAULT '0',
      `miner` SMALLINT(6) NULL DEFAULT '0',
      `krieger` SMALLINT(6) NULL DEFAULT '0',
      `haendler` SMALLINT(6) NULL DEFAULT '0',
      `race_date` INT(10) NULL DEFAULT '0'
      )


    • everything is their now

      but it get this...Issue: Undefined offset: 800
      File: /includes/pages/game/class.ShowRacePage.php (Line 56)

      Deine Klasse ist:<br> <img src=\"styles/theme/gow/img/rase". $USER['rase'] .".jpg\"> <br>" . $LNG['tech']['80'.$USER['race']];
    • öhm, seems like u changed $USER['race'] into $USER['rase']
      line 56:

      it has to be
      $USER['race']

      also in the path.

      but the error shown is cause u didnt have done step3 for ur language
      Display Spoiler
      3.open
      languages/de/TECH.php and add

      800 => 'Klassen',
      802 => 'Miner',
      803 => 'Krieger',
      801 => 'Forscher',
      804 => 'Händler',



      to line 182


      this has to be done for all languages
    • my bad i had to change it cuz on xterium the race is in their..... so i changed everthing to do with race to rase......sorry again for not mentioning it....ill double check but I'm sure it's all changed
    • hey i just uploaded version 1.9 (2moons), and i put race mod and followed all steps i changed nothing but i get this error

      Undefined offset: 800
      File: /includes/pages/game/ShowRacePage.class.php
      Line: 56