 |
demingm Beginner
Joined: 27 May 2005 Posts: 23
|
Posted: Fri May 27, 2005 4:47 pm
Trigger/Alias/Capture Help |
First of all, bear with me as I'm a zmud scripting newbie. I have the basic concepts down for aliases, triggers, and whatnot, but I'm looking for suggestions for my latest little thing I'm working on for a mud I play. On this mud there is a spell called chain lightning, I'm guessing a few of you have seen it before because I think its on a lot of ROM type muds. Basically how the spell works when cast upon a target, it was cause damage and arc to any other valid targets in the room and cause them damage. Typical output might look like this:
You cast chain lightning on a demon.
Your lightning <<<ANNIHILATES>>> a demon!
The lightning arcs to a vampire.
Your lightning -=OBLITERATES=- a vampire!
The lightning arcs to a demon.
Your lightning devastates a demon!
The lightning arcs to a vampire.
Your lightning grazes a vampire!
This is just a small example, it usually bounces many more times than this, and can hit more than two targets, and even yourself if there is only one valid target in the room. Now, I already have this one script going that someone from my mud created that takes all damages and puts a number equivalent next to them, and I have gagged the lines that shows the lightning arcing to another target. So what I have now looks something like this:
You cast chain lightning on a demon.
Your lightning <<<ANNIHILATES>>> a demon! (100 - 150)
Your lightning -=OBLITERATES=- a vampire! (65 - 85)
Your lightning devastates a demon! (35 - 45)
Your lightning grazes a vampire! (10 - 15)
So, what I want to do is, try to somehow capture this text, and combine the damages that correspond to the same monster, so I get this instead:
You cast chain lightning on a demon.
Your lightning DESTROYS a demon! (150-185)
Your lightning <<<ANNIHILATES>>> a vampire! (100 - 150)
I've tried looking at this guys script and figuring out a way to incorporate this into it, but I can't figure it out. If someone thinks it might help I can post the script and someone could take a look at it. The reason why I'm trying to make this work is because this mud is PK oriented, and there tends to be a lot of battlespam, especially when you have some group pk and there is a few people using this spell. I'm trying to minimize combat rounds to the least amount of info as possible so I can see whats going on easier. I know this is sorta an out there question but I really want to learn how to do this. Any help will be appreciated, even if its just point me in the right directions. Thanks. |
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4769 Location: Pensacola, FL, USA
|
Posted: Fri May 27, 2005 5:01 pm |
#SUB
|
|
_________________ Discord: Shalimarwildcat |
|
|
 |
DeathDealer Adept

Joined: 20 Jul 2004 Posts: 268
|
Posted: Fri May 27, 2005 8:01 pm |
Not sure how #sub works in this case.
I've been thinking of something like this as well, but haven't been able to figure it out.
Can you elaborate on that Shalimar? |
|
_________________
 |
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4769 Location: Pensacola, FL, USA
|
Posted: Fri May 27, 2005 8:51 pm |
#TR {(Your * %w!)} {#IF (%pos("ANNIHILATES", "%1")) {#SUB {%1 (100 - 150)}};#IF (%pos("OBLITERATES", "%1")) {#SUB {%1 (65-85)}};#IF (%pos("devastates ", "%1")) {#SUB {%1 (35 - 45)}};#IF (%pos("grazes", "%1")) {#SUB {%1 (10 - 15)}}}
|
|
_________________ Discord: Shalimarwildcat |
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4769 Location: Pensacola, FL, USA
|
Posted: Fri May 27, 2005 10:24 pm |
Oh i see what you mean, my mistake for recreating what you already had... try something like
#TR {{annihilates|obliterates|devestates|grazes}* (*)! ~((%d)-(%d)~)} {
#VAR temp {%replace( %1, " ", "_")}
#VAR temp2 {@@temp}
#IF (%null( @temp2)) {
#VAR @temp {Min=%2|Max=%3}
} {
#ADDKEY @temp Max %eval(@temp.Max+%3)
#ADDKEY @temp Min %eval(@temp.Min+%2)
}
#IF (%ismember( @temp, @smitings)) {} {#VAR smitings {%additem( @temp, @smitings)}}
}
Too show what all you have damaged:
#ALIAS showdam {#FOR @smitings {#EC %i;#showdb @%i}}
And to reset:
#ALIAS resetdam {#FOR @smitings {#ADDKEY %i {Min|Max} {0};#VAR smitings {}}
I dont think i left out anything...
Not quite what you wanted since im not sure what message it gives when the spell is over.. but the output you want could easily be made on a trigger off of that as well |
|
_________________ Discord: Shalimarwildcat |
|
|
 |
