Enums & Constants
TeamEnum (Target types for addSpell)
| Value | Name | Description |
|---|---|---|
0 | Enemy | Any enemy |
1 | Ally | Any ally |
2 | Self | Self only |
3 | EnemyAdjacent | Adjacent enemy |
4 | AllyAdjacent | Adjacent ally |
5 | SelfAdjacent | Self if adjacent |
6 | EnemySummon | Enemy summons only |
7 | EnemyNotSummon | Enemy non-summons |
8 | AllySummon | Ally summons |
9 | AllyNotSummon | Ally non-summons |
10 | EnemySummonAdjacent | Adjacent enemy summon |
11 | EnemyNotSummonAdjacent | Adjacent enemy non-summon |
12 | AllySummonAdjacent | Adjacent ally summon |
13 | AllyNotSummonAdjacent | Adjacent ally non-summon |
TacticEnum (playTurn tactic)
| Value | Name | Description |
|---|---|---|
0 | Imobile | Stay in place, cast from current cell |
1 | HandToHand | Move to melee range, then cast |
2 | Distance | Stay at range, cast from afar |
3 | NoAction | Skip all turns |
4 | Advanced | Built-in advanced AI |
5 | AdvancedInScript | Lua script handles fight via callbacks |
BreedEnum (Character class IDs)
| Value | Name |
|---|---|
1 | Feca |
2 | Osamodas |
3 | Enutrof |
4 | Sram |
5 | Xelor |
6 | Ecaflip |
7 | Eniripsa |
8 | Iop |
9 | Cra |
10 | Sadida |
11 | Sacrieur |
12 | Pandawa |
13 | Rogue |
14 | Masqueraider |
15 | Steamer (Foggernaut) |
Default Attack Spells by Breed
DirectionEnum
| Value | Name |
|---|---|
0 | RIGHT |
1 | DOWN_RIGHT |
2 | DOWN |
3 | DOWN_LEFT |
4 | LEFT |
5 | UP_LEFT |
6 | UP |
7 | UP_RIGHT |
StatEnum
| Value | Name | Description |
|---|---|---|
-1 | NONE | No stat |
10 | STRENGHT | Earth / Strength |
11 | VITALITY | Vitality |
12 | WISDOM | Wisdom |
13 | CHANCE | Water |
14 | AGILITY | Air |
15 | INTEL | Fire / Intelligence |
Entity Model (Fight Entity Object)
Returned byfightAction:getAllEntities() and fightSlave:entity().
| Field | Type | Description |
|---|---|---|
Team | boolean | true = ally, false = enemy |
LifePoints | int | Current HP |
MaxLifePoints | int | Max HP |
CellId | int | Current cell position |
CreatureGenericId | int | Monster/creature template ID |
AP | int | Current Action Points |
MP | int | Current Movement Points |
Level | int | Entity level |
PercentTerre | int | Earth resistance % |
PercentFeu | int | Fire resistance % |
PercentEau | int | Water resistance % |
PercentAir | int | Air resistance % |
PercentNeutre | int | Neutral resistance % |
Mycharacter | boolean | true = this is our bot character |
Id | double | Contextual entity ID |
lancesortcellid | int | Cell from which last spell was cast |
grade | int | Entity grade/rank |
Error Codes (canCastSpellOnCell / canCastSpellOnCellAfterMove)
| Code | Meaning |
|---|---|
0 | NONE (Success — can cast) |
1-16 | Various spell restrictions (range, AP cost, cooldown, line of sight, occupied cell, etc.) |
Specific error code meanings are not documented in the binary. Test with
canCastSpellOnCell and check the return value.Lua Callbacks
WhenTactic is set to AdvancedInScript, the bot calls these Lua functions:
fightManagementPosition(challengers, defenders)
Called once at fight start during the placement phase.| Parameter | Type | Description |
|---|---|---|
challengers | table | {[cellId] = entityId} — Your team’s placement cells. -1 = empty cell |
defenders | table | {[cellId] = entityId} — Enemy team’s placement cells |
fightManagement()
Called each turn when it’s any entity’s turn (including enemies/summons). You must checkisItMyTurn().
Complete Examples
Example 1: Generic Melee Fighter (any breed)
Example 2: Ranged Cra with Kiting
Example 3: Eniripsa Healer + Summon Control
Example 4: Using fightBasic for Simple AI
Example 5: Anti-Ban Delays Pattern
Sous-pages
Combat basique
Méthodes de combat basiques : playTurn, setFightSpeed et fonctions principales.
Actions de combat
Lancement de sorts, déplacement, pathfinding et gestion des entités.
Personnage de combat
Stats et informations du personnage en combat.
Debug de combat
Débogage et journalisation des informations de combat.
Défis de combat
Gestion des défis de combat.