summaryrefslogtreecommitdiff
path: root/world/map/npc/functions/vault.txt
diff options
context:
space:
mode:
authorJesusalva Jesusalva <jesusalva@themanaworld.org>2023-07-10 16:51:31 +0000
committerLed Mitz <smoothshifter@tuta.io>2023-07-10 16:51:31 +0000
commit0a6997d3c17a812ac966782ef5d6b46ebd2ea889 (patch)
treeaefbb07507d8541dfc61e29398aaf2f022d02ac3 /world/map/npc/functions/vault.txt
parent759d091d696aa0e67645405e5017ca2fed709abf (diff)
downloadserverdata-0a6997d3c17a812ac966782ef5d6b46ebd2ea889.tar.gz
serverdata-0a6997d3c17a812ac966782ef5d6b46ebd2ea889.tar.bz2
serverdata-0a6997d3c17a812ac966782ef5d6b46ebd2ea889.tar.xz
serverdata-0a6997d3c17a812ac966782ef5d6b46ebd2ea889.zip
Some missing functions
Diffstat (limited to 'world/map/npc/functions/vault.txt')
-rw-r--r--world/map/npc/functions/vault.txt73
1 files changed, 70 insertions, 3 deletions
diff --git a/world/map/npc/functions/vault.txt b/world/map/npc/functions/vault.txt
index a0da16b1..f2c51387 100644
--- a/world/map/npc/functions/vault.txt
+++ b/world/map/npc/functions/vault.txt
@@ -6,12 +6,18 @@
function|script|VaultLogin
{
if (##VAULT < 1) goto L_Return;
- // TODO: Or #VAULT ? Which of the two is set?
+ // Imports & Vitals
callsub S_Exp;
callsub S_Gold;
callsub S_Preset;
+ // Quest Handlers
+ callsub S_Quest_CR1;
+
+ // Mirror lake
+ callsub S_MirrorLake;
+
// Clean up
set @last_preset, 0;
return; // go back to global handler
@@ -43,6 +49,7 @@ S_Preset:
// TODO: Give more ammo, iron powder, sulphur powder, etc. instead of equips
// Give also some bug legs and maggot slime if applicable?
/* Handle weapons */
+ /*
if (##PRESET >= 1 && @last_preset < 1)
getitem "SharpKnife",1;
if (##PRESET >= 2 && @last_preset < 2)
@@ -83,14 +90,55 @@ S_Preset:
getitem "IronPowder", 150;
if (##PRESET >= 19 && @last_preset < 19)
getitem "TerraniteArrow",250;
-
+ */
set ##PRESET, 0;
return;
+
+////////////////////////////////
+S_Quest_CR1:
+ if (!(##01_CRQUEST & 1)) goto S_Return;
+ if (##03_TMWWORLD & MLP_CR_DEBUT) goto S_Return;
+ // Check if you can receive the rewards
+ getinventorylist;
+ if (@inventorylist_count >= 96) goto S_Return;
+ // Mark quest as done and issue rewards
+ set BOSS_POINTS, BOSS_POINTS + 871;
+ set ##03_TMWWORLD, ##03_TMWWORLD | MLP_CR_DEBUT;
+ getitem WhiteCake, 1;
+ getitem ChocolateCake, 1;
+ getitem OrangeCake, 1;
+ getitem AppleCake, 1;
+ message strcharinfo(0), "Mirror Lake : You gained 871 boss points.";
+ return;
+
+////////////////////////////////
+S_MirrorLake:
+ // Wipe any existing TMWA internal mirror lake information
+ set ##VAULT_GOTO, 0;
+ set ##VAULT_MLTO, 0;
+ // TODO: Put the Mirror Lake Portal into the shipwreck? (see portal #2)
+ set .@gto, call("get_byte", ##00_INFO, 3);
+ set .@mlp, call("get_nibble", ##00_INFO, 5);
+ // If we're moving from Mirror Lake to TMW
+ if (.@gto != WORLD_ID) goto S_MirrorFix;
+ debugmes "Vault User "+##VAULT+" moved to lake "+.@mlp;
+ if (.@mlp == 1) warp "013-2", 37, 23; // Hurnscald Mirror Lake
+ if (.@mlp == 2) warp "002-1", 30, 58; // Tulimshar Mirror Lake
+ // Unset the target lake/world
+ void call("set_byte", ##00_INFO, 3, 0);
+ void call("set_nibble", ##00_INFO, 5, 0);
+ return;
+
+// We've moved to the wrong world, so preserve it.
+S_MirrorFix:
+ set ##VAULT_GOTO, call("get_byte", ##00_INFO, 3);
+ set ##VAULT_MLTO, call("get_nibble", ##00_INFO, 5);
+ return;
}
// Remember: ##VAULT_EXP, ##VAULT_GOTO, ##VAULT_MLTO for Mirror Lake Protocol
-// However, without kick(7), it is not really worth anything
+// However, without kick(7), it is not really worth anything - so I presumed 7
// Remember: Quote symbols are illegal, simple or double, except for parameter
// To reset the database:
// cleararray $EXPORT_DATA$[0], "", 254;
@@ -161,3 +209,22 @@ L_Return:
return;
}
+// MirrorLakeSendTo(World)
+function|script|MirrorLakeSendTo
+{
+ if (##VAULT < 1) goto L_Return;
+ set ##VAULT_GOTO, getarg(0);
+ // This is TMWA - so it'll always use Lake #0 for performance reasons
+ set $@API_PROTOCOL, API_VAULT;
+ set $@API_DATA$, "'UID': "+##VAULT+", 'GID': "+getcharid(3);
+ callfunc "FlushAPI";
+ message strcharinfo(0), "Darkness fills your vision...";
+ // TODO: Misc effects
+ // TODO: Sleep for 10~15 seconds (for mapreg)
+ // TODO: Disconnect user
+ return;
+
+L_Return:
+ return;
+}
+