summaryrefslogtreecommitdiff
path: root/npc/commands/motd.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/commands/motd.txt')
-rw-r--r--npc/commands/motd.txt120
1 files changed, 77 insertions, 43 deletions
diff --git a/npc/commands/motd.txt b/npc/commands/motd.txt
index 9b51ecbc3..5e4778b2d 100644
--- a/npc/commands/motd.txt
+++ b/npc/commands/motd.txt
@@ -1,12 +1,11 @@
+// TMW2 Script
function script displayMOTD {
.@size = getvariableofnpc(.size, "@motd");
.@dsize = getvariableofnpc(.dsize, "@motd");
// git stuff and such
- if (debug)
- {
- for (.@i = 0; .@i < .@dsize; ++.@i)
- {
+ if (debug) {
+ for (.@i = 0; .@i < .@dsize; ++.@i) {
dispbottom $@Debug_Messages$[.@i]; // FIXME: send this to the Debug tab instead
}
@@ -15,8 +14,7 @@ function script displayMOTD {
}
// generic MOTD
- for (.@i = 0; .@i < .@size; ++.@i)
- {
+ for (.@i = 0; .@i < .@size; ++.@i) {
dispbottom $MOTD_Messages$[.@i];
}
@@ -35,8 +33,7 @@ function script MOTDConfig {
mes l("Please enter the new line.");
input .@s$;
.@s$ = strip(.@s$);
- if (.@s$ != "")
- {
+ if (.@s$ != "") {
.@size = getvariableofnpc(.size, "@motd");
$MOTD_Messages$[.@size] = .@s$;
set getvariableofnpc(.size, "@motd"), getarraysize($MOTD_Messages$);
@@ -80,8 +77,7 @@ function script MOTDConfig {
next;
input .@s$;
.@s$ = strip(.@s$);
- if (.@s$ != "")
- {
+ if (.@s$ != "") {
$MOTD_Messages$[.@l] = .@s$;
logmes "MOTD modified: line edited", LOGMES_ATCOMMAND;
}
@@ -94,8 +90,7 @@ function script MOTDConfig {
mes l("Enter line number:");
next;
input .@n;
- if ($MOTD_Messages$[.@n] != "")
- {
+ if ($MOTD_Messages$[.@n] != "") {
clear;
mes l("line @@: @@", .@n, $MOTD_Messages$[.@n]);
next;
@@ -107,8 +102,7 @@ function script MOTDConfig {
rif(.@n < .@max, menuimage("actions/lower", l("Move this line down"))),
menuimage("actions/home", l("Return to main menu"));
- switch (@menu)
- {
+ switch (@menu) {
case 2: removeLine .@n; return;
case 3: editLine .@n; return;
case 4: moveUp .@n; return;
@@ -128,12 +122,10 @@ function script MOTDConfig {
mes "---";
.@size = getvariableofnpc(.size, "@motd");
- for (.@i = 0; .@i < .@size; ++.@i)
- {
+ for (.@i = 0; .@i < .@size; ++.@i) {
mes l("line @@: @@", .@i, $MOTD_Messages$[.@i]);
}
- if (.@size == 0)
- {
+ if (.@size == 0) {
mes "(" + l("no active MOTD") + ")";
}
mes "---";
@@ -146,14 +138,15 @@ function script MOTDConfig {
menuimage("actions/add", l("Add a new line")),
rif(.@size, menuimage("actions/manage", l("Modify, move, or remove a line"))),
rif(.@size, menuimage("actions/test", l("Test MOTD"))),
- rif(getarg(0,0), menuimage("actions/home", l("Return to Super Menu")));
+ rif(getarg(0,0), menuimage("actions/home", l("Return to Super Menu"))),
+ rif(!getarg(0,0), menuimage("actions/home", l("Close")));
- switch (@menu)
- {
+ switch (@menu) {
case 1: toggleMOTD; break;
case 2: addNewLine; break;
case 3: modifyLine .@size; break;
case 4: displayMOTD; break;
+ case 6: close; break;
default: return;
}
} while (1);
@@ -165,8 +158,7 @@ function script MOTDConfig {
end;
OnCall:
- if (!is_admin())
- {
+ if (!is_admin()) {
end;
}
@@ -175,16 +167,25 @@ OnCall:
end;
OnPCLoginEvent:
- if ($MOTD_Disabled < 1)
- {
+ if ($MOTD_Disabled < 1) {
displayMOTD;
}
- if (debug)
- {
+ if (debug) {
dispbottom "##7<<##B @@help://test-server|" + col(l("Click here for instructions on how to use the test server."),6) + "@@ ##7>>";
}
// Handle daily login bonus
+ // The Strange Coin output wasn't changed, but now it relies on streaks.
+ // Variables:
+ // #LOGIN_DAY
+ // Current day
+ // #LOGIN_TABLE
+ // Current month
+ // #LOGIN_STREAK
+ // Number of monthly connections
+ // #LOGIN_ALLTIME
+ // Number of times you claimed the top prize (27 days streak)
+
if (#LOGIN_DAY != .login_ref) {
// Is it a new month?
if (#LOGIN_TABLE == gettime(6)) {
@@ -197,31 +198,64 @@ OnPCLoginEvent:
// Update last day you've claimed a reward
#LOGIN_DAY = .login_ref;
- // Handle rewards: Streaks first, daily later. Streak reward overrides daily reward.
+ // Handle rewards: Streaks first, daily later. Streak reward prevail over daily reward.
if (#LOGIN_STREAK > 27) {
getitem StrangeCoin, 2;
- dispbottom l("##2 @@ Days login bonus: ##B2x @@##b", #LOGIN_STREAK, getitemlink(StrangeCoin));
+ getitem CasinoCoins, 1;
+ dispbottom l("##2 @@ Days login bonus: ##B2x @@, 1x @@##b", #LOGIN_STREAK, getitemlink(StrangeCoin), getitemlink(CasinoCoins));
} else if (#LOGIN_STREAK == 27) {
- getitem RightEyePatch, 1;
- dispbottom l("##2 27 Days login bonus: ##B1x @@##b", getitemlink(RightEyePatch)); // TODO placeholder
+ #LOGIN_ALLTIME+=1;
+ // Your prize is based on season
+ switch (season()) {
+ case AUTUMN:
+ .@prize=ElixirOfLife; break;
+ case WINTER:
+ .@prize=SilverGift; break;
+ case SPRING:
+ .@prize=Toothbrush; break;
+ case SUMMER:
+ .@prize=RightEyePatch; break;
+ }
+ // Some special cases
+ if (#LOGIN_ALLTIME == 3)
+ .@prize=GoldenGift;
+ if (#LOGIN_ALLTIME == 8)
+ .@prize=PrismGift;
+
+ if (#LOGIN_ALLTIME == 12) {
+ dispbottom l("CONGRATULATIONS! For a year worth of logins, you're getting a pet!");
+ makepet Piou; // we must replace this before August 2019. (r18 probably)
+ }
+
+ getitem .@prize, 1;
+ dispbottom l("##2 27 Days login bonus: ##B1x @@##b", getitemlink(.@prize));
} else if (#LOGIN_STREAK == 21) {
- getitem StrangeCoin, 3;
- dispbottom l("##2 21 Days login bonus: ##B3x @@##b", getitemlink(StrangeCoin));
+ getitem StrangeCoin, 7;
+ dispbottom l("##2 21 Days login bonus: ##B7x @@##b", getitemlink(StrangeCoin));
} else if (#LOGIN_STREAK == 14) {
- getitem StrangeCoin, 2;
- dispbottom l("##2 14 Days login bonus: ##B2x @@##b", getitemlink(StrangeCoin));
+ getitem StrangeCoin, 5;
+ dispbottom l("##2 14 Days login bonus: ##B5x @@##b", getitemlink(StrangeCoin));
} else if (#LOGIN_STREAK == 7) {
- getexp 0, max(20, rand(0, #LOGIN_STREAK));
- dispbottom l("##2 7 Days login bonus: ##B@@ Job Exp.##b", max(20, rand(0, #LOGIN_STREAK)));
- } else if (.login_ref % 3 == 0) {
+ getitem StrangeCoin, 2;
+ dispbottom l("##2 7 Days login bonus: ##B2x @@##b", getitemlink(StrangeCoin));
+ } else if (#LOGIN_STREAK == 3) {
getitem StrangeCoin, 1;
- dispbottom l("##2Daily login bonus: ##B1x @@##b", getitemlink(StrangeCoin));
+ dispbottom l("##2 3 Days login bonus: ##B1x @@##b", getitemlink(StrangeCoin));
+ } else if (.login_ref % 3 == 0) {
+ .@value=max(5, rand(0, (#LOGIN_STREAK/4)));
+ .@value+=(BaseLevel**2);
+ getexp .@value, 0;
+ dispbottom l("##2Daily login bonus: ##B@@ EXP##b", .@value);
} else if (.login_ref % 3 == 1) {
- set Zeny, Zeny+max(20, rand(0, (#LOGIN_STREAK*2)));
- dispbottom l("##2Daily login bonus: ##B@@ GP##b", str( max(20, rand(0, (#LOGIN_STREAK*2))) ) );
+ .@value=max(20, rand(0, (#LOGIN_STREAK*2)));
+ .@value+=(BaseLevel+JobLevel);
+ Zeny=Zeny+.@value;
+ dispbottom l("##2Daily login bonus: ##B@@ GP##b", .@value);
} else {
- getexp 0, max(5, rand(0, (#LOGIN_STREAK/4)));
- dispbottom l("##2Daily login bonus: ##B@@ Job Exp.##b", max(5, rand(0, (#LOGIN_STREAK/4))));
+ .@value=max(5, rand(0, (#LOGIN_STREAK/4)));
+ .@value+=(JobLevel**2);
+ getexp 0, .@value;
+ dispbottom l("##2Daily login bonus: ##B@@ Job Exp.##b", .@value);
}
}