• 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!

Lua The Time Guardian boss script

LiloBambam

New Member
Joined
Apr 7, 2010
Messages
9
Reaction score
0
Hello players,

I'm coding a the time guardian boss and in global Tibia he change her name's and outfit like this:


In tfs 1.3 we have a function to change outfit but i cant make a consistent script to change the monsters name in-game.

I'm searching other forms to make this consistent, i can create three monsters with different names and teleport they for the same position one by one to give the impression that they are only one but the script dont split the demage in all monsters with your owner damage.

Any suggestions for these issues?

Krolork
 
If you notice, the monster is actually getting removed and a new one spawns, as you can observe the player losing target, and the monster change it's look direction when it changes. So, to replicate this you just gotta make the different monsters, and afterwards store the current health & look direction and set the newly spawned monster to that health amount & look direction when you spawn it, and possibly make it target the same player again that it targeted before. You can do that on healthchange or as monster spell, however u want it to be triggered, can't really tell from the video
 
To recreate this. Seems you dont want to lose EXP. You cannot remove the actual creature.

1) Add the ability to name change a monster there is code here on otland for that.
2) Make the monster teleport out of the characters screen when you want to name change it
3) Name change it, outfit change, ect. What ever you want to do while it is outside the characters screen
4) Teleport it back to its position it teleported from and make it focus the same player
 
If you notice, the monster is actually getting removed and a new one spawns, as you can observe the player losing target, and the monster change it's look direction when it changes. So, to replicate this you just gotta make the different monsters, and afterwards store the current health & look direction and set the newly spawned monster to that health amount & look direction when you spawn it, and possibly make it target the same player again that it targeted before. You can do that on healthchange or as monster spell, however u want it to be triggered, can't really tell from the video

I created the three boss'es phases, the first phase spawn in the room and the others spawn in another location. Each 10 seconds the script check if monster have target and change them.

For the damage, i created a script using onHealthChange to when one of phases loses health, the others loses too.

Now my problem is that's codes are consuming too much memory. I'm thinking of save the creatures boss'es ids in storages to improve the onHealthChange code.
 
To recreate this. Seems you dont want to lose EXP. You cannot remove the actual creature.

1) Add the ability to name change a monster there is code here on otland for that.
2) Make the monster teleport out of the characters screen when you want to name change it
3) Name change it, outfit change, ect. What ever you want to do while it is outside the characters screen
4) Teleport it back to its position it teleported from and make it focus the same player


I tried to do with this form, but the change monster name in the game does not work well. I've already tried to teleport the monster away but it still does not work.
 
Best way to do this is to remove the boss and spawn another one (another monster xml), you can save the boss health in a globalstorage when you remove him, and when spawning the next one, set the health to that value. Don't forget to reset this globalstoragevalue when the boss finally dies.

If I remember correctly, there is a small change in sources you can do so you can change the bosses health without showing the animation of him taking damage, because when you do something like creature:setHealth(maxHealth - damage), the dmg animation is going to display the amount of life withdrawn. Not a big deal though.

No need to have multiple bosses spawned and mirror the damage to each one of them, think smart, not hard.
 
Best way to do this is to remove the boss and spawn another one (another monster xml), you can save the boss health in a globalstorage when you remove him, and when spawning the next one, set the health to that value. Don't forget to reset this globalstoragevalue when the boss finally dies.

If I remember correctly, there is a small change in sources you can do so you can change the bosses health without showing the animation of him taking damage, because when you do something like creature:setHealth(maxHealth - damage), the dmg animation is going to display the amount of life withdrawn. Not a big deal though.

No need to have multiple bosses spawned and mirror the damage to each one of them, think smart, not hard.

In this case i have another problem. The boss damage stats and exp will share only in the last phase beware the boss dies, if the phase is physical, knights and paladins will receive best loot because only him can damage this phase, if the phase is iced, only mages will receive best loot because only him can damage this phase and so on.
 
Hmm...

You probably could do that by saving the damage map from the previous bosses and handling it on the death of the last one. You'd have to think about it though, there are lua bindings to some things already done, you could create a bind to modify the outcome of the boos death, so that you can give all the players their exp and loot.

I'm pretty sure thats doable.
 
Hmmm... This way it should work...
Do you have any suggestions on how I can save the player's damage map?
For remake the damage in the last boss, the best way is with a onKill creaturescripts?
 
You can store damage map for every player into a table and then retrieve it and add it to the next monster, here comes the tricky part, you have to create a method pointing Creature::addDamagePoints then you just have to make a creatureevent to do that.
 
You can store damage map for every player into a table and then retrieve it and add it to the next monster, here comes the tricky part, you have to create a method pointing Creature::addDamagePoints then you just have to make a creatureevent to do that.

Interesting... I will try to make it and come back with results.
 
Back
Top