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
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Sat Jul 06, 2002 2:21 pm   

2 parter, damage trigger and eq swap
 
part 1)
i've been fighting with this format all day, and getting nowhere except frustrated :)
breath spells return damage as such:

Your blast of frost === OBLITERATES === a particle's head! [86]

i'm attempting to put === OBLITERATES === into its own variable to compare against a damage list (so immune mobs wont cause the trigger to re-cast), and failing dismally. everything i've dreamt up records "=== OBLITERATES === a". part of the problem i find is that there can be either 1 or 2 words for the body part taking damage (eg, "head" or "left bicep") which discounts word counting backwards from the number damage, and the mob typically has X amount of words in its name too. (for the rest of you code voyeurs, the damage trigger contains this code thus far, which works without the damage check. the code is breath-generic, allows recasting of gas/acid/lightning/fire as is, and tracks the casts to avoid spamming the mud and causing wizlogs on ROM based)


#add breath 1
#if ( @breath = 15) {
#var breath 0
disarm
#say Attempting disarm, spam trap!
}
#if (@mana < 100) {
kick
#say saving mana
#abort 1)
}
#if (@mana > 100)
#if (%1 == lightning) {cast 'lightning breath'} {cast '%1';#abort 1}

adding a victim variable via this trigger is also hoped for to let allowed people ask me where i am and i can reply with a basic tell %1 @victim :)
not asking for much, am i? ;)

part 2)
(opinion piece)
i'm also working on adding some comparisons to my prompt trigger to see if i should incrementally change equipment, which drops out at 400 mana when full damroll/hitroll eq is worn.
basic fragment:


#if (@mood = peaceful) {#abort 1}
#if (@eq > 0) {#abort 1}
#if ((@mana > 750) AND (@mana < 800) AND (@eq = 0)) {
get sceptre hole
wear sceptre
put tome hole
#add eq 1
}

@mood is written to several ways. spellup script changes it from peaceful to fightmode (brain fart there, lack of creativity). my mana eq script changes @mood to peaceful, and making a kill changes the mood to peaceful as well. anyway...is there a "better/more streamlined" way to achieve the changing of eq based on current mana and @mood/@eq, have i missed something? once everything's changed, @eq should have a value of 9, and there's a check for that value to abort the script so nothing goes haywire beyond that point. oh...is #alarm refreshable/deletable? i was thinking i'd add an alarm after every kick/breath to time out and change @mood back to peaceful, but only if i dont end up with a list of 400 #alarms ;)

Why oh WHY did I have pass door on...
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Jul 06, 2002 3:01 pm   
 
If you're having problems with the trigger phrase, why do you give us the entire script of the trigger EXCEPT the trigger phrase?

The easiest way would probably be to make a stringlist of damage-types, similar to what I did for breath-types. You can put these in variables if you want to keep the trigger phrase short.

#TR {Your blast of ({frost|gas|acid|lightning|fire}) (%*) a } {#VAR breathdamage {%2}}

You could probably use a stringlist for the body parts also. Otherwise, you won't be able to distinguish between the mobname and the bodypart, since either or both can be multi-word.

I'd recommend using the built-in Spam Protection (it's in Preferences under General).


LightBulb
Senior Member
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Jul 06, 2002 9:11 pm   
 
For the second question, I'm not sure I understand what you're doing. Based on the script fragment you provided, you will never change equipment while "peaceful", and you won't change equipment if @eq is greater than 0. This directly contradicts your explanation of what you intend the script to do.

Anyway, what I'd do is make a stringlist variable for each equipment set. By using variables, it will be easy to change what's in the equipment set when you get better stuff (or lose stuff). I realize you might not be able to hold everything at once, so EVERY list will need to be organized the same way and use null-values for empty slots. You'll also need to make sure there's always enough room to add one item to the container. Finally, you might need some tweaking for things like rings if you can wear more than one and for items that use the same name even though they are different.

#VAR eqtemplate {head|neck|torso|waist|legs|feet|ring1|ring2|weapon|shield}
#AL wearmana {#FORALL @eqtemplate {remove %item(@eqdrhr,%i);put %item(@eqdrhr,%i) hole; get %item(@eqmana,%i) hole;wear %item(@eqmana,%i)}

You'll need to define @eqdrhr and @eqmana
There's probably better ways of doing this, but that's what comes to mind.


LightBulb
Senior Member
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Sun Jul 07, 2002 1:09 am   
 
See the folly of writing while almost asleep? :) My other problem is i can rarely translate what's in my head into clear, concise ways, either spoken or written. Doh.

the trigger's command does what its supposed to if left to just recasting and then stopping when below 100 mana. what i've falling over at is adding a recording variable for the victim. i'll work on a body part list after i post this :)

