1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
// TMW-2 Script
// Author:
// Jesusalva
// Description:
// Vault Utilities
function script getvaultid {
// FIXME: Make this False
if (debug || !debug)
return ##VAULT;
else
return 0;
}
function script getvaultexp {
.@exp=getarg(0);
if (.@exp > 100)
Exception("ILLEGAL VAULT EXPERIENCE, FIXME URGENTLY. STOPPING SCRIPT BY FORCE WHILE DOING NOTHING.",
RB_DEBUGMES | RB_IRCBROADCAST | RB_GLOBALANNOUNCE | RB_ISFATAL);
if (getvaultid()) {
##VAULT_EXP+=.@exp;
debugmes("Granting %d Soul Exp to %d under Jande's authority.",
.@exp, ##VAULT);
}
return;
}
function script vaultOnLogin {
// Mirror Lake functionality
if (getvaultid() && !getstatus(SC_JAILED)) {
.@gto=get_byte(##00_INFO, 3);
.@mlp=get_nibble(##00_INFO, 5);
// Work only on new chars, or chars which cleared Tulimshar.
if (.@gto == WORLD_ID) {
// Warp to the proper Mirror Lake
switch (.@mlp) {
//case 1: somewhere
default: warp "013-2", 37, 23; LOCATION$ = "Hurns"; break;
}
// Send debug information
debugmes("Vault User %d moved to lake %d.", getvaultid(), .@mlp);
// Handle new user (non-native) accounts - automatic tutorial skip
if (QL_BEGIN < 8) {
if (!TUT_var) {
callfunc "GameRules";
next;
closeclientdialog;
adddefaultskills();
getitem Knife, 1;
getitem SlingShot, 1;
getitem SlingBullet, 500;
getitem HitchhikersTowel, 1;
getitem CottonShirt, 1;
getitem RaggedShorts, 1;
set Zeny, Zeny + 35; // tanisha gives 5 Zeny
equip(CottonShirt);
equip(RaggedShorts);
equip(Knife);
}
QL_BEGIN = 8;
dispbottom l("Mirror Lake : Obtain help with Sorfina in Candor.");
}
// Unset the target lake/world
set_byte(##00_INFO, 3, 0);
set_nibble(##00_INFO, 5, 0);
} else if (.@gto) {
// Heading somewhere which is not here!
mesc l("WARNING: If you use any Mirror Lake feature on this world, the current Mirror Lake Quest will be marked as \"Failed\"."), 1;
mesc l("If this is undesired, select the correct world, and if needed create a new char on it."), 1;
##VAULT_GOTO=.@gto;
##VAULT_MLTO=.@mlp;
next;
closeclientdialog;
}
}
return;
}
function script vaultOnLogout {
// Send updates to Vault API
if (getvaultid()) {
.@api$=json_encode("UID", ##VAULT,
"GID", getcharid(3),
"VAR1N", "TMWQUEST",
"VAR1V", ##03_TMWQUEST,
"VAR2N", "TMWGLOBAL",
"VAR2V", ##03_TMWGLOBAL,
"VEXP", ##VAULT_EXP,
"GOTO", ##VAULT_GOTO,
"MLTO", ##VAULT_MLTO);
##VAULT_EXP=0;
##VAULT_GOTO=0;
##VAULT_MLTO=0;
api_send(API_FLUSHVAULT, .@api$);
}
return;
}
// MirrorLakeSendTo(World, Lake)
function script MirrorLakeSendTo {
.@w=getarg(0);
.@t=getarg(1);
##VAULT_GOTO=.@w;
##VAULT_MLTO=.@t;
closeclientdialog;
dispbottom l("Darkness fills your vision...");
sleep2(1000);
kick(getcharid(3), 7); // 7 is not a valid kick reason
end;
}
|