If you want a boring boss fight, that is.
------
I can give you a few tips I used when making boss fight.
The obvious things are:
- First you need to plan how will the boss work (stages to the fight, what abilities he may be using)
- Create actual abilities and trigger their effects
Now as for AI
- I usually make all boss abilities non-hero. The reason is your boss may have a wide variety of spells so you will need to add and remove them to make space.
- When I want boss to cast an ability, I add that ability to him and order him to cast it.
- I also make a trigger
-
Ability removal
-
Events
-
Unit - A unit Stops casting an ability
-
Conditions
-
(Unit-type of (Triggering unit)) Equal to Your_Boss_Unit
-
Or - Any (Conditions) are true
-
Conditions
-
(Ability being cast) Equal to Ability_01
-
(Ability being cast) Equal to Ability_02
-
(Ability being cast) Equal to Ability_03
-
(Ability being cast) Equal to Ability_04
-
Actions
-
Unit - Remove (Ability being cast) from (Triggering unit)
This removes the ability he finished casting.
Spell timing
For that you should separate your abilities into 2 groups - the not-so-dangerous ones and the IK-if-not-careful ones. The 2nd group spells are usually used in firmly set intervals. Like every 60 seconds.
The first group is usually set in random intervals.
For the first group I usually use formula [minimum cooldown] + [random integer number between X and Y].
To explain what "minimum cooldown" means: If I have for example Flamestrike ability that lasts for 10 seconds and I want there to be only 1 Flamestrike at a time in game, I set the minimum cooldown to 10 seconds. X and Y is the range of my desired random cast interval.
Spell timers
Initially I've been using countdown timers for each spell, however I am about to try and save each time into real array instead. So that is my answer. The disadvantage with countdown timers is that you will either need separate triggers for each spell that way, or you will need to check every other timer's remaining time and stop them to prevent spell cast collision (this is trickier than it seems).
Spell cast collision
By this I mean similar situations:
Boss is in the middle of channeling his ultimate ability Cataclysm, but because timer for low-damage ability Explosion is up, he interrupts Cataclysm and starts casting Explosion.
To prevent spell cast collision I decide what priority each spell has. For example my boss has 3 abilities he uses during phase 1. He uses them randomly, however if he were to try and use 2 abilities at once, he will need to know which ability he should prefer.
I've been doing this by checking the remaining time of all other timers for all higher-priority spells. If an ability with higher priority is about to be cast, I postpone the cast of the lower-priority ability.
You will need to set each ability individually.
Example - if there are 5 seconds until boss will cast his ultimate ability Cataclysm and timer for low-damage Explosion has run out, a trigger will first check if there is enough time for Explosion, before firing it. If there is not enough time, it will set a new timer for Explosion as [Time left before Cataclysm is cast] + [the time boss cast Cataclysm] + [2 seconds] = new timer for Explosion. I use those 2 seconds so boss won't cast another ability immediately and also because when ordering to cast an ability and when finishing casting, "cast backswing" and "cast point" should be taken into consideration.
When an ability is finished casting, you can set new timer for that ability in the "Ability removal" trigger like the one I posted above.
Priorities for spells usually are (1 - highest, 4 - lowest):
1. Soft enrage abilities (Example: Boss kills 1 player every 60 seconds. This has highest priority since it serves as an enrage mechanism of the fight)
2. % Hp abilities (If boss has to cast a specific spell when he reaches for example 75% health, it takes priority over base spells).
3. Stage abilities (Boss enters "Angered" stage every 30 seconds, forcing players to kite him - this has higher priority than base spells)
4. Base abilities (used when nothing else occurs)
This may differ a little per fight, but it is usually like I wrote above.