Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion Goto page Previous  1, 2
Minstrel Posted: Thu Jan 10, 2002 1:24 am
Affliction healing triggers
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Jan 28, 2003 1:30 pm   
 
Ok, right now your @sleep variable is set to 1. This means that the trigger thinks you are currently sleeping and won't do anything until you wake up. Set this variable to reflect your current status.

Second, you are missing a trigger. You need to create a trigger for when you are put to sleep. I don't know what the message is in Achaea, so I didn't make a trigger for it, but it would be something like:
#TRIGGER {You fall asleep.} {#VAR sleep 1}

Change the pattern to whatever Achaea sends when you are put to sleep. Next, you must also change the pattern in the "You wake up" trigger. Again, since I didn't know the exact message, I provided an example one, change it to match the one sent by the MUD.

Oh, and the ! before @sleep is a negation operator, it means take whatever value is supplied (the value of @sleep in this case) and make it false if it is true or true if it is false.

Kjata
Reply with quote
Myrddraal
Beginner


Joined: 25 Jan 2003
Posts: 14
Location: Australia

PostPosted: Wed Jan 29, 2003 1:22 am   
 
Hi again,

I've just tested it all and it's all working perfectly except for one thing, while asleep you aren't able to get anything out from your pocketbelts, so for example the "outb godenseal" in the triggers won't work while asleep. But once i woke the trigger did fire and tried to eat a goldenseal which wasn't there.

Would i have to do something similar to what you did for sleeping for the pocketbelt problem, although there is nothing that triggers being able to use a pocketbelt.

thanks for all your help

-Dan
Reply with quote
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Wed Jan 29, 2003 7:13 am   
 
