Schema
tibiawikisql.schema
¶
Defines the SQL schemas to use.
Classes:
| Name | Description |
|---|---|
AchievementTable |
Contains achievements from the game. |
CharmTable |
Contains information about charms. |
CreatureTable |
Contains information about creatures. |
CreatureAbilityTable |
Contains the abilities a creature can do. |
CreatureMaxDamageTable |
Contains information about the max damage a creature can deal. |
CreatureSoundTable |
Contains the "sounds" a creature can do. |
ItemTable |
Contains information about items and objects. |
ItemSoundTable |
Contains the "sounds" an item can do when used. |
ItemStoreOfferTable |
Contains the Tibia store offers for an item. |
CreatureDropTable |
Contains the items that a creature can drop. |
ItemAttributeTable |
Contains additional attributes for an item. |
BookTable |
Table to store information about books. |
DatabaseInfoTable |
Contains information about the database. |
HouseTable |
Contains information about houses and guildhalls. |
ImbuementTable |
Contains information about imbuements. |
ImbuementMaterialTable |
Contains the materials needed for imbuements. |
ItemKeyTable |
Contains information about keys. |
MapTable |
Contains map images. |
SpellTable |
Contains information about spells. |
NpcTable |
Contains information about NPCs. |
NpcJobTable |
Contains NPC jobs. |
NpcRaceTable |
Contains NPC races. |
NpcBuyingTable |
Table storing the sitems an NPC buys. |
NpcSellingTable |
Table storing the sitems an NPC sells. |
NpcDestinationTable |
Table containing the destinations an NPC can take the player to. |
NpcSpellTable |
Stores spells taught by NPCs. |
OutfitTable |
Table containing information about outfits. |
OutfitImageTable |
Table containing the different images to represent an outfit and its addon. |
QuestTable |
Table to store information about quests. |
OutfitQuestTable |
Table that stores the outfits unlocked by a quest. |
QuestDangerTable |
Table that stores the creatures faced in a quest. |
QuestRewardTable |
Table containing the item rewards for a quest. |
RashidPositionTable |
Stores information about the location of the NPC rashid on each day. |
WorldTable |
Stores information about game worlds. |
MountTable |
Stores information about mounts. |
UpdateTable |
Stores information about game updates. |
Functions:
| Name | Description |
|---|---|
create_tables |
Create all the tables in the database. |
CreatureMaxDamageTable
¶
NpcSpellTable
¶
Bases: Table
Stores spells taught by NPCs.
Attributes:
| Name | Type | Description |
|---|---|---|
npc_id |
Foreign key to NPC's article ID. |
|
spell_id |
Foreign key to spell's article ID. |
|
knight |
Whether the NPC teaches the spell to knights. |
|
sorcerer |
Whether the NPC teaches the spell to sorcerers. |
|
paladin |
Whether the NPC teaches the spell to paladins. |
|
druid |
Whether the NPC teaches the spell to druids. |
|
monk |
Whether the NPC teaches the spell to monks. |
Methods:
| Name | Description |
|---|---|
get_by_npc_id |
Get the entries corresponding to a given NPC, with additional information about the spell. |
get_by_spell_id |
Get entries matching the spell's article ID, joining additional data about the NPC. |
get_by_npc_id
classmethod
¶
get_by_npc_id(
conn: Connection | Cursor, npc_id: int
) -> list[Row]
Get the entries corresponding to a given NPC, with additional information about the spell.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conn
|
Connection | Cursor
|
Connection to the database. |
required |
npc_id
|
int
|
The article ID of the NPC. |
required |
Returns:
| Type | Description |
|---|---|
list[Row]
|
A list of rows matching the parameters. |
Source code in tibiawikisql/schema.py
get_by_spell_id
classmethod
¶
get_by_spell_id(
conn: Connection | Cursor, spell_id: int
) -> list[Row]
Get entries matching the spell's article ID, joining additional data about the NPC.
The schema returned is compatible with the [SpellTeacher][] model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conn
|
Connection | Cursor
|
A connection to the database. |
required |
spell_id
|
int
|
The article ID of the spell. |
required |
Returns:
| Type | Description |
|---|---|
list[Row]
|
The rows containing the NPCs that teach the spell. |
Source code in tibiawikisql/schema.py
OutfitImageTable
¶
OutfitQuestTable
¶
Bases: Table
Table that stores the outfits unlocked by a quest.
Methods:
| Name | Description |
|---|---|
get_list_by_outfit_id |
Get all entries related to a specific outfit, joining quest titles. |
get_list_by_outfit_id
classmethod
¶
get_list_by_outfit_id(
conn: Connection | Cursor, outfit_id: int
) -> list[Row] | list[dict[str, Any]]
Get all entries related to a specific outfit, joining quest titles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conn
|
Connection | Cursor
|
A connection to the database. |
required |
outfit_id
|
int
|
The article ID of the outfit. |
required |
Returns:
| Type | Description |
|---|---|
list[Row] | list[dict[str, Any]]
|
The rows matching the criteria. |
Source code in tibiawikisql/schema.py
QuestDangerTable
¶
Bases: Table
Table that stores the creatures faced in a quest.
Methods:
| Name | Description |
|---|---|
get_list_by_quest_id |
Get all entries related to a specific quest, joining creature titles. |
get_list_by_quest_id
classmethod
¶
get_list_by_quest_id(
conn: Connection | Cursor, quest_id: int
) -> list[Row] | list[dict[str, Any]]
Get all entries related to a specific quest, joining creature titles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conn
|
Connection | Cursor
|
A connection to the database. |
required |
quest_id
|
int
|
The article ID of the quest. |
required |
Returns:
| Type | Description |
|---|---|
list[Row] | list[dict[str, Any]]
|
The rows matching the criteria. |
Source code in tibiawikisql/schema.py
QuestRewardTable
¶
Bases: Table
Table containing the item rewards for a quest.
Methods:
| Name | Description |
|---|---|
get_list_by_item_id |
Get all entries related to a specific item, joining quest titles. |
get_list_by_quest_id |
Get all entries related to a specific quest, joining item titles. |
get_list_by_item_id
classmethod
¶
Get all entries related to a specific item, joining quest titles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conn
|
Connection | Cursor
|
A connection to the database. |
required |
item_id
|
int
|
The article ID of the item. |
required |
Returns:
| Type | Description |
|---|---|
list[Row] | list[dict[str, Any]]
|
The rows matching the criteria. |
Source code in tibiawikisql/schema.py
get_list_by_quest_id
classmethod
¶
get_list_by_quest_id(
conn: Connection | Cursor, quest_id: int
) -> list[Row] | list[dict[str, Any]]
Get all entries related to a specific quest, joining item titles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conn
|
Connection | Cursor
|
A connection to the database. |
required |
quest_id
|
int
|
The article ID of the quest. |
required |
Returns:
| Type | Description |
|---|---|
list[Row] | list[dict[str, Any]]
|
The rows matching the criteria. |
Source code in tibiawikisql/schema.py
RashidPositionTable
¶
create_tables
¶
create_tables(conn: Connection | Cursor) -> None
Create all the tables in the database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conn
|
Connection | Cursor
|
A connection to the database. |
required |