TeoTwawki wrote:There's some code for instancing allies but right now isn't set up to be usable outside of battlefields in the project. Some servers have fakes npc helpers by using modified pet objects and tacking on and adding to the AI of existing pet types.
This is exactly what my server uses for Trusts and it can be a total PITA because each trust added needs its own AI with their own timers. I didn't want to use the basic randomization of abilities and weaponskills for Trusts, so I actually programmed specific AI for each Trust so that they do specific things. For instance, the most complex AI that I currently have programmed is Ulmia because she has to decide things in this order at the start of a fight:
1 - Is the Master (player) a melee or mage job? If the player is a melee job, look at their stats to determine what songs are needed most (There are 6 different song combinations based on the players stats vs monsters). If the player is a mage job, look at Ulmia's own stats (given stats similar to melee's) to determine what song combos are needed for the melees in the group
2 - Run to the front line, cast the appropriate melee songs
3 - Run to the backline cast double ballad if at the correct level
4 - Start debuffing the mob (Slow, Requiem, Dia)
5 - Tossing cures to party members when needed
6 - Once the timers on the original melee songs begin to wear off, run to the front line and repeat the process
Programming the AI from scratch though gives you flexibility for Trusts such as making Nanaa Mihgo always stand behind the mob and only use Sneak Attack if the mob isn't facing her or having her wait to use Sneak Attack if she is close to 100% TP so she can pair it with a WS. The most difficult thing to do is getting Trusts to Skillchain with each other which currently I have three Trusts that can combo Light and Darkness right now and slowly expanding out.
You can see a demo of my server's Trust AI version 2.0 in my sig (I am now on Trust AI version 3.0 with a total of 12 Trusts)
As far as the code, I don't really give it out right now because:
A) It's a mess
B) It needs to be optimized
C) There are still some bugs (Heath information doesn't update as often as it should)
D) It's based off DSP code from 2015 before the AI refactor and is no way compatible with the current builds.
My server is pretty much beta and been running for a while for people to play on, but I don't advertise it too much because I am still patching it frequently.