Welcome to the Builder Academy

Question DG Script combat assistance

More
24 Mar 2023 07:41 #10269 by Nero
I have a mob fight where the mob will drain you increasing your age, draining your maxhitpoints and maxmana for several ticks.
The issue I am noticing is that once the affects wear off its decreasing my players' age to 1 and not restoring their maxhit and maxmana back to normal
You have to rent out and return back to the game in order to correct it. Am I missing something in this script or perhaps there is a better way to write it?
Code:
set actor %self.fighting% if (%already_fighting%)   wait 6 secs   unset already_fighting else   switch %random.5%     case 1         if (%actor.age% >= 400)              halt              end         if (%actor.age% < 400) && (%random.2% == 2)           %send% %actor% %self.name% reaches out and touches you with an ethereal hand. You feel much older as you suddenly age.           %echoaround% %actor% %self.name% reaches out and touches %actor.name% with an ethereal hand. You gasp in horror as %actor.heshe% ages before your eyes.           dg_affect %actor% AGE 30 15              halt              end                break     case 2         if (%actor.age% >= 400)              halt              end         if (%actor.age% < 400) && (%random.2% == 2)           %send% %actor% %self.name% reaches out and touches you with an ethereal hand. You feel much older as you suddenly age.           %echoaround% %actor% %self.name% reaches out and touches %actor.name% with an ethereal hand. You gasp in horror as %actor.heshe% ages before your eyes.           dg_affect %actor% AGE 30 15              halt              end                break     case 3         if (%actor.maxhitp% <= 124)              halt              end         if (%actor.maxmana% <= 80)              halt              end         if (%actor.maxhitp% > 124) && (%actor.maxmana% > 80) && (%random.2% == 2)           %send% %actor% %self.name% reaches out and touches you with an ethereal hand. You feel your vitality suddenly drain away.           %echoaround% %actor% %self.name% reaches out and touches %actor.name% with an ethereal hand. %actor.name% appears weakened.           dg_affect %actor% MAXHIT -25 15           dg_affect %actor% MAXMANA -20 15              halt              end                break     case 4         if (%actor.maxmove% <= 40)              halt              end         if (%actor.maxmove% > 40) && (%random.2% == 2)           %send% %actor% %self.name% reaches out and touches you with an ethereal hand. You feel your energy suddenly drain away.           %echoaround% %actor% %self.name% reaches out and touches %actor.name% with an ethereal hand. %actor.name% appears much slower.           dg_affect %actor% MAXMOVE -40 15              halt              end                break     default                break   done     set already_fighting 1     global already_fighting end

Please Log in or Create an account to join the conversation.

More
25 Mar 2023 17:45 #10271 by thomas
Replied by thomas on topic DG Script combat assistance
The script looks correct. If a char is affected by this, what does the "stat <character>" block say about him?

Please Log in or Create an account to join the conversation.

More
29 Mar 2023 04:38 #10283 by Nero
Replied by Nero on topic DG Script combat assistance
Most likely a code issue on Age and how its reverting back when a player rents out and comes back in ,but here are some screenshot examples. The player is affected, if they go and rent out and come back in their age is back to 19 which is their original age but they still have the affect on them. Once the affect wears off it puts their age to 1. They have to rent out and come back in again for it to be corrected. I imagine it tries to subtract whatever was added but 1 is the lowest number it can go.
Attachments:

Please Log in or Create an account to join the conversation.

More
30 Mar 2023 19:02 #10288 by thomas
Replied by thomas on topic DG Script combat assistance
Apparently, the affect is apparently not correctly applied after logging back in. It's not apparent to me why that is.

Please Log in or Create an account to join the conversation.

Time to create page: 0.192 seconds