summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--world/map/npc/functions/global_event_handler.txt4
-rw-r--r--world/map/npc/functions/vault.txt15
2 files changed, 19 insertions, 0 deletions
diff --git a/world/map/npc/functions/global_event_handler.txt b/world/map/npc/functions/global_event_handler.txt
index dab56fde..690b0566 100644
--- a/world/map/npc/functions/global_event_handler.txt
+++ b/world/map/npc/functions/global_event_handler.txt
@@ -38,6 +38,10 @@ OnPCDieEvent:
set @killerrid, 0; // reset killer rid
end;
+OnPCLogoutEvent:
+ callfunc "VaultLogout";
+ end;
+
OnInit:
callfunc "ClearGlobalVars";
callfunc "MOTD"; // set the MOTD array
diff --git a/world/map/npc/functions/vault.txt b/world/map/npc/functions/vault.txt
index 1c08dba1..ee30863c 100644
--- a/world/map/npc/functions/vault.txt
+++ b/world/map/npc/functions/vault.txt
@@ -6,6 +6,7 @@
function|script|VaultLogin
{
if (##VAULT < 1) goto L_Return;
+ // TODO: Or #VAULT ? Which of the two is set?
callsub S_Exp;
callsub S_Gold;
@@ -170,3 +171,17 @@ L_Flush2:
return;
}
+function|script|VaultLogout
+{
+ if (##VAULT < 1) goto L_Return;
+ // TODO: Or #VAULT ? Which of the two is set?
+ set $@API_PROTOCOL, API_VAULT;
+ set $@API_DATA$, "'UID': "+##VAULT+", 'GID': "+getcharid(3);
+ callfunc "FlushAPI";
+
+ return;
+
+L_Return:
+ return;
+}
+