diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-08-25 17:47:17 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-08-25 17:47:17 -0300 |
commit | 0ab1372918eb9dfe07378479dd49c7b0f8068272 (patch) | |
tree | 5592ae0a6bda23e6293d5b845d0685c11961d789 /npc | |
parent | 3244911fd8773f284c44d1fcfc2527e33accf142 (diff) | |
download | serverdata-0ab1372918eb9dfe07378479dd49c7b0f8068272.tar.gz serverdata-0ab1372918eb9dfe07378479dd49c7b0f8068272.tar.bz2 serverdata-0ab1372918eb9dfe07378479dd49c7b0f8068272.tar.xz serverdata-0ab1372918eb9dfe07378479dd49c7b0f8068272.zip |
Send Town Administrators salary based on reputation and exports.
It would be nice if you could get some tax money, no? %%a
Diffstat (limited to 'npc')
-rw-r--r-- | npc/functions/main.txt | 7 | ||||
-rw-r--r-- | npc/functions/politics.txt | 36 |
2 files changed, 42 insertions, 1 deletions
diff --git a/npc/functions/main.txt b/npc/functions/main.txt index e1b93fa46..b54401e02 100644 --- a/npc/functions/main.txt +++ b/npc/functions/main.txt @@ -330,6 +330,13 @@ function script gf_accid { return .@value[0]; } +// Get some char id, even if offline +// ( Name ) +function script gf_charnameid { + .@nb = query_sql("SELECT char_id FROM `char` WHERE name='"+escape_sql(getarg(0))+"' LIMIT 2", .@value); + return .@value[0]; +} + // Get some char name from char ID, even if offline // ( Name ) function script gf_charname { diff --git a/npc/functions/politics.txt b/npc/functions/politics.txt index f9df9e575..9349a6990 100644 --- a/npc/functions/politics.txt +++ b/npc/functions/politics.txt @@ -42,14 +42,48 @@ function script PurchaseTaxes { - script Politics NPC_HIDDEN,{ -// Weekly income OnSun0000: + // Weekly income $TULIM_MONEY+=$TULIM_EXPORT*limit(0, $TULIM_REPUTATION, 100)/100; $HALIN_MONEY+=$HALIN_EXPORT*limit(0, $HALIN_REPUTATION, 100)/100; $HURNS_MONEY+=$HURNS_EXPORT*limit(0, $HURNS_REPUTATION, 100)/100; $LOF_MONEY+=$LOF_EXPORT*limit(0, $LOF_REPUTATION, 100)/100; $NIVAL_MONEY+=$NIVAL_EXPORT*limit(0, $NIVAL_REPUTATION, 100)/100; $FROSTIA_MONEY+=$FROSTIA_EXPORT*limit(0, $FROSTIA_REPUTATION, 100)/100; + + // Send salary to Town Administrators (20% from exports and 5GP/reputation) + .@tax=$TULIM_EXPORT*limit(0, $TULIM_REPUTATION, 100)/500; + .@tax+=$TULIM_REPUTATION*5; + .@tax=min($TULIM_MONEY, .@tax); + rodex_sendmail(gf_charnameid($TULIM_MAYOR$), "Tulimshar Townhall", "Term Income", "You've received the money for the term.", .@tax); + + .@tax=$HALIN_EXPORT*limit(0, $HALIN_REPUTATION, 100)/500; + .@tax+=$HALIN_REPUTATION*5; + .@tax=min($HALIN_MONEY, .@tax); + rodex_sendmail(gf_charnameid($HALIN_MAYOR$), "Halinarzo Townhall", "Term Income", "You've received the money for the term.", .@tax); + + .@tax=$HURNS_EXPORT*limit(0, $HURNS_REPUTATION, 100)/500; + .@tax+=$HURNS_REPUTATION*5; + .@tax=min($HURNS_MONEY, .@tax); + rodex_sendmail(gf_charnameid($HURNS_MAYOR$), "Hurnscald Townhall", "Term Income", "You've received the money for the term.", .@tax); + + .@tax=$LOF_EXPORT*limit(0, $LOF_REPUTATION, 100)/500; + .@tax+=$LOF_REPUTATION*5; + .@tax=min($LOF_MONEY, .@tax); + rodex_sendmail(gf_charnameid($LOF_MAYOR$), "LoF Townhall", "Term Income", "You've received the money for the term.", .@tax); + + .@tax=$NIVAL_EXPORT*limit(0, $NIVAL_REPUTATION, 100)/500; + .@tax+=$NIVAL_REPUTATION*5; + .@tax=min($NIVAL_MONEY, .@tax); + rodex_sendmail(gf_charnameid($NIVAL_MAYOR$), "Nivalis Townhall", "Term Income", "You've received the money for the term.", .@tax); + + .@tax=$FROSTIA_EXPORT*limit(0, $FROSTIA_REPUTATION, 100)/500; + .@tax+=$FROSTIA_REPUTATION*5; + .@tax=min($FROSTIA_MONEY, .@tax); + rodex_sendmail(gf_charnameid($FROSTIA_MAYOR$), "Frostia Townhall", "Term Income", "You've received the money for the term.", .@tax); + + // Conduct elections + end; } |