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