Add T4 Hero Resource and some fix

Add T4 Hero Resource and some fix
This commit is contained in:
novgorodschi catalin
2026-07-24 08:34:50 +03:00
parent 1e19f117ca
commit 2e53094b48
20 changed files with 641 additions and 43 deletions
+14
View File
@@ -64,6 +64,20 @@ define('CLEANUP_BATCH', 5000);
// din atribute. 0 = dezactivata (comportamentul vechi).
define('HERO_BASE_REGEN', %HEROBASEREGEN%);
// Ratele casei de schimb din casa de licitatii:
// HERO_SILVER_PER_GOLD = cat argint primesti pentru 1 aur
// HERO_SILVER_TO_GOLD = cat argint costa 1 aur la schimbul invers
// Diferenta dintre ele este marja casei (ca in Travian: 1 aur -> 10 argint,
// dar 25 argint -> 1 aur).
define('HERO_SILVER_PER_GOLD', %HEROSILVERPERGOLD%);
define('HERO_SILVER_TO_GOLD', %HEROSILVERTOGOLD%);
// Atributul de erou "Resources" (T4): cate resurse produce un punct pe ora.
// ALL = cand bonusul e raspandit egal pe toate patru (implicit 3 din fiecare)
// ONE = cand e concentrat pe o singura resursa (implicit 10)
define('HERO_RES_PER_POINT_ALL', %HERORESALL%);
define('HERO_RES_PER_POINT_ONE', %HERORESONE%);
//////////////////////////////////
// ***** SERVER SETTINGS *****//
//////////////////////////////////
+24
View File
@@ -155,6 +155,30 @@ class Process {
if ($heroRegen > 100) { $heroRegen = 100; }
$findReplace["%HEROBASEREGEN%"] = $heroRegen;
// Ratele casei de schimb (aur <-> argint), din formularul de instalare.
$silverPerGold = isset($_POST['hero_silver_per_gold']) ? (int) $_POST['hero_silver_per_gold'] : 10;
$silverToGold = isset($_POST['hero_silver_to_gold']) ? (int) $_POST['hero_silver_to_gold'] : 25;
if ($silverPerGold < 1) { $silverPerGold = 1; }
if ($silverPerGold > 10000) { $silverPerGold = 10000; }
if ($silverToGold < 1) { $silverToGold = 1; }
if ($silverToGold > 10000) { $silverToGold = 10000; }
$findReplace["%HEROSILVERPERGOLD%"] = $silverPerGold;
$findReplace["%HEROSILVERTOGOLD%"] = $silverToGold;
// Atributul de erou "Resources": cate resurse da un punct pe ora.
$resAll = isset($_POST['hero_res_all']) ? (int) $_POST['hero_res_all'] : 3;
$resOne = isset($_POST['hero_res_one']) ? (int) $_POST['hero_res_one'] : 10;
if ($resAll < 0) { $resAll = 0; }
if ($resAll > 10000) { $resAll = 10000; }
if ($resOne < 0) { $resOne = 0; }
if ($resOne > 10000) { $resOne = 10000; }
$findReplace["%HERORESALL%"] = $resAll;
$findReplace["%HERORESONE%"] = $resOne;
$findReplace["%DOMAIN%"] = $_POST['domain'];
$findReplace["%HOMEPAGE%"] = $_POST['homepage'];
$findReplace["%SERVER%"] = $_POST['server'];
+4
View File
@@ -310,6 +310,10 @@ foreach($mechs as $k => $l){
<div><label>Delete chat messages after (days)</label><input class="input" name="cleanup_chat" id="cleanup_chat" value="7"></div>
<div><label>Delete messages erased by both sides (days)</label><input class="input" name="cleanup_messages" id="cleanup_messages" value="0"></div>
<div><label>Hero base regeneration (HP/day)</label><input class="input" name="hero_base_regen" id="hero_base_regen" value="10"></div>
<div><label>Silver received per 1 gold</label><input class="input" name="hero_silver_per_gold" id="hero_silver_per_gold" value="10"></div>
<div><label>Silver needed for 1 gold</label><input class="input" name="hero_silver_to_gold" id="hero_silver_to_gold" value="25"></div>
<div><label>Hero resources per point (all four)</label><input class="input" name="hero_res_all" id="hero_res_all" value="3"></div>
<div><label>Hero resources per point (single type)</label><input class="input" name="hero_res_one" id="hero_res_one" value="10"></div>
</div>
<div class="f10" style="margin-top:8px;opacity:.75;">
Automation runs from cron.php instead of players' page loads. One cron invocation keeps working for