Legend of the Green Dragon

Documentation

Namespaces

LotgdCore
Symfony
Lotgd

Interfaces, Classes and Traits

ServerFunctions

Table of Contents

addnews()  : mixed
Adds a news item for the current user.
activate_buffs()  : mixed
process_lifetaps()  : mixed
process_dmgshield()  : mixed
expire_buffs()  : mixed
expire_buffs_afterbattle()  : mixed
prepare_data_battlebars()  : array<string|int, mixed>
Prepare all data for show battle bars.
prepare_fight()  : array<string|int, mixed>
This function prepares the fight, sets up options and gives hook a hook to change options on a per-player basis.
prepare_companions()  : mixed
This functions prepares companions to be able to take part in a fight. Uses global copies.
suspend_companions()  : mixed
Suspends companions on a given parameter.
unsuspend_companions()  : mixed
Enables suspended companions.
autosettarget()  : array<string|int, mixed>
Automatically chooses the first still living enemy as target for attacks.
report_companion_move()  : array<string|int, mixed>
Based upon the type of the companion different actions are performed and the companion is marked as "used" after that.
rollcompaniondamage()  : array<string|int, mixed>
Based upon the companion's stats damage values are calculated.
battle_spawn()  : mixed
Adds a new creature to the badguy array.
battle_heal()  : mixed
Allows creatures to heal themselves or another badguy.
execute_ai_script()  : mixed
Executes the given script or loads the script and then executes it.
battle_player_attacks()  : bool
Battle: attack of player.
battle_badguy_attacks()  : bool
Battle: attack of badguy.
battlevictory()  : mixed
Function to show result of victory battle.
battlegainexperienceforest()  : mixed
Process win experiencie in battle win in forest.
battlegainexperiencegraveyard()  : mixed
Process win experiencie in battle win in graveyard.
battledefeat()  : mixed
Function to show result of defeated battle.
battleshowresults()  : mixed
Show result of.
rolldamage()  : mixed
report_power_move()  : mixed
suspend_buffs()  : mixed
suspend_buff_by_name()  : mixed
unsuspend_buff_by_name()  : mixed
is_buff_active()  : mixed
unsuspend_buffs()  : mixed
apply_bodyguard()  : mixed
apply_skill()  : mixed
calculate_buff_fields()  : mixed
restore_buff_fields()  : mixed
apply_buff()  : mixed
apply_companion()  : mixed
strip_buff()  : mixed
strip_all_buffs()  : mixed
has_buff()  : mixed
char_cleanup()  : bool
Delete an account and create a backup.
createBackupOfEntity()  : bool
Create backup of Entity in "logd_snapshots".
createBackupBasicInfo()  : bool
Create a basic info backup of account.
checkban()  : mixed
process_post_save_data()  : mixed
lotgd_generate_creature_levels()  : array<string|int, mixed>
Generate a base creature stats Can use for generated your own creatures in your modules.
lotgd_generate_doppelganger()  : array<string|int, mixed>
Generate a dummy creature Doppelganger.
lotgd_transform_creature()  : array<string|int, mixed>
Transform creature to adapt to player.
lotgd_search_creature()  : array<string|int, mixed>
Search for creature in data base.
get_creature_stats()  : mixed
get_creature_hitpoints()  : mixed
get_creature_attack()  : mixed
get_creature_defense()  : mixed
get_creature_speed()  : mixed
lotgd_show_debug_creature()  : mixed
checkday()  : mixed
Check if is a new day.
is_new_day()  : bool
getgametime()  : mixed
gametime()  : int
Undocumented function.
convertgametime()  : mixed
gametimedetails()  : mixed
secondstonextgameday()  : mixed
select_deathmessage()  : array<string|int, mixed>
Select 1 death message.
debuglog()  : mixed
Documentated by Catscradler Add to the user's log if $field $value and $consolidate have values, entry will be merged with existing line from today with identical $field.
dump_item()  : mixed
dump_item_ascode()  : mixed
handle_event()  : mixed
exp_for_next_level()  : int
Returns the experience needed to advance to the next level.
fightnav()  : mixed
do_forced_nav()  : mixed
buffbadguy()  : array<string|int, mixed>
Buff creature for optimize to character stats.
gamelog()  : mixed
holidayize()  : mixed
increment_specialty()  : mixed
lotgd_mail()  : mixed
Function for send Mails to users Has the same structure as the php "mail()" function, but this function checks if you want to send emails in html format or not.
activate_module()  : mixed
deactivate_module()  : mixed
uninstall_module()  : mixed
install_module()  : mixed
blockmodule()  : mixed
unblockmodule()  : mixed
module_collect_events()  : mixed
module_events()  : mixed
module_do_event()  : mixed
event_sort()  : mixed
module_display_events()  : mixed
modulehook()  : mixed
module_wipehooks()  : mixed
Delete hooks of module.
module_addeventhook()  : mixed
module_drophook()  : mixed
module_addhook()  : mixed
Called by modules to register themselves for a game module hook point, with default priority.
module_addhook_priority()  : mixed
Called by modules to register themselves for a game module hook point, with a given priority -- lower numbers execute first.
injectmodule()  : mixed
module_status()  : int
Returns the status of a module as a bitfield.
is_module_active()  : bool
Determines if a module is activated.
is_module_installed()  : bool
Determines if a module is installed.
get_module_install_status()  : array<string|int, mixed>
Get status of module.
module_delete_objprefs()  : mixed
Delete all objtype for objid.
get_module_objpref()  : mixed
Get value for a setting for a module, objtype and objid.
set_module_objpref()  : mixed
Set value for a setting for a module, objtype and objid.
increment_module_objpref()  : mixed
Increment value for a setting for a module, objtype and objid.
load_module_objpref()  : array<string|int, mixed>
Load objpref of a module.
module_delete_userprefs()  : mixed
Delete all module user preferences.
get_all_module_prefs()  : array<string|int, mixed>
Get all module prefs of a user.
get_module_pref()  : mixed
Get pref of user for a given module and setting.
set_module_pref()  : mixed
Set pref of user for a given module and setting.
increment_module_pref()  : mixed
Increment pref of user for a given module and setting.
clear_module_pref()  : mixed
Clear a setting for a given module and user.
load_module_prefs()  : array<string|int, mixed>
Load prefs of a module.
get_all_module_settings()  : array<string|int, mixed>
An associative array of all the settings for the given module.
get_module_setting()  : mixed
Get value for setting of a module.
set_module_setting()  : mixed
Set value for setting of a module.
increment_module_setting()  : mixed
Increment value for a setting of module.
clear_module_settings()  : mixed
Clear settings of a module.
load_module_settings()  : array<string|int, mixed>
Load settings of a module.
module_check_requirements()  : bool
Checks if the module requirements are satisfied. Should a module require other modules to be installed and active, then optionally makes them so.
mass_module_prepare()  : bool
Preloads data for multiple modules in one shot rather than having to make SQL calls for each hook, when many of the hooks are found on every page.
get_module_info()  : mixed
module_editor_navs()  : mixed
module_objpref_edit()  : mixed
module_compare_versions()  : mixed
module_condition()  : bool
Evaluates a PHP Expression.
get_racename()  : mixed
module_pref_filter()  : mixed
getmountname()  : mixed
getmount()  : mixed
get_player_title()  : mixed
get_player_basename()  : mixed
change_player_name()  : mixed
change_player_ctitle()  : mixed
change_player_title()  : mixed
wipe_charstats()  : mixed
Resets the character stats array.
addcharstat()  : mixed
Add a attribute and/or value to the character stats display.
getcharstat()  : string
Returns the character stat related to the category ($cat) and the label.
setcharstat()  : mixed
Sets a value to the passed category & label for character stats.
getcharstat_value()  : string
Is alias of getcharstat.
getcharstats()  : string
Returns output formatted character stats.
charstats()  : array<string|int, mixed>
Returns the current character stats or (if the character isn't logged in) the currently online players Hooks provided: charstats.
get_partner()  : mixed
killplayer()  : mixed
get_player_hitpoints()  : mixed
explained_get_player_hitpoints()  : mixed
get_player_attack()  : mixed
explained_row_get_player_attack()  : mixed
explained_get_player_attack()  : mixed
get_player_defense()  : mixed
explained_row_get_player_defense()  : mixed
explained_get_player_defense()  : mixed
get_player_speed()  : mixed
get_player_physical_resistance()  : mixed
setup_pvp_target()  : bool|array<string|int, mixed>
This contains functions to support pvp.
pvpvictory()  : mixed
pvpdefeat()  : mixed
pvpwarning()  : mixed
redirect()  : mixed
saveuser()  : mixed
savesetting()  : mixed
clearsettings()  : mixed
getsetting()  : mixed
getAllSettings()  : mixed
lotgd_showform()  : mixed
Construct FORM LOTGD style.
lotgd_show_form_field()  : mixed
lotgd_showtabs()  : mixed
Construct TABS Semantic UI style.
check_su_access()  : mixed
checkSuPermission()  : bool|redirect
Check Superuser premission.
substitute()  : mixed
substitute_array()  : mixed
systemmail()  : mixed
select_taunt()  : array<string|int, mixed>
Select 1 taunt.
apply_temp_stat()  : mixed
check_temp_stat()  : mixed
suspend_temp_stats()  : mixed
restore_temp_stats()  : mixed
valid_dk_title()  : mixed
get_dk_title()  : mixed
e_rand()  : int
Alias of mt_rand with some improvements.
r_rand()  : int|float
Same as e_rand but $min and $max are multiplied by 1000.
is_email()  : bool
Check if given email is valid.
arraytourl()  : string
Turns an array into an URL argument string.
urltoarray()  : array<string|int, mixed>
Takes an array and returns its arguments in an array.
createstring()  : string
Turns the given parameter into a string.
myDefine()  : mixed
list_files()  : mixed
_curl()  : mixed
_sock()  : mixed
pullurl()  : mixed
safeescape()  : mixed
nltoappon()  : mixed
bell_rand()  : mixed

Functions

addnews()

Adds a news item for the current user.

addnews(string $text[, array<string|int, mixed> $params = [] ][, string $textDomain = 'partial_news' ][, bool $hideFromBio = null ]) : mixed
Parameters
$text : string
$params : array<string|int, mixed> = []
$textDomain : string = 'partial_news'
$hideFromBio : bool = null

activate_buffs()

activate_buffs(mixed $tag) : mixed
Parameters
$tag : mixed

process_lifetaps()

process_lifetaps(mixed $ltaps, mixed $damage) : mixed
Parameters
$ltaps : mixed
$damage : mixed

process_dmgshield()

process_dmgshield(mixed $dshield, mixed $damage) : mixed
Parameters
$dshield : mixed
$damage : mixed

expire_buffs()

expire_buffs() : mixed

expire_buffs_afterbattle()

expire_buffs_afterbattle() : mixed

prepare_data_battlebars()

Prepare all data for show battle bars.

prepare_data_battlebars(array<string|int, mixed> $enemies) : array<string|int, mixed>
Parameters
$enemies : array<string|int, mixed>

prepare_fight()

This function prepares the fight, sets up options and gives hook a hook to change options on a per-player basis.

prepare_fight([array<string|int, mixed> $options = [] ]) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed> = []

the options given by a module or basics

prepare_companions()

This functions prepares companions to be able to take part in a fight. Uses global copies.

prepare_companions() : mixed

suspend_companions()

Suspends companions on a given parameter.

suspend_companions(string $susp[, string $nomsg = null ]) : mixed
Parameters
$susp : string

The type of suspension

$nomsg : string = null

The message to be displayed upon suspending. If false, no message will be displayed.

unsuspend_companions()

Enables suspended companions.

unsuspend_companions(string $susp[, string $nomsg = null ]) : mixed
Parameters
$susp : string

The type of suspension

$nomsg : string = null

The message to be displayed upon unsuspending. If false, no message will be displayed.

autosettarget()

Automatically chooses the first still living enemy as target for attacks.

autosettarget(array<string|int, mixed> $localenemies) : array<string|int, mixed>
Parameters
$localenemies : array<string|int, mixed>

the stack of enemies to find a valid one from

report_companion_move()

Based upon the type of the companion different actions are performed and the companion is marked as "used" after that.

report_companion_move(array<string|int, mixed> $companion[, string $activate = 'fight' ]) : array<string|int, mixed>
Parameters
$companion : array<string|int, mixed>

The companion itself

$activate : string = 'fight'

The stage of activation. Can be one of these: "fight", "defend", "heal" or "magic".

rollcompaniondamage()

Based upon the companion's stats damage values are calculated.

rollcompaniondamage(array<string|int, mixed> $companion) : array<string|int, mixed>
Parameters
$companion : array<string|int, mixed>

battle_spawn()

Adds a new creature to the badguy array.

battle_spawn(mixed $creature) : mixed
Parameters
$creature : mixed

A standard badguy array. If numeric, the corresponding badguy will be loaded from the database.

battle_heal()

Allows creatures to heal themselves or another badguy.

battle_heal(int $amount[, mixed $target = false ]) : mixed
Parameters
$amount : int

Amount of helath to be restored

$target : mixed = false

if false badguy will heal itself otherwise the enemy with this index

execute_ai_script()

Executes the given script or loads the script and then executes it.

execute_ai_script(string $script) : mixed
Parameters
$script : string

the script to be executed

battle_player_attacks()

Battle: attack of player.

battle_player_attacks() : bool

battle_badguy_attacks()

Battle: attack of badguy.

battle_badguy_attacks() : bool

battlevictory()

Function to show result of victory battle.

battlevictory(array<string|int, mixed> $enemies[, bool $denyflawless = false ][, bool $forest = true ]) : mixed
Parameters
$enemies : array<string|int, mixed>
$denyflawless : bool = false
$forest : bool = true

battlegainexperienceforest()

Process win experiencie in battle win in forest.

battlegainexperienceforest() : mixed

battlegainexperiencegraveyard()

Process win experiencie in battle win in graveyard.

battlegainexperiencegraveyard() : mixed

battledefeat()

Function to show result of defeated battle.

battledefeat(array<string|int, mixed> $enemies[, string|false $where = 'forest' ][, bool $candie = true ][, bool $lostexp = true ][, bool $lostgold = true ]) : mixed
Parameters
$enemies : array<string|int, mixed>
$where : string|false = 'forest'
$candie : bool = true

Can die in battle?

$lostexp : bool = true

Lost exp when die in battle?

$lostgold : bool = true

Lost gold when die in battle?

battleshowresults()

Show result of.

battleshowresults(array<string|int, mixed> $lotgdBattleContent) : mixed
Parameters
$lotgdBattleContent : array<string|int, mixed>

rolldamage()

rolldamage() : mixed

report_power_move()

report_power_move(mixed $crit, mixed $dmg) : mixed
Parameters
$crit : mixed
$dmg : mixed

suspend_buffs()

suspend_buffs([mixed $susp = false ][, mixed $msg = false ]) : mixed
Parameters
$susp : mixed = false
$msg : mixed = false

suspend_buff_by_name()

suspend_buff_by_name(mixed $name[, mixed $msg = false ]) : mixed
Parameters
$name : mixed
$msg : mixed = false

unsuspend_buff_by_name()

unsuspend_buff_by_name(mixed $name[, mixed $msg = false ]) : mixed
Parameters
$name : mixed
$msg : mixed = false

is_buff_active()

is_buff_active(mixed $name) : mixed
Parameters
$name : mixed

unsuspend_buffs()

unsuspend_buffs([mixed $susp = false ][, mixed $msg = false ]) : mixed
Parameters
$susp : mixed = false
$msg : mixed = false

apply_bodyguard()

apply_bodyguard(mixed $level) : mixed
Parameters
$level : mixed

apply_skill()

apply_skill(mixed $skill, mixed $l) : mixed
Parameters
$skill : mixed
$l : mixed

calculate_buff_fields()

calculate_buff_fields() : mixed

restore_buff_fields()

restore_buff_fields() : mixed

apply_buff()

apply_buff(mixed $name, mixed $buff) : mixed
Parameters
$name : mixed
$buff : mixed

apply_companion()

apply_companion(mixed $name, mixed $companion[, mixed $ignorelimit = false ]) : mixed
Parameters
$name : mixed
$companion : mixed
$ignorelimit : mixed = false

strip_buff()

strip_buff(mixed $name) : mixed
Parameters
$name : mixed

strip_all_buffs()

strip_all_buffs() : mixed

has_buff()

has_buff(mixed $name) : mixed
Parameters
$name : mixed

char_cleanup()

Delete an account and create a backup.

char_cleanup(int $accountId, int $type) : bool

In order to create a backup and delete the data, the EntityRepository of each table needs to have the following two methods:

  • public function backupDeleteDataFromAccount(int $accountId): array }
  • public function backupGetDataFromAccount(int $accountId): int }
