From a35d4f08a3f9f086eae94dccbfda2ff0c8eb5ae3 Mon Sep 17 00:00:00 2001 From: FrancescoBorzi Date: Mon, 25 Feb 2019 19:24:20 +0100 Subject: Import DB wiki from TC 335 --- .gitignore | 4 +- docs/Spell_system.md | 260 ++ docs/access_requirement.md | 252 +- docs/account.md | 461 ++- docs/account_access.md | 87 +- docs/account_banned.md | 130 +- docs/account_data.md | 102 +- docs/account_instance_times.md | 83 +- docs/account_tutorial.md | 158 +- docs/achievement_criteria_data.md | 365 +- docs/achievement_dbc.md | 213 +- docs/achievement_reward.md | 160 +- docs/achievement_reward_locale.md | 44 + docs/areatrigger_involvedrelation.md | 70 +- docs/areatrigger_scripts.md | 69 +- docs/areatrigger_tavern.md | 68 +- docs/areatrigger_teleport.md | 167 +- docs/areatrigger_template.md | 202 ++ docs/areatrigger_template_actions.md | 88 + docs/areatrigger_template_polygon_vertices.md | 139 + docs/arena_team.md | 271 +- docs/arena_team_member.md | 142 +- docs/auctionhouse.md | 192 +- docs/autobroadcast.md | 100 +- docs/battleground_deserters.md | 93 +- docs/battleground_template.md | 339 +- docs/battlemaster_entry.md | 68 +- docs/broadcast_text.md | 110 +- docs/channels.md | 164 +- docs/character_account_data.md | 104 +- docs/character_achievement.md | 82 +- docs/character_achievement_progress.md | 100 +- docs/character_action.md | 211 +- docs/character_arena_stats.md | 92 +- docs/character_aura.md | 264 +- docs/character_banned.md | 130 +- docs/character_battleground_data.md | 195 + docs/character_battleground_random.md | 53 +- docs/character_declinedname.md | 130 +- docs/character_equipmentsets.md | 366 +- docs/character_gifts.md | 102 +- docs/character_glyphs.md | 140 +- docs/character_homebind.md | 130 +- docs/character_instance.md | 86 +- docs/character_inventory.md | 217 +- docs/character_pet.md | 326 +- docs/character_pet_declinedname.md | 145 +- docs/character_queststatus.md | 291 +- docs/character_queststatus_daily.md | 83 +- docs/character_queststatus_rewarded.md | 83 +- docs/character_queststatus_seasonal.md | 83 +- docs/character_queststatus_weekly.md | 68 +- docs/character_reputation.md | 159 +- docs/character_skills.md | 100 +- docs/character_social.md | 125 +- docs/character_spell.md | 97 +- docs/character_spell_cooldown.md | 101 +- docs/character_stats.md | 490 ++- docs/character_talent.md | 79 +- docs/characters_table_.md | 1583 +++++++++ docs/conditions.md | 1630 ++++++++- docs/creature.md | 405 ++- docs/creature_addon.md | 264 +- docs/creature_classlevelstats.md | 194 +- docs/creature_equip_template.md | 120 +- docs/creature_formations.md | 177 +- docs/creature_model_info.md | 136 +- docs/creature_onkill_reputation.md | 230 +- docs/creature_questender.md | 68 +- docs/creature_queststarter.md | 68 +- docs/creature_respawn.md | 86 +- docs/creature_summon_groups.md | 272 +- docs/creature_template.md | 1270 ++++++- docs/creature_template_locale.md | 54 +- docs/creature_template_movement.md | 104 + docs/creature_text.md | 402 ++- docs/creature_text_locale.md | 44 + docs/disables.md | 229 +- docs/game_event.md | 188 +- docs/game_event_arena_seasons.md | 68 +- docs/game_event_battleground_holiday.md | 129 +- docs/game_event_condition.md | 130 +- docs/game_event_condition_save.md | 83 +- docs/game_event_creature.md | 71 +- docs/game_event_creature_quest.md | 83 +- docs/game_event_gameobject.md | 71 +- docs/game_event_gameobject_quest.md | 83 +- docs/game_event_model_equip.md | 105 +- docs/game_event_npc_vendor.md | 145 +- docs/game_event_npcflag.md | 85 +- docs/game_event_pool.md | 71 +- docs/game_event_prerequisite.md | 68 +- docs/game_event_quest_condition.md | 100 +- docs/game_event_save.md | 83 +- docs/game_event_seasonal_questrelation.md | 68 +- docs/game_tele.md | 139 +- docs/game_weather.md | 204 +- docs/gameobject.md | 322 +- docs/gameobject_questender.md | 68 +- docs/gameobject_queststarter.md | 68 +- docs/gameobject_respawn.md | 86 +- docs/gameobject_template.md | 1066 +++++- docs/gameobject_template_addon.md | 48 + docs/gameobject_template_locale.md | 55 +- docs/gm_subsurveys.md | 122 + docs/gm_surveys.md | 106 + docs/gm_ticket.md | 363 +- docs/gossip_menu.md | 75 +- docs/gossip_menu_option.md | 444 ++- docs/gossip_menu_option_action.md | 91 + docs/gossip_menu_option_locale.md | 232 ++ docs/graveyard_zone.md | 43 + docs/group_instance.md | 78 + docs/group_member.md | 187 +- docs/groups.md | 339 +- docs/guild.md | 220 +- docs/guild_bank_eventlog.md | 191 +- docs/guild_bank_item.md | 100 +- docs/guild_bank_right.md | 133 +- docs/guild_bank_tab.md | 115 +- docs/guild_eventlog.md | 155 +- docs/guild_member.md | 271 +- docs/guild_rank.md | 227 +- docs/instance.md | 131 +- docs/instance_encounters.md | 121 +- docs/instance_reset.md | 83 +- docs/instance_template.md | 104 +- docs/ip2nation.md | 25 +- docs/ip_banned.md | 115 +- docs/item_appearance.md | 46 + docs/item_effect.md | 120 + docs/item_enchantment_template.md | 83 +- docs/item_instance.md | 252 +- docs/item_loot_items.md | 206 ++ docs/item_loot_money.md | 68 + docs/item_modified_appearance.md | 60 + docs/item_refund_instance.md | 100 +- docs/item_set_names.md | 108 +- docs/item_set_names_locale.md | 162 + docs/item_soulbound_trade_data.md | 68 +- docs/item_sparse.md | 1488 ++++++++ docs/item_template.md | 3857 +++++++++++++++++++- docs/item_template_locale.md | 46 + docs/lag_reports.md | 147 +- docs/lfg_data.md | 83 +- docs/lfg_dungeon_encounters.md | 64 + docs/lfg_dungeon_rewards.md | 156 +- docs/lfg_entrances.md | 120 + docs/linked_respawn.md | 119 +- docs/logs.md | 134 +- docs/loot_template.md | 372 ++ docs/mail.md | 316 +- docs/mail_items.md | 83 +- docs/mail_level_reward.md | 101 +- docs/npc_spellclick_spells.md | 149 +- docs/npc_text.md | 1138 +++++- docs/npc_text_locale.md | 153 + docs/npc_trainer.md | 55 +- docs/npc_vendor.md | 137 +- docs/page_text.md | 97 +- docs/page_text_locale.md | 27 + docs/pet_aura.md | 249 +- docs/pet_levelstats.md | 81 +- docs/pet_name_generation.md | 104 +- docs/pet_spell.md | 83 +- docs/pet_spell_cooldown.md | 83 +- docs/petition.md | 133 +- docs/petition_sign.md | 148 +- docs/phase_area.md | 104 + docs/player_classlevelstats.md | 101 +- docs/player_factionchange_achievement.md | 66 +- docs/player_factionchange_items.md | 130 +- docs/player_factionchange_reputations.md | 70 +- docs/player_factionchange_spells.md | 70 +- docs/player_levelstats.md | 162 +- docs/player_xp_for_level.md | 70 +- docs/playercreateinfo.md | 162 +- docs/playercreateinfo_action.md | 160 +- docs/playercreateinfo_item.md | 102 +- docs/playercreateinfo_skills.md | 39 + docs/playercreateinfo_spell_custom.md | 100 +- docs/points_of_interest.md | 197 +- docs/points_of_interest_locale.md | 26 + docs/pool_creature.md | 105 +- docs/pool_gameobject.md | 106 +- docs/pool_pool.md | 105 +- docs/pool_quest.md | 83 +- docs/pool_quest_save.md | 68 +- docs/pool_template.md | 84 +- docs/pvpstats_battlegrounds.md | 149 +- docs/pvpstats_players.md | 216 +- docs/quest_details.md | 73 + docs/quest_greeting.md | 110 + docs/quest_objectives.md | 306 ++ docs/quest_offer_reward.md | 88 + docs/quest_poi.md | 173 +- docs/quest_poi_points.md | 49 +- docs/quest_request_items.md | 53 + docs/quest_template.md | 1723 ++++++++- docs/quest_template_addon.md | 368 +- docs/quest_template_locale.md | 148 + docs/realmcharacters.md | 84 +- docs/realmlist.md | 541 ++- docs/reputation_reward_rate.md | 104 +- docs/reputation_spillover_template.md | 227 +- docs/scene_template.md | 99 + docs/script_waypoint.md | 145 +- docs/scripts.md | 436 +++ docs/skill_discovery_template.md | 100 +- docs/skill_extra_item_template.md | 100 +- docs/skill_fishing_base_level.md | 68 +- docs/smart_scripts.md | 4699 ++++++++++++++++++++++++- docs/spawn_group.md | 32 + docs/spawn_group_template.md | 81 + docs/spell_area.md | 290 +- docs/spell_bonus_data.md | 175 +- docs/spell_custom_attr.md | 96 +- docs/spell_dbc.md | 3535 ++++++++++++++++++- docs/spell_enchant_proc_data.md | 100 +- docs/spell_group.md | 71 +- docs/spell_group_stack_rules.md | 40 +- docs/spell_learn_spell.md | 80 + docs/spell_linked_spell.md | 148 +- docs/spell_pet_auras.md | 98 +- docs/spell_proc.md | 622 +++- docs/spell_ranks.md | 88 +- docs/spell_required.md | 66 +- docs/spell_script_names.md | 70 +- docs/spell_target_position.md | 131 +- docs/spell_threat.md | 72 +- docs/spelldifficulty_dbc.md | 115 +- docs/trinity_string.md | 166 +- docs/uptime.md | 115 +- docs/vehicle_accessory.md | 206 +- docs/vehicle_template_accessory.md | 201 +- docs/version.md | 115 +- docs/warden_checks.md | 79 +- docs/waypoint_data.md | 110 +- docs/waypoints.md | 74 +- docs/worldstates.md | 767 +++- 240 files changed, 52683 insertions(+), 2552 deletions(-) create mode 100644 docs/Spell_system.md create mode 100644 docs/achievement_reward_locale.md create mode 100644 docs/areatrigger_template.md create mode 100644 docs/areatrigger_template_actions.md create mode 100644 docs/areatrigger_template_polygon_vertices.md create mode 100644 docs/character_battleground_data.md create mode 100644 docs/characters_table_.md create mode 100644 docs/creature_template_movement.md create mode 100644 docs/creature_text_locale.md create mode 100644 docs/gameobject_template_addon.md create mode 100644 docs/gm_subsurveys.md create mode 100644 docs/gm_surveys.md create mode 100644 docs/gossip_menu_option_action.md create mode 100644 docs/gossip_menu_option_locale.md create mode 100644 docs/graveyard_zone.md create mode 100644 docs/group_instance.md create mode 100644 docs/item_appearance.md create mode 100644 docs/item_effect.md create mode 100644 docs/item_loot_items.md create mode 100644 docs/item_loot_money.md create mode 100644 docs/item_modified_appearance.md create mode 100644 docs/item_set_names_locale.md create mode 100644 docs/item_sparse.md create mode 100644 docs/item_template_locale.md create mode 100644 docs/lfg_dungeon_encounters.md create mode 100644 docs/lfg_entrances.md create mode 100644 docs/loot_template.md create mode 100644 docs/npc_text_locale.md create mode 100644 docs/page_text_locale.md create mode 100644 docs/phase_area.md create mode 100644 docs/playercreateinfo_skills.md create mode 100644 docs/points_of_interest_locale.md create mode 100644 docs/quest_details.md create mode 100644 docs/quest_greeting.md create mode 100644 docs/quest_objectives.md create mode 100644 docs/quest_offer_reward.md create mode 100644 docs/quest_request_items.md create mode 100644 docs/quest_template_locale.md create mode 100644 docs/scene_template.md create mode 100644 docs/scripts.md create mode 100644 docs/spawn_group.md create mode 100644 docs/spawn_group_template.md create mode 100644 docs/spell_learn_spell.md diff --git a/.gitignore b/.gitignore index 191b112..0e43ad9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ _site -Gemfile.lock \ No newline at end of file +Gemfile.lock + +.idea/* diff --git a/docs/Spell_system.md b/docs/Spell_system.md new file mode 100644 index 0000000..8305cef --- /dev/null +++ b/docs/Spell_system.md @@ -0,0 +1,260 @@ +# Spell system + +### How do spells work? + +Behavior of each spell is defined in 3 places: database, spell scripts, and spell system code interpreting that database. Mortals should care mostly about first two which are discussed in this article. + +### Database + +The database part includes data extracted from client loaded from dbc files:  + +[Spell](Spell).dbc, ... + +As this data is extracted from client. It doesn't contain spells needed only serverside, those need to be added inside supplementary db tables in core which are emulating dbcs and have the same structure:  + +[spell\_dbc](spell_dbc) ****Note: ****Not longer used since Warlords of Draenor Expansion (see [Hotfixes](https://trinitycore.atlassian.net/wiki/display/tc/Hotfixes), at least spell, spell\_misc & spell\_effect)  + +[spelldifficulty\_dbc](spelldifficulty_dbc) + +Data stored in dbcs is extracted from client, ergo it may not be interpreted by TC properly, so it's meaning is a subject of changes and fixing, as dbcs contain most of the data needed by spell system to work. + +Data not needed by client for all spells is stored in following tables of world db: + +[conditions](conditions)  + +-CONDITION\_SOURCE\_TYPE\_SPELL\_IMPLICIT\_TARGET - allows you to define requirements for implicit area targets of the spell, only matching targets will be added to spell target list + +-CONDITION\_SOURCE\_TYPE\_SPELL - allows you to define requirements for caster/explicit target of the spell, if not met cast will fail + +-CONDITION\_SOURCE\_TYPE\_SPELL\_PROC - allows you to define requirements for actor and actionTarget, if not met proc will fail + +-CONDITION\_SOURCE\_TYPE\_SPELL\_CLICK\_EVENT + +-CONDITION\_SOURCE\_TYPE\_SPELL\_LOOT\_TEMPLATE + +-CONDITION\_SOURCE\_TYPE\_VEHICLE\_SPELL + +[spell\_area](spell_area) - defines if aura should be applied to an object in given area + +[spell\_enchant\_proc\_data](spell_enchant_proc_data) - defines behavior of item enchant procs + +[spell\_group\_stack\_rules](spell_group_stack_rules) - defines stacking rules for each group + +[spell\_group](spell_group) - allows grouping spells for convenient handling + +[spell\_learn\_spell](spell_learn_spell) - defines that learning a given spell should learn you other spell, if not provided in dbcs + +[spell\_linked\_spell](spell_linked_spell) - allows simple triggering spell casts on certain spell events + +[spell\_pet\_auras](spell_pet_auras) - defines if a certain aura on pet owner should be linked to other aura on pet + +spell\_proc\_event - defines a requirement which needs to be passed for proc event to occur + +[spell\_proc](spell_proc) - same as spell\_proc\_event, table in development + +[spell\_required](spell_required) - defines requirements for learning a spell + +[spell\_ranks](spell_ranks) - implements a concept of spell rank ingame + +[spell\_script\_names](spell_script_names) - binds spells to their spell scripts + +[spell\_target\_position](spell_target_position) - allows setting target location for certain spells + +[spell\_threat](spell_threat) - contains threat data for spells + +Developers are expected to fill those tables correctly to make spells work correctly. Please follow links for more details about each table. + +### Spell scripts + +Spell scripts are a way to provide a means of implementing more complicated behavior, which couldn't be placed in db. + +#### Generic structure + +``` cpp +// naming scheme: spell_[of who]_[spell name], for example spell_warl_banish, spell_deathwhisper_mana_barrier +class spell_class_your_name_here : public SpellScriptLoader +{ + public: + // should be the same as class name - name in "" is the one used by db in SpellScriptNames table + spell_class_your_name_here () : SpellScriptLoader("spell_class_your_name_here ") { } +  + // SpellScript object - alters behavior of Spell object ingame + class spell_class_your_name_here_SpellScript : public SpellScript + { + PrepareSpellScript(spell_class_your_name_here_SpellScript); + // bool Load() {return true;} - optional - allows loading script only in specific circumstances - see Optional loading below +  // bool Validate(SpellInfo const* /*spellInfo*/) - optional - allows checking data integrity - see Validation tests below + /* hooks here - described below*/ + + void Register() {/*hook registration here*/} + }; + // function creating script object - must be exactly like this one, but with your class name + SpellScript* GetSpellScript() const + { + return new spell_class_your_name_here_SpellScript(); + } +  + // AuraScript object - alters behavior of Aura object ingame + class spell_class_your_name_here_AuraScript : public AuraScript + { + PrepareAuraScript(spell_class_your_name_here_AuraScript); + + // bool Load() {return true;} - optional - allows loading script only in specific circumstances - see Optional loading below +  // bool Validate(SpellInfo const* /*spellInfo*/) - optional - allows checking data integrity - see Validation tests below + /* hooks here - described below*/ + void Register() {/*hook registration here*/} + }; + // function creating script object - must be exactly like this one, but with your class name + AuraScript* GetAuraScript() const + { + return new spell_class_your_name_here_AuraScript(); + } +}; +// this function call creates script loader object for us - seek that function at the end of the script file you're adding to +// if there's no such function see http://collab.kpsn.org/display/tc/How-to_CustomScript +void AddSC_class_spell_scripts() +{ + // an entry for our spell script loader, there may be other entries aswell + /* ... */ + new spell_class_your_name_here(); +} +``` + +As you see, there are 2 kinds of scripts: SpellScript and AuraScript. You may define both or just one of them in a single script. + +#### Binding your script to a spell/spells + +To make sure your script is executed you have to do two things (these are c++ requirements, I wish this was simpler). + +- create [spell\_script\_names](spell_script_names) entry - As you've seen above each SpellScript/AuraScript is put inside of SpellScriptLoader class. Constructor of that class contains single parameter, that parameter is the value of ScriptName column inside spell\_script\_names table. The table consists of pairs (spellIdToWhichYouBindTheScript, "spell\_script\_you\_re\_binding"). You can bind one script to many spells or many scripts to one spell. The latter is needed for example when you want to logically separate scripts of a spell when spell is affected by different talents. +- properly override AuraScript\* GetAuraScript() const or SpellScript\* GetSpellScript() const to create objects of your script +- make sure SpellScriptLoader of your script is created - add a call in AddSC\_XXXXX function. For more details on that, see [CustomScript](CustomScript) + +``` cpp +class spell_warl_unstable_affliction : public SpellScriptLoader +{ + public: + spell_warl_unstable_affliction() : SpellScriptLoader("spell_warl_unstable_affliction") { } +  + class spell_warl_unstable_affliction_AuraScript : public AuraScript + { + // required PrepareAuraScript macro + PrepareAuraScript(spell_warl_unstable_affliction_AuraScript); + /*...*/ + }; + AuraScript* GetAuraScript() const + { + return new spell_warl_unstable_affliction_AuraScript(); + } + /*...*/ +}; +/*...*/ +void AddSC_warlock_spell_scripts() +{ + new spell_warl_unstable_affliction(); +/*...*/ +} +``` + +#### Validation tests + +Overriding validate function allows you to check if data you're using in your script is present on core load. It's often used to check if spell used in script is still in database, as spells are often removed from client database when client version changes. + +When this function will return false, a "Spell \`%u\` did not pass Validate() function of script \`%s\` - script will be not added to the spell" error will appear in log. + +You don't need to check for presence of effects you bind hooks to - it's checked automatically and reported on startup by core for your convenience. + +##### Example - checks for existence of spells the script is using later: + +``` cpp + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R1) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R2)) + return false; + return true; + } +``` + +#### Optional loading + +Sometimes you may decide that you want your script only be present in some cases, bool Load() provides you a way to do so. When the function returns false your script will not be loaded to the object (Aura or Spell) - it will have no effect + +##### Example - we want to script only player casts: + +``` cpp + bool Load() + { + return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER; + } +``` + +#### AuraScript hooks + +TODO![(smile)](images/icons/emoticons/smile.png "(smile)"){.emoticon .emoticon-smile} + +#### SpellScript hooks + +TODO![(smile)](images/icons/emoticons/smile.png "(smile)"){.emoticon .emoticon-smile} + +#### Good practices: + +-always use Validate(SpellInfo const\*) function to check all data you use in script for presence + +-check for runtime errors, they often signal bad script behaviors + +-put full spell name in comment before the script - this helps finding the script by spell name + +``` cpp +// 781 - Disengage +class spell_hun_disengage : public SpellScriptLoader +``` + +#### Practical example on spell scripts + +``` cpp +// 781 - Disengage +class spell_hun_disengage : public SpellScriptLoader +{ + public: + spell_hun_disengage() : SpellScriptLoader("spell_hun_disengage") { } + class spell_hun_disengage_SpellScript : public SpellScript + { + PrepareSpellScript(spell_hun_disengage_SpellScript); + SpellCastResult CheckCast() + { + Unit* caster = GetCaster(); + if (caster->GetTypeId() == TYPEID_PLAYER && !caster->isInCombat()) + return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; + return SPELL_CAST_OK; + } + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_hun_disengage_SpellScript::CheckCast); + } + }; + SpellScript* GetSpellScript() const + { + return new spell_hun_disengage_SpellScript(); + } +}; +``` + +Going through line to line: + +TODO![(smile)](images/icons/emoticons/smile.png "(smile)"){.emoticon .emoticon-smile} + +- [How do spells work?](#Spellsystem-Howdospellswork?) +- [Database](#Spellsystem-Database) +- [Spell scripts](#Spellsystem-Spellscripts) + - [Generic structure](#Spellsystem-Genericstructure) + - [Binding your script to a spell/spells](#Spellsystem-Bindingyourscripttoaspell/spells) + - [Validation tests](#Spellsystem-Validationtests) + - [Example - checks for existence of spells the script is using later:](#Spellsystem-Example-checksforexistenceofspellsthescriptisusinglater:) + - [Optional loading](#Spellsystem-Optionalloading) + - [Example - we want to script only player casts:](#Spellsystem-Example-wewanttoscriptonlyplayercasts:) + - [AuraScript hooks](#Spellsystem-AuraScripthooks) + - [SpellScript hooks](#Spellsystem-SpellScripthooks) + - [Good practices:](#Spellsystem-Goodpractices:) + - [Practical example on spell scripts](#Spellsystem-Practicalexampleonspellscripts) + + diff --git a/docs/access_requirement.md b/docs/access_requirement.md index 9e5766f..7b386df 100644 --- a/docs/access_requirement.md +++ b/docs/access_requirement.md @@ -1,16 +1,236 @@ -[Database Structure](Database-Structure) > [World-Database](World-Database) > [access_requirement](access_requirement) - -Column | Type | Description ---- | --- | --- -MapId | mediumint(8) unsigned | -Difficulty | tinyint(3) unsigned | -Level_min | tinyint(3) unsigned | -Level_max | tinyint(3) unsigned | -Item_level | smallint(5) unsigned | -Item | mediumint(8) unsigned | -Item2 | mediumint(8) unsigned | -Quest_done_A | mediumint(8) unsigned | -Quest_done_H | mediumint(8) unsigned | -Completed_achievement | mediumint(8) unsigned | -Quest_failed_text | text | -Comment | text | +# access\_requirement + +`Back-to:World` + +**The \`access\_requirement\` table** + +This table contains the access requirements to enter an instance. + +**Structure** + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Field

