Lua The Time Guardian boss script

Discussion in 'Support' started by LiloBambam, Nov 22, 2018.

  1. LiloBambam

    LiloBambam New Member

    Joined:
    Apr 7, 2010
    Messages:
    7
    Likes Received:
    0
    Best Answers:
    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
     
  2. sick7

    sick7 Relentless

    Joined:
    Apr 3, 2011
    Messages:
    258
    Likes Received:
    34
    Best Answers:
    2
    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
     
  3. Itutorial

    Itutorial Well-Known Member

    Joined:
    Dec 23, 2014
    Messages:
    1,363
    Likes Received:
    291
    Best Answers:
    23
    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
     
  4. LiloBambam

    LiloBambam New Member

    Joined:
    Apr 7, 2010
    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    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.
     
  5. LiloBambam

    LiloBambam New Member

    Joined:
    Apr 7, 2010
    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0

    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.
     
  6. gudan garam

    gudan garam Active Member

    Joined:
    Feb 13, 2011
    Messages:
    273
    Likes Received:
    79
    Best Answers:
    10
    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.
     
  7. LiloBambam

    LiloBambam New Member

    Joined:
    Apr 7, 2010
    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    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.
     
  8. gudan garam

    gudan garam Active Member

    Joined:
    Feb 13, 2011
    Messages:
    273
    Likes Received:
    79
    Best Answers:
    10
    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.
     
  9. LiloBambam

    LiloBambam New Member

    Joined:
    Apr 7, 2010
    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    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?
     
  10. Westwol

    Westwol New Member

    Joined:
    Sep 19, 2018
    Messages:
    17
    Likes Received:
    4
    Best Answers:
    0
    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.
     
  11. LiloBambam

    LiloBambam New Member

    Joined:
    Apr 7, 2010
    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Interesting... I will try to make it and come back with results.
     

Share This Page

Loading...