That is actually one of the two major problems with this system... (1 being that it doesn't prioritise beyond herbs/salves)....the other being...

It relies on an in-game mechanism to keep track of what herbs to eat. I.e. how many of each type of herb is outb'ed equals the number eaten.

Sleep, unconsciousness, stunned, webbed, transfixed, hangmanned, etc etc... all prevent the action "outb herbname". The action itself means to take a piece of that herb (there are 7 curing types) out of your pocketbelt.

This means that the system will not accept afflictions while any of these things are true, which is really quite often in achaean combat. zMud will accept the affliction, and try to eat the herb - but the initial outb-ing will fail, meaning that it wont be eaten.

You could get around it by creating a mirrored list that keeps track of failed outb attempts, and will catch up when you writhe free, wake up etc and can outb again.

Or, you could make it so zmud keeps complete track all on its own, and just outb the herb as you wish to eat it. Both ways have merits, and I recommend the second, becaus in some situations you might like to fight with larger amounts of herbs already out... for example, if you fight in a retardation vibe (constant aeon affect) you're advised to outb 10-20 of both goldenseal and bayberry.

Caled
Reply with quote
Myrddraal
Beginner


Joined: 25 Jan 2003
Posts: 14
Location: Australia

PostPosted: Wed Jan 29, 2003 12:06 pm   
 
Hi,

I understand what you mean for the first way of doing it, but i'm not too sure on the second way. Can you give me a little more information about how to make zmud keep complete track all on it's own? the only way i can think of, is to only allow it to take the herb out once it has actually been told that it can now eat the herb, but i'm unsure of how to actually do this. Or maybe i have just misunderstood you completely?

thanks for everyones help so far

-Dan
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Jan 29, 2003 1:57 pm   
 
What Caled said is correct, this script was made with a set of specifications in mind and it never was intended to be a complete, catch-all system for afflictions in Achaea. Because of that, you can solve the problem with taking the cure out of the pack with a temporary trigger, but the solution is not as elegant as it should be. More specifically, each trigger that fires when you get an affliction should be changed from:
#TRIGGER {You feel light headed and dizzy.} {Outb ginseng;eatq "ginseng"}

to:
#TRIGGER {You feel light headed and dizzy.} {IF (@sleep) {#TEMP {You wake up.} {Outb ginseng}} {Outb ginseng};eatq "ginseng"}

I'm guessing that this may not work, though, because of timing problems with which trigger fires first.

In reality, what should be done, is start again from the ground up. However, I don't play in Achaea so I don't know the affliction system completely and we are not going to make a script and have to patch it up everytime someone comes up with "but what about this other thing?". So, for this we would need a detailed description of the affliction trigger, what type of afflictions there are, what can affect the curing process, what priorities there should be if any and anything else that would need to be taken into account. Only when all of this is considered at once, a script can be made to handle it without having to patch it up later.

Kjata
Reply with quote
Myrddraal
Beginner


Joined: 25 Jan 2003
Posts: 14
Location: Australia

PostPosted: Thu Jan 30, 2003 12:49 am   
 
Hi,

I'm probbaly not the best person to answer this, as i've haven't been playing Achaea for that long and don't really know all the in's and outs of the combat system. But if no one has answered before this evening i'll try and post everything i know about it.

-Dan
Reply with quote
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Thu Jan 30, 2003 7:26 am   
 
This isnt the specifics of everything you need to know, but it is the general idea.

Criteria

  • Being stunned, unconscious or aeoned should make it cease all actions, yet continue to receive afflictions

  • Being asleep should cease actions also, as well as attempt to wake up.

  • Being entangled should cause the action to writhe, unless already writhing.


  • NB: Being entangled should not cease curing, as the only actions it prevents, is outbing of herbs. Other methods are not affected, and if you have any already out, the eating is still possible. The idea then, is to make it so that it doesnt matter if it tries to outb and eat a herb, yet fails...

    Use #ABORT 1 to stop curing, rather than adding to the existing #IF expressions, because the different types require different responses, particularly as you add your own stuff later on in the future.

    Additional Criteria
    • Currently nothing is prioritised. Afflictions are cured in the order they are received

    • There are 9 curing herbs, each with 1 second balance, and 4 curing salves, with 1 second balance, except restoration, which is three.

    • Ultimately, prioritising according to affliction type is best, BUT... that requires a lot of experience in Achaea, as well as zmud. I recommend prioritising according to the cure-type.


    Herbs: Goldenseal, bloodroot, ginseng, kelp, bellwort, ash, lobelia, bayberry, hawthorn
    Salves: Mending, epidermal, caloric, restoration

    Some sample script would be...just roughly, off the top of my head...

    #TR {You are hit with a ginseng-cured aff} {addginsengaff}
    #AL addginsengaff {#ADD ginsengaffs 1 ; #IF @herbb {cureaffs}}
    #TR {You have just cured that ginseng aff} {#ADD ginsengaffs -1}
    #AL eb {outb bloodroot;eat bloodroot;zherbb=0}

    #AL cureaffs {
    #IF (@aeoned or @stunned or @unconscious) {#ABORT 1}
    #IF (@sleep and !@waking) {wake ; #ABORT 1}
    #IF (@entangled < 0 & !@writhing} {writhe}
    ;
    #IF (@zherbb & @bloodroot = 1) {eb}
    #IF (@zherbb & @baybbery = 1) {ebay}
    #IF (@zherbb & @goldensealaffs > 0) {eg}
    #IF (@zsalveb & @epidermalaffs > 0 {de}

    etc etc

    Notes: herbb and salveb are the actual balances, controlled by triggers set for when you eat herbs, apply salves....to when you regain balance on both.

    zsalveb and zherbb are your system's herb and salve balances. They are true when you regain balance in truth, BUT they become false as soon as the system sends the command to eat/apply a cure. This stops it trying to cure everything at once.

    Bloodroot only cures paralysis...hence why it = 1 instead of > 1. Bayberry and hawthorn cause blindness and deafness, respectively...which are considered GOOD defenses, not actual afflictions.

    You will need to decide on the order of curing yourself. You will probably tend to change it around a little bit as time goes on.

    In future, you may also try to separate certain afflictions from the rest. You may like to cure anorexia first, yet other epidermal ones later on. Same goes for stupidity compared to other goldenseal affs. Thats all possible, but for the beginning, dont bother.

    Now...see if you can understand it, and come up with a more complete script because I cant be bothered writing more Smile




    Caled
    Reply with quote
    Caled
    Sorcerer


    Joined: 21 Oct 2000
    Posts: 821
    Location: Australia

    PostPosted: Thu Jan 30, 2003 7:29 am   
     
    The problem with that system, is that it uses a lot of #IFs. With zmud nice and fast these days, and people generalyl running decent comps, that shouldn't be a problem. There is another way involving string lists that condense the number of #IFs a lot, but I wouldn't bother if I were you.

    Caled
    Reply with quote
    Myrddraal
    Beginner


    Joined: 25 Jan 2003
    Posts: 14
    Location: Australia

    PostPosted: Sat Feb 01, 2003 10:04 am   
     
    Your reply was great Caled! it really helped, although i have a few questions about it.

    #AL addginsengaff {#ADD ginsengaffs 1 ; #IF @herbb {cureaffs}}

    With the above line is the @herbb meant to be @zherbb? or is @herbb a separate variable?

    #TR {You have just cured that ginseng aff} {#ADD ginsengaffs -1}

    with the above do you need to know the cure for the affliction? or can "ginsengaffs -1" be triggered by something else, the only other thingi could think of would be when it says you may eat another herb etc, but i'm not sure wether this would work or not.

    and one last question, when use "#ABORT 1" will that just stop you from applying cures, or does it also stop you from accepting afflitions?

    hope you don't mind all the questions, i'm still fairly new to all this

    thanks again

    -Dan

    #IF (@zherbb & @bloodroot = 1) {eb}
    #IF (@zherbb & @baybbery = 1) {ebay}
    #IF (@zherbb & @goldensealaffs > 0) {eg}
    #IF (@zsalveb & @epidermalaffs > 0 {de}
    Reply with quote
    Caled
    Sorcerer


    Joined: 21 Oct 2000
    Posts: 821
    Location: Australia

    PostPosted: Sun Feb 02, 2003 11:27 am   
     
    Yes, you do need to know what it looks like when you've cured it. Its better not to run it just off eating the herbs themselves, though that would be quicker. It'll take you a while to set it all set up, but hey... if it was easy, everyone would run autocures.

    #ABORT 1 stops only the alias itself. The alias's only purpose is to eat the appropriate cures. So yes...in answer to your question, it will still record your afflictions.


    • I did try to explain herbb and zherbb, but its not the
      easiest of concepts so I'll explain in detail. @herbb is a variable which
      is always 0, or 1. It is controlled by triggers. The trigger which
      makes it 1, is "You may eat another herb", and the triggerS which make
      it 0 are triggers fired each time you eat a herb. You will need one
      for each herb type.


    • @zherbb is a variable which works very similarly, and is in fact closely linked to, @herbb. It is made 1 by the same trigger that makes @herbb 1, BUT.... it is made 0 by your -aliases- to eat a herb. That is the difference. What that means, is that it reflects your INTENT to eat a herb....rather than you actually eating the herb. This is necessary because otherwise your system will have you eating loads of herbs all at once.


    • You should not just use @zherbb, because sometimes your intent to eat a herb fails. @herbb represents the truth of your herb balance, so in determining whether or not to run the curing alias, it is safer to use @herbb. In truth, the only reason that line is in the trigger is NOT to make sure you dont eat herbs when you can't... but to prevent unnecessary calling of the alias, to stop it slowing zmud. The alias itself wont eat herbs if you cant.


    Caled
    Reply with quote
    mak
    Newbie


    Joined: 02 Feb 2003
    Posts: 1

    PostPosted: Sun Feb 02, 2003 10:51 pm   
     
    I read in the variable tutorial about %pop being used to put an item in the front of a variable string. Maybe that would help in prioritizing what needs to be cured first, for instance goldenseal. Does anyone know how to %pop eat goldenseal into his queue string?
    Reply with quote
    Caled
    Sorcerer


    Joined: 21 Oct 2000
    Posts: 821
    Location: Australia

    PostPosted: Mon Feb 03, 2003 8:32 am   
     
    You don't really want to use %pop, because %pop not only retrieves the first item from a list, but it also deletes it. If you're using stringlist with your autocure, you want to get the next item with

    %item(@afflictionlist, 1)

    and only delete it from the list when you receive confirmation from your mud that it IS actually cured. This would be in the form of:

    #TR {You have cured your stupidity!!!} {#DELITEM afflictionlist stupidity}


    However...in the example we're looking at at the moment, there are no stringlists involved anyway... instead, each herb type has a variable....for example, @goldensealaffs.

    Goldenseal cures 7 different afflictions...the value of the variable will always be somewhere between 0 and 7, reflecting how many times you need to eat it.

    If you wanted to separate stupidity from the other goldenseal afflictions, its quite easy... change the trigger for when you -get- stupidity, to something like:

    #TR {You are now stupid} {stupidity=1;#IF @herbb {cureaff}}

    And add this line into your "cureaff" alias:
    #IF (@stupidity & @zherbb) {eg}


    Like I said earlier though...if you're new to actual combat, dont bother with that sort of thing just yet...wait till you know enough to know exactly what priority you'd like to use.

    Caled
    Reply with quote
    Myrddraal
    Beginner


    Joined: 25 Jan 2003
    Posts: 14
    Location: Australia

    PostPosted: Mon Feb 03, 2003 11:30 am   
     
    below i have listed what i have been unsuccessfully trying, can anyone see where i am going wrong.

    #CLASS {Healing} {enable}
    #ALIAS addbloodrootaff {#ADD @bloodroot 1;#IF @herbb {cureaffs}}
    #ALIAS eb {outb bloodroot;eat bloodroot;zherbb=0}
    #ALIAS cureaffs {#IF (@zherbb & @bloodroot = 1) {eb}}
    #VAR zherbb {0} {0}
    #VAR herbb {0} {0}
    #VAR bloodroot {o}
    #VAR o {0}
    #TRIGGER {^Your body stiffens rapidly with paralysis.} {addbloodrootaff}
    #TRIGGER {^You may eat another plant.} {#add herbb 1;#add zherbb 1}
    #TRIGGER {^Your muscles unlock; you are no longer paralysed.} {#ADD @bloodroot -1}
    #TRIGGER {eat bloodroot} {herbb=0}
    #CLASS 0

    i know there's something i'm completely missing, but i'm not sure what

    thanks

    -Dan
    Reply with quote
    remus
    Wanderer


    Joined: 06 Jul 2002
    Posts: 53
    Location: Australia

    PostPosted: Mon Feb 03, 2003 2:37 pm   
     
    Great to see someone has finally decided that paying Traq credits for a system is totally wrong when you can come here and get everyone to build you one for free. Thank you for finally doing it, my combat script is just improving and improving and I aren't having to pay anyone anything!

    THANKS!

    Remus Parish aka
    Rangek, Fist of the Slayers Hand.
    coa.servegame.com port:23
    Reply with quote
    Caled
    Sorcerer


    Joined: 21 Oct 2000
    Posts: 821
    Location: Australia

    PostPosted: Tue Feb 04, 2003 7:52 am   
     
    Firstly...You have the syntax for #ADD wrong.
    #ADD goldensealaffs 1
    not
    #ADD @goldensealaffs 1

    Also...in the case of bloodroot, no need to use #ADD at all, just set it to 0 or 1. Same goes for hawthorn and bayberry. The other herbs should be #ADD, however.


    Critique:

    #ALIAS addbloodrootaff {#ADD @bloodroot 1;#IF @herbb {cureaffs}}
    Wrong. As there is only 1 bloodroot aff, no need to #ADD it. Just 0 or 1.
    #AL addbloodrootaff {bloodroot=1;#IF @herbb {cureaffs}}

    #ALIAS eb {outb bloodroot;eat bloodroot;zherbb=0}
    #ALIAS cureaffs {#IF (@zherbb & @bloodroot = 1) {eb}}
    Right.

    #VAR zherbb {0} {0}
    #VAR herbb {0} {0}
    Give them the default value of one, not zero.

    #VAR bloodroot {o}
    Give this the value of zero, not the letter "o".

    #VAR o {0}
    Whats this variable for? Delete it.

    #TRIGGER {^Your body stiffens rapidly with paralysis.} {addbloodrootaff}
    Good.

    #TRIGGER {^You may eat another plant.} {#add herbb 1;#add zherbb 1}
    The value of @herbb is to be zero OR 1. You do not need to #ADD anything to it...
    #TRIGGER {^You may eat another plant.} {herbb=1;zherbb=1;cureaffs}

    #TRIGGER {^Your muscles unlock; you are no longer paralysed.} {#ADD @bloodroot -1}
    Because there is only -one- bloodroot affliction (use valerian to cure disfigurement, not bloodroot) There is no need to use #ADD, since it will never be anything other than zero or one.
    #TRIGGER {^Your muscles unlock; you are no longer paralysed.} {bloodroot=0}

    #TRIGGER {eat bloodroot} {herbb=0}
    Good

    So...make the changes, and try it out.

    Caled
    Reply with quote
    Caled
    Sorcerer


    Joined: 21 Oct 2000
    Posts: 821
    Location: Australia

    PostPosted: Tue Feb 04, 2003 7:59 am   
     
    quote:

    Great to see someone has finally decided that paying Traq credits for a system is totally wrong when you can come here and get everyone to build you one for free.



    This one will not be as good as Tranqs system. It doesn't prioritise as precisely as Tranqs, and so far we've not discussed any methods of defeating illusions, dual affliction dealing, stupidity, and countless other things.

    It is also only the mechanical part of the system. It will take a lot of practice before all the trigger messages are in place, and before the users know enough about combat to get the prioritising done the way it should be.

    The thanks is appreciated *heh* but believe me, the hard part is not being done for you. As an Achaean, I firmly believe in people writing their own systems. I'm helping out because I know that all this part is, is the very top of the pyramid...its the bit which makes it all possible, but its only a small bit...a very small bit.

    Caled
    Reply with quote
    Myrddraal
    Beginner


    Joined: 25 Jan 2003
    Posts: 14
    Location: Australia

    PostPosted: Tue Feb 04, 2003 9:34 am   
     
    Woot!! thanks Caled i've finally got it curing!! i still have some further questions though.

    #IF (@aeoned or @stunned or @unconscious) {#ABORT 1}
    #IF (@sleep and !@waking) {wake ; #ABORT 1}
    #IF (@entangled < 0 & !@writhing} {writhe}

    I was wondering whether you could explain the "@sleep and !@waking" and the "@entangled < 0 & !@writhing" as far as i can tell @sleep if just a variable that is given a value when a sleeping trigger goes off, but i'm not sure about !@waking, and it's use. I assume it checks whether you are attempting to wake and see whether you have, but i'm not entirely sure. And as for !@writhing i think it's the same but i haven't a clue about entagle with the "> 0".

    To my understanding i thought the system would handle stupidity already. Mainly because unless the cure text for stupidity comes up it wont go to cure the next affliction, hence it would keep repeating the cure attempt until it get's it right. But i may be totally wrong on this, i haven't had a chance to test stupidity yet.

    Thanks

    _dan
    Reply with quote
    Caled
    Sorcerer


    Joined: 21 Oct 2000
    Posts: 821
    Location: Australia

    PostPosted: Tue Feb 04, 2003 10:31 am   
     
    quote:

    #IF (@aeoned or @stunned or @unconscious) {#ABORT 1}
    #IF (@sleep and !@waking) {wake ; #ABORT 1}
    #IF (@entangled < 0 & !@writhing} {writhe}


    When you are entangled, you need to writhe only ONCE. Once you writhe, after a specific amount of time (the precise amount dependant on the type of entanglement, and lag) you writhe free. Problem is, that writhing again before you writhe free, resets that timer.

    So... say you are webbed. Roughly a 3 second writhe time. But if, every two seconds, you writhe again....you'll never, ever writhe free. So...

    While entanglement is greater than 0, zmud knows you need to writhe. While @writhing is equal to 1, zmud knows that you are already writhing free of something, and that it should NOT writhe more.

    Incidentally, this is not a particularly good way to deal with entanglement afflictions...it is, however...better than straight trigs to writhe when you need it.

    quote:

    To my understanding i thought the system would handle stupidity already. Mainly because unless the cure text for stupidity comes up it wont go to cure the next affliction, hence it would keep repeating the cure attempt until it get's it right. But i may be totally wrong on this, i haven't had a chance to test stupidity yet.


    Just say stupidity makes you fail to cure the stupidity. I.e. instead of outbing and eating goldenseal, instead you moon your opponent and pray to your backpack. @zherbb is now equal to 0, but you have herbb. This means you wont regain herbb...since you already have it. And regaining herb balance is the only trigger that resets @zherbb to 1.

    How you choose to deal with this problem is up to you. There are lots of ways, and I'l leasve it to you to consider them...as its a part of autocuring which I'm not going to explain.

    Caled
    Reply with quote
    Caled
    Sorcerer


    Joined: 21 Oct 2000
    Posts: 821
    Location: Australia

    PostPosted: Tue Feb 04, 2003 10:33 am   
     
    Oh...forgot to mention. THe @sleep & !@waking thing... There is nothing wrong with typing "wake" multiple times, it wont hurt. But it wont achieve anything useful either, and it will spam you. So...unlike the @writhing thing, its not an essential part...just an anti-spam thing.

    Caled
    Reply with quote
    Minstrel
    Beginner


    Joined: 07 Dec 2001
    Posts: 21

    PostPosted: Wed Jun 11, 2003 3:28 am   
     
    I didn't quite realize that this thread was still being looked through and used.

    Now it has been quite some time since I've last played Achaea, but since I started this thread, and till the day I left I made many modifications to the scripts given here and it worked quite well in many of the fights I've encountered.

    Caled is right though, this is only a small part in the works of things. I will say that the trigger system you use, whatever it may be should reflect on you and your experience. Personally, I split the work in half between Zmud and myself. In the end I decided on taking charge of curing during a fight. You do have to keep in mind that Achaea has some pretty nasty afflictions that can mess up your triggers pretty easily.

    If your going to queue everything, stupidity can easily throw it all out of whack. Just one of the things that you have to edit and adjust, but well Caled pointed that and others out already.

    My advice, take what you have here, test it out, work on it and then work on the more complex system to deal with priority and the other problems you may face.
    Reply with quote
    GooseFire
    Novice


    Joined: 08 Sep 2003
    Posts: 32
    Location: USA

    PostPosted: Mon Sep 08, 2003 6:57 pm   
     
    We'll.. I got this script, listened to you all on fixing it, and did what I could. I found out, though, that it would only execute one command when it tried to eat, apply, or drink something. So, I had to correct this, and I made aliases that took the item from the Rift, for all you non-achaeans thats just a storage place for herbs, and then eat it. But, it would put eat -alias- or drink -alias- and apply -alias- which wouldnt work since the thing it tried to drink, eat, or apply was the first thing coming out, thats getting the herb. So, I tinkered with script and fixed that, but now it won't put things in the queue, it just executes it all. I'm going to post mine, so maybe you can help me?

    #ALIAS applyq {#IF ((!sleep) and (@apply) and (%item(@applyqueue, 1) = "")) {apply %1;#VAR apply 0} {#IF (%2 = 1) {#VAR applyqueue;%concat(%1, "", @applyqueue)} {#VAR applyqueue %additem(%1, @applyqueue)}}} "Triggers|Automatic Healing"
    #ALIAS drinkq {#IF ((!sleep) and (@drink) and (%item(@drinkqueue, 1) = "")) {drink %1;#VAR drink 0} {#IF (%2 = 1) {#VAR drinkqueue;%concat(%1, "", @drinkqueue)} {#VAR drinkqueue %additem(%1, @drinkqueue)}}} "Triggers|Automatic Healing"
    #ALIAS eatq {#IF ((!sleep) and (@eat) and (%item(@eatqueue, 1) = "")) {eat %1;#VAR eat 0} {#IF (%2 = 1) {#VAR eatqueue;%concat(%1, "", @eatqueue)} {#VAR eatqueue %additem(%1, @eatqueue)}}} "Triggers|Automatic Healing"
    #VAR apply {1} {_nodef} "Triggers|Automatic Healing"
    #VAR applyqueue {} {_nodef} "Triggers|Automatic Healing"
    #VAR drink {1} {_nodef} "Triggers|Automatic Healing"
    #VAR drinkqueue {} {_nodef} "Triggers|Automatic Healing"
    #VAR eat {1} {_nodef} "Triggers|Automatic Healing"
    #VAR eatqueue {} {_nodef} "Triggers|Automatic Healing"
    #VAR sleep {1} {_nodef} "Triggers|Automatic Healing"
    #TRIGGER {You close your eyes, curl up in a ball, and fall asleep.} {#VAR sleep 1} "Triggers|Automatic Healing"
    #TRIGGER {You feel incredibly tired, and fall asleep immediately.} {#VAR sleep 1} "Triggers|Automatic Healing"
    #TRIGGER {You feel irresistibly compelled to "sleep."} {#VAR sleep 1} "Triggers|Automatic Healing"
    #TRIGGER {You may apply another salve to yourself.} {#IF ((@sleep) or (%item(@applyqueue, 1) = "")) {#VAR apply 1} {%item(@applyqueue, 1);#VAR applyqueue %delitem(%item(@applyqueue, 1), @applyqueue)}} "Triggers|Automatic Healing"
    #TRIGGER {You may drink another affliction-healing elixir.} {#IF ((@sleep) or (%item(@drinkqueue, 1) = "")) {#VAR drink 1} {%item(@drinkqueue, 1);#VAR drinkqueue %delitem(%item(@drinkqueue, 1), @drinkqueue)}} "Triggers|Automatic Healing"
    #TRIGGER {You may eat another plant.} {#IF ((@sleep) or (%item(@eatqueue, 1) = "")) {#VAR eat 1} {%item(@eatqueue, 1);#VAR eatqueue %delitem(%item(@eatqueue, 1), @eatqueue)}} "Triggers|Automatic Healing"
    #TRIGGER {You open your eyes and yawn mightily.} {#VAR sleep 0;#IF (@eat) {#SH You may eat another plant.};#IF (@drink) {#SH You may drink another affliction-healing elixir.};#IF (@apply) {#SH You may apply another salve to yourself.}} "Triggers|Automatic Healing"
    Reply with quote
    itsacat
    Newbie


    Joined: 11 Oct 2003
    Posts: 5

    PostPosted: Sun Oct 12, 2003 1:53 pm   
     
    Here is the herb queue system i wrote (and salve queue is the same) it uses an array to store afflictions. what that means is, for salves you can have multiple slots for a salve, eg apply caloric twice, apply mending to various limbs, and all in the order you want. so if you get several afflictions it will cure them in the order youve set not in the order you recieved them.

    for herbs this is the main alias that checks the array for any herb that needs to be eaten.

    #ALIAS zherbmain { @herblen = 1;#UNTIL (@herblen > %arrhigh( herbpriqueue)) {#if (%arrget( herbpriqueue, @herblen) <> "") {%arrget( herbpriqueue, @herblen);#math herblen (%arrhigh( herbpriqueue) + 1)};#ADD herblen 1}} "combat|cures|herbs"

    heres some sample afflictions...

    #TRIGGER {You feel your limbs stiffen and lock} {#NOOP %arrset( herbpriqueue, 4, "eat bloodroot");zherbmain} "combat|cures|herbs"
    #TRIGGER {Net of stupidity over your mind} {#NOOP %arrset( herbpriqueue, 8, "eat goldenseal");zherbmain} "combat|cures|herbs"

    and heres how you would clear a cure.. eg bloodroot

    #TRIGGER {Your muscles unlock*} {#NOOP %arrset( herbpriqueue, 4, "")} "combat|cures|herbs"

    im not very experienced at combat yet, but at least it works.

    -Tacasti
    Reply with quote
    Display posts from previous:   
    Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
    Goto page Previous  1, 2
    Page 2 of 2

     
    Jump to:  
    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

    © 2009 Zugg Software. Hosted by Wolfpaw.net