DeathDealer Adept

Joined: 20 Jul 2004 Posts: 268
|
Posted: Sat May 28, 2005 12:45 am |
since demingm is talking about reducing battlespam, i'm pretty sure that your way don't do that, and since u have an alias you might be thinking that demingm wants a total or something.
What i THINK demingm wants is rather than see this during the fight:
Your lightning <<<ANNIHILATES>>> a demon! (100 - 150)
Your lightning -=OBLITERATES=- a vampire! (65 - 85)
Your lightning devastates a demon! (35 - 45)
Your lightning grazes a vampire! (10 - 15)
THIS is shown instead during the fight:
Your lightning DESTROYS a demon! (150-185)
Your lightning <<<ANNIHILATES>>> a vampire! (100 - 150)
Basically, an info gather, an adder and a subber :-)
from 4 lines of battle to 2.
Of course I could be wrong, but don't think i am in this case. |
|
_________________
 |
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Sat May 28, 2005 1:03 am |
The first true problem I see to this concept is that your are operating on a ROM based mud. If you have five vampires, all in the same room, then your chain lightning will arc betwixt all 5; and every single one will have the same text. There is no true way to tell which vampire was hit by any specific arc. Other then that I believe Shalimar is on the right track for what you want.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4769 Location: Pensacola, FL, USA
|
Posted: Sat May 28, 2005 2:56 am |
add a gag to my trigger above and you have no battle output at all
like i said, the message signifying the spells end would then fire a trigger to display what all you want in whichever format is desired for the damage ranges (i assume such messages would be based off the mean of your damage range)
#TR {ending spell message} {#FOR @smitings {
#IF (RangeAMin <= %eval((@%i.Min+@%i.Max)/2) <= RangeAMax) {#VAR damagetemp {You MessageA the %replace(%i, "_", " ") (@%i.Min-@%i.Max)}}
#IF (RangeBMin <= %eval((@%i.Min+@%i.Max)/2) <= RangeBMax) {#VAR damagetemp {You MessageB the %replace(%i, "_", " ") (@%i.Min-@%i.Max)}}
#EC @damagetemp
}
Extended to fill all the possibilities. |
|
_________________ Discord: Shalimarwildcat |
|
|
 |
DeathDealer Adept

Joined: 20 Jul 2004 Posts: 268
|
Posted: Sat May 28, 2005 3:40 am |
ah, i see.
if there is no ending spell msg, then maybe the prompt will be good enuf?
dunno if ya helped demingm, but i think ya helped me :-) |
|
_________________
 |
|
|
 |
demingm Beginner
Joined: 27 May 2005 Posts: 23
|
Posted: Sat May 28, 2005 1:44 pm |
Just to respond to a few posts so I don't appear as ungrateful First, you were right DeathDealer, I wanted to replace 4 lines with 2 (In actuality its a whole lot more than 4 to begin with, i just used 4 to simplify my example). Vijilante, I thought of your issue and thats ok to me. To be honest I don't care so much about this when fighting mobs, its when I fight other people (who will never have the same name for the most part) that I want it for. Shalimar, I'm going to try and implement your stuff and change it to fit the text from my mud. Thanks for the help and I hope I can get it to work. As I said I'm a newb when it comes to this so just by looking at what you did I'm a little lost. But I think I'll get it to work after a few tries. Thanks!
|
|
|
 |
|
|