Type

Attributes

Key

Null

Default

Extra

Comment

mapId

mediumint (8)

unsigned

PRI

NO

NULL


+


+

difficulty

tinyint(3)

unsigned

PRI

NO

0


+


+

level_min

tinyint(3)

unsigned


+

NO

0


+


+

level_max

tinyint(3)

unsigned


+

NO

0


+


+

item_levelsmallint(5)unsigned
+
NO0
+

+

item

mediumint(8)

unsigned


+

NO

0


+


+

item2

mediumint(8)

unsigned


+

NO

0


+


+

quest_done_A

mediumint(8)

unsigned


+

NO

0


+


+

quest_done_H

mediumint(8)

unsigned


+

NO

0


+


+

completed_achievement

mediumint(8)

unsigned


+

NO

0


+


+

quest_failed_text

text

signed


+

YES

NULL


+


+

comment

text

signed


+

YES

NULL


+


+

+ +**Description of the fields** + +### mapId + +This is the [access\_id](instance_template_2130198.html#instance_template-access_id) field from the [instance\_template](instance_template) table. It is an arbitrary number that merely links the requirements to an [instance\_template](instance_template), or [areatrigger\_teleport](areatrigger_teleport) + +### difficulty + +5 man dungeons - 0 for normal, 1 for heroic, 2 for epic (not used yet) + +10 man dungeons - 0 for normal, 2 for heroic + +25 man dungeons - 1 for normal, 3 for heroic + +### level\_min + +The minimum level that you must be in order to enter the instance. + +### level\_max + +The maximum level that you can be in order to enter the instance. + +### item\_level + +The at least required item level for a instance. + +- All WotLK Heroics require at least an average item level of 180. +- Trial of the Champion, Pit of Saron, and the Forge of Souls require an average item level of 200. +- Halls of Reflection requires an average item level of 219. + +### item + +An [item](item_template_2130222.html#item_template-entry) that you must have in your inventory to enter the instance. This item can not be in the bank. + +### item2 + +A second [item](item_template_2130222.html#item_template-entry) that you must have in your inventory. This item can not be in the bank. + +### quest\_done\_A + +A [quest](quest_template_2130261.html#quest_template-id) that you must have completed. This field is only for alliance. + +### quest\_done\_H + +A [quest](quest_template_2130261.html#quest_template-id) that you must have completed. This field is only for horde. + +### completed\_achievement + +An [achievement](Achievement) that must be completed by the player to enter an instance. + +### quest\_failed\_text + +The text that is shown if you try and enter the instance without having completed the quest. + +### comment + +This field is for any comment you want to make about the requirements. It is arbitrary text. \ No newline at end of file diff --git a/docs/account.md b/docs/account.md index 0e3473a..bc85ceb 100644 --- a/docs/account.md +++ b/docs/account.md @@ -1,25 +1,436 @@ -[Database Structure](Database-Structure) > [Auth-Database](Auth-Database) > [account](account) - -Column | Type | Description ---- | --- | --- -Id | int(10) unsigned | -Username | varchar(32) | -Sha_pass_hash | varchar(40) | -Sessionkey | varchar(80) | -V | varchar(64) | -S | varchar(64) | -Email | varchar(254) | -Joindate | timestamp | -Last_ip | varchar(15) | -Failed_logins | int(10) unsigned | -Locked | tinyint(3) unsigned | -Last_login | timestamp | -totaltime | int(10) unsigned [0] | total time played on all characters -Online | tinyint(3) unsigned | -Expansion | tinyint(3) unsigned | -Mutetime | bigint(20) | -Mutereason | varchar(255) | -Muteby | varchar(50) | -Locale | tinyint(3) unsigned | -Os | varchar(3) | -Recruiter | int(10) unsigned | +# account + +# Table: account** +** + +This table holds information on all available accounts. + +## Structure + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Field

