//****************************************************************************
// 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]