Welcome to the Builder Academy

Question Calculating saving throw in a DG script

More
25 Feb 2020 19:25 #8588 by Nero
I thought by increasing adding switch random.5 it would decrease the likeliness of the strength drain being spammed by the mob as I don't want them casting it every round. Is that wrong, and is there a better way to do that?

This code may be what I am looking for though, I will test it out later.

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

More
25 Feb 2020 20:20 - 25 Feb 2020 20:27 #8589 by krell

Nero wrote: I thought by increasing adding switch random.5 it would decrease the likeliness of the strength drain being spammed by the mob as I don't want them casting it every round. Is that wrong, and is there a better way to do that?


Actually, that makes perfect sense. So your mob will only have a 20% chance of using the spell. Got it.

Alternatively you could have a higher level if/else such as:

if (‰random.5 == 1)

But a switch statement works just as well.

This code may be what I am looking for though, I will test it out later.


Good luck.
Last edit: 25 Feb 2020 20:27 by krell.

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

More
25 Feb 2020 21:38 - 25 Feb 2020 21:39 #8590 by Nero
Thanks,

Your above suggestion was, in a round about way, what I was looking for
Code:
set actor %self.fighting% if (%already_fighting%) wait 6 secs unset already_fighting else switch %random.3% case 1 if (%actor.affect(CHARM)% || %actor.is_pc%) if (%actor.str% <= 14) %send% %actor% You resist the undead tree's attempt to draw the strength from your body. %echoaround% %actor% %actor.name% resists the undead tree's attempt to draw the strength from %actor.hisher% body. elseif (%actor.str% > 14) eval ss %actor.saving_spell% if (%ss% < 15) %send% %actor% %self.name% attempts to draw the strength from your body, but fails because you are already in a weakened state. %echoaround% %actor% %self.name% attempts to draw the strength from %actor.hisher% body, but %actor.heshe% is too frail to be weakened any further right now. elseif (%ss% >= 15) eval roll %random.100% if (%roll% >= 50) %send% %actor% You feel the undead tree draw the strength out of your body. %echoaround% %actor% %self.name% draws strength from %actor.name%'s body. dg_affect %actor% STR -1 5 elseif (%roll% < 50) %send% %actor% You resist the undead tree's attempt to draw the strength from your body. %echoaround% %actor% %actor.name% resists the undead tree's attempt to draw the strength from %actor.hisher% body. else %send% %actor% You resist the undead tree's attempt to draw the strength from your body. %echoaround% %actor% %actor.name% resists the undead tree's attempt to draw the strength from %actor.hisher% body. end end end end break default break done set already_fighting 1 global already_fighting end
Last edit: 25 Feb 2020 21:39 by Nero.

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

More
26 Feb 2020 01:33 #8591 by krell

Nero wrote: Thanks,
Your above suggestion was, in a round about way, what I was looking for


Heh. Well I'm glad I was able to at least help guide you in the direction you needed to go. :)

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

Time to create page: 0.184 seconds