Type

Attributes

Key

Null

Default

Extra

Comment

id

int(10)

unsigned

PRI

NO


+

Auto increment

Identifier

username

varchar(32)


+

UNI

NO

"


+


+

sha_pass_hash

varchar(40)


+


+

NO

"


+


+

sessionkey

varchar(80)


+


+

NO

"


+


+

v

varchar(64)


+


+

NO

"


+


+

s

varchar(64)


+


+

NO

"


+


+

token_keyvarchar(100)
+

+
NO''
+

+

email

varchar(255)


+


+

NO

"


+


+

reg_mailvarchar(255)
+

+
NO''
+

+

joindate

timestamp

signed


+

NO

CURRENT_TIMESTAMP


+


+

last_ip

varchar(15)


+


+

NO

127.0.0.1


+


+

failed_logins

int(10)

unsigned


+

NO

0


+


+

locked

tinyint(3)

unsigned


+

NO

0


+


+

last_login

timestamp

signed


+

NO

0000-00-00 00:00:00


+


+

online

tinyint(3)

signed


+

NO

0


+


+

expansion

tinyint(3)

unsigned


+

NO

2


+


+

mutetime

bigint(20)

signed


+

NO

0


+


+

mutereasonvarchar(255)signed
+
NO

"


+

+
mutebyvarchar(50)signed
+
NO

