From c096284e22d3949015127e19f2e462a8199bb51a Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 11 Jun 2018 19:46:25 -0300 Subject: Introduce #ADD_LVL, a special flag for when we need to give levels upon login. Introduce $UPDATE to keep Jesusalva aware of some misc server update stuff. --- npc/003-2/estard.txt | 3 +-- npc/003-3/malindou.txt | 16 +++++++++++++++- npc/functions/clientversion.txt | 27 +++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/npc/003-2/estard.txt b/npc/003-2/estard.txt index 3b4f63ca6..7c6e6717e 100644 --- a/npc/003-2/estard.txt +++ b/npc/003-2/estard.txt @@ -87,8 +87,7 @@ do { // Beta users by-pass check. - if (getskilllv(NV_BASIC) > 6 && !getq(General_Janus)) - { + if (getskilllv(NV_BASIC) > 6 && !getq(General_Janus)) { setq General_Janus, 1; } diff --git a/npc/003-3/malindou.txt b/npc/003-3/malindou.txt index ab8ff4321..06f376c08 100644 --- a/npc/003-3/malindou.txt +++ b/npc/003-3/malindou.txt @@ -3,7 +3,8 @@ // Saulc // Jesusalva // Notes: -// Also handle some PCLogin events: CheckClientVersion, and bank +// Tulim banker, and also handles PCLogin events: CheckClientVersion, and bank +// Take care of server updates, but instances are defined on their ships. 003-3,36,34,0 script Malindou NPC_LLOYD,{ Banker(.name$, "Tulimshar", 15000); @@ -12,6 +13,19 @@ OnInit: .sex = G_MALE; .distance = 4; + + // Update handler (use `date +%s` for this) + // Current UPDATE value: Qui Jun 7 08:10:55 -03 2018 + if ($UPDATE < 1528369855) { + $UPDATE=gettimetick(2); + debugmes "Warning."; + debugmes "Warning."; + debugmes "Warning: This introduces a server update:"; + debugmes ""; + debugmes "* Please create the imported guild"; + debugmes ""; + } + end; OnPCLoginEvent: diff --git a/npc/functions/clientversion.txt b/npc/functions/clientversion.txt index c9d7752fd..48438e626 100644 --- a/npc/functions/clientversion.txt +++ b/npc/functions/clientversion.txt @@ -5,6 +5,7 @@ // Jesusalva // Description: // Function checking the client version and reports if it is too old. +// This also handles all updates, and usually have priority. function script checkclientversion { // Update handler (use `date +%s` for this) @@ -16,6 +17,32 @@ function script checkclientversion { mes col("Oh, noes! Due lack of translators, some languages were removed from this project.", 9); mes col("You might have been affected. Please, select your desired language.", 9); asklanguage(LANG_IN_SHIP); + if (!#ADD_LVL) + close; + } + // #ADD_LVL means the user have to right to get some levels. This is a sketch. The code might be deleted. + if (#ADD_LVL) { + mesn "Jesus Saves"; + mes col("Oh - Welcome to TMW2: Moubootaur Legends!", 3); + next; + mesn "Jesus Saves"; + mes col("Please, fell at home. You can use ##B#world##b channel to speak to everyone on Discord, IRC and ingame.", 3); + next; + mesn "Jesus Saves"; + mes col("Our mission statement is to bring fun to all players. You'll get some levels automatically. We advise you to join a guild.", 3); + next; + mesn "Jesus Saves"; + mes col("If you have any trouble or doubt, don't hesit to call us. There are some cooperative quests, and more of them are being added.", 3); + next; + mesn "Jesus Saves"; + mes col("Anyway, ##Bwelcome##b, and have fun! If you need anything, we are a keypress from distance!", 3); + atcommand "@blvl "+#ADD_LVL; + #ADD_LVL=0; + if (ClientVersion >= 24) close; + next; + mesn "Failsafe Mechanism"; + mes col("Ah... You must update your client first.", 1); + next; } if (ClientVersion >= 24) return; -- cgit v1.2.3-60-g2f50