Hi,
Just working on a pretty simple trigger for a mob to check affected char and remove the spell if affected, however I did change it around to perform some commands inside the switch statement instead of having the echo/echoaround before the switch. Does not seem to fire 100% of the time. I have to go out and back in several times before it will fire. Is this by nature? I am assuming it is because there is a random chance 1/4 that it will pick the appropriate case, but is there a way to make it remove the spells without doing multiple if/else statements?
Here is the code.
TY!
Code:
#1005
Adept Healer~
0 g 100
~
* cast a random spell on players that enter, but only if they are not already affected by spell
wait 1 s
switch %random.4%
case 1
if %actor.affect(blind)%
say %actor.name%, You look like you need help.
%echoaround% %actor% %self.name% lays %self.hisher% hands on %actor.name% and bows %actor.hisher% head in concentration.
%send% %actor% %self.name% lays %self.hisher% hands on you and bows %actor.hisher% head in concentration.
wait 5 s
dg_cast 'cure blind' %actor%
%send% %actor% Your vision returns!
end
break
case 2
if %actor.affect(curse)%
say %actor.name%, You look like you need help.
%echoaround% %actor% %self.name% lays %self.hisher% hands on %actor.name% and bows %actor.hisher% head in concentration.
%send% %actor% %self.name% lays %self.hisher% hands on you and bows %actor.hisher% head in concentration.
wait 5 s
dg_cast 'remove curse' %actor%
%send% %actor% The curse has been lifed from you!
end
break
case 3
if %actor.affect(poison)%
say %actor.name%, You look like you need help.
%echoaround% %actor% %self.name% lays %self.hisher% hands on %actor.name% and bows %actor.hisher% head in concentration.
%send% %actor% %self.name% lays %self.hisher% hands on you and bows %actor.hisher% head in concentration.
wait 5 s
dg_cast 'remove poison' %actor%
%send% %actor% The poison suddenly leaves your body!
end
break
case 4
if %actor.affect(burning)%
say %actor.name%, You look like you need help.
%echoaround% %actor% %self.name% lays %self.hisher% hands on %actor.name% and bows %actor.hisher% head in concentration.
%send% %actor% %self.name% lays %self.hisher% hands on you and bows %actor.hisher% head in concentration.
wait 5 s
dg_cast 'cure burning' %actor%
%send% %actor% Your body is no longer burning!
end
break
default
say %actor.name%, the spell is too powerful for me to dispel.
break
done
~