Class BossScript
- Namespace
- FishMMO.Server.Implementation.World.SceneServer.AI
- Assembly
- FishMMO.Server.dll
ScriptableObject that defines a boss encounter's phases and timed mechanics. Assign to BossScript to make an NPC a scripted boss.
The AIController evaluates the boss script every tick:
- Checks health against phase thresholds.
- On phase change, applies overrides (behavior tree, attacking state, ability rotation) and spawns adds.
- Ticks all active timed mechanics and force-activates abilities or spawns when timers fire.
Example setup:
Phases:
[0] HP ≥ 70% — default behavior
[1] HP < 70% — spawn 2 adds, switch to Phase2 behavior tree
[2] HP < 40% — enrage: switch to melee attacking state
Timed Mechanics:
Meteor — every 30s, force-cast AbilityTemplate #5
Summon — every 60s, spawn skeleton prefab (only in phase 1)
[CreateAssetMenu(fileName = "New Boss Script", menuName = "FishMMO/Character/NPC/AI/Boss Script")]
public class BossScript : ScriptableObject
- Inheritance
-
ObjectScriptableObjectBossScript
- Inherited Members
-
ScriptableObject.SetDirty()ScriptableObject.CreateInstance<T>()Object.GetEntityId()Object.MemberwiseClone()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Fields
MaxLiveAdds
The most of this boss's adds that may be alive at once before its timed mechanics stop calling in more.
[Tooltip("Most of this boss's adds alive at once before timed mechanics stop calling more. Phase adds always arrive, and count towards it.")]
[Min(1)]
public int MaxLiveAdds
Field Value
Remarks
A timed mechanic fires every Interval for as long as the fight lasts, so a party that tanks the boss and ignores its adds used to meet one more every interval without end: a 30-second summon left forty NPCs in the instance after twenty minutes, each on the AI tick and each a spawn every observer is sent. A mechanic that fires with the boss at its cap calls in nothing, and tops the adds back up to the cap as they die.
A phase's SpawnOnEnter adds always arrive: a phase is entered at most once per pull, so they are bounded by what was authored, and a phase that silently came up short of the adds it names would be a different encounter. They count towards the cap all the same, so the timed mechanics hold off while they live.
Twelve because it is the most attackers AICombatSlots seats on one ring around a
target, which makes it about the largest crowd a timed summon can mean: past it, adds
stand on an outer ring waiting for a place. No shipped boss script exists yet (every
catalogue entry's is empty), so no authored encounter changes; one written against the
old behaviour reaches the cap only if its adds are left alive for twelve intervals.
Phases
Ordered boss phases. Must be sorted from highest health threshold to lowest. Phase 0 is the opening phase.
[Tooltip("Ordered phases (highest HP threshold first).")]
public List<BossPhase> Phases
Field Value
ResetOnLeash
When true, the boss fully heals and resets phases when leashing back home.
[Tooltip("Heal and reset phases when the boss leashes.")]
public bool ResetOnLeash
Field Value
TimedMechanics
Timed mechanics that fire at regular intervals during the encounter.
[Tooltip("Timed abilities / spawns that fire at regular intervals.")]
public List<BossTimedMechanic> TimedMechanics