"


+

+

locale

tinyint(3)

unsigned


+

NO

0


+


+

os

varchar(3)

signed


+

NO

"


+


+

recruiter

int(10)

unsigned


+

NO

0


+


+

+ +## Description of the fields + +### id + +The unique account ID. + +### username + +The account user name. + +### sha\_pass\_hash + +This field contains the encrypted password. The encryption is SHA1 and is in the following format: username:password. The SQL to create the password (or to compare with the current hash) is: + +| Language | Code | +|----------|---------------------------------------------------------------------| +| SQL | SELECT SHA1(CONCAT(UPPER(\`username\`), ':', UPPER(<pass>))); | +| PHP | sha1(strtoupper($username).':'.strtoupper($password)); | + +### sessionkey + +`field-no-description|5` + +### v + +`field-no-description|6` + +### s + +`field-no-description|7` + +### **token\_key** + +The authenticator key. + +Key can be generated through the Google Authenticator API, a 3rd-party TOTP generator, or manually specified (must be a Base32-compliant expression that is 16 characters). + +Implementation link on Wikipedia for the Google Authenticator API + + + +### email + +The e-mail address associated with this account. + +### reg\_mail + +The registration e-mail address associated with this account. + +### joindate + +The date when the account was created. + +### last\_ip + +The last IP used by the person who logged in the account. + +### failed\_logins + +The number of failed logins attempted on the account. + +### locked + +Boolean 0 or 1 controlling if the account has been locked or not. This can be controlled with the ".account lock" GM command. If locked (1), the user can only log in with their [last\_ip](#account-last_ip). If unlocked (0), a user can log in from any IP, and their last\_ip will be updated if it is different. ".Ban account" does not lock it. + +### last\_login + +The date when the account was last logged into. + +### online + +Boolean 0 or 1 controlling if the account is currently logged in and online. + +### expansion + +Integer 0, 1 or 2 controlling if the client logged in on the account has any expansions. (for example if client is TBC, but expansion is set to 0, it will not be able to enter outlands and etc.) + +- 0 = Classic +- 1 = The Burning Crusade (TBC) +- 2 = Wrath of the Lich King (WotLK) +- 3 = Cataclysm +- 4 = Mist of Pandaria (MOP) +- 5 = Warlords of Draenor (WOD) +- 6 = Legion + +### mutetime + +The time, in Unix time, when the account will be unmuted. To see when mute will be expired you can use this query: + +``` cpp +SELECT FROM_UNIXTIME(`mutetime`); +``` + +### mutereason + +The reason for the mute. + +### muteby + +The character name with the rights to the .mute command that give the mute. + +### locale + +The locale used by the client logged into this account. If multiple locale data has been configured and added to the world servers, the world servers will return the proper locale strings to the client. See [localization IDs](Localization_lang) + +### os + +Stores information about client's OS. Used by Warden system. + +- Win +- Mac + +### recruiter + +The account ID of another account. Used for recuit-a-friend system. See [account.id](#account-id) + +## Attachments: + +![](images/icons/bullet_blue.gif){width="8" height="8"} [Vbd5vtN.png](attachments/2130004/2131663.png) (image/png) + diff --git a/docs/account_access.md b/docs/account_access.md index c376b61..6508ae4 100644 --- a/docs/account_access.md +++ b/docs/account_access.md @@ -1,7 +1,82 @@ -[Database Structure](Database-Structure) > [Auth-Database](Auth-Database) > [account_access](account_access) +# account\_access -Column | Type | Description ---- | --- | --- -Id | int(10) unsigned | -Gmlevel | tinyint(3) unsigned | -RealmID | int(11) | +`Back-to:Auth` + +**The \`account\_access\` table** + +This table holds security access level for any realm in [realmlist](realmlist) table. + +**Structure** + + ++++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Field

