Skip to content

Creature

tibiawikisql.models.creature

Classes:

Name Description
CreatureAbility

Represents a creature's ability.

CreatureDrop

Represents an item dropped by a creature.

CreatureMaxDamage

Represent a creature's max damage, broke down by damage type.

Creature

Represents a creature.

CreatureAbility pydantic-model

Bases: BaseModel

Represents a creature's ability.

Show JSON schema:
{
  "description": "Represents a creature's ability.",
  "properties": {
    "name": {
      "title": "Name",
      "type": "string"
    },
    "effect": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Effect"
    },
    "element": {
      "title": "Element",
      "type": "string"
    }
  },
  "required": [
    "name",
    "element"
  ],
  "title": "CreatureAbility",
  "type": "object"
}

Fields:

name pydantic-field
name: str

The name of the ability.

effect pydantic-field
effect: str | None = None

The effect of the ability, or the damage range.

element pydantic-field
element: str

The element of damage type of the ability. This could also be a status condition instead. For abilities that are just plain text, plain_text is set. For abilities that are not using the abilities templates in TibiaWiki, they are saved as a single entry with element: no_template.

CreatureDrop pydantic-model

Bases: BaseModel

Represents an item dropped by a creature.

Show JSON schema:
{
  "description": "Represents an item dropped by a creature.",
  "properties": {
    "item_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Item Id"
    },
    "item_title": {
      "title": "Item Title",
      "type": "string"
    },
    "min": {
      "title": "Min",
      "type": "integer"
    },
    "max": {
      "title": "Max",
      "type": "integer"
    },
    "chance": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Chance"
    }
  },
  "required": [
    "item_title",
    "min",
    "max"
  ],
  "title": "CreatureDrop",
  "type": "object"
}

Fields:

item_id pydantic-field
item_id: int | None = None

The article id of the item.

item_title pydantic-field
item_title: str

The title of the dropped item.

min pydantic-field
min: int

The minimum possible amount of the dropped item.

max pydantic-field
max: int

The maximum possible amount of the dropped item.

chance pydantic-field
chance: float | None = None

The chance percentage of getting this item dropped by this creature.

CreatureMaxDamage pydantic-model

Bases: BaseModel

Represent a creature's max damage, broke down by damage type.

Show JSON schema:
{
  "description": "Represent a creature's max damage, broke down by damage type.",
  "properties": {
    "physical": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Physical"
    },
    "fire": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Fire"
    },
    "ice": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Ice"
    },
    "earth": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Earth"
    },
    "energy": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Energy"
    },
    "holy": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Holy"
    },
    "death": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Death"
    },
    "drown": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Drown"
    },
    "lifedrain": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Lifedrain"
    },
    "manadrain": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Manadrain"
    },
    "summons": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Summons"
    },
    "total": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Total"
    }
  },
  "title": "CreatureMaxDamage",
  "type": "object"
}

Fields:

physical pydantic-field
physical: int | None = None

The maximum physical damage dealt by the creature. If it is unknown, but the creature does deal damage, it will be -1.

fire pydantic-field
fire: int | None = None

The maximum fire damage dealt by the creature. If it is unknown, but the creature does deal damage, it will be -1.

ice pydantic-field
ice: int | None = None

The maximum ice damage dealt by the creature. If it is unknown, but the creature does deal damage, it will be -1.

earth pydantic-field
earth: int | None = None

The maximum earth damage dealt by the creature. If it is unknown, but the creature does deal damage, it will be -1.

energy pydantic-field
energy: int | None = None

The maximum energy damage dealt by the creature. If it is unknown, but the creature does deal damage, it will be -1.

holy pydantic-field
holy: int | None = None

The maximum holy damage dealt by the creature. If it is unknown, but the creature does deal damage, it will be -1.

death pydantic-field
death: int | None = None

The maximum death damage dealt by the creature. If it is unknown, but the creature does deal damage, it will be -1.

drown pydantic-field
drown: int | None = None

The maximum drown damage dealt by the creature. If it is unknown, but the creature does deal damage, it will be -1.

lifedrain pydantic-field
lifedrain: int | None = None

The maximum life drain damage dealt by the creature. If it is unknown, but the creature does deal damage, it will be -1.

manadrain pydantic-field
manadrain: int | None = None

The maximum mana drain damage dealt by the creature. This is not counted as part of the total. If it is unknown, but the creature does deal damage, it will be -1.

