|
Karac Newbie
Joined: 16 Sep 2011 Posts: 2
|
Posted: Wed Sep 21, 2011 8:14 pm
Need some help with Spellups/Autocast scripting |
Hi, I'm trying to streamline my autocast/spellups and not sure how to account for a spell that wears off during a battle and can't be casted until afterwards. Below is a snippet of what I have so far and this takes care of the spell wearing off in various scenarios (sitting, resting, sleeping or standing).
Code: |
#CLASS {SPELLS}
#TRIGGER {You go to sleep.} {#var pos {1}}
#TRIGGER {You topple over and find yourself sitting on the ground.} {#var pos {2}}
#TRIGGER {In a clear moment you decide to go to sleep. You go to sleep.} {wake;stand}
#TRIGGER {You are awake now.} {#var pos {1}}
#TRIGGER {You wake, and sit up.} {#var pos {2}}
#TRIGGER {You sit down.} {#var pos {2}}
#TRIGGER {You stop resting, and sit up.} {#var pos {2}}
#TRIGGER {You rest your tired bones.} {#var pos {3}}
#TRIGGER {You sit down and rest your tired bones.} {#var pos {3}}
#TRIGGER {You stand up.} {#var pos {4}}
#TRIGGER {You stop resting, and stand up.} {#var pos {4}}
#CLASS 0
#CLASS {SPELLS|All Spell Ups}
#CLASS 0
#CLASS {SPELLS|All Spell Ups|autocast}
#TRIGGER {^The aura around your body fades.} {#if (@pos = 1) {wake;stand;cast 'sanctuary';sleep};#if (@pos = 2) {stand;cast 'sanctuary';sit};#if (@pos = 3) {stand;cast 'sanctuary';rest};#if (@pos = 4) {cast 'sanctuary'}}
#CLASS 0 |
Now, if the spell wears off during a battle and I try to re-cast the MUD will output the line "Impossible! You can't concentrate enough." and I have to manually cast afterwards. Is there a way for me to add a 5th variable that somehow sees the "Impossible!" line and autocasts after the battle is over?
Also, what would be the most elegant way to handle unsuccessul casts so I keep casting until successful?
Thx,
K |
|
|
|
Einder Novice
Joined: 03 Jan 2008 Posts: 48
|
Posted: Fri Oct 07, 2011 6:35 pm |
You can create a true false variable, call it fighting for instance. So we have the variable @fighting that will need to be set to 1 or 0 depending on whether or not we are are fighting. So set a trigger to set that. Next you'd want a trigger to check the @fighting and see if it's false, and if false, to attempt the spell recast then...I know it sounds complicated but it's really not, I use the same idea for my Tank & Assist script.
|
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|