Parameters
$accountId : int
$type : int

createBackupOfEntity()

Create backup of Entity in "logd_snapshots".

createBackupOfEntity(int $accountId, object $repository, string $entityName) : bool
Parameters
$accountId : int
$repository : object
$entityName : string

createBackupBasicInfo()

Create a basic info backup of account.

createBackupBasicInfo(int $accountId, mixed $account) : bool
Parameters
$accountId : int
$account : mixed

checkban()

checkban([mixed $login = false ]) : mixed
Parameters
$login : mixed = false

process_post_save_data()

process_post_save_data(mixed $post, mixed $old, mixed &$flashMessages, mixed $module, mixed $textDomain) : mixed
Parameters
$post : mixed
$old : mixed
$flashMessages : mixed
$module : mixed
$textDomain : mixed

lotgd_generate_creature_levels()

Generate a base creature stats Can use for generated your own creatures in your modules.

lotgd_generate_creature_levels([false|int $level = null ]) : array<string|int, mixed>
Parameters
$level : false|int = null

Level of creature

lotgd_generate_doppelganger()

Generate a dummy creature Doppelganger.

lotgd_generate_doppelganger(int $level) : array<string|int, mixed>
Parameters
$level : int

lotgd_transform_creature()

Transform creature to adapt to player.

