GamingPrince83 Posted March 2, 2021 Share Posted March 2, 2021 Hello guys, i'm trying to figure out how to give NPCs and possibly the Player automatic regeneration like in Kotor 2 TSL. I've found out how to make Force Heal heal a lot faster and Make Force Rage heal you instead of cost life. I help will be appreciated!  Link to comment
Droidy365 Posted March 5, 2021 Share Posted March 5, 2021 For my Sword Art Academy mod, I made a few regen scripts for the player, which I think also works for NPCs. https://pastebin.com/mXd9rLaw If I recall correctly, this regenerates 5 HP every 10 seconds (10000 milliseconds). To change the delay, alter the wait timer near the top. This isn't the best - I got a bit lazy, so it all just works in increments of 5, rather than using proper maths to do it properly. If you have 4 HP, you'll regen to 5 HP, rather than 9 HP. This could be fixed, but it took me a long time to get that done in the first place After compiling this with BehavED, naming it regen.ibi, put it in scripts. To activate it, run the command: /runscript player regen If you spawn an NPC, make sure it has a NPC name for the script to target. /npc spawn reborn_new bob /runscript bob regen Of course, if this is in a custom map, you can have a target_scriptrunner activate this. Link to comment
Ramikad Posted March 5, 2021 Share Posted March 5, 2021 I wonder if SET_HEALTH can be incremental - I know some variables in Behaved are, in that you can do, for example, SET (variable, +1) and it is incremented by 1 every time it's done. If it works the same with health, then it could be simplified that if health < 100, then set health +1. May be worth a try. Droidy365 likes this Link to comment
Droidy365 Posted March 6, 2021 Share Posted March 6, 2021 I believe I tried that at one point, but it didn't work. However, as it turns out, my laziness was uncalled for. Here's a fully working script: https://pastebin.com/C0DyK4iG Feel free to use it however you like, modify it, etc. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now