From 39390c8538825e15a00714fe4948ccc4170c313c Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 7 Sep 2019 21:11:02 -0300 Subject: Report town stats to town admin (money, tax, exports, reputation) --- npc/003-2/politics.txt | 2 +- npc/009-2/politics.txt | 2 +- npc/012-7/politics.txt | 2 +- npc/017-10/politics.txt | 2 +- npc/020-7-1/politics.txt | 2 +- npc/024-11/politics.txt | 2 +- npc/functions/politics.txt | 16 ++++++++++++++++ 7 files changed, 22 insertions(+), 6 deletions(-) diff --git a/npc/003-2/politics.txt b/npc/003-2/politics.txt index c262759da..9603aef46 100644 --- a/npc/003-2/politics.txt +++ b/npc/003-2/politics.txt @@ -12,7 +12,7 @@ do { mesc ".:: "+l("Tulimshar Townhall")+" ::.", 2; mesc l("Current Town Administrator: ")+$TULIM_MAYOR$, 3; - if (strcharinfo(0) == $TULIM_MAYOR$) mesc l("Town Money: @@", $TULIM_MONEY), 2; + POL_TownInfo("TULIM"); mesc l("Application fee: @@ GP", .applytax); next; select diff --git a/npc/009-2/politics.txt b/npc/009-2/politics.txt index 1170ebdc3..d848f3138 100644 --- a/npc/009-2/politics.txt +++ b/npc/009-2/politics.txt @@ -12,7 +12,7 @@ do { mesc ".:: "+l("Halinarzo Townhall")+" ::.", 2; mesc l("Current Town Administrator: ")+$HALIN_MAYOR$, 3; - if (strcharinfo(0) == $HALIN_MAYOR$) mesc l("Town Money: @@", $HALIN_MONEY), 2; + POL_TownInfo("HALIN"); mesc l("Application fee: @@ GP", .applytax); next; select diff --git a/npc/012-7/politics.txt b/npc/012-7/politics.txt index 271801694..451f70adf 100644 --- a/npc/012-7/politics.txt +++ b/npc/012-7/politics.txt @@ -12,7 +12,7 @@ do { mesc ".:: "+l("Hurnscald Townhall")+" ::.", 2; mesc l("Current Town Administrator: ")+$HURNS_MAYOR$, 3; - if (strcharinfo(0) == $HURNS_MAYOR$) mesc l("Town Money: @@", $HURNS_MONEY), 2; + POL_TownInfo("HURNS"); mesc l("Application fee: @@ GP", .applytax); next; select diff --git a/npc/017-10/politics.txt b/npc/017-10/politics.txt index 2b90b0266..744b03a86 100644 --- a/npc/017-10/politics.txt +++ b/npc/017-10/politics.txt @@ -12,7 +12,7 @@ do { mesc ".:: "+l("Land Of Fire Townhall")+" ::.", 2; mesc l("Current Town Administrator: ")+$LOF_MAYOR$, 3; - if (strcharinfo(0) == $LOF_MAYOR$) mesc l("Town Money: @@", $LOF_MONEY), 2; + POL_TownInfo("LOF"); mesc l("Application fee: @@ GP", .applytax); next; select diff --git a/npc/020-7-1/politics.txt b/npc/020-7-1/politics.txt index 7bf312945..a665c04ec 100644 --- a/npc/020-7-1/politics.txt +++ b/npc/020-7-1/politics.txt @@ -12,7 +12,7 @@ do { mesc ".:: "+l("Nivalis Townhall")+" ::.", 2; mesc l("Current Town Administrator: ")+$NIVAL_MAYOR$, 3; - if (strcharinfo(0) == $NIVAL_MAYOR$) mesc l("Town Money: @@", $NIVAL_MONEY), 2; + POL_TownInfo("NIVAL"); mesc l("Application fee: @@ GP", .applytax); next; select diff --git a/npc/024-11/politics.txt b/npc/024-11/politics.txt index 489d6b5d1..df755e651 100644 --- a/npc/024-11/politics.txt +++ b/npc/024-11/politics.txt @@ -12,7 +12,7 @@ do { mesc ".:: "+l("Frostia Townhall")+" ::.", 2; mesc l("Current Town Administrator: ")+$FROSTIA_MAYOR$, 3; - if (strcharinfo(0) == $FROSTIA_MAYOR$) mesc l("Town Money: @@", $FROSTIA_MONEY), 2; + POL_TownInfo("FROSTIA"); mesc l("Application fee: @@ GP", .applytax); next; select diff --git a/npc/functions/politics.txt b/npc/functions/politics.txt index 5679efa82..70fc08941 100644 --- a/npc/functions/politics.txt +++ b/npc/functions/politics.txt @@ -219,4 +219,20 @@ function script POL_Candidate { } +// Town info +// POL_TownInfo( TOWNCODE ) +function script POL_TownInfo { + .@MAYOR$=getd("$"+getarg(0)+"_MAYOR$"); + .@GP=getd("$"+getarg(0)+"_MONEY"); + .@TX=getd("$"+getarg(0)+"_TAX"); + .@EX=getd("$"+getarg(0)+"_EXPORT"); + .@RP=getd("$"+getarg(0)+"_REPUTATION"); + if (strcharinfo(0) == .@MAYOR$) { + mesc l("Town Money: @@", .@GP), 2; + mesc l("Town Reputation: @@ | @@.@@%% Tax", .@RP, .@TX/100, .@TX%100), 2; + mesc l("Town Weekly Exports: @@", .@EX), 2; + } + return; +} + -- cgit v1.2.3-60-g2f50