Type

Attributes

Key

Null

Default

Extra

Comment

id

int(10)

unsigned

PRI

NO

 

 

 

gmlevel

tinyint(3)

unsigned

 

NO

 

 

 

RealmID

int(11)

signed

PRI

NO

+
+
-1
+
+

 

 

+ +**Description of the fields** + +### id + +The [account ID](account_2130004.html#account-id). + +### gmlevel + +The account security level. Different levels have access to different commands. The individual level required for a command is defined in the [command](command) table in each realm. + +### RealmID + +The [Realm ID](realmlist_2130016.html#realmlist-id). diff --git a/docs/account_banned.md b/docs/account_banned.md index b4cd94a..7ce16cd 100644 --- a/docs/account_banned.md +++ b/docs/account_banned.md @@ -1,10 +1,120 @@ -[Database Structure](Database-Structure) > [Auth-Database](Auth-Database) > [account_banned](account_banned) - -Column | Type | Description ---- | --- | --- -Id | int(10) unsigned | -Bandate | int(10) unsigned | -Unbandate | int(10) unsigned | -Bannedby | varchar(50) | -Banreason | varchar(255) | -Active | tinyint(3) unsigned | +# account\_banned + +`Back-to:Auth` + +**The \`account\_banned\` table** + +This table lists all of the accounts that have been banned along with the date when (or if) the ban will expire. + +**Structure** + + ++++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Field