lotgd_transform_creature(array<string|int, mixed> $badguy[, bool $debug = true ]) : array<string|int, mixed>
Parameters
$badguy : array<string|int, mixed>

Data of creature

$debug : bool = true

Show or not debug of creature

lotgd_search_creature()

Search for creature in data base.

lotgd_search_creature(int $multi, int $targetlevel, int $mintargetlevel[, bool $packofmonsters = false ][, bool|null $forest = true ]) : array<string|int, mixed>
Parameters
$multi : int
$targetlevel : int
$mintargetlevel : int
$packofmonsters : bool = false

For diferent or same creatures

$forest : bool|null = true

TRUE for creature of forest, FALSE for graveyard and NULL for none

get_creature_stats()

get_creature_stats(mixed $dk) : mixed
Parameters
$dk : mixed

get_creature_hitpoints()

get_creature_hitpoints(mixed $attrs) : mixed
Parameters
$attrs : mixed

get_creature_attack()

get_creature_attack(mixed $attrs) : mixed
Parameters
$attrs : mixed

get_creature_defense()

get_creature_defense(mixed $attrs) : mixed
Parameters
$attrs : mixed

get_creature_speed()

get_creature_speed(mixed $attrs) : mixed
Parameters
$attrs : mixed

lotgd_show_debug_creature()