summons pydantic-field
summons: int | None = None

The maximum damage dealt by the creature's summons. If it is unknown, but the creature does deal damage, it will be -1.

total pydantic-field
total: int | None = None

The maximum damage the creature can deal in a single turn. This doesn't count manadrain and summon damage. In most cases, this is simply the sum of the other damages, but in some cases, the amount may be different. If it is unknown, but the creature does deal damage, it will be -1.

Creature pydantic-model

Bases: WikiEntry, WithStatus, WithVersion, WithImage, RowModel

Represents a creature.

Show JSON schema:
{
  "$defs": {
    "CreatureAbility": {
      "description": "Represents a creature's ability.",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "effect": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Effect"
        },
        "element": {
          "title": "Element",
          "type": "string"
        }
      },
      "required": [
        "name",
        "element"
      ],
      "title": "CreatureAbility",
      "type": "object"
    },
    "CreatureDrop": {
      "description": "Represents an item dropped by a creature.",
      "properties": {
        "item_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Item Id"
        },
        "item_title": {
          "title": "Item Title",
          "type": "string"
        },
        "min": {
          "title": "Min",
          "type": "integer"
        },
        "max": {
          "title": "Max",
          "type": "integer"
        },
        "chance": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Chance"
        }
      },
      "required": [
        "item_title",
        "min",
        "max"
      ],
      "title": "CreatureDrop",
      "type": "object"
    },
    "CreatureMaxDamage": {
      "description": "Represent a creature's max damage, broke down by damage type.",
      "properties": {
        "physical": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Physical"
        },
        "fire": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Fire"
        },
        "ice": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Ice"
        },
        "earth": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Earth"
        },
        "energy": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Energy"
        },
        "holy": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Holy"
        },
        "death": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Death"
        },
        "drown": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Drown"
        },
        "lifedrain": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Lifedrain"
        },
        "manadrain": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Manadrain"
        },
        "summons": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Summons"
        },
        "total": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Total"
        }
      },
      "title": "CreatureMaxDamage",
      "type": "object"
    }
  },
  "description": "Represents a creature.",
  "properties": {
    "image": {
      "anyOf": [
        {
          "format": "binary",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Image"
    },
    "version": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Version"
    },
    "status": {
      "title": "Status",
      "type": "string"
    },
    "article_id": {
      "title": "Article Id",
      "type": "integer"
    },
    "title": {
      "title": "Title",
      "type": "string"
    },
    "timestamp": {
      "format": "date-time",
      "title": "Timestamp",
      "type": "string"
    },
    "article": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Article"
    },
    "name": {
      "title": "Name",
      "type": "string"
    },
    "plural": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Plural"
    },
    "library_race": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Library Race"
    },
    "creature_class": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Creature Class"
    },
    "type_primary": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Type Primary"
    },
    "type_secondary": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Type Secondary"
    },
    "bestiary_class": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Bestiary Class"
    },
    "bestiary_level": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Bestiary Level"
    },
    "bestiary_occurrence": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Bestiary Occurrence"
    },
    "bosstiary_class": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Bosstiary Class"
    },
    "hitpoints": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Hitpoints"
    },
    "experience": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Experience"
    },
    "armor": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Armor"
    },
    "mitigation": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Mitigation"
    },
    "speed": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Speed"
    },
    "runs_at": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Runs At"
    },
    "summon_cost": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Summon Cost"
    },
    "convince_cost": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Convince Cost"
    },
    "illusionable": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Illusionable"
    },
    "pushable": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pushable"
    },
    "push_objects": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Push Objects"
    },
    "sees_invisible": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Sees Invisible"
    },
    "paralysable": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Paralysable"
    },
    "spawn_type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Spawn Type"
    },
    "is_boss": {
      "title": "Is Boss",
      "type": "boolean"
    },
    "cooldown": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cooldown"
    },
    "modifier_physical": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Modifier Physical"
    },
    "modifier_earth": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Modifier Earth"
    },
    "modifier_fire": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Modifier Fire"
    },
    "modifier_energy": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Modifier Energy"
    },
    "modifier_ice": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Modifier Ice"
    },
    "modifier_death": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Modifier Death"
    },
    "modifier_holy": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Modifier Holy"
    },
    "modifier_drown": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Modifier Drown"
    },
    "modifier_lifedrain": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Modifier Lifedrain"
    },
    "modifier_healing": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Modifier Healing"
    },
    "abilities": {
      "default": [],
      "items": {
        "$ref": "#/$defs/CreatureAbility"
      },
      "title": "Abilities",
      "type": "array"
    },
    "max_damage": {
      "anyOf": [
        {
          "$ref": "#/$defs/CreatureMaxDamage"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "walks_through": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Walks Through"
    },
    "walks_around": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Walks Around"
    },
    "sounds": {
      "default": [],
      "items": {
        "type": "string"
      },
      "title": "Sounds",
      "type": "array"
    },
    "location": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Location"
    },
    "loot": {
      "default": [],
      "items": {
        "$ref": "#/$defs/CreatureDrop"
      },
      "title": "Loot",
      "type": "array"
    }
  },
  "required": [
    "version",
    "status",
    "article_id",
    "title",
    "timestamp",
    "article",
    "name",
    "plural",
    "library_race",
    "creature_class",
    "type_primary",
    "type_secondary",
    "bestiary_class",
    "bestiary_level",
    "bestiary_occurrence",
    "bosstiary_class",
    "hitpoints",
    "experience",
    "armor",
    "mitigation",
    "speed",
    "runs_at",
    "summon_cost",
    "convince_cost",
    "illusionable",
    "pushable",
    "push_objects",
    "sees_invisible",
    "paralysable",
    "spawn_type",
    "is_boss",
    "cooldown",
    "modifier_physical",
    "modifier_earth",
    "modifier_fire",
    "modifier_energy",
    "modifier_ice",
    "modifier_death",
    "modifier_holy",
    "modifier_drown",
    "modifier_lifedrain",
    "modifier_healing",
    "walks_through",
    "walks_around",
    "location"
  ],
  "title": "Creature",
  "type": "object"
}

