• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Boss stage. Like World of Warcraft's bosses

waqmaz

Member
Joined
Jun 17, 2015
Messages
203
Reaction score
11
Hello. I am trying to make a boss with stages.
1. First stage:
If it has <= 75% HP, then it is immune for 10 seconds and heals HP.
2. Second Stage:
If it has <= 50% HP then it is immune for 5 seconds and it is casting AOE spells.
3. 3th stage:
At <= 25% HP it is 200% faster and 50% stronger
4 . 4th stage:
It heals HP to full and is like a normal monster without stages.

My question is:
Is it good that to make that boss I am using global storages, addEvents and functions based on os.time()?
Should it be done another way? I am asking, because I have to use storage each time it changes its stage, because for example using onComabt function, the script works each hit, so its wrong. To prevent that it needs storage. If yes, what is the best way to make that boss, because I do not want to have lags on my server.
Is it correct that I use onStatsChange function or is it better to do it onCombat?
Thanks!
 
i mainly use onThink

but break the boss AI down into small functions so you can force execute certain functions in other situations too (like you said onCombat and onStatsChange.
Its ok to use addEvents, but try to use as few as you can.
Sometimes TFS executes them in wrong order even though addEvent time is different.
And for repetitive addevents it sometimes simply stops working. Its rare, but just so you know.
 
Thanks, you're talking about onThink from creatureScripts, don't you? Because there is one from globalevents.
creaturescripts yes.
you can easily attach creaturescripts to monsters, when you create them or spawn them or register them trough monsters.xml
 
Back
Top