I've been playing around with on the fly job changes via @changejob, and I'm curious if anyone can help with a question I have regarding hp/mp values.
When a job is changed via changejob, hp and mp are restored to full. Aside from using @hp or @mp to simply reset them to a fixed value, is there a way to note what current hp and mp values are before change > do the job change > reapply hp and mp values on new job?
I would imagine a lua script would be the best way to go about doing this but I have little experience with Lua. Anyone have any pointers or easier methods to accomplish this?
keeping hp and mp values across job changes
Re: keeping hp and mp values across job changes
you could just save the hp/mp in the @changejob script and reapply it after
Re: keeping hp and mp values across job changes
That's exactly what I was needing. I was trying to think of all kinds of different ways to do it, when the simple method was right there.
Added to changejob.lua just after the valid job id check:
oldhp = player:getHP();
oldmp = player:getMP();
and then at the end of the script after the "invalid level given" else fork:
player:setHP(oldhp);
player:setMP(oldmp);
Thanks!
Added to changejob.lua just after the valid job id check:
oldhp = player:getHP();
oldmp = player:getMP();
and then at the end of the script after the "invalid level given" else fork:
player:setHP(oldhp);
player:setMP(oldmp);
Thanks!