lotgd_show_debug_creature(iteratable<string|int, mixed> $badguy) : mixed
Parameters
$badguy : iteratable<string|int, mixed>

checkday()

Check if is a new day.

checkday() : mixed

is_new_day()

is_new_day(int $now) : bool
Parameters
$now : int

gametime()

Undocumented function.

gametime() : int

convertgametime()

convertgametime(int $intime[, mixed $debug = false ]) : mixed
Parameters
$intime : int
$debug : mixed = false

gametimedetails()

gametimedetails() : mixed

secondstonextgameday()

secondstonextgameday([mixed $details = false ]) : mixed
Parameters
$details : mixed = false

select_deathmessage()

Select 1 death message.

select_deathmessage([string $zone = 'forest' ][, array<string|int, mixed> $extraParams = [] ]) : array<string|int, mixed>
Parameters
$zone : string = 'forest'
$extraParams : array<string|int, mixed> = []

debuglog()

Documentated by Catscradler Add to the user's log if $field $value and $consolidate have values, entry will be merged with existing line from today with identical $field.

debuglog(string $message[, int $target = false ][, int $user = false ][, string $field = false ][, int $value = false ][, bool $consolidate = true ]) : mixed

otherwise, a new line will be added to the log.

Parameters
$message : string

the text to be added

$target : int = false

acctid of the user on the receiving end of the event eg. the user who did NOT initiate PvP, gold transfer recipient (optional)

$user : int = false

acctid of the user the log entry is about (optional, defaults to current user)

$field : string = false

the label for this line, appears as first word on this line in the log eg. healing, forestwin (optional)

$value : int = false

how much was gained or lost. Only useful if also using $field and $consolidate (optional)

$consolidate : bool = true

add $value to previous log lines with the same $field, keeping a running total for today (optional, defaults to true)

dump_item()

dump_item(mixed $item) : mixed
Parameters
$item : mixed

dump_item_ascode()

dump_item_ascode(mixed $item[, mixed $indent = " " ]) : mixed
Parameters
$item : mixed
$indent : mixed = " "

handle_event()

handle_event(mixed $location[, mixed $baseLink = false ]) : mixed
Parameters
$location : mixed
$baseLink : mixed = false

