summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/003-3/malindou.txt45
-rw-r--r--npc/functions/siege.txt8
-rw-r--r--npc/functions/util.txt16
3 files changed, 67 insertions, 2 deletions
diff --git a/npc/003-3/malindou.txt b/npc/003-3/malindou.txt
index f2efd46ce..952ba67a8 100644
--- a/npc/003-3/malindou.txt
+++ b/npc/003-3/malindou.txt
@@ -418,6 +418,51 @@ OnInit:
debugmes "* Magic Class Removed";
debugmes "";
}
+ // Current UPDATE value: Sab Ago 24 17:42:24 -03 2019
+ // Political System
+ if ($UPDATE < 1566679344) {
+ $UPDATE=1566679344;
+ // $LOC_MAYOR$ - Stores the name of current Hurnscald Mayor
+ // $LOC_MONEY - Total money reserves of Hurnscald
+ // $LOC_TAX - How much in % is charged as taxes. (OnBuy income)
+ // $LOC_EXPORT - Defines how much Hurnscald exports (weekly income)
+ // $LOC_REPUTATION - Town reputation. Affects Max Tax and Weekly Income.
+
+ // Tulim
+ $TULIM_MAYOR$="Saulc";
+ $TULIM_TAX=100;
+ $TULIM_EXPORT=10000;
+ $TULIM_REPUTATION=50;
+ // Halin
+ $HALIN_MAYOR$="Saulc";
+ $HALIN_TAX=100;
+ $HALIN_EXPORT=1000;
+ $HALIN_REPUTATION=50;
+ // Hurns
+ $HURNS_MAYOR$="Saulc";
+ $HURNS_TAX=100;
+ $HURNS_EXPORT=3000;
+ $HURNS_REPUTATION=50;
+ // LoF
+ $LOF_MAYOR$="Jesus Saves";
+ $LOF_TAX=100;
+ $LOF_EXPORT=5000;
+ $LOF_REPUTATION=50;
+ // Nival
+ $NIVAL_MAYOR$="Jesus Saves";
+ $NIVAL_TAX=100;
+ $NIVAL_EXPORT=3000;
+ $NIVAL_REPUTATION=50;
+ // Frostia
+ $FROSTIA_MAYOR$="Jesus Saves";
+ $FROSTIA_TAX=100;
+ $FROSTIA_EXPORT=1000;
+ $FROSTIA_REPUTATION=50;
+
+ debugmes "";
+ debugmes "* Political System Base";
+ debugmes "";
+ }
diff --git a/npc/functions/siege.txt b/npc/functions/siege.txt
index 98a600dc8..6acdeb359 100644
--- a/npc/functions/siege.txt
+++ b/npc/functions/siege.txt
@@ -191,14 +191,18 @@ function script siege_check {
.@mb+=mobcount(.@m$, "#SiegeCtrl::OnColonelDeath");
.@mb+=mobcount(.@m$, "#SiegeCtrl::OnGeneralDeath");
- // Players failed, so reduce score in 1~10 (like Sergeant~General).
+ // Players failed, so reduce score in 1~5 (like Sergeant~General).
// In future, it could be inverse proportion (-9 for sergeant, -1 for general)
if (.@mb) {
if ($GAME_STORYLINE == 2)
- $MK_TEMPVAR-=rand2(1, 10);
+ $MK_TEMPVAR-=rand2(1, 5);
+
kamibroadcast("Players failed to defend the city!!");
debugmes "Number of boss grade monsters found: %d", .@mb;
$SIEGE_DIFFICULTY=max(1, ($SIEGE_DIFFICULTY/2));
+ // Lower the town reputation in 10%
+ .@var$="$"+MapToLoc(.@m$)+"_REPUTATION";
+ setd(.@var$, getd(.@var$)*9/10);
} else {
kamibroadcast("The city was defended with success! GG, everyone!");
$SIEGE_DIFFICULTY+=1;
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index 886dec447..c32a831e1 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -825,3 +825,19 @@ function script EnterTown {
return;
}
+// Convert map name to location id
+// MapToLoc( MapName )
+function script MapToLoc {
+ // Fill variable
+ .@v$=getarg(0);
+
+ // Validade variable, see npc/000-1/exit.txt first
+ setarray .@mapx$, "005-1", "003-1", "009-1", "012-1", "017-1", "018-5", "020-1", "024-1";
+ setarray .@locs$, "Candor", "Tulim", "Halin", "Hurns", "LoF", "Lilit", "Nival", "Frostia";
+ .@lx=array_find(.@locs$, .@v$);
+ if (.@lx < 0)
+ return Exception("Invalid map passed to MapToLoc: "+.@v$, RB_DEBUGMES);
+
+ return .@locs$[.@lx];
+}
+