here I spread the mode of endless purchases of bonus resources, it is compatible with the versions 1,7,3 1,8-1,9
Mod resource bonus
This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.
-
-
for 1.7
create a file
class.ShowResPage.php
PHP Source Code: class.ShowResPage.php
- <?php
- class ShowResPage extends AbstractPage
- {
- function __construct()
- {
- global $USER;
- parent::__construct();
- }
- function show()
- {
- global $USER ,$LNG,$PLANET;
- $modo = HTTP::_GP('modo', '', UTF8_SUPPORT);
- $id = HTTP::_GP('id',0);
- if($USER['darkmatter'] <= 10000) {
- $resto = 10000 - $USER['darkmatter'];
- $this->printMessage("No, no! You do not have enough dark matter to do business with me! Come back when you have. ".$resto." unit dark matter!");
- exit;
- }elseif($modo == "ricevi"){
- $USER['darkmatter'] -= 10000;
- $PLANET['metal'] += 50000000;
- $PLANET['deuterium'] += 20000000;
- $PLANET['crystal'] += 35000000;
- $this->printMessage("The Agreement with Graferex was successfull you recieve: <br><li>Metal: 50.000.000</li>
- <li>Crystal: 35.000.000</li>
- <li>Deuterium: 20.000.000</li>", true, array("game.php?page=res", 3));
- }else{
- $this->tplObj->assign_vars(array(
- 'USERNAME'=> $USER['username'],
- ));
- $this->display('res.tpl');
- }
- }
- private function redirectToHome()
- {
- $this->redirectTo('game.php?page=res');
- }
- }
res.tpl
Smarty-Template: res.tpl
- {block name="title" prepend}Res{/block}
- {block name="content"}
- <table style="width:650px">
- <tbody><tr>
- <th colspan="2">
- Resource Pack
- </th>
- </tr><tr>
- <td><img src="styles/theme/gow/img/mercado.png" width="650px" height="298px"></td></tr>
- <td style="text-align:left;">
- Hello Emperor <font color="lime"><b>{$USERNAME}</b></font>! Today is your lucky day! I introduce myself, I am far orgini Graferex a merchant in exchange for Dark Matter I can offer you huge amounts of resources, want to buy something? <br><br>For <b><font color=red>10.000</font></b> units of dark matter you can buy:<br>
- <br>
- <center><li>Metal: <font color=red>50.000.000</font></li>
- <li>Crystal: <font color=red>35.000.000</font></li>
- <li>Deuterium: <font color=red>20.000.000</font></li>
- <ul>
- </ul></center>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <form action="game.php?page=res&modo=ricevi" method="POST">
- <input type="submit" class="buttona" name="risorse" value="Buy Resources">
- </form>
- </td>
- </tr>
- </tbody><th colspan="1" style="text-align:center"></table>{/block}
main.navigation.tpl
jquery.countdown.js
JavaScript Source Code: jquery.coundown.js
- /* jQuery countdown plugin
- * version 1.0 (12/01/2008)
- * developed by Alessandro Feijdz?
- * alef@feijo.pro.br
- * format_interval fn based on drupal homonym function
- */
- (function($) {
- var vInt=0; // this variable controls the loop
- var refresh=1; // refresh when a time finish
- var interval=1000; // the loop interval
- // this function autostarts the infinite loop, every second, triggers the countdown fn
- jQuery.autocountdown = function () {
- $('.countdown2').countdown2(); // trigger the fn
- vInt=setInterval("$('.countdown2').countdown2();", interval); // set the loop
- }
- // countdown function, update second-by-second the time to finish
- jQuery.fn.countdown2 = function (options) {
- var defaults = { // set up default options
- refresh: 1, // refresh when a time finish
- interval: 1000, // the loop interval
- cdClass: 'countdown2', // the class to apply this plugin
- granularity: 4,
- label: ['w ', 'd ', 'h', 'm:', ''],
- units: [604800, 86400, 3600, 60, 1]
- };
- if (options && options.label) {
- $.extend(defaults.label, options.label);
- delete options.label;
- }
- if (options && options.units) {
- $.extend(defaults.units, options.units);
- delete options.units;
- }
- $.extend(defaults, options);
- // pad fn, add left zeros to the string
- var pad = function (value, length) {
- value = String(value);
- length = parseInt(length) || 2;
- while (value.length < length)
- value = "0" + value;
- if (value<1) value = "00";
- return value;
- };
- var format_interval = function (timestamp) {
- var label = defaults.label;
- var units = defaults.units;
- var granularity = defaults.granularity;
- output = '';
- for (i=1; i<=units.length; i++) {
- value=units[i];
- if (timestamp >= value) {
- var val=pad(Math.floor(timestamp / value), 2);
- val = val>0 ? val : '00';
- output += val + label[i];
- timestamp %= value;
- granularity--;
- }
- else if (value==1) output += '00'; // we need the final seconds to allways show 00, i.e., 03:00
- if (granularity == 0)
- break;
- }
- if (output.length<3) output = '00:'+output;
- return output ? output : '00:00';
- }
- // the countdown core
- return this.each(function() {
- secs=$(this).attr('secs');
- $(this).html(format_interval(secs));
- secs--;
- if (secs<1) {
- $(this).attr('secs', '...');
- clearInterval(vInt);
- if (refresh)
- window.location.href = window.location.href;
- } else
- $(this).attr('secs', secs);
- });
- }
- $.autocountdown(); // loop
- })(jQuery);
-
for 1.8-1,9
create a file
ShowResPage.class.php
PHP Source Code
- <?php
- class ShowResPage extends AbstractGamePage
- {
- function __construct()
- {
- global $USER;
- parent::__construct();
- }
- function show()
- {
- global $USER ,$LNG,$PLANET;
- $modo = HTTP::_GP('modo', '', UTF8_SUPPORT);
- $id = HTTP::_GP('id',0);
- if($USER['darkmatter'] <= 10000) {
- $resto = 10000 - $USER['darkmatter'];
- $this->printMessage("No, no! You do not have enough dark matter to do business with me! Come back when you have. ".$resto." unit dark matter!");
- exit;
- }elseif($modo == "ricevi"){
- $USER['darkmatter'] -= 10000;
- $PLANET['metal'] += 50000000;
- $PLANET['deuterium'] += 20000000;
- $PLANET['crystal'] += 35000000;
- $this->printMessage("The Agreement with Graferex was successfull you recieve: <br><li>Metal: 50.000.000</li>
- <li>Crystal: 35.000.000</li>
- <li>Deuterium: 20.000.000</li>", true, array("game.php?page=res", 3));
- }else{
- $this->tplObj->assign_vars(array(
- 'USERNAME'=> $USER['username'],
- ));
- $this->display('res.tpl');
- }
- }
- private function redirectToHome()
- {
- $this->redirectTo('game.php?page=res');
- }
- }
then create a file
Source Code
- res.tpl
- {block name="title" prepend}Res{/block}
- {block name="content"}
- <table style="width:650px">
- <tbody><tr>
- <th colspan="2">
- Resource Pack
- </th>
- </tr><tr>
- <td><img src="styles/theme/gow/img/mercado.png" width="650px" height="298px"></td></tr>
- <td style="text-align:left;">
- Hello Emperor <font color="lime"><b>{$USERNAME}</b></font>! Today is your lucky day! I introduce myself, I am far orgini Graferex a merchant in exchange for Dark Matter I can offer you huge amounts of resources, want to buy something? <br><br>For <b><font color=red>10.000</font></b> units of dark matter you can buy:<br>
- <br>
- <center><li>Metal: <font color=red>50.000.000</font></li>
- <li>Crystal: <font color=red>35.000.000</font></li>
- <li>Deuterium: <font color=red>20.000.000</font></li>
- <ul>
- </ul></center>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <form action="game.php?page=res&modo=ricevi" method="POST">
- <input type="submit" class="buttona" name="risorse" value="Buy Resources">
- </form>
- </td>
- </tr>
- </tbody><th colspan="1" style="text-align:center"></table>{/block}
- then
- main.navigation.tpl
- <li><a href="game.php?page=res"style="color:lime">Buy Resources</a></li>
- and script
- jquery.countdown.js
- /* jQuery countdown plugin
- * version 1.0 (12/01/2008)
- * developed by Alessandro Feijdz?
- * alef@feijo.pro.br
- * format_interval fn based on drupal homonym function
- */
- (function($) {
- var vInt=0; // this variable controls the loop
- var refresh=1; // refresh when a time finish
- var interval=1000; // the loop interval
- // this function autostarts the infinite loop, every second, triggers the countdown fn
- jQuery.autocountdown = function () {
- $('.countdown2').countdown2(); // trigger the fn
- vInt=setInterval("$('.countdown2').countdown2();", interval); // set the loop
- }
- // countdown function, update second-by-second the time to finish
- jQuery.fn.countdown2 = function (options) {
- var defaults = { // set up default options
- refresh: 1, // refresh when a time finish
- interval: 1000, // the loop interval
- cdClass: 'countdown2', // the class to apply this plugin
- granularity: 4,
- label: ['w ', 'd ', 'h', 'm:', ''],
- units: [604800, 86400, 3600, 60, 1]
- };
- if (options && options.label) {
- $.extend(defaults.label, options.label);
- delete options.label;
- }
- if (options && options.units) {
- $.extend(defaults.units, options.units);
- delete options.units;
- }
- $.extend(defaults, options);
- // pad fn, add left zeros to the string
- var pad = function (value, length) {
- value = String(value);
- length = parseInt(length) 2;
- while (value.length < length)
- value = "0" + value;
- if (value<1) value = "00";
- return value;
- };
- var format_interval = function (timestamp) {
- var label = defaults.label;
- var units = defaults.units;
- var granularity = defaults.granularity;
- output = '';
- for (i=1; i<=units.length; i++) {
- value=units;
- if (timestamp >= value) {
- var val=pad(Math.floor(timestamp / value), 2);
- val = val>0 ? val : '00';
- output += val + label[i];
- timestamp %= value;
- granularity--;
- }
- else if (value==1) output += '00'; // we need the final seconds to allways show 00, i.e., 03:00
- if (granularity == 0)
- break;
- }
- if (output.length<3) output = '00:'+output;
- return output ? output : '00:00';
- }
- // the countdown core
- return this.each(function() {
- secs=$(this).attr('secs');
- $(this).html(format_interval(secs));
- secs--;
- if (secs<1) {
- $(this).attr('secs', '...');
- clearInterval(vInt);
- if (refresh)
- window.location.href = window.location.href;
- } else
- $(this).attr('secs', secs);
- });
- }
- $.autocountdown(); // loop
- })(jQuery);
-
-
works great thanks
-
can you add energy to it?
-
this is cool..but the script want a pic called mercado.png
can you attach it? -
i just downloaded a pic and named it
styles/theme/gow/img/mercado.png" -
ok thanks, then i have a look
-
The energy here can still be leprechaun
-
Share
- Facebook 0
- Twitter 0
- Google Plus 0
- Reddit 0