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
Zinjin
Newbie


Joined: 02 Mar 2004
Posts: 6

PostPosted: Tue Mar 02, 2004 7:06 am   

#cond triggers (new zmud multi-state) question
 
Hello!
I am brand new to zmud, and it rocks! It's the best thing.... ever.
I play on an Achaea-style mud, and I am having problems figuring out a autoheal script.
Here is the situation:
In PVP, certain classes can double-afflict 'venoms' that can only be cured by eating specific plants. The trick is, there is a plant 'balance' system that only allows you to eat a plant once every few seconds. So, this defeats simple triggers. One of the afflictions will get through without being cured.
Here is what I need the script to do:
Heal the first affliction, and upon recieving balance to eat another plant, it automatically eats the plant that cures the SECOND affliction.
Here is the trick: Wink
It is possible to get double-teamed, or get tied up to where you cant eat and cure the affliction, so I will need the list to stack, and the script to heal the afflictions in order of recieving them. I believe #additem would work here, but I havn't even broke the surfacr of the power of zmud.

Here are some sample texts for you insane zmud gurus that might want to take a stab at part, or all of this mighty script:

Combat Affliction Delivery:
Crazylegs swings at you with all of his might.
You stumble, and groan feebly.
Crazylegs jabs a sword at you.
Your lungs tighten and you have problems breathing.

In this case, say valerian would cure the first affliction, and kelp would cure the second. I would:
outb kelp
eat kelp
to cure.

The message to inform that I can eat another plant again is:
You may eat another plant or herb again.

The cure messages for each of the afflictions respectively are:
Your bones regain their strength.
Your lungs open up, and you can breathe again.

I havn't seen anyone discuss the new #cond power in this forum yet, so maybe one of you guys can crush this script, and enlighten us all!
Thanks again!!
Reply with quote
Pega
Magician


Joined: 08 Jan 2001
Posts: 341
Location: Singapore

PostPosted: Tue Mar 02, 2004 10:22 am   
 
#cond is powerful indeed, but it may not be required in this case.

Here is an example of how you can script this problem:

Code:
#var afflictiondetection {You stumble, and groan feebly.|Your lungs tighten and you have problems breathing.}
#var afflictioncure {valerian|kelp}
#var afflictionqueue %null %null
#var plantbalance %null %null
#var balancedetection {Your bones regain their strength.|Your lungs open up, and you can breathe again.}

#alias cureaffliction {#forall outb|eat {%item(@afflictionqueue,1};#delnitem @afflictionqueue 1;#var plantbalance off}

#trigger {({@afflictiondetection})} {#var afflictionqueue {%additem(@afflictionqueue,%item(@afflictioncure,%ismember("%1",@afflictiondetection)))};#if %null(@plantbalance) {cureaffliction}}

#trigger {{@balancedetection}} {#var plantbalance %null;#if %len(@afflictionqueue) {cureaffliction}}


I wrote the above on my browser and it has not been tested, but you should be able to get the general idea of how it is done.
Reply with quote
Serentus
Apprentice


Joined: 28 Sep 2001
Posts: 103
Location: USA

PostPosted: Wed Mar 03, 2004 6:12 am   
 
#COND actually can work quite well in Achaean type healing systems, but not as

#TRIGGER {Affliction message} {Cure it;add affliction}
#COND {cured message} {remove affliction}

there are to many afflcitons messages for the same cure messages
I have found that they do work quite well for multi-line affliction verifying

#Trigger {someone kicks you} {}
#Cond {Your leg is greatly damaged} {Cure damaged leg;Add affliction} {within|param=1}

Thye also work well in auto resets of balances

#ONINPUT "applyrest" {apply restoration} {#Var Applying 1}
#COND {} {#VAR Applying 0} {wait|param=1000}

#TRIGGER "appliedrest" {you apply restoration} {#VAR Applying 0;#VAR Salvebal 0;#STATE applyrest 0}
#COND {} {#VAR Salvebal 1} {wait|param=6000}

#TRIGGER {You may apply another salve} {#VAR Salvebal 0;#STATE appliedrest 0}
Reply with quote
Zinjin
Newbie


Joined: 02 Mar 2004
Posts: 6

PostPosted: Wed Mar 03, 2004 8:27 am   
 
Hmmm,
That almost works Pega,exept:
In the first line for the afflictiondetection variable, you listed two of the affliction messages. There are close to, if not more, than 100 or so such messages. I think I could buckle down and do the work, but I just wonder if that will work ok. I could add the plants to cure them in order in the afflictioncure variable.
Also, your balancedetection variable should probably trigger to the text 'You may eat another herb or plant', right?
If not, then I am way confused!

Serentus,
I am trying to figure out what those two leg damage scripts do exactly. At first glance, I though the last one would determine if you needed to apply another salve to your leg, and would do so when it sees the text, 'You may apply another salve', but I dont see where in the script it would know to apply, or not apply.
I'm Zmud challenged it appears! A little harder than the first glance gave me!
Thanks again for your time gentlemen. I appreciate it!
Reply with quote
Serentus
Apprentice


Joined: 28 Sep 2001
Posts: 103
Location: USA

PostPosted: Wed Mar 03, 2004 8:30 am   
 
The reason you didn't see the last one determining if you need another salve or not is because it's not there. What i posted was just some generic skeleton code.

If you want to check if you need another salve that is one place you could do it. depending on how you keep track of if you need another salve, when you heal, and stuff like that determines where you put thing. The way my system is I can't do it there. They way yours is, you may be able to.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
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