Type

Attributes

Key

Null

Default

Extra

Comment

id

int(10)

unsigned

PRI

NO

0

 

Account id

bandate

int(10)

signed

PRI

NO

0

 

 

unbandate

int(10)

unsigned

 

NO

0

 

 

bannedby

varchar(50)

signed

 

NO

 

 

 

banreason

varchar(255)

signed

 

NO

 

 

 

active

tinyint(3)

signed

 

NO

1

 

 

+ +**Description of the fields** + +### id + +The account ID. See [account.id](account_2130004.html#account-id). + +### bandate + +The date when the account was banned, in Unix time. + +### unbandate + +The date when the account will be automatically unbanned, in Unix time. A value less than the current date means, in effect, a permanent ban. + +### bannedby + +The character with the rights to the .ban command that banned the account. + +### banreason + +The reason for the ban. + +### active + +Boolean 0 or 1 controlling if the ban is currently active or not. diff --git a/docs/account_data.md b/docs/account_data.md index 0f3126d..11e9ff4 100644 --- a/docs/account_data.md +++ b/docs/account_data.md @@ -1,8 +1,94 @@ -[Database Structure](Database-Structure) > [Character-Database](Character-Database) > [account_data](account_data) - -Column | Type | Description ---- | --- | --- -AccountId | int(10) unsigned | -Type | tinyint(3) unsigned | -Time | int(10) unsigned | -Data | blob | +# account\_data + +`Back-to:Characters` + +**The \`account\_data\` table** + +Contains data about client account and settings. + +**Structure** + + ++++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Field

