|
Murph Newbie
Joined: 04 Dec 2005 Posts: 5
|
Posted: Sun Dec 04, 2005 9:37 pm
Easier way to do spell watching tiggers? |
Hello!
I have triggers that keep my staus bar update with which spells i have on me.
For each spell, i have a trigger for when it's casted on me "You can suddenly see invisible stuff" that does a #VAR SeeInvis on and a "Suddenly... you can't see invisible stuff" that does a #VAR SeeInvis off
Is there a more efficient way to do this with like.. lists or anything?
--Murph |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Sun Dec 04, 2005 11:35 pm |
I'm not sure if this would end up any better (and don't have zMud installed to test it) but you could try using a single variable to store all the effects.
So for 'You can suddenly see invisible stuff', effects.seeInvis = 1
For 'You can suddenly see really big things', effects.seeReallyBig = 1
Then you'd want to use #LOOPDB to go through all the values (%val) in each record (%key) in the variable and display them in the status bar if the value = 1.
Might be someone can provide some working code to get you started.
Something like
#LOOPDB @effects {#IF (%val = 1) {#show %key %cr}}
Which (hopefully) would go through each value in @effects and display the matching key followed by a new line.
Again, I'm not sure if this is necessarily 'better', but it's definately another way of doing things, and it'd cut down on the number of variables used, and it'd also mean that if you had any new effects to add in you'd not need to change the #STWIN contents, you'd just need to make the trigger to add a new pair to the variable.
Good luck |
|
|
|
Slaem Apprentice
Joined: 20 Sep 2005 Posts: 135
|
Posted: Mon Dec 05, 2005 6:21 am |
I use string lists for affects and display the values in the status bar. I do an #ADDITEM for the affect name when I get an "affect on" line and a #DELITEM when I get an "affect off" line. I color my status bar green for good affects and red for bad affects.
|
|
|
|
|
|