as for the eq change, changing incrementally in a fight is easier on the eyes and allows better combat returns than a full change when i hit 400 mana. i dont want the eq to change while i'm peaceful, covers things like portalling, spelling people up etc etc. the fragment i showed has two spamtraps, #if (@eq > 0) {#abort 1} and #if ((@mana > 750) AND (@mana < 800) AND (@eq = 0)). the eq level (the changes occur at 50 less mana each) raises with each step of the script (#add eq 1), i discovered running without a logging variable will loop the step over and over until @mana drops to the next step. (which is #if ((@mana > 700) AND (@mana < 799) AND (@eq = 1)) ).
the eq question is something i've been dying to figure out for 18 months...my holy grail! seen it used, but the guys wont share the code. now i feel i'm getting somewhere, wonderin if i omitted something basic and obvious :)

anyway, time to head back to the saltmines

Why oh WHY did I have pass door on...
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Sun Jul 07, 2002 3:42 am   
 
oo...
Your blast of (%w) {misses|scratches|grazes|hits|injures|wounds|mauls|decimates|devastates|pulps|MUTILATES|FUBARS|CRIPPLES|MASSACRES|MANGLES|DEMOLISHES|EVISCERATES|=== OBLITERATES ===|ANNIHILATES|STOMPS|does UNSPEAKABLE} %3's {head|left hand|right hand|face|chest|left forearm|right forearm|right thigh|left thigh|left shin|right shin|left bicep|right bicep|left calf|right calf|midriff|left shoulder|right shoulder}! ~[%d~]$
achieves the task. why didnt i think of that in the first place? :)

Why oh WHY did I have pass door on...
edit: code tags removed
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Jul 07, 2002 5:09 am   
 
You don't really need those "code" tags in your last post do you? They prevent the forum from wordwrapping and now it's very hard to read since it's 4 screens wide. You can remove them using the "Edit Message" button (page w/pencil icon).

I completely misunderstood your intent on the second question, so you can probably scratch my entire response.

Now that I understand what you want (I think) I guess I'd do something like this:
#IF ((@mood = "fightmode") AND (@mana < 800) AND (@eq = 0)) {#ADD eq 1;get sceptre hole;wear sceptre;put tome hole}
with similar triggers for each of the remaining pieces you want to change. What I've done is combine all the #IF conditions and eliminated the "@mana < 750" condition. I figure you still want to change that even if your mana has dropped to 749. Since @eq will equal 1 after this trigger it shouldn't loop.

LightBulb
Senior Member
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Jul 07, 2002 9:24 am   
 
This is something I through together quickly. It covers your eq swapping. It uses a fixed length alarm that fires ever 5 seconds to preform the swaps. There is also a prototype trigger to detect when you actually have started to wear the new item.

Caveats:
If you rename the EQSet variables you will have to go through the script and fix the naming for swaps.
Both EQSet's are assumed to be matched! This means head gear goes in the same slot on each, keep it that way or you may end up oddly undressed.

Usage:
Put in good names for each piece of gear you want to swap. Improve the "You wear" trigger to be specific to your mud. Change colors on the EQ button to ones you like. Adjust the ALARM to whatever speed you want it to go. Then just press the EQ button whenever you want to swap, even works in the middle of swapping.

#CLASS {EQSwapper}
#VAR CurrentEQSet {HD}
#VAR OtherEQSet {Mana}
#VAR EQSwapped {0}
#VAR ManaEQSet {hat|parka}
#VAR HDEQSet {"cap"|"coat"}
#VAR LastEQSwapDone {1}
#BUTTON 1 {EQ} {ReverseSwapDirection=1;#T+ SwapActive} {} {} {@EQSwapped} {} {} {} {} {} {} {} {} {} {} {Gauge|11|10|%eval(%numitems(@ManaEQSet)+1)|1} {} "" {"Explore"|"Inset"} {} {EQSwap}
#CLASS 0

#CLASS {EQSwapper|SwapActive} {"disable"}
#ALARM *5 {#IF (@LastEQSwapDone) {#IF (@ReverseSwapDirection) {#IF (@CurrentEQSet="Mana") {#ADD EQSwapped -1} {#ADD EqSwapped 1};CurrentEQSet=@OtherEQSet;#IF (@CurrentEQSet="Mana") {OtherEQSet="HD"} {OtherEQSet="Mana"};ReverseSwapDirection=0};remove %item(@{@{CurrentEQSet}EQSet},@EQSwapped);wear %item(@{@{OtherEQSet}EQSet},@EQSwapped);LastEQSwapDone=0}}
#TRIGGER {You wear} {#IF (@LastEQSwapDone=0) {LastEQSwapDone=1;#IF (@CurrentEQSet="Mana") {#ADD EQSwapped 1} {#ADD EqSwapped -1};#IF ((@EQSwapped>%numitems(@ManaEQSet))|(@EQSwapped=0)) {#T- SwapActive}}}
#CLASS 0
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Mon Jul 08, 2002 8:05 am   
 
thanks for that last suggestion lightbulb, it took me some hard thinking to notice the difference in your copy, but now i look at it..it makes sense :)

vijilante...um
hmm :) mindboggling...havent installed it, trying to break it down into pieces i can absorb. does this change eq both fighting and healing? big boggle :)

Why oh WHY did I have pass door on...
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