Type

Attributes

Key

Null

Default

Extra

Comment

account

int(10)

unsigned

PRI

NO

0

 

 

type

tinyint(3)

unsigned

PRI

NO

0

 

 

time

int(10)

unsigned

 

NO

0

 

 

data

blob

signed

 

NO

 

 

 

+ +**Description of the fields** + +### account + +[Account.id](account_2130004.html#account-id). + +### type + +- 0 = Global-account config cache +- 2 = Global-account bindings cache +- 4 = Global-account macros cache + +### time + +Time of last modification in Unixtime + +### data + +No description can be written. You just must understand it's data. diff --git a/docs/account_instance_times.md b/docs/account_instance_times.md index 1c8f60e..f049a18 100644 --- a/docs/account_instance_times.md +++ b/docs/account_instance_times.md @@ -1,7 +1,78 @@ -[Database Structure](Database-Structure) > [Character-Database](Character-Database) > [account_instance_times](account_instance_times) +# account\_instance\_times -Column | Type | Description ---- | --- | --- -AccountId | int(10) unsigned | -InstanceId | int(10) unsigned | -ReleaseTime | bigint(20) unsigned | +`Back-to:Characters` + +**The \`account\_instance\_times\` table** + +This table controls how many instances the account's characters have been in last 1 hour. If there is 5 records per account, the player won't be able to enter another instance. + +**Structure** + + ++++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Field

Type

Attributes

Key

Null

Default

Extra

Comment

accountId

int(10)

unsigned

PRI

NO

 

 

 

instanceId

int(10)

unsigned