exp_for_next_level()

Returns the experience needed to advance to the next level.

exp_for_next_level(int $curlevel, int $curdk) : int
Parameters
$curlevel : int

the current level of the player

$curdk : int

the current number of dragonkills

fightnav()

fightnav([mixed $allowspecial = true ][, mixed $allowflee = true ][, mixed $script = false ]) : mixed
Parameters
$allowspecial : mixed = true
$allowflee : mixed = true
$script : mixed = false

do_forced_nav()

do_forced_nav(mixed $anonymous, mixed $overrideforced) : mixed
Parameters
$anonymous : mixed
$overrideforced : mixed

buffbadguy()

Buff creature for optimize to character stats.

buffbadguy(mixed $badguy[, string $hook = 'buffbadguy' ]) : array<string|int, mixed>
Parameters
$badguy : mixed
$hook : string = 'buffbadguy'

Hook to activate when buff badguy

gamelog()

gamelog(mixed $message[, mixed $category = 'general' ][, mixed $filed = false ]) : mixed
Parameters
$message : mixed
$category : mixed = 'general'
$filed : mixed = false

holidayize()

holidayize(mixed $text[, mixed $type = 'unknown' ]) : mixed
Parameters
$text : mixed
$type : mixed = 'unknown'

increment_specialty()

increment_specialty(mixed $colorcode[, mixed $spec = false ]) : mixed
Parameters
$colorcode : mixed
$spec : mixed = false

lotgd_mail()

Function for send Mails to users Has the same structure as the php "mail()" function, but this function checks if you want to send emails in html format or not.

lotgd_mail(mixed $to, mixed $subject, mixed $message[, mixed $additional_headers = '' ][, mixed $additional_parameters = '' ]) : mixed
Parameters
$to : mixed
$subject : mixed
$message : mixed
$additional_headers : mixed = ''
$additional_parameters : mixed = ''

activate_module()

activate_module(mixed $module) : mixed
Parameters
$module : mixed

deactivate_module()

deactivate_module(mixed $module) : mixed
Parameters
$module : mixed

uninstall_module()

uninstall_module(mixed $module) : mixed
Parameters
$module : mixed

install_module()

install_module(mixed $module[, mixed $force = true ]) : mixed
Parameters
$module : mixed
$force : mixed = true

blockmodule()

blockmodule(mixed $modulename) : mixed
Parameters
$modulename : mixed

unblockmodule()

unblockmodule(mixed $modulename) : mixed
Parameters
$modulename : mixed

module_collect_events()

module_collect_events(mixed $type[, mixed $allowinactive = false ]) : mixed
Parameters
$type : mixed
$allowinactive : mixed = false

module_events()

module_events(mixed $eventtype, mixed $basechance[, mixed $baseLink = false ]) : mixed
Parameters
$eventtype : mixed
$basechance : mixed
$baseLink : mixed = false

module_do_event()

module_do_event(mixed $type, mixed $module[, mixed $allowinactive = false ][, mixed $baseLink = false ]) : mixed
Parameters
$type : mixed
$module : mixed
$allowinactive : mixed = false
$baseLink : mixed = false

event_sort()

event_sort(mixed $a, mixed $b) : mixed
Parameters
$a : mixed
$b : mixed

module_display_events()

module_display_events(mixed $eventtype[, mixed $forcescript = false ]) : mixed
Parameters
$eventtype : mixed
$forcescript : mixed = false

modulehook()

modulehook(mixed $hookname[, mixed $args = false ][, mixed $allowinactive = false ][, mixed $only = false ]) : mixed
Parameters
$hookname : mixed
$args : mixed = false
$allowinactive : mixed = false
$only : mixed = false

module_wipehooks()

Delete hooks of module.

module_wipehooks(string $module) : mixed
Parameters
$module : string

module_addeventhook()

module_addeventhook(mixed $type, mixed $chance) : mixed
Parameters
$type : mixed
$chance : mixed

module_drophook()

module_drophook(mixed $hookname[, mixed $functioncall = false ]) : mixed
Parameters
$hookname : mixed
$functioncall : mixed = false

module_addhook()

Called by modules to register themselves for a game module hook point, with default priority.

module_addhook(string $hookname[, string $functioncall = false ][, string $whenactive = false ]) : mixed

Modules with identical priorities will execute alphabetically. Modules can only have one hook on a given hook name, even if they call this function multiple times, unless they specify different values for the functioncall argument.

Parameters
$hookname : string

The hook to receive a notification for

$functioncall : string = false

The function that should be called, if not specified, use {modulename}_dohook() as the function

$whenactive : string = false

an expression that should be evaluated before triggering the event, if not specified, none

module_addhook_priority()

Called by modules to register themselves for a game module hook point, with a given priority -- lower numbers execute first.

module_addhook_priority(string $hookname[, int $priority = 50 ][, string $functioncall = false ][, string $whenactive = false ]) : mixed

Modules with identical priorities will execute alphabetically. Modules can only have one hook on a given hook name, even if they call this function multiple times, unless they specify different values for the functioncall argument.

Parameters
$hookname : string

The hook to receive a notification for

$priority : int = 50

The priority for this hooking -- lower numbers execute first. < 50 means earlier-than-normal execution, > 50 means later than normal execution. Priority only affects execution order compared to other events registered on the same hook, all events on a given hook will execute before the game resumes execution.

$functioncall : string = false

The function that should be called, if not specified, use {modulename}_dohook() as the function