Fields:

article pydantic-field
article: str | None

The article that goes before the name when looking at the creature.

name pydantic-field
name: str

The name of the creature, as displayed in-game.

plural pydantic-field
plural: str | None

The plural of the name.

library_race pydantic-field
library_race: str | None

The race name of the creature in Tibia.com's library.

creature_class pydantic-field
creature_class: str | None

The creature's classification.

type_primary pydantic-field
type_primary: str | None

The creature's type.

type_secondary pydantic-field
type_secondary: str | None

The creature's secondary type, if any.

bestiary_class pydantic-field
bestiary_class: str | None

The creature's bestiary class, if applicable.

bestiary_level pydantic-field
bestiary_level: str | None

The creature's bestiary level, from 'Trivial' to 'Hard'

bestiary_occurrence pydantic-field
bestiary_occurrence: str | None

The creature's bestiary occurrence, from 'Common' to 'Very Rare'.

bosstiary_class pydantic-field
bosstiary_class: str | None

The creature's bosstiary class, if applicable.

hitpoints pydantic-field
hitpoints: int | None

The creature's hitpoints, may be None if unknown.

experience pydantic-field
experience: int | None

Experience points yielded by the creature. Might be None if unknown.

armor pydantic-field
armor: int | None

The creature's armor value.

mitigation pydantic-field
mitigation: int | None

The creature's mitigation value.

speed pydantic-field
speed: int | None

The creature's speed value.

runs_at pydantic-field
runs_at: int | None

The amount of hitpoints when the creature starts to run away. 0 means it won't run away.

summon_cost pydantic-field
summon_cost: int | None

The mana needed to summon this creature. 0 if not summonable.

convince_cost pydantic-field
convince_cost: int | None

The mana needed to convince this creature. 0 if not convincible.

illusionable pydantic-field
illusionable: bool | None

Whether the creature can be illusioned into using Creature Illusion.

pushable pydantic-field
pushable: bool | None

Whether the creature can be pushed or not.

push_objects pydantic-field
push_objects: bool | None

Whether the creature can push objects or not.

sees_invisible pydantic-field
sees_invisible: bool | None

Whether the creature can see invisible players or not.

paralysable pydantic-field
paralysable: bool | None

Whether the creature can be paralyzed or not.

spawn_type pydantic-field
spawn_type: str | None

The way this creature spawns.

is_boss pydantic-field
is_boss: bool

Whether the creature is a boss or not.

cooldown pydantic-field
cooldown: float | None

The cooldown in hours to fight the boss again.

modifier_physical pydantic-field
modifier_physical: int | None