PRI

NO

0

 

 

releaseTime

bigint(20)

unsigned

 

NO

0

 

 

+ +**Description of the fields** + +### accountId + +Account of the player. See [account.id](account_2130004.html#account-id). + +### instanceId + +This is the instance.id which characters of this account has been past 5 hours. + +### releaseTime + +The time when the instances should be allowed again measured in Unix time. diff --git a/docs/account_tutorial.md b/docs/account_tutorial.md index b543bf1..6ee1bf3 100644 --- a/docs/account_tutorial.md +++ b/docs/account_tutorial.md @@ -1,13 +1,145 @@ -[Database Structure](Database-Structure) > [Character-Database](Character-Database) > [account_tutorial](account_tutorial) - -Column | Type | Description ---- | --- | --- -AccountId | int(10) unsigned | -Tut0 | int(10) unsigned | -Tut1 | int(10) unsigned | -Tut2 | int(10) unsigned | -Tut3 | int(10) unsigned | -Tut4 | int(10) unsigned | -Tut5 | int(10) unsigned | -Tut6 | int(10) unsigned | -Tut7 | int(10) unsigned | +# account\_tutorial + +`Back-to:Characters` + +**The \`account\_tutorial\` table** + +This table is used to store the tutorial state of all the accounts. + +**Structure** + + ++++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Field

Type

Attributes

Key

Null

Default

Extra

Comment

accountId

int(10)

unsigned

PRI

NO

0

Unique

Account Identifier

tut0

int(10)

unsigned

 

NO

0

 

 

tut1

int(10)

unsigned

 

NO

0

 

 

tut2

int(10)

unsigned

 

NO

0

 

 

tut3

int(10)

unsigned

 

NO

0

 

 

tut4

int(10)

unsigned

 

NO

0

 

 

tut5

int(10)

unsigned

 

NO

0

 

 

tut6

int(10)

unsigned

 

NO

0

 

 

tut7

int(10)

unsigned

 

NO

0

 

 

+ +**Description of the fields** + +### guid + +Account of the player. See [account.id](account_2130004.html#account-id). + +### tut0-7 + +These values 32bits flags. So 8 x 32bits values makes 256 bits available to store 256 tutorial messages status. + +Each bit means: + +``` cpp + 0 - Not yet shown + 1 - Shown +``` + +This is used to diplay only tutorial messages the character did not see before. + +Unselecting the "Show tutorial" option in game, makes all bits to be set, so all tutX columns will contain then 11111111111111111111111111111111 binary = 4294967295 in decimal after this option is changed. diff --git a/docs/achievement_criteria_data.md b/docs/achievement_criteria_data.md index da05861..36803c3 100644 --- a/docs/achievement_criteria_data.md +++ b/docs/achievement_criteria_data.md @@ -1,9 +1,356 @@ -[Database Structure](Database-Structure) > [World-Database](World-Database) > [achievement_criteria_data](achievement_criteria_data) - -Column | Type | Description ---- | --- | --- -Criteria_id | mediumint(8) | -Type | tinyint(3) unsigned | -Value1 | mediumint(8) unsigned | -Value2 | mediumint(8) unsigned | -ScriptName | char(64) | +# achievement\_criteria\_data + +` Back-to:World ` + +**The \`achievement\_criteria\_data\` table** + +This table contains the data that a player needs to obtain / complete in order to receive a given achievement. + +**Structure** + + ++++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Field

Type

Attributes

Key

Null

Default

Extra

Comment

criteria_id

mediumint(8)

signed

PRI

NO

NULL

 

 

type

tinyint(3)

unsigned

PRI

NO

0

 

 

value1

medium(8)

unsigned

 

NO

0

 

 

value2

medium(8)

unsigned

 

NO

0

 

 

ScriptName

char(64)

signed

 

NO

 

 

 

+ +**Description of the fields** + +### criteria\_id + +This is the ID from [Achievement\_Criteria.dbc](http://collab.kpsn.org/display/tc/Achievement+Criteria). + +### type + +Depending on this value, it will determine how value1 and value2 are used. + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Type

Name

0

TYPE_NONE

1

TYPE_T_CREATURE

2

TYPE_T_PLAYER_CLASS_RACE

3

TYPE_T_PLAYER_LESS_HEALTH

4

TYPE_T_PLAYER_DEAD

5

TYPE_S_AURA

6

TYPE_S_AREA

7

TYPE_T_AURA

8

TYPE_VALUE

9

TYPE_T_LEVEL

10

TYPE_T_GENDER

11

TYPE_SCRIPT

12

TYPE_MAP_DIFFICULTY

13

TYPE_MAP_PLAYER_COUNT

14

TYPE_T_TEAM

15

TYPE_S_DRUNK

16

TYPE_HOLIDAY

17

TYPE_BG_LOSS_TEAM_SCORE

18

TYPE_INSTANCE_SCRIPT

19

TYPE_S_EQUIPED_ITEM

20

TYPE_MAP_ID

21

TYPE_S_PLAYER_CLASS_RACE

22TYPE_NTH_BIRTHDAY
23TYPE_S_KNOWN_TITLE
+ +### value1 + +\***TYPE\_T\_CREATURE** + +- - The target here must be a valid entry from creature\_template + +\***TYPE\_T\_PLAYER\_CLASS\_RACE** + +- - The target here is a valid class (paste class list). value2 must also be set + +\***TYPE\_T\_PLAYER\_LESS\_HEALTH** + +- - The percentage of h