Spell
tibiawikisql.models.spell
¶
Classes:
| Name | Description |
|---|---|
SpellTeacher |
An NPC that teaches the spell. |
Spell |
Represents a Spell. |
SpellTeacher
pydantic-model
¶
Bases: BaseModel
An NPC that teaches the spell.
Note that even if the spell can be learned by multiple vocations, an NPC might only teach it to a specific vocation.
Show JSON schema:
{
"description": "An NPC that teaches the spell.\n\nNote that even if the spell can be learned by multiple vocations, an NPC might only teach it to a specific vocation.",
"properties": {
"npc_id": {
"title": "Npc Id",
"type": "integer"
},
"npc_title": {
"title": "Npc Title",
"type": "string"
},
"npc_city": {
"title": "Npc City",
"type": "string"
},
"knight": {
"title": "Knight",
"type": "boolean"
},
"paladin": {
"title": "Paladin",
"type": "boolean"
},
"druid": {
"title": "Druid",
"type": "boolean"
},
"sorcerer": {
"title": "Sorcerer",
"type": "boolean"
},
"monk": {
"title": "Monk",
"type": "boolean"
}
},
"required": [
"npc_id",
"npc_title",
"npc_city",
"knight",
"paladin",
"druid",
"sorcerer",
"monk"
],
"title": "SpellTeacher",
"type": "object"
}
Fields:
-
npc_id(int) -
npc_title(str) -
npc_city(str) -
knight(bool) -
paladin(bool) -
druid(bool) -
sorcerer(bool) -
monk(bool)
Spell
pydantic-model
¶
Bases: WikiEntry, WithVersion, WithStatus, WithImage, RowModel
Represents a Spell.
Show JSON schema:
{
"$defs": {
"SpellTeacher": {
"description": "An NPC that teaches the spell.\n\nNote that even if the spell can be learned by multiple vocations, an NPC might only teach it to a specific vocation.",
"properties": {
"npc_id": {
"title": "Npc Id",
"type": "integer"
},
"npc_title": {
"title": "Npc Title",
"type": "string"
},
"npc_city": {
"title": "Npc City",
"type": "string"
},
"knight": {
"title": "Knight",
"type": "boolean"
},
"paladin": {
"title": "Paladin",
"type": "boolean"
},
"druid": {
"title": "Druid",
"type": "boolean"
},
"sorcerer": {
"title": "Sorcerer",
"type": "boolean"
},
"monk": {
"title": "Monk",
"type": "boolean"
}
},
"required": [
"npc_id",
"npc_title",
"npc_city",
"knight",
"paladin",
"druid",
"sorcerer",
"monk"
],
"title": "SpellTeacher",
"type": "object"
}
},
"description": "Represents a Spell.",
"properties": {
"image": {
"anyOf": [
{
"format": "binary",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Image"
},
"status": {
"title": "Status",
"type": "string"
},
"version": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Version"
},
"article_id": {
"title": "Article Id",
"type": "integer"
},
"title": {
"title": "Title",
"type": "string"
},
"timestamp": {
"format": "date-time",
"title": "Timestamp",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"words": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Words"
},
"effect": {
"title": "Effect",
"type": "string"
},
"spell_type": {
"title": "Spell Type",
"type": "string"
},
"group_spell": {
"title": "Group Spell",
"type": "string"
},
"group_secondary": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Group Secondary"
},
"group_rune": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Group Rune"
},
"element": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Element"
},
"mana": {
"title": "Mana",
"type": "integer"
},
"soul": {
"title": "Soul",
"type": "integer"
},
"price": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Price"
},
"cooldown": {
"title": "Cooldown",
"type": "integer"
},
"cooldown2": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Cooldown2"
},
"cooldown3": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Cooldown3"
},
"cooldown_group": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Cooldown Group"
},
"cooldown_group_secondary": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Cooldown Group Secondary"
},
"level": {
"title": "Level",
"type": "integer"
},
"is_premium": {
"title": "Is Premium",
"type": "boolean"
},
"is_promotion": {
"title": "Is Promotion",
"type": "boolean"
},
"is_wheel_spell": {
"title": "Is Wheel Spell",
"type": "boolean"
},
"is_passive": {
"title": "Is Passive",
"type": "boolean"
},
"knight": {
"default": false,
"title": "Knight",
"type": "boolean"
},
"paladin": {
"default": false,
"title": "Paladin",
"type": "boolean"
},
"druid": {
"default": false,
"title": "Druid",
"type": "boolean"
},
"sorcerer": {
"default": false,
"title": "Sorcerer",
"type": "boolean"
},
"monk": {
"default": false,
"title": "Monk",
"type": "boolean"
},
"taught_by": {
"items": {
"$ref": "#/$defs/SpellTeacher"
},
"title": "Taught By",
"type": "array"
}
},
"required": [
"status",
"version",
"article_id",
"title",
"timestamp",
"name",
"effect",
"spell_type",
"group_spell",
"mana",
"soul",
"cooldown",
"cooldown2",
"cooldown3",
"level",
"is_premium",
"is_promotion",
"is_wheel_spell",
"is_passive"
],
"title": "Spell",
"type": "object"
}
Fields:
-
image(bytes | None) -
status(str) -
version(str | None) -
article_id(int) -
title(str) -
timestamp(datetime) -
name(str) -
words(str | None) -
effect(str) -
spell_type(str) -
group_spell(str) -
group_secondary(str | None) -
group_rune(str | None) -
element(str | None) -
mana(int) -
soul(int) -
price(int | None) -
cooldown(int) -
cooldown2(int | None) -
cooldown3(int | None) -
cooldown_group(int | None) -
cooldown_group_secondary(int | None) -
level(int) -
is_premium(bool) -
is_promotion(bool) -
is_wheel_spell(bool) -
is_passive(bool) -
knight(bool) -
paladin(bool) -
druid(bool) -
sorcerer(bool) -
monk(bool) -
taught_by(list[SpellTeacher])
group_rune
pydantic-field
¶
group_rune: str | None = None
The group of the rune created by this spell.
cooldown2
pydantic-field
¶
cooldown2: int | None
The spell's individual cooldown for the level 2 perk of the Wheel of Destiny.
cooldown3
pydantic-field
¶
cooldown3: int | None
The spell's individual cooldown for the level 3 perk of the Wheel of Destiny.
cooldown_group
pydantic-field
¶
cooldown_group: int | None = None
The spell's group cooldown in seconds. The time you have to wait before casting another spell in the same group.
cooldown_group_secondary
pydantic-field
¶
cooldown_group_secondary: int | None = None
The spell's secondary group cooldown.
is_promotion
pydantic-field
¶
is_promotion: bool
Whether you need to be promoted to buy or cast this spell.
is_wheel_spell
pydantic-field
¶
is_wheel_spell: bool
Whether this spell is acquired through the Wheel of Destiny.
is_passive
pydantic-field
¶
is_passive: bool
Whether this spell is triggered automatically without casting.
get_one_by_field
classmethod
¶
get_one_by_field(
conn: Connection | Cursor,
field: str,
value: Any,
use_like: bool = False,
) -> Self | None
Get a single element matching the field's value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conn
|
Connection | Cursor
|
A connection or cursor of the database. |
required |
field
|
str
|
The field to filter with. |
required |
value
|
Any
|
The value to look for. |
required |
use_like
|
bool
|
Whether to use |
False
|
Returns:
| Type | Description |
|---|---|
Self | None
|
The object found, or |
Raises:
| Type | Description |
|---|---|
ValueError
|
The specified field doesn't exist in the table. |