-
Notifications
You must be signed in to change notification settings - Fork 19
/
sphere_serv_triggers.scp
167 lines (130 loc) · 5.5 KB
/
sphere_serv_triggers.scp
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
//****************************************************************************
// SPHERE by : Menasoft ©1997-2019
// www.sphereserver.net
// All SPHERE script files and formats are copyright Menasoft & Partners.
// This file may be freely edited for personal use, but may not be distributed
// in whole or in part, in any format without express written permission from
// Menasoft & Partners. All donations and contributions
// become the property of Menasoft & Partners.
//****************************************************************************
// FILE LAST UPDATED: Wednesday, Feb 27, 2019
//
VERSION=0.56d
[COMMENT sphere_serv_triggers]
This file contains functions that are triggered by server actions.
[PLEVEL 7]
f_axis_preload
f_onaccount_connect
f_onaccount_login
f_onaccount_create
f_onaccount_delete
f_onaccount_pwchange
f_onchar_create
f_onchar_delete
f_onserver_start
f_onserver_exit
f_onserver_save
f_onserver_save_ok
f_onserver_save_fail
f_onserver_save_finished
f_onserver_blockip
f_onserver_timer
[FUNCTION f_axis_preload]
// This function is called every time someone connects from Axis to retrieve information.
// Variables:
// LOCAL.Account --> Account name connecting
// LOCAL.IP --> IP address connecting
// Return:
// 0 --> Deny access without send deny message
// 1 --> Deny access and send deny message
// 2 --> Allow access (default action)
[FUNCTION f_onaccount_connect]
// This function is called when an client connect on server, before password checks.
// Variables:
// LOCAL.Account --> Account name given
// LOCAL.Password --> Password given
// Return:
// 0 --> Use internal password checks (default action)
// 1 --> Disconnect client assuming the given password is wrong
// 6 --> Skip internal password checks (password checks must be done manually on scripts)
[FUNCTION f_onaccount_login]
// This function is called after client entered correct password.
// Variables:
// ARGS --> Account name connecting
// ARGO --> Client connecting
// Return:
// 0 --> Allow connection (default action)
// 1 --> Deny connection
[FUNCTION f_onaccount_create]
// This function is called before an account get created.
// Variables:
// ARGS --> Account name being created
// Return:
// 0 --> Allow account creation (default action)
// 1 --> Deny account creation
[FUNCTION f_onaccount_delete]
// This function is called before an account get deleted.
// Variables:
// ARGS --> Account name being deleted
// RETURN
// 0 --> Allow account deletion (default action)
// 1 --> Deny account deletion
[FUNCTION f_onaccount_pwchange]
// This function is called when an account password is being changed.
// Variables:
// ARGS --> Account name
// LOCAL.Password --> New password
// Return:
// 0 --> Allow password change (default action)
// 1 --> Deny password change
[FUNCTION f_onchar_create]
// This function is called before an account character got created.
// Variables:
// SRC --> Character being created
// ARGN1 --> Feature flags sent by client
// ARGN2 --> Character profession (0=Advanced, 1=Warrior, 2=Mage, 3=Blacksmith, 4=Necromancer, 5=Paladin, 6=Samurai, 7=Ninja)
// ARGN3 --> Character race (1=Human, 2=Elf, 3=Gargoyle)
// ARGS --> Account name
// ARGO --> Client creating the character
// Return:
// 0 --> Allow character creation (default action)
// 1 --> Deny character creation
//f_meditation_setup //Uncomment this line to enable passive meditation (more info on sphere_skills.scp)
[FUNCTION f_onchar_delete]
// This function is called before an account character got deleted.
// Variables:
// SRC --> Char being deleted
// ARGO --> Client deleting the character (only available if the char is being deleted from client Character Selection menu)
// Return:
// 0 --> Allow character deletion (default action)
// 1 --> Deny character deletion
[FUNCTION f_onserver_start]
// This function is called on server startup.
//SERV.ServIP=xxx.xxx.xxx.xxx //Add your public IP here (not domain) if you are behind a router
[FUNCTION f_onserver_exit]
// This function is called on server shutdown.
[FUNCTION f_onserver_save]
// This function is called before server worldsave start.
// Variables:
// ARGN1 --> Save is forced (writable)
// ARGN2 --> Save stage (for backgroud save goes 1 to 6146 [sector count + 2])
// Return:
// 0 --> Allow save (default action)
// 1 --> Deny save
//SERV.SaveStatics //Uncomment this line if you are building your server, so static items are saved also with normal saves, or comment it again in live servers to speed up the save proccess (if commented, you MUST type manually .serv.savestatics to save static items)
[FUNCTION f_onserver_save_ok]
// This function is called after server has saved correctly (once per stage with background save).
[FUNCTION f_onserver_save_fail]
// This function is called after server has failed to correctly save (once per stage with background save).
[FUNCTION f_onserver_save_finished]
// This function is called after server completely finished saving (also at end of background save).
// Variables:
// ARGS --> Time it took to save (in seconds, 4 digit precision)
[FUNCTION f_onserver_blockip]
// This function is called when an IP get blocked from the server.
// Variables:
// ARGS --> IP being blocked
// ARGN1 --> Time to block the IP, in tenths of second (writable)
[FUNCTION f_onserver_timer]
// This function is called periodically at every X minutes (value is defined on TimerCall setting of sphere.ini).
[EOF]