The percentage of damage received of physical damage. None if unknown.

modifier_earth pydantic-field
modifier_earth: int | None

The percentage of damage received of earth damage. None if unknown.

modifier_fire pydantic-field
modifier_fire: int | None

The percentage of damage received of fire damage. None if unknown.

modifier_energy pydantic-field
modifier_energy: int | None

The percentage of damage received of energy damage. None if unknown.

modifier_ice pydantic-field
modifier_ice: int | None

The percentage of damage received of ice damage. None if unknown.

modifier_death pydantic-field
modifier_death: int | None

The percentage of damage received of death damage. None if unknown.

modifier_holy pydantic-field
modifier_holy: int | None

The percentage of damage received of holy damage. None if unknown.

modifier_drown pydantic-field
modifier_drown: int | None

The percentage of damage received of drown damage. None if unknown.

modifier_lifedrain pydantic-field
modifier_lifedrain: int | None

The percentage of damage received of life drain damage. None if unknown.

modifier_healing pydantic-field
modifier_healing: int | None

The healing modifier. None if unknown.

abilities pydantic-field
abilities: list[CreatureAbility] = []

A list of the creature abilities.

max_damage pydantic-field
max_damage: CreatureMaxDamage | None = None

The maximum damage the creature can make.

walks_through pydantic-field
walks_through: str | None

The field types the creature will walk through, separated by commas.

walks_around pydantic-field
walks_around: str | None

The field types the creature will walk around, separated by commas.

sounds pydantic-field
sounds: list[str] = []

The "sounds" made by the creature.

location pydantic-field
location: str | None

The locations where the creature can be found.

loot pydantic-field
loot: list[CreatureDrop] = []

The items dropped by this creature.

bestiary_kills property
bestiary_kills: int | None

Get the total kills needed to complete the bestiary entry if applicable.

charm_points property
charm_points: int | None

Get the charm points awarded for completing the creature's bestiary entry, if applicable.

elemental_modifiers property
elemental_modifiers: dict[str, int]

Get a dictionary containing all elemental modifiers, sorted in descending order.

immune_to property
immune_to: list[str]

Get a list of the elements the creature is immune to.

weak_to property
weak_to: dict[str, int]

Get a dictionary containing the elements the creature is weak to and modifier.

resistant_to property
resistant_to: dict[str, int]

Get a dictionary containing the elements the creature is resistant to and modifier.

insert
insert(conn: Connection | Cursor) -> None

Insert the model into its respective database table.

Parameters:

Name Type Description Default
conn Connection | Cursor

A cursor or connection to the database.

required
Source code in tibiawikisql/models/creature.py
def insert(self, conn: Connection | Cursor) -> None:
    super().insert(conn)

    for drop in self.loot:
        drop.insert(conn, creature_id=self.article_id)
    for sound in self.sounds:
        CreatureSoundTable.insert(conn, creature_id=self.article_id, content=sound)
    for ability in self.abilities:
        CreatureAbilityTable.insert(conn, creature_id=self.article_id, **ability.model_dump())
    if self.max_damage:
        CreatureMaxDamageTable.insert(conn, creature_id=self.article_id, **self.max_damage.model_dump())
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 LIKE as a comparator instead of =.

False

Returns:

Type Description
Self | None

The object found, or None if no entries match.

Raises:

Type Description
ValueError

The specified field doesn't exist in the table.

Source code in tibiawikisql/models/creature.py
@classmethod
def get_one_by_field(cls, conn: Connection | Cursor, field: str, value: Any, use_like: bool = False) -> Self | None:
    creature: Self = super().get_one_by_field(conn, field, value, use_like)
    if creature is None:
        return None
    max_damage = CreatureMaxDamageTable.get_one_by_field(conn, "creature_id", creature.article_id)
    if max_damage:
        creature.max_damage = CreatureMaxDamage(**dict(max_damage))

    sounds = CreatureSoundTable.get_list_by_field(conn, "creature_id", creature.article_id)
    creature.sounds = [r["content"] for r in sounds]

    abilities = CreatureAbilityTable.get_list_by_field(conn, "creature_id", creature.article_id)
    creature.abilities = [CreatureAbility(**dict(r)) for r in abilities]

    drops = CreatureDropTable.get_by_creature_id(conn, creature.article_id)
    creature.loot = [CreatureDrop(**dict(r)) for r in drops]
    return creature