Closed otomay closed 1 year ago
Hi !
You can find the AI in DefaultFightAI (extending FightAI). You'll notice it's pretty generic and there are not much hard coded logic or spells, the AI decides what spells it should use in doGetNextOperation where random spells are tried and rated by score.
If you wanna add new spell, you'll have to read the SpellLevels.d2o file where their information is stored. You'll find, for a spell, the information specified in file DofusSpellLevel (spellId, criticalHitProbability, maxRange, minRange, and most importantly, spellEffects). What you'll need to do if your spell isn't used by the bot is to find out the DofusSpellEffectType and add it to the enum, then implement the desired behaviour in SpellSimulator.simulateEffect (and DamageCalculator.computeEffectDamage if the effect deals damages)
I don't know if this is very clear, it's kinda hard to explain as there is a lot to it, feel free to ask me if you don't understand.
Good luck !
Hello again friend!
Can you give me directions? I don't understand kotlin at all. I want to be able to "register" spells for specific races at specific times, mainly buffs. For example: ecaflips use pm buff when they don't reach enemies. Wish iop and cra could use it too, and so on.
The problem is that I didn't find any file in the repository where I can do this :s
I intend to do PR's with these additions if all goes well :)