forked from Sphereserver/Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sphere_serv_triggers.scp
162 lines (124 loc) · 5.44 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
//****************************************************************************
// SPHERE by : Menasoft ©1997-2015
// 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: Sunday, May 10, 2015
//
VERSION=0.56c
[COMMENT sphere_serv_triggers]
This file contains functions that are triggered by server actions.
[PLEVEL 7]
f_axis_preload
f_onaccount_connect
f_onaccount_create
f_onaccount_login
f_onaccount_delete
f_onaccount_pwchange
f_onchar_create
f_onchar_delete
f_onserver_start
f_onserver_save
f_onserver_save_ok
f_onserver_save_fail
f_onserver_save_finished
f_onserver_exit
f_onserver_blockip
[FUNCTION f_axis_preload]
// This is called every time someone connects from Axis to retrieve information
// local.account --> Account name of connecting client
// local.IP --> IP address of connecting client
// RETURN
// 0 --> Deny access (close connection with no info sent) (no message sent)
// 1 --> Deny access (close connection with no info sent) (send deny message)
// 2 --> normal action (allow information to be sent)
[FUNCTION f_onaccount_connect] //Read carefully
// The f_onaccount_login function is called before the sent password is checked.
// local.account --> username of the account connecting.
// local.password --> password given.
// RETURN
// 0 --> Let Sphere do its password checks.
// 1 --> Deny access asuming the given password is wrong.
// 6 --> Force login, without other password checks than the made in this function.
return 0
[FUNCTION f_onaccount_create]
// The f_onaccount_create function is called before the account is created.
// ARGS --> username of the account being created.
// RETURN
// 0 --> normal action (create)
// 1 --> account not created
[FUNCTION f_onaccount_login]
// The f_onaccount_login function is called after client entered the password.
// ARGS --> username of the client logging in
// ARGO --> the client logging in
// RETURN
// 0 --> normal action (login)
// 1 --> disconnect the client
[FUNCTION f_onaccount_delete]
// The f_onaccount_delete function is called before an account is deleted.
// ARGS --> username of the account being deleted.
// RETURN
// 0 --> normal action (delete)
// 1 --> account not deleted
[FUNCTION f_onaccount_pwchange]
// The f_onaccount_pwchange function is called when the password is being changed in one account
// ARGS --> password given
// RETURN
// 0 --> normal action (change password)
// 1 --> block the change
[FUNCTION f_onchar_create]
// The f_onchar_create function is called after client created a new char.
// SRC --> char being created
// ARGN1 --> flags
// ARGN2 --> profession chosen
// ARGN3 --> race (1=human, 2=elf, 3=gargoyle)
// ARGS --> account name
// ARGO --> the client creating the character
// RETURN
// 0 --> normal action (create character)
// 1 --> denyes creation
//IF (<ARGN3>==2) //Uncomment this code to disable the racial bonus of MaxMana +20 for Elfs
// MaxMana
//ENDIF
//f_meditation_setup // Uncomment this line to enable passive meditation (more info on sphere_skills.scp).
[FUNCTION f_onchar_delete]
// The f_onchar_delete function is called before a client delete his character from the Character Selection Menu.
// SRC --> char being deleted
// ARGO --> the client deleting the character
// RETURN
// 0 --> normal action (delete char)
// 1 --> denyes deletion
[FUNCTION f_onserver_start]
// The f_onserver_start function is called on server startup.
//Serv.ServIP ip.address //Add your public IP here (not domain) if you are behind a router.
[FUNCTION f_onserver_save]
// The f_onserver_save function is called before server is going to save.
// ARGN1 --> save is forced (writable)
// ARGN2 --> save stage (for backgroud save goes 1 to 6146 [sector count + 2])
// RETURN
// 0 --> normal action (save)
// 1 --> denyes save
//Serv.SaveStatics //Uncomment this line if you are building your server, so static items are saved also with normal saves, comment it again in live servers to speed up the save proccess (and manually type .serv.savestatics when adding new static items, or deleting them).
[FUNCTION f_onserver_save_ok]
// The f_onserver_save_ok function is called after server has saved correctly
// (once per stage with background save).
[FUNCTION f_onserver_save_fail]
// The f_onserver_save_fail function is called after server has failed to
// correctly save (once per stage with background save).
[FUNCTION f_onserver_save_finished]
// The f_onserver_save_finished function is called after server completely
// finished saving (also at end of background save).
// ARGS --> Time it took to save (in seconds, 4 digit precision)
[FUNCTION f_onserver_exit]
// The f_onserver_exit function is called when a server is shutdown, after
// all saves and everything finished.
[FUNCTION f_onserver_blockip]
// The f_onserver_blockip function is called when an IP is blocked from the
// server.
// ARGS --> IP being blocked
// ARGN1 --> Time to block the IP for in tenths of a second (writable)
[EOF]