Passer au contenu principal

Documentation Index

Fetch the complete documentation index at: https://docs.dotouch-emu.com/llms.txt

Use this file to discover all available pages before exploring further.

Calculer la distance (en cellules) entre deux positions.

🎮 Méthode

fightAction:getDistance(cellIdStart, cellIdEnd)

📝 Arguments

NomTypeDescription
cellIdStartintCellule de départ.
cellIdEndintCellule de destination.

💎 Valeur de retour

TypeDescription
intDistance en nombre de cellules.

💡 Exemple

local myCell = fightCharacter:getCellId()
local enemyCell = fightAction:getNearestEnemy()
local dist = fightAction:getDistance(myCell, enemyCell)
if dist > 1 then
    fightAction:moveToWardCell(enemyCell)
end
if dist == 1 then
    fightDebug:print("Portée corps-à-corps !")
end