$whenactive : string = false

an expression that should be evaluated before triggering the event, if not specified, none

injectmodule()

injectmodule(mixed $modulename[, mixed $force = false ]) : mixed
Parameters
$modulename : mixed
$force : mixed = false

module_status()

Returns the status of a module as a bitfield.

module_status(string $modulename[, string $version = null ]) : int
Parameters
$modulename : string

The module name

$version : string = null

The version to check for (null for don't care)

is_module_active()

Determines if a module is activated.

is_module_active(string $modulename) : bool
Parameters
$modulename : string

The module name

is_module_installed()

Determines if a module is installed.

is_module_installed(string $modulename[, string $version = false ]) : bool
Parameters
$modulename : string

The module name

$version : string = false

The version to check for

get_module_install_status()

Get status of module.

get_module_install_status() : array<string|int, mixed>

module_delete_objprefs()

Delete all objtype for objid.

module_delete_objprefs(string $objtype, int $objid) : mixed
Parameters
$objtype : string
$objid : int

get_module_objpref()

Get value for a setting for a module, objtype and objid.

get_module_objpref(string $objtype, int $objid, string $name[, string $module = false ]) : mixed
Parameters
$objtype : string
$objid : int
$name : string
$module : string = false

set_module_objpref()

Set value for a setting for a module, objtype and objid.

set_module_objpref(string $objtype, int $objid, string $name, mixed $value[, string $module = false ]) : mixed
Parameters
$objtype : string
$objid : int
$name : string
$value : mixed
$module : string = false

increment_module_objpref()

Increment value for a setting for a module, objtype and objid.

increment_module_objpref(string $objtype, int $objid, string $name[, float|int $value = 1 ][, string $module = false ]) : mixed
Parameters
$objtype : string
$objid : int
$name : string
$value : float|int = 1
$module : string = false

load_module_objpref()

Load objpref of a module.

load_module_objpref(string $objtype, int $objid[, string $module = false ]) : array<string|int, mixed>
Parameters
$objtype : string
$objid : int
$module : string = false

module_delete_userprefs()

Delete all module user preferences.

module_delete_userprefs(int $user) : mixed
Parameters
$user : int

get_all_module_prefs()

Get all module prefs of a user.

get_all_module_prefs([string $module = false ][, int $user = false ]) : array<string|int, mixed>
Parameters
$module : string = false
$user : int = false

get_module_pref()

Get pref of user for a given module and setting.

get_module_pref(string $name[, string $module = false ][, int $user = false ]) : mixed
Parameters
$name : string
$module : string = false
$user : int = false

set_module_pref()

Set pref of user for a given module and setting.

set_module_pref(string $name, mixed $value[, string $module = false ][, int $user = false ]) : mixed
Parameters
$name : string
$value : mixed
$module : string = false
$user : int = false

increment_module_pref()

Increment pref of user for a given module and setting.

increment_module_pref(string $name[, int|float $value = 1 ][, string $module = false ][, int $user = false ]) : mixed
Parameters
$name : string
$value : int|float = 1
$module : string = false
$user : int = false

clear_module_pref()

Clear a setting for a given module and user.

clear_module_pref(string $name[, string $module = false ][, int $user = false ]) : mixed
Parameters
$name : string
$module : string = false
$user : int = false

load_module_prefs()

Load prefs of a module.

load_module_prefs(string $module[, int $user = false ]) : array<string|int, mixed>
Parameters
$module : string
$user : int = false

get_all_module_settings()

An associative array of all the settings for the given module.

get_all_module_settings([string $module = false ]) : array<string|int, mixed>
Parameters
$module : string = false

get_module_setting()

Get value for setting of a module.

get_module_setting(mixed $name[, mixed $module = false ]) : mixed
Parameters
$name : mixed
$module : mixed = false

set_module_setting()

Set value for setting of a module.

set_module_setting(string $name, mixed $value[, string $module = false ]) : mixed
Parameters
$name : string
$value : mixed
$module : string = false

increment_module_setting()

Increment value for a setting of module.

increment_module_setting(string $name[, float|int $value = 1 ][, string $module = false ]) : mixed
Parameters
$name : string
$value : float|int = 1
$module : string = false

clear_module_settings()

Clear settings of a module.

clear_module_settings([string $module = false ]) : mixed
Parameters
$module : string = false

load_module_settings()

Load settings of a module.

load_module_settings(string $module) : array<string|int, mixed>
Parameters
$module : string

module_check_requirements()

Checks if the module requirements are satisfied. Should a module require other modules to be installed and active, then optionally makes them so.

module_check_requirements(array<string|int, mixed> $reqs[, mixed $forceinject = false ]) : bool
Parameters
$reqs : array<string|int, mixed>

Requirements of a module from _getmoduleinfo()

$forceinject : mixed = false

mass_module_prepare()

Preloads data for multiple modules in one shot rather than having to make SQL calls for each hook, when many of the hooks are found on every page.

mass_module_prepare(array<string|int, mixed> $hooknames) : bool
Parameters
$hooknames : array<string|int, mixed>

names of hooks whose attached modules should be preloaded

get_module_info()

get_module_info(mixed $shortname) : mixed
Parameters
$shortname : mixed

module_editor_navs()

module_editor_navs(mixed $like, mixed $linkprefix) : mixed
Parameters
$like : mixed
$linkprefix : mixed

module_objpref_edit()

module_objpref_edit(mixed $type, mixed $module, mixed $id) : mixed
Parameters
$type : mixed
$module : mixed
$id : mixed

module_compare_versions()

module_compare_versions(mixed $a, mixed $b) : mixed
Parameters
$a : mixed
$b : mixed

module_condition()

Evaluates a PHP Expression.

module_condition(string $condition) : bool
Parameters
$condition : string

The PHP condition to evaluate

get_racename()

get_racename([mixed $thisuser = true ]) : mixed
Parameters
$thisuser : mixed = true

module_pref_filter()

module_pref_filter(mixed $a) : mixed
Parameters
$a : mixed

getmount()

getmount(mixed $horse) : mixed
Parameters
$horse : mixed

get_player_title()

get_player_title([mixed $old = false ]) : mixed
Parameters
$old : mixed = false

get_player_basename()

get_player_basename([mixed $old = false ]) : mixed
Parameters
$old : mixed = false

change_player_name()

change_player_name(mixed $newname[, mixed $old = false ]) : mixed
Parameters
$newname : mixed
$old : mixed = false

change_player_ctitle()

change_player_ctitle(mixed $nctitle[, mixed $old = false ]) : mixed
Parameters
$nctitle : mixed
$old : mixed = false

change_player_title()

change_player_title(mixed $ntitle[, mixed $old = false ]) : mixed
Parameters
$ntitle : mixed
$old : mixed = false

wipe_charstats()

Resets the character stats array.

wipe_charstats() : mixed

addcharstat()

Add a attribute and/or value to the character stats display.

addcharstat(string $label[, string $value = null ]) : mixed
Parameters
$label : string

The label to use

$value : string = null

(optional) value to display

getcharstat()

Returns the character stat related to the category ($cat) and the label.

getcharstat(string $cat, string $label) : string
Parameters
$cat : string

The relavent category for the stat

$label : string

The label of the character stat

setcharstat()

Sets a value to the passed category & label for character stats.

setcharstat(string $cat, string $label, mixed $val) : mixed
Parameters
$cat : string

The category for the char stat

$label : string

The label associated with the value

$val : mixed

The value of the attribute

getcharstat_value()

Is alias of getcharstat.

getcharstat_value(string $section, string $title) : string
Parameters
$section : string

The character stat section

$title : string

The stat display label

getcharstats()

Returns output formatted character stats.

getcharstats(array<string|int, mixed> $buffs) : string
Parameters
$buffs : array<string|int, mixed>

charstats()

Returns the current character stats or (if the character isn't logged in) the currently online players Hooks provided: charstats.

charstats([bool $return = true ]) : array<string|int, mixed>
Parameters
$return : bool = true

get_partner()

get_partner([mixed $player = false ]) : mixed
Parameters
$player : mixed = false

killplayer()

killplayer([mixed $explossproportion = 0.1 ][, mixed $goldlossproportion = 1 ]) : mixed
Parameters
$explossproportion : mixed = 0.1
$goldlossproportion : mixed = 1

get_player_hitpoints()

get_player_hitpoints([mixed $player = false ]) : mixed
Parameters
$player : mixed = false

explained_get_player_hitpoints()

explained_get_player_hitpoints([mixed $player = false ][, mixed $colored = false ]) : mixed
Parameters
$player : mixed = false
$colored : mixed = false

get_player_attack()

get_player_attack([mixed $player = false ]) : mixed
Parameters
$player : mixed = false

explained_row_get_player_attack()

explained_row_get_player_attack([mixed $player = false ]) : mixed
Parameters
$player : mixed = false

explained_get_player_attack()

explained_get_player_attack([mixed $player = false ][, mixed $colored = false ]) : mixed
Parameters
$player : mixed = false
$colored : mixed = false

get_player_defense()

get_player_defense([mixed $player = false ]) : mixed
Parameters
$player : mixed = false

explained_row_get_player_defense()

explained_row_get_player_defense([mixed $player = false ]) : mixed
Parameters
$player : mixed = false

explained_get_player_defense()

explained_get_player_defense([mixed $player = false ][, mixed $colored = false ]) : mixed
Parameters
$player : mixed = false
$colored : mixed = false

get_player_speed()

get_player_speed([mixed $player = false ]) : mixed
Parameters
$player : mixed = false

get_player_physical_resistance()

get_player_physical_resistance([mixed $player = false ]) : mixed
Parameters
$player : mixed = false

setup_pvp_target()

This contains functions to support pvp.

setup_pvp_target(int $characterId) : bool|array<string|int, mixed>
Parameters
$characterId : int

pvpvictory()

pvpvictory(mixed $badguy, mixed $killedloc) : mixed
Parameters
$badguy : mixed
$killedloc : mixed

pvpdefeat()

pvpdefeat(mixed $badguy, mixed $killedloc) : mixed
Parameters
$badguy : mixed
$killedloc : mixed

pvpwarning()

pvpwarning([mixed $dokill = false ]) : mixed
Parameters
$dokill : mixed = false

redirect()

redirect(mixed $location[, mixed $reason = false ]) : mixed
Parameters
$location : mixed
$reason : mixed = false

saveuser()

saveuser([mixed $update_last_on = true ]) : mixed
Parameters
$update_last_on : mixed = true

savesetting()

savesetting(string $settingname, mixed $value) : mixed
Parameters
$settingname : string
$value : mixed

getsetting()

getsetting(string $settingname[, mixed $default = false ]) : mixed
Parameters
$settingname : string
$default : mixed = false

getAllSettings()

getAllSettings() : mixed

lotgd_showform()

Construct FORM LOTGD style.

lotgd_showform(mixed $layout, array<string|int, mixed> $row[, bool $nosave = false ][, false|pattern $keypref = false ][, bool $print = true ][, callable $callback = null ]) : mixed
Parameters
$layout : mixed
$row : array<string|int, mixed>
$nosave : bool = false
$keypref : false|pattern = false
$print : bool = true
$callback : callable = null

This can use for personalize the form used to show all inputs or for more process. Can still use lotgd_show_form_field in your callable Both functions get same parameters function($info, $row, $key, $keyout, $val, $extensions)

Tags
deprecated
4.1.0

lotgd_show_form_field()

lotgd_show_form_field(mixed $info, mixed $row, mixed $key, mixed $keyout, mixed $val, mixed $extensions) : mixed
Parameters
$info : mixed
$row : mixed
$key : mixed
$keyout : mixed
$val : mixed
$extensions : mixed

lotgd_showtabs()

Construct TABS Semantic UI style.

lotgd_showtabs(array<string|int, mixed> $tabs[, bool $print = true ][, callable $callback = null ][, bool $browse = false ]) : mixed
Parameters
$tabs : array<string|int, mixed>

Format: [ 'title for tab 1' => 'Content of tab 1' 'title for tab 2' => 'Content of tab 2' ]

$print : bool = true

Print tabs or return

$callback : callable = null

If you need proccess de content of tab can pass a callback. Default no process content and only show. callback recibe paraments $callback($content, $title)

$browse : bool = false

Indicate type of menu: tabular or browse menu

check_su_access()

check_su_access(mixed $level) : mixed
Parameters
$level : mixed

checkSuPermission()

Check Superuser premission.

checkSuPermission(int $permission[, string|null $return = null ]) : bool|redirect

Just check and redirect if denied you have permission.

Parameters
$permission : int
$return : string|null = null

substitute()

substitute(mixed $string[, mixed $extra = false ][, mixed $extrarep = false ]) : mixed
Parameters
$string : mixed
$extra : mixed = false
$extrarep : mixed = false

substitute_array()

substitute_array(mixed $string[, mixed $extra = false ][, mixed $extrarep = false ]) : mixed
Parameters
$string : mixed
$extra : mixed = false
$extrarep : mixed = false

systemmail()

systemmail(mixed $to, mixed $subject, mixed $body, mixed $from[, mixed $noemail = false ]) : mixed
Parameters
$to : mixed
$subject : mixed
$body : mixed
$from : mixed
$noemail : mixed = false

select_taunt()

Select 1 taunt.

select_taunt([array<string|int, mixed> $extraParams = [] ]) : array<string|int, mixed>
Parameters
$extraParams : array<string|int, mixed> = []

apply_temp_stat()

apply_temp_stat(mixed $name, mixed $value[, mixed $type = 'add' ]) : mixed
Parameters
$name : mixed
$value : mixed
$type : mixed = 'add'

check_temp_stat()

check_temp_stat(mixed $name[, mixed $color = false ]) : mixed
Parameters
$name : mixed
$color : mixed = false

suspend_temp_stats()

suspend_temp_stats() : mixed

restore_temp_stats()

restore_temp_stats() : mixed

valid_dk_title()

valid_dk_title(mixed $title, mixed $dks, mixed $gender) : mixed
Parameters
$title : mixed
$dks : mixed
$gender : mixed

get_dk_title()

get_dk_title(mixed $dks, mixed $gender[, mixed $ref = false ]) : mixed
Parameters
$dks : mixed
$gender : mixed
$ref : mixed = false

e_rand()

Alias of mt_rand with some improvements.

e_rand([int|float $min = null ][, int|float $max = null ]) : int
Parameters
$min : int|float = null
$max : int|float = null

r_rand()

Same as e_rand but $min and $max are multiplied by 1000.

r_rand([int|float $min = null ][, int|float $max = null ]) : int|float
Parameters
$min : int|float = null
$max : int|float = null

is_email()

Check if given email is valid.

is_email(string $email) : bool
Parameters
$email : string

arraytourl()

Turns an array into an URL argument string.

arraytourl(array<string|int, mixed> $array) : string

Takes an array and encodes it in key=val&key=val form. Does not add starting ?

Parameters
$array : array<string|int, mixed>

The array to turn into an URL

urltoarray()

Takes an array and returns its arguments in an array.

urltoarray(string $url) : array<string|int, mixed>
Parameters
$url : string

The URL

createstring()

Turns the given parameter into a string.

createstring(mixed $array) : string

If the given parameter is an array or object, it is serialized, and the serialized string is return.

Otherwise, the parameter is cast as a string and returned.

Parameters
$array : mixed

myDefine()

myDefine(mixed $name, mixed $value) : mixed
Parameters
$name : mixed
$value : mixed

list_files()

list_files(mixed $ruta, mixed $sort) : mixed
Parameters
$ruta : mixed
$sort : mixed

_curl()

_curl(mixed $url) : mixed
Parameters
$url : mixed

_sock()

_sock(mixed $url) : mixed
Parameters
$url : mixed

pullurl()

pullurl(mixed $url) : mixed
Parameters
$url : mixed

safeescape()

safeescape(mixed $input) : mixed
Parameters
$input : mixed

nltoappon()

nltoappon(mixed $in) : mixed
Parameters
$in : mixed

bell_rand()

bell_rand([mixed $min = false ][, mixed $max = false ]) : mixed
Parameters
$min : mixed = false
$max : mixed = false

Search results